diff options
author | DJ Delorie <dj@delorie.com> | 2001-05-08 14:35:18 +0000 |
---|---|---|
committer | DJ Delorie <dj@delorie.com> | 2001-05-08 14:35:18 +0000 |
commit | 2d73f342c45c3a4758dda9434045a22aaf09158e (patch) | |
tree | ef8970f648e333bb7750e88a5fb15d256874a146 /libiberty | |
parent | 44c5ee5b9757cd6205bb1574aa86a59e6c88591b (diff) | |
download | gdb-2d73f342c45c3a4758dda9434045a22aaf09158e.tar.gz |
merge from gcc
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 8 | ||||
-rw-r--r-- | libiberty/cp-demangle.c | 9 | ||||
-rw-r--r-- | libiberty/ternary.c | 31 |
3 files changed, 34 insertions, 14 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 29f8856cb28..d4f294cfdb7 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,11 @@ +2001-05-07 Zack Weinberg <zackw@stanford.edu> + + * cp-demangle.c (demangle_v3_with_details, + is_gnu_v3_mangled_ctor, is_gnu_v3_mangled_dtor): Use K+R style + function definition. + * ternary.c: Use K+R style function definitions. Use PTR, not + void *. Make arguments constant where possible. + 2001-05-07 Mark Mitchell <mark@codesourcery.com> * splay-tree.h (splay_tree_max): New function. diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 8419eef3425..a6a2c1e9f1a 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -3819,7 +3819,8 @@ java_demangle_v3 (mangled) zero, indicating that some error occurred, or a demangling_t holding the results. */ static demangling_t -demangle_v3_with_details (const char *name) +demangle_v3_with_details (name) + const char *name; { demangling_t dm; status_t status; @@ -3857,7 +3858,8 @@ demangle_v3_with_details (const char *name) - '2' if NAME is a base object constructor, or - '3' if NAME is a complete object allocating constructor. */ enum gnu_v3_ctor_kinds -is_gnu_v3_mangled_ctor (const char *name) +is_gnu_v3_mangled_ctor (name) + const char *name; { demangling_t dm = demangle_v3_with_details (name); @@ -3878,7 +3880,8 @@ is_gnu_v3_mangled_ctor (const char *name) - '1' if NAME is a complete object destructor, or - '2' if NAME is a base object destructor. */ enum gnu_v3_dtor_kinds -is_gnu_v3_mangled_dtor (const char *name) +is_gnu_v3_mangled_dtor (name) + const char *name; { demangling_t dm = demangle_v3_with_details (name); diff --git a/libiberty/ternary.c b/libiberty/ternary.c index c5ef3a58b76..056d2cee11e 100644 --- a/libiberty/ternary.c +++ b/libiberty/ternary.c @@ -33,8 +33,12 @@ /* Non-recursive so we don't waste stack space/time on large insertions. */ -void * -ternary_insert (ternary_tree * root, char *s, void *data, int replace) +PTR +ternary_insert (root, s, data, replace) + ternary_tree *root; + const char *s; + PTR data; + int replace; { int diff; ternary_tree curr, *pcurr; @@ -54,7 +58,7 @@ ternary_insert (ternary_tree * root, char *s, void *data, int replace) { if (replace) curr->eqkid = (ternary_tree) data; - return (void *) curr->eqkid; + return (PTR) curr->eqkid; } pcurr = &(curr->eqkid); } @@ -94,7 +98,8 @@ ternary_insert (ternary_tree * root, char *s, void *data, int replace) /* Free the ternary search tree rooted at p. */ void -ternary_cleanup (ternary_tree p) +ternary_cleanup (p) + ternary_tree p; { if (p) { @@ -107,10 +112,12 @@ ternary_cleanup (ternary_tree p) } /* Non-recursive find of a string in the ternary tree */ -void * -ternary_search (ternary_tree p, char *s) +PTR +ternary_search (p, s) + const ternary_node *p; + const char *s; { - ternary_tree curr; + const ternary_node *curr; int diff, spchar; spchar = *s; curr = p; @@ -123,7 +130,7 @@ ternary_search (ternary_tree p, char *s) if (diff == 0) { if (spchar == 0) - return (void *) curr->eqkid; + return (PTR) curr->eqkid; spchar = *++s; curr = curr->eqkid; } @@ -139,8 +146,10 @@ ternary_search (ternary_tree p, char *s) /* For those who care, the recursive version of the search. Useful if you want a starting point for pmsearch or nearsearch. */ -static void * -ternary_recursivesearch (ternary_tree p, char *s) +static PTR +ternary_recursivesearch (p, s) + const ternary_node *p; + const char *s; { if (!p) return 0; @@ -151,7 +160,7 @@ ternary_recursivesearch (ternary_tree p, char *s) else { if (*s == 0) - return (void *) p->eqkid; + return (PTR) p->eqkid; return ternary_recursivesearch (p->eqkid, ++s); } } |