From 86fdca67502d19d7432f3d41ea71d7dfc32c9b08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Delanoy?= Date: Tue, 29 Oct 2013 21:54:12 +0100 Subject: [PATCH] ntdll: Use BOOL type where appropriate. --- dlls/ntdll/cdrom.c | 22 +++++++++++----------- dlls/ntdll/directory.c | 6 +++--- dlls/ntdll/loadorder.c | 4 ++-- dlls/ntdll/misc.c | 4 ++-- dlls/ntdll/resource.c | 2 +- dlls/ntdll/signal_arm.c | 4 ++-- dlls/ntdll/signal_arm64.c | 4 ++-- dlls/ntdll/signal_powerpc.c | 4 ++-- dlls/ntdll/time.c | 4 ++-- dlls/ntdll/version.c | 2 +- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c index 18c787487f8..62c3d16aebe 100644 --- a/dlls/ntdll/cdrom.c +++ b/dlls/ntdll/cdrom.c @@ -575,13 +575,13 @@ static void CDROM_ClearCacheEntry(int dev) * Determines the ide interface (the number after the ide), and the * number of the device on that interface for ide cdroms (*iface <= 1). * Determines the scsi information for scsi cdroms (*iface >= 2). - * Returns false if the info cannot not be obtained. + * Returns FALSE if the info cannot not be obtained. */ -static int CDROM_GetInterfaceInfo(int fd, UCHAR* iface, UCHAR* port, UCHAR* device, UCHAR* lun) +static BOOL CDROM_GetInterfaceInfo(int fd, UCHAR* iface, UCHAR* port, UCHAR* device, UCHAR* lun) { #if defined(linux) struct stat st; - if ( fstat(fd, &st) == -1 || ! S_ISBLK(st.st_mode)) return 0; + if ( fstat(fd, &st) == -1 || ! S_ISBLK(st.st_mode)) return FALSE; *port = 0; *iface = 0; *device = 0; @@ -615,10 +615,10 @@ static int CDROM_GetInterfaceInfo(int fd, UCHAR* iface, UCHAR* port, UCHAR* devi #endif { WARN("CD-ROM device (%d, %d) not supported\n", major(st.st_rdev), minor(st.st_rdev)); - return 0; + return FALSE; } } - return 1; + return TRUE; #elif defined(__NetBSD__) struct scsi_addr addr; if (ioctl(fd, SCIOCIDENTIFY, &addr) != -1) @@ -630,16 +630,16 @@ static int CDROM_GetInterfaceInfo(int fd, UCHAR* iface, UCHAR* port, UCHAR* devi *iface = addr.addr.scsi.scbus; *device = addr.addr.scsi.target; *lun = addr.addr.scsi.lun; - return 1; + return TRUE; case TYPE_ATAPI: *port = 0; *iface = addr.addr.atapi.atbus; *device = addr.addr.atapi.drive; *lun = 0; - return 1; + return TRUE; } } - return 0; + return FALSE; #elif defined(__APPLE__) dk_scsi_identify_t addr; if (ioctl(fd, DKIOCSCSIIDENTIFY, &addr) != -1) @@ -648,12 +648,12 @@ static int CDROM_GetInterfaceInfo(int fd, UCHAR* iface, UCHAR* port, UCHAR* devi *iface = addr.port; *device = addr.target; *lun = addr.lun; - return 1; + return TRUE; } - return 0; + return FALSE; #else FIXME("not implemented on this O/S\n"); - return 0; + return FALSE; #endif } diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 4af3456e5f2..0306f773669 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -161,7 +161,7 @@ static BOOL show_dot_files; static RTL_RUN_ONCE init_once = RTL_RUN_ONCE_INIT; /* at some point we may want to allow Winelib apps to set this */ -static const int is_case_sensitive = FALSE; +static const BOOL is_case_sensitive = FALSE; UNICODE_STRING system_dir = { 0, 0, NULL }; /* system directory */ @@ -187,7 +187,7 @@ static inline BOOL is_invalid_dos_char( WCHAR ch ) } /* check if the device can be a mounted volume */ -static inline int is_valid_mounted_device( const struct stat *st ) +static inline BOOL is_valid_mounted_device( const struct stat *st ) { #if defined(linux) || defined(__sun__) return S_ISBLK( st->st_mode ); @@ -1184,7 +1184,7 @@ static ULONG hash_short_file_name( const UNICODE_STRING *name, LPWSTR buffer ) */ static BOOLEAN match_filename( const UNICODE_STRING *name_str, const UNICODE_STRING *mask_str ) { - int mismatch; + BOOL mismatch; const WCHAR *name = name_str->Buffer; const WCHAR *mask = mask_str->Buffer; const WCHAR *name_end = name + name_str->Length / sizeof(WCHAR); diff --git a/dlls/ntdll/loadorder.c b/dlls/ntdll/loadorder.c index ae50a4c6331..401d256f1c3 100644 --- a/dlls/ntdll/loadorder.c +++ b/dlls/ntdll/loadorder.c @@ -53,7 +53,7 @@ struct loadorder_list static const WCHAR separatorsW[] = {',',' ','\t',0}; -static int init_done; +static BOOL init_done; static struct loadorder_list env_list; @@ -232,7 +232,7 @@ static void init_load_order(void) UNICODE_STRING strW; WCHAR *entry, *next; - init_done = 1; + init_done = TRUE; if (!order) return; if (!strcmp( order, "help" )) diff --git a/dlls/ntdll/misc.c b/dlls/ntdll/misc.c index a6b3b2296f5..8bd4eb795d8 100644 --- a/dlls/ntdll/misc.c +++ b/dlls/ntdll/misc.c @@ -74,12 +74,12 @@ void CDECL NTDLL_wine_get_host_version( const char **sysname, const char **relea { #ifdef HAVE_SYS_UTSNAME_H static struct utsname buf; - static int init_done; + static BOOL init_done; if (!init_done) { uname( &buf ); - init_done = 1; + init_done = TRUE; } if (sysname) *sysname = buf.sysname; if (release) *release = buf.release; diff --git a/dlls/ntdll/resource.c b/dlls/ntdll/resource.c index 0d60d96d5c5..9635bb0701d 100644 --- a/dlls/ntdll/resource.c +++ b/dlls/ntdll/resource.c @@ -56,7 +56,7 @@ static LANGID user_ui_language, system_ui_language; * * Check if a module handle is for a LOAD_LIBRARY_AS_DATAFILE module. */ -static inline int is_data_file_module( HMODULE hmod ) +static inline BOOL is_data_file_module( HMODULE hmod ) { return (ULONG_PTR)hmod & 1; } diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index 9b0f1ebe19e..6dbc7c8edee 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -876,12 +876,12 @@ void set_tpidrurw( TEB *teb ) */ void signal_init_thread( TEB *teb ) { - static int init_done; + static BOOL init_done; if (!init_done) { pthread_key_create( &teb_key, NULL ); - init_done = 1; + init_done = TRUE; } set_tpidrurw( teb ); pthread_setspecific( teb_key, teb ); diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 018d84f0993..2b829520935 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -741,12 +741,12 @@ void signal_free_thread( TEB *teb ) */ void signal_init_thread( TEB *teb ) { - static int init_done; + static BOOL init_done; if (!init_done) { pthread_key_create( &teb_key, NULL ); - init_done = 1; + init_done = TRUE; } pthread_setspecific( teb_key, teb ); } diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c index ac8095a6b82..a457bdf3b44 100644 --- a/dlls/ntdll/signal_powerpc.c +++ b/dlls/ntdll/signal_powerpc.c @@ -999,12 +999,12 @@ void signal_free_thread( TEB *teb ) */ void signal_init_thread( TEB *teb ) { - static int init_done; + static BOOL init_done; if (!init_done) { pthread_key_create( &teb_key, NULL ); - init_done = 1; + init_done = TRUE; } pthread_setspecific( teb_key, teb ); } diff --git a/dlls/ntdll/time.c b/dlls/ntdll/time.c index 2b810d459f3..c3988785120 100644 --- a/dlls/ntdll/time.c +++ b/dlls/ntdll/time.c @@ -96,9 +96,9 @@ static const int MonthLengths[2][MONSPERYEAR] = { 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); } /* return a monotonic time counter, in Win32 ticks */ diff --git a/dlls/ntdll/version.c b/dlls/ntdll/version.c index 1939c762c04..f4b10939196 100644 --- a/dlls/ntdll/version.c +++ b/dlls/ntdll/version.c @@ -476,7 +476,7 @@ void version_init( const WCHAR *appname ) { static const WCHAR configW[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e',0}; static const WCHAR appdefaultsW[] = {'A','p','p','D','e','f','a','u','l','t','s','\\',0}; - static const int is_win64 = (sizeof(void *) > sizeof(int)); + static const BOOL is_win64 = (sizeof(void *) > sizeof(int)); OBJECT_ATTRIBUTES attr; UNICODE_STRING nameW; HANDLE root, hkey, config_key;