aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog4
-rw-r--r--gcc/java/jcf-parse.c13
2 files changed, 9 insertions, 8 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 8413420..f96be09 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -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.
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index 1a2de9e..2fe97bc 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -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;