Commit dc897de6 authored by Albert Gräf's avatar Albert Gräf
Browse files

Backported vanilla commit 67b3095a by Ant1r: Fix the way signal scalars are...

Backported vanilla commit 67b3095a by Ant1r: Fix the way signal scalars are searched into the list of inlets of an object.
parent 65e3cfab
...@@ -752,21 +752,18 @@ int obj_issignaloutlet(t_object *x, int m) ...@@ -752,21 +752,18 @@ int obj_issignaloutlet(t_object *x, int m)
t_float *obj_findsignalscalar(t_object *x, int m) t_float *obj_findsignalscalar(t_object *x, int m)
{ {
int n = 0;
t_inlet *i; t_inlet *i;
if (x->ob_pd->c_firstin && x->ob_pd->c_floatsignalin) if (x->ob_pd->c_firstin && x->ob_pd->c_floatsignalin)
{ {
if (!m--) if (!m--)
return (x->ob_pd->c_floatsignalin > 0 ? return (x->ob_pd->c_floatsignalin > 0 ?
(t_float *)(((char *)x) + x->ob_pd->c_floatsignalin) : 0); (t_float *)(((char *)x) + x->ob_pd->c_floatsignalin) : 0);
n++;
} }
for (i = x->ob_inlet; i; i = i->i_next, m--) for (i = x->ob_inlet; i; i = i->i_next)
if (i->i_symfrom == &s_signal) if (i->i_symfrom == &s_signal)
{ {
if (m == 0) if (m-- == 0)
return (&i->i_un.iu_floatsignalvalue); return (&i->i_un.iu_floatsignalvalue);
n++;
} }
return (0); return (0);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment