From 664e0da8dff1d04860cc46ce8139cbd47e15c552 Mon Sep 17 00:00:00 2001 From: Yong He Date: Sat, 4 Nov 2017 15:37:40 -0400 Subject: fix all unreachable code warnings --- source/slang/type-layout.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source/slang/type-layout.cpp') 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()); } } -- cgit v1.2.3