mzrouter: convert K&R function definitions to ANSI C

Convert the old-style (K&R) function definitions in mzrouter/ to ANSI C
prototypes, formatted in the project's convention: the return type on its
own line and each parameter on its own line, indented four spaces, with
the original parameter comments retained.

Builds cleanly under GCC 16 / C23 (with the -std=gnu17 build change).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Andreas Wendleder 2026-06-10 03:49:15 +02:00
parent e826c6c82f
commit 5f0f184f04
No known key found for this signature in database
GPG Key ID: 588785BFDFB01ABD
14 changed files with 321 additions and 314 deletions

View File

@ -145,8 +145,8 @@ extern void mzPaintBlockType();
*/ */
void void
mzBuildMaskDataBlocks(buildArea) mzBuildMaskDataBlocks(
Rect *buildArea; /* Area over which blockage planes will be built */ Rect *buildArea) /* Area over which blockage planes will be built */
{ {
Rect searchArea; Rect searchArea;
int pNum; int pNum;
@ -234,10 +234,10 @@ mzBuildMaskDataBlocks(buildArea)
*/ */
int int
mzBuildBlockFunc(tile, dinfo, cxp) mzBuildBlockFunc(
Tile *tile; Tile *tile,
TileType dinfo; // Unused TileType dinfo, // Unused
TreeContext *cxp; TreeContext *cxp)
{ {
SearchContext *scx = cxp->tc_scx; SearchContext *scx = cxp->tc_scx;
Rect *buildArea = (Rect *) (cxp->tc_filter->tf_arg); Rect *buildArea = (Rect *) (cxp->tc_filter->tf_arg);
@ -274,9 +274,9 @@ mzBuildBlockFunc(tile, dinfo, cxp)
*/ */
int int
mzBlockSubcellsFunc(scx, cdarg) mzBlockSubcellsFunc(
SearchContext *scx; SearchContext *scx,
ClientData cdarg; ClientData cdarg)
{ {
Rect r, rDest; Rect r, rDest;
Rect *buildArea = (Rect *) cdarg; Rect *buildArea = (Rect *) cdarg;
@ -317,7 +317,10 @@ mzBlockSubcellsFunc(scx, cdarg)
*/ */
int int
mzPaintSameNodeFunc(Tile *t, TileType dinfo, Rect *buildArea) mzPaintSameNodeFunc(
Tile *t,
TileType dinfo,
Rect *buildArea)
{ {
Rect r; Rect r;
TileType ttype; TileType ttype;
@ -351,11 +354,11 @@ mzPaintSameNodeFunc(Tile *t, TileType dinfo, Rect *buildArea)
*/ */
void void
mzPaintBlockType(r, type, buildArea, blockType) mzPaintBlockType(
Rect *r; Rect *r,
TileType type; TileType type,
Rect *buildArea; Rect *buildArea,
TileType blockType; TileType blockType)
{ {
RouteType *rT; RouteType *rT;
TileType locBlockType; TileType locBlockType;
@ -522,8 +525,8 @@ mzPaintBlockType(r, type, buildArea, blockType)
*/ */
void void
mzBuildFenceBlocks(buildArea) mzBuildFenceBlocks(
Rect *buildArea; /* Area over which planes modified */ Rect *buildArea) /* Area over which planes modified */
{ {
int mzBuildFenceBlocksFunc(); int mzBuildFenceBlocksFunc();
Rect searchArea; Rect searchArea;
@ -580,10 +583,10 @@ mzBuildFenceBlocks(buildArea)
*/ */
int int
mzBuildFenceBlocksFunc(tile, dinfo, buildArea) mzBuildFenceBlocksFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
Rect *buildArea; /* clip to this area before painting */ Rect *buildArea) /* clip to this area before painting */
{ {
RouteType *rT; RouteType *rT;
int d; int d;
@ -648,8 +651,8 @@ mzBuildFenceBlocksFunc(tile, dinfo, buildArea)
*/ */
void void
mzExtendBlockBoundsR(rect) mzExtendBlockBoundsR(
Rect *rect; Rect *rect)
{ {
Rect area; Rect area;
TileTypeBitMask genMask; TileTypeBitMask genMask;
@ -724,10 +727,10 @@ mzExtendBlockBoundsR(rect)
*/ */
int int
mzExtendBlockFunc(tile, dinfo, cdarg) mzExtendBlockFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
ClientData cdarg; ClientData cdarg)
{ {
Rect area; Rect area;
@ -785,8 +788,8 @@ mzExtendBlockFunc(tile, dinfo, cdarg)
*/ */
void void
mzExtendBlockBounds(point) mzExtendBlockBounds(
Point *point; Point *point)
{ {
Rect rect; Rect rect;
@ -934,10 +937,10 @@ mzBuildDestAreaBlocks()
*/ */
int int
mzDestAreaFunc(tile, dinfo, cxp) mzDestAreaFunc(
Tile *tile; Tile *tile,
TileType dinfo; /* (unused) */ TileType dinfo, /* (unused) */
TreeContext *cxp; TreeContext *cxp)
{ {
SearchContext *scx = cxp->tc_scx; SearchContext *scx = cxp->tc_scx;
TileType type = TiGetType(tile); TileType type = TiGetType(tile);
@ -1014,10 +1017,10 @@ mzDestAreaFunc(tile, dinfo, cxp)
*/ */
int int
mzDestWalksFunc(tile, dinfo, cxp) mzDestWalksFunc(
Tile *tile; Tile *tile,
TileType dinfo; /* (unused) */ TileType dinfo, /* (unused) */
TreeContext *cxp; TreeContext *cxp)
{ {
SearchContext *scx = cxp->tc_scx; SearchContext *scx = cxp->tc_scx;
TileType type = TiGetType(tile); TileType type = TiGetType(tile);
@ -1100,10 +1103,10 @@ mzDestWalksFunc(tile, dinfo, cxp)
*/ */
int int
mzHWalksFunc(tile, dinfo, cdarg) mzHWalksFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
ClientData cdarg; ClientData cdarg)
{ {
RouteType *rT = (RouteType *) cdarg; RouteType *rT = (RouteType *) cdarg;
@ -1189,10 +1192,10 @@ mzHWalksFunc(tile, dinfo, cdarg)
*/ */
int int
mzVWalksFunc(tile, dinfo, cdarg) mzVWalksFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
ClientData cdarg; ClientData cdarg)
{ {
RouteType *rT = (RouteType *) cdarg; RouteType *rT = (RouteType *) cdarg;
@ -1288,10 +1291,10 @@ typedef struct walkContactFuncData
*/ */
int int
mzLRCWalksFunc(tile, dinfo, cdarg) mzLRCWalksFunc(
Tile *tile; Tile *tile,
TileType dinfo; /* (unused) */ TileType dinfo, /* (unused) */
ClientData cdarg; ClientData cdarg)
{ {
RouteType *rT = (RouteType *) cdarg; /* RouteType of this dest area */ RouteType *rT = (RouteType *) cdarg; /* RouteType of this dest area */
RouteContact *rC; RouteContact *rC;
@ -1372,10 +1375,10 @@ mzLRCWalksFunc(tile, dinfo, cdarg)
*/ */
int int
mzUDCWalksFunc(tile, dinfo, cdarg) mzUDCWalksFunc(
Tile *tile; Tile *tile,
TileType dinfo; /* (unused) */ TileType dinfo, /* (unused) */
ClientData cdarg; ClientData cdarg)
{ {
RouteType *rT = (RouteType *) cdarg; /* RouteType of this dest area */ RouteType *rT = (RouteType *) cdarg; /* RouteType of this dest area */
RouteContact *rC; RouteContact *rC;
@ -1458,9 +1461,9 @@ mzUDCWalksFunc(tile, dinfo, cdarg)
*/ */
int int
mzCWalksFunc2(tile, cdarg) mzCWalksFunc2(
Tile *tile; Tile *tile,
ClientData cdarg; ClientData cdarg)
{ {
WalkContactFuncData *wD = (WalkContactFuncData *) cdarg; WalkContactFuncData *wD = (WalkContactFuncData *) cdarg;
Rect rect; Rect rect;

View File

@ -67,8 +67,8 @@ extern void mzPrintPathHead();
*/ */
void void
MZPrintRCListNames(l) MZPrintRCListNames(
List *l; List *l)
{ {
RouteContact *rC; RouteContact *rC;
@ -101,8 +101,8 @@ MZPrintRCListNames(l)
*/ */
void void
MZPrintRLListNames(l) MZPrintRLListNames(
List *l; List *l)
{ {
RouteLayer *rL; RouteLayer *rL;
@ -135,8 +135,8 @@ MZPrintRLListNames(l)
*/ */
void void
MZPrintRLs(rL) MZPrintRLs(
RouteLayer *rL; RouteLayer *rL)
{ {
while(rL!=NULL) while(rL!=NULL)
{ {
@ -166,8 +166,8 @@ MZPrintRLs(rL)
*/ */
void void
mzPrintRL(rL) mzPrintRL(
RouteLayer *rL; RouteLayer *rL)
{ {
List *cL; List *cL;
@ -224,8 +224,8 @@ mzPrintRL(rL)
*/ */
void void
mzPrintRT(rT) mzPrintRT(
RouteType *rT; RouteType *rT)
{ {
int i; int i;
@ -282,8 +282,8 @@ mzPrintRT(rT)
*/ */
void void
MZPrintRCs(rC) MZPrintRCs(
RouteContact *rC; RouteContact *rC)
{ {
while(rC!=NULL) while(rC!=NULL)
{ {
@ -312,8 +312,8 @@ MZPrintRCs(rC)
*/ */
void void
mzPrintRC(rC) mzPrintRC(
RouteContact *rC; RouteContact *rC)
{ {
TxPrintf("ROUTE CONTACT:\n"); TxPrintf("ROUTE CONTACT:\n");
mzPrintRT(&(rC->rc_routeType)); mzPrintRT(&(rC->rc_routeType));
@ -348,8 +348,8 @@ mzPrintRC(rC)
*/ */
void void
mzPrintRPs(path) mzPrintRPs(
RoutePath *path; RoutePath *path)
{ {
while(path!=NULL) while(path!=NULL)
{ {
@ -377,8 +377,8 @@ mzPrintRPs(path)
*/ */
void void
mzPrintRP(path) mzPrintRP(
RoutePath *path; RoutePath *path)
{ {
TxPrintf("ROUTE PATH:"); TxPrintf("ROUTE PATH:");
TxPrintf(" layer = %s", TxPrintf(" layer = %s",
@ -415,8 +415,8 @@ mzPrintRP(path)
/* mzPrintPathHead -- */ /* mzPrintPathHead -- */
void void
mzPrintPathHead(path) mzPrintPathHead(
RoutePath *path; RoutePath *path)
{ {
if(path==NULL) if(path==NULL)
@ -479,8 +479,8 @@ mzPrintPathHead(path)
*/ */
void void
mzDumpTags(area) mzDumpTags(
Rect *area; Rect *area)
{ {
int mzDumpTagsFunc(); int mzDumpTagsFunc();
SearchContext scx; SearchContext scx;
@ -526,10 +526,10 @@ mzDumpTags(area)
*/ */
int int
mzDumpTagsFunc(tile, dinfo, cxp) mzDumpTagsFunc(
Tile *tile; Tile *tile,
TileType dinfo; /* (unused) */ TileType dinfo, /* (unused) */
TreeContext *cxp; TreeContext *cxp)
{ {
SearchContext *scx = cxp->tc_scx; SearchContext *scx = cxp->tc_scx;
Rect r; Rect r;

View File

@ -487,10 +487,10 @@ mzCleanEstimate()
*/ */
int int
mzReclaimTCFunc(tile, dinfo, notUsed) mzReclaimTCFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
ClientData notUsed; ClientData notUsed)
{ {
if (tile->ti_client != (ClientData)CLIENTDEFAULT) if (tile->ti_client != (ClientData)CLIENTDEFAULT)
{ {
@ -537,10 +537,10 @@ mzReclaimTCFunc(tile, dinfo, notUsed)
*/ */
int int
mzProcessDestEstFunc(tile, dinfo, cxp) mzProcessDestEstFunc(
Tile *tile; Tile *tile,
TileType dinfo; /* (unused) */ TileType dinfo, /* (unused) */
TreeContext *cxp; TreeContext *cxp)
{ {
SearchContext *scx = cxp->tc_scx; SearchContext *scx = cxp->tc_scx;
TileType type = TiGetType(tile); TileType type = TiGetType(tile);
@ -610,10 +610,10 @@ mzProcessDestEstFunc(tile, dinfo, cxp)
*/ */
int int
mzDestTileEstFunc(tile, dinfo, cdarg) mzDestTileEstFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
ClientData cdarg; ClientData cdarg)
{ {
Rect rect; Rect rect;
@ -661,10 +661,10 @@ mzDestTileEstFunc(tile, dinfo, cdarg)
*/ */
int int
mzAddSubcellEstFunc(scx, dinfo, cdarg) mzAddSubcellEstFunc(
SearchContext *scx; SearchContext *scx,
TileType dinfo; TileType dinfo,
ClientData cdarg; ClientData cdarg)
{ {
Rect r, rDest; Rect r, rDest;
@ -703,10 +703,10 @@ mzAddSubcellEstFunc(scx, dinfo, cdarg)
*/ */
int int
mzAddFenceEstFunc(tile, dinfo, buildArea) mzAddFenceEstFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
Rect *buildArea; /* currently ignored */ Rect *buildArea) /* currently ignored */
{ {
Rect r; Rect r;
@ -742,10 +742,10 @@ mzAddFenceEstFunc(tile, dinfo, buildArea)
*/ */
int int
mzBuildSolidsListFunc(tile, dinfo, listPtr) mzBuildSolidsListFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
List **listPtr; /* pointer to list to add tile to */ List **listPtr) /* pointer to list to add tile to */
{ {
LIST_ADD(tile,*listPtr); LIST_ADD(tile,*listPtr);
@ -770,10 +770,10 @@ mzBuildSolidsListFunc(tile, dinfo, listPtr)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
int int
mzAssignCostsFunc(tile, dinfo, spaceCosts) mzAssignCostsFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
TileCosts *spaceCosts; /* costs to assign to space tiles */ TileCosts *spaceCosts) /* costs to assign to space tiles */
{ {
Tile *tRight, *tUp; Tile *tRight, *tUp;
TileCosts *newCosts; TileCosts *newCosts;
@ -869,10 +869,10 @@ mzAssignCostsFunc(tile, dinfo, spaceCosts)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
int int
mzDestInitialAssignFunc(tile, dinfo, cdarg) mzDestInitialAssignFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
ClientData cdarg; ClientData cdarg)
{ {
Heap *adjHeap = (Heap *) cdarg; Heap *adjHeap = (Heap *) cdarg;
Vertex *v; Vertex *v;
@ -912,10 +912,10 @@ mzDestInitialAssignFunc(tile, dinfo, cdarg)
*/ */
int int
mzBuildEstimatesFunc(tile, dinfo, notUsed) mzBuildEstimatesFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
ClientData notUsed; ClientData notUsed)
{ {
mzBuildCornerEstimators(tile); mzBuildCornerEstimators(tile);
@ -943,8 +943,8 @@ mzBuildEstimatesFunc(tile, dinfo, notUsed)
*/ */
void void
mzBuildCornerEstimators(tile) mzBuildCornerEstimators(
Tile *tile; Tile *tile)
{ {
TileCosts *tc = (TileCosts *) (tile->ti_client); TileCosts *tc = (TileCosts *) (tile->ti_client);
Vertex *vLLeft = NULL; Vertex *vLLeft = NULL;
@ -1104,8 +1104,8 @@ mzBuildCornerEstimators(tile)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
mzBuildStraightShotEstimators(tile) mzBuildStraightShotEstimators(
Tile *tile; Tile *tile)
{ {
TileCosts *tc = (TileCosts *) (tile->ti_client); TileCosts *tc = (TileCosts *) (tile->ti_client);
@ -1257,10 +1257,10 @@ mzBuildStraightShotEstimators(tile)
*/ */
bool bool
AlwaysAsGood(est1, est2, tile) AlwaysAsGood(
Estimate *est1; Estimate *est1,
Estimate *est2; Estimate *est2,
Tile *tile; Tile *tile)
{ {
if(est1->e_cost0 > est2->e_cost0) if(est1->e_cost0 > est2->e_cost0)
{ {
@ -1325,10 +1325,10 @@ AlwaysAsGood(est1, est2, tile)
*/ */
int int
mzTrimEstimatesFunc(tile, dinfo, notUsed) mzTrimEstimatesFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
ClientData notUsed; ClientData notUsed)
{ {
TileCosts *tc = (TileCosts *) (tile->ti_client); TileCosts *tc = (TileCosts *) (tile->ti_client);
Estimate *e; Estimate *e;
@ -1403,9 +1403,9 @@ mzTrimEstimatesFunc(tile, dinfo, notUsed)
*/ */
void void
mzSplitTiles(plane, point) mzSplitTiles(
Plane * plane; Plane * plane,
Point * point; /* origin from which tiles split */ Point * point) /* origin from which tiles split */
{ {
Tile *pointTile = TiSrPointNoHint(plane, point); Tile *pointTile = TiSrPointNoHint(plane, point);
Tile *t; Tile *t;
@ -1588,9 +1588,9 @@ mzAssignVertexCosts()
*/ */
void void
mzAddVertex(vxThis, adjHeap) mzAddVertex(
Vertex *vxThis; Vertex *vxThis,
Heap *adjHeap; Heap *adjHeap)
{ {
Tile *tThis; /* Tile vxThis is attached to */ Tile *tThis; /* Tile vxThis is attached to */
Point loc; /* location of vxThis */ Point loc; /* location of vxThis */
@ -1886,8 +1886,8 @@ noLeft:;
// changed from DoubleInt to dlong // changed from DoubleInt to dlong
dlong dlong
mzEstimatedCost(point) mzEstimatedCost(
Point *point; Point *point)
{ {
Tile *t = TiSrPointNoHint(mzEstimatePlane, point); Tile *t = TiSrPointNoHint(mzEstimatePlane, point);
TileCosts *tc = ((TileCosts *) t->ti_client); TileCosts *tc = ((TileCosts *) t->ti_client);
@ -1931,9 +1931,9 @@ mzEstimatedCost(point)
*/ */
void void
mzDumpEstimates(area,fd) mzDumpEstimates(
Rect *area; Rect *area,
FILE *fd; FILE *fd)
{ {
int mzDumpEstFunc(); int mzDumpEstFunc();
@ -1976,10 +1976,10 @@ mzDumpEstimates(area,fd)
*/ */
int int
mzDumpEstFunc(tile, dinfo, fd) mzDumpEstFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
FILE *fd; FILE *fd)
{ {
Rect r; Rect r;
TileCosts *tilec = (TileCosts *) tile->ti_client; TileCosts *tilec = (TileCosts *) tile->ti_client;

View File

@ -269,8 +269,8 @@ do \
*/ */
MazeParameters * MazeParameters *
MZCopyParms(oldParms) MZCopyParms(
MazeParameters *oldParms; /* Maze routing parameters */ MazeParameters *oldParms) /* Maze routing parameters */
{ {
MazeParameters *newParms; MazeParameters *newParms;
HashTable aT; /* Address translation hash table */ HashTable aT; /* Address translation hash table */
@ -415,8 +415,8 @@ MZCopyParms(oldParms)
*/ */
MazeParameters * MazeParameters *
MZFindStyle(name) MZFindStyle(
char *name; /* name of style we are looking for */ char *name) /* name of style we are looking for */
{ {
MazeStyle *style = mzStyles; MazeStyle *style = mzStyles;
@ -457,10 +457,10 @@ char *name; /* name of style we are looking for */
*/ */
void void
MZInitRoute(parms, routeUse, expansionMask) MZInitRoute(
MazeParameters *parms; /* Maze routing parameters */ MazeParameters *parms, /* Maze routing parameters */
CellUse *routeUse; /* toplevel cell router sees */ CellUse *routeUse, /* toplevel cell router sees */
int expansionMask; /* which subcells are expanded - NOTE: the int expansionMask) /* which subcells are expanded - NOTE: the
* maze router interpets a 0 mask to mean * maze router interpets a 0 mask to mean
* all cells are expanded * all cells are expanded
*/ */
@ -568,9 +568,9 @@ MZInitRoute(parms, routeUse, expansionMask)
*/ */
void void
MZAddStart(point, type) MZAddStart(
Point *point; Point *point,
TileType type; TileType type)
{ {
/* Disable undo to avoid overhead on paint operations to internal planes */ /* Disable undo to avoid overhead on paint operations to internal planes */
UndoDisable(); UndoDisable();
@ -668,9 +668,9 @@ MZAddStart(point, type)
*/ */
void void
MZAddDest(rect, type) MZAddDest(
Rect *rect; Rect *rect,
TileType type; TileType type)
{ {
ColoredRect *dTerm; ColoredRect *dTerm;
@ -721,8 +721,8 @@ MZAddDest(rect, type)
*/ */
RoutePath * RoutePath *
MZRoute(mzResult) MZRoute(
int *mzResult; /* Place to put result code */ int *mzResult) /* Place to put result code */
{ {
RoutePath *path; /* handle for result of search */ RoutePath *path; /* handle for result of search */
ColoredRect *term; ColoredRect *term;
@ -877,8 +877,8 @@ abort:
*/ */
void void
MZCleanupPath(pathList) MZCleanupPath(
RoutePath *pathList; RoutePath *pathList)
{ {
RoutePath *path, *n1path, *n2path, *n3path; RoutePath *path, *n1path, *n2path, *n3path;
RoutePath *spath, *cpath, *mpath; RoutePath *spath, *cpath, *mpath;
@ -1149,8 +1149,8 @@ MZCleanupPath(pathList)
*/ */
CellUse * CellUse *
MZPaintPath(pathList) MZPaintPath(
RoutePath *pathList; RoutePath *pathList)
{ {
RoutePath *path, *prev; RoutePath *path, *prev;
RouteLayer *last_rL = NULL; RouteLayer *last_rL = NULL;

View File

@ -64,9 +64,9 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
*/ */
void void
mzNLInit(nL, size) mzNLInit(
NumberLine *nL; NumberLine *nL,
int size; /*initial size of number line */ int size) /*initial size of number line */
{ {
int *entries; int *entries;
size = MAX(size, 2); size = MAX(size, 2);
@ -101,9 +101,9 @@ mzNLInit(nL, size)
*/ */
void void
mzNLInsert(nL,x) mzNLInsert(
NumberLine *nL; NumberLine *nL,
int x; /* new point */ int x) /* new point */
{ {
int lowI, highI; int lowI, highI;
@ -205,9 +205,9 @@ mzNLInsert(nL,x)
*/ */
int * int *
mzNLGetContainingInterval(nL,x) mzNLGetContainingInterval(
NumberLine *nL; NumberLine *nL,
int x; /* new point */ int x) /* new point */
{ {
int lowI, highI; int lowI, highI;
@ -256,8 +256,8 @@ mzNLGetContainingInterval(nL,x)
*/ */
void void
mzNLClear(nL) mzNLClear(
NumberLine *nL; NumberLine *nL)
{ {
nL->nl_entries[0] = MINFINITY; nL->nl_entries[0] = MINFINITY;

View File

@ -179,8 +179,8 @@ extern void mzExtendPath(RoutePath *);
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
RoutePath * RoutePath *
mzSearch(mzResult) mzSearch(
int *mzResult; int *mzResult)
{ {
RoutePath *path; /* solution */ RoutePath *path; /* solution */
bool morePartialPaths = TRUE; bool morePartialPaths = TRUE;
@ -728,8 +728,8 @@ mzSearch(mzResult)
*/ */
void void
mzExtendPath(path) mzExtendPath(
RoutePath *path; RoutePath *path)
{ {
int extendCode = path->rp_extendCode; int extendCode = path->rp_extendCode;
@ -813,8 +813,8 @@ mzExtendPath(path)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
mzExtendViaLRContacts(path) mzExtendViaLRContacts(
RoutePath *path; RoutePath *path)
{ {
Point p = path->rp_entry, *lastCpos = NULL; Point p = path->rp_entry, *lastCpos = NULL;
RouteLayer *rLayer = path->rp_rLayer; RouteLayer *rLayer = path->rp_rLayer;
@ -1010,8 +1010,8 @@ mzExtendViaLRContacts(path)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
mzExtendViaUDContacts(path) mzExtendViaUDContacts(
RoutePath *path; RoutePath *path)
{ {
Point p = path->rp_entry, *lastCpos = NULL; Point p = path->rp_entry, *lastCpos = NULL;
RouteLayer *rLayer = path->rp_rLayer; RouteLayer *rLayer = path->rp_rLayer;
@ -1208,17 +1208,16 @@ mzExtendViaUDContacts(path)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
mzAddPoint(path, p, rLayer, orient, extendCode, costptr) mzAddPoint(
RoutePath *path; /* path that new point extends */ RoutePath *path, /* path that new point extends */
Point *p; /* new point */ Point *p, /* new point */
RouteLayer *rLayer; /* Route Layer of new point */ RouteLayer *rLayer, /* Route Layer of new point */
int orient; /* 'H' = endpt of hor seg, 'V' = endpt of vert seg, int orient, /* 'H' = endpt of hor seg, 'V' = endpt of vert seg,
* 'O' = LR contact, 'X' = UD contact, * 'O' = LR contact, 'X' = UD contact,
* 'B' = first point in path and blocked * 'B' = first point in path and blocked
*/ */
int extendCode; /* interesting directions to extend in */ int extendCode, /* interesting directions to extend in */
dlong *costptr; /* Incremental cost of new path segment */ dlong *costptr) /* Incremental cost of new path segment */
{ {
RoutePath *newPath; RoutePath *newPath;
RoutePath *hashedPath; RoutePath *hashedPath;
@ -1459,8 +1458,8 @@ mzAddPoint(path, p, rLayer, orient, extendCode, costptr)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
mzBloomInit(path) mzBloomInit(
RoutePath *path; /* path that new point extends */ RoutePath *path) /* path that new point extends */
{ {
ASSERT(mzBloomStack==NULL,"mzBloomInit"); ASSERT(mzBloomStack==NULL,"mzBloomInit");

View File

@ -59,7 +59,10 @@ extern bool mzAddInitialContacts();
*/ */
int int
mzFindSamenodeFunc(Tile *tile, TileType dinfo, Point *point) mzFindSamenodeFunc(
Tile *tile,
TileType dinfo,
Point *point)
{ {
*point = tile->ti_ll; *point = tile->ti_ll;
return 1; return 1;
@ -88,8 +91,8 @@ mzFindSamenodeFunc(Tile *tile, TileType dinfo, Point *point)
#define EC_ALL_DIRECTIONS (EC_RIGHT | EC_LEFT | EC_UP | EC_DOWN) #define EC_ALL_DIRECTIONS (EC_RIGHT | EC_LEFT | EC_UP | EC_DOWN)
bool bool
mzStart(term) mzStart(
ColoredRect *term; ColoredRect *term)
{ {
RouteLayer *rL; RouteLayer *rL;
RouteContact *rC; RouteContact *rC;
@ -204,13 +207,13 @@ mzStart(term)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
bool bool
mzExtendInitPath(path, rL, point, cost, length, directions) mzExtendInitPath(
RoutePath *path; /* Initial Path, being extended */ RoutePath *path, /* Initial Path, being extended */
RouteLayer *rL; /* routelayer of new point */ RouteLayer *rL, /* routelayer of new point */
Point point; /* new point for initPath */ Point point, /* new point for initPath */
dlong cost; /* cost of new segment */ dlong cost, /* cost of new segment */
int length; /* length of path (excluding new segment) */ int length, /* length of path (excluding new segment) */
int directions; /* directions to extend init path in */ int directions) /* directions to extend init path in */
{ {
Tile *tp; Tile *tp;
bool returnCode = TRUE; bool returnCode = TRUE;
@ -321,9 +324,9 @@ mzExtendInitPath(path, rL, point, cost, length, directions)
*/ */
bool bool
mzAddInitialContacts(rL, point) mzAddInitialContacts(
RouteLayer *rL; /* routelayer of initial point */ RouteLayer *rL, /* routelayer of initial point */
Point point; /* initial point */ Point point) /* initial point */
{ {
List *cL; List *cL;
Tile *tp; Tile *tp;

View File

@ -290,10 +290,10 @@ int mzMakeEndpoints; /* Set to MZ_EXPAND_START, MZ_EXPAND_DEST, or
*/ */
void void
mzMarkConnectedTiles(rect, type, expandType) mzMarkConnectedTiles(
Rect *rect; Rect *rect,
TileType type; TileType type,
int expandType; int expandType)
{ {
List *expandList = NULL; /* areas remaining to be expanded from */ List *expandList = NULL; /* areas remaining to be expanded from */
@ -412,10 +412,10 @@ mzMarkConnectedTiles(rect, type, expandType)
*/ */
int int
mzConnectedTileFunc(tile, dinfo, cxp) mzConnectedTileFunc(
Tile *tile; Tile *tile,
TileType dinfo; /* (unused) */ TileType dinfo, /* (unused) */
TreeContext *cxp; TreeContext *cxp)
{ {
/* If tile not marked, mark it, add it to marked list, and add /* If tile not marked, mark it, add it to marked list, and add
* corresponding area to expand list. Mark start tiles MZ_EXPAND_START * corresponding area to expand list. Mark start tiles MZ_EXPAND_START
@ -514,9 +514,9 @@ mzConnectedTileFunc(tile, dinfo, cxp)
*/ */
int int
mzConnectedSubcellFunc(scx, cdarg) mzConnectedSubcellFunc(
SearchContext *scx; SearchContext *scx,
ClientData cdarg; ClientData cdarg)
{ {
CellUse *cu = scx->scx_use; CellUse *cu = scx->scx_use;
@ -550,8 +550,9 @@ mzConnectedSubcellFunc(scx, cdarg)
*/ */
RouteContact * RouteContact *
MZGetContact(path, prev) MZGetContact(
RoutePath *path, *prev; RoutePath *path,
RoutePath *prev)
{ {
RouteContact *rC; RouteContact *rC;
List *cL; List *cL;
@ -586,8 +587,9 @@ MZGetContact(path, prev)
*/ */
int int
mzPaintContact(path, prev) mzPaintContact(
RoutePath *path, *prev; RoutePath *path,
RoutePath *prev)
{ {
RouteContact *rC; RouteContact *rC;
int pNum, pNumC, cWidth; int pNum, pNumC, cWidth;
@ -670,8 +672,8 @@ mzPaintContact(path, prev)
*/ */
RoutePath * RoutePath *
mzCopyPath(path) mzCopyPath(
RoutePath *path; RoutePath *path)
{ {
RoutePath *newHead, *newPrev, *new; RoutePath *newHead, *newPrev, *new;
@ -795,9 +797,9 @@ mzFreeAllRPaths()
*/ */
bool bool
mzPresent(rL,touchingTypes) mzPresent(
RouteLayer *rL; RouteLayer *rL,
TileTypeBitMask *touchingTypes; TileTypeBitMask *touchingTypes)
{ {
List *l; List *l;

View File

@ -117,8 +117,8 @@ void mzEdgeRule(int, char **);
*/ */
void void
MZFreeParameters(params) MZFreeParameters(
MazeParameters *params; MazeParameters *params)
{ {
RouteLayer *rL; RouteLayer *rL;
RouteContact *rC; RouteContact *rC;
@ -331,10 +331,10 @@ MZAfterTech()
*/ */
bool bool
MZTechLine(sectionName, argc, argv) MZTechLine(
char *sectionName; /* Unused */ char *sectionName, /* Unused */
int argc; int argc,
char *argv[]; char *argv[])
{ {
if(strcmp(argv[0], "style") == 0) if(strcmp(argv[0], "style") == 0)
{ {
@ -399,9 +399,9 @@ MZTechLine(sectionName, argc, argv)
*/ */
void void
mzTechStyle(argc, argv) mzTechStyle(
int argc; int argc,
char *argv[]; char *argv[])
{ {
/* if there is a previous style, complete processing on it */ /* if there is a previous style, complete processing on it */
@ -514,8 +514,8 @@ mzStyleEnd()
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
mzSetParmDefaults(parms) mzSetParmDefaults(
MazeParameters *parms; MazeParameters *parms)
{ {
/* initialize penalty factor for excess cost togo */ /* initialize penalty factor for excess cost togo */
@ -583,9 +583,9 @@ mzSetParmDefaults(parms)
*/ */
void void
mzTechLayer(argc, argv) mzTechLayer(
int argc; int argc,
char *argv[]; char *argv[])
{ {
RouteLayer *new; RouteLayer *new;
TileType tileType; TileType tileType;
@ -745,9 +745,9 @@ mzTechLayer(argc, argv)
*/ */
void void
mzTechNotActive(argc, argv) mzTechNotActive(
int argc; int argc,
char *argv[]; char *argv[])
{ {
int argI; int argI;
TileType tileType; TileType tileType;
@ -811,9 +811,9 @@ mzTechNotActive(argc, argv)
*/ */
void void
mzTechSpacing(argc, argv) mzTechSpacing(
int argc; int argc,
char *argv[]; char *argv[])
{ {
TechSpacing *new; TechSpacing *new;
TileType tileType; TileType tileType;
@ -932,9 +932,9 @@ mzTechSpacing(argc, argv)
*/ */
void void
mzTechSearch(argc, argv) mzTechSearch(
int argc; int argc,
char *argv[]; char *argv[])
{ {
/* check number of arguments */ /* check number of arguments */
if(argc != 4) if(argc != 4)
@ -1036,9 +1036,9 @@ mzTechSearch(argc, argv)
*/ */
void void
mzTechWidth(argc, argv) mzTechWidth(
int argc; int argc,
char *argv[]; char *argv[])
{ {
TileType tileType; TileType tileType;
RouteType *rT; RouteType *rT;
@ -1133,9 +1133,9 @@ mzTechWidth(argc, argv)
*/ */
void void
mzTechContact(argc, argv) mzTechContact(
int argc; int argc,
char *argv[]; char *argv[])
{ {
RouteContact *new; RouteContact *new;
TileType type, tileType; TileType type, tileType;
@ -1225,9 +1225,9 @@ mzTechContact(argc, argv)
*/ */
void void
mzInitRouteType(rT,tileType) mzInitRouteType(
RouteType *rT; RouteType *rT,
TileType tileType; TileType tileType)
{ {
int t; int t;
@ -1296,8 +1296,8 @@ mzInitRouteType(rT,tileType)
*/ */
RouteType * RouteType *
mzFindRouteType(type) mzFindRouteType(
TileType type; TileType type)
{ {
RouteType *rT; RouteType *rT;
@ -1326,8 +1326,8 @@ mzFindRouteType(type)
*/ */
RouteLayer * RouteLayer *
mzFindRouteLayer(type) mzFindRouteLayer(
TileType type; TileType type)
{ {
RouteLayer *rL; RouteLayer *rL;
@ -1356,8 +1356,8 @@ mzFindRouteLayer(type)
*/ */
RouteContact * RouteContact *
mzFindRouteContact(type) mzFindRouteContact(
TileType type; TileType type)
{ {
RouteContact *rC; RouteContact *rC;
@ -1390,10 +1390,10 @@ mzFindRouteContact(type)
*/ */
void void
mzUpdateSpacing(rType,tType,distance) mzUpdateSpacing(
RouteType *rType; /* Route Type to which spacing applies */ RouteType *rType, /* Route Type to which spacing applies */
TileType tType; /* spacing from this tiletype */ TileType tType, /* spacing from this tiletype */
int distance; /* min spacing betweeen rType and tType */ int distance) /* min spacing betweeen rType and tType */
{ {
rType->rt_spacing[tType] = rType->rt_spacing[tType] =
MAX(rType->rt_spacing[tType],distance); MAX(rType->rt_spacing[tType],distance);

View File

@ -79,9 +79,9 @@ extern const TestCmdTableE mzTestCommands[];
*/ */
void void
mzDebugTstCmd(w, cmd) mzDebugTstCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int result; int result;
bool value; bool value;
@ -133,9 +133,9 @@ mzDebugTstCmd(w, cmd)
*/ */
void void
mzDumpEstimatesTstCmd(w, cmd) mzDumpEstimatesTstCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
if (cmd->tx_argc > 2) if (cmd->tx_argc > 2)
{ {
@ -180,9 +180,9 @@ mzDumpEstimatesTstCmd(w, cmd)
*/ */
void void
mzDumpTagsTstCmd(w, cmd) mzDumpTagsTstCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
if (cmd->tx_argc > 2) if (cmd->tx_argc > 2)
{ {
@ -227,9 +227,9 @@ mzDumpTagsTstCmd(w, cmd)
*/ */
void void
mzHelpTstCmd(w, cmd) mzHelpTstCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int n; int n;
int which; int which;
@ -303,9 +303,9 @@ mzHelpTstCmd(w, cmd)
*/ */
void void
mzNumberLineTstCmd(w, cmd) mzNumberLineTstCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
NumberLine myLine; NumberLine myLine;
int *result; int *result;
@ -382,9 +382,9 @@ mzNumberLineTstCmd(w, cmd)
*/ */
void void
mzParmsTstCmd(w, cmd) mzParmsTstCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
MZPrintRLs(mzRouteLayers); MZPrintRLs(mzRouteLayers);
@ -413,9 +413,9 @@ mzParmsTstCmd(w, cmd)
*/ */
void void
mzPlaneTstCmd(w, cmd) mzPlaneTstCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
TileType t; TileType t;
RouteType *rT; RouteType *rT;
@ -486,9 +486,9 @@ mzPlaneTstCmd(w, cmd)
*/ */
void void
mzVersionCmd(w, cmd) mzVersionCmd(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
if(cmd->tx_argc == 2) if(cmd->tx_argc == 2)
@ -573,9 +573,9 @@ const TestCmdTableE mzTestCommands[] = {
}, *mzTestCmdP; }, *mzTestCmdP;
void void
MZTest(w, cmd) MZTest(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int n; int n;
int which; int which;

View File

@ -54,8 +54,8 @@ static char rcsid[] __attribute__ ((unused)) = "$Header:";
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
mzWalkRight(path) mzWalkRight(
RoutePath *path; RoutePath *path)
{ {
Point pOrg; /* point to extend from */ Point pOrg; /* point to extend from */
Point pNew; /* next interesting point in direction of extension */ Point pNew; /* next interesting point in direction of extension */
@ -172,8 +172,8 @@ mzWalkRight(path)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
mzWalkLeft(path) mzWalkLeft(
RoutePath *path; RoutePath *path)
{ {
Point pOrg; /* point to extend from */ Point pOrg; /* point to extend from */
Point pNew; /* next interesting point in direction of extension */ Point pNew; /* next interesting point in direction of extension */
@ -293,8 +293,8 @@ mzWalkLeft(path)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
mzWalkUp(path) mzWalkUp(
RoutePath *path; RoutePath *path)
{ {
Point pOrg; /* point to extend from */ Point pOrg; /* point to extend from */
Point pNew; /* next interesting point in direction of extension */ Point pNew; /* next interesting point in direction of extension */
@ -411,8 +411,8 @@ mzWalkUp(path)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
mzWalkDown(path) mzWalkDown(
RoutePath *path; RoutePath *path)
{ {
Point pOrg; /* point to extend from */ Point pOrg; /* point to extend from */
Point pNew; /* next interesting point in direction of extension */ Point pNew; /* next interesting point in direction of extension */
@ -531,8 +531,8 @@ mzWalkDown(path)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
mzWalkLRContact(path) mzWalkLRContact(
RoutePath *path; RoutePath *path)
{ {
Point pOrg; /* point to extend from */ Point pOrg; /* point to extend from */
int extendCode; /* Interesting directions to extend in */ int extendCode; /* Interesting directions to extend in */
@ -618,8 +618,8 @@ mzWalkLRContact(path)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
mzWalkUDContact(path) mzWalkUDContact(
RoutePath *path; RoutePath *path)
{ {
Point pOrg; /* point to extend from */ Point pOrg; /* point to extend from */
int extendCode; /* Interesting directions to extend in */ int extendCode; /* Interesting directions to extend in */

View File

@ -53,8 +53,8 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
mzExtendDown(path) mzExtendDown(
RoutePath *path; RoutePath *path)
{ {
Point pOrg; /* point to extend from */ Point pOrg; /* point to extend from */
Point pStep; /* one unit from pOrg in direction of extension */ Point pStep; /* one unit from pOrg in direction of extension */

View File

@ -53,8 +53,8 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
mzExtendLeft(path) mzExtendLeft(
RoutePath *path; RoutePath *path)
{ {
Point pOrg; /* point to extend from */ Point pOrg; /* point to extend from */
Point pStep; /* one unit from pOrg in direction of extension */ Point pStep; /* one unit from pOrg in direction of extension */

View File

@ -53,8 +53,8 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
void void
mzExtendUp(path) mzExtendUp(
RoutePath *path; RoutePath *path)
{ {
Point pOrg; /* point to extend from */ Point pOrg; /* point to extend from */
Point pStep; /* one unit from pOrg in direction of extension */ Point pStep; /* one unit from pOrg in direction of extension */