* jcf-parse.c (set_source_filename): Constify variable "dot".
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Jan 2010 09:35:05 +0000 (09:35 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Jan 2010 09:35:05 +0000 (09:35 +0000)
(load_class): Constify variable "separator".
Use get_identifier_with_length.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156066 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/java/ChangeLog
gcc/java/jcf-parse.c

index 8413420..f96be09 100644 (file)
@@ -2,6 +2,10 @@
 
        * lang.c (java_post_options): Constify variable "dot".
 
+       * jcf-parse.c (set_source_filename): Constify variable "dot".
+       (load_class): Constify variable "separator".
+       Use get_identifier_with_length.
+
 2010-01-09  Jakub Jelinek  <jakub@redhat.com>
 
        * jcf-dump.c (version): Update copyright notice dates.
index 1a2de9e..2fe97bc 100644 (file)
@@ -333,7 +333,7 @@ set_source_filename (JCF *jcf, int index)
     {
       const char *class_name
        = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)));
-      char *dot = strrchr (class_name, '.');
+      const char *dot = strrchr (class_name, '.');
       if (dot != NULL)
        {
          /* Length of prefix, not counting final dot. */
@@ -1355,7 +1355,7 @@ load_class (tree class_or_name, int verbose)
     {
       while (1)
        {
-         char *separator;
+         const char *separator;
 
          /* We've already loaded it.  */
          if (IDENTIFIER_CLASS_VALUE (name) != NULL_TREE)
@@ -1372,12 +1372,9 @@ load_class (tree class_or_name, int verbose)
             for an inner class.  */
          if ((separator = strrchr (IDENTIFIER_POINTER (name), '$'))
              || (separator = strrchr (IDENTIFIER_POINTER (name), '.')))
-           {
-             int c = *separator;
-             *separator = '\0';
-             name = get_identifier (IDENTIFIER_POINTER (name));
-             *separator = c;
-           }
+           name = get_identifier_with_length (IDENTIFIER_POINTER (name),
+                                              (separator
+                                               - IDENTIFIER_POINTER (name)));
          /* Otherwise, we failed, we bail. */
          else
            break;