ext2hier.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 66f281c5e1
commit ab24761d88
1 changed files with 16 additions and 20 deletions

View File

@ -149,10 +149,9 @@ spcHierWriteParams(
int w, /* Device width, in internal units */ int w, /* Device width, in internal units */
float sdM) /* Device multiplier */ float sdM) /* Device multiplier */
{ {
bool hierD;
DevParam *plist, *dparam; DevParam *plist, *dparam;
int parmval; int parmval;
EFNode *dnode, *subnodeFlat = NULL; EFNode *dnode;
/* Write all requested parameters to the subcircuit call. */ /* Write all requested parameters to the subcircuit call. */
@ -346,7 +345,7 @@ spcHierWriteParams(
break; break;
case 's': case 's':
fprintf(esSpiceF, " %s=", plist->parm_name); fprintf(esSpiceF, " %s=", plist->parm_name);
subnodeFlat = spcdevSubstrate(hc->hc_hierName, /*EFNode *subnodeFlat =*/ spcdevSubstrate(hc->hc_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;
@ -422,9 +421,7 @@ esOutputHierResistor(
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) */
{ {
Rect r; float sdM;
float sdM ;
char name[12], devchar;
/* 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 */
@ -584,9 +581,8 @@ spcdevHierVisit(
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;
Rect r; bool subAP = FALSE;
bool subAP = FALSE, hierS, hierD;
float sdM; float sdM;
char devchar; char devchar;
bool has_model = TRUE; bool has_model = TRUE;
@ -1081,8 +1077,10 @@ spcdevHierVisit(
/* /*
* Check controlling attributes and output area and perimeter. * Check controlling attributes and output area and perimeter.
*/ */
hierS = extHierSDAttr(source); #if 0 /* -Wunused-but-set-variable extHierSDAttr() has no side-effects */
hierD = extHierSDAttr(drain); bool hierS = extHierSDAttr(source);
bool hierD = extHierSDAttr(drain);
#endif
if ( gate->dterm_attrs ) if ( gate->dterm_attrs )
subAP = Match(ATTR_SUBSAP, gate->dterm_attrs ) ; subAP = Match(ATTR_SUBSAP, gate->dterm_attrs ) ;
@ -1437,7 +1435,6 @@ spcnodeHierVisit(
int res, int res,
double cap) double cap)
{ {
EFNodeName *nn;
HierName *hierName; HierName *hierName;
bool isConnected = FALSE; bool isConnected = FALSE;
const char *fmt, *nsn; const char *fmt, *nsn;
@ -1518,9 +1515,8 @@ nodeSpiceHierName(
const HierName *hname) const HierName *hname)
{ {
EFNodeName *nn; EFNodeName *nn;
HashEntry *he, *he2; HashEntry *he;
EFNode *node; EFNode *node;
Def *def = hc->hc_use->use_def;
he = EFHNLook(hname, NULL, "ext2spice"); he = EFHNLook(hname, NULL, "ext2spice");
if (he == NULL) return "error"; if (he == NULL) return "error";
@ -1577,8 +1573,6 @@ devMergeHierVisit(
float scale) /* Scale transform of output */ float scale) /* Scale transform of output */
{ {
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;
@ -1634,9 +1628,12 @@ devMergeHierVisit(
{ {
if ((pmode = parallelDevs(fp, cfp)) != NOT_PARALLEL) if ((pmode = parallelDevs(fp, cfp)) != NOT_PARALLEL)
{ {
cf = cfp->dev; #if 0 /* -Wunused-but-set-variable cf, cg */
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)
@ -1862,7 +1859,6 @@ esMakePorts(
while (tptr != NULL) while (tptr != NULL)
{ {
int idum[6];
bool is_array; bool is_array;
/* Ignore array information for the purpose of tracing */ /* Ignore array information for the purpose of tracing */