check-init.c (check_bool2_init, [...]): Add static prototypes.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Tue, 10 Aug 1999 16:58:13 +0000 (16:58 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Tue, 10 Aug 1999 16:58:13 +0000 (16:58 +0000)
* check-init.c (check_bool2_init, done_alternative): Add static
prototypes.

* class.c (add_interface_do, maybe_layout_super_class): Likewise.
(add_method, build_utf8_ref, build_class_ref,
append_gpp_mangled_type, layout_class_method): Constify a char*.

* decl.c (push_promoted_type, make_binding_level): Add static
prototypes.
(push_promoted_type, pushdecl): Constify a char*.

* except.c (find_handler_in_range, link_handler,
check_start_handlers): Add static prototypes.

* expr.c (process_jvm_instruction): Constify a char*.

* gjavah.c (main): Constify a char*.

* java-tree.h (verify_jvm_instructions, process_jvm_instruction):
Constify a char*.

* jcf-depend.c (free_entry, add_entry, munge, print_ents): Add
static prototypes.
(add_entry, jcf_dependency_set_target, jcf_dependency_add_target,
munge, print_ents): Constify a char*.

* jcf-dump.c (disassemble_method): Constify a char*.
(print_constant_pool, print_exception_table): Add static prototypes.
(print_constant, print_exception_table, main, disassemble_method):
Constify a char*.

* jcf-io.c (find_classfile, find_class): Likewise.

* jcf-parse.c (JPOOL_UTF_DATA, find_in_current_zip): Likewise.
(set_source_filename, predefined_filename_p): Add static prototypes.
(set_source_filename, get_constant, get_class_constant,
find_in_current_zip): Constify a char*.

* jcf-path.c (free_entry, append_entry, add_entry, add_path): Add
static prototypes.
(add_entry, add_path, jcf_path_classpath_arg,
jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.

* jcf-reader.c (get_attribute, jcf_parse_preamble,
jcf_parse_constant_pool, jcf_parse_class, jcf_parse_fields,
jcf_parse_one_method, jcf_parse_methods,
jcf_parse_final_attributes): Add static prototypes.
(get_attribute): Constify a char*.

* jcf.h (find_class, find_classfile, jcf_dependency_set_target,
jcf_dependency_add_target, jcf_path_classpath_arg,
jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.

* jv-scan.c (main): Constify a char*.
(gcc_obstack_init): Add prototype arguments.

* jvgenmain.c (gcc_obstack_init): Likewise.
(main): Constify a char*.

* lang.c (put_decl_string, put_decl_node, java_dummy_print): Add
static prototypes.
(put_decl_string, lang_print_error): Constify a char*.
(lang_init): Remove redundant extern prototype.

* mangle.c (emit_unicode_mangled_name): Constify a char*.

* typeck.c (convert_ieee_real_to_integer, parse_signature_type):
Add static prototypes.
(get_type_from_signature): Constify a char*.

* verify.c (check_pending_block, type_stack_dup, start_pc_cmp ):
Add static prototypes.
(start_pc_cmp): Prefer PTR over GENERIC_PTR.
(verify_jvm_instructions): Constify a char*.

* xref.c (xref_flag_value): Likewise.

* xref.h (xref_flag_value): Likewise.

* zextract.c (makeword, makelong): Add static prototypes.
(makeword, makelong): Constify a uch*.

From-SVN: r28648

24 files changed:
gcc/java/ChangeLog
gcc/java/check-init.c
gcc/java/class.c
gcc/java/decl.c
gcc/java/except.c
gcc/java/expr.c
gcc/java/gjavah.c
gcc/java/java-tree.h
gcc/java/jcf-depend.c
gcc/java/jcf-dump.c
gcc/java/jcf-io.c
gcc/java/jcf-parse.c
gcc/java/jcf-path.c
gcc/java/jcf-reader.c
gcc/java/jcf.h
gcc/java/jv-scan.c
gcc/java/jvgenmain.c
gcc/java/lang.c
gcc/java/mangle.c
gcc/java/typeck.c
gcc/java/verify.c
gcc/java/xref.c
gcc/java/xref.h
gcc/java/zextract.c

index 525d6c4ced710e4e996c827302d6e844aee2cc92..7dc3f7c6f9b89e254e79346dd8e1a292eca3ab61 100644 (file)
@@ -1,3 +1,87 @@
+1999-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * check-init.c (check_bool2_init, done_alternative): Add static
+       prototypes.
+
+       * class.c (add_interface_do, maybe_layout_super_class): Likewise.
+       (add_method, build_utf8_ref, build_class_ref,
+       append_gpp_mangled_type, layout_class_method): Constify a char*.
+
+       * decl.c (push_promoted_type, make_binding_level): Add static
+       prototypes.
+       (push_promoted_type, pushdecl): Constify a char*.
+
+       * except.c (find_handler_in_range, link_handler,
+       check_start_handlers): Add static prototypes.
+
+       * expr.c (process_jvm_instruction): Constify a char*.
+
+       * gjavah.c (main): Constify a char*.
+
+       * java-tree.h (verify_jvm_instructions, process_jvm_instruction):
+       Constify a char*.
+
+       * jcf-depend.c (free_entry, add_entry, munge, print_ents): Add
+       static prototypes.
+       (add_entry, jcf_dependency_set_target, jcf_dependency_add_target,
+       munge, print_ents): Constify a char*.
+
+       * jcf-dump.c (disassemble_method): Constify a char*.
+       (print_constant_pool, print_exception_table): Add static prototypes.
+       (print_constant, print_exception_table, main, disassemble_method):
+       Constify a char*.
+
+       * jcf-io.c (find_classfile, find_class): Likewise.
+
+       * jcf-parse.c (JPOOL_UTF_DATA, find_in_current_zip): Likewise.
+       (set_source_filename, predefined_filename_p): Add static prototypes.
+       (set_source_filename, get_constant, get_class_constant,
+       find_in_current_zip): Constify a char*.
+
+       * jcf-path.c (free_entry, append_entry, add_entry, add_path): Add
+       static prototypes.
+       (add_entry, add_path, jcf_path_classpath_arg,
+       jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
+
+       * jcf-reader.c (get_attribute, jcf_parse_preamble,
+       jcf_parse_constant_pool, jcf_parse_class, jcf_parse_fields,
+       jcf_parse_one_method, jcf_parse_methods,
+       jcf_parse_final_attributes): Add static prototypes.
+       (get_attribute): Constify a char*.
+
+       * jcf.h (find_class, find_classfile, jcf_dependency_set_target,
+       jcf_dependency_add_target, jcf_path_classpath_arg,
+       jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
+
+       * jv-scan.c (main): Constify a char*.
+       (gcc_obstack_init): Add prototype arguments.
+
+       * jvgenmain.c (gcc_obstack_init): Likewise.
+       (main): Constify a char*.
+
+       * lang.c (put_decl_string, put_decl_node, java_dummy_print): Add
+       static prototypes.
+       (put_decl_string, lang_print_error): Constify a char*.
+       (lang_init): Remove redundant extern prototype.
+       
+       * mangle.c (emit_unicode_mangled_name): Constify a char*.
+
+       * typeck.c (convert_ieee_real_to_integer, parse_signature_type):
+       Add static prototypes.
+       (get_type_from_signature): Constify a char*.
+
+       * verify.c (check_pending_block, type_stack_dup, start_pc_cmp ):
+       Add static prototypes.
+       (start_pc_cmp): Prefer PTR over GENERIC_PTR.
+       (verify_jvm_instructions): Constify a char*.
+
+       * xref.c (xref_flag_value): Likewise.
+       
+       * xref.h (xref_flag_value): Likewise.
+
+       * zextract.c (makeword, makelong): Add static prototypes.
+       (makeword, makelong): Constify a uch*.
+
 1999-08-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
         * lang.c (java_dummy_print): Constify a char*.
index b92f3e82bdcb373ae4a1b259104e12d318a35e6e..31017a6756d5f73b194d0f3de7b9aa401efe81b8 100644 (file)
@@ -100,6 +100,9 @@ static tree wfl;
 static void check_bool_init PROTO ((tree, words, words, words));
 static void check_init PROTO ((tree, words));
 static void check_cond_init PROTO ((tree, tree, tree, words, words, words));
+static void check_bool2_init PROTO ((enum tree_code, tree, tree, words, words, words));
+struct alternatives;
+static void done_alternative PROTO ((words, struct alternatives *));
 
 #if 0
 #define ALLOC_WORDS(NUM) ((word*) xmalloc ((NUM) * sizeof (word)))
index 9a73364c8c9fe7b25fdf42f4f2616a9d027ddca0..295470ae3bc85d346a84a647cad92282e867bc82 100644 (file)
@@ -45,6 +45,8 @@ static tree get_dispatch_vector PROTO ((tree));
 static tree get_dispatch_table PROTO ((tree, tree));
 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 rtx registerClass_libfunc;
 
@@ -448,7 +450,7 @@ add_method (this_class, access_flags, name, method_sig)
 {
   tree handle_class = CLASS_TO_HANDLE_TYPE (this_class);
   tree function_type, fndecl;
-  unsigned char *sig = (unsigned char*)IDENTIFIER_POINTER (method_sig);
+  const unsigned char *sig = (const unsigned char*)IDENTIFIER_POINTER (method_sig);
   push_obstacks (&permanent_obstack, &permanent_obstack);
   if (sig[0] != '(')
     fatal ("bad method signature");
@@ -555,7 +557,7 @@ tree
 build_utf8_ref (name)
      tree name;
 {
-  char* name_ptr = IDENTIFIER_POINTER(name);
+  const char * name_ptr = IDENTIFIER_POINTER(name);
   int name_len = IDENTIFIER_LENGTH(name);
   char buf[60];
   char *buf_ptr;
@@ -662,7 +664,7 @@ build_class_ref (type)
        }
       else
        {
-         char *name;
+         const char *name;
          char buffer[25];
          if (flag_emit_class_files)
            {
@@ -1329,7 +1331,7 @@ append_gpp_mangled_type (obstack, type)
        }
       else
        {
-         char *class_name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
+         const char *class_name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
          append_gpp_mangled_classtype (obstack, class_name);
        }
       break;
@@ -1547,7 +1549,7 @@ tree
 layout_class_method (this_class, super_class, method_decl, dtable_count)
      tree this_class, super_class, method_decl, dtable_count;
 {
-  char *ptr;
+  const char *ptr;
   char *asm_name;
   tree arg, arglist, t;
   int method_name_needs_escapes = 0;
@@ -1647,7 +1649,7 @@ layout_class_method (this_class, super_class, method_decl, dtable_count)
 
   if (method_name == init_identifier_node)
     {
-      char *p = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (this_class)));
+      const char *p = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (this_class)));
       for (ptr = p; *ptr; )
        {
          if (*ptr++ == '.')
index 24696eecec8dbc0f1e6619b183805c50c5397bee..6905caec93e0487fead5eb47ef1d0d8b35f35587 100644 (file)
@@ -40,6 +40,8 @@ static tree push_jvm_slot PROTO ((int, tree));
 static tree builtin_function PROTO ((const char *, tree,
                                     enum built_in_function, const char *));
 static tree lookup_name_current_level PROTO ((tree));
+static tree push_promoted_type PROTO ((const char *, tree));
+static struct binding_level *make_binding_level PROTO ((void));
 
 #ifndef INT_TYPE_SIZE
 #define INT_TYPE_SIZE BITS_PER_WORD
@@ -380,7 +382,7 @@ tree va_list_type_node;
 
 static tree
 push_promoted_type (name, actual_type)
-     char *name;
+     const char *name;
      tree actual_type;
 {
   tree type = make_node (TREE_CODE (actual_type));
@@ -940,7 +942,7 @@ pushdecl (x)
   DECL_CONTEXT (x) = current_function_decl;
   if (name)
     {
-      char *file;
+      const char *file;
       int line;
 
       t = lookup_name_current_level (name);
@@ -1009,7 +1011,7 @@ pushdecl (x)
                   /* No shadow warnings for vars made for inlining.  */
                   && ! DECL_FROM_INLINE (x))
            {
-             char *warnstring = 0;
+             const char *warnstring = 0;
 
              if (TREE_CODE (x) == PARM_DECL
                  && current_binding_level->level_chain->parm_flag)
index 1b02e7eba4000798e23d177e7d2224a43f0b7795..4c48fe7237fc8ef86f597b2274fd848f7a18a5be 100644 (file)
@@ -39,6 +39,10 @@ The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 
 static void expand_start_java_handler PROTO ((struct eh_range *));
 static void expand_end_java_handler PROTO ((struct eh_range *));
+static struct eh_range *find_handler_in_range PROTO ((int, struct eh_range *,
+                                                     struct eh_range *));
+static void link_handler PROTO ((struct eh_range *, struct eh_range *));
+static void check_start_handlers PROTO ((struct eh_range *, int));
 
 extern struct obstack permanent_obstack;
 
index 59376a1ce748aab57e350c3762d82d10c439b8d3..1fed31df75b593ee2e28ce497acdb9e0f781779f 100644 (file)
@@ -2315,7 +2315,7 @@ java_push_constant_from_pool (jcf, index)
 int
 process_jvm_instruction (PC, byte_ops, length)
      int PC;
-     unsigned char* byte_ops;
+     const unsigned char* byte_ops;
      long length ATTRIBUTE_UNUSED;
 { 
   const char *opname; /* Temporary ??? */
index b680a87f48501b79d357310a142a66b34ec38161..72b6be1b1c3c44d856b24668c54560450a29a07b 100644 (file)
@@ -1652,7 +1652,8 @@ DEFUN(main, (argc, argv),
   for (; argi < argc; argi++)
     {
       char *classname = argv[argi];
-      char *classfile_name, *current_output_file;
+      char *current_output_file;
+      const char *classfile_name;
 
       if (verbose)
        fprintf (stderr, "Processing %s\n", classname);
index dfa17a24cfc1a9d2a41870488da0853e3df2fbbd..f34b5f2f7d0f0459fd4ec4fc511ed274bd0810db 100644 (file)
@@ -598,10 +598,10 @@ extern void push_super_field PROTO ((tree, tree));
 extern void init_class_processing PROTO ((void));
 extern int can_widen_reference_to PROTO ((tree, tree));
 extern int class_depth PROTO ((tree));
-extern int verify_jvm_instructions PROTO ((struct JCF *, unsigned char *, long));
+extern int verify_jvm_instructions PROTO ((struct JCF *, const unsigned char *, long));
 extern void maybe_pushlevels PROTO ((int));
 extern void maybe_poplevels PROTO ((int));
-extern int process_jvm_instruction PROTO ((int, unsigned char *, long));
+extern int process_jvm_instruction PROTO ((int, const unsigned char *, long));
 extern void set_local_type PROTO ((int, tree));
 extern int merge_type_state PROTO ((tree));
 extern void push_type PROTO ((tree));
index 86b9d7722fe811503a7beef3eb5d4a1d553bca03..87b474caed2e260c66792f1a7971dff07c5c3596 100644 (file)
@@ -39,6 +39,11 @@ struct entry
   struct entry *next;
 };
 
+static void free_entry PROTO ((struct entry **));
+static void add_entry PROTO ((struct entry **, const char *));
+static const char *munge PROTO ((const char *));
+static int print_ents PROTO ((struct entry *, int));
+
 /* List of files.  */
 static struct entry *dependencies = NULL;
 
@@ -77,7 +82,7 @@ free_entry (entp)
 static void
 add_entry (entp, name)
      struct entry **entp;
-     char *name;
+     const char *name;
 {
   struct entry *ent;
 
@@ -110,7 +115,7 @@ jcf_dependency_reset ()
 
 void
 jcf_dependency_set_target (name)
-     char *name;
+     const char *name;
 {
   free_entry (&targets);
   if (name != NULL)
@@ -119,7 +124,7 @@ jcf_dependency_set_target (name)
 
 void
 jcf_dependency_add_target (name)
-     char *name;
+     const char *name;
 {
   add_entry (&targets, name);
 }
@@ -158,15 +163,16 @@ jcf_dependency_init (system_p)
 
 /* FIXME: this is taken almost directly from cccp.c.  Such duplication
    is bad.  */
-static char *
+static const char *
 munge (filename)
-     char *filename;
+     const char *filename;
 {
   static char *buffer = NULL;
   static int buflen = 0;
 
   int len = 2 * strlen (filename) + 1;
-  char *p, *dst;
+  const char *p;
+  char *dst;
 
   if (buflen < len)
     {
@@ -191,7 +197,7 @@ munge (filename)
               preceded by 2N backslashes represents N backslashes at
               the end of a file name; and backslashes in other
               contexts should not be doubled.  */
-           char *q;
+           const char *q;
            for (q = p - 1; filename < q && q[-1] == '\\';  q--)
              *dst++ = '\\';
          }
@@ -228,7 +234,7 @@ print_ents (ent, column)
 
   for (; ent != NULL; ent = ent->next)
     {
-      char *depname = munge (ent->file);
+      const char *depname = munge (ent->file);
       int len = strlen (depname);
 
       if (column + len + 2 > MAX_OUTPUT_COLUMNS)
index a26a6fbbfca3ccef22eca9210ea61ba68bef166c..676a7512b838b0c92f4f987981331df3e65f0e8a 100644 (file)
@@ -82,12 +82,15 @@ static void print_access_flags PROTO ((FILE *, uint16, char));
 static void print_constant_terse PROTO ((FILE*, JCF*, int, int));
 static void print_constant PROTO ((FILE *, JCF *, int, int));
 static void print_constant_ref PROTO ((FILE *, JCF *, int));
-static void disassemble_method PROTO ((JCF*, unsigned char *, int));
+static void disassemble_method PROTO ((JCF*, const unsigned char *, int));
 static void print_name PROTO ((FILE*, JCF*, int));
 static void print_signature PROTO ((FILE*, JCF*, int, int));
 static int utf8_equal_string PROTO ((struct JCF*, int, const char *));
 static int usage PROTO ((void));
 static void process_class PROTO ((struct JCF *));
+static void print_constant_pool PROTO ((struct JCF *));
+static void print_exception_table PROTO ((struct JCF *,
+                                         const unsigned char *entries, int));
 
 #define PRINT_SIGNATURE_RESULT_ONLY 1
 #define PRINT_SIGNATURE_ARGS_ONLY 2
@@ -482,7 +485,7 @@ DEFUN(print_constant, (out, jcf, index, verbosity),
       break;
     case CONSTANT_Utf8:
       {
-       register unsigned char *str = JPOOL_UTF_DATA (jcf, index);
+       register const unsigned char *str = JPOOL_UTF_DATA (jcf, index);
        int length = JPOOL_UTF_LENGTH (jcf, index);
        if (verbosity > 0)
          { /* Print as 8-bit bytes. */
@@ -503,7 +506,7 @@ DEFUN(print_constant, (out, jcf, index, verbosity),
     }
 }
 
-void
+static void
 DEFUN(print_constant_pool, (jcf),
       JCF *jcf)
 {
@@ -630,13 +633,13 @@ DEFUN(print_signature, (stream, jcf, signature_index, int options),
 
 static void
 DEFUN(print_exception_table, (jcf, entries, count),
-      JCF *jcf AND unsigned char *entries AND int count)
+      JCF *jcf AND const unsigned char *entries AND int count)
 {
   /* Print exception table. */
   int i = count;
   if (i > 0)
     {
-      unsigned char *ptr = entries;
+      const unsigned char *ptr = entries;
       fprintf (out, "Exceptions (count: %d):\n", i);
       for (; --i >= 0;  ptr+= 8)
        {
@@ -726,7 +729,7 @@ DEFUN(main, (argc, argv),
 
   for (argi = 1; argi < argc; argi++)
     {
-      char *arg = argv[argi];
+      const char *arg = argv[argi];
 
       if (arg[0] != '-' || ! strcmp (arg, "--"))
        break;
@@ -802,7 +805,7 @@ DEFUN(main, (argc, argv),
       for (; argi < argc; argi++)
        {
          char *arg = argv[argi];
-         char* class_filename = find_class (arg, strlen (arg), jcf, 0);
+         const char *class_filename = find_class (arg, strlen (arg), jcf, 0);
          if (class_filename == NULL)
            class_filename = find_classfile (arg, jcf, NULL);
          if (class_filename == NULL)
@@ -816,7 +819,7 @@ DEFUN(main, (argc, argv),
              long compressed_size, member_size;
              int compression_method, filename_length, extra_length;
              int general_purpose_bits;
-             char *filename;
+             const char *filename;
              int total_length;
              if (flag_print_class_info)
                fprintf (out, "Reading classes from archive %s.\n",
@@ -910,7 +913,7 @@ DEFUN(main, (argc, argv),
 
 static void
 DEFUN(disassemble_method, (jcf, byte_ops, len),
-      JCF* jcf AND unsigned char *byte_ops AND int len)
+      JCF* jcf AND const unsigned char *byte_ops AND int len)
 {
 #undef AND /* Causes problems with opcodes for iand and land. */
 #undef PTR
@@ -999,7 +1002,7 @@ DEFUN(disassemble_method, (jcf, byte_ops, len),
 #define ARRAY_NEW(TYPE) ARRAY_NEW_##TYPE
 #define ARRAY_NEW_NUM \
  INT_temp = IMMEDIATE_u1; \
- { char *str; \
+ { const char *str; \
   switch (INT_temp) {  \
     case  4: str = "boolean"; break; \
     case  5: str = "char"; break; \
index 95332186545bf70efcf9e815847cf474d1f4ba57..765f1506853e1151e20ad393fba720cf0e687ec1 100644 (file)
@@ -240,7 +240,7 @@ DEFUN(open_class, (filename, jcf, fd, dep_name),
 #endif
 
 
-char *
+const char *
 DEFUN(find_classfile, (filename, jcf, dep_name),
       char *filename AND JCF *jcf AND const char *dep_name)
 {
@@ -262,7 +262,7 @@ DEFUN(find_classfile, (filename, jcf, dep_name),
    failure.  If JCF != NULL, it is suitably initialized.
    SOURCE_OK is true if we should also look for .java file. */
 
-char *
+const char *
 DEFUN(find_class, (classname, classname_length, jcf, source_ok),
       const char *classname AND int classname_length AND JCF *jcf AND int source_ok)
 
@@ -290,7 +290,7 @@ DEFUN(find_class, (classname, classname_length, jcf, source_ok),
 
   for (entry = jcf_path_start (); entry != NULL; entry = jcf_path_next (entry))
     {
-      char *path_name = jcf_path_name (entry);
+      const char *path_name = jcf_path_name (entry);
       if (class != 0)
        {
          int dir_len;
index 054c239ff72a21567b07c749f78f526948e6a4d1..78daf2d17ed12e4429ea9c9d249ba50a040800a4 100644 (file)
@@ -39,7 +39,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 #define JPOOL_UTF(JCF, INDEX) CPOOL_UTF(&(JCF)->cpool, INDEX)
 #define JPOOL_UTF_LENGTH(JCF, INDEX) IDENTIFIER_LENGTH (JPOOL_UTF (JCF, INDEX))
 #define JPOOL_UTF_DATA(JCF, INDEX) \
-  ((unsigned char*) IDENTIFIER_POINTER (JPOOL_UTF (JCF, INDEX)))
+  ((const unsigned char *) IDENTIFIER_POINTER (JPOOL_UTF (JCF, INDEX)))
 #define HANDLE_CONSTANT_Utf8(JCF, INDEX, LENGTH) \
   do { \
     unsigned char save;  unsigned char *text; \
@@ -87,12 +87,14 @@ static void process_zip_dir PROTO ((void));
 static void parse_source_file PROTO ((tree));
 static void jcf_parse_source PROTO ((void));
 static int jcf_figure_file_type PROTO ((JCF *));
-static int find_in_current_zip PROTO ((char *, struct JCF **));
+static int find_in_current_zip PROTO ((const char *, struct JCF **));
 static void parse_class_file PROTO ((void));
+static void set_source_filename PROTO ((JCF *, int));
+static int predefined_filename_p PROTO ((tree));
 
 /* Handle "SourceFile" attribute. */
 
-void
+static void
 set_source_filename (jcf, index)
      JCF *jcf;
      int index;
@@ -303,10 +305,10 @@ get_constant (jcf, index)
       {
        extern struct obstack *expression_obstack;
        tree name = get_name_constant (jcf, JPOOL_USHORT1 (jcf, index));
-       char *utf8_ptr = IDENTIFIER_POINTER (name);
+       const char *utf8_ptr = IDENTIFIER_POINTER (name);
        unsigned char *str_ptr;
        int utf8_len = IDENTIFIER_LENGTH (name);
-       unsigned char *str = (unsigned char*)utf8_ptr;
+       const unsigned char *str = (const unsigned char *)utf8_ptr;
        int i = utf8_len;
        int str_len;
 
@@ -327,7 +329,7 @@ get_constant (jcf, index)
        TREE_STRING_POINTER (value)
          = obstack_alloc (expression_obstack, 2 * str_len);
        str_ptr = (unsigned char *) TREE_STRING_POINTER (value);
-       str = (unsigned char*)utf8_ptr;
+       str = (const unsigned char *)utf8_ptr;
        for (i = 0; i < str_len; i++)
          {
            int char_value;
@@ -426,7 +428,7 @@ get_class_constant (JCF *jcf , int i)
     {
       int name_index = JPOOL_USHORT1 (jcf, i);
       /* verify_constant_pool confirmed that name_index is a CONSTANT_Utf8. */
-      char *name = JPOOL_UTF_DATA (jcf, name_index);
+      const char *name = JPOOL_UTF_DATA (jcf, name_index);
       int nlength = JPOOL_UTF_LENGTH (jcf, name_index);
       if (name[0] == '[')  /* Handle array "classes". */
          type = TREE_TYPE (parse_signature_string (name, nlength));
@@ -1007,7 +1009,7 @@ static void process_zip_dir()
    zip file.  */
 static int
 DEFUN(find_in_current_zip, (name, length, jcf),
-      char *name AND JCF **jcf)
+      const char *name AND JCF **jcf)
 {
   JCF *local_jcf;
   tree class_name = maybe_get_identifier (name), class, icv;
index 67dd02e2fffa1859e217d25abe6b100d0c4fe65f..c92cf14b353ed7b4fb19564ad5a63407a795eee6 100644 (file)
@@ -58,6 +58,11 @@ struct entry
   struct entry *next;
 };
 
+static void free_entry PROTO ((struct entry **));
+static void append_entry PROTO ((struct entry **, struct entry *));
+static void add_entry PROTO ((struct entry **, const char *, int));
+static void add_path PROTO ((struct entry **, const char *, int));
+
 /* We support several different ways to set the class path.
 
    built-in system directory (only libgcj.zip)
@@ -130,7 +135,7 @@ append_entry (entp, ent)
 static void
 add_entry (entp, filename, is_system)
      struct entry **entp;
-     char *filename;
+     const char *filename;
      int is_system;
 {
   int len;
@@ -177,10 +182,10 @@ add_entry (entp, filename, is_system)
 static void
 add_path (entp, cp, is_system)
      struct entry **entp;
-     char *cp;
+     const char *cp;
      int is_system;
 {
-  char *startp, *endp;
+  const char *startp, *endp;
 
   if (cp)
     {
@@ -229,7 +234,7 @@ jcf_path_init ()
 /* Call this when -classpath is seen on the command line.  */
 void
 jcf_path_classpath_arg (path)
-     char *path;
+     const char *path;
 {
   free_entry (&classpath_l);
   add_path (&classpath_l, path, 0);
@@ -238,7 +243,7 @@ jcf_path_classpath_arg (path)
 /* Call this when -CLASSPATH is seen on the command line.  */
 void
 jcf_path_CLASSPATH_arg (path)
-     char *path;
+     const char *path;
 {
   free_entry (&classpath_u);
   add_path (&classpath_u, path, 0);
@@ -247,7 +252,7 @@ jcf_path_CLASSPATH_arg (path)
 /* Call this when -I is seen on the command line.  */
 void
 jcf_path_include_arg (path)
-     char *path;
+     const char *path;
 {
   add_entry (&include_dirs, path, 0);
 }
index c6207a235c933ae7abe682ca61a493f7d7ee58c1..44fb37e859bcd85a3d423be6f3e58d363e856c40 100644 (file)
@@ -26,7 +26,16 @@ The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 #include "jcf.h"
 #include "zipfile.h"
 
-int
+static int get_attribute PROTO((JCF *));
+static int jcf_parse_preamble PROTO((JCF *));
+static int jcf_parse_constant_pool PROTO((JCF *));
+static void jcf_parse_class PROTO((JCF *));
+static int jcf_parse_fields PROTO((JCF *));
+static int jcf_parse_one_method PROTO((JCF *));
+static int jcf_parse_methods PROTO((JCF *));
+static int jcf_parse_final_attributes PROTO((JCF *));
+
+static int
 DEFUN(get_attribute, (jcf),
       JCF *jcf)
 {
@@ -34,7 +43,7 @@ DEFUN(get_attribute, (jcf),
   uint32 attribute_length = JCF_readu4 (jcf);
   uint32 start_pos = JCF_TELL(jcf);
   int name_length;
-  unsigned char *name_data;
+  const unsigned char *name_data;
   JCF_FILL (jcf, (long) attribute_length);
   if (attribute_name <= 0 || attribute_name >= JPOOL_SIZE(jcf))
     return -2;
@@ -134,7 +143,7 @@ DEFUN(get_attribute, (jcf),
 }
 
 /* Read and handle the pre-amble. */
-int
+static int
 DEFUN(jcf_parse_preamble, (jcf),
       JCF* jcf)
 {
@@ -155,7 +164,7 @@ DEFUN(jcf_parse_preamble, (jcf),
    Return 0 if OK.
    Return -2 if a bad cross-reference (index of other constant) was seen.
 */
-int
+static int
 DEFUN(jcf_parse_constant_pool, (jcf),
       JCF* jcf)
 {
@@ -221,7 +230,7 @@ DEFUN(jcf_parse_constant_pool, (jcf),
 
 /* Read various class flags and numbers. */
 
-void
+static void
 DEFUN(jcf_parse_class, (jcf),
       JCF* jcf)
 {
@@ -250,7 +259,7 @@ DEFUN(jcf_parse_class, (jcf),
 }
 
 /* Read fields. */
-int
+static int
 DEFUN(jcf_parse_fields, (jcf),
       JCF* jcf)
 {
@@ -290,7 +299,7 @@ DEFUN(jcf_parse_fields, (jcf),
 
 /* Read methods. */
 
-int
+static int
 DEFUN(jcf_parse_one_method, (jcf),
       JCF* jcf)
 {
@@ -314,7 +323,7 @@ DEFUN(jcf_parse_one_method, (jcf),
   return 0;
 }
 
-int
+static int
 DEFUN(jcf_parse_methods, (jcf),
       JCF* jcf)
 {
@@ -338,7 +347,7 @@ DEFUN(jcf_parse_methods, (jcf),
 }
 
 /* Read attributes. */
-int
+static int
 DEFUN(jcf_parse_final_attributes, (jcf),
       JCF *jcf)
 {
index c8ab62b259651125f5a2769eab49ed040e4000d9..56b35a5ce1014203aa5d7eac0f4ba3d57371eaeb 100644 (file)
@@ -223,8 +223,8 @@ typedef struct JCF {
 
 #define DEFAULT_CLASS_PATH "."
 
-extern char *find_class PROTO ((const char *, int, JCF*, int));
-extern char *find_classfile PROTO ((char *, JCF*, const char *));
+extern const char *find_class PROTO ((const char *, int, JCF*, int));
+extern const char *find_classfile PROTO ((char *, JCF*, const char *));
 extern int jcf_filbuf_from_stdio PROTO ((JCF *jcf, int count));
 extern void jcf_out_of_synch PROTO((JCF *));
 extern int jcf_unexpected_eof PROTO ((JCF*, int));
@@ -259,8 +259,8 @@ extern int quiet_flag;
 
 /* Declarations for dependency code.  */
 extern void jcf_dependency_reset PROTO ((void));
-extern void jcf_dependency_set_target PROTO ((char *));
-extern void jcf_dependency_add_target PROTO ((char *));
+extern void jcf_dependency_set_target PROTO ((const char *));
+extern void jcf_dependency_add_target PROTO ((const char *));
 extern void jcf_dependency_set_dep_file PROTO ((const char *));
 extern void jcf_dependency_add_file PROTO ((const char *, int));
 extern void jcf_dependency_write PROTO ((void));
@@ -268,9 +268,9 @@ extern void jcf_dependency_init PROTO ((int));
 
 /* Declarations for path handling code.  */
 extern void jcf_path_init PROTO ((void));
-extern void jcf_path_classpath_arg PROTO ((char *));
-extern void jcf_path_CLASSPATH_arg PROTO ((char *));
-extern void jcf_path_include_arg PROTO ((char *));
+extern void jcf_path_classpath_arg PROTO ((const char *));
+extern void jcf_path_CLASSPATH_arg PROTO ((const char *));
+extern void jcf_path_include_arg PROTO ((const char *));
 extern void jcf_path_seal PROTO ((void));
 extern void *jcf_path_start PROTO ((void));
 extern void *jcf_path_next PROTO ((void *));
index 26fc662ed5e9da56c3b2c128bdfe77e56ee5fe36..df660ac55f3d710a74e365ac1b03d3dc6f2aac91 100644 (file)
@@ -52,7 +52,7 @@ main (argc, argv)
   char **argv;
 {
   int i = 1;
-  char *output_file = NULL;
+  const char *output_file = NULL;
   long ft;
 
   exec_name = argv[0];
@@ -197,8 +197,8 @@ gcc_obstack_init (obstack)
 #define OBSTACK_CHUNK_FREE free
 #endif
   _obstack_begin (obstack, OBSTACK_CHUNK_SIZE, 0,
-                 (void *(*) ()) OBSTACK_CHUNK_ALLOC,
-                 (void (*) ()) OBSTACK_CHUNK_FREE);
+                 (void *(*) (long)) OBSTACK_CHUNK_ALLOC,
+                 (void (*) (void *)) OBSTACK_CHUNK_FREE);
 }
 
 PTR
index 0f9e6287827de7956cd6137e6dab692534cd0a95..8422fbc5e05c99fb216c23425210e367f9ff9e18 100644 (file)
@@ -75,8 +75,8 @@ gcc_obstack_init (obstack)
 #define OBSTACK_CHUNK_FREE free
 #endif
   _obstack_begin (obstack, OBSTACK_CHUNK_SIZE, 0,
-                 (void *(*) ()) OBSTACK_CHUNK_ALLOC,
-                 (void (*) ()) OBSTACK_CHUNK_FREE);
+                 (void *(*) PROTO((long))) OBSTACK_CHUNK_ALLOC,
+                 (void (*) PROTO((void *))) OBSTACK_CHUNK_FREE);
 }
 
 int
@@ -84,7 +84,7 @@ main (int argc, const char **argv)
 {
   const char *classname;
   FILE *stream;
-  char *mangled_classname;
+  const char *mangled_classname;
 
   if (argc < 2 || argc > 3)
     {
index 28fdc6dee62c268a89c882229876854b46b4c5a6..3287575952e1dc7071072f9b3cf534db1f26f3e3 100644 (file)
@@ -36,6 +36,10 @@ The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 #include "flags.h"
 #include "xref.h"
 
+static void put_decl_string PROTO ((const char *, int));
+static void put_decl_node PROTO ((tree));
+static void java_dummy_print PROTO ((const char *));
+
 #ifndef OBJECT_SUFFIX
 # define OBJECT_SUFFIX ".o"
 #endif
@@ -337,7 +341,7 @@ static int decl_bufpos = 0;
 
 static void
 put_decl_string (str, len)
-     char *str;
+     const char *str;
      int len;
 {
   if (len < 0)
@@ -475,7 +479,7 @@ lang_print_error (file)
        fprintf (stderr, "At top level:\n");
       else
        {
-         char *name = lang_printable_name (current_function_decl, 2);
+         const char *name = lang_printable_name (current_function_decl, 2);
          fprintf (stderr, "In method `%s':\n", name);
        }
 
@@ -487,7 +491,6 @@ lang_print_error (file)
 void
 lang_init ()
 {
-  extern struct rtx_def * (*lang_expand_expr) ();
 #if 0
   extern int flag_minimal_debug;
   flag_minimal_debug = 0;
index ebe680eb2e9b861a1d76ad163f5fbb0366c1beb4..d38a23a173e0d2cf857e40295f56c972f6ea8eb7 100644 (file)
@@ -87,7 +87,7 @@ emit_unicode_mangled_name (obstack, name, len)
          break;
        }
       if (ch >= '0' && ch <= '9')
-       emit_escape = (ptr == (unsigned char*) name);
+       emit_escape = (ptr == (const unsigned char *) name);
       else
        emit_escape = (ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z');
       if (emit_escape)
index 99536ffa146677ef6882299c25a35aaf0dd1c4c1..c6c1708ec3a9890359abe6adc2d635b82efeb9db 100644 (file)
@@ -34,6 +34,10 @@ The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 #include "convert.h"
 #include "toplev.h"
 
+static tree convert_ieee_real_to_integer PROTO ((tree, tree));
+static tree parse_signature_type PROTO ((const unsigned char **,
+                                        const unsigned char *));
+
 tree * type_map;
 extern struct obstack permanent_obstack;
 
@@ -546,7 +550,7 @@ parse_signature_string (sig_string, sig_length)
 tree
 get_type_from_signature (tree signature)
 {
-  unsigned char *sig = (unsigned char *) IDENTIFIER_POINTER (signature);
+  const unsigned char *sig = (const unsigned char *) IDENTIFIER_POINTER (signature);
   int len = IDENTIFIER_LENGTH (signature);
   tree type;
   /* Primitive types aren't cached. */
index 9e11d761c9065af0c333ceaff92dba18a1ede8d5..07556e850e0c2074db2e05e265c44d76e6296880 100644 (file)
@@ -35,6 +35,9 @@ The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 
 static void push_pending_label PROTO ((tree));
 static tree merge_types PROTO ((tree, tree));
+static const char *check_pending_block PROTO ((tree));
+static void type_stack_dup PROTO ((int, int));
+static int start_pc_cmp PROTO ((const PTR, const PTR));
 
 extern int stack_pointer;
 
@@ -310,8 +313,8 @@ struct pc_index
 /* A helper that is used when sorting exception ranges.  */
 static int
 start_pc_cmp (xp, yp)
-     const GENERIC_PTR xp;
-     const GENERIC_PTR yp;
+     const PTR xp;
+     const PTR yp;
 {
   struct pc_index *x = (struct pc_index *) xp;
   struct pc_index *y = (struct pc_index *) yp;
@@ -344,7 +347,7 @@ start_pc_cmp (xp, yp)
 int
 verify_jvm_instructions (jcf, byte_ops, length)
      JCF* jcf;
-     unsigned char* byte_ops;
+     const unsigned char *byte_ops;
      long length;
 {
   tree label;
index 8fd5180481997a7bf77084e08b653a9b7b4181b2..57241c6cd95b7b35836d09f3e1860b5cc80ffe1e 100644 (file)
@@ -42,7 +42,7 @@ static xref_flag_table xref_table [] = {
 
 int
 xref_flag_value (flag)
-     char *flag;
+     const char *flag;
 {
   int i;
   for (i = 0; xref_table [i].key; i++)
index 7a98834c2db11b4b79254658d2e3b3ba695448d1..f0db4ef533f90f508cbbd87670fad84d82731b35 100644 (file)
@@ -24,7 +24,7 @@ of Sun Microsystems, Inc. in the United States and other countries.
 The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 
 /* Exported functions. */
-int xref_flag_value PROTO ((char *));
+int xref_flag_value PROTO ((const char *));
 void expand_xref PROTO ((tree));
 void xref_set_data PROTO ((int, void *));
 void *xref_get_data PROTO ((int));
index 5e170b3a7bb44eb8e16fb70522a79f5128188048..59fe486fa2e9252fdf0c1646d08fd4af134ff877 100644 (file)
@@ -206,12 +206,19 @@ typedef unsigned long     ulg;  /*  predefined on some systems) & match zip  */
 #endif
 
 
+/***********************/
+/* Prototypes          */
+/***********************/
+
+static ush makeword PROTO ((const uch *));
+static ulg makelong PROTO ((const uch *));
+
 /***********************/
 /* Function makeword() */
 /***********************/
 
 static ush makeword(b)
-    uch *b;
+    const uch *b;
 {
     /*
      * Convert Intel style 'short' integer to non-Intel non-16-bit
@@ -226,7 +233,7 @@ static ush makeword(b)
 /***********************/
 
 static ulg makelong(sig)
-    uch *sig;
+    const uch *sig;
 {
     /*
      * Convert intel style 'long' variable to non-Intel non-16-bit