widl: Avoid FALSE:TRUE conditional expressions.
Michael Stefaniuc
mstefani at redhat.de
Tue Aug 14 16:56:28 CDT 2012
---
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
--
1.7.6.5
More information about the wine-patches
mailing list