Internals: Fix GCC constant warnings.

This commit is contained in:
Wilson Snyder 2017-09-15 18:26:09 -04:00
parent f1960273a0
commit fee4aba9ec
3 changed files with 3 additions and 5 deletions

View File

@ -305,8 +305,7 @@ private:
return (nodep->lsbp()->castConst() return (nodep->lsbp()->castConst()
&& nodep->widthp()->castConst() && nodep->widthp()->castConst()
&& nodep->lsbConst()==0 && nodep->lsbConst()==0
&& (int)nodep->widthConst()==nodep->fromp()->width() && (int)nodep->widthConst()==nodep->fromp()->width());
&& 1);
} }
bool operandSelExtend(AstSel* nodep) { bool operandSelExtend(AstSel* nodep) {
// A pattern created by []'s after offsets have been removed // A pattern created by []'s after offsets have been removed

View File

@ -530,8 +530,7 @@ public:
&& connBasicp->width() == pinBasicp->width() && connBasicp->width() == pinBasicp->width()
&& connBasicp->lsb() == pinBasicp->lsb() && connBasicp->lsb() == pinBasicp->lsb()
&& !connectRefp->varp()->isSc() // Need the signal as a 'shell' to convert types && !connectRefp->varp()->isSc() // Need the signal as a 'shell' to convert types
&& connBasicp->width() == pinVarp->width() && connBasicp->width() == pinVarp->width()) {
&& 1) {
// Done. One to one interconnect won't need a temporary variable. // Done. One to one interconnect won't need a temporary variable.
} else if (!alwaysCvt && !forTristate && pinp->exprp()->castConst()) { } else if (!alwaysCvt && !forTristate && pinp->exprp()->castConst()) {
// Done. Constant. // Done. Constant.

View File

@ -1097,7 +1097,7 @@ int V3PreProcImp::getStateToken() {
// Value of building argument is data before the lower defref // Value of building argument is data before the lower defref
// we'll append it when we push the argument. // we'll append it when we push the argument.
break; break;
} else if (tok==VP_SYMBOL || tok==VP_STRING || VP_TEXT || VP_WHITE) { } else if (tok==VP_SYMBOL || tok==VP_STRING || tok==VP_TEXT || tok==VP_WHITE) {
string rtn; rtn.assign(yyourtext(),yyourleng()); string rtn; rtn.assign(yyourtext(),yyourleng());
refp->nextarg(refp->nextarg()+rtn); refp->nextarg(refp->nextarg()+rtn);
goto next_tok; goto next_tok;