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

gEDA-cvs: pcb.git: branch: master updated (54c04e4d07ac74e5deabded920313f170056da67)



The branch, master has been updated
       via  54c04e4d07ac74e5deabded920313f170056da67 (commit)
       via  d8701b55d2175778310e54b389fb28d7bbde796b (commit)
       via  e84b4de335e2b8ff9d5278b407a5670bbf19212c (commit)
       via  398035f5d81e83178387452942f0c1e7224c4527 (commit)
       via  d592980b0af4763f1c6922edb95b2fef96093285 (commit)
       via  c3c6c802775c42ca6cd75eabaf294d155ddd6f15 (commit)
       via  f62032b5d54ce75260155e027b1331ab87e901cd (commit)
       via  9e3d49e0818de1ead86439288a8d4187274707cd (commit)
       via  e7e3e3475e33391e45d42c4251d1204fdc0d4808 (commit)
       via  f1f60b2242b416be83a4d8311056f6369b0e0fec (commit)
       via  8be7f9d519426c349c13f0f330cd60ce7c45e2ef (commit)
       via  f650381545bd92861eddb809d18216ebd3b57b17 (commit)
       via  4b447cfa4a2dbf1823961ef2619f12b29f49fc1f (commit)
       via  28657c667c96592bd055e6a4b54ddaafb1439b0a (commit)
       via  2d396f64b331748ee4b163afbc5e568c3c49833e (commit)
       via  29b0ab3a32aa445544402df46ef2106babd18ce7 (commit)
       via  74d35e5730047eb707b53149472799b1dbfbc974 (commit)
      from  9e33678b20433f571c54009c704e75d114a3ea10 (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                     |    9 ++-----
 src/autoroute.c                  |    6 +++++
 src/copy.c                       |    3 --
 src/djopt.c                      |    4 ---
 src/find.c                       |    5 ----
 src/fontmode.c                   |    3 +-
 src/hid/bom/bom.c                |    5 +---
 src/hid/gcode/trace.c            |    6 -----
 src/hid/gtk/gtkhid-main.c        |   16 +-------------
 src/hid/gtk/gui-library-window.c |    2 -
 src/hid/gtk/gui-top-window.c     |    5 +---
 src/line.c                       |    6 ++++-
 src/polygon1.c                   |   13 +++++++++--
 src/print.c                      |    2 -
 src/puller.c                     |   16 ++++++++++----
 src/rtree.c                      |    9 +++++++-
 src/toporouter.c                 |   39 +++++++++++++++----------------------
 src/undo.c                       |   22 +++++++-------------
 18 files changed, 72 insertions(+), 99 deletions(-)


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

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

    line.c: Fix a bogus compiler warning regarding a (X + c) >= X being always true.
    
    line.c: In function â??EnforceLineDRCâ??:
    line.c:491:7: warning: assuming signed overflow does not occur when assuming that (X + c) >= X is always true [-Wstrict-overflow]
    
    It would appear that gcc (4.6.1-5ubuntu1) is identifying the conditional
    portions of INDEXOFCURRENT which would always evaluate a particular way
    if a given condition is met. It is "probably" safe to assume that this
    warning manifests due to gcc considering each portion of the INDEXOFCURRENT
    definition in turn.
    
    It appears we can avoid this particular warning by temporarily assigning
    INDEXOFCURRENT into a variable before we test with it.

:100644 100644 0411afc... 7da09dc... M	src/line.c

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

    toporouter.c: Fixup warnings due to assigned but unused variables
    
    As I'm not 100% familiar with this code, I have commented out some of
    the redundant code rather than deleting it completely.

:100644 100644 5a82b14... 3b52f24... M	src/toporouter.c

commit 398035f5d81e83178387452942f0c1e7224c4527
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    undo.c: Fixup warnings due to assigned but unused variables

:100644 100644 21b86f4... 971c771... M	src/undo.c

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

    rtree.c: Fixup warnings due to assigned but unused variables
    
    Adds a nasty cludge using #ifndef NDEBUG around a variable assignment
    which is only used in a later assert() statement. (NB: assert()
    evaluates to nothing if NDEBUG is defined).

:100644 100644 526d2b7... 680be3d... M	src/rtree.c

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

    print.c: Fixup warnings due to assigned but unused variables

:100644 100644 1e3abc0... 7e7e412... M	src/print.c

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

    puller.c: Fixup warnings due to assigned but unused variables

:100644 100644 8550872... 2fd37bc... M	src/puller.c

commit 9e3d49e0818de1ead86439288a8d4187274707cd
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    polygon1.c: Fixup warnings due to assigned but unused variables
    
    Adds a nasty cludge using #ifndef NDEBUG around a variable assignment
    which is only used in a later assert() statement. (NB: assert()
    evaluates to nothing if NDEBUG is defined).

:100644 100644 70d553f... ffb1542... M	src/polygon1.c

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

    fontmode.c: Fixup warnings due to assigned but unused variables

:100644 100644 69d61ea... 2575a33... M	src/fontmode.c

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

    find.c: Fixup warnings due to assigned but unused variables

:100644 100644 c5159ba... 92c8b35... M	src/find.c

commit 8be7f9d519426c349c13f0f330cd60ce7c45e2ef
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    djopt.c: Fixup warnings due to assigned but unused variables

:100644 100644 0b00d8e... d25d621... M	src/djopt.c

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

    copy.c: Fixup warnings due to assigned but unused variables

:100644 100644 b93fcfb... 4091389... M	src/copy.c

commit 4b447cfa4a2dbf1823961ef2619f12b29f49fc1f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    autoroute.c: Fixup warnings due to assigned but unused variables
    
    Adds a nasty cludge using #ifndef NDEBUG around a variable assignment
    which is only used in a later assert() statement. (NB: assert()
    evaluates to nothing if NDEBUG is defined).

:100644 100644 c799e93... 63ab15c... M	src/autoroute.c

commit 28657c667c96592bd055e6a4b54ddaafb1439b0a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    action.c: Fixup warnings due to assigned but unused variables

:100644 100644 8b7e6d5... 9b67924... M	src/action.c

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

    hid/gcode: Fixup warnings due to assigned but unused variables

:100644 100644 8d7e5e6... 7fb9012... M	src/hid/gcode/trace.c

commit 29b0ab3a32aa445544402df46ef2106babd18ce7
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/bom: Fixup warnings due to assigned but unused variables

:100644 100644 0870bb5... 89bd6eb... M	src/hid/bom/bom.c

commit 74d35e5730047eb707b53149472799b1dbfbc974
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Fixup warnings due to assigned but unused variables

:100644 100644 2fcb37b... 6a8d904... M	src/hid/gtk/gtkhid-main.c
:100644 100644 3c0c077... 0339cf0... M	src/hid/gtk/gui-library-window.c
:100644 100644 b5caff9... b11d32c... M	src/hid/gtk/gui-top-window.c

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

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

    line.c: Fix a bogus compiler warning regarding a (X + c) >= X being always true.
    
    line.c: In function â??EnforceLineDRCâ??:
    line.c:491:7: warning: assuming signed overflow does not occur when assuming that (X + c) >= X is always true [-Wstrict-overflow]
    
    It would appear that gcc (4.6.1-5ubuntu1) is identifying the conditional
    portions of INDEXOFCURRENT which would always evaluate a particular way
    if a given condition is met. It is "probably" safe to assume that this
    warning manifests due to gcc considering each portion of the INDEXOFCURRENT
    definition in turn.
    
    It appears we can avoid this particular warning by temporarily assigning
    INDEXOFCURRENT into a variable before we test with it.

diff --git a/src/line.c b/src/line.c
index 0411afc..7da09dc 100644
--- a/src/line.c
+++ b/src/line.c
@@ -487,9 +487,13 @@ EnforceLineDRC (void)
   bool shift;
   float r1, r2;
 
+  /* Silence a bogus compiler warning by storing this in a variable */
+  int layer_idx = INDEXOFCURRENT;
+
   if ( gui->mod1_is_pressed() || gui->control_is_pressed () || PCB->RatDraw
-      || INDEXOFCURRENT >= max_copper_layer)
+      || layer_idx >= max_copper_layer)
     return;
