Fixed GCC warnings. unused variable, shadow variable.

This commit is contained in:
Daniel Marjamäki 2015-11-28 18:15:47 +01:00
parent f4aaa76639
commit 8bb8290a6f
2 changed files with 4 additions and 4 deletions

View File

@ -324,8 +324,8 @@ namespace {
{
int type = -1;
pid_t killid = getpid();
const ucontext_t* const uc = reinterpret_cast<const ucontext_t*>(context);
#if defined(__linux__) && defined(REG_ERR)
const ucontext_t* const uc = reinterpret_cast<const ucontext_t*>(context);
killid = (pid_t) syscall(SYS_gettid);
if (uc) {
type = (int)uc->uc_mcontext.gregs[REG_ERR] & 2;

View File

@ -3182,10 +3182,10 @@ bool Tokenizer::simplifySizeof()
const Token* tok2 = tok->next();
do {
const MathLib::bigint arraySize = MathLib::toLongNumber(tok2->strAt(1));
if (arraySize<0)
const MathLib::bigint num = MathLib::toLongNumber(tok2->strAt(1));
if (num<0)
break; // #6940 negative number
size *= (unsigned)arraySize;
size *= (unsigned)num;
tok2 = tok2->tokAt(3);
} while (Token::Match(tok2, "[ %num% ]"));
if (Token::Match(tok2, "[;=]")) {