summaryrefslogtreecommitdiff
path: root/desktop/win32
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2011-09-26 09:47:21 +0100
committerJan Holesovsky <kendy@suse.cz>2011-10-07 16:30:52 +0200
commit9142f9a1a10f2df24f55e21b9203058bd0d2626a (patch)
treee38d72c8eb8edf28fe6ad987597be768dfd83c91 /desktop/win32
parentce285da92f95995a4e7c3a63713a8b004a1ab967 (diff)
WaE: win32 cleanup
Diffstat (limited to 'desktop/win32')
-rw-r--r--desktop/win32/source/extendloaderenvironment.cxx2
-rwxr-xr-xdesktop/win32/source/guistdio/guistdio.inc25
-rw-r--r--desktop/win32/source/setup/setup.cpp2
3 files changed, 12 insertions, 17 deletions
diff --git a/desktop/win32/source/extendloaderenvironment.cxx b/desktop/win32/source/extendloaderenvironment.cxx
index ee9de7f6099f..2d1f09adbff9 100644
--- a/desktop/win32/source/extendloaderenvironment.cxx
+++ b/desktop/win32/source/extendloaderenvironment.cxx
@@ -123,7 +123,7 @@ void extendLoaderEnvironment(WCHAR * binPath, WCHAR * iniDirectory) {
WCHAR * padEnd = NULL;
WCHAR env[maxEnv];
DWORD n = GetEnvironmentVariableW(L"PATH", env, maxEnv);
- if (n >= maxEnv || n == 0 && GetLastError() != ERROR_ENVVAR_NOT_FOUND) {
+ if ((n >= maxEnv || n == 0) && GetLastError() != ERROR_ENVVAR_NOT_FOUND) {
fail();
}
env[n] = L'\0';
diff --git a/desktop/win32/source/guistdio/guistdio.inc b/desktop/win32/source/guistdio/guistdio.inc
index 05d462d23197..a62a0a62ef79 100755
--- a/desktop/win32/source/guistdio/guistdio.inc
+++ b/desktop/win32/source/guistdio/guistdio.inc
@@ -52,7 +52,6 @@ DWORD passOutputToConsole(HANDLE readPipe, HANDLE console)
BYTE aBuffer[1024];
DWORD dwRead = 0;
HANDLE hReadPipe = readPipe;
- BOOL fSuccess;
DWORD dwWritten;
//Indicates that we read an odd number of bytes. That is, we only read half of the last
@@ -80,7 +79,7 @@ DWORD passOutputToConsole(HANDLE readPipe, HANDLE console)
{
//To test this case, give aBuffer a small odd size, e.g. aBuffer[3]
//The last byte, which is the incomplete wchar_t (half of it), will not be written.
- fSuccess = WriteConsoleW( console, aBuffer,
+ (void) WriteConsoleW( console, aBuffer,
(dwRead - 1) / 2, &dwWritten, NULL );
//Move the last byte to the front of the buffer, so that it is the start of the
@@ -98,7 +97,7 @@ DWORD passOutputToConsole(HANDLE readPipe, HANDLE console)
//when ReadFile is called.
dwToRead = sizeof(aBuffer);
pBuffer = aBuffer;
- fSuccess = WriteConsoleW( console,
+ (void) WriteConsoleW( console,
aBuffer, dwRead / 2, &dwWritten, NULL );
}
}
@@ -122,10 +121,9 @@ DWORD WINAPI OutputThread( LPVOID pParam )
HANDLE hReadPipe = (HANDLE)pParam;
while ( ReadFile( hReadPipe, &aBuffer, sizeof(aBuffer), &dwRead, NULL ) )
{
- BOOL fSuccess;
DWORD dwWritten;
- fSuccess = WriteFile( GetStdHandle( STD_OUTPUT_HANDLE ), aBuffer, dwRead, &dwWritten, NULL );
+ (void) WriteFile( GetStdHandle( STD_OUTPUT_HANDLE ), aBuffer, dwRead, &dwWritten, NULL );
}
return 0;
@@ -150,10 +148,9 @@ DWORD WINAPI ErrorThread( LPVOID pParam )
while ( ReadFile( hReadPipe, &aBuffer, sizeof(aBuffer), &dwRead, NULL ) )
{
- BOOL fSuccess;
DWORD dwWritten;
- fSuccess = WriteFile( GetStdHandle( STD_ERROR_HANDLE ), aBuffer, dwRead, &dwWritten, NULL );
+ (void) WriteFile( GetStdHandle( STD_ERROR_HANDLE ), aBuffer, dwRead, &dwWritten, NULL );
}
return 0;
@@ -224,10 +221,10 @@ DWORD WINAPI InputThread( LPVOID pParam )
//Do the conversion.
MultiByteToWideChar(
GetConsoleCP(), MB_PRECOMPOSED, readBuf, readAll, wideBuf, sizeWBuf);
-
- BOOL fSuccess;
- DWORD dwWritten;
- fSuccess = WriteFile( hWritePipe, wideBuf, sizeWBuf * 2, &dwWritten, NULL );
+
+ DWORD dwWritten;
+ (void)WriteFile( hWritePipe, wideBuf, sizeWBuf * 2, &dwWritten, NULL );
+
delete[] wideBuf;
readAll = 0;
}
@@ -244,10 +241,8 @@ DWORD WINAPI InputThread( LPVOID pParam )
while ( ReadFile( GetStdHandle( STD_INPUT_HANDLE ), &aBuffer, sizeof(aBuffer), &dwRead, NULL ) )
{
- BOOL fSuccess;
- DWORD dwWritten;
-
- fSuccess = WriteFile( hWritePipe, aBuffer, dwRead, &dwWritten, NULL );
+ DWORD dwWritten;
+ (void) WriteFile( hWritePipe, aBuffer, dwRead, &dwWritten, NULL );
}
return 0;
diff --git a/desktop/win32/source/setup/setup.cpp b/desktop/win32/source/setup/setup.cpp
index 84065cce6959..d373233e2e68 100644
--- a/desktop/win32/source/setup/setup.cpp
+++ b/desktop/win32/source/setup/setup.cpp
@@ -1675,7 +1675,7 @@ boolean SetupAppX::GetCmdLineParameters( LPTSTR *pCmdLine )
boolean SetupAppX::IsAdmin()
{
PSID aPsidAdmin;
- SID_IDENTIFIER_AUTHORITY aAuthority = SECURITY_NT_AUTHORITY;
+ SID_IDENTIFIER_AUTHORITY aAuthority = { SECURITY_NT_AUTHORITY };
if ( !AllocateAndInitializeSid( &aAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0,