drc: convert K&R function definitions to ANSI C

Convert the old-style (K&R) function definitions in drc/ 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 drc.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:03 +02:00
parent 314978eec5
commit 413afd7a73
No known key found for this signature in database
GPG Key ID: 588785BFDFB01ABD
9 changed files with 383 additions and 362 deletions

View File

@ -108,10 +108,13 @@ drcFoundOneFunc(Tile *tile,
*/
long
drcCifPointToSegment(px, py, s1x, s1y, s2x, s2y)
int px, py; /* The position of the point */
int s1x, s1y; /* One endpoint of the line segment */
int s2x, s2y; /* The other endpoint of the line segment */
drcCifPointToSegment(
int px,
int py,
int s1x,
int s1y,
int s2x,
int s2y)
{
long x, y;
long a, b, c, frac;
@ -170,10 +173,10 @@ drcCifPointToSegment(px, py, s1x, s1y, s2x, s2y)
*/
int
areaCheck(tile, dinfo, arg)
Tile *tile;
TileType dinfo;
struct drcClientData *arg;
areaCheck(
Tile *tile,
TileType dinfo,
struct drcClientData *arg)
{
Rect rect; /* Area where error is to be recorded. */
@ -337,10 +340,10 @@ areaCheck(tile, dinfo, arg)
*/
int
areaNMReject(tile, dinfo, arg)
Tile *tile;
TileType dinfo;
ClientData *arg;
areaNMReject(
Tile *tile,
TileType dinfo,
ClientData *arg)
{
Tile *checktile = (Tile *)arg;
@ -369,10 +372,10 @@ areaNMReject(tile, dinfo, arg)
*/
int
areaNMCheck(tile, dinfo, arg)
Tile *tile;
TileType dinfo;
struct drcClientData *arg;
areaNMCheck(
Tile *tile,
TileType dinfo,
struct drcClientData *arg)
{
Rect rect; /* Area where error is to be recorded. */
@ -460,14 +463,14 @@ areaNMCheck(tile, dinfo, arg)
*/
int
DRCBasicCheck (celldef, checkRect, clipRect, function, cdata)
CellDef *celldef; /* CellDef being checked */
Rect *checkRect; /* Check rules in this area -- usually two Haloes
DRCBasicCheck(
CellDef *celldef, /* CellDef being checked */
Rect *checkRect, /* Check rules in this area -- usually two Haloes
* larger than the area where changes were made.
*/
Rect *clipRect; /* Clip error tiles against this area. */
void (*function)(); /* Function to apply for each error found. */
ClientData cdata; /* Passed to function as argument. */
Rect *clipRect, /* Clip error tiles against this area. */
void (*function)(), /* Function to apply for each error found. */
ClientData cdata) /* Passed to function as argument. */
{
struct drcClientData arg;
int errors;
@ -553,10 +556,10 @@ DRCBasicCheck (celldef, checkRect, clipRect, function, cdata)
*/
int
drcTile (tile, dinfo, arg)
Tile *tile; /* Tile being examined */
TileType dinfo; /* Split tile information */
struct drcClientData *arg;
drcTile(
Tile *tile, /* Tile being examined */
TileType dinfo, /* Split tile information */
struct drcClientData *arg)
{
DRCCookie *cptr; /* Current design rule on list */
Rect *rect = arg->dCD_rect; /* Area being checked */

View File

@ -112,9 +112,9 @@ char *drcNeedStyle = NULL;
*/
int
drcCifSetStyle(argc, argv)
int argc;
char *argv[];
drcCifSetStyle(
int argc,
char *argv[])
{
CIFKeep *new;
@ -178,9 +178,9 @@ drcCifWarning()
*/
int
drcCifWidth(argc, argv)
int argc;
char *argv[];
drcCifWidth(
int argc,
char *argv[])
{
char *layername = argv[1];
int scalefactor;
@ -239,9 +239,9 @@ drcCifWidth(argc, argv)
*/
int
drcCifSpacing(argc, argv)
int argc;
char *argv[];
drcCifSpacing(
int argc,
char *argv[])
{
char *adjacency = argv[4];
int why = drcWhyCreate(argv[5]);
@ -385,7 +385,9 @@ drcCifSpacing(argc, argv)
*/
void
drcCifScale(int n, int d)
drcCifScale(
int n,
int d)
{
DRCCookie *dp;
int i, j;
@ -512,8 +514,8 @@ drcCifFinal()
*/
void
drcCifCheck(arg)
struct drcClientData *arg;
drcCifCheck(
struct drcClientData *arg)
{
Rect *checkRect = arg->dCD_rect;
Rect cifrect;
@ -603,10 +605,10 @@ drcCifCheck(arg)
*/
int
drcCifTile (tile, dinfo, arg)
Tile *tile; /* Tile being examined */
TileType dinfo; /* Split tile information */
struct drcClientData *arg;
drcCifTile(
Tile *tile, /* Tile being examined */
TileType dinfo, /* Split tile information */
struct drcClientData *arg)
{
DRCCookie *cptr; /* Current design rule on list */
Tile *tp; /* Used for corner checks */
@ -1032,10 +1034,10 @@ tbcheck:
*/
int
areaCifCheck(tile, dinfo, arg)
Tile *tile;
TileType dinfo;
struct drcClientData *arg;
areaCifCheck(
Tile *tile,
TileType dinfo,
struct drcClientData *arg)
{
Rect rect; /* Area where error is to be recorded. */
Rect cifrect; /* rect, in CIF coordinates */
@ -1174,9 +1176,9 @@ areaCifCheck(tile, dinfo, arg)
*/
int
drcCifArea(argc, argv)
int argc;
char *argv[];
drcCifArea(
int argc,
char *argv[])
{
char *layers = argv[1];
int centiarea = atoi(argv[2]);
@ -1235,9 +1237,9 @@ drcCifArea(argc, argv)
*/
int
drcCifMaxwidth(argc, argv)
int argc;
char *argv[];
drcCifMaxwidth(
int argc,
char *argv[])
{
char *layers = argv[1];
int centidistance = atoi(argv[2]);
@ -1308,10 +1310,10 @@ drcCifMaxwidth(argc, argv)
*/
void
drcCheckCifArea(starttile, arg, cptr)
Tile *starttile;
struct drcClientData *arg;
DRCCookie *cptr;
drcCheckCifArea(
Tile *starttile,
struct drcClientData *arg,
DRCCookie *cptr)
{
int arealimit = cptr->drcc_cdist;
long area = 0L;
@ -1434,11 +1436,10 @@ forgetit:
*/
void
drcCheckCifMaxwidth(starttile, arg, cptr)
Tile *starttile;
struct drcClientData *arg;
DRCCookie *cptr;
drcCheckCifMaxwidth(
Tile *starttile,
struct drcClientData *arg,
DRCCookie *cptr)
{
int edgelimit = cptr->drcc_dist;
Rect boundrect;

View File

@ -181,12 +181,12 @@ extern TileType DRCErrorType;
/* ARGSUSED */
void
DRCCheckThis (celldef, operation, area)
CellDef * celldef; /* Allows check areas to propagate
DRCCheckThis(
CellDef * celldef, /* Allows check areas to propagate
* up from EditCell.
*/
TileType operation; /* TT_CHECKPAINT or TT_CHECKSUBCELL */
Rect * area; /* Area that changed. */
TileType operation, /* TT_CHECKPAINT or TT_CHECKSUBCELL */
Rect * area) /* Area that changed. */
{
CellUse * cu; /* Ptr to uses of the given CellDef */
Rect transRect; /* Area in coords of parent CellDefs,
@ -318,8 +318,8 @@ DRCCheckThis (celldef, operation, area)
*/
void
DRCRemovePending(def)
CellDef *def;
DRCRemovePending(
CellDef *def)
{
DRCPendingCookie *p, *plast;
@ -639,10 +639,10 @@ checkDone:
/* ARGSUSED */
int
drcCheckTile(tile, dinfo, arg)
Tile *tile; /* Tile in DRC_CHECK plane */
TileType dinfo; /* Split tile information (unused) */
ClientData arg; /* Not used. */
drcCheckTile(
Tile *tile, /* Tile in DRC_CHECK plane */
TileType dinfo, /* Split tile information (unused) */
ClientData arg) /* Not used. */
{
Rect square; /* Square area of the checkerboard
* being processed right now.
@ -768,10 +768,10 @@ drcCheckTile(tile, dinfo, arg)
*/
int
drcXorFunc(tile, dinfo, clientdata)
Tile *tile;
TileType dinfo;
ClientData clientdata;
drcXorFunc(
Tile *tile,
TileType dinfo,
ClientData clientdata)
{
Rect area;
@ -785,10 +785,10 @@ drcXorFunc(tile, dinfo, clientdata)
*/
int
drcPutBackFunc(tile, dinfo, cellDef)
Tile *tile; /* Error tile, from drcTempPlane. */
TileType dinfo; /* Split tile information */
CellDef *cellDef; /* Celldef in which to paint error. */
drcPutBackFunc(
Tile *tile, /* Error tile, from drcTempPlane. */
TileType dinfo, /* Split tile information */
CellDef *cellDef) /* Celldef in which to paint error. */
{
Rect area;
@ -820,10 +820,10 @@ drcPutBackFunc(tile, dinfo, cellDef)
*/
int
drcIncludeArea(tile, dinfo, rect)
Tile *tile;
TileType dinfo; /* (unused) */
Rect *rect; /* Rectangle in which to record total area. */
drcIncludeArea(
Tile *tile,
TileType dinfo, /* (unused) */
Rect *rect) /* Rectangle in which to record total area. */
{
Rect dum;

View File

@ -48,10 +48,10 @@ Stack *DRCstack = (Stack *)NULL;
void
drcCheckAngles(tile, arg, cptr)
Tile *tile;
struct drcClientData *arg;
DRCCookie *cptr;
drcCheckAngles(
Tile *tile,
struct drcClientData *arg,
DRCCookie *cptr)
{
Rect rect;
bool ortho = (cptr->drcc_flags & DRC_ANGLES_45) ? FALSE : TRUE;
@ -84,10 +84,10 @@ drcCheckAngles(tile, arg, cptr)
*/
void
drcCheckOffGrid(edgeRect, arg, cptr)
Rect *edgeRect;
struct drcClientData *arg;
DRCCookie *cptr;
drcCheckOffGrid(
Rect *edgeRect,
struct drcClientData *arg,
DRCCookie *cptr)
{
Rect rect;
int gtest;
@ -128,11 +128,10 @@ drcCheckOffGrid(edgeRect, arg, cptr)
*/
void
drcCheckArea(starttile,arg,cptr)
Tile *starttile;
struct drcClientData *arg;
DRCCookie *cptr;
drcCheckArea(
Tile *starttile,
struct drcClientData *arg,
DRCCookie *cptr)
{
int arealimit;
long area = 0L;
@ -257,11 +256,11 @@ forgetit:
*/
int
drcCheckMaxwidth(starttile,arg,cptr,both)
Tile *starttile;
struct drcClientData *arg;
DRCCookie *cptr;
bool both;
drcCheckMaxwidth(
Tile *starttile,
struct drcClientData *arg,
DRCCookie *cptr,
bool both)
{
int width;
int height;
@ -395,10 +394,10 @@ drcCheckMaxwidth(starttile,arg,cptr,both)
*/
void
drcCheckRectSize(starttile, arg, cptr)
Tile *starttile;
struct drcClientData *arg;
DRCCookie *cptr;
drcCheckRectSize(
Tile *starttile,
struct drcClientData *arg,
DRCCookie *cptr)
{
int maxsize, even;
TileTypeBitMask *oktypes = &cptr->drcc_mask;
@ -510,12 +509,12 @@ MaxRectsExclude(
*/
MaxRectsData *
drcCanonicalMaxwidth(starttile, dir, arg, cptr, mrdptr)
Tile *starttile;
int dir; /* direction of rule */
struct drcClientData *arg;
DRCCookie *cptr;
MaxRectsData **mrdptr;
drcCanonicalMaxwidth(
Tile *starttile,
int dir, /* direction of rule */
struct drcClientData *arg,
DRCCookie *cptr,
MaxRectsData **mrdptr)
{
int s, edgelimit;
Tile *tile,*tp;

View File

@ -145,11 +145,11 @@ LinkedIndex *DRCIgnoreRules = NULL;
*/
void
drcPaintError(celldef, rect, cptr, plane)
CellDef * celldef; /* CellDef being checked */
Rect * rect; /* Area of error */
DRCCookie * cptr; /* Design rule violated -- not used */
Plane * plane; /* Where to paint error tiles. */
drcPaintError(
CellDef * celldef, /* CellDef being checked */
Rect * rect, /* Area of error */
DRCCookie * cptr, /* Design rule violated -- not used */
Plane * plane) /* Where to paint error tiles. */
{
PaintUndoInfo ui;
@ -180,8 +180,8 @@ drcPaintError(celldef, rect, cptr, plane)
*/
char *
drcSubstitute (cptr)
DRCCookie * cptr; /* Design rule violated */
drcSubstitute(
DRCCookie * cptr) /* Design rule violated */
{
static char *why_out = NULL;
char *whyptr, *sptr, *wptr, *vptr;
@ -282,11 +282,11 @@ drcSubstitute (cptr)
*/
void
drcPrintError (celldef, rect, cptr, scx)
CellDef * celldef; /* CellDef being checked -- not used here */
Rect * rect; /* Area of error */
DRCCookie * cptr; /* Design rule violated */
SearchContext * scx; /* Only errors in scx->scx_area get reported. */
drcPrintError(
CellDef * celldef, /* CellDef being checked -- not used here */
Rect * rect, /* Area of error */
DRCCookie * cptr, /* Design rule violated */
SearchContext * scx) /* Only errors in scx->scx_area get reported. */
{
HashEntry *h;
int i;
@ -343,11 +343,11 @@ drcPrintError (celldef, rect, cptr, scx)
#ifdef MAGIC_WRAPPER
void
drcListError (celldef, rect, cptr, scx)
CellDef * celldef; /* CellDef being checked -- not used here */
Rect * rect; /* Area of error */
DRCCookie * cptr; /* Design rule violated */
SearchContext * scx; /* Only errors in scx->scx_area get reported */
drcListError(
CellDef * celldef, /* CellDef being checked -- not used here */
Rect * rect, /* Area of error */
DRCCookie * cptr, /* Design rule violated */
SearchContext * scx) /* Only errors in scx->scx_area get reported */
{
HashEntry *h;
int i;
@ -400,11 +400,11 @@ drcListError (celldef, rect, cptr, scx)
/* along with position information. */
void
drcListallError (celldef, rect, cptr, scx)
CellDef * celldef; /* CellDef being checked -- not used here */
Rect * rect; /* Area of error */
DRCCookie * cptr; /* Design rule violated */
SearchContext * scx; /* Only errors in scx->scx_area get reported. */
drcListallError(
CellDef * celldef, /* CellDef being checked -- not used here */
Rect * rect, /* Area of error */
DRCCookie * cptr, /* Design rule violated */
SearchContext * scx) /* Only errors in scx->scx_area get reported. */
{
Tcl_Obj *lobj, *pobj;
HashEntry *h;
@ -566,17 +566,17 @@ DRCPrintStats()
*/
bool
DRCWhy(dolist, use, area, findonly)
bool dolist; /*
DRCWhy(
bool dolist, /*
* Generate Tcl list for value
*/
CellUse *use; /* Use in whose definition to start
CellUse *use, /* Use in whose definition to start
* the hierarchical check.
*/
Rect *area; /* Area, in def's coordinates, that
Rect *area, /* Area, in def's coordinates, that
* is to be checked.
*/
bool findonly; /* If TRUE, contents of DRCIgnoreRules
bool findonly) /* If TRUE, contents of DRCIgnoreRules
* are inverted; that is, flag only
* the marked rules instead of ignoring
* them.
@ -643,14 +643,14 @@ DRCWhy(dolist, use, area, findonly)
#ifdef MAGIC_WRAPPER
void
DRCWhyAll(use, area, fout)
CellUse *use; /* Use in whose definition to start
DRCWhyAll(
CellUse *use, /* Use in whose definition to start
* the hierarchical check.
*/
Rect *area; /* Area, in def's coordinates, that
Rect *area, /* Area, in def's coordinates, that
* is to be checked.
*/
FILE *fout; /*
FILE *fout) /*
* Write formatted output to fout
*/
{
@ -732,9 +732,9 @@ DRCWhyAll(use, area, fout)
/* ARGSUSED */
void
drcWhyFunc(scx, cdarg)
SearchContext *scx; /* Describes current state of search. */
ClientData cdarg; /* Used to hold boolean value "dolist" */
drcWhyFunc(
SearchContext *scx, /* Describes current state of search. */
ClientData cdarg) /* Used to hold boolean value "dolist" */
{
CellDef *def = scx->scx_use->cu_def;
bool dolist = (bool)((pointertype)cdarg);
@ -748,9 +748,9 @@ drcWhyFunc(scx, cdarg)
#ifdef MAGIC_WRAPPER
int
drcWhyAllFunc(scx, cdarg)
SearchContext *scx; /* Describes current state of search. */
ClientData cdarg; /* Unused */
drcWhyAllFunc(
SearchContext *scx, /* Describes current state of search. */
ClientData cdarg) /* Unused */
{
CellDef *def = scx->scx_use->cu_def;
@ -781,9 +781,9 @@ drcWhyAllFunc(scx, cdarg)
*/
void
DRCCheck(use, area)
CellUse *use; /* Top-level use of hierarchy. */
Rect *area; /* This area is rechecked everywhere in the
DRCCheck(
CellUse *use, /* Top-level use of hierarchy. */
Rect *area) /* This area is rechecked everywhere in the
* hierarchy underneath use.
*/
{
@ -809,9 +809,9 @@ DRCCheck(use, area)
/* ARGSUSED */
int
drcCheckFunc(scx, cdarg)
SearchContext *scx;
ClientData cdarg; /* Not used. */
drcCheckFunc(
SearchContext *scx,
ClientData cdarg) /* Not used. */
{
Rect cellArea;
CellDef *def;
@ -867,10 +867,10 @@ drcCheckFunc(scx, cdarg)
*/
DRCCountList *
DRCCount(use, area, recurse)
CellUse *use; /* Top-level use of hierarchy. */
Rect *area; /* Area in which violations are counted. */
bool recurse; /* If TRUE, count errors in all subcells */
DRCCount(
CellUse *use, /* Top-level use of hierarchy. */
Rect *area, /* Area in which violations are counted. */
bool recurse) /* If TRUE, count errors in all subcells */
{
DRCCountList *dcl, *newdcl;
HashTable dupTable;
@ -930,9 +930,9 @@ DRCCount(use, area, recurse)
}
int
drcCountFunc(scx, dupTable)
SearchContext *scx;
HashTable *dupTable; /* Passed as client data, used to
drcCountFunc(
SearchContext *scx,
HashTable *dupTable) /* Passed as client data, used to
* avoid searching any cell twice.
*/
{
@ -977,10 +977,10 @@ drcCountFunc(scx, dupTable)
}
int
drcCountFunc2(tile, dinfo, countptr)
Tile *tile; /* Tile found in error plane. */
TileType dinfo; /* Split tile information (unused) */
int *countptr; /* Address of count word. */
drcCountFunc2(
Tile *tile, /* Tile found in error plane. */
TileType dinfo, /* Split tile information (unused) */
int *countptr) /* Address of count word. */
{
if (TiGetType(tile) != (TileType) TT_SPACE) (*countptr)++;
return 0;
@ -1053,11 +1053,11 @@ typedef struct {
} Sindx;
int
DRCFind(use, area, rect, indx)
CellUse *use; /* Cell use to check. */
Rect *area; /* Area of search */
Rect *rect; /* Rectangle to fill in with tile location. */
int indx; /* Go to this error. */
DRCFind(
CellUse *use, /* Cell use to check. */
Rect *area, /* Area of search */
Rect *rect, /* Rectangle to fill in with tile location. */
int indx) /* Go to this error. */
{
SearchContext scx;
Sindx finddata;
@ -1098,9 +1098,9 @@ DRCFind(use, area, rect, indx)
}
int
drcFindFunc(scx, finddata)
SearchContext *scx;
Sindx *finddata;
drcFindFunc(
SearchContext *scx,
Sindx *finddata)
{
CellDef *def;
HashEntry *h;
@ -1127,11 +1127,10 @@ drcFindFunc(scx, finddata)
}
int
drcFindFunc2(tile, dinfo, finddata)
Tile *tile; /* Tile in error plane. */
TileType dinfo; /* Split tile information (unused) */
Sindx *finddata; /* Information about error to find */
drcFindFunc2(
Tile *tile, /* Tile in error plane. */
TileType dinfo, /* Split tile information (unused) */
Sindx *finddata) /* Information about error to find */
{
if (TiGetType(tile) == (TileType) TT_SPACE) return 0;
if (++finddata->current == finddata->target)

View File

@ -53,9 +53,9 @@ extern const char *DBTypeShortName(TileType type);
*/
char *
drcGetName(layer, string)
int layer;
char *string; /* Used to hold name. Must have length >= 8 */
drcGetName(
int layer,
char *string) /* Used to hold name. Must have length >= 8 */
{
(void) strncpy(string, DBTypeShortName(layer), 8);
string[8] = '\0';
@ -79,8 +79,8 @@ drcGetName(layer, string)
*/
void
DRCPrintRulesTable (fp)
FILE *fp;
DRCPrintRulesTable(
FILE *fp)
{
int i, j, k;
DRCCookie * dp;
@ -163,8 +163,8 @@ DRCPrintRulesTable (fp)
}
char *
maskToPrint (mask)
TileTypeBitMask *mask;
maskToPrint(
TileTypeBitMask *mask)
{
int i;
int gotSome = FALSE;

View File

@ -130,9 +130,9 @@ struct drcSubcellArg {
*/
int
drcFindOtherCells(use, dlu)
CellUse *use;
struct drcLinkedUse *dlu;
drcFindOtherCells(
CellUse *use,
struct drcLinkedUse *dlu)
{
if (use != dlu->dlu_use)
GeoInclude(&use->cu_bbox, &dlu->dlu_area);
@ -158,10 +158,10 @@ drcFindOtherCells(use, dlu)
*/
int
drcSubCopyErrors(tile, dinfo, cxp)
Tile *tile;
TileType dinfo; /* (unused) */
TreeContext *cxp;
drcSubCopyErrors(
Tile *tile,
TileType dinfo, /* (unused) */
TreeContext *cxp)
{
Rect area;
Rect destArea;
@ -206,9 +206,9 @@ drcSubCopyErrors(tile, dinfo, cxp)
*/
int
drcSubCopyFunc(scx, cdarg)
SearchContext *scx;
ClientData cdarg;
drcSubCopyFunc(
SearchContext *scx,
ClientData cdarg)
{
TileTypeBitMask drcMask;
@ -246,9 +246,9 @@ drcSubCopyFunc(scx, cdarg)
*/
int
drcSubcellFunc(subUse, dsa)
CellUse *subUse; /* Subcell instance found in area. */
struct drcSubcellArg *dsa; /* Information needed for funtion and to pass
drcSubcellFunc(
CellUse *subUse, /* Subcell instance found in area. */
struct drcSubcellArg *dsa) /* Information needed for funtion and to pass
* back to the caller.
*/
{
@ -349,11 +349,11 @@ drcAlwaysOne(Tile *tile,
*/
int
drcSubCheckPaint(scx, curUse)
SearchContext *scx; /* Contains information about the celluse
drcSubCheckPaint(
SearchContext *scx, /* Contains information about the celluse
* that was found.
*/
CellUse **curUse; /* Points to a celluse, or NULL, or -1. -1
CellUse **curUse) /* Points to a celluse, or NULL, or -1. -1
* means paint was found in the root cell,
* and non-NULL means some other celluse had
* paint in it. If we find another celluse
@ -403,17 +403,17 @@ drcSubCheckPaint(scx, curUse)
*/
int
DRCFindInteractions(def, area, radius, interaction)
CellDef *def; /* Cell to check for interactions. */
Rect *area; /* Area of def to check for interacting
DRCFindInteractions(
CellDef *def, /* Cell to check for interactions. */
Rect *area, /* Area of def to check for interacting
* material.
*/
int radius; /* How close two pieces of material must be
int radius, /* How close two pieces of material must be
* to be considered interacting. Two pieces
* radius apart do NOT interact, but if they're
* close than this they do.
*/
Rect *interaction; /* Gets filled in with the bounding box of
Rect *interaction) /* Gets filled in with the bounding box of
* the interaction area, if any. Doesn't
* have a defined value when FALSE is returned.
*/
@ -539,10 +539,10 @@ DRCFindInteractions(def, area, radius, interaction)
*/
int
drcExactOverlapCheck(tile, dinfo, arg)
Tile *tile; /* Tile to check. */
TileType dinfo; /* Split tile information (unused) */
struct drcClientData *arg; /* How to detect and process errors. */
drcExactOverlapCheck(
Tile *tile, /* Tile to check. */
TileType dinfo, /* Split tile information (unused) */
struct drcClientData *arg) /* How to detect and process errors. */
{
Rect rect;
@ -579,10 +579,10 @@ drcExactOverlapCheck(tile, dinfo, arg)
*/
int
drcExactOverlapTile(tile, dinfo, cxp)
Tile *tile; /* Tile that must overlap exactly. */
TileType dinfo; /* Split tile information (unused) */
TreeContext *cxp; /* Tells how to translate out of subcell.
drcExactOverlapTile(
Tile *tile, /* Tile that must overlap exactly. */
TileType dinfo, /* Split tile information (unused) */
TreeContext *cxp) /* Tells how to translate out of subcell.
* The client data must be a drcClientData
* record, and the caller must have filled
* in the celldef, clip, errors, function,
@ -720,8 +720,8 @@ drcExactOverlapTile(tile, dinfo, cxp)
*/
void
DRCOffGridError(rect)
Rect *rect; /* Area of error */
DRCOffGridError(
Rect *rect) /* Area of error */
{
if (drcSubFunc == NULL) return;
(*drcSubFunc)(DRCErrorDef, rect, &drcOffGridCookie, drcSubClientData);
@ -763,12 +763,12 @@ DRCOffGridError(rect)
*/
int
DRCInteractionCheck(def, area, erasebox, func, cdarg)
CellDef *def; /* Definition in which to do check. */
Rect *area; /* Area in which all errors are to be found. */
Rect *erasebox; /* Smaller area containing DRC check tiles */
void (*func)(); /* Function to call for each error. */
ClientData cdarg; /* Extra info to be passed to func. */
DRCInteractionCheck(
CellDef *def, /* Definition in which to do check. */
Rect *area, /* Area in which all errors are to be found. */
Rect *erasebox, /* Smaller area containing DRC check tiles */
void (*func)(), /* Function to call for each error. */
ClientData cdarg) /* Extra info to be passed to func. */
{
int oldTiles, count, x, y, errorSaveType;
Rect intArea, square, cliparea, subArea;
@ -966,9 +966,9 @@ DRCInteractionCheck(def, area, erasebox, func, cdarg)
}
void
DRCFlatCheck(use, area)
CellUse *use;
Rect *area;
DRCFlatCheck(
CellUse *use,
Rect *area)
{
int x, y;
Rect chunk;
@ -1012,11 +1012,11 @@ DRCFlatCheck(use, area)
}
void
drcIncCount(def, area, rule, count)
CellDef *def;
Rect *area;
DRCCookie *rule;
int *count;
drcIncCount(
CellDef *def,
Rect *area,
DRCCookie *rule,
int *count)
{
(*count)++;
}

View File

@ -110,9 +110,9 @@ void drcTechFinalStyle();
*/
PlaneMask
CoincidentPlanes(typeMask, pmask)
TileTypeBitMask *typeMask; /* Mask of types to check coincidence */
PlaneMask pmask; /* Mask of all possible planes of types */
CoincidentPlanes(
TileTypeBitMask *typeMask, /* Mask of types to check coincidence */
PlaneMask pmask) /* Mask of all possible planes of types */
{
PlaneMask planes = pmask;
TileType i;
@ -135,7 +135,8 @@ CoincidentPlanes(typeMask, pmask)
*/
int
LowestMaskBit(PlaneMask pmask)
LowestMaskBit(
PlaneMask pmask)
{
PlaneMask pset = pmask;
int plane = 0;
@ -167,8 +168,10 @@ LowestMaskBit(PlaneMask pmask)
*/
void
DRCPrintStyle(dolist, doforall, docurrent)
bool dolist, doforall, docurrent;
DRCPrintStyle(
bool dolist,
bool doforall,
bool docurrent)
{
DRCKeep *style;
@ -231,8 +234,8 @@ DRCPrintStyle(dolist, doforall, docurrent)
*/
void
DRCSetStyle(name)
char *name;
DRCSetStyle(
char *name)
{
DRCKeep *style, *match;
int length;
@ -365,8 +368,8 @@ drcTechNewStyle()
*/
int
drcWhyCreate(whystring)
char *whystring;
drcWhyCreate(
char *whystring)
{
HashEntry *he;
@ -417,8 +420,8 @@ drcWhyCreate(whystring)
*/
unsigned char
drcExceptionCreate(name)
char *name;
drcExceptionCreate(
char *name)
{
int i;
char **newlist;
@ -473,8 +476,10 @@ drcExceptionCreate(name)
*/
DRCCookie *
drcFindBucket(i, j, distance)
int i, j, distance;
drcFindBucket(
int i,
int j,
int distance)
{
DRCCookie *dp;
@ -516,8 +521,8 @@ drcFindBucket(i, j, distance)
*/
void
drcLoadStyle(stylename)
char *stylename;
drcLoadStyle(
char *stylename)
{
SectionID invdrc;
@ -757,10 +762,10 @@ DRCTechStyleInit()
*/
bool
DRCTechLine(sectionName, argc, argv)
char *sectionName; /* The name of this section */
int argc; /* Number of fields on the line */
char *argv[]; /* Values of the fields */
DRCTechLine(
char *sectionName, /* The name of this section */
int argc, /* Number of fields on the line */
char *argv[]) /* Values of the fields */
{
int j, l;
DRCKeep *newStyle, *p;
@ -1009,13 +1014,17 @@ DRCTechLine(sectionName, argc, argv)
}
void
drcCifAssign(cookie, dist, next, mask, corner, tag, cdist, flags, planeto, planefrom)
DRCCookie *cookie, *next;
int dist, cdist;
TileTypeBitMask *mask, *corner;
int tag;
unsigned short flags;
int planeto, planefrom;
drcCifAssign(
DRCCookie *cookie,
int dist,
DRCCookie *next,
TileTypeBitMask *mask,
TileTypeBitMask *corner,
int tag,
int cdist,
unsigned short flags,
int planeto,
int planefrom)
{
(cookie)->drcc_dist = dist;
(cookie)->drcc_next = next;
@ -1035,13 +1044,17 @@ drcCifAssign(cookie, dist, next, mask, corner, tag, cdist, flags, planeto, plane
// planefrom
void
drcAssign(cookie, dist, next, mask, corner, why, cdist, flags, planeto, planefrom)
DRCCookie *cookie, *next;
int dist, cdist;
TileTypeBitMask *mask, *corner;
int why;
unsigned short flags;
int planeto, planefrom;
drcAssign(
DRCCookie *cookie,
int dist,
DRCCookie *next,
TileTypeBitMask *mask,
TileTypeBitMask *corner,
int why,
int cdist,
unsigned short flags,
int planeto,
int planefrom)
{
/* Diagnostic */
if (planeto >= DBNumPlanes)
@ -1090,10 +1103,10 @@ drcAssign(cookie, dist, next, mask, corner, why, cdist, flags, planeto, planefro
/* ARGSUSED */
bool
DRCTechAddRule(sectionName, argc, argv)
char *sectionName; /* Unused */
int argc;
char *argv[];
DRCTechAddRule(
char *sectionName, /* Unused */
int argc,
char *argv[])
{
int which, distance, mdist;
const char *fmt;
@ -1217,9 +1230,9 @@ DRCTechAddRule(sectionName, argc, argv)
*/
int
drcExtend(argc, argv)
int argc;
char *argv[];
drcExtend(
int argc,
char *argv[])
{
char *layers1 = argv[1];
char *layers2 = argv[2];
@ -1393,9 +1406,9 @@ drcExtend(argc, argv)
*/
int
drcWidth(argc, argv)
int argc;
char *argv[];
drcWidth(
int argc,
char *argv[])
{
char *layers = argv[1];
int distance = atoi(argv[2]);
@ -1504,9 +1517,9 @@ drcWidth(argc, argv)
*/
int
drcArea(argc, argv)
int argc;
char *argv[];
drcArea(
int argc,
char *argv[])
{
char *layers = argv[1];
int distance = atoi(argv[2]);
@ -1584,9 +1597,9 @@ drcArea(argc, argv)
*/
int
drcOffGrid(argc, argv)
int argc;
char *argv[];
drcOffGrid(
int argc,
char *argv[])
{
char *layers = argv[1];
int pitch = atoi(argv[2]);
@ -1689,9 +1702,9 @@ drcOffGrid(argc, argv)
*/
int
drcMaxwidth(argc, argv)
int argc;
char *argv[];
drcMaxwidth(
int argc,
char *argv[])
{
char *layers = argv[1];
int distance = atoi(argv[2]);
@ -1816,9 +1829,9 @@ drcMaxwidth(argc, argv)
*/
int
drcAngles(argc, argv)
int argc;
char *argv[];
drcAngles(
int argc,
char *argv[])
{
char *layers = argv[1];
char *endptr;
@ -1996,9 +2009,9 @@ drcAngles(argc, argv)
*/
int
drcSpacing3(argc, argv)
int argc;
char *argv[];
drcSpacing3(
int argc,
char *argv[])
{
char *layers1 = argv[1], *layers2 = argv[2];
char *layers3 = argv[5];
@ -2091,16 +2104,18 @@ drcSpacing3(argc, argv)
*/
int
drcMaskSpacing(set1, set2, pmask1, pmask2, wwidth, distance, adjacency,
why, widerule, runlength, multiplane)
TileTypeBitMask *set1, *set2;
PlaneMask pmask1, pmask2;
int wwidth, distance;
char *adjacency;
int why;
bool widerule;
int runlength;
bool multiplane;
drcMaskSpacing(
TileTypeBitMask *set1,
TileTypeBitMask *set2,
PlaneMask pmask1,
PlaneMask pmask2,
int wwidth,
int distance,
char *adjacency,
int why,
bool widerule,
int runlength,
bool multiplane)
{
TileTypeBitMask tmp1, tmp2, setR, setRreverse;
int plane, plane2;
@ -2600,9 +2615,9 @@ drcMaskSpacing(set1, set2, pmask1, pmask2, wwidth, distance, adjacency,
*/
int
drcSpacing(argc, argv)
int argc;
char *argv[];
drcSpacing(
int argc,
char *argv[])
{
char *layers1 = argv[1], *layers2;
char *adjacency;
@ -2775,9 +2790,9 @@ drcSpacing(argc, argv)
*/
int
drcEdge(argc, argv)
int argc;
char *argv[];
drcEdge(
int argc,
char *argv[])
{
char *layers1 = argv[1], *layers2 = argv[2];
int distance = atoi(argv[3]);
@ -2956,9 +2971,9 @@ drcEdge(argc, argv)
*/
int
drcOverhang(argc, argv)
int argc;
char *argv[];
drcOverhang(
int argc,
char *argv[])
{
char *layers2 = argv[1], *layers1 = argv[2];
int distance = atoi(argv[3]);
@ -3093,9 +3108,9 @@ drcOverhang(argc, argv)
*/
int
drcRectOnly(argc, argv)
int argc;
char *argv[];
drcRectOnly(
int argc,
char *argv[])
{
char *layers = argv[1];
int why = drcWhyCreate(argv[2]);
@ -3198,9 +3213,9 @@ drcRectOnly(argc, argv)
*/
int
drcSurround(argc, argv)
int argc;
char *argv[];
drcSurround(
int argc,
char *argv[])
{
char *layers1 = argv[1], *layers2 = argv[2], *endptr;
int distance = atoi(argv[3]);
@ -3498,9 +3513,9 @@ drcSurround(argc, argv)
*/
int
drcNoOverlap(argc, argv)
int argc;
char *argv[];
drcNoOverlap(
int argc,
char *argv[])
{
char *layers1 = argv[1], *layers2 = argv[2];
TileTypeBitMask set1, set2;
@ -3552,9 +3567,9 @@ drcNoOverlap(argc, argv)
*/
int
drcExactOverlap(argc, argv)
int argc;
char *argv[];
drcExactOverlap(
int argc,
char *argv[])
{
char *layers = argv[1];
TileTypeBitMask set;
@ -3596,9 +3611,9 @@ drcExactOverlap(argc, argv)
*/
int
drcRectangle(argc, argv)
int argc;
char *argv[];
drcRectangle(
int argc,
char *argv[])
{
char *layers = argv[1];
int why = drcWhyCreate(argv[4]);
@ -3738,9 +3753,9 @@ drcRectangle(argc, argv)
*/
int
drcException(argc, argv)
int argc;
char *argv[];
drcException(
int argc,
char *argv[])
{
int i;
@ -3756,9 +3771,9 @@ drcException(argc, argv)
}
int
drcExemption(argc, argv)
int argc;
char *argv[];
drcExemption(
int argc,
char *argv[])
{
int i;
@ -3797,9 +3812,9 @@ drcExemption(argc, argv)
*/
int
drcOption(argc, argv)
int argc;
char *argv[];
drcOption(
int argc,
char *argv[])
{
int i;
@ -3844,9 +3859,9 @@ drcOption(argc, argv)
*/
int
drcStepSize(argc, argv)
int argc;
char *argv[];
drcStepSize(
int argc,
char *argv[])
{
if (DRCCurStyle == NULL) return 0;
@ -3922,9 +3937,9 @@ DRCTechFinal()
*/
void
drcScaleDown(style, scalefactor)
DRCStyle *style;
int scalefactor;
drcScaleDown(
DRCStyle *style,
int scalefactor)
{
TileType i, j;
DRCCookie *dp;
@ -3991,9 +4006,9 @@ drcScaleDown(style, scalefactor)
*/
void
drcScaleUp(style, scalefactor)
DRCStyle *style;
int scalefactor;
drcScaleUp(
DRCStyle *style,
int scalefactor)
{
TileType i, j;
DRCCookie *dp;
@ -4060,8 +4075,8 @@ drcScaleUp(style, scalefactor)
*/
void
drcTechFinalStyle(style)
DRCStyle *style;
drcTechFinalStyle(
DRCStyle *style)
{
TileTypeBitMask tmpMask, nextMask;
DRCCookie *dummy, *dp, *next, *dptrig;
@ -4400,8 +4415,9 @@ DRCTechRuleStats()
*/
void
DRCTechScale(scalen, scaled)
int scalen, scaled;
DRCTechScale(
int scalen,
int scaled)
{
DRCCookie *dp;
TileType i, j;
@ -4469,8 +4485,8 @@ DRCTechScale(scalen, scaled)
*/
int
DRCGetDefaultLayerWidth(ttype)
TileType ttype;
DRCGetDefaultLayerWidth(
TileType ttype)
{
int routeWidth = 0;
DRCCookie *cptr;
@ -4535,8 +4551,9 @@ DRCGetDefaultLayerWidth(ttype)
*/
int
DRCGetDefaultLayerSpacing(ttype1, ttype2)
TileType ttype1, ttype2;
DRCGetDefaultLayerSpacing(
TileType ttype1,
TileType ttype2)
{
int routeSpacing = 0;
DRCCookie *cptr;
@ -4594,8 +4611,9 @@ DRCGetDefaultLayerSpacing(ttype1, ttype2)
*/
int
DRCGetDefaultLayerSurround(ttype1, ttype2)
TileType ttype1, ttype2;
DRCGetDefaultLayerSurround(
TileType ttype1,
TileType ttype2)
{
int layerSurround = 0;
DRCCookie *cptr;
@ -4668,8 +4686,9 @@ DRCGetDefaultLayerSurround(ttype1, ttype2)
*/
int
DRCGetDirectionalLayerSurround(ttype1, ttype2)
TileType ttype1, ttype2;
DRCGetDirectionalLayerSurround(
TileType ttype1,
TileType ttype2)
{
int layerSurround = 0;
DRCCookie *cptr, *cnext;
@ -4720,9 +4739,9 @@ DRCGetDirectionalLayerSurround(ttype1, ttype2)
*/
int
DRCGetDefaultWideLayerSpacing(ttype, twidth)
TileType ttype;
int twidth;
DRCGetDefaultWideLayerSpacing(
TileType ttype,
int twidth)
{
int routeSpacing = 0;
DRCCookie *cptr;

View File

@ -259,8 +259,8 @@ extern void drcPrintError();
extern int drcIncludeArea();
extern int drcExactOverlapTile();
extern void drcInitRulesTbl();
extern void drcAssign();
extern void drcCifAssign();
extern void drcAssign(DRCCookie *cookie, int dist, DRCCookie *next, TileTypeBitMask *mask, TileTypeBitMask *corner, int why, int cdist, unsigned short flags, int planeto, int planefrom);
extern void drcCifAssign(DRCCookie *cookie, int dist, DRCCookie *next, TileTypeBitMask *mask, TileTypeBitMask *corner, int tag, int cdist, unsigned short flags, int planeto, int planefrom);
extern int drcWhyCreate();
/*
@ -290,17 +290,17 @@ extern void DRCContinuous();
extern void DRCCheckThis();
extern void DRCRemovePending();
extern void DRCPrintRulesTable();
extern bool DRCWhy();
extern bool DRCWhy(bool dolist, CellUse *use, Rect *area, bool findonly);
extern void DRCPrintStats();
extern void DRCCheck();
extern DRCCountList *DRCCount();
extern DRCCountList *DRCCount(CellUse *use, Rect *area, bool recurse);
extern int DRCFind();
extern void DRCCatchUp();
extern int DRCFindInteractions();
extern int DRCBasicCheck();
extern void DRCOffGridError();
extern void DRCPrintStyle();
extern void DRCPrintStyle(bool dolist, bool doforall, bool docurrent);
extern void DRCSetStyle();
extern void DRCLoadStyle();
@ -315,7 +315,7 @@ extern void drcCifCheck();
extern void drcCifFinal();
extern void drcCheckAngles();
extern void drcCheckArea();
extern int drcCheckMaxwidth();
extern int drcCheckMaxwidth(Tile *starttile, struct drcClientData *arg, DRCCookie *cptr, bool both);
extern void drcCheckRectSize();
extern void drcCheckOffGrid();
extern int LowestMaskBit();