diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2023-04-03 11:47:10 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-02 20:47:10 -0700 |
| commit | 7a346b2982c69ef97ebc4b308c77a1f1c88c548f (patch) | |
| tree | e58d3a68b4640138bd57e4209aee0c92d4f5fcf4 | |
| parent | 271ae7165915cf9910e2de0224159ea0fdd8ce72 (diff) | |
Squash some warnings (#2765)
Co-authored-by: Yong He <yonghe@outlook.com>
| -rw-r--r-- | premake5.lua | 2 | ||||
| -rw-r--r-- | source/compiler-core/slang-json-source-map-util.cpp | 4 | ||||
| -rw-r--r-- | tools/gfx/cuda/cuda-command-queue.cpp | 2 | ||||
| -rw-r--r-- | tools/slang-reflection-test/slang-reflection-test-main.cpp | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/premake5.lua b/premake5.lua index 7635e1df1..8475a316d 100644 --- a/premake5.lua +++ b/premake5.lua @@ -354,7 +354,7 @@ workspace "slang" -- Warnings buildoptions { "-Wno-unused-but-set-variable", "-Wno-unused-parameter", "-Wno-type-limits", "-Wno-sign-compare", "-Wno-unused-variable", "-Wno-switch", "-Wno-return-type", "-Wno-unused-local-typedefs", "-Wno-parentheses" } filter { "toolset:clang or gcc*", "language:C++" } - buildoptions { "-Wno-reorder", "-Wno-class-memaccess"} + buildoptions { "-Wno-reorder", "-Wno-class-memaccess", "-Wno-invalid-offsetof" } filter { "toolset:gcc*" } buildoptions { "-Wno-implicit-fallthrough", "-Wno-maybe-uninitialized" } diff --git a/source/compiler-core/slang-json-source-map-util.cpp b/source/compiler-core/slang-json-source-map-util.cpp index 5782b0e89..a5a454bd5 100644 --- a/source/compiler-core/slang-json-source-map-util.cpp +++ b/source/compiler-core/slang-json-source-map-util.cpp @@ -75,7 +75,7 @@ static const StructRttiInfo _makeJSONSourceMap_Rtti() /* static */const StructRttiInfo JSONSourceMap::g_rttiInfo = _makeJSONSourceMap_Rtti(); // Encode a 6 bit value to VLQ encoding -static const char g_vlqEncodeTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +static const unsigned char g_vlqEncodeTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; struct VlqDecodeTable { @@ -88,7 +88,7 @@ struct VlqDecodeTable } } /// Returns a *negative* value if invalid - SLANG_FORCE_INLINE int8_t operator[](char c) const { return (c & ~char(0x7f)) ? -1 : map[c]; } + SLANG_FORCE_INLINE int8_t operator[](unsigned char c) const { return (c & ~char(0x7f)) ? -1 : map[c]; } int8_t map[128]; }; diff --git a/tools/gfx/cuda/cuda-command-queue.cpp b/tools/gfx/cuda/cuda-command-queue.cpp index 60e81246d..0c17a418e 100644 --- a/tools/gfx/cuda/cuda-command-queue.cpp +++ b/tools/gfx/cuda/cuda-command-queue.cpp @@ -50,7 +50,7 @@ SLANG_NO_THROW void SLANG_MCALL CommandQueueImpl::executeCommandBuffers( SLANG_NO_THROW void SLANG_MCALL CommandQueueImpl::waitOnHost() { auto resultCode = cuStreamSynchronize(stream); - if (resultCode != cudaSuccess) + if (resultCode != CUDA_SUCCESS) SLANG_CUDA_HANDLE_ERROR(resultCode); } diff --git a/tools/slang-reflection-test/slang-reflection-test-main.cpp b/tools/slang-reflection-test/slang-reflection-test-main.cpp index 2aabf9ca2..415231177 100644 --- a/tools/slang-reflection-test/slang-reflection-test-main.cpp +++ b/tools/slang-reflection-test/slang-reflection-test-main.cpp @@ -138,7 +138,7 @@ static void write(PrettyWriter& writer, uint64_t val) static void write(PrettyWriter& writer, int64_t val) { adjust(writer); - Slang::StdWriters::getOut().print("%ll", (long long)val); + Slang::StdWriters::getOut().print("%lld", (long long)val); } static void write(PrettyWriter& writer, int32_t val) @@ -501,7 +501,7 @@ static void emitReflectionScalarTypeInfoJSON( write(writer, "unknown"); assert(!"unhandled case"); break; -#define CASE(TAG, ID) case slang::TypeReflection::ScalarType::TAG: write(writer, #ID); break +#define CASE(TAG, ID) case static_cast<SlangScalarType>(slang::TypeReflection::ScalarType::TAG): write(writer, #ID); break CASE(Void, void); CASE(Bool, bool); |
