Ti[GS]etClient() usage enforcement

All naked access to `ti_client` now uses the function-like-macro
to encapsulate this action.  This macro existed before this just
makes all sites utilize it.

Added additional INT and PTR variants to remove the programmer
load on thinking about casing and casts polluting the point
of use.  So the use now looks cleaner.

Equivalent prototypes:

 void TiSetClient(Tile*, ClientData)
 void TiSetClientINT(Tile*, intptr_t) /* pointertype */
 void TiSetClientPTR(Tile*, void*)

 ClientData TiGetClient(Tile*)
 intptr_t TiGetClientINT(Tile*) /* pointertype */
 void *TiGetClientPTR(Tile*)
This commit is contained in:
Darryl L. Miles 2025-02-21 17:54:11 +00:00 committed by R. Timothy Edwards
parent 6e83cbe2d3
commit 606f37cc80
27 changed files with 336 additions and 332 deletions

View File

@ -117,8 +117,8 @@ extern void calmaRemoveDegenerate(BoundaryTop *blist);
#define GDS_PROCESSED 1 #define GDS_PROCESSED 1
#define PUSHTILEC(tp) \ #define PUSHTILEC(tp) \
if ((tp)->ti_client == (ClientData) GDS_UNPROCESSED) { \ if (TiGetClient(tp) == GDS_UNPROCESSED) { \
(tp)->ti_client = (ClientData) GDS_PENDING; \ TiSetClientINT(tp, GDS_PENDING); \
STACKPUSH((ClientData) (tp), SegStack); \ STACKPUSH((ClientData) (tp), SegStack); \
} }
@ -2462,7 +2462,7 @@ calmaMergePaintFunc(
BoundaryTop *bounds = NULL; BoundaryTop *bounds = NULL;
/* Quick check for tiles that have already been processed */ /* Quick check for tiles that have already been processed */
if (tile->ti_client == (ClientData)GDS_PROCESSED) return 0; if (TiGetClientINT(tile) == GDS_PROCESSED) return 0;
if (SegStack == (Stack *)NULL) if (SegStack == (Stack *)NULL)
SegStack = StackNew(64); SegStack = StackNew(64);
@ -2471,8 +2471,8 @@ calmaMergePaintFunc(
while (!StackEmpty(SegStack)) while (!StackEmpty(SegStack))
{ {
t = (Tile *) STACKPOP(SegStack); t = (Tile *) STACKPOP(SegStack);
if (t->ti_client != (ClientData)GDS_PENDING) continue; if (TiGetClientINT(t) != GDS_PENDING) continue;
t->ti_client = (ClientData)GDS_PROCESSED; TiSetClientINT(t, GDS_PROCESSED);
split_type = -1; split_type = -1;
if (IsSplit(t)) if (IsSplit(t))

View File

@ -124,8 +124,8 @@ extern void calmaOutR8Z(double d, gzFile f);
#define GDS_PROCESSED 1 #define GDS_PROCESSED 1
#define PUSHTILEZ(tp) \ #define PUSHTILEZ(tp) \
if ((tp)->ti_client == (ClientData) GDS_UNPROCESSED) { \ if (TiGetClient(tp) == GDS_UNPROCESSED) { \
(tp)->ti_client = (ClientData) GDS_PENDING; \ TiSetClientINT(tp, GDS_PENDING); \
STACKPUSH((ClientData) (tp), SegStack); \ STACKPUSH((ClientData) (tp), SegStack); \
} }
@ -1898,7 +1898,7 @@ calmaMergePaintFuncZ(
BoundaryTop *bounds = NULL; BoundaryTop *bounds = NULL;
/* Quick check for tiles that have already been processed */ /* Quick check for tiles that have already been processed */
if (tile->ti_client == (ClientData)GDS_PROCESSED) return 0; if (TiGetClientINT(tile) == GDS_PROCESSED) return 0;
if (SegStack == (Stack *)NULL) if (SegStack == (Stack *)NULL)
SegStack = StackNew(64); SegStack = StackNew(64);
@ -1907,8 +1907,8 @@ calmaMergePaintFuncZ(
while (!StackEmpty(SegStack)) while (!StackEmpty(SegStack))
{ {
t = (Tile *) STACKPOP(SegStack); t = (Tile *) STACKPOP(SegStack);
if (t->ti_client != (ClientData)GDS_PENDING) continue; if (TiGetClientINT(t) != GDS_PENDING) continue;
t->ti_client = (ClientData)GDS_PROCESSED; TiSetClientINT(t, GDS_PROCESSED);
split_type = -1; split_type = -1;
if (IsSplit(t)) if (IsSplit(t))

View File

@ -1222,8 +1222,8 @@ endbloat:
#define CIF_IGNORE 2 #define CIF_IGNORE 2
#define PUSHTILE(tp, stack) \ #define PUSHTILE(tp, stack) \
if ((tp)->ti_client == (ClientData) CIF_UNPROCESSED) { \ if (TiGetClient(tp) == CIF_UNPROCESSED) { \
(tp)->ti_client = (ClientData) CIF_PENDING; \ TiSetClientINT(tp, CIF_PENDING); \
STACKPUSH((ClientData) (tp), stack); \ STACKPUSH((ClientData) (tp), stack); \
} }
@ -1244,7 +1244,7 @@ cifProcessResetFunc(
Tile *tile, Tile *tile,
ClientData clientData) /* unused */ ClientData clientData) /* unused */
{ {
tile->ti_client = (ClientData) CIF_UNPROCESSED; TiSetClient(tile, CIF_UNPROCESSED);
return 0; return 0;
} }
@ -1270,7 +1270,7 @@ cifProcessSelectiveResetFunc(tile, clipArea)
TiToRect(tile, &area); TiToRect(tile, &area);
if (!GEO_SURROUND(&area, clipArea)) if (!GEO_SURROUND(&area, clipArea))
tile->ti_client = (ClientData) CIF_UNPROCESSED; TiSetClient(tile, CIF_UNPROCESSED);
return 0; return 0;
} }
@ -1477,8 +1477,8 @@ cifBloatAllFunc(
while (!StackEmpty(BloatStack)) while (!StackEmpty(BloatStack))
{ {
t = (Tile *) STACKPOP(BloatStack); t = (Tile *) STACKPOP(BloatStack);
if (t->ti_client != (ClientData)CIF_PENDING) continue; if (TiGetClientINT(t) != CIF_PENDING) continue;
t->ti_client = (ClientData)CIF_PROCESSED; TiSetClientINT(t, CIF_PROCESSED);
/* Get the tile into CIF coordinates. */ /* Get the tile into CIF coordinates. */
@ -1540,7 +1540,7 @@ cifBloatAllFunc(
} }
/* Clear self */ /* Clear self */
tile->ti_client = (ClientData)CIF_UNPROCESSED; TiSetClient(tile, CIF_UNPROCESSED);
/* NOTE: Tiles must be cleared after the bloat-all function has /* NOTE: Tiles must be cleared after the bloat-all function has
* completed. However, for bloat-all with a limiting distance, * completed. However, for bloat-all with a limiting distance,
@ -1554,7 +1554,7 @@ cifBloatAllFunc(
while (!StackEmpty(ResetStack)) while (!StackEmpty(ResetStack))
{ {
t = (Tile *)STACKPOP(ResetStack); t = (Tile *)STACKPOP(ResetStack);
t->ti_client = (ClientData) CIF_UNPROCESSED; TiSetClient(t, CIF_UNPROCESSED);
} }
#if 0 #if 0
@ -1819,7 +1819,7 @@ cifBridgeFunc1(
int cifBridgeCheckFunc(Tile *tile, BridgeCheckStruct *brcs); /* Forward reference */ int cifBridgeCheckFunc(Tile *tile, BridgeCheckStruct *brcs); /* Forward reference */
/* If tile is marked, then it has been handled, so ignore it */ /* If tile is marked, then it has been handled, so ignore it */
if (tile->ti_client != (ClientData)CIF_UNPROCESSED) return 0; if (TiGetClient(tile) != CIF_UNPROCESSED) return 0;
/* Find each tile outside corner (only two cases need to be checked) */ /* Find each tile outside corner (only two cases need to be checked) */
@ -1942,7 +1942,7 @@ cifBridgeFunc2(
int cifBridgeCheckFunc(Tile *tile, BridgeCheckStruct *brcs); /* Forward reference */ int cifBridgeCheckFunc(Tile *tile, BridgeCheckStruct *brcs); /* Forward reference */
/* If tile is marked, then it has been handled, so ignore it */ /* If tile is marked, then it has been handled, so ignore it */
if (tile->ti_client != (ClientData)CIF_UNPROCESSED) return 0; if (TiGetClient(tile) != CIF_UNPROCESSED) return 0;
/* Find each tile outside corner (only two cases need to be checked) */ /* Find each tile outside corner (only two cases need to be checked) */
@ -2160,7 +2160,7 @@ cifCloseFunc(
int cifGatherFunc(Tile *tile, int *atotal, int mode); int cifGatherFunc(Tile *tile, int *atotal, int mode);
/* If tile is marked, then it has been handled, so ignore it */ /* If tile is marked, then it has been handled, so ignore it */
if (tile->ti_client != (ClientData)CIF_UNPROCESSED) return 0; if (TiGetClient(tile) != CIF_UNPROCESSED) return 0;
atotal = 0; atotal = 0;
@ -2196,8 +2196,8 @@ cifGatherFunc(
TileType type; TileType type;
dlong locarea; dlong locarea;
Rect area, newarea; Rect area, newarea;
ClientData cdata = (mode == CLOSE_SEARCH) ? (ClientData)CIF_UNPROCESSED : ClientData cdata = (mode == CLOSE_SEARCH) ? CIF_UNPROCESSED :
(ClientData)CIF_PENDING; CD2INT(CIF_PENDING);
static Stack *GatherStack = (Stack *)NULL; static Stack *GatherStack = (Stack *)NULL;
@ -2210,7 +2210,7 @@ cifGatherFunc(
tile = (Tile *)STACKPOP(GatherStack); tile = (Tile *)STACKPOP(GatherStack);
/* Ignore if tile has already been processed */ /* Ignore if tile has already been processed */
if (tile->ti_client != cdata) continue; if (TiGetClient(tile) != cdata) continue;
TiToRect(tile, &area); TiToRect(tile, &area);
@ -2261,15 +2261,15 @@ cifGatherFunc(
} }
if (mode == CLOSE_SEARCH) if (mode == CLOSE_SEARCH)
tile->ti_client = (ClientData)CIF_PENDING; TiSetClientINT(tile, CIF_PENDING);
else else
tile->ti_client = (ClientData)CIF_PROCESSED; TiSetClientINT(tile, CIF_PROCESSED);
/* Look for additional neighboring space tiles */ /* Look for additional neighboring space tiles */
/* Check top */ /* Check top */
if (area.r_ytop != TiPlaneRect.r_ytop) if (area.r_ytop != TiPlaneRect.r_ytop)
for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp)) for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp))
if (tp->ti_client == cdata && TiGetBottomType(tp) == TT_SPACE) if (TiGetClient(tp) == cdata && TiGetBottomType(tp) == TT_SPACE)
{ {
STACKPUSH(tp, GatherStack); STACKPUSH(tp, GatherStack);
} }
@ -2277,7 +2277,7 @@ cifGatherFunc(
/* Check bottom */ /* Check bottom */
if (area.r_ybot != TiPlaneRect.r_ybot) if (area.r_ybot != TiPlaneRect.r_ybot)
for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp)) for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp))
if (tp->ti_client == cdata && TiGetTopType(tp) == TT_SPACE) if (TiGetClient(tp) == cdata && TiGetTopType(tp) == TT_SPACE)
{ {
STACKPUSH(tp, GatherStack); STACKPUSH(tp, GatherStack);
} }
@ -2285,7 +2285,7 @@ cifGatherFunc(
/* Check left */ /* Check left */
if (area.r_xbot != TiPlaneRect.r_xbot) if (area.r_xbot != TiPlaneRect.r_xbot)
for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp)) for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp))
if (tp->ti_client == cdata && TiGetRightType(tp) == TT_SPACE) if (TiGetClient(tp) == cdata && TiGetRightType(tp) == TT_SPACE)
{ {
STACKPUSH(tp, GatherStack); STACKPUSH(tp, GatherStack);
} }
@ -2293,7 +2293,7 @@ cifGatherFunc(
/* Check right */ /* Check right */
if (area.r_xtop != TiPlaneRect.r_xtop) if (area.r_xtop != TiPlaneRect.r_xtop)
for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp)) for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp))
if (tp->ti_client == cdata && TiGetLeftType(tp) == TT_SPACE) if (TiGetClient(tp) == cdata && TiGetLeftType(tp) == TT_SPACE)
{ {
STACKPUSH(tp, GatherStack); STACKPUSH(tp, GatherStack);
} }
@ -2343,7 +2343,7 @@ cifSquaresInitFunc(tile, clientData)
Tile *tile; Tile *tile;
ClientData clientData; ClientData clientData;
{ {
if (tile->ti_client == (ClientData) CIF_UNPROCESSED) if (TiGetClient(tile) == CIF_UNPROCESSED)
return 1; return 1;
else else
return 0; return 0;
@ -2498,7 +2498,7 @@ cifUnconnectFunc(
TileType t = TiGetTypeExact(tile); TileType t = TiGetTypeExact(tile);
if (t == TT_SPACE) return 1; if (t == TT_SPACE) return 1;
else if (t & TT_DIAGONAL) return 1; else if (t & TT_DIAGONAL) return 1;
else if (tile->ti_client != (ClientData)CIF_PROCESSED) return 1; else if (TiGetClientINT(tile) != CIF_PROCESSED) return 1;
return 0; return 0;
} }
@ -2551,8 +2551,8 @@ cifRectBoundingBox(
while (!StackEmpty(BoxStack)) while (!StackEmpty(BoxStack))
{ {
t = (Tile *) STACKPOP(BoxStack); t = (Tile *) STACKPOP(BoxStack);
if (t->ti_client != (ClientData)CIF_PENDING) continue; if (TiGetClientINT(t) != CIF_PENDING) continue;
t->ti_client = (ClientData)CIF_PROCESSED; TiSetClientINT(t, CIF_PROCESSED);
/* Adjust bounding box */ /* Adjust bounding box */
TiToRect(t, &area); TiToRect(t, &area);
@ -2615,7 +2615,7 @@ cifRectBoundingBox(
/* Clear the tiles that were processed in this set */ /* Clear the tiles that were processed in this set */
tile->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tile, CIF_IGNORE);
STACKPUSH(tile, BoxStack); STACKPUSH(tile, BoxStack);
while (!StackEmpty(BoxStack)) while (!StackEmpty(BoxStack))
{ {
@ -2623,33 +2623,33 @@ cifRectBoundingBox(
/* Top */ /* Top */
for (tp = RT(t); RIGHT(tp) > LEFT(t); tp = BL(tp)) for (tp = RT(t); RIGHT(tp) > LEFT(t); tp = BL(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, BoxStack); STACKPUSH(tp, BoxStack);
} }
/* Left */ /* Left */
for (tp = BL(t); BOTTOM(tp) < TOP(t); tp = RT(tp)) for (tp = BL(t); BOTTOM(tp) < TOP(t); tp = RT(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, BoxStack); STACKPUSH(tp, BoxStack);
} }
/* Bottom */ /* Bottom */
for (tp = LB(t); LEFT(tp) < RIGHT(t); tp = TR(tp)) for (tp = LB(t); LEFT(tp) < RIGHT(t); tp = TR(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, BoxStack); STACKPUSH(tp, BoxStack);
} }
/* Right */ /* Right */
for (tp = TR(t); TOP(tp) > BOTTOM(t); tp = LB(tp)) for (tp = TR(t); TOP(tp) > BOTTOM(t); tp = LB(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, BoxStack); STACKPUSH(tp, BoxStack);
} }
} }
@ -2820,8 +2820,8 @@ cifSquaresFillArea(
while (!StackEmpty(CutStack)) while (!StackEmpty(CutStack))
{ {
t = (Tile *) STACKPOP(CutStack); t = (Tile *) STACKPOP(CutStack);
if (t->ti_client != (ClientData)CIF_PENDING) continue; if (TiGetClientINT(t) != CIF_PENDING) continue;
t->ti_client = (ClientData)CIF_PROCESSED; TiSetClientINT(t, CIF_PROCESSED);
/* Adjust bounding box */ /* Adjust bounding box */
TiToRect(t, &area); TiToRect(t, &area);
@ -2946,7 +2946,7 @@ cifSquaresFillArea(
/* Clear the tiles that were processed */ /* Clear the tiles that were processed */
tile->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tile, CIF_IGNORE);
STACKPUSH(tile, CutStack); STACKPUSH(tile, CutStack);
while (!StackEmpty(CutStack)) while (!StackEmpty(CutStack))
{ {
@ -2954,33 +2954,33 @@ cifSquaresFillArea(
/* Top */ /* Top */
for (tp = RT(t); RIGHT(tp) > LEFT(t); tp = BL(tp)) for (tp = RT(t); RIGHT(tp) > LEFT(t); tp = BL(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, CutStack); STACKPUSH(tp, CutStack);
} }
/* Left */ /* Left */
for (tp = BL(t); BOTTOM(tp) < TOP(t); tp = RT(tp)) for (tp = BL(t); BOTTOM(tp) < TOP(t); tp = RT(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, CutStack); STACKPUSH(tp, CutStack);
} }
/* Bottom */ /* Bottom */
for (tp = LB(t); LEFT(tp) < RIGHT(t); tp = TR(tp)) for (tp = LB(t); LEFT(tp) < RIGHT(t); tp = TR(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, CutStack); STACKPUSH(tp, CutStack);
} }
/* Right */ /* Right */
for (tp = TR(t); TOP(tp) > BOTTOM(t); tp = LB(tp)) for (tp = TR(t); TOP(tp) > BOTTOM(t); tp = LB(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, CutStack); STACKPUSH(tp, CutStack);
} }
} }
@ -3162,8 +3162,8 @@ cifSlotsFillArea(
while (!StackEmpty(CutStack)) while (!StackEmpty(CutStack))
{ {
t = (Tile *) STACKPOP(CutStack); t = (Tile *) STACKPOP(CutStack);
if (t->ti_client != (ClientData)CIF_PENDING) continue; if (TiGetClientINT(t) != CIF_PENDING) continue;
t->ti_client = (ClientData)CIF_PROCESSED; TiSetClientINT(t, CIF_PROCESSED);
/* Adjust bounding box */ /* Adjust bounding box */
TiToRect(t, &area); TiToRect(t, &area);
@ -3309,7 +3309,7 @@ cifSlotsFillArea(
/* Clear the tiles that were processed */ /* Clear the tiles that were processed */
tile->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tile, CIF_IGNORE);
STACKPUSH(tile, CutStack); STACKPUSH(tile, CutStack);
while (!StackEmpty(CutStack)) while (!StackEmpty(CutStack))
{ {
@ -3317,33 +3317,33 @@ cifSlotsFillArea(
/* Top */ /* Top */
for (tp = RT(t); RIGHT(tp) > LEFT(t); tp = BL(tp)) for (tp = RT(t); RIGHT(tp) > LEFT(t); tp = BL(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, CutStack); STACKPUSH(tp, CutStack);
} }
/* Left */ /* Left */
for (tp = BL(t); BOTTOM(tp) < TOP(t); tp = RT(tp)) for (tp = BL(t); BOTTOM(tp) < TOP(t); tp = RT(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, CutStack); STACKPUSH(tp, CutStack);
} }
/* Bottom */ /* Bottom */
for (tp = LB(t); LEFT(tp) < RIGHT(t); tp = TR(tp)) for (tp = LB(t); LEFT(tp) < RIGHT(t); tp = TR(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, CutStack); STACKPUSH(tp, CutStack);
} }
/* Right */ /* Right */
for (tp = TR(t); TOP(tp) > BOTTOM(t); tp = LB(tp)) for (tp = TR(t); TOP(tp) > BOTTOM(t); tp = LB(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, CutStack); STACKPUSH(tp, CutStack);
} }
} }
@ -4446,7 +4446,7 @@ cifBridgeLimFunc1(
brlimcs.sqdistance = (long) spacing * spacing; brlimcs.sqdistance = (long) spacing * spacing;
/* If tile is marked, then it has been handled, so ignore it */ /* If tile is marked, then it has been handled, so ignore it */
if (tile->ti_client != (ClientData)CIF_UNPROCESSED) return 0; if (TiGetClient(tile) != CIF_UNPROCESSED) return 0;
/* Find each tile outside corner (up to four) */ /* Find each tile outside corner (up to four) */
@ -4609,7 +4609,7 @@ cifBridgeLimFunc2(
brlimcs.sqdistance = (long) width * width; brlimcs.sqdistance = (long) width * width;
/* If tile is marked, then it has been handled, so ignore it */ /* If tile is marked, then it has been handled, so ignore it */
if (tile->ti_client != (ClientData)CIF_UNPROCESSED) return 0; if (TiGetClient(tile) != CIF_UNPROCESSED) return 0;
/* Find each tile outside corner (up to four) */ /* Find each tile outside corner (up to four) */
@ -4756,8 +4756,8 @@ cifInteractingRegions(
while (!StackEmpty(RegStack)) while (!StackEmpty(RegStack))
{ {
t = (Tile *) STACKPOP(RegStack); t = (Tile *) STACKPOP(RegStack);
if (t->ti_client != (ClientData)CIF_PENDING) continue; if (TiGetClientINT(t) != CIF_PENDING) continue;
t->ti_client = (ClientData)CIF_PROCESSED; TiSetClientINT(t, CIF_PROCESSED);
/* Get tile area for interaction search */ /* Get tile area for interaction search */
TiToRect(t, &area); TiToRect(t, &area);
@ -4825,7 +4825,7 @@ cifInteractingRegions(
/* to the destination if this region was found to be interacting with */ /* to the destination if this region was found to be interacting with */
/* op->co_paintMask (op->co_cifMask) */ /* op->co_paintMask (op->co_cifMask) */
tile->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tile, CIF_IGNORE);
STACKPUSH(tile, RegStack); STACKPUSH(tile, RegStack);
while (!StackEmpty(RegStack)) while (!StackEmpty(RegStack))
{ {
@ -4839,33 +4839,33 @@ cifInteractingRegions(
/* Top */ /* Top */
for (tp = RT(t); RIGHT(tp) > LEFT(t); tp = BL(tp)) for (tp = RT(t); RIGHT(tp) > LEFT(t); tp = BL(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, RegStack); STACKPUSH(tp, RegStack);
} }
/* Left */ /* Left */
for (tp = BL(t); BOTTOM(tp) < TOP(t); tp = RT(tp)) for (tp = BL(t); BOTTOM(tp) < TOP(t); tp = RT(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, RegStack); STACKPUSH(tp, RegStack);
} }
/* Bottom */ /* Bottom */
for (tp = LB(t); LEFT(tp) < RIGHT(t); tp = TR(tp)) for (tp = LB(t); LEFT(tp) < RIGHT(t); tp = TR(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, RegStack); STACKPUSH(tp, RegStack);
} }
/* Right */ /* Right */
for (tp = TR(t); TOP(tp) > BOTTOM(t); tp = LB(tp)) for (tp = TR(t); TOP(tp) > BOTTOM(t); tp = LB(tp))
if (tp->ti_client == (ClientData)CIF_PROCESSED) if (TiGetClientINT(tp) == CIF_PROCESSED)
{ {
tp->ti_client = (ClientData)CIF_IGNORE; TiSetClientINT(tp, CIF_IGNORE);
STACKPUSH(tp, RegStack); STACKPUSH(tp, RegStack);
} }
} }

View File

@ -59,8 +59,8 @@ extern void drcCheckCifArea();
extern Stack *DRCstack; extern Stack *DRCstack;
#define PUSHTILE(tp) \ #define PUSHTILE(tp) \
if ((tp)->ti_client == (ClientData) DRC_UNPROCESSED) { \ if (TiGetClient(tp) == DRC_UNPROCESSED) { \
(tp)->ti_client = (ClientData) DRC_PENDING; \ TiSetClientINT(tp, DRC_PENDING); \
STACKPUSH((ClientData) (tp), DRCstack); \ STACKPUSH((ClientData) (tp), DRCstack); \
} }
@ -1328,9 +1328,9 @@ drcCheckCifArea(starttile, arg, cptr)
while (!StackEmpty(DRCstack)) while (!StackEmpty(DRCstack))
{ {
tile = (Tile *) STACKPOP(DRCstack); tile = (Tile *) STACKPOP(DRCstack);
if (tile->ti_client != (ClientData)DRC_PENDING) continue; if (TiGetClientINT(tile) != DRC_PENDING) continue;
area += (long)(RIGHT(tile)-LEFT(tile))*(TOP(tile)-BOTTOM(tile)); area += (long)(RIGHT(tile)-LEFT(tile))*(TOP(tile)-BOTTOM(tile));
tile->ti_client = (ClientData)DRC_PROCESSED; TiSetClientINT(tile, DRC_PROCESSED);
/* are we at the clip boundary? If so, skip to the end */ /* are we at the clip boundary? If so, skip to the end */
if (RIGHT(tile) == cliprect->r_xtop || if (RIGHT(tile) == cliprect->r_xtop ||
LEFT(tile) == cliprect->r_xbot || LEFT(tile) == cliprect->r_xbot ||
@ -1373,7 +1373,7 @@ drcCheckCifArea(starttile, arg, cptr)
} }
forgetit: forgetit:
/* reset the tiles */ /* reset the tiles */
starttile->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(starttile, DRC_UNPROCESSED);
STACKPUSH(starttile, DRCstack); STACKPUSH(starttile, DRCstack);
while (!StackEmpty(DRCstack)) while (!StackEmpty(DRCstack))
{ {
@ -1381,33 +1381,33 @@ forgetit:
/* Top */ /* Top */
for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp)) for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }
/* Left */ /* Left */
for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp)) for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }
/* Bottom */ /* Bottom */
for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp)) for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }
/* Right */ /* Right */
for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp)) for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }
@ -1505,13 +1505,13 @@ drcCheckCifMaxwidth(starttile,arg,cptr)
while (!StackEmpty(DRCstack)) while (!StackEmpty(DRCstack))
{ {
tile = (Tile *) STACKPOP(DRCstack); tile = (Tile *) STACKPOP(DRCstack);
if (tile->ti_client != (ClientData)DRC_PENDING) continue; if (TiGetClientINT(tile) != DRC_PENDING) continue;
if (boundrect.r_xbot > LEFT(tile)) boundrect.r_xbot = LEFT(tile); if (boundrect.r_xbot > LEFT(tile)) boundrect.r_xbot = LEFT(tile);
if (boundrect.r_xtop < RIGHT(tile)) boundrect.r_xtop = RIGHT(tile); if (boundrect.r_xtop < RIGHT(tile)) boundrect.r_xtop = RIGHT(tile);
if (boundrect.r_ybot > BOTTOM(tile)) boundrect.r_ybot = BOTTOM(tile); if (boundrect.r_ybot > BOTTOM(tile)) boundrect.r_ybot = BOTTOM(tile);
if (boundrect.r_ytop < TOP(tile)) boundrect.r_ytop = TOP(tile); if (boundrect.r_ytop < TOP(tile)) boundrect.r_ytop = TOP(tile);
tile->ti_client = (ClientData)DRC_PROCESSED; TiSetClientINT(tile, DRC_PROCESSED);
if (boundrect.r_xtop - boundrect.r_xbot > edgelimit && if (boundrect.r_xtop - boundrect.r_xbot > edgelimit &&
boundrect.r_ytop - boundrect.r_ybot > edgelimit) break; boundrect.r_ytop - boundrect.r_ybot > edgelimit) break;
@ -1553,7 +1553,7 @@ drcCheckCifMaxwidth(starttile,arg,cptr)
} }
/* reset the tiles */ /* reset the tiles */
starttile->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(starttile, DRC_UNPROCESSED);
STACKPUSH(starttile, DRCstack); STACKPUSH(starttile, DRCstack);
while (!StackEmpty(DRCstack)) while (!StackEmpty(DRCstack))
{ {
@ -1561,33 +1561,33 @@ drcCheckCifMaxwidth(starttile,arg,cptr)
/* Top */ /* Top */
for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp)) for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }
/* Left */ /* Left */
for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp)) for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }
/* Bottom */ /* Bottom */
for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp)) for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }
/* Right */ /* Right */
for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp)) for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }

