Michael Karcher : widl: Write struct fields as signed fields.

Alexandre Julliard julliard at winehq.org
Thu Jan 8 08:31:15 CST 2009


Module: wine
Branch: master
Commit: 656de48e4ea5f15b5ecc58923e3a0e2f0c3fae90
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=656de48e4ea5f15b5ecc58923e3a0e2f0c3fae90

Author: Michael Karcher <wine at mkarcher.dialup.fu-berlin.de>
Date:   Thu Jan  8 00:21:42 2009 +0100

widl: Write struct fields as signed fields.

---

 tools/widl/typegen.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index d3d5cb3..7d2b751 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -1271,6 +1271,21 @@ static void write_user_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
     *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,
                               const attr_list_t *attrs, const type_t *type,
                               unsigned int *corroff, unsigned int *tfsoff)
@@ -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));
         *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);
 }
 




More information about the wine-cvs mailing list