diff options
author | Bryce McKinlay <mckinlay@redhat.com> | 2006-02-09 01:35:33 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2006-02-09 01:35:33 +0000 |
commit | 1349c6885196987a8a167b852ff5c482de834333 (patch) | |
tree | 726a8b9fcb5ec53a03add370b1409565ddac5505 /libjava/java/lang | |
parent | c03a2b6f6879703fbf0655399ba73c7780c63336 (diff) | |
download | gcc-1349c6885196987a8a167b852ff5c482de834333.zip gcc-1349c6885196987a8a167b852ff5c482de834333.tar.gz gcc-1349c6885196987a8a167b852ff5c482de834333.tar.bz2 |
re PR libgcj/25187 (dereferencing type-punned pointer warnings while building libgcj)
2006-02-08 Bryce McKinlay <mckinlay@redhat.com>
PR libgcj/25187:
* gnu/gcj/io/natSimpleSHSStream.cc
(gnu::gcj::io::SimpleSHSStream::shsFinal): Remove bogus cast.
* interpret.cc (_Jv_InterpMethod::run): Simplify arguments to
_Jv_InterpFrame().
* boehm.cc: #undef some autoconf macros before including gc-config.h.
(_Jv_MarkObject): Don't mark the class, it is reachable via the vtable.
(_Jv_MarkArray): Likewise.
* java/lang/ref/natReference.cc (java::lang::ref::Reference::create):
Simplify _Jv_GCRegisterDisappearingLink() call.
* java/lang/Class.h (getComponentType): Use element_type.
(element_type): New field declaration, as a union with "methods".
* java/lang/natClassLoader.cc (_Jv_NewArrayClass): Use "element_type".
* java/net/natVMNetworkInterfacePosix.cc
(java::net::VMNetworkInterface::getInterfaces): Add "int" cast to
avoid sign comparison warning.
* include/java-interp.h (_Jv_InterpFrame): Take thread as second
argument, not parent call frame.
* include/x86_64-signal.h (MAKE_THROW_FRAME): Use "gregs" directly,
without a cast.
(restore_rt): Declare with hidden visibility, not "static".
* posix.cc (_Jv_platform_initProperties): Make "tmpdir" a string
constant.
* jni.cc (_Jv_JNI_DestroyJavaVM): Use a union to avoid strict alias
warning
From-SVN: r110783
Diffstat (limited to 'libjava/java/lang')
-rw-r--r-- | libjava/java/lang/Class.h | 8 | ||||
-rw-r--r-- | libjava/java/lang/natClassLoader.cc | 2 | ||||
-rw-r--r-- | libjava/java/lang/ref/natReference.cc | 4 |
3 files changed, 9 insertions, 5 deletions
diff --git a/libjava/java/lang/Class.h b/libjava/java/lang/Class.h index c94b6d3..62e280c 100644 --- a/libjava/java/lang/Class.h +++ b/libjava/java/lang/Class.h @@ -368,7 +368,7 @@ public: inline jclass getComponentType (void) { - return isArray () ? (* (jclass *) &methods) : 0; + return isArray () ? element_type : 0; } jboolean isAssignableFrom (jclass cls); @@ -554,7 +554,11 @@ private: _Jv_Constants constants; // Methods. If this is an array class, then this field holds a // pointer to the element type. - _Jv_Method *methods; + union + { + _Jv_Method *methods; + jclass element_type; + }; // Number of methods. If this class is primitive, this holds the // character used to represent this type in a signature. jshort method_count; diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc index 5f4d957..fa6f201 100644 --- a/libjava/java/lang/natClassLoader.cc +++ b/libjava/java/lang/natClassLoader.cc @@ -458,7 +458,7 @@ _Jv_NewArrayClass (jclass element, java::lang::ClassLoader *loader, = java::lang::Object::class$.vtable_method_count; // Stash the pointer to the element type. - array_class->methods = (_Jv_Method *) element; + array_class->element_type = element; // Register our interfaces. static jclass interfaces[] = diff --git a/libjava/java/lang/ref/natReference.cc b/libjava/java/lang/ref/natReference.cc index 5ad5b10..23f435f 100644 --- a/libjava/java/lang/ref/natReference.cc +++ b/libjava/java/lang/ref/natReference.cc @@ -363,8 +363,8 @@ void // finalizer for ourselves as well. _Jv_RegisterFinalizer (this, finalize_reference); _Jv_RegisterFinalizer (referent, finalize_referred_to_object); - jobject *objp = reinterpret_cast<jobject *> (&referent); - _Jv_GCRegisterDisappearingLink (objp); + gnu::gcj::RawData **p = &referent; + _Jv_GCRegisterDisappearingLink ((jobject *) p); add_to_hash (this); } } |