Commit 992bf9d4 by Antonio Maiorano

Fix unary minus warnings

No longer disable wd4146, fix warnings, and disable this warning when including LLVM headers in LLVMReactor.cpp, as it trips for specific headers like MathExtras.h, StringExtras.h. Fixes ANGLE roll. Bug: angleproject:4034 Change-Id: I102f4c18ac47c2db8abddf1b4ceace7987e6df57 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/37488 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com> Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
parent 23f9c25f
...@@ -323,7 +323,6 @@ if(MSVC) ...@@ -323,7 +323,6 @@ if(MSVC)
"/wd4018" # 'expression' : signed/unsigned mismatch "/wd4018" # 'expression' : signed/unsigned mismatch
"/wd4065" # switch statement contains 'default' but no 'case' labels "/wd4065" # switch statement contains 'default' but no 'case' labels
"/wd4141" # 'modifier' : used more than once "/wd4141" # 'modifier' : used more than once
"/wd4146" # unary minus operator applied to unsigned type, result still unsigned
"/wd4244" # 'conversion' conversion from 'type1' to 'type2', possible loss of data "/wd4244" # 'conversion' conversion from 'type1' to 'type2', possible loss of data
"/wd4267" # 'var' : conversion from 'size_t' to 'type', possible loss of data "/wd4267" # 'var' : conversion from 'size_t' to 'type', possible loss of data
"/wd4291" # 'void X new(size_t,unsigned int,unsigned int)': no matching operator delete found; memory will not be freed if initialization throws an exception "/wd4291" # 'void X new(size_t,unsigned int,unsigned int)': no matching operator delete found; memory will not be freed if initialization throws an exception
...@@ -1559,6 +1558,7 @@ if(${REACTOR_BACKEND} STREQUAL "Subzero") ...@@ -1559,6 +1558,7 @@ if(${REACTOR_BACKEND} STREQUAL "Subzero")
if(WIN32) if(WIN32)
list(APPEND SUBZERO_COMPILE_OPTIONS list(APPEND SUBZERO_COMPILE_OPTIONS
"/wd4146" # unary minus operator applied to unsigned type, result still unsigned
"/wd4334" # ''operator' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) "/wd4334" # ''operator' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
"/wd4996" # The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: new_name. "/wd4996" # The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: new_name.
) )
......
...@@ -33,6 +33,11 @@ ...@@ -33,6 +33,11 @@
#pragma clang diagnostic ignored "-Wextra-semi" #pragma clang diagnostic ignored "-Wextra-semi"
#endif // defined(__clang__) #endif // defined(__clang__)
#ifdef _MSC_VER
__pragma(warning(push))
__pragma(warning(disable : 4146)) // unary minus operator applied to unsigned type, result still unsigned
#endif
#include "llvm/Analysis/LoopPass.h" #include "llvm/Analysis/LoopPass.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/JITSymbol.h" #include "llvm/ExecutionEngine/JITSymbol.h"
...@@ -67,6 +72,10 @@ ...@@ -67,6 +72,10 @@
#pragma clang diagnostic pop #pragma clang diagnostic pop
#endif // defined(__clang__) #endif // defined(__clang__)
#ifdef _MSC_VER
__pragma(warning(pop))
#endif
#define ARGS(...) {__VA_ARGS__} #define ARGS(...) {__VA_ARGS__}
#define CreateCall2 CreateCall #define CreateCall2 CreateCall
#define CreateCall3 CreateCall #define CreateCall3 CreateCall
......
...@@ -131,7 +131,7 @@ void Win32SurfaceKHR::lazyCreateFrameBuffer() ...@@ -131,7 +131,7 @@ void Win32SurfaceKHR::lazyCreateFrameBuffer()
bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFO); bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFO);
bitmapInfo.bmiHeader.biBitCount = 32; bitmapInfo.bmiHeader.biBitCount = 32;
bitmapInfo.bmiHeader.biPlanes = 1; bitmapInfo.bmiHeader.biPlanes = 1;
bitmapInfo.bmiHeader.biHeight = -windowExtent.height; bitmapInfo.bmiHeader.biHeight = -static_cast<LONG>(windowExtent.height); // Negative for top-down DIB, origin in upper-left corner
bitmapInfo.bmiHeader.biWidth = windowExtent.width; bitmapInfo.bmiHeader.biWidth = windowExtent.width;
bitmapInfo.bmiHeader.biCompression = BI_RGB; bitmapInfo.bmiHeader.biCompression = BI_RGB;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment