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

gEDA-cvs: pcb.git: branch: master updated (43dcc15273d2d54d5aa14724a103bbcab71b5576)



The branch, master has been updated
       via  43dcc15273d2d54d5aa14724a103bbcab71b5576 (commit)
       via  b677450457b9845de78196f679f7f9c55e283c3c (commit)
       via  36c63521293a914b493fe18f23c99c2ed5c322d4 (commit)
       via  678ce25e91de2e1fa856b38a77fcd0327b5030b3 (commit)
       via  e023b537cd1c12d881e40a4c8668d6ae81e275cb (commit)
       via  be6d8eb784f74ee9b496ef4b8dbb4af20feb5405 (commit)
      from  813d9acc4f2ea3882fede5550bbf03b2fef8582a (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
=========

 globalconst.h           |    1 -
 src/hid/gerber/gerber.c |  297 +++++++++++++++++++++++------------------------
 2 files changed, 145 insertions(+), 153 deletions(-)


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

commit 43dcc15273d2d54d5aa14724a103bbcab71b5576
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    gEDA-dev: gerber-cleanup-0006-Change-a-couple-more-0-s-to-NULL-s.patch

:100644 100644 23d87b4... b9f6f7b... M	src/hid/gerber/gerber.c

commit b677450457b9845de78196f679f7f9c55e283c3c
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    gEDA-dev: gerber-cleanup-0005-Remove-old-now-unused-aperture-structures-functions.patch

:100755 100755 71bc61a... 428135d... M	globalconst.h
:100644 100644 8daebf0... 23d87b4... M	src/hid/gerber/gerber.c

commit 36c63521293a914b493fe18f23c99c2ed5c322d4
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    gEDA-dev: gerber-cleanup-0004-Use-new-aperture-functions-output-100-equal-to-origi.patch

:100644 100644 feecf6f... 8daebf0... M	src/hid/gerber/gerber.c

commit 678ce25e91de2e1fa856b38a77fcd0327b5030b3
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    gEDA-dev: gerber-cleanup-0003-Add-new-aperture-functions-but-don-t-use-them.patch

:100644 100644 a3d6f84... feecf6f... M	src/hid/gerber/gerber.c

commit e023b537cd1c12d881e40a4c8668d6ae81e275cb
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    gEDA-dev: gerber-cleanup-0002-Remove-global-variable-dependence-from-maybe_close-a.patch

:100644 100644 62295df... a3d6f84... M	src/hid/gerber/gerber.c

commit be6d8eb784f74ee9b496ef4b8dbb4af20feb5405
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    gEDA-dev: gerber-cleanup-0001-Remove-unused-Aperture-structure.patch

:100644 100644 c8afa14... 62295df... M	src/hid/gerber/gerber.c

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

commit 43dcc15273d2d54d5aa14724a103bbcab71b5576
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    gEDA-dev: gerber-cleanup-0006-Change-a-couple-more-0-s-to-NULL-s.patch

diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 23d87b4..b9f6f7b 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -320,7 +320,7 @@ static const char *copy_outline_names[] = {
   "silk",
 #define COPY_OUTLINE_ALL 3
   "all",
-  0
+  NULL
 };
 
 static const char *name_style_names[] = {
@@ -332,7 +332,7 @@ static const char *name_style_names[] = {
   "first",
 #define NAME_STYLE_EAGLE 3
   "eagle",
-  0
+  NULL
 };
 
 static HID_Attribute gerber_options[] = {
@@ -503,7 +503,7 @@ gerber_do_export (HID_Attr_Val * options)
 
   if (!options)
     {
-      gerber_get_export_options (0);
+      gerber_get_export_options (NULL);
       for (i = 0; i < NUM_OPTIONS; i++)
 	gerber_values[i] = gerber_options[i].default_val;
       options = gerber_values;
@@ -620,7 +620,7 @@ gerber_set_layer (const char *name, int group, int empty)
 	     && group <
 	     max_group) ? PCB->LayerGroups.Entries[group][0] : group;
 
-  if (name == 0)
+  if (name == NULL)
     name = PCB->Data->Layer[idx].Name;
 
   if (idx >= 0 && idx < max_copper_layer && !print_layer[idx])

commit b677450457b9845de78196f679f7f9c55e283c3c
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    gEDA-dev: gerber-cleanup-0005-Remove-old-now-unused-aperture-structures-functions.patch

diff --git a/globalconst.h b/globalconst.h
index 71bc61a..428135d 100755
--- a/globalconst.h
+++ b/globalconst.h
@@ -126,5 +126,4 @@
 						/* to enable grid drawing */
 	/* size of diamond element mark */
 #define EMARK_SIZE	1000
-#define GBX_MAXAPERTURECOUNT	2560
 #endif
diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 8daebf0..23d87b4 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -125,26 +125,11 @@ typedef struct
   int count;
 } ApertureList;
 
-typedef struct
-{
-  int some_apertures;
-  int aperture_used[GBX_MAXAPERTURECOUNT];
-} Apertures;
-
 static ApertureList *layer_aptr_list;
 static ApertureList *curr_aptr_list;
 static int layer_list_max;
 static int layer_list_idx;
 
-static int global_aperture_count;
-static int global_aperture_sizes[GBX_MAXAPERTURECOUNT];
-static ApertureShape global_aperture_shapes[GBX_MAXAPERTURECOUNT];
-
-static Apertures *layerapps = NULL;
-static Apertures *curapp;
-static int n_layerapps = 0;
-static int c_layerapps = 0;
-
 typedef struct
 {
   int diam;
@@ -299,135 +284,6 @@ setLayerApertureList (int layer_idx)
 
 /* --------------------------------------------------------------------------- */
 
-/*----------------------------------------------------------------------------*/
-/* Aperture Routines                                                          */
-/*----------------------------------------------------------------------------*/
-
-
-
-static int
-findApertureCode (int width, ApertureShape shape)
-{
-  int i;
-
-  /* we never draw zero-width lines */
-  if (width == 0)
-    return (0);
-
-  /* Search for an appropriate aperture. */
-
-  for (i = 0; i < global_aperture_count; i++)
-    {
-      if (global_aperture_sizes[i] == width
-	  && global_aperture_shapes[i] == shape)
-	{
-	  curapp->aperture_used[i] = 1;
-	  curapp->some_apertures = 1;
-	  return i + DCODE_BASE;
-	}
-    }
-
-  /* Not found, create a new aperture and add it to the list */
-  if (global_aperture_count < GBX_MAXAPERTURECOUNT)
-    {
-      i = global_aperture_count ++;
-      global_aperture_sizes[i] = width;
-      global_aperture_shapes[i] = shape;
-      curapp->aperture_used[i] = 1;
-      curapp->some_apertures = 1;
-      return i + DCODE_BASE;
-    }
-  else
-    {
-      Message (_("Error, too many apertures needed for Gerber file.\n"));
-      return (10);
-    }
-}
-
-static void
-printAperture(FILE *f, int i)
-{
-  int dCode = i + DCODE_BASE;
-  int width = global_aperture_sizes[i];
-
-  switch (global_aperture_shapes[i])
-    {
-    case ROUND:
-      fprintf (f, "%%ADD%dC,%.4f*%%\r\n", dCode,
-	       COORD_TO_INCH(width));
-      break;
-    case SQUARE:
-      fprintf (f, "%%ADD%dR,%.4fX%.4f*%%\r\n",
-	       dCode, COORD_TO_INCH(width), COORD_TO_INCH(width));
-      break;
-    case OCTAGON:
-      fprintf (f, "%%AMOCT%d*5,0,8,0,0,%.4f,22.5*%%\r\n"
-	       "%%ADD%dOCT%d*%%\r\n", dCode,
-	       COORD_TO_INCH(width) / COS_22_5_DEGREE, dCode,
-	       dCode);
-      break;
-#if 0
-    case THERMAL:
-      fprintf (f, "%%AMTHERM%d*7,0,0,%.4f,%.4f,%.4f,45*%%\r\n"
-	       "%%ADD%dTHERM%d*%%\r\n", dCode, gap / 100000.0,
-	       width / 100000.0, finger / 100000.0, dCode, dCode);
-      break;
-    case ROUNDCLEAR:
-      fprintf (f, "%%ADD%dC,%.4fX%.4f*%%\r\n",
-	       dCode, gap / 100000.0, width / 100000.0);
-      break;
-    case SQUARECLEAR:
-      fprintf (f, "%%ADD%dR,%.4fX%.4fX%.4fX%.4f*%%\r\n",
-	       dCode, gap / 100000.0, gap / 100000.0,
-	       width / 100000.0, width / 100000.0);
-      break;
-#else
-    default:
-      break;
-#endif
-    }
-}
-
-static int
-countApertures (const Apertures *ap)
-{
-  int i, rv=0;
-  for (i=0; i<GBX_MAXAPERTURECOUNT; i++)
-    if (ap->aperture_used[i])
-      rv ++;
-  return rv;
-}
-
-static void
-initApertures ()
-{
-  layerapps = NULL;
-  n_layerapps = 0;
-}
-
-static void
-SetAppLayer (int l)
-{
-  if (l >= n_layerapps)
-    {
-      int prev = n_layerapps;
-      n_layerapps = l + 1;
-      layerapps = (Apertures *)realloc (layerapps, n_layerapps * sizeof (*layerapps));
-      curapp = layerapps + prev;
-      while (curapp < layerapps + n_layerapps)
-	{
-	  int i;
-	  curapp->some_apertures = 0;
-	  for (i=0; i<GBX_MAXAPERTURECOUNT; i++)
-	    curapp->aperture_used[i] = 0;
-	  curapp++;
-	}
-    }
-  curapp = layerapps + l;
-}
-
-/* --------------------------------------------------------------------------- */
-
 static HID gerber_hid;
 
 typedef struct hid_gc_struct

commit 36c63521293a914b493fe18f23c99c2ed5c322d4
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    gEDA-dev: gerber-cleanup-0004-Use-new-aperture-functions-output-100-equal-to-origi.patch

diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index feecf6f..8daebf0 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -718,15 +718,14 @@ gerber_do_export (HID_Attr_Val * options)
   region.Y2 = PCB->MaxHeight;
 
   pagecount = 1;
-  initApertures ();
+  resetApertures ();
 
-  f = NULL;
   lastgroup = -1;
-  c_layerapps = 0;
+  layer_list_idx = 0;
   finding_apertures = 1;
   hid_expose_callback (&gerber_hid, &region, 0);
 
-  c_layerapps = 0;
+  layer_list_idx = 0;
   finding_apertures = 0;
   hid_expose_callback (&gerber_hid, &region, 0);
 
@@ -791,8 +790,8 @@ gerber_set_layer (const char *name, int group, int empty)
 	{
 	  if (i == 0 || pending_drills[i].diam != pending_drills[i - 1].diam)
 	    {
-	      int ap = findApertureCode (pending_drills[i].diam, ROUND);
-	      fprintf (f, "T%02d\r\n", ap);
+	      Aperture *ap = findAperture (curr_aptr_list, pending_drills[i].diam, ROUND);
+	      fprintf (f, "T%02d\r\n", ap->dCode);
 	    }
 	  fprintf (f, "X%06ldY%06ld\r\n",
 		   gerberDrX (PCB, pending_drills[i].x),
@@ -818,8 +817,8 @@ gerber_set_layer (const char *name, int group, int empty)
 #ifdef HAVE_GETPWUID
       struct passwd *pwentry;
 #endif
-      int i;
-      int some_apertures = 0;
+      ApertureList *aptr_list;
+      Aperture *search;
 
       lastgroup = group;
       lastX = -1;
@@ -828,13 +827,12 @@ gerber_set_layer (const char *name, int group, int empty)
       linewidth = -1;
       lastcap = -1;
 
-      SetAppLayer (c_layerapps);
-      c_layerapps++;
+      aptr_list = setLayerApertureList (layer_list_idx++);
 
       if (finding_apertures)
 	goto emit_outline;
 
-      if (!curapp->some_apertures && !all_layers)
+      if (aptr_list->count == 0 && !all_layers)
 	return 0;
 
       maybe_close_f (f);
@@ -852,7 +850,7 @@ gerber_set_layer (const char *name, int group, int empty)
 
       if (verbose)
 	{
-	  int c = countApertures (curapp);
+	  int c = aptr_list->count;
 	  printf ("Gerber: %d aperture%s in %s\n", c,
 		  c == 1 ? "" : "s", filename);
 	}
@@ -862,11 +860,8 @@ gerber_set_layer (const char *name, int group, int empty)
 	  /* We omit the ,TZ here because we are not omitting trailing zeros.  Our format is
 	     always six-digit 0.1 mil resolution (i.e. 001100 = 0.11")*/
 	  fprintf (f, "M48\r\n" "INCH\r\n");
-	  for (i = 0; i < GBX_MAXAPERTURECOUNT; i++)
-	    if (curapp->aperture_used[i])
-	      fprintf (f, "T%02dC%.3f\r\n",
-		       i + DCODE_BASE,
-		       COORD_TO_INCH(global_aperture_sizes[i]));
+	  for (search = aptr_list->data; search; search = search->next)
+	    fprintf (f, "T%02dC%.3f\r\n", search->dCode, COORD_TO_INCH(search->width));
 	  fprintf (f, "%%\r\n");
 	  /* FIXME */
 	  return 1;
@@ -922,13 +917,9 @@ gerber_set_layer (const char *name, int group, int empty)
       fprintf (f, "%%LN%s*%%\r\n", layername);
       lncount = 1;
 
-      for (i=0; i<GBX_MAXAPERTURECOUNT; i++)
-	if (curapp->aperture_used[i])
-	  {
-	    some_apertures ++;
-	    printAperture(f, i);
-	  }
-      if (!some_apertures)
+      for (search = aptr_list->data; search; search = search->next)
+        fprintAperture(f, search);
+      if (aptr_list->count == 0)
 	/* We need to put *something* in the file to make it be parsed
 	   as RS-274X instead of RS-274D. */
 	fprintf (f, "%%ADD11C,0.0100*%%\r\n");
@@ -1045,49 +1036,44 @@ gerber_set_draw_xor (hidGC gc, int xor_)
 static void
 use_gc (hidGC gc, int radius)
 {
-  int c;
   if (radius)
     {
       radius *= 2;
       if (radius != linewidth || lastcap != Round_Cap)
 	{
-	  c = findApertureCode (radius, ROUND);
-	  if (c <= 0)
-	    {
-	      fprintf (stderr,
-		       "error: aperture for radius %d type ROUND is %d\n",
-		       radius, c);
-	    }
-	  if (f && !is_drill)
-	    fprintf (f, "G54D%d*", c);
+	  Aperture *aptr = findAperture (curr_aptr_list, radius, ROUND);
+	  if (aptr == NULL)
+	    fprintf (stderr, "error: aperture for radius %d type ROUND is null\n", radius);
+	  else if (f && !is_drill)
+	    fprintf (f, "G54D%d*", aptr->dCode);
 	  linewidth = radius;
 	  lastcap = Round_Cap;
 	}
     }
   else if (linewidth != gc->width || lastcap != gc->cap)
     {
-      int ap;
+      Aperture *aptr;
+      ApertureShape shape;
+
       linewidth = gc->width;
       lastcap = gc->cap;
       switch (gc->cap)
 	{
 	case Round_Cap:
 	case Trace_Cap:
-	  c = ROUND;
+	  shape = ROUND;
 	  break;
 	default:
 	case Square_Cap:
-	  c = SQUARE;
+	  shape = SQUARE;
 	  break;
 	}
-      ap = findApertureCode (linewidth, (ApertureShape)c);
-      if (ap <= 0)
-	{
-	  fprintf (stderr, "error: aperture for width %d type %s is %d\n",
-		   linewidth, c == ROUND ? "ROUND" : "SQUARE", ap);
-	}
+      aptr = findAperture (curr_aptr_list, linewidth, shape);
+      if (aptr == NULL)
+        fprintf (stderr, "error: aperture for width %d type %s is null\n",
+                 linewidth, shape == ROUND ? "ROUND" : "SQUARE");
       if (f)
-	fprintf (f, "G54D%d*", ap);
+	fprintf (f, "G54D%d*", aptr->dCode);
     }
 #if 0
   if (lastcolor != gc->color)

commit 678ce25e91de2e1fa856b38a77fcd0327b5030b3
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    gEDA-dev: gerber-cleanup-0003-Add-new-aperture-functions-but-don-t-use-them.patch

diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index a3d6f84..feecf6f 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -110,12 +110,32 @@ typedef enum ApertureShape ApertureShape;
    dcode and macro numbers.  */
 #define DCODE_BASE 11
 
+typedef struct aperture
+{
+  int dCode;			/* The RS-274X D code */
+  BDimension width;		/* Size in pcb units */
+  ApertureShape shape;		/* ROUND/SQUARE etc */
+  struct aperture *next;
+}
+Aperture;
+
+typedef struct 
+{
+  Aperture *data;
+  int count;
+} ApertureList;
+
 typedef struct
 {
   int some_apertures;
   int aperture_used[GBX_MAXAPERTURECOUNT];
 } Apertures;
 
+static ApertureList *layer_aptr_list;
+static ApertureList *curr_aptr_list;
+static int layer_list_max;
+static int layer_list_idx;
+
 static int global_aperture_count;
 static int global_aperture_sizes[GBX_MAXAPERTURECOUNT];
 static ApertureShape global_aperture_shapes[GBX_MAXAPERTURECOUNT];
@@ -139,6 +159,145 @@ int n_pending_drills = 0, max_pending_drills = 0;
 /*----------------------------------------------------------------------------*/
 #define AUTO_OUTLINE_WIDTH MIL_TO_COORD(8)       /* Auto-geneated outline width of 8 mils */
 
+/*----------------------------------------------------------------------------*/
+/* Aperture Routines                                                          */
+/*----------------------------------------------------------------------------*/
+
+/* Initialize aperture list */
+static void
+initApertureList (ApertureList *list)
+{
+  list->data = NULL;
+  list->count = 0;
+}
+
+static void
+deinitApertureList (ApertureList *list)
+{
+  Aperture *search = list->data;
+  Aperture *next;
+  while (search)
+    {
+      free(search);
+      search = next;
+      next = search->next;
+    }
+  initApertureList (list);
+}
+
+static void resetApertures()
+{
+  int i;
+  for (i = 0; i < layer_list_max; ++i)
+    deinitApertureList (&layer_aptr_list[i]);
+  free (layer_aptr_list);
+  layer_aptr_list = NULL;
+  layer_list_max = 0;
+  layer_list_idx = 0;
+}
+
+/* Create and add a new aperture to the list */
+static Aperture *
+addAperture (ApertureList *list, BDimension width, ApertureShape shape)
+{
+  static int aperture_count;
+
+  Aperture *app = (Aperture *) malloc (sizeof *app);
+  if (app == NULL)
+    return NULL;
+
+  app->width = width;
+  app->shape = shape;
+  app->dCode = DCODE_BASE + aperture_count++;
+  app->next  = list->data;
+
+  list->data = app;
+  ++list->count;
+
+  return app;
+}
+
+/* Fetch an aperture from the list with the specified
+ *  width/shape, creating a new one if none exists */
+static Aperture *
+findAperture (ApertureList *list, BDimension width, ApertureShape shape)
+{
+  Aperture *search;
+
+  /* we never draw zero-width lines */
+  if (width == 0)
+    return NULL;
+
+  /* Search for an appropriate aperture. */
+  for (search = list->data; search; search = search->next)
+    if (search->width == width && search->shape == shape)
+      return search;
+
+  /* Failing that, create a new one */
+  return addAperture (list, width, shape);
+}
+
+/* Output aperture data to the file */
+static void
+fprintAperture (FILE *f, Aperture *aptr)
+{
+  switch (aptr->shape)
+    {
+    case ROUND:
+      fprintf (f, "%%ADD%dC,%.4f*%%\r\n", aptr->dCode,
+	       COORD_TO_INCH(aptr->width));
+      break;
+    case SQUARE:
+      fprintf (f, "%%ADD%dR,%.4fX%.4f*%%\r\n", aptr->dCode,
+	       COORD_TO_INCH(aptr->width), COORD_TO_INCH(aptr->width));
+      break;
+    case OCTAGON:
+      fprintf (f, "%%AMOCT%d*5,0,8,0,0,%.4f,22.5*%%\r\n"
+	       "%%ADD%dOCT%d*%%\r\n", aptr->dCode,
+	       COORD_TO_INCH(aptr->width) / COS_22_5_DEGREE, aptr->dCode,
+	       aptr->dCode);
+      break;
+#if 0
+    case THERMAL:
+      fprintf (f, "%%AMTHERM%d*7,0,0,%.4f,%.4f,%.4f,45*%%\r\n"
+	       "%%ADD%dTHERM%d*%%\r\n", dCode, gap / 100000.0,
+	       width / 100000.0, finger / 100000.0, dCode, dCode);
+      break;
+    case ROUNDCLEAR:
+      fprintf (f, "%%ADD%dC,%.4fX%.4f*%%\r\n",
+	       dCode, gap / 100000.0, width / 100000.0);
+      break;
+    case SQUARECLEAR:
+      fprintf (f, "%%ADD%dR,%.4fX%.4fX%.4fX%.4f*%%\r\n",
+	       dCode, gap / 100000.0, gap / 100000.0,
+	       width / 100000.0, width / 100000.0);
+      break;
+#else
+    default:
+      break;
+#endif
+    }
+}
+
+/* Set the aperture list for the current layer,
+ * expanding the list buffer if needed  */
+static ApertureList *
+setLayerApertureList (int layer_idx)
+{
+  if (layer_idx >= layer_list_max)
+    {
+      int i = layer_list_max;
+      layer_list_max  = 2 * (layer_idx + 1);
+      layer_aptr_list = (ApertureList *)
+                        realloc (layer_aptr_list, layer_list_max * sizeof (*layer_aptr_list));
+      for (; i < layer_list_max; ++i)
+        initApertureList (&layer_aptr_list[i]);
+    }
+  curr_aptr_list = &layer_aptr_list[layer_idx];
+  return curr_aptr_list;
+}
+
+/* --------------------------------------------------------------------------- */
 
 /*----------------------------------------------------------------------------*/
 /* Aperture Routines                                                          */

commit e023b537cd1c12d881e40a4c8668d6ae81e275cb
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    gEDA-dev: gerber-cleanup-0002-Remove-global-variable-dependence-from-maybe_close-a.patch

diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 62295df..a3d6f84 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -374,7 +374,7 @@ layer_sort (const void *va, const void *vb)
 }
 
 static void
-maybe_close_f ()
+maybe_close_f (FILE *f)
 {
   if (f)
     {
@@ -392,7 +392,7 @@ static BoxType region;
 /* Very similar to layer_type_to_file_name() but appends only a
    three-character suffix compatible with Eagle's defaults.  */
 static void
-assign_eagle_file_suffix (int idx)
+assign_eagle_file_suffix (char *dest, int idx)
 {
   int group;
   int nlayers;
@@ -439,11 +439,11 @@ assign_eagle_file_suffix (int idx)
       break;
     }
 
-  strcpy (filesuff, suff);
+  strcpy (dest, suff);
 }
 
 static void
-assign_file_suffix (int idx)
+assign_file_suffix (char *dest, int idx)
 {
   int fns_style;
   const char *sext = ".gbr";
@@ -455,7 +455,7 @@ assign_file_suffix (int idx)
     case NAME_STYLE_SINGLE: fns_style = FNS_single; break;
     case NAME_STYLE_FIRST:  fns_style = FNS_first;  break;
     case NAME_STYLE_EAGLE:
-      assign_eagle_file_suffix (idx);
+      assign_eagle_file_suffix (dest, idx);
       return;
     }
 
@@ -469,8 +469,8 @@ assign_file_suffix (int idx)
       break;
     }
 
-  strcpy (filesuff, layer_type_to_file_name (idx, fns_style));
-  strcat (filesuff, sext);
+  strcpy (dest, layer_type_to_file_name (idx, fns_style));
+  strcat (dest, sext);
 }
 
 static void
@@ -573,7 +573,7 @@ gerber_do_export (HID_Attr_Val * options)
 
   memcpy (LayerStack, saved_layer_stack, sizeof (LayerStack));
 
-  maybe_close_f ();
+  maybe_close_f (f);
   hid_restore_layer_ons (save_ons);
   PCB->Flags = save_thindraw;
 }
@@ -678,10 +678,10 @@ gerber_set_layer (const char *name, int group, int empty)
       if (!curapp->some_apertures && !all_layers)
 	return 0;
 
-      maybe_close_f ();
+      maybe_close_f (f);
 
       pagecount++;
-      assign_file_suffix (idx);
+      assign_file_suffix (filesuff, idx);
       f = fopen (filename, "wb");   /* Binary needed to force CR-LF */
       if (f == NULL) 
 	{

commit be6d8eb784f74ee9b496ef4b8dbb4af20feb5405
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    gEDA-dev: gerber-cleanup-0001-Remove-unused-Aperture-structure.patch

diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index c8afa14..62295df 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -106,14 +106,6 @@ enum ApertureShape
 };
 typedef enum ApertureShape ApertureShape;
 
-typedef struct Aperture
-{
-  int dCode;			/* The RS-274X D code */
-  int apertureSize;		/* Size in mils */
-  ApertureShape apertureShape;	/* ROUND/SQUARE etc */
-}
-Aperture;
-
 /* This is added to the global aperture array indexes to get gerber
    dcode and macro numbers.  */
 #define DCODE_BASE 11




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