grouter: convert K&R function definitions to ANSI C

Convert the old-style (K&R) function definitions in grouter/ 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.

Updates grouter.h with prototypes for the affected declarations.

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 561ea8135e
commit e826c6c82f
No known key found for this signature in database
GPG Key ID: 588785BFDFB01ABD
13 changed files with 360 additions and 343 deletions

View File

@ -134,8 +134,8 @@ PaintArea *glChanPaintList;
*/
void
glChanBuildMap(chanList)
GCRChannel *chanList; /* List of all channels in routing problem */
glChanBuildMap(
GCRChannel *chanList) /* List of all channels in routing problem */
{
GCRChannel *ch;
bool workDone;
@ -235,10 +235,10 @@ glChanBuildMap(chanList)
*/
int
glChanFeedFunc(tile, dinfo, clientdata)
Tile *tile;
TileType dinfo; /* (unused) */
ClientData clientdata; /* (unused) */
glChanFeedFunc(
Tile *tile,
TileType dinfo, /* (unused) */
ClientData clientdata) /* (unused) */
{
char *mesg;
Rect r;
@ -307,9 +307,9 @@ glChanFreeMap()
int glChanCheckCount;
void
glChanCheckCover(chanList, mask)
GCRChannel *chanList;
TileTypeBitMask *mask;
glChanCheckCover(
GCRChannel *chanList,
TileTypeBitMask *mask)
{
int glChanCheckFunc();
GCRChannel *ch;
@ -344,10 +344,10 @@ glChanCheckCover(chanList, mask)
*/
int
glChanCheckFunc(tile, dinfo, ch)
Tile *tile;
TileType dinfo; /* (unused) */
GCRChannel *ch;
glChanCheckFunc(
Tile *tile,
TileType dinfo, /* (unused) */
GCRChannel *ch)
{
char mesg[1024];
Rect r;
@ -394,8 +394,8 @@ glChanCheckFunc(tile, dinfo, ch)
*/
bool
glChanClip(ch)
GCRChannel *ch;
glChanClip(
GCRChannel *ch)
{
bool ret;
@ -432,17 +432,17 @@ glChanClip(ch)
}
int
glChanSetClient(tile, cdata)
Tile *tile;
ClientData cdata;
glChanSetClient(
Tile *tile,
ClientData cdata)
{
tile->ti_client = cdata;
return 0;
}
void
glChanShowTiles(mesg)
char *mesg;
glChanShowTiles(
char *mesg)
{
char answer[100], m[1024];
@ -457,10 +457,10 @@ glChanShowTiles(mesg)
}
int
glChanShowFunc(tile, dinfo, clientdata)
Tile *tile;
TileType dinfo; /* (unused) */
ClientData clientdata; /* (unused) */
glChanShowFunc(
Tile *tile,
TileType dinfo, /* (unused) */
ClientData clientdata) /* (unused) */
{
GCRChannel *ch;
char mesg[1024];
@ -503,10 +503,10 @@ glChanShowFunc(tile, dinfo, clientdata)
*/
int
glChanClipFunc(tile, dinfo, area)
Tile *tile;
TileType dinfo; /* (unused) */
Rect *area;
glChanClipFunc(
Tile *tile,
TileType dinfo, /* (unused) */
Rect *area)
{
ClientData tileClient = tile->ti_client;
TileType type = TiGetType(tile);
@ -573,10 +573,10 @@ glChanClipFunc(tile, dinfo, area)
*/
int
glChanMergeFunc(tile, dinfo, clientdata)
Tile *tile;
TileType dinfo; /* (unused) */
ClientData clientdata; /* (unused) */
glChanMergeFunc(
Tile *tile,
TileType dinfo, /* (unused) */
ClientData clientdata) /* (unused) */
{
GCRChannel *ch = (GCRChannel *) tile->ti_client;
Tile *delayed = NULL; /* delayed free to extend lifetime */
@ -664,8 +664,8 @@ glChanMergeFunc(tile, dinfo, clientdata)
*/
void
glChanBlockDens(ch)
GCRChannel *ch;
glChanBlockDens(
GCRChannel *ch)
{
GlobChan *gc = (GlobChan *) ch->gcr_client;
int halfGrid, shiftedOrigin;
@ -782,10 +782,10 @@ glChanBlockDens(ch)
}
int
glChanPaintFunc(tile, dinfo, type)
Tile *tile;
TileType dinfo; /* (unused) */
TileType type;
glChanPaintFunc(
Tile *tile,
TileType dinfo, /* (unused) */
TileType type)
{
static TileType changeTable[4][4] = {
/* Paint atop CHAN_NORMAL */
@ -832,9 +832,9 @@ glChanPaintFunc(tile, dinfo, type)
*/
void
glChanFlood(area, type)
Rect *area;
TileType type;
glChanFlood(
Rect *area,
TileType type)
{
TileTypeBitMask hMask, vMask;
Rect outside;
@ -878,10 +878,10 @@ glChanFlood(area, type)
}
int
glChanFloodVFunc(tile, dinfo, area)
Tile *tile;
TileType dinfo; /* (unused) */
Rect *area;
glChanFloodVFunc(
Tile *tile,
TileType dinfo, /* (unused) */
Rect *area)
{
PaintArea *pa;
@ -898,10 +898,10 @@ glChanFloodVFunc(tile, dinfo, area)
}
int
glChanFloodHFunc(tile, dinfo, area)
Tile *tile;
TileType dinfo; /* (unused) */
Rect *area;
glChanFloodHFunc(
Tile *tile,
TileType dinfo, /* (unused) */
Rect *area)
{
PaintArea *pa;
@ -939,10 +939,10 @@ glChanFloodHFunc(tile, dinfo, area)
*/
int
glChanSplitRiver(tile, dinfo, clientdata)
Tile *tile;
TileType dinfo; /* (unused) */
ClientData clientdata; /* (unused) */
glChanSplitRiver(
Tile *tile,
TileType dinfo, /* (unused) */
ClientData clientdata) /* (unused) */
{
ClientData tileClient = tile->ti_client;
Tile *tp, *newTile;
@ -1022,10 +1022,10 @@ glChanSplitRiver(tile, dinfo, clientdata)
*/
int
glChanRiverBlock(tile, dinfo, clientdata)
Tile *tile;
TileType dinfo; /* (unused) */
ClientData clientdata; /* (unused) */
glChanRiverBlock(
Tile *tile,
TileType dinfo, /* (unused) */
ClientData clientdata) /* (unused) */
{
GCRPin *pin, *pinLast;
GCRChannel *ch;
@ -1087,9 +1087,9 @@ glChanRiverBlock(tile, dinfo, clientdata)
*/
Tile *
glChanPinToTile(hintTile, pin)
Tile *hintTile; /* Hint for starting the tile search */
GCRPin *pin; /* Find tile containing this pin */
glChanPinToTile(
Tile *hintTile, /* Hint for starting the tile search */
GCRPin *pin) /* Find tile containing this pin */
{
GCRChannel *ch;
Tile *tp;

View File

@ -87,10 +87,10 @@ void glCrossTakePin();
*/
void
glCrossMark(rootUse, path, pNetId)
CellUse *rootUse; /* For error feedback if non-NULL */
GlPoint *path; /* Path linked via gl_path pointers */
NetId *pNetId; /* Net and segment identifier; netid_seg is updated */
glCrossMark(
CellUse *rootUse, /* For error feedback if non-NULL */
GlPoint *path, /* Path linked via gl_path pointers */
NetId *pNetId) /* Net and segment identifier; netid_seg is updated */
{
GCRPin *srcPin, *dstPin;
GlPoint *rp;
@ -161,10 +161,10 @@ glCrossMark(rootUse, path, pNetId)
*/
void
glCrossTakePin(rootUse, pin, netid)
CellUse *rootUse; /* For error feedback if non-NULL */
GCRPin *pin; /* Pin to take */
NetId netid; /* Identifier to assign */
glCrossTakePin(
CellUse *rootUse, /* For error feedback if non-NULL */
GCRPin *pin, /* Pin to take */
NetId netid) /* Identifier to assign */
{
char c[2048+64], name1[1024], name2[1024];
Rect r;
@ -236,8 +236,8 @@ glCrossTakePin(rootUse, pin, netid)
*/
void
glCrossUnreserve(net)
NLNet *net;
glCrossUnreserve(
NLNet *net)
{
NLTermLoc *loc;
NLTerm *term;
@ -289,11 +289,11 @@ glCrossUnreserve(net)
*/
int
glCrossEnum(inPt, tp, func, cdata)
GlPoint *inPt; /* Top of heap point being expanded */
Tile *tp; /* Tile adjacent to inPt->gl_tile */
int (*func)(); /* Called for each crossing */
ClientData cdata; /* Passed to (*func)() */
glCrossEnum(
GlPoint *inPt, /* Top of heap point being expanded */
Tile *tp, /* Tile adjacent to inPt->gl_tile */
int (*func)(), /* Called for each crossing */
ClientData cdata) /* Passed to (*func)() */
{
int outSide, origin, lo, hi, max, start, n, nhi;
GCRChannel *ch = inPt->gl_pin->gcr_ch;
@ -468,11 +468,11 @@ glCrossEnum(inPt, tp, func, cdata)
*/
GlPoint *
glCrossAdjust(lookAhead, path)
GlPoint *lookAhead; /* Normally, lookAhead->gl_path == path, except on the
glCrossAdjust(
GlPoint *lookAhead, /* Normally, lookAhead->gl_path == path, except on the
* initial call, in which case lookAhead == NULL.
*/
GlPoint *path; /* Adjust crossings along this path */
GlPoint *path) /* Adjust crossings along this path */
{
GlPoint *newPath, *newRest;
GCRPin *linkedPin, *pin;
@ -571,11 +571,11 @@ glCrossAdjust(lookAhead, path)
/*ARGSUSED*/
int
glCrossChoose(newRest, tp, pin, newPath)
GlPoint *newRest; /* Portion of path already assigned */
Tile *tp; /* UNUSED */
GCRPin *pin; /* Pin on boundary of tp being considered */
GlPoint *newPath; /* Update newPath->gl_pin, newPath->gl_cost */
glCrossChoose(
GlPoint *newRest, /* Portion of path already assigned */
Tile *tp, /* UNUSED */
GCRPin *pin, /* Pin on boundary of tp being considered */
GlPoint *newPath) /* Update newPath->gl_pin, newPath->gl_cost */
{
GCRPin *savePin;
int cost;
@ -629,10 +629,10 @@ glCrossChoose(newRest, tp, pin, newPath)
*/
int
glCrossCost(lookAhead, exitPt, entryPt)
GlPoint *lookAhead;
GlPoint *exitPt;
GlPoint *entryPt;
glCrossCost(
GlPoint *lookAhead,
GlPoint *exitPt,
GlPoint *entryPt)
{
GCRPin *entryPin, *exitPin, *otherPin;
GCRPin *opposite;

View File

@ -61,10 +61,11 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
*/
bool
glDensAdjust(dens, srcPin, dstPin, netid)
DensMap dens[2];
GCRPin *srcPin, *dstPin;
NetId netid;
glDensAdjust(
DensMap dens[2],
GCRPin *srcPin,
GCRPin *dstPin,
NetId netid)
{
int minprow, maxprow, minpcol, maxpcol, mincol, maxcol, minrow, maxrow;
int maxvd, maxhd, col, row, nrow, ncol;
@ -187,9 +188,10 @@ glDensAdjust(dens, srcPin, dstPin, netid)
*/
void
glDMAlloc(dm, top, cap)
DensMap *dm;
int top, cap;
glDMAlloc(
DensMap *dm,
int top,
int cap)
{
dm->dm_max = 0;
dm->dm_size = top + 1;
@ -216,8 +218,9 @@ glDMAlloc(dm, top, cap)
*/
void
glDMCopy(dm1, dm2)
DensMap *dm1, *dm2;
glDMCopy(
DensMap *dm1,
DensMap *dm2)
{
dm2->dm_max = dm1->dm_max;
ASSERT(dm2->dm_size == dm1->dm_size, "glDMCopy");
@ -243,8 +246,8 @@ glDMCopy(dm1, dm2)
*/
void
glDMFree(dm)
DensMap *dm;
glDMFree(
DensMap *dm)
{
freeMagic((char *) dm->dm_value);
}
@ -266,9 +269,10 @@ glDMFree(dm)
*/
int
glDMMaxInRange(dm, lo, hi)
DensMap *dm;
int lo, hi;
glDMMaxInRange(
DensMap *dm,
int lo,
int hi)
{
short *dval = dm->dm_value;
int n, max;
@ -305,9 +309,9 @@ glDMMaxInRange(dm, lo, hi)
*/
void
glDensInit(dmap, ch)
DensMap dmap[2];
GCRChannel *ch;
glDensInit(
DensMap dmap[2],
GCRChannel *ch)
{
short *dSrc, *dDst, *dEnd;

View File

@ -80,9 +80,9 @@ void glClientFree();
*/
void
GlGlobalRoute(chanList, netList)
GCRChannel *chanList; /* List of all channels in routing problem */
NLNetList *netList; /* Netlist built by caller */
GlGlobalRoute(
GCRChannel *chanList, /* List of all channels in routing problem */
NLNetList *netList) /* Netlist built by caller */
{
HeapEntry entry;
Heap netHeap;
@ -166,9 +166,9 @@ GlGlobalRoute(chanList, netList)
*/
void
glClientInit(chanList, netList)
GCRChannel *chanList;
NLNetList *netList;
glClientInit(
GCRChannel *chanList,
NLNetList *netList)
{
GCRChannel *ch;
GlobChan *gc;
@ -214,9 +214,9 @@ glClientInit(chanList, netList)
*/
void
glClientFree(chanList, netList)
GCRChannel *chanList;
NLNetList *netList;
glClientFree(
GCRChannel *chanList,
NLNetList *netList)
{
GlobChan *gc;
CZone *cz;
@ -279,13 +279,13 @@ glClientFree(chanList, netList)
*/
GlPoint *
glProcessLoc(startList, loc, bestCost, doFast)
GlPoint *startList; /* List of starting points */
NLTermLoc *loc; /* Location of terminal being routed to */
int bestCost; /* Best cost so far; if we can't find a path in
glProcessLoc(
GlPoint *startList, /* List of starting points */
NLTermLoc *loc, /* Location of terminal being routed to */
int bestCost, /* Best cost so far; if we can't find a path in
* less than this cost, give up.
*/
bool doFast; /* If TRUE, only wiggle crossings around within the
bool doFast) /* If TRUE, only wiggle crossings around within the
* channels on the shortest path; don't bother
* considering other sequences of channels. If FALSE,
* we keep generating longer and longer paths until

View File

@ -92,9 +92,9 @@ bool glMazeCheckLoop();
*/
GlPoint *
glMazeFindPath(loc, bestCost)
NLTermLoc *loc; /* Destination point */
int bestCost; /* Beat this cost or give up */
glMazeFindPath(
NLTermLoc *loc, /* Destination point */
int bestCost) /* Beat this cost or give up */
{
int heapPts, startPts, frontierPts;
GlPoint *inPt;
@ -183,9 +183,9 @@ glMazeFindPath(loc, bestCost)
*/
void
glMazePropFinal(inPt, loc)
GlPoint *inPt; /* Point being processed */
NLTermLoc *loc; /* Destination point */
glMazePropFinal(
GlPoint *inPt, /* Point being processed */
NLTermLoc *loc) /* Destination point */
{
GCRPin *destPin = loc->nloc_pin;
Point *destPoint = &loc->nloc_stem;
@ -229,8 +229,8 @@ glMazePropFinal(inPt, loc)
*/
void
glMazePropRiver(inPt)
GlPoint *inPt;
glMazePropRiver(
GlPoint *inPt)
{
GCRPin *inPin = inPt->gl_pin, *outPin, *linkedPin;
GCRChannel *inCh = inPin->gcr_ch;
@ -311,8 +311,8 @@ glMazePropRiver(inPt)
#define NOTBLOCKEDV(tp) (NOTBLOCKED(tp) && TiGetType(tp) != CHAN_HRIVER)
void
glMazePropNormal(inPt)
GlPoint *inPt;
glMazePropNormal(
GlPoint *inPt)
{
Tile *tile = inPt->gl_tile, *tp;
@ -362,10 +362,10 @@ glMazePropNormal(inPt)
*/
void
glMazeTile(inPt, tile, dir)
GlPoint *inPt; /* Top of heap point being expanded */
Tile *tile; /* Tile adjacent to inPt->gl_tile */
int dir; /* Direction from inPt->gl_tile to tile */
glMazeTile(
GlPoint *inPt, /* Top of heap point being expanded */
Tile *tile, /* Tile adjacent to inPt->gl_tile */
int dir) /* Direction from inPt->gl_tile to tile */
{
GCRChannel *ch = (GCRChannel *) tile->ti_client;
TileType type = TiGetType(tile);
@ -471,10 +471,10 @@ glMazeTile(inPt, tile, dir)
*/
int
glMazeTileFunc(inPt, tp, pin)
GlPoint *inPt; /* Top of heap point being expanded */
Tile *tp; /* Tile adjacent to inPt->gl_tile */
GCRPin *pin; /* Available pin on boundary of tp */
glMazeTileFunc(
GlPoint *inPt, /* Top of heap point being expanded */
Tile *tp, /* Tile adjacent to inPt->gl_tile */
GCRPin *pin) /* Available pin on boundary of tp */
{
GlPoint *outPt;
int cost;
@ -530,9 +530,9 @@ glMazeTileFunc(inPt, tp, pin)
*/
bool
glMazeCheckLoop(path, tp)
GlPoint *path;
Tile *tp;
glMazeCheckLoop(
GlPoint *path,
Tile *tp)
{
for ( ; path; path = path->gl_path)
if (path->gl_tile == tp)
@ -559,9 +559,9 @@ glMazeCheckLoop(path, tp)
*/
void
glMazeResetCost(headPage, headFree)
GlPage *headPage;
int headFree;
glMazeResetCost(
GlPage *headPage,
int headFree)
{
GlPage *gpage;
GCRPin *pin;
@ -583,8 +583,8 @@ glMazeResetCost(headPage, headFree)
}
void
glPathPrint(path)
GlPoint *path;
glPathPrint(
GlPoint *path)
{
GlPoint *rp;
GCRPin *pin;

View File

@ -109,13 +109,13 @@ void glMultiAddStart();
*/
int
glMultiSteiner(rootUse, net, routeProc, markProc, cdRoute, cdMark)
CellUse *rootUse; /* If non-NULL, feedback for errors left here */
NLNet *net; /* Net to process */
GlPoint *(*routeProc)(); /* Procedure to route a segment */
int (*markProc)(); /* Procedure to remember the route */
ClientData cdRoute; /* Passed to (*routeProc)() */
ClientData cdMark; /* Passed to (*markProc)() */
glMultiSteiner(
CellUse *rootUse, /* If non-NULL, feedback for errors left here */
NLNet *net, /* Net to process */
GlPoint *(*routeProc)(), /* Procedure to route a segment */
int (*markProc)(), /* Procedure to remember the route */
ClientData cdRoute, /* Passed to (*routeProc)() */
ClientData cdMark) /* Passed to (*markProc)() */
{
GlPoint *startList, *bestDest, *dest;
char mesg[128], *lastTermName;
@ -240,8 +240,8 @@ glMultiSteiner(rootUse, net, routeProc, markProc, cdRoute, cdMark)
*/
int
glMultiStemCost(loc)
NLTermLoc *loc;
glMultiStemCost(
NLTermLoc *loc)
{
int n1, n2, cost;
@ -278,9 +278,9 @@ glMultiStemCost(loc)
*/
void
glMultiAddStart(path, pStartList)
GlPoint *path; /* Path linked via gl_path pointers */
GlPoint **pStartList; /* List of starting points */
glMultiAddStart(
GlPoint *path, /* Path linked via gl_path pointers */
GlPoint **pStartList) /* List of starting points */
{
GlPoint *srcEntry, *dstEntry;
GCRPin *srcPin, *dstPin;

View File

@ -58,9 +58,9 @@ static bool glNameDidInit = FALSE;
*/
void
glNetNameInit(netList, numNets)
NLNetList *netList;
int numNets;
glNetNameInit(
NLNetList *netList,
int numNets)
{
NLNet *net;
int i;
@ -116,8 +116,8 @@ glNetNameInit(netList, numNets)
*/
char *
GlNetIdName(id)
int id;
GlNetIdName(
int id)
{
static char tempId[100];

View File

@ -131,9 +131,9 @@ int fudgeDenom = 10;
*/
GlPoint *
glRouteToPoint(loc, bestCost)
NLTermLoc *loc; /* Route from points on heap to this point */
int bestCost; /* If we haven't found a path with less than
glRouteToPoint(
NLTermLoc *loc, /* Route from points on heap to this point */
int bestCost) /* If we haven't found a path with less than
* this cost, return NULL.
*/
{
@ -321,14 +321,14 @@ glScalePenalties()
*/
bool
glPopFromHeap(pNewBest, newPaths, hEntry)
bool *pNewBest; /* Should be TRUE on initial call; afterwards,
glPopFromHeap(
bool *pNewBest, /* Should be TRUE on initial call; afterwards,
* we set it to TRUE when glBestCost is updated.
*/
bool newPaths; /* TRUE if points added to glHeap since the last
bool newPaths, /* TRUE if points added to glHeap since the last
* call to glPopFromHeap().
*/
HeapEntry *hEntry; /* See above */
HeapEntry *hEntry) /* See above */
{
HeapEntry *bestCostTop, *glHeapTop;
int minAcceptableCost, newBestCost;
@ -495,9 +495,9 @@ glPopFromHeap(pNewBest, newPaths, hEntry)
*/
bool
glFinalPropagate(inPt, loc)
GlPoint *inPt; /* Point being processed */
NLTermLoc *loc; /* Destination point */
glFinalPropagate(
GlPoint *inPt, /* Point being processed */
NLTermLoc *loc) /* Destination point */
{
GCRChannel *destCh = loc->nloc_chan;
GCRPin *destPin = loc->nloc_pin;
@ -565,8 +565,8 @@ glFinalPropagate(inPt, loc)
*/
int
glRiverPropagate(inPt)
GlPoint *inPt;
glRiverPropagate(
GlPoint *inPt)
{
GCRPin *inPin = inPt->gl_pin, *outPin, *linkedPin;
GCRChannel *inCh = inPt->gl_ch;
@ -719,10 +719,10 @@ glRiverPropagate(inPt)
*/
void
glNormalPropagate(inPt, inCh, heapCost)
GlPoint *inPt; /* Point on the boundary of inCh */
GCRChannel *inCh; /* Channel through which we're passing */
int heapCost; /* Cost with which inPt was added to heap */
glNormalPropagate(
GlPoint *inPt, /* Point on the boundary of inCh */
GCRChannel *inCh, /* Channel through which we're passing */
int heapCost) /* Cost with which inPt was added to heap */
{
PinRanges pinRange, prevRange;
int x, y, baseCost, min, max;
@ -913,10 +913,11 @@ glNormalPropagate(inPt, inCh, heapCost)
int
glMinRemainingCost(inPt, inCh, pRect, dRect)
GlPoint *inPt;
GCRChannel *inCh;
Rect *pRect, *dRect;
glMinRemainingCost(
GlPoint *inPt,
GCRChannel *inCh,
Rect *pRect,
Rect *dRect)
{
int cost, n;
GCRPin *pins;
@ -1042,10 +1043,10 @@ glMinRemainingCost(inPt, inCh, pRect, dRect)
int
glPinCost(inPt, pin, oldCost)
GlPoint *inPt;
GCRPin *pin;
int oldCost;
glPinCost(
GlPoint *inPt,
GCRPin *pin,
int oldCost)
{
int cost;
@ -1089,10 +1090,10 @@ glPinCost(inPt, pin, oldCost)
*/
bool
glSetDensityClip(inPt, ch, dRect)
GlPoint *inPt;
GCRChannel *ch;
Rect *dRect;
glSetDensityClip(
GlPoint *inPt,
GCRChannel *ch,
Rect *dRect)
{
GCRPin *inPin = inPt->gl_pin;
short *den, maxdensity;
@ -1213,11 +1214,12 @@ glSetDensityClip(inPt, ch, dRect)
*/
void
glSetPinClip(inPt, inCh, heapCost, dRect, pRect)
GlPoint *inPt;
GCRChannel *inCh;
int heapCost;
Rect *dRect, *pRect;
glSetPinClip(
GlPoint *inPt,
GCRChannel *inCh,
int heapCost,
Rect *dRect,
Rect *pRect)
{
int bloat, estCost, t;
Rect r;
@ -1272,9 +1274,9 @@ glSetPinClip(inPt, inCh, heapCost, dRect, pRect)
*/
void
glResetCost(headPage, headFree)
GlPage *headPage;
int headFree;
glResetCost(
GlPage *headPage,
int headFree)
{
GlPage *gpage;
GCRPin *pin;
@ -1315,10 +1317,10 @@ glResetCost(headPage, headFree)
*/
int
glPropagateFn(outCh, outPin, inPt)
GCRChannel *outCh; /* Channel entered from outPin */
GCRPin *outPin; /* Exit pin, also in inCh */
GlPoint *inPt; /* Point being considered */
glPropagateFn(
GCRChannel *outCh, /* Channel entered from outPin */
GCRPin *outPin, /* Exit pin, also in inCh */
GlPoint *inPt) /* Point being considered */
{
int cost, n;
int finalCost;
@ -1403,14 +1405,14 @@ glPropagateFn(outCh, outPin, inPt)
*/
int
glCrossPenalty(cost, inCh, outCh, inPin, outPin)
int cost; /* Distance cost */
GCRChannel *inCh; /* Both inPin and outPin are in this channel */
GCRChannel *outCh; /* Channel to which outPin exits, or NULL
glCrossPenalty(
int cost, /* Distance cost */
GCRChannel *inCh, /* Both inPin and outPin are in this channel */
GCRChannel *outCh, /* Channel to which outPin exits, or NULL
* if outPin is the destination.
*/
GCRPin *inPin; /* Pin used to enter inCh */
GCRPin *outPin; /* Pin used to exit inCh into outCh */
GCRPin *inPin, /* Pin used to enter inCh */
GCRPin *outPin) /* Pin used to exit inCh into outCh */
{
GCRPin *otherPin;
int count;
@ -1518,9 +1520,10 @@ glCrossPenalty(cost, inCh, outCh, inPin, outPin)
*/
bool
glDensityExceeded(inCh, inPin, outPin)
GCRChannel *inCh;
GCRPin *inPin, *outPin;
glDensityExceeded(
GCRChannel *inCh,
GCRPin *inPin,
GCRPin *outPin)
{
int min, max, maxdensity;
short *den;
@ -1590,10 +1593,10 @@ glDensityExceeded(inCh, inPin, outPin)
*/
void
glRectToRange(ch, r, pr)
GCRChannel *ch;
Rect *r;
PinRanges *pr;
glRectToRange(
GCRChannel *ch,
Rect *r,
PinRanges *pr)
{
Rect clipR;
@ -1642,8 +1645,9 @@ glRectToRange(ch, r, pr)
*/
bool
glJogsAcrossChannel(inPin, outPin)
GCRPin *inPin, *outPin;
glJogsAcrossChannel(
GCRPin *inPin,
GCRPin *outPin)
{
switch (inPin->gcr_side)
{
@ -1691,11 +1695,13 @@ glJogsAcrossChannel(inPin, outPin)
*/
void
glPropagateDebug(inPt, inPin, outCh, outPin, prevCost, distCost)
GlPoint *inPt;
GCRPin *inPin, *outPin;
GCRChannel *outCh;
int prevCost, distCost;
glPropagateDebug(
GlPoint *inPt,
GCRPin *inPin,
GCRChannel *outCh,
GCRPin *outPin,
int prevCost,
int distCost)
{
char mesg[256];
Point linkedPt;
@ -1752,9 +1758,9 @@ glPropagateDebug(inPt, inPin, outCh, outPin, prevCost, distCost)
*/
void
glLogPath(inPt, cost)
GlPoint *inPt;
int cost;
glLogPath(
GlPoint *inPt,
int cost)
{
extern Rect glInitRect;
@ -1784,8 +1790,8 @@ glLogPath(inPt, cost)
*/
void
glPrintPoint(inPt)
GlPoint *inPt;
glPrintPoint(
GlPoint *inPt)
{
TxPrintf("(%d,%d) l=%d p=0x%x c=0x%x",
inPt->gl_point.p_x, inPt->gl_point.p_y,

View File

@ -69,10 +69,10 @@ GlPage *glPathCurPage = NULL;
*/
void
glListAdd(list, pin, cost)
GlPoint **list; /* Linked via gl_path pointers */
GCRPin *pin;
int cost;
glListAdd(
GlPoint **list, /* Linked via gl_path pointers */
GCRPin *pin,
int cost)
{
GlPoint *newPt;
@ -106,9 +106,9 @@ glListAdd(list, pin, cost)
*/
void
glListToHeap(list, destPt)
GlPoint *list; /* List of points linked via gl_path pointers */
Point *destPt;
glListToHeap(
GlPoint *list, /* List of points linked via gl_path pointers */
Point *destPt)
{
GlPoint *temp, *new;
GCRPin *pin;
@ -164,8 +164,8 @@ glListToHeap(list, destPt)
*/
GlPoint *
glPathCopyPerm(list)
GlPoint *list;
glPathCopyPerm(
GlPoint *list)
{
GlPoint *new, *prev, *first;
@ -183,8 +183,8 @@ glPathCopyPerm(list)
}
int
glPathFreePerm(list)
GlPoint *list;
glPathFreePerm(
GlPoint *list)
{
GlPoint *p;
@ -213,10 +213,10 @@ glPathFreePerm(list)
*/
GlPoint *
glPathNew(pin, cost, prev)
GCRPin *pin; /* Pin at the crossing point (mustn't be NULL) */
int cost; /* The cost to get here from source */
GlPoint *prev; /* Point from which the new one was visited */
glPathNew(
GCRPin *pin, /* Pin at the crossing point (mustn't be NULL) */
int cost, /* The cost to get here from source */
GlPoint *prev) /* Point from which the new one was visited */
{
GlPoint *result;

View File

@ -73,8 +73,8 @@ CZone *glPenFindCZones();
*/
void
glPenSetPerChan(net)
NLNet *net;
glPenSetPerChan(
NLNet *net)
{
CZone *czNet, *czChan;
GlobChan *gc;
@ -92,8 +92,8 @@ glPenSetPerChan(net)
}
int
glPenClearPerChan(net)
NLNet *net;
glPenClearPerChan(
NLNet *net)
{
CZone *czNet, *czChan;
GlobChan *gc;
@ -181,9 +181,9 @@ glPenClearPerChan(net)
*/
void
glPenCompute(chanList, netList)
GCRChannel *chanList; /* All the channels in the routing problem */
NLNetList *netList; /* Netlist being routed */
glPenCompute(
GCRChannel *chanList, /* All the channels in the routing problem */
NLNetList *netList) /* Netlist being routed */
{
#ifdef notdef
CZone *czones, *cz;
@ -263,8 +263,8 @@ glPenCompute(chanList, netList)
*/
CZone *
glPenFindCZones(chanList)
GCRChannel *chanList; /* All the channels in the routing problem */
glPenFindCZones(
GCRChannel *chanList) /* All the channels in the routing problem */
{
CZone *czList;
DensMap *dmap;
@ -300,11 +300,11 @@ glPenFindCZones(chanList)
*/
CZone *
glPenScanDens(czList, ch, dm, type)
CZone *czList; /* Prepend to this list */
GCRChannel *ch; /* Which channel is being processed */
DensMap *dm; /* Map to search */
int type; /* Type of zone: CZ_ROW or CZ_COL */
glPenScanDens(
CZone *czList, /* Prepend to this list */
GCRChannel *ch, /* Which channel is being processed */
DensMap *dm, /* Map to search */
int type) /* Type of zone: CZ_ROW or CZ_COL */
{
short *val = dm->dm_value;
CZone *cz;
@ -381,9 +381,9 @@ glPenScanDens(czList, ch, dm, type)
*/
void
glPenAssignCosts(cz, netList)
CZone *cz; /* A single CZone being processed */
NLNetList *netList; /* List of all nets; we look for nets that cross
glPenAssignCosts(
CZone *cz, /* A single CZone being processed */
NLNetList *netList) /* List of all nets; we look for nets that cross
* this zone.
*/
{
@ -484,8 +484,9 @@ glPenAssignCosts(cz, netList)
*/
int
glPenSortNetSet(ns1, ns2)
NetSet **ns1, **ns2;
glPenSortNetSet(
NetSet **ns1,
NetSet **ns2)
{
if ((*ns1)->ns_cost > (*ns2)->ns_cost) return 1;
if ((*ns1)->ns_cost < (*ns2)->ns_cost) return -1;
@ -518,9 +519,9 @@ struct glCrossClient
};
NetSet *
glPenFindCrossingNets(cz, netList)
CZone *cz; /* A single CZone being processed */
NLNetList *netList; /* List of all nets; we look for nets that cross
glPenFindCrossingNets(
CZone *cz, /* A single CZone being processed */
NLNetList *netList) /* List of all nets; we look for nets that cross
* this zone.
*/
{
@ -566,10 +567,11 @@ glPenFindCrossingNets(cz, netList)
/*ARGSUSED*/
int
glPenFindCrossingFunc(cz, srcPin, dstPin, rcc)
CZone *cz; /* UNUSED */
GCRPin *srcPin, *dstPin; /* UNUSED */
struct glCrossClient *rcc;
glPenFindCrossingFunc(
CZone *cz, /* UNUSED */
GCRPin *srcPin,
GCRPin *dstPin,
struct glCrossClient *rcc)
{
NetSet *ns;
@ -615,11 +617,11 @@ glPenFindCrossingFunc(cz, srcPin, dstPin, rcc)
*/
int
glPenEnumCross(cz, rp, func, cdata)
CZone *cz; /* Look for segments passing through here */
GlPoint *rp; /* List of GlPoints (linked by gl_path ptrs) */
int (*func)(); /* Apply to each segment passing through cz */
ClientData cdata; /* Passed to (*func)() */
glPenEnumCross(
CZone *cz, /* Look for segments passing through here */
GlPoint *rp, /* List of GlPoints (linked by gl_path ptrs) */
int (*func)(), /* Apply to each segment passing through cz */
ClientData cdata) /* Passed to (*func)() */
{
GCRPin *srcPin, *dstPin;
int cSrc, cDst;
@ -674,9 +676,9 @@ glPenEnumCross(cz, rp, func, cdata)
*/
int
glPenRerouteNetCost(cz, net)
CZone *cz;
NLNet *net; /* Net to be rerouted */
glPenRerouteNetCost(
CZone *cz,
NLNet *net) /* Net to be rerouted */
{
NetClient *nc = (NetClient *) net->nnet_cdata;
CZone fakeCZ;
@ -707,11 +709,11 @@ glPenRerouteNetCost(cz, net)
/*ARGSUSED*/
int
glPenRouteCost(rootUse, bestPath, pNetId, pCost)
CellUse *rootUse; /* UNUSED */
GlPoint *bestPath; /* Best path for this segment */
NetId *pNetId; /* UNUSED */
int *pCost; /* Add bestPath->gl_cost to this */
glPenRouteCost(
CellUse *rootUse, /* UNUSED */
GlPoint *bestPath, /* Best path for this segment */
NetId *pNetId, /* UNUSED */
int *pCost) /* Add bestPath->gl_cost to this */
{
*pCost += bestPath->gl_cost;
return 0;
@ -739,10 +741,10 @@ glPenRouteCost(rootUse, bestPath, pNetId, pCost)
*/
int
glPenDeleteNet(dm, list, cz)
DensMap *dm; /* Update this map */
List *list; /* List of paths */
CZone *cz; /* Remove all segments passing through 'cz' from 'dm' */
glPenDeleteNet(
DensMap *dm, /* Update this map */
List *list, /* List of paths */
CZone *cz) /* Remove all segments passing through 'cz' from 'dm' */
{
for ( ; list; list = LIST_TAIL(list))
(void) glPenEnumCross(cz, (GlPoint *) LIST_FIRST(list),
@ -768,10 +770,11 @@ glPenDeleteNet(dm, list, cz)
*/
int
glPenDeleteFunc(cz, srcPin, dstPin, dm)
CZone *cz; /* Being passed through by srcPin..dstPin */
GCRPin *srcPin, *dstPin; /* Two pins in cz->cz_chan */
DensMap *dm; /* Remove srcPin..dstPin segment from 'dm' */
glPenDeleteFunc(
CZone *cz, /* Being passed through by srcPin..dstPin */
GCRPin *srcPin,
GCRPin *dstPin,
DensMap *dm) /* Remove srcPin..dstPin segment from 'dm' */
{
int n;
int lo, hi;
@ -819,8 +822,8 @@ glPenDeleteFunc(cz, srcPin, dstPin, dm)
*/
void
glPenCleanNet(net)
NLNet *net;
glPenCleanNet(
NLNet *net)
{
List *list;
NetClient *nc;
@ -851,10 +854,10 @@ glPenCleanNet(net)
*/
void
glPenSavePath(rootUse, path, pNetId)
CellUse *rootUse; /* UNUSED */
GlPoint *path; /* Path linked via gl_path pointers */
NetId *pNetId; /* Net and segment identifier */
glPenSavePath(
CellUse *rootUse, /* UNUSED */
GlPoint *path, /* Path linked via gl_path pointers */
NetId *pNetId) /* Net and segment identifier */
{
GlPoint *newpath;
NetClient *nc;
@ -884,8 +887,8 @@ glPenSavePath(rootUse, path, pNetId)
*/
void
glPenDensitySet(net)
NLNet *net;
glPenDensitySet(
NLNet *net)
{
NetClient *nc = (NetClient *) net->nnet_cdata;
GCRPin *srcPin, *dstPin;

View File

@ -58,10 +58,10 @@ static char sccsid[] = "@(#)groutePin.c 4.9 MAGIC (Berkeley) 12/8/85";
*/
GCRPin *
glPointToPin(ch, side, point)
GCRChannel *ch; /* The channel containing the point */
int side; /* Side of ch that point lies on */
Point *point; /* The point to be converted to a pin */
glPointToPin(
GCRChannel *ch, /* The channel containing the point */
int side, /* Side of ch that point lies on */
Point *point) /* The point to be converted to a pin */
{
int coord;
@ -131,8 +131,8 @@ glPointToPin(ch, side, point)
*/
void
GLInitPins(ch)
GCRChannel *ch;
GLInitPins(
GCRChannel *ch)
{
glPinArrayInit(ch, GEO_NORTH, ch->gcr_tPins, ch->gcr_length);
glPinArrayInit(ch, GEO_SOUTH, ch->gcr_bPins, ch->gcr_length);
@ -141,10 +141,11 @@ GLInitPins(ch)
}
void
glPinArrayInit(ch, side, pins, nPins)
GCRChannel *ch;
GCRPin *pins;
int nPins;
glPinArrayInit(
GCRChannel *ch,
int side,
GCRPin *pins,
int nPins)
{
GCRPin *pin, *linked;
GCRChannel *adjacent;
@ -275,8 +276,8 @@ glPinArrayInit(ch, side, pins, nPins)
*/
bool
GLBlockPins(ch)
GCRChannel *ch;
GLBlockPins(
GCRChannel *ch)
{
bool changed;
@ -294,13 +295,13 @@ GLBlockPins(ch)
}
bool
glPinArrayBlock(ch, pins, opins, nPins)
GCRChannel *ch; /* Channel pins belong to */
GCRPin *pins; /* Processing this side of channel */
GCRPin *opins; /* Pins on opposite side; used only if ch is a
glPinArrayBlock(
GCRChannel *ch, /* Channel pins belong to */
GCRPin *pins, /* Processing this side of channel */
GCRPin *opins, /* Pins on opposite side; used only if ch is a
* river-routing channel.
*/
int nPins; /* Number of internal pins (not counting pins[0]) */
int nPins) /* Number of internal pins (not counting pins[0]) */
{
bool changed, isRiver = (ch->gcr_type != CHAN_NORMAL);
GCRPin *pin, *opin, *linked;
@ -353,8 +354,8 @@ glPinArrayBlock(ch, pins, opins, nPins)
*/
void
GLLinkPins(ch)
GCRChannel *ch;
GLLinkPins(
GCRChannel *ch)
{
glPinArrayLink(ch->gcr_tPins, ch->gcr_length);
glPinArrayLink(ch->gcr_bPins, ch->gcr_length);
@ -363,9 +364,9 @@ GLLinkPins(ch)
}
void
glPinArrayLink(pins, nPins)
GCRPin *pins;
int nPins;
glPinArrayLink(
GCRPin *pins,
int nPins)
{
GCRPin *pin, *lastPin, *lastValid;
@ -386,8 +387,8 @@ glPinArrayLink(pins, nPins)
}
}
glShowPin(pin)
GCRPin *pin;
glShowPin(
GCRPin *pin)
{
char mesg[256];
Rect r, area;
@ -453,8 +454,8 @@ glShowPin(pin)
*/
void
GLFixStemPins(ch)
GCRChannel *ch;
GLFixStemPins(
GCRChannel *ch)
{
glPinArrayFixStems(ch->gcr_tPins, ch->gcr_length);
glPinArrayFixStems(ch->gcr_bPins, ch->gcr_length);
@ -463,9 +464,9 @@ GLFixStemPins(ch)
}
void
glPinArrayFixStems(pins, nPins)
GCRPin *pins;
int nPins;
glPinArrayFixStems(
GCRPin *pins,
int nPins)
{
GCRPin *pin, *lastPin;

View File

@ -111,9 +111,9 @@ void glShowCross();
*/
void
GlTest(w, cmd)
MagWindow *w;
TxCommand *cmd;
GlTest(
MagWindow *w,
TxCommand *cmd)
{
int glDebugSides();
typedef enum { CLRDEBUG, ONLYNET, SETDEBUG, SHOWDEBUG, SIDES } cmdType;
@ -209,8 +209,8 @@ badCmd:
}
int
glDebugSides(side)
Side *side;
glDebugSides(
Side *side)
{
char mesg[256];
CellDef *def = EditCellUse->cu_def;
@ -311,9 +311,10 @@ GlInit()
*/
void
glShowPath(dest, root, kind)
GlPoint *dest, *root;
int kind;
glShowPath(
GlPoint *dest,
GlPoint *root,
int kind)
{
static NetId dummyId = { 0, 0 };
GlPoint *temp;
@ -343,10 +344,10 @@ glShowPath(dest, root, kind)
*/
void
glShowCross(pin, netId, kind)
GCRPin *pin; /* Pin itself */
NetId netId; /* Identifies net and segment for this pin */
int kind; /* Determines kind of display; see above */
glShowCross(
GCRPin *pin, /* Pin itself */
NetId netId, /* Identifies net and segment for this pin */
int kind) /* Determines kind of display; see above */
{
char *name, name1[1024], name2[1024];
int style;
@ -402,8 +403,10 @@ glShowCross(pin, netId, kind)
*/
void
glHistoAdd(heapPtsBefore, frontierPtsBefore, startPtsBefore)
int heapPtsBefore, frontierPtsBefore, startPtsBefore;
glHistoAdd(
int heapPtsBefore,
int frontierPtsBefore,
int startPtsBefore)
{
GlNetHisto *gh;
@ -575,9 +578,9 @@ glStatsInit()
*/
void
glStatsDone(numNets, numTerms)
int numNets;
int numTerms;
glStatsDone(
int numNets,
int numTerms)
{
if (DebugIsSet(glDebugID, glDebVerbose))

View File

@ -233,7 +233,7 @@ extern CellUse *glChanUse;
/* Internal procedures */
GlPoint *glPathNew();
GlPoint *glPathCopyPerm();
GlPoint *glProcessLoc();
GlPoint *glProcessLoc(GlPoint *startList, NLTermLoc *loc, int bestCost, bool doFast);
Tile *glChanPinToTile();
void glCrossMark();