summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJacob Smith <jake.smith@hdfgroup.org>2019-08-14 20:36:45 (GMT)
committerJacob Smith <jake.smith@hdfgroup.org>2019-08-14 20:36:45 (GMT)
commit2e5cd3d2b2d953420252c80ab5e32ac95ac0c5b3 (patch)
treea79af758bc878d55a958bedae77d919e03a9516f /tools
parent2b72832d97496290f74ccaffcda41c3e596f8f49 (diff)
downloadhdf5-2e5cd3d2b2d953420252c80ab5e32ac95ac0c5b3.zip
hdf5-2e5cd3d2b2d953420252c80ab5e32ac95ac0c5b3.tar.gz
hdf5-2e5cd3d2b2d953420252c80ab5e32ac95ac0c5b3.tar.bz2
Fix compiler warnings with diabled ROS3 and HDFS VFDs.
Fix misuse of [HD]strncpy and [HD]snprintf. Minor formatting changes. Fix test cleanup issue with java groups example.
Diffstat (limited to 'tools')
-rw-r--r--tools/src/h5dump/h5dump.c4
-rw-r--r--tools/src/h5ls/h5ls.c4
-rw-r--r--tools/src/h5stat/h5stat.c8
3 files changed, 14 insertions, 2 deletions
diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c
index 347c189..5df701a 100644
--- a/tools/src/h5dump/h5dump.c
+++ b/tools/src/h5dump/h5dump.c
@@ -24,6 +24,7 @@ static int doxml = 0;
static int useschema = 1;
static const char *xml_dtd_uri = NULL;
+#ifdef H5_HAVE_ROS3_VFD
static H5FD_ros3_fapl_t ros3_fa = {
1, /* version */
false, /* authenticate */
@@ -31,7 +32,9 @@ static H5FD_ros3_fapl_t ros3_fa = {
"", /* access key id */
"", /* secret access key */
};
+#endif /* H5_HAVE_ROS3_VFD */
+#ifdef H5_HAVE_LIBHDFS
static H5FD_hdfs_fapl_t hdfs_fa = {
1, /* fapl version */
"localhost", /* namenode name */
@@ -40,6 +43,7 @@ static H5FD_hdfs_fapl_t hdfs_fa = {
"", /* user name */
2048, /* stream buffer size */
};
+#endif /* H5_HAVE_LIBHDFS */
/* module-scoped variables for XML option */
#define DEFAULT_XSD "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c
index 2364f23..7e2a431 100644
--- a/tools/src/h5ls/h5ls.c
+++ b/tools/src/h5ls/h5ls.c
@@ -2612,6 +2612,7 @@ main(int argc, const char *argv[])
int err_exit = 0;
hid_t fapl_id = H5P_DEFAULT;
+#ifdef H5_HAVE_ROS3_VFD
/* default "anonymous" s3 configuration */
H5FD_ros3_fapl_t ros3_fa = {
1, /* fapl version */
@@ -2620,7 +2621,9 @@ main(int argc, const char *argv[])
"", /* access key id */
"", /* secret access key */
};
+#endif /* H5_HVAE_ROS3_VFD */
+#ifdef H5_HAVE_LIBHDFS
/* "default" HDFS configuration */
H5FD_hdfs_fapl_t hdfs_fa = {
1, /* fapl version */
@@ -2630,6 +2633,7 @@ main(int argc, const char *argv[])
"", /* user name */
2048, /* stream buffer size */
};
+#endif /* H5_HAVE_LIBHDFS */
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c
index dd03f18..75d325a 100644
--- a/tools/src/h5stat/h5stat.c
+++ b/tools/src/h5stat/h5stat.c
@@ -120,6 +120,7 @@ typedef struct iter_t {
static const char *drivername = "";
+#ifdef H5_HAVE_ROS3_VFD
/* default "anonymous" s3 configuration
*/
static H5FD_ros3_fapl_t ros3_fa = {
@@ -129,7 +130,9 @@ static H5FD_ros3_fapl_t ros3_fa = {
"", /* access key id */
"", /* secret access key */
};
+#endif /* H5_HAVE_ROS3_VFD */
+#ifdef H5_HAVE_LIBHDFS
/* default HDFS access configuration
*/
static H5FD_hdfs_fapl_t hdfs_fa = {
@@ -140,6 +143,7 @@ static H5FD_hdfs_fapl_t hdfs_fa = {
"", /* user name */
2048, /* stream buffer size */
};
+#endif /* H5_HAVE_LIBHDFS */
static int display_all = TRUE;
@@ -544,8 +548,8 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "attribute_stats() failed");
/* Get storage info */
- if((storage = H5Dget_storage_size(did)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_storage_size() failed");
+ /* Failure 0 indistinguishable from no-data-stored 0 */
+ storage = H5Dget_storage_size(did);
/* Gather layout statistics */
if((dcpl = H5Dget_create_plist(did)) < 0)