From 00e2bf1cd3e30cd6560222f620b7f66fa55c1549 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Wed, 16 Aug 2023 13:27:00 +0800 Subject: squash warnings (#3113) * Remove unused variables * Silence gcc out of bounds warnings * Squash strict-aliasing warnings It is still a naughty thing to be casting to T like this though * Correct equality check when val is nullptr --------- Co-authored-by: Yong He --- source/slang/slang-emit-spirv.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'source/slang/slang-emit-spirv.cpp') diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp index a3051fadb..10adb9708 100644 --- a/source/slang/slang-emit-spirv.cpp +++ b/source/slang/slang-emit-spirv.cpp @@ -2806,11 +2806,7 @@ struct SPIRVEmitContext SpvWord baseId = 0; // Only used in debug build, but we don't want a warning/error for an unused initialized variable - if (auto ptrLikeType = as(base->getDataType())) - { - baseId = getID(ensureInst(base)); - } - else if (auto ptrType = as(base->getDataType())) + if (as(base->getDataType()) || as(base->getDataType())) { baseId = getID(ensureInst(base)); } -- cgit v1.2.3