kernel32: Use BOOL type where appropriate.

This commit is contained in:
Frédéric Delanoy 2013-10-24 00:40:22 +02:00 committed by Alexandre Julliard
parent c39eac6332
commit 7ab78b4e03
5 changed files with 20 additions and 20 deletions

View File

@ -2272,7 +2272,7 @@ static int CONSOLE_WriteChars(HANDLE hCon, LPCWSTR lpBuffer, int nc, COORD* pos)
* WriteConsoleOutput helper: handles passing to next line (+scrolling if necessary)
*
*/
static int next_line(HANDLE hCon, CONSOLE_SCREEN_BUFFER_INFO* csbi)
static BOOL next_line(HANDLE hCon, CONSOLE_SCREEN_BUFFER_INFO* csbi)
{
SMALL_RECT src;
CHAR_INFO ci;
@ -2281,7 +2281,7 @@ static int next_line(HANDLE hCon, CONSOLE_SCREEN_BUFFER_INFO* csbi)
csbi->dwCursorPosition.X = 0;
csbi->dwCursorPosition.Y++;
if (csbi->dwCursorPosition.Y < csbi->dwSize.Y) return 1;
if (csbi->dwCursorPosition.Y < csbi->dwSize.Y) return TRUE;
src.Top = 1;
src.Bottom = csbi->dwSize.Y - 1;
@ -2296,8 +2296,8 @@ static int next_line(HANDLE hCon, CONSOLE_SCREEN_BUFFER_INFO* csbi)
csbi->dwCursorPosition.Y--;
if (!ScrollConsoleScreenBufferW(hCon, &src, NULL, dst, &ci))
return 0;
return 1;
return FALSE;
return TRUE;
}
/******************************************************************
@ -2308,13 +2308,13 @@ static int next_line(HANDLE hCon, CONSOLE_SCREEN_BUFFER_INFO* csbi)
* handled
*
*/
static int write_block(HANDLE hCon, CONSOLE_SCREEN_BUFFER_INFO* csbi,
DWORD mode, LPCWSTR ptr, int len)
static BOOL write_block(HANDLE hCon, CONSOLE_SCREEN_BUFFER_INFO* csbi,
DWORD mode, LPCWSTR ptr, int len)
{
int blk; /* number of chars to write on current line */
int done; /* number of chars already written */
if (len <= 0) return 1;
if (len <= 0) return TRUE;
if (mode & ENABLE_WRAP_AT_EOL_OUTPUT) /* writes remaining on next line */
{
@ -2323,9 +2323,9 @@ static int write_block(HANDLE hCon, CONSOLE_SCREEN_BUFFER_INFO* csbi,
blk = min(len - done, csbi->dwSize.X - csbi->dwCursorPosition.X);
if (CONSOLE_WriteChars(hCon, ptr + done, blk, &csbi->dwCursorPosition) != blk)
return 0;
return FALSE;
if (csbi->dwCursorPosition.X == csbi->dwSize.X && !next_line(hCon, csbi))
return 0;
return FALSE;
}
}
else
@ -2342,11 +2342,11 @@ static int write_block(HANDLE hCon, CONSOLE_SCREEN_BUFFER_INFO* csbi,
csbi->dwCursorPosition.X = pos;
if (CONSOLE_WriteChars(hCon, ptr + done, blk, &csbi->dwCursorPosition) != blk)
return 0;
return FALSE;
}
}
return 1;
return TRUE;
}
/***********************************************************************
@ -2491,7 +2491,7 @@ BOOL WINAPI WriteConsoleA(HANDLE hConsoleOutput, LPCVOID lpBuffer, DWORD nNumber
if (lpNumberOfCharsWritten) *lpNumberOfCharsWritten = 0;
xstring = HeapAlloc(GetProcessHeap(), 0, n * sizeof(WCHAR));
if (!xstring) return 0;
if (!xstring) return FALSE;
MultiByteToWideChar(GetConsoleOutputCP(), 0, lpBuffer, nNumberOfCharsToWrite, xstring, n);
@ -3009,7 +3009,7 @@ unsigned CONSOLE_GetNumHistoryEntries(void)
*/
BOOL CONSOLE_GetEditionMode(HANDLE hConIn, int* mode)
{
unsigned ret = FALSE;
unsigned ret = 0;
SERVER_START_REQ(get_console_input_info)
{
req->handle = console_handle_unmap(hConIn);

View File

@ -247,7 +247,7 @@ BOOL WINAPI SetEnvironmentVariableA( LPCSTR name, LPCSTR value )
if (!name)
{
SetLastError(ERROR_ENVVAR_NOT_FOUND);
return 0;
return FALSE;
}
RtlCreateUnicodeStringFromAsciiz( &us_name, name );
@ -280,7 +280,7 @@ BOOL WINAPI SetEnvironmentVariableW( LPCWSTR name, LPCWSTR value )
if (!name)
{
SetLastError(ERROR_ENVVAR_NOT_FOUND);
return 0;
return FALSE;
}
RtlInitUnicodeString(&us_name, name);

View File

@ -346,7 +346,7 @@ EXIT:
*
* returns TRUE for the two first conditions, FALSE for the last
*/
static int start_debugger_atomic(PEXCEPTION_POINTERS epointers)
static BOOL start_debugger_atomic(PEXCEPTION_POINTERS epointers)
{
static HANDLE hRunOnce /* = 0 */;

View File

@ -50,7 +50,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(sync);
/* check if current version is NT or Win95 */
static inline int is_version_nt(void)
static inline BOOL is_version_nt(void)
{
return !(GetVersion() & 0x80000000);
}
@ -1467,7 +1467,7 @@ BOOL WINAPI WaitNamedPipeA (LPCSTR name, DWORD nTimeOut)
if (!MultiByteToWideChar( CP_ACP, 0, name, -1, buffer, MAX_PATH ))
{
SetLastError( ERROR_FILENAME_EXCED_RANGE );
return 0;
return FALSE;
}
return WaitNamedPipeW( buffer, nTimeOut );
}

View File

@ -67,9 +67,9 @@ static const int MonthLengths[2][12] =
{ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
};
static inline int IsLeapYear(int Year)
static inline BOOL IsLeapYear(int Year)
{
return Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) ? 1 : 0;
return Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0);
}
/***********************************************************************