summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-09-30 14:48:28 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-09-30 14:48:28 (GMT)
commit10343c197906415388f2a4c8d292e21d25cf7381 (patch)
treeb3a1ac91bb3cea2ec2bfb5d6a228813b646f15c9 /java
parent43ce4b5e6e5eb4e848bf1726252f1ca17212e545 (diff)
parent3088c6abec27ad477031a71d947ac3be4cb2429d (diff)
downloadhdf5-10343c197906415388f2a4c8d292e21d25cf7381.zip
hdf5-10343c197906415388f2a4c8d292e21d25cf7381.tar.gz
hdf5-10343c197906415388f2a4c8d292e21d25cf7381.tar.bz2
Merge pull request #2903 in HDFFV/hdf5 from ~BYRN/hdf5_clang_format:hdf5_1_12 to hdf5_1_12
* commit '3088c6abec27ad477031a71d947ac3be4cb2429d': define name warning format fixes and define name from develop Src file format preventive updates Add clang-format changes from develop.
Diffstat (limited to 'java')
-rw-r--r--java/src/jni/CMakeLists.txt8
-rw-r--r--java/src/jni/h5Constants.c12
-rw-r--r--java/src/jni/h5util.c2
3 files changed, 15 insertions, 7 deletions
diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt
index 3f71122..5e21488 100644
--- a/java/src/jni/CMakeLists.txt
+++ b/java/src/jni/CMakeLists.txt
@@ -45,6 +45,7 @@ set (HDF5_JAVA_JNI_CHDRS
${HDF5_JAVA_JNI_SOURCE_DIR}/h5fImp.h
${HDF5_JAVA_JNI_SOURCE_DIR}/h5gImp.h
${HDF5_JAVA_JNI_SOURCE_DIR}/h5iImp.h
+ ${HDF5_JAVA_JNI_SOURCE_DIR}/h5Imp.h
${HDF5_JAVA_JNI_SOURCE_DIR}/h5jni.h
${HDF5_JAVA_JNI_SOURCE_DIR}/h5lImp.h
${HDF5_JAVA_JNI_SOURCE_DIR}/h5oImp.h
@@ -87,6 +88,13 @@ SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF
H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED "JAVA")
#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_JNI_SRC_FORMAT ${HDF5_JAVA_JNI_LIB_TARGET})
+endif ()
+
+#-----------------------------------------------------------------------------
# Add Target(s) to CMake Install for import into other projects
#-----------------------------------------------------------------------------
if (HDF5_EXPORTED_TARGETS)
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c
index a0ca4b6..c07a54b 100644
--- a/java/src/jni/h5Constants.c
+++ b/java/src/jni/h5Constants.c
@@ -26,8 +26,8 @@ extern "C" {
#include <stdlib.h>
#include "h5jni.h"
-H5_GCC_DIAG_OFF(missing-prototypes)
-H5_GCC_DIAG_OFF(unused-parameter)
+H5_GCC_DIAG_OFF("missing-prototypes")
+H5_GCC_DIAG_OFF("unused-parameter")
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5_1QUARTER_1HADDR_1MAX(JNIEnv *env, jclass cls) { return (hsize_t)HADDR_MAX/4; }
@@ -365,7 +365,7 @@ JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5ES_1STATUS_1CANCELED(JNIEnv *env, jclass cls) { return H5ES_STATUS_CANCELED; }
/* Java does not have unsigned native types */
-H5_GCC_DIAG_OFF(sign-conversion)
+H5_GCC_DIAG_OFF("sign-conversion")
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1CREAT(JNIEnv *env, jclass cls) { return H5F_ACC_CREAT; }
JNIEXPORT jint JNICALL
@@ -382,7 +382,7 @@ JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1SWMR_1READ(JNIEnv *env, jclass cls) { return H5F_ACC_SWMR_READ; }
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1SWMR_1WRITE(JNIEnv *env, jclass cls) { return H5F_ACC_SWMR_WRITE; }
-H5_GCC_DIAG_ON(sign-conversion)
+H5_GCC_DIAG_ON("sign-conversion")
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1DEFAULT(JNIEnv *env, jclass cls) { return H5F_CLOSE_DEFAULT; }
@@ -1408,8 +1408,8 @@ Java_hdf_hdf5lib_HDF5Constants_H5Z_1SCALEOFFSET_1USER_1NPARMS(JNIEnv *env, jclas
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1ALL(JNIEnv *env, jclass cls) { return H5Z_FILTER_ALL; }
-H5_GCC_DIAG_ON(missing-prototypes)
-H5_GCC_DIAG_ON(unused-parameter)
+H5_GCC_DIAG_ON("missing-prototypes")
+H5_GCC_DIAG_ON("unused-parameter")
#ifdef __cplusplus
} /* end extern "C" */
diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c
index f45902f..8c3686d 100644
--- a/java/src/jni/h5util.c
+++ b/java/src/jni/h5util.c
@@ -784,7 +784,7 @@ h5str_sprintf
if (NULL == (this_str = (char *) HDmalloc(27)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
- if (HDsprintf(this_str, "%Lf", tmp_ldouble) < 0)
+ if (HDsprintf(this_str, "%Lg", tmp_ldouble) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
break;