From 886f04adea430f3774c73e829094b53f4057eeb4 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sun, 15 Apr 2007 15:58:09 +0000 Subject: [PATCH] rid compile warnings from modern gcc --- bindings/java/src/jni/vmware/javavmware.c | 22 +++++++++++----------- src/os/linux/sigar_os.h | 3 +++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/bindings/java/src/jni/vmware/javavmware.c b/bindings/java/src/jni/vmware/javavmware.c index a5ee0979..2684753f 100644 --- a/bindings/java/src/jni/vmware/javavmware.c +++ b/bindings/java/src/jni/vmware/javavmware.c @@ -195,8 +195,8 @@ JNIEXPORT jboolean VMWARE_JNI(VMwareServer_isRegistered) dSERVER(obj); const char *config = JENV->GetStringUTFChars(env, jconfig, NULL); - jboolean value; - jboolean retval = + Bool value; + Bool retval = VMControl_ServerIsRegistered(server, config, &value); JENV->ReleaseStringUTFChars(env, jconfig, config); @@ -206,7 +206,7 @@ JNIEXPORT jboolean VMWARE_JNI(VMwareServer_isRegistered) return JNI_FALSE; } - return value; + return value ? JNI_TRUE : JNI_FALSE; } JNIEXPORT jobject VMWARE_JNI(VMwareServer_getRegisteredVmNames) @@ -337,7 +337,7 @@ JNIEXPORT jint VMWARE_JNI(VM_getExecutionState) (JNIEnv *env, jclass obj) { dVM(obj); - unsigned int state; + int state; if (!VMControl_VMGetExecutionState(vm, &state)) { vmware_throw_last_vm_error(); @@ -393,7 +393,7 @@ JNIEXPORT jint VMWARE_JNI(VM_getToolsLastActive) (JNIEnv *env, jclass obj) { dVM(obj); - unsigned int seconds; + int seconds; if (!VMControl_VMToolsLastActive(vm, &seconds)) { vmware_throw_last_vm_error(); @@ -544,7 +544,7 @@ JNIEXPORT jint VMWARE_JNI(VM_getProductInfo) (JNIEnv *env, jclass obj, jint type) { dVM(obj); - unsigned int value; + int value; if (!VMControl_VMGetProductInfo(vm, type, &value)) { vmware_throw_last_vm_error(); @@ -637,14 +637,14 @@ JNIEXPORT jboolean VMWARE_JNI(VM_hasSnapshot) (JNIEnv *env, jclass obj) { dVM(obj); - jboolean value; + Bool value; if (!VMControl_VMHasSnapshot(vm, &value)) { vmware_throw_last_vm_error(); return JNI_FALSE; } - return value; + return value ? JNI_TRUE : JNI_FALSE; } JNIEXPORT jlong VMWARE_JNI(VM_getPid) @@ -730,8 +730,8 @@ JNIEXPORT jboolean VMWARE_JNI(VM_deviceIsConnected) dVM(obj); const char *device = JENV->GetStringUTFChars(env, jdevice, NULL); - jboolean isConnected; - jboolean retval = + Bool isConnected; + Bool retval = VMControl_VMDeviceIsConnected(vm, device, &isConnected); @@ -742,7 +742,7 @@ JNIEXPORT jboolean VMWARE_JNI(VM_deviceIsConnected) return JNI_FALSE; } - return isConnected; + return isConnected ? JNI_TRUE : JNI_FALSE; } #endif /* VMCONTROL_WRAPPER_SUPPORTED */ diff --git a/src/os/linux/sigar_os.h b/src/os/linux/sigar_os.h index 9279ac19..cf500982 100644 --- a/src/os/linux/sigar_os.h +++ b/src/os/linux/sigar_os.h @@ -71,7 +71,10 @@ struct sigar_t { }; #define HAVE_STRERROR_R +#ifndef __USE_XOPEN2K +/* use gnu version of strerror_r */ #define HAVE_STRERROR_R_GLIBC +#endif #define HAVE_READDIR_R #define HAVE_GETPWNAM_R #define HAVE_GETPWUID_R