diff --git a/mzrouter/mzInternal.h b/mzrouter/mzInternal.h index 34725686..514282ea 100644 --- a/mzrouter/mzInternal.h +++ b/mzrouter/mzInternal.h @@ -39,6 +39,10 @@ * the head of that function. */ +#ifndef _MAGIC_H +#include "utils/magic.h" +#endif + #ifndef _MZROUTER_H #include "mzrouter/mzrouter.h" #endif @@ -86,8 +90,8 @@ extern ClientData mzDebugID; * electrically connected to specified start or dest regions. */ #define DEF_EXPAND_ENDPOINTS 1 -#define MZ_EXPAND_START 1 /* ClientData type for start tiles */ -#define MZ_EXPAND_DEST 0 /* ClientData type for dest tiles */ +#define MZ_EXPAND_START INT2CD(1) /* ClientData type for start tiles */ +#define MZ_EXPAND_DEST INT2CD(0) /* ClientData type for dest tiles */ #define MZ_EXPAND_NONE CLIENTDEFAULT /* Normal ClientData type */ /* If set only hints in toplevel cell are recognized - speeds up processing diff --git a/plow/plowInt.h b/plow/plowInt.h index 8aea6130..ee8eeb98 100644 --- a/plow/plowInt.h +++ b/plow/plowInt.h @@ -161,11 +161,11 @@ typedef struct * of the tile to its right. */ #define TRAIL_UNINIT CLIENTDEFAULT -#define TRAILING(tp) (((tp)->ti_client == (ClientData)TRAIL_UNINIT) \ - ? LEFT(tp) : ((int)(tp)->ti_client)) +#define TRAILING(tp) (((tp)->ti_client == INT2CD(TRAIL_UNINIT)) \ + ? LEFT(tp) : ((int)CD2INT((tp)->ti_client))) #define LEADING(tp) TRAILING(TR(tp)) -#define plowSetTrailing(tp, n) ((tp)->ti_client = (ClientData) (n)) +#define plowSetTrailing(tp, n) ((tp)->ti_client = INT2CD((n))) /* ------------------ Design rules used by plowing -------------------- */ diff --git a/router/rtrDcmpose.h b/router/rtrDcmpose.h index 24d115e0..40cda9ae 100644 --- a/router/rtrDcmpose.h +++ b/router/rtrDcmpose.h @@ -49,19 +49,19 @@ /* rtrMARKED(t,s) Tile * t; int s; * Return 1 if the indicated horizontal boundary of a tile is marked. */ -#define rtrMARKED(t,s) (((int) (t)->ti_client) & (s)) +#define rtrMARKED(t,s) (((int) CD2INT((t)->ti_client)) & (s)) /* rtrMARK(t,s) Tile * t; int s; * Mark the indicated horizontal tile edge as a valid channel boundary. */ #define rtrMARK(t,s) \ - ((t)->ti_client = (ClientData) (((int) (t)->ti_client)&(s))) + ((t)->ti_client = INT2CD((((int) CD2INT((t)->ti_client))&(s)))) /* rtrCLEAR(t,s) Tile * t; int s; * Clear the indicated horizontal tile edge as a valid channel boundary. */ #define rtrCLEAR(t,s) \ - ((t)->ti_client = (ClientData) (((int) (t)->ti_client)&(!s))) + ((t)->ti_client = INT2CD((((int) CD2INT((t)->ti_client))&(!s)))) /* Private Procedures */ int rtrSrPaint(); diff --git a/tiles/tile.h b/tiles/tile.h index 59c357d1..8e50ceeb 100644 --- a/tiles/tile.h +++ b/tiles/tile.h @@ -163,7 +163,7 @@ typedef struct /* depending on whether it is cast into a 32 or a 64 bit word. */ #define CLIENTMAX (((pointertype)1 << (8 * sizeof(pointertype) - 2)) - 4) -#define CLIENTDEFAULT (-CLIENTMAX) +#define CLIENTDEFAULT INT2CD(-CLIENTMAX) /* ------------------------ Flags, etc -------------------------------- */ @@ -239,9 +239,9 @@ extern Tile *TiSrPoint(Tile *, Plane *, Point *); #define TiGetBody(tp) ((tp)->ti_body) /* See diagnostic subroutine version in tile.c */ -#define TiSetBody(tp, b) ((tp)->ti_body = (ClientData)(pointertype) (b)) +#define TiSetBody(tp, b) ((tp)->ti_body = INT2CD((b))) #define TiGetClient(tp) ((tp)->ti_client) -#define TiSetClient(tp,b) ((tp)->ti_client = (ClientData)(pointertype) (b)) +#define TiSetClient(tp,b) ((tp)->ti_client = INT2CD((b))) Tile *TiAlloc(void); void TiFree(Tile *);