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; int type = -1;
pid_t killid = getpid(); pid_t killid = getpid();
const ucontext_t* const uc = reinterpret_cast<const ucontext_t*>(context);
#if defined(__linux__) && defined(REG_ERR) #if defined(__linux__) && defined(REG_ERR)
const ucontext_t* const uc = reinterpret_cast<const ucontext_t*>(context);
killid = (pid_t) syscall(SYS_gettid); killid = (pid_t) syscall(SYS_gettid);
if (uc) { if (uc) {
type = (int)uc->uc_mcontext.gregs[REG_ERR] & 2; type = (int)uc->uc_mcontext.gregs[REG_ERR] & 2;

View File

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