Skip to content

Commit 8bb8290

Browse files
committed
Fixed GCC warnings. unused variable, shadow variable.
1 parent f4aaa76 commit 8bb8290

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

cli/cppcheckexecutor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ namespace {
324324
{
325325
int type = -1;
326326
pid_t killid = getpid();
327-
const ucontext_t* const uc = reinterpret_cast<const ucontext_t*>(context);
328327
#if defined(__linux__) && defined(REG_ERR)
328+
const ucontext_t* const uc = reinterpret_cast<const ucontext_t*>(context);
329329
killid = (pid_t) syscall(SYS_gettid);
330330
if (uc) {
331331
type = (int)uc->uc_mcontext.gregs[REG_ERR] & 2;

lib/tokenize.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3182,10 +3182,10 @@ bool Tokenizer::simplifySizeof()
31823182

31833183
const Token* tok2 = tok->next();
31843184
do {
3185-
const MathLib::bigint arraySize = MathLib::toLongNumber(tok2->strAt(1));
3186-
if (arraySize<0)
3185+
const MathLib::bigint num = MathLib::toLongNumber(tok2->strAt(1));
3186+
if (num<0)
31873187
break; // #6940 negative number
3188-
size *= (unsigned)arraySize;
3188+
size *= (unsigned)num;
31893189
tok2 = tok2->tokAt(3);
31903190
} while (Token::Match(tok2, "[ %num% ]"));
31913191
if (Token::Match(tok2, "[;=]")) {

0 commit comments

Comments
 (0)