Changed isolated for loops to while loops (based on a patch by Andreas
Mohr).
This commit is contained in:
parent
b6474aebd4
commit
566a52ad8c
|
@ -591,7 +591,10 @@ static BOOL MMIO_Destroy(LPWINE_MMIO wm)
|
||||||
LPWINE_MMIO* m;
|
LPWINE_MMIO* m;
|
||||||
|
|
||||||
EnterCriticalSection(&iData->cs);
|
EnterCriticalSection(&iData->cs);
|
||||||
for (m = &(iData->lpMMIO); *m && *m != wm; m = &(*m)->lpNext);
|
/* search for the matching one... */
|
||||||
|
m = &(iData->lpMMIO);
|
||||||
|
while (*m && *m != wm) m = &(*m)->lpNext;
|
||||||
|
/* ...and destroy */
|
||||||
if (*m) {
|
if (*m) {
|
||||||
*m = (*m)->lpNext;
|
*m = (*m)->lpNext;
|
||||||
HeapFree(GetProcessHeap(), 0, wm);
|
HeapFree(GetProcessHeap(), 0, wm);
|
||||||
|
|
|
@ -261,10 +261,12 @@ static void DOSFS_ToDosDTAFormat( LPCSTR name, LPSTR buffer )
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
memcpy( buffer, name, 8 );
|
memcpy( buffer, name, 8 );
|
||||||
for (p = buffer + 8; (p > buffer) && (p[-1] == ' '); p--);
|
p = buffer + 8;
|
||||||
|
while ((p > buffer) && (p[-1] == ' ')) p--;
|
||||||
*p++ = '.';
|
*p++ = '.';
|
||||||
memcpy( p, name + 8, 3 );
|
memcpy( p, name + 8, 3 );
|
||||||
for (p += 3; p[-1] == ' '; p--);
|
p += 3;
|
||||||
|
while (p[-1] == ' ') p--;
|
||||||
if (p[-1] == '.') p--;
|
if (p[-1] == '.') p--;
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1422,7 +1422,7 @@ BOOL WINAPI GetVolumeInformationA( LPCSTR root, LPSTR label,
|
||||||
if (label)
|
if (label)
|
||||||
{
|
{
|
||||||
lstrcpynA( label, DRIVE_GetLabel(drive), label_len );
|
lstrcpynA( label, DRIVE_GetLabel(drive), label_len );
|
||||||
for (cp = label; *cp; cp++);
|
cp = label + strlen(label);
|
||||||
while (cp != label && *(cp-1) == ' ') cp--;
|
while (cp != label && *(cp-1) == ' ') cp--;
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
}
|
}
|
||||||
|
|
|
@ -957,11 +957,9 @@ static BOOL LFD_ComposeLFD( const fontObject* fo,
|
||||||
|
|
||||||
if (uRelax <= 4)
|
if (uRelax <= 4)
|
||||||
{
|
{
|
||||||
fontEncodingTemplate* boba;
|
fontEncodingTemplate* boba = fETTable;
|
||||||
|
|
||||||
i = fo->fi->fi_encoding >> 8;
|
for(i = fo->fi->fi_encoding >> 8; i; i--) boba = boba->next;
|
||||||
for( boba = fETTable; i; i--, boba = boba->next );
|
|
||||||
|
|
||||||
aLFD.charset_registry = boba->prefix ? boba->prefix : any;
|
aLFD.charset_registry = boba->prefix ? boba->prefix : any;
|
||||||
|
|
||||||
i = fo->fi->fi_encoding & 255;
|
i = fo->fi->fi_encoding & 255;
|
||||||
|
|
|
@ -649,7 +649,8 @@ static VOID HLPFILE_SystemCommands(HLPFILE* hlpfile)
|
||||||
lstrcpy(p, (LPSTR) ptr + 4);
|
lstrcpy(p, (LPSTR) ptr + 4);
|
||||||
macro->lpszMacro = p;
|
macro->lpszMacro = p;
|
||||||
macro->next = 0;
|
macro->next = 0;
|
||||||
for (m = &hlpfile->first_macro; *m; m = &(*m)->next);
|
m = &hlpfile->first_macro;
|
||||||
|
while (*m) m = &(*m)->next;
|
||||||
*m = macro;
|
*m = macro;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -443,7 +443,8 @@ void generate_startup_debug_events( struct process *process, void *entry )
|
||||||
generate_debug_event( thread, CREATE_THREAD_DEBUG_EVENT, NULL );
|
generate_debug_event( thread, CREATE_THREAD_DEBUG_EVENT, NULL );
|
||||||
|
|
||||||
/* generate dll events (in loading order, i.e. reverse list order) */
|
/* generate dll events (in loading order, i.e. reverse list order) */
|
||||||
for (dll = &process->exe; dll->next; dll = dll->next);
|
dll = &process->exe;
|
||||||
|
while (dll->next) dll = dll->next;
|
||||||
while (dll != &process->exe)
|
while (dll != &process->exe)
|
||||||
{
|
{
|
||||||
generate_debug_event( process->thread_list, LOAD_DLL_DEBUG_EVENT, dll );
|
generate_debug_event( process->thread_list, LOAD_DLL_DEBUG_EVENT, dll );
|
||||||
|
|
|
@ -1305,7 +1305,8 @@ static void load_keys( struct key *key, FILE *f )
|
||||||
|
|
||||||
while (read_next_line( &info ) == 1)
|
while (read_next_line( &info ) == 1)
|
||||||
{
|
{
|
||||||
for (p = info.buffer; *p && isspace(*p); p++);
|
p = info.buffer;
|
||||||
|
while (*p && isspace(*p)) p++;
|
||||||
switch(*p)
|
switch(*p)
|
||||||
{
|
{
|
||||||
case '[': /* new key */
|
case '[': /* new key */
|
||||||
|
|
|
@ -120,12 +120,12 @@ const char *str_match (const char *str, const char *match, int *found)
|
||||||
{
|
{
|
||||||
assert(str && match && found);
|
assert(str && match && found);
|
||||||
|
|
||||||
for (; *str == ' '; str++);
|
while (*str == ' ') str++;
|
||||||
if (!strncmp (str, match, strlen (match)))
|
if (!strncmp (str, match, strlen (match)))
|
||||||
{
|
{
|
||||||
*found = 1;
|
*found = 1;
|
||||||
str += strlen (match);
|
str += strlen (match);
|
||||||
for (; *str == ' '; str++);
|
while (*str == ' ') str++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*found = 0;
|
*found = 0;
|
||||||
|
|
Loading…
Reference in New Issue