static char *
mop_up PARAMS ((struct work_stuff *, string *, int));
-static char *
+static void
squangle_mop_up PARAMS ((struct work_stuff *));
#if 0
#endif
static char *
-internal_cplus_demangle PARAMS ((struct work_stuff *, const char *, int));
+internal_cplus_demangle PARAMS ((struct work_stuff *, const char *));
static int
demangle_template_template_parm PARAMS ((struct work_stuff *work,
char *result;
int options;
{
- int len, i, len1, ret;
+ int len, len1, ret;
string type;
struct work_stuff work[1];
const char *tem;
len = strlen(opname);
result[0] = '\0';
ret = 0;
+ memset ((char *) work, 0, sizeof (work));
work->options = options;
if (opname[0] == '_' && opname[1] == '_'
if (opname[4] == '\0')
{
/* Operator. */
+ size_t i;
for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
{
if (strlen (optable[i].in) == 2
if (opname[2] == 'a' && opname[5] == '\0')
{
/* Assignment. */
+ size_t i;
for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
{
if (strlen (optable[i].in) == 3
if (len >= 10 /* op$assign_ */
&& memcmp (opname + 3, "assign_", 7) == 0)
{
+ size_t i;
for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
{
len1 = len - 10;
}
else
{
+ size_t i;
for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
{
len1 = len - 3;
const char *opname;
int options;
{
- int i;
+ size_t i;
int len;
len = strlen (opname);
if ((work -> options & DMGL_STYLE_MASK) == 0)
work -> options |= (int) current_demangling_style & DMGL_STYLE_MASK;
- ret = internal_cplus_demangle (work, mangled, options);
+ ret = internal_cplus_demangle (work, mangled);
squangle_mop_up (work);
return (ret);
}
calls go directly to this routine to avoid resetting that info. */
static char *
-internal_cplus_demangle (work, mangled, options)
+internal_cplus_demangle (work, mangled)
struct work_stuff *work;
const char *mangled;
- int options;
{
string decl;
/* Clear out and squangling related storage */
-static char *
+static void
squangle_mop_up (work)
struct work_stuff *work;
{
{
remember_type (work, oldmangled, *mangled - oldmangled);
}
- string_append(&tname, (work -> options & DMGL_JAVA) ? "." : "::");
+ string_append (&tname, "::");
+
string_prepends(declp, &tname);
if (work -> destructor & 1)
{
char *p = xmalloc (symbol_len + 1), *q;
strncpy (p, *mangled, symbol_len);
p [symbol_len] = '\0';
- q = internal_cplus_demangle (work, p, work->options);
+ q = internal_cplus_demangle (work, p);
string_appendn (s, "&", 1);
if (q)
{
int need_comma = 0;
int success = 0;
const char *start;
- int is_java_array = 0;
string temp;
(*mangled)++;
}
if (trawname)
string_appendn (trawname, *mangled, r);
- is_java_array = (work -> options & DMGL_JAVA)
- && strncmp (*mangled, "JArray1Z", 8) == 0;
- if (! is_java_array)
- {
string_appendn (tname, *mangled, r);
- }
*mangled += r;
}
}
- if (!is_java_array)
string_append (tname, "<");
/* get size of template parameter list */
if (!get_count (mangled, &r))
}
need_comma = 1;
}
- if (is_java_array)
- {
- string_append (tname, "[]");
- }
- else
{
if (tname->p[-1] == '>')
string_append (tname, " ");
}
remember_Ktype (work, class_name.b, LEN_STRING(&class_name));
remember_Btype (work, class_name.b, LEN_STRING(&class_name), btype);
- string_prepend (declp, (work -> options & DMGL_JAVA) ? "." : "::");
+ string_prepend (declp, "::");
string_prepends (declp, &class_name);
success = 1;
}
{
if (p != NULL)
{
- string_append (declp,
- (work -> options & DMGL_JAVA) ? "." : "::");
+ string_append (declp, "::");
(*mangled)++;
}
}
/* Consumed everything up to the cplus_marker, append the
variable name. */
(*mangled)++;
- string_append (declp, (work -> options & DMGL_JAVA) ? "." : "::");
+ string_append (declp, "::");
n = strlen (*mangled);
string_appendn (declp, *mangled, n);
(*mangled) += n;
else if (strncmp (*mangled, "__thunk_", 8) == 0)
{
int delta = ((*mangled) += 8, consume_count (mangled));
- char *method = internal_cplus_demangle (work, ++*mangled, work->options);
+ char *method = internal_cplus_demangle (work, ++*mangled);
if (method)
{
char buf[50];
success = do_type (work, mangled, &temp);
if (!success) break;
}
- if (*mangled[0] == 'K')
+ else if (*mangled[0] == 'K')
{
int idx;
(*mangled)++;
if (qualifiers > 0)
{
- string_append (&temp, (work -> options & DMGL_JAVA) ? "." : "::");
+ string_append (&temp, "::");
}
}
if (isfuncname && (work->constructor & 1 || work->destructor & 1))
{
- string_append (&temp, (work -> options & DMGL_JAVA) ? "." : "::");
+ string_append (&temp, "::");
if (work -> destructor & 1)
{
string_append (&temp, "~");
{
if (!STRING_EMPTY (result))
{
- string_append (&temp, (work -> options & DMGL_JAVA) ? "." : "::");
+ string_append (&temp, "::");
}
string_prepends (result, &temp);
}
case 'P':
case 'p':
(*mangled)++;
- if (! (work -> options & DMGL_JAVA))
string_prepend (&decl, "*");
break;
}
string_append (&decl, ")");
- string_prepend (&decl, (work -> options & DMGL_JAVA) ? "." : "::");
+ string_prepend (&decl, "::");
if (isdigit (**mangled))
{
n = consume_count (mangled);
break;
case 'C':
- (*mangled)++;
+ case 'V':
/*
if ((*mangled)[1] == 'P')
{
{
string_prepend (&decl, " ");
}
- string_prepend (&decl, "const");
+ string_prepend (&decl,
+ (**mangled) == 'C' ? "const" : "volatile");
}
+ (*mangled)++;
break;
/*
}
{"strip-underscores", no_argument, 0, '_'},
{"format", required_argument, 0, 's'},
{"help", no_argument, 0, 'h'},
- {"java", no_argument, 0, 'j'},
{"no-strip-underscores", no_argument, 0, 'n'},
{"version", no_argument, 0, 'v'},
{0, no_argument, 0, 0}
case '_':
strip_underscore = 1;
break;
- case 'j':
- flags |= DMGL_JAVA;
- break;
case 's':
if (strcmp (optarg, "gnu") == 0)
{