Skip to content

Commit

Permalink
17 x warning: suggest parentheses around assignment used as truth value
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
dlmiles authored and RTimothyEdwards committed Oct 10, 2024
1 parent a6e1596 commit 4bfed56
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions garouter/gaStem.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ gaStemAssign(routeUse, doWarn, loc, term, net, netList)
* See if this location lies inside a river-routing channel.
* 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)
goto fail;
Expand Down Expand Up @@ -347,7 +347,7 @@ gaStemContainingChannelFunc(tile, pCh)
{
GCRChannel *ch;

if (ch = (GCRChannel *) tile->ti_client)
if ((ch = (GCRChannel *) tile->ti_client))
{
if (*pCh)
{
Expand Down
2 changes: 1 addition & 1 deletion gcr/gcrInit.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ gcrUnlinkPin(pin)
{
GCRNet *net;

if (net = pin->gcr_pId)
if ((net = pin->gcr_pId))
{
ASSERT(pin == net->gcr_lPin, "gcrUnlinkPin");
net->gcr_lPin = pin->gcr_pNext;
Expand Down
2 changes: 1 addition & 1 deletion grouter/grouteMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ glProcessLoc(startList, loc, bestCost, doFast)
}
else glMazeShortest = FALSE;
bestPt = (GlPoint *) NULL;
while (lastPt = glMazeFindPath(loc, bestCost))
while ((lastPt = glMazeFindPath(loc, bestCost)))
{
adjustedPt = glCrossAdjust((GlPoint *) NULL, lastPt);
if (adjustedPt->gl_cost < bestCost)
Expand Down
2 changes: 1 addition & 1 deletion grouter/grouteMaze.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ glMazeResetCost(headPage, headFree)
for (gpage = headPage; gpage; gpage = gpage->glp_next)
{
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;
if (pin->gcr_linked)
Expand Down
2 changes: 1 addition & 1 deletion grouter/groutePath.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ glListToHeap(list, destPt)
* to lie along that channel portion).
*/
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->gl_tile = tp;
Expand Down
10 changes: 5 additions & 5 deletions irouter/irCommand.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ irContactsCmd(w, cmd)
return;
}

if(rC=irFindRouteContact(tileType))
if((rC=irFindRouteContact(tileType)))
{
/* Print Contact Heading */
TxPrintf("%-12.12s ", "contact");
Expand Down Expand Up @@ -996,7 +996,7 @@ irContactsCmd(w, cmd)
return;
}

if(rC=irFindRouteContact(tileType))
if((rC=irFindRouteContact(tileType)))
{
/* Lookup contact parameter name in table */
which = LookupStruct(
Expand Down Expand Up @@ -1272,7 +1272,7 @@ irLayersCmd(w, cmd)
return;
}

if (rL=irFindRouteLayer(tileType))
if ((rL=irFindRouteLayer(tileType)))
{
/* Print Route Layer Heading */
TxPrintf("%-12.12s ", "layer");
Expand Down Expand Up @@ -1372,7 +1372,7 @@ irLayersCmd(w, cmd)
return;
}

if (rL=irFindRouteLayer(tileType))
if ((rL=irFindRouteLayer(tileType)))
{
/* Lookup route layer parameter name in table */
which = LookupStruct(
Expand Down Expand Up @@ -1928,7 +1928,7 @@ irSpacingsCmd(w, cmd)
return;
}

if (rT=irFindRouteType(tileType))
if ((rT=irFindRouteType(tileType)))
{

TxPrintf("%s: ",
Expand Down
2 changes: 1 addition & 1 deletion net2ir/net2ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ main(argc, argv)
continue;
}

if (cp = strchr(line1, '\n'))
if ((cp = strchr(line1, '\n')))
*cp = '\0';

if (nterms >= 2)
Expand Down
2 changes: 1 addition & 1 deletion router/rtrDcmpose.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ rtrHashKill(ht)
HashSearch hs;

HashStartSearch(&hs);
while (he = HashNext(ht, &hs))
while ((he = HashNext(ht, &hs)))
GCRFreeChannel((GCRChannel *) HashGetValue(he));
HashKill(ht);
}
Expand Down
2 changes: 1 addition & 1 deletion router/rtrPin.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ rtrPinArrayInit(ch, side, pins, nPins)
if (side == GEO_WEST) p.p_x--;
if (side == GEO_SOUTH) p.p_y--;
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 */
linked = RtrPointToPin(adjacent, otherSide, &point);
Expand Down
6 changes: 3 additions & 3 deletions router/rtrStem.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ RtrStemAssignExt(use, doWarn, loc, term, net)
rtrStemRange(loc, dr->dr_dir, &si);
if (si.stem_dir != -1)
{
if (pin = rtrStemTip(loc, &si, use))
if ((pin = rtrStemTip(loc, &si, use)))
{
/* Mark the pin as taken */
pins++;
Expand Down Expand Up @@ -476,7 +476,7 @@ rtrStemTip(loc, si, use)
* Try each crossing point in the best direction, starting from the
* 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);

plo = phi = si->stem_start;
Expand Down Expand Up @@ -949,7 +949,7 @@ rtrStemSearch(center, dir, point)
tile = TiSrPointNoHint(RtrChannelPlane, point);
if (TiGetType(tile) == TT_SPACE)
{
if (ch = (GCRChannel *) tile->ti_client)
if ((ch = (GCRChannel *) tile->ti_client))
break;
return ((GCRChannel *) NULL);
}
Expand Down

0 comments on commit 4bfed56

Please sign in to comment.