[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (9162345a625160c2f1f9b088e612129776ea25af)



The branch, master has been updated
       via  9162345a625160c2f1f9b088e612129776ea25af (commit)
       via  c94531c2239d03e6312e5ec9bfb9193a47b8a188 (commit)
       via  65e19713f44b702f4a4a3d94898955c4a4351cb9 (commit)
       via  5a15cd1bf30c9b985971e6f7c670a625925bd113 (commit)
       via  0a29589df9e28a33e6594d6f1ade84a94e5fb93a (commit)
       via  24afcc1d0ca0a441d76e9fbe5f811c2a6414f156 (commit)
       via  ecfc7cf8fa31f4384dbe6d8117a0d7b3bf678f32 (commit)
       via  2e56554091204c2f902ce8dc90525fee4635ce39 (commit)
       via  b283c195c46d273ef0cebd1f614ef35378604d98 (commit)
       via  5b2e2886b4802d5ee964ca0fbf7efec67562c919 (commit)
       via  75c28777f1063e25419215138baab4e0e60f73d6 (commit)
       via  4953e452ed735868d4d47194fc2c2c2eec9b944a (commit)
      from  af27c2d529a00eb26ec9dcd1e102d7f6c91d7683 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/action.c                     |   18 ++++++++++--------
 src/find.c                       |   21 ++++++++-------------
 src/heap.c                       |    1 -
 src/hid/gcode/gcode.c            |   35 -----------------------------------
 src/hid/gerber/gerber.c          |   33 +++------------------------------
 src/hid/gtk/gui-netlist-window.c |   21 +++++++++------------
 src/hid/nelma/nelma.c            |   30 ------------------------------
 src/hid/png/png.c                |   12 ------------
 8 files changed, 30 insertions(+), 141 deletions(-)


=================
 Commit Messages
=================

commit 9162345a625160c2f1f9b088e612129776ea25af
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    action.c: Fix leak of schname in ActionImport()

:100644 100644 1005b17... 69bf89d... M	src/action.c

commit c94531c2239d03e6312e5ec9bfb9193a47b8a188
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    heap.c: Don't set the v variable twice to the same value in __upheap.
    
    (Caught with clang)

:100644 100644 9e0f35e... 57a8208... M	src/heap.c

commit 65e19713f44b702f4a4a3d94898955c4a4351cb9
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    find.c: Tidy up some ugly code in LookupLOConnectionsToLOList()
    
    Cleaned up whilst chasing some clang warnings. It appears there is no real
    problem here, as max_copper_layers is going to be >0 for any PCB. If not,
    there are potential uses of uninitialised data.

:100644 100644 877deb4... cd2aff5... M	src/find.c

commit 5a15cd1bf30c9b985971e6f7c670a625925bd113
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    src/action.c: Abort the Import(setnewport,mask) action if the mask isn't set
    
    This avoids using an uninitialised variable.
    
    (Caught by clang)

:100644 100644 c1325ba... 1005b17... M	src/action.c

commit 0a29589df9e28a33e6594d6f1ade84a94e5fb93a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/png/png.c: Remove buggy code for swapping x1/x2 and y1/y2
    
    Since the png hid works, and this code is ineffective due to a typo,
    we probably ought to remove it.
    
    (Caught by clang)

:100644 100644 ff8931a... 892696b... M	src/hid/png/png.c

commit 24afcc1d0ca0a441d76e9fbe5f811c2a6414f156
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gerber.c: Tidy up use_gc() routine to avoid a static anlysis warning
    
    Don't unconditionally access the aptr variable right after we
    just NULL tested it.
    
    (Caught by clang)

:100644 100644 3930941... 97a7c29... M	src/hid/gerber/gerber.c

commit ecfc7cf8fa31f4384dbe6d8117a0d7b3bf678f32
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gerber: Fix a couple of typos in drill_sort routine
    
    Should fix sorting of drill holes by coordinate.
    
    (Caught by clang)

:100644 100644 ce20e3b... 3930941... M	src/hid/gerber/gerber.c

commit 2e56554091204c2f902ce8dc90525fee4635ce39
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gerber: Remove dead colour selection code

:100644 100644 be6a7c4... ce20e3b... M	src/hid/gerber/gerber.c

commit b283c195c46d273ef0cebd1f614ef35378604d98
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Remove dead colour selection code from nelma and gcode hids
    
    (Silences some unused code warnings from clang)

:100644 100644 17bbae1... a3e1bfd... M	src/hid/gcode/gcode.c
:100644 100644 9659b66... 9e75927... M	src/hid/nelma/nelma.c

commit 5b2e2886b4802d5ee964ca0fbf7efec67562c919
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    action.c: Fixup some syntax so it appears as legal C before macro expansion
    
    "if TEST_FLAG (...) {" does not look like legal C until the TEST_FLAG macro
    is expanded. This works because the macro is wrapped with a () like all
    good function-like pre-processor macros.
    
    This bad style was upsetting cppcheck, which flagged up a syntax error for
    this line. (Obviously it was not expanding macros before checking).

:100644 100644 2a0be9e... c1325ba... M	src/action.c

commit 75c28777f1063e25419215138baab4e0e60f73d6
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Remove some assigned, but unused variables in the netlist window
    
    (Caught with clang)

:100644 100644 f87491d... a847e6d... M	src/hid/gtk/gui-netlist-window.c

commit 4953e452ed735868d4d47194fc2c2c2eec9b944a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Fix broken pad-center finding code in the netlist window
    
    Looks like I made a copy+paste error in the code which shows the user
    the location of a particular netlist connection.
    
    (Caught with clang)

:100644 100644 35b5427... f87491d... M	src/hid/gtk/gui-netlist-window.c

=========
 Changes
=========

commit 9162345a625160c2f1f9b088e612129776ea25af
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    action.c: Fix leak of schname in ActionImport()

diff --git a/src/action.c b/src/action.c
index 1005b17..69bf89d 100644
--- a/src/action.c
+++ b/src/action.c
@@ -7706,7 +7706,10 @@ ActionImport (int argc, char **argv, Coord x, Coord y)
       strcat (schname, ".sch");
 
       if (access (schname, F_OK))
-	return hid_action("ImportGUI");
+        {
+          free (schname);
+          return hid_action("ImportGUI");
+        }
 
       sources = (char **) malloc (2 * sizeof (char *));
       sources[0] = schname;

commit c94531c2239d03e6312e5ec9bfb9193a47b8a188
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    heap.c: Don't set the v variable twice to the same value in __upheap.
    
    (Caught with clang)

diff --git a/src/heap.c b/src/heap.c
index 9e0f35e..57a8208 100644
--- a/src/heap.c
+++ b/src/heap.c
@@ -159,7 +159,6 @@ __upheap (heap_t * heap, int k)
   assert (heap && heap->size < heap->max);
   assert (k <= heap->size);
 
-  v = heap->element[k];
   heap->element[0].cost = MIN_COST;
   for (v = heap->element[k]; heap->element[k / 2].cost > v.cost; k = k / 2)
     heap->element[k] = heap->element[k / 2];

commit 65e19713f44b702f4a4a3d94898955c4a4351cb9
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    find.c: Tidy up some ugly code in LookupLOConnectionsToLOList()
    
    Cleaned up whilst chasing some clang warnings. It appears there is no real
    problem here, as max_copper_layers is going to be >0 for any PCB. If not,
    there are potential uses of uninitialised data.

diff --git a/src/find.c b/src/find.c
index 877deb4..cd2aff5 100644
--- a/src/find.c
+++ b/src/find.c
@@ -865,7 +865,7 @@ LookupLOConnectionsToLOList (bool AndRats)
     {
       lineposition[i] = LineList[i].Location;
       polyposition[i] = PolygonList[i].Location;
-      arcposition[i] = ArcList[i].Location;
+      arcposition[i]  = ArcList[i].Location;
     }
   for (i = 0; i < 2; i++)
     padposition[i] = PadList[i].Location;
@@ -951,18 +951,13 @@ LookupLOConnectionsToLOList (bool AndRats)
        * may have changed the prior lists
        */
       done = !AndRats || ratposition >= RatList.Number;
-      for (layer = 0; layer < max_copper_layer + 2; layer++)
-        {
-          if (layer < max_copper_layer)
-            done = done &&
-              lineposition[layer] >= LineList[layer].Number
-              && arcposition[layer] >= ArcList[layer].Number
-              && polyposition[layer] >= PolygonList[layer].Number;
-          else
-            done = done
-              && padposition[layer - max_copper_layer] >=
-              PadList[layer - max_copper_layer].Number;
-        }
+      done = done && padposition[0] >= PadList[0].Number &&
+                     padposition[1] >= PadList[1].Number;
+      for (layer = 0; layer < max_copper_layer; layer++)
+        done = done &&
+               lineposition[layer] >= LineList[layer].Number &&
+               arcposition[layer]  >= ArcList[layer].Number &&
+               polyposition[layer] >= PolygonList[layer].Number;
     }
   while (!done);
   return (false);

