Commit 656de48e authored by Michael Karcher's avatar Michael Karcher Committed by Alexandre Julliard

widl: Write struct fields as signed fields.

parent 5f788692
...@@ -1271,6 +1271,21 @@ static void write_user_tfs(FILE *file, type_t *type, unsigned int *tfsoff) ...@@ -1271,6 +1271,21 @@ static void write_user_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
*tfsoff += 2; *tfsoff += 2;
} }
static unsigned char inline make_signed(unsigned char fc)
{
switch(fc)
{
case RPC_FC_USMALL:
return RPC_FC_SMALL;
case RPC_FC_USHORT:
return RPC_FC_SHORT;
case RPC_FC_ULONG:
return RPC_FC_LONG;
default:
return fc;
}
}
static void write_member_type(FILE *file, const type_t *cont, static void write_member_type(FILE *file, const type_t *cont,
const attr_list_t *attrs, const type_t *type, const attr_list_t *attrs, const type_t *type,
unsigned int *corroff, unsigned int *tfsoff) unsigned int *corroff, unsigned int *tfsoff)
...@@ -1306,7 +1321,7 @@ static void write_member_type(FILE *file, const type_t *cont, ...@@ -1306,7 +1321,7 @@ static void write_member_type(FILE *file, const type_t *cont,
print_file(file, 2, "0x%x,\t/* %s */\n", fc, string_of_type(fc)); print_file(file, 2, "0x%x,\t/* %s */\n", fc, string_of_type(fc));
*tfsoff += 1; *tfsoff += 1;
} }
else if (!write_base_type(file, type->type, tfsoff)) else if (!write_base_type(file, make_signed(type->type), tfsoff))
error("Unsupported member type 0x%x\n", type->type); error("Unsupported member type 0x%x\n", type->type);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment