From e7acc4796b655100b650f898bb10687fb9f7355d Mon Sep 17 00:00:00 2001 From: Ivica Ico Bukvic <ico@vt.edu> Date: Thu, 28 Feb 2013 13:20:03 -0500 Subject: [PATCH] implemented improvement for empty lists as suggested by IOhannes http://lists.puredata.info/pipermail/pd-list/2013-02/101518.html --- pd/src/m_class.c | 4 ++-- pd/src/x_connective.c | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pd/src/m_class.c b/pd/src/m_class.c index 1dd0c9f9e..9fc05fc2f 100644 --- a/pd/src/m_class.c +++ b/pd/src/m_class.c @@ -142,9 +142,9 @@ static void pd_defaultlist(t_pd *x, t_symbol *s, int argc, t_atom *argv) /* if the object is patchable (i.e., can have proper inlets) send it on to obj_list which will unpack the list into the inlets */ - else if ((*x)->c_patchable) + else if (argc>0 && (*x)->c_patchable) obj_list((t_object *)x, s, argc, argv); - /* otherwise gove up and complain. */ + /* otherwise give up and complain. */ else pd_defaultanything(x, &s_list, argc, argv); } diff --git a/pd/src/x_connective.c b/pd/src/x_connective.c index 94214a7a9..90df22ec0 100644 --- a/pd/src/x_connective.c +++ b/pd/src/x_connective.c @@ -1063,6 +1063,8 @@ static void trigger_list(t_trigger *x, t_symbol *s, int argc, t_atom *argv) else if (u->u_type == TR_SYMBOL) outlet_symbol(u->u_outlet, (argc ? atom_getsymbol(argv) : &s_symbol)); + else if (u->u_type == TR_ANYTHING) + outlet_anything(u->u_outlet, s, argc, argv); else if (u->u_type == TR_POINTER) { if (!argc || argv->a_type != TR_POINTER) @@ -1105,28 +1107,28 @@ static void trigger_anything(t_trigger *x, t_symbol *s, int argc, t_atom *argv) static void trigger_bang(t_trigger *x) { - trigger_list(x, 0, 0, 0); + trigger_list(x, &s_bang, 0, 0); } static void trigger_pointer(t_trigger *x, t_gpointer *gp) { t_atom at; SETPOINTER(&at, gp); - trigger_list(x, 0, 1, &at); + trigger_list(x, &s_pointer, 1, &at); } static void trigger_float(t_trigger *x, t_float f) { t_atom at; SETFLOAT(&at, f); - trigger_list(x, 0, 1, &at); + trigger_list(x, &s_float, 1, &at); } static void trigger_symbol(t_trigger *x, t_symbol *s) { t_atom at; SETSYMBOL(&at, s); - trigger_list(x, 0, 1, &at); + trigger_list(x, &s_symbol, 1, &at); } static void trigger_free(t_trigger *x) -- GitLab