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

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



The branch, master has been updated
       via  b90fb6ae22ae83fdc0c802268dcbe74005bc705e (commit)
      from  8cbc19e5aa9572196f27d4e64db8337d80945803 (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 |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)


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

commit b90fb6ae22ae83fdc0c802268dcbe74005bc705e
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Fix plated-drill overflow bug in gerber.c
    
    Plated drills are printed in 1/10 mils rather than mils (it's
    a funny format). This was previously achieved by multiplying
    coordinates by 10, then printing them as mils. However, this
    caused an overflow for medium-large boards on 32-bit systems.
    
    This fix just prints a trailing 0 onto the measures, rather
    than computing the value times ten.

:100644 100644 9280af4... be6a7c4... M	src/hid/gerber/gerber.c

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

commit b90fb6ae22ae83fdc0c802268dcbe74005bc705e
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Fix plated-drill overflow bug in gerber.c
    
    Plated drills are printed in 1/10 mils rather than mils (it's
    a funny format). This was previously achieved by multiplying
    coordinates by 10, then printing them as mils. However, this
    caused an overflow for medium-large boards on 32-bit systems.
    
    This fix just prints a trailing 0 onto the measures, rather
    than computing the value times ten.

diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 9280af4..be6a7c4 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -77,8 +77,8 @@ static void gerber_fill_polygon (hidGC gc, int n_coords, Coord *x, Coord *y);
 #define gerberYOffset(pcb, y) ((Coord) (-(y)))
 
 /* These are for drills (printed as mils but are really 1/10th mil) */
-#define gerberDrX(pcb, x) ((Coord) (x) * 10)
-#define gerberDrY(pcb, y) ((Coord) ((pcb)->MaxHeight - (y)) * 10)
+#define gerberDrX(pcb, x) ((Coord) (x))
+#define gerberDrY(pcb, y) ((Coord) ((pcb)->MaxHeight - (y)))
 
 /*----------------------------------------------------------------------------*/
 /* Private data structures                                                    */
@@ -672,7 +672,9 @@ gerber_set_layer (const char *name, int group, int empty)
 	      Aperture *ap = findAperture (curr_aptr_list, pending_drills[i].diam, ROUND);
 	      fprintf (f, "T%02d\r\n", ap->dCode);
 	    }
-	  pcb_fprintf (f, "X%06.0mlY%06.0ml\r\n",
+          /* Notice the last zeroes are literal zeroes here, a  *
+           *  x10 scale factor.  v        v                     */
+          pcb_fprintf (f, "X%06.00mlY%06.00ml\r\n",
 		   gerberDrX (PCB, pending_drills[i].x),
 		   gerberDrY (PCB, pending_drills[i].y));
 	}




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