35 x warning: suggest parentheses around assignment used as truth value

PlowRules1.c:439:9: warning: suggest parentheses around assignment used as truth value
PlowTech.c:645:17: warning: suggest parentheses around assignment used as truth value
PlowTech.c:652:17: warning: suggest parentheses around assignment used as truth value
PlowTech.c:1019:17: warning: suggest parentheses around assignment used as truth value
ResReadSim.c:270:13: warning: suggest parentheses around assignment used as truth value
ResReadSim.c:871:9: warning: suggest parentheses around assignment used as truth value
ResRex.c:1840:17: warning: suggest parentheses around assignment used as truth value
getrect.c:72:9: warning: suggest parentheses around assignment used as truth value
getrect.c:79:9: warning: suggest parentheses around assignment used as truth value
getrect.c:86:9: warning: suggest parentheses around assignment used as truth value
getrect.c:93:9: warning: suggest parentheses around assignment used as truth value
hash.c:732:16: warning: suggest parentheses around assignment used as truth value
heap.c:328:17: warning: suggest parentheses around assignment used as truth value
heap.c:344:17: warning: suggest parentheses around assignment used as truth value
netlist.c:323:17: warning: suggest parentheses around assignment used as truth value
niceabort.c:121:9: warning: suggest parentheses around assignment used as truth value
path.c:1102:12: warning: suggest parentheses around assignment used as truth value
pathvisit.c:245:13: warning: suggest parentheses around assignment used as truth value
pathvisit.c:295:17: warning: suggest parentheses around assignment used as truth value
tech.c:656:17: warning: suggest parentheses around assignment used as truth value
ext2spice.c:1591:16: warning: suggest parentheses around assignment used as truth value
ext2spice.c:1622:16: warning: suggest parentheses around assignment used as truth value
ext2spice.c:1813:12: warning: suggest parentheses around assignment used as truth value
ext2spice.c:1862:12: warning: suggest parentheses around assignment used as truth value
ext2spice.c:3808:16: warning: suggest parentheses around assignment used as truth value
CalmaRdio.c:437:9: warning: suggest parentheses around assignment used as truth value
CalmaWrite.c:396:9: warning: suggest parentheses around assignment used as truth value
CalmaWrite.c:1772:29: warning: suggest parentheses around assignment used as truth value
CalmaWriteZ.c:372:9: warning: suggest parentheses around assignment used as truth value
CalmaWriteZ.c:1608:29: warning: suggest parentheses around assignment used as truth value
CIFrdtech.c:209:9: warning: suggest parentheses around assignment used as truth value
CIFrdtech.c:214:9: warning: suggest parentheses around assignment used as truth value
CIFrdtech.c:220:9: warning: suggest parentheses around assignment used as truth value
CIFrdtech.c:226:9: warning: suggest parentheses around assignment used as truth value
CIFrdutils.c:1258:12: warning: suggest parentheses around assignment used as truth value

GCC14 -Wall cleanup series [-Wparentheses]
This commit is contained in:
Darryl L. Miles 2024-10-04 17:21:15 +01:00 committed by Tim Edwards
parent 64772655dc
commit 76d8c8c911
18 changed files with 35 additions and 35 deletions

View File

@ -434,7 +434,7 @@ calmaReadR8(pd)
/* Extract the sign and exponent */
exponent = dchars[0];
if (isneg = (exponent & 0x80))
if ((isneg = (exponent & 0x80)))
exponent &= ~0x80;
exponent -= 64;

View File

