Dan Hipschman : widl: Set the pointer description offset to zero if there are no pointers.

Alexandre Julliard julliard at winehq.org
Thu Sep 20 10:30:06 CDT 2007


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

Author: Dan Hipschman <dsh at linux.ucla.edu>
Date:   Wed Sep 19 17:04:09 2007 -0700

widl: Set the pointer description offset to zero if there are no pointers.

---

 tools/widl/typegen.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 6625bda..84efe96 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -1677,9 +1677,10 @@ static size_t write_struct_tfs(FILE *file, type_t *type,
         /* On the sizing pass, type->ptrdesc may be zero, but it's ok as
            nothing is written to file yet.  On the actual writing pass,
            this will have been updated.  */
-        short reloff = type->ptrdesc - *tfsoff;
+        unsigned int absoff = type->ptrdesc ? type->ptrdesc : *tfsoff;
+        short reloff = absoff - *tfsoff;
         print_file(file, 2, "NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n",
-                   reloff, reloff, type->ptrdesc);
+                   reloff, reloff, absoff);
         *tfsoff += 2;
     }
     else if ((type->type == RPC_FC_PSTRUCT) ||
@@ -1708,6 +1709,8 @@ static size_t write_struct_tfs(FILE *file, type_t *type,
             if (is_ptr(ft))
                 write_pointer_tfs(file, ft, tfsoff);
         }
+        if (type->ptrdesc == *tfsoff)
+            type->ptrdesc = 0;
     }
 
     current_structure = save_current_structure;




More information about the wine-cvs mailing list