View File

@ -24,8 +24,8 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
Stack *DRCstack = (Stack *)NULL; Stack *DRCstack = (Stack *)NULL;
#define PUSHTILE(tp) \ #define PUSHTILE(tp) \
if ((tp)->ti_client == (ClientData) DRC_UNPROCESSED) { \ if (TiGetClient(tp) == DRC_UNPROCESSED) { \
(tp)->ti_client = (ClientData) DRC_PENDING; \ TiSetClientINT(tp, DRC_PENDING); \
STACKPUSH((ClientData) (tp), DRCstack); \ STACKPUSH((ClientData) (tp), DRCstack); \
} }
@ -152,9 +152,9 @@ drcCheckArea(starttile,arg,cptr)
while (!StackEmpty(DRCstack)) while (!StackEmpty(DRCstack))
{ {
tile = (Tile *) STACKPOP(DRCstack); tile = (Tile *) STACKPOP(DRCstack);
if (tile->ti_client != (ClientData)DRC_PENDING) continue; if (TiGetClientINT(tile) != DRC_PENDING) continue;
area += (long)(RIGHT(tile)-LEFT(tile))*(TOP(tile)-BOTTOM(tile)); area += (long)(RIGHT(tile)-LEFT(tile))*(TOP(tile)-BOTTOM(tile));
tile->ti_client = (ClientData)DRC_PROCESSED; TiSetClientINT(tile, DRC_PROCESSED);
/* are we at the clip boundary? If so, skip to the end */ /* are we at the clip boundary? If so, skip to the end */
if (RIGHT(tile) == cliprect->r_xtop || if (RIGHT(tile) == cliprect->r_xtop ||
LEFT(tile) == cliprect->r_xbot || LEFT(tile) == cliprect->r_xbot ||
@ -196,7 +196,7 @@ forgetit:
while (!StackEmpty(DRCstack)) tile = (Tile *) STACKPOP(DRCstack); while (!StackEmpty(DRCstack)) tile = (Tile *) STACKPOP(DRCstack);
/* reset the tiles */ /* reset the tiles */
starttile->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(starttile, DRC_UNPROCESSED);
STACKPUSH(starttile, DRCstack); STACKPUSH(starttile, DRCstack);
while (!StackEmpty(DRCstack)) while (!StackEmpty(DRCstack))
{ {
@ -204,33 +204,33 @@ forgetit:
/* Top */ /* Top */
for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp)) for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }
/* Left */ /* Left */
for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp)) for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }
/* Bottom */ /* Bottom */
for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp)) for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }
/* Right */ /* Right */
for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp)) for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }
@ -285,8 +285,8 @@ drcCheckMaxwidth(starttile,arg,cptr,both)
while (!StackEmpty(DRCstack)) while (!StackEmpty(DRCstack))
{ {
tile = (Tile *) STACKPOP(DRCstack); tile = (Tile *) STACKPOP(DRCstack);
if (tile->ti_client != (ClientData)DRC_PENDING) continue; if (TiGetClientINT(tile) != DRC_PENDING) continue;
tile->ti_client = (ClientData)DRC_PROCESSED; TiSetClientINT(tile, DRC_PROCESSED);
if (boundrect.r_xbot > LEFT(tile)) boundrect.r_xbot = LEFT(tile); if (boundrect.r_xbot > LEFT(tile)) boundrect.r_xbot = LEFT(tile);
if (boundrect.r_xtop < RIGHT(tile)) boundrect.r_xtop = RIGHT(tile); if (boundrect.r_xtop < RIGHT(tile)) boundrect.r_xtop = RIGHT(tile);
@ -336,7 +336,7 @@ drcCheckMaxwidth(starttile,arg,cptr,both)
} }
/* reset the tiles */ /* reset the tiles */
starttile->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(starttile, DRC_UNPROCESSED);
STACKPUSH(starttile, DRCstack); STACKPUSH(starttile, DRCstack);
while (!StackEmpty(DRCstack)) while (!StackEmpty(DRCstack))
{ {
@ -344,33 +344,33 @@ drcCheckMaxwidth(starttile,arg,cptr,both)
/* Top */ /* Top */
for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp)) for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }
/* Left */ /* Left */
for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp)) for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }
/* Bottom */ /* Bottom */
for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp)) for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }
/* Right */ /* Right */
for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp)) for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp))
if (tp->ti_client != (ClientData)DRC_UNPROCESSED) if (TiGetClient(tp) != DRC_UNPROCESSED)
{ {
tp->ti_client = (ClientData)DRC_UNPROCESSED; TiSetClient(tp, DRC_UNPROCESSED);
STACKPUSH(tp,DRCstack); STACKPUSH(tp,DRCstack);
} }

