12 x warning: suggest parentheses around '&&' within '||'

The '&' has higher precedence, so the expression of the '&' side receive
extra parentheses.

ResMakeRes.c:671:37: warning: suggest parentheses around '&&' within '||'
ResMakeRes.c:942:32: warning: suggest parentheses around '&&' within '||'
ResSimple.c:201:70: warning: suggest parentheses around '&&' within '||'
ResRex.c:1036:28: warning: suggest parentheses around '&&' within '||'
ResRex.c:1038:50: warning: suggest parentheses around '&&' within '||'
ext2sim.c:1341:47: warning: suggest parentheses around '&&' within '||'
ext2spice.c:172:44: warning: suggest parentheses around '&&' within '||'
ext2spice.c:173:49: warning: suggest parentheses around '&&' within '||'
ext2spice.c:3655:50: warning: suggest parentheses around '&&' within '||'
ext2hier.c:1412:50: warning: suggest parentheses around '&&' within '||'
gcrDebug.c:638:55: warning: suggest parentheses around '&&' within '||'
selEnum.c:323:28: warning: suggest parentheses around '&&' within '||'

GCC14 -Wall cleanup series [-Wparentheses]
This commit is contained in:
Darryl L. Miles 2024-10-04 17:24:47 +01:00 committed by Tim Edwards
parent 239366d4b6
commit be09edb8d8
8 changed files with 20 additions and 20 deletions

View File

