From: <gi...@gp...> - 2011-12-24 15:41:58
|
The branch, master has been updated via 356d1e05840111c190490f2e6b2e5987a2d2364c (commit) via 9f239a9c2e0a16c15070d90cb128d3688da0ebac (commit) from 8e70de4d87dd2bf1979ddf17ce235bb0e2f7d113 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. ========= Summary ========= src/action.c | 178 ++++++++++++------------ src/autoplace.c | 56 ++++---- src/autoroute.c | 40 +++--- src/buffer.c | 112 +++++++------- src/buffer.h | 22 ++-- src/change.c | 270 +++++++++++++++++----------------- src/change.h | 10 +- src/copy.c | 52 ++++---- src/copy.h | 6 +- src/create.c | 154 ++++++++++---------- src/create.h | 71 ++++------ src/crosshair.c | 64 ++++---- src/data.c | 2 +- src/data.h | 2 +- src/djopt.c | 6 +- src/draw.c | 152 ++++++++++---------- src/draw.h | 62 ++++---- src/drill.c | 40 +++--- src/drill.h | 6 +- src/edif.y | 8 +- src/file.c | 52 ++++---- src/find.c | 293 +++++++++++++++++++------------------- src/find.h | 22 ++-- src/fontmode.c | 8 +- src/global.h | 151 ++++++++++---------- src/hid/gerber/gerber.c | 2 +- src/hid/gtk/gtkhid-gl.c | 2 +- src/hid/gtk/gtkhid-main.c | 2 +- src/hid/gtk/gui-drc-window.c | 2 +- src/hid/gtk/gui-netlist-window.c | 4 +- src/hid/gtk/gui-output-events.c | 4 +- src/hid/gtk/gui.h | 6 +- src/hid/lesstif/netlist.c | 20 ++-- src/hid/nelma/nelma.c | 14 +- src/hid/ps/ps.c | 4 +- src/insert.c | 26 ++-- src/insert.h | 2 +- src/intersect.c | 22 ++-- src/intersect.h | 4 +- src/line.c | 20 ++-- src/line.h | 2 +- src/macro.h | 56 ++++---- src/mirror.c | 2 +- src/mirror.h | 2 +- src/misc.c | 98 +++++++------- src/misc.h | 46 +++--- src/move.c | 84 ++++++------ src/move.h | 8 +- src/mtspace.c | 4 +- src/mymem.c | 126 ++++++++-------- src/mymem.h | 72 +++++----- src/netlist.c | 4 +- src/parse_l.h | 8 +- src/parse_l.l | 20 ++- src/parse_y.y | 30 ++-- src/polygon.c | 116 ++++++++-------- src/polygon.h | 24 ++-- src/polygon1.c | 8 +- src/print.c | 14 +- src/puller.c | 96 ++++++------ src/rats.c | 124 ++++++++-------- src/rats.h | 12 +- src/remove.c | 88 ++++++------ src/remove.h | 14 +- src/report.c | 68 +++++----- src/rotate.c | 58 ++++---- src/rotate.h | 14 +- src/rubberband.c | 102 +++++++------- src/search.c | 258 +++++++++++++++++----------------- src/search.h | 24 ++-- src/select.c | 74 +++++----- src/select.h | 6 +- src/thermal.c | 8 +- src/thermal.h | 2 +- src/toporouter.c | 8 +- src/undo.c | 263 ++++++++++++++++------------------ src/undo.h | 2 +- src/vendor.c | 2 +- src/vendor.h | 2 +- 79 files changed, 1948 insertions(+), 1974 deletions(-) ================= Commit Messages ================= commit 356d1e05840111c190490f2e6b2e5987a2d2364c Author: Peter Clifton <pc...@ca...> Commit: Peter Clifton <pc...@ca...> Remove *TypePtr and *TypeHandle aliases now we no longer use them (May break build of plugins, hence keeping this as a separately revertable commit). :100644 100644 4b21931... 7b28396... M src/global.h :100644 100644 71c0a84... 46061a3... M src/mymem.h commit 9f239a9c2e0a16c15070d90cb128d3688da0ebac Author: Peter Clifton <pc...@ca...> Commit: Peter Clifton <pc...@ca...> Remove usage of *TypePtr and *TypeHandle type aliases Coverity already caught several bugs where we mixed up the various FooType FooTypePtr and FooTypeHandle types when passing to sizeof(). Personally I find it much easier to follow FooType * and FooType **, so drop the aliases and hopefully keep things earier to follow. :100644 100644 b1c33ab... affefba... M src/action.c :100644 100644 e7cdee8... 21ab5f2... M src/autoplace.c :100644 100644 374b6ac... 8081262... M src/autoroute.c :100644 100644 1f9293a... 0394f2f... M src/buffer.c :100644 100644 6871216... 6a264ea... M src/buffer.h :100644 100644 aaad7a2... f7d571c... M src/change.c :100644 100644 3fd896d... f42842a... M src/change.h :100644 100644 193bb52... 9d92ced... M src/copy.c :100644 100644 af0b7ff... e9871fc... M src/copy.h :100644 100644 8a1effd... 9ed7caa... M src/create.c :100644 100644 faebe52... 4872514... M src/create.h :100644 100644 055f390... f0526b8... M src/crosshair.c :100644 100644 702d9ca... 9d6588c... M src/data.c :100644 100644 efb2ed1... 28cbfda... M src/data.h :100644 100644 a377508... 8a51d0e... M src/djopt.c :100644 100644 a11c6e2... ae1e99a... M src/draw.c :100644 100644 cc0822f... c7ffa97... M src/draw.h :100644 100644 efa9baa... 7830e49... M src/drill.c :100644 100644 f155a72... e9c4e92... M src/drill.h :100644 100644 cb31d9a... e5a606d... M src/edif.y :100644 100644 c157659... 1f5c406... M src/file.c :100644 100644 fa03ba7... d854b0b... M src/find.c :100644 100644 1d54111... 6ccc81f... M src/find.h :100644 100644 f218e7c... e09f825... M src/fontmode.c :100644 100644 79c1456... 4b21931... M src/global.h :100644 100644 dd9c1c9... 2181718... M src/hid/gerber/gerber.c :100644 100644 7471afc... f3133ec... M src/hid/gtk/gtkhid-gl.c :100644 100644 d8bf02c... db7d831... M src/hid/gtk/gtkhid-main.c :100644 100644 9cbc955... 1613923... M src/hid/gtk/gui-drc-window.c :100644 100644 51192c6... 447b10e... M src/hid/gtk/gui-netlist-window.c :100644 100644 20e8e03... 2ca39de... M src/hid/gtk/gui-output-events.c :100644 100644 788553e... e4d55dd... M src/hid/gtk/gui.h :100644 100644 572fba1... ba2cd4b... M src/hid/lesstif/netlist.c :100644 100644 fd0aa11... 048f476... M src/hid/nelma/nelma.c :100644 100644 263a240... ebab761... M src/hid/ps/ps.c :100644 100644 7e12874... a254998... M src/insert.c :100644 100644 2793edf... 31fc6dc... M src/insert.h :100644 100644 33b359d... 59aa064... M src/intersect.c :100644 100644 7ed758e... f3e3205... M src/intersect.h :100644 100644 6846b2d... 8898238... M src/line.c :100644 100644 8a5e4d2... 8552cae... M src/line.h :100644 100644 59c53ba... 715f0c9... M src/macro.h :100644 100644 54c53cb... 1adeda9... M src/mirror.c :100644 100644 50f648a... 97ea0bb... M src/mirror.h :100644 100644 13ce8f6... f675079... M src/misc.c :100644 100644 2f34cfe... 9ce0905... M src/misc.h :100644 100644 f1971d5... 8f7045d... M src/move.c :100644 100644 801a5cc... f91602e... M src/move.h :100644 100644 8bb3a8c... 3eba55a... M src/mtspace.c :100644 100644 c79e068... 3de31f6... M src/mymem.c :100644 100644 88c5628... 71c0a84... M src/mymem.h :100644 100644 f467f52... d47f7d2... M src/netlist.c :100644 100644 dfeed70... d11b0c8... M src/parse_l.h :100644 100644 c0ec6a7... 882fd2c... M src/parse_l.l :100644 100644 adc2387... 2ae9f6c... M src/parse_y.y :100644 100644 1114e33... 2d3e9e4... M src/polygon.c :100644 100644 e5d1ace... c217653... M src/polygon.h :100644 100644 9da353e... 667e26d... M src/polygon1.c :100644 100644 6d984a6... 972d13e... M src/print.c :100644 100644 90f082a... 7c9f0f9... M src/puller.c :100644 100644 fc6948f... e7221fa... M src/rats.c :100644 100644 16e5338... dc7479b... M src/rats.h :100644 100644 d38805f... 39af48f... M src/remove.c :100644 100644 9066428... f1f4596... M src/remove.h :100644 100644 d461bd2... 64db36a... M src/report.c :100644 100644 99f379d... fb23ba1... M src/rotate.c :100644 100644 2ac060e... 85a9361... M src/rotate.h :100644 100644 f5f7442... cd2c4f6... M src/rubberband.c :100644 100644 29271f0... 5f4ea5e... M src/search.c :100644 100644 30553dd... bdf460e... M src/search.h :100644 100644 31ea28d... 4cdc008... M src/select.c :100644 100644 6d91278... 3e0369f... M src/select.h :100644 100644 d2cfa95... 2f91d7d... M src/thermal.c :100644 100644 b252f4f... c476420... M src/thermal.h :100644 100644 d31c788... 0a83569... M src/toporouter.c :100644 100644 c3fc57e... ca41c74... M src/undo.c :100644 100644 2ec6442... f415c3c... M src/undo.h :100644 100644 f7b89f7... fbed9f0... M src/vendor.c :100644 100644 9706448... 26e3dc5... M src/vendor.h ========= Changes ========= commit 356d1e05840111c190490f2e6b2e5987a2d2364c Author: Peter Clifton <pc...@ca...> Commit: Peter Clifton <pc...@ca...> Remove *TypePtr and *TypeHandle aliases now we no longer use them (May break build of plugins, hence keeping this as a separately revertable commit). diff --git a/src/global.h b/src/global.h index 4b21931..7b28396 100644 --- a/src/global.h +++ b/src/global.h @@ -118,7 +118,7 @@ typedef struct { unsigned long f; /* generic flags */ unsigned char t[(MAX_LAYER + 1) / 2]; /* thermals */ -} FlagType, *FlagTypePtr; +} FlagType; #ifndef __GNUC__ #define __FUNCTION1(a,b) a ":" #b @@ -190,7 +190,7 @@ typedef struct /* holds information about output window */ fgGC, /* changed from some routines */ pmGC; /* depth 1 pixmap GC to store clip */ } -OutputType, *OutputTypePtr; +OutputType; /* ---------------------------------------------------------------------- * layer group. A layer group identifies layers which are always switched @@ -200,7 +200,7 @@ typedef struct { Cardinal Number[MAX_LAYER], /* number of entries per groups */ Entries[MAX_LAYER][MAX_LAYER + 2]; -} LayerGroupType, *LayerGroupTypePtr; +} LayerGroupType; struct BoxType /* a bounding box */ { @@ -212,13 +212,13 @@ typedef struct { Coord x, y; Coord width, height; -} RectangleType, *RectangleTypePtr; +} RectangleType; typedef struct { char *name; char *value; -} AttributeType, *AttributeTypePtr; +} AttributeType; struct AttributeListType { @@ -234,24 +234,24 @@ struct AttributeListType based on this. */ typedef struct { ANYOBJECTFIELDS; -} AnyObjectType, *AnyObjectTypePtr; +} AnyObjectType; typedef struct /* a line/polygon point */ { Coord X, Y, X2, Y2; /* so Point type can be cast as BoxType */ long int ID; -} PointType, *PointTypePtr; +} PointType; /* Lines, rats, pads, etc. */ typedef struct { ANYLINEFIELDS; -} AnyLineObjectType, *AnyLineObjectTypePtr; +} AnyLineObjectType; typedef struct /* holds information about one line */ { ANYLINEFIELDS; char *Number; -} LineType, *LineTypePtr; +} LineType; typedef struct { @@ -261,7 +261,7 @@ typedef struct BYTE Direction; char *TextString; /* string */ void *Element; -} TextType, *TextTypePtr; +} TextType; struct polygon_st /* holds information about a polygon */ { @@ -287,7 +287,7 @@ typedef struct /* holds information about arcs */ Coord Width, Height, /* length of axis */ X, Y; /* center coordinates */ Angle StartAngle, Delta; /* the two limiting angles in degrees */ -} ArcType, *ArcTypePtr; +} ArcType; struct rtree { @@ -313,13 +313,13 @@ typedef struct /* holds information about one layer */ AttributeListType Attributes; int no_drc; /* whether to ignore the layer when checking the design rules */ } -LayerType, *LayerTypePtr; +LayerType; typedef struct /* a rat-line */ { ANYLINEFIELDS; Cardinal group1, group2; /* the layer group each point is on */ -} RatType, *RatTypePtr; +} RatType; struct pad_st /* a SMD pad */ { @@ -365,7 +365,7 @@ typedef struct GList *Arc; BoxType VBox; AttributeListType Attributes; -} ElementType, *ElementTypePtr, **ElementTypeHandle; +} ElementType; /* --------------------------------------------------------------------------- * symbol and font related stuff @@ -378,7 +378,7 @@ typedef struct /* a single symbol */ LineMax; Coord Width, Height, /* size of cell */ Delta; /* distance to next symbol */ -} SymbolType, *SymbolTypePtr; +} SymbolType; typedef struct /* complete set of symbols */ { @@ -387,7 +387,7 @@ typedef struct /* complete set of symbols */ BoxType DefaultSymbol; /* the default symbol is a filled box */ SymbolType Symbol[MAX_FONTPOSITION + 1]; bool Valid; -} FontType, *FontTypePtr; +} FontType; typedef struct /* holds all objects */ { @@ -403,7 +403,7 @@ typedef struct /* holds all objects */ struct PCBType *pcb; LayerType Layer[MAX_LAYER + 2]; /* add 2 silkscreen layers */ int polyClip; -} DataType, *DataTypePtr; +} DataType; typedef struct /* holds drill information */ { @@ -417,14 +417,14 @@ typedef struct /* holds drill information */ PinMax; /* max number of coordinates from malloc() */ PinType **Pin; /* coordinates to drill */ ElementType **Element; /* a pointer to an array of element pointers */ -} DrillType, *DrillTypePtr; +} DrillType; typedef struct /* holds a range of Drill Infos */ { Cardinal DrillN, /* number of drill sizes */ DrillMax; /* max number from malloc() */ DrillType *Drill; /* plated holes */ -} DrillInfoType, *DrillInfoTypePtr; +} DrillInfoType; typedef struct { @@ -434,7 +434,7 @@ typedef struct Keepaway; /* min. separation from other nets */ char *Name; int index; -} RouteStyleType, *RouteStyleTypePtr; +} RouteStyleType; /* --------------------------------------------------------------------------- * structure used by library routines @@ -448,8 +448,7 @@ typedef struct *Package, /* package */ *Value, /* the value field */ *Description; /* some descritional text */ -} LibraryEntryType, *LibraryEntryTypePtr; -//typedef LibraryEntryType *LibraryEntryTypePtr; +} LibraryEntryType; /* If the internal flag is set, the only field that is valid is Name, and the struct is allocated with malloc instead of @@ -467,14 +466,14 @@ typedef struct char flag; /* used by the netlist window to enable/disable nets */ char internal; /* if set, this is an internal-only entry, not part of the global netlist. */ -} LibraryMenuType, *LibraryMenuTypePtr; +} LibraryMenuType; typedef struct { Cardinal MenuN; /* number of objects */ Cardinal MenuMax; /* number of reserved memory locations */ LibraryMenuType *Menu; /* the entries */ -} LibraryType, *LibraryTypePtr; +} LibraryType; /* The PCBType struct holds information about board layout most of which is @@ -528,7 +527,7 @@ typedef struct PCBType bool is_footprint; /* If set, the user has loaded a footprint, not a pcb. */ } -PCBType, *PCBTypePtr; +PCBType; typedef struct /* information about the paste buffer */ { @@ -536,7 +535,7 @@ typedef struct /* information about the paste buffer */ BoxType BoundingBox; DataType *Data; /* data; not all members of PCBType */ /* are used */ -} BufferType, *BufferTypePtr; +} BufferType; /* --------------------------------------------------------------------------- * some types for cursor drawing, setting of block and lines @@ -547,7 +546,7 @@ typedef struct /* rubberband lines for element moves */ LayerType *Layer; /* layer that holds the line */ LineType *Line; /* the line itself */ PointType *MovedPoint; /* and finally the point */ -} RubberbandType, *RubberbandTypePtr; +} RubberbandType; typedef struct /* current marked line */ { @@ -555,7 +554,7 @@ typedef struct /* current marked line */ Point2; long int State; bool draw; -} AttachedLineType, *AttachedLineTypePtr; +} AttachedLineType; typedef struct /* currently marked block */ { @@ -563,7 +562,7 @@ typedef struct /* currently marked block */ Point2; long int State; bool otherway; -} AttachedBoxType, *AttachedBoxTypePtr; +} AttachedBoxType; typedef struct /* currently attached object */ { @@ -577,7 +576,7 @@ typedef struct /* currently attached object */ Cardinal RubberbandN, /* number of lines in array */ RubberbandMax; RubberbandType *Rubberband; -} AttachedObjectType, *AttachedObjectTypePtr; +} AttachedObjectType; enum crosshair_shape { @@ -599,13 +598,13 @@ typedef struct /* holds cursor information */ PolygonType AttachedPolygon; AttachedObjectType AttachedObject; /* data of attached objects */ enum crosshair_shape shape; /* shape of crosshair */ -} CrosshairType, *CrosshairTypePtr; +} CrosshairType; typedef struct { bool status; Coord X, Y; -} MarkType, *MarkTypePtr; +} MarkType; /* --------------------------------------------------------------------------- * our resources @@ -696,7 +695,7 @@ typedef struct /* some resources... */ AutoPlace; /* flag which says we should force placement of the windows on startup */ } -SettingType, *SettingTypePtr; +SettingType; /* ---------------------------------------------------------------------- * pointer to low-level copy, move and rotate functions @@ -715,7 +714,7 @@ typedef struct void *(*Point) (LayerType *, PolygonType *, PointType *); void *(*Arc) (LayerType *, ArcType *); void *(*Rat) (RatType *); -} ObjectFunctionType, *ObjectFunctionTypePtr; +} ObjectFunctionType; /* --------------------------------------------------------------------------- * structure used by device drivers @@ -728,7 +727,7 @@ typedef struct /* holds a connection */ void *ptr1, *ptr2; /* the object of the connection */ Cardinal group; /* the layer group of the connection */ LibraryMenuType *menu; /* the netmenu this *SHOULD* belong too */ -} ConnectionType, *ConnectionTypePtr; +} ConnectionType; typedef struct /* holds a net of connections */ { @@ -736,28 +735,28 @@ typedef struct /* holds a net of connections */ ConnectionMax; /* max connections from malloc */ ConnectionType *Connection; RouteStyleType *Style; -} NetType, *NetTypePtr; +} NetType; typedef struct /* holds a list of nets */ { Cardinal NetN, /* the number of subnets contained */ NetMax; /* max subnets from malloc */ NetType *Net; -} NetListType, *NetListTypePtr; +} NetListType; typedef struct /* holds a list of net lists */ { Cardinal NetListN, /* the number of net lists contained */ NetListMax; /* max net lists from malloc */ NetListType *NetList; -} NetListListType, *NetListListTypePtr; +} NetListListType; typedef struct /* holds a generic list of pointers */ { Cardinal PtrN, /* the number of pointers contained */ PtrMax; /* max subnets from malloc */ void **Ptr; -} PointerListType, *PointerListTypePtr; +} PointerListType; typedef struct { @@ -765,7 +764,7 @@ typedef struct BoxMax; /* max boxes from malloc */ BoxType *Box; -} BoxListType, *BoxListTypePtr; +} BoxListType; struct drc_violation_st { diff --git a/src/mymem.h b/src/mymem.h index 71c0a84..46061a3 100644 --- a/src/mymem.h +++ b/src/mymem.h @@ -62,7 +62,7 @@ typedef struct { size_t MaxLength; char *Data; -} DynamicStringType, *DynamicStringTypePtr; +} DynamicStringType; RubberbandType * GetRubberbandMemory (void); PinType * GetPinMemory (ElementType *); commit 9f239a9c2e0a16c15070d90cb128d3688da0ebac Author: Peter Clifton <pc...@ca...> Commit: Peter Clifton <pc...@ca...> Remove usage of *TypePtr and *TypeHandle type aliases Coverity already caught several bugs where we mixed up the various FooType FooTypePtr and FooTypeHandle types when passing to sizeof(). Personally I find it much easier to follow FooType * and FooType **, so drop the aliases and hopefully keep things earier to follow. diff --git a/src/action.c b/src/action.c index b1c33ab..affefba 100644 --- a/src/action.c +++ b/src/action.c @@ -216,7 +216,7 @@ typedef struct /* used to identify subfunctions */ char *Identifier; FunctionID ID; } -FunctionType, *FunctionTypePtr; +FunctionType; /* --------------------------------------------------------------------------- */ @@ -295,10 +295,10 @@ either round or, if the octagon flag is set, octagonal. * some local identifiers */ static PointType InsertedPoint; -static LayerTypePtr lastLayer; +static LayerType *lastLayer; static struct { - PolygonTypePtr poly; + PolygonType *poly; LineType line; } fake; @@ -823,7 +823,7 @@ AdjustAttachedBox (void) void AdjustAttachedObjects (void) { - PointTypePtr pnt; + PointType *pnt; switch (Settings.Mode) { /* update at least an attached block (selection) */ @@ -897,13 +897,13 @@ NotifyLine (void) if (type == PIN_TYPE || type == VIA_TYPE) { Crosshair.AttachedLine.Point1.X = - Crosshair.AttachedLine.Point2.X = ((PinTypePtr) ptr2)->X; + Crosshair.AttachedLine.Point2.X = ((PinType *) ptr2)->X; Crosshair.AttachedLine.Point1.Y = - Crosshair.AttachedLine.Point2.Y = ((PinTypePtr) ptr2)->Y; + Crosshair.AttachedLine.Point2.Y = ((PinType *) ptr2)->Y; } else if (type == PAD_TYPE) { - PadTypePtr pad = (PadTypePtr) ptr2; + PadType *pad = (PadType *) ptr2; double d1 = Distance (Crosshair.X, Crosshair.Y, pad->Point1.X, pad->Point1.Y); double d2 = Distance (Crosshair.X, Crosshair.Y, pad->Point2.X, pad->Point2.Y); if (d2 < d1) @@ -996,7 +996,7 @@ NotifyMode (void) { type = SearchScreen (Note.X, Note.Y, test, &ptr1, &ptr2, &ptr3); if (!Note.Hit && (type & MOVE_TYPES) && - !TEST_FLAG (LOCKFLAG, (PinTypePtr) ptr2)) + !TEST_FLAG (LOCKFLAG, (PinType *) ptr2)) { Note.Hit = type; Note.ptr1 = ptr1; @@ -1004,7 +1004,7 @@ NotifyMode (void) Note.ptr3 = ptr3; } if (!Note.Moving && (type & SELECT_TYPES) && - TEST_FLAG (SELECTEDFLAG, (PinTypePtr) ptr2)) + TEST_FLAG (SELECTEDFLAG, (PinType *) ptr2)) Note.Moving = true; if ((Note.Hit && Note.Moving) || type == NO_TYPE) break; @@ -1014,7 +1014,7 @@ NotifyMode (void) case VIA_MODE: { - PinTypePtr via; + PinType *via; if (!PCB->ViaOn) { @@ -1052,7 +1052,7 @@ NotifyMode (void) case STATE_SECOND: case STATE_THIRD: { - ArcTypePtr arc; + ArcType *arc; Coord wx, wy; Angle sa, dir; @@ -1105,7 +1105,7 @@ NotifyMode (void) CLEARLINEFLAG : 0)))) { - BoxTypePtr bx; + BoxType *bx; bx = GetArcEnds (arc); Crosshair.AttachedBox.Point1.X = @@ -1129,7 +1129,7 @@ NotifyMode (void) type = SearchScreen (Note.X, Note.Y, LOCK_TYPES, &ptr1, &ptr2, &ptr3); if (type == ELEMENT_TYPE) { - ElementTypePtr element = (ElementTypePtr) ptr2; + ElementType *element = (ElementType *) ptr2; TOGGLE_FLAG (LOCKFLAG, element); PIN_LOOP (element); @@ -1154,7 +1154,7 @@ NotifyMode (void) } else if (type != NO_TYPE) { - TextTypePtr thing = (TextTypePtr) ptr3; + TextType *thing = (TextType *) ptr3; TOGGLE_FLAG (LOCKFLAG, thing); if (TEST_FLAG (LOCKFLAG, thing) && TEST_FLAG (SELECTEDFLAG, thing)) @@ -1174,17 +1174,17 @@ NotifyMode (void) = SearchScreen (Note.X, Note.Y, PIN_TYPES, &ptr1, &ptr2, &ptr3)) != NO_TYPE) - && !TEST_FLAG (HOLEFLAG, (PinTypePtr) ptr3)) + && !TEST_FLAG (HOLEFLAG, (PinType *) ptr3)) { if (gui->shift_is_pressed ()) { - int tstyle = GET_THERM (INDEXOFCURRENT, (PinTypePtr) ptr3); + int tstyle = GET_THERM (INDEXOFCURRENT, (PinType *) ptr3); tstyle++; if (tstyle > 5) tstyle = 1; ChangeObjectThermal (type, ptr1, ptr2, ptr3, tstyle); } - else if (GET_THERM (INDEXOFCURRENT, (PinTypePtr) ptr3)) + else if (GET_THERM (INDEXOFCURRENT, (PinType *) ptr3)) ChangeObjectThermal (type, ptr1, ptr2, ptr3, 0); else ChangeObjectThermal (type, ptr1, ptr2, ptr3, PCB->ThermStyle); @@ -1213,7 +1213,7 @@ NotifyMode (void) if (PCB->RatDraw) { - RatTypePtr line; + RatType *line; if ((line = AddNet ())) { addedLines++; @@ -1231,7 +1231,7 @@ NotifyMode (void) else /* create line if both ends are determined && length != 0 */ { - LineTypePtr line; + LineType *line; int maybe_found_flag; if (PCB->Clipping @@ -1273,7 +1273,7 @@ NotifyMode (void) PCB) ? CLEARLINEFLAG : 0)))) != NULL) { - PinTypePtr via; + PinType *via; addedLines++; AddObjectToCreateUndoList (LINE_TYPE, CURRENT, line, line); @@ -1355,7 +1355,7 @@ NotifyMode (void) Crosshair.AttachedBox.Point1.X != Crosshair.AttachedBox.Point2.X && Crosshair.AttachedBox.Point1.Y != Crosshair.AttachedBox.Point2.Y) { - PolygonTypePtr polygon; + PolygonType *polygon; int flags = CLEARPOLYFLAG; if (TEST_FLAG (NEWFULLPOLYFLAG, PCB)) @@ -1393,7 +1393,7 @@ NotifyMode (void) { if (strlen(string) > 0) { - TextTypePtr text; + TextType *text; int flag = CLEARLINEFLAG; if (GetLayerGroupNumberByNumber (INDEXOFCURRENT) == @@ -1416,7 +1416,7 @@ NotifyMode (void) case POLYGON_MODE: { - PointTypePtr points = Crosshair.AttachedPolygon.Points; + PointType *points = Crosshair.AttachedPolygon.Points; Cardinal n = Crosshair.AttachedPolygon.PointN; /* do update of position; use the 'LINE_MODE' mechanism */ @@ -1464,7 +1464,7 @@ NotifyMode (void) if (Crosshair.AttachedObject.Type != NO_TYPE) { - if (TEST_FLAG (LOCKFLAG, (PolygonTypePtr) + if (TEST_FLAG (LOCKFLAG, (PolygonType *) Crosshair.AttachedObject.Ptr2)) { Message (_("Sorry, the object is locked\n")); @@ -1479,7 +1479,7 @@ NotifyMode (void) /* second notify, insert new point into object */ case STATE_SECOND: { - PointTypePtr points = Crosshair.AttachedPolygon.Points; + PointType *points = Crosshair.AttachedPolygon.Points; Cardinal n = Crosshair.AttachedPolygon.PointN; POLYAREA *original, *new_hole, *result; FlagType Flags; @@ -1548,7 +1548,7 @@ NotifyMode (void) case PASTEBUFFER_MODE: { TextType estr[MAX_ELEMENTNAMES]; - ElementTypePtr e = 0; + ElementType *e = 0; if (gui->shift_is_pressed ()) { @@ -1557,7 +1557,7 @@ NotifyMode (void) &ptr3); if (type == ELEMENT_TYPE) { - e = (ElementTypePtr) ptr1; + e = (ElementType *) ptr1; if (e) { int i; @@ -1580,7 +1580,7 @@ NotifyMode (void) if (type == ELEMENT_TYPE && ptr1) { int i, save_n; - e = (ElementTypePtr) ptr1; + e = (ElementType *) ptr1; save_n = NAME_INDEX (PCB); @@ -1608,14 +1608,14 @@ NotifyMode (void) SearchScreen (Note.X, Note.Y, REMOVE_TYPES, &ptr1, &ptr2, &ptr3)) != NO_TYPE) { - if (TEST_FLAG (LOCKFLAG, (LineTypePtr) ptr2)) + if (TEST_FLAG (LOCKFLAG, (LineType *) ptr2)) { Message (_("Sorry, the object is locked\n")); break; } if (type == ELEMENT_TYPE) { - RubberbandTypePtr ptr; + RubberbandType *ptr; int i; Crosshair.AttachedObject.RubberbandN = 0; @@ -1624,7 +1624,7 @@ NotifyMode (void) for (i = 0; i < Crosshair.AttachedObject.RubberbandN; i++) { if (PCB->RatOn) - EraseRat ((RatTypePtr) ptr->Line); + EraseRat ((RatType *) ptr->Line); if (TEST_FLAG (RUBBERENDFLAG, ptr->Line)) MoveObjectToRemoveUndoList (RATLINE_TYPE, ptr->Line, ptr->Line, @@ -1666,7 +1666,7 @@ NotifyMode (void) if (Crosshair.AttachedObject.Type != NO_TYPE) { if (Settings.Mode == MOVE_MODE && - TEST_FLAG (LOCKFLAG, (PinTypePtr) + TEST_FLAG (LOCKFLAG, (PinType *) Crosshair.AttachedObject.Ptr2)) { Message (_("Sorry, the object is locked\n")); @@ -1720,7 +1720,7 @@ NotifyMode (void) if (Crosshair.AttachedObject.Type != NO_TYPE) { - if (TEST_FLAG (LOCKFLAG, (PolygonTypePtr) + if (TEST_FLAG (LOCKFLAG, (PolygonType *) Crosshair.AttachedObject.Ptr2)) { Message (_("Sorry, the object is locked\n")); @@ -1733,7 +1733,7 @@ NotifyMode (void) if (Crosshair.AttachedObject.Type == POLYGON_TYPE) { fake.poly = - (PolygonTypePtr) Crosshair.AttachedObject.Ptr2; + (PolygonType *) Crosshair.AttachedObject.Ptr2; polyIndex = GetLowestDistancePolygonPoint (fake.poly, Note.X, Note.Y); @@ -1955,7 +1955,7 @@ static int ActionFlip (int argc, char **argv, Coord x, Coord y) { char *function = ARG (0); - ElementTypePtr element; + ElementType *element; void *ptrtmp; int err = 0; @@ -1967,7 +1967,7 @@ ActionFlip (int argc, char **argv, Coord x, Coord y) if ((SearchScreen (x, y, ELEMENT_TYPE, &ptrtmp, &ptrtmp, &ptrtmp)) != NO_TYPE) { - element = (ElementTypePtr) ptrtmp; + element = (ElementType *) ptrtmp; ChangeElementSide (element, 2 * Crosshair.Y - PCB->MaxHeight); IncrementUndoSerialNumber (); Draw (); @@ -2821,7 +2821,7 @@ ActionDisplay (int argc, char **argv, Coord childX, Coord childY) /* display the pinout of an element */ case F_Pinout: { - ElementTypePtr element; + ElementType *element; void *ptrtmp; Coord x, y; @@ -2830,7 +2830,7 @@ ActionDisplay (int argc, char **argv, Coord childX, Coord childY) (x, y, ELEMENT_TYPE, &ptrtmp, &ptrtmp, &ptrtmp)) != NO_TYPE) { - element = (ElementTypePtr) ptrtmp; + element = (ElementType *) ptrtmp; gui->show_item (element); } break; @@ -2847,7 +2847,7 @@ ActionDisplay (int argc, char **argv, Coord childX, Coord childY) (void **) &ptr3)) { case ELEMENT_TYPE: - PIN_LOOP ((ElementTypePtr) ptr1); + PIN_LOOP ((ElementType *) ptr1); { if (TEST_FLAG (DISPLAYNAMEFLAG, pin)) ErasePinName (pin); @@ -2857,7 +2857,7 @@ ActionDisplay (int argc, char **argv, Coord childX, Coord childY) TOGGLE_FLAG (DISPLAYNAMEFLAG, pin); } END_LOOP; - PAD_LOOP ((ElementTypePtr) ptr1); + PAD_LOOP ((ElementType *) ptr1); { if (TEST_FLAG (DISPLAYNAMEFLAG, pad)) ErasePadName (pad); @@ -2873,35 +2873,35 @@ ActionDisplay (int argc, char **argv, Coord childX, Coord childY) break; case PIN_TYPE: - if (TEST_FLAG (DISPLAYNAMEFLAG, (PinTypePtr) ptr2)) - ErasePinName ((PinTypePtr) ptr2); + if (TEST_FLAG (DISPLAYNAMEFLAG, (PinType *) ptr2)) + ErasePinName ((PinType *) ptr2); else - DrawPinName ((PinTypePtr) ptr2); + DrawPinName ((PinType *) ptr2); AddObjectToFlagUndoList (PIN_TYPE, ptr1, ptr2, ptr3); - TOGGLE_FLAG (DISPLAYNAMEFLAG, (PinTypePtr) ptr2); + TOGGLE_FLAG (DISPLAYNAMEFLAG, (PinType *) ptr2); SetChangedFlag (true); IncrementUndoSerialNumber (); Draw (); break; case PAD_TYPE: - if (TEST_FLAG (DISPLAYNAMEFLAG, (PadTypePtr) ptr2)) - ErasePadName ((PadTypePtr) ptr2); + if (TEST_FLAG (DISPLAYNAMEFLAG, (PadType *) ptr2)) + ErasePadName ((PadType *) ptr2); else - DrawPadName ((PadTypePtr) ptr2); + DrawPadName ((PadType *) ptr2); AddObjectToFlagUndoList (PAD_TYPE, ptr1, ptr2, ptr3); - TOGGLE_FLAG (DISPLAYNAMEFLAG, (PadTypePtr) ptr2); + TOGGLE_FLAG (DISPLAYNAMEFLAG, (PadType *) ptr2); SetChangedFlag (true); IncrementUndoSerialNumber (); Draw (); break; case VIA_TYPE: - if (TEST_FLAG (DISPLAYNAMEFLAG, (PinTypePtr) ptr2)) - EraseViaName ((PinTypePtr) ptr2); + if (TEST_FLAG (DISPLAYNAMEFLAG, (PinType *) ptr2)) + EraseViaName ((PinType *) ptr2); else - DrawViaName ((PinTypePtr) ptr2); + DrawViaName ((PinType *) ptr2); AddObjectToFlagUndoList (VIA_TYPE, ptr1, ptr2, ptr3); - TOGGLE_FLAG (DISPLAYNAMEFLAG, (PinTypePtr) ptr2); + TOGGLE_FLAG (DISPLAYNAMEFLAG, (PinType *) ptr2); SetChangedFlag (true); IncrementUndoSerialNumber (); Draw (); @@ -3248,8 +3248,8 @@ static int ActionRenumber (int argc, char **argv, Coord x, Coord y) { bool changed = false; - ElementTypePtr *element_list; - ElementTypePtr *locked_element_list; + ElementType **element_list; + ElementType **locked_element_list; unsigned int i, j, k, cnt, lock_cnt; unsigned int tmpi; size_t sz; @@ -3329,8 +3329,8 @@ ActionRenumber (int argc, char **argv, Coord x, Coord y) * * We'll actually renumber things in the 2nd pass. */ - element_list = (ElementType **)calloc (PCB->Data->ElementN, sizeof (ElementTypePtr)); - locked_element_list = (ElementType **)calloc (PCB->Data->ElementN, sizeof (ElementTypePtr)); + element_list = (ElementType **)calloc (PCB->Data->ElementN, sizeof (ElementType *)); + locked_element_list = (ElementType **)calloc (PCB->Data->ElementN, sizeof (ElementType *)); was = (char **)calloc (PCB->Data->ElementN, sizeof (char *)); is = (char **)calloc (PCB->Data->ElementN, sizeof (char *)); if (element_list == NULL || locked_element_list == NULL || was == NULL @@ -3745,7 +3745,7 @@ static int ActionAddRats (int argc, char **argv, Coord x, Coord y) { char *function = ARG (0); - RatTypePtr shorty; + RatType *shorty; float len, small; if (function) @@ -4056,7 +4056,7 @@ ActionChangeSize (int argc, char **argv, Coord x, Coord y) if ((type = SearchScreen (Crosshair.X, Crosshair.Y, CHANGESIZE_TYPES, &ptr1, &ptr2, &ptr3)) != NO_TYPE) - if (TEST_FLAG (LOCKFLAG, (PinTypePtr) ptr2)) + if (TEST_FLAG (LOCKFLAG, (PinType *) ptr2)) Message (_("Sorry, the object is locked\n")); if (ChangeObjectSize (type, ptr1, ptr2, ptr3, value, absolute)) SetChangedFlag (true); @@ -4586,7 +4586,7 @@ ActionChangeName (int argc, char **argv, Coord x, Coord y) SetChangedFlag (true); if (type == ELEMENT_TYPE) { - RubberbandTypePtr ptr; + RubberbandType *ptr; int i; RestoreUndoSerialNumber (); @@ -4597,7 +4597,7 @@ ActionChangeName (int argc, char **argv, Coord x, Coord y) i++, ptr++) { if (PCB->RatOn) - EraseRat ((RatTypePtr) ptr->Line); + EraseRat ((RatType *) ptr->Line); MoveObjectToRemoveUndoList (RATLINE_TYPE, ptr->Line, ptr->Line, ptr->Line); @@ -4722,9 +4722,9 @@ ActionToggleHideName (int argc, char **argv, Coord x, Coord y) &ptr1, &ptr2, &ptr3)) != NO_TYPE) { AddObjectToFlagUndoList (type, ptr1, ptr2, ptr3); - EraseElementName ((ElementTypePtr) ptr2); - TOGGLE_FLAG (HIDENAMEFLAG, (ElementTypePtr) ptr2); - DrawElementName ((ElementTypePtr) ptr2); + EraseElementName ((ElementType *) ptr2); + TOGGLE_FLAG (HIDENAMEFLAG, (ElementType *) ptr2); + DrawElementName ((ElementType *) ptr2); Draw (); IncrementUndoSerialNumber (); } @@ -5218,7 +5218,7 @@ ActionChangeHole (int argc, char **argv, Coord x, Coord y) gui->get_coords (_("Select an Object"), &x, &y); if ((type = SearchScreen (x, y, VIA_TYPE, &ptr1, &ptr2, &ptr3)) != NO_TYPE - && ChangeHole ((PinTypePtr) ptr3)) + && ChangeHole ((PinType *) ptr3)) IncrementUndoSerialNumber (); break; } @@ -5266,7 +5266,7 @@ ActionChangePaste (int argc, char **argv, Coord x, Coord y) gui->get_coords (_("Select an Object"), &x, &y); if ((type = SearchScreen (x, y, PAD_TYPE, &ptr1, &ptr2, &ptr3)) != NO_TYPE - && ChangePaste ((PadTypePtr) ptr3)) + && ChangePaste ((PadType *) ptr3)) IncrementUndoSerialNumber (); break; } @@ -5721,7 +5721,7 @@ ActionSaveTo (int argc, char **argv, Coord x, Coord y) if (strcasecmp (function, "ElementConnections") == 0) { - ElementTypePtr element; + ElementType *element; void *ptrtmp; FILE *fp; bool result; @@ -5729,7 +5729,7 @@ ActionSaveTo (int argc, char **argv, Coord x, Coord y) if ((SearchScreen (Crosshair.X, Crosshair.Y, ELEMENT_TYPE, &ptrtmp, &ptrtmp, &ptrtmp)) != NO_TYPE) { - element = (ElementTypePtr) ptrtmp; + element = (ElementType *) ptrtmp; if ((fp = CheckAndOpenFile (name, true, false, &result, NULL)) != NULL) { @@ -6197,13 +6197,13 @@ ActionUndo (int argc, char **argv, Coord x, Coord y) { int type; void *ptr1, *ptr3, *ptrtmp; - LineTypePtr ptr2; + LineType *ptr2; /* this search is guaranteed to succeed */ SearchObjectByLocation (LINE_TYPE | RATLINE_TYPE, &ptr1, &ptrtmp, &ptr3, Crosshair.AttachedLine.Point1.X, Crosshair.AttachedLine.Point1.Y, 0); - ptr2 = (LineTypePtr) ptrtmp; + ptr2 = (LineType *) ptrtmp; /* save both ends of line */ Crosshair.AttachedLine.Point2.X = ptr2->Point1.X; @@ -6235,7 +6235,7 @@ ActionUndo (int argc, char **argv, Coord x, Coord y) &ptr3, Crosshair.AttachedLine.Point2.X, Crosshair.AttachedLine.Point2.Y, 0); - ptr2 = (LineTypePtr) ptrtmp; + ptr2 = (LineType *) ptrtmp; if (TEST_FLAG (AUTODRCFLAG, PCB)) { /* undo loses FOUNDFLAG */ @@ -6262,8 +6262,8 @@ ActionUndo (int argc, char **argv, Coord x, Coord y) &ptr3, Crosshair.AttachedLine.Point1.X, Crosshair.AttachedLine.Point1.Y, 0); - ptr2 = (LineTypePtr) ptrtmp; - lastLayer = (LayerTypePtr) ptr1; + ptr2 = (LineType *) ptrtmp; + lastLayer = (LayerType *) ptr1; } notify_crosshair_change (true); return 0; @@ -6280,12 +6280,12 @@ ActionUndo (int argc, char **argv, Coord x, Coord y) if (Crosshair.AttachedBox.State == STATE_THIRD) { void *ptr1, *ptr2, *ptr3; - BoxTypePtr bx; + BoxType *bx; /* guaranteed to succeed */ SearchObjectByLocation (ARC_TYPE, &ptr1, &ptr2, &ptr3, Crosshair.AttachedBox.Point1.X, Crosshair.AttachedBox.Point1.Y, 0); - bx = GetArcEnds ((ArcTypePtr) ptr2); + bx = GetArcEnds ((ArcType *) ptr2); Crosshair.AttachedBox.Point1.X = Crosshair.AttachedBox.Point2.X = bx->X1; Crosshair.AttachedBox.Point1.Y = @@ -6561,7 +6561,7 @@ ActionSetSame (int argc, char **argv, Coord x, Coord y) { void *ptr1, *ptr2, *ptr3; int type; - LayerTypePtr layer = CURRENT; + LayerType *layer = CURRENT; type = SearchScreen (x, y, CLONE_TYPES, &ptr1, &ptr2, &ptr3); /* set layer current and size from line or arc */ @@ -6569,9 +6569,9 @@ ActionSetSame (int argc, char **argv, Coord x, Coord y) { case LINE_TYPE: notify_crosshair_change (false); - Settings.LineThickness = ((LineTypePtr) ptr2)->Thickness; - Settings.Keepaway = ((LineTypePtr) ptr2)->Clearance / 2; - layer = (LayerTypePtr) ptr1; + Settings.LineThickness = ((LineType *) ptr2)->Thickness; + Settings.Keepaway = ((LineType *) ptr2)->Clearance / 2; + layer = (LayerType *) ptr1; if (Settings.Mode != LINE_MODE) SetMode (LINE_MODE); notify_crosshair_change (true); @@ -6580,9 +6580,9 @@ ActionSetSame (int argc, char **argv, Coord x, Coord y) case ARC_TYPE: notify_crosshair_change (false); - Settings.LineThickness = ((ArcTypePtr) ptr2)->Thickness; - Settings.Keepaway = ((ArcTypePtr) ptr2)->Clearance / 2; - layer = (LayerTypePtr) ptr1; + Settings.LineThickness = ((ArcType *) ptr2)->Thickness; + Settings.Keepaway = ((ArcType *) ptr2)->Clearance / 2; + layer = (LayerType *) ptr1; if (Settings.Mode != ARC_MODE) SetMode (ARC_MODE); notify_crosshair_change (true); @@ -6590,14 +6590,14 @@ ActionSetSame (int argc, char **argv, Coord x, Coord y) break; case POLYGON_TYPE: - layer = (LayerTypePtr) ptr1; + layer = (LayerType *) ptr1; break; case VIA_TYPE: notify_crosshair_change (false); - Settings.ViaThickness = ((PinTypePtr) ptr2)->Thickness; - Settings.ViaDrillingHole = ((PinTypePtr) ptr2)->DrillingHole; - Settings.Keepaway = ((PinTypePtr) ptr2)->Clearance / 2; + Settings.ViaThickness = ((PinType *) ptr2)->Thickness; + Settings.ViaDrillingHole = ((PinType *) ptr2)->DrillingHole; + Settings.Keepaway = ((PinType *) ptr2)->Clearance / 2; if (Settings.Mode != VIA_MODE) SetMode (VIA_MODE); notify_crosshair_change (true); @@ -6752,7 +6752,7 @@ ChangeFlag (char *what, char *flag_name, int value, char *cmd_name) if ((type = SearchScreen (Crosshair.X, Crosshair.Y, CHANGESIZE_TYPES, &ptr1, &ptr2, &ptr3)) != NO_TYPE) - if (TEST_FLAG (LOCKFLAG, (PinTypePtr) ptr2)) + if (TEST_FLAG (LOCKFLAG, (PinType *) ptr2)) Message (_("Sorry, the object is locked\n")); if (set_object (type, ptr1, ptr2, ptr3)) SetChangedFlag (true); @@ -6909,7 +6909,7 @@ find_element_by_refdes (char *refdes) } static AttributeType * -lookup_attr (AttributeListTypePtr list, const char *name) +lookup_attr (AttributeListType *list, const char *name) { int i; for (i=0; i<list->Number; i++) @@ -6919,7 +6919,7 @@ lookup_attr (AttributeListTypePtr list, const char *name) } static void -delete_attr (AttributeListTypePtr list, AttributeType *attr) +delete_attr (AttributeListType *list, AttributeType *attr) { int idx = attr - list->List; if (idx < 0 || idx >= list->Number) @@ -7946,7 +7946,7 @@ ActionAttributes (int argc, char **argv, Coord x, Coord y) if ((SearchScreen (x, y, ELEMENT_TYPE, &ptrtmp, &ptrtmp, &ptrtmp)) != NO_TYPE) - e = (ElementTypePtr) ptrtmp; + e = (ElementType *) ptrtmp; else { Message (_("No element found there\n")); diff --git a/src/autoplace.c b/src/autoplace.c index e7cdee8..21ab5f2 100644 --- a/src/autoplace.c +++ b/src/autoplace.c @@ -74,7 +74,7 @@ /* --------------------------------------------------------------------------- * some local prototypes */ -static double ComputeCost (NetListTypePtr Nets, double T0, double T); +static double ComputeCost (NetListType *Nets, double T0, double T); /* --------------------------------------------------------------------------- * some local types @@ -123,7 +123,7 @@ CostParameter = typedef struct { - ElementTypePtr *element; + ElementType **element; Cardinal elementN; } ElementPtrListType; @@ -133,11 +133,11 @@ enum ewhich typedef struct { - ElementTypePtr element; + ElementType *element; enum ewhich which; Coord DX, DY; /* for shift */ unsigned rotate; /* for rotate/flip */ - ElementTypePtr other; /* for exchange */ + ElementType *other; /* for exchange */ } PerturbationType; @@ -150,7 +150,7 @@ PerturbationType; * elements have possibly been moved, rotated, flipped, etc. */ static void -UpdateXY (NetListTypePtr Nets) +UpdateXY (NetListType *Nets) { Cardinal SLayer, CLayer; Cardinal i, j; @@ -162,20 +162,20 @@ UpdateXY (NetListTypePtr Nets) { for (j = 0; j < Nets->Net[i].ConnectionN; j++) { - ConnectionTypePtr c = &(Nets->Net[i].Connection[j]); + ConnectionType *c = &(Nets->Net[i].Connection[j]); switch (c->type) { case PAD_TYPE: c->group = TEST_FLAG (ONSOLDERFLAG, - (ElementTypePtr) c->ptr1) + (ElementType *) c->ptr1) ? SLayer : CLayer; - c->X = ((PadTypePtr) c->ptr2)->Point1.X; - c->Y = ((PadTypePtr) c->ptr2)->Point1.Y; + c->X = ((PadType *) c->ptr2)->Point1.X; + c->Y = ((PadType *) c->ptr2)->Point1.Y; break; case PIN_TYPE: c->group = SLayer; /* any layer will do */ - c->X = ((PinTypePtr) c->ptr2)->X; - c->Y = ((PinTypePtr) c->ptr2)->Y; + c->X = ((PinType *) c->ptr2)->X; + c->Y = ((PinType *) c->ptr2)->Y; break; default: Message ("Odd connection type encountered in " "UpdateXY"); @@ -196,7 +196,7 @@ collectSelectedElements () { if (TEST_FLAG (SELECTEDFLAG, element)) { - ElementTypePtr *epp = (ElementTypePtr *) GetPointerMemory (&list); + ElementType **epp = (ElementType **) GetPointerMemory (&list); *epp = element; } } @@ -208,10 +208,10 @@ collectSelectedElements () #include "create.h" /* makes a line on the solder layer surrounding all boxes in blist */ static void -showboxes (BoxListTypePtr blist) +showboxes (BoxListType *blist) { Cardinal i; - LayerTypePtr SLayer = &(PCB->Data->Layer[solder_silk_layer]); + LayerType *SLayer = &(PCB->Data->Layer[solder_silk_layer]); for (i = 0; i < blist->BoxN; i++) { CreateNewLineOnLayer (SLayer, blist->Box[i].X1, blist->Box[i].Y1, @@ -323,7 +323,7 @@ r_find_neighbor (rtree_t * rtree, const BoxType * box, * Marcel Dekker, Inc. 1993. ISBN: 0-8247-8916-4 TK7868.P7.P57 1993 */ static double -ComputeCost (NetListTypePtr Nets, double T0, double T) +ComputeCost (NetListType *Nets, double T0, double T) { double W = 0; /* wire cost */ double delta1 = 0; /* wire congestion penalty function */ @@ -346,7 +346,7 @@ ComputeCost (NetListTypePtr Nets, double T0, double T) * the "layer height" of the net. */ for (i = 0; i < Nets->NetN; i++) { - NetTypePtr n = &Nets->Net[i]; + NetType *n = &Nets->Net[i]; if (n->ConnectionN < 2) continue; /* no cost to go nowhere */ minx = maxx = n->Connection[0].X; @@ -356,7 +356,7 @@ ComputeCost (NetListTypePtr Nets, double T0, double T) allsameside = true; for (j = 1; j < n->ConnectionN; j++) { - ConnectionTypePtr c = &(n->Connection[j]); + ConnectionType *c = &(n->Connection[j]); MAKEMIN (minx, c->X); MAKEMAX (maxx, c->X); MAKEMIN (miny, c->Y); @@ -368,7 +368,7 @@ ComputeCost (NetListTypePtr Nets, double T0, double T) } /* save bounding rectangle */ { - BoxTypePtr box = GetBoxMemory (&bounds); + BoxType *box = GetBoxMemory (&bounds); box->X1 = minx; box->Y1 = miny; box->X2 = maxx; @@ -393,10 +393,10 @@ ComputeCost (NetListTypePtr Nets, double T0, double T) ELEMENT_LOOP (PCB->Data); { - BoxListTypePtr thisside; - BoxListTypePtr otherside; - BoxTypePtr box; - BoxTypePtr lastbox = NULL; + BoxListType *thisside; + BoxListType *otherside; + BoxType *box; + BoxType *lastbox = NULL; Coord thickness; Coord clearance; if (TEST_FLAG (ONSOLDERFLAG, element)) @@ -514,7 +514,7 @@ ComputeCost (NetListTypePtr Nets, double T0, double T) struct ebox { BoxType box; - ElementTypePtr element; + ElementType *element; }; direction_t dir[4] = { NORTH, EAST, SOUTH, WEST }; struct ebox **boxpp, *boxp; @@ -613,11 +613,11 @@ ComputeCost (NetListTypePtr Nets, double T0, double T) * -- Only perturb selected elements (need count/list of selected?) -- */ PerturbationType -createPerturbation (PointerListTypePtr selected, double T) +createPerturbation (PointerListType *selected, double T) { PerturbationType pt = { 0 }; /* pick element to perturb */ - pt.element = (ElementTypePtr) selected->Ptr[random () % selected->PtrN]; + pt.element = (ElementType *) selected->Ptr[random () % selected->PtrN]; /* exchange, flip/rotate or shift? */ switch (random () % ((selected->PtrN > 1) ? 3 : 2)) { @@ -655,10 +655,10 @@ createPerturbation (PointerListTypePtr selected, double T) case 2: { /* exchange! */ pt.which = EXCHANGE; - pt.other = (ElementTypePtr) + pt.other = (ElementType *) selected->Ptr[random () % (selected->PtrN - 1)]; if (pt.other == pt.element) - pt.other = (ElementTypePtr) selected->Ptr[selected->PtrN - 1]; + pt.other = (ElementType *) selected->Ptr[selected->PtrN - 1]; /* don't allow exchanging a solderside-side SMD component * with a non-SMD component. */ if ((pt.element->PinN != 0 /* non-SMD */ && @@ -748,7 +748,7 @@ doPerturb (PerturbationType * pt, bool undo) bool AutoPlaceSelected (void) { - NetListTypePtr Nets; + NetListType *Nets; PointerListType Selected = { 0, 0, NULL }; PerturbationType pt; double C0, T0; diff --git a/src/autoroute.c b/src/autoroute.c index 374b6ac..8081262 100644 --- a/src/autoroute.c +++ b/src/autoroute.c @@ -231,12 +231,12 @@ typedef struct routebox BoxType box, sbox; union { - PadTypePtr pad; - PinTypePtr pin; - PinTypePtr via; + PadType *pad; + PinType *pin; + PinType *via; struct routebox *via_shadow; /* points to the via in r-tree which * points to the PinType in the PCB. */ - LineTypePtr line; + LineType *line; void *generic; /* 'other' is polygon, arc, text */ struct routebox *expansion_area; /* previous expansion area in search */ } @@ -639,7 +639,7 @@ point_in_shrunk_box (const routebox_t * box, Coord X, Coord Y) */ static routebox_t * -AddPin (PointerListType layergroupboxes[], PinTypePtr pin, bool is_via, +AddPin (PointerListType layergroupboxes[], PinType *pin, bool is_via, RouteStyleType * style) { routebox_t **rbpp, *lastrb = NULL; @@ -687,7 +687,7 @@ AddPin (PointerListType layergroupboxes[], PinTypePtr pin, bool is_via, } static routebox_t * AddPad (PointerListType layergroupboxes[], - ElementTypePtr element, PadTypePtr pad, RouteStyleType * style) + ElementType *element, PadType *pad, RouteStyleType * style) { Coord halfthick; routebox_t **rbpp; @@ -721,8 +721,8 @@ AddPad (PointerListType layergroupboxes[], return *rbpp; } static routebox_t * -AddLine (PointerListType layergroupboxes[], int layergroup, LineTypePtr line, - LineTypePtr ptr, RouteStyleType * style) +AddLine (PointerListType layergroupboxes[], int layergroup, LineType *line, + LineType *ptr, RouteStyleType * style) { routebox_t **rbpp; assert (layergroupboxes && line); @@ -794,7 +794,7 @@ AddIrregularObstacle (PointerListType layergroupboxes[], static routebox_t * AddPolygon (PointerListType layergroupboxes[], Cardinal layer, - PolygonTypePtr polygon, RouteStyleType * style) + PolygonType *polygon, RouteStyleType * style) { int is_not_rectangle = 1; int layergroup = GetLayerGroupNumberByNumber (layer); @@ -830,7 +830,7 @@ AddPolygon (PointerListType layergroupboxes[], Cardinal layer, } static void AddText (PointerListType layergroupboxes[], Cardinal layergroup, - TextTypePtr text, RouteStyleType * style) + TextType *text, RouteStyleType * style) { AddIrregularObstacle (layergroupboxes, text->BoundingBox.X1, text->BoundingBox.Y1, @@ -839,7 +839,7 @@ AddText (PointerListType layergroupboxes[], Cardinal layergroup, } static routebox_t * AddArc (PointerListType layergroupboxes[], Cardinal layergroup, - ArcTypePtr arc, RouteStyleType * style) + ArcType *arc, RouteStyleType * style) { return AddIrregularObstacle (layergroupboxes, arc->BoundingBox.X1, arc->BoundingBox.Y1, @@ -1042,7 +1042,7 @@ CreateRouteData () CONNECTION_LOOP (net); { routebox_t *rb = NULL; - SET_FLAG (DRCFLAG, (PinTypePtr) connection->ptr2); + SET_FLAG (DRCFLAG, (PinType *) connection->ptr2); if (connection->type == LINE_TYPE) { LineType *line = (LineType *) connection->ptr2; @@ -1460,8 +1460,8 @@ bloat_routebox (routebox_t * rb) void showbox (BoxType b, Dimension thickness, int group) { - LineTypePtr line; - LayerTypePtr SLayer = LAYER_PTR (group); + LineType *line; + LayerType *SLayer = LAYER_PTR (group); if (showboxen < -1) return; if (showboxen != -1 && showboxen != group) @@ -4963,7 +4963,7 @@ out: struct fpin_info { - PinTypePtr pin; + PinType *pin; Coord X, Y; jmp_buf env; }; @@ -4971,18 +4971,18 @@ struct fpin_info static int fpin_rect (const BoxType * b, void *cl) { - PinTypePtr pin = (PinTypePtr) b; + PinType *pin = (PinType *) b; struct fpin_info *info = (struct fpin_info *) cl; if (pin->X == info->X && pin->Y == info->Y) { - info->pin = (PinTypePtr) b; + info->pin = (PinType *) b; longjmp (info->env, 1); } return 0; } static int -FindPin (const BoxType * box, PinTypePtr * pin) +FindPin (const BoxType * box, PinType ** pin) { struct fpin_info info; @@ -5014,7 +5014,7 @@ bool IronDownAllUnfixedPaths (routedata_t * rd) { bool changed = false; - LayerTypePtr layer; + LayerType *layer; routebox_t *net, *p; int i; LIST_LOOP (rd->first_net, different_net, net); @@ -5123,7 +5123,7 @@ IronDownAllUnfixedPaths (routedata_t * rd) { if (p->type == THERMAL) { - PinTypePtr pin = NULL; + PinType *pin = NULL; /* thermals are alread a single point search, no need to shrink */ int type = FindPin (&p->box, &pin); if (pin) diff --git a/src/buffer.c b/src/buffer.c index 1f9293a..0394f2f 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -63,28 +63,28 @@ /* --------------------------------------------------------------------------- * some local prototypes */ -static void *AddViaToBuffer (PinTypePtr); -static void *AddLineToBuffer (LayerTypePtr, LineTypePtr); -static void *AddArcToBuffer (LayerTypePtr, ArcTypePtr); -static void *AddRatToBuffer (RatTypePtr); -static void *AddTextToBuffer (LayerTypePtr, TextTypePtr); -static void *AddPolygonToBuffer (LayerTypePtr, PolygonTypePtr); -static void *AddElementToBuffer (ElementTypePtr); -static void *MoveViaToBuffer (PinTypePtr); -static void *MoveLineToBuffer (LayerTypePtr, LineTypePtr); -static void *MoveArcToBuffer (LayerTypePtr, ArcTypePtr); -static void *MoveRatToBuffer (RatTypePtr); -static void *MoveTextToBuffer (LayerTypePtr, TextTypePtr); -static void *MovePolygonToBuffer (LayerTypePtr, PolygonTypePtr); -static void *MoveElementToBuffer (ElementTypePtr); -static void SwapBuffer (BufferTypePtr); +static void *AddViaToBuffer (PinType *); +static void *AddLineToBuffer (LayerType *, LineType *); +static void *AddArcToBuffer (LayerType *, ArcType *); +static void *AddRatToBuffer (RatType *); +static void *AddTextToBuffer (LayerType *, TextType *); +static void *AddPolygonToBuffer (LayerType *, PolygonType *); +static void *AddElementToBuffer (ElementType *); +static void *MoveViaToBuffer (PinType *); +static void *MoveLineToBuffer (LayerType *, LineType *); +static void *MoveArcToBuffer (LayerType *, ArcType *); +static void *MoveRatToBuffer (RatType *); +static void *MoveTextToBuffer (LayerType *, TextType *); +static void *MovePolygonToBuffer (LayerType *, PolygonType *); +static void *MoveElementToBuffer (ElementType *); +static void SwapBuffer (BufferType *); #define ARG(n) (argc > (n) ? argv[n] : 0) /* --------------------------------------------------------------------------- * some local identifiers */ -static DataTypePtr Dest, Source; +static DataType *Dest, *Source; static ObjectFunctionType AddBufferFunctions = { AddLineToBuffer, @@ -115,7 +115,7 @@ static int ExtraFlag = 0; * copies a via to paste buffer */ static void * -AddViaToBuffer (PinTypePtr Via) +AddViaToBuffer (PinType *Via) { return (CreateNewVia (Dest, Via->X, Via->Y, Via->Thickness, Via->Clearance, Via->Mask, Via->DrillingHole, Via->Name, @@ -126,7 +126,7 @@ AddViaToBuffer (PinTypePtr Via) * copies a rat-line to paste buffer */ static void * -AddRatToBuffer (RatTypePtr Rat) +AddRatToBuffer (RatType *Rat) { return (CreateNewRat (Dest, Rat->Point1.X, Rat->Point1.Y, Rat->Point2.X, Rat->Point2.Y, Rat->group1, @@ -138,10 +138,10 @@ AddRatToBuffer (RatTypePtr Rat) * copies a line to buffer */ static void * -AddLineToBuffer (LayerTypePtr Layer, LineTypePtr Line) +AddLineToBuffer (LayerType *Layer, LineType *Line) { - LineTypePtr line; - LayerTypePtr layer = &Dest->Layer[GetLayerNumber (Source, Layer)]; + LineType *line; + LayerType *layer = &Dest->Layer[GetLayerNumber (Source, Layer)]; line = CreateNewLineOnLayer (layer, Line->Point1.X, Line->Point1.Y, Line->Point2.X, Line->Point2.Y, @@ -157,9 +157,9 @@ AddLineToBuffer (LayerTypePtr Layer, LineTypePtr Line) * copies an arc to buffer */ static void * -AddArcToBuffer (LayerTypePtr Layer, ArcTypePtr Arc) +AddArcToBuffer (LayerType *Layer, ArcType *Arc) { - LayerTypePtr layer = &Dest->Layer[GetLayerNumber (Source, Layer)]; + LayerType *layer = &Dest->Layer[GetLayerNumber (Source, Layer)]; return (CreateNewArcOnLayer (layer, Arc->X, Arc->Y, Arc->Width, Arc->Height, Arc->StartAngle, Arc->Delta, @@ -172,9 +172,9 @@ AddArcToBuffer (LayerTypePtr Layer, ArcTypePtr Arc) * copies a text to buffer */ static void * -AddTextToBuffer (LayerTypePtr Layer, TextTypePtr Text) +AddTextToBuffer (LayerType *Layer, TextType *Text) { - LayerTypePtr layer = &Dest->Layer[GetLayerNumber (Source, Layer)]; + LayerType *layer = &Dest->Layer[GetLayerNumber (Source, Layer)]; return (CreateNewText (layer, &PCB->Font, Text->X, Text->Y, Text->Direction, Text->Scale, Text->TextString, @@ -185,10 +185,10 @@ AddTextToBuffer (LayerTypePtr Layer, TextTypePtr Text) * copies a polygon to buffer */ static void * -AddPolygonToBuffer (LayerTypePtr Layer, PolygonTypePtr Polygon) +AddPolygonToBuffer (LayerType *Layer, PolygonType *Polygon) { - LayerTypePtr layer = &Dest->Layer[GetLayerNumber (Source, Layer)]; - PolygonTypePtr polygon; + LayerType *layer = &Dest->Layer[GetLayerNumber (Source, Layer)]; + PolygonType *polygon; polygon = CreateNewPolygon (layer, Polygon->Flags); CopyPolygonLowLevel (polygon, Polygon); @@ -209,9 +209,9 @@ AddPolygonToBuffer (LayerTypePtr Layer, PolygonTypePtr Polygon) * copies a element to buffer */ static void * -AddElementToBuffer (ElementTypePtr Element) +AddElementToBuffer (ElementType *Element) { - ElementTypePtr element; + ElementType *element; element = GetElementMemory (Dest); CopyElementLowLevel (Dest, element, Element, false, 0, 0); @@ -287,7 +287,7 @@ MoveRatToBuffer (RatType *rat) static void * MoveLineToBuffer (LayerType *layer, LineType *line) { - LayerTypePtr lay = &Dest->Layer[GetLayerNumber (Source, layer)]; + LayerType *lay = &Dest->Layer[GetLayerNumber (Source, layer)]; RestoreToPolygon (Source, LINE_TYPE, layer, line); r_delete_entry (layer->line_tree, (BoxType *)line); @@ -428,9 +428,9 @@ MoveElementToBuffer (ElementType *element) * calculates the bounding box of the buffer */ void -SetBufferBoundingBox (BufferTypePtr Buffer) +SetBufferBoundingBox (BufferType *Buffer) { - BoxTypePtr box = GetDataBoundingBox (Buffer->Data); + BoxType *box = GetDataBoundingBox (Buffer->Data); if (box) Buffer->BoundingBox = *box; @@ -440,7 +440,7 @@ SetBufferBoundingBox (BufferTypePtr Buffer) * clears the contents of the paste buffer */ void -ClearBuffer (BufferTypePtr Buffer) +ClearBuffer (BufferType *Buffer) { if (Buffer && Buffer->Data) { @@ -454,7 +454,7 @@ ClearBuffer (BufferTypePtr Buffer) * returns true if any objects have been removed */ void -AddSelectedToBuffer (BufferTypePtr Buffer, Coord X, Coord Y, bool LeaveSelected) +AddSelectedToBuffer (BufferType *Buffer, Coord X, Coord Y, bool LeaveSelected) { /* switch crosshair off because adding objects to the pastebuffer * may change the 'valid' area for the cursor @@ -488,9 +488,9 @@ AddSelectedToBuffer (BufferTypePtr Buffer, Coord X, Coord Y, bool LeaveSelected) * if successful, update some other stuff and reposition the pastebuffer */ bool -LoadElementToBuffer (BufferTypePtr Buffer, char *Name, bool FromFile) +LoadElementToBuffer (BufferType *Buffer, char *Name, bool FromFile) { - ElementTypePtr element; + ElementType *element; ClearBuffer (Buffer); if (FromFile) @@ -716,7 +716,7 @@ search_footprint_hash (const char *footprint) /* Returns zero on success, non-zero on error. */ int -LoadFootprintByName (BufferTypePtr Buffer, char *Footprint) +LoadFootprintByName (BufferType *Buffer, char *Footprint) { int i; FootprintHashEntry *fpe; @@ -816,7 +816,7 @@ LoadFootprint (int argc, char **argv, Coord x, Coord y) char *name = ARG(0); char *refdes = ARG(1); char *value = ARG(2); - ElementTypePtr e; + ElementType *e; if (!name) AFAIL (loadfootprint); @@ -857,11 +8... [truncated message content] |