K&R ext2spice/*.c: bulk function implementation conversion

int spcnAP() follows K&R param ordering
int spcnAPHier() follows K&R param ordering

TODO mergeAttr() sharing references (does this setup a future potential
use-after-free concern?)
This commit is contained in:
Darryl L. Miles 2025-07-18 14:11:04 +01:00 committed by R. Timothy Edwards
parent f77c4cbaa1
commit 828cec7bca
2 changed files with 249 additions and 219 deletions

View File

@ -71,9 +71,9 @@ typedef struct _defflagsdata {
*/ */
void void
ESGenerateHierarchy(inName, flags) ESGenerateHierarchy(
char *inName; char *inName,
int flags; int flags)
{ {
int esHierVisit(), esMakePorts(); /* Forward declaration */ int esHierVisit(), esMakePorts(); /* Forward declaration */
Use u; Use u;
@ -112,9 +112,9 @@ ESGenerateHierarchy(inName, flags)
*/ */
EFNode * EFNode *
GetHierNode(hc, name) GetHierNode(
HierContext *hc; HierContext *hc,
HierName *name; HierName *name)
{ {
HashEntry *he; HashEntry *he;
EFNodeName *nn; EFNodeName *nn;
@ -140,13 +140,13 @@ GetHierNode(hc, name)
*/ */
void void
spcHierWriteParams(hc, dev, scale, l, w, sdM) spcHierWriteParams(
HierContext *hc; HierContext *hc,
Dev *dev; /* Dev being output */ Dev *dev, /* Dev being output */
float scale; /* Scale transform for output */ float scale, /* Scale transform for output */
int l; /* Device length, in internal units */ int l, /* Device length, in internal units */
int w; /* Device width, in internal units */ int w, /* Device width, in internal units */
float sdM; /* Device multiplier */ float sdM) /* Device multiplier */
{ {
bool hierD; bool hierD;
DevParam *plist, *dparam; DevParam *plist, *dparam;
@ -410,14 +410,16 @@ spcHierWriteParams(hc, dev, scale, l, w, sdM)
*/ */
void void
esOutputHierResistor(hc, dev, scale, term1, term2, has_model, l, w, dscale) esOutputHierResistor(
HierContext *hc; HierContext *hc,
Dev *dev; /* Dev being output */ Dev *dev, /* Dev being output */
float scale; /* Scale transform for output */ float scale, /* Scale transform for output */
DevTerm *term1, *term2; /* Terminals of the device */ DevTerm *term1,
bool has_model; /* Is this a modeled resistor? */ DevTerm *term2, /* Terminals of the device */
int l, w; /* Device length and width */ bool has_model, /* Is this a modeled resistor? */
int dscale; /* Device scaling (for split resistors) */ int l,
int w, /* Device length and width */
int dscale) /* Device scaling (for split resistors) */
{ {
Rect r; Rect r;
float sdM ; float sdM ;
@ -482,10 +484,10 @@ esOutputHierResistor(hc, dev, scale, term1, term2, has_model, l, w, dscale)
*/ */
int int
subcktHierVisit(use, hierName, is_top) subcktHierVisit(
Use *use; Use *use,
HierName *hierName; HierName *hierName,
bool is_top; /* TRUE if this is the top-level cell */ bool is_top) /* TRUE if this is the top-level cell */
{ {
Def *def = use->use_def; Def *def = use->use_def;
EFNode *snode; EFNode *snode;
@ -570,10 +572,10 @@ subcktHierVisit(use, hierName, is_top)
*/ */
int int
spcdevHierVisit(hc, dev, scale) spcdevHierVisit(
HierContext *hc; HierContext *hc,
Dev *dev; /* Dev being output */ Dev *dev, /* Dev being output */
float scale; /* Scale transform for output */ float scale) /* Scale transform for output */
{ {
DevParam *plist, *pptr; DevParam *plist, *pptr;
DevTerm *gate, *source, *drain; DevTerm *gate, *source, *drain;
@ -1148,10 +1150,10 @@ spcdevHierVisit(hc, dev, scale)
*/ */
int int
spcdevHierMergeVisit(hc, dev, scale) spcdevHierMergeVisit(
HierContext *hc; HierContext *hc,
Dev *dev; /* Dev being output */ Dev *dev, /* Dev being output */
float scale; /* Scale of transform (may be non-integer) */ float scale) /* Scale of transform (may be non-integer) */
{ {
DevTerm *gate, *source, *drain; DevTerm *gate, *source, *drain;
EFNode *subnode, *snode, *dnode, *gnode; EFNode *subnode, *snode, *dnode, *gnode;
@ -1270,11 +1272,11 @@ spcdevHierMergeVisit(hc, dev, scale)
*/ */
int int
spccapHierVisit(hc, hierName1, hierName2, cap) spccapHierVisit(
HierContext *hc; HierContext *hc,
HierName *hierName1; HierName *hierName1,
HierName *hierName2; HierName *hierName2,
double cap; double cap)
{ {
cap = cap / 1000; cap = cap / 1000;
if (fabs(cap) <= EFCapThreshold) if (fabs(cap) <= EFCapThreshold)
@ -1314,11 +1316,11 @@ spccapHierVisit(hc, hierName1, hierName2, cap)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
int int
spcresistHierVisit(hc, hierName1, hierName2, res) spcresistHierVisit(
HierContext *hc; HierContext *hc,
HierName *hierName1; HierName *hierName1,
HierName *hierName2; HierName *hierName2,
float res; float res)
{ {
HashEntry *he; HashEntry *he;
EFNodeName *nn; EFNodeName *nn;
@ -1377,12 +1379,12 @@ spcresistHierVisit(hc, hierName1, hierName2, res)
*/ */
int int
spcsubHierVisit(hc, node, res, cap, resstrptr) spcsubHierVisit(
HierContext *hc; HierContext *hc,
EFNode *node; EFNode *node,
int res; // Unused int res, // Unused
double cap; // Unused double cap, // Unused
char **resstrptr; char **resstrptr)
{ {
HierName *hierName; HierName *hierName;
char *nsn; char *nsn;
@ -1415,11 +1417,11 @@ spcsubHierVisit(hc, node, res, cap, resstrptr)
*/ */
int int
spcnodeHierVisit(hc, node, res, cap) spcnodeHierVisit(
HierContext *hc; HierContext *hc,
EFNode *node; EFNode *node,
int res; int res,
double cap; double cap)
{ {
EFNodeName *nn; EFNodeName *nn;
HierName *hierName; HierName *hierName;
@ -1496,9 +1498,10 @@ spcnodeHierVisit(hc, node, res, cap)
*/ */
static char esTempName[MAX_STR_SIZE]; static char esTempName[MAX_STR_SIZE];
char *nodeSpiceHierName(hc, hname) char *
HierContext *hc; nodeSpiceHierName(
HierName *hname; HierContext *hc,
HierName *hname)
{ {
EFNodeName *nn; EFNodeName *nn;
HashEntry *he, *he2; HashEntry *he, *he2;
@ -1554,10 +1557,10 @@ retName:
*/ */
int int
devMergeHierVisit(hc, dev, scale) devMergeHierVisit(
HierContext *hc; HierContext *hc,
Dev *dev; /* Dev to examine */ Dev *dev, /* Dev to examine */
float scale; /* Scale transform of output */ float scale) /* Scale transform of output */
{ {
DevTerm *gate, *source, *drain; DevTerm *gate, *source, *drain;
Dev *cf; Dev *cf;
@ -1717,10 +1720,10 @@ mergeThem:
*/ */
int int
devDistJunctHierVisit(hc, dev, scale) devDistJunctHierVisit(
HierContext *hc; HierContext *hc,
Dev *dev; /* Dev to examine */ Dev *dev, /* Dev to examine */
float scale; /* Scale tranform of output */ float scale) /* Scale tranform of output */
{ {
EFNode *n; EFNode *n;
int i, l, w; int i, l, w;
@ -1769,9 +1772,9 @@ typedef struct _flagDefRecord {
*/ */
int int
esMakePorts(hc, cdata) esMakePorts(
HierContext *hc; HierContext *hc,
ClientData cdata; ClientData cdata)
{ {
Connection *conn; Connection *conn;
Def *def = hc->hc_use->use_def, *portdef, *updef; Def *def = hc->hc_use->use_def, *portdef, *updef;
@ -2073,9 +2076,9 @@ esMakePorts(hc, cdata)
*/ */
int int
esHierVisit(hc, cdata) esHierVisit(
HierContext *hc; HierContext *hc,
ClientData cdata; ClientData cdata)
{ {
HierContext *hcf; HierContext *hcf;
Def *def = hc->hc_use->use_def; Def *def = hc->hc_use->use_def;

View File

@ -136,8 +136,8 @@ extern void ESGenerateHierarchy(); /* forward reference */
*/ */
int int
esFreeNodeClient(client) esFreeNodeClient(
nodeClient *client; nodeClient *client)
{ {
if (client != (nodeClient *)NULL) if (client != (nodeClient *)NULL)
if (client->spiceNodeName != NULL) if (client->spiceNodeName != NULL)
@ -160,9 +160,9 @@ esFreeNodeClient(client)
*/ */
void void
esFormatSubs(outf, suf) esFormatSubs(
FILE *outf; FILE *outf,
char *suf; char *suf)
{ {
char *specchar; char *specchar;
int l; int l;
@ -201,8 +201,8 @@ esFormatSubs(outf, suf)
*/ */
int int
Exttospice_Init(interp) Exttospice_Init(
Tcl_Interp *interp; Tcl_Interp *interp)
{ {
/* Sanity checks! */ /* Sanity checks! */
if (interp == NULL) return TCL_ERROR; if (interp == NULL) return TCL_ERROR;
@ -257,9 +257,9 @@ Exttospice_Init(interp)
#define EXTTOSPC_HELP 16 #define EXTTOSPC_HELP 16
void void
CmdExtToSpice(w, cmd) CmdExtToSpice(
MagWindow *w; MagWindow *w,
TxCommand *cmd; TxCommand *cmd)
{ {
int i,flatFlags; int i,flatFlags;
char *inName; char *inName;
@ -1170,9 +1170,9 @@ runexttospice:
*/ */
int int
main(argc, argv) main(
int argc; int argc,
char *argv[]; char *argv[])
{ {
int i,flatFlags; int i,flatFlags;
@ -1352,9 +1352,9 @@ main(argc, argv)
*/ */
int int
spcParseArgs(pargc, pargv) spcParseArgs(
int *pargc; int *pargc,
char ***pargv; char ***pargv)
{ {
char **argv = *pargv, *cp; char **argv = *pargv, *cp;
int argc = *pargc; int argc = *pargc;
@ -1457,9 +1457,9 @@ usage:
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
EFNode * EFNode *
SpiceGetNode(prefix, suffix) SpiceGetNode(
HierName *prefix; HierName *prefix,
HierName *suffix; HierName *suffix)
{ {
HashEntry *he; HashEntry *he;
EFNodeName *nn; EFNodeName *nn;
@ -1488,8 +1488,9 @@ HierName *suffix;
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
bool extHierSDAttr(term) bool
DevTerm *term; extHierSDAttr(
DevTerm *term)
{ {
bool r = esHierAP; bool r = esHierAP;
@ -1531,10 +1532,10 @@ bool extHierSDAttr(term)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
int int
subcktVisit(use, hierName, is_top) subcktVisit(
Use *use; Use *use,
HierName *hierName; HierName *hierName,
bool is_top; /* TRUE if this is the top-level cell */ bool is_top) /* TRUE if this is the top-level cell */
{ {
EFNode *snode; EFNode *snode;
Def *def = use->use_def; Def *def = use->use_def;
@ -1718,10 +1719,10 @@ subcktVisit(use, hierName, is_top)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
int int
subcktUndef(use, hierName, is_top) subcktUndef(
Use *use; Use *use,
HierName *hierName; HierName *hierName,
bool is_top; /* TRUE if this is the top-level cell */ bool is_top) /* TRUE if this is the top-level cell */
{ {
Def *def = use->use_def; Def *def = use->use_def;
@ -1769,9 +1770,9 @@ typedef struct _lnn {
*/ */
void void
topVisit(def, doStub) topVisit(
Def *def; Def *def,
bool doStub; bool doStub)
{ {
EFNode *snode, *basenode; EFNode *snode, *basenode;
EFNodeName *sname, *nodeName; EFNodeName *sname, *nodeName;
@ -1985,13 +1986,13 @@ topVisit(def, doStub)
*/ */
void void
spcWriteParams(dev, hierName, scale, l, w, sdM) spcWriteParams(
Dev *dev; /* Dev being output */ Dev *dev, /* Dev being output */
HierName *hierName; /* Hierarchical path down to this dev */ HierName *hierName, /* Hierarchical path down to this dev */
float scale; /* Scale transform for output */ float scale, /* Scale transform for output */
int l; /* Device length, in internal units */ int l, /* Device length, in internal units */
int w; /* Device width, in internal units */ int w, /* Device width, in internal units */
float sdM; /* Device multiplier */ float sdM) /* Device multiplier */
{ {
bool hierD; bool hierD;
DevParam *plist, *dparam; DevParam *plist, *dparam;
@ -2292,14 +2293,16 @@ spcWriteParams(dev, hierName, scale, l, w, sdM)
*/ */
void void
esOutputResistor(dev, hierName, scale, term1, term2, has_model, l, w, dscale) esOutputResistor(
Dev *dev; /* Dev being output */ Dev *dev, /* Dev being output */
HierName *hierName; /* Hierarchical path down to this dev */ HierName *hierName, /* Hierarchical path down to this dev */
float scale; /* Scale transform for output */ float scale, /* Scale transform for output */
DevTerm *term1, *term2; /* Terminals of the device */ DevTerm *term1,
bool has_model; /* Is this a modeled resistor? */ DevTerm *term2, /* Terminals of the device */
int l, w; /* Device length and width */ bool has_model, /* Is this a modeled resistor? */
int dscale; /* Device scaling (for split resistors) */ int l,
int w, /* Device length and width */
int dscale) /* Device scaling (for split resistors) */
{ {
float sdM ; float sdM ;
char name[12], devchar; char name[12], devchar;
@ -2350,8 +2353,8 @@ esOutputResistor(dev, hierName, scale, term1, term2, has_model, l, w, dscale)
/* Report if device at index n has been deleted due to merging */ /* Report if device at index n has been deleted due to merging */
bool bool
devIsKilled(n) devIsKilled(
int n; int n)
{ {
return (esFMult[(n)] <= (float)0.0) ? TRUE : FALSE; return (esFMult[(n)] <= (float)0.0) ? TRUE : FALSE;
} }
@ -2359,8 +2362,8 @@ devIsKilled(n)
/* Add a dev's multiplier to the table and grow it if necessary */ /* Add a dev's multiplier to the table and grow it if necessary */
void void
addDevMult(f) addDevMult(
float f; float f)
{ {
int i; int i;
float *op; float *op;
@ -2382,9 +2385,9 @@ addDevMult(f)
/* Set the multiplier value f of device at index i */ /* Set the multiplier value f of device at index i */
void void
setDevMult(i, f) setDevMult(
int i; int i,
float f; float f)
{ {
esFMult[i] = f; esFMult[i] = f;
} }
@ -2392,7 +2395,7 @@ setDevMult(i, f)
/* Get the multiplier value of the device at the current index esFMIndex */ /* Get the multiplier value of the device at the current index esFMIndex */
float float
getCurDevMult() getCurDevMult(void)
{ {
return (esFMult && (esFMIndex > 0)) ? esFMult[esFMIndex-1] : (float)1.0; return (esFMult && (esFMIndex > 0)) ? esFMult[esFMIndex-1] : (float)1.0;
} }
@ -2423,8 +2426,8 @@ getCurDevMult()
*/ */
void void
swapDrainSource(dev) swapDrainSource(
Dev *dev; Dev *dev)
{ {
DevTerm tmpTerm; DevTerm tmpTerm;
@ -2471,11 +2474,11 @@ swapDrainSource(dev)
*/ */
int int
spcdevVisit(dev, hc, scale, trans) spcdevVisit(
Dev *dev; /* Dev being output */ Dev *dev, /* Dev being output */
HierContext *hc; /* Hierarchical context down to this dev */ HierContext *hc, /* Hierarchical context down to this dev */
float scale; /* Scale transform for output */ float scale, /* Scale transform for output */
Transform *trans; /* (unused) */ Transform *trans) /* (unused) */
{ {
DevParam *plist, *pptr; DevParam *plist, *pptr;
DevTerm *gate, *source, *drain; DevTerm *gate, *source, *drain;
@ -3081,10 +3084,12 @@ spcdevVisit(dev, hc, scale, trans)
* *
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
EFNode *spcdevSubstrate( prefix, suffix, type, outf) EFNode *
HierName *prefix, *suffix; spcdevSubstrate(
int type; HierName *prefix,
FILE *outf; HierName *suffix,
int type,
FILE *outf)
{ {
HashEntry *he; HashEntry *he;
EFNodeName *nn; EFNodeName *nn;
@ -3138,7 +3143,10 @@ FILE *outf;
*/ */
void void
nDecimals(char *s, double d, int n) nDecimals(
char *s,
double d,
int n)
{ {
int sz; int sz;
double d2; double d2;
@ -3177,7 +3185,9 @@ nDecimals(char *s, double d, int n)
*/ */
void void
morphNumericString(char *s, int n) morphNumericString(
char *s,
int n)
{ {
char *p; char *p;
int count; int count;
@ -3220,9 +3230,9 @@ morphNumericString(char *s, int n)
*/ */
void void
esSIvalue(file, value) esSIvalue(
FILE *file; FILE *file,
float value; float value)
{ {
char vstr[32]; char vstr[32];
char suffix = '\0'; char suffix = '\0';
@ -3306,14 +3316,17 @@ esSIvalue(file, value)
* *
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
int spcnAP(dterm, node, resClass, scale, asterm, psterm, m, outf, w) int
DevTerm *dterm; spcnAP(
EFNode *node; DevTerm *dterm,
int resClass; EFNode *node,
float scale, m; int resClass,
char *asterm, *psterm; float scale,
FILE *outf; char *asterm,
int w; char *psterm,
float m,
FILE *outf,
int w)
{ {
char afmt[15], pfmt[15]; char afmt[15], pfmt[15];
float dsc; float dsc;
@ -3437,13 +3450,16 @@ newFmt:
return 0; return 0;
} }
int spcnAPHier(dterm, hierName, resClass, scale, asterm, psterm, m, outf) int
DevTerm *dterm; spcnAPHier(
HierName *hierName; DevTerm *dterm,
int resClass; HierName *hierName,
float scale, m; int resClass,
char *asterm, *psterm; float scale,
FILE *outf; char *asterm,
char *psterm,
float m,
FILE *outf)
{ {
EFNode *node = dterm->dterm_node; EFNode *node = dterm->dterm_node;
nodeClientHier *nc; nodeClientHier *nc;
@ -3531,11 +3547,11 @@ int spcnAPHier(dterm, hierName, resClass, scale, asterm, psterm, m, outf)
*/ */
int int
spcdevOutNode(prefix, suffix, name, outf) spcdevOutNode(
HierName *prefix; HierName *prefix,
HierName *suffix; HierName *suffix,
char *name; char *name,
FILE *outf; FILE *outf)
{ {
HashEntry *he; HashEntry *he;
EFNodeName *nn; EFNodeName *nn;
@ -3588,10 +3604,10 @@ spcdevOutNode(prefix, suffix, name, outf)
*/ */
int int
spccapVisit(hierName1, hierName2, cap) spccapVisit(
HierName *hierName1; HierName *hierName1,
HierName *hierName2; HierName *hierName2,
double cap; double cap)
{ {
cap = cap / 1000; cap = cap / 1000;
if (cap <= EFCapThreshold) if (cap <= EFCapThreshold)
@ -3630,10 +3646,10 @@ spccapVisit(hierName1, hierName2, cap)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
int int
spcresistVisit(hierName1, hierName2, res) spcresistVisit(
HierName *hierName1; HierName *hierName1,
HierName *hierName2; HierName *hierName2,
float res; float res)
{ {
HashEntry *he; HashEntry *he;
EFNodeName *nn; EFNodeName *nn;
@ -3693,11 +3709,11 @@ spcresistVisit(hierName1, hierName2, res)
*/ */
int int
spcsubVisit(node, res, cap, resstr) spcsubVisit(
EFNode *node; EFNode *node,
int res; // Unused int res, // Unused
double cap; // Unused double cap, // Unused
char **resstr; char **resstr)
{ {
HierName *hierName; HierName *hierName;
char *nsn; char *nsn;
@ -3730,10 +3746,10 @@ spcsubVisit(node, res, cap, resstr)
*/ */
int int
spcnodeVisit(node, res, cap) spcnodeVisit(
EFNode *node; EFNode *node,
int res; int res,
double cap; double cap)
{ {
EFNodeName *nn; EFNodeName *nn;
HierName *hierName; HierName *hierName;
@ -3794,10 +3810,10 @@ spcnodeVisit(node, res, cap)
/* a debugging procedure */ /* a debugging procedure */
int int
nodeVisitDebug(node, res, cap) nodeVisitDebug(
EFNode *node; EFNode *node,
int res; int res,
double cap; double cap)
{ {
EFNodeName *nn; EFNodeName *nn;
HierName *hierName; HierName *hierName;
@ -3834,9 +3850,10 @@ nodeVisitDebug(node, res, cap)
*/ */
static char esTempName[MAX_STR_SIZE]; static char esTempName[MAX_STR_SIZE];
char *nodeSpiceName(hname, rnode) char *
HierName *hname; nodeSpiceName(
EFNode **rnode; HierName *hname,
EFNode **rnode)
{ {
EFNodeName *nn; EFNodeName *nn;
HashEntry *he; HashEntry *he;
@ -3893,9 +3910,9 @@ retName:
*/ */
int int
EFHNSprintf(str, hierName) EFHNSprintf(
char *str; char *str,
HierName *hierName; HierName *hierName)
{ {
bool trimGlob, trimLocal, convertComma, convertEqual, convertBrackets; bool trimGlob, trimLocal, convertComma, convertEqual, convertBrackets;
char *s, *cp, c; char *s, *cp, c;
@ -3931,9 +3948,10 @@ EFHNSprintf(str, hierName)
return 0; return 0;
} }
char *efHNSprintfPrefix(hierName, str) char *
HierName *hierName; efHNSprintfPrefix(
char *str; HierName *hierName,
char *str)
{ {
char *cp, c; char *cp, c;
bool convertEqual = (EFOutputFlags & EF_CONVERTEQUAL) ? TRUE : FALSE; bool convertEqual = (EFOutputFlags & EF_CONVERTEQUAL) ? TRUE : FALSE;
@ -3981,8 +3999,9 @@ char *efHNSprintfPrefix(hierName, str)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
int nodeHspiceName(s) int
char *s; nodeHspiceName(
char *s)
{ {
char *p, *sf; char *p, *sf;
int l, snum = -1; int l, snum = -1;
@ -4064,7 +4083,8 @@ topLevel:
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
int printSubcktDict() int
printSubcktDict(void)
{ {
HashSearch hs; HashSearch hs;
HashEntry *he; HashEntry *he;
@ -4096,11 +4116,16 @@ int printSubcktDict()
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
devMerge *mkDevMerge(l, w, g, s, d, b, hn, dev) devMerge *
float l, w; mkDevMerge(
EFNode *g, *s, *d, *b; float l,
HierName *hn; float w,
Dev *dev; EFNode *g,
EFNode *s,
EFNode *d,
EFNode *b,
HierName *hn,
Dev *dev)
{ {
devMerge *fp; devMerge *fp;
@ -4136,8 +4161,9 @@ devMerge *mkDevMerge(l, w, g, s, d, b, hn, dev)
*/ */
int int
parallelDevs(f1, f2) parallelDevs(
devMerge *f1, *f2; devMerge *f1,
devMerge *f2)
{ {
/* If the devices are not in the same class, then */ /* If the devices are not in the same class, then */
/* they cannot be parallel. */ /* they cannot be parallel. */
@ -4245,11 +4271,12 @@ parallelDevs(f1, f2)
*/ */
void void
mergeAttr(a1, a2) mergeAttr(
char **a1, **a2; char **a1,
char **a2)
{ {
if (*a1 == NULL) if (*a1 == NULL)
*a1 = *a2; *a1 = *a2; /* TODO check strdup() is appropiate due to lifetime ambiguity this creates */
else else
{ {
size_t l1 = strlen(*a1); size_t l1 = strlen(*a1);
@ -4279,11 +4306,11 @@ mergeAttr(a1, a2)
*/ */
int int
devMergeVisit(dev, hc, scale, trans) devMergeVisit(
Dev *dev; /* Dev to examine */ Dev *dev, /* Dev to examine */
HierContext *hc; /* Hierarchical context down to this dev */ HierContext *hc, /* Hierarchical context down to this dev */
float scale; /* Scale transform */ float scale, /* Scale transform */
Transform *trans; /* (unused) */ Transform *trans) /* (unused) */
{ {
DevTerm *gate, *source, *drain; DevTerm *gate, *source, *drain;
Dev *cf; Dev *cf;
@ -4460,10 +4487,10 @@ mergeThem:
*/ */
int int
update_w(resClass, w, n) update_w(
short resClass; short resClass,
int w; int w,
EFNode *n; EFNode *n)
{ {
nodeClient *nc; nodeClient *nc;
int i; int i;
@ -4498,11 +4525,11 @@ update_w(resClass, w, n)
*/ */
int int
devDistJunctVisit(dev, hc, scale, trans) devDistJunctVisit(
Dev *dev; /* Dev to examine */ Dev *dev, /* Dev to examine */
HierContext *hc; /* Hierarchical path down to this dev */ HierContext *hc, /* Hierarchical path down to this dev */
float scale; /* Scale transform */ float scale, /* Scale transform */
Transform *trans; /* (unused) */ Transform *trans) /* (unused) */
{ {
EFNode *n; EFNode *n;
int i; int i;