@ -1338,8 +1338,8 @@ FILE *outf;
suf = EFHNToStr(suffix);
if (fetInfo[type].defSubs && strcasecmp(suf,fetInfo[type].defSubs) == 0) {
l = strlen(suf) - 1;
if ( ( EFOutputFlags & EF_TRIMGLOB ) && suf[l] =='!' ||
( EFOutputFlags & EF_TRIMLOCAL ) && suf[l] == '#' )
if ( (( EFOutputFlags & EF_TRIMGLOB ) && suf[l] =='!') ||
(( EFOutputFlags & EF_TRIMLOCAL ) && suf[l] == '#') )
suf[l] = '\0' ;
if ( esFormat == SU )
fprintf(outf, "S_");

View File

@ -1409,7 +1409,7 @@ spcnodeHierVisit(hc, node, res, cap)
hierName = (HierName *) node->efnode_name->efnn_hier;
nsn = nodeSpiceHierName(hc, hierName);
if (esFormat == SPICE2 || esFormat == HSPICE && !strncmp(nsn, "z@", 2)) {
if (esFormat == SPICE2 || (esFormat == HSPICE && !strncmp(nsn, "z@", 2))) {
static char ntmp[MAX_STR_SIZE];
EFHNSprintf(ntmp, hierName);

View File

@ -169,8 +169,8 @@ esFormatSubs(outf, suf)
if (outf)
{
l = strlen(suf) - 1;
if ((EFOutputFlags & EF_TRIMGLOB ) && suf[l] == '!' ||
(EFOutputFlags & EF_TRIMLOCAL) && suf[l] == '#')
if (((EFOutputFlags & EF_TRIMGLOB ) && suf[l] == '!') ||
((EFOutputFlags & EF_TRIMLOCAL) && suf[l] == '#'))
suf[l] = '\0' ;
if (EFOutputFlags & EF_CONVERTCOMMA)
while ((specchar = strchr(suf, ',')) != NULL)
@ -3652,7 +3652,7 @@ spcnodeVisit(node, res, cap)
hierName = (HierName *) node->efnode_name->efnn_hier;
nsn = nodeSpiceName(hierName, NULL);
if (esFormat == SPICE2 || esFormat == HSPICE && strncmp(nsn, "z@", 2)==0 ) {
if (esFormat == SPICE2 || (esFormat == HSPICE && strncmp(nsn, "z@", 2)==0 )) {
static char ntmp[MAX_STR_SIZE];
EFHNSprintf(ntmp, hierName);

View File

@ -635,7 +635,7 @@ void gcrPrintCol(ch, i, showResult)
}
else TxPrintf("#");
}
else if ((res[i][j] & GCRU) || j != 0 && (res[i][j-1] & GCRU))
else if ((res[i][j] & GCRU) || (j != 0 && (res[i][j-1] & GCRU)))
{
if((res[i][j]&GCRCC) && (!(res[i][j]&(GCRBLKM|GCRBLKP))))
{

View File

@ -667,11 +667,11 @@ ResCalcNearDevice(tile, pendingList, doneList, resList)
/* 2. There are devices along two sides at right angles, */
/* and the tile is wider than it is tall. */
if ((devedge & TOPEDGE) && (devedge & BOTTOMEDGE) &&
!(devedge & LEFTEDGE) && !(devedge & RIGHTEDGE) ||
(devedge & TOPEDGE || devedge & BOTTOMEDGE) &&
if (((devedge & TOPEDGE) && (devedge & BOTTOMEDGE) &&
!(devedge & LEFTEDGE) && !(devedge & RIGHTEDGE)) ||
((devedge & TOPEDGE || devedge & BOTTOMEDGE) &&
(devedge & LEFTEDGE || devedge & RIGHTEDGE) &&
(RIGHT(tile) - LEFT(tile)) > (TOP(tile) - BOTTOM(tile)))
(RIGHT(tile) - LEFT(tile)) > (TOP(tile) - BOTTOM(tile))))
{
/* re-sort nodes south to north. */
ResSortBreaks(&junk->breakList, FALSE);
@ -939,8 +939,8 @@ ResSortBreaks(masterlist, xsort)
p3 = p2->br_next;
while (p3 != NULL)
{
if (xsort == TRUE && p2->br_loc.p_x > p3->br_loc.p_x ||
xsort == FALSE && p2->br_loc.p_y > p3->br_loc.p_y)
if ((xsort == TRUE && p2->br_loc.p_x > p3->br_loc.p_x) ||
(xsort == FALSE && p2->br_loc.p_y > p3->br_loc.p_y))
{
changed = TRUE;
if (p1 == NULL)

View File

@ -1033,9 +1033,9 @@ ResCheckSimNodes(celldef, resisdata)
ResFHFile = NULL;
}
if (ResExtFile == NULL && (ResOptionsFlags & ResOpt_DoExtFile)
|| (ResOptionsFlags & ResOpt_DoLumpFile) && ResLumpFile == NULL
|| (ResOptionsFlags & ResOpt_FastHenry) && ResFHFile == NULL)
if ((ResExtFile == NULL && (ResOptionsFlags & ResOpt_DoExtFile))
|| ((ResOptionsFlags & ResOpt_DoLumpFile) && ResLumpFile == NULL)
|| ((ResOptionsFlags & ResOpt_FastHenry) && ResFHFile == NULL))
{
TxError("Couldn't open output file\n");
return;

View File

@ -198,8 +198,8 @@ ResSimplifyNet(nodelist, biglist, reslist, tolerance)
* Break loop here. More than one driver indicates a loop;
* remove deadend, allowing drivers to be merged
*/
else if (UnMarkedReceivers == 0 && (MarkedReceivers == 1 &&
NumberOfDrivers > 1 || resistor2 != resistor1))
else if (UnMarkedReceivers == 0 && ((MarkedReceivers == 1 &&
NumberOfDrivers > 1) || resistor2 != resistor1))
{
otherNode->rn_float.rn_area += resistor1->rr_float.rr_area;

View File

@ -320,8 +320,8 @@ selEnumPFunc2(tile, arg)
/* Also okay if the X over Y yields a stacking type whose residues */
/* are X and Y. */
if ((ttype != seltype) && (((ttype == TT_SPACE) &&
TTMaskHasType(&DBHomePlaneTypes[arg->sea_plane], seltype))) ||
if (((ttype != seltype) && (((ttype == TT_SPACE) &&
TTMaskHasType(&DBHomePlaneTypes[arg->sea_plane], seltype)))) ||
(DBPaintResultTbl[arg->sea_plane][ttype][seltype] != seltype))
{
TileType chktype = DBPaintResultTbl[arg->sea_plane][ttype][seltype];