Commit 6ff2fe39 by Kaveh R. Ghazi Committed by Kaveh Ghazi

expr.c, [...]: Don't rely on the `DEFUN', `AND' or `__STDC__' macros.

	* expr.c, gjavah.c, javaop.h, jcf-dump.c, jcf-io.c, jcf-reader.c,
	jcf-write.c, jcf.h, jv-scan.c: Don't rely on the `DEFUN', `AND' or
	`__STDC__' macros.

From-SVN: r61131
parent b3339cf7
2003-01-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2003-01-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* expr.c, gjavah.c, javaop.h, jcf-dump.c, jcf-io.c, jcf-reader.c,
jcf-write.c, jcf.h, jv-scan.c: Don't rely on the `DEFUN', `AND' or
`__STDC__' macros.
* jv-scan.c, parse.y: Remove VPARAMS, VA_OPEN, VA_FIXEDARG and * jv-scan.c, parse.y: Remove VPARAMS, VA_OPEN, VA_FIXEDARG and
VA_CLOSE. VA_CLOSE.
......
...@@ -2678,7 +2678,6 @@ note_instructions (jcf, method) ...@@ -2678,7 +2678,6 @@ note_instructions (jcf, method)
jint INT_temp; jint INT_temp;
#undef RET /* Defined by config/i386/i386.h */ #undef RET /* Defined by config/i386/i386.h */
#undef AND /* Causes problems with opcodes for iand and land. */
#undef PTR #undef PTR
#define BCODE byte_ops #define BCODE byte_ops
#define BYTE_type_node byte_type_node #define BYTE_type_node byte_type_node
......
...@@ -313,8 +313,7 @@ jni_print_char (stream, ch) ...@@ -313,8 +313,7 @@ jni_print_char (stream, ch)
string, an error results. */ string, an error results. */
static void static void
DEFUN(print_name, (stream, jcf, name_index), print_name (FILE* stream, JCF* jcf, int name_index)
FILE* stream AND JCF* jcf AND int name_index)
{ {
if (JPOOL_TAG (jcf, name_index) != CONSTANT_Utf8) if (JPOOL_TAG (jcf, name_index) != CONSTANT_Utf8)
{ {
...@@ -688,9 +687,8 @@ print_field_name (stream, jcf, name_index, flags) ...@@ -688,9 +687,8 @@ print_field_name (stream, jcf, name_index, flags)
} }
static void static void
DEFUN(print_field_info, (stream, jcf, name_index, sig_index, flags), print_field_info (FILE *stream, JCF* jcf, int name_index, int sig_index,
FILE *stream AND JCF* jcf JCF_u2 flags)
AND int name_index AND int sig_index AND JCF_u2 flags)
{ {
char *override = NULL; char *override = NULL;
...@@ -797,9 +795,8 @@ DEFUN(print_field_info, (stream, jcf, name_index, sig_index, flags), ...@@ -797,9 +795,8 @@ DEFUN(print_field_info, (stream, jcf, name_index, sig_index, flags),
static void static void
DEFUN(print_method_info, (stream, jcf, name_index, sig_index, flags), print_method_info (FILE *stream, JCF* jcf, int name_index, int sig_index,
FILE *stream AND JCF* jcf JCF_u2 flags)
AND int name_index AND int sig_index AND JCF_u2 flags)
{ {
const unsigned char *str; const unsigned char *str;
int length, is_init = 0; int length, is_init = 0;
...@@ -1378,11 +1375,8 @@ decode_signature_piece (stream, signature, limit, need_space) ...@@ -1378,11 +1375,8 @@ decode_signature_piece (stream, signature, limit, need_space)
} }
static void static void
DEFUN(print_c_decl, (stream, jcf, name_index, signature_index, is_init, print_c_decl (FILE* stream, JCF* jcf, int name_index, int signature_index,
name_override, flags), int is_init, const char *name_override, int flags)
FILE* stream AND JCF* jcf
AND int name_index AND int signature_index
AND int is_init AND const char *name_override AND int flags)
{ {
if (JPOOL_TAG (jcf, signature_index) != CONSTANT_Utf8) if (JPOOL_TAG (jcf, signature_index) != CONSTANT_Utf8)
{ {
...@@ -1436,11 +1430,9 @@ DEFUN(print_c_decl, (stream, jcf, name_index, signature_index, is_init, ...@@ -1436,11 +1430,9 @@ DEFUN(print_c_decl, (stream, jcf, name_index, signature_index, is_init,
/* Print the unqualified method name followed by the signature. */ /* Print the unqualified method name followed by the signature. */
static void static void
DEFUN(print_full_cxx_name, (stream, jcf, name_index, signature_index, print_full_cxx_name (FILE* stream, JCF* jcf, int name_index,
is_init, name_override, flags), int signature_index, int is_init,
FILE* stream AND JCF* jcf const char *name_override, int flags)
AND int name_index AND int signature_index AND int is_init
AND const char *name_override AND int flags)
{ {
int length = JPOOL_UTF_LENGTH (jcf, signature_index); int length = JPOOL_UTF_LENGTH (jcf, signature_index);
const unsigned char *str0 = JPOOL_UTF_DATA (jcf, signature_index); const unsigned char *str0 = JPOOL_UTF_DATA (jcf, signature_index);
...@@ -1529,11 +1521,9 @@ DEFUN(print_full_cxx_name, (stream, jcf, name_index, signature_index, ...@@ -1529,11 +1521,9 @@ DEFUN(print_full_cxx_name, (stream, jcf, name_index, signature_index,
/* This is a helper for print_stub_or_jni. */ /* This is a helper for print_stub_or_jni. */
static void static void
DEFUN (print_name_for_stub_or_jni, (stream, jcf, name_index, signature_index, print_name_for_stub_or_jni (FILE *stream, JCF *jcf, int name_index,
is_init, name_override, flags), int signature_index, int is_init,
FILE *stream AND JCF *jcf const char *name_override, int flags)
AND int name_index AND int signature_index
AND int is_init AND const char *name_override AND int flags)
{ {
const char *const prefix = flag_jni ? "Java_" : ""; const char *const prefix = flag_jni ? "Java_" : "";
print_cxx_classname (stream, prefix, jcf, jcf->this_class, 1); print_cxx_classname (stream, prefix, jcf, jcf->this_class, 1);
...@@ -1544,11 +1534,9 @@ DEFUN (print_name_for_stub_or_jni, (stream, jcf, name_index, signature_index, ...@@ -1544,11 +1534,9 @@ DEFUN (print_name_for_stub_or_jni, (stream, jcf, name_index, signature_index,
} }
static void static void
DEFUN(print_stub_or_jni, (stream, jcf, name_index, signature_index, is_init, print_stub_or_jni (FILE* stream, JCF* jcf, int name_index,
name_override, flags), int signature_index, int is_init,
FILE* stream AND JCF* jcf const char *name_override, int flags)
AND int name_index AND int signature_index
AND int is_init AND const char *name_override AND int flags)
{ {
if (JPOOL_TAG (jcf, signature_index) != CONSTANT_Utf8) if (JPOOL_TAG (jcf, signature_index) != CONSTANT_Utf8)
{ {
...@@ -1629,8 +1617,7 @@ DEFUN(print_stub_or_jni, (stream, jcf, name_index, signature_index, is_init, ...@@ -1629,8 +1617,7 @@ DEFUN(print_stub_or_jni, (stream, jcf, name_index, signature_index, is_init,
} }
static void static void
DEFUN(print_mangled_classname, (stream, jcf, prefix, index), print_mangled_classname (FILE *stream, JCF *jcf, const char *prefix, int index)
FILE *stream AND JCF *jcf AND const char *prefix AND int index)
{ {
int name_index = JPOOL_USHORT1 (jcf, index); int name_index = JPOOL_USHORT1 (jcf, index);
fputs (prefix, stream); fputs (prefix, stream);
...@@ -1965,8 +1952,7 @@ print_class_decls (out, jcf, self) ...@@ -1965,8 +1952,7 @@ print_class_decls (out, jcf, self)
static void static void
DEFUN(process_file, (jcf, out), process_file (JCF *jcf, FILE *out)
JCF *jcf AND FILE *out)
{ {
int code, i; int code, i;
uint32 field_start, method_end, method_start; uint32 field_start, method_end, method_start;
...@@ -2314,8 +2300,7 @@ version () ...@@ -2314,8 +2300,7 @@ version ()
} }
int int
DEFUN(main, (argc, argv), main (int argc, char** argv)
int argc AND char** argv)
{ {
JCF jcf; JCF jcf;
int argi; int argi;
......
...@@ -49,11 +49,7 @@ typedef unsigned int32 uint32; ...@@ -49,11 +49,7 @@ typedef unsigned int32 uint32;
#endif #endif
typedef uint16 jchar; typedef uint16 jchar;
#ifdef __STDC__
typedef signed char jbyte; typedef signed char jbyte;
#else
typedef char jbyte;
#endif
typedef int16 jshort; typedef int16 jshort;
typedef int32 jint; typedef int32 jint;
typedef int64 jlong; typedef int64 jlong;
......
...@@ -111,8 +111,7 @@ static void print_exception_table PARAMS ((struct JCF *, ...@@ -111,8 +111,7 @@ static void print_exception_table PARAMS ((struct JCF *,
#define PRINT_SIGNATURE_ARGS_ONLY 2 #define PRINT_SIGNATURE_ARGS_ONLY 2
static int static int
DEFUN(utf8_equal_string, (jcf, index, value), utf8_equal_string (JCF *jcf, int index, const char * value)
JCF *jcf AND int index AND const char * value)
{ {
if (CPOOL_INDEX_IN_RANGE (&jcf->cpool, index) if (CPOOL_INDEX_IN_RANGE (&jcf->cpool, index)
&& JPOOL_TAG (jcf, index) == CONSTANT_Utf8) && JPOOL_TAG (jcf, index) == CONSTANT_Utf8)
...@@ -346,8 +345,7 @@ DEFUN(utf8_equal_string, (jcf, index, value), ...@@ -346,8 +345,7 @@ DEFUN(utf8_equal_string, (jcf, index, value),
#include "javaop.h" #include "javaop.h"
static void static void
DEFUN(print_constant_ref, (stream, jcf, index), print_constant_ref (FILE *stream, JCF *jcf, int index)
FILE *stream AND JCF *jcf AND int index)
{ {
fprintf (stream, "#%d=<", index); fprintf (stream, "#%d=<", index);
if (index <= 0 || index >= JPOOL_SIZE(jcf)) if (index <= 0 || index >= JPOOL_SIZE(jcf))
...@@ -362,8 +360,7 @@ DEFUN(print_constant_ref, (stream, jcf, index), ...@@ -362,8 +360,7 @@ DEFUN(print_constant_ref, (stream, jcf, index),
or 'm' (method flags). */ or 'm' (method flags). */
static void static void
DEFUN (print_access_flags, (stream, flags, context), print_access_flags (FILE *stream, uint16 flags, char context)
FILE *stream AND uint16 flags AND char context)
{ {
if (flags & ACC_PUBLIC) fprintf (stream, " public"); if (flags & ACC_PUBLIC) fprintf (stream, " public");
if (flags & ACC_PRIVATE) fprintf (stream, " private"); if (flags & ACC_PRIVATE) fprintf (stream, " private");
...@@ -387,8 +384,7 @@ DEFUN (print_access_flags, (stream, flags, context), ...@@ -387,8 +384,7 @@ DEFUN (print_access_flags, (stream, flags, context),
static void static void
DEFUN(print_name, (stream, jcf, name_index), print_name (FILE* stream, JCF* jcf, int name_index)
FILE* stream AND JCF* jcf AND int name_index)
{ {
if (JPOOL_TAG (jcf, name_index) != CONSTANT_Utf8) if (JPOOL_TAG (jcf, name_index) != CONSTANT_Utf8)
fprintf (stream, "<not a UTF8 constant>"); fprintf (stream, "<not a UTF8 constant>");
...@@ -401,8 +397,7 @@ DEFUN(print_name, (stream, jcf, name_index), ...@@ -401,8 +397,7 @@ DEFUN(print_name, (stream, jcf, name_index),
print it tersely, otherwise more verbosely. */ print it tersely, otherwise more verbosely. */
static void static void
DEFUN(print_constant_terse, (out, jcf, index, expected), print_constant_terse (FILE *out, JCF *jcf, int index, int expected)
FILE *out AND JCF *jcf AND int index AND int expected)
{ {
if (! CPOOL_INDEX_IN_RANGE (&jcf->cpool, index)) if (! CPOOL_INDEX_IN_RANGE (&jcf->cpool, index))
fprintf (out, "<constant pool index %d not in range>", index); fprintf (out, "<constant pool index %d not in range>", index);
...@@ -422,8 +417,7 @@ DEFUN(print_constant_terse, (out, jcf, index, expected), ...@@ -422,8 +417,7 @@ DEFUN(print_constant_terse, (out, jcf, index, expected),
If verbosity==2, add more descriptive text. */ If verbosity==2, add more descriptive text. */
static void static void
DEFUN(print_constant, (out, jcf, index, verbosity), print_constant (FILE *out, JCF *jcf, int index, int verbosity)
FILE *out AND JCF *jcf AND int index AND int verbosity)
{ {
int j, n; int j, n;
jlong num; jlong num;
...@@ -579,8 +573,7 @@ DEFUN(print_constant, (out, jcf, index, verbosity), ...@@ -579,8 +573,7 @@ DEFUN(print_constant, (out, jcf, index, verbosity),
} }
static void static void
DEFUN(print_constant_pool, (jcf), print_constant_pool (JCF *jcf)
JCF *jcf)
{ {
int i; int i;
for (i = 1; i < JPOOL_SIZE(jcf); i++) for (i = 1; i < JPOOL_SIZE(jcf); i++)
...@@ -595,8 +588,8 @@ DEFUN(print_constant_pool, (jcf), ...@@ -595,8 +588,8 @@ DEFUN(print_constant_pool, (jcf),
} }
static void static void
DEFUN(print_signature_type, (stream, ptr, limit), print_signature_type (FILE* stream, const unsigned char **ptr,
FILE* stream AND const unsigned char **ptr AND const unsigned char *limit) const unsigned char *limit)
{ {
int array_size; int array_size;
if ((*ptr) >= limit) if ((*ptr) >= limit)
...@@ -657,8 +650,7 @@ DEFUN(print_signature_type, (stream, ptr, limit), ...@@ -657,8 +650,7 @@ DEFUN(print_signature_type, (stream, ptr, limit),
} }
static void static void
DEFUN(print_signature, (stream, jcf, signature_index, int options), print_signature (FILE* stream, JCF *jcf, int signature_index, int options)
FILE* stream AND JCF *jcf AND int signature_index AND int options)
{ {
if (JPOOL_TAG (jcf, signature_index) != CONSTANT_Utf8) if (JPOOL_TAG (jcf, signature_index) != CONSTANT_Utf8)
print_constant_terse (out, jcf, signature_index, CONSTANT_Utf8); print_constant_terse (out, jcf, signature_index, CONSTANT_Utf8);
...@@ -704,8 +696,7 @@ DEFUN(print_signature, (stream, jcf, signature_index, int options), ...@@ -704,8 +696,7 @@ DEFUN(print_signature, (stream, jcf, signature_index, int options),
static void static void
DEFUN(print_exception_table, (jcf, entries, count), print_exception_table (JCF *jcf, const unsigned char *entries, int count)
JCF *jcf AND const unsigned char *entries AND int count)
{ {
/* Print exception table. */ /* Print exception table. */
int i = count; int i = count;
...@@ -736,8 +727,7 @@ DEFUN(print_exception_table, (jcf, entries, count), ...@@ -736,8 +727,7 @@ DEFUN(print_exception_table, (jcf, entries, count),
#include "jcf-reader.c" #include "jcf-reader.c"
static void static void
DEFUN(process_class, (jcf), process_class (JCF *jcf)
JCF *jcf)
{ {
int code; int code;
if (jcf_parse_preamble (jcf) != 0) if (jcf_parse_preamble (jcf) != 0)
...@@ -849,8 +839,7 @@ version () ...@@ -849,8 +839,7 @@ version ()
} }
int int
DEFUN(main, (argc, argv), main (int argc, char** argv)
int argc AND char** argv)
{ {
JCF jcf[1]; JCF jcf[1];
int argi, opt; int argi, opt;
...@@ -1069,10 +1058,8 @@ DEFUN(main, (argc, argv), ...@@ -1069,10 +1058,8 @@ DEFUN(main, (argc, argv),
static void static void
DEFUN(disassemble_method, (jcf, byte_ops, len), disassemble_method (JCF* jcf, const unsigned char *byte_ops, 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 #undef PTR
int PC; int PC;
int i; int i;
......
...@@ -48,8 +48,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ ...@@ -48,8 +48,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#endif #endif
int int
DEFUN(jcf_unexpected_eof, (jcf, count), jcf_unexpected_eof (JCF *jcf, int count ATTRIBUTE_UNUSED)
JCF *jcf AND int count ATTRIBUTE_UNUSED)
{ {
if (jcf->filename) if (jcf->filename)
fprintf (stderr, "Premature end of .class file %s.\n", jcf->filename); fprintf (stderr, "Premature end of .class file %s.\n", jcf->filename);
...@@ -59,8 +58,7 @@ DEFUN(jcf_unexpected_eof, (jcf, count), ...@@ -59,8 +58,7 @@ DEFUN(jcf_unexpected_eof, (jcf, count),
} }
void void
DEFUN(jcf_trim_old_input, (jcf), jcf_trim_old_input (JCF *jcf)
JCF *jcf)
{ {
int count = jcf->read_ptr - jcf->buffer; int count = jcf->read_ptr - jcf->buffer;
if (count > 0) if (count > 0)
...@@ -72,8 +70,7 @@ DEFUN(jcf_trim_old_input, (jcf), ...@@ -72,8 +70,7 @@ DEFUN(jcf_trim_old_input, (jcf),
} }
int int
DEFUN(jcf_filbuf_from_stdio, (jcf, count), jcf_filbuf_from_stdio (JCF *jcf, int count)
JCF *jcf AND int count)
{ {
FILE *file = (FILE*) (jcf->read_state); FILE *file = (FILE*) (jcf->read_state);
if (count > jcf->buffer_end - jcf->read_ptr) if (count > jcf->buffer_end - jcf->read_ptr)
...@@ -108,8 +105,7 @@ struct ZipFile *SeenZipFiles = NULL; ...@@ -108,8 +105,7 @@ struct ZipFile *SeenZipFiles = NULL;
*/ */
ZipFile * ZipFile *
DEFUN(opendir_in_zip, (zipfile, is_system), opendir_in_zip (const char *zipfile, int is_system)
const char *zipfile AND int is_system)
{ {
struct ZipFile* zipf; struct ZipFile* zipf;
char magic [4]; char magic [4];
...@@ -154,9 +150,8 @@ DEFUN(opendir_in_zip, (zipfile, is_system), ...@@ -154,9 +150,8 @@ DEFUN(opendir_in_zip, (zipfile, is_system),
*/ */
int int
DEFUN(open_in_zip, (jcf, zipfile, zipmember, is_system), open_in_zip (JCF *jcf, const char *zipfile, const char *zipmember,
JCF *jcf AND const char *zipfile AND const char *zipmember int is_system)
AND int is_system)
{ {
ZipDirectory *zipd; ZipDirectory *zipd;
int i, len; int i, len;
...@@ -189,8 +184,7 @@ DEFUN(open_in_zip, (jcf, zipfile, zipmember, is_system), ...@@ -189,8 +184,7 @@ DEFUN(open_in_zip, (jcf, zipfile, zipmember, is_system),
/* Read data from zip archive member. */ /* Read data from zip archive member. */
int int
DEFUN(read_zip_member, (jcf, zipd, zipf), read_zip_member (JCF *jcf, ZipDirectory *zipd, ZipFile *zipf)
JCF *jcf AND ZipDirectory *zipd AND ZipFile *zipf)
{ {
jcf->filbuf = jcf_unexpected_eof; jcf->filbuf = jcf_unexpected_eof;
jcf->zipd = (void *)zipd; jcf->zipd = (void *)zipd;
...@@ -237,8 +231,7 @@ DEFUN(read_zip_member, (jcf, zipd, zipf), ...@@ -237,8 +231,7 @@ DEFUN(read_zip_member, (jcf, zipd, zipf),
} }
const char * const char *
DEFUN(open_class, (filename, jcf, fd, dep_name), open_class (const char *filename, JCF *jcf, int fd, const char *dep_name)
const char *filename AND JCF *jcf AND int fd AND const char *dep_name)
{ {
if (jcf) if (jcf)
{ {
...@@ -273,8 +266,7 @@ DEFUN(open_class, (filename, jcf, fd, dep_name), ...@@ -273,8 +266,7 @@ DEFUN(open_class, (filename, jcf, fd, dep_name),
const char * const char *
DEFUN(find_classfile, (filename, jcf, dep_name), find_classfile (char *filename, JCF *jcf, const char *dep_name)
char *filename AND JCF *jcf AND const char *dep_name)
{ {
int fd = open (filename, O_RDONLY | O_BINARY); int fd = open (filename, O_RDONLY | O_BINARY);
if (fd < 0) if (fd < 0)
...@@ -289,8 +281,7 @@ DEFUN(find_classfile, (filename, jcf, dep_name), ...@@ -289,8 +281,7 @@ DEFUN(find_classfile, (filename, jcf, dep_name),
dirent **). */ dirent **). */
static int static int
DEFUN(compare_path, (key, entry), compare_path (const void *key, const void *entry)
const void *key AND const void *entry)
{ {
return strcmp ((const char *) key, return strcmp ((const char *) key,
(*((const struct dirent **) entry))->d_name); (*((const struct dirent **) entry))->d_name);
...@@ -299,8 +290,7 @@ DEFUN(compare_path, (key, entry), ...@@ -299,8 +290,7 @@ DEFUN(compare_path, (key, entry),
/* Returns nonzero if ENTRY names a .java or .class file. */ /* Returns nonzero if ENTRY names a .java or .class file. */
static int static int
DEFUN(java_or_class_file, (entry), java_or_class_file (const struct dirent *entry)
const struct dirent *entry)
{ {
const char *base = basename (entry->d_name); const char *base = basename (entry->d_name);
return (fnmatch ("*.java", base, 0) == 0 || return (fnmatch ("*.java", base, 0) == 0 ||
...@@ -325,8 +315,7 @@ typedef struct memoized_dirlist_entry ...@@ -325,8 +315,7 @@ typedef struct memoized_dirlist_entry
name. */ name. */
static int static int
DEFUN(memoized_dirlist_lookup_eq, (entry, key), memoized_dirlist_lookup_eq (const void *entry, const void *key)
const void *entry AND const void *key)
{ {
return strcmp ((const char *) key, return strcmp ((const char *) key,
((const memoized_dirlist_entry *) entry)->dir) == 0; ((const memoized_dirlist_entry *) entry)->dir) == 0;
...@@ -343,8 +332,7 @@ static htab_t memoized_dirlists; ...@@ -343,8 +332,7 @@ static htab_t memoized_dirlists;
know that it cannot succeed. FILENAME and BUF are as for stat. */ know that it cannot succeed. FILENAME and BUF are as for stat. */
static int static int
DEFUN(caching_stat, (filename, buf), caching_stat (char *filename, struct stat *buf)
char *filename AND struct stat *buf)
{ {
#if JCF_USE_SCANDIR #if JCF_USE_SCANDIR
char *sep; char *sep;
...@@ -410,8 +398,7 @@ DEFUN(caching_stat, (filename, buf), ...@@ -410,8 +398,7 @@ DEFUN(caching_stat, (filename, buf),
stored in TABLE_ENTRY (also a char *). */ stored in TABLE_ENTRY (also a char *). */
static int static int
DEFUN(memoized_class_lookup_eq, (table_entry, classname), memoized_class_lookup_eq (const void *table_entry, const void *classname)
const void *table_entry AND const void *classname)
{ {
return strcmp ((const char *)classname, (const char *)table_entry) == 0; return strcmp ((const char *)classname, (const char *)table_entry) == 0;
} }
...@@ -430,9 +417,8 @@ static htab_t memoized_class_lookups; ...@@ -430,9 +417,8 @@ static htab_t memoized_class_lookups;
file. */ file. */
const char * const char *
DEFUN(find_class, (classname, classname_length, jcf, source_ok), find_class (const char *classname, int classname_length, JCF *jcf,
const char *classname AND int classname_length AND JCF *jcf AND int source_ok) int source_ok)
{ {
int fd; int fd;
int i, k, java = -1, class = -1; int i, k, java = -1, class = -1;
...@@ -596,8 +582,7 @@ DEFUN(find_class, (classname, classname_length, jcf, source_ok), ...@@ -596,8 +582,7 @@ DEFUN(find_class, (classname, classname_length, jcf, source_ok),
} }
void void
DEFUN(jcf_print_char, (stream, ch), jcf_print_char (FILE *stream, int ch)
FILE *stream AND int ch)
{ {
switch (ch) switch (ch)
{ {
...@@ -628,8 +613,7 @@ DEFUN(jcf_print_char, (stream, ch), ...@@ -628,8 +613,7 @@ DEFUN(jcf_print_char, (stream, ch),
/* Print UTF8 string at STR of length LENGTH bytes to STREAM. */ /* Print UTF8 string at STR of length LENGTH bytes to STREAM. */
void void
DEFUN(jcf_print_utf8, (stream, str, length), jcf_print_utf8 (FILE *stream, register const unsigned char *str, int length)
FILE *stream AND register const unsigned char *str AND int length)
{ {
const unsigned char * limit = str + length; const unsigned char * limit = str + length;
while (str < limit) while (str < limit)
...@@ -647,9 +631,8 @@ DEFUN(jcf_print_utf8, (stream, str, length), ...@@ -647,9 +631,8 @@ DEFUN(jcf_print_utf8, (stream, str, length),
/* Same as jcf_print_utf8, but print IN_CHAR as OUT_CHAR. */ /* Same as jcf_print_utf8, but print IN_CHAR as OUT_CHAR. */
void void
DEFUN(jcf_print_utf8_replace, (stream, str, length, in_char, out_char), jcf_print_utf8_replace (FILE *stream, const unsigned char *str, int length,
FILE *stream AND const unsigned char *str AND int length int in_char, int out_char)
AND int in_char AND int out_char)
{ {
const unsigned char *limit = str + length; const unsigned char *limit = str + length;
while (str < limit) while (str < limit)
...@@ -671,8 +654,7 @@ DEFUN(jcf_print_utf8_replace, (stream, str, length, in_char, out_char), ...@@ -671,8 +654,7 @@ DEFUN(jcf_print_utf8_replace, (stream, str, length, in_char, out_char),
any classes, fields, or methods are valid.*/ any classes, fields, or methods are valid.*/
int int
DEFUN(verify_constant_pool, (jcf), verify_constant_pool (JCF *jcf)
JCF *jcf)
{ {
int i, n; int i, n;
for (i = 1; i < JPOOL_SIZE (jcf); i++) for (i = 1; i < JPOOL_SIZE (jcf); i++)
...@@ -721,8 +703,7 @@ DEFUN(verify_constant_pool, (jcf), ...@@ -721,8 +703,7 @@ DEFUN(verify_constant_pool, (jcf),
} }
void void
DEFUN(format_uint, (buffer, value, base), format_uint (char *buffer, uint64 value, int base)
char *buffer AND uint64 value AND int base)
{ {
#define WRITE_BUF_SIZE (4 + sizeof(uint64) * 8) #define WRITE_BUF_SIZE (4 + sizeof(uint64) * 8)
char buf[WRITE_BUF_SIZE]; char buf[WRITE_BUF_SIZE];
...@@ -746,8 +727,7 @@ DEFUN(format_uint, (buffer, value, base), ...@@ -746,8 +727,7 @@ DEFUN(format_uint, (buffer, value, base),
} }
void void
DEFUN(format_int, (buffer, value, base), format_int (char *buffer, jlong value, int base)
char *buffer AND jlong value AND int base)
{ {
uint64 abs_value; uint64 abs_value;
if (value < 0) if (value < 0)
......
...@@ -108,8 +108,7 @@ skip_attribute (jcf, number_of_attribute) ...@@ -108,8 +108,7 @@ skip_attribute (jcf, number_of_attribute)
#endif #endif
static int static int
DEFUN(get_attribute, (jcf), get_attribute (JCF *jcf)
JCF *jcf)
{ {
uint16 attribute_name = (JCF_FILL (jcf, 6), JCF_readu2 (jcf)); uint16 attribute_name = (JCF_FILL (jcf, 6), JCF_readu2 (jcf));
uint32 attribute_length = JCF_readu4 (jcf); uint32 attribute_length = JCF_readu4 (jcf);
...@@ -241,8 +240,7 @@ DEFUN(get_attribute, (jcf), ...@@ -241,8 +240,7 @@ DEFUN(get_attribute, (jcf),
/* Read and handle the pre-amble. */ /* Read and handle the pre-amble. */
static int static int
DEFUN(jcf_parse_preamble, (jcf), jcf_parse_preamble (JCF* jcf)
JCF* jcf)
{ {
uint32 magic = (JCF_FILL (jcf, 8), JCF_readu4 (jcf)); uint32 magic = (JCF_FILL (jcf, 8), JCF_readu4 (jcf));
uint16 minor_version ATTRIBUTE_UNUSED = JCF_readu2 (jcf); uint16 minor_version ATTRIBUTE_UNUSED = JCF_readu2 (jcf);
...@@ -262,8 +260,7 @@ DEFUN(jcf_parse_preamble, (jcf), ...@@ -262,8 +260,7 @@ DEFUN(jcf_parse_preamble, (jcf),
Return -2 if a bad cross-reference (index of other constant) was seen. Return -2 if a bad cross-reference (index of other constant) was seen.
*/ */
static int static int
DEFUN(jcf_parse_constant_pool, (jcf), jcf_parse_constant_pool (JCF* jcf)
JCF* jcf)
{ {
int i, n; int i, n;
JPOOL_SIZE (jcf) = (JCF_FILL (jcf, 2), JCF_readu2 (jcf)); JPOOL_SIZE (jcf) = (JCF_FILL (jcf, 2), JCF_readu2 (jcf));
...@@ -328,8 +325,7 @@ DEFUN(jcf_parse_constant_pool, (jcf), ...@@ -328,8 +325,7 @@ DEFUN(jcf_parse_constant_pool, (jcf),
/* Read various class flags and numbers. */ /* Read various class flags and numbers. */
static void static void
DEFUN(jcf_parse_class, (jcf), jcf_parse_class (JCF* jcf)
JCF* jcf)
{ {
int i; int i;
uint16 interfaces_count; uint16 interfaces_count;
...@@ -357,8 +353,7 @@ DEFUN(jcf_parse_class, (jcf), ...@@ -357,8 +353,7 @@ DEFUN(jcf_parse_class, (jcf),
/* Read fields. */ /* Read fields. */
static int static int
DEFUN(jcf_parse_fields, (jcf), jcf_parse_fields (JCF* jcf)
JCF* jcf)
{ {
int i, j; int i, j;
uint16 fields_count; uint16 fields_count;
...@@ -397,8 +392,7 @@ DEFUN(jcf_parse_fields, (jcf), ...@@ -397,8 +392,7 @@ DEFUN(jcf_parse_fields, (jcf),
/* Read methods. */ /* Read methods. */
static int static int
DEFUN(jcf_parse_one_method, (jcf), jcf_parse_one_method (JCF* jcf)
JCF* jcf)
{ {
int i; int i;
uint16 access_flags = (JCF_FILL (jcf, 8), JCF_readu2 (jcf)); uint16 access_flags = (JCF_FILL (jcf, 8), JCF_readu2 (jcf));
...@@ -421,8 +415,7 @@ DEFUN(jcf_parse_one_method, (jcf), ...@@ -421,8 +415,7 @@ DEFUN(jcf_parse_one_method, (jcf),
} }
static int static int
DEFUN(jcf_parse_methods, (jcf), jcf_parse_methods (JCF* jcf)
JCF* jcf)
{ {
int i; int i;
uint16 methods_count; uint16 methods_count;
...@@ -445,8 +438,7 @@ DEFUN(jcf_parse_methods, (jcf), ...@@ -445,8 +438,7 @@ DEFUN(jcf_parse_methods, (jcf),
/* Read attributes. */ /* Read attributes. */
static int static int
DEFUN(jcf_parse_final_attributes, (jcf), jcf_parse_final_attributes (JCF *jcf)
JCF *jcf)
{ {
int i; int i;
uint16 attributes_count = (JCF_FILL (jcf, 2), JCF_readu2 (jcf)); uint16 attributes_count = (JCF_FILL (jcf, 2), JCF_readu2 (jcf));
......
...@@ -31,7 +31,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ ...@@ -31,7 +31,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "real.h" #include "real.h"
#include "java-tree.h" #include "java-tree.h"
#include "obstack.h" #include "obstack.h"
#undef AND
#include "rtl.h" #include "rtl.h"
#include "flags.h" #include "flags.h"
#include "java-opcodes.h" #include "java-opcodes.h"
......
...@@ -28,25 +28,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ ...@@ -28,25 +28,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#ifndef GCC_JCF_H #ifndef GCC_JCF_H
#define GCC_JCF_H #define GCC_JCF_H
#include "javaop.h" #include "javaop.h"
#ifndef DEFUN
#if defined (__STDC__)
#define AND ,
#define PTR void *
#define DEFUN(name, arglist, args) name(args)
#else
#define PTR char *
#define AND ;
#define DEFUN(name, arglist, args) name arglist args;
#endif
#endif /* !DEFUN */
#ifndef PARAMS
#if defined (__STDC__)
#define PARAMS (paramlist) paramlist
#else
#define PARAMS (paramlist) ()
#endif
#endif
#ifndef JCF_u4 #ifndef JCF_u4
#define JCF_u4 unsigned long #define JCF_u4 unsigned long
......
...@@ -134,8 +134,7 @@ version () ...@@ -134,8 +134,7 @@ version ()
/* jc1-lite main entry point */ /* jc1-lite main entry point */
int int
DEFUN (main, (argc, argv), main (int argc, char **argv)
int argc AND char **argv)
{ {
int i = 1; int i = 1;
const char *output_file = NULL; const char *output_file = NULL;
......
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