diff options
| author | Yong He <yonghe@outlook.com> | 2017-11-04 15:37:40 -0400 |
|---|---|---|
| committer | Yong He <yonghe@outlook.com> | 2017-11-04 15:37:40 -0400 |
| commit | 664e0da8dff1d04860cc46ce8139cbd47e15c552 (patch) | |
| tree | f5d023e6799d5265d91db2368896c6ad3b51ea4c /source/slang/type-layout.cpp | |
| parent | 8fe947b2fbbdaa747fb7acc7624d9290bba52086 (diff) | |
fix all unreachable code warnings
Diffstat (limited to 'source/slang/type-layout.cpp')
| -rw-r--r-- | source/slang/type-layout.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source/slang/type-layout.cpp b/source/slang/type-layout.cpp index 0825da6b4..bfdc6c366 100644 --- a/source/slang/type-layout.cpp +++ b/source/slang/type-layout.cpp @@ -51,7 +51,7 @@ struct DefaultLayoutRulesImpl : SimpleLayoutRulesImpl default: SLANG_UNEXPECTED("uhandled scalar type"); - return SimpleLayoutInfo( LayoutResourceKind::Uniform, 0, 1 ); + UNREACHABLE_RETURN(SimpleLayoutInfo( LayoutResourceKind::Uniform, 0, 1 )); } } @@ -76,7 +76,7 @@ struct DefaultLayoutRulesImpl : SimpleLayoutRulesImpl default: SLANG_UNEXPECTED("unhandled scalar type"); - return SimpleLayoutInfo(); + UNREACHABLE_RETURN(SimpleLayoutInfo()); } } @@ -364,8 +364,6 @@ struct GLSLPushConstantBufferObjectLayoutRulesImpl : GLSLObjectLayoutRulesImpl // Special-case the layout for a constant-buffer, because we don't // want it to allocate a descriptor-table slot return SimpleLayoutInfo(LayoutResourceKind::PushConstantBuffer, 1); - - return GLSLObjectLayoutRulesImpl::GetObjectLayout(kind); } }; GLSLPushConstantBufferObjectLayoutRulesImpl kGLSLPushConstantBufferObjectLayoutRulesImpl_; @@ -401,7 +399,7 @@ struct HLSLObjectLayoutRulesImpl : ObjectLayoutRulesImpl // TODO: how to handle these? default: SLANG_UNEXPECTED("unhandled shader parameter kind"); - return SimpleLayoutInfo(); + UNREACHABLE_RETURN(SimpleLayoutInfo()); } } }; @@ -717,7 +715,7 @@ static SimpleLayoutInfo getParameterBlockLayoutInfo( else { SLANG_UNEXPECTED("unhandled parameter block type"); - return SimpleLayoutInfo(); + UNREACHABLE_RETURN(SimpleLayoutInfo()); } } |
