signed/unsigned fixes

Jörg Mayer jmayer at loplof.de
Thu Aug 9 18:24:17 CDT 2001


the attached patch fixes a few signed/unsigned warnings and some of the
"unsigned < 0 always true" warnings you get when compiling with -W.

  Ciao
     Jörg
-- 
Jörg Mayer <jmayer at loplof.de>
Signature fault, brain dumped
-------------- next part --------------
? wine/dlls/winmm/winealsa
Index: wine/configure
===================================================================
RCS file: /home/wine/wine/configure,v
retrieving revision 1.220
diff -u -u -r1.220 configure
--- wine/configure	2001/08/08 23:21:16	1.220
+++ wine/configure	2001/08/09 22:19:56
@@ -4948,7 +4948,7 @@
 
 if test "x${GCC}" = "xyes"
 then
-  CFLAGS="$CFLAGS -Wall"
+  CFLAGS="$CFLAGS -Wall -W"
   echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6
 echo "configure:4954: checking "for gcc strength-reduce bug"" >&5
 if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then
Index: wine/configure.in
===================================================================
RCS file: /home/wine/wine/configure.in,v
retrieving revision 1.220
diff -u -u -r1.220 configure.in
--- wine/configure.in	2001/08/08 23:21:17	1.220
+++ wine/configure.in	2001/08/09 22:19:57
@@ -554,7 +554,7 @@
 
 if test "x${GCC}" = "xyes"
 then
-  CFLAGS="$CFLAGS -Wall"
+  CFLAGS="$CFLAGS -Wall -W"
   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
                   AC_TRY_RUN([
 int	L[[4]] = {0,1,2,3};
Index: wine/dlls/comctl32/comboex.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/comboex.c,v
retrieving revision 1.35
diff -u -u -r1.35 comboex.c
--- wine/dlls/comctl32/comboex.c	2001/07/20 17:57:24	1.35
+++ wine/dlls/comctl32/comboex.c	2001/08/09 22:19:59
@@ -1440,7 +1440,7 @@
     TRACE("CtlType=%08x, CtlID=%08x, itemID=%08x, hwnd=%x, data=%08lx\n",
 	  dis->CtlType, dis->CtlID, dis->itemID, dis->hwndItem, dis->itemData);
 
-    if ((dis->itemID >= infoPtr->nb_items) || (dis->itemID < 0)) return FALSE;
+    if (dis->itemID >= infoPtr->nb_items) return FALSE;
 
     olditem = infoPtr->items;
     i = infoPtr->nb_items - 1;
Index: wine/dlls/ddraw/helper.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/helper.c,v
retrieving revision 1.13
diff -u -u -r1.13 helper.c
--- wine/dlls/ddraw/helper.c	2001/07/25 00:43:30	1.13
+++ wine/dlls/ddraw/helper.c	2001/08/09 22:20:00
@@ -45,7 +45,7 @@
 static void DDRAW_dump_flags(DWORD flags, const flag_info* names,
 			     size_t num_names)
 {
-    int	i;
+    unsigned int	i;
 
     for (i=0; i < num_names; i++)
 	if (names[i].val & flags)
@@ -57,9 +57,9 @@
 static void DDRAW_dump_members(DWORD flags, const void* data,
 			       const member_info* mems, size_t num_mems)
 {
-    int i;
+    unsigned int i;
 
-    for (i=0; i < sizeof(mems)/sizeof(mems[0]); i++)
+    for (i=0; i < num_mems; i++)
     {
 	if (mems[i].val & flags)
 	{
Index: wine/dlls/ddraw/main.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/main.c,v
retrieving revision 1.23
diff -u -u -r1.23 main.c
--- wine/dlls/ddraw/main.c	2001/06/20 23:03:14	1.23
+++ wine/dlls/ddraw/main.c	2001/08/09 22:20:00
@@ -399,7 +399,7 @@
  */
 DWORD WINAPI DDRAW_DllGetClassObject(REFCLSID rclsid,REFIID riid,LPVOID *ppv)
 {
-    int i;
+    unsigned int i;
     IClassFactoryImpl *factory;
 
     TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
Index: wine/dlls/ntdll/sync.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/sync.c,v
retrieving revision 1.16
diff -u -u -r1.16 sync.c
--- wine/dlls/ntdll/sync.c	2001/07/19 00:39:09	1.16
+++ wine/dlls/ntdll/sync.c	2001/08/09 22:20:01
@@ -33,7 +33,7 @@
     DWORD len = attr && attr->ObjectName ? attr->ObjectName->Length : 0;
     NTSTATUS ret;
 
-    if ((MaximumCount <= 0) || (InitialCount < 0) || (InitialCount > MaximumCount))
+    if ((MaximumCount <= 0) || (InitialCount > MaximumCount))
         return STATUS_INVALID_PARAMETER;
 
     SERVER_START_VAR_REQ( create_semaphore, len )
Index: wine/graphics/dispdib.c
===================================================================
RCS file: /home/wine/wine/graphics/dispdib.c,v
retrieving revision 1.11
diff -u -u -r1.11 dispdib.c
--- wine/graphics/dispdib.c	2000/12/01 23:58:30	1.11
+++ wine/graphics/dispdib.c	2001/08/09 22:20:02
@@ -56,7 +56,8 @@
 static void DISPDIB_Show(LPBITMAPINFOHEADER lpbi,LPSTR lpBits,WORD uFlags)
 {
     int Xofs,Yofs,Width=lpbi->biWidth,Height=lpbi->biHeight,Delta;
-    unsigned Pitch=(Width+3)&~3,sPitch,sWidth,sHeight;
+    int Pitch = (Width + 3) & ~3;
+    unsigned sPitch,sWidth,sHeight;
     LPSTR surf = DOSMEM_MapDosToLinear(0xa0000);
 
     if (VGA_GetMode(&sHeight,&sWidth,NULL)) return;
Index: wine/loader/ne/resource.c
===================================================================
RCS file: /home/wine/wine/loader/ne/resource.c,v
retrieving revision 1.28
diff -u -u -r1.28 resource.c
--- wine/loader/ne/resource.c	2001/07/02 19:59:48	1.28
+++ wine/loader/ne/resource.c	2001/08/09 22:20:03
@@ -207,7 +207,7 @@
         }
 	return handle;
     }
-    if (pModule && (fd = NE_OpenFile( pModule )) >= 0)
+    if (pModule && (fd = NE_OpenFile( pModule )) != INVALID_HANDLE_VALUE)
     {
 	HGLOBAL16 handle;
 	WORD sizeShift = *(WORD *)((char *)pModule + pModule->res_table);


More information about the wine-patches mailing list