Commit 416930d4 authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

ntdll: Use BOOL type where appropriate.

parent d234bcdb
...@@ -57,7 +57,7 @@ WINE_DECLARE_DEBUG_CHANNEL(imports); ...@@ -57,7 +57,7 @@ WINE_DECLARE_DEBUG_CHANNEL(imports);
typedef DWORD (CALLBACK *DLLENTRYPROC)(HMODULE,DWORD,LPVOID); typedef DWORD (CALLBACK *DLLENTRYPROC)(HMODULE,DWORD,LPVOID);
static int process_detaching = 0; /* set on process detach to avoid deadlocks with thread detach */ static BOOL process_detaching = FALSE; /* set on process detach to avoid deadlocks with thread detach */
static int free_lib_count; /* recursion depth of LdrUnloadDll calls */ static int free_lib_count; /* recursion depth of LdrUnloadDll calls */
static const char * const reason_names[] = static const char * const reason_names[] =
...@@ -127,7 +127,7 @@ static inline void *get_rva( HMODULE module, DWORD va ) ...@@ -127,7 +127,7 @@ static inline void *get_rva( HMODULE module, DWORD va )
} }
/* check whether the file name contains a path */ /* check whether the file name contains a path */
static inline int contains_path( LPCWSTR name ) static inline BOOL contains_path( LPCWSTR name )
{ {
return ((*name && (name[1] == ':')) || strchrW(name, '/') || strchrW(name, '\\')); return ((*name && (name[1] == ':')) || strchrW(name, '/') || strchrW(name, '\\'));
} }
...@@ -2391,7 +2391,7 @@ BOOLEAN WINAPI RtlDllShutdownInProgress(void) ...@@ -2391,7 +2391,7 @@ BOOLEAN WINAPI RtlDllShutdownInProgress(void)
void WINAPI LdrShutdownProcess(void) void WINAPI LdrShutdownProcess(void)
{ {
TRACE("()\n"); TRACE("()\n");
process_detaching = 1; process_detaching = TRUE;
process_detach(); process_detach();
} }
......
...@@ -850,7 +850,7 @@ static inline void do_cpuid(unsigned int ax, unsigned int *p) ...@@ -850,7 +850,7 @@ static inline void do_cpuid(unsigned int ax, unsigned int *p)
} }
/* From xf86info havecpuid.c 1.11 */ /* From xf86info havecpuid.c 1.11 */
static inline int have_cpuid(void) static inline BOOL have_cpuid(void)
{ {
#ifdef __i386__ #ifdef __i386__
unsigned int f1, f2; unsigned int f1, f2;
...@@ -868,16 +868,16 @@ static inline int have_cpuid(void) ...@@ -868,16 +868,16 @@ static inline int have_cpuid(void)
: "ir" (0x00200000)); : "ir" (0x00200000));
return ((f1^f2) & 0x00200000) != 0; return ((f1^f2) & 0x00200000) != 0;
#elif defined(__x86_64__) #elif defined(__x86_64__)
return 1; return TRUE;
#else #else
return 0; return FALSE;
#endif #endif
} }
/* Detect if a SSE2 processor is capable of Denormals Are Zero (DAZ) mode. /* Detect if a SSE2 processor is capable of Denormals Are Zero (DAZ) mode.
* *
* This function assumes you have already checked for SSE2/FXSAVE support. */ * This function assumes you have already checked for SSE2/FXSAVE support. */
static inline int have_sse_daz_mode(void) static inline BOOL have_sse_daz_mode(void)
{ {
#ifdef __i386__ #ifdef __i386__
typedef struct DECLSPEC_ALIGN(16) _M128A { typedef struct DECLSPEC_ALIGN(16) _M128A {
...@@ -913,7 +913,7 @@ static inline int have_sse_daz_mode(void) ...@@ -913,7 +913,7 @@ static inline int have_sse_daz_mode(void)
return (state->MxCsr_Mask & (1 << 6)) >> 6; return (state->MxCsr_Mask & (1 << 6)) >> 6;
#else /* all x86_64 processors include SSE2 with DAZ mode */ #else /* all x86_64 processors include SSE2 with DAZ mode */
return 1; return TRUE;
#endif #endif
} }
......
...@@ -814,7 +814,7 @@ static inline unsigned int handle_to_index( HANDLE handle, unsigned int *entry ) ...@@ -814,7 +814,7 @@ static inline unsigned int handle_to_index( HANDLE handle, unsigned int *entry )
* *
* Caller must hold fd_cache_section. * Caller must hold fd_cache_section.
*/ */
static int add_fd_to_cache( HANDLE handle, int fd, enum server_fd_type type, static BOOL add_fd_to_cache( HANDLE handle, int fd, enum server_fd_type type,
unsigned int access, unsigned int options ) unsigned int access, unsigned int options )
{ {
unsigned int entry, idx = handle_to_index( handle, &entry ); unsigned int entry, idx = handle_to_index( handle, &entry );
...@@ -823,7 +823,7 @@ static int add_fd_to_cache( HANDLE handle, int fd, enum server_fd_type type, ...@@ -823,7 +823,7 @@ static int add_fd_to_cache( HANDLE handle, int fd, enum server_fd_type type,
if (entry >= FD_CACHE_ENTRIES) if (entry >= FD_CACHE_ENTRIES)
{ {
FIXME( "too many allocated handles, not caching %p\n", handle ); FIXME( "too many allocated handles, not caching %p\n", handle );
return 0; return FALSE;
} }
if (!fd_cache[entry]) /* do we need to allocate a new block of entries? */ if (!fd_cache[entry]) /* do we need to allocate a new block of entries? */
...@@ -833,7 +833,7 @@ static int add_fd_to_cache( HANDLE handle, int fd, enum server_fd_type type, ...@@ -833,7 +833,7 @@ static int add_fd_to_cache( HANDLE handle, int fd, enum server_fd_type type,
{ {
void *ptr = wine_anon_mmap( NULL, FD_CACHE_BLOCK_SIZE * sizeof(struct fd_cache_entry), void *ptr = wine_anon_mmap( NULL, FD_CACHE_BLOCK_SIZE * sizeof(struct fd_cache_entry),
PROT_READ | PROT_WRITE, 0 ); PROT_READ | PROT_WRITE, 0 );
if (ptr == MAP_FAILED) return 0; if (ptr == MAP_FAILED) return FALSE;
fd_cache[entry] = ptr; fd_cache[entry] = ptr;
} }
} }
...@@ -843,7 +843,7 @@ static int add_fd_to_cache( HANDLE handle, int fd, enum server_fd_type type, ...@@ -843,7 +843,7 @@ static int add_fd_to_cache( HANDLE handle, int fd, enum server_fd_type type,
fd_cache[entry][idx].access = access; fd_cache[entry][idx].access = access;
fd_cache[entry][idx].options = options; fd_cache[entry][idx].options = options;
if (prev_fd != -1) close( prev_fd ); if (prev_fd != -1) close( prev_fd );
return 1; return TRUE;
} }
...@@ -1025,12 +1025,12 @@ int server_pipe( int fd[2] ) ...@@ -1025,12 +1025,12 @@ int server_pipe( int fd[2] )
{ {
int ret; int ret;
#ifdef HAVE_PIPE2 #ifdef HAVE_PIPE2
static int have_pipe2 = 1; static BOOL have_pipe2 = TRUE;
if (have_pipe2) if (have_pipe2)
{ {
if (!(ret = pipe2( fd, O_CLOEXEC ))) return ret; if (!(ret = pipe2( fd, O_CLOEXEC ))) return ret;
if (errno == ENOSYS || errno == EINVAL) have_pipe2 = 0; /* don't try again */ if (errno == ENOSYS || errno == EINVAL) have_pipe2 = FALSE; /* don't try again */
} }
#endif #endif
if (!(ret = pipe( fd ))) if (!(ret = pipe( fd )))
...@@ -1049,7 +1049,7 @@ int server_pipe( int fd[2] ) ...@@ -1049,7 +1049,7 @@ int server_pipe( int fd[2] )
*/ */
static void start_server(void) static void start_server(void)
{ {
static int started; /* we only try once */ static BOOL started; /* we only try once */
char *argv[3]; char *argv[3];
static char wineserver[] = "server/wineserver"; static char wineserver[] = "server/wineserver";
static char debug[] = "-d"; static char debug[] = "-d";
...@@ -1071,7 +1071,7 @@ static void start_server(void) ...@@ -1071,7 +1071,7 @@ static void start_server(void)
status = WIFEXITED(status) ? WEXITSTATUS(status) : 1; status = WIFEXITED(status) ? WEXITSTATUS(status) : 1;
if (status == 2) return; /* server lock held by someone else, will retry later */ if (status == 2) return; /* server lock held by someone else, will retry later */
if (status) exit(status); /* server failed */ if (status) exit(status); /* server failed */
started = 1; started = TRUE;
} }
} }
...@@ -1428,7 +1428,7 @@ NTSTATUS server_init_process_done(void) ...@@ -1428,7 +1428,7 @@ NTSTATUS server_init_process_done(void)
*/ */
size_t server_init_thread( void *entry_point ) size_t server_init_thread( void *entry_point )
{ {
static const int is_win64 = (sizeof(void *) > sizeof(int)); static const BOOL is_win64 = (sizeof(void *) > sizeof(int));
const char *arch = getenv( "WINEARCH" ); const char *arch = getenv( "WINEARCH" );
int ret; int ret;
int reply_pipe[2]; int reply_pipe[2];
......
...@@ -814,7 +814,7 @@ static const char *dwarf_reg_names[NB_FRAME_REGS] = ...@@ -814,7 +814,7 @@ static const char *dwarf_reg_names[NB_FRAME_REGS] =
/* 33-40 */ "%st0", "%st1", "%st2", "%st3", "%st4", "%st5", "%st6", "%st7" /* 33-40 */ "%st0", "%st1", "%st2", "%st3", "%st4", "%st5", "%st6", "%st7"
}; };
static int valid_reg( ULONG_PTR reg ) static BOOL valid_reg( ULONG_PTR reg )
{ {
if (reg >= NB_FRAME_REGS) FIXME( "unsupported reg %lx\n", reg ); if (reg >= NB_FRAME_REGS) FIXME( "unsupported reg %lx\n", reg );
return (reg < NB_FRAME_REGS); return (reg < NB_FRAME_REGS);
...@@ -1383,7 +1383,7 @@ static inline void *get_signal_stack(void) ...@@ -1383,7 +1383,7 @@ static inline void *get_signal_stack(void)
* *
* Check if pointer is inside the signal stack. * Check if pointer is inside the signal stack.
*/ */
static inline int is_inside_signal_stack( void *ptr ) static inline BOOL is_inside_signal_stack( void *ptr )
{ {
return ((char *)ptr >= (char *)get_signal_stack() && return ((char *)ptr >= (char *)get_signal_stack() &&
(char *)ptr < (char *)get_signal_stack() + signal_stack_size); (char *)ptr < (char *)get_signal_stack() + signal_stack_size);
......
...@@ -135,7 +135,7 @@ static void *user_space_limit; ...@@ -135,7 +135,7 @@ static void *user_space_limit;
static void *working_set_limit; static void *working_set_limit;
static void *address_space_start = (void *)0x10000; static void *address_space_start = (void *)0x10000;
#endif /* __i386__ */ #endif /* __i386__ */
static const int is_win64 = (sizeof(void *) > sizeof(int)); static const BOOL is_win64 = (sizeof(void *) > sizeof(int));
#define ROUND_ADDR(addr,mask) \ #define ROUND_ADDR(addr,mask) \
((void *)((UINT_PTR)(addr) & ~(UINT_PTR)(mask))) ((void *)((UINT_PTR)(addr) & ~(UINT_PTR)(mask)))
...@@ -151,8 +151,8 @@ static const int is_win64 = (sizeof(void *) > sizeof(int)); ...@@ -151,8 +151,8 @@ static const int is_win64 = (sizeof(void *) > sizeof(int));
static HANDLE virtual_heap; static HANDLE virtual_heap;
static void *preload_reserve_start; static void *preload_reserve_start;
static void *preload_reserve_end; static void *preload_reserve_end;
static int use_locks; static BOOL use_locks;
static int force_exec_prot; /* whether to force PROT_EXEC on all PROT_READ mmaps */ static BOOL force_exec_prot; /* whether to force PROT_EXEC on all PROT_READ mmaps */
/*********************************************************************** /***********************************************************************
...@@ -410,7 +410,7 @@ static void remove_reserved_area( void *addr, size_t size ) ...@@ -410,7 +410,7 @@ static void remove_reserved_area( void *addr, size_t size )
* *
* Check if an address range goes beyond a given limit. * Check if an address range goes beyond a given limit.
*/ */
static inline int is_beyond_limit( const void *addr, size_t size, const void *limit ) static inline BOOL is_beyond_limit( const void *addr, size_t size, const void *limit )
{ {
return (addr >= limit || (const char *)addr + size > (const char *)limit); return (addr >= limit || (const char *)addr + size > (const char *)limit);
} }
...@@ -1452,7 +1452,7 @@ void virtual_init(void) ...@@ -1452,7 +1452,7 @@ void virtual_init(void)
*/ */
void virtual_init_threading(void) void virtual_init_threading(void)
{ {
use_locks = 1; use_locks = TRUE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment