Patch: gcj warning fix
Tom Tromey
tromey@redhat.com
Thu Jan 23 02:05:00 GMT 2003
My resource compilation patch came at the wrong moment, and I
neglected to de-PARAMS it.
This patch removes the uses of PARAMS, adds prototypes to resource.c,
and fixes a warning I introduced. Hopefully the new -Werror code will
help prevent me from doing this again.
Ok for mainline?
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* java-tree.h: Don't use PARAMS.
* resource.c: Add prototypes for all functions.
(write_resource_constructor): Use `const char *' to avoid
warning.
Index: java-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/java-tree.h,v
retrieving revision 1.170
diff -u -r1.170 java-tree.h
--- java-tree.h 22 Jan 2003 20:51:55 -0000 1.170
+++ java-tree.h 23 Jan 2003 02:03:27 -0000
@@ -1299,11 +1302,10 @@
extern void java_inlining_merge_static_initializers (tree, void *);
extern void java_inlining_map_static_initializers (tree, void *);
-extern void compile_resource_data PARAMS ((char *name, const char *buffer,
- int length));
-extern void write_resource_constructor PARAMS ((void));
-extern void compile_resource_file PARAMS ((char *name, const char *filename));
-extern void init_resource_processing PARAMS ((void));
+extern void compile_resource_data (char *name, const char *buffer, int length);
+extern void write_resource_constructor (void);
+extern void compile_resource_file (char *name, const char *filename);
+extern void init_resource_processing (void);
#define DECL_FINAL(DECL) DECL_LANG_FLAG_3 (DECL)
Index: resource.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/resource.c,v
retrieving revision 1.1
diff -u -r1.1 resource.c
--- resource.c 22 Jan 2003 20:51:55 -0000 1.1
+++ resource.c 23 Jan 2003 02:03:27 -0000
@@ -56,10 +56,7 @@
static int Jr_count = 0;
void
-compile_resource_data (name, buffer, length)
- char *name;
- const char *buffer;
- int length;
+compile_resource_data (char *name, const char *buffer, int length)
{
tree rtype, field = NULL_TREE, data_type, rinit, data, decl;
char buf[60];
@@ -102,7 +99,7 @@
}
void
-write_resource_constructor ()
+write_resource_constructor (void)
{
tree init_name, init_type, init_decl;
tree iter;
@@ -134,7 +131,7 @@
for (iter = nreverse (resources); iter != NULL_TREE;
iter = TREE_CHAIN (iter))
{
- char *name = IDENTIFIER_POINTER (DECL_NAME (TREE_VALUE (iter)));
+ const char *name = IDENTIFIER_POINTER (DECL_NAME (TREE_VALUE (iter)));
emit_library_call (registerResource_libfunc, 0, VOIDmode, 1,
gen_rtx (SYMBOL_REF, Pmode, name),
Pmode);
@@ -160,9 +157,7 @@
compiled Java resource, which is accessed by the runtime using
NAME. */
void
-compile_resource_file (name, filename)
- char *name;
- const char *filename;
+compile_resource_file (char *name, const char *filename)
{
struct stat stat_buf;
int fd;
@@ -190,7 +185,7 @@
}
void
-init_resource_processing ()
+init_resource_processing (void)
{
registerResource_libfunc =
gen_rtx_SYMBOL_REF (Pmode, "_Jv_RegisterResource");
More information about the Java-patches
mailing list