commit 5a15cd1bf30c9b985971e6f7c670a625925bd113
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    src/action.c: Abort the Import(setnewport,mask) action if the mask isn't set
    
    This avoids using an uninitialised variable.
    
    (Caught by clang)

diff --git a/src/action.c b/src/action.c
index c1325ba..1005b17 100644
--- a/src/action.c
+++ b/src/action.c
@@ -7622,11 +7622,11 @@ ActionImport (int argc, char **argv, Coord x, Coord y)
 	}
       else if (strcasecmp (xs, "mark") == 0)
 	{
-	  if (Marked.status)
-	    {
-	      x = Marked.X;
-	      y = Marked.Y;
-	    }
+	  if (!Marked.status)
+	    return 0;
+
+	  x = Marked.X;
+	  y = Marked.Y;
 	}
       else if (ys)
 	{

commit 0a29589df9e28a33e6594d6f1ade84a94e5fb93a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/png/png.c: Remove buggy code for swapping x1/x2 and y1/y2
    
    Since the png hid works, and this code is ineffective due to a typo,
    we probably ought to remove it.
    
    (Caught by clang)

diff --git a/src/hid/png/png.c b/src/hid/png/png.c
index ff8931a..892696b 100644
--- a/src/hid/png/png.c
+++ b/src/hid/png/png.c
@@ -1425,18 +1425,6 @@ png_fill_rect (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
   gdImageSetThickness (im, 0);
   linewidth = 0;
 
-  if (x1 > x2)
-    {
-      Coord t = x1;
-      x2 = x2;
-      x2 = t;
-    }
-  if (y1 > y2)
-    {
-      Coord t = y1;
-      y2 = y2;
-      y2 = t;
-    }
   y1 -= bloat;
   y2 += bloat;
   SWAP_IF_SOLDER (y1, y2);

commit 24afcc1d0ca0a441d76e9fbe5f811c2a6414f156
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gerber.c: Tidy up use_gc() routine to avoid a static anlysis warning
    
    Don't unconditionally access the aptr variable right after we
    just NULL tested it.
    
    (Caught by clang)

diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 3930941..97a7c29 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -951,7 +951,7 @@ use_gc (hidGC gc, int radius)
       if (aptr == NULL)
         pcb_fprintf (stderr, "error: aperture for width %$mS type %s is null\n",
                  linewidth, shape == ROUND ? "ROUND" : "SQUARE");
-      if (f)
+      else if (f)
 	fprintf (f, "G54D%d*", aptr->dCode);
     }
 }

