diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2016-03-16 16:58:03 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2016-03-16 16:58:03 (GMT) |
commit | 1f5286ddf2cdf6162bfb9baab18e067658fbfabf (patch) | |
tree | 353049ba0d99c943eb917a640a1a2f9a39c68ada /java/src | |
parent | 0647698684f004c518d2807105db5fcaf2c22e7c (diff) | |
download | hdf5-1f5286ddf2cdf6162bfb9baab18e067658fbfabf.zip hdf5-1f5286ddf2cdf6162bfb9baab18e067658fbfabf.tar.gz hdf5-1f5286ddf2cdf6162bfb9baab18e067658fbfabf.tar.bz2 |
[svn-r29447] Correct signature of H5Pexist to return boolean
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/hdf/hdf5lib/H5.java | 5 | ||||
-rw-r--r-- | java/src/jni/h5pImp.c | 14 | ||||
-rw-r--r-- | java/src/jni/h5pImp.h | 4 |
3 files changed, 12 insertions, 11 deletions
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index fbfc40a..b8d9147 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -4360,13 +4360,12 @@ public class H5 implements java.io.Serializable { * IN: Identifier for the property to query * @param name * IN: Name of property to check for - * @return a positive value if the property exists in the property object; zero if the property does not exist; a - * negative value if failed + * @return a true value if the property exists in the property object; false if the property does not exist; * * @exception HDF5LibraryException * - Error from the HDF-5 Library. */ - public synchronized static native int H5Pexist(long plid, String name) throws HDF5LibraryException; + public synchronized static native boolean H5Pexist(long plid, String name) throws HDF5LibraryException; /** * H5Pget_size retrieves the size of a property's value in bytes diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index f4fee74..d542902 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -2162,24 +2162,26 @@ Java_hdf_hdf5lib_H5_H5Pset(JNIEnv *env, jclass clss, jlong plid, jstring name, j /* * Class: hdf_hdf5lib_H5 * Method: H5Pexist - * Signature: (JLjava/lang/String;)J + * Signature: (JLjava/lang/String;)Z */ -JNIEXPORT jlong JNICALL +JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Pexist(JNIEnv *env, jclass clss, jlong plid, jstring name) { - hid_t retVal = -1; + htri_t bval = JNI_FALSE; const char *cstr; PIN_JAVA_STRING(name, cstr, -1); - retVal = H5Pexist((hid_t)plid, cstr); + bval = H5Pexist((hid_t)plid, cstr); UNPIN_JAVA_STRING(name, cstr); - if (retVal < 0) + if (bval > 0) + bval = JNI_TRUE; + else if (bval < 0) h5libraryError(env); - return (jlong)retVal; + return (jboolean)bval; } /* end Java_hdf_hdf5lib_H5_H5Pexist */ /* diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h index ea1ee52..66488c2 100644 --- a/java/src/jni/h5pImp.h +++ b/java/src/jni/h5pImp.h @@ -579,9 +579,9 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Pset /* * Class: hdf_hdf5lib_H5 * Method: H5Pexist - * Signature: (JLjava/lang/String;)J + * Signature: (JLjava/lang/String;)Z */ -JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Pexist +JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Pexist (JNIEnv *, jclass, jlong, jstring); /* |