Michael Stefaniuc : ntdll: Avoid TRUE:FALSE conditional expressions.
Alexandre Julliard
julliard at winehq.org
Tue Aug 14 12:59:51 CDT 2012
Module: wine
Branch: master
Commit: abef6ab366ad0fb45379322fc2a95cab3f065b62
URL: http://source.winehq.org/git/wine.git/?a=commit;h=abef6ab366ad0fb45379322fc2a95cab3f065b62
Author: Michael Stefaniuc <mstefani at redhat.de>
Date: Thu Aug 9 09:32:54 2012 +0200
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 775b6f1..7b161e5 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 1aca399..432920b 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 806e0e8..20d6a02 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 ef61ad0..bd6e06b 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;
More information about the wine-cvs
mailing list