* class.c (assume_compiled, assume_compiled_node): Add static
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 31 Dec 1999 03:30:22 +0000 (03:30 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 31 Dec 1999 03:30:22 +0000 (03:30 +0000)
prototype.
(add_assume_compiled): Use xmalloc/xstrdup, not malloc/strdup.

* jcf-dump.c (ARRAY_NEW_NUM): Cast long to int in switch.

* jvgenmain.c (usage): Add static prototype with ATTRIBUTE_NORETURN.

* parse.h (OBSOLETE_MODIFIER_WARNING): Rename parameter `modifier'
to `__modifier' to avoid stringifying it.

* parse.y (verify_constructor_circularity): Don't call a variadic
function with a non-literal format string.
(java_check_abstract_methods): Move unreachable code inside
`continue' statement.
(lookup_method_invoke): Call xstrdup, not strdup.

* expr.c (expand_java_field_op): Avoid the use of ANSI string
concatenation.

* jcf-parse.c (yyparse): Likewise.

* jv-scan.c (main): Likewise.

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

gcc/java/ChangeLog
gcc/java/class.c
gcc/java/expr.c
gcc/java/jcf-dump.c
gcc/java/jcf-parse.c
gcc/java/jv-scan.c
gcc/java/jvgenmain.c
gcc/java/parse.c
gcc/java/parse.h
gcc/java/parse.y

index b90c76b..9b68f75 100644 (file)
@@ -1,5 +1,31 @@
 1999-12-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
+       * class.c (assume_compiled, assume_compiled_node): Add static
+       prototype.
+       (add_assume_compiled): Use xmalloc/xstrdup, not malloc/strdup.
+
+       * jcf-dump.c (ARRAY_NEW_NUM): Cast long to int in switch.
+
+       * jvgenmain.c (usage): Add static prototype with ATTRIBUTE_NORETURN.
+
+       * parse.h (OBSOLETE_MODIFIER_WARNING): Rename parameter `modifier'
+       to `__modifier' to avoid stringifying it.
+
+       * parse.y (verify_constructor_circularity): Don't call a variadic
+       function with a non-literal format string.
+       (java_check_abstract_methods): Move unreachable code inside
+       `continue' statement.
+       (lookup_method_invoke): Call xstrdup, not strdup.
+
+       * expr.c (expand_java_field_op): Avoid the use of ANSI string
+       concatenation.
+
+       * jcf-parse.c (yyparse): Likewise.
+
+       * jv-scan.c (main): Likewise.
+       
+1999-12-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
        * parse.h (ABSTRACT_CHECK, JCONSTRUCTOR_CHECK,
        ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
        ERROR_CAST_NEEDED_TO_INTEGRAL): Avoid the use of ANSI string
index e042c13..3e3cfe6 100644 (file)
@@ -47,6 +47,7 @@ static void append_gpp_mangled_type PROTO ((struct obstack *, tree));
 static tree mangle_static_field PROTO ((tree));
 static void add_interface_do PROTO ((tree, tree, int));
 static tree maybe_layout_super_class PROTO ((tree, tree));
+static int assume_compiled PROTO ((const char *));
 
 static rtx registerClass_libfunc;
 
@@ -75,6 +76,9 @@ typedef struct assume_compiled_node_struct
   struct assume_compiled_node_struct *child;
 } assume_compiled_node;
 
+static assume_compiled_node *find_assume_compiled_node
+                       PROTO ((assume_compiled_node *, const char *));
+
 /* This is the root of the include/exclude tree.  */
 
 static assume_compiled_node *assume_compiled_tree;
@@ -83,7 +87,7 @@ static assume_compiled_node *assume_compiled_tree;
    is IDENT.  Start the search from NODE.  Return NULL if an
    appropriate node does not exist.  */
 
-assume_compiled_node *
+static assume_compiled_node *
 find_assume_compiled_node (node, ident)
      assume_compiled_node *node;
      const char *ident;
@@ -131,9 +135,9 @@ add_assume_compiled (ident, excludep)
 {
   assume_compiled_node *parent;
   assume_compiled_node *node = 
-    (assume_compiled_node *) malloc (sizeof (assume_compiled_node));
+    (assume_compiled_node *) xmalloc (sizeof (assume_compiled_node));
 
-  node->ident = strdup (ident);
+  node->ident = xstrdup (ident);
   node->excludep = excludep;
   node->child = NULL;
 
@@ -142,7 +146,7 @@ add_assume_compiled (ident, excludep)
   if (NULL == assume_compiled_tree)
     {
       assume_compiled_tree = 
-       (assume_compiled_node *) malloc (sizeof (assume_compiled_node));
+       (assume_compiled_node *) xmalloc (sizeof (assume_compiled_node));
       assume_compiled_tree->ident = "";
       assume_compiled_tree->excludep = 0;
       assume_compiled_tree->sibling = NULL;
@@ -176,7 +180,7 @@ add_assume_compiled (ident, excludep)
 /* Returns non-zero if IDENT is the name of a class that the compiler
    should assume has been compiled to FIXME  */
 
-int
+static int
 assume_compiled (ident)
      const char *ident;
 {
index 1b8d1a1..ffeddd6 100644 (file)
@@ -1820,8 +1820,7 @@ expand_java_field_op (is_static, is_putting, field_ref_index)
              tree cfndecl_name = DECL_NAME (current_function_decl);
              if (! DECL_CONSTRUCTOR_P (current_function_decl)
                  && (cfndecl_name != finit_identifier_node))
-               error_with_decl (field_decl, "assignment to final field `%s' "
-                                "not in constructor");
+               error_with_decl (field_decl, "assignment to final field `%s' not in constructor");
            }
        }
       expand_assignment (field_ref, new_value, 0, 0);
index becf747..8a66def 100644 (file)
@@ -1018,7 +1018,7 @@ DEFUN(disassemble_method, (jcf, byte_ops, len),
 #define ARRAY_NEW(TYPE) ARRAY_NEW_##TYPE
 #define ARRAY_NEW_NUM \
  INT_temp = IMMEDIATE_u1; \
- { switch (INT_temp) {  \
+ { switch ((int) INT_temp) {  \
     case  4: fputs (" boolean", out); break; \
     case  5: fputs (" char", out); break; \
     case  6: fputs (" float", out); break; \
index c182789..b1c818a 100644 (file)
@@ -825,8 +825,7 @@ yyparse ()
            {
              char *saved_input_filename = input_filename;
              input_filename = value;
-             warning ("source file seen twice on command line and will be "
-                      "compiled only once.");
+             warning ("source file seen twice on command line and will be compiled only once.");
              input_filename = saved_input_filename;
            }
          else
index 21970d7..0e07f42 100644 (file)
@@ -99,8 +99,7 @@ DEFUN (main, (argc, argv),
 
   /* Check on bad usage */
   if (flag_find_main && flag_dump_class)
-    fatal ("Options `--print-main' and `--list-class' can't be turned on "
-          "at the same time");
+    fatal ("Options `--print-main' and `--list-class' can't be turned on at the same time");
 
   if (output_file && !(out = fopen (output_file, "w")))
     fatal ("Can't open output file `%s'", output_file);
index fc0aa94..9c17455 100644 (file)
@@ -79,6 +79,8 @@ gcc_obstack_init (obstack)
                  (void (*) PROTO((void *))) OBSTACK_CHUNK_FREE);
 }
 
+static void usage (const char *) ATTRIBUTE_NORETURN;
+
 static void
 usage (const char *name)
 {
index b2b8235..13d63ed 100644 (file)
@@ -6252,7 +6252,7 @@ verify_constructor_circularity (meth, current)
              for (liste = list; liste; liste = TREE_CHAIN (liste))
                {
                  parse_error_context 
-                   (TREE_PURPOSE (TREE_PURPOSE (liste)),
+                   (TREE_PURPOSE (TREE_PURPOSE (liste)), "%s",
                     constructor_circularity_msg
                      (TREE_VALUE (liste), TREE_VALUE (TREE_PURPOSE (liste)))); 
                  java_error_count--;
@@ -7618,9 +7618,8 @@ java_check_abstract_methods (interface_decl)
             IDENTIFIER_POINTER 
               (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found)))));
          free (t);
-         continue;
-         
          DECL_NAME (found) = saved_found_wfl;
+         continue;
        }
     }
 
@@ -10224,7 +10223,7 @@ lookup_method_invoke (lc, cl, class, name, arg_list)
   method = make_node (FUNCTION_TYPE);
   TYPE_ARG_TYPES (method) = atl;
   signature = build_java_argument_signature (method);
-  dup = strdup (lang_printable_name (class, 0));
+  dup = xstrdup (lang_printable_name (class, 0));
   parse_error_context (cl, "Can't find %s `%s(%s)' in type `%s'%s",
                       (lc ? "constructor" : "method"),
                       (lc ? dup : IDENTIFIER_POINTER (name)),
index 0221598..c875592 100644 (file)
@@ -138,12 +138,12 @@ extern tree stabilize_reference PROTO ((tree));
 
 /* Pedantic warning on obsolete modifiers. Note: when cl is NULL,
    flags was set artificially, such as for a interface method */
-#define OBSOLETE_MODIFIER_WARNING(cl, flags, modifier, format, arg)          \
+#define OBSOLETE_MODIFIER_WARNING(cl, flags, __modifier, format, arg)        \
   {                                                                          \
-    if (flag_redundant && (cl) && ((flags) & (modifier)))                   \
+    if (flag_redundant && (cl) && ((flags) & (__modifier)))                 \
       parse_warning_context (cl,                                             \
      "Discouraged redundant use of `%s' modifier in declaration of " format, \
-                            java_accstring_lookup (modifier), arg);         \
+                            java_accstring_lookup (__modifier), arg);       \
   }
 
 /* Quickly build a temporary pointer on hypothetical type NAME. */
index 9e4b4c0..49118ce 100644 (file)
@@ -3649,7 +3649,7 @@ verify_constructor_circularity (meth, current)
              for (liste = list; liste; liste = TREE_CHAIN (liste))
                {
                  parse_error_context 
-                   (TREE_PURPOSE (TREE_PURPOSE (liste)),
+                   (TREE_PURPOSE (TREE_PURPOSE (liste)), "%s",
                     constructor_circularity_msg
                      (TREE_VALUE (liste), TREE_VALUE (TREE_PURPOSE (liste)))); 
                  java_error_count--;
@@ -5015,9 +5015,8 @@ java_check_abstract_methods (interface_decl)
             IDENTIFIER_POINTER 
               (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found)))));
          free (t);
-         continue;
-         
          DECL_NAME (found) = saved_found_wfl;
+         continue;
        }
     }
 
@@ -7621,7 +7620,7 @@ lookup_method_invoke (lc, cl, class, name, arg_list)
   method = make_node (FUNCTION_TYPE);
   TYPE_ARG_TYPES (method) = atl;
   signature = build_java_argument_signature (method);
-  dup = strdup (lang_printable_name (class, 0));
+  dup = xstrdup (lang_printable_name (class, 0));
   parse_error_context (cl, "Can't find %s `%s(%s)' in type `%s'%s",
                       (lc ? "constructor" : "method"),
                       (lc ? dup : IDENTIFIER_POINTER (name)),