commit ecfc7cf8fa31f4384dbe6d8117a0d7b3bf678f32
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gerber: Fix a couple of typos in drill_sort routine
    
    Should fix sorting of drill holes by coordinate.
    
    (Caught by clang)

diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index ce20e3b..3930941 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -628,8 +628,8 @@ drill_sort (const void *va, const void *vb)
   if (a->diam != b->diam)
     return a->diam - b->diam;
   if (a->x != b->x)
-    return a->x - a->x;
-  return b->y - b->y;
+    return a->x - b->x;
+  return a->y - b->y;
 }
 
 static int

commit 2e56554091204c2f902ce8dc90525fee4635ce39
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gerber: Remove dead colour selection code

diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index be6a7c4..ce20e3b 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -304,7 +304,6 @@ static int pagecount = 0;
 static int linewidth = -1;
 static int lastgroup = -1;
 static int lastcap = -1;
-static int lastcolor = -1;
 static int print_group[MAX_LAYER];
 static int print_layer[MAX_LAYER];
 static int lastX, lastY;	/* the last X and Y coordinate */
@@ -588,7 +587,6 @@ gerber_do_export (HID_Attr_Val * options)
   linewidth = -1;
   lastcap = -1;
   lastgroup = -1;
-  lastcolor = -1;
 
   region.X1 = 0;
   region.Y1 = 0;
