PatchSet 4606 Date: 2004/04/02 20:14:38 Author: guilhem Branch: HEAD Tag: (none) Log: Fixed some warnings + changed the fix for final fields.
* kaffe/kaffevm/systems/unix-jthreads/jthread.h: Marked a parameter as unused. * kaffe/kaffeh/mem.c: Marked some parameters as unused. * kaffe/kaffevm/jar.c: Fixed some warnings. * kaffe/kaffevm/utf8const.c: Fixed some warnings. * libraries/javalib/bootstrap.classlist: Added java/io/VMObjectStreamClass.class to fix some warnings. * libraries/javalib/java/io/ObjectStreamField.java (setBooleanField, setCharField, setByteField, setShortField, setIntField, setLongField, setFloatField, setDoubleField): Use native methods directly to be able to set final fields. * libraries/javalib/java/io/VMObjectStreamClass.java (setBooleanNative, setCharNative, setByteNative, setShortNative, setIntNative, setLongNative, setFloatNative, setDoubleNative): New methods for serialization to be able to set final fields. * libraries/clib/native/ObjectInputStream.c: Changed implementation accordingly. * libraries/clib/native/ObjectStreamField.c: Removed file. * libraries/clib/native/Makefile.am: Removed ObjectStreamField.c * libraries/clib/native/Makefile.in: Regenerated. * include/Makefile.am: Added java_io_VMObjectStreamClass.h * include/Makefile.in: Regenerated. * libraries/javalib/Klasses.jar.bootstrap: Regenerated. Merged a fix from GNU Classpath. 2004-04-01 Jeroen Frijters <[EMAIL PROTECTED]> * java/text/DecimalFormat.java (scanFix): Removed suffix check for percent and permill check. Members: ChangeLog:1.2183->1.2184 include/Makefile.am:1.54->1.55 include/Makefile.in:1.149->1.150 kaffe/kaffeh/mem.c:1.5->1.6 kaffe/kaffevm/jar.c:1.25->1.26 kaffe/kaffevm/utf8const.c:1.33->1.34 kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.54->1.55 libraries/clib/native/Makefile.am:1.29->1.30 libraries/clib/native/Makefile.in:1.128->1.129 libraries/clib/native/ObjectInputStream.c:1.19->1.20 libraries/clib/native/ObjectStreamField.c:1.1->1.2(DEAD) libraries/javalib/Klasses.jar.bootstrap:1.50->1.51 libraries/javalib/bootstrap.classlist:1.41->1.42 libraries/javalib/java/io/ObjectStreamField.java:1.10->1.11 libraries/javalib/java/io/VMObjectStreamClass.java:1.2->1.3 libraries/javalib/java/text/DecimalFormat.java:1.26->1.27 Index: kaffe/ChangeLog diff -u kaffe/ChangeLog:1.2183 kaffe/ChangeLog:1.2184 --- kaffe/ChangeLog:1.2183 Fri Apr 2 20:08:20 2004 +++ kaffe/ChangeLog Fri Apr 2 20:14:38 2004 @@ -1,3 +1,50 @@ +2004-04-02 Guilhem Lavaux <[EMAIL PROTECTED]> + + * kaffe/kaffevm/systems/unix-jthreads/jthread.h: + Marked a parameter as unused. + + * kaffe/kaffeh/mem.c: Marked some parameters as unused. + + * kaffe/kaffevm/jar.c: Fixed some warnings. + + * kaffe/kaffevm/utf8const.c: Fixed some warnings. + + * libraries/javalib/bootstrap.classlist: Added + java/io/VMObjectStreamClass.class to fix some warnings. + + * libraries/javalib/java/io/ObjectStreamField.java + (setBooleanField, setCharField, setByteField, setShortField, + setIntField, setLongField, setFloatField, setDoubleField): Use + native methods directly to be able to set final fields. + + * libraries/javalib/java/io/VMObjectStreamClass.java + (setBooleanNative, setCharNative, setByteNative, setShortNative, + setIntNative, setLongNative, setFloatNative, setDoubleNative): + New methods for serialization to be able to set final fields. + + * libraries/clib/native/ObjectInputStream.c: Changed implementation + accordingly. + + * libraries/clib/native/ObjectStreamField.c: Removed file. + + * libraries/clib/native/Makefile.am: Removed ObjectStreamField.c + + * libraries/clib/native/Makefile.in: Regenerated. + + * include/Makefile.am: Added java_io_VMObjectStreamClass.h + + * include/Makefile.in: Regenerated. + + * libraries/javalib/Klasses.jar.bootstrap: Regenerated. + + Merged a fix from GNU Classpath. + + 2004-04-01 Jeroen Frijters <[EMAIL PROTECTED]> + + * java/text/DecimalFormat.java (scanFix): Removed suffix check + for percent and permill check. + + 2004-04-02 Dalibor Topic <[EMAIL PROTECTED]> * config/alpha/common.h: Index: kaffe/include/Makefile.am diff -u kaffe/include/Makefile.am:1.54 kaffe/include/Makefile.am:1.55 --- kaffe/include/Makefile.am:1.54 Thu Mar 25 20:58:29 2004 +++ kaffe/include/Makefile.am Fri Apr 2 20:14:41 2004 @@ -49,7 +49,7 @@ java_io_InputStream.h \ java_io_InterruptedIOException.h \ java_io_ObjectInputStream.h \ - java_io_ObjectStreamField.h \ + java_io_VMObjectStreamClass.h \ java_io_PrintStream.h \ java_io_RandomAccessFile.h \ java_lang_Boolean.h \ Index: kaffe/include/Makefile.in diff -u kaffe/include/Makefile.in:1.149 kaffe/include/Makefile.in:1.150 --- kaffe/include/Makefile.in:1.149 Mon Mar 29 19:45:38 2004 +++ kaffe/include/Makefile.in Fri Apr 2 20:14:41 2004 @@ -353,7 +353,7 @@ java_io_InputStream.h \ java_io_InterruptedIOException.h \ java_io_ObjectInputStream.h \ - java_io_ObjectStreamField.h \ + java_io_VMObjectStreamClass.h \ java_io_PrintStream.h \ java_io_RandomAccessFile.h \ java_lang_Boolean.h \ Index: kaffe/kaffe/kaffeh/mem.c diff -u kaffe/kaffe/kaffeh/mem.c:1.5 kaffe/kaffe/kaffeh/mem.c:1.6 --- kaffe/kaffe/kaffeh/mem.c:1.5 Tue Mar 30 17:14:46 2004 +++ kaffe/kaffe/kaffeh/mem.c Fri Apr 2 20:14:41 2004 @@ -95,30 +95,32 @@ } static void * -gcMalloc(struct _Collector *collector, size_t sz, gc_alloc_type_t type) +gcMalloc(struct _Collector *collector UNUSED, size_t sz, + gc_alloc_type_t type UNUSED) { return(jmalloc(sz)); } static void * -gcRealloc(struct _Collector *collector, void *mem, size_t sz, gc_alloc_type_t type) +gcRealloc(struct _Collector *collector UNUSED, void *mem, + size_t sz, gc_alloc_type_t type UNUSED) { return(jrealloc(mem, sz)); } -static void gcFree(struct _Collector *collector, void *mem) +static void gcFree(struct _Collector *collector UNUSED, void *mem) { jfree(mem); } void -postOutOfMemory(struct _errorInfo* einfo) +postOutOfMemory(struct _errorInfo* einfo UNUSED) { dprintf("Error: kaffeh ran out of memory.\n"); } void -postExceptionMessage(struct _errorInfo *e, +postExceptionMessage(struct _errorInfo *e UNUSED, const char *name, const char *msgfmt, ...) { va_list ap; Index: kaffe/kaffe/kaffevm/jar.c diff -u kaffe/kaffe/kaffevm/jar.c:1.25 kaffe/kaffe/kaffevm/jar.c:1.26 --- kaffe/kaffe/kaffevm/jar.c:1.25 Tue Jan 6 20:36:04 2004 +++ kaffe/kaffe/kaffevm/jar.c Fri Apr 2 20:14:42 2004 @@ -498,7 +498,7 @@ ABORT(); break; } - if( (pos >= 0) && (pos < jf->size) ) + if( (pos >= 0) && ((unsigned)pos < jf->size) ) { jf->offset = pos; retval = pos; @@ -639,6 +639,7 @@ static int readJarHeader(jarFile *jf, uint32 sig, void *buf, size_t len) { int retval = 0; + int ret; assert(jf != 0); assert((sig == CENTRAL_HEADER_SIGNATURE) || @@ -646,7 +647,8 @@ (sig == CENTRAL_END_SIGNATURE)); assert(buf != 0); - if( jarRead(jf, buf, len, instantiateSignature) == len ) + ret = jarRead(jf, buf, len, instantiateSignature); + if (ret >= 0 && (unsigned)ret == len ) { /* Check the signature */ if( sig == ((uint32 *)buf)[0] ) @@ -771,7 +773,7 @@ { jf->error = JAR_ERROR_ENTRY_COUNT_MISMATCH; } - else if( cde.sizeOfDirectory > pos ) + else if( cde.sizeOfDirectory > (unsigned)pos ) { jf->error = JAR_ERROR_IMPOSSIBLY_LARGE_DIRECTORY; } Index: kaffe/kaffe/kaffevm/utf8const.c diff -u kaffe/kaffe/kaffevm/utf8const.c:1.33 kaffe/kaffe/kaffevm/utf8const.c:1.34 --- kaffe/kaffe/kaffevm/utf8const.c:1.33 Mon Mar 8 21:21:10 2004 +++ kaffe/kaffe/kaffevm/utf8const.c Fri Apr 2 20:14:42 2004 @@ -342,7 +342,8 @@ char * utf8ConstEncode(const jchar *chars, int clength) { - int i, size = 0, pos = 0; + int i, pos = 0; + unsigned int size = 0; char * buf; /* Size output array */ Index: kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h diff -u kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.54 kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.55 --- kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.54 Thu Apr 1 16:23:50 2004 +++ kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h Fri Apr 2 20:14:42 2004 @@ -349,7 +349,7 @@ int jthread_has_run(jthread_t jt); static inline -bool jthread_attach_current_thread(bool isDaemon) +bool jthread_attach_current_thread(bool isDaemon UNUSED) { return false; } Index: kaffe/libraries/clib/native/Makefile.am diff -u kaffe/libraries/clib/native/Makefile.am:1.29 kaffe/libraries/clib/native/Makefile.am:1.30 --- kaffe/libraries/clib/native/Makefile.am:1.29 Thu Mar 25 20:58:30 2004 +++ kaffe/libraries/clib/native/Makefile.am Fri Apr 2 20:14:43 2004 @@ -15,8 +15,7 @@ ByteToCharIconv.c \ CharToByteDefault.c \ CharToByteIconv.c \ - ObjectInputStream.c \ - ObjectStreamField.c + ObjectInputStream.c LANG_SRCS = \ Class.c \ Index: kaffe/libraries/clib/native/Makefile.in diff -u kaffe/libraries/clib/native/Makefile.in:1.128 kaffe/libraries/clib/native/Makefile.in:1.129 --- kaffe/libraries/clib/native/Makefile.in:1.128 Mon Mar 29 19:46:04 2004 +++ kaffe/libraries/clib/native/Makefile.in Fri Apr 2 20:14:43 2004 @@ -74,8 +74,7 @@ libnative_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am__objects_1 = ByteToCharDefault.lo ByteToCharIconv.lo \ - CharToByteDefault.lo CharToByteIconv.lo ObjectInputStream.lo \ - ObjectStreamField.lo + CharToByteDefault.lo CharToByteIconv.lo ObjectInputStream.lo am__objects_2 = Class.lo ClassLoader.lo Compiler.lo Double.lo Float.lo \ Math.lo MemoryAdvice.lo NativeLibrary.lo Object.lo \ PrimordialClassLoader.lo Runtime.lo String.lo System.lo \ @@ -107,7 +106,6 @@ @AMDEP_TRUE@ ./$(DEPDIR)/NativeLibrary.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/Object.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/ObjectInputStream.Plo \ [EMAIL PROTECTED]@ ./$(DEPDIR)/ObjectStreamField.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/PrimordialClassLoader.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/Runtime.Plo ./$(DEPDIR)/String.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/System.Plo ./$(DEPDIR)/TestNative.Plo \ @@ -365,8 +363,7 @@ ByteToCharIconv.c \ CharToByteDefault.c \ CharToByteIconv.c \ - ObjectInputStream.c \ - ObjectStreamField.c + ObjectInputStream.c LANG_SRCS = \ Class.c \ @@ -502,7 +499,6 @@ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@ [EMAIL PROTECTED]@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@ Index: kaffe/libraries/clib/native/ObjectInputStream.c diff -u kaffe/libraries/clib/native/ObjectInputStream.c:1.19 kaffe/libraries/clib/native/ObjectInputStream.c:1.20 --- kaffe/libraries/clib/native/ObjectInputStream.c:1.19 Thu Mar 25 20:58:30 2004 +++ kaffe/libraries/clib/native/ObjectInputStream.c Fri Apr 2 20:14:43 2004 @@ -10,14 +10,17 @@ #include "config-std.h" #include <kaffe/jtypes.h> #include <native.h> -#include "java_lang_SecurityManager.h" -#include "java_io_ObjectInputStream.h" #include "../../../kaffe/kaffevm/object.h" #include "../../../kaffe/kaffevm/classMethod.h" #include "../../../kaffe/kaffevm/exception.h" #include "../../../kaffe/kaffevm/lookup.h" #include "../../../kaffe/kaffevm/soft.h" #include "../../../kaffe/kaffevm/support.h" +#include "java_lang_SecurityManager.h" +#include "java_io_ObjectInputStream.h" +#include "java_lang_reflect_Field.h" +#include "java_io_VMObjectStreamClass.h" + struct Hjava_lang_ClassLoader* java_io_ObjectInputStream_currentClassLoader( @@ -30,7 +33,7 @@ struct Hjava_lang_Object* java_io_ObjectInputStream_allocateObject( - struct Hjava_io_ObjectInputStream* this, + struct Hjava_io_ObjectInputStream* this UNUSED, struct Hjava_lang_Class* clazz) { if (CLASS_IS_INTERFACE(clazz) || CLASS_IS_ABSTRACT(clazz)) @@ -41,7 +44,7 @@ void java_io_ObjectInputStream_callConstructor( - struct Hjava_io_ObjectInputStream* this, + struct Hjava_io_ObjectInputStream* this UNUSED, struct Hjava_lang_Class* clazz, struct Hjava_lang_Object* object) { @@ -78,4 +81,77 @@ meth = findMethodLocal(clazz, init_name, void_signature); return (meth != NULL); +} + + +void java_io_VMObjectStreamClass_setBooleanNative + (struct Hjava_lang_reflect_Field* sfield, + struct Hjava_lang_Object* obj, + jboolean value) +{ + java_lang_reflect_Field_setBoolean0(sfield, obj, value); +} + +void java_io_VMObjectStreamClass_setByteNative + (struct Hjava_lang_reflect_Field* sfield, + struct Hjava_lang_Object* obj, + jbyte value) +{ + java_lang_reflect_Field_setByte0(sfield, obj, value); +} + +void java_io_VMObjectStreamClass_setCharNative + (struct Hjava_lang_reflect_Field* sfield, + struct Hjava_lang_Object* obj, + jchar value) +{ + java_lang_reflect_Field_setChar0(sfield, obj, value); +} + +void java_io_VMObjectStreamClass_setShortNative + (struct Hjava_lang_reflect_Field* sfield, + struct Hjava_lang_Object* obj, + jshort value) +{ + java_lang_reflect_Field_setShort0(sfield, obj, value); +} + +void java_io_VMObjectStreamClass_setIntNative + (struct Hjava_lang_reflect_Field* sfield, + struct Hjava_lang_Object* obj, + jint value) +{ + java_lang_reflect_Field_setInt0(sfield, obj, value); +} + +void java_io_VMObjectStreamClass_setLongNative + (struct Hjava_lang_reflect_Field* sfield, + struct Hjava_lang_Object* obj, + jlong value) +{ + java_lang_reflect_Field_setLong0(sfield, obj, value); +} + +void java_io_VMObjectStreamClass_setFloatNative + (struct Hjava_lang_reflect_Field* sfield, + struct Hjava_lang_Object* obj, + jfloat value) +{ + java_lang_reflect_Field_setFloat0(sfield, obj, value); +} + +void java_io_VMObjectStreamClass_setDoubleNative + (struct Hjava_lang_reflect_Field* sfield, + struct Hjava_lang_Object* obj, + jdouble value) +{ + java_lang_reflect_Field_setDouble0(sfield, obj, value); +} + +void java_io_VMObjectStreamClass_setObjectNative + (struct Hjava_lang_reflect_Field* sfield, + struct Hjava_lang_Object* obj, + struct Hjava_lang_Object* value) +{ + java_lang_reflect_Field_setObject0(sfield, obj, value); } =================================================================== Checking out kaffe/libraries/clib/native/ObjectStreamField.c RCS: /home/cvs/kaffe/kaffe/libraries/clib/native/Attic/ObjectStreamField.c,v VERS: 1.1 *************** --- kaffe/libraries/clib/native/ObjectStreamField.c Fri Apr 2 20:42:31 2004 +++ /dev/null Sun Aug 4 19:57:58 2002 @@ -1,105 +0,0 @@ -/* - * ObjectInputStream.c - * - * Copyright (C) 2003, 2004 Kaffe.org's team. - * - * See "licence.terms" for information on usage and redistribution - * of this file. - */ -#include "config.h" -#include "config-std.h" -#include <kaffe/jtypes.h> -#include <native.h> -#include "java_io_ObjectStreamField.h" -#include "../../../kaffe/kaffevm/object.h" -#include "../../../kaffe/kaffevm/support.h" - -void java_io_ObjectStreamField_setBooleanNative - (struct Hjava_io_ObjectStreamField* sfield, - struct Hjava_lang_Object* obj, - jboolean value) -{ - do_execute_java_method(unhand(sfield)->field, "setBooleanInternal", - "(Ljava/lang/Object;Z)V", - 0, false, obj, value); -} - -void java_io_ObjectStreamField_setByteNative - (struct Hjava_io_ObjectStreamField* sfield, - struct Hjava_lang_Object* obj, - jbyte value) -{ - do_execute_java_method(unhand(sfield)->field, "setByteInternal", - "(Ljava/lang/Object;B)V", - 0, false, obj, value); -} - -void java_io_ObjectStreamField_setCharNative - (struct Hjava_io_ObjectStreamField* sfield, - struct Hjava_lang_Object* obj, - jchar value) -{ - do_execute_java_method(unhand(sfield)->field, "setCharInternal", - "(Ljava/lang/Object;B)V", - 0, false, obj, value); -} - -void java_io_ObjectStreamField_setShortNative - (struct Hjava_io_ObjectStreamField* sfield, - struct Hjava_lang_Object* obj, - jshort value) -{ - do_execute_java_method(unhand(sfield)->field, "setShortInternal", - "(Ljava/lang/Object;S)V", - 0, false, obj, value); -} - -void java_io_ObjectStreamField_setIntNative - (struct Hjava_io_ObjectStreamField* sfield, - struct Hjava_lang_Object* obj, - jint value) -{ - do_execute_java_method(unhand(sfield)->field, "setIntInternal", - "(Ljava/lang/Object;I)V", - 0, false, obj, value); -} - -void java_io_ObjectStreamField_setLongNative - (struct Hjava_io_ObjectStreamField* sfield, - struct Hjava_lang_Object* obj, - jlong value) -{ - do_execute_java_method(unhand(sfield)->field, "setLongInternal", - "(Ljava/lang/Object;J)V", - 0, false, obj, value); -} - -void java_io_ObjectStreamField_setFloatNative - (struct Hjava_io_ObjectStreamField* sfield, - struct Hjava_lang_Object* obj, - jfloat value) -{ - do_execute_java_method(unhand(sfield)->field, "setFloatInternal", - "(Ljava/lang/Object;F)V", - 0, false, obj, value); -} - -void java_io_ObjectStreamField_setDoubleNative - (struct Hjava_io_ObjectStreamField* sfield, - struct Hjava_lang_Object* obj, - jdouble value) -{ - do_execute_java_method(unhand(sfield)->field, "setDoubleInternal", - "(Ljava/lang/Object;D)V", - 0, false, obj, value); -} - -void java_io_ObjectStreamField_setObjectNative - (struct Hjava_io_ObjectStreamField* sfield, - struct Hjava_lang_Object* obj, - struct Hjava_lang_Object* value) -{ - do_execute_java_method(unhand(sfield)->field, "setInternal", - "(Ljava/lang/Object;Ljava/lang/Object;)V", - 0, false, obj, value); -} Index: kaffe/libraries/javalib/Klasses.jar.bootstrap cvs rdiff: failed to read diff file header /tmp/cvsjYoWUl for Klasses.jar.bootstrap,v: end of file system command returned non-zero exit status: 1: aborting _______________________________________________ kaffe mailing list [EMAIL PROTECTED] http://kaffe.org/cgi-bin/mailman/listinfo/kaffe