summaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-09-30 14:28:21 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-09-30 14:28:21 (GMT)
commitca0c0c3dc83acb7261e607cfee3b3ef04d167188 (patch)
tree6aa9407c7a4cb1bd10975205c14ff8b1ce3f0d5e /java/src
parent636cba89e605644c8f094fcc7f951c70cd895a39 (diff)
downloadhdf5-ca0c0c3dc83acb7261e607cfee3b3ef04d167188.zip
hdf5-ca0c0c3dc83acb7261e607cfee3b3ef04d167188.tar.gz
hdf5-ca0c0c3dc83acb7261e607cfee3b3ef04d167188.tar.bz2
Merge of clang-format changes from develop
Diffstat (limited to 'java/src')
-rw-r--r--java/src/jni/CMakeLists.txt8
-rw-r--r--java/src/jni/h5Constants.c13
-rw-r--r--java/src/jni/h5util.c2
3 files changed, 15 insertions, 8 deletions
diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt
index a5b2d96..ae9e789 100644
--- a/java/src/jni/CMakeLists.txt
+++ b/java/src/jni/CMakeLists.txt
@@ -44,6 +44,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
@@ -85,6 +86,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 f9b0cfd..dc8a13d 100644
--- a/java/src/jni/h5Constants.c
+++ b/java/src/jni/h5Constants.c
@@ -26,9 +26,8 @@ extern "C" {
#include <stdlib.h>
#include "h5jni.h"
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wmissing-prototypes"
-#pragma GCC diagnostic ignored "-Wunused-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; }
@@ -353,8 +352,7 @@ JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1WRITEERROR(JNIEnv *env, jclass cls) { return H5E_WRITEERROR; }
/* Java does not have unsigned native types */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-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
@@ -371,7 +369,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; }
-#pragma GCC diagnostic pop
+H5_GCC_DIAG_ON("sign-conversion")
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1DEFAULT(JNIEnv *env, jclass cls) { return H5F_CLOSE_DEFAULT; }
@@ -1337,7 +1335,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; }
-#pragma GCC diagnostic pop
+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 e8bfab2..c45873a 100644
--- a/java/src/jni/h5util.c
+++ b/java/src/jni/h5util.c
@@ -716,7 +716,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;