diff --git a/externals/ggee/filters/hlshelf.c b/externals/ggee/filters/hlshelf.c index 7cf99c59cfde22f94e19211adeb6c72947ef339a..511f7e616db340a466b9d01c60bee75750075326 100644 --- a/externals/ggee/filters/hlshelf.c +++ b/externals/ggee/filters/hlshelf.c @@ -177,15 +177,17 @@ void hlshelf_float(t_hlshelf *x,t_floatarg f) static void *hlshelf_new(t_symbol* s,t_int argc, t_atom* at) { t_hlshelf *x = (t_hlshelf *)pd_new(hlshelf_class); - t_float k0 = atom_getfloat(at); - t_float k1 = atom_getfloat(at+1); - t_float k2 = atom_getfloat(at+2); - t_float f1 = atom_getfloat(at+3); - t_float f2 = atom_getfloat(at+4); - - - f1 = atom_getfloat(at); - f2 = atom_getfloat(at); + t_float k0 = argc ? atom_getfloatarg(0, argc--, at++) : 0; + t_float k1 = argc ? atom_getfloatarg(0, argc--, at++) : 0; + t_float k2 = argc ? atom_getfloatarg(0, argc--, at++) : 0; + t_float f1 = argc ? atom_getfloatarg(0, argc--, at++) : 0; + t_float f2 = argc ? atom_getfloatarg(0, argc--, at++) : 0; + + /* For some reason f1 and f2 got set to the original value + of at[0] below. Not sure why. Anyway, I just set them to + k0 which should be functionally equivalent. */ + f1 = k0; + f2 = k0; if ((f1 == 0.0f && f2 == 0.0f) || f1 > f2){ /* all gains = 0db */ f1 = 150.0f; diff --git a/externals/mrpeach/str/str.c b/externals/mrpeach/str/str.c index 0e4d7e957164160e24ba28e90699244fb7f85c77..00b9695983e15c04d09c9b7f11b4dc89b2d682ce 100644 --- a/externals/mrpeach/str/str.c +++ b/externals/mrpeach/str/str.c @@ -35,7 +35,7 @@ static void *str_new(t_symbol *s, int argc, t_atom *argv) void str_setup(void) { - str_class = class_new(gensym("str"), (t_newmethod)str_new, 0, sizeof(t_str), 0, 0); + str_class = class_new(gensym("str"), (t_newmethod)str_new, 0, sizeof(t_str), 0, A_GIMME, 0); } #else //ifndef PD_BLOBS /* Make a _real_ str object: */ @@ -687,7 +687,7 @@ static void *str_new(t_symbol *s, int argc, t_atom *argv) x->x_function = 0; /* default = string */ x->x_nsplit = 0L; next = 0; /* index of next argument */ - if (argv[0].a_type == A_SYMBOL) + if (argc && argv[0].a_type == A_SYMBOL) { /* the first argument may be a selector */ atom_string(&argv[0], (char *)x->x_buf.s_data, MAXPDSTRING); for (i = 0; i < n_functions; ++i)