mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Internals: Prefer '(void)' to avoid unused var. No functional change.
This commit is contained in:
parent
0ff77fc352
commit
ea8f86dd30
@ -17,7 +17,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
if (false && argc && argv) {}
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
|
|
||||||
// Construct context to hold simulation time, etc
|
// Construct context to hold simulation time, etc
|
||||||
const std::unique_ptr<VerilatedContext> contextp{new VerilatedContext};
|
const std::unique_ptr<VerilatedContext> contextp{new VerilatedContext};
|
||||||
|
@ -886,7 +886,7 @@ void _vl_vsformat(std::string& output, const std::string& format, va_list ap) VL
|
|||||||
case '^': { // Realtime
|
case '^': { // Realtime
|
||||||
const int lbits = va_arg(ap, int);
|
const int lbits = va_arg(ap, int);
|
||||||
const double d = va_arg(ap, double);
|
const double d = va_arg(ap, double);
|
||||||
if (lbits) {} // UNUSED - always 64
|
(void)lbits; // UNUSED - always 64
|
||||||
if (fmt == '^') { // Realtime
|
if (fmt == '^') { // Realtime
|
||||||
if (!widthSet) width = Verilated::threadContextp()->impp()->timeFormatWidth();
|
if (!widthSet) width = Verilated::threadContextp()->impp()->timeFormatWidth();
|
||||||
const int timeunit = va_arg(ap, int);
|
const int timeunit = va_arg(ap, int);
|
||||||
@ -3101,7 +3101,7 @@ void Verilated::stackCheck(QData needSize) VL_MT_UNSAFE {
|
|||||||
haveSize / 1024, (needSize * 2) / 1024);
|
haveSize / 1024, (needSize * 2) / 1024);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (false && needSize) {} // Unused argument
|
(void)needSize; // Unused argument
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,7 +428,7 @@ V3Number& V3Number::setLongS(int32_t value) {
|
|||||||
int32_t s;
|
int32_t s;
|
||||||
} u;
|
} u;
|
||||||
u.s = value;
|
u.s = value;
|
||||||
if (u.s) {}
|
(void)u.s;
|
||||||
m_data.num()[0].m_value = u.u;
|
m_data.num()[0].m_value = u.u;
|
||||||
opCleanThis();
|
opCleanThis();
|
||||||
return *this;
|
return *this;
|
||||||
@ -441,7 +441,7 @@ V3Number& V3Number::setDouble(double value) {
|
|||||||
uint32_t u[2];
|
uint32_t u[2];
|
||||||
} u;
|
} u;
|
||||||
u.d = value;
|
u.d = value;
|
||||||
if (u.d != 0.0) {}
|
(void)u.d;
|
||||||
for (int i = 2; i < words(); i++) m_data.num()[i] = {0, 0};
|
for (int i = 2; i < words(); i++) m_data.num()[i] = {0, 0};
|
||||||
m_data.num()[0].m_value = u.u[0];
|
m_data.num()[0].m_value = u.u[0];
|
||||||
m_data.num()[1].m_value = u.u[1];
|
m_data.num()[1].m_value = u.u[1];
|
||||||
@ -2374,7 +2374,7 @@ V3Number& V3Number::opRToIRoundS(const V3Number& lhs) {
|
|||||||
uint64_t q;
|
uint64_t q;
|
||||||
} u;
|
} u;
|
||||||
u.d = v;
|
u.d = v;
|
||||||
if (u.d == 0.0) {}
|
(void)u.d;
|
||||||
|
|
||||||
const int exp = static_cast<int>((u.q >> 52ULL) & VL_MASK_Q(11)) - 1023;
|
const int exp = static_cast<int>((u.q >> 52ULL) & VL_MASK_Q(11)) - 1023;
|
||||||
const int lsb = exp - 52;
|
const int lsb = exp - 52;
|
||||||
|
@ -1691,7 +1691,7 @@ class TristateVisitor final : public TristateBaseVisitor {
|
|||||||
AstVar* const enVarp = getCreateEnVarp(nodep->varp());
|
AstVar* const enVarp = getCreateEnVarp(nodep->varp());
|
||||||
nodep->user1p(new AstVarRef{nodep->fileline(), enVarp, VAccess::READ});
|
nodep->user1p(new AstVarRef{nodep->fileline(), enVarp, VAccess::READ});
|
||||||
}
|
}
|
||||||
if (m_alhs) {} // NOP; user1() already passed down from assignment
|
(void)m_alhs; // NOP; user1() already passed down from assignment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6265,7 +6265,7 @@ class WidthVisitor final : public VNVisitor {
|
|||||||
nodep->dtypeChgSigned(nodep->lhsp()->isSigned());
|
nodep->dtypeChgSigned(nodep->lhsp()->isSigned());
|
||||||
const AstNodeBiop* const newp = iterate_shift_final(nodep);
|
const AstNodeBiop* const newp = iterate_shift_final(nodep);
|
||||||
VL_DANGLING(nodep);
|
VL_DANGLING(nodep);
|
||||||
if (newp) {} // Ununused
|
(void)newp; // Ununused
|
||||||
}
|
}
|
||||||
void iterate_shift_prelim(AstNodeBiop* nodep) {
|
void iterate_shift_prelim(AstNodeBiop* nodep) {
|
||||||
// Shifts
|
// Shifts
|
||||||
@ -6617,7 +6617,7 @@ class WidthVisitor final : public VNVisitor {
|
|||||||
AstNodeDType* const expDTypep = underp->findUInt32DType();
|
AstNodeDType* const expDTypep = underp->findUInt32DType();
|
||||||
underp
|
underp
|
||||||
= iterateCheck(nodep, "file_descriptor", underp, SELF, FINAL, expDTypep, EXTEND_EXP);
|
= iterateCheck(nodep, "file_descriptor", underp, SELF, FINAL, expDTypep, EXTEND_EXP);
|
||||||
if (underp) {} // cppcheck
|
(void)underp; // cppcheck
|
||||||
}
|
}
|
||||||
void iterateCheckSigned32(AstNode* nodep, const char* side, AstNode* underp, Stage stage) {
|
void iterateCheckSigned32(AstNode* nodep, const char* side, AstNode* underp, Stage stage) {
|
||||||
// Coerce child to signed32 if not already. Child is self-determined
|
// Coerce child to signed32 if not already. Child is self-determined
|
||||||
@ -6629,7 +6629,7 @@ class WidthVisitor final : public VNVisitor {
|
|||||||
AstNodeDType* const expDTypep = nodep->findSigned32DType();
|
AstNodeDType* const expDTypep = nodep->findSigned32DType();
|
||||||
underp = iterateCheck(nodep, side, underp, SELF, FINAL, expDTypep, EXTEND_EXP);
|
underp = iterateCheck(nodep, side, underp, SELF, FINAL, expDTypep, EXTEND_EXP);
|
||||||
}
|
}
|
||||||
if (underp) {} // cppcheck
|
(void)underp; // cppcheck
|
||||||
}
|
}
|
||||||
void iterateCheckReal(AstNode* nodep, const char* side, AstNode* underp, Stage stage) {
|
void iterateCheckReal(AstNode* nodep, const char* side, AstNode* underp, Stage stage) {
|
||||||
// Coerce child to real if not already. Child is self-determined
|
// Coerce child to real if not already. Child is self-determined
|
||||||
@ -6645,7 +6645,7 @@ class WidthVisitor final : public VNVisitor {
|
|||||||
AstNodeDType* const expDTypep = nodep->findDoubleDType();
|
AstNodeDType* const expDTypep = nodep->findDoubleDType();
|
||||||
underp = iterateCheck(nodep, side, underp, SELF, FINAL, expDTypep, EXTEND_EXP);
|
underp = iterateCheck(nodep, side, underp, SELF, FINAL, expDTypep, EXTEND_EXP);
|
||||||
}
|
}
|
||||||
if (underp) {} // cppcheck
|
(void)underp; // cppcheck
|
||||||
}
|
}
|
||||||
void iterateCheckString(AstNode* nodep, const char* side, AstNode* underp, Stage stage) {
|
void iterateCheckString(AstNode* nodep, const char* side, AstNode* underp, Stage stage) {
|
||||||
if (stage & PRELIM) {
|
if (stage & PRELIM) {
|
||||||
@ -6655,7 +6655,7 @@ class WidthVisitor final : public VNVisitor {
|
|||||||
AstNodeDType* const expDTypep = nodep->findStringDType();
|
AstNodeDType* const expDTypep = nodep->findStringDType();
|
||||||
underp = iterateCheck(nodep, side, underp, SELF, FINAL, expDTypep, EXTEND_EXP);
|
underp = iterateCheck(nodep, side, underp, SELF, FINAL, expDTypep, EXTEND_EXP);
|
||||||
}
|
}
|
||||||
if (underp) {} // cppcheck
|
(void)underp; // cppcheck
|
||||||
}
|
}
|
||||||
void iterateCheckTyped(AstNode* nodep, const char* side, AstNode* underp,
|
void iterateCheckTyped(AstNode* nodep, const char* side, AstNode* underp,
|
||||||
AstNodeDType* expDTypep, Stage stage) {
|
AstNodeDType* expDTypep, Stage stage) {
|
||||||
@ -6665,7 +6665,7 @@ class WidthVisitor final : public VNVisitor {
|
|||||||
if (stage & FINAL) {
|
if (stage & FINAL) {
|
||||||
underp = iterateCheck(nodep, side, underp, SELF, FINAL, expDTypep, EXTEND_EXP);
|
underp = iterateCheck(nodep, side, underp, SELF, FINAL, expDTypep, EXTEND_EXP);
|
||||||
}
|
}
|
||||||
if (underp) {} // cppcheck
|
(void)underp; // cppcheck
|
||||||
}
|
}
|
||||||
void iterateCheckSizedSelf(AstNode* nodep, const char* side, AstNode* underp, Determ determ,
|
void iterateCheckSizedSelf(AstNode* nodep, const char* side, AstNode* underp, Determ determ,
|
||||||
Stage stage) {
|
Stage stage) {
|
||||||
@ -6681,7 +6681,7 @@ class WidthVisitor final : public VNVisitor {
|
|||||||
underp = VN_IS(underp, NodeExpr) ? checkCvtUS(VN_AS(underp, NodeExpr)) : underp;
|
underp = VN_IS(underp, NodeExpr) ? checkCvtUS(VN_AS(underp, NodeExpr)) : underp;
|
||||||
AstNodeDType* const expDTypep = underp->dtypep();
|
AstNodeDType* const expDTypep = underp->dtypep();
|
||||||
underp = iterateCheck(nodep, side, underp, SELF, FINAL, expDTypep, EXTEND_EXP);
|
underp = iterateCheck(nodep, side, underp, SELF, FINAL, expDTypep, EXTEND_EXP);
|
||||||
if (underp) {} // cppcheck
|
(void)underp; // cppcheck
|
||||||
}
|
}
|
||||||
void iterateCheckAssign(AstNode* nodep, const char* side, AstNode* rhsp, Stage stage,
|
void iterateCheckAssign(AstNode* nodep, const char* side, AstNode* rhsp, Stage stage,
|
||||||
AstNodeDType* lhsDTypep) {
|
AstNodeDType* lhsDTypep) {
|
||||||
@ -6727,7 +6727,7 @@ class WidthVisitor final : public VNVisitor {
|
|||||||
rhsp = iterateCheck(nodep, side, rhsp, ASSIGN, FINAL, lhsDTypep,
|
rhsp = iterateCheck(nodep, side, rhsp, ASSIGN, FINAL, lhsDTypep,
|
||||||
lhsStream ? EXTEND_OFF : EXTEND_LHS);
|
lhsStream ? EXTEND_OFF : EXTEND_LHS);
|
||||||
// if (debug()) nodep->dumpTree("- checkout: ");
|
// if (debug()) nodep->dumpTree("- checkout: ");
|
||||||
if (rhsp) {} // cppcheck
|
(void)rhsp; // cppcheck
|
||||||
}
|
}
|
||||||
|
|
||||||
void iterateCheckBool(AstNode* nodep, const char* side, AstNode* underp, Stage stage) {
|
void iterateCheckBool(AstNode* nodep, const char* side, AstNode* underp, Stage stage) {
|
||||||
|
@ -77,7 +77,7 @@ int dpic_line() {
|
|||||||
printf("%%Warning: svGetCallerInfo failed\n");
|
printf("%%Warning: svGetCallerInfo failed\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (svGetCallerInfo(nullptr, nullptr)) {} // Check doesn't segflt
|
(void)svGetCallerInfo(nullptr, nullptr); // Check doesn't segflt
|
||||||
return lineno;
|
return lineno;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ int dpic_save(int value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
vp.i = value;
|
vp.i = value;
|
||||||
if (vp.i) {}
|
(void)vp.i;
|
||||||
if (svPutUserData(scope, &Dpic_Unique, vp.ptr)) {
|
if (svPutUserData(scope, &Dpic_Unique, vp.ptr)) {
|
||||||
printf("%%Warning: svPutUserData failed\n");
|
printf("%%Warning: svPutUserData failed\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -35,11 +35,12 @@ int dpii_task() {
|
|||||||
|
|
||||||
// Check DPI warnings
|
// Check DPI warnings
|
||||||
svScope scope = svGetScope(); // Will warn
|
svScope scope = svGetScope(); // Will warn
|
||||||
if (scope) {} // Unused
|
(void)scope; // Unused
|
||||||
const char* filenamep = "";
|
const char* filenamep = "";
|
||||||
int lineno = 0;
|
int lineno = 0;
|
||||||
svGetCallerInfo(&filenamep, &lineno); // Will warn
|
svGetCallerInfo(&filenamep, &lineno); // Will warn
|
||||||
if (filenamep && lineno) {} // Unused
|
(void)filenamep; // Unused
|
||||||
|
(void)lineno; // Unused
|
||||||
|
|
||||||
dpix_task();
|
dpix_task();
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -127,7 +127,7 @@ static void _dpii_logic_elem_ux(int p, int u, const svOpenArrayHandle i, const s
|
|||||||
#endif
|
#endif
|
||||||
int sizeInputOfArray = svSizeOfArray(i);
|
int sizeInputOfArray = svSizeOfArray(i);
|
||||||
// svSizeOfArray(i) undeterministic as not in C representation
|
// svSizeOfArray(i) undeterministic as not in C representation
|
||||||
if (sizeInputOfArray) {}
|
(void)sizeInputOfArray; // unused
|
||||||
|
|
||||||
for (int a = svLow(i, 1); a <= svHigh(i, 1); ++a) {
|
for (int a = svLow(i, 1); a <= svHigh(i, 1); ++a) {
|
||||||
if (dim == 1) {
|
if (dim == 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user