Commit 538d1a12 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

msvcrt: Wrap get_class() and get_class_string() for unDName.

parent 29fe8d02
...@@ -491,6 +491,21 @@ static char* get_class_string(struct parsed_symbol* sym, /*const struct array* a ...@@ -491,6 +491,21 @@ static char* get_class_string(struct parsed_symbol* sym, /*const struct array* a
} }
/****************************************************************** /******************************************************************
* get_class_name
* Wrapper around get_class and get_class_string.
*/
static char* get_class_name(struct parsed_symbol* sym)
{
unsigned mark = sym->stack.num;
char* s = NULL;
if (get_class(sym))
s = get_class_string(sym, mark);
sym->stack.num = mark;
return s;
}
/******************************************************************
* get_calling_convention * get_calling_convention
* Returns a static string corresponding to the calling convention described * Returns a static string corresponding to the calling convention described
* by char 'ch'. Sets export to TRUE iff the calling convention is exported. * by char 'ch'. Sets export to TRUE iff the calling convention is exported.
...@@ -625,13 +640,11 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, ...@@ -625,13 +640,11 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
case 'V': /* class */ case 'V': /* class */
/* Class/struct/union */ /* Class/struct/union */
{ {
unsigned mark = sym->stack.num;
const char* struct_name = NULL; const char* struct_name = NULL;
const char* type_name = NULL; const char* type_name = NULL;
if (!get_class(sym) || if (!(struct_name = get_class_name(sym)))
!(struct_name = get_class_string(sym, mark))) goto done; goto done;
sym->stack.num = mark;
if (!(sym->flags & UNDNAME_NO_COMPLEX_TYPE)) if (!(sym->flags & UNDNAME_NO_COMPLEX_TYPE))
{ {
switch (dt) switch (dt)
...@@ -691,11 +704,9 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, ...@@ -691,11 +704,9 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
if (*sym->current == '4') if (*sym->current == '4')
{ {
char* enum_name; char* enum_name;
unsigned mark = sym->stack.num;
sym->current++; sym->current++;
if (!get_class(sym) || if (!(enum_name = get_class_name(sym)))
!(enum_name = get_class_string(sym, mark))) goto done; goto done;
sym->stack.num = mark;
if (sym->flags & UNDNAME_NO_COMPLEX_TYPE) if (sym->flags & UNDNAME_NO_COMPLEX_TYPE)
ct->left = enum_name; ct->left = enum_name;
else else
...@@ -813,12 +824,10 @@ static BOOL handle_data(struct parsed_symbol* sym) ...@@ -813,12 +824,10 @@ static BOOL handle_data(struct parsed_symbol* sym)
if (!get_modifier(*sym->current++, &modifier)) goto done; if (!get_modifier(*sym->current++, &modifier)) goto done;
if (*sym->current != '@') if (*sym->current != '@')
{ {
unsigned mark = sym->stack.num;
char* cls = NULL; char* cls = NULL;
if (!get_class(sym) || if (!(cls = get_class_name(sym)))
!(cls = get_class_string(sym, mark))) goto done; goto done;
sym->stack.num = mark;
ct.right = str_printf(sym, "{for `%s'}", cls); ct.right = str_printf(sym, "{for `%s'}", cls);
} }
break; break;
......
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