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

gaStem.c:225:9: warning: suggest parentheses around assignment used as truth value
gaStem.c:350:9: warning: suggest parentheses around assignment used as truth value
grouteMain.c:363:12: warning: suggest parentheses around assignment used as truth value
grouteMaze.c:573:17: warning: suggest parentheses around assignment used as truth value
groutePath.c:127:13: warning: suggest parentheses around assignment used as truth value
irCommand.c:901:12: warning: suggest parentheses around assignment used as truth value
irCommand.c:999:12: warning: suggest parentheses around assignment used as truth value
irCommand.c:1275:13: warning: suggest parentheses around assignment used as truth value
irCommand.c:1375:13: warning: suggest parentheses around assignment used as truth value
irCommand.c:1931:17: warning: suggest parentheses around assignment used as truth value
rtrDcmpose.c:435:12: warning: suggest parentheses around assignment used as truth value
rtrPin.c:174:17: warning: suggest parentheses around assignment used as truth value
rtrStem.c:373:21: warning: suggest parentheses around assignment used as truth value
rtrStem.c:479:9: warning: suggest parentheses around assignment used as truth value
rtrStem.c:952:17: warning: suggest parentheses around assignment used as truth value
gcrInit.c:239:9: warning: suggest parentheses around assignment used as truth value
net2ir.c:123:13: 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:24:07 +01:00 committed by Tim Edwards
parent a6e1596ba6
commit 4bfed56924
10 changed files with 17 additions and 17 deletions

View File

