Commit 74f24290 by Joern Rennecke Committed by Joern Rennecke

jcf-parse.c (set_source_filename): Constify variable "dot".

	* jcf-parse.c (set_source_filename): Constify variable "dot".
	(load_class): Constify variable "separator".
	Use get_identifier_with_length.

From-SVN: r156066
parent c24ea667
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
* lang.c (java_post_options): Constify variable "dot". * 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> 2010-01-09 Jakub Jelinek <jakub@redhat.com>
* jcf-dump.c (version): Update copyright notice dates. * jcf-dump.c (version): Update copyright notice dates.
......
...@@ -333,7 +333,7 @@ set_source_filename (JCF *jcf, int index) ...@@ -333,7 +333,7 @@ set_source_filename (JCF *jcf, int index)
{ {
const char *class_name const char *class_name
= IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class))); = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)));
char *dot = strrchr (class_name, '.'); const char *dot = strrchr (class_name, '.');
if (dot != NULL) if (dot != NULL)
{ {
/* Length of prefix, not counting final dot. */ /* Length of prefix, not counting final dot. */
...@@ -1355,7 +1355,7 @@ load_class (tree class_or_name, int verbose) ...@@ -1355,7 +1355,7 @@ load_class (tree class_or_name, int verbose)
{ {
while (1) while (1)
{ {
char *separator; const char *separator;
/* We've already loaded it. */ /* We've already loaded it. */
if (IDENTIFIER_CLASS_VALUE (name) != NULL_TREE) if (IDENTIFIER_CLASS_VALUE (name) != NULL_TREE)
...@@ -1372,12 +1372,9 @@ load_class (tree class_or_name, int verbose) ...@@ -1372,12 +1372,9 @@ load_class (tree class_or_name, int verbose)
for an inner class. */ for an inner class. */
if ((separator = strrchr (IDENTIFIER_POINTER (name), '$')) if ((separator = strrchr (IDENTIFIER_POINTER (name), '$'))
|| (separator = strrchr (IDENTIFIER_POINTER (name), '.'))) || (separator = strrchr (IDENTIFIER_POINTER (name), '.')))
{ name = get_identifier_with_length (IDENTIFIER_POINTER (name),
int c = *separator; (separator
*separator = '\0'; - IDENTIFIER_POINTER (name)));
name = get_identifier (IDENTIFIER_POINTER (name));
*separator = c;
}
/* Otherwise, we failed, we bail. */ /* Otherwise, we failed, we bail. */
else else
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment