This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[Patch] Silence some compiler warnings.
- From: David Daney <ddaney at avtrex dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Wed, 16 May 2007 17:10:48 -0700
- Subject: [Patch] Silence some compiler warnings.
Some of the C++ files that make up libgcj are generating compiler
warnings. This patch silences them, and also removes a dead union
definition that I encountered along the way.
Tested on x86_64-pc-linux-gnu with no regressions.
OK to commit?
2007-05-16 David Daney <ddaney@avtrex.com>
* include/java-stack.h (_Jv_FrameInfo): Remove union definition.
(_Jv_StackFrame): Remove commented out code.
(_Jv_UnwindState): Remove superfluous 'typedef'.
* sun/misc/natUnsafe.cc (spinlock): Add white space to quiet
compiler warnings.
* gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc
(getCollectionUsage): Don't declare unused parameter n.
(getMemoryManagerNames): Same.
* gnu/classpath/jdwp/natVMVirtualMachine.cc (jdwpSingleStepCB):
Don't declare unused parameter jni_env.
* gnu/gcj/util/natGCInfo.cc (gc_debug_info): Remove superfluous
'typedef'.
Index: include/java-stack.h
===================================================================
--- include/java-stack.h (revision 124758)
+++ include/java-stack.h (working copy)
@@ -49,10 +49,6 @@ struct _Jv_InterpFrameInfo
};
#endif
-union _Jv_FrameInfo
-{
-};
-
struct _Jv_StackFrame
{
_Jv_FrameType type; /* Native or interpreted. */
@@ -69,12 +65,11 @@ struct _Jv_StackFrame
void *start_ip;
};
};
-// _Jv_FrameInfo info; /* Frame-type specific data. */
jclass klass;
_Jv_Method *meth;
};
-typedef struct _Jv_UnwindState;
+struct _Jv_UnwindState;
typedef _Unwind_Reason_Code (*_Jv_TraceFn) (_Jv_UnwindState *);
struct _Jv_UnwindState
Index: sun/misc/natUnsafe.cc
===================================================================
--- sun/misc/natUnsafe.cc (revision 124758)
+++ sun/misc/natUnsafe.cc (working copy)
@@ -31,7 +31,7 @@ public:
spinlock ()
{
- while (! compare_and_swap (&lock, 0, 1));
+ while (! compare_and_swap (&lock, 0, 1)) ;
}
~spinlock ()
{
Index: gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc
===================================================================
--- gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc (revision 124758)
+++ gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc (working copy)
@@ -20,7 +20,7 @@ details. */
#include <java/lang/UnsupportedOperationException.h>
::java::lang::management::MemoryUsage *
-gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getCollectionUsage(jstring n)
+gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getCollectionUsage(jstring)
{
throw new ::java::lang::UnsupportedOperationException (JvNewStringLatin1 ("gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getCollectionUsage (::java::lang::String *) not implemented"));
}
@@ -41,7 +41,7 @@ gnu::java::lang::management::VMMemoryPoo
JArray< ::java::lang::String *> *
-gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getMemoryManagerNames(jstring n)
+gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getMemoryManagerNames(jstring)
{
return (JArray<jstring>*)
JvNewObjectArray(1, &::java::lang::String::class$, JvNewStringLatin1("BoehmGC"));
Index: gnu/classpath/jdwp/natVMVirtualMachine.cc
===================================================================
--- gnu/classpath/jdwp/natVMVirtualMachine.cc (revision 124758)
+++ gnu/classpath/jdwp/natVMVirtualMachine.cc (working copy)
@@ -1001,7 +1001,7 @@ jdwpExceptionCB (jvmtiEnv *env, MAYBE_UN
}
static void JNICALL
-jdwpSingleStepCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
+jdwpSingleStepCB (jvmtiEnv *env, JNIEnv *, jthread thread,
jmethodID method, jlocation location)
{
jobject si =
Index: gnu/gcj/util/natGCInfo.cc
===================================================================
--- gnu/gcj/util/natGCInfo.cc (revision 124758)
+++ gnu/gcj/util/natGCInfo.cc (working copy)
@@ -66,7 +66,7 @@ extern "C" {
static int gc_ok = 1;
-typedef struct gc_debug_info
+struct gc_debug_info
{
int used;
int free;