Use [[fallthrough]] attribute instead of comments.
Now that we require C++17, the [[fallthrough]] attribute is available as an alternative to load-bearing comments.
This commit is contained in:
parent
8ca24e7cf1
commit
606209e07d
9 changed files with 22 additions and 21 deletions
|
|
@ -402,7 +402,7 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char*
|
|||
case EOpLeftShiftAssign:
|
||||
case EOpRightShiftAssign:
|
||||
isModifyOp = true;
|
||||
// fall through...
|
||||
[[fallthrough]];
|
||||
case EOpAssign:
|
||||
{
|
||||
// Since this is an lvalue, we'll convert an image load to a sequence like this
|
||||
|
|
@ -4507,13 +4507,13 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
|
|||
int cmpValues = 0; // 1 if there is a compare value (handier than a bool below)
|
||||
|
||||
switch (op) {
|
||||
case EOpMethodGatherCmpRed: cmpValues = 1; // fall through
|
||||
case EOpMethodGatherCmpRed: cmpValues = 1; [[fallthrough]];
|
||||
case EOpMethodGatherRed: channel = 0; break;
|
||||
case EOpMethodGatherCmpGreen: cmpValues = 1; // fall through
|
||||
case EOpMethodGatherCmpGreen: cmpValues = 1; [[fallthrough]];
|
||||
case EOpMethodGatherGreen: channel = 1; break;
|
||||
case EOpMethodGatherCmpBlue: cmpValues = 1; // fall through
|
||||
case EOpMethodGatherCmpBlue: cmpValues = 1; [[fallthrough]];
|
||||
case EOpMethodGatherBlue: channel = 2; break;
|
||||
case EOpMethodGatherCmpAlpha: cmpValues = 1; // fall through
|
||||
case EOpMethodGatherCmpAlpha: cmpValues = 1; [[fallthrough]];
|
||||
case EOpMethodGatherAlpha: channel = 3; break;
|
||||
default: assert(0); break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue