From 27243ce07880f65f9abb15e38f7176eea9572aac Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Sat, 18 Nov 2023 02:50:40 +0800 Subject: warnings (#3335) * ignores * Remove unused variables * Squash out of bounds warning --------- Co-authored-by: Yong He --- .gitignore | 1 + source/slang/slang-language-server.cpp | 2 +- source/slang/slang-lower-to-ir.cpp | 4 +--- tools/gfx/d3d12/d3d12-device.cpp | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index a194be87e..12a1e8e64 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ *.ini .clang-format .gdb_history +.vimspector bin/ intermediate/ diff --git a/source/slang/slang-language-server.cpp b/source/slang/slang-language-server.cpp index e550b23d2..24ab534ab 100644 --- a/source/slang/slang-language-server.cpp +++ b/source/slang/slang-language-server.cpp @@ -654,7 +654,7 @@ SlangResult LanguageServer::hover( { if (auto declRefExpr = as(expr)) return fillDeclRefHoverInfo(declRefExpr->declRef); - else if (auto thisExpr = as(expr)) + else if (as(expr)) { if (expr->type) { diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index cd9d19bcc..e44419a45 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -8038,8 +8038,6 @@ struct DeclLoweringVisitor : DeclVisitor // Not clear what to do around HLSLExportModifier. // The HLSL spec says it only applies to functions, so we ignore for now. - const bool isPublicType = decl->findModifier() != nullptr; - // We are going to create nested IR building state // to use when emitting the members of the type. // @@ -9761,7 +9759,7 @@ LoweredValInfo emitDeclRef( SLANG_UNUSED(initialSubst); - if (auto thisTypeDecl = as(decl)) + if (as(decl)) { // A declref to ThisType decl should be lowered differently // from other decls. In general, IFoo.ThisType should lower to diff --git a/tools/gfx/d3d12/d3d12-device.cpp b/tools/gfx/d3d12/d3d12-device.cpp index 44a9faa45..cd4dfb7a3 100644 --- a/tools/gfx/d3d12/d3d12-device.cpp +++ b/tools/gfx/d3d12/d3d12-device.cpp @@ -1899,6 +1899,7 @@ Result DeviceImpl::createInputLayout(IInputLayout::Desc const& desc, IInputLayou char* textPos = layout->m_text.getBuffer(); List& elements = layout->m_elements; + SLANG_ASSERT(inputElementCount > 0); elements.setCount(inputElementCount); for (Int i = 0; i < inputElementCount; ++i) -- cgit v1.2.3