Add extra break statements to quiet clang warnings.

Clang complains about code that falls through into an empty default
case, so add some breaks to placate it.
This commit is contained in:
Arcady Goldmints-Orlov 2024-02-19 18:45:25 -05:00 committed by arcady-lunarg
parent 606209e07d
commit 7ffa289495
6 changed files with 8 additions and 0 deletions

View File

@ -1165,6 +1165,7 @@ spv::ImageFormat TGlslangToSpvTraverser::TranslateImageFormat(const glslang::TTy
case glslang::ElfR64i:
builder.addExtension(spv::E_SPV_EXT_shader_image_int64);
builder.addCapability(spv::CapabilityInt64ImageEXT);
break;
default:
break;
}

View File

@ -391,6 +391,7 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList)
case EvqOut:
case EvqInOut:
parseContext.error(token.loc, "in/out qualifiers are only valid on parameters", token.string->c_str(), "");
break;
default:
break;
}

View File

@ -376,6 +376,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child,
case EOpNegative:
if (child->getType().getBasicType() == EbtStruct || child->getType().isArray())
return nullptr;
break;
default: break; // some compilers want this
}
@ -3490,6 +3491,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node)
// check for non-Boolean operands
if (left->getBasicType() == EbtBool || right->getBasicType() == EbtBool)
return false;
break;
default:
break;
@ -3540,6 +3542,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node)
// At least the basic type has to match
if (left->getBasicType() != right->getBasicType())
return false;
break;
default:
break;

View File

@ -257,6 +257,7 @@ void TParseContextBase::rValueErrorCheck(const TSourceLoc& loc, const char* op,
case EOpVectorSwizzle:
case EOpMatrixSwizzle:
rValueErrorCheck(loc, op, binaryNode->getLeft());
break;
default:
break;
}

View File

@ -633,6 +633,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
infoSink.info.message(EPrefixError, "#version: mesh/task shaders require es profile with version 320 or above, or non-es profile with version 450 or above");
version = profile == EEsProfile ? 320 : 450;
}
break;
default:
break;
}

View File

@ -149,6 +149,7 @@ void TType::buildMangledName(TString& mangledName) const
mangledName += '-';
(*structure)[i].type->buildMangledName(mangledName);
}
break;
default:
break;
}