dlls/kernel32/local16.c (RESEND)
Gerald Pfeifer
gerald at pfeifer.com
Wed Nov 28 16:26:10 CST 2007
This addresses a warning I have seen in one of my GCC 4.3 based builds,
so it may be worth addressing before distros start switching for real.
(Feel free to discard the first hunk; I still included it for the sake
of completeness. ;-)
Gerald
---------- Forwarded message ----------
From: Gerald Pfeifer <gerald at pfeifer.com>
To: <wine-patches at winehq.org>
Date: Sat, 3 Nov 2007 14:36:44 +0100 (CET)
Subject: dlls/kernel32/local16.c
ChangeLog:
Handle default case in Local32_FromHandle(). Minor formatting tweak.
In Local32_ToHandle() directly above this function, the variables
passed by reference are initialized to NULL at the beginning of the
function. If you prefer I can prepare a patch along these lines instead.
Gerald
Index: dlls/kernel32/local16.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel32/local16.c,v
retrieving revision 1.3
diff -u -3 -p -r1.3 local16.c
--- dlls/kernel32/local16.c 4 Jun 2007 13:16:17 -0000 1.3
+++ dlls/kernel32/local16.c 3 Nov 2007 13:11:58 -0000
@@ -31,6 +31,7 @@
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
+#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "wine/winbase16.h"
@@ -1938,8 +1939,8 @@ static VOID Local32_FromHandle( LOCAL32H
WORD *selTable = (LPWORD)(header->base + header->selectorTableOffset);
DWORD offset = (LPBYTE)ptr - header->base;
*addr = MAKELONG( offset & 0x7fff, selTable[offset >> 15] );
+ break;
}
- break;
case -1: /* 32-bit offset */
case 2:
@@ -1949,6 +1950,10 @@ static VOID Local32_FromHandle( LOCAL32H
case 0: /* handle */
*addr = (LPBYTE)handle - (LPBYTE)header;
break;
+
+ default:
+ assert( 0 ); /* should never happen */
+ *addr = 0;
}
}
More information about the wine-patches
mailing list