@ -393,7 +393,7 @@ CalmaWrite(rootDef, f)
good = !ferror(f);
/* See if any problems occurred */
if (problems = (DBWFeedbackCount - oldCount))
if ((problems = (DBWFeedbackCount - oldCount)))
TxPrintf("%d problems occurred. See feedback entries.\n", problems);
/*
@ -1769,7 +1769,7 @@ calmaOutStructName(type, def, f)
}
/* Is the def name a legal Calma name? */
for (cp = def->cd_name; c = (unsigned char) *cp; cp++)
for (cp = def->cd_name; (c = (unsigned char) *cp); cp++)
{
if ((c > 127) || (table[c] == 0))
goto bad;

View File

@ -369,7 +369,7 @@ CalmaWriteZ(rootDef, f)
good = (nerr == 0) ? TRUE : FALSE;
/* See if any problems occurred */
if (problems = (DBWFeedbackCount - oldCount))
if ((problems = (DBWFeedbackCount - oldCount)))
TxPrintf("%d problems occurred. See feedback entries.\n", problems);
/*
@ -1605,7 +1605,7 @@ calmaOutStructNameZ(type, def, f)
}
/* Is the def name a legal Calma name? */
for (cp = def->cd_name; c = (unsigned char) *cp; cp++)
for (cp = def->cd_name; (c = (unsigned char) *cp); cp++)
{
if ((c > 127) || (table[c] == 0))
goto bad;

View File

@ -206,24 +206,24 @@ CIFCalmaLayerToCifLayer(layer, datatype, calmaStyle)
clt.clt_layer = layer;
clt.clt_type = datatype;
if (he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt))
if ((he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt)))
return ((spointertype) HashGetValue(he));
/* Try wildcarding the datatype */
clt.clt_type = -1;
if (he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt))
if ((he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt)))
return ((spointertype) HashGetValue(he));
/* Try wildcarding the layer */
clt.clt_layer = -1;
clt.clt_type = datatype;
if (he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt))
if ((he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt)))
return ((spointertype) HashGetValue(he));
/* Try wildcarding them both, for a default value */
clt.clt_layer = -1;
clt.clt_type = -1;
if (he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt))
if ((he = HashLookOnly(&(calmaStyle->cifCalmaToCif), (char *) &clt)))
return ((spointertype) HashGetValue(he));
/* No luck */

View File

