for loop fixes
Andreas Mohr
a.mohr at mailto.de
Sat Mar 3 10:36:29 CST 2001
Re François Gouget ;-)
- for loop in ITypeLib2_fnFindName was WRONG.
(the ";", that is)
it was even written as " ;" to indicate that the for loop is isolated,
but it's NOT. At least that's what the code says to me...
(ITypeLib2_fnIsName didn't do that either, and it is very similar)
So I removed it.
- changed all terminating ";" of isolated for loops to " ;" to indicate the
loop's isolation.
Please do the same for these for loops in the future.
Somebody might want to write a Wine coding guidelines article...
Andreas Mohr
P.S.: I just *knew* that at least one other for loop in Wine would be wrong,
too ;-)
-------------- next part --------------
Determining best CVS host...
Using CVSROOT :pserver:cvs at rhlx01.fht-esslingen.de:/home/wine
Index: dlls/oleaut32/typelib.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/typelib.c,v
retrieving revision 1.34
diff -u -r1.34 typelib.c
--- dlls/oleaut32/typelib.c 2001/02/28 05:31:03 1.34
+++ dlls/oleaut32/typelib.c 2001/03/03 10:56:24
@@ -2196,7 +2196,7 @@
if(!memcmp(szNameBuf,pFInfo->pParamDesc[i].Name,nNameBufLen))
goto ITypeLib2_fnFindName_exit;
}
- for(pVInfo=pTInfo->varlist;pVInfo;pVInfo=pVInfo->next) ;
+ for(pVInfo=pTInfo->varlist;pVInfo;pVInfo=pVInfo->next)
if(!memcmp(szNameBuf,pVInfo->Name, nNameBufLen)) goto ITypeLib2_fnFindName_exit;
continue;
ITypeLib2_fnFindName_exit:
Index: dlls/winmm/mmio.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/mmio.c,v
retrieving revision 1.19
diff -u -r1.19 mmio.c
--- dlls/winmm/mmio.c 2001/02/12 03:41:13 1.19
+++ dlls/winmm/mmio.c 2001/03/03 10:56:25
@@ -591,7 +591,9 @@
LPWINE_MMIO* m;
EnterCriticalSection(&iData->cs);
- for (m = &(iData->lpMMIO); *m && *m != wm; m = &(*m)->lpNext);
+ /* search for the matching one... */
+ for (m = &(iData->lpMMIO); *m && *m != wm; m = &(*m)->lpNext) ;
+ /* ...and destroy */
if (*m) {
*m = (*m)->lpNext;
HeapFree(GetProcessHeap(), 0, wm);
Index: files/dos_fs.c
===================================================================
RCS file: /home/wine/wine/files/dos_fs.c,v
retrieving revision 1.80
diff -u -r1.80 dos_fs.c
--- files/dos_fs.c 2001/02/27 02:09:17 1.80
+++ files/dos_fs.c 2001/03/03 10:56:27
@@ -261,10 +261,10 @@
char *p;
memcpy( buffer, name, 8 );
- for (p = buffer + 8; (p > buffer) && (p[-1] == ' '); p--);
+ for (p = buffer + 8; (p > buffer) && (p[-1] == ' '); p--) ;
*p++ = '.';
memcpy( p, name + 8, 3 );
- for (p += 3; p[-1] == ' '; p--);
+ for (p += 3; p[-1] == ' '; p--) ;
if (p[-1] == '.') p--;
*p = '\0';
}
Index: files/drive.c
===================================================================
RCS file: /home/wine/wine/files/drive.c,v
retrieving revision 1.51
diff -u -r1.51 drive.c
--- files/drive.c 2001/01/12 19:55:19 1.51
+++ files/drive.c 2001/03/03 10:56:29
@@ -1422,7 +1422,7 @@
if (label)
{
lstrcpynA( label, DRIVE_GetLabel(drive), label_len );
- for (cp = label; *cp; cp++);
+ for (cp = label; *cp; cp++) ;
while (cp != label && *(cp-1) == ' ') cp--;
*cp = '\0';
}
Index: graphics/x11drv/xfont.c
===================================================================
RCS file: /home/wine/wine/graphics/x11drv/xfont.c,v
retrieving revision 1.67
diff -u -r1.67 xfont.c
--- graphics/x11drv/xfont.c 2001/02/14 22:56:39 1.67
+++ graphics/x11drv/xfont.c 2001/03/03 10:56:32
@@ -960,7 +960,7 @@
fontEncodingTemplate* boba;
i = fo->fi->fi_encoding >> 8;
- for( boba = fETTable; i; i--, boba = boba->next );
+ for( boba = fETTable; i; i--, boba = boba->next ) ;
aLFD.charset_registry = boba->prefix ? boba->prefix : any;
Index: programs/winhelp/hlpfile.c
===================================================================
RCS file: /home/wine/wine/programs/winhelp/hlpfile.c,v
retrieving revision 1.5
diff -u -r1.5 hlpfile.c
--- programs/winhelp/hlpfile.c 2000/06/20 20:34:11 1.5
+++ programs/winhelp/hlpfile.c 2001/03/03 10:56:33
@@ -649,7 +649,7 @@
lstrcpy(p, (LPSTR) ptr + 4);
macro->lpszMacro = p;
macro->next = 0;
- for (m = &hlpfile->first_macro; *m; m = &(*m)->next);
+ for (m = &hlpfile->first_macro; *m; m = &(*m)->next) ;
*m = macro;
break;
Index: server/debugger.c
===================================================================
RCS file: /home/wine/wine/server/debugger.c,v
retrieving revision 1.28
diff -u -r1.28 debugger.c
--- server/debugger.c 2001/01/26 20:45:42 1.28
+++ server/debugger.c 2001/03/03 10:56:33
@@ -443,7 +443,7 @@
generate_debug_event( thread, CREATE_THREAD_DEBUG_EVENT, NULL );
/* generate dll events (in loading order, i.e. reverse list order) */
- for (dll = &process->exe; dll->next; dll = dll->next);
+ for (dll = &process->exe; dll->next; dll = dll->next) ;
while (dll != &process->exe)
{
generate_debug_event( process->thread_list, LOAD_DLL_DEBUG_EVENT, dll );
Index: server/registry.c
===================================================================
RCS file: /home/wine/wine/server/registry.c,v
retrieving revision 1.31
diff -u -r1.31 registry.c
--- server/registry.c 2001/01/05 04:08:08 1.31
+++ server/registry.c 2001/03/03 10:56:35
@@ -1305,7 +1305,7 @@
while (read_next_line( &info ) == 1)
{
- for (p = info.buffer; *p && isspace(*p); p++);
+ for (p = info.buffer; *p && isspace(*p); p++) ;
switch(*p)
{
case '[': /* new key */
Index: tools/specmaker/misc.c
===================================================================
RCS file: /home/wine/wine/tools/specmaker/misc.c,v
retrieving revision 1.1
diff -u -r1.1 misc.c
--- tools/specmaker/misc.c 2001/01/04 19:45:50 1.1
+++ tools/specmaker/misc.c 2001/03/03 10:56:35
@@ -120,12 +120,12 @@
{
assert(str && match && found);
- for (; *str == ' '; str++);
+ for (; *str == ' '; str++) ;
if (!strncmp (str, match, strlen (match)))
{
*found = 1;
str += strlen (match);
- for (; *str == ' '; str++);
+ for (; *str == ' '; str++) ;
}
else
*found = 0;
More information about the wine-patches
mailing list