Best to avoid 'sizeof type'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If this patch conflicts with other patches, just apply the other patches
and I'll just resubmit it.

Changelog:

 * dlls/advapi32/registry.c,
   dlls/advapi32/service.c,
   dlls/comcat/information.c,
   dlls/comcat/regsvr.c,
   dlls/comctl32/comctl32undoc.c,
   dlls/comctl32/propsheet.c,
   dlls/comctl32/tooltips.c,
   dlls/ddraw/ddraw/thunks.c,
   dlls/kernel/sync.c,
   dlls/kernel/tests/format_msg.c,
   dlls/netapi32/netapi32.c,
   dlls/ntdll/file.c,
   dlls/ole32/regsvr.c,
   dlls/ole32/storage32.c,
   dlls/oleaut32/parsedt.c,
   dlls/serialui/confdlg.c,
   dlls/setupapi/devinst.c,
   dlls/shell32/shelllink.c,
   dlls/shell32/shellord.c,
   dlls/user/comm16.c,
   dlls/user/tests/class.c,
   dlls/wininet/internet.c,
   dlls/winmm/lolvldrv.c,
   dlls/winsock/socket.c,
   dlls/winspool/info.c,
   files/smb.c,
   graphics/x11drv/xfont.c,
   programs/uninstaller/main.c,
   programs/winemenubuilder/winemenubuilder.c,
   scheduler/client.c,
   server/named_pipe.c,
   server/registry.c,
   server/request.c

   'sizeof type' is best avoided as it won't always compile (e.g. 'int
main() {return sizeof int;}'). Use 'sizeof(type)' instead.


