[PATCH 3/3] [Msvcrt]: fixed space in type with double indirection

Eric Pouech eric.pouech at orange.fr
Mon Apr 28 14:18:32 CDT 2008


Spotted by James Hawkins

A+
---

 dlls/msvcrt/tests/cpp.c |    2 +-
 dlls/msvcrt/undname.c   |   12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)


diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c
index 2b815b7..ef80cac 100644
--- a/dlls/msvcrt/tests/cpp.c
+++ b/dlls/msvcrt/tests/cpp.c
@@ -984,7 +984,7 @@ static void test_demangle(void)
 {"?$AAA@$DBAB@", "AAA<`template-parameter257'>"},
 {"?$AAA@?C@", "AAA<`template-parameter-2'>"},
 {"?$AAA at PAUBBB@@", "AAA<struct BBB *>"},
-{"??$ccccc at PAVaaa@@@bar at bb@foo@@DGPAV0 at PAV0@PAVee@@IPAPAVaaa@@1 at Z", "private: static class bar * __stdcall foo::bb::bar::ccccc<class aaa *>(class bar *,class ee *,unsigned int,class aaa **,class ee *)"},
+{"??$ccccc at PAVaaa@@@bar at bb@foo@@DGPAV0 at PAV0@PAVee@@IPAPAVaaa@@1 at Z", "private: static class bar * __stdcall foo::bb::bar::ccccc<class aaa *>(class bar *,class ee *,unsigned int,class aaa * *,class ee *)"},
 {"?f at T@@QAEHQCY1BE at BO@D at Z", "public: int __thiscall T::f(char (volatile * const)[20][30])"},
 {"?f at T@@QAEHQAY2BE at BO@CI at D@Z", "public: int __thiscall T::f(char (* const)[20][30][40])"},
 {"?f at T@@QAEHQAY1BE at BO@$$CBD at Z", "public: int __thiscall T::f(char const (* const)[20][30])"},
diff --git a/dlls/msvcrt/undname.c b/dlls/msvcrt/undname.c
index 9bc0970..1d9fae7 100644
--- a/dlls/msvcrt/undname.c
+++ b/dlls/msvcrt/undname.c
@@ -410,7 +410,7 @@ static BOOL get_modifier(char ch, const char** ret)
 }
 
 static BOOL get_modified_type(struct datatype_t *ct, struct parsed_symbol* sym,
-                              struct array *pmt_ref, char modif)
+                              struct array *pmt_ref, char modif, BOOL in_args)
 {
     const char* modifier;
     const char* str_modif;
@@ -465,7 +465,7 @@ static BOOL get_modified_type(struct datatype_t *ct, struct parsed_symbol* sym,
         else
         {
             /* don't insert a space between duplicate '*' */
-            if (str_modif[0] && str_modif[1] == '*' && sub_ct.left[strlen(sub_ct.left)-1] == '*')
+            if (!in_args && str_modif[0] && str_modif[1] == '*' && sub_ct.left[strlen(sub_ct.left)-1] == '*')
                 str_modif++;
             ct->left = str_printf(sym, "%s%s", sub_ct.left, str_modif );
         }
@@ -793,17 +793,17 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
         }
         else
         {
-            if (!get_modified_type(ct, sym, pmt_ref, '?')) goto done;
+            if (!get_modified_type(ct, sym, pmt_ref, '?', in_args)) goto done;
         }
         break;
     case 'A': /* reference */
     case 'B': /* volatile reference */
-        if (!get_modified_type(ct, sym, pmt_ref, dt)) goto done;
+        if (!get_modified_type(ct, sym, pmt_ref, dt, in_args)) goto done;
         break;
     case 'Q': /* const pointer */
     case 'R': /* volatile pointer */
     case 'S': /* const volatile pointer */
-        if (!get_modified_type(ct, sym, pmt_ref, in_args ? dt : 'P')) goto done;
+        if (!get_modified_type(ct, sym, pmt_ref, in_args ? dt : 'P', in_args)) goto done;
         break;
     case 'P': /* Pointer */
         if (isdigit(*sym->current))
@@ -833,7 +833,7 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
             }
             else goto done;
 	}
-	else if (!get_modified_type(ct, sym, pmt_ref, 'P')) goto done;
+	else if (!get_modified_type(ct, sym, pmt_ref, 'P', in_args)) goto done;
         break;
     case 'W':
         if (*sym->current == '4')





More information about the wine-patches mailing list