Index: trunk/config.h.in =================================================================== --- trunk/config.h.in (revision 4810) +++ trunk/config.h.in (revision 4811) @@ -197,7 +197,7 @@ @?/local/pcb/include_stdint@ /* Coordinate type and properties, as detected by scconfig */ -typedef @/local/pcb/coord_type@ Coord; +typedef @/local/pcb/coord_type@ pcb_coord_t; #define COORD_MAX @/local/pcb/coord_max@ #define coord_abs @/local/pcb/coord_abs@ Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 4810) +++ trunk/scconfig/Rev.h (revision 4811) @@ -1 +1 @@ -static const int myrev = 4608; +static const int myrev = 4811; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 4810) +++ trunk/scconfig/Rev.tab (revision 4811) @@ -1,3 +1,4 @@ +4811 configure unravel2 - the big cleanup, renaming types 4608 configure unravel - the big cleanup, moving code and files 4588 configure disable bison by default 4587 configure draw_fab moved to a plugin Index: trunk/src/action_act.c =================================================================== --- trunk/src/action_act.c (revision 4810) +++ trunk/src/action_act.c (revision 4811) @@ -47,7 +47,7 @@ %end-doc */ -int ActionExecuteFile(int argc, const char **argv, Coord x, Coord y) +int ActionExecuteFile(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { FILE *fp; const char *fname; Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 4810) +++ trunk/src/action_helper.c (revision 4811) @@ -62,7 +62,7 @@ #include "obj_poly_draw.h" -static void GetGridLockCoordinates(int type, void *ptr1, void *ptr2, void *ptr3, Coord * x, Coord * y) +static void GetGridLockCoordinates(int type, void *ptr1, void *ptr2, void *ptr3, pcb_coord_t * x, pcb_coord_t * y) { switch (type) { case PCB_TYPE_VIA: @@ -104,10 +104,10 @@ } } -static void AttachForCopy(Coord PlaceX, Coord PlaceY) +static void AttachForCopy(pcb_coord_t PlaceX, pcb_coord_t PlaceY) { pcb_box_t *box; - Coord mx = 0, my = 0; + pcb_coord_t mx = 0, my = 0; Crosshair.AttachedObject.RubberbandN = 0; if (!conf_core.editor.snap_pin) { @@ -647,7 +647,7 @@ case STATE_THIRD: { pcb_arc_t *arc; - Coord wx, wy; + pcb_coord_t wx, wy; pcb_angle_t sa, dir; wx = Note.X - Crosshair.AttachedBox.Point1.X; @@ -1278,7 +1278,7 @@ /* --------------------------------------------------------------------------- */ /* helper: get route style size for a function and selected object type. size_id: 0=main size; 1=2nd size (drill); 2=clearance */ -int get_style_size(int funcid, Coord * out, int type, int size_id) +int get_style_size(int funcid, pcb_coord_t * out, int type, int size_id) { switch (funcid) { case F_Object: Index: trunk/src/action_helper.h =================================================================== --- trunk/src/action_helper.h (revision 4810) +++ trunk/src/action_helper.h (revision 4811) @@ -46,7 +46,7 @@ #define ACTION_ARG(n) (argc > (n) ? argv[n] : NULL) -int get_style_size(int funcid, Coord * out, int type, int size_id); +int get_style_size(int funcid, pcb_coord_t * out, int type, int size_id); extern int defer_updates; extern int defer_needs_update; @@ -58,7 +58,7 @@ void ClearWarnings(void); typedef struct { - Coord X, Y; + pcb_coord_t X, Y; pcb_cardinal_t Buffer; pcb_bool Click; pcb_bool Moving; /* selected type clicked on */ Index: trunk/src/board.h =================================================================== --- trunk/src/board.h (revision 4810) +++ trunk/src/board.h (revision 4811) @@ -82,15 +82,15 @@ *RatColor, *InvisibleObjectsColor, *InvisibleMarkColor, *ElementSelectedColor, *RatSelectedColor, *ConnectedColor, *WarnColor, *MaskColor; - Coord CursorX, /* cursor position as saved with layout */ + pcb_coord_t CursorX, /* cursor position as saved with layout */ CursorY; - Coord Bloat, /* drc sizes saved with layout */ + pcb_coord_t Bloat, /* drc sizes saved with layout */ Shrink, minWid, minSlk, minDrill, minRing; - Coord GridOffsetX, /* as saved with layout */ + pcb_coord_t GridOffsetX, /* as saved with layout */ GridOffsetY, MaxWidth, /* allowed size */ MaxHeight; - Coord Grid; /* used grid with offsets */ + pcb_coord_t Grid; /* used grid with offsets */ double Zoom, /* zoom factor */ IsleArea, /* minimum poly island to retain */ ThermScale; /* scale factor used with thermals */ Index: trunk/src/box.h =================================================================== --- trunk/src/box.h (revision 4810) +++ trunk/src/box.h (revision 4811) @@ -55,11 +55,11 @@ /* rotates box 90-degrees cw */ /* that's a strange rotation! */ -#define ROTATEBOX_CW(box) { Coord t;\ +#define ROTATEBOX_CW(box) { pcb_coord_t t;\ t = (box).X1; (box).X1 = -(box).Y2; (box).Y2 = (box).X2;\ (box).X2 = -(box).Y1; (box).Y1 = t;\ } -#define ROTATEBOX_TO_NORTH(box, dir) do { Coord t;\ +#define ROTATEBOX_TO_NORTH(box, dir) do { pcb_coord_t t;\ switch(dir) {\ case EAST: \ t = (box).X1; (box).X1 = (box).Y1; (box).Y1 = -(box).X2;\ @@ -74,7 +74,7 @@ default: assert(0);\ }\ } while (0) -#define ROTATEBOX_FROM_NORTH(box, dir) do { Coord t;\ +#define ROTATEBOX_FROM_NORTH(box, dir) do { pcb_coord_t t;\ switch(dir) {\ case WEST: \ t = (box).X1; (box).X1 = (box).Y1; (box).Y1 = -(box).X2;\ @@ -103,7 +103,7 @@ typedef struct cheap_point { - Coord X, Y; + pcb_coord_t X, Y; } Cheappcb_point_t; @@ -110,12 +110,12 @@ /* note that boxes are closed on top and left and open on bottom and right. */ /* this means that top-left corner is in box, *but bottom-right corner is * not*. */ -static inline PCB_FUNC_UNUSED pcb_bool point_in_box(const pcb_box_t * box, Coord X, Coord Y) +static inline PCB_FUNC_UNUSED pcb_bool point_in_box(const pcb_box_t * box, pcb_coord_t X, pcb_coord_t Y) { return (X >= box->X1) && (Y >= box->Y1) && (X < box->X2) && (Y < box->Y2); } -static inline PCB_FUNC_UNUSED pcb_bool point_in_closed_box(const pcb_box_t * box, Coord X, Coord Y) +static inline PCB_FUNC_UNUSED pcb_bool point_in_closed_box(const pcb_box_t * box, pcb_coord_t X, pcb_coord_t Y) { return (X >= box->X1) && (Y >= box->Y1) && (X <= box->X2) && (Y <= box->Y2); } @@ -157,7 +157,7 @@ return r; } -static inline PCB_FUNC_UNUSED pcb_box_t shrink_box(const pcb_box_t * box, Coord amount) +static inline PCB_FUNC_UNUSED pcb_box_t shrink_box(const pcb_box_t * box, pcb_coord_t amount) { pcb_box_t r = *box; r.X1 += amount; @@ -167,7 +167,7 @@ return r; } -static inline PCB_FUNC_UNUSED pcb_box_t bloat_box(const pcb_box_t * box, Coord amount) +static inline PCB_FUNC_UNUSED pcb_box_t bloat_box(const pcb_box_t * box, pcb_coord_t amount) { return shrink_box(box, -amount); } @@ -195,7 +195,7 @@ } /* construct a box that holds a single point */ -static inline PCB_FUNC_UNUSED pcb_box_t point_box(Coord X, Coord Y) +static inline PCB_FUNC_UNUSED pcb_box_t point_box(pcb_coord_t X, pcb_coord_t Y) { pcb_box_t r; r.X1 = X; Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 4810) +++ trunk/src/buffer.c (revision 4811) @@ -104,7 +104,7 @@ * copies all selected and visible objects to the paste buffer * returns true if any objects have been removed */ -void AddSelectedToBuffer(pcb_buffer_t *Buffer, Coord X, Coord Y, pcb_bool LeaveSelected) +void AddSelectedToBuffer(pcb_buffer_t *Buffer, pcb_coord_t X, pcb_coord_t Y, pcb_bool LeaveSelected) { pcb_opctx_t ctx; @@ -149,7 +149,7 @@ %end-doc */ -int LoadFootprint(int argc, const char **argv, Coord x, Coord y) +int LoadFootprint(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *name = ACTION_ARG(0); const char *refdes = ACTION_ARG(1); @@ -360,7 +360,7 @@ %end-doc */ -int ActionFreeRotateBuffer(int argc, const char **argv, Coord x, Coord y) +int ActionFreeRotateBuffer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *angle_s; @@ -671,7 +671,7 @@ %end-doc */ -static int ActionPasteBuffer(int argc, const char **argv, Coord x, Coord y) +static int ActionPasteBuffer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = argc ? argv[0] : ""; const char *sbufnum = argc > 1 ? argv[1] : ""; @@ -759,8 +759,8 @@ case F_ToLayout: { - static Coord oldx = 0, oldy = 0; - Coord x, y; + static pcb_coord_t oldx = 0, oldy = 0; + pcb_coord_t x, y; pcb_bool absolute; if (argc == 1) { Index: trunk/src/buffer.h =================================================================== --- trunk/src/buffer.h (revision 4810) +++ trunk/src/buffer.h (revision 4811) @@ -32,7 +32,7 @@ #include "obj_common.h" struct pcb_buffer_s { /* information about the paste buffer */ - Coord X, Y; /* offset */ + pcb_coord_t X, Y; /* offset */ pcb_box_t BoundingBox; pcb_data_t *Data; /* data; not all members of pcb_board_t */ /* are used */ @@ -44,7 +44,7 @@ void SwapBuffer(pcb_buffer_t *Buffer); void SetBufferBoundingBox(pcb_buffer_t *); void ClearBuffer(pcb_buffer_t *); -void AddSelectedToBuffer(pcb_buffer_t *, Coord, Coord, pcb_bool); +void AddSelectedToBuffer(pcb_buffer_t *, pcb_coord_t, pcb_coord_t, pcb_bool); pcb_bool LoadLayoutToBuffer(pcb_buffer_t *Buffer, const char *Filename, const char *fmt); void RotateBuffer(pcb_buffer_t *, pcb_uint8_t); void SelectPasteBuffer(int); @@ -56,7 +56,7 @@ void *CopyObjectToBuffer(pcb_data_t *, pcb_data_t *, int, void *, void *, void *); /* This action is called from ActionElementAddIf() */ -int LoadFootprint(int argc, const char **argv, Coord x, Coord y); +int LoadFootprint(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y); pcb_data_t *CreateNewBuffer(void); Index: trunk/src/change.c =================================================================== --- trunk/src/change.c (revision 4810) +++ trunk/src/change.c (revision 4811) @@ -395,7 +395,7 @@ * changes the size of all selected and visible object types * returns pcb_true if anything has changed */ -pcb_bool ChangeSelectedSize(int types, Coord Difference, pcb_bool fixIt) +pcb_bool ChangeSelectedSize(int types, pcb_coord_t Difference, pcb_bool fixIt) { pcb_bool change = pcb_false; pcb_opctx_t ctx; @@ -417,7 +417,7 @@ * changes the clearance size of all selected and visible objects * returns pcb_true if anything has changed */ -pcb_bool ChangeSelectedClearSize(int types, Coord Difference, pcb_bool fixIt) +pcb_bool ChangeSelectedClearSize(int types, pcb_coord_t Difference, pcb_bool fixIt) { pcb_bool change = pcb_false; pcb_opctx_t ctx; @@ -442,7 +442,7 @@ * changes the 2nd size (drilling hole) of all selected and visible objects * returns pcb_true if anything has changed */ -pcb_bool ChangeSelected2ndSize(int types, Coord Difference, pcb_bool fixIt) +pcb_bool ChangeSelected2ndSize(int types, pcb_coord_t Difference, pcb_bool fixIt) { pcb_bool change = pcb_false; pcb_opctx_t ctx; @@ -783,7 +783,7 @@ * changes the size of the passed object; element size is silk size * Returns pcb_true if anything is changed */ -pcb_bool ChangeObjectSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord Difference, pcb_bool fixIt) +pcb_bool ChangeObjectSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t Difference, pcb_bool fixIt) { pcb_bool change; pcb_opctx_t ctx; @@ -805,7 +805,7 @@ * changes the size of the passed object; element size is pin ring sizes * Returns pcb_true if anything is changed */ -pcb_bool ChangeObject1stSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord Difference, pcb_bool fixIt) +pcb_bool ChangeObject1stSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t Difference, pcb_bool fixIt) { pcb_bool change; pcb_opctx_t ctx; @@ -827,7 +827,7 @@ * changes the radius of the passed object (e.g. arc width/height) * Returns pcb_true if anything is changed */ -pcb_bool ChangeObjectRadius(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_x, Coord r, pcb_bool fixIt) +pcb_bool ChangeObjectRadius(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_x, pcb_coord_t r, pcb_bool fixIt) { pcb_bool change; pcb_opctx_t ctx; @@ -872,7 +872,7 @@ * changes the clearance size of the passed object * Returns pcb_true if anything is changed */ -pcb_bool ChangeObjectClearSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord Difference, pcb_bool fixIt) +pcb_bool ChangeObjectClearSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t Difference, pcb_bool fixIt) { pcb_bool change; pcb_opctx_t ctx; @@ -918,7 +918,7 @@ * changes the 2nd size of the passed object * Returns pcb_true if anything is changed */ -pcb_bool ChangeObject2ndSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord Difference, pcb_bool fixIt, pcb_bool incundo) +pcb_bool ChangeObject2ndSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t Difference, pcb_bool fixIt, pcb_bool incundo) { pcb_bool change; pcb_opctx_t ctx; @@ -941,7 +941,7 @@ * changes the mask size of the passed object * Returns pcb_true if anything is changed */ -pcb_bool ChangeObjectMaskSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord Difference, pcb_bool fixIt) +pcb_bool ChangeObjectMaskSize(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t Difference, pcb_bool fixIt) { pcb_bool change; pcb_opctx_t ctx; @@ -1257,7 +1257,7 @@ * releases the saved pixmap if necessary * and adjusts the cursor confinement box */ -void ChangePCBSize(Coord Width, Coord Height) +void ChangePCBSize(pcb_coord_t Width, pcb_coord_t Height) { PCB->MaxWidth = Width; PCB->MaxHeight = Height; Index: trunk/src/change.h =================================================================== --- trunk/src/change.h (revision 4810) +++ trunk/src/change.h (revision 4811) @@ -68,10 +68,10 @@ pcb_bool ChangeLayoutName(char *); pcb_bool ChangeLayerName(pcb_layer_t *, char *); -pcb_bool ChangeSelectedSize(int, Coord, pcb_bool); -pcb_bool ChangeSelectedClearSize(int, Coord, pcb_bool); -pcb_bool ChangeSelected2ndSize(int, Coord, pcb_bool); -pcb_bool ChangeSelectedMaskSize(int, Coord, pcb_bool); +pcb_bool ChangeSelectedSize(int, pcb_coord_t, pcb_bool); +pcb_bool ChangeSelectedClearSize(int, pcb_coord_t, pcb_bool); +pcb_bool ChangeSelected2ndSize(int, pcb_coord_t, pcb_bool); +pcb_bool ChangeSelectedMaskSize(int, pcb_coord_t, pcb_bool); pcb_bool ChangeSelectedJoin(int); pcb_bool SetSelectedJoin(int); pcb_bool ClrSelectedJoin(int); @@ -85,12 +85,12 @@ pcb_bool ChangeSelectedOctagon(int); pcb_bool SetSelectedOctagon(int); pcb_bool ClrSelectedOctagon(int); -pcb_bool ChangeObjectSize(int, void *, void *, void *, Coord, pcb_bool); -pcb_bool ChangeObject1stSize(int, void *, void *, void *, Coord, pcb_bool); +pcb_bool ChangeObjectSize(int, void *, void *, void *, pcb_coord_t, pcb_bool); +pcb_bool ChangeObject1stSize(int, void *, void *, void *, pcb_coord_t, pcb_bool); pcb_bool ChangeObjectThermal(int, void *, void *, void *, int); -pcb_bool ChangeObjectClearSize(int, void *, void *, void *, Coord, pcb_bool); -pcb_bool ChangeObject2ndSize(int, void *, void *, void *, Coord, pcb_bool, pcb_bool); -pcb_bool ChangeObjectMaskSize(int, void *, void *, void *, Coord, pcb_bool); +pcb_bool ChangeObjectClearSize(int, void *, void *, void *, pcb_coord_t, pcb_bool); +pcb_bool ChangeObject2ndSize(int, void *, void *, void *, pcb_coord_t, pcb_bool, pcb_bool); +pcb_bool ChangeObjectMaskSize(int, void *, void *, void *, pcb_coord_t, pcb_bool); pcb_bool ChangeObjectJoin(int, void *, void *, void *); pcb_bool SetObjectJoin(int, void *, void *, void *); pcb_bool ClrObjectJoin(int, void *, void *, void *); @@ -103,9 +103,9 @@ pcb_bool ClrObjectOctagon(int, void *, void *, void *); void *ChangeObjectName(int, void *, void *, void *, char *); void *QueryInputAndChangeObjectName(int, void *, void *, void *, int); -void ChangePCBSize(Coord, Coord); +void ChangePCBSize(pcb_coord_t, pcb_coord_t); void *ChangeObjectPinnum(int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *Name); -pcb_bool ChangeObjectRadius(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_x, Coord r, pcb_bool absolute); +pcb_bool ChangeObjectRadius(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_x, pcb_coord_t r, pcb_bool absolute); pcb_bool ChangeObjectAngle(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_start, pcb_angle_t a, pcb_bool absolute); pcb_bool ChangeSelectedAngle(int types, int is_start, pcb_angle_t Difference, pcb_bool fixIt); pcb_bool ChangeSelectedRadius(int types, int is_start, pcb_angle_t Difference, pcb_bool fixIt); Index: trunk/src/change_act.c =================================================================== --- trunk/src/change_act.c (revision 4810) +++ trunk/src/change_act.c (revision 4811) @@ -47,8 +47,8 @@ #include "obj_rat_draw.h" static void ChangeFlag(const char *, const char *, int, const char *); -static int ActionChangeSize(int argc, const char **argv, Coord x, Coord y); -static int ActionChange2ndSize(int argc, const char **argv, Coord x, Coord y); +static int ActionChangeSize(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y); +static int ActionChange2ndSize(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y); /* --------------------------------------------------------------------------- */ @@ -67,13 +67,13 @@ %end-doc */ -static int ActionChangeClearSize(int argc, const char **argv, Coord x, Coord y) +static int ActionChangeClearSize(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); const char *delta = ACTION_ARG(1); const char *units = ACTION_ARG(2); pcb_bool absolute; - Coord value; + pcb_coord_t value; int type = PCB_TYPE_NONE; void *ptr1, *ptr2, *ptr3; @@ -152,7 +152,7 @@ %end-doc */ -static int ActionChangeFlag(int argc, const char **argv, Coord x, Coord y) +static int ActionChangeFlag(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); const char *flag = ACTION_ARG(1); @@ -260,7 +260,7 @@ %end-doc */ -static int ActionChangeHole(int argc, const char **argv, Coord x, Coord y) +static int ActionChangeHole(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function) { @@ -302,7 +302,7 @@ %end-doc */ -static int ActionChangePaste(int argc, const char **argv, Coord x, Coord y) +static int ActionChangePaste(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function) { @@ -346,7 +346,7 @@ with the same arguments. If any of them did not fail, return success. %end-doc */ -static int ActionChangeSizes(int argc, const char **argv, Coord x, Coord y) +static int ActionChangeSizes(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int a, b, c; SaveUndoSerialNumber(); @@ -380,13 +380,13 @@ %end-doc */ -static int ActionChangeSize(int argc, const char **argv, Coord x, Coord y) +static int ActionChangeSize(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); const char *delta = ACTION_ARG(1); const char *units = ACTION_ARG(2); pcb_bool absolute; /* indicates if absolute size is given */ - Coord value; + pcb_coord_t value; int type = PCB_TYPE_NONE, tostyle = 0; void *ptr1, *ptr2, *ptr3; @@ -482,7 +482,7 @@ %end-doc */ -static int ActionChange2ndSize(int argc, const char **argv, Coord x, Coord y) +static int ActionChange2ndSize(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); const char *delta = ACTION_ARG(1); @@ -491,7 +491,7 @@ void *ptr1, *ptr2, *ptr3; pcb_bool absolute; - Coord value; + pcb_coord_t value; if (function && delta) { int funcid = funchash_get(function, NULL); @@ -556,7 +556,7 @@ %end-doc */ -static int ActionChangePinName(int argc, const char **argv, Coord x, Coord y) +static int ActionChangePinName(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int changed = 0; const char *refdes, *pinnum, *pinname; @@ -643,7 +643,7 @@ %end-doc */ -int ActionChangeName(int argc, const char **argv, Coord x, Coord y) +int ActionChangeName(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); const char *pinnums = ACTION_ARG(1); @@ -724,7 +724,7 @@ %end-doc */ -static int ActionChangeJoin(int argc, const char **argv, Coord x, Coord y) +static int ActionChangeJoin(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function) { @@ -777,7 +777,7 @@ %end-doc */ -static int ActionChangeNonetlist(int argc, const char **argv, Coord x, Coord y) +static int ActionChangeNonetlist(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function) { @@ -823,7 +823,7 @@ %end-doc */ -static int ActionChangeSquare(int argc, const char **argv, Coord x, Coord y) +static int ActionChangeSquare(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function) { @@ -885,7 +885,7 @@ %end-doc */ -static int ActionSetSquare(int argc, const char **argv, Coord x, Coord y) +static int ActionSetSquare(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function && *function) { @@ -937,7 +937,7 @@ %end-doc */ -static int ActionClearSquare(int argc, const char **argv, Coord x, Coord y) +static int ActionClearSquare(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function && *function) { @@ -988,7 +988,7 @@ %end-doc */ -static int ActionChangeOctagon(int argc, const char **argv, Coord x, Coord y) +static int ActionChangeOctagon(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function) { @@ -1043,7 +1043,7 @@ %end-doc */ -static int ActionSetOctagon(int argc, const char **argv, Coord x, Coord y) +static int ActionSetOctagon(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function) { @@ -1099,7 +1099,7 @@ %end-doc */ -static int ActionClearOctagon(int argc, const char **argv, Coord x, Coord y) +static int ActionClearOctagon(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function) { @@ -1172,7 +1172,7 @@ to connect with. However, they will have no effect without the polygon. %end-doc */ -static int ActionSetThermal(int argc, const char **argv, Coord x, Coord y) +static int ActionSetThermal(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); const char *style = ACTION_ARG(1); @@ -1238,7 +1238,7 @@ %end-doc */ -static int ActionSetFlag(int argc, const char **argv, Coord x, Coord y) +static int ActionSetFlag(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); const char *flag = ACTION_ARG(1); @@ -1267,7 +1267,7 @@ %end-doc */ -static int ActionClrFlag(int argc, const char **argv, Coord x, Coord y) +static int ActionClrFlag(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); const char *flag = ACTION_ARG(1); @@ -1307,7 +1307,7 @@ %end-doc */ -static int ActionSetValue(int argc, const char **argv, Coord x, Coord y) +static int ActionSetValue(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); const char *val = ACTION_ARG(1); @@ -1374,7 +1374,7 @@ "ChangeAngle(SelectedObjects|Selected, start|delta|both, delta)\n" "ChangeAngle(SelectedArcs, start|delta|both, delta)\n"; static const char changeangle_help[] = "Changes the start angle, delta angle or both angles of an arc."; -static int ActionChangeAngle(int argc, const char **argv, Coord x, Coord y) +static int ActionChangeAngle(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); const char *prim = ACTION_ARG(1); @@ -1445,7 +1445,7 @@ "ChangeRadius(SelectedObjects|Selected, width|x|height|y|both, delta)\n" "ChangeRadius(SelectedArcs, width|x|height|y|both, delta)\n"; static const char changeradius_help[] = "Changes the width or height (radius) of an arc."; -static int ActionChangeRadius(int argc, const char **argv, Coord x, Coord y) +static int ActionChangeRadius(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); const char *prim = ACTION_ARG(1); Index: trunk/src/conf.h =================================================================== --- trunk/src/conf.h (revision 4810) +++ trunk/src/conf.h (revision 4811) @@ -54,7 +54,7 @@ typedef int CFT_BOOLEAN; typedef long CFT_INTEGER; typedef double CFT_REAL; -typedef Coord CFT_COORD; +typedef pcb_coord_t CFT_COORD; typedef pcb_unit_t * CFT_UNIT; typedef char * CFT_COLOR; typedef conflist_t CFT_LIST; @@ -77,7 +77,7 @@ int *boolean; long *integer; double *real; - Coord *coord; + pcb_coord_t *coord; const pcb_unit_t **unit; const char **color; conflist_t *list; Index: trunk/src/conf_act.c =================================================================== --- trunk/src/conf_act.c (revision 4810) +++ trunk/src/conf_act.c (revision 4811) @@ -49,7 +49,7 @@ return res; } -static int ActionConf(int argc, const char **argv, Coord x, Coord y) +static int ActionConf(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *cmd = argc > 0 ? argv[0] : 0; @@ -186,7 +186,7 @@ /*------------ get/chk (check flag actions for menus) ------------------*/ static const char GetStyle_syntax[] = "GetStyle()" ; static const char GetStyle_help[] = "Return integer index (>=0) of the currently active style or -1 if no style is selected (== custom style)"; -static int ActionGetStyle(int argc, const char **argv, Coord x, Coord y) +static int ActionGetStyle(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { return pcb_route_style_lookup(&PCB->RouteStyle, conf_core.design.line_thickness, conf_core.design.via_thickness, conf_core.design.via_drilling_hole, conf_core.design.clearance, NULL); } @@ -193,7 +193,7 @@ static const char ChkMode_syntax[] = "ChkMode(expected_mode)" ; static const char ChkMode_help[] = "Return 1 if the currently selected mode is the expected_mode"; -static int ActionChkMode(int argc, const char **argv, Coord x, Coord y) +static int ActionChkMode(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { #warning TODO: convert this to a compile-time hash struct { @@ -236,7 +236,7 @@ "ChkGridSize(none)\n" ; static const char ChkGridSize_help[] = "Return 1 if the currently selected grid matches the expected_size. If argument is \"none\" return 1 if there is no grid."; -static int ActionChkGridSize(int argc, const char **argv, Coord x, Coord y) +static int ActionChkGridSize(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { assert(argc == 1); if (strcmp(argv[0], "none") == 0) @@ -251,7 +251,7 @@ "ChkElementName(3) - expect value\n" ; static const char ChkElementName_help[] = "Return 1 if currently shown element label (name) type matches the expected"; -static int ActionChkElementName(int argc, const char **argv, Coord x, Coord y) +static int ActionChkElementName(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int have, expected = argv[0][0] - '0'; @@ -265,7 +265,7 @@ static const char ChkGridUnits_syntax[] = "ChkGridUnits(expected)"; static const char ChkGridUnits_help[] = "Return 1 if currently selected grid unit matches the expected (normally mm or mil)"; -static int ActionChkGridUnits(int argc, const char **argv, Coord x, Coord y) +static int ActionChkGridUnits(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { assert(argc == 1); return strcmp(conf_core.editor.grid_unit->suffix, argv[0]) == 0; @@ -273,7 +273,7 @@ static const char ChkBuffer_syntax[] = "ChkBuffer(idx)"; static const char ChkBuffer_help[] = "Return 1 if currently selected buffer's index matches idx"; -static int ActionChkBuffer(int argc, const char **argv, Coord x, Coord y) +static int ActionChkBuffer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int expected = argv[0][0] - '0'; assert(argc == 1); Index: trunk/src/const.h =================================================================== --- trunk/src/const.h (revision 4810) +++ trunk/src/const.h (revision 4811) @@ -31,8 +31,8 @@ /* These need to be carefully written to avoid overflows, and return a Coord type. */ -#define PCB_SCALE_TEXT(COORD,TEXTSCALE) ((Coord)((COORD) * ((double)(TEXTSCALE) / 100.0))) -#define PCB_UNPCB_SCALE_TEXT(COORD,TEXTSCALE) ((Coord)((COORD) * (100.0 / (double)(TEXTSCALE)))) +#define PCB_SCALE_TEXT(COORD,TEXTSCALE) ((pcb_coord_t)((COORD) * ((double)(TEXTSCALE) / 100.0))) +#define PCB_UNPCB_SCALE_TEXT(COORD,TEXTSCALE) ((pcb_coord_t)((COORD) * (100.0 / (double)(TEXTSCALE)))) /* --------------------------------------------------------------------------- * modes Index: trunk/src/copy.c =================================================================== --- trunk/src/copy.c (revision 4810) +++ trunk/src/copy.c (revision 4811) @@ -61,7 +61,7 @@ * pastes the contents of the buffer to the layout. Only visible objects * are handled by the routine. */ -pcb_bool CopyPastebufferToLayout(Coord X, Coord Y) +pcb_bool CopyPastebufferToLayout(pcb_coord_t X, pcb_coord_t Y) { pcb_cardinal_t i; pcb_bool changed = pcb_false; @@ -147,7 +147,7 @@ * the new objects is moved by DX,DY * I assume that the appropriate layer ... is switched on */ -void *CopyObject(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY) +void *CopyObject(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t DX, pcb_coord_t DY) { void *ptr; pcb_opctx_t ctx; Index: trunk/src/copy.h =================================================================== --- trunk/src/copy.h (revision 4810) +++ trunk/src/copy.h (revision 4811) @@ -39,7 +39,7 @@ PCB_TYPE_ELEMENT | PCB_TYPE_ELEMENT_NAME | PCB_TYPE_POLYGON | PCB_TYPE_ARC) -pcb_bool CopyPastebufferToLayout(Coord, Coord); -void *CopyObject(int, void *, void *, void *, Coord, Coord); +pcb_bool CopyPastebufferToLayout(pcb_coord_t, pcb_coord_t); +void *CopyObject(int, void *, void *, void *, pcb_coord_t, pcb_coord_t); #endif Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 4810) +++ trunk/src/crosshair.c (revision 4811) @@ -53,15 +53,15 @@ /* --------------------------------------------------------------------------- * some local prototypes */ -static void XORPolygon(pcb_polygon_t *, Coord, Coord, int); -static void XORDrawElement(pcb_element_t *, Coord, Coord); +static void XORPolygon(pcb_polygon_t *, pcb_coord_t, pcb_coord_t, int); +static void XORDrawElement(pcb_element_t *, pcb_coord_t, pcb_coord_t); static void XORDrawBuffer(pcb_buffer_t *); static void XORDrawInsertPointObject(void); static void XORDrawMoveOrCopyObject(void); -static void XORDrawAttachedLine(Coord, Coord, Coord, Coord, Coord); -static void XORDrawAttachedArc(Coord); +static void XORDrawAttachedLine(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_coord_t); +static void XORDrawAttachedArc(pcb_coord_t); -static void thindraw_moved_pv(pcb_pin_t * pv, Coord x, Coord y) +static void thindraw_moved_pv(pcb_pin_t * pv, pcb_coord_t x, pcb_coord_t y) { /* Make a copy of the pin structure, moved to the correct position */ pcb_pin_t moved_pv = *pv; @@ -71,7 +71,7 @@ gui->thindraw_pcb_pv(Crosshair.GC, Crosshair.GC, &moved_pv, pcb_true, pcb_false); } -static void draw_dashed_line(pcb_hid_gc_t GC, Coord x1, Coord y1, Coord x2, Coord y2) +static void draw_dashed_line(pcb_hid_gc_t GC, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { /* TODO: we need a real geo lib... using double here is plain wrong */ double dx = x2-x1, dy = y2-y1; @@ -102,7 +102,7 @@ /* --------------------------------------------------------------------------- * creates a tmp polygon with coordinates converted to screen system */ -static void XORPolygon(pcb_polygon_t *polygon, Coord dx, Coord dy, int dash_last) +static void XORPolygon(pcb_polygon_t *polygon, pcb_coord_t dx, pcb_coord_t dy, int dash_last) { pcb_cardinal_t i; for (i = 0; i < polygon->PointN; i++) { @@ -130,13 +130,13 @@ /*----------------------------------------------------------- * Draws the outline of an arc */ -static void XORDrawAttachedArc(Coord thick) +static void XORDrawAttachedArc(pcb_coord_t thick) { pcb_arc_t arc; pcb_box_t *bx; - Coord wx, wy; + pcb_coord_t wx, wy; pcb_angle_t sa, dir; - Coord wid = thick / 2; + pcb_coord_t wid = thick / 2; wx = Crosshair.X - Crosshair.AttachedBox.Point1.X; wy = Crosshair.Y - Crosshair.AttachedBox.Point1.Y; @@ -182,9 +182,9 @@ /*----------------------------------------------------------- * Draws the outline of a line */ -static void XORDrawAttachedLine(Coord x1, Coord y1, Coord x2, Coord y2, Coord thick) +static void XORDrawAttachedLine(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t thick) { - Coord dx, dy, ox, oy; + pcb_coord_t dx, dy, ox, oy; double h; dx = x2 - x1; @@ -207,7 +207,7 @@ /* --------------------------------------------------------------------------- * draws the elements of a loaded circuit which is to be merged in */ -static void XORDrawElement(pcb_element_t *Element, Coord DX, Coord DY) +static void XORDrawElement(pcb_element_t *Element, pcb_coord_t DX, pcb_coord_t DY) { /* if no silkscreen, draw the bounding box */ if (arclist_length(&Element->Arc) == 0 && linelist_length(&Element->Line) == 0) { @@ -277,7 +277,7 @@ static void XORDrawBuffer(pcb_buffer_t *Buffer) { pcb_cardinal_t i; - Coord x, y; + pcb_coord_t x, y; /* set offset */ x = Crosshair.X - Buffer->X; @@ -358,7 +358,7 @@ { pcb_rubberband_t *ptr; pcb_cardinal_t i; - Coord dx = Crosshair.X - Crosshair.AttachedObject.X, dy = Crosshair.Y - Crosshair.AttachedObject.Y; + pcb_coord_t dx = Crosshair.X - Crosshair.AttachedObject.X, dy = Crosshair.Y - Crosshair.AttachedObject.Y; switch (Crosshair.AttachedObject.Type) { case PCB_TYPE_VIA: @@ -583,7 +583,7 @@ /* an attached box does not depend on a special mode */ if (Crosshair.AttachedBox.State == STATE_SECOND || Crosshair.AttachedBox.State == STATE_THIRD) { - Coord x1, y1, x2, y2; + pcb_coord_t x1, y1, x2, y2; x1 = Crosshair.AttachedBox.Point1.X; y1 = Crosshair.AttachedBox.Point1.Y; @@ -599,7 +599,7 @@ */ void DrawMark(void) { - Coord ms = conf_core.appearance.mark_size; + pcb_coord_t ms = conf_core.appearance.mark_size; /* Mark is not drawn when it is not set */ if (!Marked.status) @@ -612,7 +612,7 @@ /* --------------------------------------------------------------------------- * Returns the nearest grid-point to the given Coord */ -Coord GridFit(Coord x, Coord grid_spacing, Coord grid_offset) +pcb_coord_t GridFit(pcb_coord_t x, pcb_coord_t grid_spacing, pcb_coord_t grid_offset) { x -= grid_offset; x = grid_spacing * pcb_round((double) x / grid_spacing); @@ -707,8 +707,8 @@ */ struct onpoint_search_info { pcb_crosshair_t *crosshair; - Coord X; - Coord Y; + pcb_coord_t X; + pcb_coord_t Y; }; static pcb_r_dir_t onpoint_line_callback(const pcb_box_t * box, void *cl) @@ -742,7 +742,7 @@ struct onpoint_search_info *info = (struct onpoint_search_info *) cl; pcb_crosshair_t *crosshair = info->crosshair; pcb_arc_t *arc = (pcb_arc_t *) box; - Coord p1x, p1y, p2x, p2y; + pcb_coord_t p1x, p1y, p2x, p2y; p1x = arc->X - arc->Width * cos(TO_RADIANS(arc->StartAngle)); p1y = arc->Y + arc->Height * sin(TO_RADIANS(arc->StartAngle)); @@ -810,7 +810,7 @@ * at the given coordinates and adds them to the crosshair's * object list along with their respective type. */ -static void onpoint_work(pcb_crosshair_t * crosshair, Coord X, Coord Y) +static void onpoint_work(pcb_crosshair_t * crosshair, pcb_coord_t X, pcb_coord_t Y) { pcb_box_t SearchBox = point_box(X, Y); struct onpoint_search_info info; @@ -874,7 +874,7 @@ return x * x; } -static double crosshair_sq_dist(pcb_crosshair_t * crosshair, Coord x, Coord y) +static double crosshair_sq_dist(pcb_crosshair_t * crosshair, pcb_coord_t x, pcb_coord_t y) { return square(x - crosshair->X) + square(y - crosshair->Y); } @@ -883,7 +883,7 @@ pcb_crosshair_t *crosshair; double nearest_sq_dist; pcb_bool nearest_is_grid; - Coord x, y; + pcb_coord_t x, y; }; /* Snap to a given location if it is the closest thing we found so far. @@ -892,7 +892,7 @@ * pressing the SHIFT key. If the SHIFT key is pressed, the closest object * (including grid points), is always preferred. */ -static void check_snap_object(struct snap_data *snap_data, Coord x, Coord y, pcb_bool prefer_to_grid) +static void check_snap_object(struct snap_data *snap_data, pcb_coord_t x, pcb_coord_t y, pcb_bool prefer_to_grid) { double sq_dist; @@ -905,12 +905,12 @@ } } -static void check_snap_offgrid_line(struct snap_data *snap_data, Coord nearest_grid_x, Coord nearest_grid_y) +static void check_snap_offgrid_line(struct snap_data *snap_data, pcb_coord_t nearest_grid_x, pcb_coord_t nearest_grid_y) { void *ptr1, *ptr2, *ptr3; int ans; pcb_line_t *line; - Coord try_x, try_y; + pcb_coord_t try_x, try_y; double dx, dy; double dist; @@ -988,9 +988,9 @@ /* --------------------------------------------------------------------------- * recalculates the passed coordinates to fit the current grid setting */ -void FitCrosshairIntoGrid(Coord X, Coord Y) +void FitCrosshairIntoGrid(pcb_coord_t X, pcb_coord_t Y) { - Coord nearest_grid_x, nearest_grid_y; + pcb_coord_t nearest_grid_x, nearest_grid_y; void *ptr1, *ptr2, *ptr3; struct snap_data snap_data; int ans; @@ -1007,8 +1007,8 @@ nearest_grid_y = GridFit(Crosshair.Y, PCB->Grid, PCB->GridOffsetY); if (Marked.status && conf_core.editor.orthogonal_moves) { - Coord dx = Crosshair.X - Marked.X; - Coord dy = Crosshair.Y - Marked.Y; + pcb_coord_t dx = Crosshair.X - Marked.X; + pcb_coord_t dy = Crosshair.Y - Marked.Y; if (PCB_ABS(dx) > PCB_ABS(dy)) nearest_grid_y = Marked.Y; else @@ -1153,7 +1153,7 @@ /* --------------------------------------------------------------------------- * move crosshair relative (has to be switched off) */ -void MoveCrosshairRelative(Coord DeltaX, Coord DeltaY) +void MoveCrosshairRelative(pcb_coord_t DeltaX, pcb_coord_t DeltaY) { FitCrosshairIntoGrid(Crosshair.X + DeltaX, Crosshair.Y + DeltaY); } @@ -1162,9 +1162,9 @@ * move crosshair absolute * return pcb_true if the crosshair was moved from its existing position */ -pcb_bool MoveCrosshairAbsolute(Coord X, Coord Y) +pcb_bool MoveCrosshairAbsolute(pcb_coord_t X, pcb_coord_t Y) { - Coord x, y, z; + pcb_coord_t x, y, z; x = Crosshair.X; y = Crosshair.Y; FitCrosshairIntoGrid(X, Y); @@ -1188,7 +1188,7 @@ /* --------------------------------------------------------------------------- * sets the valid range for the crosshair cursor */ -void SetCrosshairRange(Coord MinX, Coord MinY, Coord MaxX, Coord MaxY) +void SetCrosshairRange(pcb_coord_t MinX, pcb_coord_t MinY, pcb_coord_t MaxX, pcb_coord_t MaxY) { Crosshair.MinX = MAX(0, MinX); Crosshair.MinY = MAX(0, MinY); @@ -1202,9 +1202,9 @@ /* --------------------------------------------------------------------------- * centers the displayed PCB around the specified point (X,Y) */ -void CenterDisplay(Coord X, Coord Y) +void CenterDisplay(pcb_coord_t X, pcb_coord_t Y) { - Coord save_grid = PCB->Grid; + pcb_coord_t save_grid = PCB->Grid; PCB->Grid = 1; if (MoveCrosshairAbsolute(X, Y)) notify_crosshair_change(pcb_true); Index: trunk/src/crosshair.h =================================================================== --- trunk/src/crosshair.h (revision 4810) +++ trunk/src/crosshair.h (revision 4811) @@ -44,7 +44,7 @@ } pcb_attached_box_t; typedef struct { /* currently attached object */ - Coord X, Y; /* saved position when PCB_MODE_MOVE */ + pcb_coord_t X, Y; /* saved position when PCB_MODE_MOVE */ pcb_box_t BoundingBox; long int Type, /* object type */ State; @@ -58,7 +58,7 @@ typedef struct { pcb_bool status; - Coord X, Y; + pcb_coord_t X, Y; } pcb_mark_t; enum crosshair_shape { @@ -71,7 +71,7 @@ typedef struct { /* holds cursor information */ pcb_hid_gc_t GC, /* GC for cursor drawing */ AttachGC; /* and for displaying buffer contents */ - Coord X, Y, /* position in PCB coordinates */ + pcb_coord_t X, Y, /* position in PCB coordinates */ MinX, MinY, /* lowest and highest coordinates */ MaxX, MaxY; pcb_attached_line_t AttachedLine; /* data of new lines... */ @@ -85,7 +85,7 @@ /* list of object IDs that could have been dragged so that they can be cycled */ long int *drags; int drags_len, drags_current; - Coord dragx, dragy; /* the point where drag started */ + pcb_coord_t dragx, dragy; /* the point where drag started */ } pcb_crosshair_t; @@ -96,7 +96,7 @@ #define STATE_SECOND 1 #define STATE_THIRD 2 -Coord GridFit(Coord x, Coord grid_spacing, Coord grid_offset); +pcb_coord_t GridFit(pcb_coord_t x, pcb_coord_t grid_spacing, pcb_coord_t grid_offset); void notify_crosshair_change(pcb_bool changes_complete); void notify_mark_change(pcb_bool changes_complete); void HideCrosshair(void); @@ -103,12 +103,12 @@ void RestoreCrosshair(void); void DrawAttached(void); void DrawMark(void); -void MoveCrosshairRelative(Coord, Coord); -pcb_bool MoveCrosshairAbsolute(Coord, Coord); -void SetCrosshairRange(Coord, Coord, Coord, Coord); +void MoveCrosshairRelative(pcb_coord_t, pcb_coord_t); +pcb_bool MoveCrosshairAbsolute(pcb_coord_t, pcb_coord_t); +void SetCrosshairRange(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_coord_t); void InitCrosshair(void); void DestroyCrosshair(void); -void FitCrosshairIntoGrid(Coord, Coord); -void CenterDisplay(Coord X, Coord Y); +void FitCrosshairIntoGrid(pcb_coord_t, pcb_coord_t); +void CenterDisplay(pcb_coord_t X, pcb_coord_t Y); #endif Index: trunk/src/drc.h =================================================================== --- trunk/src/drc.h (revision 4810) +++ trunk/src/drc.h (revision 4811) @@ -32,11 +32,11 @@ struct drc_violation_s { char *title; char *explanation; - Coord x, y; + pcb_coord_t x, y; pcb_angle_t angle; int have_measured; - Coord measured_value; - Coord required_value; + pcb_coord_t measured_value; + pcb_coord_t required_value; int object_count; long int *object_id_list; int *object_type_list; Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 4810) +++ trunk/src/file_act.c (revision 4811) @@ -53,7 +53,7 @@ %end-doc */ -static int ActionExecCommand(int argc, const char **argv, Coord x, Coord y) +static int ActionExecCommand(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *command; @@ -105,7 +105,7 @@ %end-doc */ -static int ActionLoadFrom(int argc, const char **argv, Coord x, Coord y) +static int ActionLoadFrom(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function, *name, *format = NULL; @@ -168,7 +168,7 @@ %end-doc */ -static int ActionNew(int argc, const char **argv, Coord x, Coord y) +static int ActionNew(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *argument_name = ACTION_ARG(0); char *name = NULL; @@ -243,7 +243,7 @@ %end-doc */ -static int ActionSaveTo(int argc, const char **argv, Coord x, Coord y) +static int ActionSaveTo(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function; const char *name; @@ -336,7 +336,7 @@ %end-doc */ -static int ActionQuit(int argc, const char **argv, Coord x, Coord y) +static int ActionQuit(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *force = ACTION_ARG(0); if (force && strcasecmp(force, "force") == 0) { Index: trunk/src/find.c =================================================================== --- trunk/src/find.c (revision 4810) +++ trunk/src/find.c (revision 4811) @@ -128,7 +128,7 @@ /* --------------------------------------------------------------------------- * some local identifiers */ -static Coord Bloat = 0; +static pcb_coord_t Bloat = 0; static int TheFlag = PCB_FLAG_FOUND; static int OldFlag = PCB_FLAG_FOUND; static void *thing_ptr1, *thing_ptr2, *thing_ptr3; Index: trunk/src/find.h =================================================================== --- trunk/src/find.h (revision 4810) +++ trunk/src/find.h (revision 4811) @@ -68,7 +68,7 @@ pcb_bool IsPolygonInPolygon(pcb_polygon_t *, pcb_polygon_t *); void LookupElementConnections(pcb_element_t *, FILE *); void LookupConnectionsToAllElements(FILE *); -void LookupConnection(Coord, Coord, pcb_bool, Coord, int); +void LookupConnection(pcb_coord_t, pcb_coord_t, pcb_bool, pcb_coord_t, int); void LookupConnectionByPin(int type, void *ptr1); void LookupUnusedPins(FILE *); pcb_bool ResetFoundLinesAndPolygons(pcb_bool); Index: trunk/src/find_act.c =================================================================== --- trunk/src/find_act.c (revision 4810) +++ trunk/src/find_act.c (revision 4811) @@ -45,7 +45,7 @@ %end-doc */ -static int ActionDRCheck(int argc, const char **argv, Coord x, Coord y) +static int ActionDRCheck(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int count; Index: trunk/src/find_drc.c =================================================================== --- trunk/src/find_drc.c (revision 4810) +++ trunk/src/find_drc.c (revision 4811) @@ -44,11 +44,11 @@ static pcb_drc_violation_t * pcb_drc_violation_new(const char *title, const char *explanation, - Coord x, Coord y, + pcb_coord_t x, pcb_coord_t y, pcb_angle_t angle, pcb_bool have_measured, - Coord measured_value, - Coord required_value, int object_count, long int *object_id_list, int *object_type_list) + pcb_coord_t measured_value, + pcb_coord_t required_value, int object_count, long int *object_id_list, int *object_type_list) { pcb_drc_violation_t *violation = (pcb_drc_violation_t *) malloc(sizeof(pcb_drc_violation_t)); @@ -127,7 +127,7 @@ /*---------------------------------------------------------------------------- * Locate the coordinatates of offending item (thing) */ -static void LocateError(Coord * x, Coord * y) +static void LocateError(pcb_coord_t * x, pcb_coord_t * y) { switch (thing_type) { case PCB_TYPE_LINE: @@ -226,7 +226,7 @@ static pcb_r_dir_t drc_callback(pcb_data_t *data, pcb_layer_t *layer, pcb_polygon_t *polygon, int type, void *ptr1, void *ptr2) { const char *message; - Coord x, y; + pcb_coord_t x, y; int object_count; long int *object_id_list; int *object_type_list; @@ -321,7 +321,7 @@ */ int DRCAll(void) { - Coord x, y; + pcb_coord_t x, y; int object_count; long int *object_id_list; int *object_type_list; @@ -707,7 +707,7 @@ */ static pcb_bool DRCFind(int What, void *ptr1, void *ptr2, void *ptr3) { - Coord x, y; + pcb_coord_t x, y; int object_count; long int *object_id_list; int *object_type_list; @@ -827,7 +827,7 @@ */ static void GotoError(void) { - Coord X, Y; + pcb_coord_t X, Y; LocateError(&X, &Y); Index: trunk/src/find_geo.c =================================================================== --- trunk/src/find_geo.c (revision 4810) +++ trunk/src/find_geo.c (revision 4811) @@ -87,7 +87,7 @@ return (sa + d - 360) >= alpha; } -static void get_arc_ends(Coord * box, pcb_arc_t *arc) +static void get_arc_ends(pcb_coord_t * box, pcb_arc_t *arc) { box[0] = arc->X - arc->Width * cos(PCB_M180 * arc->StartAngle); box[1] = arc->Y + arc->Height * sin(PCB_M180 * arc->StartAngle); @@ -123,8 +123,8 @@ static pcb_bool ArcArcIntersect(pcb_arc_t *Arc1, pcb_arc_t *Arc2) { double x, y, dx, dy, r1, r2, a, d, l, t, t1, t2, dl; - Coord pdx, pdy; - Coord box[8]; + pcb_coord_t pdx, pdy; + pcb_coord_t box[8]; t = 0.5 * Arc1->Thickness + Bloat; t2 = 0.5 * Arc2->Thickness; @@ -248,8 +248,8 @@ else if (l->Point1.X == l->Point2.X) dwy = l->Thickness / 2.0; else { - Coord dX = l->Point2.X - l->Point1.X; - Coord dY = l->Point2.Y - l->Point1.Y; + pcb_coord_t dX = l->Point2.X - l->Point1.X; + pcb_coord_t dY = l->Point2.Y - l->Point1.Y; double r = Distance(l->Point1.X, l->Point1.Y, l->Point2.X, l->Point2.Y); dwx = l->Thickness / 2.0 / r * dX; dwy = l->Thickness / 2.0 / r * dY; @@ -511,8 +511,8 @@ if (!Polygon->Clipped) return pcb_false; if (TEST_FLAG(PCB_FLAG_SQUARE, Line) && (Line->Point1.X == Line->Point2.X || Line->Point1.Y == Line->Point2.Y)) { - Coord wid = (Line->Thickness + Bloat + 1) / 2; - Coord x1, x2, y1, y2; + pcb_coord_t wid = (Line->Thickness + Bloat + 1) / 2; + pcb_coord_t x1, x2, y1, y2; x1 = MIN(Line->Point1.X, Line->Point2.X) - wid; y1 = MIN(Line->Point1.Y, Line->Point2.Y) - wid; Index: trunk/src/find_lookup.c =================================================================== --- trunk/src/find_lookup.c (revision 4810) +++ trunk/src/find_lookup.c (revision 4811) @@ -354,10 +354,10 @@ || !i->pv.Clearance)) { double wide = MAX(0.5 * i->pv.Thickness + Bloat, 0); if (TEST_FLAG(PCB_FLAG_SQUARE, &i->pv)) { - Coord x1 = i->pv.X - (i->pv.Thickness + 1 + Bloat) / 2; - Coord x2 = i->pv.X + (i->pv.Thickness + 1 + Bloat) / 2; - Coord y1 = i->pv.Y - (i->pv.Thickness + 1 + Bloat) / 2; - Coord y2 = i->pv.Y + (i->pv.Thickness + 1 + Bloat) / 2; + pcb_coord_t x1 = i->pv.X - (i->pv.Thickness + 1 + Bloat) / 2; + pcb_coord_t x2 = i->pv.X + (i->pv.Thickness + 1 + Bloat) / 2; + pcb_coord_t y1 = i->pv.Y - (i->pv.Thickness + 1 + Bloat) / 2; + pcb_coord_t y2 = i->pv.Y + (i->pv.Thickness + 1 + Bloat) / 2; if (IsRectangleInPolygon(x1, y1, x2, y2, polygon) && ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_PIN, &i->pv, FCT_COPPER)) longjmp(i->env, 1); @@ -668,7 +668,7 @@ if (!TEST_FLAG(TheFlag, pv) && !TEST_FLAG(PCB_FLAG_HOLE, pv) && (TEST_THERM(i->layer, pv) || !TEST_FLAG(PCB_FLAG_CLEARPOLY, &i->polygon) || !pv->Clearance)) { if (TEST_FLAG(PCB_FLAG_SQUARE, pv)) { - Coord x1, x2, y1, y2; + pcb_coord_t x1, x2, y1, y2; x1 = pv->X - (PIN_SIZE(pv) + 1 + Bloat) / 2; x2 = pv->X + (PIN_SIZE(pv) + 1 + Bloat) / 2; y1 = pv->Y - (PIN_SIZE(pv) + 1 + Bloat) / 2; Index: trunk/src/find_misc.c =================================================================== --- trunk/src/find_misc.c (revision 4810) +++ trunk/src/find_misc.c (revision 4811) @@ -214,7 +214,7 @@ * the objects are re-drawn if AndDraw is pcb_true * also the action is marked as undoable if AndDraw is pcb_true */ -void LookupConnection(Coord X, Coord Y, pcb_bool AndDraw, Coord Range, int which_flag) +void LookupConnection(pcb_coord_t X, pcb_coord_t Y, pcb_bool AndDraw, pcb_coord_t Range, int which_flag) { void *ptr1, *ptr2, *ptr3; char *name; Index: trunk/src/font.c =================================================================== --- trunk/src/font.c (revision 4810) +++ trunk/src/font.c (revision 4811) @@ -66,7 +66,7 @@ pcb_cardinal_t i, j; pcb_symbol_t *symbol; pcb_line_t *line; - Coord totalminy = MAX_COORD; + pcb_coord_t totalminy = MAX_COORD; /* calculate cell with and height (is at least DEFAULT_CELLSIZE) * maximum cell width and height @@ -75,7 +75,7 @@ Ptr->MaxWidth = DEFAULT_CELLSIZE; Ptr->MaxHeight = DEFAULT_CELLSIZE; for (i = 0, symbol = Ptr->Symbol; i <= MAX_FONTPOSITION; i++, symbol++) { - Coord minx, miny, maxx, maxy; + pcb_coord_t minx, miny, maxx, maxy; /* next one if the index isn't used or symbol is empty (SPACE) */ if (!symbol->Valid || !symbol->LineN) @@ -123,7 +123,7 @@ } /* creates a new line in a symbol */ -pcb_line_t *CreateNewLineInSymbol(pcb_symbol_t *Symbol, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness) +pcb_line_t *CreateNewLineInSymbol(pcb_symbol_t *Symbol, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness) { pcb_line_t *line = Symbol->Line; Index: trunk/src/font.h =================================================================== --- trunk/src/font.h (revision 4810) +++ trunk/src/font.h (revision 4811) @@ -38,11 +38,11 @@ pcb_bool Valid; pcb_cardinal_t LineN; /* number of lines */ pcb_cardinal_t LineMax; /* lines allocated */ - Coord Width, Height, Delta; /* size of cell, distance to next symbol */ + pcb_coord_t Width, Height, Delta; /* size of cell, distance to next symbol */ } pcb_symbol_t; struct pcb_font_s { /* complete set of symbols */ - Coord MaxHeight, MaxWidth; /* maximum cell width and height */ + pcb_coord_t MaxHeight, MaxWidth; /* maximum cell width and height */ pcb_box_t DefaultSymbol; /* the default symbol is a filled box */ pcb_symbol_t Symbol[MAX_FONTPOSITION + 1]; pcb_bool Valid; @@ -51,7 +51,7 @@ void CreateDefaultFont(pcb_board_t *pcb); void SetFontInfo(pcb_font_t *Ptr); -pcb_line_t *CreateNewLineInSymbol(pcb_symbol_t *Symbol, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness); +pcb_line_t *CreateNewLineInSymbol(pcb_symbol_t *Symbol, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness); #endif Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 4810) +++ trunk/src/gui_act.c (revision 4811) @@ -211,7 +211,7 @@ return shape; } -static int ActionDisplay(int argc, const char **argv, Coord childX, Coord childY) +static int ActionDisplay(int argc, const char **argv, pcb_coord_t childX, pcb_coord_t childY) { const char *function, *str_dir; int id; @@ -418,7 +418,7 @@ /* shift grid alignment */ case F_ToggleGrid: { - Coord oldGrid = PCB->Grid; + pcb_coord_t oldGrid = PCB->Grid; PCB->Grid = 1; if (MoveCrosshairAbsolute(Crosshair.X, Crosshair.Y)) @@ -438,7 +438,7 @@ { pcb_element_t *element; void *ptrtmp; - Coord x, y; + pcb_coord_t x, y; gui->get_coords(_("Click on an element"), &x, &y); if ((SearchScreen(x, y, PCB_TYPE_ELEMENT, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_TYPE_NONE) { @@ -452,7 +452,7 @@ case F_PinOrPadName: { void *ptr1, *ptr2, *ptr3; - Coord x, y; + pcb_coord_t x, y; gui->get_coords(_("Click on an element"), &x, &y); switch (SearchScreen(x, y, @@ -607,7 +607,7 @@ %end-doc */ -static int ActionMode(int argc, const char **argv, Coord x, Coord y) +static int ActionMode(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); @@ -801,7 +801,7 @@ static const char cycledrag_help[] = "Cycle through which object is being dragged"; #define close_enough(a, b) ((((a)-(b)) > 0) ? ((a)-(b) < (SLOP * pixel_slop)) : ((a)-(b) > -(SLOP * pixel_slop))) -static int ActionCycleDrag(int argc, const char **argv, Coord x, Coord y) +static int ActionCycleDrag(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { void *ptr1, *ptr2, *ptr3; int over = 0; @@ -878,7 +878,7 @@ %end-doc */ -static int ActionMessage(int argc, const char **argv, Coord x, Coord y) +static int ActionMessage(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int i; @@ -906,7 +906,7 @@ %end-doc */ -static int ActionToggleHideName(int argc, const char **argv, Coord x, Coord y) +static int ActionToggleHideName(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function && PCB->ElementOn) { @@ -973,7 +973,7 @@ %end-doc */ -static int ActionMarkCrosshair(int argc, const char **argv, Coord x, Coord y) +static int ActionMarkCrosshair(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (!function || !*function) { @@ -1011,7 +1011,7 @@ %end-doc */ -static int ActionRouteStyle(int argc, const char **argv, Coord x, Coord y) +static int ActionRouteStyle(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *str = ACTION_ARG(0); RouteStyleType *rts; @@ -1056,7 +1056,7 @@ %end-doc */ -static int ActionCreateMenu(int argc, const char **argv, Coord x, Coord y) +static int ActionCreateMenu(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (gui == NULL) { Message(PCB_MSG_DEFAULT, "Error: can't create menu, there's no GUI hid loaded\n"); @@ -1080,7 +1080,7 @@ %end-doc */ -static int ActionRemoveMenu(int argc, const char **argv, Coord x, Coord y) +static int ActionRemoveMenu(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (gui == NULL) { Message(PCB_MSG_ERROR, "can't remove menu, there's no GUI hid loaded\n"); @@ -1114,7 +1114,7 @@ sizes (thickness, clearance, drill, etc) according to that item. %end-doc */ -static void set_same_(Coord Thick, Coord Diameter, Coord Hole, Coord Clearance, char *Name) +static void set_same_(pcb_coord_t Thick, pcb_coord_t Diameter, pcb_coord_t Hole, pcb_coord_t Clearance, char *Name) { int known; known = pcb_route_style_lookup(&PCB->RouteStyle, Thick, Diameter, Hole, Clearance, Name); @@ -1129,7 +1129,7 @@ pcb_use_route_style_idx(&PCB->RouteStyle, known); } -static int ActionSetSame(int argc, const char **argv, Coord x, Coord y) +static int ActionSetSame(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { void *ptr1, *ptr2, *ptr3; int type; @@ -1193,7 +1193,7 @@ %end-doc */ -static int ActionSwitchHID(int argc, const char **argv, Coord x, Coord y) +static int ActionSwitchHID(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { pcb_hid_t *ng = hid_find_gui(argv[0]); int chg; @@ -1219,7 +1219,7 @@ static const char fullscreen_help[] = "Hide widgets to get edit area full screen"; -static int FullScreen(int argc, const char **argv, Coord x, Coord y) +static int FullScreen(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *op = argv == NULL ? NULL : argv[0]; Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 4810) +++ trunk/src/hid.h (revision 4811) @@ -80,7 +80,7 @@ /* Called when the action is triggered. If this function returns non-zero, no further actions will be invoked for this key/mouse event. */ - int (*trigger_cb) (int argc, const char **argv, Coord x, Coord y); + int (*trigger_cb) (int argc, const char **argv, pcb_coord_t x, pcb_coord_t y); /* Short description that sometimes accompanies the name. */ const char *description; /* Full allowed syntax; use \n to separate lines. */ @@ -270,7 +270,7 @@ different values each time may be expensive, so grouping items by line style is helpful. */ void (*set_line_cap) (pcb_hid_gc_t gc_, pcb_cap_style_t style_); - void (*set_line_width) (pcb_hid_gc_t gc_, Coord width_); + void (*set_line_width) (pcb_hid_gc_t gc_, pcb_coord_t width_); void (*set_draw_xor) (pcb_hid_gc_t gc_, int xor_); /* Blends 20% or so color with 80% background. Only used for assembly drawings so far. */ @@ -279,11 +279,11 @@ /* The usual drawing functions. "draw" means to use segments of the given width, whereas "fill" means to fill to a zero-width outline. */ - void (*draw_line) (pcb_hid_gc_t gc_, Coord x1_, Coord y1_, Coord x2_, Coord y2_); - void (*draw_arc) (pcb_hid_gc_t gc_, Coord cx_, Coord cy_, Coord xradius_, Coord yradius_, pcb_angle_t start_angle_, pcb_angle_t delta_angle_); - void (*draw_rect) (pcb_hid_gc_t gc_, Coord x1_, Coord y1_, Coord x2_, Coord y2_); - void (*fill_circle) (pcb_hid_gc_t gc_, Coord cx_, Coord cy_, Coord radius_); - void (*fill_polygon) (pcb_hid_gc_t gc_, int n_coords_, Coord * x_, Coord * y_); + void (*draw_line) (pcb_hid_gc_t gc_, pcb_coord_t x1_, pcb_coord_t y1_, pcb_coord_t x2_, pcb_coord_t y2_); + void (*draw_arc) (pcb_hid_gc_t gc_, pcb_coord_t cx_, pcb_coord_t cy_, pcb_coord_t xradius_, pcb_coord_t yradius_, pcb_angle_t start_angle_, pcb_angle_t delta_angle_); + void (*draw_rect) (pcb_hid_gc_t gc_, pcb_coord_t x1_, pcb_coord_t y1_, pcb_coord_t x2_, pcb_coord_t y2_); + void (*fill_circle) (pcb_hid_gc_t gc_, pcb_coord_t cx_, pcb_coord_t cy_, pcb_coord_t radius_); + void (*fill_polygon) (pcb_hid_gc_t gc_, int n_coords_, pcb_coord_t * x_, pcb_coord_t * y_); void (*fill_pcb_polygon) (pcb_hid_gc_t gc_, pcb_polygon_t * poly, const pcb_box_t * clip_box); void (*thindraw_pcb_polygon) (pcb_hid_gc_t gc_, pcb_polygon_t * poly, const pcb_box_t * clip_box); void (*fill_pcb_pad) (pcb_hid_gc_t gc_, pcb_pad_t * pad, pcb_bool clip, pcb_bool mask); @@ -290,7 +290,7 @@ void (*thindraw_pcb_pad) (pcb_hid_gc_t gc_, pcb_pad_t * pad, pcb_bool clip, pcb_bool mask); void (*fill_pcb_pv) (pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask); void (*thindraw_pcb_pv) (pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask); - void (*fill_rect) (pcb_hid_gc_t gc_, Coord x1_, Coord y1_, Coord x2_, Coord y2_); + void (*fill_rect) (pcb_hid_gc_t gc_, pcb_coord_t x1_, pcb_coord_t y1_, pcb_coord_t x2_, pcb_coord_t y2_); /* This is for the printer. If you call this for the GUI, xval and @@ -310,7 +310,7 @@ int (*shift_is_pressed) (void); int (*control_is_pressed) (void); int (*mod1_is_pressed) (void); - void (*get_coords) (const char *msg_, Coord * x_, Coord * y_); + void (*get_coords) (const char *msg_, pcb_coord_t * x_, pcb_coord_t * y_); /* Sets the crosshair, which may differ from the pointer depending on grid and pad snap. Note that the HID is responsible for Index: trunk/src/hid_actions.c =================================================================== --- trunk/src/hid_actions.c (revision 4810) +++ trunk/src/hid_actions.c (revision 4811) @@ -221,7 +221,7 @@ int hid_actionv_(const pcb_hid_action_t *a, int argc, const char **argv) { - Coord x = 0, y = 0; + pcb_coord_t x = 0, y = 0; int i, ret; const pcb_hid_action_t *old_action; Index: trunk/src/hid_attrib.c =================================================================== --- trunk/src/hid_attrib.c (revision 4810) +++ trunk/src/hid_attrib.c (revision 4811) @@ -64,7 +64,7 @@ break; case HID_Coord: if (a->value) - *(Coord *) a->value = a->default_val.coord_value; + *(pcb_coord_t *) a->value = a->default_val.coord_value; break; case HID_Boolean: if (a->value) @@ -122,7 +122,7 @@ break; case HID_Coord: if (a->value) - *(Coord *) a->value = GetValue((*argv)[1], NULL, NULL, NULL); + *(pcb_coord_t *) a->value = GetValue((*argv)[1], NULL, NULL, NULL); else a->default_val.coord_value = GetValue((*argv)[1], NULL, NULL, NULL); (*argc)--; Index: trunk/src/hid_attrib.h =================================================================== --- trunk/src/hid_attrib.h (revision 4810) +++ trunk/src/hid_attrib.h (revision 4811) @@ -12,7 +12,7 @@ int int_value; const char *str_value; double real_value; - Coord coord_value; + pcb_coord_t coord_value; }; enum pcb_hids_t { HID_Label, HID_Integer, HID_Real, HID_String, Index: trunk/src/hid_draw_helpers.c =================================================================== --- trunk/src/hid_draw_helpers.c (revision 4810) +++ trunk/src/hid_draw_helpers.c (revision 4811) @@ -9,12 +9,12 @@ static void fill_contour(pcb_hid_gc_t gc, pcb_pline_t * pl) { - Coord *x, *y, n, i = 0; + pcb_coord_t *x, *y, n, i = 0; pcb_vnode_t *v; n = pl->Count; - x = (Coord *) malloc(n * sizeof(*x)); - y = (Coord *) malloc(n * sizeof(*y)); + x = (pcb_coord_t *) malloc(n * sizeof(*x)); + y = (pcb_coord_t *) malloc(n * sizeof(*y)); for (v = &pl->head; i < n; v = v->next) { x[i] = v->point[0]; @@ -30,8 +30,8 @@ static void thindraw_contour(pcb_hid_gc_t gc, pcb_pline_t * pl) { pcb_vnode_t *v; - Coord last_x, last_y; - Coord this_x, this_y; + pcb_coord_t last_x, last_y; + pcb_coord_t this_x, this_y; gui->set_line_width(gc, 0); gui->set_line_cap(gc, Round_Cap); @@ -104,7 +104,7 @@ #define BOUNDS_INSIDE_CLIP_THRESHOLD 0.5 static int should_compute_no_holes(pcb_polygon_t * poly, const pcb_box_t * clip_box) { - Coord x1, x2, y1, y2; + pcb_coord_t x1, x2, y1, y2; double poly_bounding_area; double clipped_poly_area; @@ -182,17 +182,17 @@ void common_thindraw_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask) { - Coord w = clear ? (mask ? pad->Mask : pad->Thickness + pad->Clearance) + pcb_coord_t w = clear ? (mask ? pad->Mask : pad->Thickness + pad->Clearance) : pad->Thickness; - Coord x1, y1, x2, y2; - Coord t = w / 2; + pcb_coord_t x1, y1, x2, y2; + pcb_coord_t t = w / 2; x1 = pad->Point1.X; y1 = pad->Point1.Y; x2 = pad->Point2.X; y2 = pad->Point2.Y; if (x1 > x2 || y1 > y2) { - Coord temp_x = x1; - Coord temp_y = y1; + pcb_coord_t temp_x = x1; + pcb_coord_t temp_y = y1; x1 = x2; x2 = temp_x; y1 = y2; @@ -224,7 +224,7 @@ } else { /* Slanted round-end pads. */ - Coord dx, dy, ox, oy; + pcb_coord_t dx, dy, ox, oy; double h; dx = x2 - x1; @@ -246,12 +246,12 @@ void common_fill_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask) { - Coord w = clear ? (mask ? pad->Mask : pad->Thickness + pad->Clearance) + pcb_coord_t w = clear ? (mask ? pad->Mask : pad->Thickness + pad->Clearance) : pad->Thickness; if (pad->Point1.X == pad->Point2.X && pad->Point1.Y == pad->Point2.Y) { if (TEST_FLAG(PCB_FLAG_SQUARE, pad)) { - Coord l, r, t, b; + pcb_coord_t l, r, t, b; l = pad->Point1.X - w / 2; b = pad->Point1.Y - w / 2; r = l + w; @@ -288,7 +288,7 @@ double X, Y; } FloatPolyType; -static void draw_square_pin_poly(pcb_hid_gc_t gc, Coord X, Coord Y, Coord Thickness, Coord thin_draw, int style) +static void draw_square_pin_poly(pcb_hid_gc_t gc, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Thickness, pcb_coord_t thin_draw, int style) { static FloatPolyType p[8] = { {0.5, -PCB_TAN_22_5_DEGREE_2}, @@ -303,8 +303,8 @@ static int special_size = 0; static int scaled_x[8]; static int scaled_y[8]; - Coord polygon_x[9]; - Coord polygon_y[9]; + pcb_coord_t polygon_x[9]; + pcb_coord_t polygon_y[9]; double xm[8], ym[8]; int i; @@ -336,7 +336,7 @@ gui->fill_polygon(gc, 8, polygon_x, polygon_y); } -static void draw_octagon_poly(pcb_hid_gc_t gc, Coord X, Coord Y, Coord Thickness, Coord thin_draw) +static void draw_octagon_poly(pcb_hid_gc_t gc, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Thickness, pcb_coord_t thin_draw) { draw_square_pin_poly(gc, X, Y, Thickness, thin_draw, 17); } @@ -344,8 +344,8 @@ void common_fill_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask) { - Coord w = mask ? pv->Mask : pv->Thickness; - Coord r = w / 2; + pcb_coord_t w = mask ? pv->Mask : pv->Thickness; + pcb_coord_t r = w / 2; if (TEST_FLAG(PCB_FLAG_HOLE, pv)) { if (mask) @@ -362,10 +362,10 @@ if (TEST_FLAG(PCB_FLAG_SQUARE, pv)) { /* use the original code for now */ if ((GET_SQUARE(pv) == 0) || (GET_SQUARE(pv) == 1)) { - Coord l = pv->X - r; - Coord b = pv->Y - r; - Coord r = l + w; - Coord t = b + w; + pcb_coord_t l = pv->X - r; + pcb_coord_t b = pv->Y - r; + pcb_coord_t r = l + w; + pcb_coord_t t = b + w; gui->fill_rect(fg_gc, l, b, r, t); } else @@ -383,8 +383,8 @@ void common_thindraw_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t * pv, pcb_bool drawHole, pcb_bool mask) { - Coord w = mask ? pv->Mask : pv->Thickness; - Coord r = w / 2; + pcb_coord_t w = mask ? pv->Mask : pv->Thickness; + pcb_coord_t r = w / 2; if (TEST_FLAG(PCB_FLAG_HOLE, pv)) { if (mask) @@ -399,10 +399,10 @@ } if (TEST_FLAG(PCB_FLAG_SQUARE, pv)) { - Coord l = pv->X - r; - Coord b = pv->Y - r; - Coord r = l + w; - Coord t = b + w; + pcb_coord_t l = pv->X - r; + pcb_coord_t b = pv->Y - r; + pcb_coord_t r = l + w; + pcb_coord_t t = b + w; gui->set_line_cap(fg_gc, Round_Cap); gui->set_line_width(fg_gc, 0); Index: trunk/src/hid_extents.c =================================================================== --- trunk/src/hid_extents.c (revision 4810) +++ trunk/src/hid_extents.c (revision 4811) @@ -61,7 +61,7 @@ { } -static void extents_set_line_width(pcb_hid_gc_t gc, Coord width) +static void extents_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { gc->width = width; } @@ -75,7 +75,7 @@ #define PEY(y,w) if (box.Y1 > (y)-(w)) box.Y1 = (y)-(w); \ if (box.Y2 < (y)+(w)) box.Y2 = (y)+(w) -static void extents_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void extents_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { PEX(x1, gc->width); PEY(y1, gc->width); @@ -83,7 +83,7 @@ PEY(y2, gc->width); } -static void extents_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord width, Coord height, pcb_angle_t start_angle, pcb_angle_t end_angle) +static void extents_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t end_angle) { /* Naive but good enough. */ PEX(cx, width + gc->width); @@ -90,7 +90,7 @@ PEY(cy, height + gc->width); } -static void extents_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void extents_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { PEX(x1, gc->width); PEY(y1, gc->width); @@ -98,13 +98,13 @@ PEY(y2, gc->width); } -static void extents_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +static void extents_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { PEX(cx, radius); PEY(cy, radius); } -static void extents_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y) +static void extents_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { int i; for (i = 0; i < n_coords; i++) { @@ -113,7 +113,7 @@ } } -static void extents_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void extents_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { PEX(x1, 0); PEY(y1, 0); Index: trunk/src/hid_nogui.c =================================================================== --- trunk/src/hid_nogui.c (revision 4810) +++ trunk/src/hid_nogui.c (revision 4811) @@ -79,7 +79,7 @@ CRASH("set_line_cap"); } -static void nogui_set_line_width(pcb_hid_gc_t gc, Coord width) +static void nogui_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { CRASH("set_line_width"); } @@ -93,27 +93,27 @@ { } -static void nogui_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void nogui_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { CRASH("draw_line"); } -static void nogui_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord width, Coord height, pcb_angle_t start_angle, pcb_angle_t end_angle) +static void nogui_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t end_angle) { CRASH("draw_arc"); } -static void nogui_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void nogui_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { CRASH("draw_rect"); } -static void nogui_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +static void nogui_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { CRASH("fill_circle"); } -static void nogui_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y) +static void nogui_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { CRASH("fill_polygon"); } @@ -143,7 +143,7 @@ CRASH("thindraw_pcb_pv"); } -static void nogui_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void nogui_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { CRASH("fill_rect"); } @@ -171,7 +171,7 @@ return 0; } -static void nogui_get_coords(const char *msg, Coord * x, Coord * y) +static void nogui_get_coords(const char *msg, pcb_coord_t * x, pcb_coord_t * y) { CRASH("get_coords"); } Index: trunk/src/ht_element.c =================================================================== --- trunk/src/ht_element.c (revision 4810) +++ trunk/src/ht_element.c (revision 4811) @@ -24,9 +24,9 @@ #define neqox(e1, x1, e2, x2, f) (eoffs(e1, MarkX, x1, f) != eoffs(e2, MarkX, x2, f)) #define neqoy(e1, y1, e2, y2, f) (eoffs(e1, MarkY, y1, f) != eoffs(e2, MarkY, y2, f)) -static inline unsigned h_coord(Coord c) +static inline unsigned h_coord(pcb_coord_t c) { - return murmurhash(&(c), sizeof(Coord)); + return murmurhash(&(c), sizeof(pcb_coord_t)); } #define h_coordox(e, c) ((e) == NULL ? h_coord(c) : h_coord(c - e->MarkX)) Index: trunk/src/insert.c =================================================================== --- trunk/src/insert.c (revision 4810) +++ trunk/src/insert.c (revision 4811) @@ -61,7 +61,7 @@ /* --------------------------------------------------------------------------- * inserts point into objects */ -void *InsertPointIntoObject(int Type, void *Ptr1, void *Ptr2, pcb_cardinal_t * Ptr3, Coord DX, Coord DY, pcb_bool Force, pcb_bool insert_last) +void *InsertPointIntoObject(int Type, void *Ptr1, void *Ptr2, pcb_cardinal_t * Ptr3, pcb_coord_t DX, pcb_coord_t DY, pcb_bool Force, pcb_bool insert_last) { void *ptr; pcb_opctx_t ctx; @@ -87,7 +87,7 @@ { static pcb_point_t InsertedPoint; double m; - Coord x, y, m1, m2; + pcb_coord_t x, y, m1, m2; pcb_line_t *line = (pcb_line_t *) Crosshair.AttachedObject.Ptr2; if (Crosshair.AttachedObject.State == STATE_FIRST) Index: trunk/src/insert.h =================================================================== --- trunk/src/insert.h (revision 4810) +++ trunk/src/insert.h (revision 4811) @@ -36,7 +36,7 @@ /* --------------------------------------------------------------------------- * prototypes */ -void *InsertPointIntoObject(int, void *, void *, pcb_cardinal_t *, Coord, Coord, pcb_bool, pcb_bool); +void *InsertPointIntoObject(int, void *, void *, pcb_cardinal_t *, pcb_coord_t, pcb_coord_t, pcb_bool, pcb_bool); pcb_point_t *AdjustInsertPoint(void); #endif Index: trunk/src/intersect.c =================================================================== --- trunk/src/intersect.c (revision 4810) +++ trunk/src/intersect.c (revision 4811) @@ -49,9 +49,9 @@ * some local types */ typedef struct { - Coord left, right; + pcb_coord_t left, right; int covered; - Coord area; + pcb_coord_t area; } SegmentTreeNode; typedef struct { @@ -60,7 +60,7 @@ } SegmentTree; typedef struct { - Coord *p; + pcb_coord_t *p; int size; } LocationList; @@ -70,11 +70,11 @@ static LocationList createSortedYList(pcb_box_list_t *boxlist) { LocationList yCoords; - Coord last; + pcb_coord_t last; int i, n; /* create sorted list of Y coordinates */ yCoords.size = 2 * boxlist->BoxN; - yCoords.p = (Coord *) calloc(yCoords.size, sizeof(*yCoords.p)); + yCoords.p = (pcb_coord_t *) calloc(yCoords.size, sizeof(*yCoords.p)); for (i = 0; i < boxlist->BoxN; i++) { yCoords.p[2 * i] = boxlist->Box[i].Y1; yCoords.p[2 * i + 1] = boxlist->Box[i].Y2; @@ -92,7 +92,7 @@ /* --------------------------------------------------------------------------- * Create an empty segment tree from the given sorted list of uniq y coords. */ -static SegmentTree createSegmentTree(Coord * yCoords, int N) +static SegmentTree createSegmentTree(pcb_coord_t * yCoords, int N) { SegmentTree st; int i; @@ -116,9 +116,9 @@ return st; } -void insertSegment(SegmentTree * st, int n, Coord Y1, Coord Y2) +void insertSegment(SegmentTree * st, int n, pcb_coord_t Y1, pcb_coord_t Y2) { - Coord discriminant; + pcb_coord_t discriminant; if (st->nodes[n].left >= Y1 && st->nodes[n].right <= Y2) { st->nodes[n].covered++; } @@ -135,9 +135,9 @@ (st->nodes[n].right - st->nodes[n].left) : (n >= st->size / 2) ? 0 : st->nodes[n * 2].area + st->nodes[n * 2 + 1].area; } -void deleteSegment(SegmentTree * st, int n, Coord Y1, Coord Y2) +void deleteSegment(SegmentTree * st, int n, pcb_coord_t Y1, pcb_coord_t Y2) { - Coord discriminant; + pcb_coord_t discriminant; if (st->nodes[n].left >= Y1 && st->nodes[n].right <= Y2) { assert(st->nodes[n].covered); --st->nodes[n].covered; @@ -183,7 +183,7 @@ pcb_cardinal_t i, j; LocationList yCoords; SegmentTree segtree; - Coord lastX; + pcb_coord_t lastX; double area = 0.0; if (boxlist->BoxN == 0) @@ -254,7 +254,7 @@ static int comparepos(const void *ptr1, const void *ptr2) { - return *((Coord *) ptr1) - *((Coord *) ptr2); + return *((pcb_coord_t *) ptr1) - *((pcb_coord_t *) ptr2); } static int nextpwrof2(int n) Index: trunk/src/main_act.c =================================================================== --- trunk/src/main_act.c (revision 4810) +++ trunk/src/main_act.c (revision 4811) @@ -40,7 +40,7 @@ static const char printactions_help[] = "Print all actions available."; -int ActionPrintActions(int argc, const char **argv, Coord x, Coord y) +int ActionPrintActions(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { print_actions(); return 0; @@ -51,7 +51,7 @@ static const char dumpactions_help[] = "Dump all actions available."; -int ActionDumpActions(int argc, const char **argv, Coord x, Coord y) +int ActionDumpActions(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { dump_actions(); return 0; @@ -142,7 +142,7 @@ return 0; } -int ActionPrintUsage(int argc, const char **argv, Coord x, Coord y) +int ActionPrintUsage(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { u(""); if (argc > 0) { @@ -174,7 +174,7 @@ static const char printversion_help[] = "Print version."; -int ActionPrintVersion(int argc, const char **argv, Coord x, Coord y) +int ActionPrintVersion(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { printf("PCB version %s\n", VERSION); return 0; @@ -185,7 +185,7 @@ static const char printcopyright_help[] = "Print copyright notice."; -int ActionPrintCopyright(int argc, const char **argv, Coord x, Coord y) +int ActionPrintCopyright(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { printf("\n" " COPYRIGHT for the original pcb program:\n\n" @@ -227,7 +227,7 @@ printf("\"\n"); } -int ActionPrintPaths(int argc, const char **argv, Coord x, Coord y) +int ActionPrintPaths(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { htsp_entry_t *e; conf_fields_foreach(e) { Index: trunk/src/misc_util.c =================================================================== --- trunk/src/misc_util.c (revision 4810) +++ trunk/src/misc_util.c (revision 4811) @@ -172,10 +172,10 @@ return rv; } -Coord GetNum(char **s, const char *default_unit) +pcb_coord_t GetNum(char **s, const char *default_unit) { /* Read value */ - Coord ret_val = GetValueEx(*s, NULL, NULL, NULL, default_unit, NULL); + pcb_coord_t ret_val = GetValueEx(*s, NULL, NULL, NULL, default_unit, NULL); /* Advance pointer */ while (isalnum(**s) || **s == '.') (*s)++; Index: trunk/src/misc_util.h =================================================================== --- trunk/src/misc_util.h (revision 4810) +++ trunk/src/misc_util.h (revision 4811) @@ -44,7 +44,7 @@ double GetValue(const char *, const char *, pcb_bool *, pcb_bool *success); double GetValueEx(const char *, const char *, pcb_bool *, pcb_unit_list_t, const char *, pcb_bool *success); -Coord GetNum(char **s, const char *default_unit); +pcb_coord_t GetNum(char **s, const char *default_unit); char *Concat(const char *, ...); /* end with NULL */ Index: trunk/src/move.c =================================================================== --- trunk/src/move.c (revision 4810) +++ trunk/src/move.c (revision 4811) @@ -67,7 +67,7 @@ * moves the object identified by its data pointers and the type * not we don't bump the undo serial number */ -void *MoveObject(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY) +void *MoveObject(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t DX, pcb_coord_t DY) { void *result; pcb_opctx_t ctx; @@ -84,7 +84,7 @@ * moves the object identified by its data pointers and the type * as well as all attached rubberband lines */ -void *MoveObjectAndRubberband(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY) +void *MoveObjectAndRubberband(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t DX, pcb_coord_t DY) { pcb_rubberband_t *ptr; pcb_opctx_t ctx; @@ -391,7 +391,7 @@ %end-doc */ -int MoveLayerAction(int argc, const char **argv, Coord x, Coord y) +int MoveLayerAction(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int old_index, new_index; int new_top = -1; Index: trunk/src/move.h =================================================================== --- trunk/src/move.h (revision 4810) +++ trunk/src/move.h (revision 4811) @@ -50,9 +50,9 @@ /* --------------------------------------------------------------------------- * prototypes */ -void *MoveObject(int, void *, void *, void *, Coord, Coord); +void *MoveObject(int, void *, void *, void *, pcb_coord_t, pcb_coord_t); void *MoveObjectToLayer(int, void *, void *, void *, pcb_layer_t *, pcb_bool); -void *MoveObjectAndRubberband(int, void *, void *, void *, Coord, Coord); +void *MoveObjectAndRubberband(int, void *, void *, void *, pcb_coord_t, pcb_coord_t); pcb_bool MoveSelectedObjectsToLayer(pcb_layer_t *); /* index is 0..MAX_LAYER-1. If old_index is -1, a new layer is Index: trunk/src/netlist.c =================================================================== --- trunk/src/netlist.c (revision 4810) +++ trunk/src/netlist.c (revision 4811) @@ -97,7 +97,7 @@ return 0; } -int pcb_pin_name_to_xy(pcb_lib_entry_t * pin, Coord *x, Coord *y) +int pcb_pin_name_to_xy(pcb_lib_entry_t * pin, pcb_coord_t *x, pcb_coord_t *y) { pcb_connection_t conn; if (!SeekPad(pin, &conn, pcb_false)) @@ -117,7 +117,7 @@ void pcb_netlist_find(pcb_lib_menu_t * net, pcb_lib_entry_t * pin) { - Coord x, y; + pcb_coord_t x, y; if (pcb_pin_name_to_xy(net->Entry, &x, &y)) return; LookupConnection(x, y, 1, 1, PCB_FLAG_FOUND); @@ -125,7 +125,7 @@ void pcb_netlist_select(pcb_lib_menu_t * net, pcb_lib_entry_t * pin) { - Coord x, y; + pcb_coord_t x, y; if (pcb_pin_name_to_xy(net->Entry, &x, &y)) return; LookupConnection(x, y, 1, 1, PCB_FLAG_SELECTED); Index: trunk/src/netlist.h =================================================================== --- trunk/src/netlist.h (revision 4810) +++ trunk/src/netlist.h (revision 4811) @@ -56,7 +56,7 @@ pcb_lib_menu_t *pcb_netnode_to_netname(const char *nodename); pcb_lib_menu_t *pcb_netname_to_netname(const char *netname); -int pcb_pin_name_to_xy(pcb_lib_entry_t *pin, Coord *x, Coord *y); +int pcb_pin_name_to_xy(pcb_lib_entry_t *pin, pcb_coord_t *x, pcb_coord_t *y); void pcb_netlist_find(pcb_lib_menu_t *net, pcb_lib_entry_t *pin); void pcb_netlist_select(pcb_lib_menu_t *net, pcb_lib_entry_t *pin); void pcb_netlist_rats(pcb_lib_menu_t *net, pcb_lib_entry_t *pin); Index: trunk/src/netlist_act.c =================================================================== --- trunk/src/netlist_act.c (revision 4810) +++ trunk/src/netlist_act.c (revision 4811) @@ -202,7 +202,7 @@ typedef void (*NFunc) (pcb_lib_menu_t *, pcb_lib_entry_t *); -static int ActionNetlist(int argc, const char **argv, Coord x, Coord y) +static int ActionNetlist(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { NFunc func; int i, j; Index: trunk/src/obj_arc.c =================================================================== --- trunk/src/obj_arc.c (revision 4810) +++ trunk/src/obj_arc.c (revision 4811) @@ -71,7 +71,7 @@ double ca1, ca2, sa1, sa2; double minx, maxx, miny, maxy; pcb_angle_t ang1, ang2; - Coord width; + pcb_coord_t width; /* first put angles into standard form: * ang1 < ang2, both angles between 0 and 720 */ @@ -158,7 +158,7 @@ } -void ChangeArcRadii(pcb_layer_t *Layer, pcb_arc_t *a, Coord new_width, Coord new_height) +void ChangeArcRadii(pcb_layer_t *Layer, pcb_arc_t *a, pcb_coord_t new_width, pcb_coord_t new_height) { RestoreToPolygon(PCB->Data, PCB_TYPE_ARC, Layer, a); r_delete_entry(Layer->arc_tree, (pcb_box_t *) a); @@ -172,7 +172,7 @@ /* creates a new arc on a layer */ -pcb_arc_t *CreateNewArcOnLayer(pcb_layer_t *Layer, Coord X1, Coord Y1, Coord width, Coord height, pcb_angle_t sa, pcb_angle_t dir, Coord Thickness, Coord Clearance, pcb_flag_t Flags) +pcb_arc_t *CreateNewArcOnLayer(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t width, pcb_coord_t height, pcb_angle_t sa, pcb_angle_t dir, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_flag_t Flags) { pcb_arc_t *Arc; @@ -253,7 +253,7 @@ /* changes the size of an arc */ void *ChangeArcSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc) { - Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Arc->Thickness + ctx->chgsize.delta; + pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Arc->Thickness + ctx->chgsize.delta; if (TEST_FLAG(PCB_FLAG_LOCK, Arc)) return (NULL); @@ -275,7 +275,7 @@ /* changes the clearance size of an arc */ void *ChangeArcClearSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc) { - Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Arc->Clearance + ctx->chgsize.delta; + pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Arc->Clearance + ctx->chgsize.delta; if (TEST_FLAG(PCB_FLAG_LOCK, Arc) || !TEST_FLAG(PCB_FLAG_CLEARLINE, Arc)) return (NULL); @@ -302,7 +302,7 @@ /* changes the radius of an arc (is_primary 0=width or 1=height or 2=both) */ void *ChangeArcRadius(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_arc_t *Arc) { - Coord value, *dst; + pcb_coord_t value, *dst; void *a0, *a1; if (TEST_FLAG(PCB_FLAG_LOCK, Arc)) @@ -523,9 +523,9 @@ } /* rotates an arc */ -void RotateArcLowLevel(pcb_arc_t *Arc, Coord X, Coord Y, unsigned Number) +void RotateArcLowLevel(pcb_arc_t *Arc, pcb_coord_t X, pcb_coord_t Y, unsigned Number) { - Coord save; + pcb_coord_t save; /* add Number*90 degrees (i.e., Number quarter-turns) */ Arc->StartAngle = NormalizeAngle(Arc->StartAngle + Number * 90); Index: trunk/src/obj_arc.h =================================================================== --- trunk/src/obj_arc.h (revision 4810) +++ trunk/src/obj_arc.h (revision 4811) @@ -33,8 +33,8 @@ struct pcb_arc_s { /* holds information about arcs */ PCB_ANYOBJECTFIELDS; - Coord Thickness, Clearance; - Coord Width, Height, /* length of axis */ + pcb_coord_t Thickness, Clearance; + pcb_coord_t Width, Height, /* length of axis */ X, Y; /* center coordinates */ pcb_angle_t StartAngle, Delta; /* the two limiting angles in degrees */ gdl_elem_t link; /* an arc is in a list: either on a layer or in an element */ @@ -50,14 +50,14 @@ void SetArcBoundingBox(pcb_arc_t *Arc); pcb_box_t *GetArcEnds(pcb_arc_t *Arc); void ChangeArcAngles(pcb_layer_t *Layer, pcb_arc_t *a, pcb_angle_t new_sa, pcb_angle_t new_da); -void ChangeArcRadii(pcb_layer_t *Layer, pcb_arc_t *a, Coord new_width, Coord new_height); +void ChangeArcRadii(pcb_layer_t *Layer, pcb_arc_t *a, pcb_coord_t new_width, pcb_coord_t new_height); void *RemoveArc(pcb_layer_t *Layer, pcb_arc_t *Arc); -pcb_arc_t *CreateNewArcOnLayer(pcb_layer_t *Layer, Coord X1, Coord Y1, Coord width, Coord height, pcb_angle_t sa, pcb_angle_t dir, Coord Thickness, Coord Clearance, pcb_flag_t Flags); +pcb_arc_t *CreateNewArcOnLayer(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t width, pcb_coord_t height, pcb_angle_t sa, pcb_angle_t dir, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_flag_t Flags); /* Add objects without creating them or making any "sanity modifications" to them */ void pcb_add_arc_on_layer(pcb_layer_t *Layer, pcb_arc_t *Arc); -void RotateArcLowLevel(pcb_arc_t *Arc, Coord X, Coord Y, unsigned Number); +void RotateArcLowLevel(pcb_arc_t *Arc, pcb_coord_t X, pcb_coord_t Y, unsigned Number); #define MOVE_ARC_LOWLEVEL(a,dx,dy) \ { \ Index: trunk/src/obj_common.h =================================================================== --- trunk/src/obj_common.h (revision 4810) +++ trunk/src/obj_common.h (revision 4811) @@ -35,13 +35,13 @@ /* point and box type - they are so common everything depends on them */ struct pcb_point_s { /* a line/polygon point */ - Coord X, Y, X2, Y2; /* so Point type can be cast as pcb_box_t */ + pcb_coord_t X, Y, X2, Y2; /* so Point type can be cast as pcb_box_t */ long int ID; }; struct pcb_box_s { /* a bounding box */ - Coord X1, Y1; /* upper left */ - Coord X2, Y2; /* and lower right corner */ + pcb_coord_t X1, Y1; /* upper left */ + pcb_coord_t X2, Y2; /* and lower right corner */ }; pcb_box_t *GetObjectBoundingBox(int Type, void *Ptr1, void *Ptr2, void *Ptr3); @@ -85,7 +85,7 @@ /* Lines, pads, and rats all use this so they can be cross-cast. */ #define PCB_ANYLINEFIELDS \ PCB_ANYOBJECTFIELDS; \ - Coord Thickness, \ + pcb_coord_t Thickness, \ Clearance; \ pcb_point_t Point1, \ Point2 Index: trunk/src/obj_elem.c =================================================================== --- trunk/src/obj_elem.c (revision 4810) +++ trunk/src/obj_elem.c (revision 4811) @@ -331,7 +331,7 @@ END_LOOP; POLYGON_LOOP(layer); { - Coord x1, y1, x2, y2, w, h, t; + pcb_coord_t x1, y1, x2, y2, w, h, t; if (!polygon_is_rectangle(polygon)) { crooked = pcb_true; @@ -391,7 +391,7 @@ return (pcb_true); } -void FreeRotateElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, Coord X, Coord Y, double cosa, double sina, pcb_angle_t angle) +void FreeRotateElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y, double cosa, double sina, pcb_angle_t angle) { /* solder side objects need a different orientation */ @@ -448,7 +448,7 @@ } /* changes the side of the board an element is on; returns pcb_true if done */ -pcb_bool ChangeElementSide(pcb_element_t *Element, Coord yoff) +pcb_bool ChangeElementSide(pcb_element_t *Element, pcb_coord_t yoff) { if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (pcb_false); @@ -506,7 +506,7 @@ } /* copies data from one element to another and creates the destination; if necessary */ -pcb_element_t *CopyElementLowLevel(pcb_data_t *Data, pcb_element_t *Dest, pcb_element_t *Src, pcb_bool uniqueName, Coord dx, Coord dy) +pcb_element_t *CopyElementLowLevel(pcb_data_t *Data, pcb_element_t *Dest, pcb_element_t *Src, pcb_bool uniqueName, pcb_coord_t dx, pcb_coord_t dy) { int i; /* release old memory if necessary */ @@ -564,7 +564,7 @@ /* creates an new element; memory is allocated if needed */ pcb_element_t *CreateNewElement(pcb_data_t *Data, pcb_element_t *Element, pcb_font_t *PCBFont, pcb_flag_t Flags, char *Description, char *NameOnPCB, - char *Value, Coord TextX, Coord TextY, pcb_uint8_t Direction, + char *Value, pcb_coord_t TextX, pcb_coord_t TextY, pcb_uint8_t Direction, int TextScale, pcb_flag_t TextFlags, pcb_bool uniqueName) { #ifdef DEBUG @@ -595,8 +595,8 @@ } /* creates a new arc in an element */ -pcb_arc_t *CreateNewArcInElement(pcb_element_t *Element, Coord X, Coord Y, - Coord Width, Coord Height, pcb_angle_t angle, pcb_angle_t delta, Coord Thickness) +pcb_arc_t *CreateNewArcInElement(pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y, + pcb_coord_t Width, pcb_coord_t Height, pcb_angle_t angle, pcb_angle_t delta, pcb_coord_t Thickness) { pcb_arc_t *arc = GetElementArcMemory(Element); @@ -623,7 +623,7 @@ } /* creates a new line for an element */ -pcb_line_t *CreateNewLineInElement(pcb_element_t *Element, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness) +pcb_line_t *CreateNewLineInElement(pcb_element_t *Element, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness) { pcb_line_t *line; @@ -645,7 +645,7 @@ /* creates a new textobject as part of an element copies the values to the appropriate text object */ -void AddTextToElement(pcb_text_t *Text, pcb_font_t *PCBFont, Coord X, Coord Y, +void AddTextToElement(pcb_text_t *Text, pcb_font_t *PCBFont, pcb_coord_t X, pcb_coord_t Y, unsigned Direction, char *TextString, int Scale, pcb_flag_t Flags) { free(Text->TextString); @@ -662,7 +662,7 @@ } /* mirrors the coordinates of an element; an additional offset is passed */ -void MirrorElementCoordinates(pcb_data_t *Data, pcb_element_t *Element, Coord yoff) +void MirrorElementCoordinates(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t yoff) { r_delete_element(Data, Element); ELEMENTLINE_LOOP(Element); @@ -930,7 +930,7 @@ */ int ElementOrientation(pcb_element_t * e) { - Coord pin1x, pin1y, pin2x, pin2y, dx, dy; + pcb_coord_t pin1x, pin1y, pin2x, pin2y, dx, dy; pcb_bool found_pin1 = 0; pcb_bool found_pin2 = 0; @@ -991,7 +991,7 @@ } /* moves a element by +-X and +-Y */ -void MoveElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, Coord DX, Coord DY) +void MoveElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t DX, pcb_coord_t DY) { if (Data) r_delete_entry(Data->element_tree, (pcb_box_t *) Element); @@ -1059,7 +1059,7 @@ } /* rotate an element in 90 degree steps */ -void RotateElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, Coord X, Coord Y, unsigned Number) +void RotateElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y, unsigned Number) { /* solder side objects need a different orientation */ @@ -1184,7 +1184,7 @@ void *ChangeElement2ndSize(pcb_opctx_t *ctx, pcb_element_t *Element) { pcb_bool changed = pcb_false; - Coord value; + pcb_coord_t value; if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (NULL); @@ -1218,7 +1218,7 @@ void *ChangeElement1stSize(pcb_opctx_t *ctx, pcb_element_t *Element) { pcb_bool changed = pcb_false; - Coord value; + pcb_coord_t value; if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (NULL); @@ -1250,7 +1250,7 @@ void *ChangeElementClearSize(pcb_opctx_t *ctx, pcb_element_t *Element) { pcb_bool changed = pcb_false; - Coord value; + pcb_coord_t value; if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (NULL); @@ -1307,7 +1307,7 @@ /* changes the scaling factor of an element's outline; returns pcb_true if changed */ void *ChangeElementSize(pcb_opctx_t *ctx, pcb_element_t *Element) { - Coord value; + pcb_coord_t value; pcb_bool changed = pcb_false; if (TEST_FLAG(PCB_FLAG_LOCK, Element)) @@ -1752,9 +1752,9 @@ return R_DIR_FOUND_CONTINUE; } -static void DrawEMark(pcb_element_t *e, Coord X, Coord Y, pcb_bool invisible) +static void DrawEMark(pcb_element_t *e, pcb_coord_t X, pcb_coord_t Y, pcb_bool invisible) { - Coord mark_size = EMARK_SIZE; + pcb_coord_t mark_size = EMARK_SIZE; if (!PCB->InvisibleObjectsOn && invisible) return; Index: trunk/src/obj_elem.h =================================================================== --- trunk/src/obj_elem.h (revision 4810) +++ trunk/src/obj_elem.h (revision 4811) @@ -40,7 +40,7 @@ struct pcb_element_s { PCB_ANYOBJECTFIELDS; pcb_text_t Name[MAX_ELEMENTNAMES]; /* the elements names: description text, name on PCB second, value third - see NAME_INDEX() below */ - Coord MarkX, MarkY; /* position mark */ + pcb_coord_t MarkX, MarkY; /* position mark */ pinlist_t Pin; padlist_t Pad; linelist_t Line; @@ -59,10 +59,10 @@ int LoadFootprintByName(pcb_buffer_t *Buffer, const char *Footprint); pcb_bool SmashBufferElement(pcb_buffer_t *Buffer); pcb_bool ConvertBufferToElement(pcb_buffer_t *Buffer); -void FreeRotateElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, Coord X, Coord Y, double cosa, double sina, pcb_angle_t angle); -pcb_bool ChangeElementSide(pcb_element_t *Element, Coord yoff); +void FreeRotateElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y, double cosa, double sina, pcb_angle_t angle); +pcb_bool ChangeElementSide(pcb_element_t *Element, pcb_coord_t yoff); pcb_bool ChangeSelectedElementSide(void); -pcb_element_t *CopyElementLowLevel(pcb_data_t *Data, pcb_element_t *Dest, pcb_element_t *Src, pcb_bool uniqueName, Coord dx, Coord dy); +pcb_element_t *CopyElementLowLevel(pcb_data_t *Data, pcb_element_t *Dest, pcb_element_t *Src, pcb_bool uniqueName, pcb_coord_t dx, pcb_coord_t dy); void SetElementBoundingBox(pcb_data_t *Data, pcb_element_t *Element, pcb_font_t *Font); char *UniqueElementName(pcb_data_t *Data, char *Name); void r_delete_element(pcb_data_t * data, pcb_element_t * element); @@ -71,22 +71,22 @@ comparing two similar footprints. */ int ElementOrientation(pcb_element_t * e); -void MoveElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, Coord DX, Coord DY); +void MoveElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t DX, pcb_coord_t DY); void *RemoveElement(pcb_element_t *Element); -void RotateElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, Coord X, Coord Y, unsigned Number); -void MirrorElementCoordinates(pcb_data_t *Data, pcb_element_t *Element, Coord yoff); +void RotateElementLowLevel(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y, unsigned Number); +void MirrorElementCoordinates(pcb_data_t *Data, pcb_element_t *Element, pcb_coord_t yoff); pcb_element_t *CreateNewElement(pcb_data_t *Data, pcb_element_t *Element, pcb_font_t *PCBFont, pcb_flag_t Flags, char *Description, char *NameOnPCB, - char *Value, Coord TextX, Coord TextY, pcb_uint8_t Direction, + char *Value, pcb_coord_t TextX, pcb_coord_t TextY, pcb_uint8_t Direction, int TextScale, pcb_flag_t TextFlags, pcb_bool uniqueName); -pcb_arc_t *CreateNewArcInElement(pcb_element_t *Element, Coord X, Coord Y, - Coord Width, Coord Height, pcb_angle_t angle, pcb_angle_t delta, Coord Thickness); +pcb_arc_t *CreateNewArcInElement(pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y, + pcb_coord_t Width, pcb_coord_t Height, pcb_angle_t angle, pcb_angle_t delta, pcb_coord_t Thickness); -pcb_line_t *CreateNewLineInElement(pcb_element_t *Element, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness); +pcb_line_t *CreateNewLineInElement(pcb_element_t *Element, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness); -void AddTextToElement(pcb_text_t *Text, pcb_font_t *PCBFont, Coord X, Coord Y, +void AddTextToElement(pcb_text_t *Text, pcb_font_t *PCBFont, pcb_coord_t X, pcb_coord_t Y, unsigned Direction, char *TextString, int Scale, pcb_flag_t Flags); Index: trunk/src/obj_line.c =================================================================== --- trunk/src/obj_line.c (revision 4810) +++ trunk/src/obj_line.c (revision 4811) @@ -71,8 +71,8 @@ /**** utility ****/ struct line_info { - Coord X1, X2, Y1, Y2; - Coord Thickness; + pcb_coord_t X1, X2, Y1, Y2; + pcb_coord_t Thickness; pcb_flag_t Flags; pcb_line_t test, *ans; jmp_buf env; @@ -146,7 +146,7 @@ /* creates a new line on a layer and checks for overlap and extension */ -pcb_line_t *CreateDrawnLineOnLayer(pcb_layer_t *Layer, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness, Coord Clearance, pcb_flag_t Flags) +pcb_line_t *CreateDrawnLineOnLayer(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_flag_t Flags) { struct line_info info; pcb_box_t search; @@ -191,7 +191,7 @@ return CreateNewLineOnLayer(Layer, X1, Y1, X2, Y2, Thickness, Clearance, Flags); } -pcb_line_t *CreateNewLineOnLayer(pcb_layer_t *Layer, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness, Coord Clearance, pcb_flag_t Flags) +pcb_line_t *CreateNewLineOnLayer(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_flag_t Flags) { pcb_line_t *Line; @@ -224,7 +224,7 @@ /* sets the bounding box of a line */ void SetLineBoundingBox(pcb_line_t *Line) { - Coord width = (Line->Thickness + Line->Clearance + 1) / 2; + pcb_coord_t width = (Line->Thickness + Line->Clearance + 1) / 2; /* Adjust for our discrete polygon approximation */ width = (double) width *POLY_CIRC_RADIUS_ADJ + 0.5; @@ -280,7 +280,7 @@ /* changes the size of a line */ void *ChangeLineSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line) { - Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Line->Thickness + ctx->chgsize.delta; + pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Line->Thickness + ctx->chgsize.delta; if (TEST_FLAG(PCB_FLAG_LOCK, Line)) return (NULL); @@ -302,7 +302,7 @@ /*changes the clearance size of a line */ void *ChangeLineClearSize(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line) { - Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Line->Clearance + ctx->chgsize.delta; + pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Line->Clearance + ctx->chgsize.delta; if (TEST_FLAG(PCB_FLAG_LOCK, Line) || !TEST_FLAG(PCB_FLAG_CLEARLINE, Line)) return (NULL); @@ -459,7 +459,7 @@ * moves a line between layers */ struct via_info { - Coord X, Y; + pcb_coord_t X, Y; jmp_buf env; }; @@ -618,7 +618,7 @@ } /* rotates a line in 90 degree steps */ -void RotateLineLowLevel(pcb_line_t *Line, Coord X, Coord Y, unsigned Number) +void RotateLineLowLevel(pcb_line_t *Line, pcb_coord_t X, pcb_coord_t Y, unsigned Number) { ROTATE(Line->Point1.X, Line->Point1.Y, X, Y, Number); ROTATE(Line->Point2.X, Line->Point2.Y, X, Y, Number); @@ -625,7 +625,7 @@ /* keep horizontal, vertical Point2 > Point1 */ if (Line->Point1.X == Line->Point2.X) { if (Line->Point1.Y > Line->Point2.Y) { - Coord t; + pcb_coord_t t; t = Line->Point1.Y; Line->Point1.Y = Line->Point2.Y; Line->Point2.Y = t; @@ -633,7 +633,7 @@ } else if (Line->Point1.Y == Line->Point2.Y) { if (Line->Point1.X > Line->Point2.X) { - Coord t; + pcb_coord_t t; t = Line->Point1.X; Line->Point1.X = Line->Point2.X; Line->Point2.X = t; @@ -673,7 +673,7 @@ void *InsertPointIntoLine(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line) { pcb_line_t *line; - Coord X, Y; + pcb_coord_t X, Y; if (((Line->Point1.X == ctx->insert.x) && (Line->Point1.Y == ctx->insert.y)) || ((Line->Point2.X == ctx->insert.x) && (Line->Point2.Y == ctx->insert.y))) Index: trunk/src/obj_line.h =================================================================== --- trunk/src/obj_line.h (revision 4810) +++ trunk/src/obj_line.h (revision 4811) @@ -49,8 +49,8 @@ pcb_line_t *GetLineMemory(pcb_layer_t * layer); void RemoveFreeLine(pcb_line_t * data); -pcb_line_t *CreateDrawnLineOnLayer(pcb_layer_t *Layer, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness, Coord Clearance, pcb_flag_t Flags); -pcb_line_t *CreateNewLineOnLayer(pcb_layer_t *Layer, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness, Coord Clearance, pcb_flag_t Flags); +pcb_line_t *CreateDrawnLineOnLayer(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_flag_t Flags); +pcb_line_t *CreateNewLineOnLayer(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_flag_t Flags); /* Add objects without creating them or making any "sanity modifications" to them */ void pcb_add_line_on_layer(pcb_layer_t *Layer, pcb_line_t *Line); @@ -57,7 +57,7 @@ void SetLineBoundingBox(pcb_line_t *Line); void *RemoveLine(pcb_layer_t *Layer, pcb_line_t *Line); -void RotateLineLowLevel(pcb_line_t *Line, Coord X, Coord Y, unsigned Number); +void RotateLineLowLevel(pcb_line_t *Line, pcb_coord_t X, pcb_coord_t Y, unsigned Number); /*** DRC enforcement (obj_line_drcenf.c) ***/ void AdjustAttachedLine(void); Index: trunk/src/obj_line_drcenf.c =================================================================== --- trunk/src/obj_line_drcenf.c (revision 4810) +++ trunk/src/obj_line_drcenf.c (revision 4811) @@ -78,7 +78,7 @@ */ void FortyFiveLine(pcb_attached_line_t *Line) { - Coord dx, dy, min; + pcb_coord_t dx, dy, min; unsigned direction = 0; double m; @@ -149,7 +149,7 @@ */ void AdjustTwoLine(pcb_bool way) { - Coord dx, dy; + pcb_coord_t dx, dy; pcb_attached_line_t *line = &Crosshair.AttachedLine; if (Crosshair.AttachedLine.State == STATE_FIRST) @@ -251,8 +251,8 @@ static double drc_lines(pcb_point_t *end, pcb_bool way) { double f, s, f2, s2, len, best; - Coord dx, dy, temp, last, length; - Coord temp2, last2, length2; + pcb_coord_t dx, dy, temp, last, length; + pcb_coord_t temp2, last2, length2; pcb_line_t line1, line2; pcb_cardinal_t group, comp; struct drc_info info; Index: trunk/src/obj_pad.c =================================================================== --- trunk/src/obj_pad.c (revision 4810) +++ trunk/src/obj_pad.c (revision 4811) @@ -66,7 +66,7 @@ /*** utility ***/ /* creates a new pad in an element */ -pcb_pad_t *CreateNewPad(pcb_element_t *Element, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness, Coord Clearance, Coord Mask, char *Name, char *Number, pcb_flag_t Flags) +pcb_pad_t *CreateNewPad(pcb_element_t *Element, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_coord_t Mask, char *Name, char *Number, pcb_flag_t Flags) { pcb_pad_t *pad = GetPadMemory(Element); @@ -98,9 +98,9 @@ /* sets the bounding box of a pad */ void SetPadBoundingBox(pcb_pad_t *Pad) { - Coord width; - Coord deltax; - Coord deltay; + pcb_coord_t width; + pcb_coord_t deltax; + pcb_coord_t deltay; /* the bounding box covers the extent of influence * so it must include the clearance values too @@ -113,7 +113,7 @@ if (TEST_FLAG(PCB_FLAG_SQUARE, Pad) && deltax != 0 && deltay != 0) { /* slanted square pad */ double theta; - Coord btx, bty; + pcb_coord_t btx, bty; /* T is a vector half a thickness long, in the direction of one of the corners. */ @@ -157,7 +157,7 @@ /* changes the size of a pad */ void *ChangePadSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad) { - Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pad->Thickness + ctx->chgsize.delta; + pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pad->Thickness + ctx->chgsize.delta; if (TEST_FLAG(PCB_FLAG_LOCK, Pad)) return (NULL); @@ -181,7 +181,7 @@ /* changes the clearance size of a pad */ void *ChangePadClearSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad) { - Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pad->Clearance + ctx->chgsize.delta; + pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pad->Clearance + ctx->chgsize.delta; if (TEST_FLAG(PCB_FLAG_LOCK, Pad)) return (NULL); @@ -278,7 +278,7 @@ /* changes the mask size of a pad */ void *ChangePadMaskSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pad_t *Pad) { - Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pad->Mask + ctx->chgsize.delta; + pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pad->Mask + ctx->chgsize.delta; value = MAX(value, 0); if (value == Pad->Mask && ctx->chgsize.absolute == 0) Index: trunk/src/obj_pad.h =================================================================== --- trunk/src/obj_pad.h (revision 4810) +++ trunk/src/obj_pad.h (revision 4811) @@ -33,7 +33,7 @@ struct pcb_pad_s { /* a SMD pad */ PCB_ANYLINEFIELDS; - Coord Mask; + pcb_coord_t Mask; char *Name, *Number; /* 'Line' */ void *Element; void *Spare; @@ -44,7 +44,7 @@ pcb_pad_t *GetPadMemory(pcb_element_t * element); void RemoveFreePad(pcb_pad_t * data); -pcb_pad_t *CreateNewPad(pcb_element_t *Element, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord Thickness, Coord Clearance, Coord Mask, char *Name, char *Number, pcb_flag_t Flags); +pcb_pad_t *CreateNewPad(pcb_element_t *Element, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_coord_t Mask, char *Name, char *Number, pcb_flag_t Flags); void SetPadBoundingBox(pcb_pad_t *Pad); pcb_bool ChangePaste(pcb_pad_t *Pad); Index: trunk/src/obj_pinvia.c =================================================================== --- trunk/src/obj_pinvia.c (revision 4810) +++ trunk/src/obj_pinvia.c (revision 4811) @@ -85,7 +85,7 @@ /*** utility ***/ /* creates a new via */ -pcb_pin_t *CreateNewVia(pcb_data_t *Data, Coord X, Coord Y, Coord Thickness, Coord Clearance, Coord Mask, Coord DrillingHole, const char *Name, pcb_flag_t Flags) +pcb_pin_t *CreateNewVia(pcb_data_t *Data, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_coord_t Mask, pcb_coord_t DrillingHole, const char *Name, pcb_flag_t Flags) { pcb_pin_t *Via; @@ -138,7 +138,7 @@ } /* creates a new pin in an element */ -pcb_pin_t *CreateNewPin(pcb_element_t *Element, Coord X, Coord Y, Coord Thickness, Coord Clearance, Coord Mask, Coord DrillingHole, char *Name, char *Number, pcb_flag_t Flags) +pcb_pin_t *CreateNewPin(pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_coord_t Mask, pcb_coord_t DrillingHole, char *Name, char *Number, pcb_flag_t Flags) { pcb_pin_t *pin = GetPinMemory(Element); @@ -206,7 +206,7 @@ /* sets the bounding box of a pin or via */ void SetPinBoundingBox(pcb_pin_t *Pin) { - Coord width; + pcb_coord_t width; if ((GET_SQUARE(Pin) > 1) && (TEST_FLAG(PCB_FLAG_SQUARE, Pin))) { pcb_polyarea_t *p = PinPoly(Pin, PIN_SIZE(Pin), Pin->Clearance); @@ -291,7 +291,7 @@ /* changes the size of a via */ void *ChangeViaSize(pcb_opctx_t *ctx, pcb_pin_t *Via) { - Coord value = ctx->chgsize.absolute ? ctx->chgsize.absolute : Via->Thickness + ctx->chgsize.delta; + pcb_coord_t value = ctx->chgsize.absolute ? ctx->chgsize.absolute : Via->Thickness + ctx->chgsize.delta; if (TEST_FLAG(PCB_FLAG_LOCK, Via)) return (NULL); @@ -318,7 +318,7 @@ /* changes the drilling hole of a via */ void *ChangeVia2ndSize(pcb_opctx_t *ctx, pcb_pin_t *Via) { - Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Via->DrillingHole + ctx->chgsize.delta; + pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Via->DrillingHole + ctx->chgsize.delta; if (TEST_FLAG(PCB_FLAG_LOCK, Via)) return (NULL); @@ -343,7 +343,7 @@ /* changes the drilling hole of a pin */ void *ChangePin2ndSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { - Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->DrillingHole + ctx->chgsize.delta; + pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->DrillingHole + ctx->chgsize.delta; if (TEST_FLAG(PCB_FLAG_LOCK, Pin)) return (NULL); @@ -369,7 +369,7 @@ /* changes the clearance size of a via */ void *ChangeViaClearSize(pcb_opctx_t *ctx, pcb_pin_t *Via) { - Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Via->Clearance + ctx->chgsize.delta; + pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Via->Clearance + ctx->chgsize.delta; if (TEST_FLAG(PCB_FLAG_LOCK, Via)) return (NULL); @@ -399,7 +399,7 @@ /* changes the size of a pin */ void *ChangePinSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { - Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->Thickness + ctx->chgsize.delta; + pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->Thickness + ctx->chgsize.delta; if (TEST_FLAG(PCB_FLAG_LOCK, Pin)) return (NULL); @@ -424,7 +424,7 @@ /* changes the clearance size of a pin */ void *ChangePinClearSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { - Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->Clearance + ctx->chgsize.delta; + pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->Clearance + ctx->chgsize.delta; if (TEST_FLAG(PCB_FLAG_LOCK, Pin)) return (NULL); @@ -662,7 +662,7 @@ /* changes the mask size of a pin */ void *ChangePinMaskSize(pcb_opctx_t *ctx, pcb_element_t *Element, pcb_pin_t *Pin) { - Coord value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->Mask + ctx->chgsize.delta; + pcb_coord_t value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Pin->Mask + ctx->chgsize.delta; value = MAX(value, 0); if (value == Pin->Mask && ctx->chgsize.absolute == 0) @@ -682,7 +682,7 @@ /* changes the mask size of a via */ void *ChangeViaMaskSize(pcb_opctx_t *ctx, pcb_pin_t *Via) { - Coord value; + pcb_coord_t value; value = (ctx->chgsize.absolute) ? ctx->chgsize.absolute : Via->Mask + ctx->chgsize.delta; value = MAX(value, 0); Index: trunk/src/obj_pinvia.h =================================================================== --- trunk/src/obj_pinvia.h (revision 4810) +++ trunk/src/obj_pinvia.h (revision 4811) @@ -33,8 +33,8 @@ struct pcb_pin_s { PCB_ANYOBJECTFIELDS; - Coord Thickness, Clearance, Mask, DrillingHole; - Coord X, Y; /* center and diameter */ + pcb_coord_t Thickness, Clearance, Mask, DrillingHole; + pcb_coord_t X, Y; /* center and diameter */ char *Name, *Number; void *Element; void *Spare; @@ -47,8 +47,8 @@ pcb_pin_t *GetPinMemory(pcb_element_t * element); void RemoveFreePin(pcb_pin_t * data); -pcb_pin_t *CreateNewVia(pcb_data_t *Data, Coord X, Coord Y, Coord Thickness, Coord Clearance, Coord Mask, Coord DrillingHole, const char *Name, pcb_flag_t Flags); -pcb_pin_t *CreateNewPin(pcb_element_t *Element, Coord X, Coord Y, Coord Thickness, Coord Clearance, Coord Mask, Coord DrillingHole, char *Name, char *Number, pcb_flag_t Flags); +pcb_pin_t *CreateNewVia(pcb_data_t *Data, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_coord_t Mask, pcb_coord_t DrillingHole, const char *Name, pcb_flag_t Flags); +pcb_pin_t *CreateNewPin(pcb_element_t *Element, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Thickness, pcb_coord_t Clearance, pcb_coord_t Mask, pcb_coord_t DrillingHole, char *Name, char *Number, pcb_flag_t Flags); void pcb_add_via(pcb_data_t *Data, pcb_pin_t *Via); void SetPinBoundingBox(pcb_pin_t *Pin); pcb_bool ChangeHole(pcb_pin_t *Via); Index: trunk/src/obj_pinvia_therm.c =================================================================== --- trunk/src/obj_pinvia_therm.c (revision 4810) +++ trunk/src/obj_pinvia_therm.c (revision 4811) @@ -41,17 +41,17 @@ static pcb_board_t *pcb; struct cent { - Coord x, y; - Coord s, c; + pcb_coord_t x, y; + pcb_coord_t s, c; char style; pcb_polyarea_t *p; }; -static pcb_polyarea_t *diag_line(Coord X, Coord Y, Coord l, Coord w, pcb_bool rt) +static pcb_polyarea_t *diag_line(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t l, pcb_coord_t w, pcb_bool rt) { pcb_pline_t *c; pcb_vector_t v; - Coord x1, x2, y1, y2; + pcb_coord_t x1, x2, y1, y2; if (rt) { x1 = (l - w) * M_SQRT1_2; @@ -87,7 +87,7 @@ pcb_polyarea_t *p, *p2; pcb_pline_t *c; pcb_vector_t v; - Coord d, in, out; + pcb_coord_t d, in, out; switch (style) { case 1: @@ -312,8 +312,8 @@ static pcb_polyarea_t *oct_therm(pcb_pin_t *pin, pcb_cardinal_t style) { pcb_polyarea_t *p, *p2, *m; - Coord t = 0.5 * pcb->ThermScale * pin->Clearance; - Coord w = pin->Thickness + pin->Clearance; + pcb_coord_t t = 0.5 * pcb->ThermScale * pin->Clearance; + pcb_coord_t w = pin->Thickness + pin->Clearance; p = OctagonPoly(pin->X, pin->Y, w, GET_SQUARE(pin)); p2 = OctagonPoly(pin->X, pin->Y, pin->Thickness, GET_SQUARE(pin)); @@ -336,7 +336,7 @@ /* fix me add thermal style 4 */ case 5: { - Coord t = pin->Thickness / 2; + pcb_coord_t t = pin->Thickness / 2; pcb_polyarea_t *q; /* cheat by using the square therm's rounded parts */ p = square_therm(pin, style); @@ -372,8 +372,8 @@ case 2: { pcb_polyarea_t *m; - Coord t = (pin->Thickness + pin->Clearance) / 2; - Coord w = 0.5 * pcb->ThermScale * pin->Clearance; + pcb_coord_t t = (pin->Thickness + pin->Clearance) / 2; + pcb_coord_t w = 0.5 * pcb->ThermScale * pin->Clearance; pa = CirclePoly(pin->X, pin->Y, t); arc = CirclePoly(pin->X, pin->Y, pin->Thickness / 2); /* create a thin ring */ Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 4810) +++ trunk/src/obj_poly.c (revision 4811) @@ -119,7 +119,7 @@ /*** utility ***/ /* rotates a polygon in 90 degree steps */ -void RotatePolygonLowLevel(pcb_polygon_t *Polygon, Coord X, Coord Y, unsigned Number) +void RotatePolygonLowLevel(pcb_polygon_t *Polygon, pcb_coord_t X, pcb_coord_t Y, unsigned Number) { POLYGONPOINT_LOOP(Polygon); { @@ -148,7 +148,7 @@ } /* creates a new polygon from the old formats rectangle data */ -pcb_polygon_t *CreateNewPolygonFromRectangle(pcb_layer_t *Layer, Coord X1, Coord Y1, Coord X2, Coord Y2, pcb_flag_t Flags) +pcb_polygon_t *CreateNewPolygonFromRectangle(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_flag_t Flags) { pcb_polygon_t *polygon = CreateNewPolygon(Layer, Flags); if (!polygon) @@ -186,7 +186,7 @@ } /* creates a new point in a polygon */ -pcb_point_t *CreateNewPointInPolygon(pcb_polygon_t *Polygon, Coord X, Coord Y) +pcb_point_t *CreateNewPointInPolygon(pcb_polygon_t *Polygon, pcb_coord_t X, pcb_coord_t Y) { pcb_point_t *point = GetPointMemoryInPolygon(Polygon); @@ -340,7 +340,7 @@ } /* low level routine to move a polygon */ -void MovePolygonLowLevel(pcb_polygon_t *Polygon, Coord DX, Coord DY) +void MovePolygonLowLevel(pcb_polygon_t *Polygon, pcb_coord_t DX, pcb_coord_t DY) { POLYGONPOINT_LOOP(Polygon); { Index: trunk/src/obj_poly.h =================================================================== --- trunk/src/obj_poly.h (revision 4810) +++ trunk/src/obj_poly.h (revision 4811) @@ -55,14 +55,14 @@ void FreePolygonMemory(pcb_polygon_t * polygon); void SetPolygonBoundingBox(pcb_polygon_t *Polygon); -pcb_polygon_t *CreateNewPolygonFromRectangle(pcb_layer_t *Layer, Coord X1, Coord Y1, Coord X2, Coord Y2, pcb_flag_t Flags); +pcb_polygon_t *CreateNewPolygonFromRectangle(pcb_layer_t *Layer, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_flag_t Flags); pcb_polygon_t *CreateNewPolygon(pcb_layer_t *Layer, pcb_flag_t Flags); -pcb_point_t *CreateNewPointInPolygon(pcb_polygon_t *Polygon, Coord X, Coord Y); +pcb_point_t *CreateNewPointInPolygon(pcb_polygon_t *Polygon, pcb_coord_t X, pcb_coord_t Y); pcb_polygon_t *CreateNewHoleInPolygon(pcb_polygon_t * Polygon); void *RemovePolygon(pcb_layer_t *Layer, pcb_polygon_t *Polygon); -void MovePolygonLowLevel(pcb_polygon_t *Polygon, Coord DX, Coord DY); -void RotatePolygonLowLevel(pcb_polygon_t *Polygon, Coord X, Coord Y, unsigned Number); +void MovePolygonLowLevel(pcb_polygon_t *Polygon, pcb_coord_t DX, pcb_coord_t DY); +void RotatePolygonLowLevel(pcb_polygon_t *Polygon, pcb_coord_t X, pcb_coord_t Y, unsigned Number); pcb_polygon_t *CopyPolygonLowLevel(pcb_polygon_t *Dest, pcb_polygon_t *Src); /* Add objects without creating them or making any "sanity modifications" to them */ Index: trunk/src/obj_rat.c =================================================================== --- trunk/src/obj_rat.c (revision 4810) +++ trunk/src/obj_rat.c (revision 4811) @@ -69,7 +69,7 @@ /*** utility ***/ /* creates a new rat-line */ -pcb_rat_t *CreateNewRat(pcb_data_t *Data, Coord X1, Coord Y1, Coord X2, Coord Y2, pcb_cardinal_t group1, pcb_cardinal_t group2, Coord Thickness, pcb_flag_t Flags) +pcb_rat_t *CreateNewRat(pcb_data_t *Data, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_cardinal_t group1, pcb_cardinal_t group2, pcb_coord_t Thickness, pcb_flag_t Flags) { pcb_rat_t *Line = GetRatMemory(Data); @@ -174,8 +174,8 @@ void *MoveRatToLayer(pcb_opctx_t *ctx, pcb_rat_t * Rat) { pcb_line_t *newone; - /*Coord X1 = Rat->Point1.X, Y1 = Rat->Point1.Y; - Coord X1 = Rat->Point1.X, Y1 = Rat->Point1.Y; + /*pcb_coord_t X1 = Rat->Point1.X, Y1 = Rat->Point1.Y; + pcb_coord_t X1 = Rat->Point1.X, Y1 = Rat->Point1.Y; if PCB_FLAG_VIA if we're on a pin, add a thermal else make a via and a wire, but 0-length wire not good @@ -253,7 +253,7 @@ void EraseRat(pcb_rat_t *Rat) { if (TEST_FLAG(PCB_FLAG_VIA, Rat)) { - Coord w = Rat->Thickness; + pcb_coord_t w = Rat->Thickness; pcb_box_t b; @@ -274,7 +274,7 @@ Rat->Thickness = pixel_slop * conf_core.appearance.rat_thickness; /* rats.c set PCB_FLAG_VIA if this rat goes to a containing poly: draw a donut */ if (TEST_FLAG(PCB_FLAG_VIA, Rat)) { - Coord w = Rat->Thickness; + pcb_coord_t w = Rat->Thickness; pcb_box_t b; Index: trunk/src/obj_rat.h =================================================================== --- trunk/src/obj_rat.h (revision 4810) +++ trunk/src/obj_rat.h (revision 4811) @@ -41,7 +41,7 @@ pcb_rat_t *GetRatMemory(pcb_data_t *data); void RemoveFreeRat(pcb_rat_t *data); -pcb_rat_t *CreateNewRat(pcb_data_t *Data, Coord X1, Coord Y1, Coord X2, Coord Y2, pcb_cardinal_t group1, pcb_cardinal_t group2, Coord Thickness, pcb_flag_t Flags); +pcb_rat_t *CreateNewRat(pcb_data_t *Data, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_cardinal_t group1, pcb_cardinal_t group2, pcb_coord_t Thickness, pcb_flag_t Flags); pcb_bool DeleteRats(pcb_bool selected); #endif Index: trunk/src/obj_text.c =================================================================== --- trunk/src/obj_text.c (revision 4810) +++ trunk/src/obj_text.c (revision 4811) @@ -67,7 +67,7 @@ /*** utility ***/ /* creates a new text on a layer */ -pcb_text_t *CreateNewText(pcb_layer_t *Layer, pcb_font_t *PCBFont, Coord X, Coord Y, unsigned Direction, int Scale, char *TextString, pcb_flag_t Flags) +pcb_text_t *CreateNewText(pcb_layer_t *Layer, pcb_font_t *PCBFont, pcb_coord_t X, pcb_coord_t Y, unsigned Direction, int Scale, char *TextString, pcb_flag_t Flags) { pcb_text_t *text; @@ -111,9 +111,9 @@ int i; int space; - Coord minx, miny, maxx, maxy, tx; - Coord min_final_radius; - Coord min_unscaled_radius; + pcb_coord_t minx, miny, maxx, maxy, tx; + pcb_coord_t min_final_radius; + pcb_coord_t min_unscaled_radius; pcb_bool first_time = pcb_true; minx = miny = maxx = maxy = tx = 0; @@ -140,7 +140,7 @@ * of 1/2 because some stupid reason we render our glyphs * at half their defined stroke-width. */ - Coord unscaled_radius = MAX(min_unscaled_radius, line->Thickness / 4); + pcb_coord_t unscaled_radius = MAX(min_unscaled_radius, line->Thickness / 4); if (first_time) { minx = maxx = line->Point1.X; @@ -161,7 +161,7 @@ } else { pcb_box_t *ds = &FontPtr->DefaultSymbol; - Coord w = ds->X2 - ds->X1; + pcb_coord_t w = ds->X2 - ds->X1; minx = MIN(minx, ds->X1 + tx); miny = MIN(miny, ds->Y1); @@ -434,7 +434,7 @@ /* rotates a text in 90 degree steps; only the bounding box is rotated, text rotation itself is done by the drawing routines */ -void RotateTextLowLevel(pcb_text_t *Text, Coord X, Coord Y, unsigned Number) +void RotateTextLowLevel(pcb_text_t *Text, pcb_coord_t X, pcb_coord_t Y, unsigned Number) { pcb_uint8_t number; @@ -468,9 +468,9 @@ /* --------------------------------------------------------------------------- * lowlevel drawing routine for text objects */ -void DrawTextLowLevel(pcb_text_t *Text, Coord min_line_width) +void DrawTextLowLevel(pcb_text_t *Text, pcb_coord_t min_line_width) { - Coord x = 0; + pcb_coord_t x = 0; unsigned char *string = (unsigned char *) Text->TextString; pcb_cardinal_t n; pcb_font_t *font = &PCB->Font; @@ -517,7 +517,7 @@ else { /* the default symbol is a filled box */ pcb_box_t defaultsymbol = PCB->Font.DefaultSymbol; - Coord size = (defaultsymbol.X2 - defaultsymbol.X1) * 6 / 5; + pcb_coord_t size = (defaultsymbol.X2 - defaultsymbol.X1) * 6 / 5; defaultsymbol.X1 = PCB_SCALE_TEXT(defaultsymbol.X1 + x, Text->Scale); defaultsymbol.Y1 = PCB_SCALE_TEXT(defaultsymbol.Y1, Text->Scale); Index: trunk/src/obj_text.h =================================================================== --- trunk/src/obj_text.h (revision 4810) +++ trunk/src/obj_text.h (revision 4811) @@ -34,7 +34,7 @@ struct pcb_text_s { PCB_ANYOBJECTFIELDS; int Scale; /* text scaling in percent */ - Coord X, Y; /* origin */ + pcb_coord_t X, Y; /* origin */ pcb_uint8_t Direction; char *TextString; /* string */ void *Element; @@ -45,7 +45,7 @@ pcb_text_t *GetTextMemory(pcb_layer_t * layer); void RemoveFreeText(pcb_text_t * data); -pcb_text_t *CreateNewText(pcb_layer_t *Layer, pcb_font_t *PCBFont, Coord X, Coord Y, unsigned Direction, int Scale, char *TextString, pcb_flag_t Flags); +pcb_text_t *CreateNewText(pcb_layer_t *Layer, pcb_font_t *PCBFont, pcb_coord_t X, pcb_coord_t Y, unsigned Direction, int Scale, char *TextString, pcb_flag_t Flags); /* Add objects without creating them or making any "sanity modifications" to them */ void pcb_add_text_on_layer(pcb_layer_t *Layer, pcb_text_t *text, pcb_font_t *PCBFont); @@ -52,7 +52,7 @@ void SetTextBoundingBox(pcb_font_t *FontPtr, pcb_text_t *Text); void *RemoveText(pcb_layer_t *Layer, pcb_text_t *Text); -void RotateTextLowLevel(pcb_text_t *Text, Coord X, Coord Y, unsigned Number); +void RotateTextLowLevel(pcb_text_t *Text, pcb_coord_t X, pcb_coord_t Y, unsigned Number); #define MOVE_TEXT_LOWLEVEL(t,dx,dy) \ { \ Index: trunk/src/obj_text_draw.h =================================================================== --- trunk/src/obj_text_draw.h (revision 4810) +++ trunk/src/obj_text_draw.h (revision 4811) @@ -32,6 +32,6 @@ pcb_r_dir_t draw_text_callback(const pcb_box_t * b, void *cl); #endif -void DrawTextLowLevel(pcb_text_t *Text, Coord min_line_width); +void DrawTextLowLevel(pcb_text_t *Text, pcb_coord_t min_line_width); void EraseText(pcb_layer_t *Layer, pcb_text_t *Text); void DrawText(pcb_layer_t *Layer, pcb_text_t *Text); Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 4810) +++ trunk/src/object_act.c (revision 4811) @@ -99,7 +99,7 @@ %end-doc */ -static int ActionAttributes(int argc, const char **argv, Coord x, Coord y) +static int ActionAttributes(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); const char *layername = ACTION_ARG(1); @@ -207,10 +207,10 @@ #define GAP PCB_MIL_TO_COORD(100) -static int ActionDisperseElements(int argc, const char **argv, Coord x, Coord y) +static int ActionDisperseElements(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); - Coord minx = GAP, miny = GAP, maxy = GAP, dx, dy; + pcb_coord_t minx = GAP, miny = GAP, maxy = GAP, dx, dy; int all = 0, bad = 0; if (!function || !*function) { @@ -318,7 +318,7 @@ %end-doc */ -static int ActionFlip(int argc, const char **argv, Coord x, Coord y) +static int ActionFlip(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); pcb_element_t *element; @@ -365,12 +365,12 @@ %end-doc */ -static int ActionMoveObject(int argc, const char **argv, Coord x, Coord y) +static int ActionMoveObject(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *x_str = ACTION_ARG(0); const char *y_str = ACTION_ARG(1); const char *units = ACTION_ARG(2); - Coord nx, ny; + pcb_coord_t nx, ny; pcb_bool absolute1, absolute2; void *ptr1, *ptr2, *ptr3; int type; @@ -411,7 +411,7 @@ %end-doc */ -static int ActionMoveToCurrentLayer(int argc, const char **argv, Coord x, Coord y) +static int ActionMoveToCurrentLayer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function) { @@ -478,7 +478,7 @@ return GetValue(as, NULL, NULL, NULL); } -static int ActionElementList(int argc, const char **argv, Coord x, Coord y) +static int ActionElementList(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { pcb_element_t *e = NULL; const char *refdes, *value, *footprint; @@ -544,7 +544,7 @@ e = find_element_by_refdes(refdes); if (!e) { - Coord nx, ny, d; + pcb_coord_t nx, ny, d; #ifdef DEBUG printf(" ... Footprint not on board, need to add it.\n"); @@ -587,7 +587,7 @@ printf(" ... Footprint on board, but different from footprint loaded.\n"); #endif int er, pr, i; - Coord mx, my; + pcb_coord_t mx, my; pcb_element_t *pe; /* Different footprint, we need to swap them out. */ @@ -654,7 +654,7 @@ %end-doc */ -static int ActionElementSetAttr(int argc, const char **argv, Coord x, Coord y) +static int ActionElementSetAttr(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { pcb_element_t *e = NULL; const char *refdes, *name, *value; @@ -723,7 +723,7 @@ %end-doc */ -static int ActionRipUp(int argc, const char **argv, Coord x, Coord y) +static int ActionRipUp(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); pcb_bool changed = pcb_false; @@ -827,13 +827,13 @@ %end-doc */ -static int ActionMinMaskGap(int argc, const char **argv, Coord x, Coord y) +static int ActionMinMaskGap(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); const char *delta = ACTION_ARG(1); const char *units = ACTION_ARG(2); pcb_bool absolute; - Coord value; + pcb_coord_t value; int flags; if (!function) @@ -901,13 +901,13 @@ %end-doc */ -static int ActionMinClearGap(int argc, const char **argv, Coord x, Coord y) +static int ActionMinClearGap(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); const char *delta = ACTION_ARG(1); const char *units = ACTION_ARG(2); pcb_bool absolute; - Coord value; + pcb_coord_t value; int flags; if (!function) @@ -982,7 +982,7 @@ } /* --------------------------------------------------------------------------- */ -int ActionListRotations(int argc, const char **argv, Coord x, Coord y) +int ActionListRotations(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { ELEMENT_LOOP(PCB->Data); { Index: trunk/src/operation.h =================================================================== --- trunk/src/operation.h (revision 4810) +++ trunk/src/operation.h (revision 4811) @@ -43,8 +43,8 @@ typedef struct { pcb_board_t *pcb; int is_primary; /* whether the primary parameter should be changed */ - Coord delta; /* change of size */ - Coord absolute; /* Absolute size */ + pcb_coord_t delta; /* change of size */ + pcb_coord_t absolute; /* Absolute size */ } pcb_opctx_chgsize_t; typedef struct { @@ -65,12 +65,12 @@ typedef struct { pcb_board_t *pcb; - Coord DeltaX, DeltaY; /* movement vector */ + pcb_coord_t DeltaX, DeltaY; /* movement vector */ } pcb_opctx_copy_t; typedef struct { pcb_board_t *pcb; - Coord x, y; + pcb_coord_t x, y; pcb_cardinal_t idx; /* poly point idx */ pcb_bool last; pcb_bool forcible; @@ -78,7 +78,7 @@ typedef struct { pcb_board_t *pcb; - Coord dx, dy; /* used by local routines as offset */ + pcb_coord_t dx, dy; /* used by local routines as offset */ pcb_layer_t *dst_layer; pcb_bool more_to_come; } pcb_opctx_move_t; @@ -91,7 +91,7 @@ typedef struct { pcb_board_t *pcb; - Coord center_x, center_y; /* center of rotation */ + pcb_coord_t center_x, center_y; /* center of rotation */ unsigned number; /* number of rotations */ } pcb_opctx_rotate_t; Index: trunk/src/pcb-printf.c =================================================================== --- trunk/src/pcb-printf.c (revision 4810) +++ trunk/src/pcb-printf.c (revision 4811) @@ -142,7 +142,7 @@ * * \return 0 on success, -1 on error */ -static int CoordsToString(gds_t *dest, Coord coord[], int n_coords, const gds_t *printf_spec_, enum pcb_allow_e allow, +static int CoordsToString(gds_t *dest, pcb_coord_t coord[], int n_coords, const gds_t *printf_spec_, enum pcb_allow_e allow, enum e_suffix suffix_type) { char filemode_buff[128]; /* G_ASCII_DTOSTR_BUF_SIZE */ @@ -284,7 +284,7 @@ }; #define NUM_HUMAN_COORD (sizeof(human_coord) / sizeof(human_coord[0])) -static inline int try_human_coord(Coord coord, const pcb_unit_t *unit, double down_limit, double up_limit, int score_factor, double *value, unsigned int *best, const char **suffix) +static inline int try_human_coord(pcb_coord_t coord, const pcb_unit_t *unit, double down_limit, double up_limit, int score_factor, double *value, unsigned int *best, const char **suffix) { double v, frac; long int digs, zeros; @@ -327,7 +327,7 @@ } /* Same as CoordsToString but take only one coord and print it in human readable format */ -static int CoordsToHumanString(gds_t *dest, Coord coord, const gds_t *printf_spec_, enum e_suffix suffix_type) +static int CoordsToHumanString(gds_t *dest, pcb_coord_t coord, const gds_t *printf_spec_, enum e_suffix suffix_type) { char filemode_buff[128]; /* G_ASCII_DTOSTR_BUF_SIZE */ char printf_spec_new_local[256]; @@ -409,7 +409,7 @@ if (*fmt == '%') { const char *ext_unit = ""; - Coord value[10]; + pcb_coord_t value[10]; int count, i; gds_truncate(&spec, 0); @@ -551,7 +551,7 @@ if (*fmt == '*') ext_unit = va_arg(args, const char *); if (*fmt != '+' && *fmt != 'a' && *fmt != 'A') - value[0] = va_arg(args, Coord); + value[0] = va_arg(args, pcb_coord_t); count = 1; switch (*fmt) { case 'I': @@ -580,26 +580,26 @@ break; /* All these fallthroughs are deliberate */ case '9': - value[count++] = va_arg(args, Coord); + value[count++] = va_arg(args, pcb_coord_t); case '8': - value[count++] = va_arg(args, Coord); + value[count++] = va_arg(args, pcb_coord_t); case '7': - value[count++] = va_arg(args, Coord); + value[count++] = va_arg(args, pcb_coord_t); case '6': - value[count++] = va_arg(args, Coord); + value[count++] = va_arg(args, pcb_coord_t); case '5': - value[count++] = va_arg(args, Coord); + value[count++] = va_arg(args, pcb_coord_t); case '4': - value[count++] = va_arg(args, Coord); + value[count++] = va_arg(args, pcb_coord_t); case '3': - value[count++] = va_arg(args, Coord); + value[count++] = va_arg(args, pcb_coord_t); case '2': case 'D': - value[count++] = va_arg(args, Coord); + value[count++] = va_arg(args, pcb_coord_t); if (CoordsToString(string, value, count, &spec, mask & ALLOW_ALL, suffix) != 0) goto err; break; case 'd': - value[1] = va_arg(args, Coord); + value[1] = va_arg(args, pcb_coord_t); if (CoordsToString(string, value, 2, &spec, ALLOW_MM | ALLOW_MIL, suffix) != 0) goto err; break; case '*': Index: trunk/src/pcb-printf.h =================================================================== --- trunk/src/pcb-printf.h (revision 4810) +++ trunk/src/pcb-printf.h (revision 4811) @@ -26,7 +26,7 @@ */ /* This file defines a wrapper around sprintf, that - * defines new specifiers that take pcb Coord objects + * defines new specifiers that take pcb_coord_t objects * as input. * * There is a fair bit of nasty (repetitious) code in Index: trunk/src/plug_footprint_act.c =================================================================== --- trunk/src/plug_footprint_act.c (revision 4810) +++ trunk/src/plug_footprint_act.c (revision 4811) @@ -29,7 +29,7 @@ static const char fp_rehash_syntax[] = "fp_rehash()" ; static const char fp_rehash_help[] = "Flush the library index; rescan all library search paths and rebuild the library index. Useful if there are changes in the library during a pcb-rnd session."; -static int Action_fp_rehash(int argc, const char **argv, Coord x, Coord y) +static int Action_fp_rehash(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { fp_rehash(); return 0; Index: trunk/src/plugins.c =================================================================== --- trunk/src/plugins.c (revision 4810) +++ trunk/src/plugins.c (revision 4811) @@ -84,7 +84,7 @@ static const char manageplugins_help[] = "Manage plugins dialog."; -static int ActionManagePlugins(int argc, const char **argv, Coord x, Coord y) +static int ActionManagePlugins(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { pcb_plugin_info_t *i; int nump = 0, numb = 0; Index: trunk/src/polyarea.h =================================================================== --- trunk/src/polyarea.h (revision 4810) +++ trunk/src/polyarea.h (revision 4811) @@ -38,7 +38,7 @@ #endif -typedef Coord pcb_vertex_t[2]; /* longing point representation of +typedef pcb_coord_t pcb_vertex_t[2]; /* longing point representation of coordinates */ typedef pcb_vertex_t pcb_vector_t; @@ -76,7 +76,7 @@ typedef struct pcb_pline_s pcb_pline_t; struct pcb_pline_s { - Coord xmin, ymin, xmax, ymax; + pcb_coord_t xmin, ymin, xmax, ymax; pcb_pline_t *next; pcb_vnode_t head; unsigned int Count; @@ -83,8 +83,8 @@ double area; pcb_rtree_t *tree; pcb_bool is_round; - Coord cx, cy; - Coord radius; + pcb_coord_t cx, cy; + pcb_coord_t radius; struct { unsigned int status:3; unsigned int orient:1; Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 4810) +++ trunk/src/polygon.c (revision 4811) @@ -297,7 +297,7 @@ return original_poly(p); } -pcb_polyarea_t *RectPoly(Coord x1, Coord x2, Coord y1, Coord y2) +pcb_polyarea_t *RectPoly(pcb_coord_t x1, pcb_coord_t x2, pcb_coord_t y1, pcb_coord_t y2) { pcb_pline_t *contour = NULL; pcb_vector_t v; @@ -346,7 +346,7 @@ } -pcb_polyarea_t *OctagonPoly(Coord x, Coord y, Coord radius, int style) +pcb_polyarea_t *OctagonPoly(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius, int style) { pcb_pline_t *contour = NULL; pcb_vector_t v; @@ -398,7 +398,7 @@ * 2 for a half circle * or 4 for a quarter circle */ -void frac_circle(pcb_pline_t * c, Coord X, Coord Y, pcb_vector_t v, int range) +void frac_circle(pcb_pline_t * c, pcb_coord_t X, pcb_coord_t Y, pcb_vector_t v, int range) { double e1, e2, t1; int i; @@ -422,7 +422,7 @@ } /* create a circle approximation from lines */ -pcb_polyarea_t *CirclePoly(Coord x, Coord y, Coord radius) +pcb_polyarea_t *CirclePoly(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius) { pcb_pline_t *contour; pcb_vector_t v; @@ -442,7 +442,7 @@ } /* make a rounded-corner rectangle with radius t beyond x1,x2,y1,y2 rectangle */ -pcb_polyarea_t *RoundRect(Coord x1, Coord x2, Coord y1, Coord y2, Coord t) +pcb_polyarea_t *RoundRect(pcb_coord_t x1, pcb_coord_t x2, pcb_coord_t y1, pcb_coord_t y2, pcb_coord_t t) { pcb_pline_t *contour = NULL; pcb_vector_t v; @@ -470,7 +470,7 @@ } #define ARC_ANGLE 5 -static pcb_polyarea_t *ArcPolyNoIntersect(pcb_arc_t * a, Coord thick) +static pcb_polyarea_t *ArcPolyNoIntersect(pcb_arc_t * a, pcb_coord_t thick) { pcb_pline_t *contour = NULL; pcb_polyarea_t *np = NULL; @@ -539,7 +539,7 @@ } #define MIN_CLEARANCE_BEFORE_BISECT 10. -pcb_polyarea_t *ArcPoly(pcb_arc_t * a, Coord thick) +pcb_polyarea_t *ArcPoly(pcb_arc_t * a, pcb_coord_t thick) { double delta; pcb_arc_t seg1, seg2; @@ -567,7 +567,7 @@ return ArcPolyNoIntersect(a, thick); } -pcb_polyarea_t *LinePoly(pcb_line_t * L, Coord thick) +pcb_polyarea_t *LinePoly(pcb_line_t * L, pcb_coord_t thick) { pcb_pline_t *contour = NULL; pcb_polyarea_t *np = NULL; @@ -624,7 +624,7 @@ } /* make a rounded-corner rectangle */ -pcb_polyarea_t *SquarePadPoly(pcb_pad_t * pad, Coord clear) +pcb_polyarea_t *SquarePadPoly(pcb_pad_t * pad, pcb_coord_t clear) { pcb_pline_t *contour = NULL; pcb_polyarea_t *np = NULL; @@ -733,7 +733,7 @@ } /* create a polygon of the pin clearance */ -pcb_polyarea_t *PinPoly(pcb_pin_t * pin, Coord thick, Coord clear) +pcb_polyarea_t *PinPoly(pcb_pin_t * pin, pcb_coord_t thick, pcb_coord_t clear) { int size; @@ -757,7 +757,7 @@ return CirclePoly(pin->X, pin->Y, size); } -pcb_polyarea_t *BoxPolyBloated(pcb_box_t * box, Coord bloat) +pcb_polyarea_t *BoxPolyBloated(pcb_box_t * box, pcb_coord_t bloat) { return RectPoly(box->X1 - bloat, box->X2 + bloat, box->Y1 - bloat, box->Y2 + bloat); } @@ -998,7 +998,7 @@ return i; } -static int clearPoly(pcb_data_t *Data, pcb_layer_t *Layer, pcb_polygon_t * polygon, const pcb_box_t * here, Coord expand) +static int clearPoly(pcb_data_t *Data, pcb_layer_t *Layer, pcb_polygon_t * polygon, const pcb_box_t * here, pcb_coord_t expand) { int r = 0, seen; pcb_box_t region; @@ -1225,7 +1225,7 @@ * point of the segment with the lowest distance to the passed * coordinates */ -pcb_cardinal_t GetLowestDistancePolygonPoint(pcb_polygon_t *Polygon, Coord X, Coord Y) +pcb_cardinal_t GetLowestDistancePolygonPoint(pcb_polygon_t *Polygon, pcb_coord_t X, pcb_coord_t Y) { double mindistance = (double) MAX_COORD * MAX_COORD; pcb_point_t *ptr1, *ptr2; @@ -1311,7 +1311,7 @@ * if closing the polygon makes sense */ if (!conf_core.editor.all_direction_lines) { - Coord dx, dy; + pcb_coord_t dx, dy; dx = coord_abs(Crosshair.AttachedPolygon.Points[n - 1].X - Crosshair.AttachedPolygon.Points[0].X); dy = coord_abs(Crosshair.AttachedPolygon.Points[n - 1].Y - Crosshair.AttachedPolygon.Points[0].Y); @@ -1569,7 +1569,7 @@ } -pcb_bool IsPointInPolygon(Coord X, Coord Y, Coord r, pcb_polygon_t *p) +pcb_bool IsPointInPolygon(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t r, pcb_polygon_t *p) { pcb_polyarea_t *c; pcb_vector_t v; @@ -1595,7 +1595,7 @@ } -pcb_bool IsPointInPolygonIgnoreHoles(Coord X, Coord Y, pcb_polygon_t *p) +pcb_bool IsPointInPolygonIgnoreHoles(pcb_coord_t X, pcb_coord_t Y, pcb_polygon_t *p) { pcb_vector_t v; v[0] = X; @@ -1603,7 +1603,7 @@ return poly_InsideContour(p->Clipped->contours, v); } -pcb_bool IsRectangleInPolygon(Coord X1, Coord Y1, Coord X2, Coord Y2, pcb_polygon_t *p) +pcb_bool IsRectangleInPolygon(pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_polygon_t *p) { pcb_polyarea_t *s; if (!(s = RectPoly(min(X1, X2), max(X1, X2), min(Y1, Y2), max(Y1, Y2)))) Index: trunk/src/polygon.h =================================================================== --- trunk/src/polygon.h (revision 4810) +++ trunk/src/polygon.h (revision 4811) @@ -56,7 +56,7 @@ pcb_cardinal_t polygon_point_contour(pcb_polygon_t *polygon, pcb_cardinal_t point); pcb_cardinal_t prev_contour_point(pcb_polygon_t *polygon, pcb_cardinal_t point); pcb_cardinal_t next_contour_point(pcb_polygon_t *polygon, pcb_cardinal_t point); -pcb_cardinal_t GetLowestDistancePolygonPoint(pcb_polygon_t *, Coord, Coord); +pcb_cardinal_t GetLowestDistancePolygonPoint(pcb_polygon_t *, pcb_coord_t, pcb_coord_t); pcb_bool RemoveExcessPolygonPoints(pcb_layer_t *, pcb_polygon_t *); void GoToPreviousPoint(void); void ClosePolygon(void); @@ -67,21 +67,21 @@ void ComputeNoHoles(pcb_polygon_t * poly); pcb_polyarea_t *ContourToPoly(pcb_pline_t *); pcb_polyarea_t *PolygonToPoly(pcb_polygon_t *); -pcb_polyarea_t *RectPoly(Coord x1, Coord x2, Coord y1, Coord y2); -pcb_polyarea_t *CirclePoly(Coord x, Coord y, Coord radius); -pcb_polyarea_t *OctagonPoly(Coord x, Coord y, Coord radius, int style); -pcb_polyarea_t *LinePoly(pcb_line_t * l, Coord thick); -pcb_polyarea_t *ArcPoly(pcb_arc_t * l, Coord thick); -pcb_polyarea_t *PinPoly(pcb_pin_t * l, Coord thick, Coord clear); -pcb_polyarea_t *BoxPolyBloated(pcb_box_t * box, Coord radius); -void frac_circle(pcb_pline_t *, Coord, Coord, pcb_vector_t, int); +pcb_polyarea_t *RectPoly(pcb_coord_t x1, pcb_coord_t x2, pcb_coord_t y1, pcb_coord_t y2); +pcb_polyarea_t *CirclePoly(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius); +pcb_polyarea_t *OctagonPoly(pcb_coord_t x, pcb_coord_t y, pcb_coord_t radius, int style); +pcb_polyarea_t *LinePoly(pcb_line_t * l, pcb_coord_t thick); +pcb_polyarea_t *ArcPoly(pcb_arc_t * l, pcb_coord_t thick); +pcb_polyarea_t *PinPoly(pcb_pin_t * l, pcb_coord_t thick, pcb_coord_t clear); +pcb_polyarea_t *BoxPolyBloated(pcb_box_t * box, pcb_coord_t radius); +void frac_circle(pcb_pline_t *, pcb_coord_t, pcb_coord_t, pcb_vector_t, int); int InitClip(pcb_data_t * d, pcb_layer_t * l, pcb_polygon_t * p); void RestoreToPolygon(pcb_data_t *, int, void *, void *); void ClearFromPolygon(pcb_data_t *, int, void *, void *); -pcb_bool IsPointInPolygon(Coord, Coord, Coord, pcb_polygon_t *); -pcb_bool IsPointInPolygonIgnoreHoles(Coord, Coord, pcb_polygon_t *); -pcb_bool IsRectangleInPolygon(Coord, Coord, Coord, Coord, pcb_polygon_t *); +pcb_bool IsPointInPolygon(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_polygon_t *); +pcb_bool IsPointInPolygonIgnoreHoles(pcb_coord_t, pcb_coord_t, pcb_polygon_t *); +pcb_bool IsRectangleInPolygon(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_polygon_t *); pcb_bool isects(pcb_polyarea_t *, pcb_polygon_t *, pcb_bool); pcb_bool MorphPolygon(pcb_layer_t *, pcb_polygon_t *); void NoHolesPolygonDicer(pcb_polygon_t * p, const pcb_box_t * clip, void (*emit) (pcb_pline_t *, void *), void *user_data); Index: trunk/src/polygon1.c =================================================================== --- trunk/src/polygon1.c (revision 4810) +++ trunk/src/polygon1.c (revision 4811) @@ -2232,7 +2232,7 @@ pcb_vnode_t *poly_CreateNode(pcb_vector_t v) { pcb_vnode_t *res; - Coord *c; + pcb_coord_t *c; assert(v); res = (pcb_vnode_t *) calloc(1, sizeof(pcb_vnode_t)); Index: trunk/src/polygon_act.c =================================================================== --- trunk/src/polygon_act.c (revision 4810) +++ trunk/src/polygon_act.c (revision 4811) @@ -57,7 +57,7 @@ %end-doc */ -static int ActionMorphPolygon(int argc, const char **argv, Coord x, Coord y) +static int ActionMorphPolygon(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function) { @@ -115,7 +115,7 @@ %end-doc */ -static int ActionPolygon(int argc, const char **argv, Coord x, Coord y) +static int ActionPolygon(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function && conf_core.editor.mode == PCB_MODE_POLYGON) { Index: trunk/src/rats.h =================================================================== --- trunk/src/rats.h (revision 4810) +++ trunk/src/rats.h (revision 4811) @@ -40,7 +40,7 @@ struct pcb_connection_s { /* holds a connection (rat) */ - Coord X, Y; /* coordinate of connection */ + pcb_coord_t X, Y; /* coordinate of connection */ long int type; /* type of object in ptr1 - 3 */ void *ptr1, *ptr2; /* the object of the connection */ pcb_cardinal_t group; /* the layer group of the connection */ Index: trunk/src/rats_act.c =================================================================== --- trunk/src/rats_act.c (revision 4810) +++ trunk/src/rats_act.c (revision 4811) @@ -69,7 +69,7 @@ %end-doc */ -static int ActionAddRats(int argc, const char **argv, Coord x, Coord y) +static int ActionAddRats(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); pcb_rat_t *shorty; @@ -144,7 +144,7 @@ %end-doc */ -static int ActionConnection(int argc, const char **argv, Coord x, Coord y) +static int ActionConnection(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function) { @@ -193,7 +193,7 @@ %end-doc */ -static int ActionDeleteRats(int argc, const char **argv, Coord x, Coord y) +static int ActionDeleteRats(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function) { Index: trunk/src/rats_patch.c =================================================================== --- trunk/src/rats_patch.c (revision 4810) +++ trunk/src/rats_patch.c (revision 4811) @@ -381,7 +381,7 @@ static const char replacefootprint_help[] = "Replace the footprint of the selected components with the footprint specified."; -static int ActionReplaceFootprint(int argc, const char **argv, Coord x, Coord y) +static int ActionReplaceFootprint(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *a[4]; const char *fpname; @@ -447,7 +447,7 @@ /* %start-doc actions SavePatch Save netlist patch for back annotation. %end-doc */ -static int ActionSavePatch(int argc, const char **argv, Coord x, Coord y) +static int ActionSavePatch(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *fn; FILE *f; Index: trunk/src/remove_act.c =================================================================== --- trunk/src/remove_act.c (revision 4810) +++ trunk/src/remove_act.c (revision 4811) @@ -42,7 +42,7 @@ %end-doc */ -static int ActionDelete(int argc, const char **argv, Coord x, Coord y) +static int ActionDelete(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); int id = funchash_get(function, NULL); @@ -88,7 +88,7 @@ %end-doc */ -static int ActionRemoveSelected(int argc, const char **argv, Coord x, Coord y) +static int ActionRemoveSelected(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (RemoveSelected()) SetChangedFlag(pcb_true); Index: trunk/src/rotate.c =================================================================== --- trunk/src/rotate.c (revision 4810) +++ trunk/src/rotate.c (revision 4811) @@ -70,7 +70,7 @@ /* --------------------------------------------------------------------------- * rotates a point in 90 degree steps */ -void RotatePointLowLevel(pcb_point_t *Point, Coord X, Coord Y, unsigned Number) +void RotatePointLowLevel(pcb_point_t *Point, pcb_coord_t X, pcb_coord_t Y, unsigned Number) { ROTATE(Point->X, Point->Y, X, Y, Number); } @@ -78,9 +78,9 @@ /* --------------------------------------------------------------------------- * rotates a box in 90 degree steps */ -void RotateBoxLowLevel(pcb_box_t *Box, Coord X, Coord Y, unsigned Number) +void RotateBoxLowLevel(pcb_box_t *Box, pcb_coord_t X, pcb_coord_t Y, unsigned Number) { - Coord x1 = Box->X1, y1 = Box->Y1, x2 = Box->X2, y2 = Box->Y2; + pcb_coord_t x1 = Box->X1, y1 = Box->Y1, x2 = Box->X2, y2 = Box->Y2; ROTATE(x1, y1, X, Y, Number); ROTATE(x2, y2, X, Y, Number); @@ -94,7 +94,7 @@ * rotates an objects at the cursor position as identified by its ID * the center of rotation is determined by the current cursor location */ -void *RotateObject(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord X, Coord Y, unsigned Steps) +void *RotateObject(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t X, pcb_coord_t Y, unsigned Steps) { pcb_rubberband_t *ptr; void *ptr2; @@ -144,7 +144,7 @@ return (ptr2); } -void RotateScreenObject(Coord X, Coord Y, unsigned Steps) +void RotateScreenObject(pcb_coord_t X, pcb_coord_t Y, unsigned Steps) { int type; void *ptr1, *ptr2, *ptr3; Index: trunk/src/rotate.h =================================================================== --- trunk/src/rotate.h (revision 4810) +++ trunk/src/rotate.h (revision 4811) @@ -37,7 +37,7 @@ */ #define ROTATE(x,y,x0,y0,n) \ { \ - Coord dx = (x)-(x0), \ + pcb_coord_t dx = (x)-(x0), \ dy = (y)-(y0); \ \ switch(n & 0x03) \ @@ -92,18 +92,18 @@ #define ROTATE_TYPES (PCB_TYPE_ELEMENT | PCB_TYPE_TEXT | PCB_TYPE_ELEMENT_NAME | PCB_TYPE_ARC) -void RotateBoxLowLevel(pcb_box_t *, Coord, Coord, unsigned); -void RotatePolygonLowLevel(pcb_polygon_t *, Coord, Coord, unsigned); -void *RotateObject(int, void *, void *, void *, Coord, Coord, unsigned); -void RotateScreenObject(Coord, Coord, unsigned); +void RotateBoxLowLevel(pcb_box_t *, pcb_coord_t, pcb_coord_t, unsigned); +void RotatePolygonLowLevel(pcb_polygon_t *, pcb_coord_t, pcb_coord_t, unsigned); +void *RotateObject(int, void *, void *, void *, pcb_coord_t, pcb_coord_t, unsigned); +void RotateScreenObject(pcb_coord_t, pcb_coord_t, unsigned); -void RotatePointLowLevel(pcb_point_t *Point, Coord X, Coord Y, unsigned Number); +void RotatePointLowLevel(pcb_point_t *Point, pcb_coord_t X, pcb_coord_t Y, unsigned Number); -static inline PCB_FUNC_UNUSED void free_rotate(Coord * x, Coord * y, Coord cx, Coord cy, double cosa, double sina) +static inline PCB_FUNC_UNUSED void free_rotate(pcb_coord_t * x, pcb_coord_t * y, pcb_coord_t cx, pcb_coord_t cy, double cosa, double sina) { double nx, ny; - Coord px = *x - cx; - Coord py = *y - cy; + pcb_coord_t px = *x - cx; + pcb_coord_t py = *y - cy; nx = px * cosa + py * sina; ny = py * cosa - px * sina; Index: trunk/src/route_style.c =================================================================== --- trunk/src/route_style.c (revision 4810) +++ trunk/src/route_style.c (revision 4811) @@ -166,7 +166,7 @@ #define cmp(a,b) (((a) != 0) && (coord_abs((a)-(b)) > 32)) #define cmps(a,b) (((a) != NULL) && (strcmp((a), (b)) != 0)) -int pcb_route_style_lookup(vtroutestyle_t *styles, Coord Thick, Coord Diameter, Coord Hole, Coord Clearance, char *Name) +int pcb_route_style_lookup(vtroutestyle_t *styles, pcb_coord_t Thick, pcb_coord_t Diameter, pcb_coord_t Hole, pcb_coord_t Clearance, char *Name) { int n; for (n = 0; n < vtroutestyle_len(styles); n++) { Index: trunk/src/route_style.h =================================================================== --- trunk/src/route_style.h (revision 4810) +++ trunk/src/route_style.h (revision 4811) @@ -47,6 +47,6 @@ /* Compare supplied parameters to each style in the vector and return the index of the first matching style. All non-0 parameters need to match to accept a style. Return -1 on no match. */ -int pcb_route_style_lookup(vtroutestyle_t *styles, Coord Thick, Coord Diameter, Coord Hole, Coord Clearance, char *Name); +int pcb_route_style_lookup(vtroutestyle_t *styles, pcb_coord_t Thick, pcb_coord_t Diameter, pcb_coord_t Hole, pcb_coord_t Clearance, char *Name); extern RouteStyleType pcb_custom_route_style; Index: trunk/src/rubberband.c =================================================================== --- trunk/src/rubberband.c (revision 4810) +++ trunk/src/rubberband.c (revision 4811) @@ -50,8 +50,8 @@ static pcb_r_dir_t rubber_callback(const pcb_box_t * b, void *cl); struct rubber_info { - Coord radius; - Coord X, Y; + pcb_coord_t radius; + pcb_coord_t X, Y; pcb_line_t *line; pcb_box_t box; pcb_layer_t *layer; @@ -62,7 +62,7 @@ pcb_line_t *line = (pcb_line_t *) b; struct rubber_info *i = (struct rubber_info *) cl; double x, y, rad, dist1, dist2; - Coord t; + pcb_coord_t t; int touches = 0; t = line->Thickness / 2; @@ -177,7 +177,7 @@ */ static void CheckPadForRubberbandConnection(pcb_pad_t *Pad) { - Coord half = Pad->Thickness / 2; + pcb_coord_t half = Pad->Thickness / 2; pcb_cardinal_t i, group; struct rubber_info info; @@ -296,7 +296,7 @@ { struct rubber_info info; pcb_cardinal_t n; - Coord t = Pin->Thickness / 2; + pcb_coord_t t = Pin->Thickness / 2; info.box.X1 = Pin->X - t; info.box.X2 = Pin->X + t; @@ -326,7 +326,7 @@ { pcb_cardinal_t group; struct rubber_info info; - Coord t = Line->Thickness / 2; + pcb_coord_t t = Line->Thickness / 2; /* lookup layergroup and check all visible lines in this group */ info.radius = Exact ? -1 : MAX(Line->Thickness / 2, 1); @@ -363,7 +363,7 @@ GROUP_LOOP(PCB->Data, group); { if (layer->On) { - Coord thick; + pcb_coord_t thick; /* the following code just stupidly compares the endpoints * of the lines Index: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 4810) +++ trunk/src/search.c (revision 4811) @@ -45,7 +45,7 @@ * some local identifiers */ static double PosX, PosY; /* search position for subroutines */ -static Coord SearchRadius; +static pcb_coord_t SearchRadius; static pcb_box_t SearchBox; static pcb_layer_t *SearchLayer; @@ -522,9 +522,9 @@ /* --------------------------------------------------------------------------- * checks if a point is on a pin */ -pcb_bool IsPointOnPin(Coord X, Coord Y, Coord Radius, pcb_pin_t *pin) +pcb_bool IsPointOnPin(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_pin_t *pin) { - Coord t = PIN_SIZE(pin) / 2; + pcb_coord_t t = PIN_SIZE(pin) / 2; if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) { pcb_box_t b; @@ -543,7 +543,7 @@ /* --------------------------------------------------------------------------- * checks if a rat-line end is on a PV */ -pcb_bool IsPointOnLineEnd(Coord X, Coord Y, pcb_rat_t *Line) +pcb_bool IsPointOnLineEnd(pcb_coord_t X, pcb_coord_t Y, pcb_rat_t *Line) { if (((X == Line->Point1.X) && (Y == Line->Point1.Y)) || ((X == Line->Point2.X) && (Y == Line->Point2.Y))) return (pcb_true); @@ -582,7 +582,7 @@ * Finally, D1 and D2 are orthogonal, so we can sum them easily * by Pythagorean theorem. */ -pcb_bool IsPointOnLine(Coord X, Coord Y, Coord Radius, pcb_line_t *Line) +pcb_bool IsPointOnLine(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_line_t *Line) { double D1, D2, L; @@ -608,7 +608,7 @@ return sqrt(D1 * D1 + D2 * D2) <= Radius + Line->Thickness / 2; } -static int is_point_on_line(Coord px, Coord py, Coord lx1, Coord ly1, Coord lx2, Coord ly2) +static int is_point_on_line(pcb_coord_t px, pcb_coord_t py, pcb_coord_t lx1, pcb_coord_t ly1, pcb_coord_t lx2, pcb_coord_t ly2) { /* ohh well... let's hope the optimizer does something clever with inlining... */ pcb_line_t l; @@ -623,7 +623,7 @@ /* --------------------------------------------------------------------------- * checks if a line crosses a rectangle */ -pcb_bool IsLineInRectangle(Coord X1, Coord Y1, Coord X2, Coord Y2, pcb_line_t *Line) +pcb_bool IsLineInRectangle(pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_line_t *Line) { pcb_line_t line; @@ -668,7 +668,7 @@ static int /*checks if a point (of null radius) is in a slanted rectangle */ IsPointInQuadrangle(pcb_point_t p[4], pcb_point_t *l) { - Coord dx, dy, x, y; + pcb_coord_t dx, dy, x, y; double prod0, prod1; dx = p[1].X - p[0].X; @@ -742,7 +742,7 @@ /* --------------------------------------------------------------------------- * checks if an arc crosses a square */ -pcb_bool IsArcInRectangle(Coord X1, Coord Y1, Coord X2, Coord Y2, pcb_arc_t *Arc) +pcb_bool IsArcInRectangle(pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_arc_t *Arc) { pcb_line_t line; @@ -785,14 +785,14 @@ * Check if a circle of Radius with center at (X, Y) intersects a Pad. * Written to enable arbitrary pad directions; for rounded pads, too. */ -pcb_bool IsPointInPad(Coord X, Coord Y, Coord Radius, pcb_pad_t *Pad) +pcb_bool IsPointInPad(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_pad_t *Pad) { double r, Sin, Cos; - Coord x; + pcb_coord_t x; /* Also used from line_callback with line type smaller than pad type; use the smallest common subset; ->Thickness is still ok. */ - Coord t2 = (Pad->Thickness + 1) / 2, range; + pcb_coord_t t2 = (Pad->Thickness + 1) / 2, range; pcb_any_line_t pad = *(pcb_any_line_t *) Pad; @@ -856,9 +856,9 @@ return range < Radius; } -pcb_bool IsPointInBox(Coord X, Coord Y, pcb_box_t *box, Coord Radius) +pcb_bool IsPointInBox(pcb_coord_t X, pcb_coord_t Y, pcb_box_t *box, pcb_coord_t Radius) { - Coord width, height, range; + pcb_coord_t width, height, range; /* NB: Assumes box has point1 with numerically lower X and Y coordinates */ @@ -901,7 +901,7 @@ * and in the case that the arc thickness is greater than * the radius. */ -pcb_bool IsPointOnArc(Coord X, Coord Y, Coord Radius, pcb_arc_t *Arc) +pcb_bool IsPointOnArc(pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius, pcb_arc_t *Arc) { /* Calculate angle of point from arc center */ double p_dist = Distance(X, Y, Arc->X, Arc->Y); @@ -930,7 +930,7 @@ /* Check point is outside arc range, check distance from endpoints */ if (ang1 >= p_ang || ang2 <= p_ang) { - Coord ArcX, ArcY; + pcb_coord_t ArcX, ArcY; ArcX = Arc->X + Arc->Width * cos((Arc->StartAngle + 180) / PCB_RAD_TO_DEG); ArcY = Arc->Y - Arc->Width * sin((Arc->StartAngle + 180) / PCB_RAD_TO_DEG); @@ -961,7 +961,7 @@ * Note that if Type includes PCB_TYPE_LOCKED, then the search includes * locked items. Otherwise, locked items are ignored. */ -int SearchObjectByLocation(unsigned Type, void **Result1, void **Result2, void **Result3, Coord X, Coord Y, Coord Radius) +int SearchObjectByLocation(unsigned Type, void **Result1, void **Result2, void **Result3, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t Radius) { void *r1, *r2, *r3; void **pr1 = &r1, **pr2 = &r2, **pr3 = &r3; @@ -1321,7 +1321,7 @@ /* --------------------------------------------------------------------------- * searches the cursor position for the type */ -int SearchScreen(Coord X, Coord Y, int Type, void **Result1, void **Result2, void **Result3) +int SearchScreen(pcb_coord_t X, pcb_coord_t Y, int Type, void **Result1, void **Result2, void **Result3) { int ans; @@ -1332,7 +1332,7 @@ /* --------------------------------------------------------------------------- * searches the cursor position for the type */ -int SearchScreenGridSlop(Coord X, Coord Y, int Type, void **Result1, void **Result2, void **Result3) +int SearchScreenGridSlop(pcb_coord_t X, pcb_coord_t Y, int Type, void **Result1, void **Result2, void **Result3) { int ans; @@ -1340,9 +1340,9 @@ return (ans); } -int lines_intersect(Coord ax1, Coord ay1, Coord ax2, Coord ay2, Coord bx1, Coord by1, Coord bx2, Coord by2) +int lines_intersect(pcb_coord_t ax1, pcb_coord_t ay1, pcb_coord_t ax2, pcb_coord_t ay2, pcb_coord_t bx1, pcb_coord_t by1, pcb_coord_t bx2, pcb_coord_t by2) { -/* TODO: this should be long double if Coord is 64 bits */ +/* TODO: this should be long double if pcb_coord_t is 64 bits */ double ua, xi, yi, X1, Y1, X2, Y2, X3, Y3, X4, Y4, tmp; int is_a_pt, is_b_pt; Index: trunk/src/search.h =================================================================== --- trunk/src/search.h (revision 4810) +++ trunk/src/search.h (revision 4811) @@ -33,7 +33,7 @@ #include "rats.h" #include "misc_util.h" -int lines_intersect(Coord ax1, Coord ay1, Coord ax2, Coord ay2, Coord bx1, Coord by1, Coord bx2, Coord by2); +int lines_intersect(pcb_coord_t ax1, pcb_coord_t ay1, pcb_coord_t ax2, pcb_coord_t ay2, pcb_coord_t bx1, pcb_coord_t by1, pcb_coord_t bx2, pcb_coord_t by2); #define SLOP 5 /* --------------------------------------------------------------------------- @@ -145,18 +145,18 @@ /* --------------------------------------------------------------------------- * prototypes */ -pcb_bool IsPointOnLine(Coord, Coord, Coord, pcb_line_t *); -pcb_bool IsPointOnPin(Coord, Coord, Coord, pcb_pin_t *); -pcb_bool IsPointOnArc(Coord, Coord, Coord, pcb_arc_t *); -pcb_bool IsPointOnLineEnd(Coord, Coord, pcb_rat_t *); -pcb_bool IsLineInRectangle(Coord, Coord, Coord, Coord, pcb_line_t *); +pcb_bool IsPointOnLine(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_line_t *); +pcb_bool IsPointOnPin(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_pin_t *); +pcb_bool IsPointOnArc(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_arc_t *); +pcb_bool IsPointOnLineEnd(pcb_coord_t, pcb_coord_t, pcb_rat_t *); +pcb_bool IsLineInRectangle(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_line_t *); pcb_bool IsLineInQuadrangle(pcb_point_t p[4], pcb_line_t *Line); -pcb_bool IsArcInRectangle(Coord, Coord, Coord, Coord, pcb_arc_t *); -pcb_bool IsPointInPad(Coord, Coord, Coord, pcb_pad_t *); -pcb_bool IsPointInBox(Coord, Coord, pcb_box_t *, Coord); -int SearchObjectByLocation(unsigned, void **, void **, void **, Coord, Coord, Coord); -int SearchScreen(Coord, Coord, int, void **, void **, void **); -int SearchScreenGridSlop(Coord, Coord, int, void **, void **, void **); +pcb_bool IsArcInRectangle(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_arc_t *); +pcb_bool IsPointInPad(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_pad_t *); +pcb_bool IsPointInBox(pcb_coord_t, pcb_coord_t, pcb_box_t *, pcb_coord_t); +int SearchObjectByLocation(unsigned, void **, void **, void **, pcb_coord_t, pcb_coord_t, pcb_coord_t); +int SearchScreen(pcb_coord_t, pcb_coord_t, int, void **, void **, void **); +int SearchScreenGridSlop(pcb_coord_t, pcb_coord_t, int, void **, void **, void **); int SearchObjectByID(pcb_data_t *, void **, void **, void **, int, int); pcb_element_t *SearchElementByName(pcb_data_t *, const char *); Index: trunk/src/select.c =================================================================== --- trunk/src/select.c (revision 4810) +++ trunk/src/select.c (revision 4811) @@ -222,7 +222,7 @@ #define swap(a,b) \ do { \ - Coord tmp; \ + pcb_coord_t tmp; \ tmp = a; \ a = b; \ b = tmp; \ Index: trunk/src/select_act.c =================================================================== --- trunk/src/select_act.c (revision 4810) +++ trunk/src/select_act.c (revision 4811) @@ -124,7 +124,7 @@ %end-doc */ -static int ActionSelect(int argc, const char **argv, Coord x, Coord y) +static int ActionSelect(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function) { @@ -218,7 +218,7 @@ case F_Convert: { - Coord x, y; + pcb_coord_t x, y; Note.Buffer = conf_core.editor.buffer_number; SetBufferNumber(MAX_BUFFER - 1); ClearBuffer(PASTEBUFFER); @@ -283,7 +283,7 @@ %end-doc */ -static int ActionUnselect(int argc, const char **argv, Coord x, Coord y) +static int ActionUnselect(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (function) { Index: trunk/src/set.c =================================================================== --- trunk/src/set.c (revision 4810) +++ trunk/src/set.c (revision 4811) @@ -52,7 +52,7 @@ /* --------------------------------------------------------------------------- * sets cursor grid with respect to grid offset values */ -void SetGrid(Coord Grid, pcb_bool align) +void SetGrid(pcb_coord_t Grid, pcb_bool align) { if (Grid >= 1 && Grid <= MAX_GRID) { if (align) { @@ -69,7 +69,7 @@ /* --------------------------------------------------------------------------- * sets a new line thickness */ -void SetLineSize(Coord Size) +void SetLineSize(pcb_coord_t Size) { if (Size >= MIN_LINESIZE && Size <= MAX_LINESIZE) { conf_set_design("design/line_thickness", "%$mS", Size); @@ -81,7 +81,7 @@ /* --------------------------------------------------------------------------- * sets a new via thickness */ -void SetViaSize(Coord Size, pcb_bool Force) +void SetViaSize(pcb_coord_t Size, pcb_bool Force) { if (Force || (Size <= MAX_PINORVIASIZE && Size >= MIN_PINORVIASIZE && Size >= conf_core.design.via_drilling_hole + MIN_PINORVIACOPPER)) { conf_set_design("design/via_thickness", "%$mS", Size); @@ -91,7 +91,7 @@ /* --------------------------------------------------------------------------- * sets a new via drilling hole */ -void SetViaDrillingHole(Coord Size, pcb_bool Force) +void SetViaDrillingHole(pcb_coord_t Size, pcb_bool Force) { if (Force || (Size <= MAX_PINORVIASIZE && Size >= MIN_PINORVIAHOLE && Size <= conf_core.design.via_thickness - MIN_PINORVIACOPPER)) { conf_set_design("design/via_drilling_hole", "%$mS", Size); @@ -101,7 +101,7 @@ /* --------------------------------------------------------------------------- * sets a clearance width */ -void SetClearanceWidth(Coord Width) +void SetClearanceWidth(pcb_coord_t Width) { if (Width <= MAX_LINESIZE) { conf_set_design("design/clearance", "%$mS", Width); @@ -251,7 +251,7 @@ notify_crosshair_change(pcb_true); } -void SetLocalRef(Coord X, Coord Y, pcb_bool Showing) +void SetLocalRef(pcb_coord_t X, pcb_coord_t Y, pcb_bool Showing) { static pcb_mark_t old; static int count = 0; Index: trunk/src/set.h =================================================================== --- trunk/src/set.h (revision 4810) +++ trunk/src/set.h (revision 4811) @@ -32,18 +32,18 @@ #include "global_typedefs.h" void SetTextScale(int); -void SetGrid(Coord, pcb_bool); +void SetGrid(pcb_coord_t, pcb_bool); void SetZoom(double); -void SetLineSize(Coord); -void SetViaSize(Coord, pcb_bool); -void SetViaDrillingHole(Coord, pcb_bool); -void SetClearanceWidth(Coord); +void SetLineSize(pcb_coord_t); +void SetViaSize(pcb_coord_t, pcb_bool); +void SetViaDrillingHole(pcb_coord_t, pcb_bool); +void SetClearanceWidth(pcb_coord_t); void SetChangedFlag(pcb_bool); void SetBufferNumber(int); void SetMode(int); void SetCrosshairRangeToBuffer(void); -void SetLocalRef(Coord, Coord, pcb_bool); -void RedrawZoom(Coord, Coord); +void SetLocalRef(pcb_coord_t, pcb_coord_t, pcb_bool); +void RedrawZoom(pcb_coord_t, pcb_coord_t); void SaveMode(void); void RestoreMode(void); Index: trunk/src/undo.c =================================================================== --- trunk/src/undo.c (revision 4810) +++ trunk/src/undo.c (revision 4811) @@ -79,11 +79,11 @@ } ChangeNameType, *ChangeNameTypePtr; typedef struct { /* information about a move command */ - Coord DX, DY; /* movement vector */ + pcb_coord_t DX, DY; /* movement vector */ } MoveType, *MoveTypePtr; typedef struct { /* information about removed polygon points */ - Coord X, Y; /* data */ + pcb_coord_t X, Y; /* data */ int ID; pcb_cardinal_t Index; /* index in a polygons array of points */ pcb_bool last_in_contour; /* Whether the point was the last in its contour */ @@ -90,7 +90,7 @@ } RemovedPointType, *RemovedPointTypePtr; typedef struct { /* information about rotation */ - Coord CenterX, CenterY; /* center of rotation */ + pcb_coord_t CenterX, CenterY; /* center of rotation */ pcb_cardinal_t Steps; /* number of steps */ } RotateType, *RotateTypePtr; @@ -129,7 +129,7 @@ RotateType Rotate; MoveToLayer MoveToLayer; pcb_flag_t Flags; - Coord Size; + pcb_coord_t Size; LayerChangeType LayerChange; ClearPolyType ClearPoly; NetlistChangeType NetlistChange; @@ -339,7 +339,7 @@ { void *ptr1, *ptr2, *ptr3; int type; - Coord swap; + pcb_coord_t swap; /* lookup entry by ID */ type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind); @@ -393,7 +393,7 @@ { void *ptr1, *ptr2, *ptr3; int type; - Coord old_w, old_h; + pcb_coord_t old_w, old_h; /* lookup entry by ID */ type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind); @@ -424,7 +424,7 @@ { void *ptr1, *ptr2, *ptr3; int type; - Coord swap; + pcb_coord_t swap; /* lookup entry by ID */ type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind); @@ -450,7 +450,7 @@ { void *ptr1, *ptr2, *ptr3; int type; - Coord swap; + pcb_coord_t swap; /* lookup entry by ID */ type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind); @@ -478,7 +478,7 @@ { void *ptr1, *ptr2, *ptr3, *ptr1e; int type; - Coord swap; + pcb_coord_t swap; /* lookup entry by ID */ type = SearchObjectByID(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind); @@ -1194,7 +1194,7 @@ /* --------------------------------------------------------------------------- * adds an object to the list of mirrored objects */ -void AddObjectToMirrorUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord yoff) +void AddObjectToMirrorUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t yoff) { UndoListTypePtr undo; @@ -1207,7 +1207,7 @@ /* --------------------------------------------------------------------------- * adds an object to the list of rotated objects */ -void AddObjectToRotateUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord CenterX, Coord CenterY, pcb_uint8_t Steps) +void AddObjectToRotateUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t CenterX, pcb_coord_t CenterY, pcb_uint8_t Steps) { UndoListTypePtr undo; @@ -1320,7 +1320,7 @@ /* --------------------------------------------------------------------------- * adds an object to the list of moved objects */ -void AddObjectToMoveUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY) +void AddObjectToMoveUndoList(int Type, void *Ptr1, void *Ptr2, void *Ptr3, pcb_coord_t DX, pcb_coord_t DY) { UndoListTypePtr undo; Index: trunk/src/undo.h =================================================================== --- trunk/src/undo.h (revision 4810) +++ trunk/src/undo.h (revision 4811) @@ -47,12 +47,12 @@ void AddObjectToInsertPointUndoList(int, void *, void *, void *); void AddObjectToRemoveContourUndoList(int, pcb_layer_t *, pcb_polygon_t *); void AddObjectToInsertContourUndoList(int, pcb_layer_t *, pcb_polygon_t *); -void AddObjectToMoveUndoList(int, void *, void *, void *, Coord, Coord); +void AddObjectToMoveUndoList(int, void *, void *, void *, pcb_coord_t, pcb_coord_t); void AddObjectToChangeNameUndoList(int, void *, void *, void *, char *); void AddObjectToChangePinnumUndoList(int, void *, void *, void *, char *); -void AddObjectToRotateUndoList(int, void *, void *, void *, Coord, Coord, pcb_uint8_t); +void AddObjectToRotateUndoList(int, void *, void *, void *, pcb_coord_t, pcb_coord_t, pcb_uint8_t); void AddObjectToCreateUndoList(int, void *, void *, void *); -void AddObjectToMirrorUndoList(int, void *, void *, void *, Coord); +void AddObjectToMirrorUndoList(int, void *, void *, void *, pcb_coord_t); void AddObjectToMoveToLayerUndoList(int, void *, void *, void *); void AddObjectToFlagUndoList(int, void *, void *, void *); void AddObjectToSizeUndoList(int, void *, void *, void *); @@ -69,9 +69,9 @@ pcb_bool Undoing(void); /* Publish actions - these may be useful for other actions */ -int ActionUndo(int argc, const char **argv, Coord x, Coord y); -int ActionRedo(int argc, const char **argv, Coord x, Coord y); -int ActionAtomic(int argc, const char **argv, Coord x, Coord y); +int ActionUndo(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y); +int ActionRedo(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y); +int ActionAtomic(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y); /* --------------------------------------------------------------------------- * define supported types of undo operations Index: trunk/src/undo_act.c =================================================================== --- trunk/src/undo_act.c (revision 4810) +++ trunk/src/undo_act.c (revision 4811) @@ -78,7 +78,7 @@ %end-doc */ -int ActionAtomic(int argc, const char **argv, Coord x, Coord y) +int ActionAtomic(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (argc != 1) AFAIL(atomic); @@ -124,7 +124,7 @@ %end-doc */ -int ActionUndo(int argc, const char **argv, Coord x, Coord y) +int ActionUndo(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); if (!function || !*function) { @@ -264,7 +264,7 @@ %end-doc */ -int ActionRedo(int argc, const char **argv, Coord x, Coord y) +int ActionRedo(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (((conf_core.editor.mode == PCB_MODE_POLYGON || conf_core.editor.mode == PCB_MODE_POLYGON_HOLE) && Crosshair.AttachedPolygon.PointN) || Crosshair.AttachedLine.State == STATE_SECOND) Index: trunk/src/unit.c =================================================================== --- trunk/src/unit.c (revision 4810) +++ trunk/src/unit.c (revision 4811) @@ -224,7 +224,7 @@ * * \return The converted measure */ -double coord_to_unit(const pcb_unit_t * unit, Coord x) +double coord_to_unit(const pcb_unit_t * unit, pcb_coord_t x) { double base; if (unit == NULL) @@ -241,7 +241,7 @@ * * \return The converted measure */ -Coord unit_to_coord(const pcb_unit_t * unit, double x) +pcb_coord_t unit_to_coord(const pcb_unit_t * unit, double x) { double base; if (unit == NULL) Index: trunk/src/unit.h =================================================================== --- trunk/src/unit.h (revision 4810) +++ trunk/src/unit.h (revision 4811) @@ -30,7 +30,7 @@ #include "config.h" -/* typedef ... Coord; pcb base unit, typedef'd in config.h */ +/* typedef ... pcb_coord_t; pcb base unit, typedef'd in config.h */ typedef double pcb_angle_t; /* degrees */ enum pcb_allow_e { @@ -88,21 +88,21 @@ struct pcb_increments_s { const char *suffix; /* key g and g value */ - Coord grid; - Coord grid_min; - Coord grid_max; + pcb_coord_t grid; + pcb_coord_t grid_min; + pcb_coord_t grid_max; /* key s and s value */ - Coord size; - Coord size_min; - Coord size_max; + pcb_coord_t size; + pcb_coord_t size_min; + pcb_coord_t size_max; /* key l and l value */ - Coord line; - Coord line_min; - Coord line_max; + pcb_coord_t line; + pcb_coord_t line_min; + pcb_coord_t line_max; /* key k and k value */ - Coord clear; - Coord clear_min; - Coord clear_max; + pcb_coord_t clear; + pcb_coord_t clear_min; + pcb_coord_t clear_max; }; typedef struct pcb_unit_s pcb_unit_t; @@ -115,9 +115,9 @@ const pcb_unit_t *get_unit_list(void); const pcb_unit_t *get_unit_by_idx(int idx); int get_n_units(void); -double coord_to_unit(const pcb_unit_t *, Coord); +double coord_to_unit(const pcb_unit_t *, pcb_coord_t); double unit_to_factor(const pcb_unit_t * unit); -Coord unit_to_coord(const pcb_unit_t *, double); +pcb_coord_t unit_to_coord(const pcb_unit_t *, double); pcb_increments_t *get_increments_struct(const char *suffix); pcb_angle_t NormalizeAngle(pcb_angle_t a); Index: trunk/src/vtroutestyle.h =================================================================== --- trunk/src/vtroutestyle.h (revision 4810) +++ trunk/src/vtroutestyle.h (revision 4811) @@ -7,7 +7,7 @@ /* Elem=RouteStyle; init=0 */ typedef struct { - Coord Thick, /* line thickness */ + pcb_coord_t Thick, /* line thickness */ Diameter, /* via diameter */ Hole, /* via drill hole */ Clearance; /* min. separation from other nets */ Index: trunk/src_plugins/autocrop/autocrop.c =================================================================== --- trunk/src_plugins/autocrop/autocrop.c (revision 4810) +++ trunk/src_plugins/autocrop/autocrop.c (revision 4811) @@ -61,7 +61,7 @@ #include "box.h" #include "hid_actions.h" -static void *MyMoveViaLowLevel(pcb_data_t * Data, pcb_pin_t * Via, Coord dx, Coord dy) +static void *MyMoveViaLowLevel(pcb_data_t * Data, pcb_pin_t * Via, pcb_coord_t dx, pcb_coord_t dy) { if (Data) { RestoreToPolygon(Data, PCB_TYPE_VIA, Via, Via); @@ -75,7 +75,7 @@ return Via; } -static void *MyMoveLineLowLevel(pcb_data_t * Data, pcb_layer_t * Layer, pcb_line_t * Line, Coord dx, Coord dy) +static void *MyMoveLineLowLevel(pcb_data_t * Data, pcb_layer_t * Layer, pcb_line_t * Line, pcb_coord_t dx, pcb_coord_t dy) { if (Data) { RestoreToPolygon(Data, PCB_TYPE_LINE, Layer, Line); @@ -89,7 +89,7 @@ return Line; } -static void *MyMoveArcLowLevel(pcb_data_t * Data, pcb_layer_t * Layer, pcb_arc_t * Arc, Coord dx, Coord dy) +static void *MyMoveArcLowLevel(pcb_data_t * Data, pcb_layer_t * Layer, pcb_arc_t * Arc, pcb_coord_t dx, pcb_coord_t dy) { if (Data) { RestoreToPolygon(Data, PCB_TYPE_ARC, Layer, Arc); @@ -103,7 +103,7 @@ return Arc; } -static void *MyMovePolygonLowLevel(pcb_data_t * Data, pcb_layer_t * Layer, pcb_polygon_t * Polygon, Coord dx, Coord dy) +static void *MyMovePolygonLowLevel(pcb_data_t * Data, pcb_layer_t * Layer, pcb_polygon_t * Polygon, pcb_coord_t dx, pcb_coord_t dy) { if (Data) { r_delete_entry(Layer->polygon_tree, (pcb_box_t *) Polygon); @@ -117,7 +117,7 @@ return Polygon; } -static void *MyMoveTextLowLevel(pcb_layer_t * Layer, pcb_text_t * Text, Coord dx, Coord dy) +static void *MyMoveTextLowLevel(pcb_layer_t * Layer, pcb_text_t * Text, pcb_coord_t dx, pcb_coord_t dy) { if (Layer) r_delete_entry(Layer->text_tree, (pcb_box_t *) Text); @@ -135,7 +135,7 @@ * element move re-clears the poly, followed by the polys moving and * re-clearing everything again. */ -static void MoveAll(Coord dx, Coord dy) +static void MoveAll(pcb_coord_t dx, pcb_coord_t dy) { ELEMENT_LOOP(PCB->Data); { @@ -180,9 +180,9 @@ ENDALL_LOOP; } -static int autocrop(int argc, const char **argv, Coord x, Coord y) +static int autocrop(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { - Coord dx, dy, pad; + pcb_coord_t dx, dy, pad; pcb_box_t *box; box = GetDataBoundingBox(PCB->Data); /* handy! */ Index: trunk/src_plugins/autoplace/action.c =================================================================== --- trunk/src_plugins/autoplace/action.c (revision 4810) +++ trunk/src_plugins/autoplace/action.c (revision 4811) @@ -43,7 +43,7 @@ %end-doc */ -static int ActionAutoPlaceSelected(int argc, const char **argv, Coord x, Coord y) +static int ActionAutoPlaceSelected(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { hid_action("Busy"); if (gui->confirm_dialog(_("Auto-placement can NOT be undone.\n" "Do you want to continue anyway?\n"), 0)) { Index: trunk/src_plugins/autoplace/autoplace.c =================================================================== --- trunk/src_plugins/autoplace/autoplace.c (revision 4810) +++ trunk/src_plugins/autoplace/autoplace.c (revision 4811) @@ -95,8 +95,8 @@ double gamma; /* annealing schedule constant */ int good_ratio; /* ratio of moves to good moves for halting */ pcb_bool fast; /* ignore SMD/pin conflicts */ - Coord large_grid_size; /* snap perturbations to this grid when T is high */ - Coord small_grid_size; /* snap to this grid when T is small. */ + pcb_coord_t large_grid_size; /* snap perturbations to this grid when T is high */ + pcb_coord_t small_grid_size; /* snap to this grid when T is small. */ } /* wire cost is manhattan distance (in mils), thus 1 inch = 1000 */ CostParameter = { @@ -127,7 +127,7 @@ typedef struct { pcb_element_t *element; enum ewhich which; - Coord DX, DY; /* for shift */ + pcb_coord_t DX, DY; /* for shift */ unsigned rotate; /* for rotate/flip */ pcb_element_t *other; /* for exchange */ } PerturbationType; @@ -214,7 +214,7 @@ pcb_box_t trap; direction_t search_dir; }; -#define ROTATEBOX(box) { Coord t;\ +#define ROTATEBOX(box) { pcb_coord_t t;\ t = (box).X1; (box).X1 = - (box).Y1; (box).Y1 = t;\ t = (box).X2; (box).X2 = - (box).Y2; (box).Y2 = t;\ t = (box).X1; (box).X1 = (box).X2; (box).X2 = t;\ @@ -301,7 +301,7 @@ double delta4 = 0; /* alignment bonus */ double delta5 = 0; /* total area penalty */ pcb_cardinal_t i, j; - Coord minx, maxx, miny, maxy; + pcb_coord_t minx, maxx, miny, maxy; pcb_bool allpads, allsameside; pcb_cardinal_t thegroup; pcb_box_list_t bounds = { 0, 0, NULL }; /* save bounding rectangles here */ @@ -362,8 +362,8 @@ pcb_box_list_t *otherside; pcb_box_t *box; pcb_box_t *lastbox = NULL; - Coord thickness; - Coord clearance; + pcb_coord_t thickness; + pcb_coord_t clearance; if (TEST_FLAG(PCB_FLAG_ONSOLDER, element)) { thisside = &solderside; otherside = &componentside; @@ -518,8 +518,8 @@ } /* penalize total area used by this layout */ { - Coord minX = MAX_COORD, minY = MAX_COORD; - Coord maxX = -MAX_COORD, maxY = -MAX_COORD; + pcb_coord_t minX = MAX_COORD, minY = MAX_COORD; + pcb_coord_t maxX = -MAX_COORD, maxY = -MAX_COORD; ELEMENT_LOOP(PCB->Data); { MAKEMIN(minX, element->VBox.X1); @@ -557,7 +557,7 @@ switch (pcb_rand() % ((selected->PtrN > 1) ? 3 : 2)) { case 0: { /* shift! */ - Coord grid; + pcb_coord_t grid; double scaleX = PCB_CLAMP(sqrt(T), PCB_MIL_TO_COORD(2.5), PCB->MaxWidth / 3); double scaleY = PCB_CLAMP(sqrt(T), PCB_MIL_TO_COORD(2.5), PCB->MaxHeight / 3); pt.which = SHIFT; @@ -608,7 +608,7 @@ void doPerturb(PerturbationType * pt, pcb_bool undo) { - Coord bbcx, bbcy; + pcb_coord_t bbcx, bbcy; /* compute center of element bounding box */ bbcx = (pt->element->VBox.X1 + pt->element->VBox.X2) / 2; bbcy = (pt->element->VBox.Y1 + pt->element->VBox.Y2) / 2; @@ -616,7 +616,7 @@ switch (pt->which) { case SHIFT: { - Coord DX = pt->DX, DY = pt->DY; + pcb_coord_t DX = pt->DX, DY = pt->DY; if (undo) { DX = -DX; DY = -DY; @@ -633,7 +633,7 @@ if (b) RotateElementLowLevel(PCB->Data, pt->element, bbcx, bbcy, b); else { - Coord y = pt->element->VBox.Y1; + pcb_coord_t y = pt->element->VBox.Y1; MirrorElementCoordinates(PCB->Data, pt->element, 0); /* mirroring moves the element. move it back. */ MoveElementLowLevel(PCB->Data, pt->element, 0, y - pt->element->VBox.Y1); @@ -643,10 +643,10 @@ case EXCHANGE: { /* first exchange positions */ - Coord x1 = pt->element->VBox.X1; - Coord y1 = pt->element->VBox.Y1; - Coord x2 = pt->other->BoundingBox.X1; - Coord y2 = pt->other->BoundingBox.Y1; + pcb_coord_t x1 = pt->element->VBox.X1; + pcb_coord_t y1 = pt->element->VBox.Y1; + pcb_coord_t x2 = pt->other->BoundingBox.X1; + pcb_coord_t y2 = pt->other->BoundingBox.Y1; MoveElementLowLevel(PCB->Data, pt->element, x2 - x1, y2 - y1); MoveElementLowLevel(PCB->Data, pt->other, x1 - x2, y1 - y2); /* then flip both elements if they are on opposite sides */ Index: trunk/src_plugins/autoroute/action.c =================================================================== --- trunk/src_plugins/autoroute/action.c (revision 4810) +++ trunk/src_plugins/autoroute/action.c (revision 4811) @@ -62,7 +62,7 @@ %end-doc */ -static int ActionAutoRoute(int argc, const char **argv, Coord x, Coord y) +static int ActionAutoRoute(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ACTION_ARG(0); hid_action("Busy"); Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 4810) +++ trunk/src_plugins/autoroute/autoroute.c (revision 4811) @@ -309,8 +309,8 @@ RouteStyleType **styles; /* [max_styles+1] */ /* what is the maximum bloat (clearance+line half-width or * clearance+via_radius) for any style we've seen? */ - Coord max_bloat; - Coord max_keep; + pcb_coord_t max_bloat; + pcb_coord_t max_keep; mtspace_t *mtspace; } routedata_t; @@ -341,7 +341,7 @@ /* net style parameters */ RouteStyleType *style; /* the present bloat */ - Coord bloat; + pcb_coord_t bloat; /* cost parameters */ cost_t ViaCost, /* additional "length" cost for using a via */ LastConflictPenalty, /* length mult. for routing over last pass' trace */ @@ -389,7 +389,7 @@ static void add_or_destroy_edge(struct routeone_state *s, edge_t * e); static void -RD_DrawThermal(routedata_t * rd, Coord X, Coord Y, pcb_cardinal_t group, pcb_cardinal_t layer, routebox_t * subnet, pcb_bool is_bad); +RD_DrawThermal(routedata_t * rd, pcb_coord_t X, pcb_coord_t Y, pcb_cardinal_t group, pcb_cardinal_t layer, routebox_t * subnet, pcb_bool is_bad); static void ResetSubnet(routebox_t * net); #ifdef ROUTE_DEBUG static int showboxen = -2; @@ -541,7 +541,7 @@ return; } -static void init_const_box(routebox_t * rb, Coord X1, Coord Y1, Coord X2, Coord Y2, Coord clearance) +static void init_const_box(routebox_t * rb, pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, pcb_coord_t Y2, pcb_coord_t clearance) { pcb_box_t *bp = (pcb_box_t *) & rb->box; /* note discarding const! */ assert(!rb->flags.inited); @@ -574,7 +574,7 @@ return closest_point_in_box(from, &rb->sbox); } -static inline pcb_bool point_in_shrunk_box(const routebox_t * box, Coord X, Coord Y) +static inline pcb_bool point_in_shrunk_box(const routebox_t * box, pcb_coord_t X, pcb_coord_t Y) { pcb_box_t b = shrink_routebox(box); return point_in_box(&b, X, Y); @@ -628,7 +628,7 @@ static routebox_t *AddPad(PointerListType layergroupboxes[], pcb_element_t *element, pcb_pad_t *pad, RouteStyleType * style) { - Coord halfthick; + pcb_coord_t halfthick; routebox_t **rbpp; int layergroup = (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? back : front); assert(0 <= layergroup && layergroup < max_group); @@ -702,11 +702,11 @@ } static routebox_t *AddIrregularObstacle(PointerListType layergroupboxes[], - Coord X1, Coord Y1, - Coord X2, Coord Y2, pcb_cardinal_t layergroup, void *parent, RouteStyleType * style) + pcb_coord_t X1, pcb_coord_t Y1, + pcb_coord_t X2, pcb_coord_t Y2, pcb_cardinal_t layergroup, void *parent, RouteStyleType * style) { routebox_t **rbpp; - Coord keep = style->Clearance; + pcb_coord_t keep = style->Clearance; assert(layergroupboxes && parent); assert(X1 <= X2 && Y1 <= Y2); assert(0 <= layergroup && layergroup < max_group); @@ -796,7 +796,7 @@ return R_DIR_NOT_FOUND; } -static routebox_t *FindRouteBoxOnLayerGroup(routedata_t * rd, Coord X, Coord Y, pcb_cardinal_t layergroup) +static routebox_t *FindRouteBoxOnLayerGroup(routedata_t * rd, pcb_coord_t X, pcb_coord_t Y, pcb_cardinal_t layergroup) { struct rb_info info; info.winner = NULL; @@ -964,8 +964,8 @@ /* dice up non-straight lines into many tiny obstacles */ if (line->Point1.X != line->Point2.X && line->Point1.Y != line->Point2.Y) { pcb_line_t fake_line = *line; - Coord dx = (line->Point2.X - line->Point1.X); - Coord dy = (line->Point2.Y - line->Point1.Y); + pcb_coord_t dx = (line->Point2.X - line->Point1.X); + pcb_coord_t dy = (line->Point2.Y - line->Point1.Y); int segs = MAX(PCB_ABS(dx), PCB_ABS(dy)) / (4 * BLOAT(rd->styles[j]) + 1); int qq; @@ -1079,8 +1079,8 @@ /* dice up non-straight lines into many tiny obstacles */ if (line->Point1.X != line->Point2.X && line->Point1.Y != line->Point2.Y) { pcb_line_t fake_line = *line; - Coord dx = (line->Point2.X - line->Point1.X); - Coord dy = (line->Point2.Y - line->Point1.Y); + pcb_coord_t dx = (line->Point2.X - line->Point1.X); + pcb_coord_t dy = (line->Point2.Y - line->Point1.Y); int segs = MAX(PCB_ABS(dx), PCB_ABS(dy)) / (4 * rd->max_bloat + 1); int qq; segs = PCB_CLAMP(segs, 1, 32); /* don't go too crazy */ @@ -1297,7 +1297,7 @@ static pcb_box_t bloat_routebox(routebox_t * rb) { pcb_box_t r; - Coord clearance; + pcb_coord_t clearance; assert(__routebox_is_good(rb)); if (rb->flags.nobloat) @@ -1526,7 +1526,7 @@ /* create edge from field values */ /* mincost_target_guess can be NULL */ static edge_t *CreateEdge(routebox_t * rb, - Coord CostPointX, Coord CostPointY, + pcb_coord_t CostPointX, pcb_coord_t CostPointY, cost_t cost_to_point, routebox_t * mincost_target_guess, direction_t expand_dir, pcb_rtree_t * targets) { edge_t *e; @@ -1839,7 +1839,7 @@ struct E_result { routebox_t *parent; routebox_t *n, *e, *s, *w; - Coord keep, bloat; + pcb_coord_t keep, bloat; pcb_box_t inflated, orig; int done; }; @@ -1855,7 +1855,7 @@ struct E_result *res = (struct E_result *) cl; routebox_t *rb = (routebox_t *) box; pcb_box_t rbox; - Coord dn, de, ds, dw, bloat; + pcb_coord_t dn, de, ds, dw, bloat; /* we don't see conflicts already encountered */ if (rb->flags.touched) @@ -1951,7 +1951,7 @@ static pcb_bool boink_box(routebox_t * rb, struct E_result *res, direction_t dir) { - Coord bloat; + pcb_coord_t bloat; if (rb->style->Clearance > res->keep) bloat = res->keep - rb->style->Clearance; else @@ -2409,7 +2409,7 @@ * i.e. if dir is SOUTH, then this means fixing up an EAST leftover * edge, which would be the southern most edge for that example. */ -static inline pcb_box_t previous_edge(Coord last, direction_t i, const pcb_box_t * b) +static inline pcb_box_t previous_edge(pcb_coord_t last, direction_t i, const pcb_box_t * b) { pcb_box_t db = *b; switch (i) { @@ -2439,8 +2439,8 @@ struct break_info bi; vector_t *edges; heap_t *heap[4]; - Coord first, last; - Coord bloat; + pcb_coord_t first, last; + pcb_coord_t bloat; direction_t dir; routebox_t fake; @@ -2828,7 +2828,7 @@ * Route-tracing code: once we've got a path of expansion boxes, trace * a line through them to actually create the connection. */ -static void RD_DrawThermal(routedata_t * rd, Coord X, Coord Y, pcb_cardinal_t group, pcb_cardinal_t layer, routebox_t * subnet, pcb_bool is_bad) +static void RD_DrawThermal(routedata_t * rd, pcb_coord_t X, pcb_coord_t Y, pcb_cardinal_t group, pcb_cardinal_t layer, routebox_t * subnet, pcb_bool is_bad) { routebox_t *rb; rb = (routebox_t *) malloc(sizeof(*rb)); @@ -2850,7 +2850,7 @@ rb->flags.homeless = 0; } -static void RD_DrawVia(routedata_t * rd, Coord X, Coord Y, Coord radius, routebox_t * subnet, pcb_bool is_bad) +static void RD_DrawVia(routedata_t * rd, pcb_coord_t X, pcb_coord_t Y, pcb_coord_t radius, routebox_t * subnet, pcb_bool is_bad) { routebox_t *rb, *first_via = NULL; int i; @@ -2906,8 +2906,8 @@ static void RD_DrawLine(routedata_t * rd, - Coord X1, Coord Y1, Coord X2, - Coord Y2, Coord halfthick, pcb_cardinal_t group, routebox_t * subnet, pcb_bool is_bad, pcb_bool is_45) + pcb_coord_t X1, pcb_coord_t Y1, pcb_coord_t X2, + pcb_coord_t Y2, pcb_coord_t halfthick, pcb_cardinal_t group, routebox_t * subnet, pcb_bool is_bad, pcb_bool is_45) { /* we hold the line in a queue to concatenate segments that * ajoin one another. That reduces the number of things in @@ -2914,14 +2914,14 @@ * the trees and allows conflict boxes to be larger, both of * which are really useful. */ - static Coord qX1 = -1, qY1, qX2, qY2; - static Coord qhthick; + static pcb_coord_t qX1 = -1, qY1, qX2, qY2; + static pcb_coord_t qhthick; static pcb_cardinal_t qgroup; static pcb_bool qis_45, qis_bad; static routebox_t *qsn; routebox_t *rb; - Coord ka = AutoRouteParameters.style->Clearance; + pcb_coord_t ka = AutoRouteParameters.style->Clearance; /* don't draw zero-length segments. */ if (X1 == X2 && Y1 == Y2) @@ -3013,7 +3013,7 @@ RD_DrawManhattanLine(routedata_t * rd, const pcb_box_t * box1, const pcb_box_t * box2, Cheappcb_point_t start, Cheappcb_point_t end, - Coord halfthick, pcb_cardinal_t group, routebox_t * subnet, pcb_bool is_bad, pcb_bool last_was_x) + pcb_coord_t halfthick, pcb_cardinal_t group, routebox_t * subnet, pcb_bool is_bad, pcb_bool last_was_x) { Cheappcb_point_t knee = start; if (end.X == start.X) { @@ -3049,7 +3049,7 @@ } else { /* draw 45-degree path across knee */ - Coord len45 = MIN(PCB_ABS(start.X - end.X), PCB_ABS(start.Y - end.Y)); + pcb_coord_t len45 = MIN(PCB_ABS(start.X - end.X), PCB_ABS(start.Y - end.Y)); Cheappcb_point_t kneestart = knee, kneeend = knee; if (kneestart.X == start.X) kneestart.Y += (kneestart.Y > start.Y) ? -len45 : len45; @@ -3112,8 +3112,8 @@ static void TracePath(routedata_t * rd, routebox_t * path, const routebox_t * target, routebox_t * subnet, pcb_bool is_bad) { pcb_bool last_x = pcb_false; - Coord halfwidth = HALF_THICK(AutoRouteParameters.style->Thick); - Coord radius = HALF_THICK(AutoRouteParameters.style->Diameter); + pcb_coord_t halfwidth = HALF_THICK(AutoRouteParameters.style->Thick); + pcb_coord_t radius = HALF_THICK(AutoRouteParameters.style->Diameter); Cheappcb_point_t lastpoint, nextpoint; routebox_t *lastpath; pcb_box_t b; @@ -3349,9 +3349,9 @@ add_via_sites(struct routeone_state *s, struct routeone_via_site_state *vss, mtspace_t * mtspace, routebox_t * within, - conflict_t within_conflict_level, edge_t * parent_edge, pcb_rtree_t * targets, Coord shrink, pcb_bool in_plane) + conflict_t within_conflict_level, edge_t * parent_edge, pcb_rtree_t * targets, pcb_coord_t shrink, pcb_bool in_plane) { - Coord radius, clearance; + pcb_coord_t radius, clearance; vetting_t *work; pcb_box_t region = shrink_routebox(within); shrink_box(®ion, shrink); @@ -3378,7 +3378,7 @@ struct routeone_via_site_state *vss, mtspace_t * mtspace, pcb_rtree_t * targets) { int i, j, count = 0; - Coord radius, clearance; + pcb_coord_t radius, clearance; vetting_t *work; routebox_t *within; conflict_t within_conflict_level; @@ -4387,7 +4387,7 @@ struct fpin_info { pcb_pin_t *pin; - Coord X, Y; + pcb_coord_t X, Y; jmp_buf env; }; @@ -4450,7 +4450,7 @@ assert(layer && layer->On); /*at least one layer must be on in this group! */ assert(p->type != EXPANSION_AREA); if (p->type == LINE) { - Coord halfwidth = HALF_THICK(p->style->Thick); + pcb_coord_t halfwidth = HALF_THICK(p->style->Thick); double th = halfwidth * 2 + 1; pcb_box_t b; assert(p->parent.line == NULL); @@ -4464,7 +4464,7 @@ if (b.Y2 == b.Y1 + 1) b.Y2 = b.Y1; if (p->flags.bl_to_ur) { - Coord t; + pcb_coord_t t; t = b.X1; b.X1 = b.X2; b.X2 = t; @@ -4481,7 +4481,7 @@ } else if (p->type == VIA || p->type == VIA_SHADOW) { routebox_t *pp = (p->type == VIA_SHADOW) ? p->parent.via_shadow : p; - Coord radius = HALF_THICK(pp->style->Diameter); + pcb_coord_t radius = HALF_THICK(pp->style->Diameter); pcb_box_t b = shrink_routebox(p); total_via_count++; assert(pp->type == VIA); @@ -4700,7 +4700,7 @@ if (changed) changed = IronDownAllUnfixedPaths(rd); - Message(PCB_MSG_DEFAULT, "Total added wire length = %$mS, %d vias added\n", (Coord) total_wire_length, total_via_count); + Message(PCB_MSG_DEFAULT, "Total added wire length = %$mS, %d vias added\n", (pcb_coord_t) total_wire_length, total_via_count); DestroyRouteData(&rd); if (changed) { SaveUndoSerialNumber(); Index: trunk/src_plugins/autoroute/mtspace.c =================================================================== --- trunk/src_plugins/autoroute/mtspace.c (revision 4810) +++ trunk/src_plugins/autoroute/mtspace.c (revision 4811) @@ -53,7 +53,7 @@ typedef struct mtspacebox { const pcb_box_t box; - Coord clearance; /* the smallest clearance around this box */ + pcb_coord_t clearance; /* the smallest clearance around this box */ } mtspacebox_t; /* this is an mtspace_t */ @@ -74,14 +74,14 @@ heap_or_vector no_fix; heap_or_vector no_hi; heap_or_vector hi_candidate; - Coord radius; - Coord clearance; + pcb_coord_t radius; + pcb_coord_t clearance; Cheappcb_point_t desired; }; #define SPECIAL 823157 -mtspacebox_t *mtspace_create_box(const pcb_box_t * box, Coord clearance) +mtspacebox_t *mtspace_create_box(const pcb_box_t * box, pcb_coord_t clearance) { mtspacebox_t *mtsb; assert(box_is_good(box)); @@ -119,7 +119,7 @@ } struct mts_info { - Coord clearance; + pcb_coord_t clearance; pcb_box_t box; pcb_rtree_t *tree; jmp_buf env; @@ -153,7 +153,7 @@ } /* add a space-filler to the empty space representation. */ -void mtspace_add(mtspace_t * mtspace, const pcb_box_t * box, mtspace_type_t which, Coord clearance) +void mtspace_add(mtspace_t * mtspace, const pcb_box_t * box, mtspace_type_t which, pcb_coord_t clearance) { mtspacebox_t *filler = mtspace_create_box(box, clearance); r_insert_entry(which_tree(mtspace, which), (const pcb_box_t *) filler, 1); @@ -160,7 +160,7 @@ } /* remove a space-filler from the empty space representation. */ -void mtspace_remove(mtspace_t * mtspace, const pcb_box_t * box, mtspace_type_t which, Coord clearance) +void mtspace_remove(mtspace_t * mtspace, const pcb_box_t * box, mtspace_type_t which, pcb_coord_t clearance) { struct mts_info cl; pcb_box_t small_search; @@ -180,7 +180,7 @@ heap_or_vector checking; heap_or_vector touching; Cheappcb_point_t *desired; - Coord radius, clearance; + pcb_coord_t radius, clearance; jmp_buf env; pcb_bool touch_is_vec; }; @@ -209,7 +209,7 @@ { struct query_closure *qc = (struct query_closure *) cl; mtspacebox_t *mtsb = (mtspacebox_t *) box; - Coord shrink; + pcb_coord_t shrink; assert(box_intersect(qc->cbox, &mtsb->box)); /* we need to satisfy the larger of the two clearances */ if (qc->clearance > mtsb->clearance) @@ -223,8 +223,8 @@ return R_DIR_NOT_FOUND; /* ok, we do touch this box, now create up to 4 boxes that don't */ if (mtsb->box.Y1 > qc->cbox->Y1 + shrink) { /* top region exists */ - Coord Y1 = qc->cbox->Y1; - Coord Y2 = mtsb->box.Y1 + shrink; + pcb_coord_t Y1 = qc->cbox->Y1; + pcb_coord_t Y2 = mtsb->box.Y1 + shrink; if (Y2 - Y1 >= 2 * (qc->radius + qc->clearance)) { pcb_box_t *newone = (pcb_box_t *) malloc(sizeof(pcb_box_t)); newone->X1 = qc->cbox->X1; @@ -236,8 +236,8 @@ } } if (mtsb->box.Y2 < qc->cbox->Y2 - shrink) { /* bottom region exists */ - Coord Y1 = mtsb->box.Y2 - shrink; - Coord Y2 = qc->cbox->Y2; + pcb_coord_t Y1 = mtsb->box.Y2 - shrink; + pcb_coord_t Y2 = qc->cbox->Y2; if (Y2 - Y1 >= 2 * (qc->radius + qc->clearance)) { pcb_box_t *newone = (pcb_box_t *) malloc(sizeof(pcb_box_t)); newone->X1 = qc->cbox->X1; @@ -249,8 +249,8 @@ } } if (mtsb->box.X1 > qc->cbox->X1 + shrink) { /* left region exists */ - Coord X1 = qc->cbox->X1; - Coord X2 = mtsb->box.X1 + shrink; + pcb_coord_t X1 = qc->cbox->X1; + pcb_coord_t X2 = mtsb->box.X1 + shrink; if (X2 - X1 >= 2 * (qc->radius + qc->clearance)) { pcb_box_t *newone; newone = (pcb_box_t *) malloc(sizeof(pcb_box_t)); @@ -263,8 +263,8 @@ } } if (mtsb->box.X2 < qc->cbox->X2 - shrink) { /* right region exists */ - Coord X1 = mtsb->box.X2 - shrink; - Coord X2 = qc->cbox->X2; + pcb_coord_t X1 = mtsb->box.X2 - shrink; + pcb_coord_t X2 = qc->cbox->X2; if (X2 - X1 >= 2 * (qc->radius + qc->clearance)) { pcb_box_t *newone = (pcb_box_t *) malloc(sizeof(pcb_box_t)); newone->Y1 = qc->cbox->Y1; @@ -370,7 +370,7 @@ * necessary. */ vetting_t *mtspace_query_rect(mtspace_t * mtspace, const pcb_box_t * region, - Coord radius, Coord clearance, + pcb_coord_t radius, pcb_coord_t clearance, vetting_t * work, vector_t * free_space_vec, vector_t * lo_conflict_space_vec, Index: trunk/src_plugins/autoroute/mtspace.h =================================================================== --- trunk/src_plugins/autoroute/mtspace.h (revision 4810) +++ trunk/src_plugins/autoroute/mtspace.h (revision 4811) @@ -56,16 +56,16 @@ * should *not* be bloated; it should be "true". The feature will fill * *at least* a radius of clearance around it; */ -void mtspace_add(mtspace_t * mtspace, const pcb_box_t * box, mtspace_type_t which, Coord clearance); +void mtspace_add(mtspace_t * mtspace, const pcb_box_t * box, mtspace_type_t which, pcb_coord_t clearance); /* remove a space-filler from the empty space representation. The given box * should *not* be bloated; it should be "true". The feature will fill * *at least* a radius of clearance around it; */ -void mtspace_remove(mtspace_t * mtspace, const pcb_box_t * box, mtspace_type_t which, Coord clearance); +void mtspace_remove(mtspace_t * mtspace, const pcb_box_t * box, mtspace_type_t which, pcb_coord_t clearance); vetting_t *mtspace_query_rect(mtspace_t * mtspace, const pcb_box_t * region, - Coord radius, Coord clearance, + pcb_coord_t radius, pcb_coord_t clearance, vetting_t * work, vector_t * free_space_vec, vector_t * lo_conflict_space_vec, Index: trunk/src_plugins/boardflip/boardflip.c =================================================================== --- trunk/src_plugins/boardflip/boardflip.c (revision 4810) +++ trunk/src_plugins/boardflip/boardflip.c (revision 4811) @@ -58,7 +58,7 @@ #define FLIP(y) (y) = h - (y) #define NEG(y) (y) = - (y) -static int boardflip(int argc, const char **argv, Coord x, Coord y) +static int boardflip(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int h = PCB->MaxHeight; int sides = 0; Index: trunk/src_plugins/diag/diag.c =================================================================== --- trunk/src_plugins/diag/diag.c (revision 4810) +++ trunk/src_plugins/diag/diag.c (revision 4811) @@ -43,7 +43,7 @@ static const char dump_conf_help[] = "Perform various operations on the configuration tree."; extern lht_doc_t *conf_root[]; -static int ActionDumpConf(int argc, const char **argv, Coord x, Coord y) +static int ActionDumpConf(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *cmd = argc > 0 ? argv[0] : NULL; @@ -90,7 +90,7 @@ static const char eval_conf_help[] = "Perform various operations on the configuration tree."; -static int ActionEvalConf(int argc, const char **argv, Coord x, Coord y) +static int ActionEvalConf(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *path = argc > 0 ? argv[0] : NULL; conf_native_t *nat; @@ -144,7 +144,7 @@ static const char dump_layers_help[] = "Print info about each layer"; extern lht_doc_t *conf_root[]; -static int ActionDumpLayers(int argc, const char **argv, Coord x, Coord y) +static int ActionDumpLayers(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int g, n, used, arr[128]; /* WARNING: this assumes we won't have more than 128 layers */ Index: trunk/src_plugins/distalign/distalign.c =================================================================== --- trunk/src_plugins/distalign/distalign.c (revision 4810) +++ trunk/src_plugins/distalign/distalign.c (revision 4811) @@ -177,7 +177,7 @@ /* this macro produces a function in X or Y that switches on 'point' */ #define COORD(DIR) \ -static inline Coord \ +static inline pcb_coord_t \ coord ## DIR(pcb_element_t *element, int point) \ { \ switch (point) { \ @@ -201,7 +201,7 @@ COORD(Y) /* return the element coordinate associated with the given internal point */ - static Coord coord(pcb_element_t * element, int dir, int point) + static pcb_coord_t coord(pcb_element_t * element, int dir, int point) { if (dir == K_X) return coordX(element, point); @@ -211,8 +211,8 @@ static struct element_by_pos { pcb_element_t *element; - Coord pos; - Coord width; + pcb_coord_t pos; + pcb_coord_t width; } *elements_by_pos; static int nelements_by_pos; @@ -281,9 +281,9 @@ * \brief Find the reference coordinate from the specified points of all * selected elements. */ -static Coord reference_coord(int op, int x, int y, int dir, int point, int reference) +static pcb_coord_t reference_coord(int op, int x, int y, int dir, int point, int reference) { - Coord q; + pcb_coord_t q; int nsel; q = 0; @@ -341,13 +341,13 @@ * * Defaults are Marks, First. */ -static int align(int argc, const char **argv, Coord x, Coord y) +static int align(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int dir; int point; int reference; int gridless; - Coord q; + pcb_coord_t q; int changed = 0; if (argc < 1 || argc > 4) { @@ -413,7 +413,7 @@ /* move all selected elements to the new coordinate */ ELEMENT_LOOP(PCB->Data); { - Coord p, dp, dx, dy; + pcb_coord_t p, dp, dx, dy; if (!TEST_FLAG(PCB_FLAG_SELECTED, element)) continue; @@ -462,13 +462,13 @@ * Distributed elements always retain the same relative order they had * before they were distributed. \n */ -static int distribute(int argc, const char **argv, Coord x, Coord y) +static int distribute(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int dir; int point; int refa, refb; int gridless; - Coord s, e, slack; + pcb_coord_t s, e, slack; int divisor; int changed = 0; int i; @@ -559,7 +559,7 @@ /* even the gaps instead of the edges or whatnot */ /* find the "slack" in the row */ if (point == K_Gaps) { - Coord w; + pcb_coord_t w; /* subtract all the "widths" from the slack */ for (i = 0; i < nelements_by_pos; ++i) { @@ -578,7 +578,7 @@ /* move all selected elements to the new coordinate */ for (i = 0; i < nelements_by_pos; ++i) { pcb_element_t *element = elements_by_pos[i].element; - Coord p, q, dp, dx, dy; + pcb_coord_t p, q, dp, dx, dy; /* find reference point for this element */ q = s + slack * i / divisor; Index: trunk/src_plugins/distaligntext/distaligntext.c =================================================================== --- trunk/src_plugins/distaligntext/distaligntext.c (revision 4810) +++ trunk/src_plugins/distaligntext/distaligntext.c (revision 4811) @@ -99,7 +99,7 @@ /* this macro produces a function in X or Y that switches on 'point' */ #define COORD(DIR) \ -static inline Coord \ +static inline pcb_coord_t \ coord ## DIR(pcb_text_t *text, int point) \ { \ switch (point) { \ @@ -123,7 +123,7 @@ /*! * Return the text coordinate associated with the given internal point. */ - static Coord coord(pcb_text_t * text, int dir, int point) + static pcb_coord_t coord(pcb_text_t * text, int dir, int point) { if (dir == K_X) return coordX(text, point); @@ -133,8 +133,8 @@ static struct text_by_pos { pcb_text_t *text; - Coord pos; - Coord width; + pcb_coord_t pos; + pcb_coord_t width; int type; } *texts_by_pos; @@ -226,9 +226,9 @@ * Find the reference coordinate from the specified points of all * selected text. */ -static Coord reference_coord(int op, int x, int y, int dir, int point, int reference) +static pcb_coord_t reference_coord(int op, int x, int y, int dir, int point, int reference) { - Coord q; + pcb_coord_t q; int i, nsel; q = 0; @@ -282,14 +282,14 @@ * * Defaults are Lefts/Tops, First */ -static int aligntext(int argc, const char **argv, Coord x, Coord y) +static int aligntext(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int dir; int point; int reference; int gridless; - Coord q; - Coord p, dp, dx, dy; + pcb_coord_t q; + pcb_coord_t p, dp, dx, dy; int changed = 0; if (argc < 1 || argc > 4) { @@ -440,13 +440,13 @@ * Distributed texts always retain the same relative order they had * before they were distributed. \n */ -static int distributetext(int argc, const char **argv, Coord x, Coord y) +static int distributetext(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int dir; int point; int refa, refb; int gridless; - Coord s, e, slack; + pcb_coord_t s, e, slack; int divisor; int changed = 0; int i; @@ -542,7 +542,7 @@ /* even the gaps instead of the edges or whatnot */ /* find the "slack" in the row */ if (point == K_Gaps) { - Coord w; + pcb_coord_t w; /* subtract all the "widths" from the slack */ for (i = 0; i < ntexts_by_pos; ++i) { @@ -563,7 +563,7 @@ for (i = 0; i < ntexts_by_pos; ++i) { pcb_text_t *text = texts_by_pos[i].text; int type = texts_by_pos[i].type; - Coord p, q, dp, dx, dy; + pcb_coord_t p, q, dp, dx, dy; /* find reference point for this text */ q = s + slack * i / divisor; Index: trunk/src_plugins/djopt/djopt.c =================================================================== --- trunk/src_plugins/djopt/djopt.c (revision 4810) +++ trunk/src_plugins/djopt/djopt.c (revision 4811) @@ -238,7 +238,7 @@ #define SWAP(a,b) { a^=b; b^=a; a^=b; } -static int gridsnap(Coord n) +static int gridsnap(pcb_coord_t n) { if (n <= 0) return 0; @@ -2546,7 +2546,7 @@ %end-doc */ -static int ActionDJopt(int argc, const char **argv, Coord x, Coord y) +static int ActionDJopt(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *arg = argc > 0 ? argv[0] : NULL; int layn, saved = 0; Index: trunk/src_plugins/djopt/djopt.h =================================================================== --- trunk/src_plugins/djopt/djopt.h (revision 4810) +++ trunk/src_plugins/djopt/djopt.h (revision 4811) @@ -29,6 +29,6 @@ #include "config.h" -int ActionDJopt(int, char **, Coord, Coord); -int djopt_set_auto_only(int, char **, Coord, Coord); +int ActionDJopt(int, char **, pcb_coord_t, pcb_coord_t); +int djopt_set_auto_only(int, char **, pcb_coord_t, pcb_coord_t); #endif Index: trunk/src_plugins/export_bboard/bboard.c =================================================================== --- trunk/src_plugins/export_bboard/bboard.c (revision 4810) +++ trunk/src_plugins/export_bboard/bboard.c (revision 4811) @@ -149,7 +149,7 @@ static const char *bboard_filename = 0; static const char *bboard_bgcolor = 0; -Coord bboard_scale_coord(Coord x) +pcb_coord_t bboard_scale_coord(pcb_coord_t x) { return ((x * DPI_SCALE / 254 / 10000) + 0) / 10; } @@ -244,7 +244,7 @@ } -static void bboard_draw_line_cairo(Coord x1, Coord y1, Coord x2, Coord y2, Coord thickness) +static void bboard_draw_line_cairo(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t thickness) { ASSERT_CAIRO; @@ -259,8 +259,8 @@ #warning TODO: remove x1;y1;x2;y2 static void -bboard_draw_arc_cairo(/*Coord x1, Coord y1, Coord x2, Coord y2,*/ Coord x, - Coord y, Coord w, Coord h, pcb_angle_t sa, pcb_angle_t a, Coord thickness) +bboard_draw_arc_cairo(/*pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2,*/ pcb_coord_t x, + pcb_coord_t y, pcb_coord_t w, pcb_coord_t h, pcb_angle_t sa, pcb_angle_t a, pcb_coord_t thickness) { ASSERT_CAIRO; @@ -281,7 +281,7 @@ cairo_stroke(bboard_cairo_ctx); } -static pcb_bool bboard_init_board_cairo(Coord x1, Coord y1, const char *color, int antialias) +static pcb_bool bboard_init_board_cairo(pcb_coord_t x1, pcb_coord_t y1, const char *color, int antialias) { unsigned int r, g, b; float tr = 1.; /* background transparency */ @@ -355,9 +355,9 @@ } -static int bboard_parse_offset(char *s, Coord * ox, Coord * oy) +static int bboard_parse_offset(char *s, pcb_coord_t * ox, pcb_coord_t * oy) { - Coord xx = 0, yy = 0; + pcb_coord_t xx = 0, yy = 0; int n = 0, ln = 0; char val[32]; @@ -388,8 +388,8 @@ static void bboard_export_element_cairo(pcb_element_t * element, pcb_bool onsolder) { cairo_surface_t *sfc; - Coord ex, ey; - Coord ox = 0, oy = 0; + pcb_coord_t ex, ey; + pcb_coord_t ox = 0, oy = 0; int w, h; pcb_angle_t tmp_angle = 0.0; char *model_angle, *s = 0, *s1, *s2, *fname = NULL; Index: trunk/src_plugins/export_dsn/dsn.c =================================================================== --- trunk/src_plugins/export_dsn/dsn.c (revision 4810) +++ trunk/src_plugins/export_dsn/dsn.c (revision 4811) @@ -65,10 +65,10 @@ static const char *dsn_cookie = "dsn exporter"; -static Coord trackwidth = 8; /* user options defined in export dialog */ -static Coord clearance = 8; -static Coord viawidth = 45; -static Coord viadrill = 25; +static pcb_coord_t trackwidth = 8; /* user options defined in export dialog */ +static pcb_coord_t clearance = 8; +static pcb_coord_t viawidth = 45; +static pcb_coord_t viadrill = 25; static pcb_hid_t dsn_hid; @@ -292,9 +292,9 @@ /* loop thru pins and pads to add to image */ PIN_LOOP(element); { - Coord ty; - Coord pinthickness; - Coord lx, ly; /* hold local pin coordinates */ + pcb_coord_t ty; + pcb_coord_t pinthickness; + pcb_coord_t lx, ly; /* hold local pin coordinates */ ty = PCB->MaxHeight - pin->Y; pinthickness = pin->Thickness; if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) @@ -323,8 +323,8 @@ PAD_LOOP(element); { - Coord xlen, ylen, xc, yc, p1y, p2y; - Coord lx, ly; /* store local coordinates for pins */ + pcb_coord_t xlen, ylen, xc, yc, p1y, p2y; + pcb_coord_t lx, ly; /* store local coordinates for pins */ p1y = PCB->MaxHeight - pad->Point1.Y; p2y = PCB->MaxHeight - pad->Point2.Y; /* pad dimensions are unusual- @@ -379,7 +379,7 @@ /* loop thru padstacks and define them all */ for (iter = pads; iter; iter = g_list_next(iter)) { - Coord dim1, dim2; + pcb_coord_t dim1, dim2; padstack = iter->data; fprintf(fp, " (padstack %s\n", padstack); Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 4810) +++ trunk/src_plugins/export_gcode/gcode.c (revision 4811) @@ -617,7 +617,7 @@ gc->cap = style; } -static void gcode_set_line_width(pcb_hid_gc_t gc, Coord width) +static void gcode_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { gc->width = width; } @@ -734,7 +734,7 @@ } } -static void gcode_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void gcode_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { use_gc(gc); gdImageRectangle(gcode_im, @@ -744,7 +744,7 @@ /* printf("Rect %d %d %d %d\n",x1,y1,x2,y2); */ } -static void gcode_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void gcode_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { use_gc(gc); gdImageSetThickness(gcode_im, 0); @@ -756,10 +756,10 @@ /* printf("FillRect %d %d %d %d\n",x1,y1,x2,y2); */ } -static void gcode_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void gcode_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { if (x1 == x2 && y1 == y2) { - Coord w = gc->width / 2; + pcb_coord_t w = gc->width / 2; gcode_fill_rect(gc, x1 - w, y1 - w, x1 + w, y1 + w); return; } @@ -770,7 +770,7 @@ gdImageLine(gcode_im, pcb_to_gcode(x1), pcb_to_gcode(y1), pcb_to_gcode(x2), pcb_to_gcode(y2), gdBrushed); } -static void gcode_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord width, Coord height, pcb_angle_t start_angle, pcb_angle_t delta_angle) +static void gcode_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle) { pcb_angle_t sa, ea; @@ -809,7 +809,7 @@ pcb_to_gcode(2 * height + gcode_toolradius * 2), sa, ea, gdBrushed); } -static void gcode_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +static void gcode_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { use_gc(gc); @@ -830,7 +830,7 @@ } } -static void gcode_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y) +static void gcode_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { int i; gdPoint *points; Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 4810) +++ trunk/src_plugins/export_gerber/gerber.c (revision 4811) @@ -47,16 +47,16 @@ static void gerber_use_mask(int use_it); static void gerber_set_color(pcb_hid_gc_t gc, const char *name); static void gerber_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style); -static void gerber_set_line_width(pcb_hid_gc_t gc, Coord width); +static void gerber_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width); static void gerber_set_draw_xor(pcb_hid_gc_t gc, int _xor); -static void gerber_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2); -static void gerber_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord width, Coord height, pcb_angle_t start_angle, pcb_angle_t delta_angle); -static void gerber_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2); -static void gerber_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius); -static void gerber_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2); +static void gerber_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); +static void gerber_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle); +static void gerber_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); +static void gerber_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius); +static void gerber_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); static void gerber_calibrate(double xval, double yval); static void gerber_set_crosshair(int x, int y, int action); -static void gerber_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y); +static void gerber_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y); /*----------------------------------------------------------------------------*/ /* Utility routines */ @@ -63,14 +63,14 @@ /*----------------------------------------------------------------------------*/ /* These are for films */ -#define gerberX(pcb, x) ((Coord) (x)) -#define gerberY(pcb, y) ((Coord) ((pcb)->MaxHeight - (y))) -#define gerberXOffset(pcb, x) ((Coord) (x)) -#define gerberYOffset(pcb, y) ((Coord) (-(y))) +#define gerberX(pcb, x) ((pcb_coord_t) (x)) +#define gerberY(pcb, y) ((pcb_coord_t) ((pcb)->MaxHeight - (y))) +#define gerberXOffset(pcb, x) ((pcb_coord_t) (x)) +#define gerberYOffset(pcb, y) ((pcb_coord_t) (-(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) ((pcb_coord_t) (x) * 10) +#define gerberDrY(pcb, y) ((pcb_coord_t) ((pcb)->MaxHeight - (y)) * 10) /*----------------------------------------------------------------------------*/ /* Private data structures */ @@ -102,7 +102,7 @@ typedef struct aperture { int dCode; /* The RS-274X D code */ - Coord width; /* Size in pcb units */ + pcb_coord_t width; /* Size in pcb units */ ApertureShape shape; /* ROUND/SQUARE etc */ struct aperture *next; } Aperture; @@ -118,9 +118,9 @@ static int layer_list_idx; typedef struct { - Coord diam; - Coord x; - Coord y; + pcb_coord_t diam; + pcb_coord_t x; + pcb_coord_t y; } PendingDrills; PendingDrills *pending_drills = NULL; int n_pending_drills = 0, max_pending_drills = 0; @@ -166,7 +166,7 @@ } /* Create and add a new aperture to the list */ -static Aperture *addAperture(ApertureList * list, Coord width, ApertureShape shape) +static Aperture *addAperture(ApertureList * list, pcb_coord_t width, ApertureShape shape) { static int aperture_count; @@ -187,7 +187,7 @@ /* Fetch an aperture from the list with the specified * width/shape, creating a new one if none exists */ -static Aperture *findAperture(ApertureList * list, Coord width, ApertureShape shape) +static Aperture *findAperture(ApertureList * list, pcb_coord_t width, ApertureShape shape) { Aperture *search; @@ -216,7 +216,7 @@ break; case OCTAGON: pcb_fprintf(f, "%%AMOCT%d*5,0,8,0,0,%.4mi,22.5*%%\r\n" - "%%ADD%dOCT%d*%%\r\n", aptr->dCode, (Coord) ((double) aptr->width / PCB_COS_22_5_DEGREE), aptr->dCode, aptr->dCode); + "%%ADD%dOCT%d*%%\r\n", aptr->dCode, (pcb_coord_t) ((double) aptr->width / PCB_COS_22_5_DEGREE), aptr->dCode, aptr->dCode); break; #if 0 case THERMAL: @@ -834,7 +834,7 @@ gc->cap = style; } -static void gerber_set_line_width(pcb_hid_gc_t gc, Coord width) +static void gerber_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { gc->width = width; } @@ -902,7 +902,7 @@ #endif } -static void gerber_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void gerber_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { gerber_draw_line(gc, x1, y1, x1, y2); gerber_draw_line(gc, x1, y1, x2, y1); @@ -910,12 +910,12 @@ gerber_draw_line(gc, x2, y1, x2, y2); } -static void gerber_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void gerber_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { pcb_bool m = pcb_false; if (x1 != x2 && y1 != y2 && gc->cap == Square_Cap) { - Coord x[5], y[5]; + pcb_coord_t x[5], y[5]; double tx, ty, theta; theta = atan2(y2 - y1, x2 - x1); @@ -973,7 +973,7 @@ } -static void gerber_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord width, Coord height, pcb_angle_t start_angle, pcb_angle_t delta_angle) +static void gerber_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle) { pcb_bool m = pcb_false; double arcStartX, arcStopX, arcStartY, arcStopY; @@ -996,10 +996,10 @@ segments. Note that most arcs in pcb are circles anyway. */ if (width != height) { double step, angle; - Coord max = width > height ? width : height; - Coord minr = max - gc->width / 10; + pcb_coord_t max = width > height ? width : height; + pcb_coord_t minr = max - gc->width / 10; int nsteps; - Coord x0, y0, x1, y1; + pcb_coord_t x0, y0, x1, y1; if (minr >= max) minr = max - 1; @@ -1047,7 +1047,7 @@ lastY = arcStopY; } -static void gerber_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +static void gerber_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { if (radius <= 0) return; @@ -1080,12 +1080,12 @@ fprintf(f, "D03*\r\n"); } -static void gerber_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y) +static void gerber_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { pcb_bool m = pcb_false; int i; int firstTime = 1; - Coord startX = 0, startY = 0; + pcb_coord_t startX = 0, startY = 0; if (is_mask && current_mask == HID_MASK_BEFORE) return; @@ -1131,10 +1131,10 @@ fprintf(f, "G37*\r\n"); } -static void gerber_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void gerber_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { - Coord x[5]; - Coord y[5]; + pcb_coord_t x[5]; + pcb_coord_t y[5]; x[0] = x[4] = x1; y[0] = y[4] = y1; x[1] = x1; Index: trunk/src_plugins/export_nelma/nelma.c =================================================================== --- trunk/src_plugins/export_nelma/nelma.c (revision 4810) +++ trunk/src_plugins/export_nelma/nelma.c (revision 4811) @@ -97,7 +97,7 @@ struct hid_gc_s { pcb_hid_t *me_pointer; pcb_cap_style_t cap; - Coord width; + pcb_coord_t width; unsigned char r, g, b; int erase; int faded; @@ -108,7 +108,7 @@ static pcb_hid_t nelma_hid; static struct color_struct *black = NULL, *white = NULL; -static Coord linewidth = -1; +static pcb_coord_t linewidth = -1; static gdImagePtr lastbrush = (gdImagePtr) ((void *) -1); static int lastcolor = -1; @@ -216,7 +216,7 @@ /* *** Utility funcions **************************************************** */ /* convert from default PCB units to nelma units */ - static int pcb_to_nelma(Coord pcb) + static int pcb_to_nelma(pcb_coord_t pcb) { return PCB_COORD_TO_INCH(pcb) * nelma_dpi; } @@ -416,7 +416,7 @@ static void nelma_write_object(FILE * out, pcb_lib_entry_t *pin) { int i, idx; - Coord px = 0, py = 0; + pcb_coord_t px = 0, py = 0; int x, y; char *f; @@ -748,7 +748,7 @@ gc->cap = style; } -static void nelma_set_line_width(pcb_hid_gc_t gc, Coord width) +static void nelma_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { gc->width = width; } @@ -865,13 +865,13 @@ } } -static void nelma_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void nelma_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { use_gc(gc); gdImageRectangle(nelma_im, pcb_to_nelma(x1), pcb_to_nelma(y1), pcb_to_nelma(x2), pcb_to_nelma(y2), gc->color->c); } -static void nelma_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void nelma_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { use_gc(gc); gdImageSetThickness(nelma_im, 0); @@ -879,10 +879,10 @@ gdImageFilledRectangle(nelma_im, pcb_to_nelma(x1), pcb_to_nelma(y1), pcb_to_nelma(x2), pcb_to_nelma(y2), gc->color->c); } -static void nelma_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void nelma_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { if (x1 == x2 && y1 == y2) { - Coord w = gc->width / 2; + pcb_coord_t w = gc->width / 2; nelma_fill_rect(gc, x1 - w, y1 - w, x1 + w, y1 + w); return; } @@ -893,7 +893,7 @@ gdImageLine(nelma_im, pcb_to_nelma(x1), pcb_to_nelma(y1), pcb_to_nelma(x2), pcb_to_nelma(y2), gdBrushed); } -static void nelma_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord width, Coord height, pcb_angle_t start_angle, pcb_angle_t delta_angle) +static void nelma_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle) { pcb_angle_t sa, ea; @@ -931,7 +931,7 @@ pcb_to_nelma(2 * width), pcb_to_nelma(2 * height), sa, ea, gdBrushed); } -static void nelma_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +static void nelma_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { use_gc(gc); @@ -942,7 +942,7 @@ } -static void nelma_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y) +static void nelma_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { int i; gdPoint *points; Index: trunk/src_plugins/export_openscad/scad.c =================================================================== --- trunk/src_plugins/export_openscad/scad.c (revision 4810) +++ trunk/src_plugins/export_openscad/scad.c (revision 4811) @@ -289,7 +289,7 @@ static int opt_outline_type; static int opt_copper_color; static int opt_mask_color; -static Coord opt_minimal_drill; +static pcb_coord_t opt_minimal_drill; static int opt_board_cut; static int lastseq = 0; @@ -300,8 +300,8 @@ static int n_alloc_outline_segments, n_outline_segments; static t_outline_segment *outline_segments; -static void scad_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y); -static void scad_emit_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y, float thickness); +static void scad_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y); +static void scad_emit_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y, float thickness); /* scaling function - all output is in milimeters */ @@ -365,7 +365,7 @@ n_outline_segments = 0; } -static void add_outline_segment(Coord x1, Coord y1, Coord x2, Coord y2) +static void add_outline_segment(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { if (!n_alloc_outline_segments) { outline_segments = (t_outline_segment *) malloc(sizeof(t_outline_segment) * 50); @@ -401,12 +401,12 @@ typedef struct { - Coord x; - Coord y; + pcb_coord_t x; + pcb_coord_t y; int marker; } t_OutlinePoint; -static int is_same_point(Coord x1, Coord y1, Coord x2, Coord y2) +static int is_same_point(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { return (abs(x1 - x2) < SCAD_MIN_OUTLINE_DIST) && (abs(y1 - y2) < SCAD_MIN_OUTLINE_DIST); @@ -892,7 +892,7 @@ gc->cap = style; } -static void scad_set_line_width(pcb_hid_gc_t gc, Coord width) +static void scad_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { gc->width = width; } @@ -902,10 +902,10 @@ } -static void scad_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void scad_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { - Coord x[5]; - Coord y[5]; + pcb_coord_t x[5]; + pcb_coord_t y[5]; x[0] = x[4] = x1; y[0] = y[4] = y1; x[1] = x1; @@ -924,7 +924,7 @@ * -- on polyline segment cap is drawn only on beginning */ -static void scad_emit_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2, int mode) +static void scad_emit_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, int mode) { int zero_length; float angle = 0., length = 0.; @@ -978,7 +978,7 @@ } -static void scad_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void scad_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { if (drill_layer) return; @@ -987,7 +987,7 @@ } -static void scad_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord width, Coord height, pcb_angle_t start_angle, pcb_angle_t delta_angle) +static void scad_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle) { int i, n_steps, x, y, ox = 0, oy = 0, sa; float angle; @@ -1024,7 +1024,7 @@ * - as plated or unplated drills it creates vector of holes * - otherwise it is drawn as simple */ -static void scad_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +static void scad_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { /* int i; */ if (outline_layer) @@ -1058,7 +1058,7 @@ * Helper function - creates extruded polygon */ -static void scad_emit_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y, float thickness) +static void scad_emit_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y, float thickness) { int i, n; /* int cw, cx; */ @@ -1091,7 +1091,7 @@ } -static void scad_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y) +static void scad_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { if (outline_layer) return; @@ -1099,10 +1099,10 @@ scad_emit_polygon(gc, n_coords, x, y, scaled_layer_thickness); } -static void scad_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void scad_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { - Coord x[5]; - Coord y[5]; + pcb_coord_t x[5]; + pcb_coord_t y[5]; if (scad_output) fprintf(scad_output, "// Fill rect\n"); Index: trunk/src_plugins/export_openscad/scad.h =================================================================== --- trunk/src_plugins/export_openscad/scad.h (revision 4810) +++ trunk/src_plugins/export_openscad/scad.h (revision 4811) @@ -120,7 +120,7 @@ typedef struct { int processed; - Coord x1, y1, x2, y2; + pcb_coord_t x1, y1, x2, y2; } t_outline_segment; extern FILE *scad_output; Index: trunk/src_plugins/export_openscad/scadcomp.c =================================================================== --- trunk/src_plugins/export_openscad/scadcomp.c (revision 4810) +++ trunk/src_plugins/export_openscad/scadcomp.c (revision 4811) @@ -233,9 +233,9 @@ } -static int scad_parse_coord_triplet(char *s, Coord * ox, Coord * oy, Coord * oz) +static int scad_parse_coord_triplet(char *s, pcb_coord_t * ox, pcb_coord_t * oy, pcb_coord_t * oz) { - Coord xx = 0, yy = 0, zz = 0; + pcb_coord_t xx = 0, yy = 0, zz = 0; int n = 0, ln = 0; char val[32]; @@ -289,7 +289,7 @@ { char *model_rotation, *model_translate, *model_scale, *model_angle; pcb_angle_t tmp_angle = (pcb_angle_t) 0; - Coord tx, ty, tz; + pcb_coord_t tx, ty, tz; float fx, fy, fz; int x = element->MarkX, y = element->MarkY; Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 4810) +++ trunk/src_plugins/export_png/png.c (revision 4811) @@ -68,8 +68,8 @@ static double bloat = 0; static double scale = 1; -static Coord x_shift = 0; -static Coord y_shift = 0; +static pcb_coord_t x_shift = 0; +static pcb_coord_t y_shift = 0; static int show_solder_side; #define SCALE(w) ((int)((w)/scale + 0.5)) #define SCALE_X(x) ((int)(((x) - x_shift)/scale)) @@ -81,7 +81,7 @@ #define NOT_EDGE_Y(y) ((y) != 0 && (y) != PCB->MaxHeight) #define NOT_EDGE(x,y) (NOT_EDGE_X(x) || NOT_EDGE_Y(y)) -static void png_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius); +static void png_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius); /* The result of a failed gdImageColorAllocate() call */ #define BADC -1 @@ -1173,7 +1173,7 @@ gc->cap = style; } -static void png_set_line_width(pcb_hid_gc_t gc, Coord width) +static void png_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { gc->width = width; } @@ -1281,13 +1281,13 @@ } } -static void png_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void png_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { use_gc(gc); gdImageRectangle(im, SCALE_X(x1), SCALE_Y(y1), SCALE_X(x2), SCALE_Y(y2), gc->color->c); } -static void png_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void png_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { use_gc(gc); gdImageSetThickness(im, 0); @@ -1294,12 +1294,12 @@ linewidth = 0; if (x1 > x2) { - Coord t = x1; + pcb_coord_t t = x1; x2 = x2; x2 = t; } if (y1 > y2) { - Coord t = y1; + pcb_coord_t t = y1; y2 = y2; y2 = t; } @@ -1311,10 +1311,10 @@ have_outline |= doing_outline; } -static void png_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void png_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { if (x1 == x2 && y1 == y2) { - Coord w = gc->width / 2; + pcb_coord_t w = gc->width / 2; if (gc->cap != Square_Cap) png_fill_circle(gc, x1, y1, w); else @@ -1370,7 +1370,7 @@ } } -static void png_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord width, Coord height, pcb_angle_t start_angle, pcb_angle_t delta_angle) +static void png_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle) { pcb_angle_t sa, ea; @@ -1379,8 +1379,8 @@ * nothing at all or a full circle when passed delta angle of 0 or 360. */ if (delta_angle == 0) { - Coord x = (width * cos(start_angle * M_PI / 180)); - Coord y = (width * sin(start_angle * M_PI / 180)); + pcb_coord_t x = (width * cos(start_angle * M_PI / 180)); + pcb_coord_t y = (width * sin(start_angle * M_PI / 180)); x = cx - x; y = cy + y; png_fill_circle(gc, x, y, gc->width / 2); @@ -1426,9 +1426,9 @@ gdImageArc(im, SCALE_X(cx), SCALE_Y(cy), SCALE(2 * width), SCALE(2 * height), sa, ea, gdBrushed); } -static void png_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +static void png_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { - Coord my_bloat; + pcb_coord_t my_bloat; use_gc(gc); @@ -1446,7 +1446,7 @@ } -static void png_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y) +static void png_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { int i; gdPoint *points; Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 4810) +++ trunk/src_plugins/export_ps/eps.c (revision 4811) @@ -37,14 +37,14 @@ static void eps_use_mask(int use_it); static void eps_set_color(pcb_hid_gc_t gc, const char *name); static void eps_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style); -static void eps_set_line_width(pcb_hid_gc_t gc, Coord width); +static void eps_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width); static void eps_set_draw_xor(pcb_hid_gc_t gc, int _xor); -static void eps_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2); -static void eps_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2); -static void eps_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord width, Coord height, pcb_angle_t start_angle, pcb_angle_t delta_angle); -static void eps_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2); -static void eps_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius); -static void eps_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y); +static void eps_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); +static void eps_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); +static void eps_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle); +static void eps_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); +static void eps_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius); +static void eps_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y); static void eps_calibrate(double xval, double yval); static void eps_set_crosshair(int x, int y, int action); /*----------------------------------------------------------------------------*/ @@ -51,7 +51,7 @@ typedef struct hid_gc_s { pcb_cap_style_t cap; - Coord width; + pcb_coord_t width; int color; int erase; } hid_gc_s; @@ -59,7 +59,7 @@ static pcb_hid_t eps_hid; static FILE *f = 0; -static Coord linewidth = -1; +static pcb_coord_t linewidth = -1; static int lastcap = -1; static int lastcolor = -1; static int print_group[MAX_LAYER]; @@ -276,7 +276,7 @@ linewidth = -1; lastcap = -1; lastcolor = -1; -#define Q (Coord) PCB_MIL_TO_COORD(10) +#define Q (pcb_coord_t) PCB_MIL_TO_COORD(10) pcb_fprintf(f, "/nclip { %mi %mi moveto %mi %mi lineto %mi %mi lineto %mi %mi lineto %mi %mi lineto eoclip newpath } def\n", bounds->X1 - Q, bounds->Y1 - Q, bounds->X1 - Q, bounds->Y2 + Q, @@ -463,7 +463,7 @@ gc->cap = style; } -static void eps_set_line_width(pcb_hid_gc_t gc, Coord width) +static void eps_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { gc->width = width; } @@ -502,18 +502,18 @@ } } -static void eps_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2); -static void eps_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius); +static void eps_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); +static void eps_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius); -static void eps_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void eps_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { use_gc(gc); pcb_fprintf(f, "%mi %mi %mi %mi r\n", x1, y1, x2, y2); } -static void eps_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void eps_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { - Coord w = gc->width / 2; + pcb_coord_t w = gc->width / 2; if (x1 == x2 && y1 == y2) { if (gc->cap == Square_Cap) eps_fill_rect(gc, x1 - w, y1 - w, x1 + w, y1 + w); @@ -527,8 +527,8 @@ double dx = w * sin(ang); double dy = -w * cos(ang); double deg = ang * 180.0 / M_PI; - Coord vx1 = x1 + dx; - Coord vy1 = y1 + dy; + pcb_coord_t vx1 = x1 + dx; + pcb_coord_t vy1 = y1 + dy; pcb_fprintf(f, "%mi %mi moveto ", vx1, vy1); pcb_fprintf(f, "%mi %mi %mi %g %g arc\n", x2, y2, w, deg - 90, deg + 90); @@ -540,7 +540,7 @@ pcb_fprintf(f, "%mi %mi %mi %mi %s\n", x1, y1, x2, y2, gc->erase ? "tc" : "t"); } -static void eps_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord width, Coord height, pcb_angle_t start_angle, pcb_angle_t delta_angle) +static void eps_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle) { pcb_angle_t sa, ea; if (delta_angle > 0) { @@ -558,13 +558,13 @@ pcb_fprintf(f, "%ma %ma %mi %mi %mi %mi %g a\n", sa, ea, -width, height, cx, cy, (double) linewidth / width); } -static void eps_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +static void eps_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { use_gc(gc); pcb_fprintf(f, "%mi %mi %mi %s\n", cx, cy, radius, gc->erase ? "cc" : "c"); } -static void eps_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y) +static void eps_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { int i; const char *op = "moveto"; @@ -576,7 +576,7 @@ fprintf(f, "fill\n"); } -static void eps_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void eps_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { use_gc(gc); pcb_fprintf(f, "%mi %mi %mi %mi r\n", x1, y1, x2, y2); Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 4810) +++ trunk/src_plugins/export_ps/ps.c (revision 4811) @@ -42,7 +42,7 @@ typedef struct hid_gc_s { pcb_hid_t *me_pointer; pcb_cap_style_t cap; - Coord width; + pcb_coord_t width; unsigned char r, g, b; int erase; int faded; @@ -63,8 +63,8 @@ typedef struct { const char *name; - Coord Width, Height; - Coord MarginX, MarginY; + pcb_coord_t Width, Height; + pcb_coord_t MarginX, MarginY; } MediaType, *MediaTypePtr; /* @@ -378,12 +378,12 @@ FILE *f; int pagecount; - Coord linewidth; + pcb_coord_t linewidth; pcb_bool print_group[MAX_LAYER]; pcb_bool print_layer[MAX_LAYER]; double fade_ratio; pcb_bool multi_file; - Coord media_width, media_height, ps_width, ps_height; + pcb_coord_t media_width, media_height, ps_width, ps_height; const char *filename; pcb_bool drill_helper; @@ -394,7 +394,7 @@ pcb_bool automirror; pcb_bool incolor; pcb_bool doing_toc; - Coord bloat; + pcb_coord_t bloat; pcb_bool invert; int media_idx; pcb_bool drillcopper; @@ -748,11 +748,11 @@ hid_parse_command_line(argc, argv); } -static void corner(FILE * fh, Coord x, Coord y, Coord dx, Coord dy) +static void corner(FILE * fh, pcb_coord_t x, pcb_coord_t y, pcb_coord_t dx, pcb_coord_t dy) { - Coord len = PCB_MIL_TO_COORD(2000); - Coord len2 = PCB_MIL_TO_COORD(200); - Coord thick = 0; + pcb_coord_t len = PCB_MIL_TO_COORD(2000); + pcb_coord_t len2 = PCB_MIL_TO_COORD(200); + pcb_coord_t thick = 0; /* * Originally 'thick' used thicker lines. Currently is uses * Postscript's "device thin" line - i.e. zero width means one @@ -898,8 +898,8 @@ * If users don't want to make smaller boards, or use fewer drill * sizes, they can always ignore this sheet. */ if (SL_TYPE(idx) == SL_FAB) { - Coord natural = boffset - PCB_MIL_TO_COORD(500) - PCB->MaxHeight / 2; - Coord needed = stub_DrawFab_overhang(); + pcb_coord_t natural = boffset - PCB_MIL_TO_COORD(500) - PCB->MaxHeight / 2; + pcb_coord_t needed = stub_DrawFab_overhang(); pcb_fprintf(global.f, "%% PrintFab overhang natural %mi, needed %mi\n", natural, needed); if (needed > natural) pcb_fprintf(global.f, "0 %mi translate\n", needed - natural); @@ -944,7 +944,7 @@ if (global.drill_helper) pcb_fprintf(global.f, "/dh { gsave %mi setlinewidth 0 gray %mi 0 360 arc stroke grestore} bind def\n", - (Coord) MIN_PINORVIAHOLE, (Coord) (MIN_PINORVIAHOLE * 3 / 2)); + (pcb_coord_t) MIN_PINORVIAHOLE, (pcb_coord_t) (MIN_PINORVIAHOLE * 3 / 2)); } #if 0 /* Try to outsmart ps2pdf's heuristics for page rotation, by putting @@ -1010,7 +1010,7 @@ gc->cap = style; } -static void ps_set_line_width(pcb_hid_gc_t gc, Coord width) +static void ps_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { gc->width = width; } @@ -1082,16 +1082,16 @@ } } -static void ps_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void ps_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { use_gc(gc); pcb_fprintf(global.f, "%mi %mi %mi %mi dr\n", x1, y1, x2, y2); } -static void ps_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2); -static void ps_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius); +static void ps_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); +static void ps_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius); -static void ps_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void ps_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { #if 0 /* If you're etching your own paste mask, this will reduce the @@ -1098,7 +1098,7 @@ amount of brass you need to etch by drawing outlines for large pads. See also ps_fill_rect. */ if (is_paste && gc->width > 2500 && gc->cap == Square_Cap && (x1 == x2 || y1 == y2)) { - Coord t, w; + pcb_coord_t t, w; if (x1 > x2) { t = x1; x1 = x2; @@ -1115,7 +1115,7 @@ } #endif if (x1 == x2 && y1 == y2) { - Coord w = gc->width / 2; + pcb_coord_t w = gc->width / 2; if (gc->cap == Square_Cap) ps_fill_rect(gc, x1 - w, y1 - w, x1 + w, y1 + w); else @@ -1126,7 +1126,7 @@ pcb_fprintf(global.f, "%mi %mi %mi %mi t\n", x1, y1, x2, y2); } -static void ps_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord width, Coord height, pcb_angle_t start_angle, pcb_angle_t delta_angle) +static void ps_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle) { pcb_angle_t sa, ea; if (delta_angle > 0) { @@ -1145,7 +1145,7 @@ sa, ea, -width, height, cx, cy, (double) (global.linewidth + 2 * global.bloat) /(double) width); } -static void ps_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +static void ps_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { use_gc(gc); if (!gc->erase || !global.is_copper || global.drillcopper) { @@ -1155,7 +1155,7 @@ } } -static void ps_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y) +static void ps_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { int i; const char *op = "moveto"; @@ -1168,11 +1168,11 @@ } typedef struct { - Coord x1, y1, x2, y2; + pcb_coord_t x1, y1, x2, y2; } lseg_t; typedef struct { - Coord x, y; + pcb_coord_t x, y; } lpoint_t; #define minmax(val, min, max) \ @@ -1212,7 +1212,7 @@ int coord_comp(const void *c1_, const void *c2_) { - const Coord *c1 = c1_, *c2 = c2_; + const pcb_coord_t *c1 = c1_, *c2 = c2_; return *c1 < *c2; } @@ -1249,9 +1249,9 @@ while ((pl = pl->next) != NULL); if (POLYGRID > 0.1) { - Coord y, x, lx, ly, fx, fy, lsegs_xmin, lsegs_xmax, lsegs_ymin, lsegs_ymax; + pcb_coord_t y, x, lx, ly, fx, fy, lsegs_xmin, lsegs_xmax, lsegs_ymin, lsegs_ymax; lseg_t *lsegs = malloc(sizeof(lseg_t) * len); - Coord *lpoints = malloc(sizeof(Coord) * len); + pcb_coord_t *lpoints = malloc(sizeof(pcb_coord_t) * len); int lsegs_used = 0; lsegs_xmin = -1000000000; @@ -1307,7 +1307,7 @@ goto retry1; } if (pts > 1) { - qsort(lpoints, pts, sizeof(Coord), coord_comp); + qsort(lpoints, pts, sizeof(pcb_coord_t), coord_comp); for (n = 0; n < pts; n += 2) lseg_line(lpoints[n], y, lpoints[n + 1], y); } @@ -1336,7 +1336,7 @@ goto retry2; } if ((pts > 1)) { - qsort(lpoints, pts, sizeof(Coord), coord_comp); + qsort(lpoints, pts, sizeof(pcb_coord_t), coord_comp); for (n = 0; n < pts; n += 2) lseg_line(x, lpoints[n], x, lpoints[n + 1]); } @@ -1351,16 +1351,16 @@ fprintf(global.f, "fill\n"); } -static void ps_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void ps_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { use_gc(gc); if (x1 > x2) { - Coord t = x1; + pcb_coord_t t = x1; x1 = x2; x2 = t; } if (y1 > y2) { - Coord t = y1; + pcb_coord_t t = y1; y1 = y2; y2 = t; } @@ -1544,7 +1544,7 @@ { } -static int ActionPSCalib(int argc, const char **argv, Coord x, Coord y) +static int ActionPSCalib(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { ps_calibrate(0.0, 0.0); return 0; Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 4810) +++ trunk/src_plugins/export_svg/svg.c (revision 4811) @@ -105,7 +105,7 @@ const char *bright; const char *normal; const char *dark; - Coord offs; + pcb_coord_t offs; } photo_palette[] = { /* MASK */ { "#00ff00", "#00ff00", "#00ff00", PCB_MM_TO_COORD(0) }, /* SILK */ { "#ffffff", "#eeeeee", "#aaaaaa", PCB_MM_TO_COORD(0) }, @@ -272,7 +272,7 @@ const char *filename; int save_ons[MAX_LAYER + 2]; int i; - Coord w, h, x1, y1, x2, y2; + pcb_coord_t w, h, x1, y1, x2, y2; if (!options) { svg_get_export_options(0); @@ -439,7 +439,7 @@ gc->cap = style; } -static void svg_set_line_width(pcb_hid_gc_t gc, Coord width) +static void svg_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { gc->width = width; } @@ -470,17 +470,17 @@ #define fix_rect_coords() \ if (x1 > x2) {\ - Coord t = x1; \ + pcb_coord_t t = x1; \ x1 = x2; \ x2 = t; \ } \ if (y1 > y2) { \ - Coord t = y1; \ + pcb_coord_t t = y1; \ y1 = y2; \ y2 = t; \ } -static void draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord w, Coord h, Coord stroke) +static void draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t w, pcb_coord_t h, pcb_coord_t stroke) { indent(&snormal); pcb_append_printf(&snormal, "\n", @@ -487,16 +487,16 @@ x1, y1, w, h, stroke, gc->color, CAPS(gc->cap)); } -static void svg_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void svg_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { fix_rect_coords(); draw_rect(gc, x1, y1, x2-x1, y2-y1, gc->width); } -static void draw_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord w, Coord h) +static void draw_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t w, pcb_coord_t h) { if ((photo_mode) && (!gc->erase)) { - Coord photo_offs = photo_palette[photo_color].offs; + pcb_coord_t photo_offs = photo_palette[photo_color].offs; if (photo_offs != 0) { indent(&sdark); pcb_append_printf(&sdark, "\n", @@ -516,7 +516,7 @@ } } -static void svg_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void svg_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { TRX(x1); TRY(y1); TRX(x2); TRY(y2); fix_rect_coords(); @@ -523,10 +523,10 @@ draw_fill_rect(gc, x1, y1, x2-x1, y2-y1); } -static void draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { if ((photo_mode) && (!gc->erase)) { - Coord photo_offs = photo_palette[photo_color].offs; + pcb_coord_t photo_offs = photo_palette[photo_color].offs; if (photo_offs != 0) { indent(&sbright); pcb_append_printf(&sbright, "\n", @@ -546,16 +546,16 @@ } } -static void svg_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void svg_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { TRX(x1); TRY(y1); TRX(x2); TRY(y2); draw_line(gc, x1, y1, x2, y2); } -static void draw_arc(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord r, Coord x2, Coord y2, Coord stroke) +static void draw_arc(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t r, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t stroke) { if ((photo_mode) && (!gc->erase)) { - Coord photo_offs = photo_palette[photo_color].offs; + pcb_coord_t photo_offs = photo_palette[photo_color].offs; if (photo_offs != 0) { indent(&sbright); pcb_append_printf(&sbright, "\n", @@ -575,9 +575,9 @@ } } -static void svg_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord width, Coord height, pcb_angle_t start_angle, pcb_angle_t delta_angle) +static void svg_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle) { - Coord x1, y1, x2, y2; + pcb_coord_t x1, y1, x2, y2; pcb_angle_t sa, ea; TRX(cx); TRY(cy); @@ -607,11 +607,11 @@ draw_arc(gc, x1, y1, width, x2, y2, gc->width); } -static void draw_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord r, Coord stroke) +static void draw_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t r, pcb_coord_t stroke) { if ((photo_mode) && (!gc->erase)) { if (!drawing_hole) { - Coord photo_offs = photo_palette[photo_color].offs; + pcb_coord_t photo_offs = photo_palette[photo_color].offs; if ((!gc->drill) && (photo_offs != 0)) { indent(&sbright); pcb_append_printf(&sbright, "\n", @@ -638,13 +638,13 @@ } } -static void svg_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +static void svg_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { TRX(cx); TRY(cy); draw_fill_circle(gc, cx, cy, radius, gc->width); } -static void draw_poly(gds_t *s, pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y, Coord offs, const char *clr) +static void draw_poly(gds_t *s, pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y, pcb_coord_t offs, const char *clr) { int i; float poly_bloat = 0.075; @@ -652,7 +652,7 @@ indent(s); gds_append_str(s, "\n", poly_bloat, clr, clr); } -static void svg_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y) +static void svg_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { if ((photo_mode) && (!gc->erase)) { - Coord photo_offs = photo_palette[photo_color].offs; + pcb_coord_t photo_offs = photo_palette[photo_color].offs; if (photo_offs != 0) { draw_poly(&sbright, gc, n_coords, x, y, -photo_offs, photo_palette[photo_color].bright); draw_poly(&sdark, gc, n_coords, x, y, +photo_offs, photo_palette[photo_color].dark); Index: trunk/src_plugins/export_test/export_test.c =================================================================== --- trunk/src_plugins/export_test/export_test.c (revision 4810) +++ trunk/src_plugins/export_test/export_test.c (revision 4811) @@ -98,7 +98,7 @@ { #if 0 char utcTime[64]; - Coord x, y; + pcb_coord_t x, y; double theta = 0.0; double sumx, sumy; double pin1x = 0.0, pin1y = 0.0, pin1angle = 0.0; Index: trunk/src_plugins/export_xy/xy.c =================================================================== --- trunk/src_plugins/export_xy/xy.c (revision 4810) +++ trunk/src_plugins/export_xy/xy.c (revision 4811) @@ -140,7 +140,7 @@ static int PrintXY(void) { char utcTime[64]; - Coord x, y; + pcb_coord_t x, y; double theta = 0.0; double sumx, sumy; double pin1x = 0.0, pin1y = 0.0; Index: trunk/src_plugins/fontmode/fontmode.c =================================================================== --- trunk/src_plugins/fontmode/fontmode.c (revision 4810) +++ trunk/src_plugins/fontmode/fontmode.c (revision 4811) @@ -54,7 +54,7 @@ should search the grid for the gridlines and use them to figure out where the symbols are. */ -#define CELL_SIZE ((Coord)(PCB_MIL_TO_COORD (100))) +#define CELL_SIZE ((pcb_coord_t)(PCB_MIL_TO_COORD (100))) #define XYtoSym(x,y) (((x) / CELL_SIZE - 1) + (16 * ((y) / CELL_SIZE - 1))) @@ -66,7 +66,7 @@ %end-doc */ -static int FontEdit(int argc, const char **argv, Coord Ux, Coord Uy) +static int FontEdit(int argc, const char **argv, pcb_coord_t Ux, pcb_coord_t Uy) { pcb_font_t *font; pcb_symbol_t *symbol; @@ -108,9 +108,9 @@ font = &PCB->Font; for (s = 0; s <= MAX_FONTPOSITION; s++) { - Coord ox = (s % 16 + 1) * CELL_SIZE; - Coord oy = (s / 16 + 1) * CELL_SIZE; - Coord w, miny, maxy, maxx = 0; + pcb_coord_t ox = (s % 16 + 1) * CELL_SIZE; + pcb_coord_t oy = (s / 16 + 1) * CELL_SIZE; + pcb_coord_t w, miny, maxy, maxx = 0; symbol = &font->Symbol[s]; @@ -155,7 +155,7 @@ %end-doc */ -static int FontSave(int argc, const char **argv, Coord Ux, Coord Uy) +static int FontSave(int argc, const char **argv, pcb_coord_t Ux, pcb_coord_t Uy) { pcb_font_t *font; pcb_symbol_t *symbol; @@ -201,9 +201,9 @@ } linelist_foreach(&lwidth->Line, &it, l) { - Coord x1 = l->Point1.X; - Coord y1 = l->Point1.Y; - Coord ox, s; + pcb_coord_t x1 = l->Point1.X; + pcb_coord_t y1 = l->Point1.Y; + pcb_coord_t ox, s; s = XYtoSym(x1, y1); ox = (s % 16 + 1) * CELL_SIZE; Index: trunk/src_plugins/gl/hidgl.c =================================================================== --- trunk/src_plugins/gl/hidgl.c (revision 4810) +++ trunk/src_plugins/gl/hidgl.c (revision 4811) @@ -101,7 +101,7 @@ { static GLfloat *points = 0; static int npoints = 0; - Coord x1, y1, x2, y2, n, i; + pcb_coord_t x1, y1, x2, y2, n, i; double x, y; if (!Settings.DrawGrid) @@ -113,13 +113,13 @@ y2 = GridFit(MIN(PCB->MaxHeight, drawn_area->Y2), PCB->Grid, PCB->GridOffsetY); if (x1 > x2) { - Coord tmp = x1; + pcb_coord_t tmp = x1; x1 = x2; x2 = tmp; } if (y1 > y2) { - Coord tmp = y1; + pcb_coord_t tmp = y1; y1 = y2; y2 = tmp; } @@ -163,7 +163,7 @@ #define MIN_TRIANGLES_PER_CAP 3 #define MAX_TRIANGLES_PER_CAP 90 -static void draw_cap(Coord width, Coord x, Coord y, pcb_angle_t angle, double scale) +static void draw_cap(pcb_coord_t width, pcb_coord_t x, pcb_coord_t y, pcb_angle_t angle, double scale) { float last_capx, last_capy; float capx, capy; @@ -190,7 +190,7 @@ } } -void hidgl_draw_line(int cap, Coord width, Coord x1, Coord y1, Coord x2, Coord y2, double scale) +void hidgl_draw_line(int cap, pcb_coord_t width, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, double scale) { double angle; float deltax, deltay, length; @@ -259,7 +259,7 @@ #define MIN_SLICES_PER_ARC 6 #define MAX_SLICES_PER_ARC 360 -void hidgl_draw_arc(Coord width, Coord x, Coord y, Coord rx, Coord ry, pcb_angle_t start_angle, pcb_angle_t delta_angle, double scale) +void hidgl_draw_arc(pcb_coord_t width, pcb_coord_t x, pcb_coord_t y, pcb_coord_t rx, pcb_coord_t ry, pcb_angle_t start_angle, pcb_angle_t delta_angle, double scale) { float last_inner_x, last_inner_y; float last_outer_x, last_outer_y; @@ -334,7 +334,7 @@ y + rx * sinf(start_angle_rad + delta_angle_rad), start_angle + delta_angle + 180., scale); } -void hidgl_draw_rect(Coord x1, Coord y1, Coord x2, Coord y2) +void hidgl_draw_rect(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { glBegin(GL_LINE_LOOP); glVertex3f(x1, y1, global_depth); @@ -345,7 +345,7 @@ } -void hidgl_fill_circle(Coord vx, Coord vy, Coord vr, double scale) +void hidgl_fill_circle(pcb_coord_t vx, pcb_coord_t vy, pcb_coord_t vr, double scale) { #define MIN_TRIANGLES_PER_CIRCLE 6 #define MAX_TRIANGLES_PER_CIRCLE 360 @@ -477,7 +477,7 @@ printf("Vertex received with unknown type\n"); } -void hidgl_fill_polygon(int n_coords, Coord * x, Coord * y) +void hidgl_fill_polygon(int n_coords, pcb_coord_t * x, pcb_coord_t * y) { int i; GLUtesselator *tobj; @@ -643,7 +643,7 @@ free(info.vertices); } -void hidgl_fill_rect(Coord x1, Coord y1, Coord x2, Coord y2) +void hidgl_fill_rect(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { hidgl_ensure_triangle_space(&buffer, 2); hidgl_add_triangle(&buffer, x1, y1, x1, y2, x2, y2); Index: trunk/src_plugins/gl/hidgl.h =================================================================== --- trunk/src_plugins/gl/hidgl.h (revision 4810) +++ trunk/src_plugins/gl/hidgl.h (revision 4811) @@ -62,13 +62,13 @@ void hidgl_draw_grid(pcb_box_t * drawn_area); void hidgl_set_depth(float depth); -void hidgl_draw_line(int cap, Coord width, Coord x1, Coord y1, Coord x2, Coord y2, double scale); -void hidgl_draw_arc(Coord width, Coord vx, Coord vy, Coord vrx, Coord vry, pcb_angle_t start_angle, pcb_angle_t delta_angle, double scale); -void hidgl_draw_rect(Coord x1, Coord y1, Coord x2, Coord y2); -void hidgl_fill_circle(Coord vx, Coord vy, Coord vr, double scale); -void hidgl_fill_polygon(int n_coords, Coord * x, Coord * y); +void hidgl_draw_line(int cap, pcb_coord_t width, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, double scale); +void hidgl_draw_arc(pcb_coord_t width, pcb_coord_t vx, pcb_coord_t vy, pcb_coord_t vrx, pcb_coord_t vry, pcb_angle_t start_angle, pcb_angle_t delta_angle, double scale); +void hidgl_draw_rect(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); +void hidgl_fill_circle(pcb_coord_t vx, pcb_coord_t vy, pcb_coord_t vr, double scale); +void hidgl_fill_polygon(int n_coords, pcb_coord_t * x, pcb_coord_t * y); void hidgl_fill_pcb_polygon(pcb_polygon_t * poly, const pcb_box_t * clip_box, double scale); -void hidgl_fill_rect(Coord x1, Coord y1, Coord x2, Coord y2); +void hidgl_fill_rect(pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); void hidgl_init(void); int hidgl_stencil_bits(void); Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/actions/actions.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/actions/actions.c (revision 4810) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/actions/actions.c (revision 4811) @@ -30,7 +30,7 @@ } -static int action_cb(int argc, const char **argv, Coord x, Coord y) +static int action_cb(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { acontext_t *ctx = (acontext_t *)current_action; int action_argc_old; Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.c (revision 4810) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.c (revision 4811) @@ -102,7 +102,7 @@ gpmi_event(h->module, HIDE_set_line_cap, h, gc, style); } -void gpmi_hid_set_line_width(pcb_hid_gc_t gc, Coord width) +void gpmi_hid_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { gpmi_hid_t *h = hid_gpmi_data_get(exporter); gpmi_event(h->module, HIDE_set_line_width, h, gc, width); @@ -120,31 +120,31 @@ gpmi_event(h->module, HIDE_set_draw_faded, h, gc, faded); } -void gpmi_hid_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +void gpmi_hid_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { gpmi_hid_t *h = hid_gpmi_data_get(exporter); gpmi_event(h->module, HIDE_draw_line, h, gc, x1, y1, x2, y2); } -void gpmi_hid_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord xradius, Coord yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle) +void gpmi_hid_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t xradius, pcb_coord_t yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle) { gpmi_hid_t *h = hid_gpmi_data_get(exporter); gpmi_event(h->module, HIDE_draw_arc, h, gc, cx, cy, xradius, yradius, start_angle, delta_angle); } -void gpmi_hid_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +void gpmi_hid_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { gpmi_hid_t *h = hid_gpmi_data_get(exporter); gpmi_event(h->module, HIDE_draw_rect, h, gc, x1, y1, x2, y2); } -void gpmi_hid_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +void gpmi_hid_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { gpmi_hid_t *h = hid_gpmi_data_get(exporter); gpmi_event(h->module, HIDE_fill_circle, h, gc, cx, cy, radius); } -void gpmi_hid_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord *x, Coord *y) +void gpmi_hid_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t *x, pcb_coord_t *y) { gpmi_hid_t *h = hid_gpmi_data_get(exporter); /* TODO: need accessor for these */ @@ -156,7 +156,7 @@ /* TODO */ } -void gpmi_hid_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +void gpmi_hid_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { gpmi_hid_t *h = hid_gpmi_data_get(exporter); gpmi_event(h->module, HIDE_fill_rect, h, gc, x1, y1, x2, y2); Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.h =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.h (revision 4810) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/hid/hid_callbacks.h (revision 4811) @@ -7,16 +7,16 @@ int gpmi_hid_set_layer(const char *name, int group, int _empty); void gpmi_hid_set_color(pcb_hid_gc_t gc, const char *name); void gpmi_hid_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style); -void gpmi_hid_set_line_width(pcb_hid_gc_t gc, Coord width); +void gpmi_hid_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width); void gpmi_hid_set_draw_xor(pcb_hid_gc_t gc, int xor); void gpmi_hid_set_draw_faded(pcb_hid_gc_t gc, int faded); -void gpmi_hid_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2); -void gpmi_hid_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord xradius, Coord yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle); -void gpmi_hid_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2); -void gpmi_hid_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius); -void gpmi_hid_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord *x, Coord *y); +void gpmi_hid_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); +void gpmi_hid_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t xradius, pcb_coord_t yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle); +void gpmi_hid_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); +void gpmi_hid_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius); +void gpmi_hid_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t *x, pcb_coord_t *y); void gpmi_hid_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polygon_t *poly, const pcb_box_t *clip_box); -void gpmi_hid_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2); +void gpmi_hid_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); void gpmi_hid_fill_pcb_pv(pcb_hid_gc_t fg_gc, pcb_hid_gc_t bg_gc, pcb_pin_t *pad, pcb_bool drawHole, pcb_bool mask); void gpmi_hid_fill_pcb_pad(pcb_hid_gc_t gc, pcb_pad_t * pad, pcb_bool clear, pcb_bool mask); void gpmi_hid_use_mask(int use_it); Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c (revision 4810) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_plugin.c (revision 4811) @@ -58,7 +58,7 @@ } } -static int action_gpmi_scripts(int argc, const char **argv, Coord x, Coord y) +static int action_gpmi_scripts(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (argc == 0) { gpmi_hid_manage_scripts(); @@ -104,7 +104,7 @@ return 0; } -static int action_gpmi_rehash(int argc, const char **argv, Coord x, Coord y) +static int action_gpmi_rehash(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { cmd_reload(NULL); return 0; Index: trunk/src_plugins/hid_batch/batch.c =================================================================== --- trunk/src_plugins/hid_batch/batch.c (revision 4810) +++ trunk/src_plugins/hid_batch/batch.c (revision 4811) @@ -46,12 +46,12 @@ free(prompt); } -static int nop(int argc, const char **argv, Coord x, Coord y) +static int nop(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { return 0; } -static int PCBChanged(int argc, const char **argv, Coord x, Coord y) +static int PCBChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (prompt != NULL) free(prompt); @@ -69,13 +69,13 @@ return 0; } -static int help(int argc, const char **argv, Coord x, Coord y) +static int help(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { print_actions(); return 0; } -static int info(int argc, const char **argv, Coord x, Coord y) +static int info(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int i, j; int cg, sg; @@ -199,7 +199,7 @@ { } -static void batch_set_line_width(pcb_hid_gc_t gc, Coord width) +static void batch_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { } @@ -207,27 +207,27 @@ { } -static void batch_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void batch_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { } -static void batch_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord width, Coord height, pcb_angle_t start_angle, pcb_angle_t end_angle) +static void batch_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t end_angle) { } -static void batch_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void batch_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { } -static void batch_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +static void batch_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { } -static void batch_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y) +static void batch_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { } -static void batch_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void batch_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { } @@ -250,7 +250,7 @@ return 0; } -static void batch_get_coords(const char *msg, Coord * x, Coord * y) +static void batch_get_coords(const char *msg, pcb_coord_t * x, pcb_coord_t * y) { } Index: trunk/src_plugins/hid_gtk/ghid-coord-entry.c =================================================================== --- trunk/src_plugins/hid_gtk/ghid-coord-entry.c (revision 4810) +++ trunk/src_plugins/hid_gtk/ghid-coord-entry.c (revision 4811) @@ -32,9 +32,9 @@ struct _GHidCoordEntry { GtkSpinButton parent; - Coord min_value; - Coord max_value; - Coord value; + pcb_coord_t min_value; + pcb_coord_t max_value; + pcb_coord_t value; enum ce_step_size step_size; const pcb_unit_t *unit; @@ -226,7 +226,7 @@ * * \return a freshly-allocated GHidCoordEntry */ -GtkWidget *ghid_coord_entry_new(Coord min_val, Coord max_val, Coord value, const pcb_unit_t * unit, enum ce_step_size step_size) +GtkWidget *ghid_coord_entry_new(pcb_coord_t min_val, pcb_coord_t max_val, pcb_coord_t value, const pcb_unit_t * unit, enum ce_step_size step_size) { /* Setup spinbox min/max values */ double small_step, big_step; @@ -271,7 +271,7 @@ } /*! \brief Gets a GHidCoordEntry's value, in pcb coords */ -Coord ghid_coord_entry_get_value(GHidCoordEntry * ce) +pcb_coord_t ghid_coord_entry_get_value(GHidCoordEntry * ce) { return ce->value; } @@ -285,7 +285,7 @@ } /*! \brief Sets a GHidCoordEntry's value, in pcb coords */ -void ghid_coord_entry_set_value(GHidCoordEntry * ce, Coord val) +void ghid_coord_entry_set_value(GHidCoordEntry * ce, pcb_coord_t val) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(ce), coord_to_unit(ce->unit, val)); } Index: trunk/src_plugins/hid_gtk/ghid-coord-entry.h =================================================================== --- trunk/src_plugins/hid_gtk/ghid-coord-entry.h (revision 4810) +++ trunk/src_plugins/hid_gtk/ghid-coord-entry.h (revision 4811) @@ -22,13 +22,13 @@ enum ce_step_size { CE_TINY, CE_SMALL, CE_MEDIUM, CE_LARGE }; GType ghid_coord_entry_get_type(void); -GtkWidget *ghid_coord_entry_new(Coord min_val, Coord max_val, Coord value, const pcb_unit_t * unit, enum ce_step_size step_size); +GtkWidget *ghid_coord_entry_new(pcb_coord_t min_val, pcb_coord_t max_val, pcb_coord_t value, const pcb_unit_t * unit, enum ce_step_size step_size); void ghid_coord_entry_add_entry(GHidCoordEntry * ce, const gchar * name, const gchar * desc); gchar *ghid_coord_entry_get_last_command(GHidCoordEntry * ce); int ghid_coord_entry_get_value_str(GHidCoordEntry * ce, char *out, int out_len); -Coord ghid_coord_entry_get_value(GHidCoordEntry * ce); -void ghid_coord_entry_set_value(GHidCoordEntry * ce, Coord val); +pcb_coord_t ghid_coord_entry_get_value(GHidCoordEntry * ce); +void ghid_coord_entry_set_value(GHidCoordEntry * ce, pcb_coord_t val); G_END_DECLS /* keep c++ happy */ #endif Index: trunk/src_plugins/hid_gtk/ghid-propedit.c =================================================================== --- trunk/src_plugins/hid_gtk/ghid-propedit.c (revision 4810) +++ trunk/src_plugins/hid_gtk/ghid-propedit.c (revision 4811) @@ -297,7 +297,7 @@ GtkWidget *area = gtk_drawing_area_new(); pcb_board_t *old_pcb; int n, zoom1, fx, fy; - Coord cx, cy; + pcb_coord_t cx, cy; /* void *v; Index: trunk/src_plugins/hid_gtk/ghid-route-style-selector.c =================================================================== --- trunk/src_plugins/hid_gtk/ghid-route-style-selector.c (revision 4810) +++ trunk/src_plugins/hid_gtk/ghid-route-style-selector.c (revision 4811) @@ -165,7 +165,7 @@ } /* \brief Helper for edit_button_cb */ -static void _table_attach(GtkWidget * table, gint row, const gchar * label, GtkWidget ** entry, Coord min, Coord max) +static void _table_attach(GtkWidget * table, gint row, const gchar * label, GtkWidget ** entry, pcb_coord_t min, pcb_coord_t max) { GtkWidget *label_w = gtk_label_new(label); gtk_misc_set_alignment(GTK_MISC(label_w), 1.0, 0.5); @@ -291,7 +291,7 @@ /* Modify the route style only if there's significant difference (beyond rouding errors) */ #define rst_modify(changed, dst, src) \ do { \ - Coord __tmp__ = src; \ + pcb_coord_t __tmp__ = src; \ if (abs(dst - __tmp__) > 10) { \ changed = 1; \ dst = __tmp__; \ @@ -584,12 +584,12 @@ * will happen. This function does not emit any signals. * * \param [in] rss The selector to be acted on - * \param [in] Thick Coord to match selection to - * \param [in] Hole Coord to match selection to - * \param [in] Diameter Coord to match selection to - * \param [in] Clearance Coord to match selection to + * \param [in] Thick pcb_coord_t to match selection to + * \param [in] Hole pcb_coord_t to match selection to + * \param [in] Diameter pcb_coord_t to match selection to + * \param [in] Clearance pcb_coord_t to match selection to */ -void ghid_route_style_selector_sync(GHidRouteStyleSelector * rss, Coord Thick, Coord Hole, Coord Diameter, Coord Clearance) +void ghid_route_style_selector_sync(GHidRouteStyleSelector * rss, pcb_coord_t Thick, pcb_coord_t Hole, pcb_coord_t Diameter, pcb_coord_t Clearance) { GtkTreeIter iter; int target, n; Index: trunk/src_plugins/hid_gtk/ghid-route-style-selector.h =================================================================== --- trunk/src_plugins/hid_gtk/ghid-route-style-selector.h (revision 4810) +++ trunk/src_plugins/hid_gtk/ghid-route-style-selector.h (revision 4811) @@ -28,7 +28,7 @@ GtkAccelGroup *ghid_route_style_selector_get_accel_group(GHidRouteStyleSelector * rss); -void ghid_route_style_selector_sync(GHidRouteStyleSelector * rss, Coord Thick, Coord Hole, Coord Diameter, Coord Clearance); +void ghid_route_style_selector_sync(GHidRouteStyleSelector * rss, pcb_coord_t Thick, pcb_coord_t Hole, pcb_coord_t Diameter, pcb_coord_t Clearance); void ghid_route_style_selector_empty(GHidRouteStyleSelector * rss); G_END_DECLS /* keep c++ happy */ Index: trunk/src_plugins/hid_gtk/gtkhid-gdk.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-gdk.c (revision 4810) +++ trunk/src_plugins/hid_gtk/gtkhid-gdk.c (revision 4811) @@ -36,9 +36,9 @@ guint lead_user_timeout; GTimer *lead_user_timer; pcb_bool lead_user; - Coord lead_user_radius; - Coord lead_user_x; - Coord lead_user_y; + pcb_coord_t lead_user_radius; + pcb_coord_t lead_user_x; + pcb_coord_t lead_user_y; } render_priv; @@ -48,7 +48,7 @@ GdkGC *gc; gchar *colorname; - Coord width; + pcb_coord_t width; gint cap, join; gchar xor_mask; gint mask_seq; @@ -130,7 +130,7 @@ static inline void ghid_draw_grid_global(void) { render_priv *priv = gport->render_priv; - Coord x, y, x1, y1, x2, y2, grd; + pcb_coord_t x, y, x1, y1, x2, y2, grd; int n, i; static GdkPoint *points = NULL; static int npoints = 0; @@ -149,12 +149,12 @@ } if (x1 > x2) { - Coord tmp = x1; + pcb_coord_t tmp = x1; x1 = x2; x2 = tmp; } if (y1 > y2) { - Coord tmp = y1; + pcb_coord_t tmp = y1; y1 = y2; y2 = tmp; } @@ -187,15 +187,15 @@ } } -static void ghid_draw_grid_local_(Coord cx, Coord cy, int radius) +static void ghid_draw_grid_local_(pcb_coord_t cx, pcb_coord_t cy, int radius) { render_priv *priv = gport->render_priv; static GdkPoint *points_base = NULL; static GdkPoint *points_abs = NULL; static int apoints = 0, npoints = 0, old_radius = 0; - static Coord last_grid = 0; + static pcb_coord_t last_grid = 0; int recalc = 0, n, r2; - Coord x, y; + pcb_coord_t x, y; /* PI is approximated with 3.25 here - allows a minimal overallocation, speeds up calculations */ r2 = radius * radius; @@ -243,9 +243,9 @@ static int grid_local_have_old = 0, grid_local_old_r = 0; -static Coord grid_local_old_x, grid_local_old_y; +static pcb_coord_t grid_local_old_x, grid_local_old_y; -void ghid_draw_grid_local(Coord cx, Coord cy) +void ghid_draw_grid_local(pcb_coord_t cx, pcb_coord_t cy) { if (grid_local_have_old) { ghid_draw_grid_local_(grid_local_old_x, grid_local_old_y, grid_local_old_r); @@ -536,7 +536,7 @@ gdk_gc_set_line_attributes(WHICH_GC(gc), Vz(gc->width), GDK_LINE_SOLID, (GdkCapStyle) gc->cap, (GdkJoinStyle) gc->join); } -void ghid_set_line_width(pcb_hid_gc_t gc, Coord width) +void ghid_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { render_priv *priv = gport->render_priv; @@ -585,7 +585,7 @@ return 1; } -void ghid_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +void ghid_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { double dx1, dy1, dx2, dy2; render_priv *priv = gport->render_priv; @@ -602,7 +602,7 @@ gdk_draw_line(gport->drawable, priv->u_gc, dx1, dy1, dx2, dy2); } -void ghid_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord xradius, Coord yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle) +void ghid_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t xradius, pcb_coord_t yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle) { gint vrx, vry; gint w, h, radius; @@ -637,7 +637,7 @@ Vx(cx) - vrx, Vy(cy) - vry, vrx * 2, vry * 2, (start_angle + 180) * 64, delta_angle * 64); } -void ghid_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +void ghid_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { gint w, h, lw; render_priv *priv = gport->render_priv; @@ -673,7 +673,7 @@ } -void ghid_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +void ghid_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { gint w, h, vr; render_priv *priv = gport->render_priv; @@ -690,7 +690,7 @@ gdk_draw_arc(gport->drawable, priv->u_gc, TRUE, Vx(cx) - vr, Vy(cy) - vr, vr * 2, vr * 2, 0, 360 * 64); } -void ghid_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y) +void ghid_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { static GdkPoint *points = 0; static int npoints = 0; @@ -709,7 +709,7 @@ gdk_draw_polygon(gport->drawable, priv->u_gc, 1, points, n_coords); } -void ghid_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +void ghid_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { gint w, h, lw, xx, yy; render_priv *priv = gport->render_priv; @@ -1253,7 +1253,7 @@ */ } -pcb_bool ghid_event_to_pcb_coords(int event_x, int event_y, Coord * pcb_x, Coord * pcb_y) +pcb_bool ghid_event_to_pcb_coords(int event_x, int event_y, pcb_coord_t * pcb_x, pcb_coord_t * pcb_y) { *pcb_x = EVENT_TO_PCB_X(event_x); *pcb_y = EVENT_TO_PCB_Y(event_y); @@ -1261,7 +1261,7 @@ return pcb_true; } -pcb_bool ghid_pcb_to_event_coords(Coord pcb_x, Coord pcb_y, int *event_x, int *event_y) +pcb_bool ghid_pcb_to_event_coords(pcb_coord_t pcb_x, pcb_coord_t pcb_y, int *event_x, int *event_y) { *event_x = DRAW_X(pcb_x); *event_y = DRAW_Y(pcb_y); @@ -1285,9 +1285,9 @@ GdkWindow *window = gtk_widget_get_window(gport->drawing_area); GtkStyle *style = gtk_widget_get_style(gport->drawing_area); int i; - Coord radius = priv->lead_user_radius; - Coord width = PCB_MM_TO_COORD(LEAD_USER_WIDTH); - Coord separation = PCB_MM_TO_COORD(LEAD_USER_ARC_SEPARATION); + pcb_coord_t radius = priv->lead_user_radius; + pcb_coord_t width = PCB_MM_TO_COORD(LEAD_USER_WIDTH); + pcb_coord_t separation = PCB_MM_TO_COORD(LEAD_USER_ARC_SEPARATION); static GdkGC *lead_gc = NULL; GdkColor lead_color; @@ -1325,7 +1325,7 @@ gboolean lead_user_cb(gpointer data) { render_priv *priv = data; - Coord step; + pcb_coord_t step; double elapsed_time; /* Queue a redraw */ @@ -1344,7 +1344,7 @@ return TRUE; } -void ghid_lead_user_to_location(Coord x, Coord y) +void ghid_lead_user_to_location(pcb_coord_t x, pcb_coord_t y) { render_priv *priv = gport->render_priv; Index: trunk/src_plugins/hid_gtk/gtkhid-gl.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-gl.c (revision 4810) +++ trunk/src_plugins/hid_gtk/gtkhid-gl.c (revision 4811) @@ -47,9 +47,9 @@ guint lead_user_timeout; GTimer *lead_user_timer; bool lead_user; - Coord lead_user_radius; - Coord lead_user_x; - Coord lead_user_y; + pcb_coord_t lead_user_radius; + pcb_coord_t lead_user_x; + pcb_coord_t lead_user_y; } render_priv; @@ -59,7 +59,7 @@ const char *colorname; double alpha_mult; - Coord width; + pcb_coord_t width; gint cap, join; gchar xor; } hid_gc_s; @@ -438,7 +438,7 @@ gc->cap = style; } -void ghid_set_line_width(pcb_hid_gc_t gc, Coord width) +void ghid_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { gc->width = width; } @@ -457,7 +457,7 @@ printf("ghid_set_draw_faded(%p,%d) -- not implemented\n", (void *)gc, faded); } -void ghid_set_line_cap_angle(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +void ghid_set_line_cap_angle(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { printf("ghid_set_line_cap_angle() -- not implemented\n"); } @@ -483,7 +483,7 @@ return 1; } -void ghid_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +void ghid_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { USE_GC(gc); @@ -490,7 +490,7 @@ hidgl_draw_line(gc->cap, gc->width, x1, y1, x2, y2, gport->view.coord_per_px); } -void ghid_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord xradius, Coord yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle) +void ghid_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t xradius, pcb_coord_t yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle) { USE_GC(gc); @@ -497,7 +497,7 @@ hidgl_draw_arc(gc->width, cx, cy, xradius, yradius, start_angle, delta_angle, gport->view.coord_per_px); } -void ghid_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +void ghid_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { USE_GC(gc); @@ -505,7 +505,7 @@ } -void ghid_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +void ghid_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { USE_GC(gc); @@ -513,7 +513,7 @@ } -void ghid_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y) +void ghid_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { USE_GC(gc); @@ -535,7 +535,7 @@ ghid_set_alpha_mult(gc, 1.0); } -void ghid_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +void ghid_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { USE_GC(gc); @@ -1138,7 +1138,7 @@ ghid_end_drawing(gport); } -bool ghid_event_to_pcb_coords(int event_x, int event_y, Coord * pcb_x, Coord * pcb_y) +bool ghid_event_to_pcb_coords(int event_x, int event_y, pcb_coord_t * pcb_x, pcb_coord_t * pcb_y) { *pcb_x = EVENT_TO_PCB_X(event_x); *pcb_y = EVENT_TO_PCB_Y(event_y); @@ -1146,7 +1146,7 @@ return pcb_true; } -bool ghid_pcb_to_event_coords(Coord pcb_x, Coord pcb_y, int *event_x, int *event_y) +bool ghid_pcb_to_event_coords(pcb_coord_t pcb_x, pcb_coord_t pcb_y, int *event_x, int *event_y) { *event_x = DRAW_X(pcb_x); *event_y = DRAW_Y(pcb_y); @@ -1198,7 +1198,7 @@ gboolean lead_user_cb(gpointer data) { render_priv *priv = data; - Coord step; + pcb_coord_t step; double elapsed_time; /* Queue a redraw */ @@ -1217,7 +1217,7 @@ return TRUE; } -void ghid_lead_user_to_location(Coord x, Coord y) +void ghid_lead_user_to_location(pcb_coord_t x, pcb_coord_t y) { render_priv *priv = gport->render_priv; Index: trunk/src_plugins/hid_gtk/gtkhid-main.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 4810) +++ trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 4811) @@ -61,7 +61,7 @@ ghid_port_ranges_changed(); } -static void ghid_pan_view_abs(Coord pcb_x, Coord pcb_y, int widget_x, int widget_y) +static void ghid_pan_view_abs(pcb_coord_t pcb_x, pcb_coord_t pcb_y, int widget_x, int widget_y) { gport->view.x0 = SIDE_X(pcb_x) - widget_x * gport->view.coord_per_px; gport->view.y0 = SIDE_Y(pcb_y) - widget_y * gport->view.coord_per_px; @@ -69,7 +69,7 @@ pan_common(gport); } -void ghid_pan_view_rel(Coord dx, Coord dy) +void ghid_pan_view_rel(pcb_coord_t dx, pcb_coord_t dy) { gport->view.x0 += dx; gport->view.y0 += dy; @@ -86,11 +86,11 @@ */ #define ALLOW_ZOOM_OUT_BY 10 /* Arbitrary, and same as the lesstif HID MAX_ZOOM_SCALE */ -static void ghid_zoom_view_abs(Coord center_x, Coord center_y, double new_zoom) +static void ghid_zoom_view_abs(pcb_coord_t center_x, pcb_coord_t center_y, double new_zoom) { double min_zoom, max_zoom; double xtmp, ytmp; - Coord cmaxx, cmaxy; + pcb_coord_t cmaxx, cmaxy; /* Limit the "minimum" zoom constant (maximum zoom), at 1 pixel per PCB * unit, and set the "maximum" zoom constant (minimum zoom), such that @@ -128,7 +128,7 @@ ghid_set_status_line_label(); } -static void ghid_zoom_view_rel(Coord center_x, Coord center_y, double factor) +static void ghid_zoom_view_rel(pcb_coord_t center_x, pcb_coord_t center_y, double factor) { ghid_zoom_view_abs(center_x, center_y, gport->view.coord_per_px * factor); } @@ -139,7 +139,7 @@ ghid_zoom_view_abs(SIDE_X(0), SIDE_Y(0), MAX(PCB->MaxWidth / gport->width, PCB->MaxHeight / gport->height)); } -static void ghid_flip_view(Coord center_x, Coord center_y, pcb_bool flip_x, pcb_bool flip_y) +static void ghid_flip_view(pcb_coord_t center_x, pcb_coord_t center_y, pcb_bool flip_x, pcb_bool flip_y) { int widget_x, widget_y; @@ -200,7 +200,7 @@ %end-doc */ -static int Zoom(int argc, const char **argv, Coord x, Coord y) +static int Zoom(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *vp; double v; @@ -302,7 +302,7 @@ int offset_x, offset_y; int widget_x, widget_y; int pointer_x, pointer_y; - Coord pcb_x, pcb_y; + pcb_coord_t pcb_x, pcb_y; ghid_draw_grid_local(x, y); @@ -1023,7 +1023,7 @@ %end-doc */ -static int About(int argc, const char **argv, Coord x, Coord y) +static int About(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { ghid_dialog_about(); return 0; @@ -1040,7 +1040,7 @@ %end-doc */ -static int GetXY(int argc, const char **argv, Coord x, Coord y) +static int GetXY(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { return 0; } @@ -1047,7 +1047,7 @@ /* ---------------------------------------------------------------------- */ -static int PointCursor(int argc, const char **argv, Coord x, Coord y) +static int PointCursor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (!ghidgui) return 0; @@ -1061,7 +1061,7 @@ /* ---------------------------------------------------------------------- */ -static int RouteStylesChanged(int argc, const char **argv, Coord x, Coord y) +static int RouteStylesChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (!ghidgui || !ghidgui->route_style_selector) return 0; @@ -1075,7 +1075,7 @@ /* ---------------------------------------------------------------------- */ -int PCBChanged(int argc, const char **argv, Coord x, Coord y) +int PCBChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (!ghidgui) return 0; @@ -1100,7 +1100,7 @@ /* ---------------------------------------------------------------------- */ -static int LayerGroupsChanged(int argc, const char **argv, Coord x, Coord y) +static int LayerGroupsChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { printf(_("LayerGroupsChanged -- not implemented\n")); return 0; @@ -1108,7 +1108,7 @@ /* ---------------------------------------------------------------------- */ -static int LibraryChanged(int argc, const char **argv, Coord x, Coord y) +static int LibraryChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { /* No need to show the library window every time it changes... * ghid_library_window_show (&ghid_port, FALSE); @@ -1118,7 +1118,7 @@ /* ---------------------------------------------------------------------- */ -static int Command(int argc, const char **argv, Coord x, Coord y) +static int Command(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { ghid_handle_user_command(TRUE); return 0; @@ -1136,7 +1136,7 @@ return pcb_strdup(getcwd(tmp, sizeof(tmp))); } -static int Load(int argc, const char **argv, Coord x, Coord y) +static int Load(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function; char *name = NULL; @@ -1199,7 +1199,7 @@ %end-doc */ -static int Save(int argc, const char **argv, Coord x, Coord y) +static int Save(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function; char *name; @@ -1320,7 +1320,7 @@ %end-doc */ -static int SwapSides(int argc, const char **argv, Coord x, Coord y) +static int SwapSides(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int active_group = GetLayerGroupNumberByNumber(LayerStack[0]); int comp_group = GetLayerGroupNumberByNumber(component_silk_layer); @@ -1373,7 +1373,7 @@ %end-doc */ -static int Print(int argc, const char **argv, Coord x, Coord y) +static int Print(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { pcb_hid_t **hids; int i; @@ -1425,7 +1425,7 @@ %end-doc */ -static int PrintCalibrate(int argc, const char **argv, Coord x, Coord y) +static int PrintCalibrate(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { pcb_hid_t *printer = hid_find_printer(); printer->calibrate(0.0, 0.0); @@ -1440,7 +1440,7 @@ /* ------------------------------------------------------------ */ -static int Export(int argc, const char **argv, Coord x, Coord y) +static int Export(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { /* check if layout is empty */ @@ -1455,7 +1455,7 @@ /* ------------------------------------------------------------ */ -static int Benchmark(int argc, const char **argv, Coord x, Coord y) +static int Benchmark(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int i = 0; time_t start, end; @@ -1491,7 +1491,7 @@ %end-doc */ -static int Center(int argc, const char **argv, Coord pcb_x, Coord pcb_y) +static int Center(int argc, const char **argv, pcb_coord_t pcb_x, pcb_coord_t pcb_y) { GdkDisplay *display; GdkScreen *screen; @@ -1567,7 +1567,7 @@ %end-doc */ -static int CursorAction(int argc, const char **argv, Coord x, Coord y) +static int CursorAction(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { pcb_unit_list_t extra_units_x = { {"grid", PCB->Grid, 0}, @@ -1650,7 +1650,7 @@ %end-doc */ -static int DoWindows(int argc, const char **argv, Coord x, Coord y) +static int DoWindows(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *a = argc >= 1 ? argv[0] : ""; gboolean raise = TRUE; @@ -1707,7 +1707,7 @@ %end-doc */ -static int SetUnits(int argc, const char **argv, Coord x, Coord y) +static int SetUnits(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const pcb_unit_t *new_unit; if (argc == 0) @@ -1747,7 +1747,7 @@ %end-doc */ -static int ScrollAction(int argc, const char **argv, Coord x, Coord y) +static int ScrollAction(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { gdouble dx = 0.0, dy = 0.0; int div = 40; @@ -1790,7 +1790,7 @@ %end-doc */ -static int PanAction(int argc, const char **argv, Coord x, Coord y) +static int PanAction(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int mode; @@ -1826,7 +1826,7 @@ in the popups subtree in the menu lht file. %end-doc */ -static int Popup(int argc, const char **argv, Coord x, Coord y) +static int Popup(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { GtkMenu *menu = NULL; char name[256]; @@ -1866,7 +1866,7 @@ %end-doc */ -static int ImportGUI(int argc, const char **argv, Coord x, Coord y) +static int ImportGUI(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { char *name = NULL; static gchar *current_layout_dir = NULL; @@ -1901,7 +1901,7 @@ static const char savewingeo_help[] = N_("Saves window geometry in the config.\n"); -static int SaveWinGeo(int argc, const char **argv, Coord x, Coord y) +static int SaveWinGeo(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { ghid_wgeo_save(1, 0); return 0; @@ -1910,7 +1910,7 @@ /* ------------------------------------------------------------ */ -static int Busy(int argc, const char **argv, Coord x, Coord y) +static int Busy(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { ghid_watch_cursor(); return 0; Index: trunk/src_plugins/hid_gtk/gui-config.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-config.c (revision 4810) +++ trunk/src_plugins/hid_gtk/gui-config.c (revision 4811) @@ -508,7 +508,7 @@ */ static GtkWidget *config_sizes_vbox, *config_sizes_tab_vbox, *config_text_spin_button; -static Coord new_board_width, new_board_height; +static pcb_coord_t new_board_width, new_board_height; static void config_sizes_apply(void) { @@ -535,7 +535,7 @@ static void coord_entry_cb(GHidCoordEntry * ce, void *dst) { - *(Coord *) dst = ghid_coord_entry_get_value(ce); + *(pcb_coord_t *) dst = ghid_coord_entry_get_value(ce); } void config_sizes_save(GtkButton *widget, save_ctx_t *ctx) @@ -753,7 +753,7 @@ static GtkWidget *config_increments_vbox = NULL, *config_increments_tab_vbox = NULL; -static void increment_tbl_update_cell(GtkLabel *lab, Coord val, const char *fmt) +static void increment_tbl_update_cell(GtkLabel *lab, pcb_coord_t val, const char *fmt) { char s[128]; pcb_snprintf(s, sizeof(s), fmt, val); @@ -760,7 +760,7 @@ gtk_label_set_text(lab, s); } -static void increment_tbl_update_row(int row, Coord edit_in_mm, Coord edit_in_mil) +static void increment_tbl_update_row(int row, pcb_coord_t edit_in_mm, pcb_coord_t edit_in_mil) { increment_tbl_update_cell(GTK_LABEL(config_increments_tbl[0][row]), edit_in_mm, "%$mm"); increment_tbl_update_cell(GTK_LABEL(config_increments_tbl[1][row]), edit_in_mil, "%$mm"); @@ -779,7 +779,7 @@ static void increment_spin_button_cb(GHidCoordEntry * ce, void *dst) { const char *path = dst; - conf_setf(CFR_DESIGN, path, -1, "%mr", (Coord)ghid_coord_entry_get_value(ce)); + conf_setf(CFR_DESIGN, path, -1, "%mr", (pcb_coord_t)ghid_coord_entry_get_value(ce)); increment_tbl_update(); } @@ -2184,7 +2184,7 @@ break; case CFN_COORD: { - Coord coord = 0; + pcb_coord_t coord = 0; citem.coord = &coord; conf_parse_text(&citem, 0, nat->type, nd->data.text.value, nd); ghid_coord_entry_set_value(GHID_COORD_ENTRY(auto_tab_widgets.edit_coord), coord); Index: trunk/src_plugins/hid_gtk/gui-dialog-print.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-dialog-print.c (revision 4810) +++ trunk/src_plugins/hid_gtk/gui-dialog-print.c (revision 4811) @@ -53,7 +53,7 @@ *ival = gtk_spin_button_get_value(GTK_SPIN_BUTTON((GtkWidget *) spin_button)); } -static void coordentry_changed_cb(GtkEntry * entry, Coord * res) +static void coordentry_changed_cb(GtkEntry * entry, pcb_coord_t * res) { const gchar *s = gtk_entry_get_text(entry); *res = GetValue(s, NULL, NULL, NULL); Index: trunk/src_plugins/hid_gtk/gui-drc-window.h =================================================================== --- trunk/src_plugins/hid_gtk/gui-drc-window.h (revision 4810) +++ trunk/src_plugins/hid_gtk/gui-drc-window.h (revision 4811) @@ -47,12 +47,12 @@ char *title; char *explanation; - Coord x_coord; - Coord y_coord; + pcb_coord_t x_coord; + pcb_coord_t y_coord; pcb_angle_t angle; pcb_bool have_measured; - Coord measured_value; - Coord required_value; + pcb_coord_t measured_value; + pcb_coord_t required_value; int object_count; long int *object_id_list; int *object_type_list; Index: trunk/src_plugins/hid_gtk/gui-log-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-log-window.c (revision 4810) +++ trunk/src_plugins/hid_gtk/gui-log-window.c (revision 4811) @@ -180,7 +180,7 @@ to it. If false, the log will still be updated, but the window won't \ be shown."; -static gint GhidLogShowOnAppend(int argc, const char **argv, Coord x, Coord y) +static gint GhidLogShowOnAppend(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *a = argc == 1 ? argv[0] : ""; Index: trunk/src_plugins/hid_gtk/gui-misc.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-misc.c (revision 4810) +++ trunk/src_plugins/hid_gtk/gui-misc.c (revision 4811) @@ -397,9 +397,9 @@ sep = '\n'; if (Marked.status) { - Coord dx = Crosshair.X - Marked.X; - Coord dy = Crosshair.Y - Marked.Y; - Coord r = Distance(Crosshair.X, Crosshair.Y, Marked.X, Marked.Y); + pcb_coord_t dx = Crosshair.X - Marked.X; + pcb_coord_t dy = Crosshair.Y - Marked.Y; + pcb_coord_t r = Distance(Crosshair.X, Crosshair.Y, Marked.X, Marked.Y); double a = atan2(dy, dx) * PCB_RAD_TO_DEG; Index: trunk/src_plugins/hid_gtk/gui-netlist-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-netlist-window.c (revision 4810) +++ trunk/src_plugins/hid_gtk/gui-netlist-window.c (revision 4811) @@ -217,7 +217,7 @@ pcb_lib_menu_t *node_net; pcb_lib_entry_t *node; pcb_connection_t conn; - Coord x, y; + pcb_coord_t x, y; static gchar *node_name; if (selection_holdoff) /* PCB is highlighting, user is not selecting */ @@ -918,7 +918,7 @@ node_model_update((&PCB->NetlistLib[NETLIST_EDITED])->Menu); } -static gint GhidNetlistChanged(int argc, const char **argv, Coord x, Coord y) +static gint GhidNetlistChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { loading_new_netlist = TRUE; ghid_netlist_window_update(TRUE); @@ -932,7 +932,7 @@ static const char netlistshow_help[] = "Selects the given pinname or netname in the netlist window. Does not \ show the window if it isn't already shown."; -static gint GhidNetlistShow(int argc, const char **argv, Coord x, Coord y) +static gint GhidNetlistShow(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { ghid_netlist_window_create(gport); if (argc > 0) @@ -944,7 +944,7 @@ static const char netlistpresent_help[] = "Presents the netlist window."; -static gint GhidNetlistPresent(int argc, const char **argv, Coord x, Coord y) +static gint GhidNetlistPresent(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { ghid_netlist_window_show(gport, TRUE); return 0; Index: trunk/src_plugins/hid_gtk/gui-output-events.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-output-events.c (revision 4810) +++ trunk/src_plugins/hid_gtk/gui-output-events.c (revision 4811) @@ -99,7 +99,7 @@ * handles all events from PCB drawing area */ -void ghid_get_coords(const char *msg, Coord * x, Coord * y) +void ghid_get_coords(const char *msg, pcb_coord_t * x, pcb_coord_t * y) { if (!ghid_port.has_entered && msg) ghid_get_user_xy(msg); @@ -291,7 +291,7 @@ } -static char *describe_location(Coord X, Coord Y) +static char *describe_location(pcb_coord_t X, pcb_coord_t Y) { void *ptr1, *ptr2, *ptr3; int type; Index: trunk/src_plugins/hid_gtk/gui-top-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-top-window.c (revision 4810) +++ trunk/src_plugins/hid_gtk/gui-top-window.c (revision 4811) @@ -1534,7 +1534,7 @@ return visible; } -gint LayersChanged(int argc, const char **argv, Coord x, Coord y) +gint LayersChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (!ghidgui || !ghidgui->menu_bar) return 0; @@ -1570,7 +1570,7 @@ %end-doc */ -static int ToggleView(int argc, const char **argv, Coord x, Coord y) +static int ToggleView(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int i, l; @@ -1627,7 +1627,7 @@ %end-doc */ -static int SelectLayer(int argc, const char **argv, Coord x, Coord y) +static int SelectLayer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int newl; if (argc == 0) @@ -1718,7 +1718,7 @@ %end-doc */ -static int AdjustStyle(int argc, const char **argv, Coord x, Coord y) +static int AdjustStyle(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (argc > 1) AFAIL(adjuststyle); @@ -1741,7 +1741,7 @@ %end-doc */ -static int EditLayerGroups(int argc, const char **argv, Coord x, Coord y) +static int EditLayerGroups(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (argc != 0) Index: trunk/src_plugins/hid_gtk/gui-utils.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-utils.c (revision 4810) +++ trunk/src_plugins/hid_gtk/gui-utils.c (revision 4811) @@ -211,8 +211,8 @@ } void -ghid_coord_entry(GtkWidget * box, GtkWidget ** coord_entry, Coord value, - Coord low, Coord high, enum ce_step_size step_size, const pcb_unit_t *u, +ghid_coord_entry(GtkWidget * box, GtkWidget ** coord_entry, pcb_coord_t value, + pcb_coord_t low, pcb_coord_t high, enum ce_step_size step_size, const pcb_unit_t *u, gint width, void (*cb_func) (GHidCoordEntry *, gpointer), gpointer data, const gchar * string_pre, const gchar * string_post) { GtkWidget *hbox = NULL, *label, *entry_widget; @@ -295,8 +295,8 @@ void ghid_table_coord_entry(GtkWidget * table, gint row, gint column, - GtkWidget ** coord_entry, Coord value, - Coord low, Coord high, enum ce_step_size step_size, + GtkWidget ** coord_entry, pcb_coord_t value, + pcb_coord_t low, pcb_coord_t high, enum ce_step_size step_size, gint width, void (*cb_func) (GHidCoordEntry *, gpointer), gpointer data, gboolean right_align, const gchar * string) { Index: trunk/src_plugins/hid_gtk/gui.h =================================================================== --- trunk/src_plugins/hid_gtk/gui.h (revision 4810) +++ trunk/src_plugins/hid_gtk/gui.h (revision 4811) @@ -134,10 +134,10 @@ typedef struct { double coord_per_px; /* Zoom level described as PCB units per screen pixel */ - Coord x0; - Coord y0; - Coord width; - Coord height; + pcb_coord_t x0; + pcb_coord_t y0; + pcb_coord_t width; + pcb_coord_t height; } view_data; @@ -163,8 +163,8 @@ gboolean panning; view_data view; - Coord pcb_x, pcb_y; /* PCB coordinates of the mouse pointer */ - Coord crosshair_x, crosshair_y; /* PCB coordinates of the crosshair */ + pcb_coord_t pcb_x, pcb_y; /* PCB coordinates of the mouse pointer */ + pcb_coord_t crosshair_x, crosshair_y; /* PCB coordinates of the crosshair */ } GHidPort; extern GHidPort ghid_port, *gport; @@ -323,8 +323,8 @@ gboolean active, gboolean pack_start, gboolean expand, gboolean fill, gint pad, void (*cb_func) (GtkToggleButton *, gpointer), gpointer data, const gchar * string); -void ghid_coord_entry(GtkWidget * box, GtkWidget ** coord_entry, Coord value, - Coord low, Coord high, enum ce_step_size step_size, const pcb_unit_t *u, +void ghid_coord_entry(GtkWidget * box, GtkWidget ** coord_entry, pcb_coord_t value, + pcb_coord_t low, pcb_coord_t high, enum ce_step_size step_size, const pcb_unit_t *u, gint width, void (*cb_func) (GHidCoordEntry *, gpointer), gpointer data, const gchar * string_pre, const gchar * string_post); void ghid_spin_button(GtkWidget * box, GtkWidget ** spin_button, @@ -332,8 +332,8 @@ gfloat step1, gint digits, gint width, void (*cb_func) (GtkSpinButton *, gpointer), gpointer data, gboolean right_align, const gchar * string); void ghid_table_coord_entry(GtkWidget * table, gint row, gint column, - GtkWidget ** coord_entry, Coord value, - Coord low, Coord high, enum ce_step_size, gint width, + GtkWidget ** coord_entry, pcb_coord_t value, + pcb_coord_t low, pcb_coord_t high, enum ce_step_size, gint width, void (*cb_func) (GHidCoordEntry *, gpointer), gpointer data, gboolean right_align, const gchar * string); void ghid_table_spin_button(GtkWidget * box, gint row, gint column, GtkWidget ** spin_button, gfloat value, @@ -413,14 +413,14 @@ void ghid_use_mask(int use_it); void ghid_set_color(pcb_hid_gc_t gc, const char *name); void ghid_set_line_cap(pcb_hid_gc_t gc, pcb_cap_style_t style); -void ghid_set_line_width(pcb_hid_gc_t gc, Coord width); +void ghid_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width); void ghid_set_draw_xor(pcb_hid_gc_t gc, int _xor); -void ghid_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2); -void ghid_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord xradius, Coord yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle); -void ghid_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2); -void ghid_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius); -void ghid_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y); -void ghid_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2); +void ghid_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); +void ghid_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t xradius, pcb_coord_t yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle); +void ghid_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); +void ghid_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius); +void ghid_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y); +void ghid_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); void ghid_invalidate_lr(int left, int right, int top, int bottom); void ghid_invalidate_all(); void ghid_notify_crosshair_change(pcb_bool changes_complete); @@ -437,16 +437,16 @@ pcb_hid_t *ghid_request_debug_draw(void); void ghid_flush_debug_draw(void); void ghid_finish_debug_draw(void); -pcb_bool ghid_event_to_pcb_coords(int event_x, int event_y, Coord * pcb_x, Coord * pcb_y); -pcb_bool ghid_pcb_to_event_coords(Coord pcb_x, Coord pcb_y, int *event_x, int *event_y); +pcb_bool ghid_event_to_pcb_coords(int event_x, int event_y, pcb_coord_t * pcb_x, pcb_coord_t * pcb_y); +pcb_bool ghid_pcb_to_event_coords(pcb_coord_t pcb_x, pcb_coord_t pcb_y, int *event_x, int *event_y); -void ghid_lead_user_to_location(Coord x, Coord y); +void ghid_lead_user_to_location(pcb_coord_t x, pcb_coord_t y); void ghid_cancel_lead_user(void); /* gtkhid-main.c */ -void ghid_pan_view_rel(Coord dx, Coord dy); -void ghid_get_coords(const char *msg, Coord * x, Coord * y); -gint PCBChanged(int argc, const char **argv, Coord x, Coord y); +void ghid_pan_view_rel(pcb_coord_t dx, pcb_coord_t dy); +void ghid_get_coords(const char *msg, pcb_coord_t * x, pcb_coord_t * y); +gint PCBChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y); @@ -458,7 +458,7 @@ /* Coordinate conversions */ /* Px converts view->pcb, Vx converts pcb->view */ -static inline int Vx(Coord x) +static inline int Vx(pcb_coord_t x) { double rv; if (conf_core.editor.view.flip_x) @@ -468,7 +468,7 @@ return pcb_round(rv); } -static inline int Vy(Coord y) +static inline int Vy(pcb_coord_t y) { double rv; if (conf_core.editor.view.flip_y) @@ -478,28 +478,28 @@ return pcb_round(rv); } -static inline int Vz(Coord z) +static inline int Vz(pcb_coord_t z) { return pcb_round((double)z / gport->view.coord_per_px + 0.5); } -static inline Coord Px(int x) +static inline pcb_coord_t Px(int x) { - Coord rv = x * gport->view.coord_per_px + gport->view.x0; + pcb_coord_t rv = x * gport->view.coord_per_px + gport->view.x0; if (conf_core.editor.view.flip_x) rv = PCB->MaxWidth - (x * gport->view.coord_per_px + gport->view.x0); return rv; } -static inline Coord Py(int y) +static inline pcb_coord_t Py(int y) { - Coord rv = y * gport->view.coord_per_px + gport->view.y0; + pcb_coord_t rv = y * gport->view.coord_per_px + gport->view.y0; if (conf_core.editor.view.flip_y) rv = PCB->MaxHeight - (y * gport->view.coord_per_px + gport->view.y0); return rv; } -static inline Coord Pz(int z) +static inline pcb_coord_t Pz(int z) { return (z * gport->view.coord_per_px); } @@ -518,7 +518,7 @@ void ghid_confchg_all_direction_lines(conf_native_t *cfg); void ghid_confchg_fullscreen(conf_native_t *cfg); void ghid_confchg_checkbox(conf_native_t *cfg); -void ghid_draw_grid_local(Coord cx, Coord cy); +void ghid_draw_grid_local(pcb_coord_t cx, pcb_coord_t cy); void ghid_fullscreen_apply(void); Index: trunk/src_plugins/hid_lesstif/dialogs.c =================================================================== --- trunk/src_plugins/hid_lesstif/dialogs.c (revision 4810) +++ trunk/src_plugins/hid_lesstif/dialogs.c (revision 4811) @@ -90,7 +90,7 @@ %end-doc */ -static int Load(int argc, const char **argv, Coord x, Coord y) +static int Load(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function; char *name; @@ -148,7 +148,7 @@ %end-doc */ -static int LoadVendor(int argc, const char **argv, Coord x, Coord y) +static int LoadVendor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { char *name; XmString xmname, pattern; @@ -201,7 +201,7 @@ %end-doc */ -static int Save(int argc, const char **argv, Coord x, Coord y) +static int Save(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function; char *name; @@ -419,7 +419,7 @@ return ok; } -static int ConfirmAction(int argc, const char **argv, Coord x, Coord y) +static int ConfirmAction(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int rv = lesstif_confirm_dialog(argc > 0 ? argv[0] : 0, argc > 1 ? argv[1] : 0, @@ -542,7 +542,7 @@ %end-doc */ -static int PromptFor(int argc, const char **argv, Coord x, Coord y) +static int PromptFor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { char *rv = lesstif_prompt_for(argc > 0 ? argv[0] : 0, argc > 1 ? argv[1] : 0); @@ -821,7 +821,7 @@ %end-doc */ -static int DoWindows(int argc, const char **argv, Coord x, Coord y) +static int DoWindows(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *a = argc == 1 ? argv[0] : ""; if (strcmp(a, "1") == 0 || strcasecmp(a, "Layout") == 0) { @@ -857,7 +857,7 @@ %end-doc */ -static int About(int argc, const char **argv, Coord x, Coord y) +static int About(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { static Widget about = 0; if (!about) { @@ -887,7 +887,7 @@ %end-doc */ -static int Print(int argc, const char **argv, Coord x, Coord y) +static int Print(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { pcb_hid_attribute_t *opts; pcb_hid_t *printer; @@ -932,7 +932,7 @@ %end-doc */ -static int PrintCalibrate(int argc, const char **argv, Coord x, Coord y) +static int PrintCalibrate(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { pcb_hid_t *printer = hid_find_printer(); printer->calibrate(0.0, 0.0); @@ -955,7 +955,7 @@ %end-doc */ -static int Export(int argc, const char **argv, Coord x, Coord y) +static int Export(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { static Widget selector = 0; pcb_hid_attribute_t *opts; @@ -1040,7 +1040,7 @@ return GetValueEx(buf, NULL, NULL, NULL, conf_core.editor.grid_unit->suffix, NULL); } -static void sz_val2str(Widget w, Coord u, int pcbu) +static void sz_val2str(Widget w, pcb_coord_t u, int pcbu) { static char buf[40]; if (pcbu) @@ -1137,7 +1137,7 @@ %end-doc */ -static int AdjustSizes(int argc, const char **argv, Coord x, Coord y) +static int AdjustSizes(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (!sizes_dialog) { Widget inf, sep; @@ -1438,7 +1438,7 @@ %end-doc */ -static int EditLayerGroups(int argc, const char **argv, Coord x, Coord y) +static int EditLayerGroups(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (!layer_groups_form) { @@ -1832,7 +1832,7 @@ %end-doc */ -static int ImportGUI(int argc, const char **argv, Coord x, Coord y) +static int ImportGUI(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { static int I_am_recursing = 0; static XmString xms_sch = 0, xms_import = 0; Index: trunk/src_plugins/hid_lesstif/lesstif.h =================================================================== --- trunk/src_plugins/hid_lesstif/lesstif.h (revision 4810) +++ trunk/src_plugins/hid_lesstif/lesstif.h (revision 4811) @@ -42,7 +42,7 @@ extern void lesstif_need_idle_proc(void); extern void lesstif_show_crosshair(int); extern void lesstif_invalidate_all(void); -extern void lesstif_coords_to_pcb(int, int, Coord *, Coord *); +extern void lesstif_coords_to_pcb(int, int, pcb_coord_t *, pcb_coord_t *); extern void lesstif_get_xy(const char *msg); extern void lesstif_update_widget_flags(void); extern int lesstif_call_action(const char *, int, char **); Index: trunk/src_plugins/hid_lesstif/library.c =================================================================== --- trunk/src_plugins/hid_lesstif/library.c (revision 4810) +++ trunk/src_plugins/hid_lesstif/library.c (revision 4811) @@ -124,7 +124,7 @@ lib_dfs(l, level+1); } -static int LibraryChanged(int argc, const char **argv, Coord x, Coord y) +static int LibraryChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int i; if (library.data.dir.children.used == 0) @@ -165,7 +165,7 @@ %end-doc */ -static int LibraryShow(int argc, const char **argv, Coord x, Coord y) +static int LibraryShow(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (build_library_dialog()) return 0; Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 4810) +++ trunk/src_plugins/hid_lesstif/main.c (revision 4811) @@ -118,8 +118,8 @@ struct PinoutData *prev, *next; Widget form; Window window; - Coord left, right, top, bottom; /* PCB extents of item */ - Coord x, y; /* PCB coordinates of upper right corner of window */ + pcb_coord_t left, right, top, bottom; /* PCB extents of item */ + pcb_coord_t x, y; /* PCB coordinates of upper right corner of window */ double zoom; /* PCB units per screen pixel */ int v_width, v_height; /* pixels */ void *item; @@ -237,7 +237,7 @@ /* Px converts view->pcb, Vx converts pcb->view */ static inline int - Vx(Coord x) + Vx(pcb_coord_t x) { int rv = (x - view_left_x) / view_zoom + 0.5; if (conf_core.editor.view.flip_x) @@ -245,7 +245,7 @@ return rv; } -static inline int Vy(Coord y) +static inline int Vy(pcb_coord_t y) { int rv = (y - view_top_y) / view_zoom + 0.5; if (conf_core.editor.view.flip_y) @@ -253,12 +253,12 @@ return rv; } -static inline int Vz(Coord z) +static inline int Vz(pcb_coord_t z) { return z / view_zoom + 0.5; } -static inline Coord Px(int x) +static inline pcb_coord_t Px(int x) { if (conf_core.editor.view.flip_x) x = view_width - x; @@ -265,7 +265,7 @@ return x * view_zoom + view_left_x; } -static inline Coord Py(int y) +static inline pcb_coord_t Py(int y) { if (conf_core.editor.view.flip_y) y = view_height - y; @@ -272,12 +272,12 @@ return y * view_zoom + view_top_y; } -static inline Coord Pz(int z) +static inline pcb_coord_t Pz(int z) { return z * view_zoom; } -void lesstif_coords_to_pcb(int vx, int vy, Coord * px, Coord * py) +void lesstif_coords_to_pcb(int vx, int vy, pcb_coord_t * px, pcb_coord_t * py) { *px = Px(vx); *py = Py(vy); @@ -309,7 +309,7 @@ /* Called from the core when it's busy doing something and we need to indicate that to the user. */ -static int Busy(int argc, const char **argv, Coord x, Coord y) +static int Busy(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { static Cursor busy_cursor = 0; if (busy_cursor == 0) @@ -324,7 +324,7 @@ /* Local actions. */ -static int PointCursor(int argc, const char **argv, Coord x, Coord y) +static int PointCursor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (argc > 0) over_point = 1; @@ -334,7 +334,7 @@ return 0; } -static int PCBChanged(int argc, const char **argv, Coord x, Coord y) +static int PCBChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (work_area == 0) return 0; @@ -388,7 +388,7 @@ %end-doc */ -static int SetUnits(int argc, const char **argv, Coord x, Coord y) +static int SetUnits(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const pcb_unit_t *new_unit; if (argc == 0) @@ -448,7 +448,7 @@ %end-doc */ -static int ZoomAction(int argc, const char **argv, Coord x, Coord y) +static int ZoomAction(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *vp; double v; @@ -493,7 +493,7 @@ static int pan_thumb_mode; -static int PanAction(int argc, const char **argv, Coord x, Coord y) +static int PanAction(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int mode; @@ -562,7 +562,7 @@ return 0; } -static int SwapSides(int argc, const char **argv, Coord x, Coord y) +static int SwapSides(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int old_shown_side = conf_core.editor.show_solder_side; int comp_group = GetLayerGroupNumberByNumber(component_silk_layer); @@ -715,7 +715,7 @@ %end-doc */ -static int Command(int argc, const char **argv, Coord x, Coord y) +static int Command(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { XtManageChild(m_cmd_label); XtManageChild(m_cmd); @@ -735,7 +735,7 @@ %end-doc */ -static int Benchmark(int argc, const char **argv, Coord x, Coord y) +static int Benchmark(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int i = 0; time_t start, end; @@ -768,7 +768,7 @@ return 0; } -static int Center(int argc, const char **argv, Coord x, Coord y) +static int Center(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { x = GridFit(x, PCB->Grid, PCB->GridOffsetX); y = GridFit(y, PCB->Grid, PCB->GridOffsetY); @@ -821,7 +821,7 @@ %end-doc */ -static int CursorAction(int argc, const char **argv, Coord x, Coord y) +static int CursorAction(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { pcb_unit_list_t extra_units_x = { {"grid", 0, 0}, @@ -1882,7 +1882,7 @@ int i; double f; char *s; - Coord c; + pcb_coord_t c; } val_union; static Boolean @@ -1901,10 +1901,10 @@ static Boolean pcb_cvt_string_to_coord(Display * d, XrmValue * args, Cardinal * num_args, XrmValue * from, XrmValue * to, XtPointer * data) { - static Coord rv; + static pcb_coord_t rv; rv = GetValue((char *) from->addr, NULL, NULL, NULL); if (to->addr) - *(Coord *) to->addr = rv; + *(pcb_coord_t *) to->addr = rv; else to->addr = (XPointer) & rv; to->size = sizeof(rv); @@ -2041,7 +2041,7 @@ case HID_Coord: r->resource_type = XmStrCast(XtRPCBCoord); r->default_type = XmStrCast(XtRPCBCoord); - r->resource_size = sizeof(Coord); + r->resource_size = sizeof(pcb_coord_t); r->default_addr = &(a->default_val.coord_value); rcount++; break; @@ -2122,7 +2122,7 @@ break; case HID_Coord: if (a->value) - *(Coord *) a->value = v->c; + *(pcb_coord_t *) a->value = v->c; else a->default_val.coord_value = v->c; rcount++; @@ -2170,8 +2170,8 @@ { static XPoint *points = 0; static int npoints = 0; - Coord x1, y1, x2, y2, prevx; - Coord x, y; + pcb_coord_t x1, y1, x2, y2, prevx; + pcb_coord_t x, y; int n; static GC grid_gc = 0; @@ -2240,7 +2240,7 @@ } } -static void mark_delta_to_widget(Coord dx, Coord dy, Widget w) +static void mark_delta_to_widget(pcb_coord_t dx, pcb_coord_t dy, Widget w) { char *buf; double g = coord_to_unit(conf_core.editor.grid_unit, PCB->Grid); @@ -2257,7 +2257,7 @@ buf = pcb_strdup_printf("%m+%+.*mS, %+.*mS", UUNIT, prec, dx, prec, dy); else { pcb_angle_t angle = atan2(dy, -dx) * 180 / M_PI; - Coord dist = Distance(0, 0, dx, dy); + pcb_coord_t dist = Distance(0, 0, dx, dy); buf = pcb_strdup_printf("%m+%+.*mS, %+.*mS (%.*mS, %.2f\260)", UUNIT, prec, dx, prec, dy, prec, dist, angle); } @@ -2269,7 +2269,7 @@ free(buf); } -static int cursor_pos_to_widget(Coord x, Coord y, Widget w, int prev_state) +static int cursor_pos_to_widget(pcb_coord_t x, pcb_coord_t y, Widget w, int prev_state) { int this_state = prev_state; char *buf = NULL; @@ -2369,12 +2369,12 @@ region.X2 = Px(view_width); region.Y2 = Py(view_height); if (conf_core.editor.view.flip_x) { - Coord tmp = region.X1; + pcb_coord_t tmp = region.X1; region.X1 = region.X2; region.X2 = tmp; } if (conf_core.editor.view.flip_y) { - Coord tmp = region.Y1; + pcb_coord_t tmp = region.Y1; region.Y1 = region.Y2; region.Y2 = tmp; } @@ -2512,8 +2512,8 @@ } { - static Coord old_grid = -1; - static Coord old_gx, old_gy; + static pcb_coord_t old_grid = -1; + static pcb_coord_t old_gx, old_gy; static const pcb_unit_t *old_unit; XmString ms; if (PCB->Grid != old_grid || PCB->GridOffsetX != old_gx || PCB->GridOffsetY != old_gy || conf_core.editor.grid_unit != old_unit) { @@ -2543,7 +2543,7 @@ static const pcb_unit_t *old_grid_unit = NULL; if (view_zoom != old_zoom || conf_core.editor.grid_unit != old_grid_unit) { char *buf = pcb_strdup_printf("%m+%$mS/pix", - conf_core.editor.grid_unit->allow, (Coord) view_zoom); + conf_core.editor.grid_unit->allow, (pcb_coord_t) view_zoom); XmString ms; old_zoom = view_zoom; @@ -3031,7 +3031,7 @@ gc->cap = style; } -static void lesstif_set_line_width(pcb_hid_gc_t gc, Coord width) +static void lesstif_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { gc->width = width; } @@ -3043,7 +3043,7 @@ #define ISORT(a,b) if (a>b) { a^=b; b^=a; a^=b; } -static void lesstif_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void lesstif_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { double dx1, dy1, dx2, dy2; int vw = Vz(gc->width); @@ -3083,7 +3083,7 @@ } } -static void lesstif_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord width, Coord height, pcb_angle_t start_angle, pcb_angle_t delta_angle) +static void lesstif_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t delta_angle) { if ((pinout || conf_core.editor.thin_draw) && gc->erase) return; @@ -3128,7 +3128,7 @@ #endif } -static void lesstif_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void lesstif_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { int vw = Vz(gc->width); if ((pinout || conf_core.editor.thin_draw) && gc->erase) @@ -3161,7 +3161,7 @@ XDrawRectangle(display, mask_bitmap, mask_gc, x1, y1, x2 - x1 + 1, y2 - y1 + 1); } -static void lesstif_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +static void lesstif_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { if (pinout && use_mask && gc->erase) return; @@ -3186,7 +3186,7 @@ XFillArc(display, mask_bitmap, mask_gc, cx, cy, radius * 2, radius * 2, 0, 360 * 64); } -static void lesstif_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y) +static void lesstif_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { static XPoint *p = 0; static int maxp = 0; @@ -3213,7 +3213,7 @@ XFillPolygon(display, mask_bitmap, mask_gc, p, n_coords, Complex, CoordModeOrigin); } -static void lesstif_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void lesstif_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { int vw = Vz(gc->width); if ((pinout || conf_core.editor.thin_draw) && gc->erase) @@ -3266,7 +3266,7 @@ return alt_pressed; } -extern void lesstif_get_coords(const char *msg, Coord * x, Coord * y); +extern void lesstif_get_coords(const char *msg, pcb_coord_t * x, pcb_coord_t * y); static void lesstif_set_crosshair(int x, int y, int action) { Index: trunk/src_plugins/hid_lesstif/menu.c =================================================================== --- trunk/src_plugins/hid_lesstif/menu.c (revision 4810) +++ trunk/src_plugins/hid_lesstif/menu.c (revision 4811) @@ -49,7 +49,7 @@ %end-doc */ -static int GetXY(int argc, const char **argv, Coord x, Coord y) +static int GetXY(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { return 0; } @@ -78,7 +78,7 @@ extern Widget lesstif_m_layer; -static int LayersChanged(int argc, const char **argv, Coord x, Coord y) +static int LayersChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int l, i, set; const char *name; @@ -309,7 +309,7 @@ %end-doc */ -static int SelectLayer(int argc, const char **argv, Coord x, Coord y) +static int SelectLayer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int newl; if (argc == 0) @@ -342,7 +342,7 @@ %end-doc */ -static int ToggleView(int argc, const char **argv, Coord x, Coord y) +static int ToggleView(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int i, l; @@ -612,7 +612,7 @@ XtUnmanageChild(m_click); } -void lesstif_get_coords(const char *msg, Coord * px, Coord * py) +void lesstif_get_coords(const char *msg, pcb_coord_t * px, pcb_coord_t * py) { if (!have_xy && msg) lesstif_get_xy(msg); Index: trunk/src_plugins/hid_lesstif/netlist.c =================================================================== --- trunk/src_plugins/hid_lesstif/netlist.c (revision 4810) +++ trunk/src_plugins/hid_lesstif/netlist.c (revision 4811) @@ -32,7 +32,7 @@ static int n_netnode_strings; static int last_pick = -1; -static int LesstifNetlistChanged(int argc, const char **argv, Coord x, Coord y); +static int LesstifNetlistChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y); static void pick_net(int pick) { @@ -343,7 +343,7 @@ return 0; } -static int LesstifNetlistChanged(int argc, const char **argv, Coord x, Coord y) +static int LesstifNetlistChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int i; if (!PCB->NetlistLib[NETLIST_EDITED].MenuN) @@ -372,7 +372,7 @@ %end-doc */ -static int LesstifNetlistShow(int argc, const char **argv, Coord x, Coord y) +static int LesstifNetlistShow(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (build_netlist_dialog()) return 0; Index: trunk/src_plugins/hid_lesstif/styles.c =================================================================== --- trunk/src_plugins/hid_lesstif/styles.c (revision 4810) +++ trunk/src_plugins/hid_lesstif/styles.c (revision 4811) @@ -80,9 +80,9 @@ "Thickness", "Diameter", "Hole", "Clearance" }; -static int RouteStylesChanged(int argc, const char **argv, Coord x, Coord y); +static int RouteStylesChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y); -static void update_one_value(int i, Coord v) +static void update_one_value(int i, pcb_coord_t v) { char buf[100]; @@ -309,7 +309,7 @@ %end-doc */ -static int AdjustStyle(int argc, const char **argv, Coord x, Coord y) +static int AdjustStyle(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if ((!mainwind) || (PCB->RouteStyle.array == NULL)) return 1; @@ -372,7 +372,7 @@ return 0; } -static int RouteStylesChanged(int argc, const char **argv, Coord x, Coord y) +static int RouteStylesChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int i, j, h; if (!PCB || vtroutestyle_len(&PCB->RouteStyle) == 0) Index: trunk/src_plugins/hid_remote/proto.c =================================================================== --- trunk/src_plugins/hid_remote/proto.c (revision 4810) +++ trunk/src_plugins/hid_remote/proto.c (revision 4811) @@ -154,7 +154,7 @@ send_end(&pctx); } -void proto_send_set_line_width(int gc, Coord width) +void proto_send_set_line_width(int gc, pcb_coord_t width) { send_begin(&pctx, "linwid"); send_open(&pctx, 0); @@ -174,7 +174,7 @@ send_end(&pctx); } -void proto_send_draw_line(int gc, Coord x1, Coord y1, Coord x2, Coord y2) +void proto_send_draw_line(int gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { send_begin(&pctx, "line"); send_open(&pctx, 0); @@ -187,7 +187,7 @@ send_end(&pctx); } -void proto_send_draw_rect(int gc, Coord x1, Coord y1, Coord x2, Coord y2, int is_filled) +void proto_send_draw_rect(int gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, int is_filled) { send_begin(&pctx, "rect"); send_open(&pctx, 0); @@ -201,7 +201,7 @@ send_end(&pctx); } -void proto_send_fill_circle(int gc, Coord cx, Coord cy, Coord radius) +void proto_send_fill_circle(int gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { send_begin(&pctx, "fcirc"); send_open(&pctx, 0); @@ -213,7 +213,7 @@ send_end(&pctx); } -void proto_send_draw_poly(int gc, int n_coords, Coord * x, Coord * y) +void proto_send_draw_poly(int gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { int n; send_begin(&pctx, "poly"); Index: trunk/src_plugins/hid_remote/proto.h =================================================================== --- trunk/src_plugins/hid_remote/proto.h (revision 4810) +++ trunk/src_plugins/hid_remote/proto.h (revision 4811) @@ -34,12 +34,12 @@ int proto_send_del_gc(int gc); void proto_send_set_color(int gc, const char *name); void proto_send_set_line_cap(int gc, char style); -void proto_send_set_line_width(int gc, Coord width); +void proto_send_set_line_width(int gc, pcb_coord_t width); void proto_send_set_draw_xor(int gc, int xor_set); -void proto_send_draw_line(int gc, Coord x1, Coord y1, Coord x2, Coord y2); -void proto_send_draw_rect(int gc, Coord x1, Coord y1, Coord x2, Coord y2, int is_filled); -void proto_send_fill_circle(int gc, Coord cx, Coord cy, Coord radius); -void proto_send_draw_poly(int gc, int n_coords, Coord * x, Coord * y); +void proto_send_draw_line(int gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); +void proto_send_draw_rect(int gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, int is_filled); +void proto_send_fill_circle(int gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius); +void proto_send_draw_poly(int gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y); int proto_send_use_mask(const char *name); int remote_proto_parse_all(); Index: trunk/src_plugins/hid_remote/remote.c =================================================================== --- trunk/src_plugins/hid_remote/remote.c (revision 4810) +++ trunk/src_plugins/hid_remote/remote.c (revision 4811) @@ -35,23 +35,23 @@ /* ----------------------------------------------------------------------------- */ -static int nop(int argc, const char **argv, Coord x, Coord y) +static int nop(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { return 0; } -static int PCBChanged(int argc, const char **argv, Coord x, Coord y) +static int PCBChanged(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { return 0; } -static int help(int argc, const char **argv, Coord x, Coord y) +static int help(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { print_actions(); return 0; } -static int info(int argc, const char **argv, Coord x, Coord y) +static int info(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { return 0; } @@ -129,7 +129,7 @@ typedef struct { char color[64]; - Coord line_width; + pcb_coord_t line_width; char cap; } remote_gc_cache_t; static hid_gc_s remote_gc[32]; @@ -208,7 +208,7 @@ } } -static void remote_set_line_width(pcb_hid_gc_t gc, Coord width) +static void remote_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { int idx = gc2idx(gc); if (idx >= 0) { @@ -226,7 +226,7 @@ proto_send_set_draw_xor(idx, xor_set); } -static void remote_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void remote_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { int idx = gc2idx(gc); if (idx >= 0) @@ -233,12 +233,12 @@ proto_send_draw_line(idx, x1, y1, x2, y2); } -static void remote_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord width, Coord height, pcb_angle_t start_angle, pcb_angle_t end_angle) +static void remote_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t width, pcb_coord_t height, pcb_angle_t start_angle, pcb_angle_t end_angle) { #warning TODO } -static void remote_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void remote_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { int idx = gc2idx(gc); if (idx >= 0) @@ -245,7 +245,7 @@ proto_send_draw_rect(idx, x1, y1, x2, y2, 0); } -static void remote_fill_circle(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord radius) +static void remote_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius) { int idx = gc2idx(gc); if (idx >= 0) @@ -252,7 +252,7 @@ proto_send_fill_circle(idx, cx, cy, radius); } -static void remote_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord * x, Coord * y) +static void remote_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t * x, pcb_coord_t * y) { int idx = gc2idx(gc); if (idx >= 0) @@ -259,7 +259,7 @@ proto_send_draw_poly(idx, n_coords, x, y); } -static void remote_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) +static void remote_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { int idx = gc2idx(gc); if (idx >= 0) @@ -285,7 +285,7 @@ return 0; } -static void remote_get_coords(const char *msg, Coord * x, Coord * y) +static void remote_get_coords(const char *msg, pcb_coord_t * x, pcb_coord_t * y) { } Index: trunk/src_plugins/import_dsn/dsn.c =================================================================== --- trunk/src_plugins/import_dsn/dsn.c (revision 4810) +++ trunk/src_plugins/import_dsn/dsn.c (revision 4811) @@ -84,7 +84,7 @@ %end-doc */ -int ActionLoadDsnFrom(int argc, const char **argv, Coord x, Coord y) +int ActionLoadDsnFrom(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *fname = NULL; static char *default_file = NULL; @@ -91,8 +91,8 @@ char str[200]; FILE *fp; int ret; - Coord dim1, dim2, x0 = 0, y0 = 0, x1, y1; - Coord linethick = 0, lineclear, viadiam, viadrill; + pcb_coord_t dim1, dim2, x0 = 0, y0 = 0, x1, y1; + pcb_coord_t linethick = 0, lineclear, viadiam, viadrill; char lname[200]; pcb_layer_t *rlayer = NULL; pcb_line_t *line = NULL; Index: trunk/src_plugins/import_hyp/import_hyp.c =================================================================== --- trunk/src_plugins/import_hyp/import_hyp.c (revision 4810) +++ trunk/src_plugins/import_hyp/import_hyp.c (revision 4811) @@ -49,7 +49,7 @@ static const char load_hyp_help[] = "Loads the specified hyp resource file."; -int ActionLoadhypFrom(int argc, const char **argv, Coord x, Coord y) +int ActionLoadhypFrom(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *fname = NULL; fname = argc ? argv[0] : 0; Index: trunk/src_plugins/import_sch/import_sch.c =================================================================== --- trunk/src_plugins/import_sch/import_sch.c (revision 4810) +++ trunk/src_plugins/import_sch/import_sch.c (revision 4811) @@ -51,7 +51,7 @@ conf_import_sch_t conf_import_sch; -extern int ActionExecuteFile(int argc, const char **argv, Coord x, Coord y); +extern int ActionExecuteFile(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y); /* ---------------------------------------------------------------- */ static const char import_syntax[] = @@ -169,7 +169,7 @@ %end-doc */ -static int ActionImport(int argc, const char **argv, Coord x, Coord y) +static int ActionImport(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *mode; const char **sources = NULL; @@ -204,7 +204,7 @@ if (mode && strcasecmp(mode, "setnewpoint") == 0) { const char *xs, *ys, *units; - Coord x, y; + pcb_coord_t x, y; char buf[50]; xs = ACTION_ARG(1); Index: trunk/src_plugins/io_kicad/read.c =================================================================== --- trunk/src_plugins/io_kicad/read.c (revision 4810) +++ trunk/src_plugins/io_kicad/read.c (revision 4811) @@ -171,7 +171,7 @@ char *end, *text; double val; - Coord X, Y; + pcb_coord_t X, Y; int scaling = 100; int textLength = 0; int mirrored = 0; @@ -348,7 +348,7 @@ char *end; double val; - Coord X1, Y1, X2, Y2, Thickness, Clearance; /* not sure what to do with mask */ + pcb_coord_t X1, Y1, X2, Y2, Thickness, Clearance; /* not sure what to do with mask */ pcb_flag_t Flags = MakeFlags(0); /* start with something bland here */ int PCBLayer = 0; /* sane default value */ @@ -469,7 +469,7 @@ char *end; double val; - Coord centreX, centreY, endX, endY, width, height, Thickness, Clearance; + pcb_coord_t centreX, centreY, endX, endY, width, height, Thickness, Clearance; pcb_angle_t startAngle = 0.0; pcb_angle_t delta = 360.0; /* these defaults allow a gr_circle to be parsed, which does not specify (angle XXX) */ pcb_flag_t Flags = MakeFlags(0); /* start with something bland here */ @@ -626,7 +626,7 @@ char *end, *name; /* not using via name for now */ double val; - Coord X, Y, Thickness, Clearance, Mask, Drill; /* not sure what to do with mask */ + pcb_coord_t X, Y, Thickness, Clearance, Mask, Drill; /* not sure what to do with mask */ pcb_flag_t Flags = MakeFlags(0); /* start with something bland here */ /* int PCBLayer = 0; not used for now; no blind or buried vias currently in pcb-rnd */ @@ -720,7 +720,7 @@ char *end; double val; - Coord X1, Y1, X2, Y2, Thickness, Clearance; + pcb_coord_t X1, Y1, X2, Y2, Thickness, Clearance; pcb_flag_t Flags = MakeFlags(PCB_FLAG_CLEARLINE); /* we try clearline flag here */ int PCBLayer = 0; /* sane default value */ @@ -990,7 +990,7 @@ int foundRefdes = 0; int refdesScaling = 100; unsigned long tally = 0, featureTally, required; - Coord moduleX, moduleY, X, Y, X1, Y1, X2, Y2, centreX, centreY, endX, endY, width, height, Thickness, Clearance, padXsize, padYsize, drill, refdesX, refdesY; + pcb_coord_t moduleX, moduleY, X, Y, X1, Y1, X2, Y2, centreX, centreY, endX, endY, width, height, Thickness, Clearance, padXsize, padYsize, drill, refdesX, refdesY; pcb_angle_t startAngle = 0.0; pcb_angle_t endAngle = 0.0; pcb_angle_t delta = 360.0; /* these defaults allow a fp_circle to be parsed, which does not specify (angle XXX) */ @@ -1826,7 +1826,7 @@ pcb_flag_t flags = MakeFlags(PCB_FLAG_CLEARPOLY); char *end; double val; - Coord X, Y; + pcb_coord_t X, Y; int PCBLayer = 0; if (subtree->str != NULL) { Index: trunk/src_plugins/io_kicad/write.c =================================================================== --- trunk/src_plugins/io_kicad/write.c (revision 4810) +++ trunk/src_plugins/io_kicad/write.c (revision 4811) @@ -97,7 +97,7 @@ int layer = 0; int currentKicadLayer = 0; int currentGroup = 0; - Coord outlineThickness = PCB_MIL_TO_COORD(10); + pcb_coord_t outlineThickness = PCB_MIL_TO_COORD(10); int bottomCount; int *bottomLayers; @@ -112,8 +112,8 @@ int outlineCount; int *outlineLayers; - Coord LayoutXOffset; - Coord LayoutYOffset; + pcb_coord_t LayoutXOffset; + pcb_coord_t LayoutYOffset; /* Kicad expects a layout "sheet" size to be specified in mils, and A4, A3 etc... */ int A4HeightMil = 8267; @@ -502,7 +502,7 @@ */ -int write_kicad_layout_vias(FILE * FP, pcb_data_t *Data, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation) +int write_kicad_layout_vias(FILE * FP, pcb_data_t *Data, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation) { gdl_iterator_t it; pcb_pin_t *via; @@ -570,7 +570,7 @@ } int write_kicad_layout_tracks(FILE * FP, pcb_cardinal_t number, - pcb_layer_t *layer, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation) + pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation) { gdl_iterator_t it; pcb_line_t *line; @@ -608,7 +608,7 @@ } int write_kicad_layout_arcs(FILE * FP, pcb_cardinal_t number, - pcb_layer_t *layer, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation) + pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation) { gdl_iterator_t it; pcb_arc_t *arc; @@ -615,7 +615,7 @@ pcb_arc_t localArc; /* for converting ellipses to circular arcs */ pcb_box_t *boxResult; /* for figuring out arc ends */ pcb_cardinal_t currentLayer = number; - Coord radius, xStart, yStart, xEnd, yEnd; + pcb_coord_t radius, xStart, yStart, xEnd, yEnd; int copperStartX; /* used for mapping geda copper arcs onto kicad copper lines */ int copperStartY; /* used for mapping geda copper arcs onto kicad copper lines */ @@ -670,21 +670,21 @@ } int write_kicad_layout_text(FILE * FP, pcb_cardinal_t number, - pcb_layer_t *layer, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation) + pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation) { pcb_font_t *myfont = &PCB->Font; - Coord mWidth = myfont->MaxWidth; /* kicad needs the width of the widest letter */ - Coord defaultStrokeThickness = 100*2540; /* use 100 mil as default 100% stroked font line thickness */ + pcb_coord_t mWidth = myfont->MaxWidth; /* kicad needs the width of the widest letter */ + pcb_coord_t defaultStrokeThickness = 100*2540; /* use 100 mil as default 100% stroked font line thickness */ int kicadMirrored = 1; /* 1 is not mirrored, 0 is mirrored */ - Coord defaultXSize; - Coord defaultYSize; - Coord strokeThickness; + pcb_coord_t defaultXSize; + pcb_coord_t defaultYSize; + pcb_coord_t strokeThickness; int rotation; - Coord textOffsetX; - Coord textOffsetY; - Coord halfStringWidth; - Coord halfStringHeight; + pcb_coord_t textOffsetX; + pcb_coord_t textOffsetY; + pcb_coord_t halfStringWidth; + pcb_coord_t halfStringHeight; int localFlag; gdl_iterator_t it; @@ -806,7 +806,7 @@ pcb_element_t *element; pcb_box_t *boxResult; - Coord arcStartX, arcStartY, arcEndX, arcEndY; /* for arc exporting */ + pcb_coord_t arcStartX, arcStartY, arcEndX, arcEndY; /* for arc exporting */ unm_t group1; /* group used to deal with missing names and provide unique ones if needed */ const char * currentElementName; @@ -1033,14 +1033,14 @@ /* --------------------------------------------------------------------------- * writes element data in kicad legacy format for use in a layout .brd file */ -int write_kicad_layout_elements(FILE * FP, pcb_board_t *Layout, pcb_data_t *Data, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation) +int write_kicad_layout_elements(FILE * FP, pcb_board_t *Layout, pcb_data_t *Data, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation) { gdl_iterator_t eit; pcb_line_t *line; pcb_arc_t *arc; - Coord arcStartX, arcStartY, arcEndX, arcEndY; /* for arc rendering */ - Coord xPos, yPos; + pcb_coord_t arcStartX, arcStartY, arcEndX, arcEndY; /* for arc rendering */ + pcb_coord_t xPos, yPos; pcb_element_t *element; unm_t group1; /* group used to deal with missing names and provide unique ones if needed */ @@ -1255,7 +1255,7 @@ */ int write_kicad_layout_polygons(FILE * FP, pcb_cardinal_t number, - pcb_layer_t *layer, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation) + pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation) { int i, j; gdl_iterator_t it; Index: trunk/src_plugins/io_kicad/write.h =================================================================== --- trunk/src_plugins/io_kicad/write.h (revision 4810) +++ trunk/src_plugins/io_kicad/write.h (revision 4811) @@ -34,14 +34,14 @@ int io_kicad_write_pcb(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency); int write_kicad_module_header(FILE * FP, pcb_cardinal_t indentation); int write_kicad_layout_header(FILE * FP, pcb_cardinal_t indentation); -int write_kicad_layout_vias(FILE * FP, pcb_data_t *Data, Coord MaxWidth, Coord MaxHeight, pcb_cardinal_t indentation); +int write_kicad_layout_vias(FILE * FP, pcb_data_t *Data, pcb_coord_t MaxWidth, pcb_coord_t MaxHeight, pcb_cardinal_t indentation); int write_kicad_layout_tracks(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer, - Coord MaxWidth, Coord MaxHeight, pcb_cardinal_t indentation); + pcb_coord_t MaxWidth, pcb_coord_t MaxHeight, pcb_cardinal_t indentation); int write_kicad_layout_arcs(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer, - Coord xOffset, Coord yOffset, pcb_cardinal_t indentation); + pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation); int write_kicad_layout_text(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer, - Coord xOffset, Coord yOffset, pcb_cardinal_t indentation); + pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation); int write_kicad_equipotential_netlists(FILE * FP, pcb_board_t *Layout, pcb_cardinal_t indentation); -int write_kicad_layout_elements(FILE * FP, pcb_board_t *Layout, pcb_data_t *Data, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation); -int write_kicad_layout_polygons(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer, Coord xOffset, Coord yOffset, pcb_cardinal_t indentation); +int write_kicad_layout_elements(FILE * FP, pcb_board_t *Layout, pcb_data_t *Data, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation); +int write_kicad_layout_polygons(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset, pcb_cardinal_t indentation); Index: trunk/src_plugins/io_kicad_legacy/write.c =================================================================== --- trunk/src_plugins/io_kicad_legacy/write.c (revision 4810) +++ trunk/src_plugins/io_kicad_legacy/write.c (revision 4811) @@ -92,7 +92,7 @@ int layer = 0; int currentKicadLayer = 0; int currentGroup = 0; - Coord outlineThickness = PCB_MIL_TO_COORD(10); + pcb_coord_t outlineThickness = PCB_MIL_TO_COORD(10); int bottomCount; int *bottomLayers; @@ -107,8 +107,8 @@ int outlineCount; int *outlineLayers; - Coord LayoutXOffset; - Coord LayoutYOffset; + pcb_coord_t LayoutXOffset; + pcb_coord_t LayoutYOffset; /* Kicad expects a layout "sheet" size to be specified in mils, and A4, A3 etc... */ int A4HeightMil = 8267; @@ -505,7 +505,7 @@ */ -int write_kicad_legacy_layout_vias(FILE * FP, pcb_data_t *Data, Coord xOffset, Coord yOffset) +int write_kicad_legacy_layout_vias(FILE * FP, pcb_data_t *Data, pcb_coord_t xOffset, pcb_coord_t yOffset) { gdl_iterator_t it; pcb_pin_t *via; @@ -529,7 +529,7 @@ } int write_kicad_legacy_layout_tracks(FILE * FP, pcb_cardinal_t number, - pcb_layer_t *layer, Coord xOffset, Coord yOffset) + pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset) { gdl_iterator_t it; pcb_line_t *line; @@ -569,7 +569,7 @@ } int write_kicad_legacy_layout_arcs(FILE * FP, pcb_cardinal_t number, - pcb_layer_t *layer, Coord xOffset, Coord yOffset) + pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset) { gdl_iterator_t it; pcb_arc_t *arc; @@ -576,7 +576,7 @@ pcb_arc_t localArc; /* for converting ellipses to circular arcs */ pcb_box_t *boxResult; /* for figuring out arc ends */ pcb_cardinal_t currentLayer = number; - Coord radius, xStart, yStart, xEnd, yEnd; + pcb_coord_t radius, xStart, yStart, xEnd, yEnd; int copperStartX; /* used for mapping geda copper arcs onto kicad copper lines */ int copperStartY; /* used for mapping geda copper arcs onto kicad copper lines */ @@ -634,21 +634,21 @@ } int write_kicad_legacy_layout_text(FILE * FP, pcb_cardinal_t number, - pcb_layer_t *layer, Coord xOffset, Coord yOffset) + pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset) { pcb_font_t *myfont = &PCB->Font; - Coord mWidth = myfont->MaxWidth; /* kicad needs the width of the widest letter */ - Coord defaultStrokeThickness = 100*2540; /* use 100 mil as default 100% stroked font line thickness */ + pcb_coord_t mWidth = myfont->MaxWidth; /* kicad needs the width of the widest letter */ + pcb_coord_t defaultStrokeThickness = 100*2540; /* use 100 mil as default 100% stroked font line thickness */ int kicadMirrored = 1; /* 1 is not mirrored, 0 is mirrored */ - Coord defaultXSize; - Coord defaultYSize; - Coord strokeThickness; + pcb_coord_t defaultXSize; + pcb_coord_t defaultYSize; + pcb_coord_t strokeThickness; int rotation; - Coord textOffsetX; - Coord textOffsetY; - Coord halfStringWidth; - Coord halfStringHeight; + pcb_coord_t textOffsetX; + pcb_coord_t textOffsetY; + pcb_coord_t halfStringWidth; + pcb_coord_t halfStringHeight; int localFlag; gdl_iterator_t it; @@ -766,7 +766,7 @@ pcb_element_t *element; pcb_box_t *boxResult; - Coord arcStartX, arcStartY, arcEndX, arcEndY; /* for arc exporting */ + pcb_coord_t arcStartX, arcStartY, arcEndX, arcEndY; /* for arc exporting */ unm_t group1; /* group used to deal with missing names and provide unique ones if needed */ const char * currentElementName; @@ -988,14 +988,14 @@ /* --------------------------------------------------------------------------- * writes element data in kicad legacy format for use in a layout .brd file */ -int write_kicad_legacy_layout_elements(FILE * FP, pcb_board_t *Layout, pcb_data_t *Data, Coord xOffset, Coord yOffset) +int write_kicad_legacy_layout_elements(FILE * FP, pcb_board_t *Layout, pcb_data_t *Data, pcb_coord_t xOffset, pcb_coord_t yOffset) { gdl_iterator_t eit; pcb_line_t *line; pcb_arc_t *arc; - Coord arcStartX, arcStartY, arcEndX, arcEndY; /* for arc rendering */ - Coord xPos, yPos; + pcb_coord_t arcStartX, arcStartY, arcEndX, arcEndY; /* for arc rendering */ + pcb_coord_t xPos, yPos; pcb_element_t *element; unm_t group1; /* group used to deal with missing names and provide unique ones if needed */ @@ -1185,7 +1185,7 @@ */ int write_kicad_legacy_layout_polygons(FILE * FP, pcb_cardinal_t number, - pcb_layer_t *layer, Coord xOffset, Coord yOffset) + pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset) { int i, j; gdl_iterator_t it; Index: trunk/src_plugins/io_kicad_legacy/write.h =================================================================== --- trunk/src_plugins/io_kicad_legacy/write.h (revision 4810) +++ trunk/src_plugins/io_kicad_legacy/write.h (revision 4811) @@ -34,14 +34,14 @@ int io_kicad_legacy_write_pcb(pcb_plug_io_t *ctx, FILE * FP, const char *old_filename, const char *new_filename, pcb_bool emergency); int write_kicad_legacy_module_header(FILE * FP); int write_kicad_legacy_layout_header(FILE * FP); -int write_kicad_legacy_layout_vias(FILE * FP, pcb_data_t *Data, Coord MaxWidth, Coord MaxHeight); +int write_kicad_legacy_layout_vias(FILE * FP, pcb_data_t *Data, pcb_coord_t MaxWidth, pcb_coord_t MaxHeight); int write_kicad_legacy_layout_tracks(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer, - Coord MaxWidth, Coord MaxHeight); + pcb_coord_t MaxWidth, pcb_coord_t MaxHeight); int write_kicad_legacy_layout_arcs(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer, - Coord xOffset, Coord yOffset); + pcb_coord_t xOffset, pcb_coord_t yOffset); int write_kicad_legacy_layout_text(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer, - Coord xOffset, Coord yOffset); + pcb_coord_t xOffset, pcb_coord_t yOffset); int write_kicad_legacy_equipotential_netlists(FILE * FP, pcb_board_t *Layout); -int write_kicad_legacy_layout_elements(FILE * FP, pcb_board_t *Layout, pcb_data_t *Data, Coord xOffset, Coord yOffset); -int write_kicad_legacy_layout_polygons(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer, Coord xOffset, Coord yOffset); +int write_kicad_legacy_layout_elements(FILE * FP, pcb_board_t *Layout, pcb_data_t *Data, pcb_coord_t xOffset, pcb_coord_t yOffset); +int write_kicad_legacy_layout_polygons(FILE * FP, pcb_cardinal_t number, pcb_layer_t *layer, pcb_coord_t xOffset, pcb_coord_t yOffset); Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 4810) +++ trunk/src_plugins/io_lihata/read.c (revision 4811) @@ -82,8 +82,8 @@ return 0; } -/* Load the Coord value of a text node into res. Return 0 on success */ -static int parse_coord(Coord *res, lht_node_t *nd) +/* Load the pcb_coord_t value of a text node into res. Return 0 on success */ +static int parse_coord(pcb_coord_t *res, lht_node_t *nd) { double tmp; pcb_bool success; @@ -122,7 +122,7 @@ return 0; } -/* Load the Coord value of a text node into res. Return 0 on success */ +/* Load the pcb_coord_t value of a text node into res. Return 0 on success */ static int parse_int(int *res, lht_node_t *nd) { long int tmp; @@ -336,7 +336,7 @@ } -static int parse_line(pcb_layer_t *ly, pcb_element_t *el, lht_node_t *obj, int no_id, Coord dx, Coord dy) +static int parse_line(pcb_layer_t *ly, pcb_element_t *el, lht_node_t *obj, int no_id, pcb_coord_t dx, pcb_coord_t dy) { pcb_line_t *line; @@ -404,7 +404,7 @@ return 0; } -static int parse_arc(pcb_layer_t *ly, pcb_element_t *el, lht_node_t *obj, Coord dx, Coord dy) +static int parse_arc(pcb_layer_t *ly, pcb_element_t *el, lht_node_t *obj, pcb_coord_t dx, pcb_coord_t dy) { pcb_arc_t *arc; @@ -580,7 +580,7 @@ } /* If el == NULL and dt != NULL it is a via (for now). */ -static int parse_pin(pcb_data_t *dt, pcb_element_t *el, lht_node_t *obj, Coord dx, Coord dy) +static int parse_pin(pcb_data_t *dt, pcb_element_t *el, lht_node_t *obj, pcb_coord_t dx, pcb_coord_t dy) { pcb_pin_t *via; @@ -615,7 +615,7 @@ return 0; } -static int parse_pad(pcb_element_t *el, lht_node_t *obj, Coord dx, Coord dy) +static int parse_pad(pcb_element_t *el, lht_node_t *obj, pcb_coord_t dx, pcb_coord_t dy) { pcb_pad_t *pad; @@ -748,7 +748,7 @@ grp = lht_dom_hash_get(nd, "objects"); for(obj = lht_dom_first(&it, grp); obj != NULL; obj = lht_dom_next(&it)) { - Coord x1, y1, x2, y2, th; + pcb_coord_t x1, y1, x2, y2, th; parse_coord(&x1, lht_dom_hash_get(obj, "x1")); parse_coord(&y1, lht_dom_hash_get(obj, "y1")); parse_coord(&x2, lht_dom_hash_get(obj, "x2")); Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 4810) +++ trunk/src_plugins/io_lihata/write.c (revision 4811) @@ -212,7 +212,7 @@ return hsh; } -static lht_node_t *build_line(pcb_line_t *line, int local_id, Coord dx, Coord dy) +static lht_node_t *build_line(pcb_line_t *line, int local_id, pcb_coord_t dx, pcb_coord_t dy) { char buff[128]; lht_node_t *obj; @@ -251,7 +251,7 @@ return obj; } -static lht_node_t *build_arc(pcb_arc_t *arc, Coord dx, Coord dy) +static lht_node_t *build_arc(pcb_arc_t *arc, pcb_coord_t dx, pcb_coord_t dy) { char buff[128]; lht_node_t *obj; @@ -273,7 +273,7 @@ return obj; } -static lht_node_t *build_pin(pcb_pin_t *pin, int is_via, Coord dx, Coord dy) +static lht_node_t *build_pin(pcb_pin_t *pin, int is_via, pcb_coord_t dx, pcb_coord_t dy) { char buff[128]; lht_node_t *obj; @@ -294,7 +294,7 @@ return obj; } -static lht_node_t *build_pad(pcb_pad_t *pad, Coord dx, Coord dy) +static lht_node_t *build_pad(pcb_pad_t *pad, pcb_coord_t dx, pcb_coord_t dy) { char buff[128]; lht_node_t *obj; @@ -728,7 +728,7 @@ { /* for coords, preserve formatting as long as values match */ if (lhtpers_rule_find(io_lihata_out_coords, inmem_node) != NULL) { - Coord v1, v2; + pcb_coord_t v1, v2; pcb_bool success1, success2; /* fprintf(stderr, "SMART d='%s' m='%s'\n", ondisk_value, inmem_node->data.text.value);*/ Index: trunk/src_plugins/io_pcb/file.h =================================================================== --- trunk/src_plugins/io_pcb/file.h (revision 4810) +++ trunk/src_plugins/io_pcb/file.h (revision 4811) @@ -38,7 +38,7 @@ /* This is used by the lexer/parser */ typedef struct { int ival; - Coord bval; + pcb_coord_t bval; double dval; char has_units; } PLMeasure; Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 4810) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 4811) @@ -145,7 +145,7 @@ int yylex(); static int check_file_version (int); -static void do_measure (PLMeasure *m, Coord i, double d, int u); +static void do_measure (PLMeasure *m, pcb_coord_t i, double d, int u); #define M(r,f,d) do_measure (&(r), f, d, 1) /* Macros for interpreting what "measure" means - integer value only, @@ -155,8 +155,8 @@ #define NU(m) new_units (m) static int integer_value (PLMeasure m); -static Coord old_units (PLMeasure m); -static Coord new_units (PLMeasure m); +static pcb_coord_t old_units (PLMeasure m); +static pcb_coord_t new_units (PLMeasure m); #define YYDEBUG 1 #define YYERROR_VERBOSE 1 @@ -2175,7 +2175,7 @@ case 70: #line 791 "parse_y.y" /* yacc.c:1646 */ { - Coord hole = (OU((yyvsp[-3].measure)) * DEFAULT_DRILLINGHOLE); + pcb_coord_t hole = (OU((yyvsp[-3].measure)) * DEFAULT_DRILLINGHOLE); /* make sure that there's enough copper left */ if (OU((yyvsp[-3].measure)) - hole < MIN_PINORVIACOPPER && @@ -2686,7 +2686,7 @@ case 157: #line 1607 "parse_y.y" /* yacc.c:1646 */ { - Coord hole = OU ((yyvsp[-3].measure)) * DEFAULT_DRILLINGHOLE; + pcb_coord_t hole = OU ((yyvsp[-3].measure)) * DEFAULT_DRILLINGHOLE; char p_number[8]; /* make sure that there's enough copper left */ @@ -3218,7 +3218,7 @@ } static void -do_measure (PLMeasure *m, Coord i, double d, int u) +do_measure (PLMeasure *m, pcb_coord_t i, double d, int u) { m->ival = i; m->bval = pcb_round (d); @@ -3234,7 +3234,7 @@ return m.ival; } -static Coord +static pcb_coord_t old_units (PLMeasure m) { if (m.has_units) @@ -3242,7 +3242,7 @@ return pcb_round (PCB_MIL_TO_COORD (m.ival)); } -static Coord +static pcb_coord_t new_units (PLMeasure m) { if (m.has_units) Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 4810) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 4811) @@ -82,7 +82,7 @@ int yylex(); static int check_file_version (int); -static void do_measure (PLMeasure *m, Coord i, double d, int u); +static void do_measure (PLMeasure *m, pcb_coord_t i, double d, int u); #define M(r,f,d) do_measure (&(r), f, d, 1) /* Macros for interpreting what "measure" means - integer value only, @@ -92,8 +92,8 @@ #define NU(m) new_units (m) static int integer_value (PLMeasure m); -static Coord old_units (PLMeasure m); -static Coord new_units (PLMeasure m); +static pcb_coord_t old_units (PLMeasure m); +static pcb_coord_t new_units (PLMeasure m); #define YYDEBUG 1 #define YYERROR_VERBOSE 1 @@ -789,7 +789,7 @@ /* old format: x, y, thickness, name, flags */ : T_VIA '(' measure measure measure STRING INTEGER ')' { - Coord hole = (OU($5) * DEFAULT_DRILLINGHOLE); + pcb_coord_t hole = (OU($5) * DEFAULT_DRILLINGHOLE); /* make sure that there's enough copper left */ if (OU($5) - hole < MIN_PINORVIACOPPER && @@ -1605,7 +1605,7 @@ */ : T_PIN '(' measure measure measure STRING INTEGER ')' { - Coord hole = OU ($5) * DEFAULT_DRILLINGHOLE; + pcb_coord_t hole = OU ($5) * DEFAULT_DRILLINGHOLE; char p_number[8]; /* make sure that there's enough copper left */ @@ -2040,7 +2040,7 @@ } static void -do_measure (PLMeasure *m, Coord i, double d, int u) +do_measure (PLMeasure *m, pcb_coord_t i, double d, int u) { m->ival = i; m->bval = pcb_round (d); @@ -2056,7 +2056,7 @@ return m.ival; } -static Coord +static pcb_coord_t old_units (PLMeasure m) { if (m.has_units) @@ -2064,7 +2064,7 @@ return pcb_round (PCB_MIL_TO_COORD (m.ival)); } -static Coord +static pcb_coord_t new_units (PLMeasure m) { if (m.has_units) Index: trunk/src_plugins/jostle/jostle.c =================================================================== --- trunk/src_plugins/jostle/jostle.c (revision 4810) +++ trunk/src_plugins/jostle/jostle.c (revision 4811) @@ -191,7 +191,7 @@ default: /* diagonal case */ { int kx, ky, minmax, dq, ckx, cky; - Coord mm[2] = { MAX_COORD, -MAX_COORD }; + pcb_coord_t mm[2] = { MAX_COORD, -MAX_COORD }; pcb_vector_t mmp[2]; pcb_vnode_t *v; @@ -493,7 +493,7 @@ return 0; } -static int jostle(int argc, const char **argv, Coord x, Coord y) +static int jostle(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { pcb_bool rel; pcb_polyarea_t *expand; Index: trunk/src_plugins/loghid/hid-logger.c =================================================================== --- trunk/src_plugins/loghid/hid-logger.c (revision 4810) +++ trunk/src_plugins/loghid/hid-logger.c (revision 4811) @@ -88,7 +88,7 @@ delegatee_->set_line_cap(gc, style); } -static void log_set_line_width(pcb_hid_gc_t gc, Coord width) { +static void log_set_line_width(pcb_hid_gc_t gc, pcb_coord_t width) { pcb_fprintf(out_, "set_line_width(gc, %d)\n", width); delegatee_->set_line_width(gc, width); } @@ -103,28 +103,28 @@ delegatee_->set_draw_faded(gc, faded); } -static void log_draw_line(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) { +static void log_draw_line(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { pcb_fprintf(out_, "draw_line(gc, %mm, %mm, %mm, %mm)\n", x1, y1, x2, y2); delegatee_->draw_line(gc, x1, y1, x2, y2); } -static void log_draw_arc(pcb_hid_gc_t gc, Coord cx, Coord cy, Coord xradius, Coord yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle) { +static void log_draw_arc(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t xradius, pcb_coord_t yradius, pcb_angle_t start_angle, pcb_angle_t delta_angle) { pcb_fprintf(out_, "draw_arc(gc, %mm, %mm, rx=%mm, ry=%mm, start_angle=%.1f, delta_a=%.1f)\n", cx, cy, xradius, yradius, start_angle, delta_angle); delegatee_->draw_arc(gc, cx, cy, xradius, yradius, start_angle, delta_angle); } -static void log_draw_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) { +static void log_draw_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { pcb_fprintf(out_, "draw_rect(gc, %mm, %mm, %mm, %mm)\n", x1, y1, x2, y2); delegatee_->draw_rect(gc, x1, y1, x2, y2); } -static void log_fill_circle(pcb_hid_gc_t gc, Coord x, Coord y, Coord r) { +static void log_fill_circle(pcb_hid_gc_t gc, pcb_coord_t x, pcb_coord_t y, pcb_coord_t r) { pcb_fprintf(out_, "fill_circle(gc, %mm, %mm, %mm)\n", x, y, r); delegatee_->fill_circle(gc, x, y, r); } -static void log_fill_polygon(pcb_hid_gc_t gc, int n_coords, Coord *x, Coord *y) { +static void log_fill_polygon(pcb_hid_gc_t gc, int n_coords, pcb_coord_t *x, pcb_coord_t *y) { int i; pcb_fprintf(out_, "fill_polygon(gc, %d", n_coords); for (i = 0; i < n_coords; ++i) { @@ -168,7 +168,7 @@ delegatee_->thindraw_pcb_pv(fg, bg, pv, drawHole, mask); } -static void log_fill_rect(pcb_hid_gc_t gc, Coord x1, Coord y1, Coord x2, Coord y2) { +static void log_fill_rect(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2) { pcb_fprintf(out_, "fill_rect(gc, %mm, %mm, %mm, %mm)\n", x1, y1, x2, y2); delegatee_->fill_rect(gc, x1, y1, x2, y2); } Index: trunk/src_plugins/mincut/rats_mincut.c =================================================================== --- trunk/src_plugins/mincut/rats_mincut.c (revision 4810) +++ trunk/src_plugins/mincut/rats_mincut.c (revision 4811) @@ -100,7 +100,7 @@ static int proc_short(pcb_pin_t * pin, pcb_pad_t * pad, int ignore) { find_callback_t old_cb; - Coord x, y; + pcb_coord_t x, y; short_conn_t *n, **lut_by_oid, **lut_by_gid, *next; int gids; gr_t *g; Index: trunk/src_plugins/oldactions/oldactions.c =================================================================== --- trunk/src_plugins/oldactions/oldactions.c (revision 4810) +++ trunk/src_plugins/oldactions/oldactions.c (revision 4811) @@ -107,7 +107,7 @@ } -static int ActionDumpLibrary(int argc, const char **argv, Coord x, Coord y) +static int ActionDumpLibrary(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { dump_lib_any(0, &library); @@ -122,7 +122,7 @@ static const char bell_help[] = "Attempt to produce audible notification (e.g. beep the speaker)."; -static int ActionBell(int argc, const char **argv, Coord x, Coord y) +static int ActionBell(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { gui->beep(); return 0; @@ -153,7 +153,7 @@ %end-doc */ -static int Debug(int argc, const char **argv, Coord x, Coord y) +static int Debug(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int i; printf("Debug:"); @@ -174,7 +174,7 @@ %end-doc */ -static int Return(int argc, const char **argv, Coord x, Coord y) +static int Return(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { return atoi(argv[0]); } @@ -198,7 +198,7 @@ -int djopt_set_auto_only(int argc, const char **argv, Coord x, Coord y) +int djopt_set_auto_only(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { conf_toggle(CFR_DESIGN, "plugins/djopt/auto_only"); return 0; @@ -224,7 +224,7 @@ %end-doc */ -int ActionToggleVendor(int argc, const char **argv, Coord x, Coord y) +int ActionToggleVendor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { conf_toggle(CFR_DESIGN, "plugins/vendor/enable"); return 0; @@ -250,7 +250,7 @@ %end-doc */ -int ActionEnableVendor(int argc, const char **argv, Coord x, Coord y) +int ActionEnableVendor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "1", POL_OVERWRITE); return 0; @@ -274,7 +274,7 @@ %end-doc */ -int ActionDisableVendor(int argc, const char **argv, Coord x, Coord y) +int ActionDisableVendor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { conf_set(CFR_DESIGN, "plugins/vendor/enable", -1, "0", POL_OVERWRITE); return 0; Index: trunk/src_plugins/polycombine/polycombine.c =================================================================== --- trunk/src_plugins/polycombine/polycombine.c (revision 4810) +++ trunk/src_plugins/polycombine/polycombine.c (revision 4811) @@ -268,7 +268,7 @@ return accumulate; } -static int polycombine(int argc, const char **argv, Coord x, Coord y) +static int polycombine(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { pcb_polyarea_t *res; pcb_bool forward; Index: trunk/src_plugins/polystitch/polystitch.c =================================================================== --- trunk/src_plugins/polystitch/polystitch.c (revision 4810) +++ trunk/src_plugins/polystitch/polystitch.c (revision 4811) @@ -227,7 +227,7 @@ RemovePolygon(poly_layer, inner_poly); } -static int polystitch(int argc, const char **argv, Coord x, Coord y) +static int polystitch(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { find_crosshair_poly(x, y); if (inner_poly) { Index: trunk/src_plugins/propedit/propedit.c =================================================================== --- trunk/src_plugins/propedit/propedit.c (revision 4810) +++ trunk/src_plugins/propedit/propedit.c (revision 4811) @@ -34,7 +34,7 @@ #warning TODO static const char propedit_syntax[] = "propedit()"; static const char propedit_help[] = "Run the property editor"; -int propedit_action(int argc, const char **argv, Coord x, Coord y) +int propedit_action(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { pe_ctx_t ctx; htsp_entry_t *pe; @@ -58,7 +58,7 @@ static const char propset_syntax[] = "propset(name, value)"; static const char propset_help[] = "Change the named property of all selected objects to/by value"; -int propset_action(int argc, const char **argv, Coord x, Coord y) +int propset_action(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int res; /* Index: trunk/src_plugins/propedit/props.h =================================================================== --- trunk/src_plugins/propedit/props.h (revision 4810) +++ trunk/src_plugins/propedit/props.h (revision 4811) @@ -45,7 +45,7 @@ typedef union { const char *string; - Coord coord; + pcb_coord_t coord; pcb_angle_t angle; int i; } pcb_propval_t; Index: trunk/src_plugins/propedit/propsel.c =================================================================== --- trunk/src_plugins/propedit/propsel.c (revision 4810) +++ trunk/src_plugins/propedit/propsel.c (revision 4811) @@ -41,12 +41,12 @@ if (!TEST_FLAG(PCB_FLAG_SELECTED, obj)) return; #define type2field_String string -#define type2field_Coord coord +#define type2field_pcb_coord_t coord #define type2field_pcb_angle_t angle #define type2field_int i #define type2TYPE_String PCB_PROPT_STRING -#define type2TYPE_Coord PCB_PROPT_COORD +#define type2TYPE_pcb_coord_t PCB_PROPT_COORD #define type2TYPE_pcb_angle_t PCB_PROPT_ANGLE #define type2TYPE_int PCB_PROPT_INT @@ -92,8 +92,8 @@ static void map_line_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_line_t *line) { map_chk_skip(ctx, line); - map_add_prop(ctx, "p/trace/thickness", Coord, line->Thickness); - map_add_prop(ctx, "p/trace/clearance", Coord, line->Clearance); + map_add_prop(ctx, "p/trace/thickness", pcb_coord_t, line->Thickness); + map_add_prop(ctx, "p/trace/clearance", pcb_coord_t, line->Clearance); map_attr(ctx, &line->Attributes); } @@ -100,10 +100,10 @@ static void map_arc_cb(void *ctx, pcb_board_t *pcb, pcb_layer_t *layer, pcb_arc_t *arc) { map_chk_skip(ctx, arc); - map_add_prop(ctx, "p/trace/thickness", Coord, arc->Thickness); - map_add_prop(ctx, "p/trace/clearance", Coord, arc->Clearance); - map_add_prop(ctx, "p/arc/width", Coord, arc->Width); - map_add_prop(ctx, "p/arc/height", Coord, arc->Height); + map_add_prop(ctx, "p/trace/thickness", pcb_coord_t, arc->Thickness); + map_add_prop(ctx, "p/trace/clearance", pcb_coord_t, arc->Clearance); + map_add_prop(ctx, "p/arc/width", pcb_coord_t, arc->Width); + map_add_prop(ctx, "p/arc/height", pcb_coord_t, arc->Height); map_add_prop(ctx, "p/arc/angle/start", pcb_angle_t, arc->StartAngle); map_add_prop(ctx, "p/arc/angle/delta", pcb_angle_t, arc->Delta); map_attr(ctx, &arc->Attributes); @@ -148,10 +148,10 @@ static void map_epin_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pin_t *pin) { map_chk_skip(ctx, pin); - map_add_prop(ctx, "p/pin/thickness", Coord, pin->Thickness); - map_add_prop(ctx, "p/pin/clearance", Coord, pin->Clearance); - map_add_prop(ctx, "p/pin/mask", Coord, pin->Mask); - map_add_prop(ctx, "p/pin/hole", Coord, pin->DrillingHole); + map_add_prop(ctx, "p/pin/thickness", pcb_coord_t, pin->Thickness); + map_add_prop(ctx, "p/pin/clearance", pcb_coord_t, pin->Clearance); + map_add_prop(ctx, "p/pin/mask", pcb_coord_t, pin->Mask); + map_add_prop(ctx, "p/pin/hole", pcb_coord_t, pin->DrillingHole); map_attr(ctx, &pin->Attributes); } @@ -158,7 +158,7 @@ static void map_epad_cb(void *ctx, pcb_board_t *pcb, pcb_element_t *element, pcb_pad_t *pad) { map_chk_skip(ctx, pad); - map_add_prop(ctx, "p/pad/mask", Coord, pad->Mask); + map_add_prop(ctx, "p/pad/mask", pcb_coord_t, pad->Mask); map_attr(ctx, &pad->Attributes); } @@ -167,10 +167,10 @@ static void map_via_cb(void *ctx, pcb_board_t *pcb, pcb_pin_t *via) { map_chk_skip(ctx, via); - map_add_prop(ctx, "p/via/thickness", Coord, via->Thickness); - map_add_prop(ctx, "p/via/clearance", Coord, via->Clearance); - map_add_prop(ctx, "p/via/mask", Coord, via->Mask); - map_add_prop(ctx, "p/via/hole", Coord, via->DrillingHole); + map_add_prop(ctx, "p/via/thickness", pcb_coord_t, via->Thickness); + map_add_prop(ctx, "p/via/clearance", pcb_coord_t, via->Clearance); + map_add_prop(ctx, "p/via/mask", pcb_coord_t, via->Mask); + map_add_prop(ctx, "p/via/hole", pcb_coord_t, via->DrillingHole); map_attr(ctx, &via->Attributes); } @@ -192,7 +192,7 @@ typedef struct set_ctx_s { const char *name; const char *value; - Coord c; + pcb_coord_t c; double d; pcb_bool c_absolute, d_absolute, c_valid, d_valid, is_trace, is_attr; Index: trunk/src_plugins/puller/puller.c =================================================================== --- trunk/src_plugins/puller/puller.c (revision 4810) +++ trunk/src_plugins/puller/puller.c (revision 4811) @@ -382,7 +382,7 @@ %end-doc */ -static int Puller(int argc, const char **argv, Coord Ux, Coord Uy) +static int Puller(int argc, const char **argv, pcb_coord_t Ux, pcb_coord_t Uy) { double arc_angle, base_angle; #if TRACE1 @@ -2264,7 +2264,7 @@ } #endif -static int GlobalPuller(int argc, const char **argv, Coord x, Coord y) +static int GlobalPuller(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int select_flags = 0; Index: trunk/src_plugins/query/query.h =================================================================== --- trunk/src_plugins/query/query.h (revision 4810) +++ trunk/src_plugins/query/query.h (revision 4811) @@ -48,7 +48,7 @@ union { pcb_obj_t obj; pcb_objlist_t lst; - Coord crd; + pcb_coord_t crd; double dbl; const char *str; } data; @@ -101,7 +101,7 @@ pcb_qry_node_t *next; /* sibling on this level of the tree (or NULL) */ pcb_qry_node_t *parent; union { /* field selection depends on ->type */ - Coord crd; + pcb_coord_t crd; double dbl; const char *str; pcb_query_iter_t *iter_ctx; Index: trunk/src_plugins/query/query_access.c =================================================================== --- trunk/src_plugins/query/query_access.c (revision 4810) +++ trunk/src_plugins/query/query_access.c (revision 4811) @@ -316,7 +316,7 @@ double x = l->Point1.X - l->Point2.X; double y = l->Point1.Y - l->Point2.Y; double len = sqrt(x*x + y*y); - PCB_QRY_RET_INT(res, ((Coord)len)); + PCB_QRY_RET_INT(res, ((pcb_coord_t)len)); } break; default:; @@ -370,7 +370,7 @@ #warning TODO: this breaks for elliptics; see http://tutorial.math.lamar.edu/Classes/CalcII/ArcLength.aspx double r = (a->Width + a->Height)/2; double len = r * M_PI / 180.0 * a->Delta; - PCB_QRY_RET_INT(res, ((Coord)len)); + PCB_QRY_RET_INT(res, ((pcb_coord_t)len)); } break; default:; Index: trunk/src_plugins/query/query_act.c =================================================================== --- trunk/src_plugins/query/query_act.c (revision 4810) +++ trunk/src_plugins/query/query_act.c (revision 4811) @@ -103,7 +103,7 @@ return pcb_qry_run(prg, cb, user_ctx); } -static int query_action(int argc, const char **argv, Coord x, Coord y) +static int query_action(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *cmd = argc > 0 ? argv[0] : 0; select_t sel; Index: trunk/src_plugins/query/query_y.c =================================================================== --- trunk/src_plugins/query/query_y.c (revision 4810) +++ trunk/src_plugins/query/query_y.c (revision 4811) @@ -226,7 +226,7 @@ #line 95 "query_y.y" /* yacc.c:355 */ char *s; - Coord c; + pcb_coord_t c; double d; const pcb_unit_t *u; pcb_qry_node_t *n; Index: trunk/src_plugins/query/query_y.h =================================================================== --- trunk/src_plugins/query/query_y.h (revision 4810) +++ trunk/src_plugins/query/query_y.h (revision 4811) @@ -76,7 +76,7 @@ #line 95 "query_y.y" /* yacc.c:1909 */ char *s; - Coord c; + pcb_coord_t c; double d; const pcb_unit_t *u; pcb_qry_node_t *n; Index: trunk/src_plugins/query/query_y.y =================================================================== --- trunk/src_plugins/query/query_y.y (revision 4810) +++ trunk/src_plugins/query/query_y.y (revision 4811) @@ -94,7 +94,7 @@ %union { char *s; - Coord c; + pcb_coord_t c; double d; const pcb_unit_t *u; pcb_qry_node_t *n; Index: trunk/src_plugins/renumber/renumber.c =================================================================== --- trunk/src_plugins/renumber/renumber.c (revision 4810) +++ trunk/src_plugins/renumber/renumber.c (revision 4811) @@ -54,7 +54,7 @@ #define WTF 0 -static int ActionRenumber(int argc, const char **argv, Coord x, Coord y) +static int ActionRenumber(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { pcb_bool changed = pcb_false; pcb_element_t **element_list; @@ -352,8 +352,8 @@ return 0; } -int action_renumber_block(int argc, const char **argv, Coord x, Coord y); -int action_renumber_buffer(int argc, const char **argv, Coord x, Coord y); +int action_renumber_block(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y); +int action_renumber_buffer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y); static const char *renumber_cookie = "renumber plugin"; Index: trunk/src_plugins/renumber/renumberblock.c =================================================================== --- trunk/src_plugins/renumber/renumberblock.c (revision 4810) +++ trunk/src_plugins/renumber/renumberblock.c (revision 4811) @@ -34,7 +34,7 @@ #include "change.h" #include "conf_core.h" -int action_renumber_block(int argc, const char **argv, Coord x, Coord y) +int action_renumber_block(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { char num_buf[15]; int old_base, new_base; @@ -79,7 +79,7 @@ return 0; } -int action_renumber_buffer(int argc, const char **argv, Coord x, Coord y) +int action_renumber_buffer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { char num_buf[15]; int old_base, new_base; Index: trunk/src_plugins/report/drill.h =================================================================== --- trunk/src_plugins/report/drill.h (revision 4810) +++ trunk/src_plugins/report/drill.h (revision 4811) @@ -29,7 +29,7 @@ #define PCB_DRILL_H typedef struct { /* holds drill information */ - Coord DrillSize; /* this drill's diameter */ + pcb_coord_t DrillSize; /* this drill's diameter */ pcb_cardinal_t ElementN, /* the number of elements using this drill size */ ElementMax, /* max number of elements from malloc() */ PinCount, /* number of pins drilled this size */ Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 4810) +++ trunk/src_plugins/report/report.c (revision 4811) @@ -65,7 +65,7 @@ #define AUSAGE(x) Message (PCB_MSG_INFO, "Usage:\n%s\n", (x##_syntax)) #define USER_UNITMASK (conf_core.editor.grid_unit->allow) -static int ReportDrills(int argc, const char **argv, Coord x, Coord y) +static int ReportDrills(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { DrillInfoTypePtr AllDrills; pcb_cardinal_t n; @@ -122,7 +122,7 @@ %end-doc */ -static int ReportDialog(int argc, const char **argv, Coord x, Coord y) +static int ReportDialog(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { void *ptr1, *ptr2, *ptr3; int type; @@ -323,7 +323,7 @@ } case PCB_TYPE_PAD: { - Coord len; + pcb_coord_t len; pcb_pad_t *Pad; pcb_element_t *element; #ifndef NDEBUG @@ -472,7 +472,7 @@ return 0; } -static int ReportFoundPins(int argc, const char **argv, Coord x, Coord y) +static int ReportFoundPins(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { gds_t list; int col = 0; @@ -505,7 +505,7 @@ * e.g. ResetConnections() has been run. * Does not add its own changes to the undo system */ -static double XYtoNetLength(Coord x, Coord y, int *found) +static double XYtoNetLength(pcb_coord_t x, pcb_coord_t y, int *found) { double length; @@ -546,7 +546,7 @@ return length; } -static int ReportAllNetLengths(int argc, const char **argv, Coord x, Coord y) +static int ReportAllNetLengths(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { int ni; int found; @@ -608,7 +608,7 @@ if (got_one) { char buf[50]; const char *units_name = argv[0]; - Coord length; + pcb_coord_t length; if (argc < 1) units_name = conf_core.editor.grid_unit->suffix; @@ -628,9 +628,9 @@ return 0; } -static int ReportNetLength(int argc, const char **argv, Coord x, Coord y) +static int ReportNetLength(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { - Coord length = 0; + pcb_coord_t length = 0; char *netname = 0; int found = 0; @@ -722,7 +722,7 @@ static int ReportNetLengthByName(const char *tofind, int x, int y) { char *netname = 0; - Coord length = 0; + pcb_coord_t length = 0; int found = 0; int i; pcb_lib_menu_t *net; @@ -866,7 +866,7 @@ %end-doc */ -static int Report(int argc, const char **argv, Coord x, Coord y) +static int Report(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if ((argc < 1) || (argc > 2)) AUSAGE(report); Index: trunk/src_plugins/shand_cmd/command.c =================================================================== --- trunk/src_plugins/shand_cmd/command.c (revision 4810) +++ trunk/src_plugins/shand_cmd/command.c (revision 4811) @@ -76,7 +76,7 @@ %end-doc */ -static int CommandHelp(int argc, const char **argv, Coord x, Coord y) +static int CommandHelp(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { Message(PCB_MSG_DEFAULT, "following commands are supported:\n" " Command() execute an action command (too numerous to list)\n" @@ -110,7 +110,7 @@ %end-doc */ -static int CommandLoadLayout(int argc, const char **argv, Coord x, Coord y) +static int CommandLoadLayout(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *filename, *format = NULL; @@ -146,7 +146,7 @@ %end-doc */ -static int CommandLoadElementToBuffer(int argc, const char **argv, Coord x, Coord y) +static int CommandLoadElementToBuffer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *filename; @@ -180,7 +180,7 @@ %end-doc */ -static int CommandLoadLayoutToBuffer(int argc, const char **argv, Coord x, Coord y) +static int CommandLoadLayoutToBuffer(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *filename, *format = NULL; @@ -215,7 +215,7 @@ %end-doc */ -static int CommandQuit(int argc, const char **argv, Coord x, Coord y) +static int CommandQuit(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (!PCB->Changed || gui->close_confirm_dialog() == HID_CLOSE_CONFIRM_OK) QuitApplication(); @@ -235,7 +235,7 @@ %end-doc */ -static int CommandReallyQuit(int argc, const char **argv, Coord x, Coord y) +static int CommandReallyQuit(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { QuitApplication(); return 0; @@ -261,7 +261,7 @@ %end-doc */ -static int CommandLoadNetlist(int argc, const char **argv, Coord x, Coord y) +static int CommandLoadNetlist(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *filename; @@ -311,7 +311,7 @@ %end-doc */ -static int CommandSaveLayout(int argc, const char **argv, Coord x, Coord y) +static int CommandSaveLayout(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { switch (argc) { case 0: @@ -355,7 +355,7 @@ %end-doc */ -static int CommandSaveLayoutAndQuit(int argc, const char **argv, Coord x, Coord y) +static int CommandSaveLayoutAndQuit(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { if (!CommandSaveLayout(argc, argv, x, y)) return CommandQuit(0, 0, 0, 0); Index: trunk/src_plugins/smartdisperse/smartdisperse.c =================================================================== --- trunk/src_plugins/smartdisperse/smartdisperse.c (revision 4810) +++ trunk/src_plugins/smartdisperse/smartdisperse.c (revision 4811) @@ -42,10 +42,10 @@ #include "compat_nls.h" #define GAP 10000 -static Coord minx; -static Coord miny; -static Coord maxx; -static Coord maxy; +static pcb_coord_t minx; +static pcb_coord_t miny; +static pcb_coord_t maxx; +static pcb_coord_t maxy; /*! * \brief Place one element. @@ -56,7 +56,7 @@ */ static void place(pcb_element_t * element) { - Coord dx, dy; + pcb_coord_t dx, dy; /* figure out how much to move the element */ dx = minx - element->BoundingBox.X1; @@ -99,7 +99,7 @@ * \brief Return the X location of a connection's pad or pin within its * element. */ -static Coord padDX(pcb_connection_t * conn) +static pcb_coord_t padDX(pcb_connection_t * conn) { pcb_element_t *element = (pcb_element_t *) conn->ptr1; pcb_any_line_t *line = (pcb_any_line_t *) conn->ptr2; @@ -113,7 +113,7 @@ */ static int padorder(pcb_connection_t * conna, pcb_connection_t * connb) { - Coord dxa, dxb; + pcb_coord_t dxa, dxb; dxa = padDX(conna); dxb = padDX(connb); @@ -136,7 +136,7 @@ #define is_visited(element) htpi_has(&visited, ((void *)(element))) -static int smartdisperse(int argc, const char **argv, Coord x, Coord y) +static int smartdisperse(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *function = ARG(0); pcb_netlist_t *Nets; Index: trunk/src_plugins/stroke/stroke.c =================================================================== --- trunk/src_plugins/stroke/stroke.c (revision 4810) +++ trunk/src_plugins/stroke/stroke.c (revision 4811) @@ -116,8 +116,8 @@ case 12589: case 14589: { - Coord x = (StrokeBox.X1 + StrokeBox.X2) / 2; - Coord y = (StrokeBox.Y1 + StrokeBox.Y2) / 2; + pcb_coord_t x = (StrokeBox.X1 + StrokeBox.X2) / 2; + pcb_coord_t y = (StrokeBox.Y1 + StrokeBox.Y2) / 2; double z; /* XXX: PCB->MaxWidth and PCB->MaxHeight may be the wrong * divisors below. The old code WAS broken, but this Index: trunk/src_plugins/teardrops/teardrops.c =================================================================== --- trunk/src_plugins/teardrops/teardrops.c (revision 4810) +++ trunk/src_plugins/teardrops/teardrops.c (revision 4811) @@ -40,7 +40,7 @@ static pcb_pad_t *pad; static int layer; static int px, py; -static Coord thickness; +static pcb_coord_t thickness; static pcb_element_t *element; static int new_arcs = 0; @@ -278,7 +278,7 @@ } } -static int teardrops(int argc, const char **argv, Coord x, Coord y) +static int teardrops(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { new_arcs = 0; Index: trunk/src_plugins/toporouter/toporouter.c =================================================================== --- trunk/src_plugins/toporouter/toporouter.c (revision 4810) +++ trunk/src_plugins/toporouter/toporouter.c (revision 4811) @@ -8095,7 +8095,7 @@ return 1; } -static int toporouter(int argc, char **argv, Coord x, Coord y) +static int toporouter(int argc, char **argv, pcb_coord_t x, pcb_coord_t y) { toporouter_t *r = toporouter_new(); parse_arguments(r, argc, argv); @@ -8134,7 +8134,7 @@ return 0; } -static int escape(int argc, char **argv, Coord x, Coord y) +static int escape(int argc, char **argv, pcb_coord_t x, pcb_coord_t y) { guint dir, viax, viay; gdouble pitch, length, dx, dy; Index: trunk/src_plugins/vendordrill/vendor.c =================================================================== --- trunk/src_plugins/vendordrill/vendor.c (revision 4810) +++ trunk/src_plugins/vendordrill/vendor.c (revision 4811) @@ -104,7 +104,7 @@ sizes for your vendor. %end-doc */ -int ActionApplyVendor(int argc, const char **argv, Coord x, Coord y) +int ActionApplyVendor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { hid_action("Busy"); apply_vendor_map(); @@ -125,7 +125,7 @@ %end-doc */ -int ActionUnloadVendor(int argc, const char **argv, Coord x, Coord y) +int ActionUnloadVendor(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { cached_drill = -1; @@ -153,7 +153,7 @@ %end-doc */ -int ActionLoadVendorFrom(int argc, const char **argv, Coord x, Coord y) +int ActionLoadVendorFrom(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { const char *fname = NULL; static char *default_file = NULL;