Index: dlls/advapi32/registry.c
===================================================================
RCS file: /home/wine/wine/dlls/advapi32/registry.c,v
retrieving revision 1.52
diff -u -r1.52 registry.c
--- dlls/advapi32/registry.c	18 Mar 2003 18:35:50 -0000	1.52
+++ dlls/advapi32/registry.c	3 Jun 2003 03:03:57 -0000
@@ -797,7 +797,7 @@
         {
             WCHAR name[MAX_PATH];

-            while(!RegEnumKeyW(tmp, 0, name, sizeof name))
+            while(!RegEnumKeyW(tmp, 0, name, sizeof(name)))
             {
                 if(RegDeleteKeyW(tmp, name))  /* recurse */
                     break;
@@ -831,7 +831,7 @@
         {
             CHAR name[MAX_PATH];

-            while(!RegEnumKeyA(tmp, 0, name, sizeof name))
+            while(!RegEnumKeyA(tmp, 0, name, sizeof(name)))
             {
                 if(RegDeleteKeyA(tmp, name))  /* recurse */
                     break;
Index: dlls/advapi32/service.c
===================================================================
RCS file: /home/wine/wine/dlls/advapi32/service.c,v
retrieving revision 1.36
diff -u -r1.36 service.c
--- dlls/advapi32/service.c	24 Jan 2003 00:45:51 -0000	1.36
+++ dlls/advapi32/service.c	3 Jun 2003 03:03:57 -0000
@@ -624,11 +624,11 @@
     TRACE("(%p,%ld,%p)\n",hService,dwNumServiceArgs,
           lpServiceArgVectors);

-    size = sizeof str;
+    size = sizeof(str);
     r = RegQueryValueExW(hService, _ImagePathW, NULL, &type, (LPVOID)str, &size);
     if (r!=ERROR_SUCCESS)
         return FALSE;
-    ExpandEnvironmentStringsW(str,path,sizeof path);
+    ExpandEnvironmentStringsW(str,path,sizeof(path));

     TRACE("Starting service %s\n", debugstr_w(path) );

@@ -718,7 +718,7 @@
     FIXME("(%p,%p) partial\n",hService,lpservicestatus);

     /* read the service type from the registry */
-    size = sizeof val;
+    size = sizeof(val);
     r = RegQueryValueExA(hService, "Type", NULL, &type, (LPBYTE)&val, &size);
     if(type!=REG_DWORD)
     {
Index: dlls/comcat/information.c
===================================================================
RCS file: /home/wine/wine/dlls/comcat/information.c,v
retrieving revision 1.8
diff -u -r1.8 information.c
--- dlls/comcat/information.c	10 Apr 2003 18:17:36 -0000	1.8
+++ dlls/comcat/information.c	3 Jun 2003 03:03:58 -0000
@@ -955,7 +955,7 @@
 	WCHAR prefix[6] = { 'C', 'L', 'S', 'I', 'D', '\\' };

 	This->lpVtbl = &COMCAT_CATID_IEnumGUID_Vtbl;
-	memcpy(This->keyname, prefix, sizeof prefix);
+	memcpy(This->keyname, prefix, sizeof(prefix));
 	StringFromGUID2(rclsid, This->keyname + 6, 39);
 	lstrcpyW(This->keyname + 44, postfix);
 	RegOpenKeyExW(HKEY_CLASSES_ROOT, This->keyname, 0, KEY_READ, &This->key);
Index: dlls/comcat/regsvr.c
===================================================================
RCS file: /home/wine/wine/dlls/comcat/regsvr.c,v
retrieving revision 1.2
diff -u -r1.2 regsvr.c
--- dlls/comcat/regsvr.c	11 Jan 2003 21:05:15 -0000	1.2
+++ dlls/comcat/regsvr.c	3 Jun 2003 03:03:58 -0000
@@ -370,7 +370,7 @@
     HKEY subkey;

     for (;;) {
-	cName = sizeof subkey_name / sizeof(WCHAR);
+	cName = sizeof(subkey_name) / sizeof(WCHAR);
 	res = RegEnumKeyExW(key, 0, subkey_name, &cName,
 			    NULL, NULL, NULL, NULL);
 	if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) {
Index: dlls/comctl32/comctl32undoc.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/comctl32undoc.c,v
retrieving revision 1.79
diff -u -r1.79 comctl32undoc.c
--- dlls/comctl32/comctl32undoc.c	15 May 2003 23:55:12 -0000	1.79
+++ dlls/comctl32/comctl32undoc.c	3 Jun 2003 03:03:59 -0000
@@ -2081,7 +2081,7 @@
         if(pfnCompare(lpPtrs[l],lpPtrs[m+1],lParam)>0)
         {
             t = lpPtrs[m+1];
-            memmove(&lpPtrs[l+1],&lpPtrs[l],(m-l+1)*sizeof lpPtrs[l]);
+            memmove(&lpPtrs[l+1],&lpPtrs[l],(m-l+1)*sizeof(lpPtrs[l]));
             lpPtrs[l] = t;

             m++;
Index: dlls/comctl32/propsheet.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/propsheet.c,v
retrieving revision 1.83
diff -u -r1.83 propsheet.c
--- dlls/comctl32/propsheet.c	7 Mar 2003 20:29:58 -0000	1.83
+++ dlls/comctl32/propsheet.c	3 Jun 2003 03:04:00 -0000
@@ -503,7 +503,7 @@

     if ( !HIWORD( lppsp->pszTitle ) )
     {
-      if (!LoadStringW( lppsp->hInstance, (UINT)lppsp->pszTitle,szTitle,sizeof szTitle ))
+      if (!LoadStringW( lppsp->hInstance, (UINT)lppsp->pszTitle,szTitle,sizeof(szTitle) ))
       {
         pTitle = pszNull;
 	FIXME("Could not load resource #%04x?\n",LOWORD(lppsp->pszTitle));
@@ -1995,7 +1995,7 @@
   {
      WCHAR szTitle[256];
      MultiByteToWideChar(CP_ACP, 0, lpszText, -1,
-			     szTitle, sizeof szTitle);
+			     szTitle, sizeof(szTitle));
      PROPSHEET_SetTitleW(hwndDlg, dwStyle, szTitle);
   }
   else
Index: dlls/comctl32/tooltips.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/tooltips.c,v
retrieving revision 1.54
diff -u -r1.54 tooltips.c
--- dlls/comctl32/tooltips.c	8 Jan 2003 21:09:27 -0000	1.54
+++ dlls/comctl32/tooltips.c	3 Jun 2003 03:04:00 -0000
@@ -2091,7 +2091,7 @@
     TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd);
     LOGFONTW lf;

-    if(!GetObjectW((HFONT)wParam, sizeof lf, &lf))
+    if(!GetObjectW((HFONT)wParam, sizeof(lf), &lf))
         return 0;

     if(infoPtr->hFont) DeleteObject (infoPtr->hFont);
Index: dlls/ddraw/ddraw/thunks.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/ddraw/thunks.c,v
retrieving revision 1.11
diff -u -r1.11 thunks.c
--- dlls/ddraw/ddraw/thunks.c	13 Jan 2003 18:30:47 -0000	1.11
+++ dlls/ddraw/ddraw/thunks.c	3 Jun 2003 03:04:01 -0000
@@ -329,8 +329,8 @@
     DDSURFACEDESC DDSD;
     struct displaymodescallback_context *cbcontext = context;

-    memcpy(&DDSD,pDDSD2,sizeof DDSD);
-    DDSD.dwSize = sizeof DDSD;
+    memcpy(&DDSD,pDDSD2,sizeof(DDSD));
+    DDSD.dwSize = sizeof(DDSD);

     return cbcontext->func(&DDSD, cbcontext->context);
 }
Index: dlls/kernel/sync.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/sync.c,v
retrieving revision 1.32
diff -u -r1.32 sync.c
--- dlls/kernel/sync.c	20 May 2003 04:32:53 -0000	1.32
+++ dlls/kernel/sync.c	3 Jun 2003 03:04:04 -0000
@@ -848,7 +848,7 @@

     TRACE("%s 0x%08lx\n",debugstr_w(name),nTimeOut);

-    memset(&ov,0,sizeof ov);
+    memset(&ov,0,sizeof(ov));
     ov.hEvent = CreateEventA( NULL, 0, 0, NULL );
     if (!ov.hEvent)
         return FALSE;
@@ -913,7 +913,7 @@
     if(overlapped)
         return SYNC_ConnectNamedPipe(hPipe,overlapped);

-    memset(&ov,0,sizeof ov);
+    memset(&ov,0,sizeof(ov));
     ov.hEvent = CreateEventA(NULL,0,0,NULL);
     if (!ov.hEvent)
         return FALSE;
Index: dlls/kernel/tests/format_msg.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/format_msg.c,v
retrieving revision 1.3
diff -u -r1.3 format_msg.c
--- dlls/kernel/tests/format_msg.c	19 Dec 2002 21:12:48 -0000	1.3
+++ dlls/kernel/tests/format_msg.c	3 Jun 2003 03:04:05 -0000
@@ -43,176 +43,176 @@

     /* the basics */
     r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "test", 0,
-        0, out, sizeof out/sizeof (CHAR),NULL);
+        0, out, sizeof(out)/sizeof(CHAR),NULL);
     ok(!strcmp("test", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* using the format feature */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!s!", 0,
-        0, out, sizeof out/sizeof (CHAR), "test");
+        0, out, sizeof(out)/sizeof(CHAR), "test");
     ok(!strcmp("test", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* no format */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "%1", 0,
-        0, out, sizeof out/sizeof (CHAR), "test");
+        0, out, sizeof(out)/sizeof(CHAR), "test");
     ok(!strcmp("test", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* two pieces */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "%1%2", 0,
-        0, out, sizeof out/sizeof (CHAR), "te","st");
+        0, out, sizeof(out)/sizeof(CHAR), "te","st");
     ok(!strcmp("test", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* three pieces */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "%1%3%2%1", 0,
-        0, out, sizeof out/sizeof (CHAR), "t","s","e");
+        0, out, sizeof(out)/sizeof(CHAR), "t","s","e");
     ok(!strcmp("test", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* s doesn't seem to work in format strings */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "%!s!", 0,
-        0, out, sizeof out/sizeof (CHAR), "test");
+        0, out, sizeof(out)/sizeof(CHAR), "test");
     ok(!strcmp("!s!", out),"failed out=[%s]",out);
     ok(r==3,"failed: r=%ld",r);

     /* S is unicode */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!S!", 0,
-        0, out, sizeof out/sizeof (CHAR), szwTest);
+        0, out, sizeof(out)/sizeof(CHAR), szwTest);
     ok(!strcmp("test", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* as characters */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!c!%2!c!%3!c!%1!c!", 0,
-        0, out, sizeof out/sizeof (CHAR), 't','e','s');
+        0, out, sizeof(out)/sizeof(CHAR), 't','e','s');
     ok(!strcmp("test", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* some numbers */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!d!%2!d!%3!d!", 0,
-        0, out, sizeof out/sizeof (CHAR), 1,2,3);
+        0, out, sizeof(out)/sizeof(CHAR), 1,2,3);
     ok(!strcmp("123", out),"failed out=[%s]",out);
     ok(r==3,"failed: r=%ld",r);

     /* a single digit with some spacing */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!4d!", 0,
-        0, out, sizeof out/sizeof (CHAR), 1);
+        0, out, sizeof(out)/sizeof(CHAR), 1);
     ok(!strcmp("   1", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* a single digit, left justified */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!-4d!", 0,
-        0, out, sizeof out/sizeof (CHAR), 1);
+        0, out, sizeof(out)/sizeof(CHAR), 1);
     ok(!strcmp("1   ", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* two digit decimal number */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!4d!", 0,
-        0, out, sizeof out/sizeof (CHAR), 11);
+        0, out, sizeof(out)/sizeof(CHAR), 11);
     ok(!strcmp("  11", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* a hex number */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!4x!", 0,
-        0, out, sizeof out/sizeof (CHAR), 11);
+        0, out, sizeof(out)/sizeof(CHAR), 11);
     ok(!strcmp("   b", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* a hex number, upper case */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!4X!", 0,
-        0, out, sizeof out/sizeof (CHAR), 11);
+        0, out, sizeof(out)/sizeof(CHAR), 11);
     ok(!strcmp("   B", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* a hex number, upper case, left justified */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!-4X!", 0,
-        0, out, sizeof out/sizeof (CHAR), 11);
+        0, out, sizeof(out)/sizeof(CHAR), 11);
     ok(!strcmp("B   ", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* a long hex number, upper case */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!4X!", 0,
-        0, out, sizeof out/sizeof (CHAR), 0x1ab);
+        0, out, sizeof(out)/sizeof(CHAR), 0x1ab);
     ok(!strcmp(" 1AB", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* two percent... */
     r = doit(FORMAT_MESSAGE_FROM_STRING, " %%%% ", 0,
-        0, out, sizeof out/sizeof (CHAR));
+        0, out, sizeof(out)/sizeof(CHAR));
     ok(!strcmp(" %% ", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* periods are special cases */
     r = doit(FORMAT_MESSAGE_FROM_STRING, " %.%. %1!d!", 0,
-        0, out, sizeof out/sizeof (CHAR), 0x1ab);
+        0, out, sizeof(out)/sizeof(CHAR), 0x1ab);
     ok(!strcmp(" .. 427", out),"failed out=[%s]",out);
     ok(r==7,"failed: r=%ld",r);

     /* %0 ends the line */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "test%0test", 0,
-        0, out, sizeof out/sizeof (CHAR));
+        0, out, sizeof(out)/sizeof(CHAR));
     ok(!strcmp("test", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* %! prints an exclaimation */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "yah%!%0   ", 0,
-        0, out, sizeof out/sizeof (CHAR));
+        0, out, sizeof(out)/sizeof(CHAR));
     ok(!strcmp("yah!", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* %space */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "% %   ", 0,
-        0, out, sizeof out/sizeof (CHAR));
+        0, out, sizeof(out)/sizeof(CHAR));
     ok(!strcmp("    ", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* line feed */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "hi\n", 0,
-        0, out, sizeof out/sizeof (CHAR));
+        0, out, sizeof(out)/sizeof(CHAR));
     ok(!strcmp("hi\r\n", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* carriage return line feed */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "hi\r\n", 0,
-        0, out, sizeof out/sizeof (CHAR));
+        0, out, sizeof(out)/sizeof(CHAR));
     ok(!strcmp("hi\r\n", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* carriage return line feed */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "\r", 0,
-        0, out, sizeof out/sizeof (CHAR));
+        0, out, sizeof(out)/sizeof(CHAR));
     ok(!strcmp("\r\n", out),"failed out=[%s]",out);
     ok(r==2,"failed: r=%ld",r);

     /* carriage return line feed */
     r = doit(FORMAT_MESSAGE_FROM_STRING, "\r\r\n", 0,
-        0, out, sizeof out/sizeof (CHAR));
+        0, out, sizeof(out)/sizeof(CHAR));
     ok(!strcmp("\r\n\r\n", out),"failed out=[%s]",out);
     ok(r==4,"failed: r=%ld",r);

     /* change of pace... test the low byte of dwflags */
     /* line feed */
     r = doit(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, "hi\n", 0,
-        0, out, sizeof out/sizeof (CHAR));
+        0, out, sizeof(out)/sizeof(CHAR));
     ok(!strcmp("hi ", out) || !strcmp("hi\r\n", out),"failed out=[%s]",out);
     ok(r==3 || r==4,"failed: r=%ld",r);

     /* carriage return line feed */
     r = doit(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, "hi\r\n", 0,
-        0, out, sizeof out/sizeof (CHAR));
+        0, out, sizeof(out)/sizeof(CHAR));
     ok(!strcmp("hi ", out),"failed out=[%s]",out);
     ok(r==3,"failed: r=%ld",r);

     /* carriage return line feed */
     r = doit(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, "\r", 0,
-        0, out, sizeof out/sizeof (CHAR));
+        0, out, sizeof(out)/sizeof(CHAR));
     ok(!strcmp(" ", out),"failed out=[%s]",out);
     ok(r==1,"failed: r=%ld",r);

     /* carriage return line feed */
     r = doit(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, "\r\r\n", 0,
-        0, out, sizeof out/sizeof (CHAR));
+        0, out, sizeof(out)/sizeof(CHAR));
     ok(!strcmp("  ", out),"failed out=[%s]",out);
     ok(r==2,"failed: r=%ld",r);
 }
