diff --git a/calma/CalmaWrite.c b/calma/CalmaWrite.c index 24c3ad64..c7920acf 100644 --- a/calma/CalmaWrite.c +++ b/calma/CalmaWrite.c @@ -867,15 +867,15 @@ calmaProcessDef( HashEntry *he; /* Skip if already output */ - if ((int) def->cd_client > 0) + if ((int) CD2INT(def->cd_client) > 0) return (0); /* Assign it a (negative) number if it doesn't have one yet */ - if ((int) def->cd_client == 0) - def->cd_client = (ClientData) calmaCellNum--; + if ((int) CD2INT(def->cd_client) == 0) + def->cd_client = INT2CD(calmaCellNum--); /* Mark this cell */ - def->cd_client = (ClientData) (- (int) def->cd_client); + def->cd_client = INT2CD(- (int) CD2INT(def->cd_client)); /* Read the cell in if it is not already available. */ if ((def->cd_flags & CDAVAILABLE) == 0) @@ -1769,7 +1769,7 @@ calmaOutStructName( { /* Bad name: use XXXXXcalmaNum */ bad: - calmanum = (int) def->cd_client; + calmanum = (int) CD2INT(def->cd_client); if (calmanum < 0) calmanum = -calmanum; defname = (char *)mallocMagic(32); (void) sprintf(defname, "XXXXX%d", calmanum); diff --git a/calma/CalmaWriteZ.c b/calma/CalmaWriteZ.c index b60f0b6d..261b3bc5 100644 --- a/calma/CalmaWriteZ.c +++ b/calma/CalmaWriteZ.c @@ -821,15 +821,15 @@ calmaProcessDefZ( HashEntry *he; /* Skip if already output */ - if ((int) def->cd_client > 0) + if ((int) CD2INT(def->cd_client) > 0) return (0); /* Assign it a (negative) number if it doesn't have one yet */ - if ((int) def->cd_client == 0) - def->cd_client = (ClientData) calmaCellNum--; + if ((int) CD2INT(def->cd_client) == 0) + def->cd_client = INT2CD(calmaCellNum--); /* Mark this cell */ - def->cd_client = (ClientData) (- (int) def->cd_client); + def->cd_client = INT2CD(- (int) CD2INT(def->cd_client)); /* Read the cell in if it is not already available. */ if ((def->cd_flags & CDAVAILABLE) == 0) @@ -1610,7 +1610,7 @@ calmaOutStructNameZ( { /* Bad name: use XXXXXcalmaNum */ bad: - calmanum = (int) def->cd_client; + calmanum = (int) CD2INT(def->cd_client); if (calmanum < 0) calmanum = -calmanum; defname = (char *)mallocMagic(32); (void) sprintf(defname, "XXXXX%d", calmanum); diff --git a/cif/CIFgen.c b/cif/CIFgen.c index b976ec73..2b45b146 100644 --- a/cif/CIFgen.c +++ b/cif/CIFgen.c @@ -5064,7 +5064,7 @@ CIFGenLayer( if (CIFErrorDef == NULL) break; /* co_client contains the flag (1) for top-level only */ - if ((int)op->co_client == 1) + if ((int)CD2INT(op->co_client) == 1) { /* Only generate output for the top-level cell */ int found = 0; diff --git a/cif/CIFrdcl.c b/cif/CIFrdcl.c index 0f60f510..683d13fc 100644 --- a/cif/CIFrdcl.c +++ b/cif/CIFrdcl.c @@ -697,7 +697,7 @@ CIFPaintCurrent( &DBAllButSpaceBits, cifCheckPaintFunc, (ClientData)NULL) == 1)) DBSrPaintArea((Tile *) NULL, plane, &TiPlaneRect, - &CIFSolidBits, cifMakeBoundaryFunc, (ClientData)filetype); + &CIFSolidBits, cifMakeBoundaryFunc, INT2CD(filetype)); } /* Swap planes */ @@ -709,7 +709,7 @@ CIFPaintCurrent( { DBSrPaintArea((Tile *) NULL, plane, &TiPlaneRect, &CIFSolidBits, cifPaintCurrentFunc, - (ClientData)type); + INT2CD(type)); } /* Recycle the plane, which was dynamically allocated. */ diff --git a/cif/CIFwrite.c b/cif/CIFwrite.c index 51c1f29f..6d0a29df 100644 --- a/cif/CIFwrite.c +++ b/cif/CIFwrite.c @@ -167,8 +167,8 @@ CIFWrite( cifOutPreamble(f, rootDef); cifOut(f); StackFree(cifStack); - if ((int) rootDef->cd_client < 0) - rootDef->cd_client = (ClientData) (- (int) rootDef->cd_client); + if ((int) CD2INT(rootDef->cd_client) < 0) + rootDef->cd_client = INT2CD(- (int) CD2INT(rootDef->cd_client)); /* See if any problems occurred. */ @@ -182,7 +182,7 @@ CIFWrite( * Now we are almost done. * Just output a call on the root cell */ - fprintf(f, "C %d;\nEnd\n", (int) rootDef->cd_client); + fprintf(f, "C %d;\nEnd\n", (int) CD2INT(rootDef->cd_client)); good = !ferror(f); return (good); } @@ -233,7 +233,7 @@ cifWriteMarkFunc( CellUse *use) { if (use->cu_def->cd_client != (ClientData) 0) return 0; - use->cu_def->cd_client = (ClientData) cifCellNum; + use->cu_def->cd_client = INT2CD(cifCellNum); cifCellNum -= 1; StackPush((ClientData) use->cu_def, cifStack); return (0); @@ -313,10 +313,10 @@ cifOut( while (!StackEmpty(cifStack)) { def = (CellDef *) StackPop(cifStack); - if ((int) def->cd_client >= 0) continue; /* Already output */ + if ((int) CD2INT(def->cd_client) >= 0) continue; /* Already output */ if (SigInterruptPending) continue; - def->cd_client = (ClientData) (- (int) def->cd_client); + def->cd_client = INT2CD(- (int) CD2INT(def->cd_client)); /* Read the cell in if it is not already available. */ if ((def->cd_flags & CDAVAILABLE) == 0) @@ -362,7 +362,7 @@ cifOutFunc( int type; CIFLayer *layer; - fprintf(f, "DS %d %d %d;\n", (int) def->cd_client, + fprintf(f, "DS %d %d %d;\n", (int) CD2INT(def->cd_client), CIFCurStyle->cs_reducer, 2 * CIFCurStyle->cs_expander); if (def->cd_name != (char *) NULL) @@ -493,7 +493,7 @@ cifWriteUseFunc( Transform *t; int cifnum; - cifnum = (int) use->cu_def->cd_client; + cifnum = (int) CD2INT(use->cu_def->cd_client); if (cifnum < 0) cifnum = (-cifnum); topx = use->cu_xhi - use->cu_xlo; if (topx < 0) topx = -topx; @@ -773,7 +773,7 @@ CIFWriteFlat( * Just output a call on the root cell */ - fprintf(f, "C %d;\nEnd\n", (int) CIFComponentDef->cd_client); + fprintf(f, "C %d;\nEnd\n", (int) CD2INT(CIFComponentDef->cd_client)); DBCellClearDef(CIFComponentDef); good = !ferror(f); diff --git a/cmwind/CMWundo.c b/cmwind/CMWundo.c index fb6cb9e5..46e11fe7 100644 --- a/cmwind/CMWundo.c +++ b/cmwind/CMWundo.c @@ -212,5 +212,5 @@ cmwUndoDone(void) for (i = 0; i < 256; i++) if (cmwColorsChanged[i]) (void) WindSearch(CMWclientID, (ClientData) NULL, (Rect *) NULL, - cmwRedisplayFunc, (ClientData) i); + cmwRedisplayFunc, INT2CD(i)); } diff --git a/commands/CmdSubrs.c b/commands/CmdSubrs.c index d3a5c7a3..72f9bffc 100644 --- a/commands/CmdSubrs.c +++ b/commands/CmdSubrs.c @@ -1132,7 +1132,7 @@ cmdExpandOneLevel( /* now, unexpand its direct children (ONE LEVEL ONLY) */ if (expand) - (void) DBCellEnum(cu->cu_def, cmdExpand1func, (ClientData) bitmask); + (void) DBCellEnum(cu->cu_def, cmdExpand1func, INT2CD(bitmask)); } int @@ -1140,7 +1140,7 @@ cmdExpand1func( CellUse *cu, ClientData bitmask) { - DBExpand(cu, (int) bitmask, FALSE); + DBExpand(cu, (int)CD2INT(bitmask), FALSE); return 0; } diff --git a/database/DBconnect.c b/database/DBconnect.c index 0859f206..74af4e4f 100644 --- a/database/DBconnect.c +++ b/database/DBconnect.c @@ -483,13 +483,13 @@ dbSrConnectFunc(tile, csa) /* Drop the first entry on the stack */ pNum = csa->csa_pNum; - STACKPUSH((ClientData)tile, dbConnectStack); - STACKPUSH((ClientData)pNum, dbConnectStack); + STACKPUSH(INT2CD(tile), dbConnectStack); + STACKPUSH(INT2CD(pNum), dbConnectStack); while (!StackEmpty(dbConnectStack)) { - pNum = (int)STACKPOP(dbConnectStack); - tile = (Tile *)STACKPOP(dbConnectStack); + pNum = (int)CD2INT(STACKPOP(dbConnectStack)); + tile = (Tile *)CD2INT(STACKPOP(dbConnectStack)); if (result == 1) continue; TiToRect(tile, &tileArea); @@ -565,9 +565,9 @@ dbSrConnectFunc(tile, csa) } else if (t2->ti_client == (ClientData) 1) continue; if (IsSplit(t2)) - TiSetBody(t2, (ClientData)(t2->ti_body | TT_SIDE)); /* bit set */ - STACKPUSH((ClientData)t2, dbConnectStack); - STACKPUSH((ClientData)pNum, dbConnectStack); + TiSetBody(t2, INT2CD(CD2INT(t2->ti_body) | TT_SIDE)); /* bit set */ + STACKPUSH(INT2CD(t2), dbConnectStack); + STACKPUSH(INT2CD(pNum), dbConnectStack); } } @@ -596,13 +596,13 @@ bottomside: { if (SplitDirection(t2)) /* bit set */ - TiSetBody(t2, (ClientData)(t2->ti_body | TT_SIDE)); + TiSetBody(t2, INT2CD(CD2INT(t2->ti_body) | TT_SIDE)); else /* bit clear */ - TiSetBody(t2, (ClientData)(t2->ti_body & ~TT_SIDE)); + TiSetBody(t2, INT2CD(CD2INT(t2->ti_body) & ~TT_SIDE)); } - STACKPUSH((ClientData)t2, dbConnectStack); - STACKPUSH((ClientData)pNum, dbConnectStack); + STACKPUSH(INT2CD(t2), dbConnectStack); + STACKPUSH(INT2CD(pNum), dbConnectStack); } } @@ -627,9 +627,9 @@ rightside: } else if (t2->ti_client == (ClientData) 1) goto nextRight; if (IsSplit(t2)) - TiSetBody(t2, (ClientData)(t2->ti_body & ~TT_SIDE)); /* bit clear */ - STACKPUSH((ClientData)t2, dbConnectStack); - STACKPUSH((ClientData)pNum, dbConnectStack); + TiSetBody(t2, INT2CD(CD2INT(t2->ti_body) & ~TT_SIDE)); /* bit clear */ + STACKPUSH(INT2CD(t2), dbConnectStack); + STACKPUSH(INT2CD(pNum), dbConnectStack); } nextRight: if (BOTTOM(t2) <= tileArea.r_ybot) break; } @@ -658,13 +658,13 @@ topside: { if (SplitDirection(t2)) /* bit clear */ - TiSetBody(t2, (ClientData)(t2->ti_body & ~TT_SIDE)); + TiSetBody(t2, INT2CD(CD2INT(t2->ti_body) & ~TT_SIDE)); else /* bit set */ - TiSetBody(t2, (ClientData)(t2->ti_body | TT_SIDE)); + TiSetBody(t2, INT2CD(CD2INT(t2->ti_body) | TT_SIDE)); } - STACKPUSH((ClientData)t2, dbConnectStack); - STACKPUSH((ClientData)pNum, dbConnectStack); + STACKPUSH(INT2CD(t2), dbConnectStack); + STACKPUSH(INT2CD(pNum), dbConnectStack); } nextTop: if (LEFT(t2) <= tileArea.r_xbot) break; } @@ -692,16 +692,16 @@ donesides: TiGetTypeExact(tile), &newArea, connectMask, dbcFindTileFunc, (ClientData)&t2) != 0) { - STACKPUSH((ClientData)t2, dbConnectStack); - STACKPUSH((ClientData)i, dbConnectStack); + STACKPUSH(INT2CD(t2), dbConnectStack); + STACKPUSH(INT2CD(i), dbConnectStack); } } else if (DBSrPaintArea((Tile *) NULL, csa->csa_def->cd_planes[i], &newArea, connectMask, dbcFindTileFunc, (ClientData)&t2) != 0) { - STACKPUSH((ClientData)t2, dbConnectStack); - STACKPUSH((ClientData)i, dbConnectStack); + STACKPUSH(INT2CD(t2), dbConnectStack); + STACKPUSH(INT2CD(i), dbConnectStack); } } } diff --git a/database/DBtechtype.c b/database/DBtechtype.c index f8509df6..35a13db4 100644 --- a/database/DBtechtype.c +++ b/database/DBtechtype.c @@ -140,7 +140,7 @@ DBTechInitPlane() for (dpp = dbTechDefaultPlanes; dpp->dp_names; dpp++) { - cp = dbTechNameAdd(dpp->dp_names, (ClientData) dpp->dp_plane, + cp = dbTechNameAdd(dpp->dp_names, INT2CD(dpp->dp_plane), &dbPlaneNameLists, FALSE); if (cp == NULL) { @@ -223,7 +223,7 @@ DBTechInitType() */ for (dtp = dbTechDefaultTypes; dtp->dt_names; dtp++) { - cp = dbTechNameAdd(dtp->dt_names, (ClientData) dtp->dt_type, + cp = dbTechNameAdd(dtp->dt_names, INT2CD(dtp->dt_type), &dbTypeNameLists, FALSE); if (cp == NULL) { @@ -283,7 +283,7 @@ DBTechAddPlane(sectionName, argc, argv) return FALSE; } - cp = dbTechNameAdd(argv[0], (ClientData) DBNumPlanes, &dbPlaneNameLists, FALSE); + cp = dbTechNameAdd(argv[0], INT2CD(DBNumPlanes), &dbPlaneNameLists, FALSE); if (cp == NULL) return FALSE; DBPlaneLongNameTbl[DBNumPlanes++] = cp; @@ -315,7 +315,7 @@ DBTechAddNameToType(newname, ttype, canonical) { char *cp; - cp = dbTechNameAdd(newname, (ClientData) ttype, &dbTypeNameLists, TRUE); + cp = dbTechNameAdd(newname, INT2CD(ttype), &dbTypeNameLists, TRUE); if (canonical) DBTypeLongNameTbl[ttype] = cp; } @@ -455,7 +455,7 @@ DBTechAddType(sectionName, argc, argv) } else { - cp = dbTechNameAdd(argv[1], (ClientData) DBNumTypes, &dbTypeNameLists, FALSE); + cp = dbTechNameAdd(argv[1], INT2CD(DBNumTypes), &dbTypeNameLists, FALSE); if (cp == NULL) return FALSE; @@ -513,7 +513,7 @@ dbTechNewStackedType(type1, type2) } sprintf(buf, "%s+%s", DBTypeShortName(type1), DBTypeShortName(type2)); - cp = dbTechNameAdd(buf, (ClientData) DBNumTypes, &dbTypeNameLists, FALSE); + cp = dbTechNameAdd(buf, INT2CD(DBNumTypes), &dbTypeNameLists, FALSE); if (cp == NULL) { TechError("Couldn't generate new stacking type %s\n", buf); diff --git a/database/DBtiles.c b/database/DBtiles.c index cfd8f8aa..e842bb84 100644 --- a/database/DBtiles.c +++ b/database/DBtiles.c @@ -266,12 +266,12 @@ nm_enum: if (!(ignore_sides & IGNORE_LEFT)) { - TiSetBody(tp, (ClientData)(tpt & ~TT_SIDE)); /* bit clear */ + TiSetBody(tp, INT2CD(tpt & ~TT_SIDE)); /* bit clear */ if ((*func)(tp, arg)) return (1); } if (!(ignore_sides & IGNORE_RIGHT)) { - TiSetBody(tp, (ClientData)(tpt | TT_SIDE)); /* bit set */ + TiSetBody(tp, INT2CD(tpt | TT_SIDE)); /* bit set */ if ((*func)(tp, arg)) return (1); } } @@ -416,7 +416,7 @@ enumerate: (dlong)(rect->r_xbot - LEFT(tp)) * theight : DLONG_MIN; if (SplitDirection(tp) ? (f1 > f4) : (f2 > f4)) { - TiSetBody(tp, (ClientData)((TileType)TiGetBody(tp) + TiSetBody(tp, INT2CD((TileType)CD2INT(TiGetBody(tp)) & ~TT_SIDE)); /* bit clear */ if ((*func)(tp, arg)) return (1); } @@ -429,7 +429,7 @@ enumerate: (dlong)(RIGHT(tp) - rect->r_xtop) * theight : DLONG_MIN; if (SplitDirection(tp) ? (f2 > f3) : (f1 > f3)) { - TiSetBody(tp, (ClientData)((TileType)TiGetBody(tp) + TiSetBody(tp, INT2CD((TileType)CD2INT(TiGetBody(tp)) | TT_SIDE)); /* bit set */ if ((*func)(tp, arg)) return (1); } @@ -576,7 +576,7 @@ enumerate: (dlong)(rect->r_xbot - LEFT(tp)) * (dlong)theight : DLONG_MIN; if (SplitDirection(tp) ? (f1 > f4) : (f2 > f4)) { - TiSetBody(tp, (ClientData)((TileType)TiGetBody(tp) + TiSetBody(tp, INT2CD((TileType)CD2INT(TiGetBody(tp)) & ~TT_SIDE)); /* bit clear */ if ((tp->ti_client == client) && (*func)(tp, arg)) return (1); @@ -590,7 +590,7 @@ enumerate: (dlong)(RIGHT(tp) - rect->r_xtop) * (dlong)theight : DLONG_MIN; if (SplitDirection(tp) ? (f2 > f3) : (f1 > f3)) { - TiSetBody(tp, (ClientData)((TileType)TiGetBody(tp) + TiSetBody(tp, INT2CD((TileType)CD2INT(TiGetBody(tp)) | TT_SIDE)); /* bit set */ if ((tp->ti_client == client) && (*func)(tp, arg)) return (1); diff --git a/dbwind/DBWprocs.c b/dbwind/DBWprocs.c index 8f5344a7..97c0094b 100644 --- a/dbwind/DBWprocs.c +++ b/dbwind/DBWprocs.c @@ -549,8 +549,8 @@ DBWloadWindow(window, name, flags) if (expand) DBExpandAll(newEditUse, &(newEditUse->cu_bbox), ((DBWclientRec *)window->w_clientData)->dbw_bitmask, - FALSE, UnexpandFunc, (ClientData) - (((DBWclientRec *)window->w_clientData)->dbw_bitmask)); + FALSE, UnexpandFunc, + INT2CD(((DBWclientRec *)window->w_clientData)->dbw_bitmask)); if (newEdit) { diff --git a/debug/debugFlags.c b/debug/debugFlags.c index 9ae0caa7..175a0322 100644 --- a/debug/debugFlags.c +++ b/debug/debugFlags.c @@ -82,7 +82,7 @@ DebugAddClient(name, maxflags) dc->dc_flags[maxflags].df_value = FALSE; } - return ((ClientData) debugNumClients++); + return (INT2CD(debugNumClients++)); } /* @@ -116,7 +116,7 @@ DebugAddFlag(clientID, name) ClientData clientID; /* Client identifier from DebugAddClient */ char *name; /* Name of debugging flag */ { - int id = (int) clientID; + int id = (int) CD2INT(clientID); struct debugClient *dc; if (id < 0 || id >= debugNumClients) @@ -159,7 +159,7 @@ void DebugShow(clientID) ClientData clientID; { - int id = (int) clientID; + int id = (int) CD2INT(clientID); struct debugClient *dc; int n; @@ -202,7 +202,7 @@ DebugSet(clientID, argc, argv, value) bool value; { bool badFlag = FALSE; - int id = (int) clientID; + int id = (int) CD2INT(clientID); struct debugClient *dc; int n; diff --git a/extflat/EFflat.c b/extflat/EFflat.c index 25502dbe..bb6919f0 100644 --- a/extflat/EFflat.c +++ b/extflat/EFflat.c @@ -146,7 +146,7 @@ EFFlatBuild(name, flags) else { flatnodeflags |= FLATNODE_DOWARN; /* No FLATNODE_STDCELL flag */ - efFlatNodes(&efFlatContext, (ClientData)flatnodeflags); + efFlatNodes(&efFlatContext, INT2CD(flatnodeflags)); } efFlatKills(&efFlatContext); if (!(flags & EF_NONAMEMERGE)) @@ -217,7 +217,7 @@ EFFlatBuildOneLevel(def, flags) /* Record all nodes down the hierarchy from here */ flatnodeflags = 0; /* No FLATNODE_DOWARN */ - efFlatNodes(&efFlatContext, (ClientData)flatnodeflags); + efFlatNodes(&efFlatContext, INT2CD(flatnodeflags)); /* Expand all subcells that contain connectivity information but */ /* no active devices (including those in subcells). */ @@ -319,7 +319,7 @@ efFlatNodes(hc, clientData) HierContext *hc; ClientData clientData; { - int flags = (int)clientData; + int flags = (int)CD2INT(clientData); bool stdcell = (flags & FLATNODE_STDCELL) ? TRUE : FALSE; bool doWarn = (flags & FLATNODE_DOWARN) ? TRUE : FALSE; @@ -616,7 +616,7 @@ efAddConns(hc, doWarn) if (conn->conn_1.cn_nsubs == 0) efAddOneConn(hc, conn->conn_name1, conn->conn_name2, conn, doWarn); else - efHierSrArray(hc, conn, efAddOneConn, (ClientData)doWarn); + efHierSrArray(hc, conn, efAddOneConn, INT2CD(doWarn)); } return (0); diff --git a/grouter/grouteChan.c b/grouter/grouteChan.c index c0f201ec..e2c32cab 100644 --- a/grouter/grouteChan.c +++ b/grouter/grouteChan.c @@ -745,12 +745,12 @@ glChanBlockDens(ch) { /* Clip tiles overlapped by pa->pa_area */ while (DBSrPaintArea((Tile *) NULL, glChanPlane, &pa->pa_area, - &DBAllTypeBits, glChanClipFunc, (ClientData) &pa->pa_area)) + &DBAllTypeBits, glChanClipFunc, PTR2CD(&pa->pa_area))) /* Nothing */; /* Change the type of all tiles within the area */ (void) DBSrPaintArea((Tile *) NULL, glChanPlane, &pa->pa_area, - &DBAllTypeBits, glChanPaintFunc, (ClientData) pa->pa_type); + &DBAllTypeBits, glChanPaintFunc, INT2CD(pa->pa_type)); /* * Allow merging, as long as no tiles get merged across diff --git a/grouter/grouteMain.c b/grouter/grouteMain.c index 1a673a5a..e56082f0 100644 --- a/grouter/grouteMain.c +++ b/grouter/grouteMain.c @@ -134,7 +134,7 @@ GlGlobalRoute(chanList, netList) glPenSetPerChan(net); } numTerms += glMultiSteiner(EditCellUse, net, glProcessLoc, - glCrossMark, (ClientData) doFast, (ClientData) 0); + glCrossMark, INT2CD(doFast), (ClientData) 0); if (DebugIsSet(glDebugID, glDebPen)) glPenClearPerChan(net); RtrMilestonePrint(); diff --git a/mzrouter/mzBlock.c b/mzrouter/mzBlock.c index 7bbf2df2..8501fc1f 100644 --- a/mzrouter/mzBlock.c +++ b/mzrouter/mzBlock.c @@ -285,7 +285,7 @@ mzBlockSubcellsFunc(scx, cdarg) r = scx->scx_use->cu_def->cd_bbox; GEOTRANSRECT(&scx->scx_trans, &r, &rDest); - if((int)(scx->scx_use->cu_client) != MZ_EXPAND_DEST) + if(scx->scx_use->cu_client != MZ_EXPAND_DEST) /* cell over part of dest node, paint normal blocks onto affected * planes. * (area is bloated by appropriate spacing on each affected plane) diff --git a/mzrouter/mzSubrs.c b/mzrouter/mzSubrs.c index c756000c..e2ec6294 100644 --- a/mzrouter/mzSubrs.c +++ b/mzrouter/mzSubrs.c @@ -423,7 +423,7 @@ mzConnectedTileFunc(tile, cxp) * MZAddStart() and MZAddDest(). */ - if ((int)tile->ti_client != mzMakeEndpoints) + if ((int)CD2INT(tile->ti_client) != mzMakeEndpoints) { SearchContext *scx = cxp->tc_scx; List *expandList = (List *) (cxp->tc_filter->tf_arg); @@ -434,12 +434,12 @@ mzConnectedTileFunc(tile, cxp) GEOTRANSRECT(&scx->scx_trans, &rRaw, &r); /* mark tile with destination type */ - tile->ti_client = (ClientData) mzMakeEndpoints; + tile->ti_client = INT2CD(mzMakeEndpoints); /* Add tiles connected to Start to mzStartTerms */ /* (Added by Tim, August 2006) */ - if (mzMakeEndpoints == MZ_EXPAND_START) + if (INT2CD(mzMakeEndpoints) == MZ_EXPAND_START) { ColoredRect *newTerm; extern List *mzStartTerms; @@ -454,7 +454,7 @@ mzConnectedTileFunc(tile, cxp) /* or the planes will get fractured up, possibly into areas too */ /* small to place a valid route. */ - else if (mzMakeEndpoints == MZ_EXPAND_DEST) + else if (INT2CD(mzMakeEndpoints) == MZ_EXPAND_DEST) { RouteLayer *rL; TileType ttype = TiGetType(tile); diff --git a/plow/PlowJogs.c b/plow/PlowJogs.c index 3b85457a..63bbf530 100644 --- a/plow/PlowJogs.c +++ b/plow/PlowJogs.c @@ -373,7 +373,7 @@ plowProcessJogFunc(edge, area) ret = 0; plowJogEraseList = (LinkedRect *) NULL; if (plowSrShadowBack(newedge.e_pNum, &r, mask, - plowJogDragLHS, (ClientData) newedge.e_newx - width) == 0) + plowJogDragLHS, INT2CD(newedge.e_newx - width)) == 0) { /* Success: first paint to extend the RHS of the jog */ plane = plowYankDef->cd_planes[newedge.e_pNum]; diff --git a/plow/PlowMain.c b/plow/PlowMain.c index a498e4fb..47a6ee94 100644 --- a/plow/PlowMain.c +++ b/plow/PlowMain.c @@ -736,11 +736,11 @@ plowPropagateRect(def, userRect, lc, changedArea) /* Add the initial edges */ for (pNum = PL_TECHDEPBASE; pNum < DBNumPlanes; pNum++) (void) plowSrShadowInitial(pNum, &plowRect, - lc, plowInitialPaint, (ClientData) plowRect.r_xtop); + lc, plowInitialPaint, INT2CD(plowRect.r_xtop)); /* Find any subcells crossed by the plow */ (void) DBSrCellPlaneArea(plowYankDef->cd_cellPlane, - &cellPlowRect, plowInitialCell, (ClientData) &cellPlowRect); + &cellPlowRect, plowInitialCell, PTR2CD(&cellPlowRect)); /* While edges remain, process them */ tooFar = 0; @@ -910,9 +910,9 @@ plowPropagateSel(def, pdistance, changedArea) /* Add everything in the selection */ SelEnumPaint(&DBAllButSpaceBits, TRUE, &dummy, - plowSelPaintPlow, (ClientData) *pdistance); + plowSelPaintPlow, INT2CD(*pdistance)); SelEnumCells(TRUE, &dummy, (SearchContext *) NULL, - plowSelCellPlow, (ClientData) *pdistance); + plowSelCellPlow, INT2CD(*pdistance)); /* While edges remain, process them */ tooFar = 0; @@ -1043,7 +1043,7 @@ plowSelPaintPlow(rect, type, distance) #endif /* notdef */ plowLHS.r_xbot--; plowSrShadow(DBPlane(type), &plowLHS, DBZeroTypeBits, - plowInitialPaint, (ClientData) plowLHS.r_xtop); + plowInitialPaint, INT2CD(plowLHS.r_xtop)); /* Queue the RHS */ plowRHS.r_xbot = plowRHS.r_xtop; @@ -1054,7 +1054,7 @@ plowSelPaintPlow(rect, type, distance) plowRHS.r_xbot--; TTMaskSetOnlyType(&mask, type); plowSrShadow(DBPlane(type), &plowRHS, mask, - plowInitialPaint, (ClientData) plowRHS.r_xtop); + plowInitialPaint, INT2CD(plowRHS.r_xtop)); return (0); } @@ -1102,8 +1102,8 @@ plowSelCellPlow(selUse, realUse, transform, distance) /* Find the cell in the yanked def that has the same use-id as this one */ save = realUse->cu_client; - realUse->cu_client = (ClientData)distance; - (void) DBCellEnum(plowYankDef, plowFindSelCell, (ClientData)realUse); + realUse->cu_client = INT2CD(distance); + (void) DBCellEnum(plowYankDef, plowFindSelCell, PTR2CD(realUse)); realUse->cu_client = save; return (0); @@ -1125,7 +1125,7 @@ plowFindSelCell(yankUse, editUse) edge.e_ytop = yankUse->cu_bbox.r_ytop; edge.e_ybot = yankUse->cu_bbox.r_ybot; edge.e_x = yankUse->cu_bbox.r_xtop; - edge.e_newx = yankUse->cu_bbox.r_xtop + (int)editUse->cu_client; + edge.e_newx = yankUse->cu_bbox.r_xtop + (int)CD2INT(editUse->cu_client); edge.e_ltype = PLOWTYPE_CELL; edge.e_rtype = PLOWTYPE_CELL; (void) plowQueueAdd(&edge); @@ -1538,7 +1538,7 @@ plowProcessEdge(edge, changedArea) plowProcessedEdges++; if (edge->e_use) { - if (amountToMove > (int)edge->e_use->cu_client) + if (amountToMove > (int)CD2INT(edge->e_use->cu_client)) { /* Update area modified by plowing */ (void) GeoInclude(&edge->e_rect, changedArea); @@ -1558,7 +1558,7 @@ plowProcessEdge(edge, changedArea) * to update the area changed by the area of the * cell PLUS the area swept out by its RHS. */ - edge->e_use->cu_client = (ClientData)amountToMove; + edge->e_use->cu_client = INT2CD(amountToMove); r = edge->e_use->cu_bbox; r.r_xbot += amountToMove; r.r_xtop += amountToMove; diff --git a/plow/PlowRules2.c b/plow/PlowRules2.c index 0a172d81..3cd8a84c 100644 --- a/plow/PlowRules2.c +++ b/plow/PlowRules2.c @@ -1086,7 +1086,7 @@ plowFoundCell(use, ar) /* Only queue the edge if the cell has not moved far enough */ if ((use->cu_client != (ClientData)CLIENTDEFAULT) && - ((int)(use->cu_client) < xmove)) + ((int)CD2INT(use->cu_client) < xmove)) { edge.e_use = use; edge.e_flags = 0; diff --git a/plow/PlowYank.c b/plow/PlowYank.c index 9b7776ea..39ea50e3 100644 --- a/plow/PlowYank.c +++ b/plow/PlowYank.c @@ -185,7 +185,7 @@ plowYankMore(area, halo, back) { (void) DBSrPaintArea((Tile *) NULL, plowYankDef->cd_planes[pNum], &oldArea, &DBAllTypeBits, plowYankUpdatePaint, - (ClientData) pNum); + INT2CD(pNum)); } /* Switch the yank cell and the spare cell */ @@ -487,16 +487,16 @@ plowUpdateCell(use, origDef) switch (plowDirection) { case GEO_NORTH: - y = (int)use->cu_client; + y = (int)CD2INT(use->cu_client); break; case GEO_SOUTH: - y = -(int)use->cu_client; + y = -(int)CD2INT(use->cu_client); break; case GEO_WEST: - x = -(int)use->cu_client; + x = -(int)CD2INT(use->cu_client); break; case GEO_EAST: - x = (int)use->cu_client; + x = (int)CD2INT(use->cu_client); break; } GeoTranslateTrans(&origUse->cu_transform, x, y, &newTrans); diff --git a/router/rtrSide.c b/router/rtrSide.c index fb1e5333..9f0f0134 100644 --- a/router/rtrSide.c +++ b/router/rtrSide.c @@ -323,7 +323,7 @@ rtrEnumSidesFunc(tile) Side side; /* Skip if already processed, out of the area, or not a cell tile */ - yprev = (int) tile->ti_client; + yprev = (int) CD2INT(tile->ti_client); ybot = MAX(BOTTOM(tile), rtrSideArea.r_ybot); if (yprev <= ybot || tile->ti_body == (ClientData) NULL || RIGHT(tile) >= rtrSideArea.r_xtop) @@ -392,7 +392,7 @@ rtrEnumSidesFunc(tile) if (LEFT(tp) != RIGHT(tile) || TOP(tp) <= ybot) { /* Processed this tile completely */ - tile->ti_client = (ClientData) ybot; + tile->ti_client = INT2CD(ybot); return (0); } } @@ -441,7 +441,7 @@ rtrEnumSidesFunc(tile) else { side.side_line.r_ytop = MIN(TOP(tp), ytop); - tp->ti_client = (ClientData) ybot; + tp->ti_client = INT2CD(ybot); } } } diff --git a/select/selCreate.c b/select/selCreate.c index a8a3b903..d6a8d308 100644 --- a/select/selCreate.c +++ b/select/selCreate.c @@ -1274,7 +1274,7 @@ SelectAndCopy2(newSourceDef) { (void) DBSrPaintArea((Tile *) NULL, Select2Def->cd_planes[plane], &TiPlaneRect, &DBAllButSpaceAndDRCBits, selACPaintFunc, - (ClientData) plane); + INT2CD(plane)); DBMergeNMTiles(Select2Def->cd_planes[plane], &TiPlaneRect, (PaintUndoInfo *)NULL); } diff --git a/select/selOps.c b/select/selOps.c index f620e15d..c9785d01 100644 --- a/select/selOps.c +++ b/select/selOps.c @@ -404,9 +404,9 @@ selShortTileProc(tile, ssd) Tile *tile; ShortSearchData *ssd; { - if ((int)tile->ti_client < ssd->cost) + if ((int)CD2INT(tile->ti_client) < ssd->cost) { - ssd->cost = (int)tile->ti_client; + ssd->cost = (int)CD2INT(tile->ti_client); ssd->tile = tile; } return 0; @@ -448,7 +448,7 @@ selShortFindReverse(rlist, tile, pnum, fdir) TileType ttype; mindir = fdir; - mincost = (int)tile->ti_client; + mincost = (int)CD2INT(tile->ti_client); while (TRUE) { @@ -495,7 +495,7 @@ selShortFindReverse(rlist, tile, pnum, fdir) newrrec->r_next = *rlist; *rlist = newrrec; - if ((int)tile->ti_client == 0) return 0; /* We're done */ + if ((int)CD2INT(tile->ti_client) == 0) return 0; /* We're done */ minp = pnum; @@ -510,9 +510,9 @@ selShortFindReverse(rlist, tile, pnum, fdir) for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp)) { if (tp->ti_client == (ClientData)CLIENTDEFAULT) continue; - if ((int)tp->ti_client < mincost) + if ((int)CD2INT(tp->ti_client) < mincost) { - mincost = (int)tp->ti_client; + mincost = (int)CD2INT(tp->ti_client); mintp = tp; mindir = GEO_NORTH; } @@ -530,9 +530,9 @@ leftside: for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp)) { if (tp->ti_client == (ClientData)CLIENTDEFAULT) continue; - if ((int)tp->ti_client < mincost) + if ((int)CD2INT(tp->ti_client) < mincost) { - mincost = (int)tp->ti_client; + mincost = (int)CD2INT(tp->ti_client); mintp = tp; mindir = GEO_WEST; } @@ -550,9 +550,9 @@ bottomside: for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp)) { if (tp->ti_client == (ClientData)CLIENTDEFAULT) continue; - if ((int)tp->ti_client < mincost) + if ((int)CD2INT(tp->ti_client) < mincost) { - mincost = (int)tp->ti_client; + mincost = (int)CD2INT(tp->ti_client); mintp = tp; mindir = GEO_SOUTH; } @@ -570,9 +570,9 @@ rightside: for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp)) { if (tp->ti_client == (ClientData)CLIENTDEFAULT) continue; - if ((int)tp->ti_client < mincost) + if ((int)CD2INT(tp->ti_client) < mincost) { - mincost = (int)tp->ti_client; + mincost = (int)CD2INT(tp->ti_client); mintp = tp; mindir = GEO_EAST; } @@ -741,7 +741,7 @@ selShortProcessTile(tile, cost, fdir, mask) if (tile->ti_client == (ClientData)CLIENTDEFAULT) TiSetClient(tile, cost); - else if ((int)tile->ti_client > cost) + else if ((int)CD2INT(tile->ti_client) > cost) TiSetClient(tile, cost); else return 1; @@ -1222,7 +1222,7 @@ SelectExpand(mask) extern int selExpandFunc(); /* Forward reference. */ (void) SelEnumCells(FALSE, (bool *) NULL, (SearchContext *) NULL, - selExpandFunc, (ClientData) mask); + selExpandFunc, INT2CD(mask)); } /* ARGSUSED */ diff --git a/tiles/tile.c b/tiles/tile.c index a1faa840..a0dae3c3 100644 --- a/tiles/tile.c +++ b/tiles/tile.c @@ -732,9 +732,9 @@ TileStoreFree(ptr) } else { - TileStoreFreeList_end->ti_client = (unsigned long)ptr; + TileStoreFreeList_end->ti_client = PTR2CD(ptr); TileStoreFreeList_end = ptr; - TileStoreFreeList_end->ti_client = (unsigned long) 0; + TileStoreFreeList_end->ti_client = INT2CD(0); } } @@ -827,5 +827,5 @@ tiPrintAll(tp) printf("UR=(%d,%d)\n", RIGHT(tp), TOP(tp)); /* The following is for plowing debugging */ - printf("LEAD=%d\n", (int) tp->ti_client); + printf("LEAD=%d\n", (int) CD2INT(tp->ti_client)); } diff --git a/utils/macros.c b/utils/macros.c index 6195698c..878673ee 100644 --- a/utils/macros.c +++ b/utils/macros.c @@ -103,7 +103,7 @@ MacroDefine(client, xc, str, help, imacro) HashInit(clienttable, 32, HT_WORDKEYS); HashSetValue(h, clienttable); } - h = HashFind(clienttable, (char *)((ClientData)xc)); + h = HashFind(clienttable, (char *)INT2CD(xc)); oldMacro = (macrodef *)HashGetValue(h); if (oldMacro != NULL) { @@ -158,7 +158,7 @@ MacroDefineHelp(client, xc, help) clienttable = (HashTable *)HashGetValue(h); if (clienttable == NULL) return; - h = HashFind(clienttable, (char *)((ClientData)xc)); + h = HashFind(clienttable, (char *)INT2CD(xc)); curMacro = (macrodef *)HashGetValue(h); if (curMacro == NULL) return; @@ -202,7 +202,7 @@ MacroRetrieve(client, xc, iReturn) clienttable = (HashTable *)HashGetValue(h); if (clienttable != NULL) { - h = HashLookOnly(clienttable, (char *)((ClientData)xc)); + h = HashLookOnly(clienttable, (char *)INT2CD(xc)); if (h != NULL) { cMacro = (macrodef *)HashGetValue(h); @@ -249,7 +249,7 @@ MacroRetrieveHelp(client, xc) clienttable = (HashTable *)HashGetValue(h); if (clienttable != NULL) { - h = HashLookOnly(clienttable, (char *)((ClientData)xc)); + h = HashLookOnly(clienttable, (char *)INT2CD(xc)); if (h != NULL) { cMacro = (macrodef *)HashGetValue(h); @@ -347,7 +347,7 @@ MacroDelete(client, xc) clienttable = (HashTable *)HashGetValue(h); if (clienttable != NULL) { - h = HashLookOnly(clienttable, (char *)((ClientData)xc)); + h = HashLookOnly(clienttable, (char *)INT2CD(xc)); if (h != NULL) { cMacro = (macrodef *)HashGetValue(h);