From 06f8f9a891194d86ff93a5856f80510d39b75272 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 4 Dec 2023 19:57:21 -0800
Subject: [PATCH] Fixed warning C6326: Potential comparison of a constant with
another constant.
Also fixed warning C6239: (<non-zero constant> && <expression>) always evaluates to the result of <expression>. Did you intend to use the bitwise-and operator?
---
src/video/yuv2rgb/yuv_rgb_std_func.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/video/yuv2rgb/yuv_rgb_std_func.h b/src/video/yuv2rgb/yuv_rgb_std_func.h
index 94872ec9f56c..17b61db751e2 100644
--- a/src/video/yuv2rgb/yuv_rgb_std_func.h
+++ b/src/video/yuv2rgb/yuv_rgb_std_func.h
@@ -69,6 +69,12 @@
#endif
+#ifdef _MSC_VER /* Visual Studio analyzer can't tell that we're building this with different constants */
+#pragma warning(push)
+#pragma warning(disable : 6239)
+#pragma warning(disable : 6326)
+#endif
+
void STD_FUNCTION_NAME(
uint32_t width, uint32_t height,
const uint8_t *Y, const uint8_t *U, const uint8_t *V, uint32_t Y_stride, uint32_t UV_stride,
@@ -227,6 +233,10 @@ void STD_FUNCTION_NAME(
#undef uv_y_sample_interval
}
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
#undef STD_FUNCTION_NAME
#undef YUV_FORMAT
#undef RGB_FORMAT