diff options
author | Sean McBride <sean@rogue-research.com> | 2022-06-22 16:16:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-22 16:16:30 (GMT) |
commit | 8b2e7b32b5b9987938ebf6936205f324bc5050b8 (patch) | |
tree | 17062db1b0521cbe22e759c5083b216ae6c62437 /test/vfd.c | |
parent | 55f4cc0caa69d65c505e926fb7b2568ab1a76c58 (diff) | |
download | hdf5-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 'test/vfd.c')
-rw-r--r-- | test/vfd.c | 48 |
1 files changed, 24 insertions, 24 deletions
@@ -3581,12 +3581,12 @@ H5FD__ctl_test_vfd_ctl(H5FD_t H5_ATTR_UNUSED *_file, uint64_t op_code, uint64_t switch (op_code) { /* Op code for testing purposes */ - case H5FD_CTL__TEST_OPCODE: + case H5FD_CTL_TEST_OPCODE: break; /* Unknown op code */ default: - if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG) + if (flags & H5FD_CTL_FAIL_IF_UNKNOWN_FLAG) ret_value = FAIL; break; } @@ -3660,8 +3660,8 @@ run_ctl_test(uint64_t op_code, uint64_t flags, ctl_test_opc_type opc_type, hid_t char filename[1024]; /* Check for a few ctl function flags */ - fail_if_unknown = (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG); - routing_flag_set = (flags & H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG); + fail_if_unknown = (flags & H5FD_CTL_FAIL_IF_UNKNOWN_FLAG); + routing_flag_set = (flags & H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG); /* Determine if the top-level VFD is a passthrough VFD */ if ((driver_id = H5Pget_driver(fapl_id)) < 0) @@ -3761,7 +3761,7 @@ test_ctl(void) TESTING_2("known op code to terminal VFD (without fail on unknown flag)"); - op_code = H5FD_CTL__TEST_OPCODE; + op_code = H5FD_CTL_TEST_OPCODE; flags = 0; /* H5FDctl call should succeed normally */ @@ -3772,8 +3772,8 @@ test_ctl(void) TESTING_2("known op code to terminal VFD (with fail on unknown flag)"); - op_code = H5FD_CTL__TEST_OPCODE; - flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG; + op_code = H5FD_CTL_TEST_OPCODE; + flags = H5FD_CTL_FAIL_IF_UNKNOWN_FLAG; /* H5FDctl call should succeed normally */ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0) @@ -3783,8 +3783,8 @@ test_ctl(void) TESTING_2("known op code to terminal VFD (without fail on unknown flag/route to terminal VFD)"); - op_code = H5FD_CTL__TEST_OPCODE; - flags = H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG; + op_code = H5FD_CTL_TEST_OPCODE; + flags = H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG; /* H5FDctl call should succeed normally */ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0) @@ -3794,8 +3794,8 @@ test_ctl(void) TESTING_2("known op code to terminal VFD (with fail on unknown flag/route to terminal VFD)"); - op_code = H5FD_CTL__TEST_OPCODE; - flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG | H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG; + op_code = H5FD_CTL_TEST_OPCODE; + flags = H5FD_CTL_FAIL_IF_UNKNOWN_FLAG | H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG; /* H5FDctl call should succeed normally */ if (run_ctl_test(op_code, flags, CTL_OPC_KNOWN_TERMINAL, fapl_id) < 0) @@ -3817,7 +3817,7 @@ test_ctl(void) TESTING_2("unknown op code to terminal VFD (with fail on unknown flag)"); op_code = H5FD_CTL_OPC_RESERVED; - flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG; + flags = H5FD_CTL_FAIL_IF_UNKNOWN_FLAG; /* H5FDctl call should fail due to 'fail if unknown' flag being specified */ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0) @@ -3828,7 +3828,7 @@ test_ctl(void) TESTING_2("unknown op code to terminal VFD (without fail on unknown flag/route to terminal VFD)"); op_code = H5FD_CTL_OPC_RESERVED; - flags = H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG; + flags = H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG; /* H5FDctl call should silently ignore unknown op code and succeed */ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0) @@ -3839,7 +3839,7 @@ test_ctl(void) TESTING_2("unknown op code to terminal VFD (with fail on unknown flag/route to terminal VFD)"); op_code = H5FD_CTL_OPC_RESERVED; - flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG | H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG; + flags = H5FD_CTL_FAIL_IF_UNKNOWN_FLAG | H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG; /* H5FDctl call should fail due to 'fail if unknown' flag being specified */ if (run_ctl_test(op_code, flags, CTL_OPC_UNKNOWN, fapl_id) < 0) @@ -3870,7 +3870,7 @@ test_ctl(void) TESTING_2("known op code through passthrough VFD to terminal VFD (without fail on unknown flag/no " "routing flag)"); - op_code = H5FD_CTL__TEST_OPCODE; + op_code = H5FD_CTL_TEST_OPCODE; flags = 0; /* @@ -3886,8 +3886,8 @@ test_ctl(void) TESTING_2( "known op code through passthrough VFD to terminal VFD (with fail on unknown flag/no routing flag)"); - op_code = H5FD_CTL__TEST_OPCODE; - flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG; + op_code = H5FD_CTL_TEST_OPCODE; + flags = H5FD_CTL_FAIL_IF_UNKNOWN_FLAG; /* * H5FDctl call should fail since op code is unknown to @@ -3903,8 +3903,8 @@ test_ctl(void) TESTING_2("known op code through passthrough VFD to terminal VFD (without fail on unknown flag/route to " "terminal VFD)"); - op_code = H5FD_CTL__TEST_OPCODE; - flags = H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG; + op_code = H5FD_CTL_TEST_OPCODE; + flags = H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG; /* * H5Dctl call should succeed since the passthrough VFD @@ -3919,8 +3919,8 @@ test_ctl(void) TESTING_2("known op code through passthrough VFD to terminal VFD (with fail on unknown flag/route to " "terminal VFD)"); - op_code = H5FD_CTL__TEST_OPCODE; - flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG | H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG; + op_code = H5FD_CTL_TEST_OPCODE; + flags = H5FD_CTL_FAIL_IF_UNKNOWN_FLAG | H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG; /* * H5Dctl call should succeed since the passthrough VFD @@ -3950,7 +3950,7 @@ test_ctl(void) TESTING_2("unknown op code to passthrough VFD (with fail on unknown flag)"); op_code = H5FD_CTL_OPC_RESERVED; - flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG; + flags = H5FD_CTL_FAIL_IF_UNKNOWN_FLAG; /* * H5FDctl call should fail since op code is unknown to @@ -3965,7 +3965,7 @@ test_ctl(void) TESTING_2("unknown op code to passthrough VFD (without fail on unknown flag/route to terminal VFD)"); op_code = H5FD_CTL_OPC_RESERVED; - flags = H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG; + flags = H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG; /* * H5Dctl call should succeed since the passthrough VFD @@ -3983,7 +3983,7 @@ test_ctl(void) TESTING_2("unknown op code to passthrough VFD (with fail on unknown flag/route to terminal VFD)"); op_code = H5FD_CTL_OPC_RESERVED; - flags = H5FD_CTL__FAIL_IF_UNKNOWN_FLAG | H5FD_CTL__ROUTE_TO_TERMINAL_VFD_FLAG; + flags = H5FD_CTL_FAIL_IF_UNKNOWN_FLAG | H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG; /* * H5Dctl call should fail since the passthrough VFD |