Merge pull request #2857 from jeremy-lunarg/hayes-fix-warnings
Fix GCC sign-compare warnings
This commit is contained in:
commit
35150804c3
@ -433,11 +433,11 @@ Id Builder::makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& opera
|
|||||||
Instruction* type;
|
Instruction* type;
|
||||||
for (int t = 0; t < (int)groupedTypes[opcode].size(); ++t) {
|
for (int t = 0; t < (int)groupedTypes[opcode].size(); ++t) {
|
||||||
type = groupedTypes[opcode][t];
|
type = groupedTypes[opcode][t];
|
||||||
if (type->getNumOperands() != operands.size())
|
if (static_cast<size_t>(type->getNumOperands()) != operands.size())
|
||||||
continue; // Number mismatch, find next
|
continue; // Number mismatch, find next
|
||||||
|
|
||||||
bool match = true;
|
bool match = true;
|
||||||
for (int op = 0; match && op < operands.size(); ++op) {
|
for (size_t op = 0; match && op < operands.size(); ++op) {
|
||||||
match = (operands[op].isId ? type->getIdOperand(op) : type->getImmediateOperand(op)) == operands[op].word;
|
match = (operands[op].isId ? type->getIdOperand(op) : type->getImmediateOperand(op)) == operands[op].word;
|
||||||
}
|
}
|
||||||
if (match)
|
if (match)
|
||||||
@ -446,7 +446,7 @@ Id Builder::makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& opera
|
|||||||
|
|
||||||
// not found, make it
|
// not found, make it
|
||||||
type = new Instruction(getUniqueId(), NoType, opcode);
|
type = new Instruction(getUniqueId(), NoType, opcode);
|
||||||
for (int op = 0; op < operands.size(); ++op) {
|
for (size_t op = 0; op < operands.size(); ++op) {
|
||||||
if (operands[op].isId)
|
if (operands[op].isId)
|
||||||
type->addIdOperand(operands[op].word);
|
type->addIdOperand(operands[op].word);
|
||||||
else
|
else
|
||||||
|
|||||||
@ -113,11 +113,13 @@ bool verifyIOMapping(std::string& linkingError, glslang::TProgram& program) {
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
for (auto outIt : pipeOut) {
|
for (auto outIt : pipeOut) {
|
||||||
if (outIt.second->getType()->isStruct()) {
|
if (outIt.second->getType()->isStruct()) {
|
||||||
unsigned int baseLoc = outIt.second->getType()->getQualifier().hasLocation() ? outIt.second->getType()->getQualifier().layoutLocation : -1;
|
unsigned int baseLoc = outIt.second->getType()->getQualifier().hasLocation() ?
|
||||||
for (int j = 0; j < outIt.second->getType()->getStruct()->size(); j++) {
|
outIt.second->getType()->getQualifier().layoutLocation :
|
||||||
|
std::numeric_limits<unsigned int>::max();
|
||||||
|
for (size_t j = 0; j < outIt.second->getType()->getStruct()->size(); j++) {
|
||||||
baseLoc = (*outIt.second->getType()->getStruct())[j].type->getQualifier().hasLocation() ?
|
baseLoc = (*outIt.second->getType()->getStruct())[j].type->getQualifier().hasLocation() ?
|
||||||
(*outIt.second->getType()->getStruct())[j].type->getQualifier().layoutLocation : baseLoc;
|
(*outIt.second->getType()->getStruct())[j].type->getQualifier().layoutLocation : baseLoc;
|
||||||
if (baseLoc != -1) {
|
if (baseLoc != std::numeric_limits<unsigned int>::max()) {
|
||||||
if (baseLoc == in.getType()->getQualifier().layoutLocation) {
|
if (baseLoc == in.getType()->getQualifier().layoutLocation) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
@ -134,10 +136,10 @@ bool verifyIOMapping(std::string& linkingError, glslang::TProgram& program) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
unsigned int baseLoc = in.getType()->getQualifier().hasLocation() ? in.getType()->getQualifier().layoutLocation : -1;
|
unsigned int baseLoc = in.getType()->getQualifier().hasLocation() ? in.getType()->getQualifier().layoutLocation : -1;
|
||||||
for (int j = 0; j < in.getType()->getStruct()->size(); j++) {
|
for (size_t j = 0; j < in.getType()->getStruct()->size(); j++) {
|
||||||
baseLoc = (*in.getType()->getStruct())[j].type->getQualifier().hasLocation() ?
|
baseLoc = (*in.getType()->getStruct())[j].type->getQualifier().hasLocation() ?
|
||||||
(*in.getType()->getStruct())[j].type->getQualifier().layoutLocation : baseLoc;
|
(*in.getType()->getStruct())[j].type->getQualifier().layoutLocation : baseLoc;
|
||||||
if (baseLoc != -1) {
|
if (baseLoc != std::numeric_limits<unsigned int>::max()) {
|
||||||
bool isMemberFound = false;
|
bool isMemberFound = false;
|
||||||
for (auto outIt : pipeOut) {
|
for (auto outIt : pipeOut) {
|
||||||
if (baseLoc == outIt.second->getType()->getQualifier().layoutLocation) {
|
if (baseLoc == outIt.second->getType()->getQualifier().layoutLocation) {
|
||||||
@ -350,4 +352,4 @@ INSTANTIATE_TEST_SUITE_P(
|
|||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
} // namespace glslangtest
|
} // namespace glslangtest
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user