@@ -704,7 +702,6 @@ gerber_set_layer (const char *name, int group, int empty)
       lastgroup = group;
       lastX = -1;
       lastY = -1;
-      lastcolor = 0;
       linewidth = -1;
       lastcap = -1;
 
@@ -957,30 +954,6 @@ use_gc (hidGC gc, int radius)
       if (f)
 	fprintf (f, "G54D%d*", aptr->dCode);
     }
-#if 0
-  if (lastcolor != gc->color)
-    {
-      c = gc->color;
-      if (is_drill)
-	return;
-      if (is_mask)
-	c = (gc->erase ? 0 : 1);
-      lastcolor = gc->color;
-      if (f)
-	{
-	  if (c)
-	    {
-	      fprintf (f, "%%LN%s_C%d*%%\r\n", layername, lncount++);
-	      fprintf (f, "%%LPC*%%\r\n");
-	    }
-	  else
-	    {
-	      fprintf (f, "%%LN%s_D%d*%%\r\n", layername, lncount++);
-	      fprintf (f, "%%LPD*%%\r\n");
-	    }
-	}
-    }
-#endif
 }
 
 static void

commit b283c195c46d273ef0cebd1f614ef35378604d98
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Remove dead colour selection code from nelma and gcode hids
    
    (Silences some unused code warnings from clang)

diff --git a/src/hid/gcode/gcode.c b/src/hid/gcode/gcode.c
index 17bbae1..a3e1bfd 100644
--- a/src/hid/gcode/gcode.c
+++ b/src/hid/gcode/gcode.c
@@ -86,7 +86,6 @@ struct hid_gc_struct
   int width;
   unsigned char r, g, b;
   int erase;
-  int faded;
   struct color_struct *color;
   gdImagePtr brush;
 };
@@ -94,7 +93,6 @@ struct hid_gc_struct
 static struct color_struct *black = NULL, *white = NULL;
 static int linewidth = -1;
 static gdImagePtr lastbrush = (gdImagePtr)((void *) -1);
-static int lastcolor = -1;
 
 /* gd image and file for PNG export */
 static gdImagePtr gcode_im = NULL;
@@ -421,7 +419,6 @@ gcode_start_png_export ()
 
   linewidth = -1;
   lastbrush = (gdImagePtr)((void *) -1);
-  lastcolor = -1;
 
   hid_expose_callback (&gcode_hid, &region, 0);
 }
@@ -839,7 +836,6 @@ gcode_set_draw_xor (hidGC gc, int xor_)
 static void
 gcode_set_draw_faded (hidGC gc, int faded)
 {
-  gc->faded = faded;
 }
 
 static void
@@ -927,37 +923,6 @@ use_gc (hidGC gc)
       lastbrush = gc->brush;
 
     }
