Codacy/Cppcheck cleanups.

This commit is contained in:
Wilson Snyder 2019-10-24 22:40:15 -04:00
parent 0cbfd29ac5
commit 352adbed74
6 changed files with 9 additions and 7 deletions

View File

@ -418,7 +418,9 @@ static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR(const void* input, int length, void
const flzuint8* ip = (const flzuint8*) input;
const flzuint8* ip_limit = ip + length;
flzuint8* op = (flzuint8*) output;
#ifdef FASTLZ_SAFE
flzuint8* op_limit = op + maxout;
#endif
flzuint32 ctrl = (*ip++) & 31;
int loop = 1;

View File

@ -290,6 +290,7 @@ string AstVar::vlArgType(bool named, bool forReturn, bool forFunc) const {
if (mayparen) { oname = " ("+oname+")"; mayparen = false; }
oarray += "["+cvtToStr(widthWords())+"]";
}
if (mayparen) { }
return otype+oname+oarray;
}

View File

@ -223,7 +223,7 @@ inline bool V3FileDependImp::checkTimes(const string& filename, const string& cm
return false;
}
{
string ignore = V3Os::getline(*ifp);
string ignore = V3Os::getline(*ifp); if (ignore.empty()) { /*used*/ }
}
{
char chkDir; *ifp>>chkDir;

View File

@ -355,7 +355,7 @@ V3Number& V3Number::setLong(uint32_t value) {
V3Number& V3Number::setLongS(vlsint32_t value) {
for (int i=0; i<words(); i++) m_value[i]=m_valueX[i] = 0;
union { uint32_t u; vlsint32_t s; } u;
u.s = value;
u.s = value; if (u.s) { }
m_value[0] = u.u;
opCleanThis();
return *this;
@ -366,7 +366,7 @@ V3Number& V3Number::setDouble(double value) {
}
m_double = true;
union { double d; uint32_t u[2]; } u;
u.d = value;
u.d = value; if (u.d) { }
for (int i=2; i<words(); i++) m_value[i]=m_valueX[i] = 0;
m_value[0] = u.u[0]; m_value[1] = u.u[1];
return *this;

View File

@ -1388,7 +1388,7 @@ private:
donorp = fromp;
recipientp = top;
}
fromp = top = NULL; // Use donorp and recipientp now instead
VL_DANGLING(fromp); VL_DANGLING(top); // Use donorp and recipientp now instead
// Recursively update forward and reverse CP numbers.
//

View File

@ -75,10 +75,9 @@ extern "C" {
if ((got) != (exp)) { \
printf("%%Error: %s:%d:", __FILE__,__LINE__); \
union { type a; long long l; } u; \
u.l = 0; u.a = got; \
if (u.a) { } /*not unused*/ \
u.l = 0; u.a = got; if (u.a) {/*used*/} \
printf(" GOT = %" T_PRI64 "x", u.l); \
u.l = 0; u.a = exp; \
u.l = 0; u.a = exp; if (u.a) {/*used*/} \
printf(" EXP = %" T_PRI64 "x\n", u.l); \
return __LINE__; \
}