diff --git a/apps/plugins/pdbox/PDa/src/g_canvas.c b/apps/plugins/pdbox/PDa/src/g_canvas.c index 1ac783ce67..8f3626008e 100644 --- a/apps/plugins/pdbox/PDa/src/g_canvas.c +++ b/apps/plugins/pdbox/PDa/src/g_canvas.c @@ -58,9 +58,9 @@ struct _canvasenvironment extern t_pd *newest; t_class *canvas_class; -static int canvas_dspstate; /* whether DSP is on or off */ -t_canvas *canvas_editing; /* last canvas to start text edting */ -t_canvas *canvas_whichfind; /* last canvas we did a find in */ +static int canvas_dspstate; /* whether DSP is on or off */ +t_canvas *canvas_editing; /* last canvas to start text edting */ +t_canvas *canvas_whichfind; /* last canvas we did a find in */ t_canvas *canvas_list; /* list of all root canvases */ /* ------------------ forward function declarations --------------- */ @@ -255,7 +255,7 @@ void canvas_makefilename(t_canvas *x, char *file, char *result, int resultsize) strcat(result, "/"); strncat(result, file, nleft); result[resultsize-1] = 0; - } + } } void canvas_rename(t_canvas *x, t_symbol *s, t_symbol *dir) @@ -345,7 +345,7 @@ t_outconnect *linetraverser_next(t_linetraverser *t) t->tr_x21 = t->tr_y21 = t->tr_x22 = t->tr_y22 = 0; t->tr_lx1 = t->tr_ly1 = t->tr_lx2 = t->tr_ly2 = 0; } - + return (rval); } @@ -435,7 +435,7 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv) x->gl_y2 = 1; canvas_setbounds(x, xloc, yloc, xloc + width, yloc + height); x->gl_owner = owner; - x->gl_name = (*s->s_name ? s : + x->gl_name = (*s->s_name ? s : (canvas_newfilename ? canvas_newfilename : gensym("Pd"))); if (strcmp(x->gl_name->s_name, "Pd")) pd_bind(&x->gl_pd, canvas_makebindsym(x->gl_name)); @@ -552,14 +552,14 @@ void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv) #ifdef ROCKBOX (void) s; #endif - t_symbol *sym = atom_getsymbolarg(0, argc, argv); - float x1 = atom_getfloatarg(1, argc, argv); - float y1 = atom_getfloatarg(2, argc, argv); - float x2 = atom_getfloatarg(3, argc, argv); - float y2 = atom_getfloatarg(4, argc, argv); - float px1 = atom_getfloatarg(5, argc, argv); - float py1 = atom_getfloatarg(6, argc, argv); - float px2 = atom_getfloatarg(7, argc, argv); + t_symbol *sym = atom_getsymbolarg(0, argc, argv); + float x1 = atom_getfloatarg(1, argc, argv); + float y1 = atom_getfloatarg(2, argc, argv); + float x2 = atom_getfloatarg(3, argc, argv); + float y2 = atom_getfloatarg(4, argc, argv); + float px1 = atom_getfloatarg(5, argc, argv); + float py1 = atom_getfloatarg(6, argc, argv); + float px2 = atom_getfloatarg(7, argc, argv); float py2 = atom_getfloatarg(8, argc, argv); glist_addglist(g, sym, x1, y1, x2, y2, px1, py1, px2, py2); } @@ -582,7 +582,7 @@ static void canvas_setbounds(t_canvas *x, int x1, int y1, int x2, int y2) x->gl_screenx2 = x2; x->gl_screeny2 = y2; /* post("set bounds %d %d %d %d", x1, y1, x2, y2); */ - if (!glist_isgraph(x) && (x->gl_y2 < x->gl_y1)) + if (!glist_isgraph(x) && (x->gl_y2 < x->gl_y1)) { /* if it's flipped so that y grows upward, fix so that zero is bottom edge and redraw. This is @@ -623,14 +623,14 @@ void canvas_reflecttitle(t_canvas *x) break; if (i != 0) strcat(namebuf, " "); - atom_string(&env->ce_argv[i], namebuf + strlen(namebuf), + atom_string(&env->ce_argv[i], namebuf + strlen(namebuf), MAXPDSTRING/2); } strcat(namebuf, ")"); } else namebuf[0] = 0; #ifndef ROCKBOX - sys_vgui("wm title .x%x {%s%c%s - %s}\n", + sys_vgui("wm title .x%x {%s%c%s - %s}\n", x, x->gl_name->s_name, (x->gl_dirty? '*' : ' '), namebuf, canvas_getdir(x)->s_name); #endif @@ -730,7 +730,7 @@ static void editor_free(t_editor *x, t_glist *y) freebytes((void *)x, sizeof(*x)); } - /* recursively create or destroy all editors of a glist and its + /* recursively create or destroy all editors of a glist and its sub-glists, as long as they aren't toplevels. */ void canvas_create_editor(t_glist *x, int createit) { @@ -788,7 +788,7 @@ void canvas_vis(t_canvas *x, t_floatarg f) #ifndef ROCKBOX sys_vgui("raise .x%x\n", x); sys_vgui("focus .x%x.c\n", x); - sys_vgui("wm deiconify .x%x\n", x); + sys_vgui("wm deiconify .x%x\n", x); #endif /* ROCKBOX */ #endif } @@ -809,8 +809,10 @@ void canvas_vis(t_canvas *x, t_floatarg f) } else /* make invisible */ { +#ifndef ROCKBOX int i; t_canvas *x2; +#endif if (!x->gl_havewindow) { /* bug workaround -- a graph in a visible patch gets "invised" @@ -828,10 +830,8 @@ void canvas_vis(t_canvas *x, t_floatarg f) canvas_create_editor(x, 0); #ifndef ROCKBOX sys_vgui("destroy .x%x\n", x); -#endif for (i = 1, x2 = x; x2; x2 = x2->gl_next, i++) - ; -#ifndef ROCKBOX + ; sys_vgui(".mbar.find delete %d\n", i); #endif /* if we're a graph on our parent, and if the parent exists @@ -858,7 +858,7 @@ void glist_menu_open(t_glist *x) if (glist_isvisible(x) && !glist_istoplevel(x)) { t_glist *gl2 = x->gl_owner; - if (!gl2) + if (!gl2) bug("canvas_vis"); /* shouldn't happen but don't get too upset. */ else { @@ -936,7 +936,7 @@ static void canvas_drawlines(t_canvas *x) #else /* ROCKBOX */ sys_vgui(".x%x.c create line %d %d %d %d -width %d -tags l%x\n", glist_getcanvas(x), - t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2, + t.tr_lx1, t.tr_ly1, t.tr_lx2, t.tr_ly2, (outlet_getsymbol(t.tr_outlet) == &s_signal ? 2:1), oc); #endif /* ROCKBOX */ @@ -1052,7 +1052,7 @@ void canvas_restore(t_canvas *x, t_symbol *s, int argc, t_atom *argv) { t_canvasenvironment *e = canvas_getenv(canvas_getcurrent()); canvas_rename(x, binbuf_realizedollsym(ap->a_w.w_symbol, - e->ce_argc, e->ce_argv, 1), 0); + e->ce_argc, e->ce_argv, 1), 0); } else if (ap->a_type == A_SYMBOL) canvas_rename(x, argv[3].a_w.w_symbol, 0); @@ -1238,13 +1238,13 @@ static void *table_new(t_symbol *s, t_floatarg f) if (s == &s_) { char tabname[255]; - t_symbol *t = gensym("table"); + t_symbol *t = gensym("table"); #ifdef ROCKBOX snprintf(tabname, sizeof(tabname), "%s%d", t->s_name, tabcount++); #else /* ROCKBOX */ sprintf(tabname, "%s%d", t->s_name, tabcount++); #endif /* ROCKBOX */ - s = gensym(tabname); + s = gensym(tabname); } if (f <= 1) f = 100; @@ -1264,7 +1264,7 @@ static void *table_new(t_symbol *s, t_floatarg f) graph_array(gl, s, &s_float, f, 0); - canvas_pop(x, 0); + canvas_pop(x, 0); return (x); } @@ -1337,7 +1337,7 @@ static void canvas_dodsp(t_canvas *x, int toplevel, t_signal **sp) t_gobj *y; t_object *ob; t_symbol *dspsym = gensym("dsp"); - t_dspcontext *dc; + t_dspcontext *dc; /* create a new "DSP graph" object to use in sorting this canvas. If we aren't toplevel, there are already other dspcontexts around. */ @@ -1347,7 +1347,7 @@ static void canvas_dodsp(t_canvas *x, int toplevel, t_signal **sp) obj_nsigoutlets(&x->gl_obj)); /* find all the "dsp" boxes and add them to the graph */ - + for (y = x->gl_list; y; y = y->g_next) if ((ob = pd_checkobject(&y->g_pd)) && zgetfn(&y->g_pd, dspsym)) ugen_add(dc, ob); @@ -1371,10 +1371,10 @@ static void canvas_start_dsp(void) else sys_gui("pdtk_pd_dsp ON\n"); #endif ugen_start(); - + for (x = canvas_list; x; x = x->gl_next) canvas_dodsp(x, 1, 0); - + canvas_dspstate = 1; } @@ -1447,7 +1447,7 @@ void glist_redrawitem(t_glist *owner, t_gobj *gobj) } } - /* redraw all "scalars" (do this if a drawing command is changed.) + /* redraw all "scalars" (do this if a drawing command is changed.) LATER we'll use the "template" information to select which ones we redraw. */ static void glist_redrawall(t_glist *gl) @@ -1602,4 +1602,3 @@ void g_canvas_setup(void) g_editor_setup(); g_readwrite_setup(); } - diff --git a/apps/plugins/pdbox/PDa/src/g_template.c b/apps/plugins/pdbox/PDa/src/g_template.c index f2770d4d5f..62cccbe252 100644 --- a/apps/plugins/pdbox/PDa/src/g_template.c +++ b/apps/plugins/pdbox/PDa/src/g_template.c @@ -129,7 +129,7 @@ t_template *template_new(t_symbol *templatesym, int argc, t_atom *argv) x->t_vec[oldn].ds_type = newtype; x->t_vec[oldn].ds_name = newname; x->t_vec[oldn].ds_arraytemplate = newarraytemplate; - bad: + bad: argc -= 2; argv += 2; } if (templatesym->s_name) @@ -188,7 +188,7 @@ t_float template_getfloat(t_template *x, t_symbol *fieldname, t_word *wp, return (fixtof(val)); } -void template_setfloat(t_template *x, t_symbol *fieldname, t_word *wp, +void template_setfloat(t_template *x, t_symbol *fieldname, t_word *wp, t_float f, int loud) { int onset, type; @@ -222,7 +222,7 @@ t_symbol *template_getsymbol(t_template *x, t_symbol *fieldname, t_word *wp, return (val); } -void template_setsymbol(t_template *x, t_symbol *fieldname, t_word *wp, +void template_setsymbol(t_template *x, t_symbol *fieldname, t_word *wp, t_symbol *s, int loud) { int onset, type; @@ -248,7 +248,7 @@ int template_match(t_template *x1, t_template *x2) return (0); for (i = x2->t_n; i < x1->t_n; i++) { - if (x1->t_vec[i].ds_type == DT_ARRAY || + if (x1->t_vec[i].ds_type == DT_ARRAY || x1->t_vec[i].ds_type == DT_LIST) return (0); } @@ -266,10 +266,10 @@ int template_match(t_template *x1, t_template *x2) in their template. The old template is assumed to be the "installed" one so we can delete old items; but making new ones we have to avoid scalar_new which would make an old one whereas we will want a new one (but whose array -elements might still be old ones. +elements might still be old ones. LATER deal with graphics updates too... */ - /* conform the word vector of a scalar to the new template */ + /* conform the word vector of a scalar to the new template */ static void template_conformwords(t_template *tfrom, t_template *tto, int *conformaction, t_word *wfrom, t_word *wto) { @@ -322,7 +322,7 @@ static t_scalar *template_conformscalar(t_template *tfrom, t_template *tto, template_conformwords(tfrom, tto, conformaction, scfrom->sc_vec, x->sc_vec); - + /* replace the old one with the new one in the list */ if (glist->gl_list == &scfrom->sc_gobj) { @@ -358,7 +358,7 @@ static t_scalar *template_conformscalar(t_template *tfrom, t_template *tto, } else if (ds->ds_type == DT_ARRAY) { - template_conformarray(tfrom, tto, conformaction, + template_conformarray(tfrom, tto, conformaction, x->sc_vec[i].w_array); } } @@ -411,7 +411,7 @@ static void template_conformglist(t_template *tfrom, t_template *tto, } } - /* globally conform all scalars from one template to another */ + /* globally conform all scalars from one template to another */ void template_conform(t_template *tfrom, t_template *tto) { int nto = tto->t_n, nfrom = tfrom->t_n, i, j, @@ -479,7 +479,7 @@ t_template *template_findbyname(t_symbol *s) t_canvas *template_findcanvas(t_template *template) { t_gtemplate *gt; - if (!template) + if (!template) bug("template_findcanvas"); if (!(gt = template->t_list)) return (0); @@ -551,12 +551,12 @@ static void template_setup(void) sizeof(t_template), CLASS_PD, 0); class_addmethod(pd_canvasmaker, (t_method)template_usetemplate, gensym("struct"), A_GIMME, 0); - + } /* ---------------- gtemplates. One per canvas. ----------- */ -/* this is a "text" object that searches for, and if necessary creates, +/* this is a "text" object that searches for, and if necessary creates, a "template" (above). Other objects in the canvas then can give drawing instructions for the template. The template doesn't go away when the gtemplate is deleted, so that you can replace it with @@ -819,7 +819,7 @@ static void *curve_new(t_symbol *classsym, t_int argc, t_atom *argv) classname += 6; flags |= CLOSED; if (argc) fielddesc_setfloatarg(&x->x_fillcolor, argc--, argv++); - else FIELDDESC_SETFLOAT(&x->x_outlinecolor, 0); + else FIELDDESC_SETFLOAT(&x->x_outlinecolor, 0); } else classname += 4; if (classname[0] == 'c') flags |= BEZ; @@ -863,7 +863,7 @@ static void curve_getrect(t_gobj *z, t_glist *glist, *xp1 = x1; *yp1 = y1; *xp2 = x2; - *yp2 = y2; + *yp2 = y2; } static void curve_displace(t_gobj *z, t_glist *glist, @@ -939,20 +939,23 @@ static void numbertocolor(int n, char *s) #endif } -static void curve_vis(t_gobj *z, t_glist *glist, +static void curve_vis(t_gobj *z, t_glist *glist, t_word *data, t_template *template, float basex, float basey, int vis) { t_curve *x = (t_curve *)z; - int i, n = x->x_npoints; + int n = x->x_npoints; +#ifndef ROCKBOX + int i; t_fielddesc *f = x->x_vec; +#endif #ifdef ROCKBOX (void) glist; (void) basex; (void) basey; #endif - + if (vis) { if (n > 1) @@ -981,18 +984,14 @@ static void curve_vis(t_gobj *z, t_glist *glist, #ifndef ROCKBOX else sys_vgui(".x%x.c create line\\\n", glist_getcanvas(glist)); -#endif for (i = 0, f = x->x_vec; i < n; i++, f += 2) { -#ifndef ROCKBOX float xloc = glist_xtopixels(glist, basex + fielddesc_getfloat(f, template, data, 1)); float yloc = glist_ytopixels(glist, basey + fielddesc_getfloat(f+1, template, data, 1)); sys_vgui("%d %d\\\n", (int)xloc, (int)yloc); -#endif } -#ifndef ROCKBOX sys_vgui("-width %f\\\n", fielddesc_getfloat(&x->x_width, template, data, 1)); if (flags & CLOSED) sys_vgui("-fill %s -outline %s\\\n", @@ -1008,7 +1007,7 @@ static void curve_vis(t_gobj *z, t_glist *glist, { #ifndef ROCKBOX if (n > 1) sys_vgui(".x%x.c delete curve%x\n", - glist_getcanvas(glist), data); + glist_getcanvas(glist), data); #endif } } @@ -1038,7 +1037,7 @@ static void curve_motion(void *z, t_floatarg dx, t_floatarg dy) { template_setfloat(curve_motion_template, f->fd_un.fd_varsym, - curve_motion_wp, + curve_motion_wp, curve_motion_xbase + curve_motion_xcumulative * curve_motion_xper, 1); } @@ -1046,14 +1045,14 @@ static void curve_motion(void *z, t_floatarg dx, t_floatarg dy) { template_setfloat(curve_motion_template, (f+1)->fd_un.fd_varsym, - curve_motion_wp, + curve_motion_wp, curve_motion_ybase + curve_motion_ycumulative * curve_motion_yper, 1); } glist_redrawitem(curve_motion_glist, curve_motion_gobj); } -static int curve_click(t_gobj *z, t_glist *glist, +static int curve_click(t_gobj *z, t_glist *glist, t_scalar *sc, t_template *template, float basex, float basey, int xpix, int ypix, int shift, int alt, int dbl, int doit) { @@ -1198,7 +1197,7 @@ static void *plot_new(t_symbol *classsym, t_int argc, t_atom *argv) /* get everything we'll need from the owner template of the array being plotted. Not used for garrays, but see below */ static int plot_readownertemplate(t_plot *x, - t_word *data, t_template *ownertemplate, + t_word *data, t_template *ownertemplate, t_symbol **elemtemplatesymp, t_array **arrayp, float *linewidthp, float *xlocp, float *xincp, float *ylocp) { @@ -1250,7 +1249,7 @@ int array_getfields(t_symbol *elemtemplatesym, t_canvas *elemtemplatecanvas = 0; /* the "float" template is special in not having to have a canvas; - template_findbyname is hardwired to return a predefined + template_findbyname is hardwired to return a predefined template. */ if (!(elemtemplate = template_findbyname(elemtemplatesym))) @@ -1266,13 +1265,13 @@ int array_getfields(t_symbol *elemtemplatesym, } elemsize = elemtemplate->t_n * sizeof(t_word); if (!template_find_field(elemtemplate, gensym("y"), &yonset, &type, &dummy) - || type != DT_FLOAT) + || type != DT_FLOAT) yonset = -1; if (!template_find_field(elemtemplate, gensym("x"), &xonset, &type, &dummy) - || type != DT_FLOAT) + || type != DT_FLOAT) xonset = -1; if (!template_find_field(elemtemplate, gensym("w"), &wonset, &type, &dummy) - || type != DT_FLOAT) + || type != DT_FLOAT) wonset = -1; /* fill in slots for return values */ @@ -1300,7 +1299,7 @@ static void plot_getrect(t_gobj *z, t_glist *glist, int i; float xpix, ypix, wpix; - if (!plot_readownertemplate(x, data, template, + if (!plot_readownertemplate(x, data, template, &elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc) && !array_getfields(elemtemplatesym, &elemtemplatecanvas, &elemtemplate, &elemsize, &xonset, &yonset, &wonset)) @@ -1376,7 +1375,7 @@ static void plot_activate(t_gobj *z, t_glist *glist, /* not yet */ } -static void plot_vis(t_gobj *z, t_glist *glist, +static void plot_vis(t_gobj *z, t_glist *glist, t_word *data, t_template *template, float basex, float basey, int vis) { @@ -1389,7 +1388,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, t_array *array; int nelem; char *elem; - if (plot_readownertemplate(x, data, template, + if (plot_readownertemplate(x, data, template, &elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc) || array_getfields(elemtemplatesym, &elemtemplatecanvas, &elemtemplate, &elemsize, &xonset, &yonset, &wonset)) @@ -1397,7 +1396,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, nelem = array->a_n; elem = (char *)array->a_vec; if (vis) - { + { char outline[20]; int lastpixel = -1, ndrawn = 0; float xsum, yval = 0, xpix; @@ -1417,7 +1416,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, sys_vgui(".x%x.c create polygon \\\n", glist_getcanvas(glist)); #endif - + for (i = 0, xsum = xloc; i < nelem; i++) { float usexloc; @@ -1538,7 +1537,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, /* We're done with the outline; now draw all the points. This code is inefficient since the template has to be searched for drawing instructions for every last point. */ - + for (xsum = xloc, i = 0; i < nelem; i++) { float usexloc, useyloc; @@ -1586,7 +1585,7 @@ static void plot_vis(t_gobj *z, t_glist *glist, } -static int plot_click(t_gobj *z, t_glist *glist, +static int plot_click(t_gobj *z, t_glist *glist, t_scalar *sc, t_template *template, float basex, float basey, int xpix, int ypix, int shift, int alt, int dbl, int doit) { @@ -1596,7 +1595,7 @@ static int plot_click(t_gobj *z, t_glist *glist, t_array *array; t_word *data = sc->sc_vec; - if (!plot_readownertemplate(x, data, template, + if (!plot_readownertemplate(x, data, template, &elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc)) { return (array_doclick(array, glist, &sc->sc_gobj, @@ -1758,7 +1757,7 @@ static void drawnumber_activate(t_gobj *z, t_glist *glist, post("drawnumber_activate %d", state); } -static void drawnumber_vis(t_gobj *z, t_glist *glist, +static void drawnumber_vis(t_gobj *z, t_glist *glist, t_word *data, t_template *template, float basex, float basey, int vis) { @@ -1818,13 +1817,13 @@ static void drawnumber_motion(void *z, t_floatarg dx, t_floatarg dy) #endif template_setfloat(drawnumber_motion_template, f->fd_un.fd_varsym, - drawnumber_motion_wp, + drawnumber_motion_wp, drawnumber_motion_ycumulative, 1); glist_redrawitem(drawnumber_motion_glist, drawnumber_motion_gobj); } -static int drawnumber_click(t_gobj *z, t_glist *glist, +static int drawnumber_click(t_gobj *z, t_glist *glist, t_scalar *sc, t_template *template, float basex, float basey, int xpix, int ypix, int shift, int alt, int dbl, int doit) { @@ -1896,6 +1895,3 @@ void g_template_setup(void) plot_setup(); drawnumber_setup(); } - - - diff --git a/apps/plugins/pdbox/PDa/src/m_binbuf.c b/apps/plugins/pdbox/PDa/src/m_binbuf.c index 2665a1343f..7394e062d5 100644 --- a/apps/plugins/pdbox/PDa/src/m_binbuf.c +++ b/apps/plugins/pdbox/PDa/src/m_binbuf.c @@ -164,7 +164,7 @@ void binbuf_text(t_binbuf *x, char *text, size_t size) } if (!slash) bufp++; } - while (textp != etext && bufp != ebuf && + while (textp != etext && bufp != ebuf && (slash || (*textp != ' ' && *textp != '\n' && *textp != '\r' && *textp != '\t' &&*textp != ',' && *textp != ';'))); *bufp = 0; @@ -350,7 +350,7 @@ void binbuf_addbinbuf(t_binbuf *x, t_binbuf *y) bug("binbuf_addbinbuf"); } } - + binbuf_add(x, z->b_n, z->b_vec); } @@ -429,7 +429,7 @@ void binbuf_print(t_binbuf *x) postatom(1, x->b_vec + i); if (x->b_vec[i].a_type == A_SEMI) newline = 1; - else newline = 0; + else newline = 0; } if (startedpost) endpost(); } @@ -448,10 +448,10 @@ int canvas_getdollarzero( void); t_symbol *binbuf_realizedollsym(t_symbol *s, int ac, t_atom *av, int tonew) { - int argno = atol(s->s_name), lastnum; + int argno = atol(s->s_name)/*, lastnum */; char buf[MAXPDSTRING], c, *sp; - for (lastnum = 0, sp = s->s_name; ((c = *sp) && c >= '0' && c <= '9'); - sp++, lastnum++) + for (/*lastnum = 0,*/ sp = s->s_name; ((c = *sp) && c >= '0' && c <= '9'); + sp++/*, lastnum++*/) if (!c || argno < 0 || argno > ac) { if (!tonew) @@ -497,13 +497,13 @@ void binbuf_eval(t_binbuf *x, t_pd *target, int argc, t_atom *argv) { error("$%d: not enough arguments supplied", at->a_w.w_index); - goto cleanup; + goto cleanup; } else if (argv[at->a_w.w_index-1].a_type != A_SYMBOL) { error("$%d: symbol needed as message destination", at->a_w.w_index); - goto cleanup; + goto cleanup; } else s = argv[at->a_w.w_index-1].a_w.w_symbol; } @@ -679,7 +679,7 @@ int binbuf_read(t_binbuf *b, char *filename, char *dirname, int crflag) #endif /* ROCKBOX */ return (1); } - if ((length = lseek(fd, 0, SEEK_END)) < 0 || lseek(fd, 0, SEEK_SET) < 0 + if ((length = lseek(fd, 0, SEEK_END)) < 0 || lseek(fd, 0, SEEK_SET) < 0 || !(buf = t_getbytes(length))) { #ifdef ROCKBOX @@ -772,7 +772,7 @@ int binbuf_write(t_binbuf *x, char *filename, char *dir, int crflag) x = binbuf_convert(x, 0); deleteit = 1; } - + #ifdef ROCKBOX if(!(f = binbuf_doopen(fbuf, O_WRONLY|O_CREAT|O_TRUNC))) #else /* ROCKBOX */ @@ -862,7 +862,7 @@ fail: } /* The following routine attempts to convert from max to pd or back. The -max to pd direction is working OK but you will need to make lots of +max to pd direction is working OK but you will need to make lots of abstractions for objects like "gate" which don't exist in Pd. conversion from Pd to Max hasn't been tested for patches with subpatches yet! */ @@ -903,7 +903,7 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) if (maxtopd) { /* case 1: importing a ".pat" file into Pd. */ - + /* dollar signs in file translate to symbols */ for (i = 0; i < natom; i++) { @@ -940,7 +940,7 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) stack[stackdepth] = nobj; stackdepth++; nobj = 0; - binbuf_addv(newb, "ssfffff;", + binbuf_addv(newb, "ssfffff;", gensym("#N"), gensym("canvas"), atom_getfloatarg(2, natom, nextmess), atom_getfloatarg(3, natom, nextmess), @@ -1002,7 +1002,7 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) binbuf_add(newb, natom - 1, outmess); nobj++; } - else if (!strcmp(second, "message") || + else if (!strcmp(second, "message") || !strcmp(second, "comment")) { SETSYMBOL(outmess, gensym("#X")); @@ -1068,7 +1068,7 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) gensym("#X"), gensym("obj"), atom_getfloatarg(2, natom, nextmess), atom_getfloatarg(3, natom, nextmess), - gensym((natom > 5 ? "inlet~" : "inlet"))); + gensym((natom > 5 ? "inlet~" : "inlet"))); nobj++; } else if (!strcmp(second, "outlet")) @@ -1077,7 +1077,7 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) gensym("#X"), gensym("obj"), atom_getfloatarg(2, natom, nextmess), atom_getfloatarg(3, natom, nextmess), - gensym((natom > 5 ? "outlet~" : "outlet"))); + gensym((natom > 5 ? "outlet~" : "outlet"))); nobj++; } else if (!strcmp(second, "user")) @@ -1086,7 +1086,7 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) gensym("#X"), gensym("obj"), atom_getfloatarg(3, natom, nextmess), atom_getfloatarg(4, natom, nextmess), - atom_getsymbolarg(2, natom, nextmess)); + atom_getsymbolarg(2, natom, nextmess)); nobj++; } else if (!strcmp(second, "connect")|| @@ -1097,7 +1097,7 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) nobj - atom_getfloatarg(2, natom, nextmess) - 1, atom_getfloatarg(3, natom, nextmess), nobj - atom_getfloatarg(4, natom, nextmess) - 1, - atom_getfloatarg(5, natom, nextmess)); + atom_getfloatarg(5, natom, nextmess)); } } } @@ -1115,7 +1115,7 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) stack[stackdepth] = nobj; stackdepth++; nobj = 0; - binbuf_addv(newb, "ssffff;", + binbuf_addv(newb, "ssffff;", gensym("#N"), gensym("vpatcher"), atom_getfloatarg(2, natom, nextmess), atom_getfloatarg(3, natom, nextmess), @@ -1205,9 +1205,9 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) binbuf_add(newb, natom + 3, outmess); } nobj++; - + } - else if (!strcmp(second, "msg") || + else if (!strcmp(second, "msg") || !strcmp(second, "text")) { SETSYMBOL(outmess, gensym("#P")); @@ -1238,7 +1238,7 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) nobj - atom_getfloatarg(2, natom, nextmess) - 1, atom_getfloatarg(3, natom, nextmess), nobj - atom_getfloatarg(4, natom, nextmess) - 1, - atom_getfloatarg(5, natom, nextmess)); + atom_getfloatarg(5, natom, nextmess)); } } } @@ -1260,7 +1260,7 @@ int binbuf_match(t_binbuf *inbuf, t_binbuf *searchbuf) { for (nmatched = 0; nmatched < searchbuf->b_n; nmatched++) { - t_atom *a1 = &inbuf->b_vec[indexin + nmatched], + t_atom *a1 = &inbuf->b_vec[indexin + nmatched], *a2 = &searchbuf->b_vec[nmatched]; if (a1->a_type != a2->a_type || (a1->a_type == A_SYMBOL && a1->a_w.w_symbol != a2->a_w.w_symbol) @@ -1330,4 +1330,3 @@ void glob_evalfile(t_pd *ignore, t_symbol *name, t_symbol *dir) pd_doloadbang(); canvas_resume_dsp(dspstate); } - diff --git a/apps/plugins/pdbox/PDa/src/m_obj.c b/apps/plugins/pdbox/PDa/src/m_obj.c index 8d4947f202..26b23c3ce7 100644 --- a/apps/plugins/pdbox/PDa/src/m_obj.c +++ b/apps/plugins/pdbox/PDa/src/m_obj.c @@ -71,7 +71,7 @@ static void inlet_wrong(t_inlet *x, t_symbol *s) /* LATER figure out how to make these efficient: */ static void inlet_bang(t_inlet *x) { - if (x->i_symfrom == &s_bang) + if (x->i_symfrom == &s_bang) pd_vmess(x->i_dest, x->i_symto, ""); else if (!x->i_symfrom) pd_bang(x->i_dest); else inlet_wrong(x, &s_bang); @@ -79,7 +79,7 @@ static void inlet_bang(t_inlet *x) static void inlet_pointer(t_inlet *x, t_gpointer *gp) { - if (x->i_symfrom == &s_pointer) + if (x->i_symfrom == &s_pointer) pd_vmess(x->i_dest, x->i_symto, "p", gp); else if (!x->i_symfrom) pd_pointer(x->i_dest, gp); else inlet_wrong(x, &s_pointer); @@ -98,7 +98,7 @@ static void inlet_float(t_inlet *x, t_float f) static void inlet_symbol(t_inlet *x, t_symbol *s) { - if (x->i_symfrom == &s_symbol) + if (x->i_symfrom == &s_symbol) pd_vmess(x->i_dest, x->i_symto, "s", s); else if (!x->i_symfrom) pd_symbol(x->i_dest, s); else inlet_wrong(x, &s_symbol); @@ -234,7 +234,7 @@ void obj_list(t_object *x, t_symbol *s, int argc, t_atom *argv) if (argv->a_type == A_POINTER) pd_pointer(&x->ob_pd, argv->a_w.w_gpointer); else if (argv->a_type == A_FLOAT) pd_float(&x->ob_pd, argv->a_w.w_float); else pd_symbol(&x->ob_pd, argv->a_w.w_symbol); -} +} void obj_init(void) { @@ -425,10 +425,10 @@ t_outconnect *obj_connect(t_object *source, int outno, t_outlet *o; t_pd *to; t_outconnect *oc, *oc2; - + for (o = source->ob_outlet; o && outno; o = o->o_next, outno--) ; if (!o) return (0); - + if (sink->ob_pd->c_firstin) { if (!inno) @@ -464,7 +464,7 @@ void obj_disconnect(t_object *source, int outno, t_object *sink, int inno) t_outlet *o; t_pd *to; t_outconnect *oc, *oc2; - + for (o = source->ob_outlet; o && outno; o = o->o_next, outno--) if (!o) return; if (sink->ob_pd->c_firstin) @@ -669,21 +669,21 @@ int obj_issignaloutlet(t_object *x, int m) t_sample *obj_findsignalscalar(t_object *x, int m) { - int n = 0; +// int n = 0; t_inlet *i; if (x->ob_pd->c_firstin && x->ob_pd->c_floatsignalin) { if (!m--) return (x->ob_pd->c_floatsignalin > 0 ? (t_sample *)(((char *)x) + x->ob_pd->c_floatsignalin) : 0); - n++; +// n++; } for (i = x->ob_inlet; i; i = i->i_next, m--) if (i->i_symfrom == &s_signal) { if (m == 0) return (&i->i_un.iu_floatsignalvalue); - n++; +// n++; } return (0); } @@ -703,8 +703,7 @@ int outlet_getsignalindex(t_outlet *x) { int n = 0; t_outlet *o; - for (o = x->o_owner->ob_outlet, n = 0; o && o != x; o = o->o_next) + for (o = x->o_owner->ob_outlet, n = 0; o && o != x; o = o->o_next) if (o->o_sym == &s_signal) n++; return (n); } -