widl: Clean up array case in write_remoting_arg.

Use a switch statement instead of multiple if statements and
explicitly write out the fixed array cases.
This commit is contained in:
Rob Shearman 2010-03-15 19:31:00 +00:00 committed by Alexandre Julliard
parent 0e6ad1fa85
commit 82ab9443b8
1 changed files with 17 additions and 11 deletions

View File

@ -3500,7 +3500,7 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const
case TGT_ARRAY: case TGT_ARRAY:
{ {
unsigned char tc = get_array_fc(type); unsigned char tc = get_array_fc(type);
const char *array_type = "FixedArray"; const char *array_type = NULL;
/* We already have the size_is expression since it's at the /* We already have the size_is expression since it's at the
top level, but do checks for multidimensional conformant top level, but do checks for multidimensional conformant
@ -3509,19 +3509,25 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const
the return value. */ the return value. */
get_size_is_expr(type, var->name); get_size_is_expr(type, var->name);
if (tc == RPC_FC_SMVARRAY || tc == RPC_FC_LGVARRAY) switch (tc)
{ {
case RPC_FC_SMFARRAY:
case RPC_FC_LGFARRAY:
array_type = "FixedArray";
break;
case RPC_FC_SMVARRAY:
case RPC_FC_LGVARRAY:
array_type = "VaryingArray"; array_type = "VaryingArray";
} break;
else if (tc == RPC_FC_CARRAY) case RPC_FC_CARRAY:
{
array_type = "ConformantArray"; array_type = "ConformantArray";
} break;
else if (tc == RPC_FC_CVARRAY || tc == RPC_FC_BOGUS_ARRAY) case RPC_FC_CVARRAY:
{ array_type = "ConformantVaryingArray";
array_type = (tc == RPC_FC_BOGUS_ARRAY break;
? "ComplexArray" case RPC_FC_BOGUS_ARRAY:
: "ConformantVaryingArray"); array_type = "ComplexArray";
break;
} }
if (pointer_type != RPC_FC_RP) array_type = "Pointer"; if (pointer_type != RPC_FC_RP) array_type = "Pointer";