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

bpMain.c:265:11: warning: suggest parentheses around assignment used as truth value
CmdSubrs.c:413:12: warning: suggest parentheses around assignment used as truth value
CmdSubrs.c:759:13: warning: suggest parentheses around assignment used as truth value
CmdFI.c:1600:12: warning: suggest parentheses around assignment used as truth value
DBcell.c:109:12: warning: suggest parentheses around assignment used as truth value
DBcellname.c:2512:9: warning: suggest parentheses around assignment used as truth value
DBcellsrch.c:95:12: warning: suggest parentheses around assignment used as truth value
DBio.c:3998:9: warning: suggest parentheses around assignment used as truth value
DBlabel2.c:228:9: warning: suggest parentheses around assignment used as truth value
DBWelement.c:195:12: warning: suggest parentheses around assignment used as truth value
DBWelement.c:197:13: warning: suggest parentheses around assignment used as truth value
DBWelement.c:295:12: warning: suggest parentheses around assignment used as truth value
DBWelement.c:297:13: warning: suggest parentheses around assignment used as truth value
DBWelement.c:637:12: warning: suggest parentheses around assignment used as truth value
DBWelement.c:639:13: warning: suggest parentheses around assignment used as truth value
DBWelement.c:679:12: warning: suggest parentheses around assignment used as truth value
DBWelement.c:681:13: warning: suggest parentheses around assignment used as truth value
DRCtech.c:1219:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:1368:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:1471:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:1543:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:1676:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:1772:21: warning: suggest parentheses around assignment used as truth value
DRCtech.c:1919:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:2099:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:2324:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:2713:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:2830:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:2944:17: warning: suggest parentheses around assignment used as truth value
DRCtech.c:3097:21: warning: suggest parentheses around assignment used as truth value
DRCtech.c:3144:21: warning: suggest parentheses around assignment used as truth value
DRCtech.c:3181:21: warning: suggest parentheses around assignment used as truth value
DRCtech.c:3215:9: warning: suggest parentheses around assignment used as truth value
DRCtech.c:3227:21: warning: suggest parentheses around assignment used as truth value
DRCtech.c:3261:21: warning: suggest parentheses around assignment used as truth value
DRCtech.c:3459:17: 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:19:27 +01:00 committed by Tim Edwards
parent 518b5f45d8
commit 6cdb9ad167
10 changed files with 36 additions and 36 deletions

View File

@ -262,7 +262,7 @@ Rect BPBBox(BPlane *bp)
e = BPEnumNext(&bpe); e = BPEnumNext(&bpe);
bp->bp_bbox = e->e_rect; bp->bp_bbox = e->e_rect;
while(e = BPEnumNext(&bpe)) while((e = BPEnumNext(&bpe)))
{ {
GeoIncludeRectInBBox(&e->e_rect, &bp->bp_bbox); GeoIncludeRectInBBox(&e->e_rect, &bp->bp_bbox);
} }

View File

