From e053121410d4db0fa7c0566522efa29483e683ff Mon Sep 17 00:00:00 2001 From: Mathieu L Bouchard <matju@artengine.ca> Date: Fri, 1 Aug 2014 00:28:28 -0400 Subject: [PATCH] remove unused vars --- pd/src/g_canvas.c | 5 +--- pd/src/g_editor.c | 67 ++++++++++++++------------------------------- pd/src/g_mycanvas.c | 5 ++-- pd/src/g_numbox.c | 6 ++-- pd/src/g_rtext.c | 3 -- pd/src/g_text.c | 23 ++++++---------- 6 files changed, 33 insertions(+), 76 deletions(-) diff --git a/pd/src/g_canvas.c b/pd/src/g_canvas.c index 58927c336..70c030581 100644 --- a/pd/src/g_canvas.c +++ b/pd/src/g_canvas.c @@ -1264,7 +1264,7 @@ static void canvas_relocate(t_canvas *x, t_symbol *canvasgeom, canvas_setbounds(x, txpix, typix, txpix + cw, typix + ch); /* readjust garrays (if any) */ - t_gobj *g, *gg = NULL; + t_gobj *g; t_garray *ga = NULL; t_array *a = NULL; int num_elem = 0; @@ -1347,7 +1347,6 @@ static void canvas_click(t_canvas *x, void canvas_fattensub(t_canvas *x, int *xp1, int *yp1, int *xp2, int *yp2) { - t_gobj *y; *xp2 += 50; /* fake for now */ *yp2 += 50; } @@ -1657,7 +1656,6 @@ static void glist_redrawall(t_template *template, t_glist *gl, int action) int vis = glist_isvisible(gl); for (g = gl->gl_list; g; g = g->g_next) { - t_class *cl; if (vis && g->g_pd == scalar_class && ((template == template_findbyname(((t_scalar *)g)->sc_template)) || template_has_elemtemplate( @@ -1862,7 +1860,6 @@ static void canvas_declare(t_canvas *x, t_symbol *s, int argc, t_atom *argv) int canvas_open(t_canvas *x, const char *name, const char *ext, char *dirresult, char **nameresult, unsigned int size, int bin) { - t_namelist *nl, thislist; int fd = -1; int result = 0; t_canvas *y; diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c index c957e4fa7..e186a8238 100644 --- a/pd/src/g_editor.c +++ b/pd/src/g_editor.c @@ -1307,7 +1307,6 @@ void canvas_undo_paste(t_canvas *x, void *z, int action) { //if (buf->u_offset) // do_not_redraw += 1; - t_selection *sel; glist_noselect(x); //if the pasted object is supposed to be autopatched //then select the object it should be autopatched to @@ -1359,7 +1358,7 @@ static void glist_doreload(t_glist *gl, t_symbol *name, t_symbol *dir, Get its index here, and afterward restore g. Also, the replacement will be at the end of the list, so we don't do g = g->g_next in this case. */ - int j = glist_getindex(gl, g); + //int j = glist_getindex(gl, g); //fprintf(stderr, "rebuildlicious %d\n", j); if (!gl->gl_havewindow) { @@ -1437,7 +1436,7 @@ typedef struct _undo_apply void *canvas_undo_set_apply(t_canvas *x, int n) { t_undo_apply *buf; - t_gobj *y, *obj; + t_gobj *obj; t_linetraverser t; t_outconnect *oc; /* enable editor (in case it is disabled) and select the object @@ -1528,7 +1527,7 @@ void canvas_apply_setundo(t_canvas *x, t_gobj *y) int canvas_apply_restore_original_position(t_canvas *x, int orig_pos) { - t_gobj *y, *y1, *y_prev, *y_next; + t_gobj *y, *y_prev, *y_next; //get the last object y = glist_nth(x, glist_getindex(x, 0) - 1); if (glist_getindex(x, y) != orig_pos) @@ -1568,7 +1567,6 @@ void *canvas_undo_set_arrange(t_canvas *x, t_gobj *obj, int newindex) // newindex tells us is the new index at the beginning (0) or the end (1) t_undo_arrange *buf; - t_gobj *y; /* enable editor (in case it is disabled) and select the object we are working on */ if (!x->gl_edit) @@ -2080,16 +2078,10 @@ void canvas_undo_recreate(t_canvas *x, void *z, int action) if (action == UNDO_UNDO || action == UNDO_REDO) { // first copy new state of the current object - t_linetraverser t; - t_outconnect *oc; - int issel1, issel2; - t_undo_create *buf2 = (t_undo_create *)getbytes(sizeof(*buf)); //buf2->u_index = glist_getindex(x, y); buf2->u_index = buf->u_index; - int nnotsel= glist_selectionindex(x, 0, 0) - 1; // - 1 is a critical - // difference from - // the create + //fprintf(stderr,"buf2->u_index=%d nnotsel=%d y_getindex=%d\n", // buf2->u_index, nnotsel, glist_getindex(x, y)); buf2->u_objectbuf = binbuf_new(); @@ -2168,8 +2160,6 @@ void canvas_undo_font(t_canvas *x, void *z, int action) { t_canvas *x2 = canvas_getrootfor(x); int tmp_font = x2->gl_font; - t_float resize = (t_float)sys_fontwidth(u_f->font) / - (t_float)sys_fontwidth(x2->gl_font); t_int properties = gfxstub_haveproperties((void *)x2); if (properties) { @@ -2224,7 +2214,6 @@ int canvas_hitbox(t_canvas *x, t_gobj *y, int xpos, int ypos, int *x1p, int *y1p, int *x2p, int *y2p) { int x1, y1, x2, y2; - t_text *ob; if (!gobj_shouldvis(y, x)) return (0); gobj_getrect(y, x, &x1, &y1, &x2, &y2); @@ -2849,7 +2838,7 @@ static void canvas_done_popup(t_canvas *x, t_float which, t_float xpos, t_float ypos) { //fprintf(stderr,"canvas_done_pupup %lx\n", (t_int)x); - char pathbuf[FILENAME_MAX], namebuf[FILENAME_MAX]; + char namebuf[FILENAME_MAX]; t_gobj *y=NULL, *oldy=NULL, *oldy_prev=NULL, *oldy_next=NULL, *y_begin, *y_end=NULL; int x1, y1, x2, y2; @@ -4078,8 +4067,6 @@ int canvas_trymulticonnect(t_canvas *x, int xpos, int ypos, int which, int doit) { int width1 = x12 - x11, closest1, hotspot1; int width2 = x22 - x21, closest2, hotspot2; - int lx1, lx2, ly1, ly2; - t_outconnect *oc, *oc2; if (noutlet1 > 1) { @@ -4131,8 +4118,6 @@ int canvas_trymulticonnect(t_canvas *x, int xpos, int ypos, int which, int doit) { int width1 = x12 - x11, closest1, hotspot1; int width2 = x22 - x21, closest2, hotspot2; - int lx1, lx2, ly1, ly2; - t_outconnect *oc, *oc2; if (noutlet1 > 1) { @@ -4199,8 +4184,6 @@ int canvas_trymulticonnect(t_canvas *x, int xpos, int ypos, int which, int doit) { int width1 = x12 - x11, closest1, hotspot1; int width2 = x22 - x21, closest2, hotspot2; - int lx1, lx2, ly1, ly2; - t_outconnect *oc, *oc2; if (noutlet1 > 1) { @@ -4275,8 +4258,6 @@ int canvas_trymulticonnect(t_canvas *x, int xpos, int ypos, int which, int doit) { int width1 = x12 - x11, closest1, hotspot1; int width2 = x22 - x21, closest2, hotspot2; - int lx1, lx2, ly1, ly2; - t_outconnect *oc, *oc2; if (noutlet1 > 1) { @@ -4512,8 +4493,6 @@ void canvas_doconnect(t_canvas *x, int xpos, int ypos, int which, int doit) { int width1 = x12 - x11, closest1, hotspot1; int width2 = x22 - x21, closest2, hotspot2; - int lx1, lx2, ly1, ly2; - t_outconnect *oc, *oc2; if (noutlet1 > 1) { @@ -4738,8 +4717,8 @@ void canvas_mouseup(t_canvas *x, if (x->gl_editor->e_selection && !(x->gl_editor->e_selection->sel_next)) { - t_gobj *g = x->gl_editor->e_selection->sel_what; - t_glist *gl2; + //t_gobj *g = x->gl_editor->e_selection->sel_what; + //t_glist *gl2; /* first though, check we aren't an abstraction with a dirty sub-patch that would be discarded if we edit this. */ /*if (pd_class(&g->g_pd) == canvas_class && @@ -4894,7 +4873,6 @@ static void canvas_displaceselection(t_canvas *x, int dx, int dy) { /* for the time being let's discern from vanilla objects and those that don't conform */ - t_glist *yglist = (t_glist *)(y->sel_what); if (y->sel_what->g_pd->c_wb && y->sel_what->g_pd->c_wb->w_displacefnwtag) { @@ -5065,7 +5043,6 @@ void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av) return; if (x && down) { - t_object *ob; /* cancel any dragging action */ if (x->gl_editor->e_onmotion == MA_MOVE) x->gl_editor->e_onmotion = MA_NONE; @@ -5756,7 +5733,7 @@ void canvas_restoreconnections(t_canvas *x) static t_binbuf *canvas_docopy(t_canvas *x) { //fprintf(stderr,"canvas_docopy\n"); - t_gobj *y, *last; + t_gobj *y; t_linetraverser t; t_outconnect *oc; t_binbuf *b = binbuf_new(); @@ -6064,18 +6041,18 @@ static void glist_donewloadbangs(t_glist *x) static void canvas_paste_xyoffset(t_canvas *x) { - t_selection *sel; - t_class *cl; - int resortin = 0; - int resortout = 0; + //t_selection *sel; + //t_class *cl; + //int resortin = 0; + //int resortout = 0; - for (sel = x->gl_editor->e_selection; sel; sel = sel->sel_next) - { + //for (sel = x->gl_editor->e_selection; sel; sel = sel->sel_next) + //{ //gobj_displace(sel->sel_what, x, paste_xyoffset*10, paste_xyoffset*10); - cl = pd_class(&sel->sel_what->g_pd); - if (cl == vinlet_class) resortin = 1; - if (cl == voutlet_class) resortout = 1; - } + //cl = pd_class(&sel->sel_what->g_pd); + //if (cl == vinlet_class) resortin = 1; + //if (cl == voutlet_class) resortout = 1; + //} canvas_displaceselection(x, paste_xyoffset*10, paste_xyoffset*10); //if (resortin) canvas_resortinlets(x); @@ -6150,7 +6127,7 @@ static void canvas_dopaste(t_canvas *x, t_binbuf *b) do_not_redraw += 1; int was_dnr = do_not_redraw; - t_gobj *newgobj, *last, *g2, *first; + t_gobj *newgobj, *g2; int dspstate = canvas_suspend_dsp(), nbox, count; int canvas_empty = 0; int offset = 1; @@ -6162,7 +6139,6 @@ static void canvas_dopaste(t_canvas *x, t_binbuf *b) //autopatching variables int connectme, xpix, ypix, indx, nobj; - t_float sx = 0.0, sy = 0.0; connectme = 0; canvas_editmode(x, 1.); @@ -6464,8 +6440,6 @@ static void canvas_selectall(t_canvas *x) static void canvas_reselect(t_canvas *x) { t_gobj *g, *gwas; - t_selection *sel; - t_object *ob; /* if someone is text editing, and if only one object is selected, deselect everyone and reselect. */ if (x->gl_editor->e_textedfor) @@ -6664,8 +6638,7 @@ static void canvas_tidy(t_canvas *x) int hs, vs; // horizontal respacing, vertical respacing t_gobj *leftmost, *rightmost, *topmost, *bottommost; int x1, x2, y1, y2; - int ox1, ox2, oy1, oy2; // object x and y dimensions - int cox1, cox2, coy1, coy2; // comparing object x and y dimensions + //int cox1, cox2, coy1, coy2; // comparing object x and y dimensions int dx, dy; // displacement variables int i; // generic counter var t_sgobj *sg, *tmpsg; // list of objects ordered spatially diff --git a/pd/src/g_mycanvas.c b/pd/src/g_mycanvas.c index 8fe240308..9d41bead5 100644 --- a/pd/src/g_mycanvas.c +++ b/pd/src/g_mycanvas.c @@ -560,7 +560,7 @@ static void my_canvas_dialog(t_my_canvas *x, t_symbol *s, int argc, t_atom *argv int a = (int)atom_getintarg(0, argc, argv); int w = (int)atom_getintarg(2, argc, argv); int h = (int)atom_getintarg(3, argc, argv); - int sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv); + iemgui_dialog(&x->x_gui, srl, argc, argv); x->x_gui.x_isa.x_loadinit = 0; if(a < 1) @@ -648,9 +648,8 @@ static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv) t_my_canvas *x = (t_my_canvas *)pd_new(my_canvas_class); int bflcol[]={-233017, -1, -66577}; int a=IEM_GUI_DEFAULTSIZE, w=100, h=60; - int ldx=20, ldy=12, f=2, i=0; + int ldx=20, ldy=12, i=0; int fs=14; - char str[144]; iem_inttosymargs(&x->x_gui.x_isa, 0); iem_inttofstyle(&x->x_gui.x_fsf, 0); diff --git a/pd/src/g_numbox.c b/pd/src/g_numbox.c index e915e1e5b..3e04b7d34 100644 --- a/pd/src/g_numbox.c +++ b/pd/src/g_numbox.c @@ -980,11 +980,10 @@ static void my_numbox_dialog(t_my_numbox *x, t_symbol *s, int argc, { x->x_hide_frame = (int)atom_getintarg(18, argc, argv); } - int sr_flags; if(lilo != 0) lilo = 1; x->x_lin0_log1 = lilo; - sr_flags = iemgui_dialog(&x->x_gui, srl, argc, argv); + iemgui_dialog(&x->x_gui, srl, argc, argv); if(w < 1) w = 1; x->x_gui.x_w = w; @@ -1290,11 +1289,10 @@ static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv) t_my_numbox *x = (t_my_numbox *)pd_new(my_numbox_class); int bflcol[]={-262144, -1, -1}; int w=5, h=14; - int lilo=0, f=0, ldx=0, ldy=-8; + int lilo=0, ldx=0, ldy=-8; int fs=10; int log_height=256; double min=-1.0e+37, max=1.0e+37,v=0.0; - char str[144]; if((argc >= 17)&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1) &&IS_A_FLOAT(argv,2)&&IS_A_FLOAT(argv,3) diff --git a/pd/src/g_rtext.c b/pd/src/g_rtext.c index 56aa0766e..fbc166ba1 100644 --- a/pd/src/g_rtext.c +++ b/pd/src/g_rtext.c @@ -58,7 +58,6 @@ struct _rtext t_rtext *rtext_new(t_glist *glist, t_text *who) { t_rtext *x = (t_rtext *)getbytes(sizeof *x); - int w = 0, h = 0, indx; x->x_height = -1; x->x_text = who; x->x_glist = glist; @@ -421,7 +420,6 @@ void rtext_retext(t_rtext *x) int wantreduce = bufsize - text->te_width; char *decimal = 0, *nextchar, *ebuf = x->x_buf + bufsize, *s1, *s2; - int ndecimals; for (decimal = x->x_buf; decimal < ebuf; decimal++) if (*decimal == '.') break; @@ -571,7 +569,6 @@ static int rtext_compare_special_chars(const char c) void rtext_key(t_rtext *x, int keynum, t_symbol *keysym) { int w = 0, h = 0, indx, i, newsize, ndel; - char *s1, *s2; //fprintf(stderr,"rtext_key keysym=%s\n", keysym->s_name); if (keynum) { diff --git a/pd/src/g_text.c b/pd/src/g_text.c index d275e41b1..218142c94 100644 --- a/pd/src/g_text.c +++ b/pd/src/g_text.c @@ -247,8 +247,7 @@ extern int sys_noautopatch; void canvas_howputnew(t_canvas *x, int *connectp, int *xpixp, int *ypixp, int *indexp, int *totalp) { - int xpix, ypix, indx = 0, nobj = 0, n2, x1, x2, y1, y2; - t_gobj *selected; + int indx = 0, nobj = 0, n2, x1, x2, y1, y2; /* int connectme = 0; @@ -314,7 +313,6 @@ void canvas_obj(t_glist *gl, t_symbol *s, int argc, t_atom *argv) { //fprintf(stderr,"canvas_obj\n"); if (canvas_hasarray(gl)) return; - t_text *x; if (argc >= 2) { t_binbuf *b = binbuf_new(); @@ -1109,10 +1107,8 @@ static void gatom_param(t_gatom *x, t_symbol *sel, int argc, t_atom *argv) /* ---------------- gatom-specific widget functions --------------- */ static void gatom_getwherelabel(t_gatom *x, t_glist *glist, int *xp, int *yp) { - int x1, y1, x2, y2, width, height; + int x1, y1, x2, y2; text_getrect(&x->a_text.te_g, glist, &x1, &y1, &x2, &y2); - width = x2 - x1; - height = y2 - y1; if (x->a_wherelabel == ATOM_LABELLEFT) { *xp = x1 - 3 - @@ -1420,7 +1416,7 @@ static void text_displace_withtag(t_gobj *z, t_glist *glist, x->te_ypix += dy; if (glist_isvisible(glist)) { - t_rtext *y = glist_findrtext(glist, x); + //t_rtext *y = glist_findrtext(glist, x); //text_drawborder_withtag(x, glist, rtext_gettag(y), // rtext_width(y), rtext_height(y), 0); canvas_fixlinesfor(glist_getcanvas(glist), x); @@ -1463,7 +1459,7 @@ static void text_displace_withtag(t_gobj *z, t_glist *glist, static void gatom_displace_withtag(t_gobj *z, t_glist *glist, int dx, int dy) { - t_gatom *x = (t_gatom*)z; + //t_gatom *x = (t_gatom*)z; text_displace_withtag(z, glist, dx, dy); //sys_vgui(".x%lx.c move %lx.l %d %d\n", glist_getcanvas(glist), // x, dx, dy); @@ -1504,7 +1500,7 @@ static void text_select(t_gobj *z, t_glist *glist, int state) } if (z->g_pd->c_wb && z->g_pd->c_wb->w_displacefnwtag) { - int i, ni, no; + int i; if (state) { if (z->g_pd == gatom_class) @@ -1948,7 +1944,7 @@ void text_drawborder(t_text *x, t_glist *glist, char *tag, int width2, int height2, int firsttime) { t_object *ob; - int x1, y1, x2, y2, width, height, msg_draw_const, atom_draw_const; + int x1, y1, x2, y2; /* if this is gop patcher, the getrect should be equal to gop-ed window rather than just the size of text */ @@ -1970,8 +1966,6 @@ void text_drawborder(t_text *x, t_glist *glist, text_getrect(&x->te_g, glist, &x1, &y1, &x2, &y2); } - width = x2 - x1; - height = y2 - y1; if (x->te_type == T_OBJECT) { char *pattern; char *outline; char *fill; @@ -2093,10 +2087,9 @@ void text_drawborder_withtag(t_text *x, t_glist *glist, char *tag, int width2, int height2, int firsttime) { t_object *ob; - int x1, y1, x2, y2, width, height, msg_draw_const, atom_draw_const; + int x1, y1, x2, y2, msg_draw_const, atom_draw_const; text_getrect(&x->te_g, glist, &x1, &y1, &x2, &y2); - width = x2 - x1; - height = y2 - y1; + if (x->te_type == T_OBJECT) { char *pattern; char *outline; char *fill; -- GitLab