kernel: Wsign-compare warning fix by casting the result of a substration of pointers to an unsigned.

Michael Stefaniuc mstefani at redhat.de
Thu Jul 27 17:00:06 CDT 2006


Changing talloced to a signed integer isn't an option because it is
compared also to a DWORD parameter of FormatMessage() (an official Win32
function). Also the casts aren't that ugly as they are hidden inside a
macro.
This small patch fixes 27 -Wsign-compare warnings.

bye
	michael
	
---
 dlls/kernel/format_msg.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/kernel/format_msg.c b/dlls/kernel/format_msg.c
index 26ffcec..ecca98b 100644
--- a/dlls/kernel/format_msg.c
+++ b/dlls/kernel/format_msg.c
@@ -181,7 +181,7 @@ #if defined(__i386__) || defined(__sparc
 
 #define ADD_TO_T(c) do { \
         *t++=c;\
-        if (t-target == talloced) {\
+        if ((DWORD)(t-target) == talloced) {\
             target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2);\
             t = target+talloced;\
             talloced*=2;\
@@ -395,7 +395,7 @@ #if defined(__i386__) || defined(__sparc
 
 #define ADD_TO_T(c)  do {\
     *t++=c;\
-    if (t-target == talloced) {\
+    if ((DWORD)(t-target) == talloced) {\
         target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2*sizeof(WCHAR));\
         t = target+talloced;\
         talloced*=2;\
-- 
1.4.0


-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
Sr. Network Engineer            Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani at redhat.com
Hauptstaetterstr. 58            http://www.redhat.de/
D-70178 Stuttgart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20060728/d19041f7/attachment.pgp


More information about the wine-patches mailing list