Index: dlls/netapi32/netapi32.c
===================================================================
RCS file: /home/wine/wine/dlls/netapi32/netapi32.c,v
retrieving revision 1.11
diff -u -r1.11 netapi32.c
--- dlls/netapi32/netapi32.c	19 May 2003 23:06:35 -0000	1.11
+++ dlls/netapi32/netapi32.c	3 Jun 2003 03:04:06 -0000
@@ -207,8 +207,8 @@
     if(!nad->valid)
         return NRC_INVADDRESS;

-    memset(astat, 0, sizeof astat);
-    memcpy(astat->adapter_address, nad->address, sizeof astat->adapter_address);
+    memset(astat, 0, sizeof(astat));
+    memcpy(astat->adapter_address, nad->address, sizeof(astat->adapter_address));

     return NRC_GOODRET;
 }
Index: dlls/ntdll/file.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/file.c,v
retrieving revision 1.22
diff -u -r1.22 file.c
--- dlls/ntdll/file.c	15 May 2003 04:22:45 -0000	1.22
+++ dlls/ntdll/file.c	3 Jun 2003 03:04:07 -0000
@@ -217,8 +217,8 @@
 		FileHandle,EventHandle,ApcRoutine,ApcContext,IoStatusBlock,Buffer,Length,ByteOffset,Key);

 	if (IsBadWritePtr( Buffer, Length ) ||
-	    IsBadWritePtr( IoStatusBlock, sizeof *IoStatusBlock) ||
-	    IsBadWritePtr( ByteOffset, sizeof *ByteOffset) )
+	    IsBadWritePtr( IoStatusBlock, sizeof(*IoStatusBlock)) ||
+	    IsBadWritePtr( ByteOffset, sizeof(*ByteOffset)) )
 		return STATUS_ACCESS_VIOLATION;

 	IoStatusBlock->Information = 0;
