Michael Stefaniuc : widl: Avoid FALSE:TRUE conditional expressions.
Alexandre Julliard
julliard at winehq.org
Wed Aug 15 14:08:32 CDT 2012
Module: wine
Branch: master
Commit: 2c97f3fcb5ecc73db7b1ab601dac00f93eb8a60b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2c97f3fcb5ecc73db7b1ab601dac00f93eb8a60b
Author: Michael Stefaniuc <mstefani at redhat.de>
Date: Tue Aug 14 23:56:28 2012 +0200
widl: Avoid FALSE:TRUE conditional expressions.
---
tools/widl/server.c | 5 ++---
tools/widl/typegen.c | 5 +++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/widl/server.c b/tools/widl/server.c
index 7f817b0..29b5bec 100644
--- a/tools/widl/server.c
+++ b/tools/widl/server.c
@@ -175,11 +175,10 @@ static void write_function_stub(const type_t *iface, const var_t *func, unsigned
/* if the context_handle attribute appears in the chain of types
* without pointers being followed, then the context handle must
* be direct, otherwise it is a pointer */
- int is_ch_ptr = is_aliaschain_attr(var->type, ATTR_CONTEXTHANDLE) ? FALSE : TRUE;
+ const char *ch_ptr = is_aliaschain_attr(var->type, ATTR_CONTEXTHANDLE) ? "*" : "";
print_server("(");
write_type_decl_left(server, var->type);
- fprintf(server, ")%sNDRSContextValue(__frame->%s)",
- is_ch_ptr ? "" : "*", var->name);
+ fprintf(server, ")%sNDRSContextValue(__frame->%s)", ch_ptr, var->name);
}
else
{
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 516d8e7..280bd05 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -4146,10 +4146,11 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const
/* if the context_handle attribute appears in the chain of types
* without pointers being followed, then the context handle must
* be direct, otherwise it is a pointer */
- int is_ch_ptr = is_aliaschain_attr(type, ATTR_CONTEXTHANDLE) ? FALSE : TRUE;
+ const char *ch_ptr = is_aliaschain_attr(type, ATTR_CONTEXTHANDLE) ? "" : "*";
print_file(file, indent, "NdrClientContextMarshall(\n");
print_file(file, indent + 1, "&__frame->_StubMsg,\n");
- print_file(file, indent + 1, "(NDR_CCONTEXT)%s%s%s,\n", is_ch_ptr ? "*" : "", local_var_prefix, var->name);
+ print_file(file, indent + 1, "(NDR_CCONTEXT)%s%s%s,\n", ch_ptr, local_var_prefix,
+ var->name);
print_file(file, indent + 1, "%s);\n", in_attr && out_attr ? "1" : "0");
}
else
More information about the wine-cvs
mailing list