[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2-demos] fix-compiler-warnings 5f152ce 2/4: * graph/win32/grwin
From: |
Werner Lemberg |
Subject: |
[freetype2-demos] fix-compiler-warnings 5f152ce 2/4: * graph/win32/grwin32.c: Fix compiler warnings |
Date: |
Mon, 24 May 2021 07:41:53 -0400 (EDT) |
branch: fix-compiler-warnings
commit 5f152cedb750c6be1712e4b9957a78591139adee
Author: David Turner <david@freetype.org>
Commit: David Turner <david@freetype.org>
* graph/win32/grwin32.c: Fix compiler warnings
- Redefine the LCS_sRGB macro to properly compile with the Mingw64
toolchain and the -Wmultichar warning enabled.
- Add missing return code paths in function.
---
graph/win32/grwin32.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/graph/win32/grwin32.c b/graph/win32/grwin32.c
index 799e4e3..2eafdd1 100644
--- a/graph/win32/grwin32.c
+++ b/graph/win32/grwin32.c
@@ -256,6 +256,13 @@ gr_win32_surface_set_icon( grWin32Surface* surface,
ICONINFO ici = { TRUE };
HICON hIcon;
+/* NOTE: The Mingw64 wingdi.h defines this macro as 'sRGB'
+ * which triggers the -Wmultichar warning during compilation,
+ * so replace it with the corresponding numerical value.
+ */
+#undef LCS_sRGB
+#define LCS_sRGB 0x73524742
+
BITMAPV4HEADER hdr = { sizeof( BITMAPV4HEADER ),
0, 0, 1, 32, BI_BITFIELDS, 0, 0, 0, 0, 0,
0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
@@ -297,6 +304,8 @@ gr_win32_surface_set_icon( grWin32Surface* surface,
case ICON_BIG:
surface->bIcon = hIcon;
return s[0];
+ default:
+ return 0; /* should not happen */
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2-demos] fix-compiler-warnings 5f152ce 2/4: * graph/win32/grwin32.c: Fix compiler warnings,
Werner Lemberg <=