You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(4) |
Mar
(5) |
Apr
|
May
(5) |
Jun
(30) |
Jul
(2) |
Aug
(18) |
Sep
(14) |
Oct
(7) |
Nov
(21) |
Dec
(44) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(63) |
Feb
(94) |
Mar
(54) |
Apr
(39) |
May
(34) |
Jun
(25) |
Jul
(10) |
Aug
(33) |
Sep
(16) |
Oct
(62) |
Nov
(12) |
Dec
(2) |
| 2005 |
Jan
(71) |
Feb
(8) |
Mar
(50) |
Apr
|
May
(2) |
Jun
(12) |
Jul
(19) |
Aug
(8) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(8) |
| 2006 |
Jan
(10) |
Feb
(1) |
Mar
(301) |
Apr
(232) |
May
(26) |
Jun
(20) |
Jul
(26) |
Aug
(79) |
Sep
(92) |
Oct
(174) |
Nov
(17) |
Dec
(93) |
| 2007 |
Jan
(27) |
Feb
(179) |
Mar
(37) |
Apr
(81) |
May
(20) |
Jun
(5) |
Jul
|
Aug
(40) |
Sep
(68) |
Oct
(8) |
Nov
(47) |
Dec
(34) |
| 2008 |
Jan
(154) |
Feb
(15) |
Mar
(5) |
Apr
(21) |
May
(4) |
Jun
(1) |
Jul
(4) |
Aug
(6) |
Sep
(8) |
Oct
(9) |
Nov
(35) |
Dec
(50) |
| 2009 |
Jan
(8) |
Feb
(10) |
Mar
(6) |
Apr
(9) |
May
(7) |
Jun
(40) |
Jul
(7) |
Aug
(5) |
Sep
(2) |
Oct
(16) |
Nov
(42) |
Dec
(5) |
| 2010 |
Jan
(3) |
Feb
(15) |
Mar
(32) |
Apr
(18) |
May
(6) |
Jun
(9) |
Jul
|
Aug
(11) |
Sep
(16) |
Oct
|
Nov
(4) |
Dec
(35) |
| 2011 |
Jan
(24) |
Feb
(6) |
Mar
(27) |
Apr
(119) |
May
(72) |
Jun
(20) |
Jul
(31) |
Aug
(88) |
Sep
(86) |
Oct
(14) |
Nov
(11) |
Dec
(30) |
| 2012 |
Jan
(4) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <gi...@gp...> - 2010-12-21 13:07:54
|
The branch, master has been updated
via 5c0e88f2d44c4a22b6afa770750f2a599b048e2b (commit)
from a759c4a8360a686f7f415ef28f42c3d0d3296b64 (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/parse_l.l | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit 5c0e88f2d44c4a22b6afa770750f2a599b048e2b
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
parse_l.l: Fix warning implicit definition of function âCreateBeLenientâ
Warning was introduced in commit e8dd18a2f7b83c6108d2c9398903d4be92e22d4c
The required prototype was added to create.h, but create.h was not
included in parse_l.l
Note to developers:
Please "make clean" and build with "make -s" before pushing changes.
This kind of bug is really easy to catch, and I just recently spent
a log of effort cleaning up PCB's compile so we can catch real bugs!
Pretty please?
:100644 100644 4ed5741... 9799250... M src/parse_l.l
=========
Changes
=========
commit 5c0e88f2d44c4a22b6afa770750f2a599b048e2b
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
parse_l.l: Fix warning implicit definition of function âCreateBeLenientâ
Warning was introduced in commit e8dd18a2f7b83c6108d2c9398903d4be92e22d4c
The required prototype was added to create.h, but create.h was not
included in parse_l.l
Note to developers:
Please "make clean" and build with "make -s" before pushing changes.
This kind of bug is really easy to catch, and I just recently spent
a log of effort cleaning up PCB's compile so we can catch real bugs!
Pretty please?
diff --git a/src/parse_l.l b/src/parse_l.l
index 4ed5741..9799250 100644
--- a/src/parse_l.l
+++ b/src/parse_l.l
@@ -61,6 +61,7 @@ RCSID("$Id$");
#include "strflags.h"
#include "parse_l.h"
#include "parse_y.h"
+#include "create.h"
#define YY_NO_INPUT
|
|
From: <gi...@gp...> - 2010-12-21 12:10:14
|
The branch, master has been updated
via a759c4a8360a686f7f415ef28f42c3d0d3296b64 (commit)
from 7595662eae5a005024d17c09b713736c6c98314f (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 | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
=================
Commit Messages
=================
commit a759c4a8360a686f7f415ef28f42c3d0d3296b64
Author: Martin Kupec <mar...@ku...>
Commit: Peter Clifton <pc...@ca...>
action.c: Change macro ARG, to return NULL instead of 0
When the argument number requested does not exist, return NULL, not 0,
as this is more in keeping with the type (char *) normally returned.
Commit message modified by Peter Clifton <pc...@ca...>
:100644 100644 e3576bf... ba1fbed... M src/action.c
=========
Changes
=========
commit a759c4a8360a686f7f415ef28f42c3d0d3296b64
Author: Martin Kupec <mar...@ku...>
Commit: Peter Clifton <pc...@ca...>
action.c: Change macro ARG, to return NULL instead of 0
When the argument number requested does not exist, return NULL, not 0,
as this is more in keeping with the type (char *) normally returned.
Commit message modified by Peter Clifton <pc...@ca...>
diff --git a/src/action.c b/src/action.c
index e3576bf..ba1fbed 100644
--- a/src/action.c
+++ b/src/action.c
@@ -462,7 +462,7 @@ extern int stroke_trans (char *s);
#endif
static void ChangeFlag (char *, char *, int, char *);
-#define ARG(n) (argc > (n) ? argv[n] : 0)
+#define ARG(n) (argc > (n) ? argv[n] : NULL)
#ifdef HAVE_LIBSTROKE
@@ -5429,7 +5429,7 @@ ActionSelect (int argc, char **argv, int x, int y)
{
if (SelectObjectByName (type, pattern, true))
SetChangedFlag (true);
- if (ARG (1) == 0)
+ if (ARG (1) == NULL)
free (pattern);
}
break;
@@ -5612,7 +5612,7 @@ ActionUnselect (int argc, char **argv, int x, int y)
{
if (SelectObjectByName (type, pattern, false))
SetChangedFlag (true);
- if (ARG (1) == 0)
+ if (ARG (1) == NULL)
free (pattern);
}
break;
|
|
From: <gi...@gp...> - 2010-12-20 13:58:18
|
The branch, master has been updated
via 7595662eae5a005024d17c09b713736c6c98314f (commit)
via 7392b020deca9ef155f3b1449f1ad8fac6d6083b (commit)
via 788389f8f2b7db8773fff60d3370acd0d5226262 (commit)
from e8dd18a2f7b83c6108d2c9398903d4be92e22d4c (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/crosshair.c | 250 ++++++++++++++++++++++++++++++++++++++-----------------
src/search.c | 14 +++
src/search.h | 1 +
3 files changed, 190 insertions(+), 75 deletions(-)
=================
Commit Messages
=================
commit 7392b020deca9ef155f3b1449f1ad8fac6d6083b
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Only snap to pads on the active layer
:100644 100644 b944f0c... 4c94889... M src/crosshair.c
commit 788389f8f2b7db8773fff60d3370acd0d5226262
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Improve grid snapping heuristics
:100644 100644 6fa8bc9... b944f0c... M src/crosshair.c
:100644 100644 79451fe... 3fafcd4... M src/search.c
:100644 100644 ae71967... add5661... M src/search.h
=========
Changes
=========
commit 7392b020deca9ef155f3b1449f1ad8fac6d6083b
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Only snap to pads on the active layer
diff --git a/src/crosshair.c b/src/crosshair.c
index b944f0c..4c94889 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -838,20 +838,53 @@ FitCrosshairIntoGrid (LocationType X, LocationType Y)
if (PCB->RatDraw || TEST_FLAG (SNAPPINFLAG, PCB))
ans = SearchScreenGridSlop (Crosshair.X, Crosshair.Y,
- PAD_TYPE | PIN_TYPE, &ptr1, &ptr2, &ptr3);
+ PAD_TYPE, &ptr1, &ptr2, &ptr3);
else
ans = NO_TYPE;
/* Avoid self-snapping when moving */
- if (Settings.Mode == MOVE_MODE &&
- Crosshair.AttachedObject.Type == ELEMENT_TYPE)
+ if (ans && Settings.Mode == MOVE_MODE &&
+ Crosshair.AttachedObject.Type == ELEMENT_TYPE &&
+ ptr1 == Crosshair.AttachedObject.Ptr1)
+ ans = NO_TYPE;
+
+ if (ans && (Settings.Mode == LINE_MODE ||
+ (Settings.Mode == MOVE_MODE &&
+ Crosshair.AttachedObject.Type == LINEPOINT_TYPE)))
{
- if ((ans & (PAD_TYPE | PIN_TYPE)) &&
- ptr1 == Crosshair.AttachedObject.Ptr1)
+ PadTypePtr pad = (PadTypePtr) ptr2;
+ LayerType *desired_layer;
+ Cardinal desired_group;
+ Cardinal SLayer, CLayer;
+ int found_our_layer = false;
+
+ desired_layer = CURRENT;
+ if (Settings.Mode == MOVE_MODE &&
+ Crosshair.AttachedObject.Type == LINEPOINT_TYPE)
+ {
+ desired_layer = (LayerType *)Crosshair.AttachedObject.Ptr1;
+ }
+
+ /* find layer groups of the component side and solder side */
+ SLayer = GetLayerGroupNumberByNumber (solder_silk_layer);
+ CLayer = GetLayerGroupNumberByNumber (component_silk_layer);
+ desired_group = TEST_FLAG (ONSOLDERFLAG, pad) ? SLayer : CLayer;
+
+ GROUP_LOOP (PCB->Data, desired_group);
+ {
+ if (layer == desired_layer)
+ {
+ found_our_layer = true;
+ break;
+ }
+ }
+ END_LOOP;
+
+ if (found_our_layer == false)
ans = NO_TYPE;
}
- if (ans & PAD_TYPE)
+ if (ans)
{
PadTypePtr pad = (PadTypePtr) ptr2;
LocationType px, py;
@@ -869,7 +902,20 @@ FitCrosshairIntoGrid (LocationType X, LocationType Y)
nearest = sq_dist;
}
}
- else if (ans & PIN_TYPE)
+
+ if (PCB->RatDraw || TEST_FLAG (SNAPPINFLAG, PCB))
+ ans = SearchScreenGridSlop (Crosshair.X, Crosshair.Y,
+ PIN_TYPE, &ptr1, &ptr2, &ptr3);
+ else
+ ans = NO_TYPE;
+
+ /* Avoid self-snapping when moving */
+ if (ans && Settings.Mode == MOVE_MODE &&
+ Crosshair.AttachedObject.Type == ELEMENT_TYPE &&
+ ptr1 == Crosshair.AttachedObject.Ptr1)
+ ans = NO_TYPE;
+
+ if (ans)
{
PinTypePtr pin = (PinTypePtr) ptr2;
sq_dist = SQUARE (pin->X - Crosshair.X) + SQUARE (pin->Y - Crosshair.Y);
commit 788389f8f2b7db8773fff60d3370acd0d5226262
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Improve grid snapping heuristics
diff --git a/src/crosshair.c b/src/crosshair.c
index 6fa8bc9..b944f0c 100644
--- a/src/crosshair.c
+++ b/src/crosshair.c
@@ -774,6 +774,7 @@ FitCrosshairIntoGrid (LocationType X, LocationType Y)
{
LocationType x2, y2, x0, y0;
void *ptr1, *ptr2, *ptr3;
+ float nearest, sq_dist;
int ans;
x0 = 0;
@@ -783,41 +784,6 @@ FitCrosshairIntoGrid (LocationType X, LocationType Y)
Crosshair.X = MIN (Crosshair.MaxX, MAX (Crosshair.MinX, X));
Crosshair.Y = MIN (Crosshair.MaxY, MAX (Crosshair.MinY, Y));
- if (PCB->RatDraw || TEST_FLAG (SNAPPINFLAG, PCB))
- {
- ans =
- SearchScreen (Crosshair.X, Crosshair.Y,
- PAD_TYPE | PIN_TYPE, &ptr1, &ptr2, &ptr3);
- if (ans == NO_TYPE && !PCB->RatDraw)
- ans =
- SearchScreen (Crosshair.X, Crosshair.Y, VIA_TYPE | LINEPOINT_TYPE,
- &ptr1, &ptr2, &ptr3);
- if (ans == NO_TYPE && !PCB->RatDraw)
- ans =
- SearchScreen (Crosshair.X, Crosshair.Y, ELEMENT_TYPE, &ptr1, &ptr2,
- &ptr3);
- }
- else
- ans = NO_TYPE;
-
- /* avoid self-snapping */
- if (Settings.Mode == MOVE_MODE)
- {
- switch (Crosshair.AttachedObject.Type)
- {
- case ELEMENT_TYPE:
- if ((ans & (PAD_TYPE | PIN_TYPE)) &&
- ptr1 == Crosshair.AttachedObject.Ptr1)
- ans = NO_TYPE;
- break;
- case VIA_TYPE:
- /* just avoid snapping to any other vias */
- if (ans & PIN_TYPES)
- ans = NO_TYPE;
- break;
- }
- }
-
if (PCB->RatDraw)
{
x0 = -600;
@@ -867,6 +833,24 @@ FitCrosshairIntoGrid (LocationType X, LocationType Y)
}
}
+
+ nearest = -1;
+
+ if (PCB->RatDraw || TEST_FLAG (SNAPPINFLAG, PCB))
+ ans = SearchScreenGridSlop (Crosshair.X, Crosshair.Y,
+ PAD_TYPE | PIN_TYPE, &ptr1, &ptr2, &ptr3);
+ else
+ ans = NO_TYPE;
+
+ /* Avoid self-snapping when moving */
+ if (Settings.Mode == MOVE_MODE &&
+ Crosshair.AttachedObject.Type == ELEMENT_TYPE)
+ {
+ if ((ans & (PAD_TYPE | PIN_TYPE)) &&
+ ptr1 == Crosshair.AttachedObject.Ptr1)
+ ans = NO_TYPE;
+ }
+
if (ans & PAD_TYPE)
{
PadTypePtr pad = (PadTypePtr) ptr2;
@@ -875,64 +859,134 @@ FitCrosshairIntoGrid (LocationType X, LocationType Y)
px = (pad->Point1.X + pad->Point2.X) / 2;
py = (pad->Point1.Y + pad->Point2.Y) / 2;
- if (!gui->shift_is_pressed()
- || (SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) >
- SQUARE (px - Crosshair.X) + SQUARE (py - Crosshair.Y)))
- {
- x0 = px;
- y0 = py;
- }
+ sq_dist = SQUARE (px - Crosshair.X) + SQUARE (py - Crosshair.Y);
+
+ if (!gui->shift_is_pressed() ||
+ SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) > sq_dist)
+ {
+ x0 = px;
+ y0 = py;
+ nearest = sq_dist;
+ }
+ }
+ else if (ans & PIN_TYPE)
+ {
+ PinTypePtr pin = (PinTypePtr) ptr2;
+ sq_dist = SQUARE (pin->X - Crosshair.X) + SQUARE (pin->Y - Crosshair.Y);
+ if ((nearest == -1 || sq_dist < nearest) &&
+ (!gui->shift_is_pressed() ||
+ SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) > sq_dist))
+ {
+ x0 = pin->X;
+ y0 = pin->Y;
+ nearest = sq_dist;
+ }
+ }
+
+ if (TEST_FLAG (SNAPPINFLAG, PCB))
+ ans = SearchScreenGridSlop (Crosshair.X, Crosshair.Y,
+ VIA_TYPE, &ptr1, &ptr2, &ptr3);
+ else
+ ans = NO_TYPE;
+
+ /* Avoid snapping vias to any other vias */
+ if (Settings.Mode == MOVE_MODE &&
+ Crosshair.AttachedObject.Type == VIA_TYPE)
+ {
+ if (ans & PIN_TYPES)
+ ans = NO_TYPE;
}
- else if (ans & (PIN_TYPE | VIA_TYPE))
+ if (ans)
{
PinTypePtr pin = (PinTypePtr) ptr2;
- if (!gui->shift_is_pressed()
- || (SQUARE (x0 - Crosshair.X) +
- SQUARE (y0 - Crosshair.Y) >
- SQUARE (pin->X - Crosshair.X) + SQUARE (pin->Y - Crosshair.Y)))
- {
- x0 = pin->X;
- y0 = pin->Y;
- }
+ sq_dist = SQUARE (pin->X - Crosshair.X) + SQUARE (pin->Y - Crosshair.Y);
+ if ((nearest == -1 || sq_dist < nearest) &&
+ (!gui->shift_is_pressed() ||
+ SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) > sq_dist))
+ {
+ x0 = pin->X;
+ y0 = pin->Y;
+ nearest = sq_dist;
+ }
}
- else if (ans & LINEPOINT_TYPE)
+
+ if (TEST_FLAG (SNAPPINFLAG, PCB))
+ ans = SearchScreenGridSlop (Crosshair.X, Crosshair.Y,
+ LINEPOINT_TYPE, &ptr1, &ptr2, &ptr3);
+ else
+ ans = NO_TYPE;
+
+ if (ans)
{
PointTypePtr pnt = (PointTypePtr) ptr3;
- if (((x0 - Crosshair.X) * (x0 - Crosshair.X) +
- (y0 - Crosshair.Y) * (y0 - Crosshair.Y)) >
- ((pnt->X - Crosshair.X) * (pnt->X - Crosshair.X) +
- (pnt->Y - Crosshair.Y) * (pnt->Y - Crosshair.Y)))
- {
- x0 = pnt->X;
- y0 = pnt->Y;
- }
+ sq_dist = SQUARE (pnt->X - Crosshair.X) + SQUARE (pnt->Y - Crosshair.Y);
+ if ((nearest == -1 || sq_dist < nearest) &&
+ (!gui->shift_is_pressed() ||
+ SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) > sq_dist))
+ {
+ x0 = pnt->X;
+ y0 = pnt->Y;
+ nearest = sq_dist;
+ }
}
- else if (ans & ELEMENT_TYPE)
+
+ if (TEST_FLAG (SNAPPINFLAG, PCB))
+ ans = SearchScreenGridSlop (Crosshair.X, Crosshair.Y,
+ POLYGONPOINT_TYPE, &ptr1, &ptr2, &ptr3);
+ else
+ ans = NO_TYPE;
+
+ if (ans)
+ {
+ PointTypePtr pnt = (PointTypePtr) ptr3;
+ sq_dist = SQUARE (pnt->X - Crosshair.X) + SQUARE (pnt->Y - Crosshair.Y);
+ if ((nearest == -1 || sq_dist < nearest) &&
+ (!gui->shift_is_pressed() ||
+ SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) > sq_dist))
+ {
+ x0 = pnt->X;
+ y0 = pnt->Y;
+ nearest = sq_dist;
+ }
+ }
+
+
+ if (PCB->RatDraw || TEST_FLAG (SNAPPINFLAG, PCB))
+ ans = SearchScreenGridSlop (Crosshair.X, Crosshair.Y,
+ ELEMENT_TYPE, &ptr1, &ptr2, &ptr3);
+ else
+ ans = NO_TYPE;
+
+ if (ans & ELEMENT_TYPE)
{
ElementTypePtr el = (ElementTypePtr) ptr1;
- if (SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) >
- SQUARE (el->MarkX - Crosshair.X) + SQUARE (el->MarkY - Crosshair.Y))
- {
- x0 = el->MarkX;
- y0 = el->MarkY;
- }
+ sq_dist = SQUARE (el->MarkX - Crosshair.X) + SQUARE (el->MarkY - Crosshair.Y);
+ if ((nearest == -1 || sq_dist < nearest) &&
+ SQUARE (x0 - Crosshair.X) + SQUARE (y0 - Crosshair.Y) > sq_dist)
+ {
+ x0 = el->MarkX;
+ y0 = el->MarkY;
+ nearest = sq_dist;
+ }
}
+
if (x0 >= 0 && y0 >= 0)
{
Crosshair.X = x0;
Crosshair.Y = y0;
}
+
if (Settings.Mode == ARROW_MODE)
{
- ans =
- SearchScreen (Crosshair.X, Crosshair.Y, LINEPOINT_TYPE,
- &ptr1, &ptr2, &ptr3);
- if (ans == NO_TYPE)
- hid_action("PointCursor");
- else if (!TEST_FLAG(SELECTEDFLAG, (LineType *)ptr2))
- hid_actionl("PointCursor","True", NULL);
+ ans = SearchScreenGridSlop (Crosshair.X, Crosshair.Y,
+ LINEPOINT_TYPE, &ptr1, &ptr2, &ptr3);
+ if (ans == NO_TYPE)
+ hid_action("PointCursor");
+ else if (!TEST_FLAG(SELECTEDFLAG, (LineType *)ptr2))
+ hid_actionl("PointCursor","True", NULL);
}
+
if (Settings.Mode == LINE_MODE
&& Crosshair.AttachedLine.State != STATE_FIRST
&& TEST_FLAG (AUTODRCFLAG, PCB))
diff --git a/src/search.c b/src/search.c
index 79451fe..3fafcd4 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1601,3 +1601,17 @@ SearchScreen (LocationType X, LocationType Y, int Type, void **Result1,
X, Y, SLOP * pixel_slop);
return (ans);
}
+
+/* ---------------------------------------------------------------------------
+ * searches the cursor position for the type
+ */
+int
+SearchScreenGridSlop (LocationType X, LocationType Y, int Type, void **Result1,
+ void **Result2, void **Result3)
+{
+ int ans;
+
+ ans = SearchObjectByLocation (Type, Result1, Result2, Result3,
+ X, Y, PCB->Grid / 2);
+ return (ans);
+}
diff --git a/src/search.h b/src/search.h
index ae71967..add5661 100644
--- a/src/search.h
+++ b/src/search.h
@@ -85,6 +85,7 @@ bool IsPointInBox (LocationType, LocationType, BoxTypePtr, BDimension);
int SearchObjectByLocation (int, void **, void **, void **, LocationType,
LocationType, BDimension);
int SearchScreen (LocationType, LocationType, int, void **, void **, void **);
+int SearchScreenGridSlop (LocationType, LocationType, int, void **, void **, void **);
int SearchObjectByID (DataTypePtr, void **, void **, void **, int, int);
ElementTypePtr SearchElementByName (DataTypePtr, char *);
|
|
From: <gi...@gp...> - 2010-12-20 03:03:45
|
The branch, master has been updated
via e8dd18a2f7b83c6108d2c9398903d4be92e22d4c (commit)
from 05bd7804fa66b65159959c25d126ff939146a1eb (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/create.c | 33 ++++++++++++++++++++++++---------
src/create.h | 5 +++++
src/parse_l.l | 4 ++++
3 files changed, 33 insertions(+), 9 deletions(-)
=================
Commit Messages
=================
commit e8dd18a2f7b83c6108d2c9398903d4be92e22d4c
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Allow via copper to overlap; preserve illegal vias from file.
Reduce "overlapping via" tests to check for overlapping drills, not
overlapping copper. If a file being loaded has "illegal" vias, load
them anyway - the check only happens at create time, if the user figures
out a way around it, preserve it.
:100644 100644 538ea0d... 07de918... M src/create.c
:100644 100644 8086b1e... 521f60e... M src/create.h
:100644 100644 a2808ad... 4ed5741... M src/parse_l.l
=========
Changes
=========
commit e8dd18a2f7b83c6108d2c9398903d4be92e22d4c
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Allow via copper to overlap; preserve illegal vias from file.
Reduce "overlapping via" tests to check for overlapping drills, not
overlapping copper. If a file being loaded has "illegal" vias, load
them anyway - the check only happens at create time, if the user figures
out a way around it, preserve it.
diff --git a/src/create.c b/src/create.c
index 538ea0d..07de918 100644
--- a/src/create.c
+++ b/src/create.c
@@ -66,6 +66,8 @@ RCSID ("$Id$");
static int ID = 1; /* current object ID; incremented after */
/* each creation of an object */
+static bool be_lenient = false;
+
/* ----------------------------------------------------------------------
* some local prototypes
*/
@@ -74,6 +76,16 @@ static void AddTextToElement (TextTypePtr, FontTypePtr,
FlagType);
/* ---------------------------------------------------------------------------
+ * Set the lenience mode.
+ */
+
+void
+CreateBeLenient (bool v)
+{
+ be_lenient = v;
+}
+
+/* ---------------------------------------------------------------------------
* creates a new paste buffer
*/
DataTypePtr
@@ -229,17 +241,20 @@ CreateNewVia (DataTypePtr Data,
{
PinTypePtr Via;
- VIA_LOOP (Data);
- {
- if (SQUARE (via->X - X) + SQUARE (via->Y - Y) <=
- SQUARE (via->Thickness / 2 + Thickness / 2))
+ if (!be_lenient)
{
- Message (_("Dropping via at (%d, %d) because it would overlap with the via "
- "at (%d, %d)\n"), X/100, Y/100, via->X/100, via->Y/100);
- return (NULL); /* don't allow via stacking */
+ VIA_LOOP (Data);
+ {
+ if (SQUARE (via->X - X) + SQUARE (via->Y - Y) <=
+ SQUARE (via->DrillingHole / 2 + DrillingHole / 2))
+ {
+ Message (_("Dropping via at (%d, %d) because it's hole would overlap with the via "
+ "at (%d, %d)\n"), X/100, Y/100, via->X/100, via->Y/100);
+ return (NULL); /* don't allow via stacking */
+ }
+ }
+ END_LOOP;
}
- }
- END_LOOP;
Via = GetViaMemory (Data);
diff --git a/src/create.h b/src/create.h
index 8086b1e..521f60e 100644
--- a/src/create.h
+++ b/src/create.h
@@ -33,6 +33,11 @@
#include "global.h"
+/* TRUE during file loads, for example to allow overlapping vias.
+ FALSE otherwise, to stop the user from doing normally dangerous
+ things. */
+void CreateBeLenient (bool);
+
DataTypePtr CreateNewBuffer (void);
void pcb_colors_from_settings (PCBTypePtr);
PCBTypePtr CreateNewPCB (bool);
diff --git a/src/parse_l.l b/src/parse_l.l
index a2808ad..4ed5741 100644
--- a/src/parse_l.l
+++ b/src/parse_l.l
@@ -275,6 +275,8 @@ static int Parse(char *Executable, char *Path, char *Filename, char *Parameter)
* on termination.
*/
+ CreateBeLenient (true);
+
#if !defined(HAS_ATEXIT) && !defined(HAS_ON_EXIT)
if (PCB)
SaveTMPData();
@@ -286,6 +288,8 @@ static int Parse(char *Executable, char *Path, char *Filename, char *Parameter)
/* clean up parse buffer */
yy_delete_buffer(YY_CURRENT_BUFFER);
+ CreateBeLenient (false);
+
if (used_popen)
return(pclose(yyin) ? 1 : returncode);
return(fclose(yyin) ? 1 : returncode);
|
|
From: <gi...@gp...> - 2010-12-17 02:24:45
|
The branch, master has been updated
via 05bd7804fa66b65159959c25d126ff939146a1eb (commit)
from 6ee0bf592060806969097754e387cd19cd9bfc4c (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/rats.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 50 insertions(+), 5 deletions(-)
=================
Commit Messages
=================
commit 05bd7804fa66b65159959c25d126ff939146a1eb
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Further work on rats patch.
Add a lot of comments to clarify what's happening in that function (the
previous patch was bogus because the function re-uses a structure
in an unintended way). Fixed the logic to be mew paranoid.
:100644 100644 0ed87dd... 5fe86cd... M src/rats.c
=========
Changes
=========
commit 05bd7804fa66b65159959c25d126ff939146a1eb
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Further work on rats patch.
Add a lot of comments to clarify what's happening in that function (the
previous patch was bogus because the function re-uses a structure
in an unintended way). Fixed the logic to be mew paranoid.
diff --git a/src/rats.c b/src/rats.c
index 0ed87dd..5fe86cd 100644
--- a/src/rats.c
+++ b/src/rats.c
@@ -553,6 +553,11 @@ GatherSubnets (NetListTypePtr Netl, bool NoWarn, bool AndRats)
/* ---------------------------------------------------------------------------
* Draw a rat net (tree) having the shortest lines
* this also frees the subnet memory as they are consumed
+ *
+ * Note that the Netl we are passed is NOT the main netlist - it's the
+ * connectivity for ONE net. It represents the CURRENT connectivity
+ * state for the net, with each Netl->Net[N] representing one
+ * copper-connected subset of the net.
*/
static bool
@@ -563,11 +568,14 @@ DrawShortestRats (NetListTypePtr Netl, void (*funcp) ())
register ConnectionTypePtr conn1, conn2, firstpoint, secondpoint;
PolygonTypePtr polygon;
bool changed = false;
- bool havepoints = false;
+ bool havepoints;
Cardinal n, m, j;
NetTypePtr next, subnet, theSubnet = NULL;
- if (Netl->Net[0].ConnectionN < 2)
+ /* This is just a sanity check, to make sure we're passed
+ * *something*.
+ */
+ if (!Netl || Netl->NetN < 1)
return false;
/*
@@ -578,15 +586,41 @@ DrawShortestRats (NetListTypePtr Netl, void (*funcp) ())
* connected items. This loop finds the closest vertex pairs between
* each blob and draws rats that merge the blobs until there's just
* one big blob.
+ *
+ * Just to clarify, with some examples:
+ *
+ * Each Netl is one full net from a netlist, like from gnetlist.
+ * Each Netl->Net[N] is a subset of that net that's already
+ * physically connected on the pcb.
+ *
+ * So a new design with no traces yet, would have a huge list of Net[N],
+ * each with one pin in it.
+ *
+ * A fully routed design would have one Net[N] with all the pins
+ * (for that net) in it.
+ */
+
+ /*
+ * We keep doing this do/while loop until everything's connected.
+ * I.e. once per rat we add.
*/
distance = 0.0;
- do
+ havepoints = true; /* so we run the loop at least once */
+ while (Netl->NetN > 1 && havepoints)
{
- firstpoint = secondpoint = NULL;
+ /* This is the top of the "find one rat" logic. */
havepoints = false;
+ firstpoint = secondpoint = NULL;
+
+ /* Test Net[0] vs Net[N] for N=1..max. Find the shortest
+ distance between any two points in different blobs. */
subnet = &Netl->Net[0];
for (j = 1; j < Netl->NetN; j++)
{
+ /*
+ * Scan between Net[0] blob (subnet) and Net[N] blob (next).
+ * Note the shortest distance we find.
+ */
next = &Netl->Net[j];
for (n = subnet->ConnectionN - 1; n != -1; n--)
{
@@ -595,6 +629,13 @@ DrawShortestRats (NetListTypePtr Netl, void (*funcp) ())
{
conn2 = &next->Connection[m];
/*
+ * At this point, conn1 and conn2 are two pins in
+ * different blobs of the same net. See how far
+ * apart they are, and if they're "closer" than what
+ * we already have.
+ */
+
+ /*
* Prefer to connect Connections over polygons to the
* polygons (ie assume the user wants a via to a plane,
* not a daisy chain). Further prefer to pick an existing
@@ -637,6 +678,10 @@ DrawShortestRats (NetListTypePtr Netl, void (*funcp) ())
}
}
+ /*
+ * If HAVEPOINTS is true, we've found a pair of points in two
+ * separate blobs of the net, and need to connect them together.
+ */
if (havepoints)
{
if (funcp)
@@ -664,7 +709,7 @@ DrawShortestRats (NetListTypePtr Netl, void (*funcp) ())
/* copy theSubnet into the current subnet */
TransferNet (Netl, theSubnet, subnet);
}
- } while (Netl->NetN > 1 && havepoints);
+ }
/* presently nothing to do with the new subnet */
/* so we throw it away and free the space */
|
|
From: <gi...@gp...> - 2010-12-17 01:22:50
|
The branch, master has been updated
via 6ee0bf592060806969097754e387cd19cd9bfc4c (commit)
from e4a747dcc4fc8c2e1087cf876a17be58d4b70912 (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/rats.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
=================
Commit Messages
=================
commit 6ee0bf592060806969097754e387cd19cd9bfc4c
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Fix rats bug (SF 3137324)
When adding rats from a netlist, we want to skip nets with too few
connections, not netlists with too few nets.
:100644 100644 8dc513c... 0ed87dd... M src/rats.c
=========
Changes
=========
commit 6ee0bf592060806969097754e387cd19cd9bfc4c
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Fix rats bug (SF 3137324)
When adding rats from a netlist, we want to skip nets with too few
connections, not netlists with too few nets.
diff --git a/src/rats.c b/src/rats.c
index 8dc513c..0ed87dd 100644
--- a/src/rats.c
+++ b/src/rats.c
@@ -567,7 +567,7 @@ DrawShortestRats (NetListTypePtr Netl, void (*funcp) ())
Cardinal n, m, j;
NetTypePtr next, subnet, theSubnet = NULL;
- if (Netl->NetN < 2)
+ if (Netl->Net[0].ConnectionN < 2)
return false;
/*
|
|
From: <gi...@gp...> - 2010-12-12 06:06:26
|
The branch, master has been updated
via e4a747dcc4fc8c2e1087cf876a17be58d4b70912 (commit)
from 2d8dc8a3a3a55158b4e6278dd9f40588e4111c2d (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/report.c | 360 +++++++++++++++++++++++++++++++---------------------------
1 files changed, 191 insertions(+), 169 deletions(-)
=================
Commit Messages
=================
commit e4a747dcc4fc8c2e1087cf876a17be58d4b70912
Author: Ineiev <in...@us...>
Commit: DJ Delorie <dj...@de...>
report object coordinates in selected units
SF patch 1621915
HOW TO TEST
load a pcb; Ctrl-R on objects of different types;
the reported units should be either mm or mils according to selected units
04 Oct 2010: merged with Joerg Wunsch's patch 2995918
"Add human-readable info to polygon report"
:100644 100644 7af4358... be6d1e6... M src/report.c
=========
Changes
=========
commit e4a747dcc4fc8c2e1087cf876a17be58d4b70912
Author: Ineiev <in...@us...>
Commit: DJ Delorie <dj...@de...>
report object coordinates in selected units
SF patch 1621915
HOW TO TEST
load a pcb; Ctrl-R on objects of different types;
the reported units should be either mm or mils according to selected units
04 Oct 2010: merged with Joerg Wunsch's patch 2995918
"Add human-readable info to polygon report"
diff --git a/src/report.c b/src/report.c
index 7af4358..be6d1e6 100644
--- a/src/report.c
+++ b/src/report.c
@@ -1,5 +1,3 @@
-/* $Id$ */
-
/*
* COPYRIGHT
*
@@ -20,7 +18,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contact addresses for paper mail and Email:
* Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
@@ -53,11 +51,11 @@
#include <dmalloc.h>
#endif
-RCSID ("$Id$");
-
+static double
+units(double value)
+{return (Settings.grid_units_mm ? (value * COOR_TO_MM) : (value / 100.0));}
-#define UNIT1(value) (Settings.grid_units_mm ? ((value) / 100000.0 * 25.4) : ((value) / 100.0))
-#define UNIT(value) UNIT1(value) , (Settings.grid_units_mm ? "mm" : "mils")
+#define UNIT(value) units(value), (Settings.grid_units_mm ? "mm" : "mils")
static int
ReportDrills (int argc, char **argv, int x, int y)
@@ -66,6 +64,7 @@ ReportDrills (int argc, char **argv, int x, int y)
Cardinal n;
char *stringlist, *thestring;
int total_drills = 0;
+ int prec = Settings.grid_units_mm? 4: 2;
AllDrills = GetDrillInfo (PCB->Data);
RoundDrillInfo (AllDrills, 100);
@@ -84,16 +83,17 @@ ReportDrills (int argc, char **argv, int x, int y)
*/
sprintf (stringlist,
"There are %d different drill sizes used in this layout, %d holes total\n\n"
- "Drill Diam. (mils)\t# of Pins\t# of Vias\t# of Elements\t# Unplated\n",
- AllDrills->DrillN, total_drills);
+ "Drill Diam. (%s)\t# of Pins\t# of Vias\t# of Elements\t# Unplated\n",
+ AllDrills->DrillN, total_drills,
+ Settings.grid_units_mm? "mm": "mils");
thestring = stringlist;
while (*thestring != '\0')
thestring++;
for (n = 0; n < AllDrills->DrillN; n++)
{
sprintf (thestring,
- "\t%d\t\t\t%d\t\t%d\t\t%d\t\t%d\n",
- (AllDrills->Drill[n].DrillSize+50) / 100,
+ "\t%.*f\t\t%d\t\t%d\t\t%d\t\t%d\n",
+ prec, units (AllDrills->Drill[n].DrillSize),
AllDrills->Drill[n].PinCount, AllDrills->Drill[n].ViaCount,
AllDrills->Drill[n].ElementN,
AllDrills->Drill[n].UnplatedCount);
@@ -124,7 +124,7 @@ static int
ReportDialog (int argc, char **argv, int x, int y)
{
void *ptr1, *ptr2, *ptr3;
- int type;
+ int type, prec = Settings.grid_units_mm? 4: 2;
char report[2048];
type = SearchScreen (x, y, REPORT_TYPES, &ptr1, &ptr2, &ptr3);
@@ -146,30 +146,34 @@ ReportDialog (int argc, char **argv, int x, int y)
#endif
via = (PinTypePtr) ptr2;
if (TEST_FLAG (HOLEFLAG, via))
- sprintf (&report[0], "VIA ID# %ld Flags:%s\n"
- "(X,Y) = (%d, %d)\n"
- "It is a pure hole of diameter %0.2f %s\n"
- "Name = \"%s\""
+ sprintf (&report[0], "VIA ID# %ld; Flags:%s\n"
+ "(X,Y) = (%.*f, %.*f) %s.\n"
+ "It is a pure hole of diameter %.*f %s.\n"
+ "Name = \"%s\"."
"%s", via->ID, flags_to_string (via->Flags, VIA_TYPE),
- via->X, via->Y, UNIT (via->DrillingHole),
+ prec, units (via->X), prec, UNIT (via->Y),
+ prec, UNIT (via->DrillingHole),
EMPTY (via->Name), TEST_FLAG (LOCKFLAG,
- via) ? "It is LOCKED\n" :
+ via) ? "It is LOCKED.\n" :
"");
else
- sprintf (&report[0], "VIA ID# %ld Flags:%s\n"
- "(X,Y) = (%d, %d)\n"
- "Copper width = %0.2f %s Drill width = %0.2f %s\n"
- "Clearance width in polygons = %0.2f %s\n"
- "Annulus = %0.2f %s\n"
- "Solder mask hole = %0.2f %s (gap = %0.2f %s)\n"
- "Name = \"%s\""
+ sprintf (&report[0], "VIA ID# %ld; Flags:%s\n"
+ "(X,Y) = (%.*f, %.*f) %s.\n"
+ "Copper width = %0.*f %s. Drill width = %0.*f %s.\n"
+ "Clearance width in polygons = %0.*f %s.\n"
+ "Annulus = %0.*f %s.\n"
+ "Solder mask hole = %0.*f %s (gap = %0.*f %s).\n"
+ "Name = \"%s\"."
"%s", via->ID, flags_to_string (via->Flags, VIA_TYPE),
- via->X, via->Y, UNIT (via->Thickness),
- UNIT (via->DrillingHole), UNIT (via->Clearance / 2.),
- UNIT ((via->Thickness - via->DrillingHole)/2),
- UNIT (via->Mask), UNIT ((via->Mask - via->Thickness)/2),
+ prec, units (via->X), prec, UNIT (via->Y),
+ prec, UNIT (via->Thickness),
+ prec, UNIT (via->DrillingHole),
+ prec, UNIT (via->Clearance / 2.),
+ prec, UNIT ((via->Thickness - via->DrillingHole)/2),
+ prec, UNIT (via->Mask),
+ prec, UNIT ((via->Mask - via->Thickness)/2),
EMPTY (via->Name), TEST_FLAG (LOCKFLAG, via) ?
- "It is LOCKED\n" : "");
+ "It is LOCKED.\n" : "");
break;
}
case PIN_TYPE:
@@ -193,32 +197,36 @@ ReportDialog (int argc, char **argv, int x, int y)
}
END_LOOP;
if (TEST_FLAG (HOLEFLAG, Pin))
- sprintf (&report[0], "PIN ID# %ld Flags:%s\n"
- "(X,Y) = (%d, %d)\n"
- "It is a mounting hole, Drill width = %0.2f %s\n"
- "It is owned by element %s\n"
+ sprintf (&report[0], "PIN ID# %ld; Flags:%s\n"
+ "(X,Y) = (%.*f, %.*f) %s.\n"
+ "It is a mounting hole. Drill width = %0.*f %s.\n"
+ "It is owned by element %s.\n"
"%s", Pin->ID, flags_to_string (Pin->Flags, PIN_TYPE),
- Pin->X, Pin->Y, UNIT (Pin->DrillingHole),
+ prec, units (Pin->X), prec, UNIT (Pin->Y),
+ prec, UNIT (Pin->DrillingHole),
EMPTY (element->Name[1].TextString),
- TEST_FLAG (LOCKFLAG, Pin) ? "It is LOCKED\n" : "");
+ TEST_FLAG (LOCKFLAG, Pin) ? "It is LOCKED.\n" : "");
else
sprintf (&report[0],
- "PIN ID# %ld Flags:%s\n" "(X,Y) = (%d, %d)\n"
- "Copper width = %0.2f %s Drill width = %0.2f %s\n"
- "Clearance width to Polygon = %0.2f %s\n"
- "Annulus = %0.2f %s\n"
- "Solder mask hole = %0.2f %s (gap = %0.2f %s)\n"
- "Name = \"%s\"\n"
- "It is owned by element %s\n" "As pin number %s\n"
+ "PIN ID# %ld; Flags:%s\n" "(X,Y) = (%.*f, %.*f) %s.\n"
+ "Copper width = %0.*f %s. Drill width = %0.*f %s.\n"
+ "Clearance width to Polygon = %0.*f %s.\n"
+ "Annulus = %0.*f %s.\n"
+ "Solder mask hole = %0.*f %s (gap = %0.*f %s).\n"
+ "Name = \"%s\".\n"
+ "It is owned by element %s\n as pin number %s.\n"
"%s",
Pin->ID, flags_to_string (Pin->Flags, PIN_TYPE),
- Pin->X, Pin->Y, UNIT (Pin->Thickness),
- UNIT (Pin->DrillingHole), UNIT (Pin->Clearance / 2.),
- UNIT ((Pin->Thickness - Pin->DrillingHole)/2),
- UNIT (Pin->Mask), UNIT ((Pin->Mask - Pin->Thickness)/2),
+ prec, units(Pin->X), prec, UNIT(Pin->Y),
+ prec, UNIT (Pin->Thickness),
+ prec, UNIT (Pin->DrillingHole),
+ prec, UNIT (Pin->Clearance / 2.),
+ prec, UNIT ((Pin->Thickness - Pin->DrillingHole)/2),
+ prec, UNIT (Pin->Mask),
+ prec, UNIT ((Pin->Mask - Pin->Thickness)/2),
EMPTY (Pin->Name),
EMPTY (element->Name[1].TextString), EMPTY (Pin->Number),
- TEST_FLAG (LOCKFLAG, Pin) ? "It is LOCKED\n" : "");
+ TEST_FLAG (LOCKFLAG, Pin) ? "It is LOCKED.\n" : "");
break;
}
case LINE_TYPE:
@@ -233,21 +241,21 @@ ReportDialog (int argc, char **argv, int x, int y)
}
#endif
line = (LineTypePtr) ptr2;
- sprintf (&report[0], "LINE ID# %ld Flags:%s\n"
- "FirstPoint(X,Y) = (%d, %d) ID = %ld\n"
- "SecondPoint(X,Y) = (%d, %d) ID = %ld\n"
- "Width = %0.2f %s.\nClearance width in polygons = %0.2f %s.\n"
+ sprintf (&report[0], "LINE ID# %ld; Flags:%s\n"
+ "FirstPoint(X,Y) = (%.*f, %.*f) %s, ID = %ld.\n"
+ "SecondPoint(X,Y) = (%.*f, %.*f) %s, ID = %ld.\n"
+ "Width = %0.*f %s.\nClearance width in polygons = %0.*f %s.\n"
"It is on layer %d\n"
- "and has name %s\n"
+ "and has name \"%s\".\n"
"%s",
line->ID, flags_to_string (line->Flags, LINE_TYPE),
- line->Point1.X, line->Point1.Y,
- line->Point1.ID, line->Point2.X, line->Point2.Y,
- line->Point2.ID, UNIT (line->Thickness),
- UNIT (line->Clearance / 2.), GetLayerNumber (PCB->Data,
+ prec, units (line->Point1.X), prec, UNIT (line->Point1.Y),
+ line->Point1.ID, prec, units (line->Point2.X), prec, UNIT (line->Point2.Y),
+ line->Point2.ID, prec, UNIT (line->Thickness),
+ prec, UNIT (line->Clearance / 2.), GetLayerNumber (PCB->Data,
(LayerTypePtr) ptr1),
UNKNOWN (line->Number), TEST_FLAG (LOCKFLAG,
- line) ? "It is LOCKED\n" :
+ line) ? "It is LOCKED.\n" :
"");
break;
}
@@ -262,15 +270,15 @@ ReportDialog (int argc, char **argv, int x, int y)
}
#endif
line = (RatTypePtr) ptr2;
- sprintf (&report[0], "RAT-LINE ID# %ld Flags:%s\n"
- "FirstPoint(X,Y) = (%d, %d) ID = %ld "
- "connects to layer group %d\n"
- "SecondPoint(X,Y) = (%d, %d) ID = %ld "
- "connects to layer group %d\n",
+ sprintf (&report[0], "RAT-LINE ID# %ld; Flags:%s\n"
+ "FirstPoint(X,Y) = (%.*f, %.*f) %s; ID = %ld; "
+ "connects to layer group %d.\n"
+ "SecondPoint(X,Y) = (%.*f, %.*f) %s; ID = %ld; "
+ "connects to layer group %d.\n",
line->ID, flags_to_string (line->Flags, LINE_TYPE),
- line->Point1.X, line->Point1.Y,
+ prec, units (line->Point1.X), prec, UNIT (line->Point1.Y),
line->Point1.ID, line->group1,
- line->Point2.X, line->Point2.Y,
+ prec, units (line->Point2.X), prec, UNIT (line->Point2.Y),
line->Point2.ID, line->group2);
break;
}
@@ -289,23 +297,26 @@ ReportDialog (int argc, char **argv, int x, int y)
Arc = (ArcTypePtr) ptr2;
box = GetArcEnds (Arc);
- sprintf (&report[0], "ARC ID# %ld Flags:%s\n"
- "CenterPoint(X,Y) = (%d, %d)\n"
- "Radius = %0.2f %s, Thickness = %0.2f %s\n"
- "Clearance width in polygons = %0.2f %s\n"
- "StartAngle = %ld degrees, DeltaAngle = %ld degrees\n"
- "Bounding Box is (%d,%d), (%d,%d)\n"
- "That makes the end points at (%d,%d) and (%d,%d)\n"
- "It is on layer %d\n"
+ sprintf (&report[0], "ARC ID# %ld; Flags:%s\n"
+ "CenterPoint(X,Y) = (%.*f, %.*f) %s.\n"
+ "Radius = %0.*f %s, Thickness = %0.*f %s.\n"
+ "Clearance width in polygons = %0.*f %s.\n"
+ "StartAngle = %ld degrees, DeltaAngle = %ld degrees.\n"
+ "Bounding Box is (%.*f,%.*f), (%.*f,%.*f) %s.\n"
+ "That makes the end points at (%.*f,%.*f) %s and (%.*f,%.*f) %s.\n"
+ "It is on layer %d.\n"
"%s", Arc->ID, flags_to_string (Arc->Flags, ARC_TYPE),
- Arc->X, Arc->Y, UNIT (Arc->Width), UNIT (Arc->Thickness),
- UNIT (Arc->Clearance / 2.), Arc->StartAngle, Arc->Delta,
- Arc->BoundingBox.X1, Arc->BoundingBox.Y1,
- Arc->BoundingBox.X2, Arc->BoundingBox.Y2, box->X1,
- box->Y1, box->X2, box->Y2, GetLayerNumber (PCB->Data,
- (LayerTypePtr)
- ptr1),
- TEST_FLAG (LOCKFLAG, Arc) ? "It is LOCKED\n" : "");
+ prec, units(Arc->X), prec, UNIT(Arc->Y),
+ prec, UNIT (Arc->Width), prec, UNIT (Arc->Thickness),
+ prec, UNIT (Arc->Clearance / 2.), Arc->StartAngle, Arc->Delta,
+ prec, units (Arc->BoundingBox.X1),
+ prec, units (Arc->BoundingBox.Y1),
+ prec, units (Arc->BoundingBox.X2),
+ prec, UNIT (Arc->BoundingBox.Y2),
+ prec, units (box->X1), prec, UNIT (box->Y1),
+ prec, units (box->X2), prec, UNIT (box->Y2),
+ GetLayerNumber (PCB->Data, (LayerTypePtr) ptr1),
+ TEST_FLAG (LOCKFLAG, Arc) ? "It is LOCKED.\n" : "");
break;
}
case POLYGON_TYPE:
@@ -321,19 +332,21 @@ ReportDialog (int argc, char **argv, int x, int y)
#endif
Polygon = (PolygonTypePtr) ptr2;
- sprintf (&report[0], "POLYGON ID# %ld Flags:%s\n"
- "Its bounding box is (%d,%d) (%d,%d)\n"
+ sprintf (&report[0], "POLYGON ID# %ld; Flags:%s\n"
+ "Its bounding box is (%.*f,%.*f) (%.*f,%.*f) %s.\n"
"It has %d points and could store %d more\n"
- "without using more memory.\n"
- "It has %d holes and resides on layer %d\n"
+ " without using more memory.\n"
+ "It has %d holes and resides on layer %d.\n"
"%s", Polygon->ID,
flags_to_string (Polygon->Flags, POLYGON_TYPE),
- Polygon->BoundingBox.X1, Polygon->BoundingBox.Y1,
- Polygon->BoundingBox.X2, Polygon->BoundingBox.Y2,
+ prec, units(Polygon->BoundingBox.X1),
+ prec, units(Polygon->BoundingBox.Y1),
+ prec, units(Polygon->BoundingBox.X2),
+ prec, UNIT(Polygon->BoundingBox.Y2),
Polygon->PointN, Polygon->PointMax - Polygon->PointN,
Polygon->HoleIndexN,
GetLayerNumber (PCB->Data, (LayerTypePtr) ptr1),
- TEST_FLAG (LOCKFLAG, Polygon) ? "It is LOCKED\n" : "");
+ TEST_FLAG (LOCKFLAG, Polygon) ? "It is LOCKED.\n" : "");
break;
}
case PAD_TYPE:
@@ -363,29 +376,33 @@ ReportDialog (int argc, char **argv, int x, int y)
dy = Pad->Point1.Y - Pad->Point2.Y;
len = sqrt (dx*dx+dy*dy);
mgap = (Pad->Mask - Pad->Thickness)/2;
- sprintf (&report[0], "PAD ID# %ld Flags:%s\n"
- "FirstPoint(X,Y) = (%d, %d) ID = %ld\n"
- "SecondPoint(X,Y) = (%d, %d) ID = %ld\n"
- "Width = %0.2f %s. Length = %0.2f %s.\n"
- "Clearance width in polygons = %0.2f %s.\n"
- "Solder mask = %0.2f x %0.2f %s (gap = %0.2f %s).\n"
- "Name = \"%s\"\n"
+ sprintf (&report[0], "PAD ID# %ld; Flags:%s\n"
+ "FirstPoint(X,Y) = (%.*f, %.*f) %s; ID = %ld.\n"
+ "SecondPoint(X,Y) = (%.*f, %.*f) %s; ID = %ld.\n"
+ "Width = %0.*f %s. Length = %0.*f %s.\n"
+ "Clearance width in polygons = %0.*f %s.\n"
+ "Solder mask = %0.*f x %0.*f %s (gap = %0.*f %s).\n"
+ "Name = \"%s\".\n"
"It is owned by SMD element %s\n"
- "As pin number %s and is on the %s\n"
+ " as pin number %s and is on the %s\n"
"side of the board.\n"
"%s", Pad->ID,
flags_to_string (Pad->Flags, PAD_TYPE),
- Pad->Point1.X, Pad->Point1.Y, Pad->Point1.ID,
- Pad->Point2.X, Pad->Point2.Y, Pad->Point2.ID,
- UNIT (Pad->Thickness), UNIT (len + Pad->Thickness),
- UNIT (Pad->Clearance / 2.),
- UNIT1 (Pad->Mask), UNIT (Pad->Mask + len), UNIT (mgap),
+ prec, units (Pad->Point1.X),
+ prec, UNIT (Pad->Point1.Y), Pad->Point1.ID,
+ prec, units (Pad->Point2.X),
+ prec, UNIT (Pad->Point2.Y), Pad->Point2.ID,
+ prec, UNIT (Pad->Thickness),
+ prec, UNIT (len + Pad->Thickness),
+ prec, UNIT (Pad->Clearance / 2.),
+ prec, units (Pad->Mask), prec, UNIT (Pad->Mask + len),
+ prec, UNIT (mgap),
EMPTY (Pad->Name),
EMPTY (element->Name[1].TextString),
EMPTY (Pad->Number),
TEST_FLAG (ONSOLDERFLAG,
Pad) ? "solder (bottom)" : "component",
- TEST_FLAG (LOCKFLAG, Pad) ? "It is LOCKED\n" : "");
+ TEST_FLAG (LOCKFLAG, Pad) ? "It is LOCKED.\n" : "");
break;
}
case ELEMENT_TYPE:
@@ -399,29 +416,32 @@ ReportDialog (int argc, char **argv, int x, int y)
}
#endif
element = (ElementTypePtr) ptr2;
- sprintf (&report[0], "ELEMENT ID# %ld Flags:%s\n"
- "BoundingBox (%d,%d) (%d,%d)\n"
- "Descriptive Name \"%s\"\n"
- "Name on board \"%s\"\n"
- "Part number name \"%s\"\n"
- "It is %0.2f %s tall and is located at (X,Y) = (%d,%d)\n"
- "%s"
- "Mark located at point (X,Y) = (%d,%d)\n"
+ sprintf (&report[0], "ELEMENT ID# %ld; Flags:%s\n"
+ "BoundingBox (%.*f,%.*f) (%.*f,%.*f) %s.\n"
+ "Descriptive Name \"%s\".\n"
+ "Name on board \"%s\".\n"
+ "Part number name \"%s\".\n"
+ "It is %.*f %s tall and is located at (X,Y) = (%.*f,%.*f)%s.\n"
+ "Mark located at point (X,Y) = (%.*f,%.*f).\n"
"It is on the %s side of the board.\n"
"%s",
element->ID, flags_to_string (element->Flags, ELEMENT_TYPE),
- element->BoundingBox.X1, element->BoundingBox.Y1,
- element->BoundingBox.X2, element->BoundingBox.Y2,
+ prec, units(element->BoundingBox.X1),
+ prec, units (element->BoundingBox.Y1),
+ prec, units(element->BoundingBox.X2),
+ prec, UNIT (element->BoundingBox.Y2),
EMPTY (element->Name[0].TextString),
EMPTY (element->Name[1].TextString),
EMPTY (element->Name[2].TextString),
- UNIT (0.45 * element->Name[1].Scale * 100.), element->Name[1].X,
- element->Name[1].Y, TEST_FLAG (HIDENAMEFLAG, element) ?
- "But it's hidden\n" : "", element->MarkX,
- element->MarkY, TEST_FLAG (ONSOLDERFLAG,
- element) ? "solder (bottom)" :
+ prec, UNIT (0.45 * element->Name[1].Scale * 100.),
+ prec, units(element->Name[1].X),
+ prec, units(element->Name[1].Y),
+ TEST_FLAG (HIDENAMEFLAG, element) ?
+ ",\n but it's hidden" : "", prec, units(element->MarkX),
+ prec, units(element->MarkY),
+ TEST_FLAG (ONSOLDERFLAG, element) ? "solder (bottom)" :
"component", TEST_FLAG (LOCKFLAG, element) ?
- "It is LOCKED\n" : "");
+ "It is LOCKED.\n" : "");
break;
}
case TEXT_TYPE:
@@ -447,32 +467,35 @@ ReportDialog (int argc, char **argv, int x, int y)
text = (TextTypePtr) ptr2;
if (type == TEXT_TYPE)
- sprintf (laynum, "is on layer %d",
+ sprintf (laynum, "It is on layer %d.",
GetLayerNumber (PCB->Data, (LayerTypePtr) ptr1));
- sprintf (&report[0], "TEXT ID# %ld Flags:%s\n"
- "Located at (X,Y) = (%d,%d)\n"
- "Characters are %0.2f %s tall\n"
- "Value is \"%s\"\n"
- "Direction is %d\n"
- "The bounding box is (%d,%d) (%d, %d)\n"
- "It %s\n"
+ sprintf (&report[0], "TEXT ID# %ld; Flags:%s\n"
+ "Located at (X,Y) = (%.*f,%.*f) %s.\n"
+ "Characters are %0.*f %s tall.\n"
+ "Value is \"%s\".\n"
+ "Direction is %d.\n"
+ "The bounding box is (%.*f,%.*f) (%.*f, %.*f) %s.\n"
+ "%s\n"
"%s", text->ID, flags_to_string (text->Flags, TEXT_TYPE),
- text->X, text->Y, UNIT (0.45 * text->Scale * 100.),
+ prec, units(text->X), prec, UNIT (text->Y),
+ prec, UNIT (0.45 * text->Scale * 100.),
text->TextString, text->Direction,
- text->BoundingBox.X1, text->BoundingBox.Y1,
- text->BoundingBox.X2, text->BoundingBox.Y2,
- (type == TEXT_TYPE) ? laynum : "is an element name.",
- TEST_FLAG (LOCKFLAG, text) ? "It is LOCKED\n" : "");
+ prec, units(text->BoundingBox.X1),
+ prec, units(text->BoundingBox.Y1),
+ prec, units(text->BoundingBox.X2),
+ prec, UNIT (text->BoundingBox.Y2),
+ (type == TEXT_TYPE) ? laynum : "It is an element name.",
+ TEST_FLAG (LOCKFLAG, text) ? "It is LOCKED.\n" : "");
break;
}
case LINEPOINT_TYPE:
case POLYGONPOINT_TYPE:
{
PointTypePtr point = (PointTypePtr) ptr2;
- sprintf (&report[0], "POINT ID# %ld. Points don't have flags.\n"
- "Located at (X,Y) = (%d,%d)\n"
- "It belongs to a %s on layer %d\n", point->ID,
- point->X, point->Y,
+ sprintf (&report[0], "POINT ID# %ld.\n"
+ "Located at (X,Y) = (%.*f,%.*f) %s.\n"
+ "It belongs to a %s on layer %d.\n", point->ID,
+ prec, units (point->X), prec, UNIT (point->Y),
(type == LINEPOINT_TYPE) ? "line" : "polygon",
GetLayerNumber (PCB->Data, (LayerTypePtr) ptr1));
break;
@@ -585,24 +608,37 @@ XYtoNetLength (int x, int y, int *found)
static int
ReportAllNetLengths (int argc, char **argv, int x, int y)
{
- enum { Upcb, Umm, Umil, Uin } units;
int ni;
int found;
double length;
+ int prec;
+ double scale;
+ const char *units_name;
- units = Settings.grid_units_mm ? Umm : Umil;
+ units_name = argv[0];
+ if (argc < 1)
+ units_name = Settings.grid_units_mm ? "mm" : "mil";
- if (argc >= 1)
+ if (strcasecmp (units_name, "mm") == 0)
+ {
+ prec = 4;
+ scale = COOR_TO_MM;
+ }
+ else if (strcasecmp (units_name, "mil") == 0)
+ {
+ prec = 2;
+ scale = .01;
+ }
+ else if (strcasecmp (units_name, "in") == 0)
{
- printf("Units: %s\n", argv[0]);
- if (strcasecmp (argv[0], "mm") == 0)
- units = Umm;
- else if (strcasecmp (argv[0], "mil") == 0)
- units = Umil;
- else if (strcasecmp (argv[0], "in") == 0)
- units = Uin;
- else
- units = Upcb;
+ prec = 5;
+ scale = 1./100000;
+ }
+ else
+ {
+ prec = 0;
+ units_name = "pcb";
+ scale = 1;
}
for (ni = 0; ni < PCB->NetlistLib.MenuN; ni++)
@@ -659,24 +695,7 @@ ReportAllNetLengths (int argc, char **argv, int x, int y)
RestoreUndoSerialNumber ();
length = XYtoNetLength (x, y, &found);
- switch (units)
- {
- case Upcb:
- gui->log("Net %s length %d\n", netname, (int)length);
- break;
- case Umm:
- length *= COOR_TO_MM;
- gui->log("Net %s length %.2f mm\n", netname, length);
- break;
- case Umil:
- length /= 100;
- gui->log("Net %s length %d mil\n", netname, (int)length);
- break;
- case Uin:
- length /= 100000.0;
- gui->log("Net %s length %.3f in\n", netname, length);
- break;
- }
+ gui->log("Net %s length %.*f %s\n", netname, prec, length*scale, units_name);
}
return 0;
}
@@ -760,10 +779,13 @@ ReportNetLength (int argc, char **argv, int x, int y)
got_net_name:
HideCrosshair (false);
- if (netname)
- gui->log ("Net %s length: %0.2f %s\n", netname, UNIT (length));
- else
- gui->log ("Net length: %0.2f %s\n", UNIT (length));
+ {
+ int prec = Settings.grid_units_mm? 4: 2;
+ if (netname)
+ gui->log ("Net \"%s\" length: %.*f %s\n", netname, prec, UNIT (length));
+ else
+ gui->log ("Net length: %.*f %s\n", prec, UNIT (length));
+ }
RestoreCrosshair (false);
return 0;
}
|
|
From: <gi...@gp...> - 2010-12-12 05:31:26
|
The branch, master has been updated
via 2d8dc8a3a3a55158b4e6278dd9f40588e4111c2d (commit)
from 238d32ce8acb01c7533c48a22779d8748fa60eb5 (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/polygon.c | 42 ++++++++++++++++++++++++++----------------
1 files changed, 26 insertions(+), 16 deletions(-)
=================
Commit Messages
=================
commit 2d8dc8a3a3a55158b4e6278dd9f40588e4111c2d
Author: Ineiev <in...@us...>
Commit: DJ Delorie <dj...@de...>
[PATCH] fix bug 2793480 (vias/arcs-to-polygon clearances)
frac_circle(): introduce radius_adjustment factor to make
the polygon outline the arc rather than connet points on the arc
ArcPolyNoIntersect(): compute number of segments so that
polygon diverges from the arc no more than 0.02 of
required thickness; adjust outer "arc" radius like in frac_circle()
:100644 100644 74d4bc4... 72d92c9... M src/polygon.c
=========
Changes
=========
commit 2d8dc8a3a3a55158b4e6278dd9f40588e4111c2d
Author: Ineiev <in...@us...>
Commit: DJ Delorie <dj...@de...>
[PATCH] fix bug 2793480 (vias/arcs-to-polygon clearances)
frac_circle(): introduce radius_adjustment factor to make
the polygon outline the arc rather than connet points on the arc
ArcPolyNoIntersect(): compute number of segments so that
polygon diverges from the arc no more than 0.02 of
required thickness; adjust outer "arc" radius like in frac_circle()
diff --git a/src/polygon.c b/src/polygon.c
index 74d4bc4..72d92c9 100644
--- a/src/polygon.c
+++ b/src/polygon.c
@@ -1,10 +1,8 @@
-/* $Id$ */
-
/*
* COPYRIGHT
*
* PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996 Thomas Nau
+ * Copyright (C) 1994,1995,1996,2010 Thomas Nau
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contact addresses for paper mail and Email:
* Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
@@ -104,8 +102,6 @@ dicer output is used for HIDs which cannot render things with holes
#include <dmalloc.h>
#endif
-RCSID ("$Id$");
-
#define ROUND(x) ((long)(((x) >= 0 ? (x) + 0.5 : (x) - 0.5)))
#define UNSUBTRACT_BLOAT 10
@@ -121,6 +117,11 @@ static double circleVerticies[] = {
1.0, 0.0,
0.98768834059513777, 0.15643446504023087,
};
+/* adjustment to make the segments
+ * outline the circle rather than connect
+ * points on the circle
+ * 1 - cos(\alpha/2) < (\alpha/2)^2/2 */
+static double radius_adjustment = (M_PI/CIRC_SEGS)*(M_PI/CIRC_SEGS)/2;
Cardinal
polygon_point_idx (PolygonTypePtr polygon, PointTypePtr point)
@@ -400,11 +401,11 @@ frac_circle (PLINE * c, LocationType X, LocationType Y, Vector v, int range)
poly_InclVertex (c->head.prev, poly_CreateNode (v));
/* move vector to origin */
- e1 = v[0] - X;
- e2 = v[1] - Y;
+ e1 = (v[0] - X) * (1 + radius_adjustment);
+ e2 = (v[1] - Y) * (1 + radius_adjustment);
/* NB: the caller adds the last vertex, hence the -1 */
- range = CIRC_SEGS / range - 1;
+ range = range == 1 ? CIRC_SEGS-1 : (CIRC_SEGS / range) - 1;
for (i = 0; i < range; i++)
{
/* rotate the vector */
@@ -479,6 +480,9 @@ ArcPolyNoIntersect (ArcType * a, BDimension thick)
int i, segs;
double ang, da, rx, ry;
long half;
+ static const double delta_th = 0.02; /* polygon diverges from modelled arc
+ no more than delta_th * thick */
+ double radius_adj;
if (thick <= 0)
return NULL;
@@ -492,9 +496,15 @@ ArcPolyNoIntersect (ArcType * a, BDimension thick)
/* start with inner radius */
rx = MAX (a->Width - half, 0);
ry = MAX (a->Height - half, 0);
- segs = a->Delta / ARC_ANGLE;
+ segs = 1;
+ if(thick > 0)
+ segs = a->Delta * M_PI / 360
+ * sqrt(sqrt((double)rx*rx + (double)ry*ry)/delta_th/2/thick);
+ segs = MAX(segs, a->Delta / ARC_ANGLE);
+
ang = a->StartAngle;
da = (1.0 * a->Delta) / segs;
+ radius_adj = (M_PI*da/360)*(M_PI*da/360)/2;
v[0] = a->X - rx * cos (ang * M180);
v[1] = a->Y + ry * sin (ang * M180);
if ((contour = poly_NewContour (v)) == NULL)
@@ -508,13 +518,13 @@ ArcPolyNoIntersect (ArcType * a, BDimension thick)
}
/* find last point */
ang = a->StartAngle + a->Delta;
- v[0] = a->X - rx * cos (ang * M180);
- v[1] = a->Y + ry * sin (ang * M180);
+ v[0] = a->X - rx * cos (ang * M180) * (1 - radius_adj);
+ v[1] = a->Y + ry * sin (ang * M180) * (1 - radius_adj);
/* add the round cap at the end */
frac_circle (contour, ends->X2, ends->Y2, v, 2);
/* and now do the outer arc (going backwards) */
- rx = a->Width + half;
- ry = a->Width + half;
+ rx = (a->Width + half) * (1+radius_adj);
+ ry = (a->Width + half) * (1+radius_adj);
da = -da;
for (i = 0; i < segs; i++)
{
@@ -525,8 +535,8 @@ ArcPolyNoIntersect (ArcType * a, BDimension thick)
}
/* now add other round cap */
ang = a->StartAngle;
- v[0] = a->X - rx * cos (ang * M180);
- v[1] = a->Y + ry * sin (ang * M180);
+ v[0] = a->X - rx * cos (ang * M180) * (1 - radius_adj);
+ v[1] = a->Y + ry * sin (ang * M180) * (1 - radius_adj);
frac_circle (contour, ends->X1, ends->Y1, v, 2);
/* now we have the whole contour */
if (!(np = ContourToPoly (contour)))
|
|
From: <gi...@gp...> - 2010-12-12 04:48:11
|
The branch, master has been updated
via 238d32ce8acb01c7533c48a22779d8748fa60eb5 (commit)
via 82659182e02012ffc0c7b90a8055cf007a9f33ad (commit)
from dbf835c02cda1d16157a83f8c1b9b1da2a05400a (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 | 2 +-
src/file.c | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
=================
Commit Messages
=================
commit 238d32ce8acb01c7533c48a22779d8748fa60eb5
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Check for special name "(local)" to mean "."
When expanding a tree of footprints, we want the symbolic name
"(local)" to mean the "." subdir. Now that we check for chdir()
failures, we can no longer "just work" because the chdir didn't
change directories.
:100644 100644 bfe0de0... 4e4d55d... M src/file.c
commit 82659182e02012ffc0c7b90a8055cf007a9f33ad
Author: David Dandar <dd...@us...>
Commit: DJ Delorie <dj...@de...>
Let RealignGrid align grid to a pin or pad snap.
SF patch 2476262:
Realign grid has been broken for a while. Darn mm and mil mix components
were killing me. I got desperate and fixed it, but I'm not sure if it's
the right fix. It does work though. Hope this helps.
:100644 100644 88907af... e3576bf... M src/action.c
=========
Changes
=========
commit 238d32ce8acb01c7533c48a22779d8748fa60eb5
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Check for special name "(local)" to mean "."
When expanding a tree of footprints, we want the symbolic name
"(local)" to mean the "." subdir. Now that we check for chdir()
failures, we can no longer "just work" because the chdir didn't
change directories.
diff --git a/src/file.c b/src/file.c
index bfe0de0..4e4d55d 100644
--- a/src/file.c
+++ b/src/file.c
@@ -1157,7 +1157,11 @@ LoadNewlibFootprintsFromDir(char *libpath, char *toppath)
return 0;
}
- strcpy (subdir, libpath);
+ if (strcmp (libpath, "(local)") == 0)
+ strcpy (subdir, ".");
+ else
+ strcpy (subdir, libpath);
+
if (chdir (subdir))
{
ChdirErrorMessage (subdir);
commit 82659182e02012ffc0c7b90a8055cf007a9f33ad
Author: David Dandar <dd...@us...>
Commit: DJ Delorie <dj...@de...>
Let RealignGrid align grid to a pin or pad snap.
SF patch 2476262:
Realign grid has been broken for a while. Darn mm and mil mix components
were killing me. I got desperate and fixed it, but I'm not sure if it's
the right fix. It does work though. Hope this helps.
diff --git a/src/action.c b/src/action.c
index 88907af..e3576bf 100644
--- a/src/action.c
+++ b/src/action.c
@@ -2831,7 +2831,7 @@ ActionDisplay (int argc, char **argv, int childX, int childY)
oldGrid = PCB->Grid;
PCB->Grid = 1.0;
- if (MoveCrosshairAbsolute (childX, childY))
+ if (MoveCrosshairAbsolute (Crosshair.X, Crosshair.Y))
RestoreCrosshair (false); /* was hidden by MoveCrosshairAbs */
SetGrid (oldGrid, true);
}
|
|
From: Peter C. <pc...@ca...> - 2010-12-11 16:11:48
|
On Sat, 2010-12-11 at 06:21 +0000, gi...@gp... wrote:
> ConnectionTypePtr conn;
>
> + /* It would be worth checking if SourceNet is NULL here to avoid a segfault. Seb James. */
> CONNECTION_LOOP (SourceNet);
> {
> conn = GetConnectionMemory (DestNet);
I'd rather not see comments like this added. If it is worth testing..
make a patch and add the test. Especially if the result could be a
segfault. In general, I object to sprinkling checks unnecessarily.. can
SourceNet ever be null at this point?
An assert() might make the assumption clear, a test avoids fixes the
problem (or is overly paranoid), but the comment adds nothing useful.
As a style point, if one "must" add such comments, prefix with "FIXME: "
or "XXX:", as these are picked up by many editors, and can easily be
searched for if anyone is in the mood to review such things.
Generally, I tend to prefer not to see people's names added to comments
in the code. It might put people off editing things if they think a
particular piece of code "belongs" to someone.
git log / git blame etc.. provide powerful tools to investigate the
origin of code lines - if people need to know.
--
Peter Clifton
Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA
Tel: +44 (0)7729 980173 - (No signal in the lab!)
Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)
|
|
From: <gi...@gp...> - 2010-12-11 06:26:55
|
The branch, master has been updated
via dbf835c02cda1d16157a83f8c1b9b1da2a05400a (commit)
from 02fa7cf6646ad4f16383c91e53784986f4d8d15d (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/rats.c | 56 +++++++++++++++++++++++++++++++++++---------------------
1 files changed, 35 insertions(+), 21 deletions(-)
=================
Commit Messages
=================
commit dbf835c02cda1d16157a83f8c1b9b1da2a05400a
Author: Seb James <se...@es...>
Commit: DJ Delorie <dj...@de...>
SF patch 1674895:
This crash occurs in rats.c, around line 610 in the function
DrawShortestRats() where CreateNewRat() is called with some arguments
which don't exist.
It occurred for me when I tried to "optimize rats nest" on an invalid
design.
There's no check in DrawShortestRats() that the firstposition and
secondposition pointers are not NULL.
firstposition->X (and Y) and secondposition->X (and Y) are passed as
arguments to CreateNewRat(). It is possible in some cases that
firstposition and secondposition are not reset from 0 in the code
preceding the call to CreateNewRat(). In these cases a segfault will
occur.
:100644 100644 3c5ede1... 8dc513c... M src/rats.c
=========
Changes
=========
commit dbf835c02cda1d16157a83f8c1b9b1da2a05400a
Author: Seb James <se...@es...>
Commit: DJ Delorie <dj...@de...>
SF patch 1674895:
This crash occurs in rats.c, around line 610 in the function
DrawShortestRats() where CreateNewRat() is called with some arguments
which don't exist.
It occurred for me when I tried to "optimize rats nest" on an invalid
design.
There's no check in DrawShortestRats() that the firstposition and
secondposition pointers are not NULL.
firstposition->X (and Y) and secondposition->X (and Y) are passed as
arguments to CreateNewRat(). It is possible in some cases that
firstposition and secondposition are not reset from 0 in the code
preceding the call to CreateNewRat(). In these cases a segfault will
occur.
diff --git a/src/rats.c b/src/rats.c
index 3c5ede1..8dc513c 100644
--- a/src/rats.c
+++ b/src/rats.c
@@ -341,6 +341,7 @@ TransferNet (NetListTypePtr Netl, NetTypePtr SourceNet, NetTypePtr DestNet)
{
ConnectionTypePtr conn;
+ /* It would be worth checking if SourceNet is NULL here to avoid a segfault. Seb James. */
CONNECTION_LOOP (SourceNet);
{
conn = GetConnectionMemory (DestNet);
@@ -562,9 +563,13 @@ DrawShortestRats (NetListTypePtr Netl, void (*funcp) ())
register ConnectionTypePtr conn1, conn2, firstpoint, secondpoint;
PolygonTypePtr polygon;
bool changed = false;
+ bool havepoints = false;
Cardinal n, m, j;
NetTypePtr next, subnet, theSubnet = NULL;
+ if (Netl->NetN < 2)
+ return false;
+
/*
* Everything inside the NetList Netl should be connected together.
* Each Net in Netl is a group of Connections which are already
@@ -575,9 +580,10 @@ DrawShortestRats (NetListTypePtr Netl, void (*funcp) ())
* one big blob.
*/
distance = 0.0;
- while (Netl->NetN > 1)
+ do
{
firstpoint = secondpoint = NULL;
+ havepoints = false;
subnet = &Netl->Net[0];
for (j = 1; j < Netl->NetN; j++)
{
@@ -604,6 +610,7 @@ DrawShortestRats (NetListTypePtr Netl, void (*funcp) ())
firstpoint = conn2;
secondpoint = conn1;
theSubnet = next;
+ havepoints = true;
}
else if (conn2->type == POLYGON_TYPE &&
(polygon = (PolygonTypePtr)conn2->ptr2) &&
@@ -615,6 +622,7 @@ DrawShortestRats (NetListTypePtr Netl, void (*funcp) ())
firstpoint = conn1;
secondpoint = conn2;
theSubnet = next;
+ havepoints = true;
}
else if ((temp = SQUARE (conn1->X - conn2->X) +
SQUARE (conn1->Y - conn2->Y)) < distance || !firstpoint)
@@ -623,35 +631,41 @@ DrawShortestRats (NetListTypePtr Netl, void (*funcp) ())
firstpoint = conn1;
secondpoint = conn2;
theSubnet = next;
+ havepoints = true;
}
}
}
}
- if (funcp)
- {
- (*funcp) (firstpoint, secondpoint, subnet->Style);
- }
- else
+
+ if (havepoints)
{
- /* found the shortest distance subnet, draw the rat */
- if ((line = CreateNewRat (PCB->Data,
- firstpoint->X, firstpoint->Y,
- secondpoint->X, secondpoint->Y,
- firstpoint->group, secondpoint->group,
- Settings.RatThickness,
- NoFlags ())) != NULL)
+ if (funcp)
+ {
+ (*funcp) (firstpoint, secondpoint, subnet->Style);
+ }
+ else
{
- if (distance == 0)
- SET_FLAG (VIAFLAG, line);
- AddObjectToCreateUndoList (RATLINE_TYPE, line, line, line);
- DrawRat (line, 0);
- changed = true;
+ /* found the shortest distance subnet, draw the rat */
+ if ((line = CreateNewRat (PCB->Data,
+ firstpoint->X, firstpoint->Y,
+ secondpoint->X, secondpoint->Y,
+ firstpoint->group, secondpoint->group,
+ Settings.RatThickness,
+ NoFlags ())) != NULL)
+ {
+ if (distance == 0)
+ SET_FLAG (VIAFLAG, line);
+ AddObjectToCreateUndoList (RATLINE_TYPE, line, line, line);
+ DrawRat (line, 0);
+ changed = true;
+ }
}
+
+ /* copy theSubnet into the current subnet */
+ TransferNet (Netl, theSubnet, subnet);
}
+ } while (Netl->NetN > 1 && havepoints);
- /* copy theSubnet into the current subnet */
- TransferNet (Netl, theSubnet, subnet);
- }
/* presently nothing to do with the new subnet */
/* so we throw it away and free the space */
FreeNetMemory (&Netl->Net[--(Netl->NetN)]);
|
|
From: <gi...@gp...> - 2010-12-10 03:55:39
|
The branch, master has been updated
via 02fa7cf6646ad4f16383c91e53784986f4d8d15d (commit)
via 70786c0c18c8d2c4626d429068e88a4601a21d6d (commit)
from 0c62fca0df9bd9ebe7bedfbee0af3502e4298a42 (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
=========
configure.ac | 3 +++
src/.gitignore | 2 ++
src/action.c | 8 ++++++++
3 files changed, 13 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit 02fa7cf6646ad4f16383c91e53784986f4d8d15d
Author: Cesar Strauss <cst...@no...>
Commit: DJ Delorie <dj...@de...>
Check for the _spawnvp function and use it if present.
:100644 100644 a220a82... abdd8a1... M configure.ac
:100644 100644 0e035a6... 88907af... M src/action.c
commit 70786c0c18c8d2c4626d429068e88a4601a21d6d
Author: Cesar Strauss <cst...@no...>
Commit: DJ Delorie <dj...@de...>
Ignore generated files on Windows.
:100644 100644 bb22c23... c7f149e... M src/.gitignore
=========
Changes
=========
commit 02fa7cf6646ad4f16383c91e53784986f4d8d15d
Author: Cesar Strauss <cst...@no...>
Commit: DJ Delorie <dj...@de...>
Check for the _spawnvp function and use it if present.
diff --git a/configure.ac b/configure.ac
index a220a82..abdd8a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -662,6 +662,9 @@ AC_CHECK_FUNCS(popen)
AC_CHECK_FUNCS(realpath canonicalize_file_name)
libiberty_NEED_DECLARATION(canonicalize_file_name)
+# for pcb_spawnvp in action.c on Windows
+AC_CHECK_FUNCS(_spawnvp)
+
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h locale.h string.h sys/types.h regex.h pwd.h)
AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h sys/param.h sys/times.h sys/wait.h)
diff --git a/src/action.c b/src/action.c
index 0e035a6..88907af 100644
--- a/src/action.c
+++ b/src/action.c
@@ -7287,6 +7287,13 @@ ActionExecCommand (int argc, char **argv, int x, int y)
static int
pcb_spawnvp (char **argv)
{
+#ifdef HAVE__SPAWNVP
+ int result = _spawnvp (_P_WAIT, argv[0], argv);
+ if (result == -1)
+ return 1;
+ else
+ return 0;
+#else
int pid;
pid = fork ();
if (pid < 0)
@@ -7308,6 +7315,7 @@ pcb_spawnvp (char **argv)
wait (&rv);
}
return 0;
+#endif
}
/* ---------------------------------------------------------------- */
commit 70786c0c18c8d2c4626d429068e88a4601a21d6d
Author: Cesar Strauss <cst...@no...>
Commit: DJ Delorie <dj...@de...>
Ignore generated files on Windows.
diff --git a/src/.gitignore b/src/.gitignore
index bb22c23..c7f149e 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -10,3 +10,5 @@ res_parse.[ch]
*pcb-menu.h
pcbtest.sh
pcb
+pcb.exe
+pcb_icon.ico
|
|
From: <gi...@gp...> - 2010-12-10 03:07:45
|
The branch, master has been updated
discards 0e24fde9348a61c2d25bb07b0a53e47e52a2d0a5 (commit)
discards 277f9b937180093f38f2cdc2abc5a57ba22cb610 (commit)
via 0c62fca0df9bd9ebe7bedfbee0af3502e4298a42 (commit)
via 107aed5bfbdca64e8881e6c2ba0e4ca7d7693fff (commit)
from 0e24fde9348a61c2d25bb07b0a53e47e52a2d0a5 (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
=========
=================
Commit Messages
=================
commit 0c62fca0df9bd9ebe7bedfbee0af3502e4298a42
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove My* memory allocation routines. Just use the standard APIs directly
This means the following changes:
1. Replace all calls to MyCalloc() with calls to calloc()
2. Replace all calls to MyMalloc() with calls to malloc()
3. Replace all calls to MyRealloc() with calls to realloc()
4. Replace all calls to SaveFree() with calls to free()
5a. Where the MYFREE(x) macro is used and its pointer clearing side-
effect is required, call free (x); and (x) = NULL; directly.
5b. Where the MYFREE(x) macro is used, and (x) is immediately re-
assigned, or its location free'd or zero'd, skip the (x) = NULL;
6. Replace all calls to MyStrdup() with calls to the STRDUP(x) macro,
which expands to (((x) != NULL) ? strdup (x) : NULL).
NB: The previous commit already replaced various known "safe" calls of
MyStrdup() with strdup(), when the argument is known to be non-NULL.
1,2,3 and 6. mean that we discard the following features of the
mymem.c allocators:
7. Logging messages when MEM_DEBUF defined
8. Logic to assign 1 unit of memory if 0 is requested
9. Allocation failure handling via MyFatal() -> EmergencySave()
With feedback from Stephen Ecob <sil...@gm...>
7. Is old debug code which is rarely (if ever) used. Current debug tools
such as Valgrind can do a much better job of memory debugging now.
8. This is really papering over the possibility of a caller bug, and
should never have been included in the first place.
9. This is unlikely to actually ever save someone from loosing their PCB.
Patch created with the assistance and testing of
Stephen Ecob <sil...@gm...>
:100644 100644 f5e043a... 0e035a6... M src/action.c
:100644 100644 c69fc39... 4447c30... M src/buffer.c
:100644 100644 b41263b... 5c2b985... M src/command.c
:100644 100644 735f20f... 538ea0d... M src/create.c
:100644 100644 738ed18... 1f1d770... M src/drill.c
:100644 100644 5a926f8... bfe0de0... M src/file.c
:100644 100644 8d468bb... 3176357... M src/find.c
:100644 100644 e4a566d... 30859fb... M src/hid/common/flags.c
:100644 100644 1f6341b... 85e01f3... M src/hid/gerber/gerber.c
:100644 100644 461b779... 5cd969c... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 2f49f06... 16caff3... M src/hid/gtk/gui-dialog-size.c
:100644 100644 9c30a93... 90977e2... M src/hid/gtk/gui-top-window.c
:100644 100644 76dce1a... 5f497a8... M src/hid/lesstif/main.c
:100644 100644 aca306d... 6baa016... M src/hid/lesstif/menu.c
:100644 100644 d3dcdaa... 9b67d0f... M src/hid/lesstif/styles.c
:100644 100644 8f99ad7... 7389ba9... M src/intersect.c
:100644 100644 c23ae8b... 462285d... M src/main.c
:100644 100644 9ab9f53... 2e471d0... M src/misc.c
:100644 100644 13863c1... 09cb6ab... M src/mymem.c
:100644 100644 fdfd7e6... 4e36640... M src/mymem.h
:100644 100644 459b08a... 4a26bc9... M src/netlist.c
:100644 100644 c9d96c8... a2808ad... M src/parse_l.l
:100644 100644 f4fc367... 7aa7b80... M src/parse_y.y
:100644 100644 67a0efc... 3c5ede1... M src/rats.c
:100644 100644 98b9ade... 8defaf4... M src/remove.c
:100644 100644 dc01153... 7af4358... M src/report.c
:100644 100644 68ea8ff... 5226c53... M src/undo.c
commit 107aed5bfbdca64e8881e6c2ba0e4ca7d7693fff
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Convet some "safe" usage of MyStrdup to plain strdup
These cases are ones where we know the caller will not risk
passing a NULL string to duplicate.
Patch created with the assistance and testing of
Stephen Ecob <sil...@gm...>
:100644 100644 9e1370b... f5e043a... M src/action.c
:100644 100644 f9d6f5a... c69fc39... M src/buffer.c
:100644 100644 c8244ed... ee831b9... M src/copy.c
:100644 100644 15c0099... 735f20f... M src/create.c
:100644 100644 8cbd95d... 5a926f8... M src/file.c
:100644 100644 bd9fcee... 4f7f5b8... M src/fontmode.c
:100644 100644 923e0ee... c23ae8b... M src/main.c
:100644 100644 34b18cb... 9ab9f53... M src/misc.c
:100644 100644 cce6e19... cbb2e3d... M src/move.c
:100644 100644 ade8326... 459b08a... M src/netlist.c
:100644 100644 46a18c8... 67a0efc... M src/rats.c
=========
Changes
=========
commit 0c62fca0df9bd9ebe7bedfbee0af3502e4298a42
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove My* memory allocation routines. Just use the standard APIs directly
This means the following changes:
1. Replace all calls to MyCalloc() with calls to calloc()
2. Replace all calls to MyMalloc() with calls to malloc()
3. Replace all calls to MyRealloc() with calls to realloc()
4. Replace all calls to SaveFree() with calls to free()
5a. Where the MYFREE(x) macro is used and its pointer clearing side-
effect is required, call free (x); and (x) = NULL; directly.
5b. Where the MYFREE(x) macro is used, and (x) is immediately re-
assigned, or its location free'd or zero'd, skip the (x) = NULL;
6. Replace all calls to MyStrdup() with calls to the STRDUP(x) macro,
which expands to (((x) != NULL) ? strdup (x) : NULL).
NB: The previous commit already replaced various known "safe" calls of
MyStrdup() with strdup(), when the argument is known to be non-NULL.
1,2,3 and 6. mean that we discard the following features of the
mymem.c allocators:
7. Logging messages when MEM_DEBUF defined
8. Logic to assign 1 unit of memory if 0 is requested
9. Allocation failure handling via MyFatal() -> EmergencySave()
With feedback from Stephen Ecob <sil...@gm...>
7. Is old debug code which is rarely (if ever) used. Current debug tools
such as Valgrind can do a much better job of memory debugging now.
8. This is really papering over the possibility of a caller bug, and
should never have been included in the first place.
9. This is unlikely to actually ever save someone from loosing their PCB.
Patch created with the assistance and testing of
Stephen Ecob <sil...@gm...>
diff --git a/src/action.c b/src/action.c
index f5e043a..0e035a6 100644
--- a/src/action.c
+++ b/src/action.c
@@ -5731,7 +5731,7 @@ ActionSaveTo (int argc, char **argv, int x, int y)
if (strcasecmp (function, "LayoutAs") == 0)
{
- MYFREE (PCB->Filename);
+ free (PCB->Filename);
PCB->Filename = strdup (name);
SavePCB (PCB->Filename);
return 0;
@@ -5891,7 +5891,7 @@ ActionLoadFrom (int argc, char **argv, int x, int y)
else if (strcasecmp (function, "Netlist") == 0)
{
if (PCB->Netlistname)
- SaveFree (PCB->Netlistname);
+ free (PCB->Netlistname);
PCB->Netlistname = StripWhiteSpaceAndDup (name);
FreeLibraryMemory (&PCB->NetlistLib);
if (!ImportNetlist (PCB->Netlistname))
@@ -7239,7 +7239,7 @@ ActionElementSetAttr (int argc, char **argv, int x, int y)
if (attr && value)
{
- MYFREE (attr->value);
+ free (attr->value);
attr->value = strdup (value);
}
if (attr && ! value)
diff --git a/src/buffer.c b/src/buffer.c
index c69fc39..4447c30 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -953,7 +953,7 @@ SmashBufferElement (BufferTypePtr Buffer)
line->Point2.X, line->Point2.Y,
line->Thickness, 0, NoFlags ());
if (line)
- line->Number = MyStrdup (NAMEONPCB_NAME (element), "SmashBuffer");
+ line->Number = STRDUP (NAMEONPCB_NAME (element));
}
END_LOOP;
ARC_LOOP (element);
@@ -991,11 +991,11 @@ SmashBufferElement (BufferTypePtr Buffer)
pad->Point2.X, pad->Point2.Y,
pad->Thickness, pad->Clearance, NoFlags ());
if (line)
- line->Number = MyStrdup (pad->Number, "SmashBuffer");
+ line->Number = STRDUP (pad->Number);
}
END_LOOP;
FreeElementMemory (element);
- SaveFree (element);
+ free (element);
return (true);
}
@@ -1216,7 +1216,7 @@ LoadLayoutToBuffer (BufferTypePtr Buffer, char *Filename)
{
/* clear data area and replace pointer */
ClearBuffer (Buffer);
- SaveFree (Buffer->Data);
+ free (Buffer->Data);
Buffer->Data = newPCB->Data;
newPCB->Data = NULL;
Buffer->X = newPCB->CursorX;
diff --git a/src/command.c b/src/command.c
index b41263b..5c2b985 100644
--- a/src/command.c
+++ b/src/command.c
@@ -297,7 +297,7 @@ CommandLoadNetlist (int argc, char **argv, int x, int y)
return (1);
}
if (PCB->Netlistname)
- SaveFree (PCB->Netlistname);
+ free (PCB->Netlistname);
PCB->Netlistname = StripWhiteSpaceAndDup (filename);
free (name);
return (0);
diff --git a/src/create.c b/src/create.c
index 735f20f..538ea0d 100644
--- a/src/create.c
+++ b/src/create.c
@@ -80,7 +80,7 @@ DataTypePtr
CreateNewBuffer (void)
{
DataTypePtr data;
- data = (DataTypePtr) MyCalloc (1, sizeof (DataType), "CreateNewBuffer()");
+ data = (DataTypePtr) calloc (1, sizeof (DataType));
data->pcb = (void *) PCB;
return data;
}
@@ -136,7 +136,7 @@ CreateNewPCB (bool SetDefaultNames)
int i;
/* allocate memory, switch all layers on and copy resources */
- ptr = MyCalloc (1, sizeof (PCBType), "CreateNewPCB()");
+ ptr = calloc (1, sizeof (PCBType));
ptr->Data = CreateNewBuffer ();
ptr->Data->pcb = (void *) ptr;
@@ -259,7 +259,7 @@ CreateNewVia (DataTypePtr Data,
0.01 * Via->DrillingHole, 0.01 * DrillingHole);
}
- Via->Name = MyStrdup (Name, "CreateNewVia()");
+ Via->Name = STRDUP (Name);
Via->Flags = Flags;
CLEAR_FLAG (WARNFLAG, Via);
SET_FLAG (VIAFLAG, Via);
@@ -704,8 +704,7 @@ CreateNewArcInElement (ElementTypePtr Element,
if (Element->ArcN >= Element->ArcMax)
{
Element->ArcMax += STEP_ELEMENTARC;
- arc = MyRealloc (arc, Element->ArcMax * sizeof (ArcType),
- "CreateNewArcInElement()");
+ arc = realloc (arc, Element->ArcMax * sizeof (ArcType));
Element->Arc = arc;
memset (arc + Element->ArcN, 0, STEP_ELEMENTARC * sizeof (ArcType));
}
@@ -751,8 +750,7 @@ CreateNewLineInElement (ElementTypePtr Element,
if (Element->LineN >= Element->LineMax)
{
Element->LineMax += STEP_ELEMENTLINE;
- line = MyRealloc (line, Element->LineMax * sizeof (LineType),
- "CreateNewLineInElement()");
+ line = realloc (line, Element->LineMax * sizeof (LineType));
Element->Line = line;
memset (line + Element->LineN, 0, STEP_ELEMENTLINE * sizeof (LineType));
}
@@ -787,8 +785,8 @@ CreateNewPin (ElementTypePtr Element,
pin->Thickness = Thickness;
pin->Clearance = Clearance;
pin->Mask = Mask;
- pin->Name = MyStrdup (Name, "CreateNewPin()");
- pin->Number = MyStrdup (Number, "CreateNewPin()");
+ pin->Name = STRDUP (Name);
+ pin->Number = STRDUP (Number);
pin->Flags = Flags;
CLEAR_FLAG (WARNFLAG, pin);
SET_FLAG (PINFLAG, pin);
@@ -874,8 +872,8 @@ CreateNewPad (ElementTypePtr Element,
pad->Thickness = Thickness;
pad->Clearance = Clearance;
pad->Mask = Mask;
- pad->Name = MyStrdup (Name, "CreateNewPad()");
- pad->Number = MyStrdup (Number, "CreateNewPad()");
+ pad->Name = STRDUP (Name);
+ pad->Number = STRDUP (Number);
pad->Flags = Flags;
CLEAR_FLAG (WARNFLAG, pad);
pad->ID = ID++;
@@ -892,13 +890,13 @@ AddTextToElement (TextTypePtr Text, FontTypePtr PCBFont,
LocationType X, LocationType Y,
BYTE Direction, char *TextString, int Scale, FlagType Flags)
{
- MYFREE (Text->TextString);
+ free (Text->TextString);
+ Text->TextString = (TextString && *TextString) ? strdup (TextString) : NULL;
Text->X = X;
Text->Y = Y;
Text->Direction = Direction;
Text->Flags = Flags;
Text->Scale = Scale;
- Text->TextString = (TextString && *TextString) ? strdup (TextString) : NULL;
/* calculate size of the bounding box */
SetTextBoundingBox (PCBFont, Text);
@@ -919,8 +917,7 @@ CreateNewLineInSymbol (SymbolTypePtr Symbol,
if (Symbol->LineN >= Symbol->LineMax)
{
Symbol->LineMax += STEP_SYMBOLLINE;
- line = MyRealloc (line, Symbol->LineMax * sizeof (LineType),
- "CreateNewLineInSymbol()");
+ line = realloc (line, Symbol->LineMax * sizeof (LineType));
Symbol->Line = line;
memset (line + Symbol->LineN, 0, STEP_SYMBOLLINE * sizeof (LineType));
}
@@ -994,7 +991,7 @@ CreateNewConnection (LibraryMenuTypePtr net, char *conn)
{
LibraryEntryTypePtr entry = GetLibraryEntryMemory (net);
- entry->ListEntry = MyStrdup (conn, "CreateNewConnection()");
+ entry->ListEntry = STRDUP (conn);
return (entry);
}
@@ -1007,12 +1004,10 @@ CreateNewAttribute (AttributeListTypePtr list, char *name, char *value)
if (list->Number >= list->Max)
{
list->Max += 10;
- list->List = MyRealloc (list->List,
- list->Max * sizeof (AttributeType),
- "CreateNewAttribute");
+ list->List = realloc (list->List, list->Max * sizeof (AttributeType));
}
- list->List[list->Number].name = MyStrdup (name, "CreateNewAttribute");
- list->List[list->Number].value = MyStrdup (value, "CreateNewAttribute");
+ list->List[list->Number].name = STRDUP (name);
+ list->List[list->Number].value = STRDUP (value);
list->Number++;
return &list->List[list->Number - 1];
}
diff --git a/src/drill.c b/src/drill.c
index 738ed18..1f1d770 100644
--- a/src/drill.c
+++ b/src/drill.c
@@ -126,7 +126,7 @@ GetDrillInfo (DataTypePtr top)
bool DrillFound = false;
bool NewDrill;
- AllDrills = MyCalloc (1, sizeof (DrillInfoType), "GetAllDrillInfo()");
+ AllDrills = calloc (1, sizeof (DrillInfoType));
ALLPIN_LOOP (top);
{
if (!DrillFound)
@@ -235,10 +235,9 @@ RoundDrillInfo (DrillInfoTypePtr d, int roundto)
= d->Drill[i].ElementN + d->Drill[i+1].ElementN;
if (d->Drill[i].ElementMax)
{
- d->Drill[i].Element = MyRealloc (d->Drill[i].Element,
- d->Drill[i].ElementMax *
- sizeof(ElementTypePtr),
- "RoundDrillInfo");
+ d->Drill[i].Element = realloc (d->Drill[i].Element,
+ d->Drill[i].ElementMax *
+ sizeof (ElementTypePtr));
for (ei = 0; ei < d->Drill[i+1].ElementN; ei++)
{
@@ -250,16 +249,18 @@ RoundDrillInfo (DrillInfoTypePtr d, int roundto)
= d->Drill[i + 1].Element[ei];
}
}
- MYFREE (d->Drill[i + 1].Element);
+ free (d->Drill[i + 1].Element);
+ d->Drill[i + 1].Element = NULL;
d->Drill[i].PinMax = d->Drill[i].PinN + d->Drill[i + 1].PinN;
- d->Drill[i].Pin = MyRealloc (d->Drill[i].Pin,
- d->Drill[i].PinMax *
- sizeof (PinTypePtr), "RoundDrillInfo");
+ d->Drill[i].Pin = realloc (d->Drill[i].Pin,
+ d->Drill[i].PinMax *
+ sizeof (PinTypePtr));
memcpy (d->Drill[i].Pin + d->Drill[i].PinN, d->Drill[i + 1].Pin,
d->Drill[i + 1].PinN * sizeof (PinTypePtr));
d->Drill[i].PinN += d->Drill[i + 1].PinN;
- MYFREE (d->Drill[i + 1].Pin);
+ free (d->Drill[i + 1].Pin);
+ d->Drill[i + 1].Pin = NULL;
d->Drill[i].PinCount += d->Drill[i + 1].PinCount;
d->Drill[i].ViaCount += d->Drill[i + 1].ViaCount;
@@ -285,10 +286,10 @@ FreeDrillInfo (DrillInfoTypePtr Drills)
{
DRILL_LOOP (Drills);
{
- MYFREE (drill->Element);
- MYFREE (drill->Pin);
+ free (drill->Element);
+ free (drill->Pin);
}
END_LOOP;
- MYFREE (Drills->Drill);
- SaveFree (Drills);
+ free (Drills->Drill);
+ free (Drills);
}
diff --git a/src/file.c b/src/file.c
index 5a926f8..bfe0de0 100644
--- a/src/file.c
+++ b/src/file.c
@@ -319,7 +319,7 @@ SavePCB (char *Filename)
* it might be identical to 'PCB->Filename'
*/
copy = strdup (Filename);
- SaveFree (PCB->Filename);
+ free (PCB->Filename);
PCB->Filename = copy;
SetChangedFlag (false);
}
@@ -1223,7 +1223,7 @@ LoadNewlibFootprintsFromDir(char *libpath, char *toppath)
* entry->ListEntry points to fp name itself.
*/
len = strlen(subdir) + strlen("/") + strlen(subdirentry->d_name) + 1;
- entry->AllocatedMemory = MyCalloc (1, len, "ParseLibraryTree()");
+ entry->AllocatedMemory = calloc (1, len);
strcat (entry->AllocatedMemory, subdir);
strcat (entry->AllocatedMemory, PCB_DIR_SEPARATOR_S);
@@ -1382,7 +1382,7 @@ ReadLibraryContents (void)
/* First load the M4 stuff. The variable Settings.LibraryPath
* points to it.
*/
- MYFREE (command);
+ free (command);
command = EvaluateFilename (Settings.LibraryContentsCommand,
Settings.LibraryPath, Settings.LibraryFilename,
NULL);
@@ -1447,8 +1447,7 @@ ReadLibraryContents (void)
/* create the list entry */
len = strlen (EMPTY (entry->Value)) +
strlen (EMPTY (entry->Description)) + 4;
- entry->ListEntry = MyCalloc (len, sizeof (char),
- "ReadLibraryDescription()");
+ entry->ListEntry = calloc (len, sizeof (char));
sprintf (entry->ListEntry,
"%s, %s", EMPTY (entry->Value),
EMPTY (entry->Description));
@@ -1507,7 +1506,7 @@ ReadNetlist (char *filename)
else
{
used_popen = 1;
- MYFREE (command);
+ free (command);
command = EvaluateFilename (Settings.RatCommand,
Settings.RatPath, filename, NULL);
diff --git a/src/find.c b/src/find.c
index 8d468bb..3176357 100644
--- a/src/find.c
+++ b/src/find.c
@@ -569,19 +569,26 @@ FreeLayoutLookupMemory (void)
for (i = 0; i < max_copper_layer; i++)
{
- MYFREE (LineList[i].Data);
- MYFREE (ArcList[i].Data);
- MYFREE (PolygonList[i].Data);
+ free (LineList[i].Data);
+ LineList[i].Data = NULL;
+ free (ArcList[i].Data);
+ ArcList[i].Data = NULL;
+ free (PolygonList[i].Data);
+ PolygonList[i].Data = NULL;
}
- MYFREE (PVList.Data);
- MYFREE (RatList.Data);
+ free (PVList.Data);
+ PVList.Data = NULL;
+ free (RatList.Data);
+ RatList.Data = NULL;
}
void
FreeComponentLookupMemory (void)
{
- MYFREE (PadList[0].Data);
- MYFREE (PadList[1].Data);
+ free (PadList[0].Data);
+ PadList[0].Data = NULL;
+ free (PadList[1].Data);
+ PadList[1].Data = NULL;
}
/* ---------------------------------------------------------------------------
@@ -608,9 +615,7 @@ InitComponentLookup (void)
for (i = 0; i < 2; i++)
{
/* allocate memory for working list */
- PadList[i].Data =
- (void **) MyCalloc (NumberOfPads[i], sizeof (PadTypePtr),
- "InitComponentLookup()");
+ PadList[i].Data = calloc (NumberOfPads[i], sizeof (PadTypePtr));
/* clear some struct members */
PadList[i].Location = 0;
@@ -637,16 +642,12 @@ InitLayoutLookup (void)
if (layer->LineN)
{
/* allocate memory for line pointer lists */
- LineList[i].Data =
- (void **) MyCalloc (layer->LineN, sizeof (LineTypePtr),
- "InitLayoutLookup()");
+ LineList[i].Data = calloc (layer->LineN, sizeof (LineTypePtr));
LineList[i].Size = layer->LineN;
}
if (layer->ArcN)
{
- ArcList[i].Data =
- (void **) MyCalloc (layer->ArcN, sizeof (ArcTypePtr),
- "InitLayoutLookup()");
+ ArcList[i].Data = calloc (layer->ArcN, sizeof (ArcTypePtr));
ArcList[i].Size = layer->ArcN;
}
@@ -654,9 +655,7 @@ InitLayoutLookup (void)
/* allocate memory for polygon list */
if (layer->PolygonN)
{
- PolygonList[i].Data = (void **) MyCalloc (layer->PolygonN,
- sizeof (PolygonTypePtr),
- "InitLayoutLookup()");
+ PolygonList[i].Data = calloc (layer->PolygonN, sizeof (PolygonTypePtr));
PolygonList[i].Size = layer->PolygonN;
}
@@ -681,15 +680,13 @@ InitLayoutLookup (void)
else
TotalV = 0;
/* allocate memory for 'new PV to check' list and clear struct */
- PVList.Data = (void **) MyCalloc (TotalP + TotalV, sizeof (PinTypePtr),
- "InitLayoutLookup()");
+ PVList.Data = calloc (TotalP + TotalV, sizeof (PinTypePtr));
PVList.Size = TotalP + TotalV;
PVList.Location = 0;
PVList.DrawLocation = 0;
PVList.Number = 0;
/* Initialize ratline data */
- RatList.Data = (void **) MyCalloc (PCB->Data->RatN, sizeof (RatTypePtr),
- "InitLayoutLookup()");
+ RatList.Data = calloc (PCB->Data->RatN, sizeof (RatTypePtr));
RatList.Size = PCB->Data->RatN;
RatList.Location = 0;
RatList.DrawLocation = 0;
diff --git a/src/hid/common/flags.c b/src/hid/common/flags.c
index e4a566d..30859fb 100644
--- a/src/hid/common/flags.c
+++ b/src/hid/common/flags.c
@@ -110,7 +110,7 @@ hid_get_flag (const char *name)
if (nbuf < (cp - name + 1))
{
nbuf = cp - name + 10;
- buf = MyRealloc (buf, nbuf, "hid_get_flag");
+ buf = realloc (buf, nbuf);
}
memcpy (buf, name, cp - name);
buf[cp - name] = 0;
diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 1f6341b..85e01f3 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -230,9 +230,7 @@ SetAppLayer (int l)
{
int prev = n_layerapps;
n_layerapps = l + 1;
- layerapps =
- MyRealloc (layerapps, n_layerapps * sizeof (Apertures),
- "SetAppLayer");
+ layerapps = realloc (layerapps, n_layerapps * sizeof (Apertures));
curapp = layerapps + prev;
while (curapp < layerapps + n_layerapps)
{
@@ -364,7 +362,7 @@ gerber_do_export (HID_Attr_Val * options)
all_layers = options[HA_all_layers].int_value;
i = strlen (fnbase);
- filename = MyRealloc (filename, i + 40, "gerber");
+ filename = realloc (filename, i + 40);
strcpy (filename, fnbase);
strcat (filename, ".");
filesuff = filename + strlen (filename);
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 461b779..5cd969c 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -133,8 +133,7 @@ ghid_draw_grid (void)
if (n > npoints)
{
npoints = n + 10;
- points =
- MyRealloc (points, npoints * sizeof (GdkPoint), "gtk_draw_grid");
+ points = realloc (points, npoints * sizeof (GdkPoint));
}
n = 0;
for (x = x1; x <= x2; x += PCB->Grid)
@@ -601,8 +600,7 @@ ghid_fill_polygon (hidGC gc, int n_coords, int *x, int *y)
if (npoints < n_coords)
{
npoints = n_coords + 1;
- points = MyRealloc (points,
- npoints * sizeof (GdkPoint), (char *) __FUNCTION__);
+ points = realloc (points, npoints * sizeof (GdkPoint));
}
for (i = 0; i < n_coords; i++)
{
diff --git a/src/hid/gtk/gui-dialog-size.c b/src/hid/gtk/gui-dialog-size.c
index 2f49f06..16caff3 100644
--- a/src/hid/gtk/gui-dialog-size.c
+++ b/src/hid/gtk/gui-dialog-size.c
@@ -308,7 +308,7 @@ ghid_route_style_dialog (gint index, RouteStyleType * temp_rst)
if (index < NUM_STYLES && !set_temp1 && !set_temp2)
{
string = ghid_entry_get_text (sd->name_entry);
- SaveFree (rst->Name);
+ free (rst->Name);
rst->Name = StripWhiteSpaceAndDup (string);
pcb_use_route_style (rst);
SetChangedFlag (true);
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index 9c30a93..90977e2 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -303,9 +303,7 @@ note_toggle_flag (const char *actionname, MenuFlagType type, char *name)
if (n_tflags >= max_tflags)
{
max_tflags += 20;
- tflags =
- MyRealloc (tflags, max_tflags * sizeof (ToggleFlagType),
- __FUNCTION__);
+ tflags = realloc (tflags, max_tflags * sizeof (ToggleFlagType));
}
tflags[n_tflags].actionname = strdup (actionname);
tflags[n_tflags].flagname = name;
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index 76dce1a..5f497a8 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -2236,8 +2236,7 @@ draw_grid ()
if (n > npoints)
{
npoints = n + 10;
- points =
- MyRealloc (points, npoints * sizeof (XPoint), "lesstif_draw_grid");
+ points = realloc (points, npoints * sizeof (XPoint));
}
n = 0;
prevx = 0;
@@ -3675,7 +3674,7 @@ lesstif_show_item (void *item)
if (!mainwind)
return;
- pd = (PinoutData *) MyCalloc (1, sizeof (PinoutData), "lesstif_show_item");
+ pd = calloc (1, sizeof (PinoutData));
pd->item = item;
diff --git a/src/hid/lesstif/menu.c b/src/hid/lesstif/menu.c
index aca306d..6baa016 100644
--- a/src/hid/lesstif/menu.c
+++ b/src/hid/lesstif/menu.c
@@ -672,9 +672,7 @@ note_widget_flag (Widget w, char *type, char *name)
if (n_wflags >= max_wflags)
{
max_wflags += 20;
- wflags =
- MyRealloc (wflags, max_wflags * sizeof (WidgetFlagType),
- __FUNCTION__);
+ wflags = realloc (wflags, max_wflags * sizeof (WidgetFlagType));
}
wflags[n_wflags].w = w;
wflags[n_wflags].flagname = name;
diff --git a/src/hid/lesstif/styles.c b/src/hid/lesstif/styles.c
index d3dcdaa..9b67d0f 100644
--- a/src/hid/lesstif/styles.c
+++ b/src/hid/lesstif/styles.c
@@ -452,8 +452,7 @@ lesstif_insert_style_buttons (Widget menu)
num_style_buttons++;
s = num_style_buttons * sizeof (StyleButtons);
- style_button_list =
- (StyleButtons *) MyRealloc (style_button_list, s, __FUNCTION__);
+ style_button_list = realloc (style_button_list, s);
sb = style_button_list + num_style_buttons - 1;
for (i = 0; i < NUM_STYLES; i++)
diff --git a/src/intersect.c b/src/intersect.c
index 8f99ad7..7389ba9 100644
--- a/src/intersect.c
+++ b/src/intersect.c
@@ -97,8 +97,7 @@ createSortedYList (BoxListTypePtr boxlist)
int i, n;
/* create sorted list of Y coordinates */
yCoords.size = 2 * boxlist->BoxN;
- yCoords.p = MyCalloc (yCoords.size, sizeof (*yCoords.p),
- "createSortedYList");
+ yCoords.p = calloc (yCoords.size, sizeof (*yCoords.p));
for (i = 0; i < boxlist->BoxN; i++)
{
yCoords.p[2 * i] = boxlist->Box[i].Y1;
@@ -124,7 +123,7 @@ createSegmentTree (LocationType * yCoords, int N)
int i;
/* size is twice the nearest larger power of 2 */
st.size = 2 * nextpwrof2 (N);
- st.nodes = MyCalloc (st.size, sizeof (*st.nodes), "createSegmentTree");
+ st.nodes = calloc (st.size, sizeof (*st.nodes));
/* initialize the rightmost leaf node */
st.nodes[st.size - 1].left = (N > 0) ? yCoords[--N] : 10;
st.nodes[st.size - 1].right = st.nodes[st.size - 1].left + 1;
@@ -235,10 +234,8 @@ ComputeUnionArea (BoxListTypePtr boxlist)
segtree = createSegmentTree (yCoords.p, yCoords.size);
free (yCoords.p);
/* create sorted list of left and right X coordinates of rectangles */
- rectLeft = MyCalloc (boxlist->BoxN, sizeof (*rectLeft),
- "ComputeUnionArea(1)");
- rectRight = MyCalloc (boxlist->BoxN, sizeof (*rectRight),
- "ComputeUnionArea(2)");
+ rectLeft = calloc (boxlist->BoxN, sizeof (*rectLeft));
+ rectRight = calloc (boxlist->BoxN, sizeof (*rectRight));
for (i = 0; i < boxlist->BoxN; i++)
{
assert (boxlist->Box[i].X1 <= boxlist->Box[i].X2);
diff --git a/src/main.c b/src/main.c
index c23ae8b..462285d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -226,7 +226,7 @@ usage_hid (HID * h)
exporter = NULL;
}
- note = (UsageNotes *) MyMalloc (sizeof (UsageNotes), "usage_hid");
+ note = malloc (sizeof (UsageNotes));
note->next = usage_notes;
note->seen = attributes;
usage_notes = note;
diff --git a/src/misc.c b/src/misc.c
index 9ab9f53..2e471d0 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -962,13 +962,13 @@ ExpandFilename (char *Dirname, char *Filename)
DSClearString (&answer);
if (Dirname)
{
- command = MyCalloc (strlen (Filename) + strlen (Dirname) + 7,
- sizeof (char), "ExpandFilename()");
+ command = calloc (strlen (Filename) + strlen (Dirname) + 7,
+ sizeof (char));
sprintf (command, "echo %s/%s", Dirname, Filename);
}
else
{
- command = MyCalloc (strlen (Filename) + 6, sizeof (char), "Expand()");
+ command = calloc (strlen (Filename) + 6, sizeof (char));
sprintf (command, "echo %s", Filename);
}
@@ -984,13 +984,13 @@ ExpandFilename (char *Dirname, char *Filename)
DSAddCharacter (&answer, c);
}
- SaveFree (command);
+ free (command);
return (pclose (pipe) ? NULL : answer.Data);
}
/* couldn't be expanded by the shell */
PopenErrorMessage (command);
- SaveFree (command);
+ free (command);
return (NULL);
}
@@ -1904,7 +1904,7 @@ AttributePutToList (AttributeListType *list, const char *name, const char *value
if (strcmp (name, list->List[i].name) == 0)
{
free (list->List[i].value);
- list->List[i].value = MyStrdup (value, "AttributePutToList");
+ list->List[i].value = STRDUP (value);
return 1;
}
}
@@ -1920,8 +1920,8 @@ AttributePutToList (AttributeListType *list, const char *name, const char *value
/* Now add the new attribute. */
i = list->Number;
- list->List[i].name = MyStrdup (name, "AttributePutToList");
- list->List[i].value = MyStrdup (value, "AttributePutToList");
+ list->List[i].name = STRDUP (name);
+ list->List[i].value = STRDUP (value);
list->Number ++;
return 0;
}
diff --git a/src/mymem.c b/src/mymem.c
index 13863c1..09cb6ab 100644
--- a/src/mymem.c
+++ b/src/mymem.c
@@ -69,9 +69,8 @@ GetRubberbandMemory (void)
Crosshair.AttachedObject.RubberbandMax)
{
Crosshair.AttachedObject.RubberbandMax += STEP_RUBBERBAND;
- ptr = MyRealloc (ptr,
- Crosshair.AttachedObject.RubberbandMax *
- sizeof (RubberbandType), "GetRubberbandMemory()");
+ ptr = realloc (ptr, Crosshair.AttachedObject.RubberbandMax *
+ sizeof (RubberbandType));
Crosshair.AttachedObject.Rubberband = ptr;
memset (ptr + Crosshair.AttachedObject.RubberbandN, 0,
STEP_RUBBERBAND * sizeof (RubberbandType));
@@ -88,8 +87,7 @@ GetPointerMemory (PointerListTypePtr list)
if (list->PtrN >= list->PtrMax)
{
list->PtrMax = STEP_POINT + (2 * list->PtrMax);
- ptr = MyRealloc (ptr, list->PtrMax * sizeof (void *),
- "GetPointerMemory()");
+ ptr = realloc (ptr, list->PtrMax * sizeof (void *));
list->Ptr = ptr;
memset (ptr + list->PtrN, 0,
(list->PtrMax - list->PtrN) * sizeof (void *));
@@ -100,7 +98,7 @@ GetPointerMemory (PointerListTypePtr list)
void
FreePointerListMemory (PointerListTypePtr list)
{
- MYFREE (list->Ptr);
+ free (list->Ptr);
memset (list, 0, sizeof (PointerListType));
}
@@ -116,8 +114,7 @@ GetBoxMemory (BoxListTypePtr Boxes)
if (Boxes->BoxN >= Boxes->BoxMax)
{
Boxes->BoxMax = STEP_POINT + (2 * Boxes->BoxMax);
- box = MyRealloc (box, Boxes->BoxMax * sizeof (BoxType),
- "GetBoxMemory()");
+ box = realloc (box, Boxes->BoxMax * sizeof (BoxType));
Boxes->Box = box;
memset (box + Boxes->BoxN, 0,
(Boxes->BoxMax - Boxes->BoxN) * sizeof (BoxType));
@@ -138,8 +135,7 @@ GetConnectionMemory (NetTypePtr Net)
if (Net->ConnectionN >= Net->ConnectionMax)
{
Net->ConnectionMax += STEP_POINT;
- con = MyRealloc (con, Net->ConnectionMax * sizeof (ConnectionType),
- "GetConnectionMemory()");
+ con = realloc (con, Net->ConnectionMax * sizeof (ConnectionType));
Net->Connection = con;
memset (con + Net->ConnectionN, 0,
STEP_POINT * sizeof (ConnectionType));
@@ -159,8 +155,7 @@ GetNetMemory (NetListTypePtr Netlist)
if (Netlist->NetN >= Netlist->NetMax)
{
Netlist->NetMax += STEP_POINT;
- net = MyRealloc (net, Netlist->NetMax * sizeof (NetType),
- "GetNetMemory()");
+ net = realloc (net, Netlist->NetMax * sizeof (NetType));
Netlist->Net = net;
memset (net + Netlist->NetN, 0, STEP_POINT * sizeof (NetType));
}
@@ -179,9 +174,8 @@ GetNetListMemory (NetListListTypePtr Netlistlist)
if (Netlistlist->NetListN >= Netlistlist->NetListMax)
{
Netlistlist->NetListMax += STEP_POINT;
- netlist = MyRealloc
- (netlist, Netlistlist->NetListMax * sizeof (NetListType),
- "GetNetListMemory()");
+ netlist = realloc (netlist,
+ Netlistlist->NetListMax * sizeof (NetListType));
Netlistlist->NetList = netlist;
memset (netlist + Netlistlist->NetListN, 0,
STEP_POINT * sizeof (NetListType));
@@ -211,8 +205,7 @@ GetPinMemory (ElementTypePtr Element)
END_LOOP;
}
Element->PinMax += STEP_PIN;
- pin = MyRealloc (pin, Element->PinMax * sizeof (PinType),
- "GetPinMemory()");
+ pin = realloc (pin, Element->PinMax * sizeof (PinType));
Element->Pin = pin;
memset (pin + Element->PinN, 0, STEP_PIN * sizeof (PinType));
if (onBoard)
@@ -249,8 +242,7 @@ GetPadMemory (ElementTypePtr Element)
END_LOOP;
}
Element->PadMax += STEP_PAD;
- pad = MyRealloc (pad, Element->PadMax * sizeof (PadType),
- "GetPadMemory()");
+ pad = realloc (pad, Element->PadMax * sizeof (PadType));
Element->Pad = pad;
memset (pad + Element->PadN, 0, STEP_PAD * sizeof (PadType));
if (onBoard)
@@ -279,8 +271,7 @@ GetViaMemory (DataTypePtr Data)
Data->ViaMax += STEP_VIA;
if (Data->via_tree)
r_destroy_tree (&Data->via_tree);
- via = MyRealloc (via, Data->ViaMax * sizeof (PinType),
- "GetViaMemory()");
+ via = realloc (via, Data->ViaMax * sizeof (PinType));
Data->Via = via;
memset (via + Data->ViaN, 0, STEP_VIA * sizeof (PinType));
Data->via_tree = r_create_tree (NULL, 0, 0);
@@ -308,8 +299,7 @@ GetRatMemory (DataTypePtr Data)
/* all of the pointers move, so rebuild the whole tree */
if (Data->rat_tree)
r_destroy_tree (&Data->rat_tree);
- rat = MyRealloc (rat, Data->RatMax * sizeof (RatType),
- "GetRatMemory()");
+ rat = realloc (rat, Data->RatMax * sizeof (RatType));
Data->Rat = rat;
memset (rat + Data->RatN, 0, STEP_RAT * sizeof (RatType));
Data->rat_tree = r_create_tree (NULL, 0, 0);
@@ -337,8 +327,7 @@ GetLineMemory (LayerTypePtr Layer)
/* all of the pointers move, so rebuild the whole tree */
if (Layer->line_tree)
r_destroy_tree (&Layer->line_tree);
- line = MyRealloc (line, Layer->LineMax * sizeof (LineType),
- "GetLineMemory()");
+ line = realloc (line, Layer->LineMax * sizeof (LineType));
Layer->Line = line;
memset (line + Layer->LineN, 0, STEP_LINE * sizeof (LineType));
Layer->line_tree = r_create_tree (NULL, 0, 0);
@@ -365,8 +354,7 @@ GetArcMemory (LayerTypePtr Layer)
Layer->ArcMax += STEP_ARC;
if (Layer->arc_tree)
r_destroy_tree (&Layer->arc_tree);
- arc = MyRealloc (arc, Layer->ArcMax * sizeof (ArcType),
- "GetArcMemory()");
+ arc = realloc (arc, Layer->ArcMax * sizeof (ArcType));
Layer->Arc = arc;
memset (arc + Layer->ArcN, 0, STEP_ARC * sizeof (ArcType));
Layer->arc_tree = r_create_tree (NULL, 0, 0);
@@ -393,8 +381,7 @@ GetTextMemory (LayerTypePtr Layer)
Layer->TextMax += STEP_TEXT;
if (Layer->text_tree)
r_destroy_tree (&Layer->text_tree);
- text = MyRealloc (text, Layer->TextMax * sizeof (TextType),
- "GetTextMemory()");
+ text = realloc (text, Layer->TextMax * sizeof (TextType));
Layer->Text = text;
memset (text + Layer->TextN, 0, STEP_TEXT * sizeof (TextType));
Layer->text_tree = r_create_tree (NULL, 0, 0);
@@ -421,8 +408,7 @@ GetPolygonMemory (LayerTypePtr Layer)
Layer->PolygonMax += STEP_POLYGON;
if (Layer->polygon_tree)
r_destroy_tree (&Layer->polygon_tree);
- polygon = MyRealloc (polygon, Layer->PolygonMax * sizeof (PolygonType),
- "GetPolygonMemory()");
+ polygon = realloc (polygon, Layer->PolygonMax * sizeof (PolygonType));
Layer->Polygon = polygon;
memset (polygon + Layer->PolygonN, 0,
STEP_POLYGON * sizeof (PolygonType));
@@ -449,8 +435,7 @@ GetPointMemoryInPolygon (PolygonTypePtr Polygon)
if (Polygon->PointN >= Polygon->PointMax)
{
Polygon->PointMax += STEP_POLYGONPOINT;
- points = MyRealloc (points, Polygon->PointMax * sizeof (PointType),
- "GetPointMemoryInPolygon()");
+ points = realloc (points, Polygon->PointMax * sizeof (PointType));
Polygon->Points = points;
memset (points + Polygon->PointN, 0,
STEP_POLYGONPOINT * sizeof (PointType));
@@ -471,8 +456,7 @@ GetHoleIndexMemoryInPolygon (PolygonTypePtr Polygon)
if (Polygon->HoleIndexN >= Polygon->HoleIndexMax)
{
Polygon->HoleIndexMax += STEP_POLYGONHOLEINDEX;
- holeindex = MyRealloc (holeindex, Polygon->HoleIndexMax * sizeof (int),
- "GetHoleIndexMemoryInPolygon()");
+ holeindex = realloc (holeindex, Polygon->HoleIndexMax * sizeof (int));
Polygon->HoleIndex = holeindex;
memset (holeindex + Polygon->HoleIndexN, 0,
STEP_POLYGONHOLEINDEX * sizeof (int));
@@ -495,8 +479,7 @@ GetElementMemory (DataTypePtr Data)
Data->ElementMax += STEP_ELEMENT;
if (Data->element_tree)
r_destroy_tree (&Data->element_tree);
- element = MyRealloc (element, Data->ElementMax * sizeof (ElementType),
- "GetElementMemory()");
+ element = realloc (element, Data->ElementMax * sizeof (ElementType));
Data->Element = element;
memset (element + Data->ElementN, 0,
STEP_ELEMENT * sizeof (ElementType));
@@ -545,8 +528,7 @@ GetLibraryMenuMemory (LibraryTypePtr lib)
if (lib->MenuN >= lib->MenuMax)
{
lib->MenuMax += STEP_LIBRARYMENU;
- menu = MyRealloc (menu, lib->MenuMax * sizeof (LibraryMenuType),
- "GetLibraryMenuMemory()");
+ menu = realloc (menu, lib->MenuMax * sizeof (LibraryMenuType));
lib->Menu = menu;
memset (menu + lib->MenuN, 0,
STEP_LIBRARYMENU * sizeof (LibraryMenuType));
@@ -566,8 +548,7 @@ GetLibraryEntryMemory (LibraryMenuTypePtr Menu)
if (Menu->EntryN >= Menu->EntryMax)
{
Menu->EntryMax += STEP_LIBRARYENTRY;
- entry = MyRealloc (entry, Menu->EntryMax * sizeof (LibraryEntryType),
- "GetLibraryEntryMemory()");
+ entry = realloc (entry, Menu->EntryMax * sizeof (LibraryEntryType));
Menu->Entry = entry;
memset (entry + Menu->EntryN, 0,
STEP_LIBRARYENTRY * sizeof (LibraryEntryType));
@@ -589,9 +570,8 @@ GetDrillElementMemory (DrillTypePtr Drill)
if (Drill->ElementN >= Drill->ElementMax)
{
Drill->ElementMax += STEP_ELEMENT;
- element =
- MyRealloc (element, Drill->ElementMax * sizeof (ElementTypeHandle),
- "GetDrillElementMemory()");
+ element = realloc (element,
+ Drill->ElementMax * sizeof (ElementTypeHandle));
Drill->Element = element;
memset (element + Drill->ElementN, 0,
STEP_ELEMENT * sizeof (ElementTypeHandle));
@@ -613,8 +593,7 @@ GetDrillPinMemory (DrillTypePtr Drill)
if (Drill->PinN >= Drill->PinMax)
{
Drill->PinMax += STEP_POINT;
- pin = MyRealloc (pin, Drill->PinMax * sizeof (PinTypeHandle),
- "GetDrillPinMemory()");
+ pin = realloc (pin, Drill->PinMax * sizeof (PinTypeHandle));
Drill->Pin = pin;
memset (pin + Drill->PinN, 0, STEP_POINT * sizeof (PinTypeHandle));
}
@@ -633,8 +612,7 @@ GetDrillInfoDrillMemory (DrillInfoTypePtr DrillInfo)
if (DrillInfo->DrillN >= DrillInfo->DrillMax)
{
DrillInfo->DrillMax += STEP_DRILL;
- drill = MyRealloc (drill, DrillInfo->DrillMax * sizeof (DrillType),
- "GetDrillInfoDrillMemory()");
+ drill = realloc (drill, DrillInfo->DrillMax * sizeof (DrillType));
DrillInfo->Drill = drill;
memset (drill + DrillInfo->DrillN, 0, STEP_DRILL * sizeof (DrillType));
}
@@ -642,112 +620,6 @@ GetDrillInfoDrillMemory (DrillInfoTypePtr DrillInfo)
}
/* ---------------------------------------------------------------------------
- * allocates memory with error handling
- */
-void *
-MyCalloc (size_t Number, size_t Size, const char *Text)
-{
- void *p;
-
-#ifdef MEM_DEBUG
- fprintf (stderr, "MyCalloc %d by %d from %s ", Number, Size, Text);
-#endif
- /* InitComponentLookup() at least can ask for zero here, so return something
- | that can be freed.
- */
- if (Number == 0)
- Number = 1;
- if (Size == 0)
- Size = 1;
-
- if ((p = calloc (Number, Size)) == NULL)
- MyFatal ("out of memory during malloc() in '%s'()\n",
- (Text ? Text : "(unknown)"));
-#ifdef MEM_DEBUG
- fprintf (stderr, "returned 0x%x\n", p);
-#endif
- return (p);
-}
-
-void *
-MyMalloc (size_t Size, const char *Text)
-{
- void *p;
-
-#ifdef MEM_DEBUG
- fprintf (stderr, "MyMalloc %d by %d from %s ", Number, Size, Text);
-#endif
- /* avoid malloc of 0 bytes */
- if (Size == 0)
- Size = 1;
- if ((p = malloc (Size)) == NULL)
- MyFatal ("out of memory during malloc() in '%s'()\n",
- (Text ? Text : "(unknown)"));
-#ifdef MEM_DEBUG
- fprintf (stderr, "returned 0x%x\n", p);
-#endif
- return (p);
-}
-
-/* ---------------------------------------------------------------------------
- * allocates memory with error handling
- * this is a save version because BSD doesn't support the
- * handling of NULL pointers in realloc()
- */
-void *
-MyRealloc (void *Ptr, size_t Size, const char *Text)
-{
- void *p;
-
-#ifdef MEM_DEBUG
- fprintf (stderr, "0x%x Realloc to %d from %s ", Ptr, Size, Text);
-#endif
- if (Size == 0)
- Size = 1;
- p = Ptr ? realloc (Ptr, Size) : malloc (Size);
- if (!p)
- MyFatal ("out of memory during realloc() in '%s'()\n",
- (Text ? Text : "(unknown)"));
-#ifdef MEM_DEBUG
- fprintf (stderr, "returned 0x%x\n", p);
-#endif
- return (p);
-}
-
-/* ---------------------------------------------------------------------------
- * allocates memory for a new string, does some error processing
- */
-char *
-MyStrdup (const char *S, const char *Text)
-{
- char *p = NULL;
-
- /* bug-fix by Ulrich Pegelow (ul...@bi...) */
- if (S && ((p = strdup (S)) == NULL))
- MyFatal ("out of memory during g_strdup() in '%s'\n",
- (Text ? Text : "(unknown)"));
-#ifdef MEM_DEBUG
- fprintf (stderr, "g_strdup returning 0x%x\n", p);
-#endif
- return (p);
-}
-
-/* ---------------------------------------------------------------------------
- * frees memory and sets pointer to NULL
- * too troublesome for modern C compiler,
- * warning: dereferencing type-punned pointer will break strict-aliasing rules
- * Use MYFREE() macro instead
- */
-#if 0
-void
-MyFree (char **Ptr)
-{
- SaveFree (*Ptr);
- *Ptr = NULL;
-}
-#endif
-
-/* ---------------------------------------------------------------------------
* frees memory used by a polygon
*/
void
@@ -755,8 +627,8 @@ FreePolygonMemory (PolygonTypePtr Polygon)
{
if (Polygon)
{
- MYFREE (Polygon->Points);
- MYFREE (Polygon->HoleIndex);
+ free (Polygon->Points);
+ free (Polygon->HoleIndex);
if (Polygon->Clipped)
poly_Free (&Polygon->Clipped);
poly_FreeContours (&Polygon->NoHoles);
@@ -772,7 +644,7 @@ FreeBoxListMemory (BoxListTypePtr Boxlist)
{
if (Boxlist)
{
- MYFREE (Boxlist->Box);
+ free (Boxlist->Box);
memset (Boxlist, 0, sizeof (BoxListType));
}
}
@@ -790,7 +662,7 @@ FreeNetListMemory (NetListTypePtr Netlist)
FreeNetMemory (net);
}
END_LOOP;
- MYFREE (Netlist->Net);
+ free (Netlist->Net);
memset (Netlist, 0, sizeof (NetListType));
}
}
@@ -808,7 +680,7 @@ FreeNetListListMemory (NetListListTypePtr Netlistlist)
FreeNetListMemory (netlist);
}
END_LOOP;
- MYFREE (Netlistlist->NetList);
+ free (Netlistlist->NetList);
memset (Netlistlist, 0, sizeof (NetListListType));
}
}
@@ -821,7 +693,7 @@ FreeNetMemory (NetTypePtr Net)
{
if (Net)
{
- MYFREE (Net->Connection);
+ free (Net->Connection);
memset (Net, 0, sizeof (NetType));
}
}
@@ -835,10 +707,10 @@ FreeAttributeListMemory (AttributeListTypePtr list)
for (i = 0; i < list->Number; i++)
{
- SaveFree (list->List[i].name);
- SaveFree (list->List[i].value);
+ free (list->List[i].name);
+ free (list->List[i].value);
}
- SaveFree (list->List);
+ free (list->List);
list->List = NULL;
list->Max = 0;
}
@@ -853,25 +725,25 @@ FreeElementMemory (ElementTypePtr Element)
{
ELEMENTNAME_LOOP (Element);
{
- MYFREE (textstring);
+ free (textstring);
}
END_LOOP;
PIN_LOOP (Element);
{
- MYFREE (pin->Name);
- MYFREE (pin->Number);
+ free (pin->Name);
+ free (pin->Number);
}
END_LOOP;
PAD_LOOP (Element);
{
- MYFREE (pad->Name);
- MYFREE (pad->Number);
+ free (pad->Name);
+ free (pad->Number);
}
END_LOOP;
- MYFREE (Element->Pin);
- MYFREE (Element->Pad);
- MYFREE (Element->Line);
- MYFREE (Element->Arc);
+ free (Element->Pin);
+ free (Element->Pad);
+ free (Element->Line);
+ free (Element->Arc);
FreeAttributeListMemory (&Element->Attributes);
memset (Element, 0, sizeof (ElementType));
}
@@ -887,15 +759,15 @@ FreePCBMemory (PCBTypePtr PCBPtr)
if (PCBPtr)
{
- MYFREE (PCBPtr->Name);
- MYFREE (PCBPtr->Filename);
- MYFREE (PCBPtr->PrintFilename);
+ free (PCBPtr->Name);
+ free (PCBPtr->Filename);
+ free (PCBPtr->PrintFilename);
if (PCBPtr->Data)
FreeDataMemory (PCBPtr->Data);
- MYFREE (PCBPtr->Data);
+ free (PCBPtr->Data);
/* release font symbols */
for (i = 0; i <= MAX_FONTPOSITION; i++)
- MYFREE (PCBPtr->Font.Symbol[i].Line);
+ free (PCBPtr->Font.Symbol[i].Line);
FreeLibraryMemory (&PCBPtr->NetlistLib);
FreeAttributeListMemory (&PCBPtr->Attributes);
/* clear struct */
@@ -920,43 +792,43 @@ FreeDataMemory (DataTypePtr Data)
{
VIA_LOOP (Data);
{
- MYFREE (via->Name);
+ free (via->Name);
}
END_LOOP;
- MYFREE (Data->Via);
+ free (Data->Via);
ELEMENT_LOOP (Data);
{
FreeElementMemory (element);
}
END_LOOP;
- MYFREE (Data->Element);
- MYFREE (Data->Rat);
+ free (Data->Element);
+ free (Data->Rat);
for (layer = Data->Layer, i = 0; i < MAX_LAYER + 2; layer++, i++)
{
FreeAttributeListMemory (&layer->Attributes);
TEXT_LOOP (layer);
{
- MYFREE (text->TextString);
+ free (text->TextString);
}
END_LOOP;
if (layer->Name)
- MYFREE (layer->Name);
+ free (layer->Name);
LINE_LOOP (layer);
{
if (line->Number)
- MYFREE (line->Number);
+ free (line->Number);
}
END_LOOP;
- MYFREE (layer->Line);
- MYFREE (layer->Arc);
- MYFREE (layer->Text);
+ free (layer->Line);
+ free (layer->Arc);
+ free (layer->Text);
POLYGON_LOOP (layer);
{
FreePolygonMemory (polygon);
}
END_LOOP;
- MYFREE (layer->Polygon);
+ free (layer->Polygon);
if (layer->line_tree)
r_destroy_tree (&layer->line_tree);
if (layer->arc_tree)
@@ -999,36 +871,21 @@ FreeLibraryMemory (LibraryTypePtr lib)
{
ENTRY_LOOP (menu);
{
- SaveFree ((void *) entry->AllocatedMemory);
- SaveFree ((void *) entry->ListEntry);
+ free (entry->AllocatedMemory);
+ free (entry->ListEntry);
}
END_LOOP;
- SaveFree ((void *) menu->Entry);
- SaveFree ((void *) menu->Name);
+ free (menu->Entry);
+ free (menu->Name);
}
END_LOOP;
- SaveFree ((void *) lib->Menu);
+ free (lib->Menu);
/* clear struct */
memset (lib, 0, sizeof (LibraryType));
}
/* ---------------------------------------------------------------------------
- * a 'save' free routine which first does a quick check if the pointer
- * is zero. The routine isn't implemented as a macro to make additional
- * safety features easier to implement
- */
-void
-SaveFree (void *Ptr)
-{
-#ifdef MEM_DEBUG
- fprintf (stderr, "Freeing 0x%x\n", Ptr);
-#endif
- if (Ptr)
- free (Ptr);
-}
-
-/* ---------------------------------------------------------------------------
* reallocates memory for a dynamic length string if necessary
*/
static void
@@ -1038,7 +895,7 @@ DSRealloc (DynamicStringTypePtr Ptr, size_t Length)
if (input_null || Length >= Ptr->MaxLength)
{
Ptr->MaxLength = Length + 512;
- Ptr->Data = MyRealloc (Ptr->Data, Ptr->MaxLength, "ReallocDS()");
+ Ptr->Data = realloc (Ptr->Data, Ptr->MaxLength);
if (input_null)
Ptr->Data[0] = '\0';
}
@@ -1106,7 +963,7 @@ StripWhiteSpaceAndDup (char *S)
/* string is not empty -> allocate memory */
if (length)
{
- p2 = MyRealloc (NULL, length + 1, "StripWhiteSpace()");
+ p2 = realloc (NULL, length + 1);
strncpy (p2, p1, length);
*(p2 + length) = '\0';
return (p2);
diff --git a/src/mymem.h b/src/mymem.h
index fdfd7e6..4e36640 100644
--- a/src/mymem.h
+++ b/src/mymem.h
@@ -64,6 +64,8 @@
#define STEP_RUBBERBAND 100
#define STEP_RAT 2000
+#define STRDUP(x) (((x) != NULL) ? strdup (x) : NULL)
+
/* ---------------------------------------------------------------------------
* some memory types
*/
@@ -95,12 +97,6 @@ ElementTypeHandle GetDrillElementMemory (DrillTypePtr);
PinTypeHandle GetDrillPinMemory (DrillTypePtr);
DrillTypePtr GetDrillInfoDrillMemory (DrillInfoTypePtr);
void **GetPointerMemory (PointerListTypePtr);
-void *MyCalloc (size_t, size_t, const char *);
-void *MyMalloc (size_t, const char *);
-void *MyRealloc (void *, size_t, const char *);
-char *MyStrdup (const char *s, const char *);
-/* void MyFree (void **); */
-#define MYFREE(x) do { SaveFree(x); (x)=NULL; } while (0)
void FreePolygonMemory (PolygonTypePtr);
void FreeElementMemory (ElementTypePtr);
void FreePCBMemory (PCBTypePtr);
@@ -111,7 +107,6 @@ void FreeNetMemory (NetTypePtr);
void FreeDataMemory (DataTypePtr);
void FreeLibraryMemory (LibraryTypePtr);
void FreePointerListMemory (PointerListTypePtr);
-void SaveFree (void *);
void DSAddCharacter (DynamicStringTypePtr, char);
void DSAddString (DynamicStringTypePtr, const char *);
void DSClearString (DynamicStringTypePtr);
diff --git a/src/netlist.c b/src/netlist.c
index 459b08a..4a26bc9 100644
--- a/src/netlist.c
+++ b/src/netlist.c
@@ -242,10 +242,8 @@ netlist_clear (LibraryMenuType * net, LibraryEntryType * pin)
static void
netlist_style (LibraryMenuType *net, const char *style)
{
- if (net->Style)
- MYFREE (net->Style);
- if (style)
- net->Style = strdup ((char *)style);
+ free (net->Style);
+ net->Style = STRDUP ((char *)style);
}
/* The primary purpose of this action is to rebuild a netlist from a
diff --git a/src/parse_l.l b/src/parse_l.l
index c9d96c8..a2808ad 100644
--- a/src/parse_l.l
+++ b/src/parse_l.l
@@ -171,7 +171,7 @@ Attribute { return(T_ATTRIBUTE); }
* leading and trailing '"'
*/
yyleng -= 2;
- yylval.string = MyCalloc(yyleng+1, sizeof(char), "LEX");
+ yylval.string = calloc (yyleng+1, sizeof (char));
p1 = (char *) (yytext +1);
p2 = yylval.string;
while(yyleng--)
@@ -247,8 +247,7 @@ static int Parse(char *Executable, char *Path, char *Filename, char *Parameter)
{
used_popen = 1;
/* release old command and create new from template */
- if (command)
- MYFREE (command);
+ free (command);
command = EvaluateFilename(Executable, Path, Filename, Parameter);
/* open pipe to stdout of command */
diff --git a/src/parse_y.y b/src/parse_y.y
index f4fc367..7aa7b80 100644
--- a/src/parse_y.y
+++ b/src/parse_y.y
@@ -733,7 +733,7 @@ via_hi_format
: T_VIA '[' NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER STRING flags ']'
{
CreateNewVia(yyData, $3, $4, $5, $6, $7, $8, $9, $10);
- SaveFree($9);
+ free ($9);
}
;
@@ -743,7 +743,7 @@ via_2.0_format
{
CreateNewVia(yyData, $3*100, $4*100, $5*100, $6*100, $7*100, $8*100, $9,
OldFlags($10));
- SaveFree($9);
+ free ($9);
}
;
@@ -754,7 +754,7 @@ via_1.7_format
{
CreateNewVia(yyData, $3*100, $4*100, $5*100, $6*100,
($5 + $6)*100, $7*100, $8, OldFlags($9));
- SaveFree($8);
+ free ($8);
}
;
@@ -764,7 +764,7 @@ via_newformat
{
CreateNewVia(yyData, $3*100, $4*100, $5*100, 200*GROUNDPLANEFRAME,
($5 + 2*MASKFRAME)*100, $6*100, $7, OldFlags($8));
- SaveFree($7);
+ free ($7);
}
;
@@ -781,7 +781,7 @@ via_oldformat
CreateNewVia(yyData, $3*100, $4*100, $5*100, 200*GROUNDPLANEFRAME,
($5 + 2*MASKFRAME)*100, hole, $6, OldFlags($7));
- SaveFree($6);
+ free ($6);
}
;
@@ -1045,7 +1045,7 @@ text_oldformat
{
/* use a default scale of 100% */
CreateNewText(Layer,yyFont,$3*100, $4*100, $5, 100, $6, OldFlags($7));
- SaveFree($6);
+ free ($6);
}
;
@@ -1064,7 +1064,7 @@ text_newformat
else
CreateNewText(Layer, yyFont, $3*100, $4*100, $5, $6, $7,
OldFlags($8));
- SaveFree($7);
+ free ($7);
}
;
text_hi_format
@@ -1087,7 +1087,7 @@ text_hi_format
}
else
CreateNewText(Layer, yyFont, $3, $4, $5, $6, $7, $8);
- SaveFree($7);
+ free ($7);
}
;
@@ -1258,8 +1258,8 @@ element_oldformat
{
yyElement = CreateNewElement(yyData, yyElement, yyFont, NoFlags(),
$3, $4, NULL, $5*100, $6*100, $7, 100, NoFlags(), false);
- SaveFree($3);
- SaveFree($4);
+ free ($3);
+ free ($4);
pin_num = 1;
}
elementdefinitions ')'
@@ -1276,8 +1276,8 @@ element_1.3.4_format
{
yyElement = CreateNewElement(yyData, yyElement, yyFont, OldFlags($3),
$4, $5, NULL, $6*100, $7*100, $8, $9, OldFlags($10), false);
- SaveFree($4);
- SaveFree($5);
+ free ($4);
+ free ($5);
pin_num = 1;
}
elementdefinitions ')'
@@ -1294,9 +1294,9 @@ element_newformat
{
yyElement = CreateNewElement(yyData, yyElement, yyFont, OldFlags($3),
$4, $5, $6, $7*100, $8*100, $9, $10, OldFlags($11), false);
- SaveFree($4);
- SaveFree($5);
- SaveFree($6);
+ free ($4);
+ free ($5);
+ free ($6);
pin_num = 1;
}
elementdefinitions ')'
@@ -1316,9 +1316,9 @@ element_1.7_format
$4, $5, $6, ($7+$9)*100, ($8+$10)*100, $11, $12, OldFlags($13), false);
yyElement->MarkX = $7*100;
yyElement->MarkY = $8*100;
- SaveFree($4);
- SaveFree($5);
- SaveFree($6);
+ free ($4);
+ free ($5);
+ free ($6);
}
relementdefs ')'
{
@@ -1337,9 +1337,9 @@ element_hi_format
$4, $5, $6, ($7+$9), ($8+$10), $11, $12, $13, false);
yyElement->MarkX = $7;
yyElement->MarkY = $8;
- SaveFree($4);
- SaveFree($5);
- SaveFree($6);
+ free ($4);
+ free ($5);
+ free ($6);
}
relementdefs ')'
{
@@ -1534,8 +1534,8 @@ pin_hi_format
CreateNewPin(yyElement, $3 + yyElement->MarkX,
$4 + yyElement->MarkY, $5, $6, $7, $8, $9,
$10, $11);
- SaveFree($9);
- SaveFree($10);
+ free ($9);
+ free ($10);
}
;
pin_1.7_format
@@ -1546,8 +1546,8 @@ pin_1.7_format
CreateNewPin(yyElement, $3*100 + yyElement->MarkX,
$4*100 + yyElement->MarkY, $5*100, $6*100, $7*100, $8*100, $9,
$10, OldFlags($11));
- SaveFree($9);
- SaveFree($10);
+ free ($9);
+ free ($10);
}
;
@@ -1557,8 +1557,8 @@ pin_1.6.3_format
{
CreateNewPin(yyElement, $3*100, $4*100, $5*100, 200*GROUNDPLANEFRAME,
($5 + 2*MASKFRAME)*100, $6*100, $7, $8, OldFlags($9));
- SaveFree($7);
- SaveFree($8);
+ free ($7);
+ free ($8);
}
;
@@ -1572,7 +1572,7 @@ pin_newformat
CreateNewPin(yyElement, $3*100, $4*100, $5*100, 200*GROUNDPLANEFRAME,
($5 + 2*MASKFRAME)*100, $6*100, $7, p_number, OldFlags($8));
- SaveFree($7);
+ free ($7);
}
;
@@ -1593,7 +1593,7 @@ pin_oldformat
sprintf(p_number, "%d", pin_num++);
CreateNewPin(yyElement, $3*100, $4*100, $5*100, 200*GROUNDPLANEFRAME,
($5 + 2*MASKFRAME)*100, hole, $6, p_number, OldFlags($7));
- SaveFree($6);
+ free ($6);
}
;
@@ -1641,8 +1641,8 @@ pad_hi_format
$5 + yyElement->MarkX,
$6 + yyElement->MarkY, $7, $8, $9,
$10, $11, $12);
- SaveFree($10);
- SaveFree($11);
+ free ($10);
+ free ($11);
}
;
@@ -1654,8 +1654,8 @@ pad_1.7_format
$4*100 + yyElement->MarkY, $5*100 + yyElement->MarkX,
$6*100 + yyElement->MarkY, $7*100, $8*100, $9*100,
$10, $11, OldFlags($12));
- SaveFree($10);
- SaveFree($11);
+ free ($10);
+ free ($11);
}
;
@@ -1665,8 +1665,8 @@ pad_newformat
{
CreateNewPad(yyElement,$3*100,$4*100,$5*100,$6*100,$7*100, 200*GROUNDPLANEFRAME,
($7 + 2*MASKFRAME)*100, $8,$9, OldFlags($10));
- SaveFree($8);
- SaveFree($9);
+ free ($8);
+ free ($9);
}
;
@@ -1679,7 +1679,7 @@ pad
sprintf(p_number, "%d", pin_num++);
CreateNewPad(yyElement,$3*100,$4*100,$5*100,$6*100,$7*100, 200*GROUNDPLANEFRAME,
($7 + 2*MASKFRAME)*100, $8,p_number, OldFlags($9));
- SaveFree($8);
+ free ($8);
}
;
@@ -1846,8 +1846,8 @@ net
: T_NET '(' STRING STRING ')' '('
{
Menu = CreateNewNet(&yyPCB->NetlistLib, $3, $4);
- SaveFree($3);
- SaveFree($4);
+ free ($3);
+ free ($4);
}
connections ')'
;
@@ -1881,7 +1881,7 @@ conn
: T_CONN '(' STRING ')'
{
CreateNewConnection(Menu, $3);
- SaveFree($3);
+ free ($3);
}
;
@@ -1914,8 +1914,8 @@ attribute
: T_ATTRIBUTE '(' STRING STRING ')'
{
CreateNewAttribute (attr_list, $3, $4 ? $4 : "");
- SaveFree ($3);
- SaveFree ($4);
+ free ($3);
+ free ($4);
}
;
diff --git a/src/rats.c b/src/rats.c
index 67a0efc..3c5ede1 100644
--- a/src/rats.c
+++ b/src/rats.c
@@ -228,15 +228,14 @@ ProcNetlist (LibraryTypePtr net_menu)
if (!net_menu->MenuN)
return (NULL);
FreeNetListMemory (Wantlist);
- SaveFree (Wantlist);
- /* MYFREE (Wantlist); *//* awkward */
+ free (Wantlist);
badnet = false;
/* find layer groups of the component side and solder side */
SLayer = GetLayerGroupNumberByNumber (solder_silk_layer);
CLayer = GetLayerGroupNumberByNumber (component_silk_layer);
- Wantlist = MyCalloc (1, sizeof (NetListType), "ProcNetlist()");
+ Wantlist = calloc (1, sizeof (NetListType));
if (Wantlist)
{
ALLPIN_LOOP (PCB->Data);
@@ -361,8 +360,7 @@ static bool
CheckShorts (LibraryMenuTypePtr theNet)
{
bool new, warn = false;
- PointerListTypePtr generic = MyCalloc (1, sizeof (PointerListType),
- "CheckShorts");
+ PointerListTypePtr generic = calloc (1, sizeof (PointerListType));
/* the first connection was starting point so
* the menu is always non-null
*/
@@ -442,7 +440,7 @@ CheckShorts (LibraryMenuTypePtr theNet)
}
ENDALL_LOOP;
FreePointerListMemory (generic);
- SaveFree (generic);
+ free (generic);
return (warn);
}
@@ -695,7 +693,7 @@ AddAllRats (bool SelectedOnly, void (*funcp) ())
/* initialize finding engine */
InitConnectionLookup ();
SaveFindFlag (DRCFLAG);
- Nets = MyCalloc (1, sizeof (NetListType), "AddAllRats()");
+ Nets = calloc (1, sizeof (NetListType));
/* now we build another netlist (Nets) for each
* net in Wantlist that shows how it actually looks now,
* then fill in any missing connections with rat lines.
@@ -728,7 +726,7 @@ AddAllRats (bool SelectedOnly, void (*funcp) ())
}
END_LOOP;
FreeNetListMemory (Nets);
- MYFREE (Nets);
+ free (Nets);
FreeConnectionLookupMemory ();
RestoreFindFlag ();
if (funcp)
diff --git a/src/remove.c b/src/remove.c
index 98b9ade..8defaf4 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -120,7 +120,7...
[truncated message content] |
|
From: <gi...@gp...> - 2010-12-10 03:00:48
|
The branch, master has been updated
via 0e24fde9348a61c2d25bb07b0a53e47e52a2d0a5 (commit)
via 277f9b937180093f38f2cdc2abc5a57ba22cb610 (commit)
from 48ba0051476ab1e0bf1e8f3d598c410a09f41614 (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 | 12 +-
src/buffer.c | 13 +-
src/command.c | 2 +-
src/copy.c | 2 +-
src/create.c | 51 +++-----
src/drill.c | 29 +++--
src/file.c | 34 +++---
src/find.c | 43 +++----
src/fontmode.c | 8 +-
src/hid/common/flags.c | 2 +-
src/hid/gerber/gerber.c | 6 +-
src/hid/gtk/gtkhid-gdk.c | 6 +-
src/hid/gtk/gui-dialog-size.c | 2 +-
src/hid/gtk/gui-top-window.c | 4 +-
src/hid/lesstif/main.c | 5 +-
src/hid/lesstif/menu.c | 4 +-
src/hid/lesstif/styles.c | 3 +-
src/intersect.c | 11 +-
src/main.c | 6 +-
src/misc.c | 20 ++--
src/move.c | 2 +-
src/mymem.c | 277 ++++++++++-------------------------------
src/mymem.h | 9 +-
src/netlist.c | 6 +-
src/parse_l.l | 5 +-
src/parse_y.y | 82 ++++++------
src/rats.c | 24 ++--
src/remove.c | 8 +-
src/report.c | 2 +-
src/undo.c | 10 +-
30 files changed, 253 insertions(+), 435 deletions(-)
=================
Commit Messages
=================
commit 0e24fde9348a61c2d25bb07b0a53e47e52a2d0a5
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove My* memory allocation routines. Just use the standard APIs directly
This means the following changes:
1. Replace all calls to MyCalloc() with calls to calloc()
2. Replace all calls to MyMalloc() with calls to malloc()
3. Replace all calls to MyRealloc() with calls to realloc()
4. Replace all calls to SaveFree() with calls to free()
5a. Where the MYFREE(x) macro is used and its pointer clearing side-
effect is required, call free (x); and (x) = NULL; directly.
5b. Where the MYFREE(x) macro is used, and (x) is immediately re-
assigned, or its location free'd or zero'd, skip the (x) = NULL;
6. Replace all calls to MyStrdup() with calls to the STRDUP(x) macro,
which expands to (((x) != NULL) ? strdup (x) : NULL).
NB: The previous commit already replaced various known "safe" calls of
MyStrdup() with strdup(), when the argument is known to be non-NULL.
1,2,3 and 6. mean that we discard the following features of the
mymem.c allocators:
7. Logging messages when MEM_DEBUF defined
8. Logic to assign 1 unit of memory if 0 is requested
9. Allocation failure handling via MyFatal() -> EmergencySave()
With feedback from Stephen Ecob <sil...@gm...>
7. Is old debug code which is rarely (if ever) used. Current debug tools
such as Valgrind can do a much better job of memory debugging now.
8. This is really papering over the possibility of a caller bug, and
should never have been included in the first place.
9. This is unlikely to actually ever save someone from loosing their PCB.
:100644 100644 f5e043a... 0e035a6... M src/action.c
:100644 100644 c69fc39... 4447c30... M src/buffer.c
:100644 100644 b41263b... 5c2b985... M src/command.c
:100644 100644 735f20f... 538ea0d... M src/create.c
:100644 100644 738ed18... 1f1d770... M src/drill.c
:100644 100644 5a926f8... bfe0de0... M src/file.c
:100644 100644 8d468bb... 3176357... M src/find.c
:100644 100644 e4a566d... 30859fb... M src/hid/common/flags.c
:100644 100644 1f6341b... 85e01f3... M src/hid/gerber/gerber.c
:100644 100644 461b779... 5cd969c... M src/hid/gtk/gtkhid-gdk.c
:100644 100644 2f49f06... 16caff3... M src/hid/gtk/gui-dialog-size.c
:100644 100644 9c30a93... 90977e2... M src/hid/gtk/gui-top-window.c
:100644 100644 76dce1a... 5f497a8... M src/hid/lesstif/main.c
:100644 100644 aca306d... 6baa016... M src/hid/lesstif/menu.c
:100644 100644 d3dcdaa... 9b67d0f... M src/hid/lesstif/styles.c
:100644 100644 8f99ad7... 7389ba9... M src/intersect.c
:100644 100644 c23ae8b... 462285d... M src/main.c
:100644 100644 9ab9f53... 2e471d0... M src/misc.c
:100644 100644 13863c1... 09cb6ab... M src/mymem.c
:100644 100644 fdfd7e6... 4e36640... M src/mymem.h
:100644 100644 459b08a... 4a26bc9... M src/netlist.c
:100644 100644 c9d96c8... a2808ad... M src/parse_l.l
:100644 100644 f4fc367... 7aa7b80... M src/parse_y.y
:100644 100644 67a0efc... 3c5ede1... M src/rats.c
:100644 100644 98b9ade... 8defaf4... M src/remove.c
:100644 100644 dc01153... 7af4358... M src/report.c
:100644 100644 68ea8ff... 5226c53... M src/undo.c
commit 277f9b937180093f38f2cdc2abc5a57ba22cb610
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Convet some "safe" usage of MyStrdup to plain strdup
These cases are ones where we know the caller will not risk
passing a NULL string to duplicate.
:100644 100644 9e1370b... f5e043a... M src/action.c
:100644 100644 f9d6f5a... c69fc39... M src/buffer.c
:100644 100644 c8244ed... ee831b9... M src/copy.c
:100644 100644 15c0099... 735f20f... M src/create.c
:100644 100644 8cbd95d... 5a926f8... M src/file.c
:100644 100644 bd9fcee... 4f7f5b8... M src/fontmode.c
:100644 100644 923e0ee... c23ae8b... M src/main.c
:100644 100644 34b18cb... 9ab9f53... M src/misc.c
:100644 100644 cce6e19... cbb2e3d... M src/move.c
:100644 100644 ade8326... 459b08a... M src/netlist.c
:100644 100644 46a18c8... 67a0efc... M src/rats.c
=========
Changes
=========
commit 0e24fde9348a61c2d25bb07b0a53e47e52a2d0a5
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove My* memory allocation routines. Just use the standard APIs directly
This means the following changes:
1. Replace all calls to MyCalloc() with calls to calloc()
2. Replace all calls to MyMalloc() with calls to malloc()
3. Replace all calls to MyRealloc() with calls to realloc()
4. Replace all calls to SaveFree() with calls to free()
5a. Where the MYFREE(x) macro is used and its pointer clearing side-
effect is required, call free (x); and (x) = NULL; directly.
5b. Where the MYFREE(x) macro is used, and (x) is immediately re-
assigned, or its location free'd or zero'd, skip the (x) = NULL;
6. Replace all calls to MyStrdup() with calls to the STRDUP(x) macro,
which expands to (((x) != NULL) ? strdup (x) : NULL).
NB: The previous commit already replaced various known "safe" calls of
MyStrdup() with strdup(), when the argument is known to be non-NULL.
1,2,3 and 6. mean that we discard the following features of the
mymem.c allocators:
7. Logging messages when MEM_DEBUF defined
8. Logic to assign 1 unit of memory if 0 is requested
9. Allocation failure handling via MyFatal() -> EmergencySave()
With feedback from Stephen Ecob <sil...@gm...>
7. Is old debug code which is rarely (if ever) used. Current debug tools
such as Valgrind can do a much better job of memory debugging now.
8. This is really papering over the possibility of a caller bug, and
should never have been included in the first place.
9. This is unlikely to actually ever save someone from loosing their PCB.
diff --git a/src/action.c b/src/action.c
index f5e043a..0e035a6 100644
--- a/src/action.c
+++ b/src/action.c
@@ -5731,7 +5731,7 @@ ActionSaveTo (int argc, char **argv, int x, int y)
if (strcasecmp (function, "LayoutAs") == 0)
{
- MYFREE (PCB->Filename);
+ free (PCB->Filename);
PCB->Filename = strdup (name);
SavePCB (PCB->Filename);
return 0;
@@ -5891,7 +5891,7 @@ ActionLoadFrom (int argc, char **argv, int x, int y)
else if (strcasecmp (function, "Netlist") == 0)
{
if (PCB->Netlistname)
- SaveFree (PCB->Netlistname);
+ free (PCB->Netlistname);
PCB->Netlistname = StripWhiteSpaceAndDup (name);
FreeLibraryMemory (&PCB->NetlistLib);
if (!ImportNetlist (PCB->Netlistname))
@@ -7239,7 +7239,7 @@ ActionElementSetAttr (int argc, char **argv, int x, int y)
if (attr && value)
{
- MYFREE (attr->value);
+ free (attr->value);
attr->value = strdup (value);
}
if (attr && ! value)
diff --git a/src/buffer.c b/src/buffer.c
index c69fc39..4447c30 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -953,7 +953,7 @@ SmashBufferElement (BufferTypePtr Buffer)
line->Point2.X, line->Point2.Y,
line->Thickness, 0, NoFlags ());
if (line)
- line->Number = MyStrdup (NAMEONPCB_NAME (element), "SmashBuffer");
+ line->Number = STRDUP (NAMEONPCB_NAME (element));
}
END_LOOP;
ARC_LOOP (element);
@@ -991,11 +991,11 @@ SmashBufferElement (BufferTypePtr Buffer)
pad->Point2.X, pad->Point2.Y,
pad->Thickness, pad->Clearance, NoFlags ());
if (line)
- line->Number = MyStrdup (pad->Number, "SmashBuffer");
+ line->Number = STRDUP (pad->Number);
}
END_LOOP;
FreeElementMemory (element);
- SaveFree (element);
+ free (element);
return (true);
}
@@ -1216,7 +1216,7 @@ LoadLayoutToBuffer (BufferTypePtr Buffer, char *Filename)
{
/* clear data area and replace pointer */
ClearBuffer (Buffer);
- SaveFree (Buffer->Data);
+ free (Buffer->Data);
Buffer->Data = newPCB->Data;
newPCB->Data = NULL;
Buffer->X = newPCB->CursorX;
diff --git a/src/command.c b/src/command.c
index b41263b..5c2b985 100644
--- a/src/command.c
+++ b/src/command.c
@@ -297,7 +297,7 @@ CommandLoadNetlist (int argc, char **argv, int x, int y)
return (1);
}
if (PCB->Netlistname)
- SaveFree (PCB->Netlistname);
+ free (PCB->Netlistname);
PCB->Netlistname = StripWhiteSpaceAndDup (filename);
free (name);
return (0);
diff --git a/src/create.c b/src/create.c
index 735f20f..538ea0d 100644
--- a/src/create.c
+++ b/src/create.c
@@ -80,7 +80,7 @@ DataTypePtr
CreateNewBuffer (void)
{
DataTypePtr data;
- data = (DataTypePtr) MyCalloc (1, sizeof (DataType), "CreateNewBuffer()");
+ data = (DataTypePtr) calloc (1, sizeof (DataType));
data->pcb = (void *) PCB;
return data;
}
@@ -136,7 +136,7 @@ CreateNewPCB (bool SetDefaultNames)
int i;
/* allocate memory, switch all layers on and copy resources */
- ptr = MyCalloc (1, sizeof (PCBType), "CreateNewPCB()");
+ ptr = calloc (1, sizeof (PCBType));
ptr->Data = CreateNewBuffer ();
ptr->Data->pcb = (void *) ptr;
@@ -259,7 +259,7 @@ CreateNewVia (DataTypePtr Data,
0.01 * Via->DrillingHole, 0.01 * DrillingHole);
}
- Via->Name = MyStrdup (Name, "CreateNewVia()");
+ Via->Name = STRDUP (Name);
Via->Flags = Flags;
CLEAR_FLAG (WARNFLAG, Via);
SET_FLAG (VIAFLAG, Via);
@@ -704,8 +704,7 @@ CreateNewArcInElement (ElementTypePtr Element,
if (Element->ArcN >= Element->ArcMax)
{
Element->ArcMax += STEP_ELEMENTARC;
- arc = MyRealloc (arc, Element->ArcMax * sizeof (ArcType),
- "CreateNewArcInElement()");
+ arc = realloc (arc, Element->ArcMax * sizeof (ArcType));
Element->Arc = arc;
memset (arc + Element->ArcN, 0, STEP_ELEMENTARC * sizeof (ArcType));
}
@@ -751,8 +750,7 @@ CreateNewLineInElement (ElementTypePtr Element,
if (Element->LineN >= Element->LineMax)
{
Element->LineMax += STEP_ELEMENTLINE;
- line = MyRealloc (line, Element->LineMax * sizeof (LineType),
- "CreateNewLineInElement()");
+ line = realloc (line, Element->LineMax * sizeof (LineType));
Element->Line = line;
memset (line + Element->LineN, 0, STEP_ELEMENTLINE * sizeof (LineType));
}
@@ -787,8 +785,8 @@ CreateNewPin (ElementTypePtr Element,
pin->Thickness = Thickness;
pin->Clearance = Clearance;
pin->Mask = Mask;
- pin->Name = MyStrdup (Name, "CreateNewPin()");
- pin->Number = MyStrdup (Number, "CreateNewPin()");
+ pin->Name = STRDUP (Name);
+ pin->Number = STRDUP (Number);
pin->Flags = Flags;
CLEAR_FLAG (WARNFLAG, pin);
SET_FLAG (PINFLAG, pin);
@@ -874,8 +872,8 @@ CreateNewPad (ElementTypePtr Element,
pad->Thickness = Thickness;
pad->Clearance = Clearance;
pad->Mask = Mask;
- pad->Name = MyStrdup (Name, "CreateNewPad()");
- pad->Number = MyStrdup (Number, "CreateNewPad()");
+ pad->Name = STRDUP (Name);
+ pad->Number = STRDUP (Number);
pad->Flags = Flags;
CLEAR_FLAG (WARNFLAG, pad);
pad->ID = ID++;
@@ -892,13 +890,13 @@ AddTextToElement (TextTypePtr Text, FontTypePtr PCBFont,
LocationType X, LocationType Y,
BYTE Direction, char *TextString, int Scale, FlagType Flags)
{
- MYFREE (Text->TextString);
+ free (Text->TextString);
+ Text->TextString = (TextString && *TextString) ? strdup (TextString) : NULL;
Text->X = X;
Text->Y = Y;
Text->Direction = Direction;
Text->Flags = Flags;
Text->Scale = Scale;
- Text->TextString = (TextString && *TextString) ? strdup (TextString) : NULL;
/* calculate size of the bounding box */
SetTextBoundingBox (PCBFont, Text);
@@ -919,8 +917,7 @@ CreateNewLineInSymbol (SymbolTypePtr Symbol,
if (Symbol->LineN >= Symbol->LineMax)
{
Symbol->LineMax += STEP_SYMBOLLINE;
- line = MyRealloc (line, Symbol->LineMax * sizeof (LineType),
- "CreateNewLineInSymbol()");
+ line = realloc (line, Symbol->LineMax * sizeof (LineType));
Symbol->Line = line;
memset (line + Symbol->LineN, 0, STEP_SYMBOLLINE * sizeof (LineType));
}
@@ -994,7 +991,7 @@ CreateNewConnection (LibraryMenuTypePtr net, char *conn)
{
LibraryEntryTypePtr entry = GetLibraryEntryMemory (net);
- entry->ListEntry = MyStrdup (conn, "CreateNewConnection()");
+ entry->ListEntry = STRDUP (conn);
return (entry);
}
@@ -1007,12 +1004,10 @@ CreateNewAttribute (AttributeListTypePtr list, char *name, char *value)
if (list->Number >= list->Max)
{
list->Max += 10;
- list->List = MyRealloc (list->List,
- list->Max * sizeof (AttributeType),
- "CreateNewAttribute");
+ list->List = realloc (list->List, list->Max * sizeof (AttributeType));
}
- list->List[list->Number].name = MyStrdup (name, "CreateNewAttribute");
- list->List[list->Number].value = MyStrdup (value, "CreateNewAttribute");
+ list->List[list->Number].name = STRDUP (name);
+ list->List[list->Number].value = STRDUP (value);
list->Number++;
return &list->List[list->Number - 1];
}
diff --git a/src/drill.c b/src/drill.c
index 738ed18..1f1d770 100644
--- a/src/drill.c
+++ b/src/drill.c
@@ -126,7 +126,7 @@ GetDrillInfo (DataTypePtr top)
bool DrillFound = false;
bool NewDrill;
- AllDrills = MyCalloc (1, sizeof (DrillInfoType), "GetAllDrillInfo()");
+ AllDrills = calloc (1, sizeof (DrillInfoType));
ALLPIN_LOOP (top);
{
if (!DrillFound)
@@ -235,10 +235,9 @@ RoundDrillInfo (DrillInfoTypePtr d, int roundto)
= d->Drill[i].ElementN + d->Drill[i+1].ElementN;
if (d->Drill[i].ElementMax)
{
- d->Drill[i].Element = MyRealloc (d->Drill[i].Element,
- d->Drill[i].ElementMax *
- sizeof(ElementTypePtr),
- "RoundDrillInfo");
+ d->Drill[i].Element = realloc (d->Drill[i].Element,
+ d->Drill[i].ElementMax *
+ sizeof (ElementTypePtr));
for (ei = 0; ei < d->Drill[i+1].ElementN; ei++)
{
@@ -250,16 +249,18 @@ RoundDrillInfo (DrillInfoTypePtr d, int roundto)
= d->Drill[i + 1].Element[ei];
}
}
- MYFREE (d->Drill[i + 1].Element);
+ free (d->Drill[i + 1].Element);
+ d->Drill[i + 1].Element = NULL;
d->Drill[i].PinMax = d->Drill[i].PinN + d->Drill[i + 1].PinN;
- d->Drill[i].Pin = MyRealloc (d->Drill[i].Pin,
- d->Drill[i].PinMax *
- sizeof (PinTypePtr), "RoundDrillInfo");
+ d->Drill[i].Pin = realloc (d->Drill[i].Pin,
+ d->Drill[i].PinMax *
+ sizeof (PinTypePtr));
memcpy (d->Drill[i].Pin + d->Drill[i].PinN, d->Drill[i + 1].Pin,
d->Drill[i + 1].PinN * sizeof (PinTypePtr));
d->Drill[i].PinN += d->Drill[i + 1].PinN;
- MYFREE (d->Drill[i + 1].Pin);
+ free (d->Drill[i + 1].Pin);
+ d->Drill[i + 1].Pin = NULL;
d->Drill[i].PinCount += d->Drill[i + 1].PinCount;
d->Drill[i].ViaCount += d->Drill[i + 1].ViaCount;
@@ -285,10 +286,10 @@ FreeDrillInfo (DrillInfoTypePtr Drills)
{
DRILL_LOOP (Drills);
{
- MYFREE (drill->Element);
- MYFREE (drill->Pin);
+ free (drill->Element);
+ free (drill->Pin);
}
END_LOOP;
- MYFREE (Drills->Drill);
- SaveFree (Drills);
+ free (Drills->Drill);
+ free (Drills);
}
diff --git a/src/file.c b/src/file.c
index 5a926f8..bfe0de0 100644
--- a/src/file.c
+++ b/src/file.c
@@ -319,7 +319,7 @@ SavePCB (char *Filename)
* it might be identical to 'PCB->Filename'
*/
copy = strdup (Filename);
- SaveFree (PCB->Filename);
+ free (PCB->Filename);
PCB->Filename = copy;
SetChangedFlag (false);
}
@@ -1223,7 +1223,7 @@ LoadNewlibFootprintsFromDir(char *libpath, char *toppath)
* entry->ListEntry points to fp name itself.
*/
len = strlen(subdir) + strlen("/") + strlen(subdirentry->d_name) + 1;
- entry->AllocatedMemory = MyCalloc (1, len, "ParseLibraryTree()");
+ entry->AllocatedMemory = calloc (1, len);
strcat (entry->AllocatedMemory, subdir);
strcat (entry->AllocatedMemory, PCB_DIR_SEPARATOR_S);
@@ -1382,7 +1382,7 @@ ReadLibraryContents (void)
/* First load the M4 stuff. The variable Settings.LibraryPath
* points to it.
*/
- MYFREE (command);
+ free (command);
command = EvaluateFilename (Settings.LibraryContentsCommand,
Settings.LibraryPath, Settings.LibraryFilename,
NULL);
@@ -1447,8 +1447,7 @@ ReadLibraryContents (void)
/* create the list entry */
len = strlen (EMPTY (entry->Value)) +
strlen (EMPTY (entry->Description)) + 4;
- entry->ListEntry = MyCalloc (len, sizeof (char),
- "ReadLibraryDescription()");
+ entry->ListEntry = calloc (len, sizeof (char));
sprintf (entry->ListEntry,
"%s, %s", EMPTY (entry->Value),
EMPTY (entry->Description));
@@ -1507,7 +1506,7 @@ ReadNetlist (char *filename)
else
{
used_popen = 1;
- MYFREE (command);
+ free (command);
command = EvaluateFilename (Settings.RatCommand,
Settings.RatPath, filename, NULL);
diff --git a/src/find.c b/src/find.c
index 8d468bb..3176357 100644
--- a/src/find.c
+++ b/src/find.c
@@ -569,19 +569,26 @@ FreeLayoutLookupMemory (void)
for (i = 0; i < max_copper_layer; i++)
{
- MYFREE (LineList[i].Data);
- MYFREE (ArcList[i].Data);
- MYFREE (PolygonList[i].Data);
+ free (LineList[i].Data);
+ LineList[i].Data = NULL;
+ free (ArcList[i].Data);
+ ArcList[i].Data = NULL;
+ free (PolygonList[i].Data);
+ PolygonList[i].Data = NULL;
}
- MYFREE (PVList.Data);
- MYFREE (RatList.Data);
+ free (PVList.Data);
+ PVList.Data = NULL;
+ free (RatList.Data);
+ RatList.Data = NULL;
}
void
FreeComponentLookupMemory (void)
{
- MYFREE (PadList[0].Data);
- MYFREE (PadList[1].Data);
+ free (PadList[0].Data);
+ PadList[0].Data = NULL;
+ free (PadList[1].Data);
+ PadList[1].Data = NULL;
}
/* ---------------------------------------------------------------------------
@@ -608,9 +615,7 @@ InitComponentLookup (void)
for (i = 0; i < 2; i++)
{
/* allocate memory for working list */
- PadList[i].Data =
- (void **) MyCalloc (NumberOfPads[i], sizeof (PadTypePtr),
- "InitComponentLookup()");
+ PadList[i].Data = calloc (NumberOfPads[i], sizeof (PadTypePtr));
/* clear some struct members */
PadList[i].Location = 0;
@@ -637,16 +642,12 @@ InitLayoutLookup (void)
if (layer->LineN)
{
/* allocate memory for line pointer lists */
- LineList[i].Data =
- (void **) MyCalloc (layer->LineN, sizeof (LineTypePtr),
- "InitLayoutLookup()");
+ LineList[i].Data = calloc (layer->LineN, sizeof (LineTypePtr));
LineList[i].Size = layer->LineN;
}
if (layer->ArcN)
{
- ArcList[i].Data =
- (void **) MyCalloc (layer->ArcN, sizeof (ArcTypePtr),
- "InitLayoutLookup()");
+ ArcList[i].Data = calloc (layer->ArcN, sizeof (ArcTypePtr));
ArcList[i].Size = layer->ArcN;
}
@@ -654,9 +655,7 @@ InitLayoutLookup (void)
/* allocate memory for polygon list */
if (layer->PolygonN)
{
- PolygonList[i].Data = (void **) MyCalloc (layer->PolygonN,
- sizeof (PolygonTypePtr),
- "InitLayoutLookup()");
+ PolygonList[i].Data = calloc (layer->PolygonN, sizeof (PolygonTypePtr));
PolygonList[i].Size = layer->PolygonN;
}
@@ -681,15 +680,13 @@ InitLayoutLookup (void)
else
TotalV = 0;
/* allocate memory for 'new PV to check' list and clear struct */
- PVList.Data = (void **) MyCalloc (TotalP + TotalV, sizeof (PinTypePtr),
- "InitLayoutLookup()");
+ PVList.Data = calloc (TotalP + TotalV, sizeof (PinTypePtr));
PVList.Size = TotalP + TotalV;
PVList.Location = 0;
PVList.DrawLocation = 0;
PVList.Number = 0;
/* Initialize ratline data */
- RatList.Data = (void **) MyCalloc (PCB->Data->RatN, sizeof (RatTypePtr),
- "InitLayoutLookup()");
+ RatList.Data = calloc (PCB->Data->RatN, sizeof (RatTypePtr));
RatList.Size = PCB->Data->RatN;
RatList.Location = 0;
RatList.DrawLocation = 0;
diff --git a/src/hid/common/flags.c b/src/hid/common/flags.c
index e4a566d..30859fb 100644
--- a/src/hid/common/flags.c
+++ b/src/hid/common/flags.c
@@ -110,7 +110,7 @@ hid_get_flag (const char *name)
if (nbuf < (cp - name + 1))
{
nbuf = cp - name + 10;
- buf = MyRealloc (buf, nbuf, "hid_get_flag");
+ buf = realloc (buf, nbuf);
}
memcpy (buf, name, cp - name);
buf[cp - name] = 0;
diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 1f6341b..85e01f3 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -230,9 +230,7 @@ SetAppLayer (int l)
{
int prev = n_layerapps;
n_layerapps = l + 1;
- layerapps =
- MyRealloc (layerapps, n_layerapps * sizeof (Apertures),
- "SetAppLayer");
+ layerapps = realloc (layerapps, n_layerapps * sizeof (Apertures));
curapp = layerapps + prev;
while (curapp < layerapps + n_layerapps)
{
@@ -364,7 +362,7 @@ gerber_do_export (HID_Attr_Val * options)
all_layers = options[HA_all_layers].int_value;
i = strlen (fnbase);
- filename = MyRealloc (filename, i + 40, "gerber");
+ filename = realloc (filename, i + 40);
strcpy (filename, fnbase);
strcat (filename, ".");
filesuff = filename + strlen (filename);
diff --git a/src/hid/gtk/gtkhid-gdk.c b/src/hid/gtk/gtkhid-gdk.c
index 461b779..5cd969c 100644
--- a/src/hid/gtk/gtkhid-gdk.c
+++ b/src/hid/gtk/gtkhid-gdk.c
@@ -133,8 +133,7 @@ ghid_draw_grid (void)
if (n > npoints)
{
npoints = n + 10;
- points =
- MyRealloc (points, npoints * sizeof (GdkPoint), "gtk_draw_grid");
+ points = realloc (points, npoints * sizeof (GdkPoint));
}
n = 0;
for (x = x1; x <= x2; x += PCB->Grid)
@@ -601,8 +600,7 @@ ghid_fill_polygon (hidGC gc, int n_coords, int *x, int *y)
if (npoints < n_coords)
{
npoints = n_coords + 1;
- points = MyRealloc (points,
- npoints * sizeof (GdkPoint), (char *) __FUNCTION__);
+ points = realloc (points, npoints * sizeof (GdkPoint));
}
for (i = 0; i < n_coords; i++)
{
diff --git a/src/hid/gtk/gui-dialog-size.c b/src/hid/gtk/gui-dialog-size.c
index 2f49f06..16caff3 100644
--- a/src/hid/gtk/gui-dialog-size.c
+++ b/src/hid/gtk/gui-dialog-size.c
@@ -308,7 +308,7 @@ ghid_route_style_dialog (gint index, RouteStyleType * temp_rst)
if (index < NUM_STYLES && !set_temp1 && !set_temp2)
{
string = ghid_entry_get_text (sd->name_entry);
- SaveFree (rst->Name);
+ free (rst->Name);
rst->Name = StripWhiteSpaceAndDup (string);
pcb_use_route_style (rst);
SetChangedFlag (true);
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index 9c30a93..90977e2 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -303,9 +303,7 @@ note_toggle_flag (const char *actionname, MenuFlagType type, char *name)
if (n_tflags >= max_tflags)
{
max_tflags += 20;
- tflags =
- MyRealloc (tflags, max_tflags * sizeof (ToggleFlagType),
- __FUNCTION__);
+ tflags = realloc (tflags, max_tflags * sizeof (ToggleFlagType));
}
tflags[n_tflags].actionname = strdup (actionname);
tflags[n_tflags].flagname = name;
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index 76dce1a..5f497a8 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -2236,8 +2236,7 @@ draw_grid ()
if (n > npoints)
{
npoints = n + 10;
- points =
- MyRealloc (points, npoints * sizeof (XPoint), "lesstif_draw_grid");
+ points = realloc (points, npoints * sizeof (XPoint));
}
n = 0;
prevx = 0;
@@ -3675,7 +3674,7 @@ lesstif_show_item (void *item)
if (!mainwind)
return;
- pd = (PinoutData *) MyCalloc (1, sizeof (PinoutData), "lesstif_show_item");
+ pd = calloc (1, sizeof (PinoutData));
pd->item = item;
diff --git a/src/hid/lesstif/menu.c b/src/hid/lesstif/menu.c
index aca306d..6baa016 100644
--- a/src/hid/lesstif/menu.c
+++ b/src/hid/lesstif/menu.c
@@ -672,9 +672,7 @@ note_widget_flag (Widget w, char *type, char *name)
if (n_wflags >= max_wflags)
{
max_wflags += 20;
- wflags =
- MyRealloc (wflags, max_wflags * sizeof (WidgetFlagType),
- __FUNCTION__);
+ wflags = realloc (wflags, max_wflags * sizeof (WidgetFlagType));
}
wflags[n_wflags].w = w;
wflags[n_wflags].flagname = name;
diff --git a/src/hid/lesstif/styles.c b/src/hid/lesstif/styles.c
index d3dcdaa..9b67d0f 100644
--- a/src/hid/lesstif/styles.c
+++ b/src/hid/lesstif/styles.c
@@ -452,8 +452,7 @@ lesstif_insert_style_buttons (Widget menu)
num_style_buttons++;
s = num_style_buttons * sizeof (StyleButtons);
- style_button_list =
- (StyleButtons *) MyRealloc (style_button_list, s, __FUNCTION__);
+ style_button_list = realloc (style_button_list, s);
sb = style_button_list + num_style_buttons - 1;
for (i = 0; i < NUM_STYLES; i++)
diff --git a/src/intersect.c b/src/intersect.c
index 8f99ad7..7389ba9 100644
--- a/src/intersect.c
+++ b/src/intersect.c
@@ -97,8 +97,7 @@ createSortedYList (BoxListTypePtr boxlist)
int i, n;
/* create sorted list of Y coordinates */
yCoords.size = 2 * boxlist->BoxN;
- yCoords.p = MyCalloc (yCoords.size, sizeof (*yCoords.p),
- "createSortedYList");
+ yCoords.p = calloc (yCoords.size, sizeof (*yCoords.p));
for (i = 0; i < boxlist->BoxN; i++)
{
yCoords.p[2 * i] = boxlist->Box[i].Y1;
@@ -124,7 +123,7 @@ createSegmentTree (LocationType * yCoords, int N)
int i;
/* size is twice the nearest larger power of 2 */
st.size = 2 * nextpwrof2 (N);
- st.nodes = MyCalloc (st.size, sizeof (*st.nodes), "createSegmentTree");
+ st.nodes = calloc (st.size, sizeof (*st.nodes));
/* initialize the rightmost leaf node */
st.nodes[st.size - 1].left = (N > 0) ? yCoords[--N] : 10;
st.nodes[st.size - 1].right = st.nodes[st.size - 1].left + 1;
@@ -235,10 +234,8 @@ ComputeUnionArea (BoxListTypePtr boxlist)
segtree = createSegmentTree (yCoords.p, yCoords.size);
free (yCoords.p);
/* create sorted list of left and right X coordinates of rectangles */
- rectLeft = MyCalloc (boxlist->BoxN, sizeof (*rectLeft),
- "ComputeUnionArea(1)");
- rectRight = MyCalloc (boxlist->BoxN, sizeof (*rectRight),
- "ComputeUnionArea(2)");
+ rectLeft = calloc (boxlist->BoxN, sizeof (*rectLeft));
+ rectRight = calloc (boxlist->BoxN, sizeof (*rectRight));
for (i = 0; i < boxlist->BoxN; i++)
{
assert (boxlist->Box[i].X1 <= boxlist->Box[i].X2);
diff --git a/src/main.c b/src/main.c
index c23ae8b..462285d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -226,7 +226,7 @@ usage_hid (HID * h)
exporter = NULL;
}
- note = (UsageNotes *) MyMalloc (sizeof (UsageNotes), "usage_hid");
+ note = malloc (sizeof (UsageNotes));
note->next = usage_notes;
note->seen = attributes;
usage_notes = note;
diff --git a/src/misc.c b/src/misc.c
index 9ab9f53..2e471d0 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -962,13 +962,13 @@ ExpandFilename (char *Dirname, char *Filename)
DSClearString (&answer);
if (Dirname)
{
- command = MyCalloc (strlen (Filename) + strlen (Dirname) + 7,
- sizeof (char), "ExpandFilename()");
+ command = calloc (strlen (Filename) + strlen (Dirname) + 7,
+ sizeof (char));
sprintf (command, "echo %s/%s", Dirname, Filename);
}
else
{
- command = MyCalloc (strlen (Filename) + 6, sizeof (char), "Expand()");
+ command = calloc (strlen (Filename) + 6, sizeof (char));
sprintf (command, "echo %s", Filename);
}
@@ -984,13 +984,13 @@ ExpandFilename (char *Dirname, char *Filename)
DSAddCharacter (&answer, c);
}
- SaveFree (command);
+ free (command);
return (pclose (pipe) ? NULL : answer.Data);
}
/* couldn't be expanded by the shell */
PopenErrorMessage (command);
- SaveFree (command);
+ free (command);
return (NULL);
}
@@ -1904,7 +1904,7 @@ AttributePutToList (AttributeListType *list, const char *name, const char *value
if (strcmp (name, list->List[i].name) == 0)
{
free (list->List[i].value);
- list->List[i].value = MyStrdup (value, "AttributePutToList");
+ list->List[i].value = STRDUP (value);
return 1;
}
}
@@ -1920,8 +1920,8 @@ AttributePutToList (AttributeListType *list, const char *name, const char *value
/* Now add the new attribute. */
i = list->Number;
- list->List[i].name = MyStrdup (name, "AttributePutToList");
- list->List[i].value = MyStrdup (value, "AttributePutToList");
+ list->List[i].name = STRDUP (name);
+ list->List[i].value = STRDUP (value);
list->Number ++;
return 0;
}
diff --git a/src/mymem.c b/src/mymem.c
index 13863c1..09cb6ab 100644
--- a/src/mymem.c
+++ b/src/mymem.c
@@ -69,9 +69,8 @@ GetRubberbandMemory (void)
Crosshair.AttachedObject.RubberbandMax)
{
Crosshair.AttachedObject.RubberbandMax += STEP_RUBBERBAND;
- ptr = MyRealloc (ptr,
- Crosshair.AttachedObject.RubberbandMax *
- sizeof (RubberbandType), "GetRubberbandMemory()");
+ ptr = realloc (ptr, Crosshair.AttachedObject.RubberbandMax *
+ sizeof (RubberbandType));
Crosshair.AttachedObject.Rubberband = ptr;
memset (ptr + Crosshair.AttachedObject.RubberbandN, 0,
STEP_RUBBERBAND * sizeof (RubberbandType));
@@ -88,8 +87,7 @@ GetPointerMemory (PointerListTypePtr list)
if (list->PtrN >= list->PtrMax)
{
list->PtrMax = STEP_POINT + (2 * list->PtrMax);
- ptr = MyRealloc (ptr, list->PtrMax * sizeof (void *),
- "GetPointerMemory()");
+ ptr = realloc (ptr, list->PtrMax * sizeof (void *));
list->Ptr = ptr;
memset (ptr + list->PtrN, 0,
(list->PtrMax - list->PtrN) * sizeof (void *));
@@ -100,7 +98,7 @@ GetPointerMemory (PointerListTypePtr list)
void
FreePointerListMemory (PointerListTypePtr list)
{
- MYFREE (list->Ptr);
+ free (list->Ptr);
memset (list, 0, sizeof (PointerListType));
}
@@ -116,8 +114,7 @@ GetBoxMemory (BoxListTypePtr Boxes)
if (Boxes->BoxN >= Boxes->BoxMax)
{
Boxes->BoxMax = STEP_POINT + (2 * Boxes->BoxMax);
- box = MyRealloc (box, Boxes->BoxMax * sizeof (BoxType),
- "GetBoxMemory()");
+ box = realloc (box, Boxes->BoxMax * sizeof (BoxType));
Boxes->Box = box;
memset (box + Boxes->BoxN, 0,
(Boxes->BoxMax - Boxes->BoxN) * sizeof (BoxType));
@@ -138,8 +135,7 @@ GetConnectionMemory (NetTypePtr Net)
if (Net->ConnectionN >= Net->ConnectionMax)
{
Net->ConnectionMax += STEP_POINT;
- con = MyRealloc (con, Net->ConnectionMax * sizeof (ConnectionType),
- "GetConnectionMemory()");
+ con = realloc (con, Net->ConnectionMax * sizeof (ConnectionType));
Net->Connection = con;
memset (con + Net->ConnectionN, 0,
STEP_POINT * sizeof (ConnectionType));
@@ -159,8 +155,7 @@ GetNetMemory (NetListTypePtr Netlist)
if (Netlist->NetN >= Netlist->NetMax)
{
Netlist->NetMax += STEP_POINT;
- net = MyRealloc (net, Netlist->NetMax * sizeof (NetType),
- "GetNetMemory()");
+ net = realloc (net, Netlist->NetMax * sizeof (NetType));
Netlist->Net = net;
memset (net + Netlist->NetN, 0, STEP_POINT * sizeof (NetType));
}
@@ -179,9 +174,8 @@ GetNetListMemory (NetListListTypePtr Netlistlist)
if (Netlistlist->NetListN >= Netlistlist->NetListMax)
{
Netlistlist->NetListMax += STEP_POINT;
- netlist = MyRealloc
- (netlist, Netlistlist->NetListMax * sizeof (NetListType),
- "GetNetListMemory()");
+ netlist = realloc (netlist,
+ Netlistlist->NetListMax * sizeof (NetListType));
Netlistlist->NetList = netlist;
memset (netlist + Netlistlist->NetListN, 0,
STEP_POINT * sizeof (NetListType));
@@ -211,8 +205,7 @@ GetPinMemory (ElementTypePtr Element)
END_LOOP;
}
Element->PinMax += STEP_PIN;
- pin = MyRealloc (pin, Element->PinMax * sizeof (PinType),
- "GetPinMemory()");
+ pin = realloc (pin, Element->PinMax * sizeof (PinType));
Element->Pin = pin;
memset (pin + Element->PinN, 0, STEP_PIN * sizeof (PinType));
if (onBoard)
@@ -249,8 +242,7 @@ GetPadMemory (ElementTypePtr Element)
END_LOOP;
}
Element->PadMax += STEP_PAD;
- pad = MyRealloc (pad, Element->PadMax * sizeof (PadType),
- "GetPadMemory()");
+ pad = realloc (pad, Element->PadMax * sizeof (PadType));
Element->Pad = pad;
memset (pad + Element->PadN, 0, STEP_PAD * sizeof (PadType));
if (onBoard)
@@ -279,8 +271,7 @@ GetViaMemory (DataTypePtr Data)
Data->ViaMax += STEP_VIA;
if (Data->via_tree)
r_destroy_tree (&Data->via_tree);
- via = MyRealloc (via, Data->ViaMax * sizeof (PinType),
- "GetViaMemory()");
+ via = realloc (via, Data->ViaMax * sizeof (PinType));
Data->Via = via;
memset (via + Data->ViaN, 0, STEP_VIA * sizeof (PinType));
Data->via_tree = r_create_tree (NULL, 0, 0);
@@ -308,8 +299,7 @@ GetRatMemory (DataTypePtr Data)
/* all of the pointers move, so rebuild the whole tree */
if (Data->rat_tree)
r_destroy_tree (&Data->rat_tree);
- rat = MyRealloc (rat, Data->RatMax * sizeof (RatType),
- "GetRatMemory()");
+ rat = realloc (rat, Data->RatMax * sizeof (RatType));
Data->Rat = rat;
memset (rat + Data->RatN, 0, STEP_RAT * sizeof (RatType));
Data->rat_tree = r_create_tree (NULL, 0, 0);
@@ -337,8 +327,7 @@ GetLineMemory (LayerTypePtr Layer)
/* all of the pointers move, so rebuild the whole tree */
if (Layer->line_tree)
r_destroy_tree (&Layer->line_tree);
- line = MyRealloc (line, Layer->LineMax * sizeof (LineType),
- "GetLineMemory()");
+ line = realloc (line, Layer->LineMax * sizeof (LineType));
Layer->Line = line;
memset (line + Layer->LineN, 0, STEP_LINE * sizeof (LineType));
Layer->line_tree = r_create_tree (NULL, 0, 0);
@@ -365,8 +354,7 @@ GetArcMemory (LayerTypePtr Layer)
Layer->ArcMax += STEP_ARC;
if (Layer->arc_tree)
r_destroy_tree (&Layer->arc_tree);
- arc = MyRealloc (arc, Layer->ArcMax * sizeof (ArcType),
- "GetArcMemory()");
+ arc = realloc (arc, Layer->ArcMax * sizeof (ArcType));
Layer->Arc = arc;
memset (arc + Layer->ArcN, 0, STEP_ARC * sizeof (ArcType));
Layer->arc_tree = r_create_tree (NULL, 0, 0);
@@ -393,8 +381,7 @@ GetTextMemory (LayerTypePtr Layer)
Layer->TextMax += STEP_TEXT;
if (Layer->text_tree)
r_destroy_tree (&Layer->text_tree);
- text = MyRealloc (text, Layer->TextMax * sizeof (TextType),
- "GetTextMemory()");
+ text = realloc (text, Layer->TextMax * sizeof (TextType));
Layer->Text = text;
memset (text + Layer->TextN, 0, STEP_TEXT * sizeof (TextType));
Layer->text_tree = r_create_tree (NULL, 0, 0);
@@ -421,8 +408,7 @@ GetPolygonMemory (LayerTypePtr Layer)
Layer->PolygonMax += STEP_POLYGON;
if (Layer->polygon_tree)
r_destroy_tree (&Layer->polygon_tree);
- polygon = MyRealloc (polygon, Layer->PolygonMax * sizeof (PolygonType),
- "GetPolygonMemory()");
+ polygon = realloc (polygon, Layer->PolygonMax * sizeof (PolygonType));
Layer->Polygon = polygon;
memset (polygon + Layer->PolygonN, 0,
STEP_POLYGON * sizeof (PolygonType));
@@ -449,8 +435,7 @@ GetPointMemoryInPolygon (PolygonTypePtr Polygon)
if (Polygon->PointN >= Polygon->PointMax)
{
Polygon->PointMax += STEP_POLYGONPOINT;
- points = MyRealloc (points, Polygon->PointMax * sizeof (PointType),
- "GetPointMemoryInPolygon()");
+ points = realloc (points, Polygon->PointMax * sizeof (PointType));
Polygon->Points = points;
memset (points + Polygon->PointN, 0,
STEP_POLYGONPOINT * sizeof (PointType));
@@ -471,8 +456,7 @@ GetHoleIndexMemoryInPolygon (PolygonTypePtr Polygon)
if (Polygon->HoleIndexN >= Polygon->HoleIndexMax)
{
Polygon->HoleIndexMax += STEP_POLYGONHOLEINDEX;
- holeindex = MyRealloc (holeindex, Polygon->HoleIndexMax * sizeof (int),
- "GetHoleIndexMemoryInPolygon()");
+ holeindex = realloc (holeindex, Polygon->HoleIndexMax * sizeof (int));
Polygon->HoleIndex = holeindex;
memset (holeindex + Polygon->HoleIndexN, 0,
STEP_POLYGONHOLEINDEX * sizeof (int));
@@ -495,8 +479,7 @@ GetElementMemory (DataTypePtr Data)
Data->ElementMax += STEP_ELEMENT;
if (Data->element_tree)
r_destroy_tree (&Data->element_tree);
- element = MyRealloc (element, Data->ElementMax * sizeof (ElementType),
- "GetElementMemory()");
+ element = realloc (element, Data->ElementMax * sizeof (ElementType));
Data->Element = element;
memset (element + Data->ElementN, 0,
STEP_ELEMENT * sizeof (ElementType));
@@ -545,8 +528,7 @@ GetLibraryMenuMemory (LibraryTypePtr lib)
if (lib->MenuN >= lib->MenuMax)
{
lib->MenuMax += STEP_LIBRARYMENU;
- menu = MyRealloc (menu, lib->MenuMax * sizeof (LibraryMenuType),
- "GetLibraryMenuMemory()");
+ menu = realloc (menu, lib->MenuMax * sizeof (LibraryMenuType));
lib->Menu = menu;
memset (menu + lib->MenuN, 0,
STEP_LIBRARYMENU * sizeof (LibraryMenuType));
@@ -566,8 +548,7 @@ GetLibraryEntryMemory (LibraryMenuTypePtr Menu)
if (Menu->EntryN >= Menu->EntryMax)
{
Menu->EntryMax += STEP_LIBRARYENTRY;
- entry = MyRealloc (entry, Menu->EntryMax * sizeof (LibraryEntryType),
- "GetLibraryEntryMemory()");
+ entry = realloc (entry, Menu->EntryMax * sizeof (LibraryEntryType));
Menu->Entry = entry;
memset (entry + Menu->EntryN, 0,
STEP_LIBRARYENTRY * sizeof (LibraryEntryType));
@@ -589,9 +570,8 @@ GetDrillElementMemory (DrillTypePtr Drill)
if (Drill->ElementN >= Drill->ElementMax)
{
Drill->ElementMax += STEP_ELEMENT;
- element =
- MyRealloc (element, Drill->ElementMax * sizeof (ElementTypeHandle),
- "GetDrillElementMemory()");
+ element = realloc (element,
+ Drill->ElementMax * sizeof (ElementTypeHandle));
Drill->Element = element;
memset (element + Drill->ElementN, 0,
STEP_ELEMENT * sizeof (ElementTypeHandle));
@@ -613,8 +593,7 @@ GetDrillPinMemory (DrillTypePtr Drill)
if (Drill->PinN >= Drill->PinMax)
{
Drill->PinMax += STEP_POINT;
- pin = MyRealloc (pin, Drill->PinMax * sizeof (PinTypeHandle),
- "GetDrillPinMemory()");
+ pin = realloc (pin, Drill->PinMax * sizeof (PinTypeHandle));
Drill->Pin = pin;
memset (pin + Drill->PinN, 0, STEP_POINT * sizeof (PinTypeHandle));
}
@@ -633,8 +612,7 @@ GetDrillInfoDrillMemory (DrillInfoTypePtr DrillInfo)
if (DrillInfo->DrillN >= DrillInfo->DrillMax)
{
DrillInfo->DrillMax += STEP_DRILL;
- drill = MyRealloc (drill, DrillInfo->DrillMax * sizeof (DrillType),
- "GetDrillInfoDrillMemory()");
+ drill = realloc (drill, DrillInfo->DrillMax * sizeof (DrillType));
DrillInfo->Drill = drill;
memset (drill + DrillInfo->DrillN, 0, STEP_DRILL * sizeof (DrillType));
}
@@ -642,112 +620,6 @@ GetDrillInfoDrillMemory (DrillInfoTypePtr DrillInfo)
}
/* ---------------------------------------------------------------------------
- * allocates memory with error handling
- */
-void *
-MyCalloc (size_t Number, size_t Size, const char *Text)
-{
- void *p;
-
-#ifdef MEM_DEBUG
- fprintf (stderr, "MyCalloc %d by %d from %s ", Number, Size, Text);
-#endif
- /* InitComponentLookup() at least can ask for zero here, so return something
- | that can be freed.
- */
- if (Number == 0)
- Number = 1;
- if (Size == 0)
- Size = 1;
-
- if ((p = calloc (Number, Size)) == NULL)
- MyFatal ("out of memory during malloc() in '%s'()\n",
- (Text ? Text : "(unknown)"));
-#ifdef MEM_DEBUG
- fprintf (stderr, "returned 0x%x\n", p);
-#endif
- return (p);
-}
-
-void *
-MyMalloc (size_t Size, const char *Text)
-{
- void *p;
-
-#ifdef MEM_DEBUG
- fprintf (stderr, "MyMalloc %d by %d from %s ", Number, Size, Text);
-#endif
- /* avoid malloc of 0 bytes */
- if (Size == 0)
- Size = 1;
- if ((p = malloc (Size)) == NULL)
- MyFatal ("out of memory during malloc() in '%s'()\n",
- (Text ? Text : "(unknown)"));
-#ifdef MEM_DEBUG
- fprintf (stderr, "returned 0x%x\n", p);
-#endif
- return (p);
-}
-
-/* ---------------------------------------------------------------------------
- * allocates memory with error handling
- * this is a save version because BSD doesn't support the
- * handling of NULL pointers in realloc()
- */
-void *
-MyRealloc (void *Ptr, size_t Size, const char *Text)
-{
- void *p;
-
-#ifdef MEM_DEBUG
- fprintf (stderr, "0x%x Realloc to %d from %s ", Ptr, Size, Text);
-#endif
- if (Size == 0)
- Size = 1;
- p = Ptr ? realloc (Ptr, Size) : malloc (Size);
- if (!p)
- MyFatal ("out of memory during realloc() in '%s'()\n",
- (Text ? Text : "(unknown)"));
-#ifdef MEM_DEBUG
- fprintf (stderr, "returned 0x%x\n", p);
-#endif
- return (p);
-}
-
-/* ---------------------------------------------------------------------------
- * allocates memory for a new string, does some error processing
- */
-char *
-MyStrdup (const char *S, const char *Text)
-{
- char *p = NULL;
-
- /* bug-fix by Ulrich Pegelow (ul...@bi...) */
- if (S && ((p = strdup (S)) == NULL))
- MyFatal ("out of memory during g_strdup() in '%s'\n",
- (Text ? Text : "(unknown)"));
-#ifdef MEM_DEBUG
- fprintf (stderr, "g_strdup returning 0x%x\n", p);
-#endif
- return (p);
-}
-
-/* ---------------------------------------------------------------------------
- * frees memory and sets pointer to NULL
- * too troublesome for modern C compiler,
- * warning: dereferencing type-punned pointer will break strict-aliasing rules
- * Use MYFREE() macro instead
- */
-#if 0
-void
-MyFree (char **Ptr)
-{
- SaveFree (*Ptr);
- *Ptr = NULL;
-}
-#endif
-
-/* ---------------------------------------------------------------------------
* frees memory used by a polygon
*/
void
@@ -755,8 +627,8 @@ FreePolygonMemory (PolygonTypePtr Polygon)
{
if (Polygon)
{
- MYFREE (Polygon->Points);
- MYFREE (Polygon->HoleIndex);
+ free (Polygon->Points);
+ free (Polygon->HoleIndex);
if (Polygon->Clipped)
poly_Free (&Polygon->Clipped);
poly_FreeContours (&Polygon->NoHoles);
@@ -772,7 +644,7 @@ FreeBoxListMemory (BoxListTypePtr Boxlist)
{
if (Boxlist)
{
- MYFREE (Boxlist->Box);
+ free (Boxlist->Box);
memset (Boxlist, 0, sizeof (BoxListType));
}
}
@@ -790,7 +662,7 @@ FreeNetListMemory (NetListTypePtr Netlist)
FreeNetMemory (net);
}
END_LOOP;
- MYFREE (Netlist->Net);
+ free (Netlist->Net);
memset (Netlist, 0, sizeof (NetListType));
}
}
@@ -808,7 +680,7 @@ FreeNetListListMemory (NetListListTypePtr Netlistlist)
FreeNetListMemory (netlist);
}
END_LOOP;
- MYFREE (Netlistlist->NetList);
+ free (Netlistlist->NetList);
memset (Netlistlist, 0, sizeof (NetListListType));
}
}
@@ -821,7 +693,7 @@ FreeNetMemory (NetTypePtr Net)
{
if (Net)
{
- MYFREE (Net->Connection);
+ free (Net->Connection);
memset (Net, 0, sizeof (NetType));
}
}
@@ -835,10 +707,10 @@ FreeAttributeListMemory (AttributeListTypePtr list)
for (i = 0; i < list->Number; i++)
{
- SaveFree (list->List[i].name);
- SaveFree (list->List[i].value);
+ free (list->List[i].name);
+ free (list->List[i].value);
}
- SaveFree (list->List);
+ free (list->List);
list->List = NULL;
list->Max = 0;
}
@@ -853,25 +725,25 @@ FreeElementMemory (ElementTypePtr Element)
{
ELEMENTNAME_LOOP (Element);
{
- MYFREE (textstring);
+ free (textstring);
}
END_LOOP;
PIN_LOOP (Element);
{
- MYFREE (pin->Name);
- MYFREE (pin->Number);
+ free (pin->Name);
+ free (pin->Number);
}
END_LOOP;
PAD_LOOP (Element);
{
- MYFREE (pad->Name);
- MYFREE (pad->Number);
+ free (pad->Name);
+ free (pad->Number);
}
END_LOOP;
- MYFREE (Element->Pin);
- MYFREE (Element->Pad);
- MYFREE (Element->Line);
- MYFREE (Element->Arc);
+ free (Element->Pin);
+ free (Element->Pad);
+ free (Element->Line);
+ free (Element->Arc);
FreeAttributeListMemory (&Element->Attributes);
memset (Element, 0, sizeof (ElementType));
}
@@ -887,15 +759,15 @@ FreePCBMemory (PCBTypePtr PCBPtr)
if (PCBPtr)
{
- MYFREE (PCBPtr->Name);
- MYFREE (PCBPtr->Filename);
- MYFREE (PCBPtr->PrintFilename);
+ free (PCBPtr->Name);
+ free (PCBPtr->Filename);
+ free (PCBPtr->PrintFilename);
if (PCBPtr->Data)
FreeDataMemory (PCBPtr->Data);
- MYFREE (PCBPtr->Data);
+ free (PCBPtr->Data);
/* release font symbols */
for (i = 0; i <= MAX_FONTPOSITION; i++)
- MYFREE (PCBPtr->Font.Symbol[i].Line);
+ free (PCBPtr->Font.Symbol[i].Line);
FreeLibraryMemory (&PCBPtr->NetlistLib);
FreeAttributeListMemory (&PCBPtr->Attributes);
/* clear struct */
@@ -920,43 +792,43 @@ FreeDataMemory (DataTypePtr Data)
{
VIA_LOOP (Data);
{
- MYFREE (via->Name);
+ free (via->Name);
}
END_LOOP;
- MYFREE (Data->Via);
+ free (Data->Via);
ELEMENT_LOOP (Data);
{
FreeElementMemory (element);
}
END_LOOP;
- MYFREE (Data->Element);
- MYFREE (Data->Rat);
+ free (Data->Element);
+ free (Data->Rat);
for (layer = Data->Layer, i = 0; i < MAX_LAYER + 2; layer++, i++)
{
FreeAttributeListMemory (&layer->Attributes);
TEXT_LOOP (layer);
{
- MYFREE (text->TextString);
+ free (text->TextString);
}
END_LOOP;
if (layer->Name)
- MYFREE (layer->Name);
+ free (layer->Name);
LINE_LOOP (layer);
{
if (line->Number)
- MYFREE (line->Number);
+ free (line->Number);
}
END_LOOP;
- MYFREE (layer->Line);
- MYFREE (layer->Arc);
- MYFREE (layer->Text);
+ free (layer->Line);
+ free (layer->Arc);
+ free (layer->Text);
POLYGON_LOOP (layer);
{
FreePolygonMemory (polygon);
}
END_LOOP;
- MYFREE (layer->Polygon);
+ free (layer->Polygon);
if (layer->line_tree)
r_destroy_tree (&layer->line_tree);
if (layer->arc_tree)
@@ -999,36 +871,21 @@ FreeLibraryMemory (LibraryTypePtr lib)
{
ENTRY_LOOP (menu);
{
- SaveFree ((void *) entry->AllocatedMemory);
- SaveFree ((void *) entry->ListEntry);
+ free (entry->AllocatedMemory);
+ free (entry->ListEntry);
}
END_LOOP;
- SaveFree ((void *) menu->Entry);
- SaveFree ((void *) menu->Name);
+ free (menu->Entry);
+ free (menu->Name);
}
END_LOOP;
- SaveFree ((void *) lib->Menu);
+ free (lib->Menu);
/* clear struct */
memset (lib, 0, sizeof (LibraryType));
}
/* ---------------------------------------------------------------------------
- * a 'save' free routine which first does a quick check if the pointer
- * is zero. The routine isn't implemented as a macro to make additional
- * safety features easier to implement
- */
-void
-SaveFree (void *Ptr)
-{
-#ifdef MEM_DEBUG
- fprintf (stderr, "Freeing 0x%x\n", Ptr);
-#endif
- if (Ptr)
- free (Ptr);
-}
-
-/* ---------------------------------------------------------------------------
* reallocates memory for a dynamic length string if necessary
*/
static void
@@ -1038,7 +895,7 @@ DSRealloc (DynamicStringTypePtr Ptr, size_t Length)
if (input_null || Length >= Ptr->MaxLength)
{
Ptr->MaxLength = Length + 512;
- Ptr->Data = MyRealloc (Ptr->Data, Ptr->MaxLength, "ReallocDS()");
+ Ptr->Data = realloc (Ptr->Data, Ptr->MaxLength);
if (input_null)
Ptr->Data[0] = '\0';
}
@@ -1106,7 +963,7 @@ StripWhiteSpaceAndDup (char *S)
/* string is not empty -> allocate memory */
if (length)
{
- p2 = MyRealloc (NULL, length + 1, "StripWhiteSpace()");
+ p2 = realloc (NULL, length + 1);
strncpy (p2, p1, length);
*(p2 + length) = '\0';
return (p2);
diff --git a/src/mymem.h b/src/mymem.h
index fdfd7e6..4e36640 100644
--- a/src/mymem.h
+++ b/src/mymem.h
@@ -64,6 +64,8 @@
#define STEP_RUBBERBAND 100
#define STEP_RAT 2000
+#define STRDUP(x) (((x) != NULL) ? strdup (x) : NULL)
+
/* ---------------------------------------------------------------------------
* some memory types
*/
@@ -95,12 +97,6 @@ ElementTypeHandle GetDrillElementMemory (DrillTypePtr);
PinTypeHandle GetDrillPinMemory (DrillTypePtr);
DrillTypePtr GetDrillInfoDrillMemory (DrillInfoTypePtr);
void **GetPointerMemory (PointerListTypePtr);
-void *MyCalloc (size_t, size_t, const char *);
-void *MyMalloc (size_t, const char *);
-void *MyRealloc (void *, size_t, const char *);
-char *MyStrdup (const char *s, const char *);
-/* void MyFree (void **); */
-#define MYFREE(x) do { SaveFree(x); (x)=NULL; } while (0)
void FreePolygonMemory (PolygonTypePtr);
void FreeElementMemory (ElementTypePtr);
void FreePCBMemory (PCBTypePtr);
@@ -111,7 +107,6 @@ void FreeNetMemory (NetTypePtr);
void FreeDataMemory (DataTypePtr);
void FreeLibraryMemory (LibraryTypePtr);
void FreePointerListMemory (PointerListTypePtr);
-void SaveFree (void *);
void DSAddCharacter (DynamicStringTypePtr, char);
void DSAddString (DynamicStringTypePtr, const char *);
void DSClearString (DynamicStringTypePtr);
diff --git a/src/netlist.c b/src/netlist.c
index 459b08a..4a26bc9 100644
--- a/src/netlist.c
+++ b/src/netlist.c
@@ -242,10 +242,8 @@ netlist_clear (LibraryMenuType * net, LibraryEntryType * pin)
static void
netlist_style (LibraryMenuType *net, const char *style)
{
- if (net->Style)
- MYFREE (net->Style);
- if (style)
- net->Style = strdup ((char *)style);
+ free (net->Style);
+ net->Style = STRDUP ((char *)style);
}
/* The primary purpose of this action is to rebuild a netlist from a
diff --git a/src/parse_l.l b/src/parse_l.l
index c9d96c8..a2808ad 100644
--- a/src/parse_l.l
+++ b/src/parse_l.l
@@ -171,7 +171,7 @@ Attribute { return(T_ATTRIBUTE); }
* leading and trailing '"'
*/
yyleng -= 2;
- yylval.string = MyCalloc(yyleng+1, sizeof(char), "LEX");
+ yylval.string = calloc (yyleng+1, sizeof (char));
p1 = (char *) (yytext +1);
p2 = yylval.string;
while(yyleng--)
@@ -247,8 +247,7 @@ static int Parse(char *Executable, char *Path, char *Filename, char *Parameter)
{
used_popen = 1;
/* release old command and create new from template */
- if (command)
- MYFREE (command);
+ free (command);
command = EvaluateFilename(Executable, Path, Filename, Parameter);
/* open pipe to stdout of command */
diff --git a/src/parse_y.y b/src/parse_y.y
index f4fc367..7aa7b80 100644
--- a/src/parse_y.y
+++ b/src/parse_y.y
@@ -733,7 +733,7 @@ via_hi_format
: T_VIA '[' NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER STRING flags ']'
{
CreateNewVia(yyData, $3, $4, $5, $6, $7, $8, $9, $10);
- SaveFree($9);
+ free ($9);
}
;
@@ -743,7 +743,7 @@ via_2.0_format
{
CreateNewVia(yyData, $3*100, $4*100, $5*100, $6*100, $7*100, $8*100, $9,
OldFlags($10));
- SaveFree($9);
+ free ($9);
}
;
@@ -754,7 +754,7 @@ via_1.7_format
{
CreateNewVia(yyData, $3*100, $4*100, $5*100, $6*100,
($5 + $6)*100, $7*100, $8, OldFlags($9));
- SaveFree($8);
+ free ($8);
}
;
@@ -764,7 +764,7 @@ via_newformat
{
CreateNewVia(yyData, $3*100, $4*100, $5*100, 200*GROUNDPLANEFRAME,
($5 + 2*MASKFRAME)*100, $6*100, $7, OldFlags($8));
- SaveFree($7);
+ free ($7);
}
;
@@ -781,7 +781,7 @@ via_oldformat
CreateNewVia(yyData, $3*100, $4*100, $5*100, 200*GROUNDPLANEFRAME,
($5 + 2*MASKFRAME)*100, hole, $6, OldFlags($7));
- SaveFree($6);
+ free ($6);
}
;
@@ -1045,7 +1045,7 @@ text_oldformat
{
/* use a default scale of 100% */
CreateNewText(Layer,yyFont,$3*100, $4*100, $5, 100, $6, OldFlags($7));
- SaveFree($6);
+ free ($6);
}
;
@@ -1064,7 +1064,7 @@ text_newformat
else
CreateNewText(Layer, yyFont, $3*100, $4*100, $5, $6, $7,
OldFlags($8));
- SaveFree($7);
+ free ($7);
}
;
text_hi_format
@@ -1087,7 +1087,7 @@ text_hi_format
}
else
CreateNewText(Layer, yyFont, $3, $4, $5, $6, $7, $8);
- SaveFree($7);
+ free ($7);
}
;
@@ -1258,8 +1258,8 @@ element_oldformat
{
yyElement = CreateNewElement(yyData, yyElement, yyFont, NoFlags(),
$3, $4, NULL, $5*100, $6*100, $7, 100, NoFlags(), false);
- SaveFree($3);
- SaveFree($4);
+ free ($3);
+ free ($4);
pin_num = 1;
}
elementdefinitions ')'
@@ -1276,8 +1276,8 @@ element_1.3.4_format
{
yyElement = CreateNewElement(yyData, yyElement, yyFont, OldFlags($3),
$4, $5, NULL, $6*100, $7*100, $8, $9, OldFlags($10), false);
- SaveFree($4);
- SaveFree($5);
+ free ($4);
+ free ($5);
pin_num = 1;
}
elementdefinitions ')'
@@ -1294,9 +1294,9 @@ element_newformat
{
yyElement = CreateNewElement(yyData, yyElement, yyFont, OldFlags($3),
$4, $5, $6, $7*100, $8*100, $9, $10, OldFlags($11), false);
- SaveFree($4);
- SaveFree($5);
- SaveFree($6);
+ free ($4);
+ free ($5);
+ free ($6);
pin_num = 1;
}
elementdefinitions ')'
@@ -1316,9 +1316,9 @@ element_1.7_format
$4, $5, $6, ($7+$9)*100, ($8+$10)*100, $11, $12, OldFlags($13), false);
yyElement->MarkX = $7*100;
yyElement->MarkY = $8*100;
- SaveFree($4);
- SaveFree($5);
- SaveFree($6);
+ free ($4);
+ free ($5);
+ free ($6);
}
relementdefs ')'
{
@@ -1337,9 +1337,9 @@ element_hi_format
$4, $5, $6, ($7+$9), ($8+$10), $11, $12, $13, false);
yyElement->MarkX = $7;
yyElement->MarkY = $8;
- SaveFree($4);
- SaveFree($5);
- SaveFree($6);
+ free ($4);
+ free ($5);
+ free ($6);
}
relementdefs ')'
{
@@ -1534,8 +1534,8 @@ pin_hi_format
CreateNewPin(yyElement, $3 + yyElement->MarkX,
$4 + yyElement->MarkY, $5, $6, $7, $8, $9,
$10, $11);
- SaveFree($9);
- SaveFree($10);
+ free ($9);
+ free ($10);
}
;
pin_1.7_format
@@ -1546,8 +1546,8 @@ pin_1.7_format
CreateNewPin(yyElement, $3*100 + yyElement->MarkX,
$4*100 + yyElement->MarkY, $5*100, $6*100, $7*100, $8*100, $9,
$10, OldFlags($11));
- SaveFree($9);
- SaveFree($10);
+ free ($9);
+ free ($10);
}
;
@@ -1557,8 +1557,8 @@ pin_1.6.3_format
{
CreateNewPin(yyElement, $3*100, $4*100, $5*100, 200*GROUNDPLANEFRAME,
($5 + 2*MASKFRAME)*100, $6*100, $7, $8, OldFlags($9));
- SaveFree($7);
- SaveFree($8);
+ free ($7);
+ free ($8);
}
;
@@ -1572,7 +1572,7 @@ pin_newformat
CreateNewPin(yyElement, $3*100, $4*100, $5*100, 200*GROUNDPLANEFRAME,
($5 + 2*MASKFRAME)*100, $6*100, $7, p_number, OldFlags($8));
- SaveFree($7);
+ free ($7);
}
;
@@ -1593,7 +1593,7 @@ pin_oldformat
sprintf(p_number, "%d", pin_num++);
CreateNewPin(yyElement, $3*100, $4*100, $5*100, 200*GROUNDPLANEFRAME,
($5 + 2*MASKFRAME)*100, hole, $6, p_number, OldFlags($7));
- SaveFree($6);
+ free ($6);
}
;
@@ -1641,8 +1641,8 @@ pad_hi_format
$5 + yyElement->MarkX,
$6 + yyElement->MarkY, $7, $8, $9,
$10, $11, $12);
- SaveFree($10);
- SaveFree($11);
+ free ($10);
+ free ($11);
}
;
@@ -1654,8 +1654,8 @@ pad_1.7_format
$4*100 + yyElement->MarkY, $5*100 + yyElement->MarkX,
$6*100 + yyElement->MarkY, $7*100, $8*100, $9*100,
$10, $11, OldFlags($12));
- SaveFree($10);
- SaveFree($11);
+ free ($10);
+ free ($11);
}
;
@@ -1665,8 +1665,8 @@ pad_newformat
{
CreateNewPad(yyElement,$3*100,$4*100,$5*100,$6*100,$7*100, 200*GROUNDPLANEFRAME,
($7 + 2*MASKFRAME)*100, $8,$9, OldFlags($10));
- SaveFree($8);
- SaveFree($9);
+ free ($8);
+ free ($9);
}
;
@@ -1679,7 +1679,7 @@ pad
sprintf(p_number, "%d", pin_num++);
CreateNewPad(yyElement,$3*100,$4*100,$5*100,$6*100,$7*100, 200*GROUNDPLANEFRAME,
($7 + 2*MASKFRAME)*100, $8,p_number, OldFlags($9));
- SaveFree($8);
+ free ($8);
}
;
@@ -1846,8 +1846,8 @@ net
: T_NET '(' STRING STRING ')' '('
{
Menu = CreateNewNet(&yyPCB->NetlistLib, $3, $4);
- SaveFree($3);
- SaveFree($4);
+ free ($3);
+ free ($4);
}
connections ')'
;
@@ -1881,7 +1881,7 @@ conn
: T_CONN '(' STRING ')'
{
CreateNewConnection(Menu, $3);
- SaveFree($3);
+ free ($3);
}
;
@@ -1914,8 +1914,8 @@ attribute
: T_ATTRIBUTE '(' STRING STRING ')'
{
CreateNewAttribute (attr_list, $3, $4 ? $4 : "");
- SaveFree ($3);
- SaveFree ($4);
+ free ($3);
+ free ($4);
}
;
diff --git a/src/rats.c b/src/rats.c
index 67a0efc..3c5ede1 100644
--- a/src/rats.c
+++ b/src/rats.c
@@ -228,15 +228,14 @@ ProcNetlist (LibraryTypePtr net_menu)
if (!net_menu->MenuN)
return (NULL);
FreeNetListMemory (Wantlist);
- SaveFree (Wantlist);
- /* MYFREE (Wantlist); *//* awkward */
+ free (Wantlist);
badnet = false;
/* find layer groups of the component side and solder side */
SLayer = GetLayerGroupNumberByNumber (solder_silk_layer);
CLayer = GetLayerGroupNumberByNumber (component_silk_layer);
- Wantlist = MyCalloc (1, sizeof (NetListType), "ProcNetlist()");
+ Wantlist = calloc (1, sizeof (NetListType));
if (Wantlist)
{
ALLPIN_LOOP (PCB->Data);
@@ -361,8 +360,7 @@ static bool
CheckShorts (LibraryMenuTypePtr theNet)
{
bool new, warn = false;
- PointerListTypePtr generic = MyCalloc (1, sizeof (PointerListType),
- "CheckShorts");
+ PointerListTypePtr generic = calloc (1, sizeof (PointerListType));
/* the first connection was starting point so
* the menu is always non-null
*/
@@ -442,7 +440,7 @@ CheckShorts (LibraryMenuTypePtr theNet)
...
[truncated message content] |
|
From: <gi...@gp...> - 2010-12-10 02:27:16
|
The branch, master has been updated
via 48ba0051476ab1e0bf1e8f3d598c410a09f41614 (commit)
from 317d46af556d23315078a8a466f0829e8032e123 (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/create.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
=================
Commit Messages
=================
commit 48ba0051476ab1e0bf1e8f3d598c410a09f41614
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Ensure CreateNewText() returns NULL if called with NULL text.
Ensuring that text will not be NULL allows us to replace the
MyStrdup call with a simple strdup.
:100644 100644 bf3b688... 15c0099... M src/create.c
=========
Changes
=========
commit 48ba0051476ab1e0bf1e8f3d598c410a09f41614
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Ensure CreateNewText() returns NULL if called with NULL text.
Ensuring that text will not be NULL allows us to replace the
MyStrdup call with a simple strdup.
diff --git a/src/create.c b/src/create.c
index bf3b688..15c0099 100644
--- a/src/create.c
+++ b/src/create.c
@@ -578,9 +578,14 @@ CreateNewText (LayerTypePtr Layer, FontTypePtr PCBFont,
LocationType X, LocationType Y,
BYTE Direction, int Scale, char *TextString, FlagType Flags)
{
- TextTypePtr text = GetTextMemory (Layer);
- if (!text)
- return (text);
+ TextType *text;
+
+ if (TextString == NULL)
+ return NULL;
+
+ text = GetTextMemory (Layer);
+ if (text == NULL)
+ return NULL;
/* copy values, width and height are set by drawing routine
* because at this point we don't know which symbols are available
@@ -590,7 +595,7 @@ CreateNewText (LayerTypePtr Layer, FontTypePtr PCBFont,
text->Direction = Direction;
text->Flags = Flags;
text->Scale = Scale;
- text->TextString = MyStrdup (TextString, "CreateNewText()");
+ text->TextString = strdup (TextString);
/* calculate size of the bounding box */
SetTextBoundingBox (PCBFont, text);
|
|
From: <gi...@gp...> - 2010-12-10 02:22:52
|
The branch, master has been updated
via 317d46af556d23315078a8a466f0829e8032e123 (commit)
from c1f85a94d591c58ac0f9f6ea4d217f96d14a4d98 (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/file.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 50 insertions(+), 11 deletions(-)
=================
Commit Messages
=================
commit 317d46af556d23315078a8a466f0829e8032e123
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
file.c: c Attempt to handle failure of GetWorkingDirectory() and chdir()
Report the error to the user if any GetWorkingDirectory or chdir call
fails. Add attempts to change back to the original working directory
on error paths.
Ideally, these functions would be re-implemented to operate without
changing the current working directory at all.
:100644 100644 aff5073... 8cbd95d... M src/file.c
=========
Changes
=========
commit 317d46af556d23315078a8a466f0829e8032e123
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
file.c: c Attempt to handle failure of GetWorkingDirectory() and chdir()
Report the error to the user if any GetWorkingDirectory or chdir call
fails. Add attempts to change back to the original working directory
on error paths.
Ideally, these functions would be re-implemented to operate without
changing the current working directory at all.
diff --git a/src/file.c b/src/file.c
index aff5073..8cbd95d 100644
--- a/src/file.c
+++ b/src/file.c
@@ -1151,17 +1151,36 @@ LoadNewlibFootprintsFromDir(char *libpath, char *toppath)
/* Cache old dir, then cd into subdir because stat is given relative file names. */
memset (subdir, 0, sizeof subdir);
memset (olddir, 0, sizeof olddir);
- GetWorkingDirectory(olddir);
+ if (GetWorkingDirectory (olddir) == NULL)
+ {
+ Message (_("LoadNewlibFootprintsFromDir: Could not determine initial working directory\n"));
+ return 0;
+ }
+
strcpy (subdir, libpath);
- chdir(subdir);
- GetWorkingDirectory(subdir); /* subdir is abs path */
+ if (chdir (subdir))
+ {
+ ChdirErrorMessage (subdir);
+ return 0;
+ }
+
+ /* Determine subdir is abs path */
+ if (GetWorkingDirectory (subdir) == NULL)
+ {
+ Message (_("LoadNewlibFootprintsFromDir: Could not determine new working directory\n"));
+ if (chdir (olddir))
+ ChdirErrorMessage (olddir);
+ return 0;
+ }
/* First try opening the directory specified by path */
if ( (subdirobj = opendir (subdir)) == NULL )
- {
+ {
OpendirErrorMessage (subdir);
+ if (chdir (olddir))
+ ChdirErrorMessage (olddir);
return 0;
- }
+ }
/* Get pointer to memory holding menu */
menu = GetLibraryMenuMemory (&Library);
@@ -1221,7 +1240,8 @@ LoadNewlibFootprintsFromDir(char *libpath, char *toppath)
}
/* Done. Clean up, cd back into old dir, and return */
closedir (subdirobj);
- chdir(olddir);
+ if (chdir (olddir))
+ ChdirErrorMessage (olddir);
return n_footprints;
}
@@ -1252,7 +1272,11 @@ ParseLibraryTree (void)
/* Save the current working directory as an absolute path.
* This fcn writes the abs path into the memory pointed to by the input arg.
*/
- GetWorkingDirectory (working);
+ if (GetWorkingDirectory (working) == NULL)
+ {
+ Message (_("ParseLibraryTree: Could not determine initial working directory\n"));
+ return 0;
+ }
/* Additional loop to allow for multiple 'newlib' style library directories
* called out in Settings.LibraryTree
@@ -1266,14 +1290,28 @@ ParseLibraryTree (void)
/* start out in the working directory in case the path is a
* relative path
*/
- chdir (working);
+ if (chdir (working))
+ {
+ ChdirErrorMessage (working);
+ free (libpaths);
+ return 0;
+ }
/*
* Next change to the directory which is the top of the library tree
* and extract its abs path.
*/
- chdir (toppath);
- GetWorkingDirectory (toppath);
+ if (chdir (toppath))
+ {
+ ChdirErrorMessage (toppath);
+ continue;
+ }
+
+ if (GetWorkingDirectory (toppath) == NULL)
+ {
+ Message (_("ParseLibraryTree: Could not determine new working directory\n"));
+ continue;
+ }
#ifdef DEBUG
printf("In ParseLibraryTree, looking for newlib footprints inside top level directory %s ... \n",
@@ -1316,7 +1354,8 @@ ParseLibraryTree (void)
}
/* restore the original working directory */
- chdir (working);
+ if (chdir (working))
+ ChdirErrorMessage (working);
#ifdef DEBUG
printf("Leaving ParseLibraryTree, found %d footprints.\n", n_footprints);
|
|
From: <gi...@gp...> - 2010-12-10 01:53:16
|
The branch, master has been updated
via c1f85a94d591c58ac0f9f6ea4d217f96d14a4d98 (commit)
via bdc22fcddac7ae0702acb61c4a55c5397aaf9531 (commit)
via 65cc2455f59b12e5726a993685e741d1130398a1 (commit)
via c54da70385b15a0b19b49ea25354ec8f28dafa09 (commit)
from 2756468cf3ada09fa768bae8287b73fe79b41a8a (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 | 15 ++++---
src/change.c | 4 +-
src/hid/batch/batch.c | 101 +++++----------------------------------------
src/hid/common/hidnogui.c | 95 +++++++++++++++++++++++++++++++++++-------
src/vendor.c | 15 ++++---
5 files changed, 111 insertions(+), 119 deletions(-)
=================
Commit Messages
=================
commit c1f85a94d591c58ac0f9f6ea4d217f96d14a4d98
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Plug some memory leaks of strings returned from gui->prompt_for()
:100644 100644 07b2752... 9e1370b... M src/action.c
:100644 100644 df7f454... 2545d84... M src/change.c
commit bdc22fcddac7ae0702acb61c4a55c5397aaf9531
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
vendor.c: Fix memory leak and unused variable in ActionLoadVendorFrom()
Also, don't bother testing x != NULL before calling free (x).
:100644 100644 39359cc... a296aa1... M src/vendor.c
commit 65cc2455f59b12e5726a993685e741d1130398a1
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common: Fix / re-write nogui_{prompt_for,fileselect,confirm_dialog}()
Fixes some pretty nasty bugs in these functions:
1. These functions must return allocated memory, strdup will do nicely.
2. fgets will insert the newline character into the buffer, so we need
to check if we just got a '\r' or '\n' as our first character, not
just '\0' when deciding whether to return the default string or not.
3. DO NOT strcpy a the default string...
we don't know if it will overflow our buffer
4. For the "fileselect" case, return NULL if the user didn't give us a
filename, and the caller didn't specify a default string. Prompt for
will return strdup (""), equivalent to what it previously did.
:100644 100644 6111ec3... 08adb26... M src/hid/common/hidnogui.c
commit c54da70385b15a0b19b49ea25354ec8f28dafa09
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/batch: Use hidnogui as a default base hid to avoid code duplication
:100644 100644 9715c09... 1fa97c7... M src/hid/batch/batch.c
=========
Changes
=========
commit c1f85a94d591c58ac0f9f6ea4d217f96d14a4d98
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Plug some memory leaks of strings returned from gui->prompt_for()
diff --git a/src/action.c b/src/action.c
index 07b2752..9e1370b 100644
--- a/src/action.c
+++ b/src/action.c
@@ -1408,8 +1408,6 @@ NotifyMode (void)
Draw ();
}
}
-
- /* free memory allocated by gui->prompt_for() */
free (string);
}
break;
@@ -4651,7 +4649,8 @@ ActionChangeName (int argc, char **argv, int x, int y)
case F_Layout:
name =
gui->prompt_for (_("Enter the layout name:"), EMPTY (PCB->Name));
- if (name && ChangeLayoutName (name)) /* XXX memory leak */
+ /* NB: ChangeLayoutName takes ownership of the passed memory */
+ if (name && ChangeLayoutName (name))
SetChangedFlag (true);
break;
@@ -4659,7 +4658,8 @@ ActionChangeName (int argc, char **argv, int x, int y)
case F_Layer:
name = gui->prompt_for (_("Enter the layer name:"),
EMPTY (CURRENT->Name));
- if (name && ChangeLayerName (CURRENT, name)) /* XXX memory leak */
+ /* NB: ChangeLayerName takes ownership of the passed memory */
+ if (name && ChangeLayerName (CURRENT, name))
SetChangedFlag (true);
break;
}
@@ -5951,7 +5951,8 @@ ActionNew (int argc, char **argv, int x, int y)
CreateNewPCBPost (PCB, 1);
/* setup the new name and reset some values to default */
- PCB->Name = name; /* XXX memory leak */
+ free (PCB->Name);
+ PCB->Name = name;
ResetStackAndVisibility ();
CreateDefaultFont ();
@@ -7605,7 +7606,7 @@ ActionImport (int argc, char **argv, int x, int y)
if (mode && strcasecmp (mode, "setdisperse") == 0)
{
- const char *ds, *units;
+ char *ds, *units;
char buf[50];
ds = ARG (1);
@@ -7622,6 +7623,8 @@ ActionImport (int argc, char **argv, int x, int y)
}
else
AttributePut (PCB, "import::disperse", ds);
+ if (ARG (1) == NULL)
+ free (ds);
return 0;
}
diff --git a/src/change.c b/src/change.c
index df7f454..2545d84 100644
--- a/src/change.c
+++ b/src/change.c
@@ -1079,6 +1079,7 @@ ChangeTextName (LayerTypePtr Layer, TextTypePtr Text)
bool
ChangeLayoutName (char *Name)
{
+ free (PCB->Name);
PCB->Name = Name;
hid_action ("PCBChanged");
return (true);
@@ -1106,6 +1107,7 @@ ChangeElementSide (ElementTypePtr Element, LocationType yoff)
bool
ChangeLayerName (LayerTypePtr Layer, char *Name)
{
+ free (CURRENT->Name);
CURRENT->Name = Name;
hid_action ("LayersChanged");
return (true);
@@ -2280,7 +2282,7 @@ QueryInputAndChangeObjectName (int Type, void *Ptr1, void *Ptr2, void *Ptr3)
}
if (name)
{
- /* XXX Memory leak!! */
+ /* NB: ChangeObjectName takes ownership of the passed memory */
char *old = ChangeObjectName (Type, Ptr1, Ptr2, Ptr3, name);
if (old != (char *) -1)
{
commit bdc22fcddac7ae0702acb61c4a55c5397aaf9531
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
vendor.c: Fix memory leak and unused variable in ActionLoadVendorFrom()
Also, don't bother testing x != NULL before calling free (x).
diff --git a/src/vendor.c b/src/vendor.c
index 39359cc..a296aa1 100644
--- a/src/vendor.c
+++ b/src/vendor.c
@@ -269,11 +269,12 @@ int
ActionLoadVendorFrom (int argc, char **argv, int x, int y)
{
int i;
- char *fname = NULL, *name = NULL;
+ char *fname = NULL;
static char *default_file = NULL;
char *sval;
Resource *res, *drcres, *drlres;
int type;
+ bool free_fname = false;
cached_drill = -1;
@@ -291,11 +292,10 @@ ActionLoadVendorFrom (int argc, char **argv, int x, int y)
if (fname == NULL)
AFAIL (load_vendor);
- if (default_file != NULL)
- {
- free (default_file);
- default_file = NULL;
- }
+ free_fname = true;
+
+ free (default_file);
+ default_file = NULL;
if (fname && *fname)
default_file = strdup (fname);
@@ -459,7 +459,8 @@ ActionLoadVendorFrom (int argc, char **argv, int x, int y)
vendorMapEnable = true;
apply_vendor_map ();
- free (name);
+ if (free_fname)
+ free (fname);
return 0;
}
commit 65cc2455f59b12e5726a993685e741d1130398a1
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common: Fix / re-write nogui_{prompt_for,fileselect,confirm_dialog}()
Fixes some pretty nasty bugs in these functions:
1. These functions must return allocated memory, strdup will do nicely.
2. fgets will insert the newline character into the buffer, so we need
to check if we just got a '\r' or '\n' as our first character, not
just '\0' when deciding whether to return the default string or not.
3. DO NOT strcpy a the default string...
we don't know if it will overflow our buffer
4. For the "fileselect" case, return NULL if the user didn't give us a
filename, and the caller didn't specify a default string. Prompt for
will return strdup (""), equivalent to what it previously did.
diff --git a/src/hid/common/hidnogui.c b/src/hid/common/hidnogui.c
index 6111ec3..08adb26 100644
--- a/src/hid/common/hidnogui.c
+++ b/src/hid/common/hidnogui.c
@@ -264,14 +264,73 @@ nogui_logv (const char *fmt, va_list ap)
vprintf (fmt, ap);
}
+/* Return a line of user input text, stripped of any newline characters.
+ * Returns NULL if the user simply presses enter, or otherwise gives no input.
+ */
+#define MAX_LINE_LENGTH 1024
+static char *
+read_stdin_line (void)
+{
+ static char buf[MAX_LINE_LENGTH];
+ char *s;
+ int i;
+
+ s = fgets (buf, MAX_LINE_LENGTH, stdin);
+ if (s == NULL)
+ {
+ printf ("\n");
+ return NULL;
+ }
+
+ /* Strip any trailing newline characters */
+ for (i = strlen (s) - 1; i >= 0; i--)
+ if (s[i] == '\r' || s[i] == '\n')
+ s[i] = '\0';
+
+ if (s[0] == '\0')
+ return NULL;
+
+ return strdup (s);
+}
+#undef MAX_LINE_LENGTH
+
static int
nogui_confirm_dialog (char *msg, ...)
{
- int rv;
- printf ("%s ? 0=cancel 1=ok : ", msg);
- fflush (stdout);
- scanf ("%d", &rv);
- return rv;
+ char *answer;
+ int ret = 0;
+ bool valid_answer = false;
+ va_list args;
+
+ do
+ {
+ va_start (args, msg);
+ vprintf (msg, args);
+ va_end (args);
+
+ printf (" ? 0=cancel 1 = ok : ");
+
+ answer = read_stdin_line ();
+
+ if (answer == NULL)
+ continue;
+
+ if (answer[0] == '0' && answer[1] == '\0')
+ {
+ ret = 0;
+ valid_answer = true;
+ }
+
+ if (answer[0] == '1' && answer[1] == '\0')
+ {
+ ret = 1;
+ valid_answer = true;
+ }
+
+ free (answer);
+ }
+ while (!valid_answer);
+ return ret;
}
static int
@@ -289,15 +348,18 @@ nogui_report_dialog (char *title, char *msg)
static char *
nogui_prompt_for (const char *msg, const char *default_string)
{
- static char buf[1024];
+ char *answer;
+
if (default_string)
printf ("%s [%s] : ", msg, default_string);
else
printf ("%s : ", msg);
- fgets (buf, 1024, stdin);
- if (buf[0] == 0 && default_string)
- strcpy (buf, default_string);
- return buf;
+
+ answer = read_stdin_line ();
+ if (answer == NULL)
+ return strdup ((default_string != NULL) ? default_string : "");
+ else
+ return strdup (answer);
}
/* FIXME - this could use some enhancement to actually use the other
@@ -307,15 +369,18 @@ nogui_fileselect (const char *title, const char *descr,
char *default_file, char *default_ext,
const char *history_tag, int flags)
{
- static char buf[1024];
+ char *answer;
+
if (default_file)
printf ("%s [%s] : ", title, default_file);
else
printf ("%s : ", title);
- fgets (buf, 1024, stdin);
- if (buf[0] == 0 && default_file)
- strcpy (buf, default_file);
- return buf;
+
+ answer = read_stdin_line ();
+ if (answer == NULL)
+ return (default_file != NULL) ? strdup (default_file) : NULL;
+ else
+ return strdup (answer);
}
static int
commit c54da70385b15a0b19b49ea25354ec8f28dafa09
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/batch: Use hidnogui as a default base hid to avoid code duplication
diff --git a/src/hid/batch/batch.c b/src/hid/batch/batch.c
index 9715c09..1fa97c7 100644
--- a/src/hid/batch/batch.c
+++ b/src/hid/batch/batch.c
@@ -332,73 +332,6 @@ batch_stop_block_hook (hidval mlpoll)
{
}
-static void
-batch_log (const char *fmt, ...)
-{
- va_list ap;
- va_start (ap, fmt);
- vprintf (fmt, ap);
- va_end (ap);
-}
-
-static void
-batch_logv (const char *fmt, va_list ap)
-{
- vprintf (fmt, ap);
-}
-
-static int
-batch_confirm_dialog (char *msg, ...)
-{
- int rv;
- printf ("%s ? 0=cancel 1=ok : ", msg);
- fflush (stdout);
- scanf ("%d", &rv);
- return rv;
-}
-
-static int
-batch_close_confirm_dialog ()
-{
- return batch_confirm_dialog (_("OK to lose data ?"), NULL);
-}
-
-static void
-batch_report_dialog (char *title, char *msg)
-{
- printf ("--- %s ---\n%s\n", title, msg);
-}
-
-static char *
-batch_prompt_for (const char *msg, const char *default_string)
-{
- static char buf[1024];
- if (default_string)
- printf ("%s [%s] : ", msg, default_string);
- else
- printf ("%s : ", msg);
- fgets (buf, 1024, stdin);
- if (buf[0] == 0 && default_string)
- strcpy (buf, default_string);
- return buf;
-}
-
-static char *
-batch_fileselect (const char *title, const char *descr,
- char *default_file, char *default_ext,
- const char *history_tag, int flags)
-{
- static char buf[1024];
- if (default_file)
- printf ("%s [%s] : ", title, default_file);
- else
- printf ("%s : ", title);
- fgets (buf, 1024, stdin);
- if (buf[0] == 0 && default_file)
- strcpy (buf, default_file);
- return buf;
-}
-
static int
batch_attribute_dialog (HID_Attribute * attrs_,
int n_attrs_, HID_Attr_Val * results_,
@@ -412,19 +345,6 @@ batch_show_item (void *item)
{
}
-static void
-batch_beep (void)
-{
- putchar (7);
- fflush (stdout);
-}
-
-static int
-batch_progress (int so_far_, int total_, const char *message_)
-{
- return 0;
-}
-
HID batch_gui = {
sizeof (HID),
"batch",
@@ -465,18 +385,18 @@ HID batch_gui = {
batch_unwatch_file,
batch_add_block_hook,
batch_stop_block_hook,
- batch_log,
- batch_logv,
- batch_confirm_dialog,
- batch_close_confirm_dialog,
- batch_report_dialog,
- batch_prompt_for,
- batch_fileselect,
+ 0 /* batch_log */,
+ 0 /* batch_logv */,
+ 0 /* batch_confirm_dialog */,
+ 0 /* batch_close_confirm_dialog */,
+ 0 /* batch_report_dialog */,
+ 0 /* batch_prompt_for */,
+ 0 /* batch_fileselect */,
batch_attribute_dialog,
batch_show_item,
- batch_beep,
- batch_progress,
- 0 /* batch_drc_gui */ ,
+ 0 /* batch_beep */,
+ 0 /* batch_progress */,
+ 0 /* batch_drc_gui */,
0 /* batch_edit_attributes */
};
@@ -485,6 +405,7 @@ HID batch_gui = {
void
hid_batch_init ()
{
+ apply_default_hid (&batch_gui, 0);
hid_register_hid (&batch_gui);
#include "batch_lists.h"
}
|
|
From: <gi...@gp...> - 2010-12-09 20:49:10
|
The branch, master has been updated
via 2756468cf3ada09fa768bae8287b73fe79b41a8a (commit)
via 97963eb2ad6a4ea2e82e2084653bf52d0dedbc1d (commit)
via d882cbe3a56ba41e7723d8da1b57255d361075ac (commit)
via 6714f5ff18afbf12c2a059482d747d15f250d68e (commit)
via 2e46d5a7a626f703d868d25670af33b0c2afff17 (commit)
via 99ac52a605256bf60089d3177ff268d9fccf83ad (commit)
via b2f7f75a375ca20350891f464283018677763a61 (commit)
via 42930014efab78eb5ddb06ea1ef9053c4c7bb13e (commit)
via 86585c7eb9c35faa9ea310c241e80edb038c2055 (commit)
via 2265df977e20edf832f56c74e78fca1e15b45555 (commit)
via 5f9832e8b50bd56dd56d28391dc6cb8c7be8a0d9 (commit)
via 05f663f3905d3dde859fefa1f614c29d67428539 (commit)
via 7fa6e8145b3a9e2b85b42a2bae12d55fe0005ae1 (commit)
via ec76a0d17c1baea2dd83a6a67b6fe48aee74b547 (commit)
via d5fd3e348da36c4fb10100b0cc5e218069c309c9 (commit)
via a17c8a99d84ba8408ffe6173813a982016545cba (commit)
via e4a4a0740d6b648ce5026bef1261726037f90163 (commit)
via 9dab8d5519bcb752d91d3e4647bbc2356ed80830 (commit)
via cadcc01668cd9de9629992bcfc9d28f910738662 (commit)
via 8a764804b6c1af050552ba79ec284a2021d55157 (commit)
via f9119256366eb114f4dd30a62fa1aa95cd9ffb72 (commit)
via 8f3cf398616a634cb85c40b7295dcfec5fbe70e5 (commit)
via 4f81df61732f5328a0d66cabc53503fd745c8bc9 (commit)
via 0c66ee758d318111b5ec867f0ba89f4fab0a6601 (commit)
via 3c47897d8c8d151ae76203f1bb49270d9a2d747e (commit)
from bdf06d189aa089b01e13753c3164d35c1aaa8d5e (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/Makefile.am | 2 +
src/action.c | 116 ++++++++++++++++++++++----------------------
src/autoroute.c | 2 +
src/buffer.c | 3 +-
src/change.c | 2 -
src/djopt.c | 2 +
src/file.c | 2 +-
src/flags.c | 7 ++-
src/gts/edge.c | 2 +-
src/gts/pgraph.c | 4 +-
src/hid.h | 2 +-
src/hid/batch/batch.c | 25 +++++++---
src/hid/common/actions.h | 7 +++
src/hid/common/hidinit.h | 6 ++
src/hid/common/hidnogui.c | 2 +-
src/hid/gcode/gcode.c | 4 +-
src/hid/gerber/gerber.c | 3 +-
src/hid/gtk/gtkhid-main.c | 2 +-
src/hid/gtk/gui-dialog.c | 2 +-
src/hid/gtk/gui.h | 2 +-
src/hid/lesstif/dialogs.c | 54 ++++++++++----------
src/hid/lesstif/lesstif.h | 2 +-
src/hid/lesstif/main.c | 20 ++++----
src/hid/lesstif/menu.c | 6 +-
src/hid/lesstif/netlist.c | 14 +++---
src/hid/lesstif/styles.c | 2 +-
src/hid/lpr/lpr.c | 3 +-
src/hid/nelma/nelma.c | 4 +-
src/hid/png/png.c | 4 +-
src/hid/ps/eps.c | 3 +-
src/hid/ps/ps.c | 3 +-
src/main.c | 6 +--
src/misc.c | 4 +-
src/misc.h | 4 +-
src/mymem.c | 2 +-
src/mymem.h | 2 +-
src/parse_l.l | 2 +
src/res_lex.l | 1 +
src/rtree.c | 4 +-
src/toporouter.c | 9 ++--
40 files changed, 188 insertions(+), 158 deletions(-)
create mode 100644 src/hid/common/actions.h
create mode 100644 src/hid/common/hidinit.h
=================
Commit Messages
=================
commit 2756468cf3ada09fa768bae8287b73fe79b41a8a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
action.c: Mark some strings as translateable in ActionImport()
:100644 100644 34d54e2... 07b2752... M src/action.c
commit 97963eb2ad6a4ea2e82e2084653bf52d0dedbc1d
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Make the strings passed to AttributePutToList and MyStrdup (const char *)
Silences some compiler warnings when using const char * strings.
:100644 100644 b1d4304... 34b18cb... M src/misc.c
:100644 100644 82bd194... 776e309... M src/misc.h
:100644 100644 59f8f8d... 13863c1... M src/mymem.c
:100644 100644 81dff7a... fdfd7e6... M src/mymem.h
commit d882cbe3a56ba41e7723d8da1b57255d361075ac
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/lesstif: Revert some Boolean->bool type changes as required by Xt* APIs
This is a partial revert of commit ad5eb5a165442be38624aa622beeb57dc1d2afbd
For consistency, I have also reverted the changes of True->true and
False->false when calling X11 APIs.
:100644 100644 6c7a2de... a56e3a3... M src/hid/lesstif/dialogs.c
:100644 100644 5caec02... 76dce1a... M src/hid/lesstif/main.c
:100644 100644 9983d42... aca306d... M src/hid/lesstif/menu.c
:100644 100644 7d31197... ee6d723... M src/hid/lesstif/netlist.c
:100644 100644 fb9d3b3... d3dcdaa... M src/hid/lesstif/styles.c
commit 6714f5ff18afbf12c2a059482d747d15f250d68e
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/lesstif: Use an intervening size_t casts to aovid compiler warnings
This is to avoid the compiler warning us what we already know.. that we
are passing an integer value cast into what might be a different sized
pointer. (On 64 bit builds).
:100644 100644 b3cc375... 6c7a2de... M src/hid/lesstif/dialogs.c
commit 2e46d5a7a626f703d868d25670af33b0c2afff17
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/batch: Add some missing header files for prototypes
:100644 100644 8d53d8c... 9715c09... M src/hid/batch/batch.c
commit 99ac52a605256bf60089d3177ff268d9fccf83ad
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common: Provide a header to define hid_parse_command_line()
Avoids having each caller having to pull it in with an extern declaration.
:100644 100644 ef72012... a0f1c50... M src/Makefile.am
:100644 100644 6bc0e58... 8d53d8c... M src/hid/batch/batch.c
:000000 100644 0000000... bd1174f... A src/hid/common/hidinit.h
:100644 100644 7a52a7c... f1bdcea... M src/hid/gcode/gcode.c
:100644 100644 e2d9c57... 1f6341b... M src/hid/gerber/gerber.c
:100644 100644 aa696be... ac3e2db... M src/hid/lpr/lpr.c
:100644 100644 c53ce05... 5f6ebc7... M src/hid/nelma/nelma.c
:100644 100644 5c52768... 32639c8... M src/hid/png/png.c
:100644 100644 1b85b7d... 83ce780... M src/hid/ps/eps.c
:100644 100644 3e72b81... 814e23e... M src/hid/ps/ps.c
commit b2f7f75a375ca20350891f464283018677763a61
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common: Provide a header file to define print_actions()
Avoids having each caller having to pull it in with an extern declaration.
:100644 100644 e719268... ef72012... M src/Makefile.am
:100644 100644 cfa4e5a... 6bc0e58... M src/hid/batch/batch.c
:000000 100644 0000000... 1cc6f24... A src/hid/common/actions.h
:100644 100644 ba8c959... 923e0ee... M src/main.c
commit 42930014efab78eb5ddb06ea1ef9053c4c7bb13e
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Fix function prototypes and dummy return values for batch HID
Most of these are dummy functions, but we should get the prototypes
right! Also, return 0 from dummy functions which are supposed to return
an integer.
Fixes various compiler warnings.
:100644 100644 7db8a54... cfa4e5a... M src/hid/batch/batch.c
commit 86585c7eb9c35faa9ea310c241e80edb038c2055
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
HID: Make arguments to the prompt_for method const char *, not char *
Avoids compiler warnings calling gui->prompt_for() with a const char *
:100644 100644 dd34b8e... 94734ba... M src/hid.h
:100644 100644 f3b7d3c... 7db8a54... M src/hid/batch/batch.c
:100644 100644 d5dc9e1... 6111ec3... M src/hid/common/hidnogui.c
:100644 100644 7d59672... a3947d0... M src/hid/gtk/gtkhid-main.c
:100644 100644 ec91233... 1f6b11a... M src/hid/gtk/gui-dialog.c
:100644 100644 7686106... 4ad6cdc... M src/hid/gtk/gui.h
:100644 100644 544a718... b3cc375... M src/hid/lesstif/dialogs.c
:100644 100644 54e4ced... 3bc822b... M src/hid/lesstif/lesstif.h
commit 2265df977e20edf832f56c74e78fca1e15b45555
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Rename "r" variables used in calls to GetValue() to be more descriptive
A purely cosmetic change.
:100644 100644 b8707d1... 34d54e2... M src/action.c
commit 5f9832e8b50bd56dd56d28391dc6cb8c7be8a0d9
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
action.c: Fix data types in GetValue calls
We passed an (int *) rather than a (bool *) in ActionImport() and
parse_layout_attribute_units()
:100644 100644 8d5931a... b8707d1... M src/action.c
commit 05f663f3905d3dde859fefa1f614c29d67428539
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Change unmodifed parameters to GetValue to const char *
Silences some compiler warnings in action.c
:100644 100644 76b05c0... b1d4304... M src/misc.c
:100644 100644 bb88a21... 82bd194... M src/misc.h
commit 7fa6e8145b3a9e2b85b42a2bae12d55fe0005ae1
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
autoroute.c: #if 0 out an unused static function add_clearance()
Silences compiler warning.
:100644 100644 ea97d01... 9ccab97... M src/autoroute.c
commit ec76a0d17c1baea2dd83a6a67b6fe48aee74b547
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
djopt.c: #if 0 out an unused static function nudge_corner()
Silences a compiler warning.
:100644 100644 800e574... b5d9c39... M src/djopt.c
commit d5fd3e348da36c4fb10100b0cc5e218069c309c9
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
buffer.c: Declare variables before code in ActionFreeRotateBuffer()
Avoids compiler warning "ISO C90 forbids mixed declarations and code"
:100644 100644 bec918f... f9d6f5a... M src/buffer.c
commit a17c8a99d84ba8408ffe6173813a982016545cba
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
change.c: Remove unused variable in ChangeElementText()
:100644 100644 5546f1f... df7f454... M src/change.c
commit e4a4a0740d6b648ce5026bef1261726037f90163
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Remove unused variables in ActionElementList() and ActionImport()
:100644 100644 ba9ca44... 8d5931a... M src/action.c
commit 9dab8d5519bcb752d91d3e4647bbc2356ed80830
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Add missing return value in ActionImport()
:100644 100644 f52fcf4... ba9ca44... M src/action.c
commit cadcc01668cd9de9629992bcfc9d28f910738662
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Silence used function warning for __r_tree_is_good() (Non-debug builds)
__r_tree_is_good() and its helper functions are only used when debugging,
and are called from assert() macros. If "NDEBUG" is defined, these expand
to nothing, and the function is not called.
Wrap __r_tree_is_good() and its helper, __r_tree_node_is_good() with
#ifndef NDEBUG
:100644 100644 a6fe712... f44672c... M src/rtree.c
commit 8a764804b6c1af050552ba79ec284a2021d55157
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
file.c: The "elapsed" variable in LoadPCB is debugging only
Silence compiler warning by moving it inside the #ifdef DEBUG
:100644 100644 6893379... aff5073... M src/file.c
commit f9119256366eb114f4dd30a62fa1aa95cd9ffb72
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
flags.c: Avoid compiler warning when casting our OffsetOf value
Strictly, our OffsetOf calculation "could" return a number as large as the
pointer size on the system - so the compiler will complain when we squash
it directly into an int. Casting via a size_t will avoid the warning.
Our structure offsets are small, so this is safe - if somewhat ugly.
:100644 100644 c33cfb6... 499e59e... M src/flags.c
commit 8f3cf398616a634cb85c40b7295dcfec5fbe70e5
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Toporouter: Comment unused debug variable
Silences compiler warning
:100644 100644 0ad26b5... 41fd4b1... M src/toporouter.c
commit 4f81df61732f5328a0d66cabc53503fd745c8bc9
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
gts: Comment some unused variables left as placeholders
Silences compiler warnings
:100644 100644 2c13c1e... 6d1f619... M src/gts/pgraph.c
commit 0c66ee758d318111b5ec867f0ba89f4fab0a6601
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
gts: Add cast to silence compiler warning
:100644 100644 47754de... fde7d87... M src/gts/edge.c
commit 3c47897d8c8d151ae76203f1bb49270d9a2d747e
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
*.l: Add #define YY_NO_INPUT to avoid defining unused "input()" function
Silences compiler warnings
:100644 100644 b1b67a8... c9d96c8... M src/parse_l.l
:100644 100644 0525aed... 5e08666... M src/res_lex.l
=========
Changes
=========
commit 2756468cf3ada09fa768bae8287b73fe79b41a8a
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
action.c: Mark some strings as translateable in ActionImport()
diff --git a/src/action.c b/src/action.c
index 34d54e2..07b2752 100644
--- a/src/action.c
+++ b/src/action.c
@@ -7613,7 +7613,7 @@ ActionImport (int argc, char **argv, int x, int y)
if (!ds)
{
const char *as = AttributeGet (PCB, "import::disperse");
- ds = gui->prompt_for("Enter dispersion:", as ? as : "0");
+ ds = gui->prompt_for(_("Enter dispersion:"), as ? as : "0");
}
if (units)
{
@@ -7661,7 +7661,7 @@ ActionImport (int argc, char **argv, int x, int y)
}
else
{
- Message ("Bad syntax for Import(setnewpoint)");
+ Message (_("Bad syntax for Import(setnewpoint)"));
return 1;
}
commit 97963eb2ad6a4ea2e82e2084653bf52d0dedbc1d
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Make the strings passed to AttributePutToList and MyStrdup (const char *)
Silences some compiler warnings when using const char * strings.
diff --git a/src/misc.c b/src/misc.c
index b1d4304..34b18cb 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1892,7 +1892,7 @@ AttributeGetFromList (AttributeListType *list, char *name)
}
int
-AttributePutToList (AttributeListType *list, char *name, char *value, int replace)
+AttributePutToList (AttributeListType *list, const char *name, const char *value, int replace)
{
int i;
diff --git a/src/misc.h b/src/misc.h
index 82bd194..776e309 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -86,7 +86,7 @@ char *AttributeGetFromList (AttributeListType *list, char *name);
/* Adds an attribute to the list. If the attribute already exists,
whether it's replaced or a second copy added depends on
REPLACE. Returns non-zero if an existing attribute was replaced. */
-int AttributePutToList (AttributeListType *list, char *name, char *value, int replace);
+int AttributePutToList (AttributeListType *list, const char *name, const char *value, int replace);
/* Simplistic version: Takes a pointer to an object, looks up attributes in it. */
#define AttributeGet(OBJ,name) AttributeGetFromList (&(OBJ->Attributes), name)
/* Simplistic version: Takes a pointer to an object, sets attributes in it. */
diff --git a/src/mymem.c b/src/mymem.c
index 59f8f8d..13863c1 100644
--- a/src/mymem.c
+++ b/src/mymem.c
@@ -718,7 +718,7 @@ MyRealloc (void *Ptr, size_t Size, const char *Text)
* allocates memory for a new string, does some error processing
*/
char *
-MyStrdup (char *S, const char *Text)
+MyStrdup (const char *S, const char *Text)
{
char *p = NULL;
diff --git a/src/mymem.h b/src/mymem.h
index 81dff7a..fdfd7e6 100644
--- a/src/mymem.h
+++ b/src/mymem.h
@@ -98,7 +98,7 @@ void **GetPointerMemory (PointerListTypePtr);
void *MyCalloc (size_t, size_t, const char *);
void *MyMalloc (size_t, const char *);
void *MyRealloc (void *, size_t, const char *);
-char *MyStrdup (char *s, const char *);
+char *MyStrdup (const char *s, const char *);
/* void MyFree (void **); */
#define MYFREE(x) do { SaveFree(x); (x)=NULL; } while (0)
void FreePolygonMemory (PolygonTypePtr);
commit d882cbe3a56ba41e7723d8da1b57255d361075ac
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/lesstif: Revert some Boolean->bool type changes as required by Xt* APIs
This is a partial revert of commit ad5eb5a165442be38624aa622beeb57dc1d2afbd
For consistency, I have also reverted the changes of True->true and
False->false when calling X11 APIs.
diff --git a/src/hid/lesstif/dialogs.c b/src/hid/lesstif/dialogs.c
index 6c7a2de..a56e3a3 100644
--- a/src/hid/lesstif/dialogs.c
+++ b/src/hid/lesstif/dialogs.c
@@ -135,7 +135,7 @@ Load (int argc, char **argv, int x, int y)
n = 0;
stdarg (XmNpattern, pattern);
- stdarg (XmNmustMatch, true);
+ stdarg (XmNmustMatch, True);
stdarg (XmNselectionLabelString, xms_load);
XtSetValues (fsb, args, n);
@@ -188,7 +188,7 @@ LoadVendor (int argc, char **argv, int x, int y)
n = 0;
stdarg (XmNpattern, pattern);
- stdarg (XmNmustMatch, true);
+ stdarg (XmNmustMatch, True);
stdarg (XmNselectionLabelString, xms_loadv);
XtSetValues (fsb, args, n);
@@ -255,7 +255,7 @@ Save (int argc, char **argv, int x, int y)
n = 0;
stdarg (XmNpattern, pattern);
- stdarg (XmNmustMatch, false);
+ stdarg (XmNmustMatch, False);
stdarg (XmNselectionLabelString, xms_save);
XtSetValues (fsb, args, n);
@@ -325,7 +325,7 @@ lesstif_logv (const char *fmt, va_list ap)
Widget clear_button, dismiss_button;
n = 0;
- stdarg (XmNautoUnmanage, false);
+ stdarg (XmNautoUnmanage, False);
stdarg (XmNwidth, 600);
stdarg (XmNheight, 200);
stdarg (XmNtitle, "PCB Log");
@@ -349,9 +349,9 @@ lesstif_logv (const char *fmt, va_list ap)
(XtCallbackProc) log_dismiss, 0);
n = 0;
- stdarg (XmNeditable, false);
+ stdarg (XmNeditable, False);
stdarg (XmNeditMode, XmMULTI_LINE_EDIT);
- stdarg (XmNcursorPositionVisible, true);
+ stdarg (XmNcursorPositionVisible, True);
stdarg (XmNtopAttachment, XmATTACH_FORM);
stdarg (XmNleftAttachment, XmATTACH_FORM);
stdarg (XmNrightAttachment, XmATTACH_FORM);
@@ -474,7 +474,7 @@ lesstif_confirm_dialog (char *msg, ...)
wait_for_dialog (confirm_dialog);
n = 0;
- stdarg (XmNdefaultPosition, false);
+ stdarg (XmNdefaultPosition, False);
XtSetValues (confirm_dialog, args, n);
return ok;
@@ -511,16 +511,16 @@ lesstif_report_dialog (char *title, char *msg)
return;
n = 0;
- stdarg (XmNautoUnmanage, false);
+ stdarg (XmNautoUnmanage, False);
stdarg (XmNwidth, 600);
stdarg (XmNheight, 200);
stdarg (XmNtitle, title);
report_form = XmCreateFormDialog (mainwind, "report", args, n);
n = 0;
- stdarg (XmNeditable, false);
+ stdarg (XmNeditable, False);
stdarg (XmNeditMode, XmMULTI_LINE_EDIT);
- stdarg (XmNcursorPositionVisible, false);
+ stdarg (XmNcursorPositionVisible, False);
stdarg (XmNtopAttachment, XmATTACH_FORM);
stdarg (XmNleftAttachment, XmATTACH_FORM);
stdarg (XmNrightAttachment, XmATTACH_FORM);
@@ -560,7 +560,7 @@ lesstif_prompt_for (const char *msg, const char *default_string)
if (prompt_dialog == 0)
{
n = 0;
- stdarg (XmNautoUnmanage, false);
+ stdarg (XmNautoUnmanage, False);
stdarg (XmNtitle, "PCB Prompt");
prompt_dialog = XmCreateFormDialog (mainwind, "prompt", args, n);
@@ -578,7 +578,7 @@ lesstif_prompt_for (const char *msg, const char *default_string)
stdarg (XmNbottomAttachment, XmATTACH_WIDGET);
stdarg (XmNleftAttachment, XmATTACH_FORM);
stdarg (XmNrightAttachment, XmATTACH_FORM);
- stdarg (XmNeditable, true);
+ stdarg (XmNeditable, True);
prompt_text = XmCreateText (prompt_dialog, "text", args, n);
XtManageChild (prompt_text);
XtAddCallback (prompt_text, XmNactivateCallback,
@@ -752,20 +752,20 @@ lesstif_attribute_dialog (HID_Attribute * attrs,
break;
case HID_String:
stdarg (XmNcolumns, 40);
- stdarg (XmNresizeWidth, true);
+ stdarg (XmNresizeWidth, True);
stdarg (XmNvalue, results[i].str_value);
wl[i] = XmCreateTextField (form, attrs[i].name, args, n);
break;
case HID_Integer:
stdarg (XmNcolumns, 13);
- stdarg (XmNresizeWidth, true);
+ stdarg (XmNresizeWidth, True);
sprintf (buf, "%d", results[i].int_value);
stdarg (XmNvalue, buf);
wl[i] = XmCreateTextField (form, attrs[i].name, args, n);
break;
case HID_Real:
stdarg (XmNcolumns, 16);
- stdarg (XmNresizeWidth, true);
+ stdarg (XmNresizeWidth, True);
sprintf (buf, "%g", results[i].real_value);
stdarg (XmNvalue, buf);
wl[i] = XmCreateTextField (form, attrs[i].name, args, n);
@@ -1269,7 +1269,7 @@ AdjustSizes (int argc, char **argv, int x, int y)
stdarg (XmNmarginHeight, 3);
stdarg (XmNhorizontalSpacing, 3);
stdarg (XmNverticalSpacing, 3);
- stdarg (XmNautoUnmanage, false);
+ stdarg (XmNautoUnmanage, False);
stdarg (XmNtitle, "Board Sizes");
sizes_dialog = XmCreateFormDialog (mainwind, "sizes", args, n);
@@ -1640,8 +1640,8 @@ EditLayerGroups (int argc, char **argv, int x, int y)
stdarg (XmNbottomPosition, (i + 1) * MAX_LAYER);
stdarg (XmNlabelString, XmStringCreateLocalized (" "));
stdarg (XmNspacing, 0);
- stdarg (XmNvisibleWhenOff, true);
- stdarg (XmNfillOnSelect, true);
+ stdarg (XmNvisibleWhenOff, True);
+ stdarg (XmNfillOnSelect, True);
stdarg (XmNshadowThickness, 0);
stdarg (XmNmarginWidth, 0);
stdarg (XmNmarginHeight, 0);
@@ -1794,14 +1794,14 @@ lesstif_attributes_need_rows (int new_max)
(XtPointer) (size_t) attr_max_rows);
n = 0;
- stdarg (XmNresizeWidth, true);
+ stdarg (XmNresizeWidth, True);
attr_row[attr_max_rows].w_name = XmCreateTextField (f_top, "name", args, n);
XtManageChild (attr_row[attr_max_rows].w_name);
XtAddCallback (attr_row[attr_max_rows].w_name, XmNvalueChangedCallback,
(XtCallbackProc) fiddle_with_bb_layout, NULL);
n = 0;
- stdarg (XmNresizeWidth, true);
+ stdarg (XmNresizeWidth, True);
attr_row[attr_max_rows].w_value = XmCreateTextField (f_top, "value", args, n);
XtManageChild (attr_row[attr_max_rows].w_value);
XtAddCallback (attr_row[attr_max_rows].w_value, XmNvalueChangedCallback,
@@ -1897,7 +1897,7 @@ lesstif_attributes_dialog (char *owner, AttributeListType *attrs_list)
if (attr_dialog == NULL)
{
n = 0;
- stdarg (XmNautoUnmanage, false);
+ stdarg (XmNautoUnmanage, False);
stdarg (XmNtitle, owner);
stdarg (XmNwidth, 400);
stdarg (XmNheight, 300);
@@ -2049,7 +2049,7 @@ ImportGUI (int argc, char **argv, int x, int y)
n = 0;
stdarg (XmNpattern, xms_sch);
- stdarg (XmNmustMatch, true);
+ stdarg (XmNmustMatch, True);
stdarg (XmNselectionLabelString, xms_import);
XtSetValues (fsb, args, n);
diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c
index 5caec02..76dce1a 100644
--- a/src/hid/lesstif/main.c
+++ b/src/hid/lesstif/main.c
@@ -664,7 +664,7 @@ command_callback (Widget w, XtPointer uptr, XmTextVerifyCallbackStruct * cbs)
}
static void
-command_event_handler (Widget w, XtPointer p, XEvent * e, bool * cont)
+command_event_handler (Widget w, XtPointer p, XEvent * e, Boolean * cont)
{
char buf[10];
KeySym sym;
@@ -680,7 +680,7 @@ command_event_handler (Widget w, XtPointer p, XEvent * e, bool * cont)
XtUnmanageChild (m_cmd);
XtUnmanageChild (m_cmd_label);
XmTextSetString (w, "");
- *cont = false;
+ *cont = False;
break;
}
break;
@@ -1294,7 +1294,7 @@ mod_changed (XKeyEvent * e, int set)
}
static void
-work_area_input (Widget w, XtPointer v, XEvent * e, bool * ctd)
+work_area_input (Widget w, XtPointer v, XEvent * e, Boolean * ctd)
{
static int pressed_button = 0;
static int ignore_release = 0;
@@ -1673,7 +1673,7 @@ work_area_first_expose (Widget work_area, void *me,
XRenderColor a = {0, 0, 0, 0x8000};
pale_pixmap = XCreatePixmap (display, window, 1, 1, 8);
- pa.repeat = true;
+ pa.repeat = True;
pale_picture = XRenderCreatePicture (display, pale_pixmap,
XRenderFindStandardFormat(display, PictStandardA8),
CPRepeat, &pa);
@@ -1813,7 +1813,7 @@ lesstif_do_export (HID_Attr_Val * options)
XtManageChild (hscroll);
n = 0;
- stdarg (XmNresize, true);
+ stdarg (XmNresize, True);
stdarg (XmNresizePolicy, XmRESIZE_ANY);
messages = XmCreateForm (mainwind, "messages", args, n);
XtManageChild (messages);
@@ -1908,7 +1908,7 @@ typedef union
char *s;
} val_union;
-static bool
+static Boolean
cvtres_string_to_double (Display * d, XrmValue * args, Cardinal * num_args,
XrmValue * from, XrmValue * to,
XtPointer * converter_data)
@@ -1920,7 +1920,7 @@ cvtres_string_to_double (Display * d, XrmValue * args, Cardinal * num_args,
else
to->addr = (XPointer) & rv;
to->size = sizeof (rv);
- return true;
+ return True;
}
static void
@@ -2110,7 +2110,7 @@ lesstif_parse_arguments (int *argc, char ***argv)
XmAddWMProtocolCallback (appwidget, close_atom,
(XtCallbackProc) mainwind_delete_cb, 0);
- /* XSynchronize(display, true); */
+ /* XSynchronize(display, True); */
XtGetApplicationResources (appwidget, new_values, new_resources,
rmax, 0, 0);
@@ -2400,7 +2400,7 @@ lesstif_update_status_line ()
static int idle_proc_set = 0;
static int need_redraw = 0;
-static bool
+static Boolean
idle_proc (XtPointer dummy)
{
if (need_redraw)
@@ -2794,7 +2794,7 @@ idle_proc (XtPointer dummy)
show_crosshair (1);
idle_proc_set = 0;
- return true;
+ return True;
}
void
diff --git a/src/hid/lesstif/menu.c b/src/hid/lesstif/menu.c
index 9983d42..aca306d 100644
--- a/src/hid/lesstif/menu.c
+++ b/src/hid/lesstif/menu.c
@@ -271,7 +271,7 @@ LayersChanged (int argc, char **argv, int x, int y)
{
stdarg (XmNforeground, bg_color);
stdarg (XmNbackground, fg_colors[i]);
- stdarg (XmNset, current_layer == i ? true : false);
+ stdarg (XmNset, current_layer == i ? True : False);
}
XtSetValues (lb->w[i], args, n);
@@ -398,7 +398,7 @@ layerpick_button_callback (Widget w, int layer,
if (!lb->is_pick)
continue;
for (i = 0; i < LB_NUMPICK; i++)
- XmToggleButtonSetState (lb->w[i], layer == i, false);
+ XmToggleButtonSetState (lb->w[i], layer == i, False);
}
switch (layer)
{
@@ -1305,7 +1305,7 @@ add_resource_to_menu (Widget menu, Resource * node, XtCallbackProc callback)
if (resource_value (node->v[i].subres, "set"))
{
- stdarg (XmNset, true);
+ stdarg (XmNset, True);
}
stdarg (XmNindicatorType, XmONE_OF_MANY);
btn = XmCreateToggleButton (menu, "menubutton", args, n);
diff --git a/src/hid/lesstif/netlist.c b/src/hid/lesstif/netlist.c
index 7d31197..ee6d723 100644
--- a/src/hid/lesstif/netlist.c
+++ b/src/hid/lesstif/netlist.c
@@ -89,7 +89,7 @@ netlist_select (Widget w, void *v, XmListCallbackStruct * cbs)
str = XmStringCreateLocalized (name);
XmListReplaceItemsPos (netlist_list, &str, 1, pos);
XmStringFree (str);
- XmListSelectPos (netlist_list, pos, false);
+ XmListSelectPos (netlist_list, pos, False);
}
static void
@@ -175,7 +175,7 @@ nbcb_std_callback (Widget w, Std_Nbcb_Func v, XmPushButtonCallbackStruct * cbs)
{
int *posl, posc, i;
XmString **items, **selected;
- if (XmListGetSelectedPos (netlist_list, &posl, &posc) == false)
+ if (XmListGetSelectedPos (netlist_list, &posl, &posc) == False)
return;
if (v == nbcb_find)
hid_actionl ("connection", "reset", NULL);
@@ -314,7 +314,7 @@ build_netlist_dialog ()
n = 0;
stdarg (XmNresizePolicy, XmRESIZE_GROW);
stdarg (XmNtitle, "Netlists");
- stdarg (XmNautoUnmanage, false);
+ stdarg (XmNautoUnmanage, False);
netlist_dialog = XmCreateFormDialog (mainwind, "netlist", args, n);
n = 0;
@@ -435,15 +435,15 @@ LesstifNetlistShow (int argc, char **argv, int x, int y)
XmString item;
int vis = 0;
- /* Select net first, 'true' causes pick_net() to be invoked */
+ /* Select net first, 'True' causes pick_net() to be invoked */
item = XmStringCreateLocalized (net->Name);
- XmListSelectItem (netlist_list, item, true);
+ XmListSelectItem (netlist_list, item, True);
XmListSetItem (netlist_list, item);
XmStringFree (item);
/* Now the netnode_list has the right contents */
item = XmStringCreateLocalized (argv[0]);
- XmListSelectItem (netnode_list, item, false);
+ XmListSelectItem (netnode_list, item, False);
/*
* Only force the item to the top if there are enough to scroll.
@@ -470,7 +470,7 @@ LesstifNetlistShow (int argc, char **argv, int x, int y)
item = XmStringCreateLocalized (net->Name);
XmListSetItem (netlist_list, item);
- XmListSelectItem (netlist_list, item, true);
+ XmListSelectItem (netlist_list, item, True);
XmStringFree (item);
}
}
diff --git a/src/hid/lesstif/styles.c b/src/hid/lesstif/styles.c
index fb9d3b3..d3dcdaa 100644
--- a/src/hid/lesstif/styles.c
+++ b/src/hid/lesstif/styles.c
@@ -364,7 +364,7 @@ AdjustStyle (int argc, char **argv, int x, int y)
xms_mil = XmStringCreateLocalized ("mil");
n = 0;
- stdarg (XmNautoUnmanage, false);
+ stdarg (XmNautoUnmanage, False);
stdarg (XmNtitle, "Route Styles");
style_dialog = XmCreateFormDialog (mainwind, "style", args, n);
commit 6714f5ff18afbf12c2a059482d747d15f250d68e
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/lesstif: Use an intervening size_t casts to aovid compiler warnings
This is to avoid the compiler warning us what we already know.. that we
are passing an integer value cast into what might be a different sized
pointer. (On 64 bit builds).
diff --git a/src/hid/lesstif/dialogs.c b/src/hid/lesstif/dialogs.c
index b3cc375..6c7a2de 100644
--- a/src/hid/lesstif/dialogs.c
+++ b/src/hid/lesstif/dialogs.c
@@ -1791,7 +1791,7 @@ lesstif_attributes_need_rows (int new_max)
XtManageChild (attr_row[attr_max_rows].del);
XtAddCallback (attr_row[attr_max_rows].del, XmNactivateCallback,
(XtCallbackProc) attributes_delete_callback,
- (XtPointer) attr_max_rows);
+ (XtPointer) (size_t) attr_max_rows);
n = 0;
stdarg (XmNresizeWidth, true);
@@ -1862,7 +1862,7 @@ attributes_delete_callback (Widget w, void *v, void *cbs)
int i, n;
Widget wn, wv;
- n = (int) v;
+ n = (int) (size_t) v;
wn = attr_row[n].w_name;
wv = attr_row[n].w_value;
commit 2e46d5a7a626f703d868d25670af33b0c2afff17
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/batch: Add some missing header files for prototypes
diff --git a/src/hid/batch/batch.c b/src/hid/batch/batch.c
index 8d53d8c..9715c09 100644
--- a/src/hid/batch/batch.c
+++ b/src/hid/batch/batch.c
@@ -8,10 +8,14 @@
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include "global.h"
#include "hid.h"
#include "data.h"
+#include "misc.h"
+#include "hid.h"
+#include "../hidint.h"
#include "hid/common/actions.h"
#include "hid/common/hidinit.h"
commit 99ac52a605256bf60089d3177ff268d9fccf83ad
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common: Provide a header to define hid_parse_command_line()
Avoids having each caller having to pull it in with an extern declaration.
diff --git a/src/Makefile.am b/src/Makefile.am
index ef72012..a0f1c50 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -143,6 +143,7 @@ PCB_SRCS = \
hid/common/actions.h \
hid/common/flags.c \
hid/common/hidinit.c \
+ hid/common/hidinit.h \
hid/common/hidnogui.c \
hid/common/extents.c \
hid/common/draw_helpers.c \
diff --git a/src/hid/batch/batch.c b/src/hid/batch/batch.c
index 6bc0e58..8d53d8c 100644
--- a/src/hid/batch/batch.c
+++ b/src/hid/batch/batch.c
@@ -14,6 +14,7 @@
#include "data.h"
#include "hid/common/actions.h"
+#include "hid/common/hidinit.h"
#ifdef HAVE_LIBDMALLOC
#include <dmalloc.h>
diff --git a/src/hid/common/hidinit.h b/src/hid/common/hidinit.h
new file mode 100644
index 0000000..bd1174f
--- /dev/null
+++ b/src/hid/common/hidinit.h
@@ -0,0 +1,6 @@
+#ifndef __HID_INIT_INCLUDED__
+#define __HID_INIT_INCLUDED__
+
+void hid_parse_command_line (int *argc, char ***argv);
+
+#endif
diff --git a/src/hid/gcode/gcode.c b/src/hid/gcode/gcode.c
index 7a52a7c..f1bdcea 100644
--- a/src/hid/gcode/gcode.c
+++ b/src/hid/gcode/gcode.c
@@ -60,6 +60,8 @@
#include "trace.h"
#include "decompose.h"
+#include "hid/common/hidinit.h"
+
#ifdef HAVE_LIBDMALLOC
#include <dmalloc.h>
#endif
@@ -238,8 +240,6 @@ sort_drill (struct drill_struct *drill, int n_drill)
/* *** Main export callback ************************************************ */
-extern void hid_parse_command_line (int *argc, char ***argv);
-
static void
gcode_parse_arguments (int *argc, char ***argv)
{
diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index e2d9c57..1f6341b 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -29,6 +29,7 @@
#include "hid.h"
#include "../hidint.h"
#include "hid/common/draw_helpers.h"
+#include "hid/common/hidinit.h"
#ifdef HAVE_LIBDMALLOC
#include <dmalloc.h>
@@ -424,8 +425,6 @@ gerber_do_export (HID_Attr_Val * options)
PCB->Flags = save_thindraw;
}
-extern void hid_parse_command_line (int *argc, char ***argv);
-
static void
gerber_parse_arguments (int *argc, char ***argv)
{
diff --git a/src/hid/lpr/lpr.c b/src/hid/lpr/lpr.c
index aa696be..ac3e2db 100644
--- a/src/hid/lpr/lpr.c
+++ b/src/hid/lpr/lpr.c
@@ -17,6 +17,7 @@
#include "hid.h"
#include "../hidint.h"
#include "../ps/ps.h"
+#include "hid/common/hidinit.h"
#ifdef HAVE_LIBDMALLOC
#include <dmalloc.h>
@@ -97,8 +98,6 @@ lpr_do_export (HID_Attr_Val * options)
fclose (f);
}
-extern void hid_parse_command_line (int *argc, char ***argv);
-
static void
lpr_parse_arguments (int *argc, char ***argv)
{
diff --git a/src/hid/nelma/nelma.c b/src/hid/nelma/nelma.c
index c53ce05..5f6ebc7 100644
--- a/src/hid/nelma/nelma.c
+++ b/src/hid/nelma/nelma.c
@@ -75,6 +75,8 @@
#include <gd.h>
+#include "hid/common/hidinit.h"
+
#ifdef HAVE_LIBDMALLOC
#include <dmalloc.h>
#endif
@@ -484,8 +486,6 @@ nelma_write_objects(FILE * out)
/* *** Main export callback ************************************************ */
-extern void hid_parse_command_line(int *argc, char ***argv);
-
static void
nelma_parse_arguments(int *argc, char ***argv)
{
diff --git a/src/hid/png/png.c b/src/hid/png/png.c
index 5c52768..32639c8 100644
--- a/src/hid/png/png.c
+++ b/src/hid/png/png.c
@@ -47,6 +47,8 @@
/* the gd library which makes this all so easy */
#include <gd.h>
+#include "hid/common/hidinit.h"
+
#ifdef HAVE_LIBDMALLOC
#include <dmalloc.h>
#endif
@@ -876,8 +878,6 @@ png_do_export (HID_Attr_Val * options)
gdImageDestroy (im);
}
-extern void hid_parse_command_line (int *argc, char ***argv);
-
static void
png_parse_arguments (int *argc, char ***argv)
{
diff --git a/src/hid/ps/eps.c b/src/hid/ps/eps.c
index 1b85b7d..83ce780 100644
--- a/src/hid/ps/eps.c
+++ b/src/hid/ps/eps.c
@@ -18,6 +18,7 @@
#include "../hidint.h"
#include "hid/common/draw_helpers.h"
#include "../ps/ps.h"
+#include "hid/common/hidinit.h"
#ifdef HAVE_LIBDMALLOC
#include <dmalloc.h>
@@ -292,8 +293,6 @@ eps_do_export (HID_Attr_Val * options)
fclose (f);
}
-extern void hid_parse_command_line (int *argc, char ***argv);
-
static void
eps_parse_arguments (int *argc, char ***argv)
{
diff --git a/src/hid/ps/ps.c b/src/hid/ps/ps.c
index 3e72b81..814e23e 100644
--- a/src/hid/ps/ps.c
+++ b/src/hid/ps/ps.c
@@ -22,6 +22,7 @@
#include "hid/common/draw_helpers.h"
#include "../ps/ps.h"
#include "../../print.h"
+#include "hid/common/hidinit.h"
#ifdef HAVE_LIBDMALLOC
#include <dmalloc.h>
@@ -582,8 +583,6 @@ ps_do_export (HID_Attr_Val * options)
}
}
-extern void hid_parse_command_line (int *argc, char ***argv);
-
static void
ps_parse_arguments (int *argc, char ***argv)
{
commit b2f7f75a375ca20350891f464283018677763a61
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
hid/common: Provide a header file to define print_actions()
Avoids having each caller having to pull it in with an extern declaration.
diff --git a/src/Makefile.am b/src/Makefile.am
index e719268..ef72012 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -140,6 +140,7 @@ PCB_SRCS = \
vendor.c \
vendor.h \
hid/common/actions.c \
+ hid/common/actions.h \
hid/common/flags.c \
hid/common/hidinit.c \
hid/common/hidnogui.c \
diff --git a/src/hid/batch/batch.c b/src/hid/batch/batch.c
index cfa4e5a..6bc0e58 100644
--- a/src/hid/batch/batch.c
+++ b/src/hid/batch/batch.c
@@ -13,6 +13,8 @@
#include "hid.h"
#include "data.h"
+#include "hid/common/actions.h"
+
#ifdef HAVE_LIBDMALLOC
#include <dmalloc.h>
#endif
diff --git a/src/hid/common/actions.h b/src/hid/common/actions.h
new file mode 100644
index 0000000..1cc6f24
--- /dev/null
+++ b/src/hid/common/actions.h
@@ -0,0 +1,7 @@
+
+#ifndef __HID_ACTIONS_INCLUDED__
+#define __HID_ACTIONS_INCLUDED__
+
+void print_actions (void);
+
+#endif
diff --git a/src/main.c b/src/main.c
index ba8c959..923e0ee 100644
--- a/src/main.c
+++ b/src/main.c
@@ -54,6 +54,8 @@
#include "misc.h"
#include "lrealpath.h"
+#include "hid/common/actions.h"
+
/* This next one is so we can print the help messages. */
#include "hid/hidint.h"
@@ -372,10 +374,6 @@ print_defaults ()
exit (1);
}
-/* in hid/common/actions.c */
-extern void print_actions ();
-
-
#define SSET(F,D,N,H) { N, H, \
HID_String, 0, 0, { 0, D, 0 }, 0, &Settings.F }
#define ISET(F,D,N,H) { N, H, \
commit 42930014efab78eb5ddb06ea1ef9053c4c7bb13e
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Fix function prototypes and dummy return values for batch HID
Most of these are dummy functions, but we should get the prototypes
right! Also, return 0 from dummy functions which are supposed to return
an integer.
Fixes various compiler warnings.
diff --git a/src/hid/batch/batch.c b/src/hid/batch/batch.c
index 7db8a54..cfa4e5a 100644
--- a/src/hid/batch/batch.c
+++ b/src/hid/batch/batch.c
@@ -237,12 +237,12 @@ batch_fill_polygon (hidGC gc, int n_coords, int *x, int *y)
}
static void
-batch_fill_pcb_polygon (hidGC gc, PolygonType *poly)
+batch_fill_pcb_polygon (hidGC gc, PolygonType *poly, const BoxType *clip_box)
{
}
static void
-batch_thindraw_pcb_polygon (hidGC gc, PolygonType *poly)
+batch_thindraw_pcb_polygon (hidGC gc, PolygonType *poly, const BoxType *clip_box)
{
}
@@ -393,10 +393,11 @@ batch_fileselect (const char *title, const char *descr,
}
static int
-batch_attribute_dialog (HID_Attribute * attrs,
- int n_attrs, HID_Attr_Val * results,
- const char *descr)
+batch_attribute_dialog (HID_Attribute * attrs_,
+ int n_attrs_, HID_Attr_Val * results_,
+ const char *title_, const char *descr_)
{
+ return 0;
}
static void
@@ -411,9 +412,10 @@ batch_beep (void)
fflush (stdout);
}
-static void
-batch_progress (int so_far, int total, const char *message)
+static int
+batch_progress (int so_far_, int total_, const char *message_)
{
+ return 0;
}
HID batch_gui = {
commit 86585c7eb9c35faa9ea310c241e80edb038c2055
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
HID: Make arguments to the prompt_for method const char *, not char *
Avoids compiler warnings calling gui->prompt_for() with a const char *
diff --git a/src/hid.h b/src/hid.h
index dd34b8e..94734ba 100644
--- a/src/hid.h
+++ b/src/hid.h
@@ -468,7 +468,7 @@ typedef enum
/* Prompts the user to enter a string, returns the string. If
default_string isn't NULL, the form is pre-filled with this
value. "msg" is like "Enter value:". */
- char *(*prompt_for) (char *msg_, char *default_string_);
+ char *(*prompt_for) (const char *msg_, const char *default_string_);
/* Prompts the user for a filename or directory name. For GUI
HID's this would mean a file select dialog box. The 'flags'
diff --git a/src/hid/batch/batch.c b/src/hid/batch/batch.c
index f3b7d3c..7db8a54 100644
--- a/src/hid/batch/batch.c
+++ b/src/hid/batch/batch.c
@@ -363,7 +363,7 @@ batch_report_dialog (char *title, char *msg)
}
static char *
-batch_prompt_for (char *msg, char *default_string)
+batch_prompt_for (const char *msg, const char *default_string)
{
static char buf[1024];
if (default_string)
diff --git a/src/hid/common/hidnogui.c b/src/hid/common/hidnogui.c
index d5dc9e1..6111ec3 100644
--- a/src/hid/common/hidnogui.c
+++ b/src/hid/common/hidnogui.c
@@ -287,7 +287,7 @@ nogui_report_dialog (char *title, char *msg)
}
static char *
-nogui_prompt_for (char *msg, char *default_string)
+nogui_prompt_for (const char *msg, const char *default_string)
{
static char buf[1024];
if (default_string)
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 7d59672..a3947d0 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -867,7 +867,7 @@ ghid_report_dialog (char *title, char *msg)
}
char *
-ghid_prompt_for (char *msg, char *default_string)
+ghid_prompt_for (const char *msg, const char *default_string)
{
char *rv;
diff --git a/src/hid/gtk/gui-dialog.c b/src/hid/gtk/gui-dialog.c
index ec91233..1f6b11a 100644
--- a/src/hid/gtk/gui-dialog.c
+++ b/src/hid/gtk/gui-dialog.c
@@ -46,7 +46,7 @@ RCSID ("$Id$");
/* ---------------------------------------------- */
gchar *
-ghid_dialog_input (gchar * prompt, gchar * initial)
+ghid_dialog_input (const char * prompt, const char * initial)
{
GtkWidget *dialog, *vbox, *label, *entry;
gchar *string;
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index 7686106..4ad6cdc 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -332,7 +332,7 @@ int ghid_dialog_close_confirm (void);
#define GUI_DIALOG_CLOSE_CONFIRM_NOSAVE 1
#define GUI_DIALOG_CLOSE_CONFIRM_SAVE 2
gint ghid_dialog_confirm_all (gchar * message);
-gchar *ghid_dialog_input (gchar * prompt, gchar * initial);
+gchar *ghid_dialog_input (const char * prompt, const char * initial);
void ghid_dialog_about (void);
char * ghid_fileselect (const char *, const char *, char *, char *, const char *, int);
diff --git a/src/hid/lesstif/dialogs.c b/src/hid/lesstif/dialogs.c
index 544a718..b3cc375 100644
--- a/src/hid/lesstif/dialogs.c
+++ b/src/hid/lesstif/dialogs.c
@@ -544,7 +544,7 @@ lesstif_fileselect (const char *title, const char *descr,
const char *history_tag, int flags)
{
- return lesstif_prompt_for ((char *)title, default_file);
+ return lesstif_prompt_for (title, default_file);
}
/* ------------------------------------------------------------ */
@@ -553,7 +553,7 @@ static Widget prompt_dialog = 0;
static Widget prompt_label, prompt_text;
char *
-lesstif_prompt_for (char *msg, char *default_string)
+lesstif_prompt_for (const char *msg, const char *default_string)
{
char *rv;
XmString xs;
@@ -592,7 +592,7 @@ lesstif_prompt_for (char *msg, char *default_string)
xs = XmStringCreateLocalized ((char *)msg);
stdarg (XmNlabelString, xs);
XtSetValues (prompt_label, args, n);
- XmTextSetString (prompt_text, default_string);
+ XmTextSetString (prompt_text, (char *)default_string);
XmTextSetCursorPosition (prompt_text, strlen (default_string));
wait_for_dialog (prompt_dialog);
rv = XmTextGetString (prompt_text);
diff --git a/src/hid/lesstif/lesstif.h b/src/hid/lesstif/lesstif.h
index 54e4ced..3bc822b 100644
--- a/src/hid/lesstif/lesstif.h
+++ b/src/hid/lesstif/lesstif.h
@@ -50,7 +50,7 @@ extern void lesstif_insert_style_buttons (Widget menu);
extern void lesstif_styles_update_values ();
extern void lesstif_update_layer_groups ();
extern void lesstif_update_status_line ();
-extern char *lesstif_prompt_for (char *, char *);
+extern char *lesstif_prompt_for (const char *, const char *);
extern char *lesstif_fileselect (const char *, const char *,
char *, char *,
const char *, int);
commit 2265df977e20edf832f56c74e78fca1e15b45555
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Rename "r" variables used in calls to GetValue() to be more descriptive
A purely cosmetic change.
diff --git a/src/action.c b/src/action.c
index b8707d1..34d54e2 100644
--- a/src/action.c
+++ b/src/action.c
@@ -2211,24 +2211,25 @@ ActionSetValue (int argc, char **argv, int x, int y)
char *function = ARG (0);
char *val = ARG (1);
char *units = ARG (2);
- bool r; /* flag for 'relative' value */
+ bool absolute; /* flag for 'absolute' value */
float value;
int err = 0;
if (function && val)
{
HideCrosshair (true);
- value = GetValue (val, units, &r);
+ value = GetValue (val, units, &absolute);
switch (GetFunctionID (function))
{
case F_ViaDrillingHole:
- SetViaDrillingHole (r ? value : value + Settings.ViaDrillingHole,
+ SetViaDrillingHole (absolute ? value :
+ value + Settings.ViaDrillingHole,
false);
hid_action ("RouteStylesChanged");
break;
case F_Grid:
- if (!r)
+ if (!absolute)
{
if ((value == (int) value && PCB->Grid == (int) PCB->Grid)
|| (value != (int) value && PCB->Grid != (int) PCB->Grid)
@@ -2256,20 +2257,20 @@ ActionSetValue (int argc, char **argv, int x, int y)
case F_LineSize:
case F_Line:
- SetLineSize (r ? value : value + Settings.LineThickness);
+ SetLineSize (absolute ? value : value + Settings.LineThickness);
hid_action ("RouteStylesChanged");
break;
case F_Via:
case F_ViaSize:
- SetViaSize (r ? value : value + Settings.ViaThickness, false);
+ SetViaSize (absolute ? value : value + Settings.ViaThickness, false);
hid_action ("RouteStylesChanged");
break;
case F_Text:
case F_TextScale:
value /= 45;
- SetTextScale (r ? value : value + Settings.TextScale);
+ SetTextScale (absolute ? value : value + Settings.TextScale);
break;
default:
err = 1;
@@ -4070,12 +4071,12 @@ ActionChangeSize (int argc, char **argv, int x, int y)
char *function = ARG (0);
char *delta = ARG (1);
char *units = ARG (2);
- bool r; /* indicates if absolute size is given */
+ bool absolute; /* indicates if absolute size is given */
float value;
if (function && delta)
{
- value = GetValue (delta, units, &r);
+ value = GetValue (delta, units, &absolute);
HideCrosshair (true);
switch (GetFunctionID (function))
{
@@ -4089,54 +4090,54 @@ ActionChangeSize (int argc, char **argv, int x, int y)
&ptr1, &ptr2, &ptr3)) != NO_TYPE)
if (TEST_FLAG (LOCKFLAG, (PinTypePtr) ptr2))
Message (_("Sorry, the object is locked\n"));
- if (ChangeObjectSize (type, ptr1, ptr2, ptr3, value, r))
+ if (ChangeObjectSize (type, ptr1, ptr2, ptr3, value, absolute))
SetChangedFlag (true);
break;
}
case F_SelectedVias:
- if (ChangeSelectedSize (VIA_TYPE, value, r))
+ if (ChangeSelectedSize (VIA_TYPE, value, absolute))
SetChangedFlag (true);
break;
case F_SelectedPins:
- if (ChangeSelectedSize (PIN_TYPE, value, r))
+ if (ChangeSelectedSize (PIN_TYPE, value, absolute))
SetChangedFlag (true);
break;
case F_SelectedPads:
- if (ChangeSelectedSize (PAD_TYPE, value, r))
+ if (ChangeSelectedSize (PAD_TYPE, value, absolute))
SetChangedFlag (true);
break;
case F_SelectedArcs:
- if (ChangeSelectedSize (ARC_TYPE, value, r))
+ if (ChangeSelectedSize (ARC_TYPE, value, absolute))
SetChangedFlag (true);
break;
case F_SelectedLines:
- if (ChangeSelectedSize (LINE_TYPE, value, r))
+ if (ChangeSelectedSize (LINE_TYPE, value, absolute))
SetChangedFlag (true);
break;
case F_SelectedTexts:
- if (ChangeSelectedSize (TEXT_TYPE, value, r))
+ if (ChangeSelectedSize (TEXT_TYPE, value, absolute))
SetChangedFlag (true);
break;
case F_SelectedNames:
- if (ChangeSelectedSize (ELEMENTNAME_TYPE, value, r))
+ if (ChangeSelectedSize (ELEMENTNAME_TYPE, value, absolute))
SetChangedFlag (true);
break;
case F_SelectedElements:
- if (ChangeSelectedSize (ELEMENT_TYPE, value, r))
+ if (ChangeSelectedSize (ELEMENT_TYPE, value, absolute))
SetChangedFlag (true);
break;
case F_Selected:
case F_SelectedObjects:
- if (ChangeSelectedSize (CHANGESIZE_TYPES, value, r))
+ if (ChangeSelectedSize (CHANGESIZE_TYPES, value, absolute))
SetChangedFlag (true);
break;
}
@@ -4164,12 +4165,12 @@ ActionChange2ndSize (int argc, char **argv, int x, int y)
char *function = ARG (0);
char *delta = ARG (1);
char *units = ARG (2);
- bool r;
+ bool absolute;
float value;
if (function && delta)
{
- value = GetValue (delta, units, &r);
+ value = GetValue (delta, units, &absolute);
HideCrosshair (true);
switch (GetFunctionID (function))
{
@@ -4183,23 +4184,23 @@ ActionChange2ndSize (int argc, char **argv, int x, int y)
SearchScreen (x, y, CHANGE2NDSIZE_TYPES,
&ptr1, &ptr2, &ptr3)) != NO_TYPE)
if (ChangeObject2ndSize
- (type, ptr1, ptr2, ptr3, value, r, true))
+ (type, ptr1, ptr2, ptr3, value, absolute, true))
SetChangedFlag (true);
break;
}
case F_SelectedVias:
- if (ChangeSelected2ndSize (VIA_TYPE, value, r))
+ if (ChangeSelected2ndSize (VIA_TYPE, value, absolute))
SetChangedFlag (true);
break;
case F_SelectedPins:
- if (ChangeSelected2ndSize (PIN_TYPE, value, r))
+ if (ChangeSelected2ndSize (PIN_TYPE, value, absolute))
SetChangedFlag (true);
break;
case F_Selected:
case F_SelectedObjects:
- if (ChangeSelected2ndSize (PIN_TYPES, value, r))
+ if (ChangeSelected2ndSize (PIN_TYPES, value, absolute))
SetChangedFlag (true);
break;
}
@@ -4233,12 +4234,12 @@ ActionChangeClearSize (int argc, char **argv, int x, int y)
char *function = ARG (0);
char *delta = ARG (1);
char *units = ARG (2);
- bool r;
+ bool absolute;
float value;
if (function && delta)
{
- value = 2 * GetValue (delta, units, &r);
+ value = 2 * GetValue (delta, units, &absolute);
HideCrosshair (true);
switch (GetFunctionID (function))
{
@@ -4252,33 +4253,33 @@ ActionChangeClearSize (int argc, char **argv, int x, int y)
SearchScreen (x, y,
CHANGECLEARSIZE_TYPES, &ptr1, &ptr2,
&ptr3)) != NO_TYPE)
- if (ChangeObjectClearSize (type, ptr1, ptr2, ptr3, value, r))
+ if (ChangeObjectClearSize (type, ptr1, ptr2, ptr3, value, absolute))
SetChangedFlag (true);
break;
}
case F_SelectedVias:
- if (ChangeSelectedClearSize (VIA_TYPE, value, r))
+ if (ChangeSelectedClearSize (VIA_TYPE, value, absolute))
SetChangedFlag (true);
break;
case F_SelectedPads:
- if (ChangeSelectedClearSize (PAD_TYPE, value, r))
+ if (ChangeSelectedClearSize (PAD_TYPE, value, absolute))
SetChangedFlag (true);
break;
case F_SelectedPins:
- if (ChangeSelectedClearSize (PIN_TYPE, value, r))
+ if (ChangeSelectedClearSize (PIN_TYPE, value, absolute))
SetChangedFlag (true);
break;
case F_SelectedLines:
- if (ChangeSelectedClearSize (LINE_TYPE, value, r))
+ if (ChangeSelectedClearSize (LINE_TYPE, value, absolute))
SetChangedFlag (true);
break;
case F_SelectedArcs:
- if (ChangeSelectedClearSize (ARC_TYPE, value, r))
+ if (ChangeSelectedClearSize (ARC_TYPE, value, absolute))
SetChangedFlag (true);
break;
case F_Selected:
case F_SelectedObjects:
- if (ChangeSelectedClearSize (CHANGECLEARSIZE_TYPES, value, r))
+ if (ChangeSelectedClearSize (CHANGECLEARSIZE_TYPES, value, absolute))
SetChangedFlag (true);
break;
}
@@ -4309,7 +4310,7 @@ ActionMinMaskGap (int argc, char **argv, int x, int y)
char *function = ARG (0);
char *delta = ARG (1);
char *units = ARG (2);
- bool r;
+ bool absolute;
int value;
int flags;
@@ -4323,7 +4324,7 @@ ActionMinMaskGap (int argc, char **argv, int x, int y)
delta = function;
flags = 0;
}
- value = 2 * GetValue (delta, units, &r);
+ value = 2 * GetValue (delta, units, &absolute);
HideCrosshair (true);
SaveUndoSerialNumber ();
@@ -4393,7 +4394,7 @@ ActionMinClearGap (int argc, char **argv, int x, int y)
char *function = ARG (0);
char *delta = ARG (1);
char *units = ARG (2);
- bool r;
+ bool absolute;
int value;
int flags;
@@ -4407,7 +4408,7 @@ ActionMinClearGap (int argc, char **argv, int x, int y)
delta = function;
flags = 0;
}
- value = 2 * GetValue (delta, units, &r);
+ value = 2 * GetValue (delta, units, &absolute);
HideCrosshair (true);
SaveUndoSerialNumber ();
@@ -6137,7 +6138,7 @@ ActionPasteBuffer (int argc, char **argv, int x, int y)
{
static int oldx = 0, oldy = 0;
int x, y;
- bool r;
+ bool absolute;
if (argc == 1)
{
@@ -6145,11 +6146,11 @@ ActionPasteBuffer (int argc, char **argv, int x, int y)
}
else if (argc == 3 || argc == 4)
{
- x = GetValue (ARG (1), ARG (3), &r);
- if (!r)
+ x = GetValue (ARG (1), ARG (3), &absolute);
+ if (!absolute)
x += oldx;
- y = GetValue (ARG (2), ARG (3), &r);
- if (!r)
+ y = GetValue (ARG (2), ARG (3), &absolute);
+ if (!absolute)
y += oldy;
}
else
@@ -6512,12 +6513,12 @@ ActionMoveObject (int argc, char **argv, int x, int y)
char *y_str = ARG (1);
char *units = ARG (2);
LocationType nx, ny;
- bool r1, r2;
+ bool absolute1, absolute2;
void *ptr1, *ptr2, *ptr3;
int type;
- ny = GetValue (y_str, units, &r1);
- nx = GetValue (x_str, units, &r2);
+ ny = GetValue (y_str, units, &absolute1);
+ nx = GetValue (x_str, units, &absolute2);
type = SearchScreen (x, y, MOVE_TYPES, &ptr1, &ptr2, &ptr3);
if (type == NO_TYPE)
@@ -6525,9 +6526,9 @@ ActionMoveObject (int argc, char **argv, int x, int y)
Message (_("Nothing found under crosshair\n"));
return 1;
}
- if (r1)
+ if (absolute1)
nx -= x;
- if (r2)
+ if (absolute2)
ny -= y;
Crosshair.AttachedObject.RubberbandN = 0;
if (TEST_FLAG (RUBBERBANDFLAG, PCB))
@@ -7013,7 +7014,7 @@ parse_layout_attribute_units (char *name, int def)
{
const char *as, *units = NULL;
int n = 0, v;
- bool r;
+ bool absolute;
as = AttributeGet (PCB, name);
if (!as)
@@ -7023,7 +7024,7 @@ parse_layout_attribute_units (char *name, int def)
units = as + n;
if (! *units)
units = NULL;
- v = GetValue (as, units, &r);
+ v = GetValue (as, units, &absolute);
return v;
}
@@ -7654,9 +7655,9 @@ ActionImport (int argc, char **argv, int x, int y)
}
else if (ys)
{
- bool r;
- x = GetValue (xs, units, &r);
- y = GetValue (ys, units, &r);
+ bool absolute;
+ x = GetValue (xs, units, &absolute);
+ y = GetValue (ys, units, &absolute);
}
else
{
commit 5f9832e8b50bd56dd56d28391dc6cb8c7be8a0d9
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
action.c: Fix data types in GetValue calls
We passed an (int *) rather than a (bool *) in ActionImport() and
parse_layout_attribute_units()
diff --git a/src/action.c b/src/action.c
index 8d5931a..b8707d1 100644
--- a/src/action.c
+++ b/src/action.c
@@ -7012,7 +7012,8 @@ static int
parse_layout_attribute_units (char *name, int def)
{
const char *as, *units = NULL;
- int n = 0, v, r;
+ int n = 0, v;
+ bool r;
as = AttributeGet (PCB, name);
if (!as)
@@ -7653,7 +7654,7 @@ ActionImport (int argc, char **argv, int x, int y)
}
else if (ys)
{
- int r;
+ bool r;
x = GetValue (xs, units, &r);
y = GetValue (ys, units, &r);
}
commit 05f663f3905d3dde859fefa1f614c29d67428539
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Change unmodifed parameters to GetValue to const char *
Silences some compiler warnings in action.c
diff --git a/src/misc.c b/src/misc.c
index 76b05c0..b1d4304 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -108,7 +108,7 @@ static struct
* bool variable absolute to false if it leads with a +/- character
*/
float
-GetValue (char *val, char *units, bool * absolute)
+GetValue (const char *val, const char *units, bool * absolute)
{
double value;
int n = -1;
diff --git a/src/misc.h b/src/misc.h
index bb88a21..82bd194 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -74,7 +74,7 @@ BoxTypePtr GetArcEnds (ArcTypePtr);
void ChangeArcAngles (LayerTypePtr, ArcTypePtr, long int, long int);
char *UniqueElementName (DataTypePtr, char *);
void AttachForCopy (LocationType, LocationType);
-float GetValue (char *, char *, bool *);
+float GetValue (const char *, const char *, bool *);
int FileExists (const char *);
char *Concat (const char *, ...); /* end with NULL */
commit 7fa6e8145b3a9e2b85b42a2bae12d55fe0005ae1
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
autoroute.c: #if 0 out an unused static function add_clearance()
Silences compiler warning.
diff --git a/src/autoroute.c b/src/autoroute.c
index ea97d01..9ccab97 100644
--- a/src/autoroute.c
+++ b/src/autoroute.c
@@ -3428,6 +3428,7 @@ RD_DrawManhattanLine (routedata_t * rd,
}
/* for smoothing, don't pack traces to min clearance gratuitously */
+#if 0
static void
add_clearance (CheapPointType * nextpoint, const BoxType * b)
{
@@ -3464,6 +3465,7 @@ add_clearance (CheapPointType * nextpoint, const BoxType * b)
nextpoint->Y = (b->Y1 + b->Y2) / 2;
}
}
+#endif
/* This back-traces the expansion boxes along the best path
* it draws the lines that will make the actual path.
commit ec76a0d17c1baea2dd83a6a67b6fe48aee74b547
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
djopt.c: #if 0 out an unused static function nudge_corner()
Silences a compiler warning.
diff --git a/src/djopt.c b/src/djopt.c
index 800e574..b5d9c39 100644
--- a/src/djopt.c
+++ b/src/djopt.c
@@ -2491,6 +2491,7 @@ dump_all ()
}
#endif
+#if 0
static void
nudge_corner (corner_s * c, int dx, int dy, corner_s * prev_corner)
{
@@ -2511,6 +2512,7 @@ nudge_corner (corner_s * c, int dx, int dy, corner_s * prev_corner)
nudge_corner (oc, 0, dy, c);
}
}
+#endif
static line_s *
choose_example_line (corner_s * c1, corner_s * c2)
commit d5fd3e348da36c4fb10100b0cc5e218069c309c9
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
buffer.c: Declare variables before code in ActionFreeRotateBuffer()
Avoids compiler warning "ISO C90 forbids mixed declarations and code"
diff --git a/src/buffer.c b/src/buffer.c
index bec918f..f9d6f5a 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1449,9 +1449,10 @@ angle is given, the user is prompted for one.
int
ActionFreeRotateBuffer(int argc, char **argv, int x, int y)
{
- HideCrosshair(false);
char *angle_s;
+ HideCrosshair(false);
+
if (argc < 1)
angle_s = gui->prompt_for ("Enter Rotation (degrees, CCW):", "0");
else
commit a17c8a99d84ba8408ffe6173813a982016545cba
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
change.c: Remove unused variable in ChangeElementText()
diff --git a/src/change.c b/src/change.c
index 5546f1f..df7f454 100644
--- a/src/change.c
+++ b/src/change.c
@@ -1034,8 +1034,6 @@ ChangeElementText (PCBType *pcb, DataType *data, ElementT...
[truncated message content] |
|
From: <gi...@gp...> - 2010-12-08 23:20:58
|
The branch, master has been updated
via bdf06d189aa089b01e13753c3164d35c1aaa8d5e (commit)
from 466b0183758ef3ca44623c43de60a233b175d2ad (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/buffer.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit bdf06d189aa089b01e13753c3164d35c1aaa8d5e
Author: Stephen Ecob <sil...@gm...>
Commit: Peter Clifton <pc...@ca...>
Fix SmashBufferElement(), broken by fixing a memory leak in FreeDataMemory()
Commit 466b0183758ef3ca44623c43de60a233b175d2ad broke SmashBufferElement()
by changing FreeDataMemory() (which SmashBufferElement() calls via
ClearBuffer()). SmashBufferElement() depended on the memory leak of
Data->Element in FreeDataMemory().
This patch removes the dependence on the leak.
Commit-message-reformatted-by: Peter Clifton <pc...@ca...>
:100644 100644 1b2d27c... bec918f... M src/buffer.c
=========
Changes
=========
commit bdf06d189aa089b01e13753c3164d35c1aaa8d5e
Author: Stephen Ecob <sil...@gm...>
Commit: Peter Clifton <pc...@ca...>
Fix SmashBufferElement(), broken by fixing a memory leak in FreeDataMemory()
Commit 466b0183758ef3ca44623c43de60a233b175d2ad broke SmashBufferElement()
by changing FreeDataMemory() (which SmashBufferElement() calls via
ClearBuffer()). SmashBufferElement() depended on the memory leak of
Data->Element in FreeDataMemory().
This patch removes the dependence on the leak.
Commit-message-reformatted-by: Peter Clifton <pc...@ca...>
diff --git a/src/buffer.c b/src/buffer.c
index 1b2d27c..bec918f 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -933,7 +933,17 @@ SmashBufferElement (BufferTypePtr Buffer)
Message (_("Error! Buffer doesn't contain a single element\n"));
return (false);
}
+ /*
+ * At this point the buffer should contain just a single element.
+ * Now we detach the single element from the buffer and then clear the
+ * buffer, ready to receive the smashed elements. As a result of detaching
+ * it the single element is orphaned from the buffer and thus will not be
+ * free()'d by FreeDataMemory (called via ClearBuffer). This leaves it
+ * around for us to smash bits off it. It then becomes our responsibility,
+ * however, to free the single element when we're finished with it.
+ */
element = &Buffer->Data->Element[0];
+ Buffer->Data->Element = NULL;
Buffer->Data->ElementN = 0;
ClearBuffer (Buffer);
ELEMENTLINE_LOOP (element);
|
|
From: <gi...@gp...> - 2010-12-07 13:44:01
|
The branch, master has been updated
via 466b0183758ef3ca44623c43de60a233b175d2ad (commit)
from 4e22cf4e48f4eb9e0a199c65cded32e15dea420d (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/misc.c | 6 ++++++
src/mymem.c | 3 +++
2 files changed, 9 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit 466b0183758ef3ca44623c43de60a233b175d2ad
Author: Stephen Ecob <sil...@gm...>
Commit: Peter Clifton <pc...@ca...>
Fixed some memory leaks associated with the global PCB structure.
:100644 100644 faeefa8... 76b05c0... M src/misc.c
:100644 100644 bed0f9b... 59f8f8d... M src/mymem.c
=========
Changes
=========
commit 466b0183758ef3ca44623c43de60a233b175d2ad
Author: Stephen Ecob <sil...@gm...>
Commit: Peter Clifton <pc...@ca...>
Fixed some memory leaks associated with the global PCB structure.
diff --git a/src/misc.c b/src/misc.c
index faeefa8..76b05c0 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -888,6 +888,12 @@ QuitApplication (void)
else
DisableEmergencySave ();
+ /* Free up memory allocated to the PCB. Why bother when we're about to exit ?
+ * Because it removes some false positives from heap bug detectors such as
+ * lib dmalloc.
+ */
+ FreePCBMemory(PCB);
+
exit (0);
}
diff --git a/src/mymem.c b/src/mymem.c
index bed0f9b..59f8f8d 100644
--- a/src/mymem.c
+++ b/src/mymem.c
@@ -923,11 +923,14 @@ FreeDataMemory (DataTypePtr Data)
MYFREE (via->Name);
}
END_LOOP;
+ MYFREE (Data->Via);
ELEMENT_LOOP (Data);
{
FreeElementMemory (element);
}
END_LOOP;
+ MYFREE (Data->Element);
+ MYFREE (Data->Rat);
for (layer = Data->Layer, i = 0; i < MAX_LAYER + 2; layer++, i++)
{
|
|
From: <gi...@gp...> - 2010-11-28 05:08:41
|
The branch, master has been updated
via 4e22cf4e48f4eb9e0a199c65cded32e15dea420d (commit)
from 8aae80e95b0da076164bfd6e4a213d487cf9abf6 (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/djopt.c | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
=================
Commit Messages
=================
commit 4e22cf4e48f4eb9e0a199c65cded32e15dea420d
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Store is_pad flag for each line rather than trying to deduce
if a line is a pad or not.
:100644 100644 240b86b... 800e574... M src/djopt.c
=========
Changes
=========
commit 4e22cf4e48f4eb9e0a199c65cded32e15dea420d
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Store is_pad flag for each line rather than trying to deduce
if a line is a pad or not.
diff --git a/src/djopt.c b/src/djopt.c
index 240b86b..800e574 100644
--- a/src/djopt.c
+++ b/src/djopt.c
@@ -100,6 +100,7 @@ typedef struct line_s
struct line_s *next;
corner_s *s, *e;
LineType *line;
+ char is_pad;
} line_s;
typedef struct rect_s
@@ -155,8 +156,9 @@ HID_Flag djopt_flag_list[] = {
};
REGISTER_FLAGS (djopt_flag_list)
-#define line_is_pad(l) ((l)->line == (LineType *)(l)->s->pad)
- static char *element_name_for (corner_s * c)
+
+static char *
+element_name_for (corner_s * c)
{
int i, p;
ElementType *e;
@@ -267,7 +269,7 @@ check2 (int srcline, corner_s * c, line_s * l)
break;
if (i == ll->e->n_lines)
dj_abort ("check:%d: ll->e has no backref\n", srcline);
- if (!line_is_pad (ll)
+ if (!ll->is_pad
&& (ll->s->x != ll->line->Point1.X
|| ll->s->y != ll->line->Point1.Y
|| ll->e->x != ll->line->Point2.X
@@ -567,6 +569,7 @@ new_line (corner_s * s, corner_s * e, int layer, LineType * example)
ls = (line_s *) malloc (sizeof (line_s));
ls->next = lines;
lines = ls;
+ ls->is_pad = 0;
ls->s = s;
ls->e = e;
ls->layer = layer;
@@ -995,7 +998,7 @@ split_line (line_s * l, corner_s * c)
if (!intersecting_layers (l->layer, c->layer))
return 0;
- if (line_is_pad (l))
+ if (l->is_pad)
return 0;
if (c->pad)
{
@@ -1022,6 +1025,7 @@ split_line (line_s * l, corner_s * c)
ls->next = lines;
lines = ls;
+ ls->is_pad = 0;
ls->s = c;
ls->e = l->e;
ls->line = pcbline;
@@ -2830,6 +2834,9 @@ padcleaner ()
{
nextl = l->next;
+ if (l->is_pad)
+ continue;
+
if (DELETED (l))
continue;
@@ -3002,6 +3009,7 @@ ActionDJopt (int argc, char **argv, int x, int y)
line_s *ls = (line_s *) malloc (sizeof (line_s));
ls->next = lines;
lines = ls;
+ ls->is_pad = 1;
ls->s = find_corner (pad->Point1.X, pad->Point1.Y, layern);
ls->s->pad = pad;
ls->e = find_corner (pad->Point2.X, pad->Point2.Y, layern);
@@ -3009,9 +3017,6 @@ ActionDJopt (int argc, char **argv, int x, int y)
ls->layer = layern;
ls->line = (LineTypePtr) pad;
add_line_to_corner (ls, ls->s);
- ls->layer = layern;
- ls->line = (LineTypePtr) pad;
- add_line_to_corner (ls, ls->s);
add_line_to_corner (ls, ls->e);
}
@@ -3059,6 +3064,7 @@ ActionDJopt (int argc, char **argv, int x, int y)
ls = (line_s *) malloc (sizeof (line_s));
ls->next = lines;
lines = ls;
+ ls->is_pad = 0;
ls->s = find_corner (l->Point1.X, l->Point1.Y, layn);
ls->e = find_corner (l->Point2.X, l->Point2.Y, layn);
ls->line = l;
|
|
From: <gi...@gp...> - 2010-11-26 03:29:20
|
The branch, master has been updated
via 8aae80e95b0da076164bfd6e4a213d487cf9abf6 (commit)
via 093a606b182229c8e28118ace1be7d6b6ad5cf7f (commit)
via c582326a43cf659233a9438c303c75c80ba1db73 (commit)
via f6e43daeb4379263ea8c7af64a6008a8c457c331 (commit)
via 6669edbdb52cfdd46b0dc2ecd63e020a21fd8139 (commit)
via 7c435c090d0f38b5ae865e233a881b381961e7d2 (commit)
via 235e39298a9a464fd1b610d3a1e4de77a794dd60 (commit)
from 323a0c52f7dfdaae51fd7ead87373b3dac90be14 (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/polyarea.h | 1 +
src/polygon.c | 76 ++++-
src/polygon1.c | 1036 ++++++++++++++++++++++++++++++++++++++++++++++----------
3 files changed, 930 insertions(+), 183 deletions(-)
=================
Commit Messages
=================
commit 093a606b182229c8e28118ace1be7d6b6ad5cf7f
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
polygon1.c: Avoid re-starting the intersection routine for each new node
This seems to have a nice performance win for the NoHoles dicer, which
may have suffered due to other polygon changes which increased operation
overhead. (The NoHoles dicer deliberately causes intersections, so
will benefit from speed improvements in the intersection routine).
Rather than inserting nodes when we find intersections in seg_in_seg(),
(which requires an immediate restart of the intersection search), build
a queue of deferred work to be executed at the end of each iteration.
The intersected segments will be split at end of this search pass.
Once a segment has been queued for splitting, further intersections
detected with that segment must be ignored until the next pass
(after the segment has been split at the new node). The current pass
can continue to calculate intersections between _other_ segments.
Whenever an iteration finishes and nodes are added by deferred work,
another iteration of the intersection loop is required. Processing
stops after an iteration when no new nodes are added
:100644 100644 1127fbd... 468c139... M src/polygon1.c
commit c582326a43cf659233a9438c303c75c80ba1db73
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Various speedups to the polygon code.
Attempt to fix polygon slowness by avoiding the need to create a
completely new polygon for each boolean operation. This mostly relies
upon r-tree searches to find contours to operate on - rather than
searching each in turn.
We avoid labelling all of the "A" polygon's contours, use the contour
r-trees to dynamically search the required data.
Added code to reparent holes which end up in the wrong polygon piece
after inserting a new hole in InsertHoles. This means we don't have
to dump every potental hole we encounter in the holes insersion queue,
hopefully leading to better dynamic update performance.
At this point, polygon performance has finally seen a net gain.
HOWEVER: Due to differences in the order of polygon operations, the
data-structures resulting from a boolean polygon operation
may be sorted differently.
In certain contrived cases, where a polygon is clipped into
identically sized pieces, the resulting piece of polygon
which PCB will keep and use on the board is different after
this commit.
:100644 100644 a0be8e6... 1127fbd... M src/polygon1.c
commit f6e43daeb4379263ea8c7af64a6008a8c457c331
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Use heap structure to insert holes quicker in InsertHoles()
:100644 100644 2799a67... a0be8e6... M src/polygon1.c
commit 6669edbdb52cfdd46b0dc2ecd63e020a21fd8139
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Optimise polygon operations by keeping an rtree of POLYAREA contours
Attempt to speed up the intersect() routine using this rtree rather
than generating a new one at each call.
Due to the increased overheads of keeping an r-tree up to date, there
is a significant overall slow-down at this point in the patch series.
:100644 100644 958498b... ce427ad... M src/polyarea.h
:100644 100644 65879c8... 74d4bc4... M src/polygon.c
:100644 100644 d2c0798... 2799a67... M src/polygon1.c
commit 7c435c090d0f38b5ae865e233a881b381961e7d2
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Use rtree of countours when computing an intersection
NOTE: This is more complex than the existing code, and on its own,
actually slows things down a little.
The intention is that the r-tree should be maintained continually,
so it doesn't need to be recreated with each call to intersect().
:100644 100644 329058e... d2c0798... M src/polygon1.c
commit 235e39298a9a464fd1b610d3a1e4de77a794dd60
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
polygon.c: Accumulate vias and lines into batches before subtracting them
Accumulate polygons to clear from lines and pins in batches, then
clear from the polygon. Not quite sure why, but this _really_ seems to
speed up loading very complex boards. (e.g. 50sec -> 10sec for one example).
Possibly this is because withing the assembled batches, it is cheaper to
produce a more unified contour (touching lines), and the complex contours
of the main polygon are broken less frequently.
It isn't quite clear why this helps so much for pins / vias (which won't
usually touch each-other), however it changes a 50sec load time to 10 sec.
This could perhaps be because any contours which are smashed by clearance
of closely spaced vias / pins now only incurr the penalty of breaking the
main contour once every batch (100 vias / pins).
Batch sizes (20 for lines, 100 for pins / vias) aren't necessarily optimal!
Also, clear pins and vias last...
There is a chance these objects are simpler, and just end up as holes in
the main polygon, rather than causing a contour intersection. This means
it is cheaper to add them last.
If we add them first, and make the polygon complex, objects (usually
lines) which pierce the polygon's outer contour cause all the holes to
be removed and queued for re-insersion after the new contour is
constructed.
:100644 100644 586e8cc... 65879c8... M src/polygon.c
=========
Changes
=========
commit 093a606b182229c8e28118ace1be7d6b6ad5cf7f
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
polygon1.c: Avoid re-starting the intersection routine for each new node
This seems to have a nice performance win for the NoHoles dicer, which
may have suffered due to other polygon changes which increased operation
overhead. (The NoHoles dicer deliberately causes intersections, so
will benefit from speed improvements in the intersection routine).
Rather than inserting nodes when we find intersections in seg_in_seg(),
(which requires an immediate restart of the intersection search), build
a queue of deferred work to be executed at the end of each iteration.
The intersected segments will be split at end of this search pass.
Once a segment has been queued for splitting, further intersections
detected with that segment must be ignored until the next pass
(after the segment has been split at the new node). The current pass
can continue to calculate intersections between _other_ segments.
Whenever an iteration finishes and nodes are added by deferred work,
another iteration of the intersection loop is required. Processing
stops after an iteration when no new nodes are added
diff --git a/src/polygon1.c b/src/polygon1.c
index 1127fbd..468c139 100644
--- a/src/polygon1.c
+++ b/src/polygon1.c
@@ -180,26 +180,20 @@ node_add
4 means the intersection was not on the dest point
*/
static VNODE *
-node_add (VNODE * dest, Vector po, int *new_point)
+node_add_single (VNODE * dest, Vector po)
{
VNODE *p;
if (vect_equal (po, dest->point))
return dest;
if (vect_equal (po, dest->next->point))
- {
- (*new_point) += 4;
- return dest->next;
- }
+ return dest->next;
p = poly_CreateNode (po);
if (p == NULL)
return NULL;
- (*new_point) += 5;
- p->prev = dest;
- p->next = dest->next;
p->cvc_prev = p->cvc_next = NULL;
p->Flags.status = UNKNWN;
- return (dest->next = dest->next->prev = p);
+ return p;
} /* node_add */
#define ISECT_BAD_PARAM (-1)
@@ -362,22 +356,22 @@ node_add_point
return 1 if new node in b, 2 if new node in a and 3 if new node in both
*/
-static int
-node_add_point (VNODE * a, VNODE * b, Vector p)
+static VNODE *
+node_add_single_point (VNODE * a, Vector p)
{
- int res = 0;
+ VNODE *next_a, *new_node;
- VNODE *node_a, *node_b;
+ next_a = a->next;
- node_a = node_add (a, p, &res);
- res += res;
- node_b = node_add (b, p, &res);
+ new_node = node_add_single (a, p);
+ assert (new_node != NULL);
- if (node_a == NULL || node_b == NULL)
- return ISECT_NO_MEMORY;
- node_b->cvc_prev = node_b->cvc_next = (CVCList *) - 1;
- node_a->cvc_prev = node_a->cvc_next = (CVCList *) - 1;
- return res;
+ new_node->cvc_prev = new_node->cvc_next = (CVCList *) - 1;
+
+ if (new_node == a || new_node == next_a)
+ return NULL;
+
+ return new_node;
} /* node_add_point */
/*
@@ -501,8 +495,18 @@ typedef struct seg
BoxType box;
VNODE *v;
PLINE *p;
+ int intersected;
} seg;
+typedef struct _insert_node_task insert_node_task;
+
+struct _insert_node_task
+{
+ insert_node_task *next;
+ seg *seg;
+ VNODE *new_node;
+};
+
typedef struct info
{
double m, b;
@@ -510,6 +514,8 @@ typedef struct info
VNODE *v;
struct seg *s;
jmp_buf *env, sego, *touch;
+ int need_restart;
+ insert_node_task *node_insert_list;
} info;
typedef struct contour_info
@@ -517,6 +523,8 @@ typedef struct contour_info
PLINE *pa;
jmp_buf restart;
jmp_buf *getout;
+ int need_restart;
+ insert_node_task *node_insert_list;
} contour_info;
@@ -534,6 +542,7 @@ adjust_tree (rtree_t * tree, struct seg *s)
q = malloc (sizeof (struct seg));
if (!q)
return 1;
+ q->intersected = 0;
q->v = s->v;
q->p = s->p;
q->box.X1 = min (q->v->point[0], q->v->next->point[0]);
@@ -544,6 +553,7 @@ adjust_tree (rtree_t * tree, struct seg *s)
q = malloc (sizeof (struct seg));
if (!q)
return 1;
+ q->intersected = 0;
q->v = s->v->next;
q->p = s->p;
q->box.X1 = min (q->v->point[0], q->v->next->point[0]);
@@ -577,6 +587,17 @@ seg_in_region (const BoxType * b, void *cl)
return 1; /* might intersect */
}
+/* Prepend a deferred node-insersion task to a list */
+static insert_node_task *
+prepend_insert_node_task (insert_node_task *list, seg *seg, VNODE *new_node)
+{
+ insert_node_task *task = malloc (sizeof (*task));
+ task->seg = seg;
+ task->new_node = new_node;
+ task->next = list;
+ return task;
+}
+
/*
* seg_in_seg()
* (C) 2006 harry eaton
@@ -594,7 +615,15 @@ seg_in_seg (const BoxType * b, void *cl)
struct info *i = (struct info *) cl;
struct seg *s = (struct seg *) b;
Vector s1, s2;
- int cnt, res;
+ int cnt;
+ VNODE *new_node;
+
+ /* When new nodes are added at the end of a pass due to an intersection
+ * the segments may be altered. If either segment we're looking at has
+ * already been intersected this pass, skip it until the next pass.
+ */
+ if (s->intersected || i->s->intersected)
+ return 0;
cnt = vect_inters2 (s->v->point, s->v->next->point,
i->v->point, i->v->next->point, s1, s2);
@@ -606,31 +635,36 @@ seg_in_seg (const BoxType * b, void *cl)
s->p->Flags.status = ISECTED;
for (; cnt; cnt--)
{
- res = node_add_point (i->v, s->v, cnt > 1 ? s2 : s1);
- if (res < 0)
- return 1; /* error */
- /* adjust the bounding box and tree if necessary */
- if (res & 2)
- {
- cntrbox_adjust (i->s->p, cnt > 1 ? s2 : s1);
- if (adjust_tree (i->s->p->tree, i->s))
- return 1;
- }
- /* if we added a node in the tree we need to change the tree */
- if (res & 1)
+ bool done_insert_on_i = false;
+ new_node = node_add_single_point (i->v, cnt > 1 ? s2 : s1);
+ if (new_node != NULL)
{
- cntrbox_adjust (s->p, cnt > 1 ? s2 : s1);
- if (adjust_tree (i->tree, s))
- return 1;
+#ifdef DEBUG_INTERSECT
+ DEBUGP ("new intersection on segment \"i\" at (%d, %d)\n",
+ cnt > 1 ? s2[0] : s1[0], cnt > 1 ? s2[1] : s1[1]);
+#endif
+ i->node_insert_list =
+ prepend_insert_node_task (i->node_insert_list, i->s, new_node);
+ i->s->intersected = 1;
+ done_insert_on_i = true;
}
- if (res & 3) /* if a point was inserted start over */
+ new_node = node_add_single_point (s->v, cnt > 1 ? s2 : s1);
+ if (new_node != NULL)
{
#ifdef DEBUG_INTERSECT
- DEBUGP ("new intersection at (%d, %d)\n", cnt > 1 ? s2[0] : s1[0],
- cnt > 1 ? s2[1] : s1[1]);
+ DEBUGP ("new intersection on segment \"s\" at (%d, %d)\n",
+ cnt > 1 ? s2[0] : s1[0], cnt > 1 ? s2[1] : s1[1]);
#endif
- longjmp (*i->env, 1);
+ i->node_insert_list =
+ prepend_insert_node_task (i->node_insert_list, s, new_node);
+ s->intersected = 1;
+ return 0; /* Keep looking for intersections with segment "i" */
}
+ /* Skip any remaining r_search hits against segment i, as any futher
+ * intersections will be rejected until the next pass anyway.
+ */
+ if (done_insert_on_i)
+ longjmp (*i->env, 1);
}
return 0;
}
@@ -645,6 +679,7 @@ make_edge_tree (PLINE * pb)
do
{
s = malloc (sizeof (struct seg));
+ s->intersected = 0;
if (bv->point[0] < bv->next->point[0])
{
s->box.X1 = bv->point[0];
@@ -715,10 +750,13 @@ contour_bounds_touch (const BoxType * b, void *cl)
VNODE *av; /* node iterators */
struct info info;
BoxType box;
+ jmp_buf restart;
/* Have seg_in_seg return to our desired location if it touches */
- info.env = &c_info->restart;
+ info.env = &restart;
info.touch = c_info->getout;
+ info.need_restart = 0;
+ info.node_insert_list = c_info->node_insert_list;
/* Pick which contour has the fewer points, and do the loop
* over that. The r_tree makes hit-testing against a contour
@@ -760,23 +798,38 @@ contour_bounds_touch (const BoxType * b, void *cl)
assert (0);
}
+ /* If we're going to have another pass anyway, skip this */
+ if (info.s->intersected && info.node_insert_list != NULL)
+ continue;
+
+ if (setjmp (restart))
+ continue;
+
/* NB: If this actually hits anything, we are teleported back to the beginning */
info.tree = rtree_over->tree;
if (info.tree)
if (UNLIKELY (r_search (info.tree, &info.s->box,
seg_in_region, seg_in_seg, &info)))
- return err_no_memory; /* error */
+ assert (0); /* XXX: Memory allocation failure */
}
while ((av = av->next) != &looping_over->head);
+
+ c_info->node_insert_list = info.node_insert_list;
+ if (info.need_restart)
+ c_info->need_restart = 1;
return 0;
}
static int
-intersect (jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
+intersect_impl (jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
{
POLYAREA *t;
PLINE *pa;
contour_info c_info;
+ int need_restart = 0;
+ insert_node_task *task;
+ c_info.need_restart = 0;
+ c_info.node_insert_list = NULL;
/* Search the r-tree of the object with most contours
* We loop over the contours of "a". Swap if necessary.
@@ -788,8 +841,6 @@ intersect (jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
a = t;
}
- setjmp (c_info.restart); /* we loop back here whenever a vertex is inserted */
-
for (pa = a->contours; pa; pa = pa->next) /* Loop over the contours of POLYAREA "a" */
{
BoxType sb;
@@ -817,8 +868,42 @@ intersect (jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
sb.Y2 = pa->ymax + 1;
r_search (b->contour_tree, &sb, NULL, contour_bounds_touch, &c_info);
+ if (c_info.need_restart)
+ need_restart = 1;
}
+ /* Process any deferred node insersions */
+ task = c_info.node_insert_list;
+ while (task != NULL)
+ {
+ insert_node_task *next = task->next;
+
+ /* Do insersion */
+ task->new_node->prev = task->seg->v;
+ task->new_node->next = task->seg->v->next;
+ task->seg->v->next->prev = task->new_node;
+ task->seg->v->next = task->new_node;
+ task->seg->p->Count++;
+
+ cntrbox_adjust (task->seg->p, task->new_node->point);
+ if (adjust_tree (task->seg->p->tree, task->seg))
+ assert (0); /* XXX: Memory allocation failure */
+
+ need_restart = 1; /* Any new nodes could intersect */
+
+ free (task);
+ task = next;
+ }
+
+ return need_restart;
+}
+
+static int
+intersect (jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
+{
+ int call_count = 1;
+ while (intersect_impl (jb, b, a, add))
+ call_count++;
return 0;
}
commit c582326a43cf659233a9438c303c75c80ba1db73
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Various speedups to the polygon code.
Attempt to fix polygon slowness by avoiding the need to create a
completely new polygon for each boolean operation. This mostly relies
upon r-tree searches to find contours to operate on - rather than
searching each in turn.
We avoid labelling all of the "A" polygon's contours, use the contour
r-trees to dynamically search the required data.
Added code to reparent holes which end up in the wrong polygon piece
after inserting a new hole in InsertHoles. This means we don't have
to dump every potental hole we encounter in the holes insersion queue,
hopefully leading to better dynamic update performance.
At this point, polygon performance has finally seen a net gain.
HOWEVER: Due to differences in the order of polygon operations, the
data-structures resulting from a boolean polygon operation
may be sorted differently.
In certain contrived cases, where a polygon is clipped into
identically sized pieces, the resulting piece of polygon
which PCB will keep and use on the board is different after
this commit.
diff --git a/src/polygon1.c b/src/polygon1.c
index a0be8e6..1127fbd 100644
--- a/src/polygon1.c
+++ b/src/polygon1.c
@@ -879,12 +879,22 @@ cntrbox_inside (PLINE * c1, PLINE * c2)
/*****************************************************************/
/* Routines for making labels */
+static int
+count_contours_i_am_inside (const BoxType * b, void *cl)
+{
+ PLINE *me = cl;
+ PLINE *check = (PLINE *) b;
+
+ if (poly_ContourInContour (check, me))
+ return 1;
+ return 0;
+}
+
/* cntr_in_M_POLYAREA
returns poly is inside outfst ? TRUE : FALSE */
static int
cntr_in_M_POLYAREA (PLINE * poly, POLYAREA * outfst, BOOLp test)
{
- PLINE *curc;
POLYAREA *outer = outfst;
heap_t *heap;
@@ -907,18 +917,22 @@ cntr_in_M_POLYAREA (PLINE * poly, POLYAREA * outfst, BOOLp test)
if (heap_is_empty (heap))
break;
outer = (POLYAREA *) heap_remove_smallest (heap);
- if (poly_ContourInContour (outer->contours, poly))
+
+ switch (r_search
+ (outer->contour_tree, (BoxType *) poly, NULL,
+ count_contours_i_am_inside, poly))
{
- for (curc = outer->contours->next; curc != NULL; curc = curc->next)
- if (poly_ContourInContour (curc, poly))
- {
- /* it's inside a hole in the smallest polygon
- * no need to check the other polygons */
- heap_destroy (&heap);
- return FALSE;
- }
+ case 0: /* Didn't find anything in this piece, Keep looking */
+ break;
+ case 1: /* Found we are inside this piece, and not any of its holes */
heap_destroy (&heap);
return TRUE;
+ case 2: /* Found inside a hole in the smallest polygon so far. No need to check the other polygons */
+ heap_destroy (&heap);
+ return FALSE;
+ default:
+ printf ("Something strange here\n");
+ break;
}
}
while (1);
@@ -1031,6 +1045,19 @@ cntr_label_POLYAREA (PLINE * poly, POLYAREA * ppl, BOOLp test)
} /* cntr_label_POLYAREA */
static BOOLp
+M_POLYAREA_label_separated (PLINE * afst, POLYAREA * b, BOOLp touch)
+{
+ PLINE *curc = afst;
+
+ for (curc = afst; curc != NULL; curc = curc->next)
+ {
+ if (cntr_label_POLYAREA (curc, b, touch) && touch)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static BOOLp
M_POLYAREA_label (POLYAREA * afst, POLYAREA * b, BOOLp touch)
{
POLYAREA *a = afst;
@@ -1118,6 +1145,24 @@ PutContour (jmp_buf * e, PLINE * cntr, POLYAREA ** contours, PLINE ** holes,
}
} /* PutContour */
+static inline void
+remove_contour (POLYAREA * piece, PLINE * prev_contour, PLINE * contour,
+ int remove_rtree_entry)
+{
+ if (piece->contours == contour)
+ piece->contours = contour->next;
+ else if (prev_contour != NULL)
+ {
+ assert (prev_contour->next == contour);
+ prev_contour->next = contour->next;
+ }
+
+ contour->next = NULL;
+
+ if (remove_rtree_entry)
+ r_delete_entry (piece->contour_tree, (BoxType *) contour);
+}
+
struct polyarea_info
{
BoxType BoundingBox;
@@ -1136,6 +1181,32 @@ heap_it (const BoxType * b, void *cl)
return 1;
}
+struct find_inside_info
+{
+ jmp_buf jb;
+ PLINE *want_inside;
+ PLINE *result;
+};
+
+static int
+find_inside (const BoxType * b, void *cl)
+{
+ struct find_inside_info *info = cl;
+ PLINE *check = (PLINE *) b;
+ /* Do test on check to see if it inside info->want_inside */
+ /* If it is: */
+ if (check->Flags.orient == PLF_DIR)
+ {
+ return 0;
+ }
+ if (poly_ContourInContour (info->want_inside, check))
+ {
+ info->result = check;
+ longjmp (info->jb, 1);
+ }
+ return 0;
+}
+
static void
InsertHoles (jmp_buf * e, POLYAREA * dest, PLINE ** src)
{
@@ -1237,10 +1308,52 @@ InsertHoles (jmp_buf * e, POLYAREA * dest, PLINE ** src)
}
else
{
+ /* Need to check if this new hole means we need to kick out any old ones for reprocessing */
+ while (1)
+ {
+ struct find_inside_info info;
+ PLINE *prev;
+
+ info.want_inside = curh;
+
+ /* Set jump return */
+ if (setjmp (info.jb))
+ {
+ /* Returned here! */
+ }
+ else
+ {
+ info.result = NULL;
+ /* Rtree search, calling back a routine to longjmp back with data about any hole inside the added one */
+ /* Be sure not to bother jumping back to report the main contour! */
+ r_search (pa_info->pa->contour_tree, (BoxType *) curh, NULL,
+ find_inside, &info);
+
+ /* Nothing found? */
+ break;
+ }
+
+ /* We need to find the contour before it, so we can update its next pointer */
+ prev = container;
+ while (prev->next != info.result)
+ {
+ prev = prev->next;
+ }
+
+ /* Remove hole from the contour */
+ remove_contour (pa_info->pa, prev, info.result, TRUE);
+
+ /* Add hole as the next on the list to be processed in this very function */
+ info.result->next = *src;
+ *src = info.result;
+ }
+ /* End check for kicked out holes */
+
/* link at front of hole list */
curh->next = container->next;
container->next = curh;
r_insert_entry (pa_info->pa->contour_tree, (BoxTypePtr) curh, 0);
+
}
}
r_destroy_tree (&tree);
@@ -1634,6 +1747,384 @@ M_B_AREA_Collect (jmp_buf * e, POLYAREA * bfst, POLYAREA ** contours,
}
+static inline int
+contour_is_first (POLYAREA * a, PLINE * cur)
+{
+ return (a->contours == cur);
+}
+
+
+static inline int
+contour_is_last (PLINE * cur)
+{
+ return (cur->next == NULL);
+}
+
+
+static inline void
+remove_polyarea (POLYAREA ** list, POLYAREA * piece)
+{
+ /* If this item was the start of the list, advance that pointer */
+ if (*list == piece)
+ *list = (*list)->f;
+
+ /* But reset it to NULL if it wraps around and hits us again */
+ if (*list == piece)
+ *list = NULL;
+
+ piece->b->f = piece->f;
+ piece->f->b = piece->b;
+ piece->f = piece->b = piece;
+}
+
+static void
+M_POLYAREA_separate_isected (jmp_buf * e, POLYAREA ** pieces,
+ PLINE ** holes, PLINE ** isected)
+{
+ POLYAREA *a = *pieces;
+ POLYAREA *anext;
+ PLINE *curc, *next, *prev;
+ int finished;
+
+ if (a == NULL)
+ return;
+
+ /* TODO: STASH ENOUGH INFORMATION EARLIER ON, SO WE CAN REMOVE THE INTERSECTED
+ CONTOURS WITHOUT HAVING TO WALK THE FULL DATA-STRUCTURE LOOKING FOR THEM. */
+
+ do
+ {
+ int hole_contour = 0;
+ int is_outline = 1;
+
+ anext = a->f;
+ finished = (anext == *pieces);
+
+ prev = NULL;
+ for (curc = a->contours; curc != NULL; curc = next, is_outline = 0)
+ {
+ int is_first = contour_is_first (a, curc);
+ int is_last = contour_is_last (curc);
+ int isect_contour = (curc->Flags.status == ISECTED);
+
+ next = curc->next;
+
+ if (isect_contour || hole_contour)
+ {
+
+ /* Reset the intersection flags, since we keep these pieces */
+ if (curc->Flags.status != ISECTED)
+ curc->Flags.status = UNKNWN;
+
+ remove_contour (a, prev, curc, !(is_first && is_last));
+
+ if (isect_contour)
+ {
+ /* Link into the list of intersected contours */
+ curc->next = *isected;
+ *isected = curc;
+ }
+ else if (hole_contour)
+ {
+ /* Link into the list of holes */
+ curc->next = *holes;
+ *holes = curc;
+ }
+ else
+ {
+ assert (0);
+ }
+
+ if (is_first && is_last)
+ {
+ remove_polyarea (pieces, a);
+ poly_Free (&a); /* NB: Sets a to NULL */
+ }
+
+ }
+ else
+ {
+ /* Note the item we just didn't delete as the next
+ candidate for having its "next" pointer adjusted.
+ Saves walking the contour list when we delete one. */
+ prev = curc;
+ }
+
+ /* If we move or delete an outer contour, we need to move any holes
+ we wish to keep within that contour to the holes list. */
+ if (is_outline && isect_contour)
+ hole_contour = 1;
+
+ }
+
+ /* If we deleted all the pieces of the polyarea, *pieces is NULL */
+ }
+ while ((a = anext), *pieces != NULL && !finished);
+}
+
+
+struct find_inside_m_pa_info
+{
+ jmp_buf jb;
+ POLYAREA *want_inside;
+ PLINE *result;
+};
+
+static int
+find_inside_m_pa (const BoxType * b, void *cl)
+{
+ struct find_inside_m_pa_info *info = cl;
+ PLINE *check = (PLINE *) b;
+ /* Don't report for the main contour */
+ if (check->Flags.orient == PLF_DIR)
+ return 0;
+ /* Don't look at contours marked as being intersected */
+ if (check->Flags.status == ISECTED)
+ return 0;
+ if (cntr_in_M_POLYAREA (check, info->want_inside, FALSE))
+ {
+ info->result = check;
+ longjmp (info->jb, 1);
+ }
+ return 0;
+}
+
+
+static void
+M_POLYAREA_update_primary (jmp_buf * e, POLYAREA ** pieces,
+ PLINE ** holes, int action, POLYAREA * bpa)
+{
+ POLYAREA *a = *pieces;
+ POLYAREA *b;
+ POLYAREA *anext;
+ PLINE *curc, *next, *prev;
+ BoxType box;
+ int inv_inside = 0;
+ int del_inside = 0;
+ int del_outside = 0;
+ int finished;
+
+ if (a == NULL)
+ return;
+
+ switch (action)
+ {
+ case PBO_ISECT:
+ del_outside = 1;
+ break;
+ case PBO_UNITE:
+ case PBO_SUB:
+ del_inside = 1;
+ break;
+ case PBO_XOR: /* NOT IMPLEMENTED OR USED */
+ inv_inside = 1;
+ assert (0);
+ break;
+ }
+
+ box = *((BoxType *) bpa->contours);
+ b = bpa;
+ while ((b = b->f) != bpa)
+ {
+ BoxType *b_box = (BoxType *) b->contours;
+ MAKEMIN (box.X1, b_box->X1);
+ MAKEMIN (box.Y1, b_box->Y1);
+ MAKEMAX (box.X2, b_box->X2);
+ MAKEMAX (box.Y2, b_box->Y2);
+ }
+
+ if (del_inside)
+ {
+
+ do
+ {
+ anext = a->f;
+ finished = (anext == *pieces);
+
+ /* Test the outer contour first, as we may need to remove all children */
+
+ /* We've not yet split intersected contours out, just ignore them */
+ if (a->contours->Flags.status != ISECTED &&
+ /* Pre-filter on bounding box */
+ ((a->contours->xmin >= box.X1) && (a->contours->ymin >= box.Y1)
+ && (a->contours->xmax <= box.X2)
+ && (a->contours->ymax <= box.Y2)) &&
+ /* Then test properly */
+ cntr_in_M_POLYAREA (a->contours, bpa, FALSE))
+ {
+
+ /* Delete this contour, all children -> holes queue */
+
+ /* Delete the outer contour */
+ curc = a->contours;
+ remove_contour (a, NULL, curc, FALSE); /* Rtree deleted in poly_Free below */
+ /* a->contours now points to the remaining holes */
+ poly_DelContour (&curc);
+
+ if (a->contours != NULL)
+ {
+ /* Find the end of the list of holes */
+ curc = a->contours;
+ while (curc->next != NULL)
+ curc = curc->next;
+
+ /* Take the holes and prepend to the holes queue */
+ curc->next = *holes;
+ *holes = a->contours;
+ a->contours = NULL;
+ }
+
+ remove_polyarea (pieces, a);
+ poly_Free (&a); /* NB: Sets a to NULL */
+
+ continue;
+ }
+
+ /* Loop whilst we find INSIDE contours to delete */
+ while (1)
+ {
+ struct find_inside_m_pa_info info;
+ PLINE *prev;
+
+ info.want_inside = bpa;
+
+ /* Set jump return */
+ if (setjmp (info.jb))
+ {
+ /* Returned here! */
+ }
+ else
+ {
+ info.result = NULL;
+ /* r-tree search, calling back a routine to longjmp back with
+ * data about any hole inside the B polygon.
+ * NB: Does not jump back to report the main contour!
+ */
+ r_search (a->contour_tree, &box, NULL, find_inside_m_pa,
+ &info);
+
+ /* Nothing found? */
+ break;
+ }
+
+ /* We need to find the contour before it, so we can update its next pointer */
+ prev = a->contours;
+ while (prev->next != info.result)
+ {
+ prev = prev->next;
+ }
+
+ /* Remove hole from the contour */
+ remove_contour (a, prev, info.result, TRUE);
+ poly_DelContour (&info.result);
+ }
+ /* End check for deleted holes */
+
+ /* If we deleted all the pieces of the polyarea, *pieces is NULL */
+ }
+ while ((a = anext), *pieces != NULL && !finished);
+
+ return;
+ }
+ else
+ {
+ /* This path isn't optimised for speed */
+ }
+
+ do
+ {
+ int hole_contour = 0;
+ int is_outline = 1;
+
+ anext = a->f;
+ finished = (anext == *pieces);
+
+ prev = NULL;
+ for (curc = a->contours; curc != NULL; curc = next, is_outline = 0)
+ {
+ int is_first = contour_is_first (a, curc);
+ int is_last = contour_is_last (curc);
+ int del_contour = 0;
+
+ next = curc->next;
+
+ if (del_outside)
+ del_contour = curc->Flags.status != ISECTED &&
+ !cntr_in_M_POLYAREA (curc, bpa, FALSE);
+
+ /* Skip intersected contours */
+ if (curc->Flags.status == ISECTED)
+ {
+ prev = curc;
+ continue;
+ }
+
+ /* Reset the intersection flags, since we keep these pieces */
+ curc->Flags.status = UNKNWN;
+
+ if (del_contour || hole_contour)
+ {
+
+ remove_contour (a, prev, curc, !(is_first && is_last));
+
+ if (del_contour)
+ {
+ /* Delete the contour */
+ poly_DelContour (&curc); /* NB: Sets curc to NULL */
+ }
+ else if (hole_contour)
+ {
+ /* Link into the list of holes */
+ curc->next = *holes;
+ *holes = curc;
+ }
+ else
+ {
+ assert (0);
+ }
+
+ if (is_first && is_last)
+ {
+ remove_polyarea (pieces, a);
+ poly_Free (&a); /* NB: Sets a to NULL */
+ }
+
+ }
+ else
+ {
+ /* Note the item we just didn't delete as the next
+ candidate for having its "next" pointer adjusted.
+ Saves walking the contour list when we delete one. */
+ prev = curc;
+ }
+
+ /* If we move or delete an outer contour, we need to move any holes
+ we wish to keep within that contour to the holes list. */
+ if (is_outline && del_contour)
+ hole_contour = 1;
+
+ }
+
+ /* If we deleted all the pieces of the polyarea, *pieces is NULL */
+ }
+ while ((a = anext), *pieces != NULL && !finished);
+}
+
+static void
+M_POLYAREA_Collect_separated (jmp_buf * e, PLINE * afst, POLYAREA ** contours,
+ PLINE ** holes, int action, BOOLp maybe)
+{
+ PLINE **cur, **next;
+
+ for (cur = &afst; *cur != NULL; cur = next)
+ {
+ next = &((*cur)->next);
+ /* if we disappear a contour, don't advance twice */
+ if (cntr_Collect (e, cur, contours, holes, action, NULL, NULL, NULL))
+ next = cur;
+ }
+}
+
static void
M_POLYAREA_Collect (jmp_buf * e, POLYAREA * afst, POLYAREA ** contours,
PLINE ** holes, int action, BOOLp maybe)
@@ -1726,6 +2217,7 @@ int
poly_Boolean_free (POLYAREA * ai, POLYAREA * bi, POLYAREA ** res, int action)
{
POLYAREA *a = ai, *b = bi;
+ PLINE *a_isected = NULL;
PLINE *p, *holes = NULL;
jmp_buf e;
int code;
@@ -1770,18 +2262,29 @@ poly_Boolean_free (POLYAREA * ai, POLYAREA * bi, POLYAREA ** res, int action)
assert (poly_Valid (b));
#endif
+ /* intersect needs to make a list of the contours in a and b which are intersected */
M_POLYAREA_intersect (&e, a, b, TRUE);
- M_POLYAREA_label (a, b, FALSE);
+ /* We could speed things up a lot here if we only processed the relevant contours */
+ /* NB: Relevant parts of a are labeled below */
M_POLYAREA_label (b, a, FALSE);
- M_POLYAREA_Collect (&e, a, res, &holes, action, b->f == b
- && !b->contours->next
- && b->contours->Flags.status != ISECTED);
- poly_Free (&a);
+ *res = a;
+ M_POLYAREA_update_primary (&e, res, &holes, action, b);
+ M_POLYAREA_separate_isected (&e, res, &holes, &a_isected);
+ M_POLYAREA_label_separated (a_isected, b, FALSE);
+ M_POLYAREA_Collect_separated (&e, a_isected, res, &holes, action,
+ FALSE);
M_B_AREA_Collect (&e, b, res, &holes, action);
poly_Free (&b);
+ /* free a_isected */
+ while ((p = a_isected) != NULL)
+ {
+ a_isected = p->next;
+ poly_DelContour (&p);
+ }
+
InsertHoles (&e, *res, &holes);
}
/* delete holes if any left */
commit f6e43daeb4379263ea8c7af64a6008a8c457c331
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Use heap structure to insert holes quicker in InsertHoles()
diff --git a/src/polygon1.c b/src/polygon1.c
index 2799a67..a0be8e6 100644
--- a/src/polygon1.c
+++ b/src/polygon1.c
@@ -1118,14 +1118,21 @@ PutContour (jmp_buf * e, PLINE * cntr, POLYAREA ** contours, PLINE ** holes,
}
} /* PutContour */
+struct polyarea_info
+{
+ BoxType BoundingBox;
+ POLYAREA *pa;
+};
+
static int
heap_it (const BoxType * b, void *cl)
{
heap_t *heap = (heap_t *) cl;
- PLINE *p = (PLINE *) b;
+ struct polyarea_info *pa_info = (struct polyarea_info *) b;
+ PLINE *p = pa_info->pa->contours;
if (p->Count == 0)
return 0; /* how did this happen? */
- heap_insert (heap, p->area, (void *) p);
+ heap_insert (heap, p->area, pa_info);
return 1;
}
@@ -1133,23 +1140,44 @@ static void
InsertHoles (jmp_buf * e, POLYAREA * dest, PLINE ** src)
{
POLYAREA *curc;
- PLINE *curh, *container, *tmp;
+ PLINE *curh, *container;
heap_t *heap;
rtree_t *tree;
+ int i;
+ int num_polyareas = 0;
+ struct polyarea_info *all_pa_info, *pa_info;
if (*src == NULL)
return; /* empty hole list */
if (dest == NULL)
error (err_bad_parm); /* empty contour list */
- /* make an rtree of outer contours */
+ /* Count dest polyareas */
+ curc = dest;
+ do
+ {
+ num_polyareas++;
+ }
+ while ((curc = curc->f) != dest);
+
+ /* make a polyarea info table */
+ /* make an rtree of polyarea info table */
+ all_pa_info = malloc (sizeof (struct polyarea_info) * num_polyareas);
tree = r_create_tree (NULL, 0, 0);
+ i = 0;
curc = dest;
do
{
- r_insert_entry (tree, (const BoxType *) curc->contours, 0);
+ all_pa_info[i].BoundingBox.X1 = curc->contours->xmin;
+ all_pa_info[i].BoundingBox.Y1 = curc->contours->ymin;
+ all_pa_info[i].BoundingBox.X2 = curc->contours->xmax;
+ all_pa_info[i].BoundingBox.Y2 = curc->contours->ymax;
+ all_pa_info[i].pa = curc;
+ r_insert_entry (tree, (const BoxType *) &all_pa_info[i], 0);
+ i++;
}
while ((curc = curc->f) != dest);
+
/* loop through the holes and put them where they belong */
while ((curh = *src) != NULL)
{
@@ -1173,24 +1201,24 @@ InsertHoles (jmp_buf * e, POLYAREA * dest, PLINE ** src)
* in the heap, assume it is the container without the expense of
* proving it.
*/
- tmp = (PLINE *) heap_remove_smallest (heap);
+ pa_info = heap_remove_smallest (heap);
if (heap_is_empty (heap))
{ /* only one possibility it must be the right one */
- assert (poly_ContourInContour (tmp, curh));
- container = tmp;
+ assert (poly_ContourInContour (pa_info->pa->contours, curh));
+ container = pa_info->pa->contours;
}
else
{
do
{
- if (poly_ContourInContour (tmp, curh))
+ if (poly_ContourInContour (pa_info->pa->contours, curh))
{
- container = tmp;
+ container = pa_info->pa->contours;
break;
}
if (heap_is_empty (heap))
break;
- tmp = (PLINE *) heap_remove_smallest (heap);
+ pa_info = heap_remove_smallest (heap);
}
while (1);
}
@@ -1212,26 +1240,11 @@ InsertHoles (jmp_buf * e, POLYAREA * dest, PLINE ** src)
/* link at front of hole list */
curh->next = container->next;
container->next = curh;
-
- /* Search for which POLYAREA the containing contour belongs to */
- /* FIXME: Perhaps store this information in the heap structure? */
- curc = dest;
- do
- {
- if (curc->contours == container)
- break;
- }
- while ((curc = curc->f) != dest);
-
- if (curc->contours == container)
- {
- r_insert_entry (curc->contour_tree, (BoxTypePtr) curh, 0);
- }
- else
- assert (0);
+ r_insert_entry (pa_info->pa->contour_tree, (BoxTypePtr) curh, 0);
}
}
r_destroy_tree (&tree);
+ free (all_pa_info);
} /* InsertHoles */
commit 6669edbdb52cfdd46b0dc2ecd63e020a21fd8139
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Optimise polygon operations by keeping an rtree of POLYAREA contours
Attempt to speed up the intersect() routine using this rtree rather
than generating a new one at each call.
Due to the increased overheads of keeping an r-tree up to date, there
is a significant overall slow-down at this point in the patch series.
diff --git a/src/polyarea.h b/src/polyarea.h
index 958498b..ce427ad 100644
--- a/src/polyarea.h
+++ b/src/polyarea.h
@@ -132,6 +132,7 @@ struct POLYAREA
{
POLYAREA *f, *b;
PLINE *contours;
+ rtree_t *contour_tree;
};
BOOLp poly_M_Copy0(POLYAREA ** dst, const POLYAREA * srcfst);
diff --git a/src/polygon.c b/src/polygon.c
index 65879c8..74d4bc4 100644
--- a/src/polygon.c
+++ b/src/polygon.c
@@ -215,6 +215,7 @@ biggest (POLYAREA * p)
{
POLYAREA *n, *top = NULL;
PLINE *pl;
+ rtree_t *tree;
double big = -1;
if (!p)
return NULL;
@@ -248,8 +249,11 @@ biggest (POLYAREA * p)
if (top == p)
return p;
pl = top->contours;
+ tree = top->contour_tree;
top->contours = p->contours;
+ top->contour_tree = p->contour_tree;
p->contours = pl;
+ p->contour_tree = tree;
assert (pl);
assert (p->f);
assert (p->b);
@@ -1694,6 +1698,8 @@ r_NoHolesPolygonDicer (POLYAREA * pa,
if (!pa->contours->next) /* no holes */
{
pa->contours = NULL; /* The callback now owns the contour */
+ /* Don't bother removing it from the POLYAREA's rtree
+ since we're going to free the POLYAREA below anyway */
emit (p, user_data);
poly_Free (&pa);
return;
diff --git a/src/polygon1.c b/src/polygon1.c
index d2c0798..2799a67 100644
--- a/src/polygon1.c
+++ b/src/polygon1.c
@@ -775,31 +775,19 @@ static int
intersect (jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
{
POLYAREA *t;
- PLINE *pa, *pb;
- int ca = 0, cb = 0;
+ PLINE *pa;
contour_info c_info;
- rtree_t *b_contour_tree = NULL;
-
- /* count the contours in a and b */
- for (pa = a->contours; pa; pa = pa->next, ca++);
- for (pb = b->contours; pb; pb = pb->next, cb++);
- /* Make the contour r-tree from the one with fewest contours */
- /* Inserting entries is more expensive than searching
- * the r-tree. We do one ca times, the other cb times. */
- if (ca < cb)
+ /* Search the r-tree of the object with most contours
+ * We loop over the contours of "a". Swap if necessary.
+ */
+ if (a->contour_tree->size > b->contour_tree->size)
{
t = b;
b = a;
a = t;
}
- /* make an rtree of b's contours */
- b_contour_tree = r_create_tree (NULL, 0, 0);
- for (pb = b->contours; pb != NULL; pb = pb->next)
- r_insert_entry (b_contour_tree, (const BoxType *) pb, 0);
-
- /* FIXME: We might actually need to re-build the r_tree if the geometry changes */
setjmp (c_info.restart); /* we loop back here whenever a vertex is inserted */
for (pa = a->contours; pa; pa = pa->next) /* Loop over the contours of POLYAREA "a" */
@@ -818,7 +806,6 @@ intersect (jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
{
/* The intersection test short-circuited back here,
* we need to clean up, then longjmp to jb */
- r_destroy_tree (&b_contour_tree);
longjmp (*jb, retval);
}
c_info.getout = &out;
@@ -829,7 +816,7 @@ intersect (jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
sb.X2 = pa->xmax + 1;
sb.Y2 = pa->ymax + 1;
- r_search (b_contour_tree, &sb, NULL, contour_bounds_touch, &c_info);
+ r_search (b->contour_tree, &sb, NULL, contour_bounds_touch, &c_info);
}
return 0;
@@ -1085,31 +1072,48 @@ InsCntr (jmp_buf * e, PLINE * c, POLYAREA ** dst)
newp->f->b = newp->b->f = newp;
}
newp->contours = c;
+ newp->contour_tree = r_create_tree (NULL, 0, 0);
+ r_insert_entry (newp->contour_tree, (BoxTypePtr) c, 0);
c->next = NULL;
} /* InsCntr */
static void
PutContour (jmp_buf * e, PLINE * cntr, POLYAREA ** contours, PLINE ** holes,
- PLINE * parent)
+ POLYAREA * owner, POLYAREA * parent, PLINE * parent_contour)
{
assert (cntr != NULL);
assert (cntr->Count > 2);
cntr->next = NULL;
+
if (cntr->Flags.orient == PLF_DIR)
- InsCntr (e, cntr, contours);
+ {
+ if (owner != NULL)
+ r_delete_entry (owner->contour_tree, (BoxType *) cntr);
+ InsCntr (e, cntr, contours);
+ }
/* put hole into temporary list */
else
{
/* if we know this belongs inside the parent, put it there now */
- if (parent)
+ if (parent_contour)
{
- cntr->next = parent->next;
- parent->next = cntr;
+ cntr->next = parent_contour->next;
+ parent_contour->next = cntr;
+ if (owner != parent)
+ {
+ if (owner != NULL)
+ r_delete_entry (owner->contour_tree, (BoxType *) cntr);
+ r_insert_entry (parent->contour_tree, (BoxType *) cntr, 0);
+ }
}
else
{
cntr->next = *holes;
*holes = cntr; /* let cntr be 1st hole in list */
+ /* We don't insert the holes into an r-tree,
+ * they just form a linked list */
+ if (owner != NULL)
+ r_delete_entry (owner->contour_tree, (BoxType *) cntr);
}
}
} /* PutContour */
@@ -1138,7 +1142,7 @@ InsertHoles (jmp_buf * e, POLYAREA * dest, PLINE ** src)
if (dest == NULL)
error (err_bad_parm); /* empty contour list */
- /* make an rtree of contours */
+ /* make an rtree of outer contours */
tree = r_create_tree (NULL, 0, 0);
curc = dest;
do
@@ -1206,9 +1210,25 @@ InsertHoles (jmp_buf * e, POLYAREA * dest, PLINE ** src)
else
{
/* link at front of hole list */
- tmp = container->next;
+ curh->next = container->next;
container->next = curh;
- curh->next = tmp;
+
+ /* Search for which POLYAREA the containing contour belongs to */
+ /* FIXME: Perhaps store this information in the heap structure? */
+ curc = dest;
+ do
+ {
+ if (curc->contours == container)
+ break;
+ }
+ while ((curc = curc->f) != dest);
+
+ if (curc->contours == container)
+ {
+ r_insert_entry (curc->contour_tree, (BoxTypePtr) curh, 0);
+ }
+ else
+ assert (0);
}
}
r_destroy_tree (&tree);
@@ -1443,7 +1463,7 @@ Collect1 (jmp_buf * e, VNODE * cur, DIRECTION dir, POLYAREA ** contours,
DEBUGP ("adding contour with %d verticies and direction %c\n",
p->Count, p->Flags.orient ? 'F' : 'B');
#endif
- PutContour (e, p, contours, holes, NULL);
+ PutContour (e, p, contours, holes, NULL, NULL, NULL);
}
else
{
@@ -1477,7 +1497,8 @@ Collect (jmp_buf * e, PLINE * a, POLYAREA ** contours, PLINE ** holes,
static int
cntr_Collect (jmp_buf * e, PLINE ** A, POLYAREA ** contours, PLINE ** holes,
- int action, PLINE * parent)
+ int action, POLYAREA * owner, POLYAREA * parent,
+ PLINE * parent_contour)
{
PLINE *tmprev;
@@ -1507,10 +1528,10 @@ cntr_Collect (jmp_buf * e, PLINE ** A, POLYAREA ** contours, PLINE ** holes,
if ((*A)->Flags.status == INSIDE)
{
tmprev = *A;
- /* disappear this contour */
+ /* disappear this contour (rtree entry removed in PutContour) */
*A = tmprev->next;
tmprev->next = NULL;
- PutContour (e, tmprev, contours, holes, NULL);
+ PutContour (e, tmprev, contours, holes, owner, NULL, NULL);
return TRUE;
}
break;
@@ -1518,11 +1539,11 @@ cntr_Collect (jmp_buf * e, PLINE ** A, POLYAREA ** contours, PLINE ** holes,
if ((*A)->Flags.status == INSIDE)
{
tmprev = *A;
- /* disappear this contour */
+ /* disappear this contour (rtree entry removed in PutContour) */
*A = tmprev->next;
tmprev->next = NULL;
poly_InvContour (tmprev);
- PutContour (e, tmprev, contours, holes, NULL);
+ PutContour (e, tmprev, contours, holes, owner, NULL, NULL);
return TRUE;
}
/* break; *//* Fall through (I think this is correct! pcjc2) */
@@ -1531,10 +1552,11 @@ cntr_Collect (jmp_buf * e, PLINE ** A, POLYAREA ** contours, PLINE ** holes,
if ((*A)->Flags.status == OUTSIDE)
{
tmprev = *A;
- /* disappear this contour */
+ /* disappear this contour (rtree entry removed in PutContour) */
*A = tmprev->next;
tmprev->next = NULL;
- PutContour (e, tmprev, contours, holes, parent);
+ PutContour (e, tmprev, contours, holes, owner, parent,
+ parent_contour);
return TRUE;
}
break;
@@ -1571,7 +1593,7 @@ M_B_AREA_Collect (jmp_buf * e, POLYAREA * bfst, POLYAREA ** contours,
next = cur;
tmp->next = NULL;
tmp->Flags.status = UNKNWN;
- PutContour (e, tmp, contours, holes, NULL);
+ PutContour (e, tmp, contours, holes, b, NULL, NULL);
break;
case PBO_UNITE:
break; /* nothing to do - already included */
@@ -1587,7 +1609,7 @@ M_B_AREA_Collect (jmp_buf * e, POLYAREA * bfst, POLYAREA ** contours,
next = cur;
tmp->next = NULL;
tmp->Flags.status = UNKNWN;
- PutContour (e, tmp, contours, holes, NULL);
+ PutContour (e, tmp, contours, holes, b, NULL, NULL);
break;
case PBO_ISECT:
case PBO_SUB:
@@ -1604,7 +1626,8 @@ M_POLYAREA_Collect (jmp_buf * e, POLYAREA * afst, POLYAREA ** contours,
PLINE ** holes, int action, BOOLp maybe)
{
POLYAREA *a = afst;
- PLINE **cur, **next, *parent;
+ POLYAREA *parent = NULL; /* Quiet compiler warning */
+ PLINE **cur, **next, *parent_contour;
assert (a != NULL);
while ((a = a->f) != afst);
@@ -1612,16 +1635,33 @@ M_POLYAREA_Collect (jmp_buf * e, POLYAREA * afst, POLYAREA ** contours,
do
{
if (maybe && a->contours->Flags.status != ISECTED)
- parent = a->contours;
+ parent_contour = a->contours;
else
- parent = NULL;
- for (cur = &a->contours; *cur != NULL; cur = next)
+ parent_contour = NULL;
+
+ /* Take care of the first contour - so we know if we
+ * can shortcut reparenting some of its children
+ */
+ cur = &a->contours;
+ if (*cur != NULL)
+ {
+ next = &((*cur)->next);
+ /* if we disappear a contour, don't advance twice */
+ if (cntr_Collect (e, cur, contours, holes, action, a, NULL, NULL))
+ {
+ parent = (*contours)->b; /* InsCntr inserts behind the head */
+ next = cur;
+ }
+ else
+ parent = a;
+ cur = next;
+ }
+ for (; *cur != NULL; cur = next)
{
next = &((*cur)->next);
/* if we disappear a contour, don't advance twice */
- if (cntr_Collect
- (e, cur, contours, holes, action,
- *cur == parent ? NULL : parent))
+ if (cntr_Collect (e, cur, contours, holes, action, a, parent,
+ parent_contour))
next = cur;
}
}
@@ -2110,6 +2150,7 @@ poly_Copy0 (POLYAREA ** dst, const POLYAREA * src)
*dst = calloc (1, sizeof (POLYAREA));
if (*dst == NULL)
return FALSE;
+ (*dst)->contour_tree = r_create_tree (NULL, 0, 0);
return poly_Copy1 (*dst, src);
}
@@ -2126,6 +2167,7 @@ poly_Copy1 (POLYAREA * dst, const POLYAREA * src)
{
if (!poly_CopyContour (last, cur))
return FALSE;
+ r_insert_entry (dst->contour_tree, (BoxTypePtr) * last, 0);
last = &(*last)->next;
}
return TRUE;
@@ -2185,6 +2227,7 @@ poly_InclContour (POLYAREA * p, PLINE * c)
p->contours->next = c;
c->next = tmp;
}
+ r_insert_entry (p->contour_tree, (BoxTypePtr) c, 0);
return TRUE;
}
@@ -2454,6 +2497,7 @@ poly_Init (POLYAREA * p)
{
p->f = p->b = p;
p->contours = NULL;
+ p->contour_tree = r_create_tree (NULL, 0, 0);
}
POLYAREA *
@@ -2488,11 +2532,13 @@ poly_Free (POLYAREA ** p)
for (cur = (*p)->f; cur != *p; cur = (*p)->f)
{
poly_FreeContours (&cur->contours);
+ r_destroy_tree (&cur->contour_tree);
cur->f->b = cur->b;
cur->b->f = cur->f;
free (cur);
}
poly_FreeContours (&cur->contours);
+ r_destroy_tree (&cur->contour_tree);
free (*p), *p = NULL;
}
commit 7c435c090d0f38b5ae865e233a881b381961e7d2
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
Use rtree of countours when computing an intersection
NOTE: This is more complex than the existing code, and on its own,
actually slows things down a little.
The intention is that the r-tree should be maintained continually,
so it doesn't need to be recreated with each call to intersect().
diff --git a/src/polygon1.c b/src/polygon1.c
index 329058e..d2c0798 100644
--- a/src/polygon1.c
+++ b/src/polygon1.c
@@ -509,9 +509,17 @@ typedef struct info
rtree_t *tree;
VNODE *v;
struct seg *s;
- jmp_buf env, sego, *touch;
+ jmp_buf *env, sego, *touch;
} info;
+typedef struct contour_info
+{
+ PLINE *pa;
+ jmp_buf restart;
+ jmp_buf *getout;
+} contour_info;
+
+
/*
* adjust_tree()
* (C) 2006 harry eaton
@@ -621,7 +629,7 @@ seg_in_seg (const BoxType * b, void *cl)
DEBUGP ("new intersection at (%d, %d)\n", cnt > 1 ? s2[0] : s1[0],
cnt > 1 ? s2[1] : s1[1]);
#endif
- longjmp (i->env, 1);
+ longjmp (*i->env, 1);
}
}
return 0;
@@ -679,7 +687,7 @@ get_seg (const BoxType * b, void *cl)
}
/*
- * intersect()
+ * intersect() (and helpers)
* (C) 2006, harry eaton
* This uses an rtree to find A-B intersections. Whenever a new vertex is
* added, the search for intersections is re-started because the rounding
@@ -697,104 +705,133 @@ get_seg (const BoxType * b, void *cl)
*/
static int
-intersect (jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
+contour_bounds_touch (const BoxType * b, void *cl)
{
- PLINE *pa, *pb; /* pline iterators */
+ contour_info *c_info = (contour_info *) cl;
+ PLINE *pa = c_info->pa;
+ PLINE *pb = (PLINE *) b;
PLINE *rtree_over;
PLINE *looping_over;
VNODE *av; /* node iterators */
struct info info;
BoxType box;
- if (add)
- info.touch = NULL;
+ /* Have seg_in_seg return to our desired location if it touches */
+ info.env = &c_info->restart;
+ info.touch = c_info->getout;
+
+ /* Pick which contour has the fewer points, and do the loop
+ * over that. The r_tree makes hit-testing against a contour
+ * faster, so we want to do that on the bigger contour.
+ */
+ if (pa->Count < pb->Count)
+ {
+ rtree_over = pb;
+ looping_over = pa;
+ }
else
- info.touch = jb;
- setjmp (info.env); /* we loop back here whenever a vertex is inserted */
- {
- pa = a->contours;
- pb = b->contours;
- while (pa) /* Loop over the contours of POLYAREA "a" */
- {
- int found_overlapping_a_b_contour = FALSE;
-
- while (pb) /* Loop over the contours of POLYAREA "b" */
- {
- /* Are there overlapping bounds? */
- if (pb->xmin <= pa->xmax && pb->xmax >= pa->xmin &&
- pb->ymin <= pa->ymax && pb->ymax >= pa->ymin)
- {
- found_overlapping_a_b_contour = TRUE;
- break;
- }
- pb = pb->next;
- }
+ {
+ rtree_over = pa;
+ looping_over = pb;
+ }
- /* If we didn't find anything intersting, move onto the next "a" contour */
- if (!found_overlapping_a_b_contour)
- {
- pa = pa->next;
- pb = b->contours;
- continue;
- }
+ av = &looping_over->head;
+ do /* Loop over the nodes in the smaller contour */
+ {
+ /* check this edge for any insertions */
+ double dx;
+ info.v = av;
+ /* compute the slant for region trimming */
+ dx = av->next->point[0] - av->point[0];
+ if (dx == 0)
+ info.m = 0;
+ else
+ {
+ info.m = (av->next->point[1] - av->point[1]) / dx;
+ info.b = av->point[1] - info.m * av->point[0];
+ }
+ box.X2 = (box.X1 = av->point[0]) + 1;
+ box.Y2 = (box.Y1 = av->point[1]) + 1;
- /* something intersects so check the edges of the contour */
+ /* fill in the segment in info corresponding to this node */
+ if (setjmp (info.sego) == 0)
+ {
+ r_search (looping_over->tree, &box, NULL, get_seg, &info);
+ assert (0);
+ }
- /* Pick which contour has the fewer points, and do the loop
- * over that. The r_tree makes hit-testing against a contour
- * faster, so we want to do that on the bigger contour.
- */
- if (pa->Count < pb->Count)
- {
- rtree_over = pb;
- looping_over = pa;
- }
- else
- {
- rtree_over = pa;
- looping_over = pb;
- }
+ /* NB: If this actually hits anything, we are teleported back to the beginning */
+ info.tree = rtree_over->tree;
+ if (info.tree)
+ if (UNLIKELY (r_search (info.tree, &info.s->box,
+ seg_in_region, seg_in_seg, &info)))
+ return err_no_memory; /* error */
+ }
+ while ((av = av->next) != &looping_over->head);
+ return 0;
+}
- av = &looping_over->head;
- do /* Loop over the nodes in the smaller contour */
- {
- /* check this edge for any insertions */
- double dx;
- info.v = av;
- /* compute the slant for region trimming */
- dx = av->next->point[0] - av->point[0];
- if (dx == 0)
- info.m = 0;
- else
- {
- info.m = (av->next->point[1] - av->point[1]) / dx;
- info.b = av->point[1] - info.m * av->point[0];
- }
- box.X2 = (box.X1 = av->point[0]) + 1;
- box.Y2 = (box.Y1 = av->point[1]) + 1;
+static int
+intersect (jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add)
+{
+ POLYAREA *t;
+ PLINE *pa, *pb;
+ int ca = 0, cb = 0;
+ contour_info c_info;
+ rtree_t *b_contour_tree = NULL;
- /* fill in the segment in info corresponding to this node */
- if (setjmp (info.sego) == 0)
- {
- r_search (looping_over->tree, &box, NULL, get_seg, &info);
- assert (0);
- }
+ /* count the contours in a and b */
+ for (pa = a->contours; pa; pa = pa->next, ca++);
+ for (pb = b->contours; pb; pb = pb->next, cb++);
- /* NB: If this actually hits anything, we are teleported back to the beginning */
- info.tree = rtree_over->tree;
- if (info.tree)
- if (UNLIKELY (r_search (info.tree, &info.s->box,
- seg_in_region, seg_in_seg, &info)))
- return err_no_memory; /* error */
- }
- while ((av = av->next) != &looping_over->head);
+ /* Make the contour r-tree from the one with fewest contours */
+ /* Inserting entries is more expensive than searching
+ * the r-tree. We do one ca times, the other cb times. */
+ if (ca < cb)
+ {
+ t = b;
+ b = a;
+ a = t;
+ }
+
+ /* make an rtree of b's contours */
+ b_contour_tree = r_create_tree (NULL, 0, 0);
+ for (pb = b->contours; pb != NULL; pb = pb->next)
+ r_insert_entry (b_contour_tree, (const BoxType *) pb, 0);
+
+ /* FIXME: We might actually need to re-build the r_tree if the geometry changes */
+ setjmp (c_info.restart); /* we loop back here whenever a vertex is inserted */
+
+ for (pa = a->contours; pa; pa = pa->next) /* Loop over the contours of POLYAREA "a" */
+ {
+ BoxType sb;
+ jmp_buf out;
+ int retval;
+
+ c_info.getout = NULL;
+ c_info.pa = pa;
+
+ if (!add)
+ {
+ retval = setjmp (out);
+ if (retval)
+ {
+ /* The intersection test short-circuited back here,
+ * we need to clean up, then longjmp to jb */
+ r_destroy_tree (&b_contour_tree);
+ longjmp (*jb, retval);
+ }
+ c_info.getout = &out;
+ }
+
+ sb.X1 = pa->xmin;
+ sb.Y1 = pa->ymin;
+ sb.X2 = pa->xmax + 1;
+ sb.Y2 = pa->ymax + 1;
+
+ r_search (b_contour_tree, &sb, NULL, contour_bounds_touch, &c_info);
+ }
- /* Continue the with the _same_ "a" contour,
- * testing it against the next "b" contour.
- */
- pb = pb->next;
- }
- } /* end of setjmp loop */
return 0;
}
commit 235e39298a9a464fd1b610d3a1e4de77a794dd60
Author: Peter Clifton <pc...@ca...>
Commit: Peter Clifton <pc...@ca...>
polygon.c: Accumulate vias and lines into batches before subtracting them
Accumulate polygons to clear from lines and pins in batches, then
clear from the polygon. Not quite sure why, but this _really_ seems to
speed up loading very complex boards. (e.g. 50sec -> 10sec for one example).
Possibly this is because withing the assembled batches, it is cheaper to
produce a more unified contour (touching lines), and the complex contours
of the main polygon are broken less frequently.
It isn't quite clear why this helps so much for pins / vias (which won't
usually touch each-other), however it changes a 50sec load time to 10 sec.
This could perhaps be because any contours which are smashed by clearance
of closely spaced vias / pins now only incurr the penalty of breaking the
main contour once every batch (100 vias / pins).
Batch sizes (20 for lines, 100 for pins / vias) aren't necessarily optimal!
Also, clear pins and vias last...
There is a chance these objects are simpler, and just end up as holes in
the main polygon, rather than causing a contour intersection. This means
it is cheaper to add them last.
If we add them first, and make the polygon complex, objects (usually
lines) which pierce the polygon's outer contour cause all the holes to
be removed and queued for re-insersion after the new contour is
constructed.
diff --git a/src/polygon.c b/src/polygon.c
index 586e8cc..65879c8 100644
--- a/src/polygon.c
+++ b/src/polygon.c
@@ -109,6 +109,8 @@ RCSID ("$Id$");
#define ROUND(x) ((long)(((x) >= 0 ? (x) + 0.5 : (x) - 0.5)))
#define UNSUBTRACT_BLOAT 10
+#define SUBTRACT_PIN_VIA_BATCH_SIZE 100
+#define SUBTRACT_LINE_BATCH_SIZE 20
/* ---------------------------------------------------------------------------
* local prototypes
@@ -860,22 +862,60 @@ struct cpInfo
LayerType *layer;
PolygonType *polygon;
bool solder;
+ POLYAREA *accumulate;
+ int batch_size;
jmp_buf env;
};
+static void
+subtract_accumulated (struct cpInfo *info, PolygonTypePtr polygon)
+{
+ if (info->accumulate == NULL)
+ return;
+ Subtract (info->accumulate, polygon, true);
+ info->accumulate = NULL;
+ info->batch_size = 0;
+}...
[truncated message content] |
|
From: <gi...@gp...> - 2010-11-07 19:56:59
|
The branch, master has been updated
via 323a0c52f7dfdaae51fd7ead87373b3dac90be14 (commit)
from ceacb65cc277e9b587668afebdc910ff559c4dc8 (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
=========
lib/geda.inc | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 80 insertions(+), 3 deletions(-)
=================
Commit Messages
=================
commit 323a0c52f7dfdaae51fd7ead87373b3dac90be14
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Add more ACY, ACPY, ALF, RCY, RCYP, JUMPER, and HEADER macros to fill
in the gaps.
:100644 100644 de5d3f1... 347adcf... M lib/geda.inc
=========
Changes
=========
commit 323a0c52f7dfdaae51fd7ead87373b3dac90be14
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Add more ACY, ACPY, ALF, RCY, RCYP, JUMPER, and HEADER macros to fill
in the gaps.
diff --git a/lib/geda.inc b/lib/geda.inc
index de5d3f1..347adcf 100644
--- a/lib/geda.inc
+++ b/lib/geda.inc
@@ -509,26 +509,48 @@ define(`PKG_ZIP40', `PKG_SD(`$1', `$2', `$3', 40)');
#
## Axial non-polar component (typically resistor or capacitor),
-# 300 through 1000 mil between pins
-# AXN300 .. AXN1000
+# 100 through 1600 mil between pins
+# AXN100 .. AXN1600
#
+define(`PKG_ACY100', `PKG_AXIAL_LAY(`$1', `$2', `$3', 100)');
+define(`PKG_ACY150', `PKG_AXIAL_LAY(`$1', `$2', `$3', 150)');
+define(`PKG_ACY200', `PKG_AXIAL_LAY(`$1', `$2', `$3', 200)');
define(`PKG_ACY300', `PKG_AXIAL_LAY(`$1', `$2', `$3', 300)');
define(`PKG_ACY400', `PKG_AXIAL_LAY(`$1', `$2', `$3', 400)');
define(`PKG_ACY500', `PKG_AXIAL_LAY(`$1', `$2', `$3', 500)');
define(`PKG_ACY600', `PKG_AXIAL_LAY(`$1', `$2', `$3', 600)');
+define(`PKG_ACY700', `PKG_AXIAL_LAY(`$1', `$2', `$3', 700)');
define(`PKG_ACY800', `PKG_AXIAL_LAY(`$1', `$2', `$3', 800)');
+define(`PKG_ACY900', `PKG_AXIAL_LAY(`$1', `$2', `$3', 900)');
define(`PKG_ACY1000', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1000)');
+define(`PKG_ACY1100', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1100)');
+define(`PKG_ACY1200', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1200)');
+define(`PKG_ACY1300', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1300)');
+define(`PKG_ACY1400', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1400)');
+define(`PKG_ACY1500', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1500)');
+define(`PKG_ACY1600', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1600)');
## Axial polar component (typically capacitor),
-# 300 through 1000 mil between pins
+# 100 through 1600 mil between pins
#
+define(`PKG_ACY100P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 100, 1)')
+define(`PKG_ACY150P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 150, 1)')
+define(`PKG_ACY200P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 200, 1)')
define(`PKG_ACY300P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 300, 1)')
define(`PKG_ACY400P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 400, 1)')
define(`PKG_ACY500P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 500, 1)')
define(`PKG_ACY600P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 600, 1)')
+define(`PKG_ACY700P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 700, 1)')
define(`PKG_ACY800P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 800, 1)')
+define(`PKG_ACY900P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 900, 1)')
define(`PKG_ACY1000P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1000, 1)')
+define(`PKG_ACY1100P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1100, 1)')
+define(`PKG_ACY1200P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1200, 1)')
+define(`PKG_ACY1300P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1300, 1)')
+define(`PKG_ACY1400P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1400, 1)')
+define(`PKG_ACY1500P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1500, 1)')
+define(`PKG_ACY1600P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1600, 1)')
#
## Axial diode (pin 1 is cathode)
@@ -539,7 +561,9 @@ define(`PKG_ALF300', `PKG_DIODE_LAY(`$1', `$2', `$3', 300)');
define(`PKG_ALF400', `PKG_DIODE_LAY(`$1', `$2', `$3', 400)');
define(`PKG_ALF500', `PKG_DIODE_LAY(`$1', `$2', `$3', 500)');
define(`PKG_ALF600', `PKG_DIODE_LAY(`$1', `$2', `$3', 600)');
+define(`PKG_ALF700', `PKG_DIODE_LAY(`$1', `$2', `$3', 700)');
define(`PKG_ALF800', `PKG_DIODE_LAY(`$1', `$2', `$3', 800)');
+define(`PKG_ALF900', `PKG_DIODE_LAY(`$1', `$2', `$3', 900)');
define(`PKG_ALF1000',`PKG_DIODE_LAY(`$1', `$2', `$3', 1000)');
#
@@ -548,26 +572,40 @@ define(`PKG_ALF1000',`PKG_DIODE_LAY(`$1', `$2', `$3', 1000)');
# RCY100 .. RCY1000
#
define(`PKG_RCY100', `PKG_RADIAL_CAN(`$1', `$2', `$3', 200)');
+define(`PKG_RCY150', `PKG_RADIAL_CAN(`$1', `$2', `$3', 300)');
define(`PKG_RCY200', `PKG_RADIAL_CAN(`$1', `$2', `$3', 400)');
+define(`PKG_RCY250', `PKG_RADIAL_CAN(`$1', `$2', `$3', 500)');
define(`PKG_RCY300', `PKG_RADIAL_CAN(`$1', `$2', `$3', 600)');
+define(`PKG_RCY350', `PKG_RADIAL_CAN(`$1', `$2', `$3', 700)');
define(`PKG_RCY400', `PKG_RADIAL_CAN(`$1', `$2', `$3', 800)');
define(`PKG_RCY500', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1000)');
define(`PKG_RCY600', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1200)');
+define(`PKG_RCY700', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1400)');
define(`PKG_RCY800', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1600)');
+define(`PKG_RCY900', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1800)');
define(`PKG_RCY1000', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2000)');
+define(`PKG_RCY1100', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2200)');
+define(`PKG_RCY1200', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2400)');
## Bottom lead polar circular component (typically capacitor)
# pin spacing 100 mil and up
#
define(`PKG_RCY100P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 200, 1)');
+define(`PKG_RCY150P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 300, 1)');
define(`PKG_RCY200P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 400, 1)');
+define(`PKG_RCY250P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 500, 1)');
define(`PKG_RCY300P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 600, 1)');
+define(`PKG_RCY350P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 700, 1)');
define(`PKG_RCY400P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 800, 1)');
define(`PKG_RCY500P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1000, 1)');
define(`PKG_RCY600P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1200, 1)');
+define(`PKG_RCY700P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1400, 1)');
define(`PKG_RCY800P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1600, 1)');
+define(`PKG_RCY900P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 1800, 1)');
define(`PKG_RCY1000P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2000, 1)');
+define(`PKG_RCY1100P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2200, 1)');
+define(`PKG_RCY1200P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2400, 1)');
#
## Crystal
@@ -686,10 +724,20 @@ define(`PKG_JUMPER9', `PKG_CONNECTOR(`$1', `$2', `$3', 9, 1)');
define(`PKG_JUMPER10', `PKG_CONNECTOR(`$1', `$2', `$3', 10, 1)');
define(`PKG_JUMPER11', `PKG_CONNECTOR(`$1', `$2', `$3', 11, 1)');
define(`PKG_JUMPER12', `PKG_CONNECTOR(`$1', `$2', `$3', 12, 1)');
+define(`PKG_JUMPER13', `PKG_CONNECTOR(`$1', `$2', `$3', 13, 1)');
define(`PKG_JUMPER14', `PKG_CONNECTOR(`$1', `$2', `$3', 14, 1)');
+define(`PKG_JUMPER15', `PKG_CONNECTOR(`$1', `$2', `$3', 15, 1)');
define(`PKG_JUMPER16', `PKG_CONNECTOR(`$1', `$2', `$3', 16, 1)');
+define(`PKG_JUMPER17', `PKG_CONNECTOR(`$1', `$2', `$3', 17, 1)');
define(`PKG_JUMPER18', `PKG_CONNECTOR(`$1', `$2', `$3', 18, 1)');
+define(`PKG_JUMPER19', `PKG_CONNECTOR(`$1', `$2', `$3', 19, 1)');
define(`PKG_JUMPER20', `PKG_CONNECTOR(`$1', `$2', `$3', 20, 1)');
+define(`PKG_JUMPER21', `PKG_CONNECTOR(`$1', `$2', `$3', 21, 1)');
+define(`PKG_JUMPER22', `PKG_CONNECTOR(`$1', `$2', `$3', 22, 1)');
+define(`PKG_JUMPER23', `PKG_CONNECTOR(`$1', `$2', `$3', 23, 1)');
+define(`PKG_JUMPER24', `PKG_CONNECTOR(`$1', `$2', `$3', 24, 1)');
+define(`PKG_JUMPER25', `PKG_CONNECTOR(`$1', `$2', `$3', 25, 1)');
+define(`PKG_JUMPER26', `PKG_CONNECTOR(`$1', `$2', `$3', 26, 1)');
#
## MTA Connector, (0.100 inch pitch)
@@ -724,11 +772,26 @@ define(`PKG_HEADER16_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 8)');
define(`PKG_HEADER18_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 9)');
define(`PKG_HEADER20_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 10)');
define(`PKG_HEADER22_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 11)');
+define(`PKG_HEADER24_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 12)');
define(`PKG_HEADER26_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 13)');
+define(`PKG_HEADER28_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 14)');
define(`PKG_HEADER30_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 15)');
+define(`PKG_HEADER32_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 16)');
define(`PKG_HEADER34_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 17)');
+define(`PKG_HEADER36_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 18)');
+define(`PKG_HEADER38_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 19)');
define(`PKG_HEADER40_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 20)');
+define(`PKG_HEADER42_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 21)');
+define(`PKG_HEADER44_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 22)');
+define(`PKG_HEADER46_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 23)');
+define(`PKG_HEADER48_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 24)');
define(`PKG_HEADER50_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 25)');
+define(`PKG_HEADER52_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 26)');
+define(`PKG_HEADER54_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 27)');
+define(`PKG_HEADER56_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 28)');
+define(`PKG_HEADER58_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 29)');
+define(`PKG_HEADER60_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 30)');
+define(`PKG_HEADER62_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 31)');
define(`PKG_HEADER64_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 32)');
#
@@ -746,12 +809,26 @@ define(`PKG_HEADER16_2', `PKG_CONNECTOR(`$1', `$2', `$3', 8, 2)');
define(`PKG_HEADER18_2', `PKG_CONNECTOR(`$1', `$2', `$3', 9, 2)');
define(`PKG_HEADER20_2', `PKG_CONNECTOR(`$1', `$2', `$3', 10, 2)');
define(`PKG_HEADER22_2', `PKG_CONNECTOR(`$1', `$2', `$3', 11, 2)');
+define(`PKG_HEADER24_2', `PKG_CONNECTOR(`$1', `$2', `$3', 12, 2)');
define(`PKG_HEADER26_2', `PKG_CONNECTOR(`$1', `$2', `$3', 13, 2)');
+define(`PKG_HEADER28_2', `PKG_CONNECTOR(`$1', `$2', `$3', 14, 2)');
define(`PKG_HEADER30_2', `PKG_CONNECTOR(`$1', `$2', `$3', 15, 2)');
+define(`PKG_HEADER32_2', `PKG_CONNECTOR(`$1', `$2', `$3', 16, 2)');
define(`PKG_HEADER34_2', `PKG_CONNECTOR(`$1', `$2', `$3', 17, 2)');
+define(`PKG_HEADER36_2', `PKG_CONNECTOR(`$1', `$2', `$3', 18, 2)');
+define(`PKG_HEADER38_2', `PKG_CONNECTOR(`$1', `$2', `$3', 19, 2)');
define(`PKG_HEADER40_2', `PKG_CONNECTOR(`$1', `$2', `$3', 20, 2)');
+define(`PKG_HEADER42_2', `PKG_CONNECTOR(`$1', `$2', `$3', 21, 2)');
+define(`PKG_HEADER44_2', `PKG_CONNECTOR(`$1', `$2', `$3', 22, 2)');
+define(`PKG_HEADER46_2', `PKG_CONNECTOR(`$1', `$2', `$3', 23, 2)');
+define(`PKG_HEADER48_2', `PKG_CONNECTOR(`$1', `$2', `$3', 24, 2)');
define(`PKG_HEADER50_2', `PKG_CONNECTOR(`$1', `$2', `$3', 25, 2)');
+define(`PKG_HEADER52_2', `PKG_CONNECTOR(`$1', `$2', `$3', 26, 2)');
+define(`PKG_HEADER54_2', `PKG_CONNECTOR(`$1', `$2', `$3', 27, 2)');
+define(`PKG_HEADER56_2', `PKG_CONNECTOR(`$1', `$2', `$3', 28, 2)');
+define(`PKG_HEADER58_2', `PKG_CONNECTOR(`$1', `$2', `$3', 29, 2)');
define(`PKG_HEADER60_2', `PKG_CONNECTOR(`$1', `$2', `$3', 30, 2)');
+define(`PKG_HEADER62_2', `PKG_CONNECTOR(`$1', `$2', `$3', 31, 2)');
define(`PKG_HEADER64_2', `PKG_CONNECTOR(`$1', `$2', `$3', 32, 2)');
#
|
|
From: <gi...@gp...> - 2010-11-07 18:09:31
|
The branch, master has been updated
via ceacb65cc277e9b587668afebdc910ff559c4dc8 (commit)
from 262ec1ab712879aa27a4e1b318b8128a8bf45fd4 (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/toporouter.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
=================
Commit Messages
=================
commit ceacb65cc277e9b587668afebdc910ff559c4dc8
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Comment out code to dump toporouter surfaces.
:100644 100644 60c3853... 0ad26b5... M src/toporouter.c
=========
Changes
=========
commit ceacb65cc277e9b587668afebdc910ff559c4dc8
Author: DJ Delorie <dj...@de...>
Commit: DJ Delorie <dj...@de...>
Comment out code to dump toporouter surfaces.
diff --git a/src/toporouter.c b/src/toporouter.c
index 60c3853..0ad26b5 100644
--- a/src/toporouter.c
+++ b/src/toporouter.c
@@ -2624,6 +2624,7 @@ check_cons_continuation:
gts_surface_print_stats(l->surface, stderr);
#endif
+#if 0
{
char buffer[64];
FILE *fout2;
@@ -2631,6 +2632,7 @@ check_cons_continuation:
fout2 = fopen(buffer, "w");
gts_surface_write(l->surface, fout2);
}
+#endif
}
|
|
From: <gi...@gp...> - 2010-09-29 20:52:21
|
The annotated tag, pcb-20100929-RELEASE has been created
at f4a9acb4a642e5fdf1e2312bff9ab56ac5984e2e (tag)
tagging 0cf505d684209fa776483f323f20d3fbadddfc68 (commit)
tagged by DJ Delorie
on Wed Sep 29 16:51:14 2010 -0400
pcb-20100929 release
Anthony Blake (3):
Added topological autorouter
GTS build script changes
gts.h fix
Anthony M. Blake (2):
Toporouter: fixed a few AMD64 warnings
Merge branch 'master' of ssh://amb33@git.gpleda.org/home/git/pcb
Ben Jackson (48):
Fix [ 1751578 ] 'move to current layer' doesn't re-plow polygon correctly
Fix bugs 1751572 and 1743534 by allowing a remove on an endpoint to delete
Fix the crash from [ 1724453 ] PCB Crashes with bad footprint (in its library)
Apply [ 1751580 ] polys should not be selectable/considered when thin-drawn
Fix [ 1751566 ] When 'far side' hidden, hidden elements don't deselect
Search for rat-end connections using 3x3 "fat" ends to avoid having
Fix [ 1751574 ] undoing rotation that put an elt inside a poly didn't fix plow
Fix [ 1751568 ] shorted nets stay orange after fixing and re-opt netlist
Fix bugs with undoing "group" moves of objects over a polygon. The group
Add (under ifdef) code I used to debug a report of
Change rendering of rounded corners used when clearing polygons. This
The correct point on a line now moves with a polygon (fix cut'n'paste typo)
Make DRC dialog next/continue to clarify its function.
Ratlist generation is changed to favor connecting to polygons when they
Fix printf format warnings.
Treat VIAFLAG rats (displayed as donuts) as round targets, not as the
Plumb the NetlistShow() hid action in lesstif. Takes a pin name or
Shift-click with the via tool to connect it to the current layer as you
Add support for clearing text from polygons. Text with the clearline
Fix bugs intoduced by revision 1.41 while preserving the fixes in 1.41.
LIST_LOOP works on circular lists, but at least some code will produce
Apply patch [ 1835365 ] Fix for [ 1820385 ] Can't close the preference dialog
Change all the GetXY prompts for greater clarity.
Remove obsolete (generated, even!) file
Apply [ 1726201 ] SaveTo(PasteBuffer.file) for footprint creation
Add some prototypes for global functions returning double that will
Fix two bugs in my via-rats patch:
In case 'biggest()' polygon is 0 area, init size = -1 instead of 0.
Fix a typo.
Missed a spot when adding 'clearlineflag' support to Text.
Fix [ 1836172 ] shift-create two vias, undo twice, internal error
Fix [ 1836169 ] undo of shift-paste element replacement broken
Fix [ 1820398 ] Inconsistant vias with move-to-layer
Partial fix? [ 1775101 ] Undo with the line tool sometimes switches to wrong node
Data->LayerN should generally be avoided. It's not initialized for buffers.
Don't create empty text objects.
Avoid moving elements snapping to their own pins or pads.
ignore paste layers
Rebuild with 2.61
Add XRENDER support to the Lesstif HID. Rat lines and soldermasks are now
Add gross hack to avoid using mask in DrawRats() for othet than lesstif
Make 'outline' layer test case-insensitive to match other instances.
Add Zoom(Toggle) and bind it to ` (backtick).
Temporarily change PCB=yyPCB while InitClip after load
Fix crash with 'ben-mode' if your layer stack is the reverse of DJ's.
Add initial gitignore files covering autogen files and GTK HID build
GTK HID: Background color can be set live from config dialog
Add *.backup to gitignore (in case you test run PCB in the tree)
Bert Timmerman (4):
Apply filters to load filechooser dialogs. [1988982] [2686963]
Correction of the pcb homepage url in the about dialog window.
gEDA-dev: pcb [PATCH] Correction of the geda homepage url and wiki url in the about dialog window.
gEDA-dev: [pcb patch] Correction of the pcb homepage url in the batch HID
Bill Wilson (21):
Fix a zoom glitch.
ghid_invalidate_all() when colors change.
Fix gtk magenta color messages -> initialize all new hidGC colornames to
Fix draw arc when flipped.
Set netlist nodes enabled by default when NetlistChanged.
Turn of Disable all nets button when NetlistChanged.
Pan to a netlist window selected node if it's not visible.
I wrapped too much into the verbose option so the file
Fix netlist window to scroll to net/node when user lookups connection.
mode_button_toggled_cb() didn't sync ghidgui->settings_mode
Support --bg-image in the Gtk HID. Images can be jpg, png, gif, etc. as
Make ghid_get_coords() x value account for side viewed (when using TAB).
Fix soldermask draw while TAB view from solder side.
For the Gtk HID, add an alternate vertical window layout mode to help
Fix route style "Save as default" bug.
Remove Gtk HID specific build_route_string() function.
Clean out FIXMEs specific to the Gtk HID.
Clean out Gtk HID related FIXMEs. Also old background image code which
Clean out Gtk HID related FIXMEs
Couple of small typo bugs: a missing "break" and needed -1 arg to size request.
Update status line after menu Save layout and Save layout as.
Chitlesh GOORAH (1):
Update the quick reference
DJ Delorie (422):
Add trace optimizer.
Add Thindraw
Add orthogonal move feature
Regenerate with djopt.c
Automatically set CLEARLINEFLAG if the user modifies the clearance.
The minimum size of a board should never be more than the current
Fix off-by-one bug in handling bloat.
Sort drill report by hole size, list total hole count.
Properly scale outline and alignment. Add segment to alignment
Solder mask layers are reliefs and normally are positive prints.
polygon fills must have a defined aperture also
Dummy commit to test log messages
second dummy commit
Support however many layers are configured.
Add FAB drawing page.
Use the layer groups to determine which layers are solder and
Don't assume that an all-ones pixel is white.
* Detect re_comp(), regcomp(), and <regex.h> (select.c doesn't use the
* Detect re_comp(), regcomp(), and <regex.h> (select.c doesn't use the
Regenerate.
Provide our own yywrap(), just in case.
add ylwrap
add file-driven menus
add version.texi for non-maintainers
Remove gcc-isms
Fix bug wrt intersecting layer groups in miter
Don't use local var for widget name.
Add flag to default to optimizing only autorouted nets, plus menu option to
Be even more picky about which line is chosen as an example.
Run gather-actions only if maintainer-mode
Add support for menu accelerators. Replace hotkey translations with menu
Cut and Copy from the popup menu now wait for a click before acting (bug 978406)
Change size of selected objects, fix enlarge options to actually enlarge
Add limited support for a behind-the-board background image.
Add command history to : widget.
Avoid checking pin numbers for unnumbered pins.
Print plated and unplated hole counts on separate lines.
Check for numberless pins.
add non-gcc definition of ATTRIBUTE_UNUSED
Oops, overzealous patching ;-)
Add FlagHaveRegex (have_regex) so that the SelectByName menu entries work.
Regenerated
Sort actions by modifier so that both Ctrl<Key>x and <Key>x work.
Document resource file comments
Add support for comments. Comments begin with '#' and extend
Add -action command line, to execute one action string at startup
Quote "$@" to keep args whole
Support multiple actions per line for -action and -script
Move right-click popup menu to pcb-menu.res also.
Oops, take out test entry
Allow FAB author name to be set by .Xdefaults
Put parens around computed macros. Use ~0 instead of -1 for "all bits".
When saving files, convert flags to symbolic format instead of
Minor bugfixes related to error handling
Fix the "all pads are ovals" bug.
Avoid name conflict with abs/min/max
Update sources to support more than 8 layers.
Fab author fixes from Karel.
Add "join" to SetFlag, ClrFlag, and ChangeFlag actions.
Inline documentation.
New file, for extracting inline documentation.
Document ElementArc, ElementLine, and Mark.
HID merge.
regenerate everything with FC4.
Update to automake 1.9 files.
New file, from automake 1.9.
Remove UpdateSettingsOnScreen. Call InitCrosshair only for GUIs.
Remove a debug printf.
Call lpr, don't just save the file.
Don't try to run the idle proc until the GUI is created.
MyCalloc, MyRealloc, MyStrdup: make final parameter (tag string) const,
Misc bugfixes and changes, to silence compiler warnings.
Use explicit void** pointers to avoid aliasing problems.
Use void * pointers to avoid aliasing problems.
Avoid aliasing problems.
Round drill sizes to nearest mil for fab drawings and gerber drill file.
Change the way we handle built include files.
Also look for ~/.pcb/pcb-menu.res. Actually use the path we found ;-)
Add File->Revert.
hid actions: remove needs_coords, use need_coord_msg to determine when
hid_actionl must be terminated with NULL, not a plain 0, in case integers
Fix eps->pdf rule to set size and resolution right. Limit pcb->* to visible areas.
Initial chunk of inline action docs.
Document the rest of the registered actions in action.c.
Print correct symbol counts for drills on fab drawing.
Document actions in command.c.
Document actions in netlist.c
Determine when we need to use the complex erase logic, and when we can just
Add --bg-image option to lesstif hid to load a background image.
Make sure the Message and return are in the same scope.
Document the puller action.
Document actions in report.c.
Include sys/types.h so that regex compiles on more hosts.
Remove all the prev-next-up links, reformat all the texi files to allow
Add --psfade option.
Document lesstif hid actions.
Define on-board objects in terms of base types.
Comment tweak.
Use locale-independent strtod and dtostr functions.
Add support for drawing/exporting paste layers.
Fix drawing of box around text items in buffer.
Add batch-mode HID.
Fix test for interactiveness.
Fig typo in ChangeDrillSize menu.
Ignore locked objects unless LOCKED_TYPE is passed (lock tool).
Change gerber names to be compatible with pre-hid.
Name internal gerber layers sanely.
Split plated and unplated drills in gerber output.
Reset layer value cache before we shortcut for counting apertures.
Report on locked objects if there are no unlocked objects under the cursor.
Adjust endpoints of lines that don't quite reach adjoining lines.
Add Flip action, both vertical and horizontal.
Remove lesstif board flipping item.
Syntax fix for DisperseElements()
Fix logic a bit, don't try to move pins.
Fix rounding bug when collecting drill sizes.
Compensate for board flipping in the panning code.
flexible max_layers
Print actions called when verbose.
Merge lesstif's Flip() action into SwapSides to avoid conflict with core Flip().
Remove obsolete ActionSwapSides()
Account for board flipping when zooming.
MoveLayers cleanup tasks - thermals, pips, undo
Don't delete vias with thermals. Try to split diagonal lines at pins and vias.
Fix layer group parsing code. Avoid trailing colon in group string.
Fix minor rounding bug in c_dtostr().
Minor patches from Larry.
Fix draw_rect vs board flipping bug.
use "top" and "bottom" to describe the side flags, instead of using
Add support for multi-key hotkeys, via <Keys>abc syntax for a/b/c sequence.
Add the ability to user-configure mouse actions.
Enable loaded netlists by default.
Allow extended selections.
When the drill list fits "naturally", no offset is added, which makes
spelling fixes from Larry.
When deleting a layer, make sure to zero out the now-unused slot at the end.
Allow New() to take a name, so that the user need not be prompted during
Use the old style (mil) syntax when saving font info, if the values permit it,
Add font editing mode (FontEdit() and FontSave())
Add X_CFLAGS to CFLAGS so that Xm/Xm.h can be found.
Draw via annulii on assembly drawings.
Don't let search find backsilk if invisible objects are off.
Let right-mouse do "rotate" for now.
post-initialize PCBs loaded from files.
Add default colors for layers 9..16
If a pad/via's clearance is zero, don't attempt to draw a zero-width clear.
Allow via clearance to be reduced to zero.
fill_rect needs the same point-ordering as draw_rect
Special case: allow vias with exactly zero clearance.
Don't print invisible silk.
Don't consider off layers for fast mask. Don't print paste.
When printing as-shown, mirror the image if we're viewing the solder side.
Fix rats enable/disable code.
Constrain arc start angles to -180..180 degrees.
Remove obsolete comment.
Add arbitrary attributes to PCB and Element types. Ignore optional flags
Copy attributes when copying element data.
Doc typo.
Regenerate to add attributes
Shift-click replaces element on pcb with element in buffer.
[pc...@ca...] Patch to fix bug #1553558, Stack corruption PCB bug in
Draw the elements' marks.
Break out layer->filename code. Fix bug in top/bottom detection.
Add multi-file output option.
Add MinMaskGap() action.
Fix undo for MinMaskGap()
Avoid attempts to realloc to zero bytes.
Allow rectangular polygons when converting a buffer to an element.
Fix bug in poly point sorting for element conversion.
Note pixel slop in gtk hid. Increase slop to 10 pixels.
Display remaining rats in status bar.
If Settings.RatThickness is less than 20, it's a pixel size, not a pcb size.
Add a --verbose option to list gerber files as they're printed.
A layer group containing only an "outline" or "route" layer will be named
A layer group that only contains a layer named "outline" or "route"
I did the one about separate ps files.
Add -rdynamic when it's available.
Fix off-by-one error.
Dynamically load plug-ins (hids, actions, etc) at runtime.
Fix plugin init function logic.
Remove debugging printf.
Load settings from ./pcb.settings and ~/.pcb/settings. Add :savesettings
Add global "exporter" option.
Minor bug fix for exporter.
Add RTLD_GLOBAL.
Keep ElemenOn and *SILK->On in sync.
If we're converting a buffer to an element and the buffer has no associated
Report units in mm or mils as selected by user.
Move layer ID text outside of the "board" area. Print board name,
Move thermals when we move layers.
Handle edge conditions when adding/removing layers wrt thermals.
Allow attributes in old-style elements too.
Add SDIP20. Fix comment.
Add automatic busy cursor. Add (disabled) debug code for arc thindraw.
Add progress() hook to HID structure. No actual implementation yet.
Fix progress prototypes.
... and return 0 for progress hooks.
Remove completed projects, add some new ones.
Increase default size of main window.
Add support for HID_Enum in attribute dialogs.
Take "enums" off the lesstif list.
Cast away const-ness.
Don't draw plated holes on outline gerber.
From: Hans Nieuwenhuis <vz...@xs...>
Keep canonicalizing lines until they're all canonicalized.
Update from ../src
Don't call popen() if we don't need to.
Use a global aperture list instead of per-layer lists.
Make sure we have a current mark when we convert selection to an element.
Add more functionality to netlist dialog.
Draw plated holes when exporting.
Fix gtk grid when board flipped.
Fix logic for adding new rat lines to the netlist.
Round drill sizes before reporting them.
Add command line option for setting DrawGrid
Always initialize default layer names.
Add "C" for Center() action. Provide examples for zooming-with-centering
Change the way the busy cursor is done. Called for autoplace, autoroute,
Call busy before applying the vendor map.
Properly deal with quoted characters in both string reading and string writing.
Cache vendor lookups. Use binary search instead of linear.
Add printer calibration code for lesstif HID.
Compensate for rotated boards. Allow the print step to be skipped.
Keep track of the minimum line size for text depending on which layer
Move declarations before statements (patch by Ben Jackson <be...@be...>)
Don't use the crosshair's position to keep track of whether it's in the window
Attach status bar widgets to the correct siblings.
Don't print the scale if we're filling the page. Don't print (null)
Silence some compiler warnings.
Report on pads as rectangles, not lines, so we get width and height for
Allow the user to load a footprint as a pcb; create a suitably-sized pcb
Add calibration values to the attribute list so they can be stored
Avoid segfaults when loading elements, fixes bug in load-element-as-pcb patch.
Made flags type big enough to hold PCB flags.
Add basic line clipping to both GUIs.
Allow :s without filename to use current filename.
Use polygons to draw square ended diagonal lines.
Permit the existence of diagonal pads.
Use ".fp" when loading element data.
Allow for diagonal pads.
Add FreeRotatebuffer(Angle) (angle can be any angle)
Preserve width *and* height when manipulating arcs.
Draw non-circular arcs manually.
Add Delete() action. No arguments: delete selected ELSE object, but options
Don't free home_pcbmenu until after it's used.
Gerber, PS, and EPS ignore the thindraw settings. Fix bug in PS
Swap the direction of scroll bars when the board is swapped.
When swapping board sides, swap top/bot layers even if both layers
When the layer stack is reset, bring the component layer to the front
Add missing variable.
When a board is loaded, the first route style is automatically
Fix references to RouteStyleChanged (should be RouteStylesChanged).
Fixed a bug in flags_to_string where the LOCALREF pcb flag would
Protect against empty :command string.
Don't allow LayersChanged if there's no GUI yet.
More paranoid check for "gui is up"
Tracker 1753084 - fixes 1751589, merged soldermask has larger than expected
Apply bloat to drawn rectangles.
Don't limit keepaway size to minimum *line* size.
Adds an export in mm to the BOM export dialog [1742399]
patch 1738364: flag for non-clipped polygons.
Ben: Avoid duplicate passes through pad clearances.
More empty :command checks [1751582]
Fix the have_regex flag in pcb-menu.res [1751564]
Match whole names with regex's, when possible. [1741650]
[ 1751567 ] with thin-draw-poly on, soldermask display is messed up
Make sure loaded buffers have a proper pcb backpointer.
Give data->pcb a real type.
Add missing else.
Make sure the leftmost end of the line is visible in the log window.
Don't draw pins/holes on the outline layer. Include commented-out code
Fixes for DRC of slanted pads. Tracker bug 1791388 and patch 1791392.
Properly thin-draw slanted pads.
Move silk away from pads. Fix notch in SO footprints.
Reduce silk width of connector/header/jumpers (some fabs clip it to the pads)
Don't complain about checking the shift key when exporting pngs from
Snap to pin/pads whenever we're within the pin/pad copper, unless shift is
Fix pin bound calculations based on new thermal calculations.
Expand min/max values.
Add annulus and mask gap to pin/via report.
Update the status line even when we don't have a styles dialog.
Additional slanted-pad patch for missed DRC
lesstif_show_library: Don't reset the dialog when we're just re-displaying it.
Don't crash if a scanned element has no text.
Don't just clean out RemoveList, free it, so it's created properly later.
Draw outline layer on all other copper layers when "draw outline" is
Export DrawLayer() for the ps exporter.
Draw arc start/end radii in separate colors, and dotted, if enabled.
Add global puller.
Attach the show soldermask layer button to its flag.
Add 50 mil grid setting. Add global puller submenu.
Fix printer calibration.
Check for Xrender library.
Fix enter/leave logic to avoid leaving obsolete crosshair-attached
Various changes from Kai; cut-copy swap for lesstif.
Add TSSOP14 and TSSOP16
Resolve some const-cast issues.
Cast parameters to right type.
Fix some off-by-one bugs.
Re-initialize num so that multiple actions will be parsed properly.
Strict aliasing patch from Larry Doolittle.
Allow negative bloats
Ignore zero-radius filled circles.
If a layer selected through --layer-stack isn't found, let the user know
When drawing zero-length lines, draw a square or circle according to the
Fix off-by-one bug drawing pads.
Don't say ,TZ as we're not omitting trailing zeros.
Add ELEMENTARC_LOOP
Allow outline layers that have nothing but arcs.
Do not require a second paramter for SaveTo(Layout)
Oops, fix bug from previous patch.
Add "Ben Mode". Fix export of thindrawn polygons.
Add --ben-flip-x and --ben-flip-y options to produce "ben mode" images
Bump up font size and aperture count.
Add missing parameter name
Fix lesstif crosshair color - joel silvestre
Fix poly clearance around rotated pads - Robert Fitzsimons and Ineiev
Put exploded pads on the correct layer
Don't merge two lines if the join flag differs.
Move splitlines even earlier, to avoid unwanted changes.
Fix the foo.ps.type.ps bug
Test the two lines, not the line vs the current pcb, for compatible
Merge thermals from old flags, not overwrite them.
Add MinClearGap() action.
Add flags for whether various layers are shown.
Add support for suffixes on numbers, like "mm", "um", "in", or "mil". No suffix
Increase resolution of gerbers to 0.01 mil; drills remain at 0.1 mil
append '-' on all parameter names to prevent mis-interpretation of such.
Add initial "getting started" guide.
add texi2dvi check and doc/gs subdir
missed files
More missing files
Set home from homedir.
Fix via annulus calculations, from Jasper
Avoid checking memory before short-named files.
Make sure we clean up if dlopen fails.
Typo.
Add an option for undocumented attributes.
Rename ben-mode to photo-mode.
Add "empty layer" hint to HID. Add option --all-layers to gerber export
sf patch 2162834 from d.ineiev - count apertures for diagonal pads
Add min-drill and min-ring to the saved config list, and save the config
Make sure the user has specified an element for the pinout window.
Include explicit text/lines/etc on silk layers in assembly drawings.
fix parsing of old-syntax arcs.
Fix flipping of arcs.
Add "hide names" option to hide all refdes on the board temporarily.
Add description of how polygon data works from Ben, and debug routines
Handle wrap-around when searching the string hash table.
Add outline mode for photo-mode, from Mark Rages
Add only-visible support to photo-mode, check for more outline fill spots.
Don't show undocumented options.
Skip undocumented options.
bugfix: avoid NULL pin names with Report(NetLength)
single-action register/deregister
Add "report all net lengths" option
Oops, re-comment-out a debug statement.
Add bloat to PNG hid
Fix "Design Rule Checker moves elements and traces off grid"
Handle NULL strings when replacing elements.
Add support for specifying soldermask and solderside from the command line
Fix photo-mode mask layer.
Check for empty layers.
Work-in-progress for LF: netlist importing
Undo an accidental change.
Add Import() action
Add attribute editor GUI to gtk and lesstif.
Add the new netlister.
Add import to gtk menu, change lesstif menu to match.
Changed element/netlist syntax as follows:
Fix drawn circles
swap png bloat too
Rename NetlistChanged() to avoid conflicts
Fix pcb forward annotation bugs
Revert an unintended change.
Check for NULL names.
Check both FOO and FOO.fp for footprints.
Add more flexibility to the import::make option.
Fix bogus cast to BoxType
Allow empty attribute values.
Fix Typo
Record the calculated length in Report(NetLength)
Return non-fail for ReportAllNetLengths()
Add AttributePut functionality.
Let the GUI deal with choosing schematics.
Add missing newline.
Implement lesstif ImportGUI()
Fix doc typo
Handle attempts to change clearance on polygons.
Add hint about :MinClearGap(Selected,=10,mil)
Allow for only one confirm button.
Fix PNG bloat for drills.
Clarify the meaning of keys bound to SetValue()
Don't select silk on the far side if the far side is not shown
Quote strings
Add FreeRotateBuffer to the Menu
Update Import() docs
Check for NULL element name when adding attributes.
Export lesstif attributes.
Export GTK attributes.
Print all command line options with help.
Merge lesstif attributes.
Merge GTK attributes.
Add AttributeRemove functions
Add new-part-location to import
Enhance GetValue
Store units for import::disperse
Add import settings to menus
Fix layer visibility logic for some boards.
Fix typo in parse_y.y
Fix arc bounding box math.
Fix lesstif SwapSides magic layer option.
Avoid divide-by-zero
Fix bug tracker # 3064887
If we don't use the outline to clip, don't draw it either.
Wrap more messages in debug
Don't print "can't open ./default_font for reading" all the time
Make new text clear polygons
Fix for distcheck errors.
Update ChangeLog from git logs.
Update NEWS from ChangeLog
branch version 20100929
Dan McMahill (1054):
Initial revision
remove unneeded output files
remove obsolete files
remove obsolete files
remove obsolete file (the contents live in pcb/newlib/ now
these don't really belong in CVS. The sources are in the doc/ directory
remove obsolete files
- add section on checking out via anoncvs and updating via anoncvs.
coding style fixes to allow this to be compiled with the SunPRO c compiler.
change c++ style comments to c style and remove the use of non-static
bump to 1.99o since a 1.99n version was posted to the geda list.
when checking for a NULL pointer compare to NULL rather than 0 for
add check for strerror()
move the strerror test up in the configure process so we don't need to
if strerror() is present on our system then use it instead of trying
remove spurious file which should not have been imported.
remove spurious file which should not have been imported. Noted by
add missing bga.inc and resistor_adjust.inc included. The latter addresses
change yy_current_buffer to YY_CURRENT_BUFFER. This addresses the build \
add 2 more levels of zooming to the menu. Inspired by an email from
add missing rules.inc
Fix a bug in the way the current working directory is found. This caused
Allow '=' at the beginning of the zoom exponent to indicate an absolute
remove unused varargs.h header which breaks gcc-3.3 compilation
only declare sys_nerr if we're using the sys_errlist interface. This
add the automake/conf generated files to make building from CVS sources
add automake/conf output to make it easier for users to build
note that autoconf 2.13 is not new enough and mention how to get the version
fix parse errors on DS1225 and DS1230. Patch provided in bug report
fix parse errors in TL083 and ua747. Patch provided in bug report
fix parse error on uA7952C. Patch provided in bug report
Remove extra space in one of the pin names in AT90S2313_dil
add DJ and myself
add a note on creating snapshots
Makefile.am is not a library component so do not install it as one
regen
add info-dir entry
Add 20,28,32 pin PLCC footprints, both unsocketed and socketed (through hole).
add scripts which autogenerate geda.m4 and geda.list from geda.inc.
when given a -I flag, look both there and the current directory for .list
add qfpdj.inc to the include list
rework the QFP packages fixing several bugs and greatly expanding the
these files are autogenerated now
remove the lines which tried to copy the source file RCS Id to the generated
change 'Square' to 'Rectangular' to the comment for the rectangular QFP
add brief section about the trace optimizer.
add a --with-xaw= option that lets you select an alternative to Xaw. For
regen
don't hardcode -lXaw in the FUNCPROTO and related tests.
regen
Add two new chapters to the manual. The first attempts to provide some
add example/libraries/Makefile
regen after example/libraries addition
update copyright for last changes
add a figure to help with describing the pads. Also add an Xresources file needed to convert the tgif drawing to png
add 60 members of the Quad Flat No-lead (QFN) package family. Based on
regen after qfn.inc additions
remove some output files which should have never been in CVS.
show pad names in object report. patch supplied in bug report 787711 by
correct the reporting of soldermask relief for pads and via's. Patch
fix two bugs related to gerber file generation. The first bug is triggered
add a few more variants of wish (wish83, cygwish80, etc) to search for
search for libXpm which is needed on cygwin libXaw
move the pcb script to a subdirectory to avoid name conflicts with the Pcb
regen after moving the pcb script to a subdirectory.
use AC_PATH_PROGS to search through a list of candidates for wish
Change how the polarity of the soldermask relief layer is handled. The
regen after adding Xpm check
add rules for creating postscript and png from a tgif drawing. Needed for improved docs.
regen
When trying out the various -R, --rpath, etc. compiler flags, actually
regen after -R fix
add footprints for Johnstech Evaluation Socket for QFN packages
add -*- m4 -*-
add MTA100 connectors
Add amphenol connectors. Start out with the ARFX1229 SMA connector.
regen after adding amphenol library
remove extra whitespace at end of ARFX1229 line
correct capitalization for amphenol_ARFX1229
add note about the dangers of whitespace in .list files
add bourns 3224G, 3224J, 3224W, and 3224X trim pots
add some more SMA connectors
include the bourns library
add through hole test point footprint.
- add a handful of 3 pin SMT EMI filter footprints
regen after adding bourns library
add several minicircuits packages
regen after adding minicircuits
add an extra argument to COMMON_SMT_DIL_MIL and COMMON_SMT_DIL_MM to
deal with SMT DIL packages with an odd number of pads per side
Add the panasonic EXB series of chip resistor arrays.
regen after adding panasonic library
rename the SOT23 and SOT323 footprints here to SOT23_CEL and SOT323_CEL
add SC70_3, SC70_4, SC70_5, and SC70_6 footprints (the 3,4,5, and 6 pin
fix typo in a comment
with reverse order numbering in COMMON_SMT_DIL_MIL and COMMON_SMT_DIL_MM,
add Amp connector library. Currently its populated with the 767054 series
regen after adding amp library
add a features wish list. not sure if this is the best place for such
add element versioning and database of good elements
properly pass down the arguments to the underlying macro for the PKG_AMPHENOL_ARFX123{0,1,2} packages
bump copyright date
fix some quoting
- modify the 2 pad smt base definition to put the origin of the footprint
add missing RCS Id
add missing RCS Id
correct the aperture definition output lines and the drill tool definition
Convert to a high resolution footprint. Pads are a little more accurate
fix a couple of other bugs related to the high res changes. In particular,
fix generation of fab drawing with the high resolution changes
partially undo the last change with respect to quoting. Only
One more hi-res buglet. Correct parsing of 'Arc'. Thanks to Bill Wilson
note harry's hi-res changes.
#/bin/sh -> #!/bin/sh to make these execute correctly.
add Merge_dimPCBPS
regen after adding Merge_dimPCBPS
correct the drill diameter in the drill report after the hi-res changes
add a way to control the scale factor associated with thermals. This is
add checks for logf and expf
regen after adding logf and expf checks
install MergePCBPS and Merge_dimPBPS
add a place for putting our own implementation of missing/broken functions.
regen after adding compat.c/h
remove extra whitespace in generic208_lqfp
add a PKG_CONNECTOR_DIL for 2 column headers with DIL pin numbering.
whitespace fix
clarify the pad creation a little
a HEADER60_2 should have 60 pins not 50 as noted in bug report 900231
enable the regex select stuff. A trial of a regex select of some components
Added a new action which will toggle the visibility of
document the ToggleVisibility action
one more regex bug fix noted by Matt Ettus
100 pin QFP packages have 100 pins not 72
revert last change. Some compilers including gcc-2.95.3 do not like it.
increase soldermask relief on mounting pads
test commit
test commit #2
test commit #3
hires-ify the COMMON_SMT_DIL_MIL macro. The macro already took input
Correct the spacing between the rows of pads. Also fix one of the pad
Fix SDIP (shrink DIP) footprints. Patch from Wojciech Kazubski in
fix refdes silk size
add cts library containing CTS series 742/3/4/5/6 resistor packs
fix the EXTRACT_END flag
put variable declarations at the beginning of functions. Avoids syntax
RCS Id police
RCS Id police
fix some 64-bit bugs to get this working on my alpha. Of prime importance,
When printing to RS-274-X also generate a centroid data file (X-Y data)
RCS Id and config.h police
add a note about the centroid and bill of materials output. While here
minor fixes to get the distcheck target working again.
regen
RCS Id police
put a string which is repeated several times into a #define and use that
Add some DRC checking of silkscreen layers. Currently this check looks for
clarify a comment
adjust spacing between the 2 rows of pins to better match the datasheet
protect the inclusion of string.h with HAVE_STRING_H
fix typo
fix typo in comment
correct the pin/pad bounding box calculation. Bug noted by David Koski.
add a comment
unset XUSERFILESEARCHPATH which causes a conflict with XAPPLRESDIR
add missing string.h (for strcmp). Noted by Dave McGuire
fix a hi-res bug in the polarity arc silk for some SMT DIL pkgs
add SOJ packages (lots of them)
make sure we get the preamble in all EPS output files. Bug noted by David Koski
update the COMMON_SMT_2PAD_MIL macro to the newer element format. With this
add INFO-DIR-SECTION Miscellaneous per bug #957369 submitted by Mike Frysinger
bump date
add test for rint()
regen after adding rint() test
Fix the segfault bug noted in bug report #959073 by Bob Paddock. While
Add SetFlag, ClrFlag, and ChangeFlag actions. These currently let you
For the pcb wrapper script, if the first argument is "-gdb", pick off that
correct location for Pcb appdefaults file
document the SetFlag(), ClrFlag(), and ChangeFlag() actions
set MASKFRAME to be 3 (mils) instead of 0. This way the soldermask
add missing prototype
add some release notes for the upcoming 20040530 snapshot
bump updated date to match snapshot date
update changelog with cvs2cl.pl. This file previously was empty.
remove duplicated line
add a note to remember to do something better with versions on the next snapshot
fail configuration if Xaw is not found
regen (fail configuration if Xaw is not found)
add a GetXY() to the 'copy selection to buffer' menu. Needed to have
add @ character. Absence noted by Dave McGuire.
Add usage output if the input arguments are not quite right for several
add usage output for several more actions
If --enable-dmalloc is given but dmalloc is not found then error out instead of disabling dmalloc
regen (If --enable-dmalloc is given but dmalloc is not found then error out instead of disabling dmalloc
change the order in the list of rpath flags which are tried out. This
regen after rpath flag order change
Save layerstack settings prior to running DRC and restore them afterwards
Add 0.5 and 0.1 mil grid selections. Requested in RFE #876549 by
Do not arbitrarily change the zoom setting whenever running DRC. Especially
fix the function name strings passed to MyCalloc().
make sure we define all aperture codes used by arcs. Fixes the bug reported
add a few more 400mil width DIP packages (DIPxM)
make 'str' static so that the memory allocated by MyStrdup() can
when running under gdb set XAPPLRESDIR and unset XUSERFILESEARCHPATH
fix some errors where the diameter was used where the radius should
Fix a bug related to checking for the intersection of a circular region
improve the decision on adding or not adding a silk arc on the COMMON_SMT_DIL_MIL macro
update the 150 and 300 mil width SOIC packages per the IPC recommendations
use foo?foo:bar instead of foo?:bar as the latter is a gcc extension.
avoid 'inline' unless we're using gcc.
add a man page which says where to look for the manual
regen after adding pcb.1
In the Usage() function be sure to restore stderr at the beginning since
allow --version, --help, and --copyright to also work since those are
add one more Usage message. this time for the RemoveSelected() action
add a brief comment about what M4 is and where to find more info
exclude Makefile, Makefile.am, and Makefile.in as valid element names as these may reside in a lib directory
use "Reference Designator" instead of "Name on PCB" as the former is more standard
update the table of the output files generated by PCB
Fix a minor memory leak bug which allocated space for 10 more pointers
add an ExecuteFile(file) action which executes the actions contained
document the ExecuteFile() action and the -script command line option
add pcb.1 to EXTRA_DIST
regen (add pcb.1 to EXTRA_DIST)
bump updated date
remove an unused variable
add a missing header
remove some unused variables
use long int in some places to avoid assigning a long int to an int
add missing header (for isdigit)
if we are using gcc then add -Wall
regen (if we are using gcc then add -Wall)
add actionlist.c for non-maintainers
update this to more closely match the current reality
fix a "=" instead of "==" bug
rework the lines which have
get rid of a bunch of format string compiler warnings along with some unused variable warnings
clean up a few more compiler warnings
add missing prototype
remove unused variable
add missing prototype
add missing headers
add more detailed snapshot instructions
update to get ready for next snapshot
update with pcb-20040903 news items
mention the background image in 20040903
add an extra digit to the display of metric measurements.
minor tweaks to instructions
add missing #else clause in defining ATTRIBUTE_UNUSED on non-gcc or older
Apply several improvements from Bob Paddock including:
minor fixup in the newlib element creation guide.
improve the quoting so that aclocal-1.9.2 is happier
check for ps2pdf which is used for building the refcard
regen
- override the mostlyclean-aminfo target to avoid deleting the .dvi, .html,
regen
update to texinfoversion 2004-09-06.16
minor fixups to make this happy again with the new texinfo.tex
update date on manual since there have been additions
regen so that all Makefile.in files came from the same version of automake
Fix one more (last one maybe?) hires bug where when converting a selection
Add date and compile time to the About dialog. Patch provided as
remove unused variable, make sure return returns a value on a non-void fn
Add support for a loadable vendor resource. The primary purpose is to import
regen after adding vendor resource/mapping code
document vendor drill mapping
add missing vendor.h
Quote "$@" to keep args whole
Modify the LoadVendor() action so if the file name is not give, the user
Allow the use of regular expressions in the resources which specify
clarify the units used by PCB a bit
add support for ElectricFence debugging. --enable-efence
regen [add support for ElectricFence debugging. --enable-efence]
Fix the <Key>. binding to toggle 45 degree mode. Addresses bug #1022800
Restore translation table for the mode buttons. This seems to fix
add <Key>. as the hotkey for toggling 45 degree line mode.
revert previous. Seems to have snuck in by mistake in the strcmp()
adjust Pcb.masterForm*cursorPosition.width to match the app-defaults file value
add metric output to the location display. Based on patches provided
remove a compiler warning
move the regfree() call _before_ the return from the function that calls it
change "Location" to "LocationType". Avoids some confusion with some
cast some pointers to (void *) when printing debug output. reduces the # of compiler warnings
remove duplicated files and fix some out of date info
add a DisperseElements() action which will disperse all elemnents in
remove some more compiler warnings
add DisperseElements() to menu
udate data
regen
increase quoting of $2 in PKG_CRYSTAL to avoid the refdes from
add docs for ChangeClearSize() action. Also apply some other fixes
Increase Pcb.masterForm*cursorPosition.width to make room for metric display.
in the message log produced when a via size has to be increased to
use LAYOUT_BOTTOM to always put the status line at the bottom of the
add a --disable-rpath flag to disable hardcoding of the X11
regen
avoid having text overlaying text in the fab drawing when a very
Add "Selected" and "All" arguments to DisperseElements so you have
for the .test/Pcb apps-default file (the one used when running before
regen
- break the status line into 2 lines as it was getting rather long
do not complain about MIN_PINORVIACOPPER on a mounting hole
bump date
increase the padsize and drill size for through-hole PLCC sockets
fix the LED3 and LED5 footprints for T-1 and T-1 3/4 (3mm and 5mm)
change pcb to Pcb in a commented out resource
update to latest automake
update to get ready for next snapshot
add news for snapshot 20050127
add an appendix with a big list of drill sizes. Included are American
regen
fix typo in target for creating texi files from the ascii list of drills
regen
add flag to keep building the html manual as a single page.
regen
add TQFP packages provided by Walter Fetter Lages in patch #1108881.
fix drill size for PKG_BNC_LAY. Provided by Walter Fetter Lages in patch #1108881
fix drill size for ZIP packages. Noted by Walter Fetter Lages in patch #1108881
Add DIP44. Provided by Walter Fetter Lages in patch #1108881
change units to 1/100 mil for pinout window offset
fix a segfault bug on the pinout window (no null pointer dereference)
fix a segfault bug when using <Key>Up and <Key>Down to try and adjust
add --enable-gtk and --disable-xaw configure flags which will turn
regen after adding --enable-gtk and --disable-xaw
regen
add a few missing prototypes
add MULTIWATT and friends. Fix drill size for several versions
use ACLOCAL_FLAGS if set
regen after adding gtk configure.ac stuff
update with latest changes
add a few missing files to EXTRA_DIST
regen
Import Bill Wilson's port of pcb to gtk. Things seem to compile and
add some config file patches from Bill Wilson
add some files missed in the gtk-pcb checkin
error out if m4 is not found
regen [error out if m4 not found]
convert several c++ style comments to c comments. not all compilers like //
make sure we still set the X library rpath (yes, it is still
regen
add missing strflags.h
regen [add missing strflags.h]
reduce minimum board size from 1.2 to 0.6 inches
add changes for 20050609
add news for 20050609
apply the patches provided by Wim Lewis in patch #1189989 to allow
apply patches provided by Bill Wilson in patch #1215935
apply patches provided by Bill Wilson in patch #1227205
apply patches provided by Bill Wilson in patch #1227292
apply patches provided by Bill Wilson in patch #1230704
apply patches provided by Bill Wilson in patch #1230708.
remove the inclusion of menu.h. We don't use that file anymore
hires-ify the QFN packages. While here make sure we use an appropriate
add a check for sys/types.h and then if found, include in vendor.c.
regen
fix typo
remove some redundant code to make things more clear
add appendix describing the centroid file format along with the
regen (fix botched commit which was missing some M4 paths)
fix the pin order.
add 1008 package
- change the Print action to PrintDialog since it causes the print
add script to make it easier to print from the command line
fix -auto-place for the library window
fix a bug in the --add-alignment option. Noted by David Baird
add pcb-print to the list of distributed files
check for gtk+ >= 2.4.0 instead of 2.2.0 since we need >= 2.4.0
regen
make sure to check for -lX11 even when we're using the gtk gui.
regen
make this script a bit more verbose and also abort on errors
add a PKG_SMT_2PAD_MM100 which directly takes dimensions for the pads,
redo the 0201, 0402, etc passives to bring them in line with the IPC
Be sure to set the library path to the source tree. Patch supplied by
fix duplicate PKG_SME4 which should have been called SME5. Reported by
fix a bug which prevented disabling nets from the ratsnest
- added the pad drawing showing how a pad is drawn with an aperture.
cause the missing ) in PKG_SMT_2PAD_MM100 to appear
bump date last touched
put the html manual in 1 file. Its a bit easier to manage
regen [put the html manual in 1 file]
add a ChangePinName() action which lets you change the name of a pin/pad
document ChangePinName action
format cleanup of ActionChangePinName() to bring more in line with
apply some fixes for DragonFly BSD
Add a pad drawing showing how a pad is drawn with a rectangular
When manually adding nets, make sure we actually pick a unique name
add DRC checks for minimum drill diameter and minimum annular ring.
- clarify that the manual does not currently document the very latest pcb
Fix reduce-reduce conflicts (patch from DJ).
eat blank lines of which there can be many in the element output
put the correct gschem footprint= attribute in [] at the end of each description
garbage collect some footprints that were not at all conforming to the
regen
Remove the abuse of the value field as a way of passing in multiple
add an optional -fp argument which will display the correct footprint=
add drawing of soldermask opening around a pad
- replace obsolete AC_ERROR with AC_MSG_ERROR
regen
Minor updates to fix the 'distcheck' target. Adds a missing file
regen
bump updated date
regen
update with changes for 20060321 snapshot.
update authors a bit
add news for the 20060321 snapshot
regen
add a few more notes about the snapshot process
note what some of the branches are
Use log() instead of logv(). Fixes compilation on NetBSD/alpha, gcc-3.3.3
improve this drawing a bit
include the tgif output here until I replace the drawings with pcb drawings
detect when tgif is not found and give a warning instead of crashing the build
regen
correctly identify the poly clearance
Replace the tgif drawing with a pcb drawing. The suffix rules are
add missing RCS Id
add $srcdir in a couple of places for configuring outside of the
regen
add the generated headers to DISTCLEANFILES and add a bunch of missing
add missing header
remove a compiler warning
remove compiler warning and add config.h, dmalloc.h, and RCS Id
add config.h, dmalloc.h, and RCS Id
add RCS Id
add dmalloc.h
add config.h, dmalloc.h, and RCS Id
add RCS Id
remove a duplicate header and Id
remove unused variable
remove a spurious ";"
add RCSID and dmalloc.h
add missing draw.h header
add a couple of missing headers
format string fix
remove unused variable
remove compiler warning
remove an unused variable
add missing header
remove unused variable
add missing member to the lpr_hid initialization
remove more compiler warnings
fix several more compiler warnings by removing some unused variables
Take the ";" out of the REGISTER_* defines and put them in the invocations.
indent
indent
Revert the ";" thing. The REGISTER_* macros now contain ";"
quote the regexp passed to grep to keep solaris-2.9 happy
fix the ChangeFlag action (compiler warning pointed to the bug)
don't include the full path for the default value of the LibraryCommand
add some missing arguments when running in gdb
avoid some complier warnings on solaris-2.9/sparc (gcc-3.3.5)
avoid some compiler warnings on solaris-2.9/sparc (gcc-3.3.5)
avoid some compiler warnings on solaris-2.9/sparc (gcc-3.3.5)
check the result of the --install options _after_ the options have
avoid some compiler warnings on solaris-2.9/sparc (gcc-3.3.5)
fix a couple of paths when building outside the source directory
also set the font path
fix a bug when specifying the output file name
add missing lesstif header to get it in the distfile
move ListLibraryContents.sh to being something created at configure time
correctly find the font file
Rework the dependencies on the various generated files a bit to hopefully
put the generated files in the build directory instead of the source
don't automatically run ./configure. Simplifies things a bit when
regen after configure.ac changes
Fix the calculation of the names of the generated .texi tables for
note the DISTCHECK_CONFIGURE_FLAGS variable
- when not in maintainer mode, do not list all the dependencies for the
regen
List the available HID's in the ./configure --help output.
minor cleanup of status output
add a help string for --lib-newlib
Fix a bug in options parsing where the loop looking for matches continued
add a --listen option which causes pcb to listen on the standard input
fix a segfault when printing a board with no drill holes at all.
use fileno(stdin) instead of 1 to get the stdin file descriptor.
add some of the generated files to see if that will help with those
add cast to avoid compiler warnings
add a --listen option for the lesstif HID too (works the same as the gtk
- remove a debug printf which was trying to print a NULL string. Fixes
- Remove a debug printf which tried to print a NULL string. Avoids
bump the rev letter to help identify this as the HID version if someone
Make sure we initialize some variables before using them. Fixes a segfault
add back in the --enable-efence and --enable-dmalloc configure flags
in a function which is supposed to return a string but is commented out
Fix an off by one overflow of a malloc'ed buffer. Found with ElectricFence.
No need to use strdup(Concat()) as Concat already gives us allocated memory
fix a typo in a comment
avoid allocating 0 bytes
Fix a bug where actions using SelectedPads did nothing and SelectedPins picked
- When changing selected line size from the menu, do it to the selected
add a missing typecase
fix prototype for an action. kills one more compiler warning
access djopt_set_auto_only() via the associated action instead of directly
put back dmalloc support
do not redefine malloc if we are using dmalloc
Check to make sure a pointer is not NULL before dereferencing it.
move variable declarations to the beginning of blocks to make gcc-2.95
fix a prototype
check to see which graphic file formats are supported by the installed
Be a bit more careful with rouding issues when converting to pcb units.
remove the pcb-print script. It is obsolete now that the HID
fix a bug which prevented the File->Export menu from working more than
add pointer to the geda homepage and wiki as well as the pcb home page in the about dialog
- make the ESC key return you to the arrow tool if you are in via, thermal,
add a MyMalloc to go along with MyCalloc
revert the previous, this part wasn't quite right.
add some missing const-s
declare dump_actions() right before using it
move some initializations inside a loop so they don't get missed
When building docs, look for a perl to use. This will let the user set
Fix bug [ 1462380 ] saving buffer elemnts to file does nothing.
garbage collect some printf output
- for the Select(*ByName) action, allow a 2nd argument to specify the
regen (after checking for perl)
- add a missing description and move some footprints from the wrong .list
Add a "ToLayout" option for the PasteBuffer() action. You can now do things
add two documents in progress describing a plan for future work
add support for units and relative coordinates in PasteBuffer(ToLayout)
move these to an ideas subdirectory to hopefully more clearly indicate
add a drawing showing what a thermal relief looks like
change name of board
add thermal drawing
increase resolution of PDFs of drawings. 72dpi looked pretty bad on the thermal drawing
add thermal to the glossary
add thermals to glossary
use AFAIL() when an action fails due to a syntax error
add the About action
const-ify the log message functions
Add some stuff to help build under win32. Note: win32 support is not finished
Add a couple more configure checks for functions (gethostname
add stuff to compile in icons for win32
add some new configure related files
one more header check
add windres file for win32 icons
check for getcwd()
add a few more checks to let this build under cygwin/mingw
check for a few tools used to regenerate windows icons
replace wcalc icons with placeholder pcb icons
add a tgif Xdefaults file needed for generating the correct XPM version
add win32 to SUBDIRS
add generated icon file
add missing file
add a dependency on the icon resource object if this is win32
add a win32 README file
add compat.h header for missing system functions
add a (lame) random() replacement
add missing return value
on win32, figure out the path to the installed package so
fix a distcheck problem
regen
update the instructions a bit
update for 20060414 snapshot
20060414 release notes
bump rev after 20060414 branch
make sure we set the default icon _before_ any windows are created
switch the output scaling to default to 100 dpi instead of fixing the
get this to properly link when --disable-gif is used and the installed
- add checks for sys/param.h and compiler understanding of 'inline'.
rely on the autoconf test for inline instead of using our own based
comment out with #if 0 the code related to lesstif_options and lesstif_resources
change from NONE_PRESSED to NO_BUTTON_PRESSED since the former is not
protect some GNU C specific stuff with #ifdef __GNUC__
Comment out locale.h since the code which needed that was also commented
update for 20060422 snapshot
update for 20060422
add 20060422 release notes
update newlib creation section for the latest GTK HID. Addresses bug
when smashing the pastebuffer, don't set the pure hole flag on the
remove a debugging printf
do not crash if the input pipe terminates when using --listen
complain if the png HID has been requested but all formats disabled
remove obsolete README file
bring the install docs up to date
remove obsolete README file
if gdlib-config is not found, try and just check for -lgd on the off chance
minor updates, mention gd-2.0.23 as having been used
regen
prevent segfaults when trying to undo in the middle of drawing ratlines.
fix a bug where mirroring a buffer with only traces triggered the
add Message() action
add the batch HID to the list of gui HIDs in the help output
add a comment about needing the png HID for building docs from cvs
Apply a patch from Larry Doolittle that switches from the MyFree() function
Apply a patch from Larry Doolittle.
remove some redundant and out of date notes
fix a typo
summarize the dependencies for building pcb
remove circular dependency which breaks non-GNU make programs.
- Note that automake-1.7 and older are too old.
After running PATH_XTRA and checking for various X libs (Xpm, etc), we
Remove extra calls to Dra...
[truncated message content] |