Index: dlls/ole32/regsvr.c
===================================================================
RCS file: /home/wine/wine/dlls/ole32/regsvr.c,v
retrieving revision 1.1
diff -u -r1.1 regsvr.c
--- dlls/ole32/regsvr.c	28 Mar 2003 19:33:04 -0000	1.1
+++ dlls/ole32/regsvr.c	3 Jun 2003 03:04:07 -0000
@@ -369,7 +369,7 @@
     HKEY subkey;

     for (;;) {
-	cName = sizeof subkey_name / sizeof(WCHAR);
+	cName = sizeof(subkey_name) / sizeof(WCHAR);
 	res = RegEnumKeyExW(key, 0, subkey_name, &cName,
 			    NULL, NULL, NULL, NULL);
 	if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) {
Index: dlls/ole32/storage32.c
===================================================================
RCS file: /home/wine/wine/dlls/ole32/storage32.c,v
retrieving revision 1.39
diff -u -r1.39 storage32.c
--- dlls/ole32/storage32.c	13 May 2003 00:41:58 -0000	1.39
+++ dlls/ole32/storage32.c	3 Jun 2003 03:04:10 -0000
@@ -6553,7 +6553,7 @@

     if( string )
         len = WideCharToMultiByte( CP_ACP, 0, string, -1, NULL, 0, NULL, NULL);
-    r = IStream_Write( stm, &len, sizeof len, NULL);
+    r = IStream_Write( stm, &len, sizeof(len), NULL);
     if( FAILED( r ) )
         return r;
     if(len == 0)
@@ -6573,10 +6573,10 @@
     LPSTR str;
     LPWSTR wstr;

-    r = IStream_Read( stm, &len, sizeof len, &count );
+    r = IStream_Read( stm, &len, sizeof(len), &count );
     if( FAILED( r ) )
         return r;
-    if( count != sizeof len )
+    if( count != sizeof(len) )
         return E_OUTOFMEMORY;

     TRACE("%ld bytes\n",len);
@@ -6633,7 +6633,7 @@
         return r;

     /* Write CompObj Structure to stream */
-    r = IStream_Write(pstm, unknown1, sizeof unknown1, NULL);
+    r = IStream_Write(pstm, unknown1, sizeof(unknown1), NULL);

     if( SUCCEEDED( r ) )
         r = WriteClassStm( pstm, clsid );
@@ -6645,7 +6645,7 @@
     if( SUCCEEDED( r ) )
         r = STREAM_WriteString( pstm, szProgIDName );
     if( SUCCEEDED( r ) )
-        r = IStream_Write(pstm, unknown2, sizeof unknown2, NULL);
+        r = IStream_Write(pstm, unknown2, sizeof(unknown2), NULL);

     IStream_Release( pstm );

@@ -6675,7 +6675,7 @@

     for(i=0; !found; i++ )
     {
-        r = RegEnumKeyW( hkeyclsid, i, szKey, sizeof szKey/sizeof(WCHAR));
+        r = RegEnumKeyW( hkeyclsid, i, szKey, sizeof(szKey)/sizeof(WCHAR));
         if( r != ERROR_SUCCESS )
             break;
         hkey = 0;
@@ -6727,7 +6727,7 @@
         return E_OUTOFMEMORY;

     /* get the clipboard format name */
-    n = GetClipboardFormatNameW( cf, szwClipName, sizeof szwClipName );
+    n = GetClipboardFormatNameW( cf, szwClipName, sizeof(szwClipName) );
     szwClipName[n]=0;

     TRACE("Clipboard name is %s\n", debugstr_w(szwClipName));
@@ -6785,8 +6785,8 @@
     }

     /* read the various parts of the structure */
-    r = IStream_Read( stm, unknown1, sizeof unknown1, &count );
-    if( FAILED( r ) || ( count != sizeof unknown1 ) )
+    r = IStream_Read( stm, unknown1, sizeof(unknown1), &count );
+    if( FAILED( r ) || ( count != sizeof(unknown1) ) )
         goto end;
     r = ReadClassStm( stm, &clsid );
     if( FAILED( r ) )
@@ -6804,8 +6804,8 @@
     if( FAILED( r ) )
         goto end;

-    r = IStream_Read( stm, unknown2, sizeof unknown2, &count );
-    if( FAILED( r ) || ( count != sizeof unknown2 ) )
+    r = IStream_Read( stm, unknown2, sizeof(unknown2), &count );
+    if( FAILED( r ) || ( count != sizeof(unknown2) ) )
         goto end;

     /* ok, success... now we just need to store what we found */
Index: dlls/oleaut32/parsedt.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/parsedt.c,v
retrieving revision 1.7
diff -u -r1.7 parsedt.c
--- dlls/oleaut32/parsedt.c	28 Aug 2002 23:43:43 -0000	1.7
+++ dlls/oleaut32/parsedt.c	3 Jun 2003 03:04:11 -0000
@@ -260,7 +260,7 @@
 	{ZULU, RESERV, DTK_ZULU},	/* 00:00:00 */
 };

-static unsigned int szdatetktbl = sizeof datetktbl / sizeof datetktbl[0];
+static unsigned int szdatetktbl = sizeof(datetktbl) / sizeof(datetktbl[0]);



Index: dlls/serialui/confdlg.c
===================================================================
RCS file: /home/wine/wine/dlls/serialui/confdlg.c,v
retrieving revision 1.13
diff -u -r1.13 confdlg.c
--- dlls/serialui/confdlg.c	4 Nov 2002 23:53:44 -0000	1.13
+++ dlls/serialui/confdlg.c	3 Jun 2003 03:04:11 -0000
@@ -176,7 +176,7 @@
         return FALSE;
     }