@ -222,7 +222,7 @@ gaStemAssign(routeUse, doWarn, loc, term, net, netList)
* See if this location lies inside a river-routing channel. * See if this location lies inside a river-routing channel.
* If it does, return the channel containing it. * If it does, return the channel containing it.
*/ */
if (ch = gaStemContainingChannel(routeUse, doWarn, loc)) if ((ch = gaStemContainingChannel(routeUse, doWarn, loc)))
{ {
if (ch->gcr_type != CHAN_HRIVER && ch->gcr_type != CHAN_VRIVER) if (ch->gcr_type != CHAN_HRIVER && ch->gcr_type != CHAN_VRIVER)
goto fail; goto fail;
@ -347,7 +347,7 @@ gaStemContainingChannelFunc(tile, pCh)
{ {
GCRChannel *ch; GCRChannel *ch;
if (ch = (GCRChannel *) tile->ti_client) if ((ch = (GCRChannel *) tile->ti_client))
{ {
if (*pCh) if (*pCh)
{ {

View File

@ -236,7 +236,7 @@ gcrUnlinkPin(pin)
{ {
GCRNet *net; GCRNet *net;
if (net = pin->gcr_pId) if ((net = pin->gcr_pId))
{ {
ASSERT(pin == net->gcr_lPin, "gcrUnlinkPin"); ASSERT(pin == net->gcr_lPin, "gcrUnlinkPin");
net->gcr_lPin = pin->gcr_pNext; net->gcr_lPin = pin->gcr_pNext;

View File

@ -360,7 +360,7 @@ glProcessLoc(startList, loc, bestCost, doFast)
} }
else glMazeShortest = FALSE; else glMazeShortest = FALSE;
bestPt = (GlPoint *) NULL; bestPt = (GlPoint *) NULL;
while (lastPt = glMazeFindPath(loc, bestCost)) while ((lastPt = glMazeFindPath(loc, bestCost)))
{ {
adjustedPt = glCrossAdjust((GlPoint *) NULL, lastPt); adjustedPt = glCrossAdjust((GlPoint *) NULL, lastPt);
if (adjustedPt->gl_cost < bestCost) if (adjustedPt->gl_cost < bestCost)

View File

@ -570,7 +570,7 @@ glMazeResetCost(headPage, headFree)
for (gpage = headPage; gpage; gpage = gpage->glp_next) for (gpage = headPage; gpage; gpage = gpage->glp_next)
{ {
for (n = headFree; n < gpage->glp_free; n++) for (n = headFree; n < gpage->glp_free; n++)
if (pin = gpage->glp_array[n].gl_pin) if ((pin = gpage->glp_array[n].gl_pin))
{ {
pin->gcr_cost = INFINITY; pin->gcr_cost = INFINITY;
if (pin->gcr_linked) if (pin->gcr_linked)

View File

@ -124,7 +124,7 @@ glListToHeap(list, destPt)
* to lie along that channel portion). * to lie along that channel portion).
*/ */
pin = temp->gl_pin; pin = temp->gl_pin;
if (tp = glChanPinToTile((Tile *) NULL, pin)) if ((tp = glChanPinToTile((Tile *) NULL, pin)))
{ {
new = glPathNew(pin, temp->gl_cost, (GlPoint *) NULL); new = glPathNew(pin, temp->gl_cost, (GlPoint *) NULL);
new->gl_tile = tp; new->gl_tile = tp;

View File

@ -898,7 +898,7 @@ irContactsCmd(w, cmd)
return; return;
} }
if(rC=irFindRouteContact(tileType)) if((rC=irFindRouteContact(tileType)))
{ {
/* Print Contact Heading */ /* Print Contact Heading */
TxPrintf("%-12.12s ", "contact"); TxPrintf("%-12.12s ", "contact");
@ -996,7 +996,7 @@ irContactsCmd(w, cmd)
return; return;
} }
if(rC=irFindRouteContact(tileType)) if((rC=irFindRouteContact(tileType)))
{ {
/* Lookup contact parameter name in table */ /* Lookup contact parameter name in table */
which = LookupStruct( which = LookupStruct(
@ -1272,7 +1272,7 @@ irLayersCmd(w, cmd)
return; return;
} }
if (rL=irFindRouteLayer(tileType)) if ((rL=irFindRouteLayer(tileType)))
{ {
/* Print Route Layer Heading */ /* Print Route Layer Heading */
TxPrintf("%-12.12s ", "layer"); TxPrintf("%-12.12s ", "layer");
@ -1372,7 +1372,7 @@ irLayersCmd(w, cmd)
return; return;
} }
if (rL=irFindRouteLayer(tileType)) if ((rL=irFindRouteLayer(tileType)))
{ {
/* Lookup route layer parameter name in table */ /* Lookup route layer parameter name in table */
which = LookupStruct( which = LookupStruct(
@ -1928,7 +1928,7 @@ irSpacingsCmd(w, cmd)
return; return;
} }
if (rT=irFindRouteType(tileType)) if ((rT=irFindRouteType(tileType)))
{ {
TxPrintf("%s: ", TxPrintf("%s: ",

View File

@ -120,7 +120,7 @@ getfirst:
continue; continue;
} }
if (cp = strchr(line1, '\n')) if ((cp = strchr(line1, '\n')))
*cp = '\0'; *cp = '\0';
if (nterms >= 2) if (nterms >= 2)

View File

@ -432,7 +432,7 @@ rtrHashKill(ht)
HashSearch hs; HashSearch hs;
HashStartSearch(&hs); HashStartSearch(&hs);
while (he = HashNext(ht, &hs)) while ((he = HashNext(ht, &hs)))
GCRFreeChannel((GCRChannel *) HashGetValue(he)); GCRFreeChannel((GCRChannel *) HashGetValue(he));
HashKill(ht); HashKill(ht);
} }

View File

@ -171,7 +171,7 @@ rtrPinArrayInit(ch, side, pins, nPins)
if (side == GEO_WEST) p.p_x--; if (side == GEO_WEST) p.p_x--;
if (side == GEO_SOUTH) p.p_y--; if (side == GEO_SOUTH) p.p_y--;
tp = TiSrPointNoHint(RtrChannelPlane, &p); tp = TiSrPointNoHint(RtrChannelPlane, &p);
if (adjacent = (GCRChannel *) tp->ti_client) if ((adjacent = (GCRChannel *) tp->ti_client))
{ {
/* Only link if entering the linked channel from a legal side */ /* Only link if entering the linked channel from a legal side */
linked = RtrPointToPin(adjacent, otherSide, &point); linked = RtrPointToPin(adjacent, otherSide, &point);

View File

@ -370,7 +370,7 @@ RtrStemAssignExt(use, doWarn, loc, term, net)
rtrStemRange(loc, dr->dr_dir, &si); rtrStemRange(loc, dr->dr_dir, &si);
if (si.stem_dir != -1) if (si.stem_dir != -1)
{ {
if (pin = rtrStemTip(loc, &si, use)) if ((pin = rtrStemTip(loc, &si, use)))
{ {
/* Mark the pin as taken */ /* Mark the pin as taken */
pins++; pins++;
@ -476,7 +476,7 @@ rtrStemTip(loc, si, use)
* Try each crossing point in the best direction, starting from the * Try each crossing point in the best direction, starting from the
* stem_start point and working outward toward stem_lo and stem_hi. * stem_start point and working outward toward stem_lo and stem_hi.
*/ */
if (pin = rtrStemTryPin(loc, si->stem_dir, &si->stem_start, use)) if ((pin = rtrStemTryPin(loc, si->stem_dir, &si->stem_start, use)))
return (pin); return (pin);
plo = phi = si->stem_start; plo = phi = si->stem_start;
@ -949,7 +949,7 @@ rtrStemSearch(center, dir, point)
tile = TiSrPointNoHint(RtrChannelPlane, point); tile = TiSrPointNoHint(RtrChannelPlane, point);
if (TiGetType(tile) == TT_SPACE) if (TiGetType(tile) == TT_SPACE)
{ {
if (ch = (GCRChannel *) tile->ti_client) if ((ch = (GCRChannel *) tile->ti_client))
break; break;
return ((GCRChannel *) NULL); return ((GCRChannel *) NULL);
} }