Fix build warnings on some platforms

Use an explicit cast from size_t to int to avoid errors like the following:
glslang\glslang\MachineIndependent\preprocessor\Pp.cpp(1053) : error C2220: warning treated as error - no 'object' file generated
glslang\glslang\MachineIndependent\preprocessor\Pp.cpp(1053) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data

affects Pp.cpp, hlslParseHelper.cpp.

Initialize local variable to get rid of warningsa about potentially
uninitialized variables:
glslang\hlsl\hlslparsehelper.cpp(3667) : error C2220: warning treated as error - no 'object' file generated
glslang\hlsl\hlslparsehelper.cpp(3667) : warning C4701: potentially uninitialized local variable 'builtIn' used

affects hlslParseHelper.cpp
This commit is contained in:
Daniel Koch 2017-02-28 09:01:43 -05:00
parent 3494d71cfa
commit 197082ca34
2 changed files with 3 additions and 3 deletions

View file

@ -1052,7 +1052,7 @@ int TPpContext::tMacroInput::scan(TPpToken* ppToken)
// TODO: preprocessor: properly handle whitespace (or lack of it) between tokens when expanding
if (token == PpAtomIdentifier) {
int i;
for (i = mac->args.size() - 1; i >= 0; i--)
for (i = (int)mac->args.size() - 1; i >= 0; i--)
if (strcmp(pp->atomStrings.getString(mac->args[i]), ppToken->name) == 0)
break;
if (i >= 0) {