-    if(!GetWindowTextA(hControl, &lpEntry[0], sizeof lpEntry))
+    if(!GetWindowTextA(hControl, &lpEntry[0], sizeof(lpEntry)))
     {
         TRACE("Couldn't get window text for item %lx\n",id);
         return FALSE;
@@ -349,7 +349,7 @@
         if(!info)
             return FALSE;
         SetWindowLongA(hWnd, DWL_USER, lParam);
-        snprintf(szTitle, sizeof szTitle, "Settings for %s", info->lpszDevice);
+        snprintf(szTitle, sizeof(szTitle), "Settings for %s", info->lpszDevice);
         SetWindowTextA(hWnd, szTitle);
         SERIALUI_DCBToDialogInfo(hWnd, info);
         return TRUE;
@@ -457,7 +457,7 @@
     if(r != ERROR_SUCCESS)
         return FALSE;

-    snprintf(szKeyName, sizeof szKeyName, "%s\\%s", lpszCommKey ,lpszDevice);
+    snprintf(szKeyName, sizeof(szKeyName), "%s\\%s", lpszCommKey ,lpszDevice);
     r = RegCreateKeyA(hKeyReg, szKeyName, &hKeyPort);
     if(r == ERROR_SUCCESS)
     {
@@ -509,7 +509,7 @@
     if(r != ERROR_SUCCESS)
         return FALSE;

-    snprintf(szKeyName, sizeof szKeyName, "%s\\%s", lpszCommKey ,lpszDevice);
+    snprintf(szKeyName, sizeof(szKeyName), "%s\\%s", lpszCommKey ,lpszDevice);
     r = RegOpenKeyA(hKeyReg, szKeyName, &hKeyPort);
     if(r == ERROR_SUCCESS)
     {
Index: dlls/setupapi/devinst.c
===================================================================
RCS file: /home/wine/wine/dlls/setupapi/devinst.c,v
retrieving revision 1.10
diff -u -r1.10 devinst.c
--- dlls/setupapi/devinst.c	13 May 2003 22:16:53 -0000	1.10
+++ dlls/setupapi/devinst.c	3 Jun 2003 03:04:12 -0000
@@ -205,7 +205,7 @@

     if(info==NULL)
         return FALSE;
-    if(info->cbSize < sizeof *info)
+    if(info->cbSize < sizeof(*info))
         return FALSE;

     return FALSE;
Index: dlls/shell32/shelllink.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shelllink.c,v
retrieving revision 1.54
diff -u -r1.54 shelllink.c
--- dlls/shell32/shelllink.c	21 May 2003 18:50:53 -0000	1.54
+++ dlls/shell32/shelllink.c	3 Jun 2003 03:04:12 -0000
@@ -247,8 +247,8 @@

     TRACE("starting %s\n",debugstr_w(buffer));

-    memset(&si, 0, sizeof si);
-    si.cb = sizeof si;
+    memset(&si, 0, sizeof(si));
+    si.cb = sizeof(si);
     if (!CreateProcessW( NULL, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) return FALSE;

     /* wait for a while to throttle the creation of linker processes */
@@ -404,8 +404,8 @@
     TRACE("%p\n", stm);

     count = 0;
-    r = IStream_Read(stm, &len, sizeof len, &count);
-    if ( FAILED (r) || ( count != sizeof len ) )
+    r = IStream_Read(stm, &len, sizeof(len), &count);
+    if ( FAILED (r) || ( count != sizeof(len) ) )
         return E_FAIL;

     if( unicode )
@@ -455,20 +455,20 @@

     TRACE("%p\n",stm);

-    r = IStream_Read( stm, &size, sizeof size, &count );
+    r = IStream_Read( stm, &size, sizeof(size), &count );
     if( FAILED( r ) )
         return r;
-    if( count != sizeof loc->dwTotalSize )
+    if( count != sizeof(loc->dwTotalSize) )
         return E_FAIL;

     loc = HeapAlloc( GetProcessHeap(), 0, size );
     if( ! loc )
         return E_OUTOFMEMORY;

-    r = IStream_Read( stm, &loc->dwHeaderSize, size-sizeof size, &count );
+    r = IStream_Read( stm, &loc->dwHeaderSize, size-sizeof(size), &count );
     if( FAILED( r ) )
         goto end;
-    if( count != (size - sizeof size) )
+    if( count != (size - sizeof(size)) )
     {
         r = E_FAIL;
         goto end;
@@ -507,13 +507,13 @@
 	  return STG_E_INVALIDPOINTER;

     dwBytesRead = 0;
-    r = IStream_Read(stm, &hdr, sizeof hdr, &dwBytesRead);
+    r = IStream_Read(stm, &hdr, sizeof(hdr), &dwBytesRead);
     if( FAILED( r ) )
         return r;

-    if( dwBytesRead != sizeof hdr)
+    if( dwBytesRead != sizeof(hdr))
         return E_FAIL;
-    if( hdr.dwSize != sizeof hdr)
+    if( hdr.dwSize != sizeof(hdr))
         return E_FAIL;
     if( !IsEqualIID(&hdr.MagicGuid, &CLSID_ShellLink) )
         return E_FAIL;
@@ -604,7 +604,7 @@
     DWORD count;
     HRESULT r;

-    r = IStream_Write( stm, &len, sizeof len, &count );
+    r = IStream_Write( stm, &len, sizeof(len), &count );
     if( FAILED( r ) )
         return r;

@@ -624,8 +624,8 @@

     FIXME("writing empty location info\n");

-    memset( &loc, 0, sizeof loc );
-    loc.dwTotalSize = sizeof loc - sizeof loc.dwTotalSize;
+    memset( &loc, 0, sizeof(loc) );
+    loc.dwTotalSize = sizeof(loc) - sizeof(loc.dwTotalSize);

     /* FIXME: fill this in */

@@ -658,9 +658,9 @@
         This->pPidl = ILCreateFromPathW( This->sPath );
     }

-    memset(&header, 0, sizeof header);
-    header.dwSize = sizeof header;
-    memcpy(&header.MagicGuid, &CLSID_ShellLink, sizeof header.MagicGuid );
+    memset(&header, 0, sizeof(header));
+    header.dwSize = sizeof(header);
+    memcpy(&header.MagicGuid, &CLSID_ShellLink, sizeof(header.MagicGuid) );

     header.wHotKey = This->wHotKey;
     header.nIcon = This->iIcoNdx;
@@ -682,7 +682,7 @@
     SystemTimeToFileTime ( &This->time3, &header.Time3 );

     /* write the Shortcut header */
-    r = IStream_Write( stm, &header, sizeof header, &count );
+    r = IStream_Write( stm, &header, sizeof(header), &count );
     if( FAILED( r ) )
     {
         ERR("Write failed at %d\n",__LINE__);
Index: dlls/shell32/shellord.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shellord.c,v
retrieving revision 1.114
diff -u -r1.114 shellord.c
--- dlls/shell32/shellord.c	19 May 2003 18:54:01 -0000	1.114
+++ dlls/shell32/shellord.c	3 Jun 2003 03:04:13 -0000
@@ -1105,7 +1105,7 @@

 	TRACE("%p %d \n",cs,length);

-	if( (cs == NULL) || (length < sizeof *cs)  )
+	if( (cs == NULL) || (length < sizeof(*cs))  )
 		return FALSE;

 	r = RegOpenKeyW( HKEY_CURRENT_USER, szwCabLocation, &hkey );
@@ -1119,12 +1119,12 @@
 	}

 	/* if we can't read from the registry, create default values */
-	if ( (r != ERROR_SUCCESS) || (cs->cLength < sizeof *cs) ||
+	if ( (r != ERROR_SUCCESS) || (cs->cLength < sizeof(*cs)) ||
 		(cs->cLength != length) )
 	{
 		ERR("Initializing shell cabinet settings\n");
-		memset(cs, 0, sizeof *cs);
-		cs->cLength          = sizeof *cs;
+		memset(cs, 0, sizeof(*cs));
+		cs->cLength          = sizeof(*cs);
 		cs->nVersion         = 2;
 		cs->fFullPathTitle   = FALSE;
 		cs->fSaveLocalView   = TRUE;
Index: dlls/user/comm16.c
===================================================================
RCS file: /home/wine/wine/dlls/user/comm16.c,v
retrieving revision 1.14
diff -u -r1.14 comm16.c
--- dlls/user/comm16.c	22 Nov 2002 21:22:16 -0000	1.14
+++ dlls/user/comm16.c	3 Jun 2003 03:04:13 -0000
@@ -332,7 +332,7 @@
 	OVERLAPPED ov;
 	DWORD count= -1;

-	ZeroMemory(&ov,sizeof ov);
+	ZeroMemory(&ov,sizeof(ov));
 	ov.hEvent = CreateEventA(NULL,0,0,NULL);
 	if(ov.hEvent==INVALID_HANDLE_VALUE)
 		return -1;
@@ -577,7 +577,7 @@
                         /* set default parameters */
                         if(COM[port].baudrate>-1){
                             DCB16 dcb;
-			    memcpy(&dcb,&COM[port].dcb,sizeof dcb);
+			    memcpy(&dcb,&COM[port].dcb,sizeof(dcb));
                             dcb.BaudRate=COM[port].baudrate;
                             /* more defaults:
                              * databits, parity, stopbits
@@ -923,8 +923,8 @@
 		return -1;
 	}

-	memset(&dcb,0,sizeof dcb);
-	dcb.DCBlength = sizeof dcb;
+	memset(&dcb,0,sizeof(dcb));
+	dcb.DCBlength = sizeof(dcb);

 	/*
 	 * according to MSDN, we should first interpret lpdcb->BaudRate as follows:
Index: dlls/user/tests/class.c
===================================================================
RCS file: /home/wine/wine/dlls/user/tests/class.c,v
retrieving revision 1.7
diff -u -r1.7 class.c
--- dlls/user/tests/class.c	19 May 2003 23:10:54 -0000	1.7
+++ dlls/user/tests/class.c	3 Jun 2003 03:04:14 -0000
@@ -127,7 +127,7 @@
     }

     /* check GetClassName */
-    i = GetClassNameW(hTestWnd, str, sizeof str);
+    i = GetClassNameW(hTestWnd, str, sizeof(str));
     ok(i == lstrlenW(className),
         "GetClassName returned incorrect length");
     ok(!lstrcmpW(className,str),
Index: dlls/wininet/internet.c
===================================================================
RCS file: /home/wine/wine/dlls/wininet/internet.c,v
retrieving revision 1.56
diff -u -r1.56 internet.c
--- dlls/wininet/internet.c	11 May 2003 02:59:52 -0000	1.56
+++ dlls/wininet/internet.c	3 Jun 2003 03:04:15 -0000
@@ -1545,7 +1545,7 @@

         proxlen = MultiByteToWideChar( CP_ACP, 0, pi->lpszProxy, -1, NULL, 0);
         prbylen= MultiByteToWideChar( CP_ACP, 0, pi->lpszProxyBypass, -1, NULL, 0);
-        wlen = sizeof *piw + proxlen + prbylen;
+        wlen = sizeof(*piw) + proxlen + prbylen;
         wbuffer = HeapAlloc( GetProcessHeap(), 0, wlen );
         piw = (LPINTERNET_PROXY_INFOW) wbuffer;
         piw->dwAccessType = pi->dwAccessType;
Index: dlls/winmm/lolvldrv.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/lolvldrv.c,v
retrieving revision 1.44
diff -u -r1.44 lolvldrv.c
--- dlls/winmm/lolvldrv.c	15 Mar 2003 00:54:12 -0000	1.44
+++ dlls/winmm/lolvldrv.c	3 Jun 2003 03:04:15 -0000
@@ -478,7 +479,7 @@
     case DRV_QUERYDRIVERIDS:
 	WARN("NIY call VxD\n");
 	/* should call VxD MMDEVLDR with (DevNode, dwParam1 and dwParam2) as pmts
-	 * dwParam1 is buffer and dwParam2 is sizeof buffer
+	 * dwParam1 is buffer and dwParam2 is sizeof(buffer)
 	 * I don't know where the result is stored though
 	 */
 	break;
Index: dlls/winsock/socket.c
===================================================================
RCS file: /home/wine/wine/dlls/winsock/socket.c,v
retrieving revision 1.126
diff -u -r1.126 socket.c
--- dlls/winsock/socket.c	13 May 2003 04:43:44 -0000	1.126
+++ dlls/winsock/socket.c	3 Jun 2003 03:04:22 -0000
@@ -910,7 +910,7 @@
 #ifdef IPX_FRAME_NONE
             uipx->sipx_type=IPX_FRAME_NONE;
 #endif
-            memset(&uipx->sipx_zero,0,sizeof uipx->sipx_zero);
+            memset(&uipx->sipx_zero,0,sizeof(uipx->sipx_zero));
             return (const struct sockaddr*)uipx;
         }
 #endif
Index: dlls/winspool/info.c
===================================================================
RCS file: /home/wine/wine/dlls/winspool/info.c,v
retrieving revision 1.77
diff -u -r1.77 info.c
--- dlls/winspool/info.c	19 May 2003 23:19:21 -0000	1.77
+++ dlls/winspool/info.c	3 Jun 2003 03:04:23 -0000
@@ -2933,7 +2933,7 @@
     ofs = info_size*count;
     for ( i=0; i<count; i++)
     {
-        DWORD vallen = sizeof portname - 1;
+        DWORD vallen = sizeof(portname) - 1;

         /* get the serial port values, then the printer values */
         if ( i < serial_count )
Index: files/smb.c
===================================================================
RCS file: /home/wine/wine/files/smb.c,v
retrieving revision 1.17
diff -u -r1.17 smb.c
--- files/smb.c	15 Mar 2003 00:12:42 -0000	1.17
+++ files/smb.c	3 Jun 2003 03:04:25 -0000
@@ -216,7 +216,7 @@
     if(fd<0)
         return FALSE;

-    r = setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &on, sizeof on);
+    r = setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
     if(r<0)
         goto err;

@@ -228,11 +228,11 @@
     sin.sin_family = AF_INET;
     sin.sin_port    = htons(137);

-    len = NB_NameReq(host,buffer,sizeof buffer);
+    len = NB_NameReq(host,buffer,sizeof(buffer));
     if(len<=0)
         goto err;

-    r = sendto(fd, buffer, len, 0, (struct sockaddr*)&sin, sizeof sin);
+    r = sendto(fd, buffer, len, 0, (struct sockaddr*)&sin, sizeof(sin));
     if(r<0)
     {
         FIXME("Error sending packet\n");
@@ -253,7 +253,7 @@
     TRACE("Got response!\n");

     fromsize = sizeof (fromaddr);
-    r = recvfrom(fd, buffer, sizeof buffer, 0, (struct sockaddr*)&fromaddr, &fromsize);
+    r = recvfrom(fd, buffer, sizeof(buffer), 0, (struct sockaddr*)&fromaddr, &fromsize);
     if(r<0)
         goto err;

@@ -271,7 +271,7 @@

     TRACE("packet is OK\n");

-    memcpy(&addr->sin_addr, &buffer[58], sizeof addr->sin_addr);
+    memcpy(&addr->sin_addr, &buffer[58], sizeof(addr->sin_addr));

     close(fd);
     return TRUE;
@@ -525,7 +525,7 @@

     TRACE("\n");

-    memset(buf,0,sizeof buf);
+    memset(buf,0,sizeof(buf));

     tx.buffer = buf;
     tx.len = SMB_Header(tx.buffer, SMB_COM_NEGOTIATE, 0, 0);
@@ -578,7 +578,7 @@
     int pcount,bcount;
     struct NB_Buffer rx, tx;

-    memset(buf,0,sizeof buf);
+    memset(buf,0,sizeof(buf));
     tx.buffer = buf;

     tx.len = SMB_Header(tx.buffer, SMB_COM_SESSION_SETUP_ANDX, 0, 0);
@@ -675,7 +675,7 @@

     TRACE("%s\n",share_name);

-    memset(buf,0,sizeof buf);
+    memset(buf,0,sizeof(buf));
     tx.buffer = buf;

     tx.len = SMB_Header(tx.buffer, SMB_COM_TREE_CONNECT, 0, user_id);
@@ -697,7 +697,7 @@
     tx.buffer[tx.len++] = 0; /* null terminated password */

     slen = strlen(share_name);
-    if(slen<(sizeof buf-tx.len))
+    if(slen<(sizeof(buf)-tx.len))
         strcpy(&tx.buffer[tx.len], share_name);
     else
         return FALSE;
@@ -739,7 +739,7 @@

     TRACE("%s\n",filename);

-    memset(buffer,0,sizeof buffer);
+    memset(buffer,0,sizeof(buffer));

     len = SMB_Header(buffer, SMB_COM_NT_CREATE_ANDX, tree_id, user_id);

@@ -789,7 +789,7 @@
     /* 0x39 */
     SMB_ADDWORD(&buffer[len],slen); len += 2; /* size of buffer */

-    if(slen<(sizeof buffer-len))
+    if(slen<(sizeof(buffer)-len))
         strcpy(&buffer[len], filename);
     else
         return FALSE;
@@ -865,7 +865,7 @@

     mode = SMB_GetMode(access,sharing);

-    memset(buffer,0,sizeof buffer);
+    memset(buffer,0,sizeof(buffer));

     len = SMB_Header(buffer, SMB_COM_OPEN_ANDX, tree_id, user_id);

@@ -896,7 +896,7 @@

     TRACE("%s\n",filename);

-    memset(buf,0,sizeof buf);
+    memset(buf,0,sizeof(buf));

     tx.buffer = buf;
     tx.len = SMB_Header(tx.buffer, SMB_COM_OPEN, tree_id, user_id);
@@ -1167,7 +1167,7 @@
     int storagetype = 0;
     int len, buf_size;

-    memset(send,0,sizeof send);
+    memset(send,0,sizeof(send));

     send->setup_count = 1;
     send->setup = HeapAlloc(GetProcessHeap(),0,send->setup_count*2);
@@ -1216,7 +1216,7 @@
     if(!SMB_SetupFindFirst(&send, filename))
         return FALSE;

-    memset(&recv,0,sizeof recv);
+    memset(&recv,0,sizeof(recv));

     ret = SMB_Transaction2(fd, tree_id, user_id, &send, &recv);
     HeapFree(GetProcessHeap(),0,send.params);
@@ -1323,7 +1323,7 @@
         unsigned char *x = (unsigned char *)&sin.sin_addr;
         TRACE("Connecting to %d.%d.%d.%d ...\n", x[0],x[1],x[2],x[3]);
     }
-    r = connect(fd, (struct sockaddr*)&sin, sizeof sin);
+    r = connect(fd, (struct sockaddr*)&sin, sizeof(sin));

     if(!NB_SessionReq(fd, "*SMBSERVER", "WINE"))
     {
@@ -1596,7 +1596,7 @@
     if(dir->current >= dir->num_entries)
         return FALSE;

-    memset(data, 0, sizeof *data);
+    memset(data, 0, sizeof(*data));

     ent = dir->entries[dir->current];
     len = SMB_GETDWORD(&ent[0]);
@@ -1612,13 +1612,13 @@

     /* copy the long filename */
     fnlen = SMB_GETDWORD(&ent[0x3c]);
-    if ( fnlen > (sizeof data->cFileName/sizeof(WCHAR)) )
+    if ( fnlen > (sizeof(data->cFileName)/sizeof(WCHAR)) )
         return FALSE;
     MultiByteToWideChar( CP_ACP, 0, &ent[0x5e], fnlen, data->cFileName,
                          sizeof(data->cFileName)/sizeof(WCHAR) );

     /* copy the short filename */
-    if ( ent[0x44] > (sizeof data->cAlternateFileName/sizeof(WCHAR)) )
+    if ( ent[0x44] > (sizeof(data->cAlternateFileName)/sizeof(WCHAR)) )
         return FALSE;
     MultiByteToWideChar( CP_ACP, 0, &ent[0x5e + len], ent[0x44], data->cAlternateFileName,
                          sizeof(data->cAlternateFileName)/sizeof(WCHAR) );
@@ -1632,7 +1632,7 @@
 {
     HeapFree(GetProcessHeap(),0,dir->buffer);
     HeapFree(GetProcessHeap(),0,dir->entries);
-    memset(dir,0,sizeof *dir);
+    memset(dir,0,sizeof(*dir));
     HeapFree(GetProcessHeap(),0,dir);
     return TRUE;
 }
Index: graphics/x11drv/xfont.c
===================================================================
RCS file: /home/wine/wine/graphics/x11drv/xfont.c,v
retrieving revision 1.113
diff -u -r1.113 xfont.c
--- graphics/x11drv/xfont.c	3 Dec 2002 19:18:42 -0000	1.113
+++ graphics/x11drv/xfont.c	3 Jun 2003 03:04:29 -0000
@@ -1704,7 +1704,7 @@
     {
         BOOL bSubst;
 	char subsection[32];
-        snprintf( subsection, sizeof subsection, "%s%i", INIAliasSection, i++ );
+        snprintf( subsection, sizeof(subsection), "%s%i", INIAliasSection, i++ );

 	buffer[0] = 0;
 	if(!RegOpenKeyA(HKEY_LOCAL_MACHINE, INIFontSection, &hkey))
@@ -2109,7 +2109,7 @@
 	    lfd1.resolution_x = res_string;
 	    lfd1.resolution_y = res_string;

-	    LFD_UnParse(buffer, sizeof buffer, &lfd1);
+	    LFD_UnParse(buffer, sizeof(buffer), &lfd1);

 	    lpstr = buffer;
 	}
@@ -2330,7 +2330,7 @@

 	for( j = i = 0, pfr = fontList; pfr; pfr = pfr->next )
 	{
-	    LFD_UnParse(buffer, sizeof buffer, pfr->resource);
+	    LFD_UnParse(buffer, sizeof(buffer), pfr->resource);
 	    i += strlen( buffer) + 1;
 	    j += pfr->fi_count;
 	}
@@ -2368,7 +2368,7 @@
 	    write( fd, &i, sizeof(int) );
 	    for( pfr = fontList; pfr && i == j; pfr = pfr->next )
 	    {
-		LFD_UnParse(buffer, sizeof buffer, pfr->resource);
+		LFD_UnParse(buffer, sizeof(buffer), pfr->resource);
 	        i = strlen( buffer ) + 1;
 		j = write( fd, buffer, i );
 	    }
Index: programs/uninstaller/main.c
===================================================================
RCS file: /home/wine/wine/programs/uninstaller/main.c,v
retrieving revision 1.10
diff -u -r1.10 main.c
--- programs/uninstaller/main.c	5 Jul 2002 21:23:54 -0000	1.10
+++ programs/uninstaller/main.c	3 Jun 2003 03:04:31 -0000
@@ -80,7 +80,7 @@
     { BS_PUSHBUTTON, "Exit", 0 }
 };

-#define NUM (sizeof button/sizeof button[0])
+#define NUM (sizeof(button)/sizeof(button[0]))

 int FetchUninstallInformation(void);
 void UninstallProgram(void);
Index: programs/winemenubuilder/winemenubuilder.c
===================================================================
RCS file: /home/wine/wine/programs/winemenubuilder/winemenubuilder.c,v
retrieving revision 1.1
diff -u -r1.1 winemenubuilder.c
--- programs/winemenubuilder/winemenubuilder.c	21 May 2003 18:50:53 -0000	1.1
+++ programs/winemenubuilder/winemenubuilder.c	3 Jun 2003 03:04:31 -0000
@@ -683,7 +683,7 @@
     if( !GetFullPathNameW( linkfile, MAX_PATH, filename, NULL ))
         return FALSE;

-    for( i=0; i<sizeof locations/sizeof locations[0]; i++ )
+    for( i=0; i<sizeof(locations)/sizeof(locations[0]); i++ )
     {
         if (!SHGetSpecialFolderPathW( 0, buffer, locations[i], FALSE ))
             continue;
@@ -743,24 +743,24 @@
     }

     szWorkDir[0]=0;
-    IShellLinkA_GetWorkingDirectory( sl, szWorkDir, sizeof szWorkDir);
+    IShellLinkA_GetWorkingDirectory( sl, szWorkDir, sizeof(szWorkDir));
     WINE_TRACE("workdir    : %s\n", szWorkDir);

     szDescription[0] = 0;
-    IShellLinkA_GetDescription( sl, szDescription, sizeof szDescription);
+    IShellLinkA_GetDescription( sl, szDescription, sizeof(szDescription));
     WINE_TRACE("description: %s\n", szDescription);

     szPath[0] = 0;
-    IShellLinkA_GetPath( sl, szPath, sizeof szPath, NULL, SLGP_RAWPATH );
+    IShellLinkA_GetPath( sl, szPath, sizeof(szPath), NULL, SLGP_RAWPATH );
     WINE_TRACE("path       : %s\n", szPath);

     szArgs[0] = 0;
-    IShellLinkA_GetArguments( sl, szArgs, sizeof szArgs );
+    IShellLinkA_GetArguments( sl, szArgs, sizeof(szArgs) );
     WINE_TRACE("args       : %s\n", szArgs);

     szIconPath[0] = 0;
     IShellLinkA_GetIconLocation( sl, szIconPath,
-                        sizeof szIconPath, &iIconId );
+                        sizeof(szIconPath), &iIconId );
     WINE_TRACE("icon file  : %s\n", szIconPath );

     if( !szPath[0] )
@@ -963,7 +963,7 @@
         {
             WCHAR link[MAX_PATH];

-            MultiByteToWideChar( CP_ACP, 0, token, -1, link, sizeof link );
+            MultiByteToWideChar( CP_ACP, 0, token, -1, link, sizeof(link) );
             if( !Process_Link( link, bAgain ) )
             {
 	        WINE_ERR( "failed to build menu item for %s\n",token);
Index: scheduler/client.c
===================================================================
RCS file: /home/wine/wine/scheduler/client.c,v
retrieving revision 1.98
diff -u -r1.98 client.c
--- scheduler/client.c	20 Apr 2003 02:48:06 -0000	1.98
+++ scheduler/client.c	3 Jun 2003 03:04:32 -0000
@@ -68,7 +68,7 @@
 /* data structure used to pass an fd with sendmsg/recvmsg */
 struct cmsg_fd
 {
-    int len;   /* sizeof structure */
+    int len;   /* size of structure */
     int level; /* SOL_SOCKET */
     int type;  /* SCM_RIGHTS */
     int fd;    /* fd to pass */
Index: server/named_pipe.c
===================================================================
RCS file: /home/wine/wine/server/named_pipe.c,v
retrieving revision 1.24
diff -u -r1.24 named_pipe.c
--- server/named_pipe.c	15 May 2003 04:22:45 -0000	1.24
+++ server/named_pipe.c	3 Jun 2003 03:04:32 -0000
@@ -248,7 +248,7 @@
 {
     struct connect_wait *waiter;

-    waiter = mem_alloc( sizeof *waiter );
+    waiter = mem_alloc( sizeof(*waiter) );
     if( waiter )
     {
         set_waiter( &waiter->wait, func, overlapped );
Index: server/registry.c
===================================================================
RCS file: /home/wine/wine/server/registry.c,v
retrieving revision 1.50
diff -u -r1.50 registry.c
--- server/registry.c	25 Feb 2003 04:04:18 -0000	1.50
+++ server/registry.c	3 Jun 2003 03:04:33 -0000
@@ -1924,7 +1924,7 @@
             }
             else
             {
-                notify = (struct notify *) malloc (sizeof *notify);
+                notify = (struct notify *) malloc (sizeof(*notify));
                 if( notify )
                 {
                     grab_object( event );
Index: server/request.c
===================================================================
RCS file: /home/wine/wine/server/request.c,v
retrieving revision 1.79
diff -u -r1.79 request.c
--- server/request.c	28 Mar 2003 00:36:12 -0000	1.79
+++ server/request.c	3 Jun 2003 03:04:33 -0000
@@ -116,7 +116,7 @@
 #ifndef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
 struct cmsg_fd
 {
-    int len;   /* sizeof structure */
+    int len;   /* size of structure */
     int level; /* SOL_SOCKET */
     int type;  /* SCM_RIGHTS */
     int fd;    /* fd to pass */



-- 
Francois Gouget         fgouget@free.fr        http://fgouget.free.fr/
           Cahn's Axiom: When all else fails, read the instructions.



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux