router: convert K&R function definitions to ANSI C

Convert the old-style (K&R) function definitions in router/ 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 the router headers (router.h, routerInt.h) and adds forward
typedefs for the netlist types (NLTermLoc, NLTerm, NLNet) named by the new
prototypes.

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

View File

@ -26,6 +26,16 @@
#include "database/database.h"
#include "utils/geometry.h"
/* Forward declaration to avoid pulling in utils/netlist.h */
struct nlNetList;
typedef struct nlNetList NLNetList;
struct nlTermLoc;
typedef struct nlTermLoc NLTermLoc;
struct nlTerm;
typedef struct nlTerm NLTerm;
struct nlNet;
typedef struct nlNet NLNet;
/* Masks of directions */
#define DIRTOMASK(d) (1 << (d))
#define DIRMASKHASDIR(m, d) ((m) & DIRTOMASK(d))
@ -185,9 +195,9 @@ extern void RtrMilestoneDone();
extern void RtrChannelDensity();
extern void RtrChannelRoute();
extern void RtrChannelCleanObstacles();
extern void RtrStemProcessAll();
extern void RtrStemProcessAll(CellUse *use, NLNetList *netList, bool doWarn, bool (*func)());
extern void RtrPaintBack();
extern bool RtrStemAssignExt();
extern bool RtrStemAssignExt(CellUse *use, bool doWarn, NLTermLoc *loc, NLTerm *term, NLNet *net);
extern void RtrPinsInit();
extern void RtrHazards();
extern void RtrPinsLink();

View File

@ -38,8 +38,8 @@ extern int rtrPinArrayInit();
extern int rtrPinArrayLink();
extern int rtrSidePassToClient();
extern int rtrSideProcess();
extern int rtrXDist();
extern int rtrYDist();
extern int rtrXDist(Tile *tiles[], int x, bool isRight);
extern int rtrYDist(Tile *tiles[], Point *point, bool up, Plane *plane);
extern int rtrStemContactLine();
extern int rtrStemTypes();
extern int rtrSrTraverse();

View File

@ -89,9 +89,9 @@ extern void rtrChannelObstaclePins();
*/
void
RtrChannelRoute(ch, pCount)
GCRChannel *ch;
int *pCount;
RtrChannelRoute(
GCRChannel *ch,
int *pCount)
{
GCRChannel *flipped, *flipped_again, *copy;
int errs1, errs2;
@ -214,11 +214,11 @@ bottom:
*/
void
RtrChannelBounds(loc, pLength, pWidth, origin)
Rect *loc; /* Area the channel is to occupy */
int *pLength; /* Filled in with # columns in channel */
int *pWidth; /* Filled in with # rows in channel */
Point *origin; /* Filled in with coords of (0,0) grid point
RtrChannelBounds(
Rect *loc, /* Area the channel is to occupy */
int *pLength, /* Filled in with # columns in channel */
int *pWidth, /* Filled in with # rows in channel */
Point *origin) /* Filled in with coords of (0,0) grid point
* (one grid line below and to left of first
* usable grid point)
*/
@ -285,9 +285,9 @@ RtrChannelBounds(loc, pLength, pWidth, origin)
*/
void
RtrChannelObstacles(use, ch)
CellUse *use;
GCRChannel * ch;
RtrChannelObstacles(
CellUse *use,
GCRChannel * ch)
{
int l, w, up = RtrSubcellSepUp, down = RtrSubcellSepDown;
TileTypeBitMask allObs;
@ -342,8 +342,8 @@ RtrChannelObstacles(use, ch)
*/
void
rtrChannelObstaclePins(ch)
GCRChannel *ch;
rtrChannelObstaclePins(
GCRChannel *ch)
{
short **res;
int row, col, end;
@ -412,10 +412,10 @@ rtrChannelObstaclePins(ch)
*/
int
rtrChannelObstacleMark(tile, dinfo, cxp)
Tile *tile;
TileType dinfo; /* (unused) */
TreeContext *cxp;
rtrChannelObstacleMark(
Tile *tile,
TileType dinfo, /* (unused) */
TreeContext *cxp)
{
short **mcol, *mrow, *mrowend, mask;
GCRChannel *ch = (GCRChannel *) cxp->tc_filter->tf_arg;
@ -514,8 +514,8 @@ rtrChannelObstacleMark(tile, dinfo, cxp)
*/
void
RtrChannelDensity(ch)
GCRChannel *ch;
RtrChannelDensity(
GCRChannel *ch)
{
short *hdens, *vdens, *rptr;
int col, density;
@ -587,8 +587,8 @@ RtrChannelDensity(ch)
*/
void
RtrChannelCleanObstacles(ch)
GCRChannel *ch;
RtrChannelCleanObstacles(
GCRChannel *ch)
{
short *rptr;
int row, rtop;

View File

@ -76,9 +76,9 @@ bool RtrMazeStems = FALSE; /* Set by default to original behavior */
*/
void
CmdGARouterTest(w, cmd)
MagWindow *w;
TxCommand *cmd;
CmdGARouterTest(
MagWindow *w,
TxCommand *cmd)
{
GATest(w, cmd);
}
@ -103,9 +103,9 @@ CmdGARouterTest(w, cmd)
*/
void
CmdGRouterTest(w, cmd)
MagWindow *w;
TxCommand *cmd;
CmdGRouterTest(
MagWindow *w,
TxCommand *cmd)
{
GlTest(w, cmd);
}
@ -130,9 +130,9 @@ CmdGRouterTest(w, cmd)
*/
void
CmdIRouterTest(w, cmd)
MagWindow *w;
TxCommand *cmd;
CmdIRouterTest(
MagWindow *w,
TxCommand *cmd)
{
IRTest(w, cmd);
}
@ -157,9 +157,9 @@ CmdIRouterTest(w, cmd)
*/
void
CmdMZRouterTest(w, cmd)
MagWindow *w;
TxCommand *cmd;
CmdMZRouterTest(
MagWindow *w,
TxCommand *cmd)
{
MZTest(w, cmd);
}
@ -188,9 +188,9 @@ CmdMZRouterTest(w, cmd)
*/
void
CmdChannel(w, cmd)
MagWindow *w;
TxCommand *cmd;
CmdChannel(
MagWindow *w,
TxCommand *cmd)
{
Rect newBox;
CellDef *def, *RtrDecomposeName();
@ -227,10 +227,10 @@ CmdChannel(w, cmd)
}
int
cmdChannelFunc(tile, dinfo, clientdata)
Tile *tile;
TileType dinfo; /* (unused) */
ClientData clientdata; /* (unused) */
cmdChannelFunc(
Tile *tile,
TileType dinfo, /* (unused) */
ClientData clientdata) /* (unused) */
{
Rect area, rootArea;
@ -258,9 +258,9 @@ cmdChannelFunc(tile, dinfo, clientdata)
*/
void
CmdGaRoute(w, cmd)
MagWindow *w;
TxCommand *cmd;
CmdGaRoute(
MagWindow *w,
TxCommand *cmd)
{
typedef enum { CHANNEL, GEN, HELP, NOWARN, RESET, ROUTE, WARN } cmdType;
static char *chanTypeName[] = { "NORMAL", "HRIVER", "VRIVER" };
@ -459,9 +459,9 @@ badChanCmd:
*/
void
CmdIRoute(w, cmd)
MagWindow *w;
TxCommand *cmd;
CmdIRoute(
MagWindow *w,
TxCommand *cmd)
{
IRCommand(w,cmd);
@ -506,9 +506,9 @@ CmdIRoute(w, cmd)
#define ROUTERMAZESTEMS 19
void
CmdRoute(w, cmd)
MagWindow *w;
TxCommand *cmd;
CmdRoute(
MagWindow *w,
TxCommand *cmd)
{
int option;
GCRChannel *ch;
@ -782,9 +782,9 @@ usage2:
*/
void
CmdSeeFlags(w, cmd)
MagWindow * w;
TxCommand *cmd;
CmdSeeFlags(
MagWindow * w,
TxCommand *cmd)
{
Rect rootRect;
Point point;

View File

@ -75,7 +75,7 @@ Rect RouteArea;
/* Forward declarations */
extern int rtrSrCells();
extern void rtrRoundRect();
extern void rtrRoundRect(Rect *r, int sepUp, int sepDown, bool doRoundUp);
extern void rtrHashKill();
extern void rtrSplitToArea();
extern void rtrMarkChannel();
@ -104,10 +104,10 @@ bool rtrUseCorner();
*/
CellDef *
RtrDecomposeName(routeUse, area, name)
CellUse *routeUse; /* Cell to be decomposed */
Rect *area; /* Confine channels to this area */
char *name; /* Name of netlist if non-NULL; otherwise, use the
RtrDecomposeName(
CellUse *routeUse, /* Cell to be decomposed */
Rect *area, /* Confine channels to this area */
char *name) /* Name of netlist if non-NULL; otherwise, use the
* name of the current netlist or that of routeUse
* as described above.
*/
@ -164,10 +164,10 @@ RtrDecomposeName(routeUse, area, name)
*/
CellDef *
RtrDecompose(routeUse, area, netList)
CellUse *routeUse;
Rect *area;
NLNetList *netList;
RtrDecompose(
CellUse *routeUse,
Rect *area,
NLNetList *netList)
{
SearchContext scx;
CellDef *cdTo;
@ -312,9 +312,9 @@ RtrFindChannelDef()
*/
int
rtrSrCells(scx, targetDef)
SearchContext *scx; /* The cell to be painted */
CellDef *targetDef; /* The def into which the silhouette is painted */
rtrSrCells(
SearchContext *scx, /* The cell to be painted */
CellDef *targetDef) /* The def into which the silhouette is painted */
{
CellDef *def = scx->scx_use->cu_def;
Rect rootBbox, gridBbox;
@ -367,10 +367,11 @@ rtrSrCells(scx, targetDef)
*/
void
rtrRoundRect(r, sepUp, sepDown, doRoundUp)
Rect *r;
int sepUp, sepDown;
bool doRoundUp;
rtrRoundRect(
Rect *r,
int sepUp,
int sepDown,
bool doRoundUp)
{
int halfGrid = RtrGridSpacing / 2;
@ -425,8 +426,8 @@ rtrRoundRect(r, sepUp, sepDown, doRoundUp)
*/
void
rtrHashKill(ht)
HashTable *ht;
rtrHashKill(
HashTable *ht)
{
HashEntry *he;
HashSearch hs;
@ -454,9 +455,9 @@ rtrHashKill(ht)
*/
void
rtrSplitToArea(area, def)
Rect *area; /* Routing area */
CellDef *def; /* Def holding routing results */
rtrSplitToArea(
Rect *area, /* Routing area */
CellDef *def) /* Def holding routing results */
{
Tile *tile;
Point p;
@ -522,10 +523,10 @@ rtrSplitToArea(area, def)
*/
int
rtrSrClear(tile, dinfo, area)
Tile *tile;
TileType dinfo;
Rect *area;
rtrSrClear(
Tile *tile,
TileType dinfo,
Rect *area)
{
/* Clear all */
rtrCLEAR(tile, -1);
@ -581,10 +582,10 @@ rtrSrClear(tile, dinfo, area)
*/
int
rtrSrFunc(tile, dinfo, plane)
Tile *tile; /* Candidate cell tile */
TileType dinfo; /* Split tile information (unused) */
Plane *plane; /* Plane in which searches take place */
rtrSrFunc(
Tile *tile, /* Candidate cell tile */
TileType dinfo, /* Split tile information (unused) */
Plane *plane) /* Plane in which searches take place */
{
Tile *tiles[3];
Point p;
@ -639,11 +640,11 @@ rtrSrFunc(tile, dinfo, plane)
*/
bool
rtrUseCorner(point, corner, plane, tiles)
Point *point; /* Point at which a cell corner is found */
int corner; /* Selects NE, NW, SE, or SW cell corner */
Plane *plane; /* Plane to be searched for tiles */
Tile *tiles[]; /* Return pointers to found space tiles */
rtrUseCorner(
Point *point, /* Point at which a cell corner is found */
int corner, /* Selects NE, NW, SE, or SW cell corner */
Plane *plane, /* Plane to be searched for tiles */
Tile *tiles[]) /* Return pointers to found space tiles */
{
Point p0, p1;
Tile * tile;
@ -723,11 +724,11 @@ rtrUseCorner(point, corner, plane, tiles)
*/
void
rtrMarkChannel(plane, tiles, point, corner)
Plane *plane; /* Plane for searching */
Tile *tiles[]; /* Bordering space tiles */
Point *point; /* Coordinates of corner */
int corner; /* Corner of tile to process */
rtrMarkChannel(
Plane *plane, /* Plane for searching */
Tile *tiles[], /* Bordering space tiles */
Point *point, /* Coordinates of corner */
int corner) /* Corner of tile to process */
{
int xDist, yDist, d1, d2, lastY;
Tile *tile, *new;
@ -846,11 +847,11 @@ rtrMarkChannel(plane, tiles, point, corner)
*/
int
rtrYDist(tiles, point, up, plane)
Tile *tiles[]; /* Start tile in [1]. Put bottom tile in [0] */
Point *point; /* Point from which distance is measure */
bool up; /* TRUE if search up, FALSE if down */
Plane *plane; /* Cell plane for search */
rtrYDist(
Tile *tiles[], /* Start tile in [1]. Put bottom tile in [0] */
Point *point, /* Point from which distance is measure */
bool up, /* TRUE if search up, FALSE if down */
Plane *plane) /* Cell plane for search */
{
Tile *current = tiles[1], *next;
int x, yStart, flag;
@ -954,10 +955,10 @@ rtrYDist(tiles, point, up, plane)
*/
int
rtrXDist(tiles, x, isRight)
Tile *tiles[]; /* Space tiles bordering the corner */
int x; /* Starting x for distance calculation */
bool isRight; /* TRUE if right, FALSE if left */
rtrXDist(
Tile *tiles[], /* Space tiles bordering the corner */
int x, /* Starting x for distance calculation */
bool isRight) /* TRUE if right, FALSE if left */
{
int l0, l1;
@ -987,7 +988,11 @@ rtrXDist(tiles, x, isRight)
*/
void
rtrMerge(Tile **delay1, Tile *tup, Tile *tdn, Plane *plane)
rtrMerge(
Tile **delay1,
Tile *tup,
Tile *tdn,
Plane *plane)
{
Tile *side;

View File

@ -82,12 +82,12 @@ int rtrFNum; /* Says which list is active */
*/
void
RtrChannelError(ch, col, track, msg, net)
GCRChannel *ch; /* Channel where error occurred. */
int col; /* Column where error occurred. */
int track; /* Track where error occurred. */
char *msg; /* Message identifying error. */
NLNet *net; /* Net where error occurred */
RtrChannelError(
GCRChannel *ch, /* Channel where error occurred. */
int col, /* Column where error occurred. */
int track, /* Track where error occurred. */
char *msg, /* Message identifying error. */
NLNet *net) /* Net where error occurred */
{
Rect box;
Point old, new;
@ -170,9 +170,9 @@ rtrFBClear()
*/
void
rtrFBAdd(r, t)
Rect * r;
char * t;
rtrFBAdd(
Rect * r,
char * t)
{
RtrFB * new;
@ -201,8 +201,8 @@ rtrFBAdd(r, t)
*/
void
RtrFBPaint(num)
int num; /* Selects which list to use */
RtrFBPaint(
int num) /* Selects which list to use */
{
RtrFB *temp;

View File

@ -45,7 +45,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
/* Forward declarations */
extern void rtrFindEnds();
extern void rtrFlag();
extern void rtrFlag(GCRChannel * ch, int cl, int cr, int rb, int rt, bool isHoriz);
/*
@ -84,8 +84,8 @@ extern void rtrFlag();
*/
void
RtrHazards(ch)
GCRChannel *ch; /* The channel to be flagged */
RtrHazards(
GCRChannel *ch) /* The channel to be flagged */
{
short **map, **rtrHeights(), **rtrWidths(), **height, **width;
short *hcol, *wcol, *mcol;
@ -231,8 +231,8 @@ RtrHazards(ch)
*/
short **
rtrHeights(ch)
GCRChannel * ch; /* Channel to be processed */
rtrHeights(
GCRChannel * ch) /* Channel to be processed */
{
short **heights, *obstacles, *hcol;
int i, row;
@ -303,8 +303,8 @@ rtrHeights(ch)
*/
short **
rtrWidths(ch)
GCRChannel * ch;
rtrWidths(
GCRChannel * ch)
{
short **widths, **map;
int col, i;
@ -377,13 +377,13 @@ rtrWidths(ch)
*/
void
rtrFindEnds(ch, isHoriz, bot, top, lo, hi)
GCRChannel *ch;
int isHoriz; /* 1 if to find horizontal ends */
int bot; /* Low range to be scanned */
int top; /* High range to be scanned */
int *lo; /* Low range of result. Also starting col or row. */
int *hi; /* High range of result */
rtrFindEnds(
GCRChannel *ch,
int isHoriz, /* 1 if to find horizontal ends */
int bot, /* Low range to be scanned */
int top, /* High range to be scanned */
int *lo, /* Low range of result. Also starting col or row. */
int *hi) /* High range of result */
{
int col, row;
short **map;
@ -488,11 +488,13 @@ gotVL:
*/
void
rtrFlag(ch, cl, cr, rb, rt, isHoriz)
GCRChannel * ch; /* Channel whose flag array is to be set */
int cl, cr; /* Left and right limits of columns to be set */
int rb, rt; /* Bottom and top limits of rows to be set */
bool isHoriz; /* TRUE if left/right flags, else top/bottom */
rtrFlag(
GCRChannel * ch, /* Channel whose flag array is to be set */
int cl,
int cr,
int rb,
int rt,
bool isHoriz) /* TRUE if left/right flags, else top/bottom */
{
int extra, limit, r, c;
short ** map;

View File

@ -86,9 +86,9 @@ Point RtrOrigin = { 0, 0 };
*/
void
Route(routeUse, routeArea)
CellUse *routeUse;
Rect *routeArea;
Route(
CellUse *routeUse,
Rect *routeArea)
{
CellDef *channelDef;
int errs, numNets;
@ -171,13 +171,13 @@ done:
*/
int
rtrMakeChannel(tile, dinfo, clipBox)
Tile *tile; /* Potential channel tile; we create a channel whose
rtrMakeChannel(
Tile *tile, /* Potential channel tile; we create a channel whose
* area is equal to that of this tile if the type of
* this tile is TT_SPACE.
*/
TileType dinfo; /* Split tile information (unused) */
Rect *clipBox; /* If non-NULL, clip the channel area to this box */
TileType dinfo, /* Split tile information (unused) */
Rect *clipBox) /* If non-NULL, clip the channel area to this box */
{
int length, width;
HashEntry *entry;
@ -256,8 +256,8 @@ RtrRunStats()
}
void
RtrMilestoneStart(event)
char *event;
RtrMilestoneStart(
char *event)
{
rtrMilestoneName = event;
TxPrintf("%s: ", event);

View File

@ -72,9 +72,9 @@ bool rtrDoVia();
*/
void
RtrPaintBack(ch, def)
GCRChannel * ch;
CellDef *def;
RtrPaintBack(
GCRChannel * ch,
CellDef *def)
{
if(RtrDoMMax) /*Change poly to metal where possible */
rtrMaxMetal(ch);
@ -102,9 +102,9 @@ RtrPaintBack(ch, def)
*/
void
rtrPaintRows(def, ch)
CellDef *def; /* Def into which paint will go */
GCRChannel *ch; /* Channel being painted */
rtrPaintRows(
CellDef *def, /* Def into which paint will go */
GCRChannel *ch) /* Channel being painted */
{
TileType curType, nextType;
short **result, code;
@ -230,9 +230,9 @@ rtrPaintRows(def, ch)
*/
void
rtrPaintColumns(def, ch)
CellDef * def;
GCRChannel * ch;
rtrPaintColumns(
CellDef * def,
GCRChannel * ch)
{
TileType curType; /* Describes what kind of material currently
* occupies the column. It's either RtrMetalType,
@ -339,10 +339,10 @@ rtrPaintColumns(def, ch)
*/
bool
rtrDoVia(ch, col, row)
GCRChannel *ch; /* The channel undergoing display */
int col; /* The x coordinate of the location considered */
int row; /* The y coordinate of the location considered */
rtrDoVia(
GCRChannel *ch, /* The channel undergoing display */
int col, /* The x coordinate of the location considered */
int row) /* The y coordinate of the location considered */
{
short up, down, left, right, mask;
short **result, code;
@ -430,8 +430,8 @@ rtrDoVia(ch, col, row)
*/
void
rtrMaxMetal(ch)
GCRChannel * ch;
rtrMaxMetal(
GCRChannel * ch)
{
bool needLowX, needHiX, hasLowX, hasHiX, active, cross;
int x, y, i, bottom, top;
@ -569,10 +569,10 @@ rtrMaxMetal(ch)
*/
bool
rtrMetalOkay(ch, col, dir)
GCRChannel *ch; /* The originating channel for the search */
int col; /* The crossing column in the originating channel */
int dir; /* Direction of the crossing NORTH or SOUTH */
rtrMetalOkay(
GCRChannel *ch, /* The originating channel for the search */
int col, /* The crossing column in the originating channel */
int dir) /* Direction of the crossing NORTH or SOUTH */
{
GCRChannel *newCh;
GCRPin *pin;
@ -622,9 +622,9 @@ rtrMetalOkay(ch, col, dir)
*/
void
RtrPaintContact(def, area)
CellDef *def; /* Cell in which to paint contact. */
Rect *area; /* Area in which to paint the contact. */
RtrPaintContact(
CellDef *def, /* Cell in which to paint contact. */
Rect *area) /* Area in which to paint the contact. */
{
Rect larger;
@ -659,9 +659,9 @@ RtrPaintContact(def, area)
*/
void
RtrPaintStats(type, distance)
TileType type;
int distance;
RtrPaintStats(
TileType type,
int distance)
{
if (distance < 0) distance = -distance;

View File

@ -79,8 +79,8 @@ void rtrPinShow(GCRPin *);
*/
void
RtrPinsInit(ch)
GCRChannel *ch;
RtrPinsInit(
GCRChannel *ch)
{
rtrPinArrayInit(ch, GEO_NORTH, ch->gcr_tPins, ch->gcr_length);
rtrPinArrayInit(ch, GEO_SOUTH, ch->gcr_bPins, ch->gcr_length);
@ -89,11 +89,11 @@ RtrPinsInit(ch)
}
int
rtrPinArrayInit(ch, side, pins, nPins)
GCRChannel *ch;
int side;
GCRPin *pins;
int nPins;
rtrPinArrayInit(
GCRChannel *ch,
int side,
GCRPin *pins,
int nPins)
{
GCRPin *pin, *linked;
GCRChannel *adjacent;
@ -212,10 +212,10 @@ rtrPinArrayInit(ch, side, pins, nPins)
*/
GCRPin *
RtrPointToPin(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 */
RtrPointToPin(
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;
@ -286,8 +286,8 @@ RtrPointToPin(ch, side, point)
*/
bool
RtrPinsBlock(ch)
GCRChannel *ch;
RtrPinsBlock(
GCRChannel *ch)
{
bool changed;
@ -305,13 +305,13 @@ RtrPinsBlock(ch)
}
bool
rtrPinArrayBlock(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
rtrPinArrayBlock(
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;
@ -364,8 +364,8 @@ rtrPinArrayBlock(ch, pins, opins, nPins)
*/
void
RtrPinsLink(ch)
GCRChannel *ch;
RtrPinsLink(
GCRChannel *ch)
{
rtrPinArrayLink(ch->gcr_tPins, ch->gcr_length);
rtrPinArrayLink(ch->gcr_bPins, ch->gcr_length);
@ -374,9 +374,9 @@ RtrPinsLink(ch)
}
int
rtrPinArrayLink(pins, nPins)
GCRPin *pins;
int nPins;
rtrPinArrayLink(
GCRPin *pins,
int nPins)
{
GCRPin *pin, *lastPin, *lastValid;
@ -465,8 +465,8 @@ void rtrPinShow(pin)
*/
void
RtrPinsFixStems(ch)
GCRChannel *ch;
RtrPinsFixStems(
GCRChannel *ch)
{
rtrPinArrayFixStems(ch->gcr_tPins, ch->gcr_length);
rtrPinArrayFixStems(ch->gcr_bPins, ch->gcr_length);
@ -475,9 +475,9 @@ RtrPinsFixStems(ch)
}
int
rtrPinArrayFixStems(pins, nPins)
GCRPin *pins;
int nPins;
rtrPinArrayFixStems(
GCRPin *pins,
int nPins)
{
GCRPin *pin, *lastPin;

View File

@ -151,15 +151,15 @@ int rtrSideLookCellsFunc();
*/
int
rtrEnumSides(use, area, minChannelWidth, func, cdata)
CellUse *use; /* Enumerate sides of use->cu_def */
Rect *area; /* Only consider sides inside this area;
rtrEnumSides(
CellUse *use, /* Enumerate sides of use->cu_def */
Rect *area, /* Only consider sides inside this area;
* this does not include sides along the
* border.
*/
int minChannelWidth; /* See above */
int (*func)(); /* Applied to each Side found */
ClientData cdata; /* Passed to (*func)() */
int minChannelWidth, /* See above */
int (*func)(), /* Applied to each Side found */
ClientData cdata) /* Passed to (*func)() */
{
/* Create the yank buffer if it doesn't exist */
if (rtrSideTransUse == NULL)
@ -213,11 +213,11 @@ rtrEnumSides(use, area, minChannelWidth, func, cdata)
*/
int
rtrSideProcess(use, side, area, trans)
CellUse *use; /* Enumerating Sides of use->cu_def */
int side; /* Which sides (GEO_NORTH, etc) of cells to process */
Rect *area; /* Find sides in this area (in use->cu_def coords) */
Transform *trans; /* Transform from use->cu_def coords to those of the
rtrSideProcess(
CellUse *use, /* Enumerating Sides of use->cu_def */
int side, /* Which sides (GEO_NORTH, etc) of cells to process */
Rect *area, /* Find sides in this area (in use->cu_def coords) */
Transform *trans) /* Transform from use->cu_def coords to those of the
* cell tile plane where we actually try to find Sides.
*/
{
@ -285,10 +285,10 @@ rtrSideProcess(use, side, area, trans)
*/
int
rtrSideInitClient(tile, dinfo, client)
Tile *tile;
TileType dinfo;
ClientData client;
rtrSideInitClient(
Tile *tile,
TileType dinfo,
ClientData client)
{
if (IsSplit(tile))
if (TiGetLeftType(tile) != TT_SPACE && TiGetRightType(tile) != TT_SPACE)
@ -321,10 +321,10 @@ rtrSideInitClient(tile, dinfo, client)
*/
int
rtrEnumSidesFunc(tile, dinfo, clientdata)
Tile *tile;
TileType dinfo;
ClientData clientdata; /* (unused) */
rtrEnumSidesFunc(
Tile *tile,
TileType dinfo,
ClientData clientdata) /* (unused) */
{
int ybot, ytop, yprev, sep, x, origin;
Tile *tp, *tpB;
@ -487,8 +487,8 @@ rtrEnumSidesFunc(tile, dinfo, clientdata)
*/
int
rtrSidePassToClient(side)
Side *side;
rtrSidePassToClient(
Side *side)
{
side->side_search.r_ybot = side->side_line.r_ybot;
side->side_search.r_ytop = side->side_line.r_ytop;

View File

@ -131,11 +131,11 @@ bool RtrComputeJogs();
*/
void
RtrStemProcessAll(use, netList, doWarn, func)
CellUse *use;
NLNetList *netList;
bool doWarn;
bool (*func)();
RtrStemProcessAll(
CellUse *use,
NLNetList *netList,
bool doWarn,
bool (*func)())
{
NLTermLoc *loc, *locFirst, *locPrev, *locNext;
Rect errArea;
@ -236,12 +236,12 @@ out:
*/
bool
RtrStemAssignExt(use, doWarn, loc, term, net)
CellUse *use; /* Cell being routed (for feedback) */
bool doWarn; /* If TRUE, leave feedback for each bad loc */
NLTermLoc *loc; /* Location being assigned */
NLTerm *term; /* For nterm_name */
NLNet *net; /* For marking pin */
RtrStemAssignExt(
CellUse *use, /* Cell being routed (for feedback) */
bool doWarn, /* If TRUE, leave feedback for each bad loc */
NLTermLoc *loc, /* Location being assigned */
NLTerm *term, /* For nterm_name */
NLNet *net) /* For marking pin */
{
TileType type = loc->nloc_label->lab_type;
int dirMask, termWidth, pins;
@ -403,7 +403,10 @@ fail:
/* Routine to expand rectangle into touching tiles of a label's type. */
int
rtrStemExpandFunc(Tile *t, TileType dinfo, TreeContext *cxp)
rtrStemExpandFunc(
Tile *t,
TileType dinfo,
TreeContext *cxp)
{
SearchContext *scx = cxp->tc_scx;
Rect rsrc;
@ -465,10 +468,10 @@ rtrStemExpandFunc(Tile *t, TileType dinfo, TreeContext *cxp)
*/
GCRPin *
rtrStemTip(loc, si, use)
NLTermLoc *loc; /* Location whose stem tip is being found */
StemInfo *si; /* Stem information */
CellUse *use;
rtrStemTip(
NLTermLoc *loc, /* Location whose stem tip is being found */
StemInfo *si, /* Stem information */
CellUse *use)
{
Point plo, phi;
int *lo, *hi;
@ -546,11 +549,11 @@ rtrAbort(Tile *tile,
*/
GCRPin *
rtrStemTryPin(loc, dir, p, use)
NLTermLoc *loc; /* Try to assign the GCRPin for p to this loc */
int dir; /* Direction away from loc that p lies */
Point *p; /* Crossing point to try */
CellUse *use;
rtrStemTryPin(
NLTermLoc *loc, /* Try to assign the GCRPin for p to this loc */
int dir, /* Direction away from loc that p lies */
Point *p, /* Crossing point to try */
CellUse *use)
{
Point pSearch;
GCRChannel *ch;
@ -651,11 +654,11 @@ rtrStemTryPin(loc, dir, p, use)
*/
bool
rtrTreeSrArea(loc, dir, p, use)
NLTermLoc *loc; /* Terminal location under consideration */
int dir; /* Direction away from loc that p lies */
Point *p; /* Point at channel boundary */
CellUse *use; /* Parent cell use */
rtrTreeSrArea(
NLTermLoc *loc, /* Terminal location under consideration */
int dir, /* Direction away from loc that p lies */
Point *p, /* Point at channel boundary */
CellUse *use) /* Parent cell use */
{
Rect tmp, tmp1, tmp2;
Point contact, jog, start;
@ -719,11 +722,11 @@ rtrTreeSrArea(loc, dir, p, use)
}
bool
rtrSrArea(dir,use,tmp,delta)
int dir;
CellUse *use;
Rect *tmp;
int delta;
rtrSrArea(
int dir,
CellUse *use,
Rect *tmp,
int delta)
{
SearchContext scx;
TileTypeBitMask r1mask, r2mask;
@ -821,10 +824,10 @@ rtrSrArea(dir,use,tmp,delta)
*/
void
rtrStemRange(loc, dir, si)
NLTermLoc *loc; /* Terminal we're trying to find a stem for */
int dir; /* Direction away from loc that we're searching */
StemInfo *si; /* Fill this in if this direction looks best so far */
rtrStemRange(
NLTermLoc *loc, /* Terminal we're trying to find a stem for */
int dir, /* Direction away from loc that we're searching */
StemInfo *si) /* Fill this in if this direction looks best so far */
{
Rect *area = &loc->nloc_rect;
Point start, near, center;
@ -899,9 +902,10 @@ rtrStemRange(loc, dir, si)
*/
int
rtrStemContactLine(lo, hi, origin)
int lo, hi; /* Bottom and top, or left and right of terminal */
int origin; /* Coordinate of routing grid origin */
rtrStemContactLine(
int lo,
int hi,
int origin) /* Coordinate of routing grid origin */
{
int center;
@ -936,10 +940,10 @@ rtrStemContactLine(lo, hi, origin)
*/
GCRChannel *
rtrStemSearch(center, dir, point)
Point *center;
int dir;
Point *point;
rtrStemSearch(
Point *center,
int dir,
Point *point)
{
Tile *tile;
GCRChannel *ch;
@ -1012,9 +1016,9 @@ rtrStemSearch(center, dir, point)
*/
bool
RtrStemPaintExt(use, loc)
CellUse *use;
NLTermLoc *loc; /* Terminal whose stem is to be painted */
RtrStemPaintExt(
CellUse *use,
NLTermLoc *loc) /* Terminal whose stem is to be painted */
{
TileTypeBitMask startMask; /* Possible layers for first part of stem */
TileTypeBitMask finalMask; /* Possible layers for last part of stem */
@ -1135,18 +1139,18 @@ failure:
*/
bool
rtrStemMask(routeUse, loc, flags, startMask, finalMask)
CellUse *routeUse; /* Cell being routed */
NLTermLoc *loc; /* Terminal */
int flags; /* Blockage flags in the channel at the
rtrStemMask(
CellUse *routeUse, /* Cell being routed */
NLTermLoc *loc, /* Terminal */
int flags, /* Blockage flags in the channel at the
* crossing point. If a layer is marked
* as blocked in these flags, it is excluded
* from finalMask since the channel router
* will not have used it for routing a
* signal.
*/
TileTypeBitMask *startMask; /* Possible types for terminal */
TileTypeBitMask *finalMask; /* Possible types for stem tip */
TileTypeBitMask *startMask, /* Possible types for terminal */
TileTypeBitMask *finalMask) /* Possible types for stem tip */
{
Rect tmp;
@ -1193,9 +1197,11 @@ rtrStemMask(routeUse, loc, flags, startMask, finalMask)
}
int
rtrStemTypes(startMask, finalMask, startType, finalType)
TileTypeBitMask *startMask, *finalMask;
TileType *startType, *finalType;
rtrStemTypes(
TileTypeBitMask *startMask,
TileTypeBitMask *finalMask,
TileType *startType,
TileType *finalType)
{
if (!TTMaskHasType(finalMask, RtrMetalType))
{
@ -1240,20 +1246,20 @@ rtrStemTypes(startMask, finalMask, startType, finalType)
*/
bool
RtrComputeJogs(loc, stem, dir, contact, jog, start, width)
NLTermLoc *loc; /* Terminal whose stem is to be painted */
Point *stem; /* Point intersecting channel*/
int dir;
Point *contact; /* A second grid point, where a contact can
RtrComputeJogs(
NLTermLoc *loc, /* Terminal whose stem is to be painted */
Point *stem, /* Point intersecting channel*/
int dir,
Point *contact, /* A second grid point, where a contact can
* be placed if necessary. This is a the
* nearest grid crossing to crossing outside
* the channel.
*/
Point *jog; /* Where the stem crosses the first usable
Point *jog, /* Where the stem crosses the first usable
* grid line as it runs out from the cell.
*/
Point *start; /* Somewhere along terminal area */
int width;
Point *start, /* Somewhere along terminal area */
int width)
{
Rect *area;
area = &loc->nloc_rect;

View File

@ -129,10 +129,10 @@ RtrTechInit()
*/
bool
RtrTechLine(sectionName, argc, argv)
char *sectionName; /* Name of this section. */
int argc; /* Number of fields on line. */
char *argv[]; /* Values of fields. */
RtrTechLine(
char *sectionName, /* Name of this section. */
int argc, /* Number of fields on line. */
char *argv[]) /* Values of fields. */
{
TileTypeBitMask mask;
int type, width, i, distance;
@ -403,8 +403,9 @@ RtrTechFinal()
*/
int
RtrTechScale(scaled, scalen)
int scaled, scalen;
RtrTechScale(
int scaled,
int scalen)
{
int i;

View File

@ -114,32 +114,31 @@ struct rtrTileStack
*/
int
rtrSrTraverse(def, startArea, mask, connect, bounds, func, clientData)
CellDef *def; /* Cell definition in which to carry out
rtrSrTraverse(
CellDef *def, /* Cell definition in which to carry out
* the connectivity search. Only paint
* in this definition is considered.
*/
Rect *startArea; /* Area to search for an initial tile. Only
Rect *startArea, /* Area to search for an initial tile. Only
* tiles OVERLAPPING the area are considered.
* This area should have positive x and y
* dimensions.
*/
TileTypeBitMask *mask; /* Only tiles of one of these types are used
TileTypeBitMask *mask, /* Only tiles of one of these types are used
* as initial tiles.
*/
TileTypeBitMask *connect; /* Pointer to a table indicating what tile
TileTypeBitMask *connect, /* Pointer to a table indicating what tile
* types connect to what other tile types.
* Each entry gives a mask of types that
* connect to tiles of a given type.
*/
Rect *bounds; /* Area, in coords of scx->scx_use->cu_def,
Rect *bounds, /* Area, in coords of scx->scx_use->cu_def,
* that limits the search: only tiles
* overalapping this area will be returned.
* Use TiPlaneRect to search everywhere.
*/
int (*func)(); /* Function to apply at each connected tile. */
ClientData clientData; /* Client data for above function. */
int (*func)(), /* Function to apply at each connected tile. */
ClientData clientData) /* Client data for above function. */
{
struct conSrArg csa;
struct rtrTileStack ts;
@ -199,10 +198,10 @@ rtrSrTraverse(def, startArea, mask, connect, bounds, func, clientData)
}
int
rtrSrTraverseStartFunc(tile, dinfo, tad)
Tile *tile; /* This will be the starting tile. */
TileType dinfo; /* Split tile information (unused) */
TileAndDinfo *tad; /* We store tile's address here. */
rtrSrTraverseStartFunc(
Tile *tile, /* This will be the starting tile. */
TileType dinfo, /* Split tile information (unused) */
TileAndDinfo *tad) /* We store tile's address here. */
{
/* Simplified approach to split tiles: Use split tiles with one
@ -257,10 +256,10 @@ rtrSrTraverseStartFunc(tile, dinfo, tad)
#define IGNORE_BOTTOM 8
int
rtrSrTraverseFunc(tile, dinfo, ts)
Tile *tile; /* Tile that is connected. */
TileType dinfo; /* Split tile information (unused) */
struct rtrTileStack *ts; /* Contains information about the search. */
rtrSrTraverseFunc(
Tile *tile, /* Tile that is connected. */
TileType dinfo, /* Split tile information (unused) */
struct rtrTileStack *ts) /* Contains information about the search. */
{
Tile *t2;
Rect tileArea;
@ -451,10 +450,10 @@ rtrSrTraverseFunc(tile, dinfo, ts)
*/
int
rtrExamineTile(tile, dinfo, cdata)
Tile *tile;
TileType dinfo;
ClientData cdata;
rtrExamineTile(
Tile *tile,
TileType dinfo,
ClientData cdata)
{
TileType ttype;
@ -496,10 +495,10 @@ rtrExamineTile(tile, dinfo, cdata)
*/
int
rtrExamineStack(tile, dinfo, ts)
Tile *tile;
TileType dinfo; /* (unused) */
struct rtrTileStack *ts;
rtrExamineStack(
Tile *tile,
TileType dinfo, /* (unused) */
struct rtrTileStack *ts)
{
int i;
Tile *tp[3];

View File

@ -108,13 +108,13 @@ int rtrExamineStack(); /* Examines the tile stack for
/* ARGSUSED */
int
rtrFollowLocFunc(rect, name, label, area)
Rect *rect; /* Area of the terminal, edit cell coords. */
char *name; /* Name of the terminal (ignored). */
Label *label; /* Pointer to the label, used to find out
rtrFollowLocFunc(
Rect *rect, /* Area of the terminal, edit cell coords. */
char *name, /* Name of the terminal (ignored). */
Label *label, /* Pointer to the label, used to find out
* what layer the label's attached to.
*/
Rect *area; /* We GeoInclude into this all the areas of
Rect *area) /* We GeoInclude into this all the areas of
* all the tiles we delete.
*/
{
@ -150,10 +150,10 @@ rtrFollowLocFunc(rect, name, label, area)
/* ARGSUSED */
int
rtrFollowName(name, firstInNet, area)
char *name; /* Name of terminal. */
bool firstInNet; /* Ignored by this procedure. */
Rect *area; /* Passed through as ClientData to
rtrFollowName(
char *name, /* Name of terminal. */
bool firstInNet, /* Ignored by this procedure. */
Rect *area) /* Passed through as ClientData to
* rtrFollowLocFunc.
*/
{
@ -182,10 +182,10 @@ rtrFollowName(name, firstInNet, area)
*/
int
rtrCheckTypes(tile, dinfo, cdata)
Tile *tile;
TileType dinfo;
ClientData cdata;
rtrCheckTypes(
Tile *tile,
TileType dinfo,
ClientData cdata)
{
int type;
int lastType = *(int *)cdata;
@ -226,10 +226,10 @@ rtrCheckTypes(tile, dinfo, cdata)
*/
void
rtrExtend(tile,area,stub)
Tile *tile; /* Tile adjacent to via */
Rect *area; /* Area occupied by via */
Rect *stub; /* Extension of routing material
rtrExtend(
Tile *tile, /* Tile adjacent to via */
Rect *area, /* Area occupied by via */
Rect *stub) /* Extension of routing material
into area of via */
{
if ( (TOP(tile) == area->r_ybot) || (BOTTOM(tile) == area->r_ytop) )
@ -264,10 +264,10 @@ rtrExtend(tile,area,stub)
*/
int
rtrStubGen(tile, dinfo, si)
Tile *tile;
TileType dinfo; /* (unused) */
struct srinfo *si;
rtrStubGen(
Tile *tile,
TileType dinfo, /* (unused) */
struct srinfo *si)
{
Rect area;
struct paintlist *pl;
@ -311,10 +311,10 @@ rtrStubGen(tile, dinfo, si)
int
rtrReferenceTile(tile, dinfo, si)
Tile *tile;
TileType dinfo; /* (unused) */
struct srinfo *si;
rtrReferenceTile(
Tile *tile,
TileType dinfo, /* (unused) */
struct srinfo *si)
{
si->si_tile = tile;
rtrExtend(tile, si->si_varea, &si->si_extend);
@ -342,9 +342,9 @@ rtrReferenceTile(tile, dinfo, si)
*/
void
rtrViaCheck(area, def)
Rect *area;
CellDef *def;
rtrViaCheck(
Rect *area,
CellDef *def)
{
Rect r;
int type, plane;
@ -423,12 +423,12 @@ rtrViaCheck(area, def)
*/
void
rtrListArea(tile, oldType, newType, deltax, deltay)
Tile *tile;
int oldType;
int newType;
int deltax;
int deltay;
rtrListArea(
Tile *tile,
int oldType,
int newType,
int deltax,
int deltay)
{
struct arealist *ap;
@ -469,8 +469,8 @@ rtrListArea(tile, oldType, newType, deltax, deltay)
*/
int
rtrListVia(tile)
Tile *tile;
rtrListVia(
Tile *tile)
{
struct vialist *vp;
@ -501,8 +501,8 @@ rtrListVia(tile)
*/
int
RtrViaMinimize(def)
CellDef *def;
RtrViaMinimize(
CellDef *def)
{
Rect area;
struct vialist *vp;

View File

@ -44,8 +44,8 @@ extern void CmdIRouterTest(), CmdMZRouterTest();
*/
int
Tclroute_Init(interp)
Tcl_Interp *interp;
Tclroute_Init(
Tcl_Interp *interp)
{
SectionID invsec;