summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2021-03-10 18:41:34 (GMT)
committerGitHub <noreply@github.com>2021-03-10 18:41:34 (GMT)
commita7a013782f0af93f511142b5d167c2bc8ca8505d (patch)
tree5c13dc35b15c30315bcae04aa6971d73acabd9fc /src
parent7501f96ab9605e11c58bc0c9e6412e4db30ba7db (diff)
downloadhdf5-a7a013782f0af93f511142b5d167c2bc8ca8505d.zip
hdf5-a7a013782f0af93f511142b5d167c2bc8ca8505d.tar.gz
hdf5-a7a013782f0af93f511142b5d167c2bc8ca8505d.tar.bz2
Various clang tidy warning fixes (#448)
* Fixed clang-tidy bugprone-reserved-identifier warnings * Fixed clang-tidy bugprone-assert-side-effect warnings * Fixed clang-tidy bugprone-copy-constructor-init warning * Fixed clang-tidy readability-redundant-preprocessor warning For error_test.c the removed code was already dead, because it was in the else of an `#if H5_USE_16_API` block. Based on H5Location.h, I think p_get_ref_obj_type was meant to be in `#ifndef DOXYGEN_SHOULD_SKIP_THIS` and an `#endif` was missing. Similarly, in the header, getObjTypeByIdx is only in H5_NO_DEPRECATED_SYMBOLS, not DOXYGEN_SHOULD_SKIP_THIS. * Fixed clang-tidy readability-redundant-string-init warnings * Fixed some clang-tidy performance-type-promotion-in-math-fn warnings * Fixed clang-tidy performance-unnecessary-value-param warnings * Reformat source with clang v10.0.1. Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
Diffstat (limited to 'src')
-rw-r--r--src/H5Tconv.c4
-rw-r--r--src/H5Zscaleoffset.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 60ad627..8cc6ede 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -8477,7 +8477,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz
/* Allocate enough space for the buffer holding temporary
* converted value
*/
- buf_size = (size_t)(HDpow((double)2.0f, (double)src.u.f.esize) / 8 + 1);
+ buf_size = (size_t)(HDpow(2.0, (double)src.u.f.esize) / 8 + 1);
int_buf = (uint8_t *)H5MM_calloc(buf_size);
/* Get conversion exception callback property */
@@ -9315,7 +9315,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz
}
/* Check if the exponent is too big */
- expo_max = (hsize_t)(HDpow((double)2.0f, (double)dst.u.f.esize) - 1);
+ expo_max = (hsize_t)(HDpow(2.0, (double)dst.u.f.esize) - 1);
if (expo > expo_max) { /*overflows*/
if (cb_struct.func) { /*user's exception handler. Reverse back source order*/
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index 3a08a07..5310f7d 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -364,12 +364,12 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
#define H5Z_scaleoffset_max_min_3(i, d_nelmts, buf, filval, max, min, D_val) \
{ \
i = 0; \
- while (i < d_nelmts && HDfabs(buf[i] - filval) < HDpow(10.0f, -D_val)) \
+ while (i < d_nelmts && HDfabs(buf[i] - filval) < HDpow(10.0, -D_val)) \
i++; \
if (i < d_nelmts) \
min = max = buf[i]; \
for (; i < d_nelmts; i++) { \
- if (HDfabs(buf[i] - filval) < HDpow(10.0f, -D_val)) \
+ if (HDfabs(buf[i] - filval) < HDpow(10.0, -D_val)) \
continue; /* ignore fill value */ \
if (buf[i] > max) \
max = buf[i]; \