summaryrefslogtreecommitdiffstats
path: root/libiberty/cplus-dem.c
diff options
context:
space:
mode:
authoraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-06 19:29:24 +0000
committeraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-06 19:29:24 +0000
commitff02de610f5bca33ed5ea55d530485b91928556f (patch)
tree81414498df5f202e2c1ae3671e2388ec8582a8b8 /libiberty/cplus-dem.c
parentbae58a4d7cf38f9b11a72c3ce0c51f330d013413 (diff)
downloadppe42-gcc-ff02de610f5bca33ed5ea55d530485b91928556f.tar.gz
ppe42-gcc-ff02de610f5bca33ed5ea55d530485b91928556f.zip
* libiberty/cplus-dem.c (ada_demangle): Get rid of unneeded
variable and of strict-aliasing warning. (grow_vect): Use char as first parameter. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57866 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/cplus-dem.c')
-rw-r--r--libiberty/cplus-dem.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index 4c4778375b0..f42d6181d40 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -514,7 +514,7 @@ recursively_demangle PARAMS ((struct work_stuff *, const char **, string *,
int));
static void
-grow_vect PARAMS ((void **, size_t *, size_t, int));
+grow_vect PARAMS ((char **, size_t *, size_t, int));
/* Translate count to integer, consuming tokens in the process.
Conversion terminates on the first non-digit character.
@@ -936,7 +936,7 @@ cplus_demangle (mangled, options)
static void
grow_vect (old_vect, size, min_size, element_size)
- void **old_vect;
+ char **old_vect;
size_t *size;
size_t min_size;
int element_size;
@@ -969,8 +969,7 @@ ada_demangle (mangled, option)
char *demangled = NULL;
int at_start_name;
int changed;
- char *demangling_buffer = NULL;
- size_t demangling_buffer_size = 0;
+ size_t demangled_size = 0;
changed = 0;
@@ -998,10 +997,9 @@ ada_demangle (mangled, option)
}
/* Make demangled big enough for possible expansion by operator name. */
- grow_vect ((void **) &(demangling_buffer),
- &demangling_buffer_size, 2 * len0 + 1,
+ grow_vect (&demangled,
+ &demangled_size, 2 * len0 + 1,
sizeof (char));
- demangled = demangling_buffer;
if (ISDIGIT ((unsigned char) mangled[len0 - 1])) {
for (i = len0 - 2; i >= 0 && ISDIGIT ((unsigned char) mangled[i]); i -= 1)
@@ -1051,10 +1049,10 @@ ada_demangle (mangled, option)
return demangled;
Suppress:
- grow_vect ((void **) &(demangling_buffer),
- &demangling_buffer_size, strlen (mangled) + 3,
+ grow_vect (&demangled,
+ &demangled_size, strlen (mangled) + 3,
sizeof (char));
- demangled = demangling_buffer;
+
if (mangled[0] == '<')
strcpy (demangled, mangled);
else
OpenPOWER on IntegriCloud