-#define CBLEND(gc) (((gc->r)<<24)|((gc->g)<<16)|((gc->b)<<8)|(gc->faded))
-  if (lastcolor != CBLEND (gc))
-    {
-      if (is_drill || is_mask)
-        {
-#ifdef FIXME
-          fprintf (f, "%d gray\n", gc->erase ? 0 : 1);
-#endif
-          lastcolor = 0;
-        }
-      else
-        {
-          double r, g, b;
-          r = gc->r;
-          g = gc->g;
-          b = gc->b;
-          if (gc->faded)
-            {
-              r = 0.8 * 255 + 0.2 * r;
-              g = 0.8 * 255 + 0.2 * g;
-              b = 0.8 * 255 + 0.2 * b;
-            }
-#ifdef FIXME
-          if (gc->r == gc->g && gc->g == gc->b)
-            fprintf (f, "%g gray\n", r / 255.0);
-          else
-            fprintf (f, "%g %g %g rgb\n", r / 255.0, g / 255.0, b / 255.0);
-#endif
-          lastcolor = CBLEND (gc);
-        }
-    }
 }
 
 static void
diff --git a/src/hid/nelma/nelma.c b/src/hid/nelma/nelma.c
index 9659b66..9e75927 100644
--- a/src/hid/nelma/nelma.c
+++ b/src/hid/nelma/nelma.c
@@ -102,7 +102,6 @@ struct hid_gc_struct {
 	Coord           width;
 	unsigned char   r, g, b;
 	int             erase;
-	int             faded;
 	struct color_struct *color;
 	gdImagePtr      brush;
 };
@@ -112,7 +111,6 @@ static HID nelma_hid;
 static struct color_struct *black = NULL, *white = NULL;
 static Coord    linewidth = -1;
 static gdImagePtr lastbrush = (gdImagePtr)((void *) -1);
-static int      lastcolor = -1;
 
 /* gd image and file for PNG export */
 static gdImagePtr nelma_im = NULL;
@@ -648,7 +646,6 @@ nelma_start_png_export()
 
 	linewidth = -1;
 	lastbrush = (gdImagePtr)((void *) -1);
-	lastcolor = -1;
 
 	hid_expose_callback(&nelma_hid, &region, 0);
 }
@@ -832,7 +829,6 @@ nelma_set_draw_xor(hidGC gc, int xor_)
 static void
 nelma_set_draw_faded(hidGC gc, int faded)
 {
-	gc->faded = faded;
 }
 
 static void
@@ -911,32 +907,6 @@ use_gc(hidGC gc)
 		lastbrush = gc->brush;
 
 	}
-#define CBLEND(gc) (((gc->r)<<24)|((gc->g)<<16)|((gc->b)<<8)|(gc->faded))
-	if (lastcolor != CBLEND(gc)) {
-		if (is_drill || is_mask) {
-#ifdef FIXME
-			fprintf(f, "%d gray\n", gc->erase ? 0 : 1);
-#endif
-			lastcolor = 0;
-		} else {
-			double          r, g, b;
-			r = gc->r;
-			g = gc->g;
-			b = gc->b;
-			if (gc->faded) {
-				r = 0.8 * 255 + 0.2 * r;
-				g = 0.8 * 255 + 0.2 * g;
-				b = 0.8 * 255 + 0.2 * b;
-			}
-#ifdef FIXME
-			if (gc->r == gc->g && gc->g == gc->b)
-				fprintf(f, "%g gray\n", r / 255.0);
-			else
-				fprintf(f, "%g %g %g rgb\n", r / 255.0, g / 255.0, b / 255.0);
-#endif
-			lastcolor = CBLEND(gc);
-		}
-	}
 }
 
 static void

commit 5b2e2886b4802d5ee964ca0fbf7efec67562c919
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    action.c: Fixup some syntax so it appears as legal C before macro expansion
    
    "if TEST_FLAG (...) {" does not look like legal C until the TEST_FLAG macro
    is expanded. This works because the macro is wrapped with a () like all
    good function-like pre-processor macros.
    
    This bad style was upsetting cppcheck, which flagged up a syntax error for
    this line. (Obviously it was not expanding macros before checking).

