[kaffe] CVS kaffe (robilad): warning fixes for gcc 4 on x86-linux
Kaffe CVS
cvs-commits at kaffe.org
Sat Aug 6 07:31:36 PDT 2005
PatchSet 6786
Date: 2005/08/06 14:25:10
Author: robilad
Branch: HEAD
Tag: (none)
Log:
warning fixes for gcc 4 on x86-linux
2005-08-06 Dalibor Topic <robilad at kaffe.org>
* kaffe/kaffevm/jar.c (jarSeek): Initialize pos
before use.
(getCentralDirCount) Initialize dir_size before use.
* kaffe/kaffevm/locks.c (slowLockObject): Initialize
isContention before use.
* kaffe/kaffevm/jni/jni-helpers.c (KaffeJNI_GetDirectBufferCapacity)
Return jlong.
* kaffe/kaffevm/jni/jni-string.c (KaffeJNI_GetStringUTFChars) Return
const char*. Changed type of return buffer to char*.
* kaffe/kaffevm/jni/jni_funcs.h (KaffeJNI_GetDirectBufferCapacity,
KaffeJNI_GetStringUTFChars): Fixed prototypes to match declarations
in jni.h.
* kaffe/kaffevm/systems/unix-pthreads/syscalls.c (jthreadedBind,
jthreadedConnect) Fixed to match declaration. Removed no longer
necessary socklen_t casts.
Members:
ChangeLog:1.4311->1.4312
kaffe/kaffevm/jar.c:1.38->1.39
kaffe/kaffevm/locks.c:1.63->1.64
kaffe/kaffevm/jni/jni-helpers.c:1.7->1.8
kaffe/kaffevm/jni/jni-string.c:1.12->1.13
kaffe/kaffevm/jni/jni_funcs.h:1.10->1.11
kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.32->1.33
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4311 kaffe/ChangeLog:1.4312
--- kaffe/ChangeLog:1.4311 Sat Aug 6 00:41:38 2005
+++ kaffe/ChangeLog Sat Aug 6 14:25:10 2005
@@ -1,3 +1,26 @@
+2005-08-06 Dalibor Topic <robilad at kaffe.org>
+
+ * kaffe/kaffevm/jar.c (jarSeek): Initialize pos
+ before use.
+ (getCentralDirCount) Initialize dir_size before use.
+
+ * kaffe/kaffevm/locks.c (slowLockObject): Initialize
+ isContention before use.
+
+ * kaffe/kaffevm/jni/jni-helpers.c (KaffeJNI_GetDirectBufferCapacity)
+ Return jlong.
+
+ * kaffe/kaffevm/jni/jni-string.c (KaffeJNI_GetStringUTFChars) Return
+ const char*. Changed type of return buffer to char*.
+
+ * kaffe/kaffevm/jni/jni_funcs.h (KaffeJNI_GetDirectBufferCapacity,
+ KaffeJNI_GetStringUTFChars): Fixed prototypes to match declarations
+ in jni.h.
+
+ * kaffe/kaffevm/systems/unix-pthreads/syscalls.c (jthreadedBind,
+ jthreadedConnect) Fixed to match declaration. Removed no longer
+ necessary socklen_t casts.
+
2005-08-05 Dalibor Topic <robilad at kaffe.org>
* kaffe/kaffevm/jit/codeproto.h (and_int_const):
Index: kaffe/kaffe/kaffevm/jar.c
diff -u kaffe/kaffe/kaffevm/jar.c:1.38 kaffe/kaffe/kaffevm/jar.c:1.39
--- kaffe/kaffe/kaffevm/jar.c:1.38 Fri May 6 15:24:28 2005
+++ kaffe/kaffe/kaffevm/jar.c Sat Aug 6 14:25:14 2005
@@ -487,7 +487,7 @@
#ifdef HAVE_MMAP
if( jf->data != (uint8*)-1 )
{
- off_t pos;
+ off_t pos = 0;
switch( whence )
{
@@ -804,7 +804,7 @@
*/
static int readJarEntries(jarFile *jf)
{
- unsigned int dir_size;
+ unsigned int dir_size = 0;
int retval = 0;
assert(jf != 0);
Index: kaffe/kaffe/kaffevm/locks.c
diff -u kaffe/kaffe/kaffevm/locks.c:1.63 kaffe/kaffe/kaffevm/locks.c:1.64
--- kaffe/kaffe/kaffevm/locks.c:1.63 Tue Jul 19 16:27:35 2005
+++ kaffe/kaffe/kaffevm/locks.c Sat Aug 6 14:25:14 2005
@@ -526,7 +526,7 @@
slowLockObject(Hjava_lang_Object* obj)
{
#if defined(ENABLE_JVMPI)
- jboolean isContention;
+ jboolean isContention = false;
if( JVMPI_EVENT_ISENABLED(JVMPI_EVENT_MONITOR_CONTENDED_ENTER) )
{
Index: kaffe/kaffe/kaffevm/jni/jni-helpers.c
diff -u kaffe/kaffe/kaffevm/jni/jni-helpers.c:1.7 kaffe/kaffe/kaffevm/jni/jni-helpers.c:1.8
--- kaffe/kaffe/kaffevm/jni/jni-helpers.c:1.7 Tue Jul 5 17:20:41 2005
+++ kaffe/kaffe/kaffevm/jni/jni-helpers.c Sat Aug 6 14:25:14 2005
@@ -82,7 +82,7 @@
return address;
}
-long KaffeJNI_GetDirectBufferCapacity(JNIEnv *env UNUSED, jobject buffer)
+jlong KaffeJNI_GetDirectBufferCapacity(JNIEnv *env UNUSED, jobject buffer)
{
jmethodID capacity_method;
jint capacity;
Index: kaffe/kaffe/kaffevm/jni/jni-string.c
diff -u kaffe/kaffe/kaffevm/jni/jni-string.c:1.12 kaffe/kaffe/kaffevm/jni/jni-string.c:1.13
--- kaffe/kaffe/kaffevm/jni/jni-string.c:1.12 Tue Jul 5 17:20:41 2005
+++ kaffe/kaffe/kaffevm/jni/jni-string.c Sat Aug 6 14:25:14 2005
@@ -141,12 +141,12 @@
return (count);
}
-const jbyte*
+const char*
KaffeJNI_GetStringUTFChars(JNIEnv* env, jstring data, jboolean* copy)
{
Hjava_lang_String* const str = (Hjava_lang_String*)unveil(data);
jchar* ptr;
- jbyte* buf;
+ char* buf;
jsize len;
jsize i;
jsize j;
Index: kaffe/kaffe/kaffevm/jni/jni_funcs.h
diff -u kaffe/kaffe/kaffevm/jni/jni_funcs.h:1.10 kaffe/kaffe/kaffevm/jni/jni_funcs.h:1.11
--- kaffe/kaffe/kaffevm/jni/jni_funcs.h:1.10 Tue Jul 5 17:20:41 2005
+++ kaffe/kaffe/kaffevm/jni/jni_funcs.h Sat Aug 6 14:25:14 2005
@@ -24,7 +24,7 @@
jobject KaffeJNI_ToReflectedField (JNIEnv *, jclass, jfieldID, jboolean);
jobject KaffeJNI_NewDirectByteBuffer(JNIEnv *, void *, jlong);
void * KaffeJNI_GetDirectBufferAddress(JNIEnv *, jobject);
-long KaffeJNI_GetDirectBufferCapacity(JNIEnv *, jobject);
+jlong KaffeJNI_GetDirectBufferCapacity(JNIEnv *, jobject);
void NONRETURNING
KaffeJNI_FatalError(JNIEnv* env, const char* mess);
@@ -38,7 +38,7 @@
KaffeJNI_GetStringChars(JNIEnv* env, jstring data, jboolean* copy);
jstring KaffeJNI_NewStringUTF(JNIEnv* env, const char* data);
jsize KaffeJNI_GetStringUTFLength(JNIEnv* env, jstring data);
-const jbyte*
+const char*
KaffeJNI_GetStringUTFChars(JNIEnv* env, jstring data, jboolean* copy);
void KaffeJNI_ReleaseStringUTFChars(JNIEnv* env, jstring data, const char* chars);
void KaffeJNI_GetStringRegion(JNIEnv *env, jstring data, jsize start, jsize len, jchar *buf);
Index: kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c
diff -u kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.32 kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.33
--- kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.32 Tue May 3 20:43:04 2005
+++ kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c Sat Aug 6 14:25:15 2005
@@ -196,11 +196,11 @@
}
static int
-jthreadedBind(int fd, struct sockaddr *addr, int namelen)
+jthreadedBind(int fd, struct sockaddr *addr, socklen_t namelen)
{
int rc = 0;
- if (bind(fd, addr, (socklen_t)namelen) == -1) {
+ if (bind(fd, addr, namelen) == -1) {
rc = errno;
}
return (rc);
@@ -420,7 +420,7 @@
* Threaded socket connect.
*/
static int
-jthreadedConnect(int fd, struct sockaddr* addr, int len, int timeout)
+jthreadedConnect(int fd, struct sockaddr* addr, socklen_t len, int timeout)
{
int r;
jlong deadline = 0;
@@ -428,7 +428,7 @@
SET_DEADLINE(deadline, timeout)
for (;;) {
- r = connect(fd, addr, (socklen_t)len);
+ r = connect(fd, addr, len);
if (r == 0 || !(errno == EINPROGRESS
|| errno == EINTR || errno == EISCONN)) {
break; /* success or real error */
More information about the kaffe
mailing list