Fix mismatched integer comparison (size_t/unsigned int vs int)
authorbaldurk <baldurk@baldurk.org>
Wed, 30 Jan 2019 17:29:17 +0000 (17:29 +0000)
committerbaldurk <baldurk@baldurk.org>
Wed, 30 Jan 2019 17:29:44 +0000 (17:29 +0000)
SPIRV/SpvPostProcess.cpp
glslang/MachineIndependent/SymbolTable.cpp

index 04d594c..d4924f6 100755 (executable)
@@ -222,7 +222,7 @@ void Builder::postProcess(Instruction& inst)
                     Instruction *idx = module.getInstruction(accessChain->getIdOperand(i));
                     if (type->getOpCode() == OpTypeStruct) {
                         assert(idx->getOpCode() == OpConstant);
                     Instruction *idx = module.getInstruction(accessChain->getIdOperand(i));
                     if (type->getOpCode() == OpTypeStruct) {
                         assert(idx->getOpCode() == OpConstant);
-                        int c = idx->getImmediateOperand(0);
+                        unsigned int c = idx->getImmediateOperand(0);
 
                         const auto function = [&](const std::unique_ptr<Instruction>& decoration) {
                             if (decoration.get()->getOpCode() == OpMemberDecorate &&
 
                         const auto function = [&](const std::unique_ptr<Instruction>& decoration) {
                             if (decoration.get()->getOpCode() == OpMemberDecorate &&
index 427666a..d8d6846 100755 (executable)
@@ -297,7 +297,7 @@ TVariable::TVariable(const TVariable& copyOf) : TSymbol(copyOf)
     if (copyOf.getNumExtensions() > 0)
         setExtensions(copyOf.getNumExtensions(), copyOf.getExtensions());
     if (copyOf.hasMemberExtensions()) {
     if (copyOf.getNumExtensions() > 0)
         setExtensions(copyOf.getNumExtensions(), copyOf.getExtensions());
     if (copyOf.hasMemberExtensions()) {
-        for (int m = 0; m < copyOf.type.getStruct()->size(); ++m) {
+        for (int m = 0; m < (int)copyOf.type.getStruct()->size(); ++m) {
             if (copyOf.getNumMemberExtensions(m) > 0)
                 setMemberExtensions(m, copyOf.getNumMemberExtensions(m), copyOf.getMemberExtensions(m));
         }
             if (copyOf.getNumMemberExtensions(m) > 0)
                 setMemberExtensions(m, copyOf.getNumMemberExtensions(m), copyOf.getMemberExtensions(m));
         }