@ -1597,7 +1597,7 @@ CmdFindNetProc(nodename, use, rect, warn_not_found, isvalid)
scx.scx_trans = GeoIdentityTransform; scx.scx_trans = GeoIdentityTransform;
s = nodename; s = nodename;
trans = GeoIdentityTransform; trans = GeoIdentityTransform;
while (s2 = strchr(s, '/')) while ((s2 = strchr(s, '/')))
{ {
*s2 = '\0'; *s2 = '\0';
DBTreeFindUse(s, scx.scx_use, &scx2); DBTreeFindUse(s, scx.scx_use, &scx2);

View File

@ -410,7 +410,7 @@ CmdParseLayers(s, mask)
TTMaskZero(mask); TTMaskZero(mask);
while (c = *s++) while ((c = *s++))
{ {
switch (c) switch (c)
{ {
@ -756,7 +756,7 @@ again:
if (strcmp(returnname, def->cd_name) != 0) if (strcmp(returnname, def->cd_name) != 0)
{ {
if (f = PaOpen(returnname, "r", DBSuffix, ".", (char *) NULL, &filename)) if ((f = PaOpen(returnname, "r", DBSuffix, ".", (char *) NULL, &filename)))
{ {
(void) fclose(f); (void) fclose(f);
if (noninteractive) { if (noninteractive) {

View File

@ -106,7 +106,7 @@ DBCellFindDup(use, parent)
BPEnumInit(&bpe, parent->cd_cellPlane, &use->cu_bbox, BPE_EQUAL, BPEnumInit(&bpe, parent->cd_cellPlane, &use->cu_bbox, BPE_EQUAL,
"DBCellFindDup"); "DBCellFindDup");
while (dupUse = BPEnumNext(&bpe)) while ((dupUse = BPEnumNext(&bpe)))
if (dupUse->cu_def == use->cu_def) if (dupUse->cu_def == use->cu_def)
/* Transforms must be equal---Aligned bounding boxes are /* Transforms must be equal---Aligned bounding boxes are
* an insufficient measure of exact overlap. * an insufficient measure of exact overlap.

View File

@ -2509,7 +2509,7 @@ DBUnLinkCell(use, parentDef)
{ {
HashEntry *he; HashEntry *he;
if (he = HashLookOnly(&parentDef->cd_idHash, use->cu_id)) if ((he = HashLookOnly(&parentDef->cd_idHash, use->cu_id)))
HashSetValue(he, (ClientData) NULL); HashSetValue(he, (ClientData) NULL);
} }

View File

@ -92,7 +92,7 @@ DBSrCellPlaneArea(BPlane *plane, Rect *rect, int (*func)(), ClientData arg)
bpe = (BPEnum *)mallocMagic(sizeof(BPEnum)); bpe = (BPEnum *)mallocMagic(sizeof(BPEnum));
BPEnumInit(bpe, plane, rect, BPE_OVERLAP, "DBSrCellPlaneArea"); BPEnumInit(bpe, plane, rect, BPE_OVERLAP, "DBSrCellPlaneArea");
while (use = BPEnumNext(bpe)) while ((use = BPEnumNext(bpe)))
{ {
if ((*func)(use, arg)) if ((*func)(use, arg))
{ {

View File

@ -3993,7 +3993,7 @@ DBCellWrite(cellDef, fileName)
* If so, write to the temp file and then rename it after * If so, write to the temp file and then rename it after
* we're done. * we're done.
*/ */
if (tmpf = fopen(tmpname, "w")) if ((tmpf = fopen(tmpname, "w")))
{ {
result = DBCellWriteFile(cellDef, tmpf); result = DBCellWriteFile(cellDef, tmpf);
(void) fclose(tmpf); (void) fclose(tmpf);

View File

@ -225,7 +225,7 @@ DBSrLabelLoc(rootUse, name, func, cdarg)
char csave; char csave;
Rect r; Rect r;
if (cp = strrchr(name, '/')) if ((cp = strrchr(name, '/')))
{ {
csave = *cp; csave = *cp;
*cp = '\0'; *cp = '\0';

View File

@ -192,9 +192,9 @@ DBWPrintElements(cellDef, flagmask, reducer)
char *etypes[] = {"rectangle", "line", "text"}; char *etypes[] = {"rectangle", "line", "text"};
HashStartSearch(&hs); HashStartSearch(&hs);
while (he = HashNext(&elementTable, &hs)) while ((he = HashNext(&elementTable, &hs)))
{ {
if (elem = (DBWElement *)HashGetValue(he)) if ((elem = (DBWElement *)HashGetValue(he)))
{ {
if ((elem->rootDef == cellDef) && (elem->flags & flagmask)) if ((elem->rootDef == cellDef) && (elem->flags & flagmask))
{ {
@ -292,9 +292,9 @@ DBWScaleElements(n, d)
extern bool DBScalePoint(); /* Forward declaration */ extern bool DBScalePoint(); /* Forward declaration */
HashStartSearch(&hs); HashStartSearch(&hs);
while (he = HashNext(&elementTable, &hs)) while ((he = HashNext(&elementTable, &hs)))
{ {
if (elem = (DBWElement *)HashGetValue(he)) if ((elem = (DBWElement *)HashGetValue(he)))
{ {
/* scale area rectangle */ /* scale area rectangle */
DBScalePoint(&elem->area.r_ll, n, d); DBScalePoint(&elem->area.r_ll, n, d);
@ -634,9 +634,9 @@ DBWElementNames()
#endif #endif
HashStartSearch(&hs); HashStartSearch(&hs);
while (he = HashNext(&elementTable, &hs)) while ((he = HashNext(&elementTable, &hs)))
{ {
if (elem = (DBWElement *)HashGetValue(he)) if ((elem = (DBWElement *)HashGetValue(he)))
{ {
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
Tcl_AppendElement(magicinterp, he->h_key.h_name); Tcl_AppendElement(magicinterp, he->h_key.h_name);
@ -676,9 +676,9 @@ DBWElementInbox(area)
#endif #endif
HashStartSearch(&hs); HashStartSearch(&hs);
while (he = HashNext(&elementTable, &hs)) while ((he = HashNext(&elementTable, &hs)))
{ {
if (elem = (DBWElement *)HashGetValue(he)) if ((elem = (DBWElement *)HashGetValue(he)))
{ {
if (GEO_SURROUND(area, &elem->area)) if (GEO_SURROUND(area, &elem->area))
{ {

View File

@ -1216,7 +1216,7 @@ drcExtend(argc, argv)
for (j = 0; j < DBNumTypes; j++) for (j = 0; j < DBNumTypes; j++)
{ {
if (i == j) continue; if (i == j) continue;
if (pset = (DBTypesOnSamePlane(i, j) & pMask2)) if ((pset = (DBTypesOnSamePlane(i, j) & pMask2)))
{ {
/* Edge depends on whether or not the extension is */ /* Edge depends on whether or not the extension is */
/* on the same plane as the layer from which it is */ /* on the same plane as the layer from which it is */
@ -1365,7 +1365,7 @@ drcWidth(argc, argv)
* and a type in 'set'. * and a type in 'set'.
*/ */
if (pset = (DBTypesOnSamePlane(i, j) & pmask)) if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
{ {
if (TTMaskHasType(&setC, i) && TTMaskHasType(&set, j)) if (TTMaskHasType(&setC, i) && TTMaskHasType(&set, j))
{ {
@ -1468,7 +1468,7 @@ drcArea(argc, argv)
* to the right of any edge between a type in '~set' * to the right of any edge between a type in '~set'
* and a type in 'set'. * and a type in 'set'.
*/ */
if (pset = (DBTypesOnSamePlane(i, j) & pmask)) if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
{ {
if (TTMaskHasType(&setC, i) && TTMaskHasType(&set, j)) if (TTMaskHasType(&setC, i) && TTMaskHasType(&set, j))
{ {
@ -1540,7 +1540,7 @@ drcOffGrid(argc, argv)
* to the right of any edge between a type in '~set' * to the right of any edge between a type in '~set'
* and a type in 'set'. * and a type in 'set'.
*/ */
if (pset = (DBTypesOnSamePlane(i, j))) if ((pset = (DBTypesOnSamePlane(i, j))))
{ {
if (TTMaskHasType(&setC, i) && TTMaskHasType(&set, j)) if (TTMaskHasType(&setC, i) && TTMaskHasType(&set, j))
{ {
@ -1673,7 +1673,7 @@ drcMaxwidth(argc, argv)
* to the right of any edge between a type in '~set' * to the right of any edge between a type in '~set'
* and a type in 'set'. * and a type in 'set'.
*/ */
if (pset = (DBTypesOnSamePlane(i, j) & pmask)) if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
{ {
if (TTMaskHasType(&setC, i) && TTMaskHasType(&set, j)) if (TTMaskHasType(&setC, i) && TTMaskHasType(&set, j))
{ {
@ -1769,7 +1769,7 @@ drcAngles(argc, argv)
{ {
if (i == j) continue; if (i == j) continue;
if (pset = (DBTypesOnSamePlane(i, j) & pmask)) if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
{ {
/* Inside corners */ /* Inside corners */
if (TTMaskHasType(&set, i) && TTMaskHasType(&set2, j)) if (TTMaskHasType(&set, i) && TTMaskHasType(&set2, j))
@ -1916,7 +1916,7 @@ drcSpacing3(argc, argv)
for (j = 0; j < DBNumTypes; j++) for (j = 0; j < DBNumTypes; j++)
{ {
if (i == j) continue; if (i == j) continue;
if (pset = (DBTypesOnSamePlane(i, j) & pmask)) if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
{ {
if (TTMaskHasType(&set1, i) && TTMaskHasType(&set3, j)) if (TTMaskHasType(&set1, i) && TTMaskHasType(&set3, j))
{ {
@ -2096,7 +2096,7 @@ drcMaskSpacing(set1, set2, pmask1, pmask2, wwidth, distance, adjacency,
for (j = 0; j < DBNumTypes; j++) for (j = 0; j < DBNumTypes; j++)
{ {
if (i == j) continue; if (i == j) continue;
if (pset = (DBTypesOnSamePlane(i, j) & pmask1)) if ((pset = (DBTypesOnSamePlane(i, j) & pmask1)))
{ {
plane = LowestMaskBit(pset); plane = LowestMaskBit(pset);
@ -2321,7 +2321,7 @@ drcMaskSpacing(set1, set2, pmask1, pmask2, wwidth, distance, adjacency,
if (needtrigger) continue; if (needtrigger) continue;
if (pset = (DBTypesOnSamePlane(i, j) & pmask1)) if ((pset = (DBTypesOnSamePlane(i, j) & pmask1)))
{ {
plane = LowestMaskBit(pset); plane = LowestMaskBit(pset);
@ -2710,7 +2710,7 @@ drcEdge(argc, argv)
for (j = 0; j < DBNumTypes; j++) for (j = 0; j < DBNumTypes; j++)
{ {
if (i == j) continue; if (i == j) continue;
if (pset = (DBTypesOnSamePlane(i, j) & pMask1)) if ((pset = (DBTypesOnSamePlane(i, j) & pMask1)))
{ {
if (TTMaskHasType(&set1, i) && TTMaskHasType(&set2, j)) if (TTMaskHasType(&set1, i) && TTMaskHasType(&set2, j))
{ {
@ -2827,7 +2827,7 @@ drcOverhang(argc, argv)
for (j = 0; j < DBNumTypes; j++) for (j = 0; j < DBNumTypes; j++)
{ {
if (i == j) continue; if (i == j) continue;
if (pset = (DBTypesOnSamePlane(i, j) & pMask2)) if ((pset = (DBTypesOnSamePlane(i, j) & pMask2)))
{ {
if ((pset & pMask1) != 0) if ((pset & pMask1) != 0)
{ {
@ -2941,7 +2941,7 @@ drcRectOnly(argc, argv)
{ {
if (i == j) continue; if (i == j) continue;
if (pset = (DBTypesOnSamePlane(i, j) & pmask)) if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
{ {
if (TTMaskHasType(&set1, i) && TTMaskHasType(&set2, j)) if (TTMaskHasType(&set1, i) && TTMaskHasType(&set2, j))
{ {
@ -3094,7 +3094,7 @@ drcSurround(argc, argv)
if (isDirectional) if (isDirectional)
{ {
if (pset = (DBTypesOnSamePlane(i, j) & pmask)) if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
{ {
/* Directional surround is done entirely differently */ /* Directional surround is done entirely differently */
@ -3141,7 +3141,7 @@ drcSurround(argc, argv)
} }
else else
{ {
if (pset = (DBTypesOnSamePlane(i, j) & pmask2)) if ((pset = (DBTypesOnSamePlane(i, j) & pmask2)))
{ {
if (TTMaskHasType(&set1, i) && TTMaskHasType(&set2, j)) if (TTMaskHasType(&set1, i) && TTMaskHasType(&set2, j))
{ {
@ -3178,7 +3178,7 @@ drcSurround(argc, argv)
for (j = 0; j < DBNumTypes; j++) for (j = 0; j < DBNumTypes; j++)
{ {
if (i == j) continue; /* Ignore false edges */ if (i == j) continue; /* Ignore false edges */
if (pset = (DBTypesOnSamePlane(i, j) & pmask)) if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
{ {
if (TTMaskHasType(&setM, i) && TTMaskHasType(&set2, j)) if (TTMaskHasType(&setM, i) && TTMaskHasType(&set2, j))
{ {
@ -3212,7 +3212,7 @@ drcSurround(argc, argv)
/* Add an extra rule when presence of the surrounding */ /* Add an extra rule when presence of the surrounding */
/* layer is required. Rule is different if planes match. */ /* layer is required. Rule is different if planes match. */
if (pset = pmask & pmask2) if ((pset = pmask & pmask2))
{ {
TTMaskZero(&invM); TTMaskZero(&invM);
TTMaskSetMask(&invM, &setM); TTMaskSetMask(&invM, &setM);
@ -3224,7 +3224,7 @@ drcSurround(argc, argv)
for (j = 0; j < DBNumTypes; j++) for (j = 0; j < DBNumTypes; j++)
{ {
if (i == j) continue; if (i == j) continue;
if (pset = (DBTypesOnSamePlane(i, j) & pmask & pmask2)) if ((pset = (DBTypesOnSamePlane(i, j) & pmask & pmask2)))
{ {
plane1 = LowestMaskBit(pset); plane1 = LowestMaskBit(pset);
if (TTMaskHasType(&setM, i) && TTMaskHasType(&invM, j)) if (TTMaskHasType(&setM, i) && TTMaskHasType(&invM, j))
@ -3258,7 +3258,7 @@ drcSurround(argc, argv)
for (j = 0; j < DBNumTypes; j++) for (j = 0; j < DBNumTypes; j++)
{ {
if (i == j) continue; if (i == j) continue;
if (pset = (DBTypesOnSamePlane(i, j) & pmask)) if ((pset = (DBTypesOnSamePlane(i, j) & pmask)))
{ {
if (TTMaskHasType(&setM, i) && TTMaskHasType(&invM, j)) if (TTMaskHasType(&setM, i) && TTMaskHasType(&invM, j))
{ {
@ -3456,7 +3456,7 @@ drcRectangle(argc, argv)
{ {
if (i == j) continue; if (i == j) continue;
if (pset = (DBTypesOnSamePlane(i, j) & pMask)) if ((pset = (DBTypesOnSamePlane(i, j) & pMask)))
{ {
if (TTMaskHasType(&types, i) && TTMaskHasType(&nottypes, j)) if (TTMaskHasType(&types, i) && TTMaskHasType(&nottypes, j))
{ {