From 4a68207b8984cb030e02db1fca5f5a2dd827bb53 Mon Sep 17 00:00:00 2001
From: Mathieu L Bouchard <matju@artengine.ca>
Date: Fri, 1 Aug 2014 17:39:39 -0400
Subject: [PATCH] remove unused vars

---
 pd/src/g_bang.c     |  7 +------
 pd/src/g_editor.c   | 25 +++++++++----------------
 pd/src/g_hdial.c    |  6 ------
 pd/src/g_hslider.c  |  6 ------
 pd/src/g_mycanvas.c |  6 ------
 pd/src/g_numbox.c   |  6 ------
 pd/src/g_scalar.c   |  2 ++
 pd/src/g_toggle.c   |  8 +-------
 pd/src/g_vdial.c    |  8 --------
 pd/src/g_vslider.c  |  6 ------
 10 files changed, 13 insertions(+), 67 deletions(-)

diff --git a/pd/src/g_bang.c b/pd/src/g_bang.c
index 32c860f61..8e10a625b 100644
--- a/pd/src/g_bang.c
+++ b/pd/src/g_bang.c
@@ -520,7 +520,7 @@ static void bng__motionhook(t_scalehandle *sh,
         if (properties)
         {
             int new_w = x->x_gui.x_w - x->x_gui.scale_offset_x + sh->h_dragx;
-            int new_h = x->x_gui.x_h - x->x_gui.scale_offset_y + sh->h_dragy;
+            //int new_h = x->x_gui.x_h - x->x_gui.scale_offset_y + sh->h_dragy;
             sys_vgui(".gfxstub%lx.dim.w_ent delete 0 end\n", properties);
             sys_vgui(".gfxstub%lx.dim.w_ent insert 0 %d\n", properties, new_w);
             //sys_vgui(".gfxstub%lx.dim.h_ent delete 0 end\n", properties);
@@ -531,11 +531,6 @@ static void bng__motionhook(t_scalehandle *sh,
     {
         t_bng *x = (t_bng *)(sh->h_master);
         int dx = (int)f1, dy = (int)f2;
-        int newx, newy;
-        newx = x->x_gui.x_obj.te_xpix + x->x_gui.x_w -
-            x->x_gui.scale_offset_x + dx;
-        newy = x->x_gui.x_obj.te_ypix + x->x_gui.x_h -
-            x->x_gui.scale_offset_y + dy;
 
         sh->h_dragx = dx;
         sh->h_dragy = dy;
diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c
index e186a8238..adbe5af47 100644
--- a/pd/src/g_editor.c
+++ b/pd/src/g_editor.c
@@ -552,9 +552,9 @@ void glist_deselect(t_glist *x, t_gobj *y)
 {
     //fprintf(stderr, "deselect\n");
     int fixdsp = 0;
-    static int reenter = 0;
+    //static int reenter = 0;
     /* if (reenter) return; */
-    reenter = 1;
+    //reenter = 1;
     if (x->gl_editor)
     {
         t_selection *sel, *sel2;
@@ -629,7 +629,7 @@ void glist_deselect(t_glist *x, t_gobj *y)
             sys_vgui("pdtk_canvas_update_edit_menu .x%lx 0\n", x);
         canvas_draw_gop_resize_hooks(x);
     }
-    reenter = 0;
+    //reenter = 0;
 }
 
 void glist_noselect(t_glist *x)
@@ -2649,7 +2649,7 @@ static void canvas_donecanvasdialog(t_glist *x,
 {
     t_float xperpix, yperpix, x1, y1, x2, y2, xpix, ypix, xmargin, ymargin;
     int rx1=0, ry1=0, rx2=0, ry2=0; //for getrect
-    int graphme, redraw = 0;
+    int graphme;
 
     xperpix = atom_getfloatarg(0, argc, argv);
     yperpix = atom_getfloatarg(1, argc, argv);
@@ -2718,8 +2718,6 @@ static void canvas_donecanvasdialog(t_glist *x,
     }
     else
     {
-        if (xperpix != glist_dpixtodx(x, 1) || yperpix != glist_dpixtody(x, 1))
-            redraw = 1;
         if (xperpix > 0)
         {
             x->gl_x1 = 0;
@@ -4814,7 +4812,7 @@ void canvas_mouseup(t_canvas *x,
 void canvas_mousedown_middle(t_canvas *x, t_floatarg xpos, t_floatarg ypos,
     t_floatarg which, t_floatarg mod)
 {
-    int shiftmod, runmode, altmod, rightclick, middleclick;
+    int middleclick;
 
     // remove stale tooltips, if any
     if (objtooltip)
@@ -4824,10 +4822,6 @@ void canvas_mousedown_middle(t_canvas *x, t_floatarg xpos, t_floatarg ypos,
     }
     
     // read key and mouse button states
-    shiftmod = ((int)mod & SHIFTMOD);
-    runmode = (((int)mod & CTRLMOD) || (!x->gl_edit));
-    altmod = ((int)mod & ALTMOD);
-    rightclick = ((int)mod & RIGHTCLICK);
     x->gl_editor->e_xwas = (int)xpos;
     x->gl_editor->e_ywas = (int)ypos;
     middleclick = (which == 2 ? 1 : 0);
@@ -5227,7 +5221,6 @@ void canvas_motion(t_canvas *x, t_floatarg xpos, t_floatarg ypos,
                 &x11, &y11, &x12, &y12))
         {
             int wantwidth = xpos - x11;
-            t_gotfn sizefn;
             t_object *ob = pd_checkobject(&y1->g_pd);
             if (ob && ob->te_pd->c_wb == &text_widgetbehavior ||
                     (ob->ob_pd == canvas_class &&
@@ -6127,7 +6120,7 @@ static void canvas_dopaste(t_canvas *x, t_binbuf *b)
     do_not_redraw += 1;
     int was_dnr = do_not_redraw;
     
-    t_gobj *newgobj, *g2;
+    t_gobj *g2;
     int dspstate = canvas_suspend_dsp(), nbox, count;
     int canvas_empty = 0;
     int offset = 1;
@@ -6448,8 +6441,8 @@ static void canvas_reselect(t_canvas *x)
         if ((gwas = x->gl_editor->e_selection->sel_what) &&
             !x->gl_editor->e_selection->sel_next)
         {
-            int nobjwas = glist_getindex(x, 0),
-                indx = canvas_getindex(x, x->gl_editor->e_selection->sel_what);
+            //int nobjwas = glist_getindex(x, 0);
+            //int indx = canvas_getindex(x, x->gl_editor->e_selection->sel_what);
             glist_noselect(x);
             for (g = x->gl_list; g; g = g->g_next)
                 if (g == gwas)
@@ -7105,7 +7098,7 @@ static void canvas_tidy(t_canvas *x)
     /* LATER might have to speed this up */
 static void canvas_tidyold(t_canvas *x)
 {
-    t_gobj *y, *y2, *y3;
+    t_gobj *y, *y2;
     int ax1, ay1, ax2, ay2, bx1, by1, bx2, by2;
     int histogram[NHIST], *ip, i, besthist, bestdist;
         /* if nobody is selected, this means do it to all boxes;
diff --git a/pd/src/g_hdial.c b/pd/src/g_hdial.c
index 8911e3b24..aef8b43bc 100644
--- a/pd/src/g_hdial.c
+++ b/pd/src/g_hdial.c
@@ -553,12 +553,6 @@ static void hradio__motionhook(t_scalehandle *sh,
     {
         t_bng *x = (t_bng *)(sh->h_master);
         int dx = (int)f1, dy = (int)f2;
-        int newx, newy;
-        newx = x->x_gui.x_obj.te_xpix + x->x_gui.x_w -
-            x->x_gui.scale_offset_x + dx;
-        newy = x->x_gui.x_obj.te_ypix + x->x_gui.x_h -
-            x->x_gui.scale_offset_y + dy;
-
         sh->h_dragx = dx;
         sh->h_dragy = dy;
 
diff --git a/pd/src/g_hslider.c b/pd/src/g_hslider.c
index 8755489b9..ec6656207 100644
--- a/pd/src/g_hslider.c
+++ b/pd/src/g_hslider.c
@@ -535,12 +535,6 @@ static void hslider__motionhook(t_scalehandle *sh,
     {
         t_bng *x = (t_bng *)(sh->h_master);
         int dx = (int)f1, dy = (int)f2;
-        int newx, newy;
-        newx = x->x_gui.x_obj.te_xpix + x->x_gui.x_w -
-            x->x_gui.scale_offset_x + dx;
-        newy = x->x_gui.x_obj.te_ypix + x->x_gui.x_h -
-            x->x_gui.scale_offset_y + dy;
-
         sh->h_dragx = dx;
         sh->h_dragy = dy;
 
diff --git a/pd/src/g_mycanvas.c b/pd/src/g_mycanvas.c
index 9d41bead5..b7a5f55d8 100644
--- a/pd/src/g_mycanvas.c
+++ b/pd/src/g_mycanvas.c
@@ -427,12 +427,6 @@ static void my_canvas__motionhook(t_scalehandle *sh,
     {
         t_my_canvas *x = (t_my_canvas *)(sh->h_master);
         int dx = (int)f1, dy = (int)f2;
-        int newx, newy;
-        newx = x->x_gui.x_obj.te_xpix + x->x_gui.x_ldx -
-            x->x_gui.label_offset_x + dx;
-        newy = x->x_gui.x_obj.te_ypix + x->x_gui.x_ldy -
-            x->x_gui.label_offset_y + dy;
-
         sh->h_dragx = dx;
         sh->h_dragy = dy;
 
diff --git a/pd/src/g_numbox.c b/pd/src/g_numbox.c
index 3e04b7d34..b8f86b182 100644
--- a/pd/src/g_numbox.c
+++ b/pd/src/g_numbox.c
@@ -783,12 +783,6 @@ static void my_numbox__motionhook(t_scalehandle *sh,
     {
         t_bng *x = (t_bng *)(sh->h_master);
         int dx = (int)f1, dy = (int)f2;
-        int newx, newy;
-        newx = x->x_gui.x_obj.te_xpix + x->x_gui.x_w -
-            x->x_gui.scale_offset_x + dx;
-        newy = x->x_gui.x_obj.te_ypix + x->x_gui.x_h -
-            x->x_gui.scale_offset_y + dy;
-
         sh->h_dragx = dx;
         sh->h_dragy = dy;
 
diff --git a/pd/src/g_scalar.c b/pd/src/g_scalar.c
index c49a8d29c..228b2ab10 100644
--- a/pd/src/g_scalar.c
+++ b/pd/src/g_scalar.c
@@ -139,6 +139,7 @@ int template_hasxy(t_template *template)
 
 int template_cancreate(t_template *template)
 {
+	//return 1;
     int i, type, nitems = template->t_n;
     t_dataslot *datatypes = template->t_vec;
     t_template *elemtemplate;
@@ -175,6 +176,7 @@ t_scalar *scalar_new(t_glist *owner, t_symbol *templatesym)
     }
     if (!template_cancreate(template))
         return (0);
+    post("ALLÔ");
     x = (t_scalar *)getbytes(sizeof(t_scalar) +
         (template->t_n - 1) * sizeof(*x->sc_vec));
     x->sc_gobj.g_pd = scalar_class;
diff --git a/pd/src/g_toggle.c b/pd/src/g_toggle.c
index 293a7af40..f98fcaaac 100644
--- a/pd/src/g_toggle.c
+++ b/pd/src/g_toggle.c
@@ -538,7 +538,7 @@ static void toggle__motionhook(t_scalehandle *sh, t_floatarg f1, t_floatarg f2)
         if (properties)
         {
             int new_w = x->x_gui.x_w - x->x_gui.scale_offset_x + sh->h_dragx;
-            int new_h = x->x_gui.x_h - x->x_gui.scale_offset_y + sh->h_dragy;
+            //int new_h = x->x_gui.x_h - x->x_gui.scale_offset_y + sh->h_dragy;
             sys_vgui(".gfxstub%lx.dim.w_ent delete 0 end\n", properties);
             sys_vgui(".gfxstub%lx.dim.w_ent insert 0 %d\n", properties, new_w);
             //sys_vgui(".gfxstub%lx.dim.h_ent delete 0 end\n", properties);
@@ -549,12 +549,6 @@ static void toggle__motionhook(t_scalehandle *sh, t_floatarg f1, t_floatarg f2)
     {
         t_bng *x = (t_bng *)(sh->h_master);
         int dx = (int)f1, dy = (int)f2;
-        int newx, newy;
-        newx = x->x_gui.x_obj.te_xpix + x->x_gui.x_w -
-            x->x_gui.scale_offset_x + dx;
-        newy = x->x_gui.x_obj.te_ypix + x->x_gui.x_h -
-            x->x_gui.scale_offset_y + dy;
-
         sh->h_dragx = dx;
         sh->h_dragy = dy;
 
diff --git a/pd/src/g_vdial.c b/pd/src/g_vdial.c
index 4e09d6e95..0fb3f00fc 100644
--- a/pd/src/g_vdial.c
+++ b/pd/src/g_vdial.c
@@ -155,8 +155,6 @@ void vradio_draw_move(t_vradio *x, t_glist *glist)
 void vradio_draw_erase(t_vradio* x, t_glist* glist)
 {
     t_canvas *canvas=glist_getcanvas(glist);
-    int n=x->x_number, i;
-
     sys_vgui(".x%lx.c delete %lxVRDO\n", canvas, x);
     sys_vgui(".x%lx.c dtag all %lxVRDO\n", canvas, x);
     if (x->x_gui.x_fsf.x_selected)
@@ -550,12 +548,6 @@ static void vradio__motionhook(t_scalehandle *sh,
     {
         t_bng *x = (t_bng *)(sh->h_master);
         int dx = (int)f1, dy = (int)f2;
-        int newx, newy;
-        newx = x->x_gui.x_obj.te_xpix + x->x_gui.x_w -
-            x->x_gui.scale_offset_x + dx;
-        newy = x->x_gui.x_obj.te_ypix + x->x_gui.x_h -
-            x->x_gui.scale_offset_y + dy;
-
         sh->h_dragx = dx;
         sh->h_dragy = dy;
 
diff --git a/pd/src/g_vslider.c b/pd/src/g_vslider.c
index b80e61fb3..6631e521b 100644
--- a/pd/src/g_vslider.c
+++ b/pd/src/g_vslider.c
@@ -544,12 +544,6 @@ static void vslider__motionhook(t_scalehandle *sh,
     {
         t_bng *x = (t_bng *)(sh->h_master);
         int dx = (int)f1, dy = (int)f2;
-        int newx, newy;
-        newx = x->x_gui.x_obj.te_xpix + x->x_gui.x_w -
-            x->x_gui.scale_offset_x + dx;
-        newy = x->x_gui.x_obj.te_ypix + x->x_gui.x_h -
-            x->x_gui.scale_offset_y + dy;
-
         sh->h_dragx = dx;
         sh->h_dragy = dy;
 
-- 
GitLab