View File

@ -3038,10 +3038,10 @@ extTransFindSubsFunc1(tile, noderecptr)
* regions under the same device) * regions under the same device)
*/ */
if (tile->ti_client != (ClientData) extUnInit) if (TiGetClient(tile) != extUnInit)
{ {
if ((noderecptr->region != (NodeRegion *)NULL) && if ((noderecptr->region != (NodeRegion *)NULL) &&
((ClientData)noderecptr->region != tile->ti_client)) (noderecptr->region != TiGetClientPTR(tile)))
TxError("Warning: Split substrate under device at (%d %d)\n", TxError("Warning: Split substrate under device at (%d %d)\n",
tile->ti_ll.p_x, tile->ti_ll.p_y); tile->ti_ll.p_x, tile->ti_ll.p_y);
if (IsSplit(tile)) if (IsSplit(tile))
@ -3052,7 +3052,7 @@ extTransFindSubsFunc1(tile, noderecptr)
else else
type = TiGetTypeExact(tile); type = TiGetTypeExact(tile);
noderecptr->region = (NodeRegion *)tile->ti_client; noderecptr->region = (NodeRegion *)TiGetClientPTR(tile);
noderecptr->layer = type; noderecptr->layer = type;
return 1; return 1;
} }
@ -3495,8 +3495,8 @@ extTermAPFunc(tile, pNum, eapd)
eapd->eapd_perim += MIN(RIGHT(tile), RIGHT(tp)) - eapd->eapd_perim += MIN(RIGHT(tile), RIGHT(tp)) -
MAX(LEFT(tile), LEFT(tp)); MAX(LEFT(tile), LEFT(tp));
if (TTMaskHasType(eapd->eapd_gatemask, type)) if (TTMaskHasType(eapd->eapd_gatemask, type))
if (tp->ti_client != (ClientData)eapd->eapd_gatenode) if (TiGetClientPTR(tp) != eapd->eapd_gatenode)
extAddSharedDevice(eapd, (NodeRegion *)tp->ti_client); extAddSharedDevice(eapd, (NodeRegion *)TiGetClientPTR(tp));
} }
} }
@ -3509,8 +3509,8 @@ extTermAPFunc(tile, pNum, eapd)
eapd->eapd_perim += MIN(RIGHT(tile), RIGHT(tp)) - eapd->eapd_perim += MIN(RIGHT(tile), RIGHT(tp)) -
MAX(LEFT(tile), LEFT(tp)); MAX(LEFT(tile), LEFT(tp));
if (TTMaskHasType(eapd->eapd_gatemask, type)) if (TTMaskHasType(eapd->eapd_gatemask, type))
if (tp->ti_client != (ClientData)eapd->eapd_gatenode) if (TiGetClientPTR(tp) != eapd->eapd_gatenode)
extAddSharedDevice(eapd, (NodeRegion *)tp->ti_client); extAddSharedDevice(eapd, (NodeRegion *)TiGetClientPTR(tp));
} }
} }
@ -3523,8 +3523,8 @@ extTermAPFunc(tile, pNum, eapd)
eapd->eapd_perim += MIN(TOP(tile), TOP(tp)) - eapd->eapd_perim += MIN(TOP(tile), TOP(tp)) -
MAX(BOTTOM(tile), BOTTOM(tp)); MAX(BOTTOM(tile), BOTTOM(tp));
if (TTMaskHasType(eapd->eapd_gatemask, type)) if (TTMaskHasType(eapd->eapd_gatemask, type))
if (tp->ti_client != (ClientData)eapd->eapd_gatenode) if (TiGetClientPTR(tp) != eapd->eapd_gatenode)
extAddSharedDevice(eapd, (NodeRegion *)tp->ti_client); extAddSharedDevice(eapd, (NodeRegion *)TiGetClientPTR(tp));
} }
} }
@ -3537,8 +3537,8 @@ extTermAPFunc(tile, pNum, eapd)
eapd->eapd_perim += MIN(TOP(tile), TOP(tp)) - eapd->eapd_perim += MIN(TOP(tile), TOP(tp)) -
MAX(BOTTOM(tile), BOTTOM(tp)); MAX(BOTTOM(tile), BOTTOM(tp));
if (TTMaskHasType(eapd->eapd_gatemask, type)) if (TTMaskHasType(eapd->eapd_gatemask, type))
if (tp->ti_client != (ClientData)eapd->eapd_gatenode) if (TiGetClientPTR(tp) != eapd->eapd_gatenode)
extAddSharedDevice(eapd, (NodeRegion *)tp->ti_client); extAddSharedDevice(eapd, (NodeRegion *)TiGetClientPTR(tp));
} }
} }
@ -4803,9 +4803,9 @@ extNodeAreaFunc(tile, arg)
* been visited in the meantime. If it's still unvisited, * been visited in the meantime. If it's still unvisited,
* visit it and process its neighbors. * visit it and process its neighbors.
*/ */
if (tile->ti_client == (ClientData) reg) if (TiGetClientPTR(tile) == reg)
continue; continue;
tile->ti_client = (ClientData) reg; TiSetClientPTR(tile, reg);
if (DebugIsSet(extDebugID, extDebNeighbor)) if (DebugIsSet(extDebugID, extDebNeighbor))
extShowTile(tile, "neighbor", 1); extShowTile(tile, "neighbor", 1);
@ -4909,21 +4909,21 @@ topside:
if (IsSplit(tp)) if (IsSplit(tp))
{ {
t = SplitBottomType(tp); t = SplitBottomType(tp);
if (tp->ti_client == extUnInit && TTMaskHasType(mask, t)) if (TiGetClient(tp) == extUnInit && TTMaskHasType(mask, t))
{ {
PUSHTILEBOTTOM(tp, tilePlaneNum); PUSHTILEBOTTOM(tp, tilePlaneNum);
} }
else if (tp->ti_client != (ClientData)reg && TTMaskHasType(mask, t)) else if (TiGetClientPTR(tp) != reg && TTMaskHasType(mask, t))
{ {
/* Count split tile twice, once for each node it belongs to. */ /* Count split tile twice, once for each node it belongs to. */
tp->ti_client = extUnInit; TiSetClient(tp, extUnInit);
PUSHTILEBOTTOM(tp, tilePlaneNum); PUSHTILEBOTTOM(tp, tilePlaneNum);
} }
} }
else else
{ {
t = TiGetTypeExact(tp); t = TiGetTypeExact(tp);
if (tp->ti_client == extUnInit && TTMaskHasType(mask, t)) if (TiGetClient(tp) == extUnInit && TTMaskHasType(mask, t))
{ {
PUSHTILE(tp, tilePlaneNum); PUSHTILE(tp, tilePlaneNum);
} }
@ -4954,21 +4954,21 @@ leftside:
if (IsSplit(tp)) if (IsSplit(tp))
{ {
t = SplitRightType(tp); t = SplitRightType(tp);
if (tp->ti_client == extUnInit && TTMaskHasType(mask, t)) if (TiGetClient(tp) == extUnInit && TTMaskHasType(mask, t))
{ {
PUSHTILERIGHT(tp, tilePlaneNum); PUSHTILERIGHT(tp, tilePlaneNum);
} }
else if (tp->ti_client != (ClientData)reg && TTMaskHasType(mask, t)) else if (TiGetClientPTR(tp) != reg && TTMaskHasType(mask, t))
{ {
/* Count split tile twice, once for each node it belongs to. */ /* Count split tile twice, once for each node it belongs to. */
tp->ti_client = extUnInit; TiSetClient(tp, extUnInit);
PUSHTILERIGHT(tp, tilePlaneNum); PUSHTILERIGHT(tp, tilePlaneNum);
} }
} }
else else
{ {
t = TiGetTypeExact(tp); t = TiGetTypeExact(tp);
if (tp->ti_client == extUnInit && TTMaskHasType(mask, t)) if (TiGetClient(tp) == extUnInit && TTMaskHasType(mask, t))
{ {
PUSHTILE(tp, tilePlaneNum); PUSHTILE(tp, tilePlaneNum);
} }
@ -5000,21 +5000,21 @@ bottomside:
if (IsSplit(tp)) if (IsSplit(tp))
{ {
t = SplitTopType(tp); t = SplitTopType(tp);
if (tp->ti_client == extUnInit && TTMaskHasType(mask, t)) if (TiGetClient(tp) == extUnInit && TTMaskHasType(mask, t))
{ {
PUSHTILETOP(tp, tilePlaneNum); PUSHTILETOP(tp, tilePlaneNum);
} }
else if (tp->ti_client != (ClientData)reg && TTMaskHasType(mask, t)) else if (TiGetClientPTR(tp) != reg && TTMaskHasType(mask, t))
{ {
/* Count split tile twice, once for each node it belongs to. */ /* Count split tile twice, once for each node it belongs to. */
tp->ti_client = extUnInit; TiSetClient(tp, extUnInit);
PUSHTILETOP(tp, tilePlaneNum); PUSHTILETOP(tp, tilePlaneNum);
} }
} }
else else
{ {
t = TiGetTypeExact(tp); t = TiGetTypeExact(tp);
if (tp->ti_client == extUnInit && TTMaskHasType(mask, t)) if (TiGetClient(tp) == extUnInit && TTMaskHasType(mask, t))
{ {
PUSHTILE(tp, tilePlaneNum); PUSHTILE(tp, tilePlaneNum);
} }
@ -5045,21 +5045,21 @@ rightside:
if (IsSplit(tp)) if (IsSplit(tp))
{ {
t = SplitLeftType(tp); t = SplitLeftType(tp);
if (tp->ti_client == extUnInit && TTMaskHasType(mask, t)) if (TiGetClient(tp) == extUnInit && TTMaskHasType(mask, t))
{ {
PUSHTILELEFT(tp, tilePlaneNum); PUSHTILELEFT(tp, tilePlaneNum);
} }
else if (tp->ti_client != (ClientData)reg && TTMaskHasType(mask, t)) else if (TiGetClientPTR(tp) != reg && TTMaskHasType(mask, t))
{ {
/* Count split tile twice, once for each node it belongs to */ /* Count split tile twice, once for each node it belongs to */
tp->ti_client = extUnInit; TiSetClient(tp, extUnInit);
PUSHTILELEFT(tp, tilePlaneNum); PUSHTILELEFT(tp, tilePlaneNum);
} }
} }
else else
{ {
t = TiGetTypeExact(tp); t = TiGetTypeExact(tp);
if (tp->ti_client == extUnInit && TTMaskHasType(mask, t)) if (TiGetClient(tp) == extUnInit && TTMaskHasType(mask, t))
{ {
PUSHTILE(tp, tilePlaneNum); PUSHTILE(tp, tilePlaneNum);
} }
@ -5090,7 +5090,7 @@ donesides:
GOTOPOINT(tp, &tile->ti_ll); GOTOPOINT(tp, &tile->ti_ll);
plane->pl_hint = tp; plane->pl_hint = tp;
if (tp->ti_client != extUnInit) continue; if (TiGetClient(tp) != extUnInit) continue;
/* tp and tile should have the same geometry for a contact */ /* tp and tile should have the same geometry for a contact */
if (IsSplit(tile) && IsSplit(tp)) if (IsSplit(tile) && IsSplit(tp))

View File

@ -108,7 +108,7 @@ struct extPathFloodArg
}; };
/* Used to mark tiles during path tracing */ /* Used to mark tiles during path tracing */
#define MARKED ((ClientData) 1) #define MARKED (1)
/* Forward declarations */ /* Forward declarations */
Label *extPathLabel(); Label *extPathLabel();
@ -665,7 +665,7 @@ extPathPairDistance(lab1, lab2, pMin, pMax)
/* Reset ti_client fields in tiles */ /* Reset ti_client fields in tiles */
for (pNum = PL_TECHDEPBASE; pNum < DBNumPlanes; pNum++) for (pNum = PL_TECHDEPBASE; pNum < DBNumPlanes; pNum++)
(void) DBSrPaintClient((Tile *) NULL, extPathDef->cd_planes[pNum], (void) DBSrPaintClient((Tile *) NULL, extPathDef->cd_planes[pNum],
&TiPlaneRect, &DBAllButSpaceBits, MARKED, &TiPlaneRect, &DBAllButSpaceBits, (ClientData) MARKED,
extPathResetClient, (ClientData) NULL); extPathResetClient, (ClientData) NULL);
} }
@ -688,7 +688,7 @@ int
extPathResetClient(tile) extPathResetClient(tile)
Tile *tile; Tile *tile;
{ {
tile->ti_client = (ClientData) CLIENTDEFAULT; TiSetClient(tile, CLIENTDEFAULT);
return (0); return (0);
} }
@ -780,7 +780,7 @@ extPathFlood(tile, p, distance, epa)
Rect r; Rect r;
/* Mark the tile as being visited */ /* Mark the tile as being visited */
tile->ti_client = MARKED; TiSetClientINT(tile, MARKED);
/* /*
* Are we at the destination yet? * Are we at the destination yet?
@ -820,22 +820,22 @@ extPathFlood(tile, p, distance, epa)
/* TOP */ /* TOP */
for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp)) for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp))
if (tp->ti_client != MARKED && DBConnectsTo(TiGetType(tp), type)) if (TiGetClientINT(tp) != MARKED && DBConnectsTo(TiGetType(tp), type))
extPathFloodTile(tile, p, distance, tp, epa); extPathFloodTile(tile, p, distance, tp, epa);
/* RIGHT */ /* RIGHT */
for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp)) for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp))
if (tp->ti_client != MARKED && DBConnectsTo(TiGetType(tp), type)) if (TiGetClientINT(tp) != MARKED && DBConnectsTo(TiGetType(tp), type))
extPathFloodTile(tile, p, distance, tp, epa); extPathFloodTile(tile, p, distance, tp, epa);
/* BOTTOM */ /* BOTTOM */
for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp)) for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp))
if (tp->ti_client != MARKED && DBConnectsTo(TiGetType(tp), type)) if (TiGetClientINT(tp) != MARKED && DBConnectsTo(TiGetType(tp), type))
extPathFloodTile(tile, p, distance, tp, epa); extPathFloodTile(tile, p, distance, tp, epa);
/* LEFT */ /* LEFT */
for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp)) for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp))
if (tp->ti_client != MARKED && DBConnectsTo(TiGetType(tp), type)) if (TiGetClientINT(tp) != MARKED && DBConnectsTo(TiGetType(tp), type))
extPathFloodTile(tile, p, distance, tp, epa); extPathFloodTile(tile, p, distance, tp, epa);
/* Try connections to other planes */ /* Try connections to other planes */
@ -856,7 +856,7 @@ extPathFlood(tile, p, distance, epa)
plane->pl_hint = tp; plane->pl_hint = tp;
/* If not yet visited, process tp */ /* If not yet visited, process tp */
if (tp->ti_client == (ClientData) CLIENTDEFAULT if (TiGetClient(tp) == CLIENTDEFAULT
&& DBConnectsTo(type, TiGetType(tp))) && DBConnectsTo(type, TiGetType(tp)))
{ {
epa->epa_pNum = pNum; epa->epa_pNum = pNum;

View File

@ -117,9 +117,9 @@ ExtFindNeighbors(tile, tilePlaneNum, arg)
* been visited in the meantime. If it's still unvisited, * been visited in the meantime. If it's still unvisited,
* visit it and process its neighbors. * visit it and process its neighbors.
*/ */
if (tile->ti_client == (ClientData) arg->fra_region) if (TiGetClientPTR(tile) == arg->fra_region)
continue; continue;
tile->ti_client = (ClientData) arg->fra_region; TiSetClientPTR(tile, arg->fra_region);
tilesfound++; tilesfound++;
if (DebugIsSet(extDebugID, extDebNeighbor)) if (DebugIsSet(extDebugID, extDebNeighbor))
extShowTile(tile, "neighbor", 1); extShowTile(tile, "neighbor", 1);
@ -132,8 +132,8 @@ topside:
if (IsSplit(tp)) if (IsSplit(tp))
{ {
t = SplitBottomType(tp); t = SplitBottomType(tp);
// if (tp->ti_client == extNbrUn && TTMaskHasType(mask, t)) // if (TiGetClient(tp) == extNbrUn && TTMaskHasType(mask, t))
if (tp->ti_client != (ClientData)arg->fra_region && TTMaskHasType(mask, t)) if (TiGetClientPTR(tp) != arg->fra_region && TTMaskHasType(mask, t))
{ {
PUSHTILEBOTTOM(tp, tilePlaneNum); PUSHTILEBOTTOM(tp, tilePlaneNum);
} }
@ -141,7 +141,7 @@ topside:
else else
{ {
t = TiGetTypeExact(tp); t = TiGetTypeExact(tp);
if (tp->ti_client == extNbrUn && TTMaskHasType(mask, t)) if (TiGetClient(tp) == extNbrUn && TTMaskHasType(mask, t))
{ {
PUSHTILE(tp, tilePlaneNum); PUSHTILE(tp, tilePlaneNum);
} }
@ -156,8 +156,8 @@ leftside:
if (IsSplit(tp)) if (IsSplit(tp))
{ {
t = SplitRightType(tp); t = SplitRightType(tp);
// if (tp->ti_client == extNbrUn && TTMaskHasType(mask, t)) // if (TiGetClient(tp) == extNbrUn && TTMaskHasType(mask, t))
if (tp->ti_client != (ClientData)arg->fra_region && TTMaskHasType(mask, t)) if (TiGetClientPTR(tp) != arg->fra_region && TTMaskHasType(mask, t))
{ {
PUSHTILERIGHT(tp, tilePlaneNum); PUSHTILERIGHT(tp, tilePlaneNum);
} }
@ -165,7 +165,7 @@ leftside:
else else
{ {
t = TiGetTypeExact(tp); t = TiGetTypeExact(tp);
if (tp->ti_client == extNbrUn && TTMaskHasType(mask, t)) if (TiGetClient(tp) == extNbrUn && TTMaskHasType(mask, t))
{ {
PUSHTILE(tp, tilePlaneNum); PUSHTILE(tp, tilePlaneNum);
} }
@ -181,8 +181,8 @@ bottomside:
if (IsSplit(tp)) if (IsSplit(tp))
{ {
t = SplitTopType(tp); t = SplitTopType(tp);
// if (tp->ti_client == extNbrUn && TTMaskHasType(mask, t)) // if (TiGetClient(tp) == extNbrUn && TTMaskHasType(mask, t))
if (tp->ti_client != (ClientData)arg->fra_region && TTMaskHasType(mask, t)) if (TiGetClientPTR(tp) != arg->fra_region && TTMaskHasType(mask, t))
{ {
PUSHTILETOP(tp, tilePlaneNum); PUSHTILETOP(tp, tilePlaneNum);
} }
@ -190,7 +190,7 @@ bottomside:
else else
{ {
t = TiGetTypeExact(tp); t = TiGetTypeExact(tp);
if (tp->ti_client == extNbrUn && TTMaskHasType(mask, t)) if (TiGetClient(tp) == extNbrUn && TTMaskHasType(mask, t))
{ {
PUSHTILE(tp, tilePlaneNum); PUSHTILE(tp, tilePlaneNum);
} }
@ -205,8 +205,8 @@ rightside:
if (IsSplit(tp)) if (IsSplit(tp))
{ {
t = SplitLeftType(tp); t = SplitLeftType(tp);
// if (tp->ti_client == extNbrUn && TTMaskHasType(mask, t)) // if (TiGetClient(tp) == extNbrUn && TTMaskHasType(mask, t))
if (tp->ti_client != (ClientData)arg->fra_region && TTMaskHasType(mask, t)) if (TiGetClientPTR(tp) != arg->fra_region && TTMaskHasType(mask, t))
{ {
PUSHTILELEFT(tp, tilePlaneNum); PUSHTILELEFT(tp, tilePlaneNum);
} }
@ -214,7 +214,7 @@ rightside:
else else
{ {
t = TiGetTypeExact(tp); t = TiGetTypeExact(tp);
if (tp->ti_client == extNbrUn && TTMaskHasType(mask, t)) if (TiGetClient(tp) == extNbrUn && TTMaskHasType(mask, t))
{ {
PUSHTILE(tp, tilePlaneNum); PUSHTILE(tp, tilePlaneNum);
} }
@ -240,7 +240,7 @@ donesides:
tp = plane->pl_hint; tp = plane->pl_hint;
GOTOPOINT(tp, &tile->ti_ll); GOTOPOINT(tp, &tile->ti_ll);
plane->pl_hint = tp; plane->pl_hint = tp;
if (tp->ti_client != extNbrUn) continue; if (TiGetClient(tp) != extNbrUn) continue;
/* tp and tile should have the same geometry for a contact */ /* tp and tile should have the same geometry for a contact */
if (IsSplit(tile) && IsSplit(tp)) if (IsSplit(tile) && IsSplit(tp))
@ -317,7 +317,7 @@ fail:
while (!StackEmpty(extNodeStack)) while (!StackEmpty(extNodeStack))
{ {
POPTILE(tile, tilePlaneNum); POPTILE(tile, tilePlaneNum);
tile->ti_client = (ClientData) arg->fra_region; TiSetClientPTR(tile, arg->fra_region);
} }
return -1; return -1;
} }
@ -356,7 +356,7 @@ extNbrPushFunc(tile, pla)
tileArea = &pla->area; tileArea = &pla->area;
/* Ignore tile if it's already been visited */ /* Ignore tile if it's already been visited */
if (tile->ti_client != extNbrUn) if (TiGetClient(tile) != extNbrUn)
return 0; return 0;
/* Only consider tile if it overlaps tileArea or shares part of a side */ /* Only consider tile if it overlaps tileArea or shares part of a side */

View File

@ -875,14 +875,14 @@ defExemptWireFunc(
Rect r; Rect r;
/* Do not change the client data of tiles that have been processed! */ /* Do not change the client data of tiles that have been processed! */
if (tile->ti_client != (ClientData) 1) if (TiGetClientINT(tile) != 1)
{ {
/* Ignore contacts, which need additional processing */ /* Ignore contacts, which need additional processing */
if (DBIsContact(TiGetType(tile))) return 0; if (DBIsContact(TiGetType(tile))) return 0;
TiToRect(tile, &r); TiToRect(tile, &r);
if (GEO_SURROUND(rect, &r)) if (GEO_SURROUND(rect, &r))
tile->ti_client = (ClientData) 2; TiSetClientINT(tile, 2);
} }
return 0; return 0;
} }

View File

@ -646,7 +646,7 @@ lefYankGeometry(
bool iscut; bool iscut;
/* Ignore marked tiles */ /* Ignore marked tiles */
if (tile->ti_client != (ClientData)CLIENTDEFAULT) return 0; if (TiGetClient(tile) != CLIENTDEFAULT) return 0;
otype = TiGetTypeExact(tile); otype = TiGetTypeExact(tile);
if (IsSplit(tile)) if (IsSplit(tile))
@ -736,7 +736,7 @@ lefYankContacts(
TileTypeBitMask *lrmask; TileTypeBitMask *lrmask;
/* Ignore marked tiles */ /* Ignore marked tiles */
if (tile->ti_client != (ClientData)CLIENTDEFAULT) return 0; if (TiGetClient(tile) != CLIENTDEFAULT) return 0;
/* Ignore split tiles */ /* Ignore split tiles */
if (IsSplit(tile)) return 0; if (IsSplit(tile)) return 0;
@ -805,11 +805,11 @@ lefWriteGeometry(
LefMapping *lefMagicToLefLayer = lefdata->lefMagicMap; LefMapping *lefMagicToLefLayer = lefdata->lefMagicMap;
/* Ignore tiles that have already been output */ /* Ignore tiles that have already been output */
if (tile->ti_client != (ClientData)CLIENTDEFAULT) if (TiGetClient(tile) != CLIENTDEFAULT)
return 0; return 0;
/* Mark this tile as visited */ /* Mark this tile as visited */
TiSetClient(tile, (ClientData)1); TiSetClientINT(tile, 1);
/* Get layer type */ /* Get layer type */
if (IsSplit(tile)) if (IsSplit(tile))
@ -834,7 +834,7 @@ lefWriteGeometry(
/* Reset the tile to not visited and return 1 to */ /* Reset the tile to not visited and return 1 to */
/* signal that something is going to be written. */ /* signal that something is going to be written. */
TiSetClient(tile, (ClientData)CLIENTDEFAULT); TiSetClient(tile, CLIENTDEFAULT);
return 1; return 1;
} }

View File

@ -1948,7 +1948,7 @@ plowSplitY(tp, y)
Tile *newTile; Tile *newTile;
newTile = TiSplitY(tp, y); newTile = TiSplitY(tp, y);
newTile->ti_client = tp->ti_client; TiSetClient(newTile, TiGetClient(tp));
TiSetBody(newTile, TiGetBody(tp)); TiSetBody(newTile, TiGetBody(tp));
return (newTile); return (newTile);

View File

@ -314,7 +314,7 @@ plowYankUpdatePaint(yankTp, pNum)
(void) plowSplitY(spareTp, TOP(yankTp)); (void) plowSplitY(spareTp, TOP(yankTp));
if (BOTTOM(spareTp) < BOTTOM(yankTp)) if (BOTTOM(spareTp) < BOTTOM(yankTp))
spareTp = plowSplitY(spareTp, BOTTOM(yankTp)); spareTp = plowSplitY(spareTp, BOTTOM(yankTp));
spareTp->ti_client = yankTp->ti_client; TiSetClient(spareTp, TiGetClient(yankTp));
} }
startPoint.p_y = BOTTOM(spareTp) - 1; startPoint.p_y = BOTTOM(spareTp) - 1;

View File

@ -46,7 +46,7 @@ resNodeIsPort(node, x, y, tile)
Rect *rect; Rect *rect;
Point p; Point p;
resPort *pl, *lp; resPort *pl, *lp;
tileJunk *junk = (tileJunk *)(tile->ti_client); tileJunk *junk = (tileJunk *)TiGetClientPTR(tile);
p.p_x = x; p.p_x = x;
p.p_y = y; p.p_y = y;
@ -90,7 +90,7 @@ resAllPortNodes(tile, list)
int x, y; int x, y;
resNode *resptr; resNode *resptr;
resPort *pl; resPort *pl;
tileJunk *junk = (tileJunk *)(tile->ti_client); tileJunk *junk = (tileJunk *)TiGetClientPTR(tile);
for (pl = junk->portList; pl; pl = pl->rp_nextPort) for (pl = junk->portList; pl; pl = pl->rp_nextPort)
{ {
@ -198,7 +198,7 @@ ResEachTile(tile, startpoint)
int xj, yj, i; int xj, yj, i;
bool merged; bool merged;
tElement *tcell; tElement *tcell;
tileJunk *tstructs= (tileJunk *)(tile->ti_client); tileJunk *tstructs= (tileJunk *)TiGetClientPTR(tile);
ExtDevice *devptr; ExtDevice *devptr;
ResTileCount++; ResTileCount++;

View File

@ -60,9 +60,9 @@ ResNewSDDevice(tile, tp, xj, yj, direction, PendingList)
* be generated which means "more debugging needed"; however, it will * be generated which means "more debugging needed"; however, it will
* not cause a segmentation violation. * not cause a segmentation violation.
*/ */
if (tp->ti_client == CLIENTDEFAULT) return; if (TiGetClient(tp) == CLIENTDEFAULT) return;
j = (tileJunk *) tp->ti_client; j = (tileJunk *) TiGetClientPTR(tp);
resDev = j->deviceList; resDev = j->deviceList;
if ((j->sourceEdge & direction) != 0) if ((j->sourceEdge & direction) != 0)
{ {
@ -128,7 +128,7 @@ ResNewSubDevice(tile, tp, xj, yj, direction, PendingList)
tileJunk *j; tileJunk *j;
newnode = FALSE; newnode = FALSE;
j = (tileJunk *) tp->ti_client; j = (tileJunk *) TiGetClientPTR(tp);
resDev = j->deviceList; resDev = j->deviceList;
/* Arrived at a device that has a terminal connected to substrate */ /* Arrived at a device that has a terminal connected to substrate */
@ -181,8 +181,8 @@ ResProcessJunction(tile, tp, xj, yj, NodeList)
ResJunction *junction; ResJunction *junction;
resNode *resptr; resNode *resptr;
jElement *jcell; jElement *jcell;
tileJunk *j0 = (tileJunk *)tile->ti_client; tileJunk *j0 = (tileJunk *)TiGetClientPTR(tile);
tileJunk *j2 = (tileJunk *)tp->ti_client; tileJunk *j2 = (tileJunk *)TiGetClientPTR(tp);
#ifdef PARANOID #ifdef PARANOID
if (tile == tp) if (tile == tp)

View File

@ -357,7 +357,7 @@ ResAddBreakpointFunc(tile, node)
{ {
tileJunk *junk; tileJunk *junk;
if (tile->ti_client == (ClientData) CLIENTDEFAULT) if (TiGetClient(tile) == CLIENTDEFAULT)
return 0; return 0;
NEWPORT(node, tile); NEWPORT(node, tile);
@ -422,7 +422,7 @@ ResFindNewContactTiles(contacts)
if ((IsSplit(tile) && TTMaskHasType(&mask, TiGetRightType(tile))) if ((IsSplit(tile) && TTMaskHasType(&mask, TiGetRightType(tile)))
|| TTMaskHasType(&mask, TiGetType(tile))) || TTMaskHasType(&mask, TiGetType(tile)))
{ {
tileJunk *j = (tileJunk *)tile->ti_client; tileJunk *j = (tileJunk *)TiGetClientPTR(tile);
cElement *ce; cElement *ce;
ce = (cElement *) mallocMagic((unsigned) (sizeof(cElement))); ce = (cElement *) mallocMagic((unsigned) (sizeof(cElement)));
@ -444,7 +444,7 @@ ResFindNewContactTiles(contacts)
*/ */
if (TTMaskIntersect(DBResidueMask(ttype), &mask)) if (TTMaskIntersect(DBResidueMask(ttype), &mask))
{ {
tileJunk *j = (tileJunk *)tile->ti_client; tileJunk *j = (tileJunk *)TiGetClientPTR(tile);
cElement *ce; cElement *ce;
ce = (cElement *) mallocMagic((unsigned) (sizeof(cElement))); ce = (cElement *) mallocMagic((unsigned) (sizeof(cElement)));
@ -545,7 +545,7 @@ ResProcessTiles(goodies, origin)
{ {
Tile *tile = fix->fp_tile; Tile *tile = fix->fp_tile;
if (tile != NULL && (((tileJunk *)tile->ti_client)->tj_status & if (tile != NULL && (((tileJunk *)TiGetClientPTR(tile)->tj_status &
RES_TILE_DONE) == 0) RES_TILE_DONE) == 0)
{ {
resCurrentNode = fix->fp_node; resCurrentNode = fix->fp_node;
@ -584,7 +584,7 @@ ResProcessTiles(goodies, origin)
for (tilenum = 0; tilenum < TILES_PER_JUNCTION; tilenum++) for (tilenum = 0; tilenum < TILES_PER_JUNCTION; tilenum++)
{ {
Tile *tile = rj->rj_Tile[tilenum]; Tile *tile = rj->rj_Tile[tilenum];
tileJunk *j = (tileJunk *)tile->ti_client; tileJunk *j = (tileJunk *)TiGetClientPTR(tile);
if ((j->tj_status & RES_TILE_DONE) == 0) if ((j->tj_status & RES_TILE_DONE) == 0)
{ {
@ -611,7 +611,7 @@ ResProcessTiles(goodies, origin)
for (tilenum = 0; tilenum < cp->cp_currentcontact; tilenum++) for (tilenum = 0; tilenum < cp->cp_currentcontact; tilenum++)
{ {
Tile *tile = cp->cp_tile[tilenum]; Tile *tile = cp->cp_tile[tilenum];
tileJunk *j = (tileJunk *) tile->ti_client; tileJunk *j = (tileJunk *) TiGetClientPTR(tile);
if ((j->tj_status & RES_TILE_DONE) == 0) if ((j->tj_status & RES_TILE_DONE) == 0)
{ {
@ -814,7 +814,7 @@ resExpandDevFunc(tile, cx)
if (devResetStack == NULL) if (devResetStack == NULL)
devResetStack = StackNew(8); devResetStack = StackNew(8);
tile->ti_client = (ClientData)DEV_PROCESSED; TiSetClientINT(tile, DEV_PROCESSED);
STACKPUSH((ClientData)tile, devExtentsStack); STACKPUSH((ClientData)tile, devExtentsStack);
while (!StackEmpty(devExtentsStack)) while (!StackEmpty(devExtentsStack))
@ -837,12 +837,12 @@ resExpandDevFunc(tile, cx)
/* top */ /* top */
for (tp2 = RT(tp); RIGHT(tp2) > LEFT(tp); tp2 = BL(tp2)) for (tp2 = RT(tp); RIGHT(tp2) > LEFT(tp); tp2 = BL(tp2))
{ {
if (tp2->ti_client == (ClientData)DEV_PROCESSED) continue; if (TiGetClientINT(tp2) == DEV_PROCESSED) continue;
ttype = TiGetBottomType(tp2); ttype = TiGetBottomType(tp2);
if ((ttype == thisDev->type) || (DBIsContact(ttype) if ((ttype == thisDev->type) || (DBIsContact(ttype)
&& TTMaskHasType(DBResidueMask(ttype), thisDev->type))) && TTMaskHasType(DBResidueMask(ttype), thisDev->type)))
{ {
tp2->ti_client = (ClientData)DEV_PROCESSED; TiSetClientINT(tp2, DEV_PROCESSED);
STACKPUSH((ClientData)tp2, devExtentsStack); STACKPUSH((ClientData)tp2, devExtentsStack);
} }
} }
@ -850,12 +850,12 @@ resExpandDevFunc(tile, cx)
/* bottom */ /* bottom */
for (tp2 = LB(tp); LEFT(tp2) < RIGHT(tp); tp2 = TR(tp2)) for (tp2 = LB(tp); LEFT(tp2) < RIGHT(tp); tp2 = TR(tp2))
{ {
if (tp2->ti_client == (ClientData)DEV_PROCESSED) continue; if (TiGetClientINT(tp2) == DEV_PROCESSED) continue;
ttype = TiGetTopType(tp2); ttype = TiGetTopType(tp2);
if ((ttype == thisDev->type) || (DBIsContact(ttype) if ((ttype == thisDev->type) || (DBIsContact(ttype)
&& TTMaskHasType(DBResidueMask(ttype), thisDev->type))) && TTMaskHasType(DBResidueMask(ttype), thisDev->type)))
{ {
tp2->ti_client = (ClientData)DEV_PROCESSED; TiSetClientINT(tp2, DEV_PROCESSED);
STACKPUSH((ClientData)tp2, devExtentsStack); STACKPUSH((ClientData)tp2, devExtentsStack);
} }
} }
@ -863,12 +863,12 @@ resExpandDevFunc(tile, cx)
/* right */ /* right */
for (tp2 = TR(tp); TOP(tp2) > BOTTOM(tp); tp2 = LB(tp2)) for (tp2 = TR(tp); TOP(tp2) > BOTTOM(tp); tp2 = LB(tp2))
{ {
if (tp2->ti_client == (ClientData)DEV_PROCESSED) continue; if (TiGetClientINT(tp2) == DEV_PROCESSED) continue;
ttype = TiGetLeftType(tp2); ttype = TiGetLeftType(tp2);
if ((ttype == thisDev->type) || (DBIsContact(ttype) if ((ttype == thisDev->type) || (DBIsContact(ttype)
&& TTMaskHasType(DBResidueMask(ttype), thisDev->type))) && TTMaskHasType(DBResidueMask(ttype), thisDev->type)))
{ {
tp2->ti_client = (ClientData)DEV_PROCESSED; TiSetClientINT(tp2, DEV_PROCESSED);
STACKPUSH((ClientData)tp2, devExtentsStack); STACKPUSH((ClientData)tp2, devExtentsStack);
} }
} }
@ -876,12 +876,12 @@ resExpandDevFunc(tile, cx)
/* left */ /* left */
for (tp2 = BL(tp); BOTTOM(tp2) < TOP(tp); tp2 = RT(tp2)) for (tp2 = BL(tp); BOTTOM(tp2) < TOP(tp); tp2 = RT(tp2))
{ {
if (tp2->ti_client == (ClientData)DEV_PROCESSED) continue; if (TiGetClientINT(tp2) == DEV_PROCESSED) continue;
ttype = TiGetRightType(tp2); ttype = TiGetRightType(tp2);
if ((ttype == thisDev->type) || (DBIsContact(ttype) if ((ttype == thisDev->type) || (DBIsContact(ttype)
&& TTMaskHasType(DBResidueMask(ttype), thisDev->type))) && TTMaskHasType(DBResidueMask(ttype), thisDev->type)))
{ {
tp2->ti_client = (ClientData)DEV_PROCESSED; TiSetClientINT(tp2, DEV_PROCESSED);
STACKPUSH((ClientData)tp2, devExtentsStack); STACKPUSH((ClientData)tp2, devExtentsStack);
} }
} }
@ -891,7 +891,7 @@ resExpandDevFunc(tile, cx)
while (!StackEmpty(devResetStack)) while (!StackEmpty(devResetStack))
{ {
tp = (Tile *) STACKPOP(devResetStack); tp = (Tile *) STACKPOP(devResetStack);
tp->ti_client = (ClientData)CLIENTDEFAULT; TiSetClient(tp, CLIENTDEFAULT);
} }
/* Return 1 to stop the search; we only need to run this from */ /* Return 1 to stop the search; we only need to run this from */
@ -1443,8 +1443,8 @@ FindStartTile(goodies, SourcePoint)
MAX(BOTTOM(tile), BOTTOM(tp))) >> 1; MAX(BOTTOM(tile), BOTTOM(tp))) >> 1;
return(tp); return(tp);
} }
else if (tp->ti_client != CLIENTDEFAULT) else if (TiGetClient(tp) != CLIENTDEFAULT)
if (((tileJunk *)tp->ti_client)->tj_status & RES_TILE_DEV) if (((tileJunk *)TiGetClientPTR(tp))->tj_status & RES_TILE_DEV)
complex = TRUE; complex = TRUE;
} }
@ -1460,8 +1460,8 @@ FindStartTile(goodies, SourcePoint)
MAX(BOTTOM(tile), BOTTOM(tp))) >> 1; MAX(BOTTOM(tile), BOTTOM(tp))) >> 1;
return(tp); return(tp);
} }
else if (tp->ti_client != CLIENTDEFAULT) else if (TiGetClient(tp) != CLIENTDEFAULT)
if (((tileJunk *)tp->ti_client)->tj_status & RES_TILE_DEV) if (((tileJunk *)TiGetClientPTR(tp))->tj_status & RES_TILE_DEV)
complex = TRUE; complex = TRUE;
} }
@ -1477,8 +1477,8 @@ FindStartTile(goodies, SourcePoint)
MAX(LEFT(tile), LEFT(tp))) >> 1; MAX(LEFT(tile), LEFT(tp))) >> 1;
return(tp); return(tp);
} }
else if (tp->ti_client != CLIENTDEFAULT) else if (TiGetClient(tp) != CLIENTDEFAULT)
if (((tileJunk *)tp->ti_client)->tj_status & RES_TILE_DEV) if (((tileJunk *)TiGetClientPTR(tp))->tj_status & RES_TILE_DEV)
complex = TRUE; complex = TRUE;
} }
@ -1494,8 +1494,8 @@ FindStartTile(goodies, SourcePoint)
MAX(LEFT(tile), LEFT(tp))) >> 1; MAX(LEFT(tile), LEFT(tp))) >> 1;
return(tp); return(tp);
} }
else if (tp->ti_client != CLIENTDEFAULT) else if (TiGetClient(tp) != CLIENTDEFAULT)
if (((tileJunk *)tp->ti_client)->tj_status & RES_TILE_DEV) if (((tileJunk *)TiGetClientPTR(tp))->tj_status & RES_TILE_DEV)
complex = TRUE; complex = TRUE;
} }
@ -1507,7 +1507,7 @@ FindStartTile(goodies, SourcePoint)
if (devStack == NULL) devStack = StackNew(8); if (devStack == NULL) devStack = StackNew(8);
((tileJunk *)tile->ti_client)->tj_status |= RES_TILE_PUSHED; ((tileJunk *)TiGetClientPTR(tile))->tj_status |= RES_TILE_PUSHED;
STACKPUSH((ClientData)tile, devStack); STACKPUSH((ClientData)tile, devStack);
while (!StackEmpty(devStack)) while (!StackEmpty(devStack))
{ {
@ -1529,14 +1529,14 @@ FindStartTile(goodies, SourcePoint)
} }
return(tp); return(tp);
} }
else if (tp->ti_client != CLIENTDEFAULT) else if (TiGetClient(tp) != CLIENTDEFAULT)
{ {
if (((tileJunk *)tp->ti_client)->tj_status & RES_TILE_DEV) if (((tileJunk *)TiGetClientPTR(tp))->tj_status & RES_TILE_DEV)
{ {
if (!(((tileJunk *)tp->ti_client)->tj_status if (!(((tileJunk *)TiGetClientPTR(tp))->tj_status
& RES_TILE_PUSHED)) & RES_TILE_PUSHED))
{ {
((tileJunk *)tp->ti_client)->tj_status ((tileJunk *)TiGetClientPTR(tp))->tj_status
|= RES_TILE_PUSHED; |= RES_TILE_PUSHED;
STACKPUSH((ClientData)tp, devStack); STACKPUSH((ClientData)tp, devStack);
} }
@ -1560,14 +1560,14 @@ FindStartTile(goodies, SourcePoint)
} }
return(tp); return(tp);
} }
else if (tp->ti_client != CLIENTDEFAULT) else if (TiGetClient(tp) != CLIENTDEFAULT)
{ {
if (((tileJunk *)tp->ti_client)->tj_status & RES_TILE_DEV) if (((tileJunk *)TiGetClientPTR(tp))->tj_status & RES_TILE_DEV)
{ {
if (!(((tileJunk *)tp->ti_client)->tj_status if (!(((tileJunk *)TiGetClientPTR(tp))->tj_status
& RES_TILE_PUSHED)) & RES_TILE_PUSHED))
{ {
((tileJunk *)tp->ti_client)->tj_status ((tileJunk *)TiGetClientPTR(tp))->tj_status
|= RES_TILE_PUSHED; |= RES_TILE_PUSHED;
STACKPUSH((ClientData)tp, devStack); STACKPUSH((ClientData)tp, devStack);
} }
@ -1591,14 +1591,14 @@ FindStartTile(goodies, SourcePoint)
} }
return(tp); return(tp);
} }
else if (tp->ti_client != CLIENTDEFAULT) else if (TiGetClient(tp) != CLIENTDEFAULT)
{ {
if (((tileJunk *)tp->ti_client)->tj_status & RES_TILE_DEV) if (((tileJunk *)TiGetClientPTR(tp))->tj_status & RES_TILE_DEV)
{ {
if (!(((tileJunk *)tp->ti_client)->tj_status if (!(((tileJunk *)TiGetClientPTR(tp))->tj_status
& RES_TILE_PUSHED)) & RES_TILE_PUSHED))
{ {
((tileJunk *)tp->ti_client)->tj_status ((tileJunk *)TiGetClientPTR(tp))->tj_status
|= RES_TILE_PUSHED; |= RES_TILE_PUSHED;
STACKPUSH((ClientData)tp, devStack); STACKPUSH((ClientData)tp, devStack);
} }
@ -1622,14 +1622,14 @@ FindStartTile(goodies, SourcePoint)
} }
return(tp); return(tp);
} }
else if (tp->ti_client != CLIENTDEFAULT) else if (TiGetClient(tp) != CLIENTDEFAULT)
{ {
if (((tileJunk *)tp->ti_client)->tj_status & RES_TILE_DEV) if (((tileJunk *)TiGetClientPTR(tp))->tj_status & RES_TILE_DEV)
{ {
if (!(((tileJunk *)tp->ti_client)->tj_status if (!(((tileJunk *)TiGetClientPTR(tp))->tj_status
& RES_TILE_PUSHED)) & RES_TILE_PUSHED))
{ {
((tileJunk *)tp->ti_client)->tj_status ((tileJunk *)TiGetClientPTR(tp))->tj_status
|= RES_TILE_PUSHED; |= RES_TILE_PUSHED;
STACKPUSH((ClientData)tp, devStack); STACKPUSH((ClientData)tp, devStack);
} }
@ -1722,15 +1722,15 @@ ResGetDevice(pt, type)
{ {
if (TTMaskHasType(&ExtCurStyle->exts_deviceMask, TiGetLeftType(tile)) if (TTMaskHasType(&ExtCurStyle->exts_deviceMask, TiGetLeftType(tile))
|| TTMaskHasType(&ExtCurStyle->exts_deviceMask, TiGetRightType(tile))) || TTMaskHasType(&ExtCurStyle->exts_deviceMask, TiGetRightType(tile)))
return (((tileJunk *)tile->ti_client)->deviceList); return (((tileJunk *)TiGetClientPTR(tile))->deviceList);
} }
else if (TTMaskHasType(&ExtCurStyle->exts_deviceMask, TiGetType(tile))) else if (TTMaskHasType(&ExtCurStyle->exts_deviceMask, TiGetType(tile)))
{ {
/* Failure to have a valid client data will result in a "Bad Device" /* Failure to have a valid client data will result in a "Bad Device"
* error and indicates a problem that needs debugging. * error and indicates a problem that needs debugging.
*/ */
if (tile->ti_client != CLIENTDEFAULT) if (TiGetClient(tile) != CLIENTDEFAULT)
return (((tileJunk *)tile->ti_client)->deviceList); return (((tileJunk *)TiGetClientPTR(tile))->deviceList);
} }
return NULL; return NULL;
} }

View File

@ -132,7 +132,7 @@ ResCalcEastWest(tile, pendingList, doneList, resList)
resElement *element; resElement *element;
resNode *currNode; resNode *currNode;
float rArea; float rArea;
tileJunk *junk = (tileJunk *)tile->ti_client; tileJunk *junk = (tileJunk *)TiGetClientPTR(tile);
merged = FALSE; merged = FALSE;
height = TOP(tile) - BOTTOM(tile); height = TOP(tile) - BOTTOM(tile);
@ -303,7 +303,7 @@ ResCalcNorthSouth(tile, pendingList, doneList, resList)
resElement *element; resElement *element;
resNode *currNode; resNode *currNode;
float rArea; float rArea;
tileJunk *junk = (tileJunk *)tile->ti_client; tileJunk *junk = (tileJunk *)TiGetClientPTR(tile);
merged = FALSE; merged = FALSE;
width = RIGHT(tile) - LEFT(tile); width = RIGHT(tile) - LEFT(tile);
@ -472,7 +472,7 @@ ResCalcNearDevice(tile, pendingList, doneList, resList)
bool merged; bool merged;
int devcount, devedge, deltax, deltay; int devcount, devedge, deltax, deltay;
Breakpoint *p1, *p2, *p3; Breakpoint *p1, *p2, *p3;
tileJunk *junk = (tileJunk *)tile->ti_client; tileJunk *junk = (tileJunk *)TiGetClientPTR(tile);
merged = FALSE; merged = FALSE;

View File

@ -709,7 +709,7 @@ ResMergeNodes(node1, node2, pendingList, doneList)
tileJunk *junk; tileJunk *junk;
tile = tJunc->je_thisj->rj_Tile[i]; tile = tJunc->je_thisj->rj_Tile[i];
junk = (tileJunk *) tile->ti_client; junk = (tileJunk *) TiGetClientPTR(tile);
if ((junk->tj_status & RES_TILE_DONE) == FALSE) if ((junk->tj_status & RES_TILE_DONE) == FALSE)
ResFixBreakPoint(&junk->breakList, node2, node1); ResFixBreakPoint(&junk->breakList, node2, node1);
@ -733,7 +733,7 @@ ResMergeNodes(node1, node2, pendingList, doneList)
workingCon->ce_thisc->cp_cnode[i] = node1; workingCon->ce_thisc->cp_cnode[i] = node1;
tile =tCon->ce_thisc->cp_tile[i]; tile =tCon->ce_thisc->cp_tile[i];
junk = (tileJunk *) tile->ti_client; junk = (tileJunk *) TiGetClientPTR(tile);
if ((junk->tj_status & RES_TILE_DONE) == FALSE) if ((junk->tj_status & RES_TILE_DONE) == FALSE)
ResFixBreakPoint(&junk->breakList, node2, node1); ResFixBreakPoint(&junk->breakList, node2, node1);
} }

View File

@ -190,7 +190,7 @@ ResAddPlumbing(tile, arg)
if (resDevStack == NULL) if (resDevStack == NULL)
resDevStack = StackNew(64); resDevStack = StackNew(64);
if (tile->ti_client == (ClientData) CLIENTDEFAULT) if (TiGetClient(tile) == CLIENTDEFAULT)
{ {
if (IsSplit(tile)) if (IsSplit(tile))
loctype = (SplitSide(tile)) ? SplitRightType(tile) : loctype = (SplitSide(tile)) ? SplitRightType(tile) :
@ -437,12 +437,12 @@ ResAddPlumbing(tile, arg)
t1 = TiGetTypeExact(tp1); t1 = TiGetTypeExact(tp1);
devptr = ExtCurStyle->exts_device[t1]; devptr = ExtCurStyle->exts_device[t1];
j0 = (tileJunk *) tp1->ti_client; j0 = (tileJunk *) TiGetClientPTR(tp1);
/* top */ /* top */
for (tp2 = RT(tp1); RIGHT(tp2) > LEFT(tp1); tp2 = BL(tp2)) for (tp2 = RT(tp1); RIGHT(tp2) > LEFT(tp1); tp2 = BL(tp2))
{ {
if ((TiGetBottomType(tp2) == t1) && if ((TiGetBottomType(tp2) == t1) &&
(tp2->ti_client == (ClientData) CLIENTDEFAULT)) (TiGetClient(tp2) == CLIENTDEFAULT))
{ {
Junk = resAddField(tp2); Junk = resAddField(tp2);
STACKPUSH((ClientData)tp2, resDevStack); STACKPUSH((ClientData)tp2, resDevStack);
@ -472,7 +472,7 @@ ResAddPlumbing(tile, arg)
for (tp2 = LB(tp1); LEFT(tp2) < RIGHT(tp1); tp2 = TR(tp2)) for (tp2 = LB(tp1); LEFT(tp2) < RIGHT(tp1); tp2 = TR(tp2))
{ {
if ((TiGetTopType(tp2) == t1) && if ((TiGetTopType(tp2) == t1) &&
(tp2->ti_client == (ClientData) CLIENTDEFAULT)) (TiGetClient(tp2) == CLIENTDEFAULT))
{ {
Junk = resAddField(tp2); Junk = resAddField(tp2);
STACKPUSH((ClientData)tp2, resDevStack); STACKPUSH((ClientData)tp2, resDevStack);
@ -502,7 +502,7 @@ ResAddPlumbing(tile, arg)
for (tp2 = TR(tp1); TOP(tp2) > BOTTOM(tp1); tp2 = LB(tp2)) for (tp2 = TR(tp1); TOP(tp2) > BOTTOM(tp1); tp2 = LB(tp2))
{ {
if ((TiGetLeftType(tp2) == t1) && if ((TiGetLeftType(tp2) == t1) &&
(tp2->ti_client == (ClientData) CLIENTDEFAULT)) (TiGetClient(tp2) == CLIENTDEFAULT))
{ {
Junk = resAddField(tp2); Junk = resAddField(tp2);
STACKPUSH((ClientData)tp2, resDevStack); STACKPUSH((ClientData)tp2, resDevStack);
@ -532,7 +532,7 @@ ResAddPlumbing(tile, arg)
for (tp2 = BL(tp1); BOTTOM(tp2) < TOP(tp1); tp2 = RT(tp2)) for (tp2 = BL(tp1); BOTTOM(tp2) < TOP(tp1); tp2 = RT(tp2))
{ {
if ((TiGetRightType(tp2) == t1) && if ((TiGetRightType(tp2) == t1) &&
(tp2->ti_client == (ClientData) CLIENTDEFAULT)) (TiGetClient(tp2) == CLIENTDEFAULT))
{ {
Junk = resAddField(tp2); Junk = resAddField(tp2);
STACKPUSH((ClientData)tp2, resDevStack); STACKPUSH((ClientData)tp2, resDevStack);
@ -564,7 +564,7 @@ ResAddPlumbing(tile, arg)
if (source != (Tile *) NULL) if (source != (Tile *) NULL)
{ {
tileJunk *j = (tileJunk *) source->ti_client; tileJunk *j = (tileJunk *) TiGetClientPTR(source);
STACKPUSH((ClientData)source, resDevStack); STACKPUSH((ClientData)source, resDevStack);
j->tj_status &= ~RES_TILE_SD; j->tj_status &= ~RES_TILE_SD;
@ -583,7 +583,7 @@ ResAddPlumbing(tile, arg)
/* top */ /* top */
for (tp2 = RT(tp1); RIGHT(tp2) > LEFT(tp1); tp2 = BL(tp2)) for (tp2 = RT(tp1); RIGHT(tp2) > LEFT(tp1); tp2 = BL(tp2))
{ {
tileJunk *j2 = (tileJunk *) tp2->ti_client; tileJunk *j2 = (tileJunk *) TiGetClientPTR(tp2);
if (TiGetBottomType(tp2) == t1) if (TiGetBottomType(tp2) == t1)
{ {
if (j2->tj_status & RES_TILE_SD) if (j2->tj_status & RES_TILE_SD)
@ -596,7 +596,7 @@ ResAddPlumbing(tile, arg)
/* bottom */ /* bottom */
for(tp2 = LB(tp1); LEFT(tp2) < RIGHT(tp1); tp2 = TR(tp2)) for(tp2 = LB(tp1); LEFT(tp2) < RIGHT(tp1); tp2 = TR(tp2))
{ {
tileJunk *j2 = (tileJunk *) tp2->ti_client; tileJunk *j2 = (tileJunk *) TiGetClientPTR(tp2);
if (TiGetTopType(tp2) == t1) if (TiGetTopType(tp2) == t1)
{ {
if (j2->tj_status & RES_TILE_SD) if (j2->tj_status & RES_TILE_SD)
@ -609,7 +609,7 @@ ResAddPlumbing(tile, arg)
/* right */ /* right */
for (tp2 = TR(tp1); TOP(tp2) > BOTTOM(tp1); tp2 = LB(tp2)) for (tp2 = TR(tp1); TOP(tp2) > BOTTOM(tp1); tp2 = LB(tp2))
{ {
tileJunk *j2 = (tileJunk *) tp2->ti_client; tileJunk *j2 = (tileJunk *) TiGetClientPTR(tp2);
if (TiGetLeftType(tp2) == t1) if (TiGetLeftType(tp2) == t1)
{ {
if (j2->tj_status & RES_TILE_SD) if (j2->tj_status & RES_TILE_SD)
@ -622,7 +622,7 @@ ResAddPlumbing(tile, arg)
/* left */ /* left */
for (tp2 = BL(tp1); BOTTOM(tp2) < TOP(tp1); tp2 = RT(tp2)) for (tp2 = BL(tp1); BOTTOM(tp2) < TOP(tp1); tp2 = RT(tp2))
{ {
tileJunk *j2 = (tileJunk *) tp2->ti_client; tileJunk *j2 = (tileJunk *) TiGetClientPTR(tp2);
if (TiGetRightType(tp2) == t1) if (TiGetRightType(tp2) == t1)
{ {
if (j2->tj_status & RES_TILE_SD) if (j2->tj_status & RES_TILE_SD)
@ -657,10 +657,10 @@ ResRemovePlumbing(tile, arg)
{ {
if (tile->ti_client != (ClientData) CLIENTDEFAULT) if (TiGetClient(tile) != CLIENTDEFAULT)
{ {
freeMagic(((char *)(tile->ti_client))); freeMagic((char *)TiGetClientPTR(tile));
tile->ti_client = (ClientData) CLIENTDEFAULT; TiSetClient(tile, CLIENTDEFAULT);
} }
return(0); return(0);
} }
@ -725,7 +725,7 @@ ResPreProcessDevices(TileList, DeviceList, Def)
GOTOPOINT(tile, &(TileList->area.r_ll)); GOTOPOINT(tile, &(TileList->area.r_ll));
tt = TiGetType(tile); tt = TiGetType(tile);
tstruct = (tileJunk *) tile->ti_client; tstruct = (tileJunk *) TiGetClientPTR(tile);
if ((tstruct == (tileJunk *)CLIENTDEFAULT) || if ((tstruct == (tileJunk *)CLIENTDEFAULT) ||
(tstruct->deviceList == NULL) || (tstruct->deviceList == NULL) ||
@ -846,11 +846,11 @@ resAddField(tile)
Tile *tile; Tile *tile;
{ {
tileJunk *Junk; tileJunk *Junk;
if ((Junk = (tileJunk *)tile->ti_client) == (tileJunk *) CLIENTDEFAULT) if ((Junk = (tileJunk *)TiGetClientPTR(tile)) == (tileJunk *) CLIENTDEFAULT)
{ {
Junk = (tileJunk *) mallocMagic((unsigned) (sizeof(tileJunk))); Junk = (tileJunk *) mallocMagic((unsigned) (sizeof(tileJunk)));
ResJunkInit(Junk); ResJunkInit(Junk);
tile->ti_client = (ClientData) Junk; TiSetClientPTR(tile, Junk);
} }
return Junk; return Junk;
} }

View File

@ -171,7 +171,7 @@ rtrPinArrayInit(ch, side, pins, nPins)
if (side == GEO_WEST) p.p_x--; if (side == GEO_WEST) p.p_x--;
if (side == GEO_SOUTH) p.p_y--; if (side == GEO_SOUTH) p.p_y--;
tp = TiSrPointNoHint(RtrChannelPlane, &p); tp = TiSrPointNoHint(RtrChannelPlane, &p);
if ((adjacent = (GCRChannel *) tp->ti_client)) if ((adjacent = (GCRChannel *) TiGetClientPTR(tp)))
{ {
/* Only link if entering the linked channel from a legal side */ /* Only link if entering the linked channel from a legal side */
linked = RtrPointToPin(adjacent, otherSide, &point); linked = RtrPointToPin(adjacent, otherSide, &point);

View File

@ -289,7 +289,7 @@ rtrSideInitClient(tile, client)
Tile *tile; Tile *tile;
ClientData client; ClientData client;
{ {
tile->ti_client = client; TiSetClient(tile, client);
return (0); return (0);
} }
@ -323,7 +323,7 @@ rtrEnumSidesFunc(tile)
Side side; Side side;
/* Skip if already processed, out of the area, or not a cell tile */ /* Skip if already processed, out of the area, or not a cell tile */
yprev = (int) CD2INT(tile->ti_client); yprev = (int) TiGetClientINT(tile);
ybot = MAX(BOTTOM(tile), rtrSideArea.r_ybot); ybot = MAX(BOTTOM(tile), rtrSideArea.r_ybot);
if (yprev <= ybot || tile->ti_body == (ClientData) NULL if (yprev <= ybot || tile->ti_body == (ClientData) NULL
|| RIGHT(tile) >= rtrSideArea.r_xtop) || RIGHT(tile) >= rtrSideArea.r_xtop)
@ -392,7 +392,7 @@ rtrEnumSidesFunc(tile)
if (LEFT(tp) != RIGHT(tile) || TOP(tp) <= ybot) if (LEFT(tp) != RIGHT(tile) || TOP(tp) <= ybot)
{ {
/* Processed this tile completely */ /* Processed this tile completely */
tile->ti_client = INT2CD(ybot); TiSetClientINT(tile, ybot);
return (0); return (0);
} }
} }
@ -441,7 +441,7 @@ rtrEnumSidesFunc(tile)
else else
{ {
side.side_line.r_ytop = MIN(TOP(tp), ytop); side.side_line.r_ytop = MIN(TOP(tp), ytop);
tp->ti_client = INT2CD(ybot); TiSetClientINT(tp, ybot);
} }
} }
} }

View File

@ -562,7 +562,7 @@ rtrStemTryPin(loc, dir, p, use)
tp = TiSrPointNoHint(RtrChannelPlane, &pSearch); tp = TiSrPointNoHint(RtrChannelPlane, &pSearch);
if (TiGetType(tp) != TT_SPACE) if (TiGetType(tp) != TT_SPACE)
return ((GCRPin *) NULL); return ((GCRPin *) NULL);
ch = (GCRChannel *) tp->ti_client; ch = (GCRChannel *) TiGetClientPTR(tp);
if (ch == (GCRChannel *) NULL || ch->gcr_type != CHAN_NORMAL) if (ch == (GCRChannel *) NULL || ch->gcr_type != CHAN_NORMAL)
return ((GCRPin *) NULL); return ((GCRPin *) NULL);
@ -949,7 +949,7 @@ rtrStemSearch(center, dir, point)
tile = TiSrPointNoHint(RtrChannelPlane, point); tile = TiSrPointNoHint(RtrChannelPlane, point);
if (TiGetType(tile) == TT_SPACE) if (TiGetType(tile) == TT_SPACE)
{ {
if ((ch = (GCRChannel *) tile->ti_client)) if ((ch = (GCRChannel *) TiGetClientPTR(tile)))
break; break;
return ((GCRChannel *) NULL); return ((GCRChannel *) NULL);
} }

View File

@ -268,13 +268,13 @@ rtrSrTraverseFunc(tile, ts)
if (csa->csa_clear) if (csa->csa_clear)
{ {
if (tile->ti_client == (ClientData) CLIENTDEFAULT) return 0; if (TiGetClient(tile) == CLIENTDEFAULT) return 0;
tile->ti_client = (ClientData) CLIENTDEFAULT; TiSetClient(tile, CLIENTDEFAULT);
} }
else else
{ {
if (tile->ti_client != (ClientData) CLIENTDEFAULT) return 0; if (TiGetClient(tile) != CLIENTDEFAULT) return 0;
tile->ti_client = (ClientData) 1; TiSetClientINT(tile, 1);
} }
/* Call the client function, if there is one. */ /* Call the client function, if there is one. */
@ -300,9 +300,9 @@ rtrSrTraverseFunc(tile, ts)
{ {
if (csa->csa_clear) if (csa->csa_clear)
{ {
if (t2->ti_client == (ClientData) CLIENTDEFAULT) continue; if (TiGetClient(t2) == CLIENTDEFAULT) continue;
} }
else if (t2->ti_client != (ClientData) CLIENTDEFAULT) continue; else if (TiGetClient(t2) != CLIENTDEFAULT) continue;
if (rtrSrTraverseFunc(t2, &nts) != 0) return 1; if (rtrSrTraverseFunc(t2, &nts) != 0) return 1;
} }
} }
@ -315,9 +315,9 @@ rtrSrTraverseFunc(tile, ts)
{ {
if (csa->csa_clear) if (csa->csa_clear)
{ {
if (t2->ti_client == (ClientData) CLIENTDEFAULT) continue; if (TiGetClient(t2) == CLIENTDEFAULT) continue;
} }
else if (t2->ti_client != (ClientData) CLIENTDEFAULT) continue; else if (TiGetClient(t2) != CLIENTDEFAULT) continue;
if (rtrSrTraverseFunc(t2, &nts) != 0) return 1; if (rtrSrTraverseFunc(t2, &nts) != 0) return 1;
} }
} }
@ -330,9 +330,9 @@ rtrSrTraverseFunc(tile, ts)
{ {
if (csa->csa_clear) if (csa->csa_clear)
{ {
if (t2->ti_client == (ClientData) CLIENTDEFAULT) goto nextRight; if (TiGetClient(t2) == CLIENTDEFAULT) goto nextRight;
} }
else if (t2->ti_client != (ClientData) CLIENTDEFAULT) goto nextRight; else if (TiGetClient(t2) != CLIENTDEFAULT) goto nextRight;
if (rtrSrTraverseFunc(t2, &nts) != 0) return 1; if (rtrSrTraverseFunc(t2, &nts) != 0) return 1;
} }
nextRight: if (BOTTOM(t2) <= tileArea.r_ybot) break; nextRight: if (BOTTOM(t2) <= tileArea.r_ybot) break;
@ -346,9 +346,9 @@ rtrSrTraverseFunc(tile, ts)
{ {
if (csa->csa_clear) if (csa->csa_clear)
{ {
if (t2->ti_client == (ClientData) CLIENTDEFAULT) goto nextTop; if (TiGetClient(t2) == CLIENTDEFAULT) goto nextTop;
} }
else if (t2->ti_client != (ClientData) CLIENTDEFAULT) goto nextTop; else if (TiGetClient(t2) != CLIENTDEFAULT) goto nextTop;
if (rtrSrTraverseFunc(t2, &nts) != 0) return 1; if (rtrSrTraverseFunc(t2, &nts) != 0) return 1;
} }
nextTop: if (LEFT(t2) <= tileArea.r_xbot) break; nextTop: if (LEFT(t2) <= tileArea.r_xbot) break;

View File

@ -413,9 +413,9 @@ selShortTileProc(tile, ssd)
Tile *tile; Tile *tile;
ShortSearchData *ssd; ShortSearchData *ssd;
{ {
if ((int)CD2INT(tile->ti_client) < ssd->cost) if ((int)TiGetClientINT(tile) < ssd->cost)
{ {
ssd->cost = (int)CD2INT(tile->ti_client); ssd->cost = (int)TiGetClientINT(tile);
ssd->tile = tile; ssd->tile = tile;
} }
return 0; return 0;
@ -457,7 +457,7 @@ selShortFindReverse(rlist, tile, pnum, fdir)
TileType ttype; TileType ttype;
mindir = fdir; mindir = fdir;
mincost = (int)CD2INT(tile->ti_client); mincost = (int)TiGetClientINT(tile);
while (TRUE) while (TRUE)
{ {
@ -504,7 +504,7 @@ selShortFindReverse(rlist, tile, pnum, fdir)
newrrec->r_next = *rlist; newrrec->r_next = *rlist;
*rlist = newrrec; *rlist = newrrec;
if ((int)CD2INT(tile->ti_client) == 0) return 0; /* We're done */ if ((int)TiGetClientINT(tile) == 0) return 0; /* We're done */
minp = pnum; minp = pnum;
@ -518,10 +518,10 @@ selShortFindReverse(rlist, tile, pnum, fdir)
for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp)) for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp))
{ {
if (tp->ti_client == (ClientData)CLIENTDEFAULT) continue; if (TiGetClient(tp) == CLIENTDEFAULT) continue;
if ((int)CD2INT(tp->ti_client) < mincost) if ((int)TiGetClientINT(tp) < mincost)
{ {
mincost = (int)CD2INT(tp->ti_client); mincost = (int)TiGetClientINT(tp);
mintp = tp; mintp = tp;
mindir = GEO_NORTH; mindir = GEO_NORTH;
} }
@ -538,10 +538,10 @@ leftside:
for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp)) for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp))
{ {
if (tp->ti_client == (ClientData)CLIENTDEFAULT) continue; if (TiGetClient(tp) == CLIENTDEFAULT) continue;
if ((int)CD2INT(tp->ti_client) < mincost) if ((int)TiGetClientINT(tp) < mincost)
{ {
mincost = (int)CD2INT(tp->ti_client); mincost = (int)TiGetClientINT(tp);
mintp = tp; mintp = tp;
mindir = GEO_WEST; mindir = GEO_WEST;
} }
@ -558,10 +558,10 @@ bottomside:
for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp)) for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp))
{ {
if (tp->ti_client == (ClientData)CLIENTDEFAULT) continue; if (TiGetClient(tp) == CLIENTDEFAULT) continue;
if ((int)CD2INT(tp->ti_client) < mincost) if ((int)TiGetClientINT(tp) < mincost)
{ {
mincost = (int)CD2INT(tp->ti_client); mincost = (int)TiGetClientINT(tp);
mintp = tp; mintp = tp;
mindir = GEO_SOUTH; mindir = GEO_SOUTH;
} }
@ -578,10 +578,10 @@ rightside:
for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp)) for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp))
{ {
if (tp->ti_client == (ClientData)CLIENTDEFAULT) continue; if (TiGetClient(tp) == CLIENTDEFAULT) continue;
if ((int)CD2INT(tp->ti_client) < mincost) if ((int)TiGetClientINT(tp) < mincost)
{ {
mincost = (int)CD2INT(tp->ti_client); mincost = (int)TiGetClientINT(tp);
mintp = tp; mintp = tp;
mindir = GEO_EAST; mindir = GEO_EAST;
} }
@ -620,7 +620,7 @@ donesides:
if (mincost == INT_MAX) return 1; if (mincost == INT_MAX) return 1;
/* Failsafe: Avoid infinite recursion */ /* Failsafe: Avoid infinite recursion */
if ((tile == mintp) || (tile->ti_client == CLIENTDEFAULT)) if ((tile == mintp) || (TiGetClient(tile) == CLIENTDEFAULT))
{ {
TxError("Failed to trace back shorting path.\n"); TxError("Failed to trace back shorting path.\n");
break; break;
@ -712,7 +712,7 @@ selShortProcessTile(tile, cost, fdir, mask)
/* algorithm to find any valid path but not the best path. That */ /* algorithm to find any valid path but not the best path. That */
/* choice keeps the algorithm fast and efficient. */ /* choice keeps the algorithm fast and efficient. */
if (tile->ti_client != (ClientData)CLIENTDEFAULT) return 1; if (TiGetClient(tile) != CLIENTDEFAULT) return 1;
if (IsSplit(tile)) if (IsSplit(tile))
{ {
@ -748,10 +748,10 @@ selShortProcessTile(tile, cost, fdir, mask)
/* If this tile is unvisited, or has a lower cost, then return and */ /* If this tile is unvisited, or has a lower cost, then return and */
/* keep going. Otherwise, return 1 to stop the search this direction */ /* keep going. Otherwise, return 1 to stop the search this direction */
if (tile->ti_client == (ClientData)CLIENTDEFAULT) if (TiGetClient(tile) == CLIENTDEFAULT)
TiSetClient(tile, cost); TiSetClientINT(tile, cost);
else if ((int)CD2INT(tile->ti_client) > cost) else if ((int)TiGetClientINT(tile) > cost)
TiSetClient(tile, cost); TiSetClientINT(tile, cost);
else else
return 1; return 1;
@ -795,7 +795,7 @@ selShortFindForward(srctile, srctype, srcpnum, desttile)
ShortStack = StackNew(64); ShortStack = StackNew(64);
/* Set the cost of the source tile to zero */ /* Set the cost of the source tile to zero */
TiSetClient(srctile, (ClientData)0); TiSetClientINT(srctile, 0);
/* Drop the first entry on the stack */ /* Drop the first entry on the stack */
sd = NewSD(cost, srctile, srctype, srcpnum); sd = NewSD(cost, srctile, srctype, srcpnum);
@ -1009,7 +1009,7 @@ SelectShort(char *lab1, char *lab2)
selShortFindForward(srctile, srctype, srcpnum, desttile/*, desttype*/); selShortFindForward(srctile, srctype, srcpnum, desttile/*, desttype*/);
/* Now see if destination has been counted */ /* Now see if destination has been counted */
if (desttile->ti_client == (ClientData)CLIENTDEFAULT) return NULL; if (TiGetClient(desttile) == CLIENTDEFAULT) return NULL;
/* Now find the shortest path between source and destination */ /* Now find the shortest path between source and destination */
rlist = NULL; rlist = NULL;

View File

@ -372,7 +372,7 @@ int SimTransTerms( bp, trans )
TransTerm *term; TransTerm *term;
Tile *tile = bp->b_outside; Tile *tile = bp->b_outside;
TileType type; TileType type;
NodeRegion *reg = (NodeRegion *) tile->ti_client; NodeRegion *reg = (NodeRegion *) TiGetClientPTR(tile);
int pNum; int pNum;
int i; int i;
@ -590,7 +590,7 @@ SimFindOneNode( sx, tile )
transistor.t_pnum = DBNumPlanes; transistor.t_pnum = DBNumPlanes;
transistor.t_do_terms = FALSE; transistor.t_do_terms = FALSE;
gateTile->ti_client = (ClientData) extUnInit; TiSetClient(gateTile, extUnInit);
arg.fra_connectsTo = &SimTransMask; arg.fra_connectsTo = &SimTransMask;
if (IsSplit(tile)) if (IsSplit(tile))
@ -639,7 +639,7 @@ SimFindOneNode( sx, tile )
loctype = TiGetTypeExact(sdTile); loctype = TiGetTypeExact(sdTile);
arg.fra_pNum = DBPlane(loctype); arg.fra_pNum = DBPlane(loctype);
arg.fra_uninit = (ClientData) sdTile->ti_client; arg.fra_uninit = TiGetClient(sdTile);
arg.fra_region = (ExtRegion *) &ret; arg.fra_region = (ExtRegion *) &ret;
arg.fra_each = SimTransistorTile; arg.fra_each = SimTransistorTile;
(void) ExtFindNeighbors( sdTile, arg.fra_pNum, &arg ); (void) ExtFindNeighbors( sdTile, arg.fra_pNum, &arg );
@ -718,7 +718,7 @@ SimGetNodeName(sx, tp, path)
/* check to see if this tile has been extracted before */ /* check to see if this tile has been extracted before */
if (tp->ti_client == extUnInit) if (TiGetClient(tp) == extUnInit)
{ {
NodeSpec *ns; NodeSpec *ns;
@ -732,7 +732,7 @@ SimGetNodeName(sx, tp, path)
} }
else else
{ {
nodeList = (NodeRegion *)(tp->ti_client); nodeList = (NodeRegion *)TiGetClientPTR(tp);
} }
/* generate the node name from the label region and the path name */ /* generate the node name from the label region and the path name */

View File

@ -335,7 +335,7 @@ SimSelectFunc(tile, pHead)
/* check to see if the node has already been extracted */ /* check to see if the node has already been extracted */
if (tile->ti_client == (ClientData) 1) { if (TiGetClientINT(tile) == 1) {
return(0); return(0);
} }

View File

@ -241,7 +241,11 @@ extern Tile *TiSrPoint(Tile *, Plane *, Point *);
/* See diagnostic subroutine version in tile.c */ /* See diagnostic subroutine version in tile.c */
#define TiSetBody(tp, b) ((tp)->ti_body = INT2CD((b))) #define TiSetBody(tp, b) ((tp)->ti_body = INT2CD((b)))
#define TiGetClient(tp) ((tp)->ti_client) #define TiGetClient(tp) ((tp)->ti_client)
#define TiSetClient(tp,b) ((tp)->ti_client = INT2CD((b))) #define TiGetClientINT(tp) (CD2INT((tp)->ti_client))
#define TiGetClientPTR(tp) (CD2PTR((tp)->ti_client))
#define TiSetClient(tp,cd) ((tp)->ti_client = (cd))
#define TiSetClientINT(tp,cd) ((tp)->ti_client = INT2CD((cd)))
#define TiSetClientPTR(tp,cd) ((tp)->ti_client = PTR2CD((cd)))
Tile *TiAlloc(void); Tile *TiAlloc(void);
void TiFree(Tile *); void TiFree(Tile *);

View File

@ -47,7 +47,7 @@ genCanonicalMaxwidth(bbox, starttile, plane, mask)
mrd->listdepth = 8; mrd->listdepth = 8;
} }
if (mask == NULL) if (mask == NULL)
mrd->match = starttile->ti_client; mrd->match = TiGetClient(starttile);
else else
mrd->match = CLIENTDEFAULT; mrd->match = CLIENTDEFAULT;
@ -104,7 +104,7 @@ FindMaxRects(tile, mrd)
int s, entries; int s, entries;
if (mrd->match != CLIENTDEFAULT) if (mrd->match != CLIENTDEFAULT)
if (tile->ti_client == mrd->match) if (TiGetClient(tile) == mrd->match)
return 0; return 0;
entries = 0; entries = 0;