ext2spice.c: cleanup unused localvars -Wunused-variable -Wunused-but-set-variable

This commit is contained in:
Darryl L. Miles 2025-07-24 14:36:22 +01:00
parent ad5383c307
commit c6fe62f64a
2 changed files with 16 additions and 25 deletions

View File

@ -78,7 +78,6 @@ ESGenerateHierarchy(
int esHierVisit(HierContext *hc, ClientData cdata); /* (DefFlagsData *) */ int esHierVisit(HierContext *hc, ClientData cdata); /* (DefFlagsData *) */
int esMakePorts(HierContext *hc, ClientData cdata); /* Forward declaration (UNUSED) */ int esMakePorts(HierContext *hc, ClientData cdata); /* Forward declaration (UNUSED) */
Use u; Use u;
Def *def;
HierContext hc; HierContext hc;
DefFlagsData dfd; DefFlagsData dfd;
@ -119,7 +118,6 @@ GetHierNode(
{ {
HashEntry *he; HashEntry *he;
EFNodeName *nn; EFNodeName *nn;
Def *def = hc->hc_use->use_def;
he = EFHNConcatLook(hc->hc_hierName, name, "node"); he = EFHNConcatLook(hc->hc_hierName, name, "node");
if (he == NULL) return NULL; if (he == NULL) return NULL;

View File

@ -263,7 +263,6 @@ CmdExtToSpice(
{ {
int i,flatFlags; int i,flatFlags;
char *inName; char *inName;
FILE *f;
int value; int value;
int option = EXTTOSPC_RUN; int option = EXTTOSPC_RUN;
@ -357,12 +356,14 @@ CmdExtToSpice(
NULL NULL
}; };
#if 0 /* -Wunused-variable */
static const char * const shorttypes[] = { static const char * const shorttypes[] = {
"none", "none",
"resistor", "resistor",
"voltage", "voltage",
NULL NULL
}; };
#endif
enum { enum {
IDX_YES, IDX_TRUE, IDX_ON, IDX_NO, IDX_FALSE, IDX_OFF, IDX_YES, IDX_TRUE, IDX_ON, IDX_NO, IDX_FALSE, IDX_OFF,
@ -1356,7 +1357,7 @@ spcParseArgs(
int *pargc, int *pargc,
char ***pargv) char ***pargv)
{ {
char **argv = *pargv, *cp; char **argv = *pargv;
int argc = *pargc; int argc = *pargc;
char *ftmp, *t; char *ftmp, *t;
@ -1544,7 +1545,7 @@ subcktVisit(
EFNodeName *sname, *nodeName; EFNodeName *sname, *nodeName;
HashSearch hs; HashSearch hs;
HashEntry *he; HashEntry *he;
int portorder, portmax, portidx, tchars; int portmax, portidx, tchars;
char stmp[MAX_STR_SIZE]; char stmp[MAX_STR_SIZE];
char *instname, *subcktname; char *instname, *subcktname;
DevParam *plist, *pptr; DevParam *plist, *pptr;
@ -1634,10 +1635,6 @@ subcktVisit(
for (nodeName = sname; nodeName != NULL; nodeName = nodeName->efnn_next) for (nodeName = sname; nodeName != NULL; nodeName = nodeName->efnn_next)
{ {
EFNodeName *nn;
HashEntry *he;
char *pname;
portidx = nodeName->efnn_port; portidx = nodeName->efnn_port;
if (portidx < 0) continue; if (portidx < 0) continue;
if (nodeList[portidx] == NULL) if (nodeList[portidx] == NULL)
@ -1778,7 +1775,7 @@ topVisit(
Def *def, Def *def,
bool doStub) bool doStub)
{ {
EFNode *snode, *basenode; EFNode *snode;
EFNodeName *sname, *nodeName; EFNodeName *sname, *nodeName;
HashSearch hs; HashSearch hs;
HashEntry *he, *hep, *heh; HashEntry *he, *hep, *heh;
@ -2001,7 +1998,7 @@ spcWriteParams(
bool hierD; bool hierD;
DevParam *plist, *dparam; DevParam *plist, *dparam;
int parmval; int parmval;
EFNode *dnode, *subnodeFlat = NULL; EFNode *dnode;
plist = efGetDeviceParams(EFDevTypes[dev->dev_type]); plist = efGetDeviceParams(EFDevTypes[dev->dev_type]);
while (plist != NULL) while (plist != NULL)
@ -2231,7 +2228,7 @@ spcWriteParams(
break; break;
case 's': case 's':
fprintf(esSpiceF, " %s=", plist->parm_name); fprintf(esSpiceF, " %s=", plist->parm_name);
subnodeFlat = spcdevSubstrate(hierName, /*EFNode *subnodeFlat =*/ spcdevSubstrate(hierName,
dev->dev_subsnode->efnode_name->efnn_hier, dev->dev_subsnode->efnode_name->efnn_hier,
dev->dev_type, esSpiceF); dev->dev_type, esSpiceF);
break; break;
@ -2306,8 +2303,8 @@ esOutputResistor(
int w, /* Device length and width */ int w, /* Device length and width */
int dscale) /* Device scaling (for split resistors) */ int dscale) /* Device scaling (for split resistors) */
{ {
float sdM ; float sdM;
char name[12], devchar; char name[12];
/* Resistor is "Rnnn term1 term2 value" */ /* Resistor is "Rnnn term1 term2 value" */
/* extraction sets two terminals, which are assigned */ /* extraction sets two terminals, which are assigned */
@ -2488,7 +2485,7 @@ spcdevVisit(
DevParam *plist, *pptr; DevParam *plist, *pptr;
DevTerm *gate, *source, *drain; DevTerm *gate, *source, *drain;
EFNode *subnode, *snode, *dnode, *subnodeFlat = NULL; EFNode *subnode, *snode, *dnode, *subnodeFlat = NULL;
int l, w, i, parmval; int l, w, i;
bool subAP= FALSE, hierS, hierD; bool subAP= FALSE, hierS, hierD;
float sdM; float sdM;
char name[12], devchar; char name[12], devchar;
@ -3241,7 +3238,6 @@ esSIvalue(
{ {
char vstr[32]; char vstr[32];
char suffix = '\0'; char suffix = '\0';
int precision;
float avalue; float avalue;
avalue = fabsf(value); avalue = fabsf(value);
@ -3765,7 +3761,6 @@ spcnodeVisit(
double cap, double cap,
ClientData cdata) /* unused */ ClientData cdata) /* unused */
{ {
EFNodeName *nn;
HierName *hierName; HierName *hierName;
bool isConnected = FALSE; bool isConnected = FALSE;
const char *fmt; const char *fmt;
@ -3831,10 +3826,8 @@ nodeVisitDebug(
double cap, double cap,
ClientData cdata) /* unused */ ClientData cdata) /* unused */
{ {
EFNodeName *nn;
HierName *hierName; HierName *hierName;
const char *nsn; const char *nsn;
EFAttr *ap;
hierName = (HierName *) node->efnode_name->efnn_hier; hierName = (HierName *) node->efnode_name->efnn_hier;
nsn = nodeSpiceName(hierName, NULL); nsn = nodeSpiceName(hierName, NULL);
@ -4102,7 +4095,6 @@ topLevel:
int int
printSubcktDict(void) printSubcktDict(void)
{ {
HashSearch hs;
HashEntry *he; HashEntry *he;
fprintf(esSpiceF,"\n** hspice subcircuit dictionary\n"); fprintf(esSpiceF,"\n** hspice subcircuit dictionary\n");
@ -4332,8 +4324,6 @@ devMergeVisit(
ClientData cdata) /* (unused) */ ClientData cdata) /* (unused) */
{ {
DevTerm *gate, *source, *drain; DevTerm *gate, *source, *drain;
Dev *cf;
DevTerm *cg, *cs, *cd;
EFNode *subnode, *snode, *dnode, *gnode; EFNode *subnode, *snode, *dnode, *gnode;
int pmode, l, w; int pmode, l, w;
bool hS, hD, chS, chD; bool hS, hD, chS, chD;
@ -4393,9 +4383,12 @@ devMergeVisit(
{ {
if ((pmode = parallelDevs(fp, cfp)) != NOT_PARALLEL) if ((pmode = parallelDevs(fp, cfp)) != NOT_PARALLEL)
{ {
cf = cfp->dev; #if 0 /* -Wunused-but-set-variable */
cg = &cfp->dev->dev_terms[0]; Dev *cf = cfp->dev;
cs = cd = &cfp->dev->dev_terms[1]; DevTerm *cg = &cfp->dev->dev_terms[0];
#endif
DevTerm *cs = &cfp->dev->dev_terms[1];
DevTerm *cd = cs;
if (cfp->dev->dev_nterm >= 3) if (cfp->dev->dev_nterm >= 3)
{ {
if (pmode == PARALLEL) if (pmode == PARALLEL)