extflat: convert K&R function definitions to ANSI C

Convert the old-style (K&R) function definitions in extflat/ 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 extflat headers (extflat.h, EFint.h) to prototype 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 413afd7a73
commit 97be8b72f0
No known key found for this signature in database
GPG Key ID: 588785BFDFB01ABD
11 changed files with 352 additions and 331 deletions

View File

@ -123,9 +123,9 @@ typedef struct _ams {
#define ANTENNACHECK_HELP 2 #define ANTENNACHECK_HELP 2
void void
CmdAntennaCheck(w, cmd) CmdAntennaCheck(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int i, flatFlags; int i, flatFlags;
char *inName; char *inName;
@ -291,9 +291,9 @@ runantennacheck:
*/ */
int int
antennacheckArgs(pargc, pargv) antennacheckArgs(
int *pargc; int *pargc,
char ***pargv; char ***pargv)
{ {
char **argv = *pargv, *cp; char **argv = *pargv, *cp;
int argc = *pargc; int argc = *pargc;
@ -327,9 +327,9 @@ usage:
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
EFNode * EFNode *
AntennaGetNode(prefix, suffix) AntennaGetNode(
HierName *prefix; HierName *prefix,
HierName *suffix; HierName *suffix)
{ {
HashEntry *he; HashEntry *he;
@ -754,10 +754,10 @@ antennacheckVisit(
*/ */
int int
areaMarkFunc(tile, dinfo, ams) areaMarkFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
AntennaMarkStruct *ams; AntennaMarkStruct *ams)
{ {
Rect rect; Rect rect;
char msg[200]; char msg[200];
@ -779,10 +779,10 @@ areaMarkFunc(tile, dinfo, ams)
*/ */
int int
areaAccumFunc(tile, dinfo, gdas) areaAccumFunc(
Tile *tile; Tile *tile,
TileType dinfo; TileType dinfo,
GateDiffAccumStruct *gdas; GateDiffAccumStruct *gdas)
{ {
Rect *rect = &(gdas->r); Rect *rect = &(gdas->r);
int type; int type;
@ -819,10 +819,10 @@ areaAccumFunc(tile, dinfo, gdas)
*/ */
int int
antennaAccumFunc(tile, dinfo, aaptr) antennaAccumFunc(
Tile *tile; Tile *tile,
TileType dinfo; /* Not used, but should be handled */ TileType dinfo, /* Not used, but should be handled */
AntennaAccumStruct *aaptr; AntennaAccumStruct *aaptr)
{ {
Rect *rect = &(aaptr->r); Rect *rect = &(aaptr->r);
Rect *cont = &(aaptr->via); Rect *cont = &(aaptr->via);

View File

@ -144,12 +144,12 @@ extern void efLoadSearchPath();
*/ */
char * char *
EFArgs(argc, argv, err_result, argsProc, cdata) EFArgs(
int argc; /* Number of command-line args */ int argc, /* Number of command-line args */
char *argv[]; /* Vector of command-line args */ char *argv[], /* Vector of command-line args */
bool *err_result; /* Set to TRUE if error occurs */ bool *err_result, /* Set to TRUE if error occurs */
bool (*argsProc)(); /* Called for args we don't recognize */ bool (*argsProc)(), /* Called for args we don't recognize */
ClientData cdata; /* Passed to (*argsProc)() */ ClientData cdata) /* Passed to (*argsProc)() */
{ {
static char libpath[FNSIZE]; static char libpath[FNSIZE];
char *realIn, line[1024], *inname = NULL, *name, *cp; char *realIn, line[1024], *inname = NULL, *name, *cp;
@ -362,8 +362,8 @@ usage:
*/ */
void void
efLoadSearchPath(path) efLoadSearchPath(
char **path; char **path)
{ {
PaVisit *pv; PaVisit *pv;
@ -377,9 +377,9 @@ efLoadSearchPath(path)
} }
int int
efLoadPathFunc(line, ppath) efLoadPathFunc(
char *line; char *line,
char **ppath; char **ppath)
{ {
char *cp, *dp, c; char *cp, *dp, c;
char path[BUFSIZ]; char path[BUFSIZ];

View File

@ -140,18 +140,18 @@ extern float locScale;
*/ */
void void
efBuildNode(def, isSubsnode, isDevSubsnode, isExtNode, nodeName, nodeCap, efBuildNode(
x, y, layerName, av, ac) Def *def, /* Def to which this connection is to be added */
Def *def; /* Def to which this connection is to be added */ bool isSubsnode, /* TRUE if the node is the global substrate */
bool isSubsnode; /* TRUE if the node is the global substrate */ bool isDevSubsnode, /* TRUE if the node is a device body connection */
bool isDevSubsnode; /* TRUE if the node is a device body connection */ bool isExtNode, /* TRUE if this was a "node" or "substrate" in .ext */
bool isExtNode; /* TRUE if this was a "node" or "substrate" in .ext */ char *nodeName, /* One of the names for this node */
char *nodeName; /* One of the names for this node */ double nodeCap, /* Capacitance of this node to ground */
double nodeCap; /* Capacitance of this node to ground */ int x,
int x; int y; /* Location of a point inside this node */ int y, /* Location of a point inside this node */
char *layerName; /* Name of tile type */ char *layerName, /* Name of tile type */
char **av; /* Pairs of area, perimeter strings */ char **av, /* Pairs of area, perimeter strings */
int ac; /* Number of strings in av */ int ac) /* Number of strings in av */
{ {
EFNodeName *newname; EFNodeName *newname;
EFNode *newnode; EFNode *newnode;
@ -333,10 +333,10 @@ efBuildNode(def, isSubsnode, isDevSubsnode, isExtNode, nodeName, nodeCap,
*/ */
void void
efAdjustSubCap(def, nodeName, nodeCapAdjust) efAdjustSubCap(
Def *def; /* Def to which this connection is to be added */ Def *def, /* Def to which this connection is to be added */
char *nodeName; /* One of the names for this node */ char *nodeName, /* One of the names for this node */
double nodeCapAdjust; /* Substrate capacitance adjustment */ double nodeCapAdjust) /* Substrate capacitance adjustment */
{ {
EFNodeName *nodename; EFNodeName *nodename;
EFNode *node; EFNode *node;
@ -375,12 +375,12 @@ efAdjustSubCap(def, nodeName, nodeCapAdjust)
*/ */
void void
efBuildAttr(def, nodeName, r, layerName, text) efBuildAttr(
Def *def; Def *def,
char *nodeName; char *nodeName,
Rect *r; Rect *r,
char *layerName; char *layerName,
char *text; char *text)
{ {
HashEntry *he; HashEntry *he;
EFNodeName *nn; EFNodeName *nn;
@ -431,13 +431,12 @@ efBuildAttr(def, nodeName, r, layerName, text)
*/ */
void void
efBuildDist(def, driver, receiver, min, max) efBuildDist(
Def *def; /* Def for which we're adding a new Distance */ Def *def, /* Def for which we're adding a new Distance */
char *driver; /* Source terminal */ char *driver, /* Source terminal */
char *receiver; /* Destination terminal */ char *receiver, /* Destination terminal */
int min, max; /* Minimum and maximum acyclic distance from source int min,
* to destination. int max)
*/
{ {
Distance *dist, distKey; Distance *dist, distKey;
HierName *hn1, *hn2; HierName *hn1, *hn2;
@ -506,9 +505,9 @@ efBuildDist(def, driver, receiver, min, max)
*/ */
void void
efBuildKill(def, name) efBuildKill(
Def *def; /* Def for which we're adding a new Kill */ Def *def, /* Def for which we're adding a new Kill */
char *name; /* Name of node to die */ char *name) /* Name of node to die */
{ {
Kill *kill; Kill *kill;
@ -538,14 +537,14 @@ efBuildKill(def, name)
*/ */
void void
efBuildEquiv(def, nodeName1, nodeName2, resist, isspice) efBuildEquiv(
Def *def; /* Def for which we're adding a new node name */ Def *def, /* Def for which we're adding a new node name */
char *nodeName1; /* One of node names to be made equivalent */ char *nodeName1, /* One of node names to be made equivalent */
char *nodeName2; /* Other name to be made equivalent. One of nodeName1 char *nodeName2, /* Other name to be made equivalent. One of nodeName1
* or nodeName2 must already be known. * or nodeName2 must already be known.
*/ */
bool resist; /* True if "extresist on" option was selected */ bool resist, /* True if "extresist on" option was selected */
bool isspice; /* Passed from EFReadFile(), is only TRUE when bool isspice) /* Passed from EFReadFile(), is only TRUE when
* running ext2spice. Indicates that nodes are * running ext2spice. Indicates that nodes are
* case-insensitive. * case-insensitive.
*/ */
@ -750,8 +749,8 @@ efBuildEquiv(def, nodeName1, nodeName2, resist, isspice)
*/ */
DevParam * DevParam *
efGetDeviceParams(name) efGetDeviceParams(
char *name; char *name)
{ {
HashEntry *he; HashEntry *he;
DevParam *plist = NULL; DevParam *plist = NULL;
@ -774,10 +773,10 @@ efGetDeviceParams(name)
*/ */
void void
efBuildDeviceParams(name, argc, argv) efBuildDeviceParams(
char *name; char *name,
int argc; int argc,
char *argv[]; char *argv[])
{ {
HashEntry *he; HashEntry *he;
DevParam *plist = NULL, *newparm; DevParam *plist = NULL, *newparm;
@ -1328,13 +1327,14 @@ efBuildDevice(
*/ */
void void
efBuildPortNode(def, name, idx, x, y, layername, toplevel) efBuildPortNode(
Def *def; /* Def to which this connection is to be added */ Def *def, /* Def to which this connection is to be added */
char *name; /* One of the names for this node */ char *name, /* One of the names for this node */
int idx; /* Port number (order) */ int idx, /* Port number (order) */
int x; int y; /* Location of a point inside this node */ int x,
char *layername; /* Name of tile type */ int y, /* Location of a point inside this node */
bool toplevel; /* 1 if the cell def is the top level cell */ char *layername, /* Name of tile type */
bool toplevel) /* 1 if the cell def is the top level cell */
{ {
HashEntry *he; HashEntry *he;
EFNodeName *nn; EFNodeName *nn;
@ -1375,8 +1375,8 @@ efBuildPortNode(def, name, idx, x, y, layername, toplevel)
*/ */
int int
EFGetPortMax(def) EFGetPortMax(
Def *def; Def *def)
{ {
EFNode *snode; EFNode *snode;
EFNodeName *nodeName; EFNodeName *nodeName;
@ -1480,11 +1480,11 @@ efBuildDevNode(
*/ */
int int
efBuildAddStr(table, pMax, size, str) efBuildAddStr(
char *table[]; /* Table to search */ char *table[], /* Table to search */
int *pMax; /* Increment this if we add an entry */ int *pMax, /* Increment this if we add an entry */
int size; /* Maximum size of table */ int size, /* Maximum size of table */
char *str; /* String to add */ char *str) /* String to add */
{ {
int n, max; int n, max;
@ -1530,12 +1530,16 @@ efBuildAddStr(table, pMax, size, str)
*/ */
void void
efBuildUse(def, subDefName, subUseId, ta, tb, tc, td, te, tf) efBuildUse(
Def *def; /* Def to which this connection is to be added */ Def *def, /* Def to which this connection is to be added */
char *subDefName; /* Def of which this a use */ char *subDefName, /* Def of which this a use */
char *subUseId; /* Use identifier for the def 'subDefName' */ char *subUseId, /* Use identifier for the def 'subDefName' */
int ta, tb, tc, int ta,
td, te, tf; /* Elements of a transform from coordinates of int tb,
int tc,
int td,
int te,
int tf) /* Elements of a transform from coordinates of
* subDefName up to def. * subDefName up to def.
*/ */
{ {
@ -1613,7 +1617,8 @@ efBuildUse(def, subDefName, subUseId, ta, tb, tc, td, te, tf)
*/ */
void void
efConnectionFreeLinkedList(Connection *conn) efConnectionFreeLinkedList(
Connection *conn)
{ {
while (conn) while (conn)
{ {
@ -1641,7 +1646,8 @@ efConnectionFreeLinkedList(Connection *conn)
*/ */
void void
efConnPointFreeLinkedList(ConnectionPoint *connpt) efConnPointFreeLinkedList(
ConnectionPoint *connpt)
{ {
while (connpt) while (connpt)
{ {
@ -1677,12 +1683,15 @@ efConnPointFreeLinkedList(ConnectionPoint *connpt)
*/ */
void void
efBuildConnect(def, llx, lly, urx, ury, layerName, upnodeName, downnodeName) efBuildConnect(
Def *def; Def *def,
int llx, lly, urx, ury; int llx,
char *layerName; int lly,
char *upnodeName; int urx,
char *downnodeName; int ury,
char *layerName,
char *upnodeName,
char *downnodeName)
{ {
int tnew; int tnew;
ConnectionPoint *connpt; ConnectionPoint *connpt;
@ -1759,13 +1768,13 @@ efBuildConnect(def, llx, lly, urx, ury, layerName, upnodeName, downnodeName)
*/ */
void void
efBuildMerge(def, nodeName1, nodeName2, deltaC, av, ac) efBuildMerge(
Def *def; /* Def to which this connection is to be added */ Def *def, /* Def to which this connection is to be added */
char *nodeName1; /* Name of first node in connection */ char *nodeName1, /* Name of first node in connection */
char *nodeName2; /* Name of other node in connection */ char *nodeName2, /* Name of other node in connection */
double deltaC; /* Adjustment in capacitance */ double deltaC, /* Adjustment in capacitance */
char **av; /* Strings for area, perimeter adjustment */ char **av, /* Strings for area, perimeter adjustment */
int ac; /* Number of strings in av */ int ac) /* Number of strings in av */
{ {
int n; int n;
Connection *conn; Connection *conn;
@ -1878,11 +1887,11 @@ efBuildMerge(def, nodeName1, nodeName2, deltaC, av, ac)
*/ */
void void
efBuildResistor(def, nodeName1, nodeName2, resistance) efBuildResistor(
Def *def; /* Def to which this connection is to be added */ Def *def, /* Def to which this connection is to be added */
char *nodeName1; /* Name of first node in resistor */ char *nodeName1, /* Name of first node in resistor */
char *nodeName2; /* Name of second node in resistor */ char *nodeName2, /* Name of second node in resistor */
float resistance; /* Resistor value */ float resistance) /* Resistor value */
{ {
Connection *conn; Connection *conn;
@ -1915,11 +1924,11 @@ efBuildResistor(def, nodeName1, nodeName2, resistance)
*/ */
void void
efBuildCap(def, nodeName1, nodeName2, cap) efBuildCap(
Def *def; /* Def to which this connection is to be added */ Def *def, /* Def to which this connection is to be added */
char *nodeName1; /* Name of first node in capacitor */ char *nodeName1, /* Name of first node in capacitor */
char *nodeName2; /* Name of second node in capacitor */ char *nodeName2, /* Name of second node in capacitor */
double cap; /* Capacitor value */ double cap) /* Capacitor value */
{ {
Connection *conn; Connection *conn;
@ -1951,9 +1960,10 @@ efBuildCap(def, nodeName1, nodeName2, cap)
*/ */
bool bool
efConnInitSubs(conn, nodeName1, nodeName2) efConnInitSubs(
Connection *conn; Connection *conn,
char *nodeName1, *nodeName2; char *nodeName1,
char *nodeName2)
{ {
ConnName *c1, *c2; ConnName *c1, *c2;
int n; int n;
@ -2009,9 +2019,9 @@ bad:
*/ */
bool bool
efConnBuildName(cnp, name) efConnBuildName(
ConnName *cnp; ConnName *cnp,
char *name; char *name)
{ {
char *srcp, *dstp, *cp, *dp; char *srcp, *dstp, *cp, *dp;
int nsubs; int nsubs;
@ -2116,11 +2126,11 @@ again:
*/ */
void void
efNodeAddName(node, he, hn, isNew) efNodeAddName(
EFNode *node; EFNode *node,
HashEntry *he; HashEntry *he,
HierName *hn; HierName *hn,
bool isNew; // If TRUE, added name is never the preferred name. bool isNew) // If TRUE, added name is never the preferred name.
{ {
EFNodeName *newnn; EFNodeName *newnn;
EFNodeName *oldnn; EFNodeName *oldnn;
@ -2182,8 +2192,9 @@ efNodeAddName(node, he, hn, isNew)
*/ */
EFNode * EFNode *
efNodeMerge(node1ptr, node2ptr) efNodeMerge(
EFNode **node1ptr, **node2ptr; /* Pointers to hierarchical nodes */ EFNode **node1ptr,
EFNode **node2ptr)
{ {
EFNodeName *nn, *nnlast; EFNodeName *nn, *nnlast;
EFAttr *ap; EFAttr *ap;
@ -2408,8 +2419,8 @@ efNodeMerge(node1ptr, node2ptr)
*/ */
void void
efFreeUseTable(table) efFreeUseTable(
HashTable *table; HashTable *table)
{ {
HashSearch hs; HashSearch hs;
HashEntry *he; HashEntry *he;
@ -2438,8 +2449,8 @@ efFreeUseTable(table)
*/ */
void void
efFreeDevTable(table) efFreeDevTable(
HashTable *table; HashTable *table)
{ {
Dev *dev; Dev *dev;
HashSearch hs; HashSearch hs;
@ -2481,8 +2492,8 @@ efFreeDevTable(table)
*/ */
void void
efFreeNodeTable(table) efFreeNodeTable(
HashTable *table; HashTable *table)
{ {
HashSearch hs; HashSearch hs;
HashEntry *he; HashEntry *he;
@ -2536,9 +2547,9 @@ efFreeNodeTable(table)
*/ */
void void
efFreeNodeList(head, func) efFreeNodeList(
EFNode *head; EFNode *head,
int (*func)(); int (*func)())
{ {
EFNode *node; EFNode *node;
EFAttr *ap; EFAttr *ap;
@ -2590,8 +2601,8 @@ efFreeNodeList(head, func)
*/ */
void void
efFreeConn(conn) efFreeConn(
Connection *conn; Connection *conn)
{ {
if (conn->conn_name1) freeMagic(conn->conn_name1); if (conn->conn_name1) freeMagic(conn->conn_name1);
if (conn->conn_name2) freeMagic(conn->conn_name2); if (conn->conn_name2) freeMagic(conn->conn_name2);

View File

@ -95,8 +95,8 @@ EFInit()
*/ */
void void
EFDone(func) EFDone(
int (*func)(); int (*func)())
{ {
Connection *conn; Connection *conn;
HashSearch hs; HashSearch hs;
@ -204,8 +204,8 @@ EFDone(func)
*/ */
Def * Def *
efDefLook(name) efDefLook(
char *name; char *name)
{ {
HashEntry *he; HashEntry *he;
@ -233,8 +233,8 @@ efDefLook(name)
*/ */
Def * Def *
efDefNew(name) efDefNew(
char *name; char *name)
{ {
HashEntry *he; HashEntry *he;
Def *newdef; Def *newdef;

View File

@ -101,9 +101,9 @@ int efAddOneConn(HierContext *hc, char *name1, char *name2, Connection *conn, in
*/ */
void void
EFFlatBuild(name, flags) EFFlatBuild(
char *name; /* Name of root def being flattened */ char *name, /* Name of root def being flattened */
int flags; /* Say what to flatten; see above */ int flags) /* Say what to flatten; see above */
{ {
efFlatRootDef = efDefLook(name); efFlatRootDef = efDefLook(name);
if (efHNStats) efHNPrintSizes("before building flattened table"); if (efHNStats) efHNPrintSizes("before building flattened table");
@ -180,9 +180,9 @@ EFFlatBuild(name, flags)
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
HierContext * HierContext *
EFFlatBuildOneLevel(def, flags) EFFlatBuildOneLevel(
Def *def; /* root def being flattened */ Def *def, /* root def being flattened */
int flags; int flags)
{ {
int usecount, savecount; int usecount, savecount;
Use *use; Use *use;
@ -262,8 +262,8 @@ EFFlatBuildOneLevel(def, flags)
*/ */
void void
EFFlatDone(func) EFFlatDone(
int (*func)(); int (*func)())
{ {
#ifdef MALLOCTRACE #ifdef MALLOCTRACE
/* Hash table statistics */ /* Hash table statistics */
@ -317,9 +317,9 @@ EFFlatDone(func)
*/ */
int int
efFlatNodes(hc, clientData) efFlatNodes(
HierContext *hc; HierContext *hc,
ClientData clientData; ClientData clientData)
{ {
int flags = (int)CD2INT(clientData); int flags = (int)CD2INT(clientData);
int hierflags = 0; int hierflags = 0;
@ -382,8 +382,8 @@ efFlatNodes(hc, clientData)
*/ */
int int
efFlatNodesStdCell(hc) efFlatNodesStdCell(
HierContext *hc; HierContext *hc)
{ {
if (!(hc->hc_use->use_def->def_flags & DEF_SUBCIRCUIT)) if (!(hc->hc_use->use_def->def_flags & DEF_SUBCIRCUIT))
{ {
@ -402,9 +402,9 @@ efFlatNodesStdCell(hc)
} }
int int
efFlatNodesDeviceless(hc, cdata) efFlatNodesDeviceless(
HierContext *hc; HierContext *hc,
ClientData cdata; ClientData cdata)
{ {
int *usecount = (int *)cdata; int *usecount = (int *)cdata;
int newcount; int newcount;
@ -874,8 +874,9 @@ efFlatGlobError(
} }
bool bool
efFlatGlobCmp(hierName1, hierName2) efFlatGlobCmp(
HierName *hierName1, *hierName2; HierName *hierName1,
HierName *hierName2)
{ {
if (hierName1 == hierName2) if (hierName1 == hierName2)
return FALSE; return FALSE;
@ -887,8 +888,8 @@ efFlatGlobCmp(hierName1, hierName2)
} }
char * char *
efFlatGlobCopy(hierName) efFlatGlobCopy(
HierName *hierName; HierName *hierName)
{ {
HierName *hNew; HierName *hNew;
int size; int size;
@ -905,8 +906,8 @@ efFlatGlobCopy(hierName)
} }
int int
efFlatGlobHash(hierName) efFlatGlobHash(
HierName *hierName; HierName *hierName)
{ {
return hierName->hn_hash; return hierName->hn_hash;
} }
@ -931,8 +932,8 @@ efFlatGlobHash(hierName)
*/ */
int int
efFlatKills(hc) efFlatKills(
HierContext *hc; HierContext *hc)
{ {
Def *def = hc->hc_use->use_def; Def *def = hc->hc_use->use_def;
HashEntry *he; HashEntry *he;
@ -976,8 +977,8 @@ efFlatKills(hc)
int int
efFlatCapsDeviceless(hc) efFlatCapsDeviceless(
HierContext *hc; HierContext *hc)
{ {
Connection *conn; Connection *conn;
int newcount; int newcount;
@ -1040,8 +1041,8 @@ efFlatCapsDeviceless(hc)
*/ */
int int
efFlatCaps(hc) efFlatCaps(
HierContext *hc; HierContext *hc)
{ {
Connection *conn; Connection *conn;
@ -1156,8 +1157,8 @@ efFlatSingleCap(
*/ */
int int
efFlatDists(hc) efFlatDists(
HierContext *hc; HierContext *hc)
{ {
Distance *dist, *distFlat, distKey; Distance *dist, *distFlat, distKey;
HashEntry *he, *heFlat; HashEntry *he, *heFlat;
@ -1227,9 +1228,9 @@ HashEntry *he;
* *
*/ */
void void
CapHashSetValue(he, c) CapHashSetValue(
HashEntry *he; HashEntry *he,
double c; double c)
{ {
EFCapValue *capp = (EFCapValue *)HashGetValue(he); EFCapValue *capp = (EFCapValue *)HashGetValue(he);
if(capp == NULL) { if(capp == NULL) {

View File

@ -69,10 +69,10 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
*/ */
int int
efHierSrUses(hc, func, cdata) efHierSrUses(
HierContext *hc; HierContext *hc,
int (*func)(); int (*func)(),
ClientData cdata; ClientData cdata)
{ {
int xlo, xhi, ylo, yhi, xbase, ybase, xsep, ysep; int xlo, xhi, ylo, yhi, xbase, ybase, xsep, ysep;
HierContext newhc; HierContext newhc;
@ -153,11 +153,11 @@ efHierSrUses(hc, func, cdata)
*/ */
int int
efHierSrArray(hc, conn, proc, cdata) efHierSrArray(
HierContext *hc; HierContext *hc,
Connection *conn; Connection *conn,
int (*proc)(); int (*proc)(),
ClientData cdata; ClientData cdata)
{ {
char name1[1024], name2[1024]; char name1[1024], name2[1024];
int i, j, i1lo, i2lo, j1lo, j2lo; int i, j, i1lo, i2lo, j1lo, j2lo;
@ -234,10 +234,10 @@ efHierSrArray(hc, conn, proc, cdata)
*/ */
int int
EFHierSrDefs(hc, func, cdata) EFHierSrDefs(
HierContext *hc; HierContext *hc,
int (*func)(); int (*func)(),
ClientData cdata; ClientData cdata)
{ {
HierContext newhc; HierContext newhc;
Use *u; Use *u;
@ -321,10 +321,10 @@ EFHierSrDefs(hc, func, cdata)
*/ */
int int
EFHierVisitSubcircuits(hc, subProc, cdata) EFHierVisitSubcircuits(
HierContext *hc; HierContext *hc,
int (*subProc)(); int (*subProc)(),
ClientData cdata; /* unused */ ClientData cdata) /* unused */
{ {
CallArg ca; CallArg ca;
int efHierVisitSubcircuits(); /* Forward declaration */ int efHierVisitSubcircuits(); /* Forward declaration */
@ -353,9 +353,9 @@ EFHierVisitSubcircuits(hc, subProc, cdata)
*/ */
int int
efHierVisitSubcircuits(hc, ca) efHierVisitSubcircuits(
HierContext *hc; HierContext *hc,
CallArg *ca; CallArg *ca)
{ {
/* Visit all children of this def */ /* Visit all children of this def */
Def *def = (Def *)ca->ca_cdata; Def *def = (Def *)ca->ca_cdata;
@ -385,10 +385,10 @@ efHierVisitSubcircuits(hc, ca)
*/ */
bool bool
efHierDevKilled(hc, dev, prefix) efHierDevKilled(
HierContext *hc; HierContext *hc,
Dev *dev; Dev *dev,
HierName *prefix; HierName *prefix)
{ {
HierName *suffix; HierName *suffix;
HashEntry *he; HashEntry *he;
@ -468,9 +468,9 @@ EFHierVisitDevs(
*/ */
int int
efHierVisitDevs(hc, ca) efHierVisitDevs(
HierContext *hc; HierContext *hc,
CallArg *ca; CallArg *ca)
{ {
Def *def = hc->hc_use->use_def; Def *def = hc->hc_use->use_def;
Dev *dev; Dev *dev;
@ -678,10 +678,10 @@ efHierVisitResists(
*/ */
int int
EFHierVisitCaps(hc, capProc, cdata) EFHierVisitCaps(
HierContext *hc; HierContext *hc,
int (*capProc)(); int (*capProc)(),
ClientData cdata; ClientData cdata)
{ {
HashSearch hs; HashSearch hs;
HashEntry *he; HashEntry *he;
@ -737,10 +737,10 @@ EFHierVisitCaps(hc, capProc, cdata)
*/ */
int int
EFHierVisitNodes(hc, nodeProc, cdata) EFHierVisitNodes(
HierContext *hc; HierContext *hc,
int (*nodeProc)(); int (*nodeProc)(),
ClientData cdata; ClientData cdata)
{ {
Def *def = hc->hc_use->use_def; Def *def = hc->hc_use->use_def;
EFCapValue cap; EFCapValue cap;

View File

@ -319,12 +319,12 @@ extern void CapHashSetValue();
that some ANSI C compilers introduce */ that some ANSI C compilers introduce */
extern DevParam *efGetDeviceParams(); extern DevParam *efGetDeviceParams();
extern void efBuildNode(); extern void efBuildNode(Def *def, bool isSubsnode, bool isDevSubsnode, bool isExtNode, char *nodeName, double nodeCap, int x, int y, char *layerName, char **av, int ac);
extern void efConnectionFreeLinkedList(Connection *conn); extern void efConnectionFreeLinkedList(Connection *conn);
extern void efConnPointFreeLinkedList(ConnectionPoint *conn); extern void efConnPointFreeLinkedList(ConnectionPoint *conn);
extern void efBuildConnect(); extern void efBuildConnect();
extern void efBuildMerge(); extern void efBuildMerge();
extern void efBuildResistor(); extern void efBuildResistor(Def *def, char *nodeName1, char *nodeName2, float resistance);
extern void efBuildCap(); extern void efBuildCap();
extern HierContext *EFFlatBuildOneLevel(); extern HierContext *EFFlatBuildOneLevel();

View File

@ -98,8 +98,8 @@ extern void efHNRecord();
*/ */
bool bool
EFHNIsGlob(hierName) EFHNIsGlob(
HierName *hierName; HierName *hierName)
{ {
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
char *retstr; char *retstr;
@ -134,8 +134,8 @@ EFHNIsGlob(hierName)
*/ */
bool bool
EFHNIsGND(hierName) EFHNIsGND(
HierName *hierName; HierName *hierName)
{ {
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
char *retstr; char *retstr;
@ -171,9 +171,9 @@ EFHNIsGND(hierName)
*/ */
HierName * HierName *
EFHNConcat(prefix, suffix) EFHNConcat(
HierName *prefix; /* Components of name on root side */ HierName *prefix, /* Components of name on root side */
HierName *suffix; /* Components of name on leaf side */ HierName *suffix) /* Components of name on leaf side */
{ {
HierName *new, *prev; HierName *new, *prev;
HierName *firstNew; HierName *firstNew;
@ -220,9 +220,9 @@ EFHNConcat(prefix, suffix)
*/ */
HierName * HierName *
EFStrToHN(prefix, suffixStr) EFStrToHN(
HierName *prefix; /* Components of name on side of root */ HierName *prefix, /* Components of name on side of root */
char *suffixStr; /* Leaf part of name (may have /'s) */ char *suffixStr) /* Leaf part of name (may have /'s) */
{ {
char *cp; char *cp;
HashEntry *he; HashEntry *he;
@ -281,8 +281,8 @@ EFStrToHN(prefix, suffixStr)
*/ */
char * char *
EFHNToStr(hierName) EFHNToStr(
HierName *hierName; /* Name to be converted */ HierName *hierName) /* Name to be converted */
{ {
static char namebuf[2048]; static char namebuf[2048];
@ -308,9 +308,9 @@ EFHNToStr(hierName)
*/ */
char * char *
efHNToStrFunc(hierName, dstp) efHNToStrFunc(
HierName *hierName; /* Name to be converted */ HierName *hierName, /* Name to be converted */
char *dstp; /* Store name here */ char *dstp) /* Store name here */
{ {
char *srcp; char *srcp;
@ -359,10 +359,10 @@ efHNToStrFunc(hierName, dstp)
*/ */
HashEntry * HashEntry *
EFHNLook(prefix, suffixStr, errorStr) EFHNLook(
HierName *prefix; /* Components of name on root side */ HierName *prefix, /* Components of name on root side */
char *suffixStr; /* Part of name on leaf side */ char *suffixStr, /* Part of name on leaf side */
char *errorStr; /* Explanatory string for errors */ char *errorStr) /* Explanatory string for errors */
{ {
HierName *hierName, *hn; HierName *hierName, *hn;
bool dontFree = FALSE; bool dontFree = FALSE;
@ -413,10 +413,10 @@ EFHNLook(prefix, suffixStr, errorStr)
*/ */
HashEntry * HashEntry *
EFHNConcatLook(prefix, suffix, errorStr) EFHNConcatLook(
HierName *prefix; /* Components of name on root side */ HierName *prefix, /* Components of name on root side */
HierName *suffix; /* Part of name on leaf side */ HierName *suffix, /* Part of name on leaf side */
char *errorStr; /* Explanatory string for errors */ char *errorStr) /* Explanatory string for errors */
{ {
HashEntry *he; HashEntry *he;
HierName *hn; HierName *hn;
@ -463,9 +463,10 @@ EFHNConcatLook(prefix, suffix, errorStr)
*/ */
void void
EFHNFree(hierName, prefix, type) EFHNFree(
HierName *hierName, *prefix; HierName *hierName,
int type; /* HN_ALLOC, HN_CONCAT, etc */ HierName *prefix,
int type) /* HN_ALLOC, HN_CONCAT, etc */
{ {
HierName *hn; HierName *hn;
@ -507,8 +508,9 @@ EFHNFree(hierName, prefix, type)
*/ */
bool bool
EFHNBest(hierName1, hierName2) EFHNBest(
HierName *hierName1, *hierName2; HierName *hierName1,
HierName *hierName2)
{ {
int ncomponents1, ncomponents2, len1, len2; int ncomponents1, ncomponents2, len1, len2;
HierName *np1, *np2; HierName *np1, *np2;
@ -591,8 +593,9 @@ EFHNBest(hierName1, hierName2)
*/ */
int int
efHNLexOrder(hierName1, hierName2) efHNLexOrder(
HierName *hierName1, *hierName2; HierName *hierName1,
HierName *hierName2)
{ {
int i; int i;
@ -628,9 +631,9 @@ efHNLexOrder(hierName1, hierName2)
*/ */
HierName * HierName *
efHNFromUse(hc, prefix) efHNFromUse(
HierContext *hc; /* Contains use and array information */ HierContext *hc, /* Contains use and array information */
HierName *prefix; /* Root part of name */ HierName *prefix) /* Root part of name */
{ {
char *srcp, *dstp; char *srcp, *dstp;
char name[2048], *namePtr; char name[2048], *namePtr;
@ -725,8 +728,9 @@ efHNFromUse(hc, prefix)
*/ */
bool bool
efHNUseCompare(hierName1, hierName2) efHNUseCompare(
HierName *hierName1, *hierName2; HierName *hierName1,
HierName *hierName2)
{ {
return ((bool)(hierName1->hn_parent != hierName2->hn_parent return ((bool)(hierName1->hn_parent != hierName2->hn_parent
|| strcmp(hierName1->hn_name, hierName2->hn_name) || strcmp(hierName1->hn_name, hierName2->hn_name)
@ -734,8 +738,8 @@ efHNUseCompare(hierName1, hierName2)
} }
int int
efHNUseHash(hierName) efHNUseHash(
HierName *hierName; HierName *hierName)
{ {
return hierName->hn_hash + (spointertype) hierName->hn_parent; return hierName->hn_hash + (spointertype) hierName->hn_parent;
} }
@ -760,10 +764,10 @@ efHNUseHash(hierName)
*/ */
void void
efHNInit(hierName, cp, endp) efHNInit(
HierName *hierName; /* Fill in fields of this HierName */ HierName *hierName, /* Fill in fields of this HierName */
char *cp; /* Start of name to be stored in hn_name */ char *cp, /* Start of name to be stored in hn_name */
char *endp; /* End of name if non-NULL; else, see above */ char *endp) /* End of name if non-NULL; else, see above */
{ {
unsigned hashsum; unsigned hashsum;
char *dstp; char *dstp;
@ -817,8 +821,9 @@ efHNInit(hierName, cp, endp)
*/ */
int int
efHNCompare(hierName1, hierName2) efHNCompare(
HierName *hierName1, *hierName2; HierName *hierName1,
HierName *hierName2)
{ {
while (hierName1) while (hierName1)
{ {
@ -837,8 +842,8 @@ efHNCompare(hierName1, hierName2)
} }
int int
efHNHash(hierName) efHNHash(
HierName *hierName; HierName *hierName)
{ {
int n; int n;
@ -877,8 +882,9 @@ efHNHash(hierName)
*/ */
bool bool
efHNDistCompare(dist1, dist2) efHNDistCompare(
Distance *dist1, *dist2; Distance *dist1,
Distance *dist2)
{ {
return ((bool)(efHNCompare(dist1->dist_1, dist2->dist_1) return ((bool)(efHNCompare(dist1->dist_1, dist2->dist_1)
|| efHNCompare(dist1->dist_2, dist2->dist_2) || efHNCompare(dist1->dist_2, dist2->dist_2)
@ -886,8 +892,8 @@ efHNDistCompare(dist1, dist2)
} }
char * char *
efHNDistCopy(dist) efHNDistCopy(
Distance *dist; Distance *dist)
{ {
Distance *distNew; Distance *distNew;
@ -897,16 +903,16 @@ efHNDistCopy(dist)
} }
int int
efHNDistHash(dist) efHNDistHash(
Distance *dist; Distance *dist)
{ {
return efHNHash(dist->dist_1) + efHNHash(dist->dist_2); return efHNHash(dist->dist_1) + efHNHash(dist->dist_2);
} }
void void
efHNDistKill(dist) efHNDistKill(
Distance *dist; Distance *dist)
{ {
HierName *hn; HierName *hn;
@ -936,10 +942,10 @@ efHNDistKill(dist)
*/ */
void void
efHNBuildDistKey(prefix, dist, distKey) efHNBuildDistKey(
HierName *prefix; HierName *prefix,
Distance *dist; Distance *dist,
Distance *distKey; Distance *distKey)
{ {
HierName *hn1, *hn2; HierName *hn1, *hn2;
@ -1002,16 +1008,16 @@ efHNDump()
int efHNSizes[4]; int efHNSizes[4];
void void
efHNRecord(size, type) efHNRecord(
int size; int size,
int type; int type)
{ {
efHNSizes[type] += size; efHNSizes[type] += size;
} }
void void
efHNPrintSizes(when) efHNPrintSizes(
char *when; char *when)
{ {
int total, i; int total, i;

View File

@ -94,8 +94,8 @@ efSymInit()
*/ */
bool bool
efSymAddFile(name) efSymAddFile(
char *name; char *name)
{ {
char line[1024], *cp; char line[1024], *cp;
int lineNum; int lineNum;
@ -140,8 +140,8 @@ efSymAddFile(name)
*/ */
bool bool
efSymAdd(str) efSymAdd(
char *str; char *str)
{ {
HashEntry *he; HashEntry *he;
char *value; char *value;
@ -191,9 +191,9 @@ efSymAdd(str)
*/ */
bool bool
efSymLook(name, pValue) efSymLook(
char *name; char *name,
int *pValue; int *pValue)
{ {
HashEntry *he; HashEntry *he;

View File

@ -90,9 +90,9 @@ bool efDevKilled();
*/ */
int int
EFVisitSubcircuits(subProc, cdata) EFVisitSubcircuits(
int (*subProc)(); int (*subProc)(),
ClientData cdata; ClientData cdata)
{ {
CallArg ca; CallArg ca;
HierContext *hc; HierContext *hc;
@ -129,9 +129,9 @@ EFVisitSubcircuits(subProc, cdata)
*/ */
int int
efVisitSubcircuits(hc, ca) efVisitSubcircuits(
HierContext *hc; HierContext *hc,
CallArg *ca; CallArg *ca)
{ {
/* Look for children of this def which are defined */ /* Look for children of this def which are defined */
/* as subcircuits via the DEF_SUBCIRCUIT flag. */ /* as subcircuits via the DEF_SUBCIRCUIT flag. */
@ -172,10 +172,10 @@ efVisitSubcircuits(hc, ca)
*/ */
void void
EFGetLengthAndWidth(dev, lptr, wptr) EFGetLengthAndWidth(
Dev *dev; Dev *dev,
int *lptr; int *lptr,
int *wptr; int *wptr)
{ {
DevTerm *gate, *source, *drain; DevTerm *gate, *source, *drain;
int area, perim, l, w; int area, perim, l, w;
@ -300,9 +300,9 @@ EFVisitDevs(
*/ */
int int
efVisitDevs(hc, ca) efVisitDevs(
HierContext *hc; HierContext *hc,
CallArg *ca; CallArg *ca)
{ {
Def *def = hc->hc_use->use_def; Def *def = hc->hc_use->use_def;
Dev *dev; Dev *dev;
@ -355,9 +355,9 @@ efVisitDevs(hc, ca)
*/ */
bool bool
efDevKilled(dev, prefix) efDevKilled(
Dev *dev; Dev *dev,
HierName *prefix; HierName *prefix)
{ {
HierName *suffix; HierName *suffix;
HashEntry *he; HashEntry *he;
@ -399,9 +399,10 @@ efDevKilled(dev, prefix)
*/ */
void void
efDevFixLW(attrs, pL, pW) efDevFixLW(
char *attrs; char *attrs,
int *pL, *pW; int *pL,
int *pW)
{ {
char *cp, *ep; char *cp, *ep;
char attrName, savec; char attrName, savec;
@ -512,9 +513,9 @@ extern int efVisitSingleResist(HierContext *hc, const char *name1, const char *n
Connection *res, ClientData cdata); /* @typedef cb_extflat_hiersrarray_t (CallArg*) */ Connection *res, ClientData cdata); /* @typedef cb_extflat_hiersrarray_t (CallArg*) */
int int
efVisitResists(hc, ca) efVisitResists(
HierContext *hc; HierContext *hc,
CallArg *ca; CallArg *ca)
{ {
Def *def = hc->hc_use->use_def; Def *def = hc->hc_use->use_def;
Connection *res; Connection *res;
@ -626,9 +627,9 @@ efVisitSingleResist(
*/ */
int int
EFVisitCaps(capProc, cdata) EFVisitCaps(
int (*capProc)(); int (*capProc)(),
ClientData cdata; ClientData cdata)
{ {
HashSearch hs; HashSearch hs;
HashEntry *he; HashEntry *he;
@ -682,9 +683,9 @@ EFVisitCaps(capProc, cdata)
*/ */
int int
EFVisitNodes(nodeProc, cdata) EFVisitNodes(
int (*nodeProc)(); int (*nodeProc)(),
ClientData cdata; ClientData cdata)
{ {
EFNode *node; EFNode *node;
EFNodeName *nn; EFNodeName *nn;
@ -780,8 +781,8 @@ EFVisitNodes(nodeProc, cdata)
*/ */
int int
EFNodeResist(node) EFNodeResist(
EFNode *node; EFNode *node)
{ {
int n, perim, area; int n, perim, area;
float s, fperim; float s, fperim;
@ -829,9 +830,11 @@ EFNodeResist(node)
*/ */
bool bool
EFLookDist(hn1, hn2, pMinDist, pMaxDist) EFLookDist(
HierName *hn1, *hn2; HierName *hn1,
int *pMinDist, *pMaxDist; HierName *hn2,
int *pMinDist,
int *pMaxDist)
{ {
Distance distKey, *dist; Distance distKey, *dist;
HashEntry *he; HashEntry *he;
@ -875,9 +878,9 @@ EFLookDist(hn1, hn2, pMinDist, pMaxDist)
*/ */
void void
EFHNOut(hierName, outf) EFHNOut(
HierName *hierName; HierName *hierName,
FILE *outf; FILE *outf)
{ {
bool trimGlob, trimLocal, convComma, convBrackets; bool trimGlob, trimLocal, convComma, convBrackets;
char *cp, c; char *cp, c;
@ -923,9 +926,9 @@ EFHNOut(hierName, outf)
} }
void void
efHNOutPrefix(hierName, outf) efHNOutPrefix(
HierName *hierName; HierName *hierName,
FILE *outf; FILE *outf)
{ {
char *cp, c; char *cp, c;

View File

@ -80,9 +80,9 @@ extern void efBuildAttr();
extern int efBuildDevice(Def *def, char class, char *type, const Rect *r, int argc, char *argv[]); extern int efBuildDevice(Def *def, char class, char *type, const Rect *r, int argc, char *argv[]);
extern void efBuildDeviceParams(); extern void efBuildDeviceParams();
extern void efBuildDist(); extern void efBuildDist();
extern void efBuildEquiv(); extern void efBuildEquiv(Def *def, char *nodeName1, char *nodeName2, bool resist, bool isspice);
extern void efBuildKill(); extern void efBuildKill();
extern void efBuildPortNode(); extern void efBuildPortNode(Def *def, char *name, int idx, int x, int y, char *layername, bool toplevel);
extern void efBuildUse(); extern void efBuildUse();
extern int efFlatCaps(); extern int efFlatCaps();
extern int efFlatDists(); extern int efFlatDists();