Merge pull request #543 from slime73/compilerwarnings

Address some compiler warnings.
This commit is contained in:
John Kessenich 2016-10-11 15:31:31 -06:00 committed by GitHub
commit 631f223b1b
6 changed files with 8 additions and 9 deletions

View file

@ -320,8 +320,8 @@ bool TParseContextBase::insertGlobalUniformBlock()
if (globalUniformBlock == nullptr)
return true;
int numMembers = globalUniformBlock->getType().getStruct()->size();
bool inserted;
int numMembers = (int)globalUniformBlock->getType().getStruct()->size();
bool inserted = false;
if (firstNewMember == 0) {
// This is the first request; we need a normal symbol table insert
inserted = symbolTable.insert(*globalUniformBlock);

View file

@ -1813,7 +1813,7 @@ TFunction* TParseContext::handleConstructorCall(const TSourceLoc& loc, const TPu
}
// Handle seeing a precision qualifier in the grammar.
void TParseContext::handlePrecisionQualifier(const TSourceLoc& loc, TQualifier& qualifier, TPrecisionQualifier precision)
void TParseContext::handlePrecisionQualifier(const TSourceLoc& /*loc*/, TQualifier& qualifier, TPrecisionQualifier precision)
{
if (obeyPrecisionQualifiers())
qualifier.precision = precision;

View file

@ -235,9 +235,9 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
case PpAtomConstInt:
if (len > 0 && tokenText[0] == '0') {
if (len > 1 && (tokenText[1] == 'x' || tokenText[1] == 'X'))
ppToken->ival = strtol(ppToken->name, 0, 16);
ppToken->ival = (int)strtol(ppToken->name, 0, 16);
else
ppToken->ival = strtol(ppToken->name, 0, 8);
ppToken->ival = (int)strtol(ppToken->name, 0, 8);
} else
ppToken->ival = atoi(ppToken->name);
break;

View file

@ -670,7 +670,7 @@ protected:
// Gets the struct dereference index that leads to 'precise' object.
ObjectAccessChain precise_accesschain_index_str =
getFrontElement(remained_accesschain_);
unsigned precise_accesschain_index = strtoul(precise_accesschain_index_str.c_str(), nullptr, 10);
unsigned precise_accesschain_index = (unsigned)strtoul(precise_accesschain_index_str.c_str(), nullptr, 10);
// Gets the node pointed by the access chain index extracted before.
glslang::TIntermTyped* potential_precise_node =
node->getSequence()[precise_accesschain_index]->getAsTyped();