summaryrefslogtreecommitdiffstats
path: root/src/H5Tnative.c
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2022-04-01 20:41:26 (GMT)
committerGitHub <noreply@github.com>2022-04-01 20:41:26 (GMT)
commit572adbaacb126e530f6af94a90092e004c23a163 (patch)
tree1fc09f3d565a05a93800a5c4a9eefe582d03d8b0 /src/H5Tnative.c
parent210e0d91d158ea80e6d76d5656b2b467d0d1a9e6 (diff)
downloadhdf5-572adbaacb126e530f6af94a90092e004c23a163.zip
hdf5-572adbaacb126e530f6af94a90092e004c23a163.tar.gz
hdf5-572adbaacb126e530f6af94a90092e004c23a163.tar.bz2
Assume C99 fixed sized ints exist, use them (#470) (#1571)
* Committing clang-format changes * Assume C99 fixed sized ints exist, use them * Assume H5_SIZEOF_LONG_DOUBLE != 0, `long double` has existed since C89 Note, this is only assuming that `long double` exists, no assumptions about its size have been touched. Didn't remove any code that does things like test if `long double` and `double` have different sizes. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Sean McBride <sean@rogue-research.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5Tnative.c')
-rw-r--r--src/H5Tnative.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/H5Tnative.c b/src/H5Tnative.c
index 2688b23..c9a2907 100644
--- a/src/H5Tnative.c
+++ b/src/H5Tnative.c
@@ -718,9 +718,7 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali
enum match_type { /* The different kinds of floating point types we can match */
H5T_NATIVE_FLOAT_MATCH_FLOAT,
H5T_NATIVE_FLOAT_MATCH_DOUBLE,
-#if H5_SIZEOF_LONG_DOUBLE != 0
H5T_NATIVE_FLOAT_MATCH_LDOUBLE,
-#endif
H5T_NATIVE_FLOAT_MATCH_UNKNOWN
} match = H5T_NATIVE_FLOAT_MATCH_UNKNOWN;
H5T_t *ret_value = NULL; /* Return value */
@@ -738,24 +736,16 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali
match = H5T_NATIVE_FLOAT_MATCH_DOUBLE;
native_size = sizeof(double);
}
-#if H5_SIZEOF_LONG_DOUBLE != 0
else if (size <= sizeof(long double)) {
match = H5T_NATIVE_FLOAT_MATCH_LDOUBLE;
native_size = sizeof(long double);
}
-#endif
else { /* If not match, return the biggest datatype */
-#if H5_SIZEOF_LONG_DOUBLE != 0
match = H5T_NATIVE_FLOAT_MATCH_LDOUBLE;
native_size = sizeof(long double);
-#else
- match = H5T_NATIVE_FLOAT_MATCH_DOUBLE;
- native_size = sizeof(double);
-#endif
}
}
else {
-#if H5_SIZEOF_LONG_DOUBLE != 0
if (size > sizeof(double)) {
match = H5T_NATIVE_FLOAT_MATCH_LDOUBLE;
native_size = sizeof(long double);
@@ -768,16 +758,6 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali
match = H5T_NATIVE_FLOAT_MATCH_FLOAT;
native_size = sizeof(float);
}
-#else
- if (size > sizeof(float)) {
- match = H5T_NATIVE_FLOAT_MATCH_DOUBLE;
- native_size = sizeof(double);
- }
- else {
- match = H5T_NATIVE_FLOAT_MATCH_FLOAT;
- native_size = sizeof(float);
- }
-#endif
}
/* Set the appropriate native floating point information */
@@ -792,12 +772,11 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali
align = H5T_NATIVE_DOUBLE_COMP_ALIGN_g;
break;
-#if H5_SIZEOF_LONG_DOUBLE != 0
case H5T_NATIVE_FLOAT_MATCH_LDOUBLE:
tid = H5T_NATIVE_LDOUBLE;
align = H5T_NATIVE_LDOUBLE_COMP_ALIGN_g;
break;
-#endif
+
case H5T_NATIVE_FLOAT_MATCH_UNKNOWN:
default:
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "Unknown native floating-point match")