diff --git a/src/action.c b/src/action.c
index 2a0be9e..c1325ba 100644
--- a/src/action.c
+++ b/src/action.c
@@ -2679,8 +2679,7 @@ ActionDisplay (int argc, char **argv, Coord childX, Coord childY)
 
 	case F_CycleClip:
 	  notify_crosshair_change (false);
-	  if TEST_FLAG
-	    (ALLDIRECTIONFLAG, PCB)
+	  if (TEST_FLAG (ALLDIRECTIONFLAG, PCB))
 	    {
 	      TOGGLE_FLAG (ALLDIRECTIONFLAG, PCB);
 	      PCB->Clipping = 0;

commit 75c28777f1063e25419215138baab4e0e60f73d6
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Remove some assigned, but unused variables in the netlist window
    
    (Caught with clang)

diff --git a/src/hid/gtk/gui-netlist-window.c b/src/hid/gtk/gui-netlist-window.c
index f87491d..a847e6d 100644
--- a/src/hid/gtk/gui-netlist-window.c
+++ b/src/hid/gtk/gui-netlist-window.c
@@ -71,7 +71,6 @@ static GtkWidget	*disable_all_button;
 
 static GtkTreeModel *node_model;
 static GtkTreeView *node_treeview;
-static GtkTreeSelection *node_selection;
 
 static gboolean selection_holdoff;
 
@@ -701,7 +700,6 @@ ghid_netlist_window_create (GHidPort * out)
   GtkWidget *vbox, *hbox, *button, *label, *sep;
   GtkTreeView *treeview;
   GtkTreeModel *model;
-  GtkTreeSelection *selection;
   GtkCellRenderer *renderer;
   GtkTreeViewColumn *column;
 
@@ -760,10 +758,10 @@ ghid_netlist_window_create (GHidPort * out)
    */
   gtk_tree_view_expand_all (treeview);
 
-  selection = ghid_scrolled_selection (treeview, hbox,
-				       GTK_SELECTION_SINGLE,
-				       GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC,
-				       net_selection_changed_cb, NULL);
+  ghid_scrolled_selection (treeview, hbox,
+                           GTK_SELECTION_SINGLE,
+                           GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC,
+                           net_selection_changed_cb, NULL);
 
   /* Connect to the double click event.
    */
@@ -785,11 +783,10 @@ ghid_netlist_window_create (GHidPort * out)
 					       "text", NODE_NAME_COLUMN,
 					       NULL);
 
-  selection = ghid_scrolled_selection (treeview, hbox,
-				       GTK_SELECTION_SINGLE,
-				       GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC,
-				       node_selection_changed_cb, NULL);
-  node_selection = selection;
+  ghid_scrolled_selection (treeview, hbox,
+                           GTK_SELECTION_SINGLE,
+                           GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC,
+                           node_selection_changed_cb, NULL);
 
   hbox = gtk_hbox_new (FALSE, 0);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);

commit 4953e452ed735868d4d47194fc2c2c2eec9b944a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Fix broken pad-center finding code in the netlist window
    
    Looks like I made a copy+paste error in the code which shows the user
    the location of a particular netlist connection.
    
    (Caught with clang)

diff --git a/src/hid/gtk/gui-netlist-window.c b/src/hid/gtk/gui-netlist-window.c
index 35b5427..f87491d 100644
--- a/src/hid/gtk/gui-netlist-window.c
+++ b/src/hid/gtk/gui-netlist-window.c
@@ -295,7 +295,7 @@ node_selection_changed_cb (GtkTreeSelection * selection, gpointer data)
         {
           PadTypePtr pad = (PadTypePtr) conn.ptr2;
           x = pad->Point1.X + (pad->Point2.X - pad->Point1.X) / 2;
-          y = pad->Point1.Y + (pad->Point2.Y - pad->Point2.Y) / 2;
+          y = pad->Point1.Y + (pad->Point2.Y - pad->Point1.Y) / 2;
           gui->set_crosshair (x, y, 0);
           ghid_lead_user_to_location (x, y);
           break;




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs