diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2007-07-27 15:39:30 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2007-07-27 15:39:30 +0000 |
commit | 0b7406341cfd55645d110b78d0cfd23f80cc23db (patch) | |
tree | 040a5161d117eb07d2338cf8c7c895d406385ab0 /gcc | |
parent | 2b8327ce6ab70ad4240aa99e6f67d823e5966724 (diff) | |
download | gcc-0b7406341cfd55645d110b78d0cfd23f80cc23db.zip gcc-0b7406341cfd55645d110b78d0cfd23f80cc23db.tar.gz gcc-0b7406341cfd55645d110b78d0cfd23f80cc23db.tar.bz2 |
mangle.c (set_type_package_list): Constify.
* mangle.c (set_type_package_list): Constify.
* verify-glue.c (vfy_make_string): Delete.
* verify.h (vfy_make_string): Likewise.
From-SVN: r126980
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/java/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/java/mangle.c | 18 | ||||
-rw-r--r-- | gcc/java/verify-glue.c | 12 | ||||
-rw-r--r-- | gcc/java/verify.h | 1 |
4 files changed, 12 insertions, 25 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 44eec2a..23a80c1 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,9 @@ +2007-07-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * mangle.c (set_type_package_list): Constify. + * verify-glue.c (vfy_make_string): Delete. + * verify.h (vfy_make_string): Likewise. + 2007-07-26 Tom Tromey <tromey@redhat.com> * java-tree.h (push_labeled_block, pop_labeled_block): Remove. diff --git a/gcc/java/mangle.c b/gcc/java/mangle.c index 69a0898..2401501 100644 --- a/gcc/java/mangle.c +++ b/gcc/java/mangle.c @@ -749,27 +749,21 @@ set_type_package_list (tree type) { int i; const char *type_string = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))); - char *ptr; + const char *ptr; int qualifications; tree list = NULL_TREE, elt; - for (ptr = (char *)type_string, qualifications = 0; *ptr; ptr++) + for (ptr = type_string, qualifications = 0; *ptr; ptr++) if (*ptr == '.') qualifications += 1; - for (ptr = (char *)type_string, i = 0; i < qualifications; ptr++) + for (ptr = type_string, i = 0; i < qualifications; ptr++) { if (ptr [0] == '.') { - char c; - tree identifier; - - /* Can't use an obstack, we're already using it to - accumulate the mangling. */ - c = ptr [0]; - ptr [0] = '\0'; - identifier = get_identifier (type_string); - ptr [0] = c; + tree const identifier + = get_identifier_with_length (type_string, ptr - type_string); + elt = build_tree_list (identifier, identifier); TREE_CHAIN (elt) = list; list = elt; diff --git a/gcc/java/verify-glue.c b/gcc/java/verify-glue.c index 23fcaba..4854387 100644 --- a/gcc/java/verify-glue.c +++ b/gcc/java/verify-glue.c @@ -211,18 +211,6 @@ vfy_get_pool_class (vfy_constants *pool, int index) } vfy_string -vfy_make_string (const char *s, int len) -{ - tree result; - char *s2 = (char *) s; - char save = s2[len]; - s2[len] = '\0'; - result = get_identifier (s2); - s2[len] = save; - return result; -} - -vfy_string vfy_get_class_name (vfy_jclass klass) { return DECL_NAME (TYPE_NAME (klass)); diff --git a/gcc/java/verify.h b/gcc/java/verify.h index b85176e..a2f64e8 100644 --- a/gcc/java/verify.h +++ b/gcc/java/verify.h @@ -97,7 +97,6 @@ vfy_constants *vfy_get_constants (vfy_jclass klass); int vfy_get_constants_size (vfy_jclass klass); vfy_string vfy_get_pool_string (vfy_constants *pool, int index); vfy_jclass vfy_get_pool_class (vfy_constants *pool, int index); -vfy_string vfy_make_string (const char *s, int len); vfy_string vfy_get_class_name (vfy_jclass klass); bool vfy_is_assignable_from (vfy_jclass target, vfy_jclass source); char vfy_get_primitive_char (vfy_jclass klass); |