From abef6ab366ad0fb45379322fc2a95cab3f065b62 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Thu, 9 Aug 2012 09:32:54 +0200 Subject: [PATCH] ntdll: Avoid TRUE:FALSE conditional expressions. --- dlls/ntdll/nt.c | 4 ++-- dlls/ntdll/printf.c | 6 +++--- dlls/ntdll/rtlbitmap.c | 2 +- dlls/ntdll/threadpool.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 775b6f1d4be..7b161e5b9a7 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -610,7 +610,7 @@ NTSTATUS WINAPI NtPrivilegeCheck( SERVER_START_REQ( check_token_privileges ) { req->handle = wine_server_obj_handle( ClientToken ); - req->all_required = ((RequiredPrivileges->Control & PRIVILEGE_SET_ALL_NECESSARY) ? TRUE : FALSE); + req->all_required = (RequiredPrivileges->Control & PRIVILEGE_SET_ALL_NECESSARY) != 0; wine_server_add_data( req, RequiredPrivileges->Privilege, RequiredPrivileges->PrivilegeCount * sizeof(RequiredPrivileges->Privilege[0]) ); wine_server_set_reply( req, RequiredPrivileges->Privilege, @@ -619,7 +619,7 @@ NTSTATUS WINAPI NtPrivilegeCheck( status = wine_server_call( req ); if (status == STATUS_SUCCESS) - *Result = (reply->has_privileges ? TRUE : FALSE); + *Result = reply->has_privileges != 0; } SERVER_END_REQ; return status; diff --git a/dlls/ntdll/printf.c b/dlls/ntdll/printf.c index 1aca399efa8..432920ba039 100644 --- a/dlls/ntdll/printf.c +++ b/dlls/ntdll/printf.c @@ -244,7 +244,7 @@ static inline BOOL pf_is_integer_format( char fmt ) static const char float_fmts[] = "diouxX"; if (!fmt) return FALSE; - return strchr( float_fmts, fmt ) ? TRUE : FALSE; + return strchr( float_fmts, fmt ) != 0; } static inline BOOL pf_is_double_format( char fmt ) @@ -252,7 +252,7 @@ static inline BOOL pf_is_double_format( char fmt ) static const char float_fmts[] = "aeEfgG"; if (!fmt) return FALSE; - return strchr( float_fmts, fmt ) ? TRUE : FALSE; + return strchr( float_fmts, fmt ) != 0; } static inline BOOL pf_is_valid_format( char fmt ) @@ -260,7 +260,7 @@ static inline BOOL pf_is_valid_format( char fmt ) static const char float_fmts[] = "acCdeEfgGinouxX"; if (!fmt) return FALSE; - return strchr( float_fmts, fmt ) ? TRUE : FALSE; + return strchr( float_fmts, fmt ) != 0; } static void pf_rebuild_format_string( char *p, pf_flags *flags ) diff --git a/dlls/ntdll/rtlbitmap.c b/dlls/ntdll/rtlbitmap.c index 806e0e80da5..20d6a0248c9 100644 --- a/dlls/ntdll/rtlbitmap.c +++ b/dlls/ntdll/rtlbitmap.c @@ -956,7 +956,7 @@ static ULONG NTDLL_FindRuns(PCRTL_BITMAP lpBits, PRTL_BITMAP_RUN lpSeries, ULONG ulCount, BOOLEAN bLongest, ULONG (*fn)(PCRTL_BITMAP,ULONG,PULONG)) { - BOOL bNeedSort = ulCount > 1 ? TRUE : FALSE; + BOOL bNeedSort = ulCount > 1; ULONG ulPos = 0, ulRuns = 0; TRACE("(%p,%p,%d,%d)\n", lpBits, lpSeries, ulCount, bLongest); diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c index ef61ad0f821..bd6e06b4f45 100644 --- a/dlls/ntdll/threadpool.c +++ b/dlls/ntdll/threadpool.c @@ -344,7 +344,7 @@ static DWORD CALLBACK wait_thread_proc(LPVOID Arg) { struct wait_work_item *wait_work_item = Arg; NTSTATUS status; - BOOLEAN alertable = (wait_work_item->Flags & WT_EXECUTEINIOTHREAD) ? TRUE : FALSE; + BOOLEAN alertable = (wait_work_item->Flags & WT_EXECUTEINIOTHREAD) != 0; HANDLE handles[2] = { wait_work_item->Object, wait_work_item->CancelEvent }; LARGE_INTEGER timeout; HANDLE completion_event;