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

gEDA-cvs: pcb.git: branch: master updated (2473e26c7d9581753a28f1f55a4a4b7ff109a3f2)



The branch, master has been updated
       via  2473e26c7d9581753a28f1f55a4a4b7ff109a3f2 (commit)
      from  bba2c1d29cfe341f2ad1e4eefeef76f9134e1d50 (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/hid/gerber/gerber.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)


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

commit 2473e26c7d9581753a28f1f55a4a4b7ff109a3f2
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Fix locale-dependent gerber output
    
    pcb_printf doesn't have a modifier that lets you select a unit (%mi) and
    locale-independent format (like %mr) at the same time.  The gerber
    hid was using %mi to output to a file, but that resulted in ',' instead
    of '.' for some locales.  This patch switches it to call
    g_ascii_formatd() on the value first, to ensure it's output with '.'.

:100644 100644 1539f88... 4e0007b... M	src/hid/gerber/gerber.c

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

commit 2473e26c7d9581753a28f1f55a4a4b7ff109a3f2
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Fix locale-dependent gerber output
    
    pcb_printf doesn't have a modifier that lets you select a unit (%mi) and
    locale-independent format (like %mr) at the same time.  The gerber
    hid was using %mi to output to a file, but that resulted in ',' instead
    of '.' for some locales.  This patch switches it to call
    g_ascii_formatd() on the value first, to ensure it's output with '.'.

diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 1539f88..4e0007b 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -226,18 +226,23 @@ findAperture (ApertureList *list, Coord width, ApertureShape shape)
 static void
 fprintAperture (FILE *f, Aperture *aptr)
 {
+  char buf[50];
+
   switch (aptr->shape)
     {
     case ROUND:
-      pcb_fprintf (f, "%%ADD%dC,%.4mi*%%\r\n", aptr->dCode, aptr->width);
+      g_ascii_formatd (buf, 50, "%.4f", COORD_TO_INCH (aptr->width));
+      pcb_fprintf (f, "%%ADD%dC,%s*%%\r\n", aptr->dCode, buf);
       break;
     case SQUARE:
-      pcb_fprintf (f, "%%ADD%dR,%.4miX%.4mi*%%\r\n", aptr->dCode, aptr->width, aptr->width);
+      g_ascii_formatd (buf,  50, "%.4f", COORD_TO_INCH (aptr->width));
+      pcb_fprintf (f, "%%ADD%dR,%sX%s*%%\r\n", aptr->dCode, buf, buf);
       break;
     case OCTAGON:
-      pcb_fprintf (f, "%%AMOCT%d*5,0,8,0,0,%.4mi,22.5*%%\r\n"
+      g_ascii_formatd (buf,  50, "%.4f", COORD_TO_INCH (aptr->width / COS_22_5_DEGREE));
+      pcb_fprintf (f, "%%AMOCT%d*5,0,8,0,0,%s,22.5*%%\r\n"
 	       "%%ADD%dOCT%d*%%\r\n", aptr->dCode,
-	       (Coord) ((double) aptr->width / COS_22_5_DEGREE), aptr->dCode,
+	       buf, aptr->dCode,
 	       aptr->dCode);
       break;
 #if 0




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