Michael Stefaniuc : server: Avoid TRUE:FALSE conditional expressions.
Alexandre Julliard
julliard at winehq.org
Mon Aug 13 13:21:17 CDT 2012
Module: wine
Branch: master
Commit: 794ad909825763984979ef1d8a9f035c45d78a0d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=794ad909825763984979ef1d8a9f035c45d78a0d
Author: Michael Stefaniuc <mstefani at redhat.de>
Date: Wed Aug 8 10:10:44 2012 +0200
server: Avoid TRUE:FALSE conditional expressions.
---
server/security.h | 4 ++--
server/token.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/server/security.h b/server/security.h
index d5f629d..38e36c0 100644
--- a/server/security.h
+++ b/server/security.h
@@ -90,7 +90,7 @@ extern int sd_is_valid( const struct security_descriptor *sd, data_size_t size )
/* gets the discretionary access control list from a security descriptor */
static inline const ACL *sd_get_dacl( const struct security_descriptor *sd, int *present )
{
- *present = (sd->control & SE_DACL_PRESENT ? TRUE : FALSE);
+ *present = (sd->control & SE_DACL_PRESENT) != 0;
if (sd->dacl_len)
return (const ACL *)((const char *)(sd + 1) +
@@ -102,7 +102,7 @@ static inline const ACL *sd_get_dacl( const struct security_descriptor *sd, int
/* gets the system access control list from a security descriptor */
static inline const ACL *sd_get_sacl( const struct security_descriptor *sd, int *present )
{
- *present = (sd->control & SE_SACL_PRESENT ? TRUE : FALSE);
+ *present = (sd->control & SE_SACL_PRESENT) != 0;
if (sd->sacl_len)
return (const ACL *)((const char *)(sd + 1) +
diff --git a/server/token.c b/server/token.c
index a0ec143..b66a603 100644
--- a/server/token.c
+++ b/server/token.c
@@ -475,9 +475,9 @@ static struct token *create_token( unsigned primary, const SID *user,
memcpy( &group->sid, groups[i].Sid, FIELD_OFFSET( SID, SubAuthority[((const SID *)groups[i].Sid)->SubAuthorityCount] ) );
group->enabled = TRUE;
group->def = TRUE;
- group->logon = (groups[i].Attributes & SE_GROUP_LOGON_ID) ? TRUE : FALSE;
- group->mandatory = (groups[i].Attributes & SE_GROUP_MANDATORY) ? TRUE : FALSE;
- group->owner = groups[i].Attributes & SE_GROUP_OWNER ? TRUE : FALSE;
+ group->logon = (groups[i].Attributes & SE_GROUP_LOGON_ID) != 0;
+ group->mandatory = (groups[i].Attributes & SE_GROUP_MANDATORY) != 0;
+ group->owner = (groups[i].Attributes & SE_GROUP_OWNER) != 0;
group->resource = FALSE;
group->deny_only = FALSE;
list_add_tail( &token->groups, &group->entry );
More information about the wine-cvs
mailing list