Module: wine Branch: master Commit: 615e9572f163151bf23c826476dbb7c63fcd17d3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=615e9572f163151bf23c826476... Author: Marcus Meissner <meissner(a)suse.de> Date: Fri Oct 21 08:19:17 2011 +0200 kernel32: Avoid shadowing variables "a", "nt" and "fd". --- dlls/kernel32/process.c | 30 ++++++++++++++---------------- 1 files changed, 14 insertions(+), 16 deletions(-) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index f67e438..6d42696 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -804,7 +804,6 @@ static BOOL build_command_line( WCHAR **argv ) *p++='"'; if (has_quote) { int bcount; - WCHAR* a; bcount=0; a=*arg; @@ -1510,17 +1509,16 @@ static int fork_and_exec( const char *filename, const WCHAR *cmdline, const WCHA if (flags & (CREATE_NEW_PROCESS_GROUP | CREATE_NEW_CONSOLE | DETACHED_PROCESS)) { - int pid; if (!(pid = fork())) { - int fd = open( "/dev/null", O_RDWR ); + int nullfd = open( "/dev/null", O_RDWR ); setsid(); /* close stdin and stdout */ - if (fd != -1) + if (nullfd != -1) { - dup2( fd, 0 ); - dup2( fd, 1 ); - close( fd ); + dup2( nullfd, 0 ); + dup2( nullfd, 1 ); + close( nullfd ); } } else if (pid != -1) _exit(0); /* parent */ @@ -2250,14 +2248,14 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A if (env && !(flags & CREATE_UNICODE_ENVIRONMENT)) /* convert environment to unicode */ { - char *p = env; + char *e = env; DWORD lenW; - while (*p) p += strlen(p) + 1; - p++; /* final null */ - lenW = MultiByteToWideChar( CP_ACP, 0, env, p - (char*)env, NULL, 0 ); + while (*e) e += strlen(e) + 1; + e++; /* final null */ + lenW = MultiByteToWideChar( CP_ACP, 0, env, e - (char*)env, NULL, 0 ); envW = HeapAlloc( GetProcessHeap(), 0, lenW * sizeof(WCHAR) ); - MultiByteToWideChar( CP_ACP, 0, env, p - (char*)env, envW, lenW ); + MultiByteToWideChar( CP_ACP, 0, env, e - (char*)env, envW, lenW ); flags |= CREATE_UNICODE_ENVIRONMENT; } @@ -3206,11 +3204,11 @@ DWORD WINAPI GetProcessVersion( DWORD pid ) if (!pid || pid == GetCurrentProcessId()) { - IMAGE_NT_HEADERS *nt; + IMAGE_NT_HEADERS *pnt; - if ((nt = RtlImageNtHeader( NtCurrentTeb()->Peb->ImageBaseAddress ))) - return ((nt->OptionalHeader.MajorSubsystemVersion << 16) | - nt->OptionalHeader.MinorSubsystemVersion); + if ((pnt = RtlImageNtHeader( NtCurrentTeb()->Peb->ImageBaseAddress ))) + return ((pnt->OptionalHeader.MajorSubsystemVersion << 16) | + pnt->OptionalHeader.MinorSubsystemVersion); return 0; }