summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2022-06-22 16:16:30 (GMT)
committerGitHub <noreply@github.com>2022-06-22 16:16:30 (GMT)
commit8b2e7b32b5b9987938ebf6936205f324bc5050b8 (patch)
tree17062db1b0521cbe22e759c5083b216ae6c62437 /src
parent55f4cc0caa69d65c505e926fb7b2568ab1a76c58 (diff)
downloadhdf5-8b2e7b32b5b9987938ebf6936205f324bc5050b8.zip
hdf5-8b2e7b32b5b9987938ebf6936205f324bc5050b8.tar.gz
hdf5-8b2e7b32b5b9987938ebf6936205f324bc5050b8.tar.bz2
Various warning fixes (#1812)
* Fixed -Wreserved-id-macro warnings from header include guards * Removed all __int64 and LL suffix stuff now that C99 is minimum requirement * Rename `H5FD_CTL__` to `H5FD_CTL_` to fix -Wreserved-id-macro warnings Double underscore is reserved in C++ and this public header should be C++ compatible. * Never define __STDC_FORMAT_MACROS anymore Defining it causes a -Wreserved-id-macro. Happily, according to the C++11 standard: "The macros defined by <stdint> are provided unconditionally. In particular, the symbols __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS (mentioned in C99 footnotes 219, 220, and 222) play no role in C++." https://cplusplus.github.io/LWG/issue984 So looks like it's not necessary to define it with reasonably new toolchains. * Fixed some -Wunused-macros warnings, removed dead code * Fixed all -Wdouble-promotion warnings in C++ files * Fixed remaining -Wsuggest-destructor-override warnings * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/H5Dcompact.c4
-rw-r--r--src/H5ESdevelop.h6
-rw-r--r--src/H5FD.c4
-rw-r--r--src/H5FDdevelop.h6
-rw-r--r--src/H5FDmpi.c12
-rw-r--r--src/H5FDmpio.c14
-rw-r--r--src/H5FDmulti.c2
-rw-r--r--src/H5FDpublic.h26
-rw-r--r--src/H5FDsec2.c2
-rw-r--r--src/H5FDsplitter.c6
-rw-r--r--src/H5Idevelop.h6
-rw-r--r--src/H5Ldevelop.h6
-rw-r--r--src/H5Tdevelop.h6
-rw-r--r--src/H5Zdevelop.h6
-rw-r--r--src/H5public.h5
15 files changed, 56 insertions, 55 deletions
diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c
index 92252dc..94dc64d 100644
--- a/src/H5Dcompact.c
+++ b/src/H5Dcompact.c
@@ -285,7 +285,7 @@ H5D__compact_iovv_memmanage_cb(hsize_t dst_off, hsize_t src_off, size_t len, voi
HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "can't get file handle")
/* Setup operation flags and arguments */
- op_flags = H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG | H5FD_CTL__FAIL_IF_UNKNOWN_FLAG;
+ op_flags = H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG | H5FD_CTL_FAIL_IF_UNKNOWN_FLAG;
op_args.dstbuf = udata->dstbuf;
op_args.dst_off = dst_off;
@@ -294,7 +294,7 @@ H5D__compact_iovv_memmanage_cb(hsize_t dst_off, hsize_t src_off, size_t len, voi
op_args.len = len;
/* Make request to file driver */
- if (H5FD_ctl(file_handle, H5FD_CTL__MEM_COPY, op_flags, &op_args, NULL) < 0)
+ if (H5FD_ctl(file_handle, H5FD_CTL_MEM_COPY, op_flags, &op_args, NULL) < 0)
HGOTO_ERROR(H5E_IO, H5E_FCNTL, FAIL, "VFD memcpy request failed")
done:
diff --git a/src/H5ESdevelop.h b/src/H5ESdevelop.h
index 2fb9aeb..5bbf74e 100644
--- a/src/H5ESdevelop.h
+++ b/src/H5ESdevelop.h
@@ -15,8 +15,8 @@
* support routines.
*/
-#ifndef _H5ESdevelop_H
-#define _H5ESdevelop_H
+#ifndef H5ESdevelop_H
+#define H5ESdevelop_H
/* Include package's public header */
#include "H5ESpublic.h"
@@ -49,4 +49,4 @@ H5_DLL herr_t H5ESget_requests(hid_t es_id, H5_iter_order_t order, hid_t *connec
}
#endif
-#endif /* _H5ESdevelop_H */
+#endif /* H5ESdevelop_H */
diff --git a/src/H5FD.c b/src/H5FD.c
index 6584843..162e27f 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -2180,7 +2180,7 @@ H5FD_ctl(H5FD_t *file, uint64_t op_code, uint64_t flags, const void *input, void
/* Dispatch to driver if the ctl function exists.
*
- * If it doesn't, fail if the H5FD_CTL__FAIL_IF_UNKNOWN_FLAG is set.
+ * If it doesn't, fail if the H5FD_CTL_FAIL_IF_UNKNOWN_FLAG is set.
*
* Otherwise, report success.
*/
@@ -2190,7 +2190,7 @@ H5FD_ctl(H5FD_t *file, uint64_t op_code, uint64_t flags, const void *input, void
HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL, "VFD ctl request failed")
}
- else if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG) {
+ else if (flags & H5FD_CTL_FAIL_IF_UNKNOWN_FLAG) {
HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL,
"VFD ctl request failed (no ctl callback and fail if unknown flag is set)")
diff --git a/src/H5FDdevelop.h b/src/H5FDdevelop.h
index f5b32ed..50eae1f 100644
--- a/src/H5FDdevelop.h
+++ b/src/H5FDdevelop.h
@@ -15,8 +15,8 @@
* support routines.
*/
-#ifndef _H5FDdevelop_H
-#define _H5FDdevelop_H
+#ifndef H5FDdevelop_H
+#define H5FDdevelop_H
/* Include package's public header */
#include "H5FDpublic.h"
@@ -292,4 +292,4 @@ H5_DLL herr_t H5FDctl(H5FD_t *file, uint64_t op_code, uint64_t flags, const voi
}
#endif
-#endif /* _H5FDdevelop_H */
+#endif /* H5FDdevelop_H */
diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c
index 7eb1463..45791e8 100644
--- a/src/H5FDmpi.c
+++ b/src/H5FDmpi.c
@@ -57,7 +57,7 @@ int
H5FD_mpi_get_rank(H5FD_t *file)
{
const H5FD_class_t *cls;
- uint64_t flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG | H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+ uint64_t flags = H5FD_CTL_FAIL_IF_UNKNOWN_FLAG | H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG;
int rank = -1;
void * rank_ptr = (void *)(&rank);
int ret_value;
@@ -70,7 +70,7 @@ H5FD_mpi_get_rank(H5FD_t *file)
HDassert(cls->ctl); /* All MPI drivers must implement this */
/* Dispatch to driver */
- if ((cls->ctl)(file, H5FD_CTL__GET_MPI_RANK_OPCODE, flags, NULL, &rank_ptr) < 0)
+ if ((cls->ctl)(file, H5FD_CTL_GET_MPI_RANK_OPCODE, flags, NULL, &rank_ptr) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_rank request failed")
HDassert(rank >= 0);
@@ -109,7 +109,7 @@ int
H5FD_mpi_get_size(H5FD_t *file)
{
const H5FD_class_t *cls;
- uint64_t flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG | H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+ uint64_t flags = H5FD_CTL_FAIL_IF_UNKNOWN_FLAG | H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG;
int size = 0;
void * size_ptr = (void *)(&size);
int ret_value;
@@ -122,7 +122,7 @@ H5FD_mpi_get_size(H5FD_t *file)
HDassert(cls->ctl); /* All MPI drivers must implement this */
/* Dispatch to driver */
- if ((cls->ctl)(file, H5FD_CTL__GET_MPI_SIZE_OPCODE, flags, NULL, &size_ptr) < 0)
+ if ((cls->ctl)(file, H5FD_CTL_GET_MPI_SIZE_OPCODE, flags, NULL, &size_ptr) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_size request failed")
if (0 >= size)
@@ -162,7 +162,7 @@ MPI_Comm
H5FD_mpi_get_comm(H5FD_t *file)
{
const H5FD_class_t *cls;
- uint64_t flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG | H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG;
+ uint64_t flags = H5FD_CTL_FAIL_IF_UNKNOWN_FLAG | H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG;
MPI_Comm comm = MPI_COMM_NULL;
void * comm_ptr = (void *)(&comm);
MPI_Comm ret_value;
@@ -175,7 +175,7 @@ H5FD_mpi_get_comm(H5FD_t *file)
HDassert(cls->ctl); /* All MPI drivers must implement this */
/* Dispatch to driver */
- if ((cls->ctl)(file, H5FD_CTL__GET_MPI_COMMUNICATOR_OPCODE, flags, NULL, &comm_ptr) < 0)
+ if ((cls->ctl)(file, H5FD_CTL_GET_MPI_COMMUNICATOR_OPCODE, flags, NULL, &comm_ptr) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, MPI_COMM_NULL, "driver get_comm request failed")
if (comm == MPI_COMM_NULL)
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 1be4779..ce32bc7 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -3017,9 +3017,9 @@ done:
*
* At present, the supported op codes are:
*
- * H5FD_CTL__GET_MPI_COMMUNICATOR_OPCODE
- * H5FD_CTL__GET_MPI_RANK_OPCODE
- * H5FD_CTL__GET_MPI_SIZE_OPCODE
+ * H5FD_CTL_GET_MPI_COMMUNICATOR_OPCODE
+ * H5FD_CTL_GET_MPI_RANK_OPCODE
+ * H5FD_CTL_GET_MPI_SIZE_OPCODE
*
* Note that these opcodes must be supported by all VFDs that
* support MPI.
@@ -3045,26 +3045,26 @@ H5FD__mpio_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void H5_AT
switch (op_code) {
- case H5FD_CTL__GET_MPI_COMMUNICATOR_OPCODE:
+ case H5FD_CTL_GET_MPI_COMMUNICATOR_OPCODE:
HDassert(output);
HDassert(*output);
**((MPI_Comm **)output) = file->comm;
break;
- case H5FD_CTL__GET_MPI_RANK_OPCODE:
+ case H5FD_CTL_GET_MPI_RANK_OPCODE:
HDassert(output);
HDassert(*output);
**((int **)output) = file->mpi_rank;
break;
- case H5FD_CTL__GET_MPI_SIZE_OPCODE:
+ case H5FD_CTL_GET_MPI_SIZE_OPCODE:
HDassert(output);
HDassert(*output);
**((int **)output) = file->mpi_size;
break;
default: /* unknown op code */
- if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG) {
+ if (flags & H5FD_CTL_FAIL_IF_UNKNOWN_FLAG) {
HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL, "unknown op_code and fail if unknown")
}
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 20c538f..0d5bedf 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -2268,7 +2268,7 @@ H5FD_multi_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *inpu
switch (op_code) {
/* Unknown op code */
default:
- if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG)
+ if (flags & H5FD_CTL_FAIL_IF_UNKNOWN_FLAG)
H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_FCNTL,
"VFD ctl request failed (unknown op code and fail if unknown flag is set)", -1);
diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h
index 221f569..5221e35 100644
--- a/src/H5FDpublic.h
+++ b/src/H5FDpublic.h
@@ -188,14 +188,14 @@
(H5FD_CTL_OPC_RESERVED + 511) /* Maximum opcode value available for experimental use */
/* ctl function op codes: */
-#define H5FD_CTL__INVALID_OPCODE 0
-#define H5FD_CTL__TEST_OPCODE 1
-#define H5FD_CTL__GET_MPI_COMMUNICATOR_OPCODE 2
-#define H5FD_CTL__GET_MPI_RANK_OPCODE 3
-#define H5FD_CTL__GET_MPI_SIZE_OPCODE 4
-#define H5FD_CTL__MEM_ALLOC 5
-#define H5FD_CTL__MEM_FREE 6
-#define H5FD_CTL__MEM_COPY 7
+#define H5FD_CTL_INVALID_OPCODE 0
+#define H5FD_CTL_TEST_OPCODE 1
+#define H5FD_CTL_GET_MPI_COMMUNICATOR_OPCODE 2
+#define H5FD_CTL_GET_MPI_RANK_OPCODE 3
+#define H5FD_CTL_GET_MPI_SIZE_OPCODE 4
+#define H5FD_CTL_MEM_ALLOC 5
+#define H5FD_CTL_MEM_FREE 6
+#define H5FD_CTL_MEM_COPY 7
/* ctl function flags: */
@@ -227,7 +227,7 @@
*/
/* Unknown op codes should be ignored silently unless the
- * H5FD_CTL__FAIL_IF_UNKNOWN_FLAG is set.
+ * H5FD_CTL_FAIL_IF_UNKNOWN_FLAG is set.
*
* On terminal VFDs, unknown op codes should generate an
* error unconditionally if this flag is set.
@@ -237,9 +237,9 @@
* flags. In the absence of such flags, the VFD should
* generate an error.
*/
-#define H5FD_CTL__FAIL_IF_UNKNOWN_FLAG 0x0001
+#define H5FD_CTL_FAIL_IF_UNKNOWN_FLAG 0x0001
-/* The H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG is used only
+/* The H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG is used only
* by non-ternminal VFDs, and only applies to unknown
* opcodes. (known op codes should be handled as
* appropriate.)
@@ -249,9 +249,9 @@
* the VFD stack en-route to the terminal VFD.
* If that VFD does not support the ctl call, the
* pass through VFD should fail or succeed as directed
- * by the H5FD_CTL__FAIL_IF_UNKNOWN_FLAG.
+ * by the H5FD_CTL_FAIL_IF_UNKNOWN_FLAG.
*/
-#define H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG 0x0002
+#define H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG 0x0002
/*******************/
/* Public Typedefs */
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index acc705e..1d97f83 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -1086,7 +1086,7 @@ H5FD__sec2_ctl(H5FD_t *_file, uint64_t H5_ATTR_UNUSED op_code, uint64_t flags,
HDassert(_file);
/* No op codes are understood. */
- if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG)
+ if (flags & H5FD_CTL_FAIL_IF_UNKNOWN_FLAG)
HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL, "unknown op_code and fail if unknown flag is set")
done:
diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c
index 3d7093a..48de4e6 100644
--- a/src/H5FDsplitter.c
+++ b/src/H5FDsplitter.c
@@ -1325,16 +1325,16 @@ H5FD__splitter_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void *
switch (op_code) {
/* Unknown op code */
default:
- if (flags & H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG) {
+ if (flags & H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG) {
/* Pass ctl call down to R/W channel VFD */
if (H5FDctl(file->rw_file, op_code, flags, input, output) < 0)
HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL, "VFD ctl request failed")
}
else {
/* If no valid VFD routing flag is specified, fail for unknown op code
- * if H5FD_CTL__FAIL_IF_UNKNOWN_FLAG flag is set.
+ * if H5FD_CTL_FAIL_IF_UNKNOWN_FLAG flag is set.
*/
- if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG)
+ if (flags & H5FD_CTL_FAIL_IF_UNKNOWN_FLAG)
HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL,
"VFD ctl request failed (unknown op code and fail if unknown flag is set)")
}
diff --git a/src/H5Idevelop.h b/src/H5Idevelop.h
index 3cd951e..13e3a83 100644
--- a/src/H5Idevelop.h
+++ b/src/H5Idevelop.h
@@ -15,8 +15,8 @@
* support routines.
*/
-#ifndef _H5Idevelop_H
-#define _H5Idevelop_H
+#ifndef H5Idevelop_H
+#define H5Idevelop_H
/* Include package's public header */
#include "H5Ipublic.h" /* ID management */
@@ -136,4 +136,4 @@ H5_DLL hid_t H5Iregister_future(H5I_type_t type, const void *object, H5I_future_
}
#endif
-#endif /* _H5Idevelop_H */
+#endif /* H5Idevelop_H */
diff --git a/src/H5Ldevelop.h b/src/H5Ldevelop.h
index 43ed7de..96b2ec3 100644
--- a/src/H5Ldevelop.h
+++ b/src/H5Ldevelop.h
@@ -15,8 +15,8 @@
* support routines.
*/
-#ifndef _H5Ldevelop_H
-#define _H5Ldevelop_H
+#ifndef H5Ldevelop_H
+#define H5Ldevelop_H
/* Include package's public header */
#include "H5Lpublic.h"
@@ -311,4 +311,4 @@ typedef struct {
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-#endif /* _H5Ldevelop_H */
+#endif /* H5Ldevelop_H */
diff --git a/src/H5Tdevelop.h b/src/H5Tdevelop.h
index e642d7c..2ae4178 100644
--- a/src/H5Tdevelop.h
+++ b/src/H5Tdevelop.h
@@ -15,8 +15,8 @@
* support routines.
*/
-#ifndef _H5Tdevelop_H
-#define _H5Tdevelop_H
+#ifndef H5Tdevelop_H
+#define H5Tdevelop_H
/* Include package's public header */
#include "H5Tpublic.h"
@@ -224,4 +224,4 @@ H5_DLL htri_t H5Tcompiler_conv(hid_t src_id, hid_t dst_id);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-#endif /* _H5Tdevelop_H */
+#endif /* H5Tdevelop_H */
diff --git a/src/H5Zdevelop.h b/src/H5Zdevelop.h
index 328e221..0f5e3e9 100644
--- a/src/H5Zdevelop.h
+++ b/src/H5Zdevelop.h
@@ -15,8 +15,8 @@
* support routines.
*/
-#ifndef _H5Zdevelop_H
-#define _H5Zdevelop_H
+#ifndef H5Zdevelop_H
+#define H5Zdevelop_H
/* Include package's public header */
#include "H5Zpublic.h"
@@ -418,4 +418,4 @@ typedef struct H5Z_class1_t {
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-#endif /* _H5Zdevelop_H */
+#endif /* H5Zdevelop_H */
diff --git a/src/H5public.h b/src/H5public.h
index 0be303b..26239d0 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -37,9 +37,10 @@
/* C library header files for things that appear in HDF5 public headers */
#ifdef __cplusplus
-#define __STDC_FORMAT_MACROS
-#endif
+#include <cinttypes>
+#else
#include <inttypes.h>
+#endif
#include <limits.h>
#include <stdarg.h>
#include <stdbool.h>