diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-04-14 12:37:38 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-04-14 12:37:38 (GMT) |
commit | 86bac7b594deeba7c3c23732fe5ebd427c012dd2 (patch) | |
tree | 2e22176bcb69969e911e351991557a5e83913d2d /java/src | |
parent | 8668195f417cb22df596e3d440da7502adae1597 (diff) | |
parent | 311a9c9147cf03e8a4b33fb1500ad9a73d07e540 (diff) | |
download | hdf5-86bac7b594deeba7c3c23732fe5ebd427c012dd2.zip hdf5-86bac7b594deeba7c3c23732fe5ebd427c012dd2.tar.gz hdf5-86bac7b594deeba7c3c23732fe5ebd427c012dd2.tar.bz2 |
Merge pull request #2481 in HDFFV/hdf5 from ~BYRN/hdf5_adb:hdf5_1_10 to hdf5_1_10
* commit '311a9c9147cf03e8a4b33fb1500ad9a73d07e540':
Fix shadoweed type
TRILAB-192 - cleanup edits and match CMake CXX to autotools
Add missing " and update function calls incorrectly named load_gcc_arguments. Commit changes to gnu-cxxflags to remove unmatched " and to gnu-fflags to not add C warnings flags to H5_FCFLAGS.
TRILAB-192 update LTparse files
TRILAB-192 - merge changes from develop
Update release note for CMake warnings
Correct extra flags and merge TRILAB-24
Correct cb object name
TRILAB-192 merging warnings changes from develop
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/jni/CMakeLists.txt | 1 | ||||
-rw-r--r-- | java/src/jni/h5aImp.c | 6 | ||||
-rw-r--r-- | java/src/jni/h5eImp.c | 6 | ||||
-rw-r--r-- | java/src/jni/h5lImp.c | 6 | ||||
-rw-r--r-- | java/src/jni/h5oImp.c | 41 |
5 files changed, 21 insertions, 39 deletions
diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 386a908..a5b2d96 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -77,6 +77,7 @@ add_library (${HDF5_JAVA_JNI_LIB_TARGET} SHARED ${HDF5_JAVA_JNI_CSRCS} ${HDF5_JA target_include_directories (${HDF5_JAVA_JNI_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_JAVA_JNI_SOURCE_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" ) +target_compile_options(${HDF5_JAVA_JNI_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") TARGET_C_PROPERTIES (${HDF5_JAVA_JNI_LIB_TARGET} SHARED) target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_target_properties (${HDF5_JAVA_JNI_LIB_TARGET} PROPERTIES FOLDER libraries/jni) diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c index 4dfbe39..b59aeb6 100644 --- a/java/src/jni/h5aImp.c +++ b/java/src/jni/h5aImp.c @@ -2146,7 +2146,7 @@ H5A_iterate_cb jobject visit_callback = wrapper->visit_callback; jstring str; JNIEnv *cbenv = NULL; - jclass cls; + jclass cbcls; jvalue args[4]; void *op_data = (void *)wrapper->op_data; jint status = -1; @@ -2156,10 +2156,10 @@ H5A_iterate_cb H5_JNI_FATAL_ERROR(CBENVONLY, "H5A_iterate_cb: failed to attach current thread to JVM"); } - if (NULL == (cls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback))) + if (NULL == (cbcls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback))) CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); - if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cls, "callback", "(JLjava/lang/String;Lhdf/hdf5lib/structs/H5A_info_t;Lhdf/hdf5lib/callbacks/H5A_iterate_t;)I"))) + if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cbcls, "callback", "(JLjava/lang/String;Lhdf/hdf5lib/structs/H5A_info_t;Lhdf/hdf5lib/callbacks/H5A_iterate_t;)I"))) CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); if (NULL == (str = CBENVPTR->NewStringUTF(CBENVONLY, name))) diff --git a/java/src/jni/h5eImp.c b/java/src/jni/h5eImp.c index 7ea4223..80e23a1 100644 --- a/java/src/jni/h5eImp.c +++ b/java/src/jni/h5eImp.c @@ -523,7 +523,7 @@ H5E_walk_cb jobject cb_info_t = NULL; jvalue args[7]; JNIEnv *cbenv = NULL; - jclass cls; + jclass cbcls; void *op_data = (void *)wrapper->op_data; jint status = FAIL; @@ -532,10 +532,10 @@ H5E_walk_cb H5_JNI_FATAL_ERROR(CBENVONLY, "H5E_walk_cb: failed to attach current thread to JVM"); } - if (NULL == (cls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback))) + if (NULL == (cbcls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback))) CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); - if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cls, "callback", "(ILhdf/hdf5lib/structs/H5E_error2_t;Lhdf/hdf5lib/callbacks/H5E_walk_t;)I"))) + if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cbcls, "callback", "(ILhdf/hdf5lib/structs/H5E_error2_t;Lhdf/hdf5lib/callbacks/H5E_walk_t;)I"))) CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); args[0].j = info->cls_id; diff --git a/java/src/jni/h5lImp.c b/java/src/jni/h5lImp.c index 6b55b46..ade53a3 100644 --- a/java/src/jni/h5lImp.c +++ b/java/src/jni/h5lImp.c @@ -625,7 +625,7 @@ H5L_iterate_cb jobject visit_callback = wrapper->visit_callback; jstring str; JNIEnv *cbenv = NULL; - jclass cls; + jclass cbcls; jvalue args[5]; void *op_data = (void *)wrapper->op_data; jint status = -1; @@ -636,10 +636,10 @@ H5L_iterate_cb } /* Get the Method ID for the "callback" function of the H5L_iterate_t class */ - if (NULL == (cls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback))) + if (NULL == (cbcls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback))) CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); - if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cls, "callback", "(JLjava/lang/String;Lhdf/hdf5lib/structs/H5L_info_t;Lhdf/hdf5lib/callbacks/H5L_iterate_t;)I"))) + if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cbcls, "callback", "(JLjava/lang/String;Lhdf/hdf5lib/structs/H5L_info_t;Lhdf/hdf5lib/callbacks/H5L_iterate_t;)I"))) CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); if (NULL == (str = CBENVPTR->NewStringUTF(CBENVONLY, name))) diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c index e332615..a52a905 100644 --- a/java/src/jni/h5oImp.c +++ b/java/src/jni/h5oImp.c @@ -378,15 +378,16 @@ H5O_iterate_cb (hid_t g_id, const char *name, const H5O_info_t *info, void *cb_data) { cb_wrapper *wrapper = (cb_wrapper *)cb_data; - jmethodID constructor, mid; + jmethodID mid; jobject cb_info_t = NULL; jobject visit_callback = wrapper->visit_callback; + jobject ret_obj = NULL; jobject hdrinfobuf; jobject ihinfobuf1; jobject ihinfobuf2; jstring str; JNIEnv *cbenv = NULL; - jclass cls; + jclass cbcls; jvalue args[12]; void *op_data = (void *)wrapper->op_data; jint status = FAIL; @@ -396,10 +397,10 @@ H5O_iterate_cb H5_JNI_FATAL_ERROR(CBENVONLY, "H5O_iterate_cb: failed to attach current thread to JVM"); } - if (NULL == (cls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback))) + if (NULL == (cbcls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback))) CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); - if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cls, "callback", "(JLjava/lang/String;Lhdf/hdf5lib/structs/H5O_info_t;Lhdf/hdf5lib/callbacks/H5O_iterate_t;)I"))) + if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cbcls, "callback", "(JLjava/lang/String;Lhdf/hdf5lib/structs/H5O_info_t;Lhdf/hdf5lib/callbacks/H5O_iterate_t;)I"))) CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); if (NULL == (str = CBENVPTR->NewStringUTF(CBENVONLY, name))) @@ -417,41 +418,21 @@ H5O_iterate_cb args[9].j = (jlong)info->hdr.mesg.shared; /* Get a reference to the H5_hdr_info_t class */ - if (NULL == (cls = CBENVPTR->FindClass(CBENVONLY, "hdf/hdf5lib/structs/H5O_hdr_info_t"))) - CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); - - /* Get a reference to the constructor; the name is <init> */ - if (NULL == (constructor = CBENVPTR->GetMethodID(CBENVONLY, cls, "<init>", "(IIIIJJJJJJ)V"))) - CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); - - if (NULL == (hdrinfobuf = CBENVPTR->NewObjectA(CBENVONLY, cls, constructor, args))) { - HDprintf("H5O_iterate_cb ERROR: hdf/hdf5lib/structs/H5O_hdr_info_t: Creation failed\n"); - CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); - } + CALL_CONSTRUCTOR(CBENVONLY, "hdf/hdf5lib/structs/H5O_hdr_info_t", "(IIIIJJJJJJ)V", args, ret_obj); + hdrinfobuf = ret_obj; args[0].j = (jlong)info->meta_size.obj.index_size; args[1].j = (jlong)info->meta_size.obj.heap_size; /* Get a reference to the H5_ih_info_t class */ - if (NULL == (cls = CBENVPTR->FindClass(CBENVONLY, "hdf/hdf5lib/structs/H5_ih_info_t"))) - CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); - - /* Get a reference to the constructor; the name is <init> */ - if (NULL == (constructor = CBENVPTR->GetMethodID(CBENVONLY, cls, "<init>", "(JJ)V"))) - CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); - - if (NULL == (ihinfobuf1 = CBENVPTR->NewObjectA(CBENVONLY, cls, constructor, args))) { - HDprintf("H5O_iterate_cb ERROR: hdf/hdf5lib/structs/H5_ih_info_t: Creation failed\n"); - CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); - } + CALL_CONSTRUCTOR(CBENVONLY, "hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args, ret_obj); + ihinfobuf1 = ret_obj; args[0].j = (jlong)info->meta_size.attr.index_size; args[1].j = (jlong)info->meta_size.attr.heap_size; - if (NULL == (ihinfobuf2 = CBENVPTR->NewObjectA(CBENVONLY, cls, constructor, args))) { - HDprintf("H5O_iterate_cb ERROR: hdf/hdf5lib/structs/H5_ih_info_t: Creation failed\n"); - CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); - } + CALL_CONSTRUCTOR(CBENVONLY, "hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args, ret_obj); + ihinfobuf2 = ret_obj; args[0].j = (jlong)info->fileno; args[1].j = (jlong)info->addr; |