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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -319,12 +319,12 @@ extern void CapHashSetValue();
that some ANSI C compilers introduce */
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 efConnPointFreeLinkedList(ConnectionPoint *conn);
extern void efBuildConnect();
extern void efBuildMerge();
extern void efBuildResistor();
extern void efBuildResistor(Def *def, char *nodeName1, char *nodeName2, float resistance);
extern void efBuildCap();
extern HierContext *EFFlatBuildOneLevel();

View File

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

View File

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

View File

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