From bfe0952118d23e590164bc71ebb7e4173d3249cd Mon Sep 17 00:00:00 2001 From: Daniel Koch Date: Tue, 13 Mar 2018 17:06:51 -0400 Subject: [PATCH] Fix build several build errors glslang/SPIRV/SpvBuilder.cpp:2533:27: error: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare] for (int c = 0; c < accessChain.swizzle.size(); ++c) ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. glslang/hlsl/hlslParseHelper.cpp:69:5: error: field 'cullDistanceInput' will be initialized after field 'clipDistanceOutput' [-Werror,-Wreorder] cullDistanceInput(nullptr), ^ 1 error generated. glslang/glslang/MachineIndependent/attribute.cpp:85:16: error: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare] if (argNum >= args->getSequence().size()) ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. --- SPIRV/SpvBuilder.cpp | 2 +- glslang/MachineIndependent/attribute.cpp | 2 +- hlsl/hlslParseHelper.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 10d0d501f..1ba5f12ec 100644 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -2530,7 +2530,7 @@ void Builder::remapDynamicSwizzle() if (accessChain.component != NoResult && accessChain.swizzle.size() > 1) { // build a vector of the swizzle for the component to map into std::vector components; - for (int c = 0; c < accessChain.swizzle.size(); ++c) + for (int c = 0; c < (int)accessChain.swizzle.size(); ++c) components.push_back(makeUintConstant(accessChain.swizzle[c])); Id mapType = makeVectorType(makeUintType(32), (int)accessChain.swizzle.size()); Id map = makeCompositeConstant(mapType, components); diff --git a/glslang/MachineIndependent/attribute.cpp b/glslang/MachineIndependent/attribute.cpp index acc17e9f2..73b665d80 100644 --- a/glslang/MachineIndependent/attribute.cpp +++ b/glslang/MachineIndependent/attribute.cpp @@ -82,7 +82,7 @@ const TConstUnion* TAttributeArgs::getConstUnion(TBasicType basicType, int argNu if (args == nullptr) return nullptr; - if (argNum >= args->getSequence().size()) + if (argNum >= (int)args->getSequence().size()) return nullptr; const TConstUnion* constVal = &args->getSequence()[argNum]->getAsConstantUnion()->getConstArray()[0]; diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp index fbfc428ef..09d20dfa7 100755 --- a/hlsl/hlslParseHelper.cpp +++ b/hlsl/hlslParseHelper.cpp @@ -65,10 +65,10 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int entryPointFunction(nullptr), entryPointFunctionBody(nullptr), gsStreamOutput(nullptr), - clipDistanceInput(nullptr), - cullDistanceInput(nullptr), clipDistanceOutput(nullptr), - cullDistanceOutput(nullptr) + cullDistanceOutput(nullptr), + clipDistanceInput(nullptr), + cullDistanceInput(nullptr) { globalUniformDefaults.clear(); globalUniformDefaults.layoutMatrix = ElmRowMajor;