Commit a5ade513 by Andre Weissflog

Fix most clang warnings

- member initializing order in some constructors - missing default branches in switch-case - uninitialized variable if switch-case default (uncritical because program would exit) - && and || brace warnings in if()
parent e6f7988a
...@@ -1175,7 +1175,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool proj, co ...@@ -1175,7 +1175,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool proj, co
Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameters) Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameters)
{ {
// Figure out the result type // Figure out the result type
Id resultType; Id resultType = NoType;
switch (opCode) { switch (opCode) {
case OpTextureQuerySize: case OpTextureQuerySize:
case OpTextureQuerySizeLod: case OpTextureQuerySizeLod:
......
...@@ -213,10 +213,10 @@ public: ...@@ -213,10 +213,10 @@ public:
class InstructionParameters { class InstructionParameters {
public: public:
InstructionParameters() : InstructionParameters() :
typePresent(true), // most normal, only exceptions have to be spelled out
resultPresent(true), // most normal, only exceptions have to be spelled out
opDesc(0), opDesc(0),
opClass(OpClassMisc) opClass(OpClassMisc),
typePresent(true), // most normal, only exceptions have to be spelled out
resultPresent(true) // most normal, only exceptions have to be spelled out
{ } { }
void setResultAndType(bool r, bool t) void setResultAndType(bool r, bool t)
......
...@@ -1054,7 +1054,7 @@ void TBuiltIns::initialize(int version, EProfile profile) ...@@ -1054,7 +1054,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
// //
//============================================================================ //============================================================================
bool esBarrier = (profile == EEsProfile && version >= 310); bool esBarrier = (profile == EEsProfile && version >= 310);
if (profile != EEsProfile && version >= 150 || esBarrier) if ((profile != EEsProfile && version >= 150) || esBarrier)
stageBuiltins[EShLangTessControl].append( stageBuiltins[EShLangTessControl].append(
"void barrier();" "void barrier();"
); );
......
...@@ -685,7 +685,7 @@ int TScanContext::tokenizeIdentifier() ...@@ -685,7 +685,7 @@ int TScanContext::tokenizeIdentifier()
return keyword; return keyword;
case ATOMIC_UINT: case ATOMIC_UINT:
if (parseContext.profile == EEsProfile && parseContext.version >= 310 || if ((parseContext.profile == EEsProfile && parseContext.version >= 310) ||
parseContext.extensionsTurnedOn(1, &E_GL_ARB_shader_atomic_counters)) parseContext.extensionsTurnedOn(1, &E_GL_ARB_shader_atomic_counters))
return keyword; return keyword;
return es30ReservedFromGLSL(420); return es30ReservedFromGLSL(420);
......
...@@ -457,6 +457,8 @@ bool TParseContext::extensionsTurnedOn(int numExtensions, const char* const exte ...@@ -457,6 +457,8 @@ bool TParseContext::extensionsTurnedOn(int numExtensions, const char* const exte
case EBhRequire: case EBhRequire:
case EBhWarn: case EBhWarn:
return true; return true;
default:
break;
} }
} }
......
...@@ -86,7 +86,7 @@ namespace glslang { ...@@ -86,7 +86,7 @@ namespace glslang {
class TPpToken { class TPpToken {
public: public:
TPpToken() : token(0), ival(0), space(false), dval(0.0), atom(0) TPpToken() : token(0), space(false), ival(0), dval(0.0), atom(0)
{ {
loc.init(); loc.init();
name[0] = 0; name[0] = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment