diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 14:04:36 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 14:04:36 (GMT) |
commit | f1ba03cea5b82699a984c80bd2deac14fdc8df18 (patch) | |
tree | ebe777c3e0b83f4c4cec9212731da9ebe0a0cfd3 /java/src/jni/h5pDAPLImp.c | |
parent | 10343c197906415388f2a4c8d292e21d25cf7381 (diff) | |
download | hdf5-f1ba03cea5b82699a984c80bd2deac14fdc8df18.zip hdf5-f1ba03cea5b82699a984c80bd2deac14fdc8df18.tar.gz hdf5-f1ba03cea5b82699a984c80bd2deac14fdc8df18.tar.bz2 |
Source formatted
Diffstat (limited to 'java/src/jni/h5pDAPLImp.c')
-rw-r--r-- | java/src/jni/h5pDAPLImp.c | 93 |
1 files changed, 45 insertions, 48 deletions
diff --git a/java/src/jni/h5pDAPLImp.c b/java/src/jni/h5pDAPLImp.c index 2386df1..4654aa3 100644 --- a/java/src/jni/h5pDAPLImp.c +++ b/java/src/jni/h5pDAPLImp.c @@ -44,13 +44,12 @@ static herr_t H5D_append_cb(hid_t dataset_id, hsize_t *cur_dims, void *cb_data); * Signature: (JJJD)V */ JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1chunk_1cache - (JNIEnv *env, jclass clss, jlong dapl, jlong rdcc_nslots, - jlong rdcc_nbytes, jdouble rdcc_w0) +Java_hdf_hdf5lib_H5_H5Pset_1chunk_1cache(JNIEnv *env, jclass clss, jlong dapl, jlong rdcc_nslots, + jlong rdcc_nbytes, jdouble rdcc_w0) { UNUSED(clss); - if (H5Pset_chunk_cache((hid_t)dapl, (size_t)rdcc_nslots, (size_t)rdcc_nbytes, (double) rdcc_w0) < 0) + if (H5Pset_chunk_cache((hid_t)dapl, (size_t)rdcc_nslots, (size_t)rdcc_nbytes, (double)rdcc_w0) < 0) H5_LIBRARY_ERROR(ENVONLY); done: @@ -63,37 +62,38 @@ done: * Signature: (J[J[J[D)V */ JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1chunk_1cache - (JNIEnv *env, jclass clss, jlong dapl, jlongArray rdcc_nslots, - jlongArray rdcc_nbytes, jdoubleArray rdcc_w0) +Java_hdf_hdf5lib_H5_H5Pget_1chunk_1cache(JNIEnv *env, jclass clss, jlong dapl, jlongArray rdcc_nslots, + jlongArray rdcc_nbytes, jdoubleArray rdcc_w0) { - jboolean isCopy; - jdouble *w0Array = NULL; - jlong *rdcc_nslotsArray = NULL; - jlong *nbytesArray = NULL; - herr_t status = FAIL; + jboolean isCopy; + jdouble *w0Array = NULL; + jlong * rdcc_nslotsArray = NULL; + jlong * nbytesArray = NULL; + herr_t status = FAIL; UNUSED(clss); if (NULL != rdcc_w0) PIN_DOUBLE_ARRAY(ENVONLY, rdcc_w0, w0Array, &isCopy, "H5Pget_chunk_cache: rdcc_w0 array not pinned"); if (NULL != rdcc_nslots) - PIN_LONG_ARRAY(ENVONLY, rdcc_nslots, rdcc_nslotsArray, &isCopy, "H5Pget_chunk_cache: rdcc_nslots array not pinned"); + PIN_LONG_ARRAY(ENVONLY, rdcc_nslots, rdcc_nslotsArray, &isCopy, + "H5Pget_chunk_cache: rdcc_nslots array not pinned"); if (NULL != rdcc_nbytes) - PIN_LONG_ARRAY(ENVONLY, rdcc_nbytes, nbytesArray, &isCopy, "H5Pget_chunk_cache: nbytesArray array not pinned"); + PIN_LONG_ARRAY(ENVONLY, rdcc_nbytes, nbytesArray, &isCopy, + "H5Pget_chunk_cache: nbytesArray array not pinned"); { /* direct cast (size_t *)variable fails on 32-bit environment */ long long rdcc_nslots_temp = *rdcc_nslotsArray; - long long nbytes_temp = *nbytesArray; - size_t rdcc_nslots_t = (size_t) rdcc_nslots_temp; - size_t nbytes_t = (size_t) nbytes_temp; + long long nbytes_temp = *nbytesArray; + size_t rdcc_nslots_t = (size_t)rdcc_nslots_temp; + size_t nbytes_t = (size_t)nbytes_temp; if ((status = H5Pget_chunk_cache((hid_t)dapl, &rdcc_nslots_t, &nbytes_t, (double *)w0Array)) < 0) H5_LIBRARY_ERROR(ENVONLY); *rdcc_nslotsArray = (jlong)rdcc_nslots_t; - *nbytesArray = (jlong)nbytes_t; + *nbytesArray = (jlong)nbytes_t; } /* end direct cast special handling */ done: @@ -111,18 +111,18 @@ done: * Signature: (JLjava/lang/String;)V */ JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix - (JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix) +Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix(JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix) { const char *extFilePrefix = NULL; - herr_t retVal = FAIL; + herr_t retVal = FAIL; UNUSED(clss); if (NULL == prefix) H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pset_efile_prefix: external file prefix is NULL"); - PIN_JAVA_STRING(ENVONLY, prefix, extFilePrefix, NULL, "H5Pset_efile_prefix: external file prefix not pinned"); + PIN_JAVA_STRING(ENVONLY, prefix, extFilePrefix, NULL, + "H5Pset_efile_prefix: external file prefix not pinned"); if ((retVal = H5Pset_efile_prefix((hid_t)dapl_id, extFilePrefix)) < 0) H5_LIBRARY_ERROR(ENVONLY); @@ -138,19 +138,18 @@ done: * Signature: (J)Ljava/lang/String; */ JNIEXPORT jstring JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix - (JNIEnv *env, jclass clss, jlong dapl_id) +Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix(JNIEnv *env, jclass clss, jlong dapl_id) { - ssize_t prefix_size = -1; - char *pre = NULL; - jstring str = NULL; + ssize_t prefix_size = -1; + char * pre = NULL; + jstring str = NULL; UNUSED(clss); if ((prefix_size = H5Pget_efile_prefix((hid_t)dapl_id, (char *)NULL, 0)) < 0) H5_LIBRARY_ERROR(ENVONLY); - if (NULL == (pre = (char *) HDmalloc(sizeof(char) * (size_t)prefix_size + 1))) + if (NULL == (pre = (char *)HDmalloc(sizeof(char) * (size_t)prefix_size + 1))) H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_efile_prefix: memory allocation failed"); if (H5Pget_efile_prefix((hid_t)dapl_id, (char *)pre, (size_t)prefix_size + 1) < 0) @@ -159,7 +158,8 @@ Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, pre))) { CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); - H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_efile_prefix: out of memory - unable to construct string from UTF characters"); + H5_OUT_OF_MEMORY_ERROR( + ENVONLY, "H5Pget_efile_prefix: out of memory - unable to construct string from UTF characters"); } done: @@ -175,11 +175,11 @@ done: * Signature: (JI[JLjava/lang/Object;Ljava/lang/Object;)V */ JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1append_1flush - (JNIEnv *env, jclass clss, jlong plist_id, jint ndims, jlongArray boundary, jobject callback_op, jobject op_data) +Java_hdf_hdf5lib_H5_H5Pset_1append_1flush(JNIEnv *env, jclass clss, jlong plist_id, jint ndims, + jlongArray boundary, jobject callback_op, jobject op_data) { - cb_wrapper wrapper = { callback_op, op_data }; - herr_t status = FAIL; + cb_wrapper wrapper = {callback_op, op_data}; + herr_t status = FAIL; UNUSED(clss); @@ -191,7 +191,8 @@ Java_hdf_hdf5lib_H5_H5Pset_1append_1flush if (NULL == callback_op) H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pset_append_flush: callback_op is NULL"); - if ((status = H5Pset_append_flush((hid_t)plist_id, (unsigned)ndims, (const hsize_t *)boundary, (H5D_append_cb_t)H5D_append_cb, (void *)&wrapper)) < 0) + if ((status = H5Pset_append_flush((hid_t)plist_id, (unsigned)ndims, (const hsize_t *)boundary, + (H5D_append_cb_t)H5D_append_cb, (void *)&wrapper)) < 0) H5_LIBRARY_ERROR(ENVONLY); done: @@ -208,8 +209,7 @@ done: * Signature: (JI)V */ JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1virtual_1view - (JNIEnv *env, jclass clss, jlong dapl_id, jint view) +Java_hdf_hdf5lib_H5_H5Pset_1virtual_1view(JNIEnv *env, jclass clss, jlong dapl_id, jint view) { UNUSED(clss); @@ -226,8 +226,7 @@ done: * Signature: (J)I */ JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1virtual_1view - (JNIEnv *env, jclass clss, jlong dapl_id) +Java_hdf_hdf5lib_H5_H5Pget_1virtual_1view(JNIEnv *env, jclass clss, jlong dapl_id) { H5D_vds_view_t virtual_view = H5D_VDS_ERROR; @@ -246,8 +245,7 @@ done: * Signature: (JJ)V */ JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5Pset_1virtual_1printf_1gap - (JNIEnv *env, jclass clss, jlong dapl_id, jlong gap_size) +Java_hdf_hdf5lib_H5_H5Pset_1virtual_1printf_1gap(JNIEnv *env, jclass clss, jlong dapl_id, jlong gap_size) { UNUSED(clss); @@ -264,8 +262,7 @@ done: * Signature: (J)J */ JNIEXPORT jlong JNICALL -Java_hdf_hdf5lib_H5_H5Pget_1virtual_1printf_1gap - (JNIEnv *env, jclass clss, jlong dapl_id) +Java_hdf_hdf5lib_H5_H5Pget_1virtual_1printf_1gap(JNIEnv *env, jclass clss, jlong dapl_id) { hsize_t gap_size = 0; @@ -279,17 +276,16 @@ done: } /* end Java_hdf_hdf5lib_H5_H5Pget_1virtual_1printf_1gap */ static herr_t -H5D_append_cb - (hid_t dataset_id, hsize_t *cur_dims, void *cb_data) +H5D_append_cb(hid_t dataset_id, hsize_t *cur_dims, void *cb_data) { cb_wrapper *wrapper = (cb_wrapper *)cb_data; jlongArray cur_dimsArray; jmethodID mid; jobject visit_callback = wrapper->visit_callback; jclass cls; - JNIEnv *cbenv = NULL; - void *op_data = (void *)wrapper->op_data; - jint status = -1; + JNIEnv * cbenv = NULL; + void * op_data = (void *)wrapper->op_data; + jint status = -1; if (JVMPTR->AttachCurrentThread(JVMPAR, (void **)&cbenv, NULL) < 0) { CHECK_JNI_EXCEPTION(CBENVONLY, JNI_TRUE); @@ -299,7 +295,8 @@ H5D_append_cb if (NULL == (cls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback))) CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); - if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cls, "callback", "(J[JLhdf/hdf5lib/callbacks/H5D_append_t;)I"))) + if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cls, "callback", + "(J[JLhdf/hdf5lib/callbacks/H5D_append_t;)I"))) CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE); if (NULL != cur_dims) { |