From f5d9c28f03e4cd06560531d0dfcce158981d400f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 23 Nov 2015 19:05:52 -0800 Subject: [PATCH] Fixed clang warning. --- 3rdparty/freetype/freetype.h | 5 ++++- examples/common/nanovg/nanovg.cpp | 1 + src/renderer_d3d12.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/3rdparty/freetype/freetype.h b/3rdparty/freetype/freetype.h index cec419ac5..fb67c097b 100644 --- a/3rdparty/freetype/freetype.h +++ b/3rdparty/freetype/freetype.h @@ -1,6 +1,6 @@ #pragma once -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !defined(__clang__) # pragma warning(push) # pragma warning(disable: 4100) // DISABLE warning C4100: '' : unreferenced formal parameter # pragma warning(disable: 4146) // DISABLE warning C4146: unary minus operator applied to unsigned type, result still unsigned @@ -10,6 +10,9 @@ # pragma warning(disable: 4701) // DISABLE warning C4701: potentially uninitialized local variable '' used #elif defined(__GNUC__) # pragma GCC system_header +#elif defined(__clang__) +# pragma clang diagnostic ignored "-Wshift-negative-value" +# pragma clang diagnostic ignored "-Wuninitialized" #endif // defined(__GNUC__) /***************************************************************************/ diff --git a/examples/common/nanovg/nanovg.cpp b/examples/common/nanovg/nanovg.cpp index 2f0106dc4..0ea4fbb9f 100644 --- a/examples/common/nanovg/nanovg.cpp +++ b/examples/common/nanovg/nanovg.cpp @@ -37,6 +37,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); BX_PRAGMA_DIAGNOSTIC_PUSH(); BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wmissing-field-initializers"); BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wshadow"); +BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wint-to-pointer-cast") #define STB_IMAGE_IMPLEMENTATION #include BX_PRAGMA_DIAGNOSTIC_POP(); diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index 4af1030c6..3fd13f83d 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -4583,8 +4583,8 @@ data.NumQualityLevels = 0; box.bottom = blit.m_srcY + height;; box.back = blit.m_srcZ + bx::uint32_imax(1, depth); - D3D12_TEXTURE_COPY_LOCATION dstLocation = { dst.m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, { 0 } }; - D3D12_TEXTURE_COPY_LOCATION srcLocation = { src.m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, { 0 } }; + D3D12_TEXTURE_COPY_LOCATION dstLocation = { dst.m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, {{ 0 }} }; + D3D12_TEXTURE_COPY_LOCATION srcLocation = { src.m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, {{ 0 }} }; m_commandList->CopyTextureRegion(&dstLocation , blit.m_dstX , blit.m_dstY @@ -4612,8 +4612,8 @@ data.NumQualityLevels = 0; : 0 ; - D3D12_TEXTURE_COPY_LOCATION dstLocation = { dst.m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, { dstZ*dst.m_numMips+blit.m_dstMip } }; - D3D12_TEXTURE_COPY_LOCATION srcLocation = { src.m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, { srcZ*src.m_numMips+blit.m_srcMip } }; + D3D12_TEXTURE_COPY_LOCATION dstLocation = { dst.m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, {{ dstZ*dst.m_numMips+blit.m_dstMip }} }; + D3D12_TEXTURE_COPY_LOCATION srcLocation = { src.m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, {{ srcZ*src.m_numMips+blit.m_srcMip }} }; bool depthStencil = isDepth(TextureFormat::Enum(src.m_textureFormat) ); m_commandList->CopyTextureRegion(&dstLocation , blit.m_dstX