@ -1253,7 +1253,7 @@ CIFCleanPath(pathHead)
if (!path) return;
}
while (next = path->cifp_next)
while ((next = path->cifp_next))
{
if ((dir2 = CIFEdgeDirection(path, next)) == CIF_ZERO)
{

View File

@ -1588,7 +1588,7 @@ subcktVisit(use, hierName, is_top)
/* generated during topVisit(). */
HashStartSearch(&hs);
while (he = HashNext(&def->def_nodes, &hs))
while ((he = HashNext(&def->def_nodes, &hs)))
{
sname = (EFNodeName *) HashGetValue(he);
if (sname == NULL) continue;
@ -1619,7 +1619,7 @@ subcktVisit(use, hierName, is_top)
nodeList[portidx] = (EFNodeName *)NULL;
HashStartSearch(&hs);
while (he = HashNext(&def->def_nodes, &hs))
while ((he = HashNext(&def->def_nodes, &hs)))
{
sname = (EFNodeName *) HashGetValue(he);
if (sname == NULL) continue;
@ -1810,7 +1810,7 @@ topVisit(def, doStub)
HashStartSearch(&hs);
portmax = -1;
while (he = HashNext(&def->def_nodes, &hs))
while ((he = HashNext(&def->def_nodes, &hs)))
{
sname = (EFNodeName *) HashGetValue(he);
if (sname == NULL) continue;
@ -1859,7 +1859,7 @@ topVisit(def, doStub)
sorted_ports[portorder] = NULL;
HashStartSearch(&hs);
while (he = HashNext(&def->def_nodes, &hs))
while ((he = HashNext(&def->def_nodes, &hs)))
{
char stmp[MAX_STR_SIZE];
int portidx;
@ -3805,7 +3805,7 @@ EFHNSprintf(str, hierName)
convertComma = (EFOutputFlags & EF_CONVERTCOMMA);
convertEqual = (EFOutputFlags & EF_CONVERTEQUAL);
convertBrackets = (EFOutputFlags & EF_CONVERTBRACKETS);
while (c = *cp++)
while ((c = *cp++))
{
switch (c)
{

View File

@ -436,7 +436,7 @@ plowPenumbraRule(impactedEdge, ar)
int newsep, oldsep, newx;
oldsep = impactedEdge->e_x - movingEdge->e_x;
if (pr = ar->ar_rule)
if ((pr = ar->ar_rule))
{
if (!TTMaskHasType(&pr->pr_oktypes, impactedEdge->e_ltype))
return (0);

View File

@ -642,14 +642,14 @@ PlowDRCFinal()
plowMaxDist[i] = 0;
for (j = 0; j < DBNumTypes; j++)
{
if (pr = plowWidthRulesTbl[i][j])
if ((pr = plowWidthRulesTbl[i][j]))
{
pr = plowWidthRulesTbl[i][j] = plowTechOptimizeRule(pr);
for ( ; pr; pr = pr->pr_next)
if (pr->pr_dist > plowMaxDist[i])
plowMaxDist[i] = pr->pr_dist;
}
if (pr = plowSpacingRulesTbl[i][j])
if ((pr = plowSpacingRulesTbl[i][j]))
{
pr = plowSpacingRulesTbl[i][j] = plowTechOptimizeRule(pr);
for ( ; pr; pr = pr->pr_next)
@ -1016,7 +1016,7 @@ plowTechShowTable(table, header, f)
fprintf(f, "\n\n------------ %s ------------\n", header);
for (i = 0; i < DBNumTypes; i++)
for (j = 0; j < DBNumTypes; j++)
if (pr = table[i][j])
if ((pr = table[i][j]))
{
fprintf(f, "\n%s -- %s:\n",
DBTypeLongName(i), DBTypeLongName(j));

View File

@ -267,7 +267,7 @@ ResReadNode(nodefile)
node->rs_bbox.r_xtop = atoi(line[NODE_BBOX_UR_X]);
node->rs_bbox.r_ytop = atoi(line[NODE_BBOX_UR_Y]);
#endif
if (cp = strchr(line[NODES_NODETYPE], ';')) *cp = '\0';
if ((cp = strchr(line[NODES_NODETYPE], ';'))) *cp = '\0';
node->type = DBTechNameType(line[NODES_NODETYPE]);
if (node->type == -1)
@ -868,7 +868,7 @@ ResSimAttribute(aname, avalue, rootname, readextfile)
}
}
#endif
if (avalue = strchr(avalue, ','))
if ((avalue = strchr(avalue, ',')))
{
ResSimAttribute(aname, avalue + 1, rootname, readextfile);
}

View File

@ -1837,7 +1837,7 @@ ResWriteExtFile(celldef, node, rctol, nidx, eidx)
}
for (ptr = node->firstDev; ptr != NULL; ptr=ptr->nextDev)
{
if (layoutDev = ResGetDevice(&ptr->thisDev->location, ptr->thisDev->rs_ttype))
if ((layoutDev = ResGetDevice(&ptr->thisDev->location, ptr->thisDev->rs_ttype)))
{
ResFixUpConnections(ptr->thisDev, layoutDev, node, newname);
}

View File

@ -69,28 +69,28 @@ GetRect(fin, skip, rect, scalen, scaled)
while (skip-- > 0)
(void) FGETC(fin);
if (isNegative = ((c = FGETC(fin)) == '-')) c = FGETC(fin);
if ((isNegative = ((c = FGETC(fin)) == '-'))) c = FGETC(fin);
for (n = 0; isdigit(c); n = n * 10 + c - '0', c = FGETC(fin))
/* Nothing */;
rect->r_xbot = isNegative ? -n : n;
if (!isspace(c)) goto bad;
while ((c = FGETC(fin)) != EOF && isspace(c)) /* Nothing */;
if (isNegative = (c == '-')) c = FGETC(fin);
if ((isNegative = (c == '-'))) c = FGETC(fin);
for (n = 0; isdigit(c); n = n * 10 + c - '0', c = FGETC(fin))
/* Nothing */;
rect->r_ybot = isNegative ? -n : n;
if (!isspace(c)) goto bad;
while ((c = FGETC(fin)) != EOF && isspace(c)) /* Nothing */;
if (isNegative = (c == '-')) c = FGETC(fin);
if ((isNegative = (c == '-'))) c = FGETC(fin);
for (n = 0; isdigit(c); n = n * 10 + c - '0', c = FGETC(fin))
/* Nothing */;
rect->r_xtop = isNegative ? -n : n;
if (!isspace(c)) goto bad;
while ((c = FGETC(fin)) != EOF && isspace(c)) /* Nothing */;
if (isNegative = (c == '-')) c = FGETC(fin);
if ((isNegative = (c == '-'))) c = FGETC(fin);
for (n = 0; isdigit(c); n = n * 10 + c - '0', c = FGETC(fin))
/* Nothing */;
rect->r_ytop = isNegative ? -n : n;

View File

@ -729,7 +729,7 @@ HashTable *table;
void *p;
HashStartSearch(&hs);
while (he = HashNext(table, &hs)) {
while ((he = HashNext(table, &hs))) {
p = HashGetValue(he);
freeMagic(p);
}

View File

@ -325,7 +325,7 @@ heapify(heap, root)
while (1)
{
if ((x = heapLeft(used, root)) == 0) break;
if (r = heapRight(used, root))
if ((r = heapRight(used, root)))
KEY_LESS_COND(keyType, list, x, r, x = r);
KEY_LE_COND(keyType, list, x, root, return);
@ -341,7 +341,7 @@ heapify(heap, root)
while (1)
{
if ((x = heapLeft(used, root)) == 0) break;
if (r = heapRight(used, root))
if ((r = heapRight(used, root)))
KEY_GREATER_COND(keyType, list, x, r, x = r);
KEY_GE_COND(keyType, list, x, root, return);
*list = list[root];

View File

@ -320,7 +320,7 @@ NLSort(netList, netHeap)
/* Find bounding box around all terminals in this net */
nterms = 0;
for (term = net->nnet_terms; term; term = term->nterm_next)
if (loc = term->nterm_locs)
if ((loc = term->nterm_locs))
{
for ( ; loc; loc = loc->nloc_next)
{

View File

@ -118,7 +118,7 @@ DumpCore()
* to place the crash dump.
*/
if (crashFile = PaOpen(CRASHDIR, "r", "", ".", "", &crashDir))
if ((crashFile = PaOpen(CRASHDIR, "r", "", ".", "", &crashDir)))
{
(void) fclose(crashFile);

View File

@ -1099,7 +1099,7 @@ PaEnum(path, file, proc, cdata)
{
char component[MAXSIZE], *next;
while (next = nextName(&path, file, component, sizeof component))
while ((next = nextName(&path, file, component, sizeof component)))
if (next[0] && (*proc)(next, cdata))
return (1);

View File

@ -242,7 +242,7 @@ paVisitFilesProc(name, pv)
}
}
*lp = '\0';
if (code = paVisitProcess(lp = line, pv))
if ((code = paVisitProcess(lp = line, pv)))
break;
next: ;
}
@ -292,7 +292,7 @@ paVisitProcess(line, pv)
for (pvc = pv->pv_first; pvc; pvc = pvc->pvc_next)
if (len > 0 && strncmp(line, pvc->pvc_keyword, len) == 0)
if (code = (*pvc->pvc_proc)(line, pvc->pvc_cdata))
if ((code = (*pvc->pvc_proc)(line, pvc->pvc_cdata)))
break;
return (code);

View File

@ -651,7 +651,7 @@ TechLoad(filename, initmask)
skip = TRUE;
continue;
}
if (mask = (tsp->ts_prevSects & ~techSectionMask))
if ((mask = (tsp->ts_prevSects & ~techSectionMask)))
{
techSection *sp;