+
   rs.X = r45.X = Crosshair.X;
   rs.Y = r45.Y = Crosshair.Y;
   /* first try starting straight */

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

    toporouter.c: Fixup warnings due to assigned but unused variables
    
    As I'm not 100% familiar with this code, I have commented out some of
    the redundant code rather than deleting it completely.

diff --git a/src/toporouter.c b/src/toporouter.c
index 5a82b14..3b52f24 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -1487,13 +1487,10 @@ vertices_plane_distance(toporouter_spoint_t *a, toporouter_spoint_t *b) {
 static inline void
 vertex_outside_segment(toporouter_spoint_t *a, toporouter_spoint_t *b, gdouble r, toporouter_spoint_t *p) 
 {
-  gdouble m;
   toporouter_spoint_t temp[2];
 
-  m = vertex_gradient(a,b);
-  
   vertices_on_line(a, vertex_gradient(a,b), r, &temp[0], &temp[1]);
-  
+
   if(vertices_plane_distance(&temp[0], b) > vertices_plane_distance(&temp[1], b)) {
     p->x = temp[0].x;
     p->y = temp[0].y;
@@ -1905,7 +1902,6 @@ read_pads(toporouter_t *r, toporouter_layer_t *l, guint layer)
 {
   toporouter_spoint_t p[2], rv[5];
   gdouble x[2], y[2], t, m;
-  GList *objectconstraints;
 
   GList *vlist = NULL;
   toporouter_bbox_t *bbox = NULL;
@@ -1926,8 +1922,6 @@ read_pads(toporouter_t *r, toporouter_layer_t *l, guint layer)
       if( (l - r->layers == back && TEST_FLAG(ONSOLDERFLAG, pad)) || 
           (l - r->layers == front && !TEST_FLAG(ONSOLDERFLAG, pad)) ) {
 
-
-        objectconstraints = NULL;
         t = (gdouble)pad->Thickness / 2.0f;
         x[0] = pad->Point1.X;
         x[1] = pad->Point2.X;
@@ -3407,8 +3401,11 @@ gdouble
 triangle_interior_capacity(GtsTriangle *t, toporouter_vertex_t *v)
 {
   toporouter_edge_t *e = TOPOROUTER_EDGE(gts_triangle_edge_opposite(t, GTS_VERTEX(v)));
-  gdouble x, y, m1, m2, c2, c1, len;
-  
+  gdouble x, y, m1, m2, c2, c1;
+#ifdef DEBUG_ROUTE
+  gdouble len;
+#endif
+
   g_assert(e);
 
   m1 = toporouter_edge_gradient(e);
@@ -3425,9 +3422,8 @@ triangle_interior_capacity(GtsTriangle *t, toporouter_vertex_t *v)
 
   y = (isinf(m2)) ? vy(edge_v1(e)) : (m2 * x) + c2;
 
-  len = gts_point_distance2(GTS_POINT(edge_v1(e)), GTS_POINT(edge_v2(e)));
-
 #ifdef DEBUG_ROUTE
+  len = gts_point_distance2(GTS_POINT(edge_v1(e)), GTS_POINT(edge_v2(e)));
   printf("%f,%f len = %f v = %f,%f\n", x, y, len, vx(v), vy(v));
 #endif
 
@@ -4843,7 +4839,7 @@ route(toporouter_t *r, toporouter_route_t *data, guint debug)
   gint count = 0;
 
   toporouter_vertex_t *srcv = NULL, *destv = NULL, *curpoint = NULL;
-  toporouter_layer_t *cur_layer, *dest_layer;
+  toporouter_layer_t *cur_layer; //, *dest_layer;
 
   g_assert(data->src->c != data->dest->c);
   
@@ -4858,7 +4854,8 @@ route(toporouter_t *r, toporouter_route_t *data, guint debug)
   if(!curpoint || !destv) goto routing_return;
 
   srcv = curpoint;
-  cur_layer = vlayer(curpoint); dest_layer = vlayer(destv);
+  cur_layer = vlayer(curpoint);
+  //dest_layer = vlayer(destv);
 
   data->path = NULL; 
   
@@ -4897,7 +4894,7 @@ route(toporouter_t *r, toporouter_route_t *data, guint debug)
         tempv = closest_dest_vertex(r, curpoint, data);
         if(tempv) {
           destv = tempv;
-          dest_layer = vlayer(destv);//&r->layers[(int)vz(destv)];
+          //dest_layer = vlayer(destv);//&r->layers[(int)vz(destv)];
 
         }
       }
@@ -5521,18 +5518,13 @@ gdouble
 export_pcb_drawarc(guint layer, toporouter_arc_t *a, guint thickness, guint keepaway) 
 {
   gdouble sa, da, theta;
-  gdouble x0, y0, x1, y1, d=0.;
+  gdouble d = 0.;
   ArcTypePtr arc;
   gint wind;
 
   wind = coord_wind(a->x0, a->y0, a->x1, a->y1, vx(a->centre), vy(a->centre));
 
   sa = coord_xangle(a->x0, a->y0, vx(a->centre), vy(a->centre)) * 180. / M_PI;
-  
-  x0 = a->x0 - vx(a->centre);
-  x1 = a->x1 - vx(a->centre);
-  y0 = a->y0 - vy(a->centre);
-  y1 = a->y1 - vy(a->centre);
 
   theta = arc_angle(a);
 
@@ -6201,17 +6193,18 @@ check_adj_pushing_vertex(toporouter_oproute_t *oproute, gdouble x0, gdouble y0,
     if(vertex_line_normal_intersection(x0, y0, x1, y1, vx(n), vy(n), &segintx, &seginty)) {
       toporouter_edge_t *e = tedge(n, v);
       gdouble ms = 0., d = coord_distance(segintx, seginty, vx(n), vy(n));
-      toporouter_vertex_t *a, *b;
+      //toporouter_vertex_t *a;
+      toporouter_vertex_t *b;
       GList *closestnet = NULL;
 
       g_assert(e);
 
       if(v == tedge_v1(e)) {
-        a = tedge_v1(e);
+        //a = tedge_v1(e);
         b = tedge_v2(e);
         closestnet = edge_routing(e);
       }else{
-        a = tedge_v2(e);
+        //a = tedge_v2(e);
         b = tedge_v1(e);
         closestnet = g_list_last(edge_routing(e));
       }

commit 398035f5d81e83178387452942f0c1e7224c4527
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    undo.c: Fixup warnings due to assigned but unused variables

diff --git a/src/undo.c b/src/undo.c
index 21b86f4..971c771 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -1288,16 +1288,14 @@ AddObjectToRotateUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3,
 void
 MoveObjectToRemoveUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3)
 {
-  UndoListTypePtr undo;
+  if (Locked)
+    return;
 
-  if (!Locked)
-    {
-      if (!RemoveList)
-	RemoveList = CreateNewBuffer ();
+  if (!RemoveList)
+    RemoveList = CreateNewBuffer ();
 
-      undo = GetUndoSlot (UNDO_REMOVE, OBJECT_ID (Ptr3), Type);
-      MoveObjectToBuffer (RemoveList, PCB->Data, Type, Ptr1, Ptr2, Ptr3);
-    }
+  GetUndoSlot (UNDO_REMOVE, OBJECT_ID (Ptr3), Type);
+  MoveObjectToBuffer (RemoveList, PCB->Data, Type, Ptr1, Ptr2, Ptr3);
 }
 
 /* ---------------------------------------------------------------------------
@@ -1351,10 +1349,8 @@ AddObjectToRemovePointUndoList (int Type,
 void
 AddObjectToInsertPointUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3)
 {
-  UndoListTypePtr undo;
-
   if (!Locked)
-    undo = GetUndoSlot (UNDO_INSERT_POINT, OBJECT_ID (Ptr3), Type);
+    GetUndoSlot (UNDO_INSERT_POINT, OBJECT_ID (Ptr3), Type);
 }
 
 static void
@@ -1451,10 +1447,8 @@ AddObjectToMoveToLayerUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3)
 void
 AddObjectToCreateUndoList (int Type, void *Ptr1, void *Ptr2, void *Ptr3)
 {
-  UndoListTypePtr undo;
-
   if (!Locked)
-    undo = GetUndoSlot (UNDO_CREATE, OBJECT_ID (Ptr3), Type);
+    GetUndoSlot (UNDO_CREATE, OBJECT_ID (Ptr3), Type);
   ClearFromPolygon (PCB->Data, Type, Ptr1, Ptr2);
 }
 

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

    rtree.c: Fixup warnings due to assigned but unused variables
    
    Adds a nasty cludge using #ifndef NDEBUG around a variable assignment
    which is only used in a later assert() statement. (NB: assert()
    evaluates to nothing if NDEBUG is defined).

diff --git a/src/rtree.c b/src/rtree.c
index 526d2b7..680be3d 100644
--- a/src/rtree.c
+++ b/src/rtree.c
@@ -596,12 +596,19 @@ int
 r_region_is_empty (rtree_t * rtree, const BoxType * region)
 {
   jmp_buf env;
+#ifndef NDEBUG
   int r;
+#endif
 
   if (setjmp (env))
     return 0;
-  r = r_search (rtree, region, NULL, __r_region_is_empty_rect_in_reg, &env);
+#ifndef NDEBUG
+  r =
+#endif
+    r_search (rtree, region, NULL, __r_region_is_empty_rect_in_reg, &env);
+#ifndef NDEBUG
   assert (r == 0);              /* otherwise longjmp would have been called */
+#endif
   return 1;                     /* no rectangles found */
 }
 

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

    print.c: Fixup warnings due to assigned but unused variables

diff --git a/src/print.c b/src/print.c
index 1e3abc0..7e7e412 100644
--- a/src/print.c
+++ b/src/print.c
@@ -222,12 +222,10 @@ PrintFab_overhang (void)
 void
 PrintFab (hidGC gc)
 {
-  PinType tmp_pin;
   DrillInfoTypePtr AllDrills;
   int i, n, yoff, total_drills = 0, ds = 0;
   time_t currenttime;
   char utcTime[64];
-  tmp_pin.Flags = NoFlags ();
   AllDrills = GetDrillInfo (PCB->Data);
   RoundDrillInfo (AllDrills, MIL_TO_COORD(1));
   yoff = -TEXT_LINE;

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

    puller.c: Fixup warnings due to assigned but unused variables

diff --git a/src/puller.c b/src/puller.c
index 8550872..2fd37bc 100644
--- a/src/puller.c
+++ b/src/puller.c
@@ -427,7 +427,10 @@ arc-line intersection was moved to.
 static int
 Puller (int argc, char **argv, int Ux, int Uy)
 {
-  double arc_angle, line_angle, rel_angle, base_angle;
+  double arc_angle, base_angle;
+#if TRACE1
+  double line_angle, rel_angle;
+#endif
   double tangent;
   int new_delta_angle;
 
@@ -484,13 +487,13 @@ Puller (int argc, char **argv, int Ux, int Uy)
     arc_angle = the_arc->StartAngle + the_arc->Delta + 90;
   else
     arc_angle = the_arc->StartAngle + the_arc->Delta - 90;
-  line_angle = r2d (atan2 (ey - y, x - ex));
-  rel_angle = line_angle - arc_angle;
   base_angle = r2d (atan2 (ey - cy, cx - ex));
 
   tangent = r2d (acos (the_arc->Width / Distance (cx, cy, ex, ey)));
 
 #if TRACE1
+  line_angle = r2d (atan2 (ey - y, x - ex));
+  rel_angle = line_angle - arc_angle;
   printf ("arc %g line %g rel %g base %g\n", arc_angle, line_angle, rel_angle,
 	  base_angle);
   printf ("tangent %g\n", tangent);
@@ -1827,15 +1830,18 @@ gp_pad_cb (const BoxType *b, void *cb)
 static LineTypePtr
 create_line (LineTypePtr sample, int x1, int y1, int x2, int y2)
 {
-  Extra *e;
 #if TRACE1
+  Extra *e;
   pcb_printf("create_line from %#mD to %#mD\n", x1, y1, x2, y2);
 #endif
   LineTypePtr line = CreateNewLineOnLayer (CURRENT, x1, y1, x2, y2,
 					   sample->Thickness, sample->Clearance, sample->Flags);
   AddObjectToCreateUndoList (LINE_TYPE, CURRENT, line, line);
 
-  e = new_line_extra (line);
+#if TRACE1
+  e =
+#endif
+    new_line_extra (line);
 #if TRACE1
   printf(" - line extra is %p\n", e);
 #endif

commit 9e3d49e0818de1ead86439288a8d4187274707cd
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    polygon1.c: Fixup warnings due to assigned but unused variables
    
    Adds a nasty cludge using #ifndef NDEBUG around a variable assignment
    which is only used in a later assert() statement. (NB: assert()
    evaluates to nothing if NDEBUG is defined).

diff --git a/src/polygon1.c b/src/polygon1.c
index 70d553f..ffb1542 100644
--- a/src/polygon1.c
+++ b/src/polygon1.c
@@ -1980,7 +1980,7 @@ M_POLYAREA_update_primary (jmp_buf * e, POLYAREA ** pieces,
   POLYAREA *anext;
   PLINE *curc, *next, *prev;
   BoxType box;
-  int inv_inside = 0;
+  /* int inv_inside = 0; */
   int del_inside = 0;
   int del_outside = 0;
   int finished;
@@ -1998,7 +1998,7 @@ M_POLYAREA_update_primary (jmp_buf * e, POLYAREA ** pieces,
       del_inside = 1;
       break;
     case PBO_XOR:		/* NOT IMPLEMENTED OR USED */
-      inv_inside = 1;
+      /* inv_inside = 1; */
       assert (0);
       break;
     }
@@ -2649,7 +2649,9 @@ void
 poly_InvContour (PLINE * c)
 {
   VNODE *cur, *next;
+#ifndef NDEBUG
   int r;
+#endif
 
   assert (c != NULL);
   cur = &c->head;
@@ -2664,8 +2666,13 @@ poly_InvContour (PLINE * c)
   c->Flags.orient ^= 1;
   if (c->tree)
     {
-      r = r_search (c->tree, NULL, NULL, flip_cb, NULL);
+#ifndef NDEBUG
+      r =
+#endif
+        r_search (c->tree, NULL, NULL, flip_cb, NULL);
+#ifndef NDEBUG
       assert (r == c->Count);
+#endif
     }
 }
 

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

    fontmode.c: Fixup warnings due to assigned but unused variables

diff --git a/src/fontmode.c b/src/fontmode.c
index 69d61ea..2575a33 100644
--- a/src/fontmode.c
+++ b/src/fontmode.c
@@ -220,11 +220,10 @@ FontSave (int argc, char **argv, int Ux, int Uy)
       LineType *l = ii->data;
       int x1 = l->Point1.X;
       int y1 = l->Point1.Y;
-      int ox, oy, s;
+      int ox, s;
 
       s = XYtoSym (x1, y1);
       ox = (s % 16 + 1) * CELL_SIZE;
-      oy = (s / 16 + 1) * CELL_SIZE;
       symbol = &PCB->Font.Symbol[s];
 
       x1 -= ox;

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

    find.c: Fixup warnings due to assigned but unused variables

diff --git a/src/find.c b/src/find.c
index c5159ba..92c8b35 100644
--- a/src/find.c
+++ b/src/find.c
@@ -1927,13 +1927,8 @@ static bool
 LookupLOConnectionsToArc (ArcTypePtr Arc, Cardinal LayerGroup)
 {
   Cardinal entry;
-  LocationType xlow, xhigh;
   struct lo_info info;
 
-  /* the maximum possible distance */
-  xlow = Arc->BoundingBox.X1 - MAX (MAX_PADSIZE, MAX_LINESIZE) / 2;
-  xhigh = Arc->BoundingBox.X2 + MAX (MAX_PADSIZE, MAX_LINESIZE) / 2;
-
   info.arc = *Arc;
   EXPAND_BOUNDS (&info.arc);
   /* loop over all layers of the group */

commit 8be7f9d519426c349c13f0f330cd60ce7c45e2ef
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    djopt.c: Fixup warnings due to assigned but unused variables

diff --git a/src/djopt.c b/src/djopt.c
index 0b00d8e..d25d621 100644
--- a/src/djopt.c
+++ b/src/djopt.c
@@ -948,7 +948,6 @@ static int
 split_line (line_s * l, corner_s * c)
 {
   int i;
-  LayerType *layer;
   LineType *pcbline;
   line_s *ls;
 
@@ -965,7 +964,6 @@ split_line (line_s * l, corner_s * c)
     }
 
   check (c, l);
-  layer = PCB->Data->Layer + l->layer;
   pcbline = create_pcb_line (l->layer,
 			     c->x, c->y, l->e->x, l->e->y,
 			     l->line->Thickness, l->line->Clearance,
@@ -2558,7 +2556,6 @@ pinsnap ()
   PinType *pin;
   int again = 1;
 
-  corner_s *prev_c;
   int close = 0;
   corner_s *c2;
 
@@ -2575,7 +2572,6 @@ pinsnap ()
 	  if (!(c->pin || c->via || c->pad))
 	    continue;
 
-	  prev_c = c;
 	  pin = 0;
 
 	  dprintf ("\ncorner %s\n", corner_name (c));

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

    copy.c: Fixup warnings due to assigned but unused variables

diff --git a/src/copy.c b/src/copy.c
index b93fcfb..4091389 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -294,7 +294,6 @@ CopyElement (ElementTypePtr Element)
 	 Element->Name[1].TextString);
 #endif
 
-  bool didDraw = false;
   ElementTypePtr element = CopyElementLowLevel (PCB->Data,
 						NULL, Element,
 						TEST_FLAG (UNIQUENAMEFLAG,
@@ -307,12 +306,10 @@ CopyElement (ElementTypePtr Element)
     {
       DrawElementName (element);
       DrawElementPackage (element);
-      didDraw = true;
     }
   if (PCB->PinOn)
     {
       DrawElementPinsAndPads (element);
-      didDraw = true;
     }
 #ifdef DEBUG
   printf(" ... Leaving CopyElement.\n");

commit 4b447cfa4a2dbf1823961ef2619f12b29f49fc1f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    autoroute.c: Fixup warnings due to assigned but unused variables
    
    Adds a nasty cludge using #ifndef NDEBUG around a variable assignment
    which is only used in a later assert() statement. (NB: assert()
    evaluates to nothing if NDEBUG is defined).

diff --git a/src/autoroute.c b/src/autoroute.c
index c799e93..63ab15c 100644
--- a/src/autoroute.c
+++ b/src/autoroute.c
@@ -4751,7 +4751,9 @@ RouteAll (routedata_t * rd)
 	      p->flags.is_bad = 0;
 	      if (!p->flags.fixed)
 		{
+#ifndef NDEBUG
 		  bool del;
+#endif
 		  assert (!p->flags.homeless);
 		  if (rip)
 		    {
@@ -4773,10 +4775,14 @@ RouteAll (routedata_t * rd)
 		    {
 		      if (TEST_FLAG (LIVEROUTEFLAG, PCB))
 			ripout_livedraw_obj (p);
+#ifndef NDEBUG
 		      del =
+#endif
 			r_delete_entry (rd->layergrouptree[p->group],
 					&p->box);
+#ifndef NDEBUG
 		      assert (del);
+#endif
 		    }
 		  else
 		    {

commit 28657c667c96592bd055e6a4b54ddaafb1439b0a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    action.c: Fixup warnings due to assigned but unused variables

diff --git a/src/action.c b/src/action.c
index 8b7e6d5..9b67924 100644
--- a/src/action.c
+++ b/src/action.c
@@ -2404,12 +2404,11 @@ static int
 ActionDisperseElements (int argc, char **argv, int x, int y)
 {
   char *function = ARG (0);
-  long minx, miny, maxx, maxy, dx, dy;
+  long minx, miny, maxy, dx, dy;
   int all = 0, bad = 0;
 
   minx = GAP;
   miny = GAP;
-  maxx = GAP;
   maxy = GAP;
 
   if (!function || !*function)
@@ -7402,8 +7401,6 @@ tempfile_name_new (char * name)
 static int
 tempfile_unlink (char * name)
 {
-  int rc;
-
 #ifdef DEBUG
     /* SDB says:  Want to keep old temp files for examiniation when debugging */
   return 0;
@@ -7413,7 +7410,7 @@ tempfile_unlink (char * name)
   int e, rc2 = 0;
   char *dname;
 
-  rc = unlink (name);
+  unlink (name);
   /* it is possible that the file was never created so it is OK if the
      unlink fails */
 
@@ -7455,7 +7452,7 @@ tempfile_unlink (char * name)
   }
 
 #else
-  rc =  unlink (name);
+  int rc = unlink (name);
 
   if (rc != 0) {
     fprintf (stderr, _("Failed to unlink \"%s\"\n"), name);

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

    hid/gcode: Fixup warnings due to assigned but unused variables

diff --git a/src/hid/gcode/trace.c b/src/hid/gcode/trace.c
index 8d7e5e6..7fb9012 100644
--- a/src/hid/gcode/trace.c
+++ b/src/hid/gcode/trace.c
@@ -1406,10 +1406,7 @@ plotpolygon (privpath_t * pp, FILE * f, double scale)
   int i;
   int m = pp->m;
   int *po = pp->po;
-  int n = pp->len;
   point_t *pt = pp->pt;
-  int x0 = pp->x0;
-  int y0 = pp->y0;
   /* double scale=1.0/dpi; */
   double dm = 0;
 
@@ -1417,10 +1414,7 @@ plotpolygon (privpath_t * pp, FILE * f, double scale)
     return 0;
 
   po = pp->po;
-  n = pp->len;
   pt = pp->pt;
-  x0 = pp->x0;
-  y0 = pp->y0;
 
   fprintf (f, "G0 X%f Y%f    (start point)\n", pt[po[0]].x * scale,
 	   pt[po[0]].y * scale);

commit 29b0ab3a32aa445544402df46ef2106babd18ce7
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/bom: Fixup warnings due to assigned but unused variables

diff --git a/src/hid/bom/bom.c b/src/hid/bom/bom.c
index 0870bb5..89bd6eb 100644
--- a/src/hid/bom/bom.c
+++ b/src/hid/bom/bom.c
@@ -279,7 +279,7 @@ PrintBOM (void)
   double theta = 0.0;
   double sumx, sumy;
   double pin1x = 0.0, pin1y = 0.0, pin1angle = 0.0;
-  double pin2x = 0.0, pin2y = 0.0, pin2angle;
+  double pin2x = 0.0, pin2y = 0.0;
   int found_pin1;
   int found_pin2;
   int pin_cnt;
@@ -364,7 +364,6 @@ PrintBOM (void)
 	{
 	  pin2x = (double) pin->X;
 	  pin2y = (double) pin->Y;
-	  pin2angle = 0.0;	/* pins have no notion of angle */
 	  found_pin2 = 1;
 	}
     }
@@ -393,8 +392,6 @@ PrintBOM (void)
 	{
 	  pin2x = (double) (pad->Point1.X + pad->Point2.X) / 2.0;
 	  pin2y = (double) (pad->Point1.Y + pad->Point2.Y) / 2.0;
-	  pin2angle = (180.0 / M_PI) * atan2 (pad->Point1.Y - pad->Point2.Y,
-					      pad->Point2.X - pad->Point1.X);
 	  found_pin2 = 1;
 	}
 

commit 74d35e5730047eb707b53149472799b1dbfbc974
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Fixup warnings due to assigned but unused variables

diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 2fcb37b..6a8d904 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -127,7 +127,6 @@ Note that zoom factors of zero are silently ignored.
 static int
 Zoom (int argc, char **argv, int x, int y)
 {
-  double factor;
   const char *vp;
   double v;
 
@@ -161,17 +160,14 @@ Zoom (int argc, char **argv, int x, int y)
   switch (argv[0][0])
     {
     case '-':
-      factor = 1 / v;
       zoom_by (1 / v, x, y);
       break;
     default:
     case '+':
-      factor = v;
       zoom_by (v, x, y);
       break;
     case '=':
       /* this needs to set the scale factor absolutely*/
-      factor = 1.0;
       zoom_to (v, x, y);
       break;
     }
@@ -184,7 +180,9 @@ static void
 zoom_to (double new_zoom, int x, int y)
 {
   double max_zoom, xfrac, yfrac;
+#ifdef DEBUG
   int cx, cy;
+#endif
 
   /* gport->zoom:
    * zoom value is PCB units per screen pixel.  Larger numbers mean zooming
@@ -229,13 +227,11 @@ zoom_to (double new_zoom, int x, int y)
 #ifdef DEBUG
   printf ("max_zoom = %g, xfrac = %g, yfrac = %g, new_zoom = %g\n", 
 	  max_zoom, xfrac, yfrac, new_zoom);
-#endif
 
   /* find center x and y */
   cx = gport->view_x0 + gport->view_width * xfrac * gport->zoom;
   cy = gport->view_y0 + gport->view_height * yfrac * gport->zoom;
 
-#ifdef DEBUG
   pcb_printf ("zoom_to():  x0 = %#mS, cx = %#mS\n", gport->view_x0, cx);
   pcb_printf ("zoom_to():  y0 = %#mS, cy = %#mS\n", gport->view_y0, cy);
 #endif
@@ -376,11 +372,9 @@ ghid_set_crosshair (int x, int y, int action)
   if (action == HID_SC_PAN_VIEWPORT)
     {
       GdkDisplay *display;
-      GdkScreen *screen;
       gint pos_x, pos_y, xofs, yofs;
       
       display = gdk_display_get_default ();
-      screen = gdk_display_get_default_screen (display); 
       
       /* figure out where the pointer is relative to the display */ 
       gdk_display_get_pointer (display, NULL, &pos_x, &pos_y, NULL); 
@@ -1648,16 +1642,10 @@ Benchmark (int argc, char **argv, int x, int y)
 {
   int i = 0;
   time_t start, end;
-  BoxType region;
   GdkDisplay *display;
 
   display = gdk_drawable_get_display (gport->drawable);
 
-  region.X1 = 0;
-  region.Y1 = 0;
-  region.X2 = PCB->MaxWidth;
-  region.Y2 = PCB->MaxHeight;
-
   gdk_display_sync (display);
   time (&start);
   do
diff --git a/src/hid/gtk/gui-library-window.c b/src/hid/gtk/gui-library-window.c
index 3c0c077..0339cf0 100644
--- a/src/hid/gtk/gui-library-window.c
+++ b/src/hid/gtk/gui-library-window.c
@@ -364,7 +364,6 @@ static void
 library_window_callback_tree_selection_changed (GtkTreeSelection * selection,
 						gpointer user_data)
 {
-  GtkTreeView *view;
   GtkTreeModel *model;
   GtkTreeIter iter;
   GhidLibraryWindow *library_window = (GhidLibraryWindow *) user_data;
@@ -374,7 +373,6 @@ library_window_callback_tree_selection_changed (GtkTreeSelection * selection,
   if (!gtk_tree_selection_get_selected (selection, &model, &iter))
     return;
 
-  view = gtk_tree_selection_get_tree_view (selection);
   gtk_tree_model_get (model, &iter, MENU_ENTRY_COLUMN, &entry, -1);
 
   if (entry == NULL)
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index b5caff9..b11d32c 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -1073,7 +1073,6 @@ layer_select_button_cb (GtkWidget * widget, LayerButtonSet * lb)
 static void
 layer_enable_button_cb (GtkWidget * widget, gpointer data)
 {
-  LayerButtonSet *lb;
   gint i, group, layer = GPOINTER_TO_INT (data);
   gboolean active, redraw = FALSE;
 
@@ -1082,7 +1081,6 @@ layer_enable_button_cb (GtkWidget * widget, gpointer data)
   if (layer_enable_button_cb_hold_off)
     return;
 
-  lb = &layer_buttons[layer];
   switch (layer)
     {
     case LAYER_BUTTON_SILK:
@@ -2292,12 +2290,11 @@ ghid_listener_cb (GIOChannel *source,
 static void
 ghid_create_listener (void)
 {
-  guint tag;
   GIOChannel *channel;
   int fd = fileno (stdin);
 
   channel = g_io_channel_unix_new (fd);
-  tag = g_io_add_watch (channel, G_IO_IN, ghid_listener_cb, NULL);
+  g_io_add_watch (channel, G_IO_IN, ghid_listener_cb, NULL);
 }
 
 



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