Skip to content
Snippets Groups Projects
Commit b02fceba authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

make mrpeach objects instantiate without arguments

parent 0fdcd2a4
No related branches found
No related tags found
3 merge requests!114External tests,!113WIP: External tests revised,!110WIP: External tests
Pipeline #
...@@ -670,7 +670,17 @@ static void *udpreceive_tilde_new(t_symbol *s, int argc, t_atom *argv) ...@@ -670,7 +670,17 @@ static void *udpreceive_tilde_new(t_symbol *s, int argc, t_atom *argv)
{ {
t_udpreceive_tilde *x; t_udpreceive_tilde *x;
int i, j = 0, portno = 0, outlets = 0, blocksize = 0; int i, j = 0, portno = 0, outlets = 0, blocksize = 0;
t_atom sane_defaults[2];
if (!argc)
{
post("udpreceive~: warning: no arguments provided: defaulting to "
"[updreceive~ 0]");
SETFLOAT(sane_defaults, 0.);
SETFLOAT(sane_defaults+1, 1.);
argc = 2;
argv = sane_defaults;
}
x = (t_udpreceive_tilde *)pd_new(udpreceive_tilde_class); x = (t_udpreceive_tilde *)pd_new(udpreceive_tilde_class);
if (NULL == x) return NULL; if (NULL == x) return NULL;
......
...@@ -840,6 +840,11 @@ static void *udpsend_tilde_new(t_floatarg inlets, t_floatarg blocksize) ...@@ -840,6 +840,11 @@ static void *udpsend_tilde_new(t_floatarg inlets, t_floatarg blocksize)
t_udpsend_tilde *x = (t_udpsend_tilde *)pd_new(udpsend_tilde_class); t_udpsend_tilde *x = (t_udpsend_tilde *)pd_new(udpsend_tilde_class);
if (x) if (x)
{ {
if (inlets < 1.)
{
post("udpsend~: warning: no inlet argument given: defaulting to 1");
inlets = 1.;
}
for (i = sizeof(t_object); i < (int)sizeof(t_udpsend_tilde); i++) for (i = sizeof(t_object); i < (int)sizeof(t_udpsend_tilde); i++)
((char *)x)[i] = 0; ((char *)x)[i] = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment