Commit d4476be2 by Kaveh R. Ghazi Committed by Kaveh Ghazi

Warning fixes:

        * Makefile.in (parse.o): Depend on $(CONFIG_H) and
        $(srcdir)/../system.h.
        (class.o): Depend on $(PARSE_H) and $(srcdir)/../output.h.
        (jcf-parse.o): Depend on $(srcdir)/../toplev.h.
        (jcf-write.o): Likewise.
        (jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
        (mangle.o): Depend on $(srcdir)/../toplev.h.
        (parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
        (zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
        * class.c: Include output.h and parse.h.
        (mangled_classname): Add the `const' keyword to a char*.
        (find_named_method): Hide unused function definition.
        (build_utf8_ref): Change type of variable `c' to unsigned char.
        Use ISALPHA/ISDIGIT instead of isalpha/isdigit.
        (build_class_ref): Add the `const' keyword to a char*.
        (layout_class_method): Remove unused variable `buf'.
        * decl.c (find_local_variable): Remove unused variable `rtl'.
        (pushdecl): Likewise for variables `different_binding_level' and
        `oldglobal'.
        (pushlevel): Mark parameter `unused' with ATTRIBUTE_UNUSED.
        (maybe_build_cleanup): Likewise for parameter `decl'.
        * except.c (expand_start_java_handler): Mark parameter `range'
        with ATTRIBUTE_UNUSED.
        * expr.c: Include except.h.
        (pop_type): Remove unused variable `i'.
        (pop_value): Likewise for variables `n_words' and `i'.
        (expand_java_arrayload): Likewise for variable `convert'.
        (java_lang_expand_expr): Likewise for variables `op0', `type',
        `mode', `unsignedp', `node' and `elements'.
        (expand_byte_code): Likewise for variables `prev_eh_ranges' and
        `eh_ranges'.
        (process_jvm_instruction): Add a `const' qualifier to a char*.
        * gjavah.c (output_directory): Add the `const' keyword to a char*.
        (temp_directory): Likewise.
        (print_c_decl): Likewise.
        (print_method_info): Likewise.
        (decode_signature_piece): Likewise.
        (print_mangled_classname): Likewise.
        * java-except.h: Provide prototypes for maybe_start_try,
        maybe_end_try and add_handler.
        * java-tree.h (mangled_classname): Add the `const' keyword to a char*.
        (parse_error_context): Likewise.  Also add ATTRIBUTE_PRINTF_2.
        (pushdecl_top_level, alloc_class_constant, unicode_mangling_length,
        init_expr_processing, push_super_field, init_class_processing,
        can_widen_reference_to, class_depth, verify_jvm_instructions,
        maybe_pushlevels, maybe_poplevels, process_jvm_instruction,
        set_local_type, merge_type_state, push_type, load_type_state,
        add_interface, find_in_current_zip, append_gpp_mangled_classtype,
        emit_unicode_mangled_name): Add prototypes.
        * jcf-dump.c (print_constant): Add the `const' keyword to a char*.
        (print_signature_type): Use ISDIGIT, not isdigit.
        (print_signature): Remove unused variable `j'.
        * jcf-io.c (jcf_filbuf_from_stdio): Cast the result of `fread' to
        int when comparing against one.
        * jcf-parse.c: Include toplev.h.
        * jcf-write.c: Likewise.  Don't include <string.h> or <sys/stat.h>.
        (localvar_free): Remove unused variable `i'.
        (generate_bytecode_conditional): Likewise for variable `kind'.
        * jv-scan.c: Include config.h and system.h.  Remove redundant
        OS header and gansidecl.h includes.
        (warning): Add the `const' keyword to a char*.  Also add
        ATTRIBUTE_PRINTF_1 to the prototype.  Check ANSI_PROTOTYPES, not
        __STDC__, when determining whether to use ANSI-isms.
        (fatal): Likewise.  Also add ATTRIBUTE_UNUSED.
        (xmalloc): Don't redundantly prototype here.
        (main): Remove unused parameter `envp'.  Also fix the arguments
        passed to function `fatal' to match the format specifier.
        * lang.c (java_tree_code_name): Add the `const' keyword to a char*.
        * mangle.c: Include toplev.h.
        (emit_unicode_mangled_name): Declare parameter `len'.
        * parse.y (parse_warning_context): Add the `const' keyword to a
        char*.  Also add ATTRIBUTE_PRINTF_2 to the prototype.  Check
        `ANSI_PROTOTYPES' not `__STDC__' for whether to use ANSI-isms.
        (issue_warning_error_from_context): Add the `const' keyword to
        a char*.
        (parse_error_context): Likewise.  Also check `ANSI_PROTOTYPES'
        not `__STDC__' for whether to use ANSI-isms.
        * typeck.c (incomplete_type_error): Mark parameters `value' and
        `type' with ATTRIBUTE_UNUSED.
        (parse_signature_type): Use ISDIGIT, not isdigit.
        * verify.c (check_pending_block): Add the `const' keyword to a char*.
        (verify_jvm_instructions): Likewise.  Remove unused variables
        `field_name' and `default_val'.
        * zextract.c: Include config.h and system.h.  Remove redundant
        OS header includes.
        * zipfile.h: Prototype `read_zip_archive'.

From-SVN: r24835
parent 9b3142b3
Sat Jan 23 23:02:43 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (parse.o): Depend on $(CONFIG_H) and
$(srcdir)/../system.h.
(class.o): Depend on $(PARSE_H) and $(srcdir)/../output.h.
(jcf-parse.o): Depend on $(srcdir)/../toplev.h.
(jcf-write.o): Likewise.
(jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
(mangle.o): Depend on $(srcdir)/../toplev.h.
(parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
(zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
* class.c: Include output.h and parse.h.
(mangled_classname): Add the `const' keyword to a char*.
(find_named_method): Hide unused function definition.
(build_utf8_ref): Change type of variable `c' to unsigned char.
Use ISALPHA/ISDIGIT instead of isalpha/isdigit.
(build_class_ref): Add the `const' keyword to a char*.
(layout_class_method): Remove unused variable `buf'.
* decl.c (find_local_variable): Remove unused variable `rtl'.
(pushdecl): Likewise for variables `different_binding_level' and
`oldglobal'.
(pushlevel): Mark parameter `unused' with ATTRIBUTE_UNUSED.
(maybe_build_cleanup): Likewise for parameter `decl'.
* except.c (expand_start_java_handler): Mark parameter `range'
with ATTRIBUTE_UNUSED.
* expr.c: Include except.h.
(pop_type): Remove unused variable `i'.
(pop_value): Likewise for variables `n_words' and `i'.
(expand_java_arrayload): Likewise for variable `convert'.
(java_lang_expand_expr): Likewise for variables `op0', `type',
`mode', `unsignedp', `node' and `elements'.
(expand_byte_code): Likewise for variables `prev_eh_ranges' and
`eh_ranges'.
(process_jvm_instruction): Add a `const' qualifier to a char*.
* gjavah.c (output_directory): Add the `const' keyword to a char*.
(temp_directory): Likewise.
(print_c_decl): Likewise.
(print_method_info): Likewise.
(decode_signature_piece): Likewise.
(print_mangled_classname): Likewise.
* java-except.h: Provide prototypes for maybe_start_try,
maybe_end_try and add_handler.
* java-tree.h (mangled_classname): Add the `const' keyword to a char*.
(parse_error_context): Likewise. Also add ATTRIBUTE_PRINTF_2.
(pushdecl_top_level, alloc_class_constant, unicode_mangling_length,
init_expr_processing, push_super_field, init_class_processing,
can_widen_reference_to, class_depth, verify_jvm_instructions,
maybe_pushlevels, maybe_poplevels, process_jvm_instruction,
set_local_type, merge_type_state, push_type, load_type_state,
add_interface, find_in_current_zip, append_gpp_mangled_classtype,
emit_unicode_mangled_name): Add prototypes.
* jcf-dump.c (print_constant): Add the `const' keyword to a char*.
(print_signature_type): Use ISDIGIT, not isdigit.
(print_signature): Remove unused variable `j'.
* jcf-io.c (jcf_filbuf_from_stdio): Cast the result of `fread' to
int when comparing against one.
* jcf-parse.c: Include toplev.h.
* jcf-write.c: Likewise. Don't include <string.h> or <sys/stat.h>.
(localvar_free): Remove unused variable `i'.
(generate_bytecode_conditional): Likewise for variable `kind'.
* jv-scan.c: Include config.h and system.h. Remove redundant
OS header and gansidecl.h includes.
(warning): Add the `const' keyword to a char*. Also add
ATTRIBUTE_PRINTF_1 to the prototype. Check ANSI_PROTOTYPES, not
__STDC__, when determining whether to use ANSI-isms.
(fatal): Likewise. Also add ATTRIBUTE_UNUSED.
(xmalloc): Don't redundantly prototype here.
(main): Remove unused parameter `envp'. Also fix the arguments
passed to function `fatal' to match the format specifier.
* lang.c (java_tree_code_name): Add the `const' keyword to a char*.
* mangle.c: Include toplev.h.
(emit_unicode_mangled_name): Declare parameter `len'.
* parse.y (parse_warning_context): Add the `const' keyword to a
char*. Also add ATTRIBUTE_PRINTF_2 to the prototype. Check
`ANSI_PROTOTYPES' not `__STDC__' for whether to use ANSI-isms.
(issue_warning_error_from_context): Add the `const' keyword to
a char*.
(parse_error_context): Likewise. Also check `ANSI_PROTOTYPES'
not `__STDC__' for whether to use ANSI-isms.
* typeck.c (incomplete_type_error): Mark parameters `value' and
`type' with ATTRIBUTE_UNUSED.
(parse_signature_type): Use ISDIGIT, not isdigit.
* verify.c (check_pending_block): Add the `const' keyword to a char*.
(verify_jvm_instructions): Likewise. Remove unused variables
`field_name' and `default_val'.
* zextract.c: Include config.h and system.h. Remove redundant
OS header includes.
* zipfile.h: Prototype `read_zip_archive'.
Thu Jan 21 16:00:06 1999 Andrew Haley <aph@cygnus.com>
* typeck.c (convert): Allow conversions to void type: some
......
......@@ -273,13 +273,14 @@ clean: mostlyclean
force:
parse.o: $(PARSE_C) jcf-reader.c
parse.o: $(PARSE_C) jcf-reader.c $(CONFIG_H) $(srcdir)/../system.h
jcf-dump.o: jcf-reader.c jcf.h javaop.h javaop.def
gjavah.o: jcf-reader.c jcf.h javaop.h
buffer.o : buffer.c $(CONFIG_H) buffer.h $(srcdir)/../gansidecl.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h
class.o : class.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) jcf.h \
$(srcdir)/../gansidecl.h $(srcdir)/../toplev.h $(srcdir)/../system.h
class.o : class.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) jcf.h $(PARSE_H) \
$(srcdir)/../gansidecl.h $(srcdir)/../toplev.h $(srcdir)/../system.h \
$(srcdir)/../output.h
constants.o : constants.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h \
$(srcdir)/../toplev.h $(srcdir)/../system.h
decl.o : decl.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h \
......@@ -294,16 +295,20 @@ expr.o : expr.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h $(srcdir)/../real.h \
jcf-depend.o: jcf-depend.c $(CONFIG_H) $(srcdir)/../system.h jcf.h
jcf-io.o: jcf-io.c $(CONFIG_H) $(srcdir)/../system.h
jcf-parse.o : jcf-parse.c $(CONFIG_H) $(JAVA_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../input.h java-except.h $(srcdir)/../system.h
$(srcdir)/../input.h java-except.h $(srcdir)/../system.h \
$(srcdir)/../toplev.h
jcf-write.o : jcf-write.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h $(RTL_H) \
java-opcodes.h parse.h buffer.h $(srcdir)/../system.h
java-opcodes.h parse.h buffer.h $(srcdir)/../system.h $(srcdir)/../toplev.h
jv-scan.o : $(CONFIG_H) $(srcdir)/../system.h
jvgenmain.o : jvgenmain.c $(CONFIG_H) $(srcdir)/../system.h
lang.o : lang.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h $(srcdir)/../input.h \
$(srcdir)/../toplev.h $(srcdir)/../system.h
mangle.o : mangle.c $(CONFIG_H) jcf.h $(srcdir)/../system.h
mangle.o : mangle.c $(CONFIG_H) jcf.h $(srcdir)/../system.h \
$(srcdir)/../toplev.h
parse-scan.o : $(CONFIG_H) $(srcdir)/../system.h
typeck.o : typeck.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h convert.h \
$(srcdir)/../toplev.h $(srcdir)/../system.h
verify.o : verify.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h javaop.h java-opcodes.h \
java-except.h $(srcdir)/../toplev.h $(srcdir)/../system.h
zextract.o: zextract.c zipfile.h
zextract.o: zextract.c $(CONFIG_H) $(srcdir)/../system.h zipfile.h
......@@ -33,6 +33,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "jcf.h"
#include "obstack.h"
#include "toplev.h"
#include "output.h"
#include "parse.h"
static tree mangle_class_field PROTO ((tree class));
......@@ -95,8 +97,8 @@ identifier_subst (old_id, prefix, old_char, new_char, suffix)
tree
mangled_classname (prefix, type)
char *prefix;
tree type;
const char *prefix;
tree type;
{
tree ident = TYPE_NAME (type);
if (TREE_CODE (ident) != IDENTIFIER_NODE)
......@@ -354,6 +356,7 @@ add_interface (this_class, interface_class)
add_interface_do (basetype_vec, interface_class, i);
}
#if 0
/* Return the address of a pointer to the first FUNCTION_DECL
in the list (*LIST) whose DECL_NAME is NAME. */
......@@ -366,6 +369,7 @@ find_named_method (list, name)
list = &TREE_CHAIN (*list);
return list;
}
#endif
tree
build_java_method_type (fntype, this_class, access_flags)
......@@ -566,10 +570,10 @@ build_utf8_ref (name)
buf_ptr = &buf[strlen (buf)];
while (--name_len >= 0)
{
char c = *name_ptr++;
unsigned char c = *name_ptr++;
if (c & 0x80)
continue;
if (!isalpha(c) && !isdigit(c))
if (!ISALPHA(c) && !ISDIGIT(c))
c = '_';
*buf_ptr++ = c;
if (buf_ptr >= buf + 50)
......@@ -639,7 +643,7 @@ build_class_ref (type)
char buffer[25];
if (flag_emit_class_files)
{
char *prim_class_name;
const char *prim_class_name;
tree prim_class;
if (type == char_type_node)
prim_class_name = "java.lang.Character";
......@@ -1499,7 +1503,6 @@ layout_class_method (this_class, super_class, method_decl, dtable_count)
tree this_class, super_class, method_decl, dtable_count;
{
char *ptr;
char buf[8];
char *asm_name;
tree arg, arglist, t;
int method_name_needs_escapes = 0;
......
......@@ -113,7 +113,6 @@ find_local_variable (index, type, pc)
tree type;
int pc;
{
struct rtx_def *rtl = NULL;
tree decl = TREE_VEC_ELT (decl_map, index);
tree best = NULL_TREE;
while (decl != NULL_TREE)
......@@ -888,7 +887,6 @@ pushdecl (x)
{
char *file;
int line;
int different_binding_level = 0;
t = lookup_name_current_level (name);
if (t != 0 && t == error_mark_node)
......@@ -928,7 +926,6 @@ pushdecl (x)
{
/* Here to install a non-global value. */
tree oldlocal = IDENTIFIER_LOCAL_VALUE (name);
tree oldglobal = IDENTIFIER_GLOBAL_VALUE (name);
IDENTIFIER_LOCAL_VALUE (name) = x;
#if 0
......@@ -1047,7 +1044,7 @@ make_binding_level ()
void
pushlevel (unused)
int unused;
int unused ATTRIBUTE_UNUSED;
{
register struct binding_level *newlevel = NULL_BINDING_LEVEL;
......@@ -1378,7 +1375,7 @@ copy_lang_decl (node)
tree
maybe_build_cleanup (decl)
tree decl;
tree decl ATTRIBUTE_UNUSED;
{
/* There are no cleanups in Java (I think). */
return NULL_TREE;
......
......@@ -184,7 +184,7 @@ add_handler (start_pc, end_pc, handler, type)
/* if there are any handlers for this range, issue start of region */
void
expand_start_java_handler (range)
struct eh_range *range;
struct eh_range *range ATTRIBUTE_UNUSED;
{
expand_eh_region_start ();
}
......
......@@ -37,6 +37,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "java-except.h"
#include "parse.h"
#include "toplev.h"
#include "except.h"
static tree operand_type[59];
extern struct obstack permanent_obstack;
......@@ -242,7 +243,6 @@ pop_type (type)
tree type;
{
int n_words;
int i;
tree t;
if (TREE_CODE (type) == RECORD_TYPE)
type = promote_type (type);
......@@ -356,8 +356,6 @@ tree
pop_value (type)
tree type;
{
int n_words = 1 + TYPE_IS_WIDE (type);
int i;
type = pop_type (type);
if (quick_stack)
{
......@@ -846,7 +844,6 @@ expand_java_arrayload (lhs_type_node )
tree lhs_type_node;
{
tree load_node;
int convert;
tree index_node = pop_value (int_type_node);
tree array_node = pop_value (ptr_type_node);
......@@ -1747,18 +1744,14 @@ java_lang_expand_expr (exp, target, tmode, modifier)
enum machine_mode tmode;
enum expand_modifier modifier;
{
register rtx op0;
tree type = TREE_TYPE (exp);
register enum machine_mode mode = TYPE_MODE (type);
int unsignedp = TREE_UNSIGNED (type);
tree node, current;
tree current;
int has_finally_p;
switch (TREE_CODE (exp))
{
case NEW_ARRAY_INIT:
{
rtx tmp, elements;
rtx tmp;
tree array_type = TREE_TYPE (TREE_TYPE (exp));
tree element_type = TYPE_ARRAY_ELEMENT (array_type);
tree data_fld = TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (array_type)));
......@@ -1942,8 +1935,6 @@ expand_byte_code (jcf, method)
int i;
int saw_index;
unsigned char *linenumber_pointer;
struct eh_range *prev_eh_ranges = NULL_EH_RANGE;
struct eh_range *eh_ranges;
#undef RET /* Defined by config/i386/i386.h */
#undef AND /* Causes problems with opcodes for iand and land. */
......@@ -2190,7 +2181,7 @@ process_jvm_instruction (PC, byte_ops, length)
unsigned char* byte_ops;
long length;
{
char *opname; /* Temporary ??? */
const char *opname; /* Temporary ??? */
int oldpc = PC; /* PC at instruction start. */
/* If the instruction is at the beginning of a exception handler,
......
......@@ -42,10 +42,10 @@ FILE *out = NULL;
static int found_error = 0;
/* Directory to place resulting files in. Set by -d option. */
char *output_directory = "";
const char *output_directory = "";
/* Directory to place temporary file. Set by -td option. Currently unused. */
char *temp_directory = "/tmp";
const char *temp_directory = "/tmp";
/* Number of friend functions we have to declare. */
static int friend_count;
......@@ -100,7 +100,7 @@ static struct method_name *method_name_list;
static void print_field_info PROTO ((FILE *, JCF*, int, int, JCF_u2));
static void print_method_info PROTO ((FILE *, JCF*, int, int, JCF_u2));
static void print_c_decl PROTO ((FILE*, JCF*, int, int, JCF_u2, int, char *));
static void print_c_decl PROTO ((FILE*, JCF*, int, int, JCF_u2, int, const char *));
static void decompile_method PROTO ((FILE *, JCF *, int));
JCF_u2 current_field_name;
......@@ -423,7 +423,7 @@ DEFUN(print_method_info, (stream, jcf, name_index, sig_index, flags),
{
unsigned char *str;
int length, is_init = 0;
char *override = NULL;
const char *override = NULL;
method_declared = 0;
method_access = flags;
......@@ -557,7 +557,7 @@ decode_signature_piece (stream, signature, limit, need_space)
unsigned char *signature, *limit;
int *need_space;
{
char *ctype;
const char *ctype;
switch (signature[0])
{
......@@ -649,7 +649,7 @@ DEFUN(print_c_decl, (stream, jcf, name_index, signature_index, flags, is_init,
name_override),
FILE* stream AND JCF* jcf
AND int name_index AND int signature_index AND JCF_u2 flags
AND int is_init AND char *name_override)
AND int is_init AND const char *name_override)
{
if (JPOOL_TAG (jcf, signature_index) != CONSTANT_Utf8)
{
......@@ -734,7 +734,7 @@ DEFUN(print_c_decl, (stream, jcf, name_index, signature_index, flags, is_init,
void
DEFUN(print_mangled_classname, (stream, jcf, prefix, index),
FILE *stream AND JCF *jcf AND char *prefix AND int index)
FILE *stream AND JCF *jcf AND const char *prefix AND int index)
{
int name_index = JPOOL_USHORT1 (jcf, index);
fputs (prefix, stream);
......
......@@ -65,3 +65,9 @@ extern void method_init_exceptions PROTO ((void));
extern void emit_handlers PROTO ((void));
extern void maybe_start_try PROTO ((int));
extern void maybe_end_try PROTO ((int));
extern int add_handler PROTO ((int, int, tree, tree));
......@@ -512,7 +512,7 @@ extern tree find_stack_slot PROTO ((int index, tree type));
extern tree build_prim_array_type PROTO ((tree, HOST_WIDE_INT));
extern tree build_java_array_type PROTO ((tree, HOST_WIDE_INT));
extern int is_compiled_class PROTO ((tree));
extern tree mangled_classname PROTO ((char*, tree));
extern tree mangled_classname PROTO ((const char*, tree));
extern tree lookup_label PROTO ((int));
extern tree pop_type PROTO ((tree));
extern void pop_argument_types PROTO ((tree));
......@@ -561,13 +561,35 @@ extern void emit_register_classes PROTO (());
extern void lang_init_source PROTO ((int));
extern void write_classfile PROTO ((tree));
extern char *print_int_node PROTO ((tree));
extern void parse_error_context VPROTO ((tree cl, char *msg, ...));
extern void parse_error_context PVPROTO ((tree cl, const char *, ...))
ATTRIBUTE_PRINTF_2;
extern tree build_primtype_type_ref PROTO ((char *));
extern tree java_get_real_method_name PROTO ((tree));
extern void finish_class PROTO ((tree));
extern void java_layout_seen_class_methods PROTO (());
extern void check_for_initialization PROTO ((tree));
extern tree pushdecl_top_level PROTO ((tree));
extern int alloc_class_constant PROTO ((tree));
extern int unicode_mangling_length PROTO ((char *, int));
extern void init_expr_processing PROTO ((void));
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 void maybe_pushlevels PROTO ((int));
extern void maybe_poplevels PROTO ((int));
extern int process_jvm_instruction PROTO ((int, unsigned char *, long));
extern void set_local_type PROTO ((int, tree));
extern int merge_type_state PROTO ((tree));
extern void push_type PROTO ((tree));
extern void load_type_state PROTO ((tree));
extern void add_interface PROTO ((tree, tree));
extern int find_in_current_zip PROTO ((char *, int, struct JCF **));
extern void append_gpp_mangled_classtype PROTO ((struct obstack *, char *));
extern void emit_unicode_mangled_name PROTO ((struct obstack *, char *, int));
/* Access flags etc for a method (a FUNCTION_DECL): */
#define METHOD_PUBLIC(DECL) DECL_LANG_FLAG_1 (DECL)
......
......@@ -364,7 +364,7 @@ DEFUN(print_constant, (out, jcf, index, verbosity),
{
int j, n;
jlong num;
char *str;
const char *str;
int kind = JPOOL_TAG (jcf, index);
switch (kind)
{
......@@ -518,7 +518,7 @@ DEFUN(print_signature_type, (stream, ptr, limit),
{
case '[':
array_size = -1;
for ((*ptr)++; (*ptr) < limit && isdigit (**ptr); (*ptr)++)
for ((*ptr)++; (*ptr) < limit && ISDIGIT (**ptr); (*ptr)++)
{
int digit =
array_size = (array_size < 0 ? 0 : 10 * array_size) + *(*ptr) - '0';
......@@ -578,7 +578,6 @@ DEFUN(print_signature, (stream, jcf, signature_index, int options),
print_constant_terse (out, jcf, signature_index, CONSTANT_Utf8);
else
{
int j;
const unsigned char *str = JPOOL_UTF_DATA (jcf, signature_index);
int length = JPOOL_UTF_LENGTH (jcf, signature_index);
const unsigned char *limit;
......
......@@ -79,7 +79,7 @@ DEFUN(jcf_filbuf_from_stdio, (jcf, count),
count -= jcf->read_end - jcf->read_ptr;
if (count <= 0)
return 0;
if (fread (jcf->read_end, 1, count, file) != count)
if ((int) fread (jcf->read_end, 1, count, file) != count)
jcf_unexpected_eof (jcf, count);
jcf->read_end += count;
return 0;
......
......@@ -32,6 +32,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "java-except.h"
#include "input.h"
#include "java-tree.h"
#include "toplev.h"
/* A CONSTANT_Utf8 element is converted to an IDENTIFIER_NODE at parse time. */
#define JPOOL_UTF(JCF, INDEX) CPOOL_UTF(&(JCF)->cpool, INDEX)
......
......@@ -23,7 +23,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
#include <string.h>
#include "tree.h"
#include "java-tree.h"
#include "jcf.h"
......@@ -33,8 +32,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "java-opcodes.h"
#include "parse.h" /* for BLOCK_EXPR_BODY */
#include "buffer.h"
#include <sys/stat.h>
#include "toplev.h"
#ifndef DIR_SEPARATOR
#define DIR_SEPARATOR '/'
......@@ -550,7 +548,6 @@ localvar_free (decl, state)
register struct localvar_info **ptr = &localvar_buffer [index];
register struct localvar_info *info = *ptr;
int wide = TYPE_IS_WIDE (TREE_TYPE (decl));
int i;
info->end_label = end_label;
......@@ -1054,7 +1051,6 @@ generate_bytecode_conditional (exp, true_label, false_label,
int true_branch_first;
struct jcf_partial *state;
{
int kind;
tree exp0, exp1, type;
int save_SP = state->code_SP;
enum java_opcode op, negop;
......
......@@ -19,22 +19,15 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <stdlib.h>
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "config.h"
#include "system.h"
#include "gansidecl.h" /* Definitions of PROTO and VPROTO */
#include "obstack.h" /* We use obstacks in lex.c */
void fatal VPROTO((char *s, ...));
void warning VPROTO((char *s, ...));
void fatal VPROTO((const char *s, ...)) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
void warning VPROTO((const char *s, ...)) ATTRIBUTE_PRINTF_1;
void gcc_obstack_init PROTO ((struct obstack *obstack));
extern void reset_report PROTO ((void));
extern PTR xmalloc PROTO((size_t));
#define JC1_LITE
#include "parse.h"
......@@ -55,10 +48,9 @@ int flag_list_filename = 0;
/* jc1-lite main entry point */
int
main (argc, argv, envp)
int argc;
char **argv;
char **envp;
main (argc, argv)
int argc;
char **argv;
{
int i = 1;
char *output_file = NULL;
......@@ -109,10 +101,10 @@ main (argc, argv, envp)
/* 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", argv [0]);
"at the same time");
if (output_file && !(out = fopen (output_file, "w")))
fatal ("Can't open output file `%s'", argv [0], output_file);
fatal ("Can't open output file `%s'", output_file);
ft = ftell (out);
......@@ -134,7 +126,7 @@ main (argc, argv, envp)
reset_report ();
}
else
fatal ("File not found `%s'", argv [0], argv [i]);
fatal ("File not found `%s'", argv [i]);
}
/* Flush and close */
......@@ -150,17 +142,17 @@ main (argc, argv, envp)
functions */
void
fatal VPROTO((char *s, ...))
fatal VPROTO((const char *s, ...))
{
#ifndef __STDC__
char *s;
#ifndef ANSI_PROTOTYPES
const char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
s = va_arg (ap, char *);
#ifndef ANSI_PROTOTYPES
s = va_arg (ap, const char *);
#endif
fprintf (stderr, "%s: error: ", exec_name);
......@@ -171,17 +163,17 @@ fatal VPROTO((char *s, ...))
}
void
warning VPROTO((char *s, ...))
warning VPROTO((const char *s, ...))
{
#ifndef __STDC__
char *s;
#ifndef ANSI_PROTOTYPES
const char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef __STDC__
s = va_arg (ap, char *);
#ifndef ANSI_PROTOTYPES
s = va_arg (ap, const char *);
#endif
fprintf (stderr, "%s: warning: ", exec_name);
......
......@@ -65,7 +65,7 @@ int java_tree_code_length[] = {
Used for printing out the tree and error messages. */
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
char *java_tree_code_name[] = {
const char *java_tree_code_name[] = {
"@@dummy",
#include "java-tree.def"
};
......
......@@ -29,6 +29,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "system.h"
#include "jcf.h"
#include "obstack.h"
#include "toplev.h"
/* Assuming (NAME, LEN) is a Utf8-encoding string, calculate
the length of the string as mangled (a la g++) including Unicode escapes.
......@@ -70,6 +71,7 @@ void
emit_unicode_mangled_name (obstack, name, len)
struct obstack *obstack;
char *name;
int len;
{
unsigned char *ptr;
unsigned char *limit = (unsigned char *)name + len;
......
......@@ -86,8 +86,9 @@ static tree lookup_java_method2 PROTO ((tree, tree, int));
static tree method_header PROTO ((int, tree, tree, tree));
static void fix_method_argument_names PROTO ((tree ,tree));
static tree method_declarator PROTO ((tree, tree));
static void parse_warning_context VPROTO ((tree cl, char *msg, ...));
static void issue_warning_error_from_context PROTO ((tree, char *msg, va_list));
static void parse_warning_context PVPROTO ((tree cl, const char *msg, ...))
ATTRIBUTE_PRINTF_2;
static void issue_warning_error_from_context PROTO ((tree, const char *msg, va_list));
static tree parse_jdk1_1_error PROTO ((char *));
static void complete_class_report_errors PROTO ((jdep *));
static int process_imports PROTO ((void));
......@@ -2447,7 +2448,7 @@ yyerror (msg)
static void
issue_warning_error_from_context (cl, msg, ap)
tree cl;
char *msg;
const char *msg;
va_list ap;
{
char *saved, *saved_input_filename;
......@@ -2475,18 +2476,18 @@ issue_warning_error_from_context (cl, msg, ap)
/* Issue an error message at a current source line CL */
void
parse_error_context VPROTO ((tree cl, char *msg, ...))
parse_error_context VPROTO ((tree cl, const char *msg, ...))
{
#ifndef __STDC__
#ifndef ANSI_PROTOTYPES
tree cl;
char *msg;
const char *msg;
#endif
va_list ap;
VA_START (ap, msg);
#ifndef __STDC__
#ifndef ANSI_PROTOTYPES
cl = va_arg (ap, tree);
msg = va_arg (ap, char *);
msg = va_arg (ap, const char *);
#endif
issue_warning_error_from_context (cl, msg, ap);
va_end (ap);
......@@ -2495,18 +2496,18 @@ parse_error_context VPROTO ((tree cl, char *msg, ...))
/* Issue a warning at a current source line CL */
static void
parse_warning_context VPROTO ((tree cl, char *msg, ...))
parse_warning_context VPROTO ((tree cl, const char *msg, ...))
{
#ifndef __STDC__
#ifndef ANSI_PROTOTYPES
tree cl;
char *msg;
const char *msg;
#endif
va_list ap;
VA_START (ap, msg);
#ifndef __STDC__
#ifndef ANSI_PROTOTYPES
cl = va_arg (ap, tree);
msg = va_arg (ap, char *);
msg = va_arg (ap, const char *);
#endif
force_error = do_warning = 1;
......
......@@ -151,8 +151,8 @@ convert_to_boolean (type, expr)
void
incomplete_type_error (value, type)
tree value;
tree type;
tree value ATTRIBUTE_UNUSED;
tree type ATTRIBUTE_UNUSED;
{
error ("internal error - use of undefined type");
}
......@@ -464,7 +464,7 @@ parse_signature_type (ptr, limit)
case 'Z': (*ptr)++; return boolean_type_node;
case 'V': (*ptr)++; return void_type_node;
case '[':
for ((*ptr)++; (*ptr) < limit && isdigit (**ptr); ) (*ptr)++;
for ((*ptr)++; (*ptr) < limit && ISDIGIT (**ptr); ) (*ptr)++;
type = parse_signature_type (ptr, limit);
type = build_java_array_type (type, -1);
break;
......
......@@ -61,7 +61,7 @@ push_pending_label (target_label)
Merge the type state etc.
Return NULL on sucess, or an error message on failure. */
static char *
static const char *
check_pending_block (target_label)
tree target_label;
{
......@@ -332,7 +332,7 @@ verify_jvm_instructions (jcf, byte_ops, length)
int PC;
int oldpc; /* PC of start of instruction. */
int prevpc; /* If >= 0, PC of previous instruction. */
char *message;
const char *message;
int i;
register unsigned char *p;
struct eh_range *prev_eh_ranges = NULL_EH_RANGE;
......@@ -724,7 +724,6 @@ verify_jvm_instructions (jcf, byte_ops, length)
int index = IMMEDIATE_u2;
tree self_type = get_class_constant
(jcf, COMPONENT_REF_CLASS_INDEX (&current_jcf->cpool, index));
tree field_name = COMPONENT_REF_NAME (&current_jcf->cpool, index);
tree field_signature = COMPONENT_REF_SIGNATURE (&current_jcf->cpool, index);
tree field_type = get_type_from_signature (field_signature);
if (is_putting)
......@@ -963,7 +962,7 @@ verify_jvm_instructions (jcf, byte_ops, length)
case OPCODE_tableswitch:
{
jint default_val, low, high;
jint low, high;
pop_type (int_type_node);
while (PC%4)
......
......@@ -25,19 +25,14 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
/* Written by Per Bothner <bothner@cygnus.com>, February 1996. */
#include "config.h"
#include "system.h"
#include "zipfile.h"
/* This stuff is partly based on the 28 August 1994 public release of the
Info-ZIP group's portable UnZip zipfile-extraction program (and related
utilities). */
#include <stdio.h>
#ifdef __STDC__
#include <stdlib.h>
#endif
#include <errno.h> /* used in mapname() */
/*************/
/* Defines */
/*************/
......
......@@ -58,3 +58,4 @@ extern struct ZipFileCache *SeenZipFiles;
#define ZIPMAGIC 0x504b0304
extern ZipFile * opendir_in_zip ();
extern int read_zip_archive PROTO ((ZipFile *));
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