From 00f39b23c11ce989351125496381cdcc4c54b16f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 18 Jun 2020 13:20:47 -0500 Subject: HDFFV-11111 add unimplemented errors in JNI --- java/src/jni/h5aImp.c | 21 +++++++++++++++++++++ java/src/jni/h5pFCPLImp.c | 10 ++++++++++ 2 files changed, 31 insertions(+) diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c index b59aeb6..c1a2631 100644 --- a/java/src/jni/h5aImp.c +++ b/java/src/jni/h5aImp.c @@ -94,11 +94,18 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5__1H5Aopen_1name (JNIEnv *env, jclass clss, jlong loc_id, jstring name) { +#ifndef H5_NO_DEPRECATED_SYMBOLS const char *attrName = NULL; +#endif hid_t attr_id = H5I_INVALID_HID; UNUSED(clss); +#ifdef H5_NO_DEPRECATED_SYMBOLS + UNUSED(loc_id); + UNUSED(name); + H5_UNIMPLEMENTED(ENVONLY, "H5Aopen_name: not implemented"); +#else if (NULL == name) H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Aopen_name: attribute name is null"); @@ -106,10 +113,13 @@ Java_hdf_hdf5lib_H5__1H5Aopen_1name if((attr_id = H5Aopen_name((hid_t)loc_id, attrName)) < 0) H5_LIBRARY_ERROR(ENVONLY); +#endif done: +#ifndef H5_NO_DEPRECATED_SYMBOLS if (attrName) UNPIN_JAVA_STRING(ENVONLY, name, attrName); +#endif return (jlong)attr_id; } /* end Java_hdf_hdf5lib_H5__1H5Aopen_1name */ @@ -127,8 +137,14 @@ Java_hdf_hdf5lib_H5__1H5Aopen_1idx UNUSED(clss); +#ifdef H5_NO_DEPRECATED_SYMBOLS + UNUSED(loc_id); + UNUSED(idx); + H5_UNIMPLEMENTED(ENVONLY, "H5Aopen_idx: not implemented"); +#else if ((attr_id = H5Aopen_idx((hid_t) loc_id, (unsigned int) idx)) < 0) H5_LIBRARY_ERROR(ENVONLY); +#endif done: return (jlong)attr_id; @@ -1512,8 +1528,13 @@ Java_hdf_hdf5lib_H5_H5Aget_1num_1attrs UNUSED(clss); +#ifdef H5_NO_DEPRECATED_SYMBOLS + UNUSED(loc_id); + H5_UNIMPLEMENTED(ENVONLY, "H5Aget_num_attrs: not implemented"); +#else if ((retVal = H5Aget_num_attrs((hid_t)loc_id)) < 0) H5_LIBRARY_ERROR(ENVONLY); +#endif done: return (jint)retVal; diff --git a/java/src/jni/h5pFCPLImp.c b/java/src/jni/h5pFCPLImp.c index cc7c264..e056fa8 100644 --- a/java/src/jni/h5pFCPLImp.c +++ b/java/src/jni/h5pFCPLImp.c @@ -40,13 +40,20 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1version (JNIEnv *env, jclass clss, jlong plist, jintArray version_info) { +#ifdef H5_NO_DEPRECATED_SYMBOLS jboolean isCopy; jsize arrLen; jint *theArray = NULL; +#endif herr_t status = FAIL; UNUSED(clss); +#ifdef H5_NO_DEPRECATED_SYMBOLS + UNUSED(loc_id); + UNUSED(name); + H5_UNIMPLEMENTED(ENVONLY, "H5Aopen_name: not implemented"); +#else if (NULL == version_info) H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_version: version_info input array is NULL"); @@ -62,10 +69,13 @@ Java_hdf_hdf5lib_H5_H5Pget_1version if ((status = H5Pget_version((hid_t)plist, (unsigned *)&(theArray[0]), (unsigned *)&(theArray[1]), (unsigned *)&(theArray[2]), (unsigned *)&(theArray[3]))) < 0) H5_LIBRARY_ERROR(ENVONLY); +#endif done: +#ifdef H5_NO_DEPRECATED_SYMBOLS if (theArray) UNPIN_INT_ARRAY(ENVONLY, version_info, theArray, (status < 0) ? JNI_ABORT : 0); +#endif return (jint)status; } /* end Java_hdf_hdf5lib_H5_H5Pget_1version */ -- cgit v0.12 From e4e86174dcc0385e44342f0b9566b15444503912 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 18 Jun 2020 14:41:03 -0500 Subject: HDFFV-11111 correct ifdef logic --- java/src/jni/h5pFCPLImp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/src/jni/h5pFCPLImp.c b/java/src/jni/h5pFCPLImp.c index e056fa8..0223e12 100644 --- a/java/src/jni/h5pFCPLImp.c +++ b/java/src/jni/h5pFCPLImp.c @@ -40,7 +40,7 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1version (JNIEnv *env, jclass clss, jlong plist, jintArray version_info) { -#ifdef H5_NO_DEPRECATED_SYMBOLS +#ifndef H5_NO_DEPRECATED_SYMBOLS jboolean isCopy; jsize arrLen; jint *theArray = NULL; @@ -72,7 +72,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1version #endif done: -#ifdef H5_NO_DEPRECATED_SYMBOLS +#ifndef H5_NO_DEPRECATED_SYMBOLS if (theArray) UNPIN_INT_ARRAY(ENVONLY, version_info, theArray, (status < 0) ? JNI_ABORT : 0); #endif -- cgit v0.12 From 61d21839269b9e3902cd0a09c3f773ec5f41e280 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 22 Jun 2020 08:48:56 -0500 Subject: Correct arg references --- java/src/jni/h5pFCPLImp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/src/jni/h5pFCPLImp.c b/java/src/jni/h5pFCPLImp.c index 0223e12..304623b 100644 --- a/java/src/jni/h5pFCPLImp.c +++ b/java/src/jni/h5pFCPLImp.c @@ -50,9 +50,9 @@ Java_hdf_hdf5lib_H5_H5Pget_1version UNUSED(clss); #ifdef H5_NO_DEPRECATED_SYMBOLS - UNUSED(loc_id); - UNUSED(name); - H5_UNIMPLEMENTED(ENVONLY, "H5Aopen_name: not implemented"); + UNUSED(plist); + UNUSED(version_info); + H5_UNIMPLEMENTED(ENVONLY, "H5Pget_version: not implemented"); #else if (NULL == version_info) H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_version: version_info input array is NULL"); -- cgit v0.12