summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5T.c104
-rw-r--r--src/H5Tconv.c202
-rw-r--r--src/H5Tpkg.h96
-rw-r--r--src/H5config.h.in48
4 files changed, 303 insertions, 147 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 1894f33..7e4754e 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -1001,16 +1001,16 @@ H5T_init_interface(void)
*/
/* floating point */
-#if H5_CONVERT_DENORMAL_FLOAT
+#if FP_FP
status |= H5T_register(H5T_PERS_HARD, "flt_dbl", native_float, native_double, H5T_conv_float_double, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_flt", native_double, native_float, H5T_conv_double_float, H5AC_dxpl_id);
-#if H5_SIZEOF_LONG_DOUBLE !=0
+#endif /*FP_FP*/
+#if FP_LDOUBLE
status |= H5T_register(H5T_PERS_HARD, "flt_ldbl", native_float, native_ldouble, H5T_conv_float_ldouble, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_ldbl", native_double, native_ldouble, H5T_conv_double_ldouble, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "ldbl_flt", native_ldouble, native_float, H5T_conv_ldouble_float, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "ldbl_dbl", native_ldouble, native_double, H5T_conv_ldouble_double, H5AC_dxpl_id);
-#endif
-#endif /*H5_CONVERT_DENORMAL_FLOAT*/
+#endif /*FP_LDOUBLE*/
/* from long_long */
status |= H5T_register(H5T_PERS_HARD, "llong_ullong", native_llong, native_ullong, H5T_conv_llong_ullong, H5AC_dxpl_id);
@@ -1115,149 +1115,149 @@ H5T_init_interface(void)
/* From char to floats */
status |= H5T_register(H5T_PERS_HARD, "schar_flt", native_schar, native_float, H5T_conv_schar_float, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "schar_dbl", native_schar, native_double, H5T_conv_schar_double, H5AC_dxpl_id);
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
status |= H5T_register(H5T_PERS_HARD, "schar_ldbl", native_schar, native_ldouble, H5T_conv_schar_ldouble, H5AC_dxpl_id);
-#endif /* H5_SW_INTEGER_TO_LDOUBLE_WORKS */
+#endif /* INTEGER_LDOUBLE */
/* From unsigned char to floats */
status |= H5T_register(H5T_PERS_HARD, "uchar_flt", native_uchar, native_float, H5T_conv_uchar_float, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "uchar_dbl", native_uchar, native_double, H5T_conv_uchar_double, H5AC_dxpl_id);
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
status |= H5T_register(H5T_PERS_HARD, "uchar_ldbl", native_uchar, native_ldouble, H5T_conv_uchar_ldouble, H5AC_dxpl_id);
-#endif /*H5_SW_INTEGER_TO_LDOUBLE_WORKS*/
+#endif /* INTEGER_LDOUBLE */
/* From short to floats */
status |= H5T_register(H5T_PERS_HARD, "short_flt", native_short, native_float, H5T_conv_short_float, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "short_dbl", native_short, native_double, H5T_conv_short_double, H5AC_dxpl_id);
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
status |= H5T_register(H5T_PERS_HARD, "short_ldbl", native_short, native_ldouble, H5T_conv_short_ldouble, H5AC_dxpl_id);
-#endif /*H5_SW_INTEGER_TO_LDOUBLE_WORKS*/
+#endif /* INTEGER_LDOUBLE */
/* From unsigned short to floats */
status |= H5T_register(H5T_PERS_HARD, "ushort_flt", native_ushort, native_float, H5T_conv_ushort_float, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "ushort_dbl", native_ushort, native_double, H5T_conv_ushort_double, H5AC_dxpl_id);
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
status |= H5T_register(H5T_PERS_HARD, "ushort_ldbl", native_ushort, native_ldouble, H5T_conv_ushort_ldouble, H5AC_dxpl_id);
-#endif /*H5_SW_INTEGER_TO_LDOUBLE_WORKS*/
+#endif /* INTEGER_LDOUBLE */
/* From int to floats */
status |= H5T_register(H5T_PERS_HARD, "int_flt", native_int, native_float, H5T_conv_int_float, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "int_dbl", native_int, native_double, H5T_conv_int_double, H5AC_dxpl_id);
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
status |= H5T_register(H5T_PERS_HARD, "int_ldbl", native_int, native_ldouble, H5T_conv_int_ldouble, H5AC_dxpl_id);
-#endif /*H5_SW_INTEGER_TO_LDOUBLE_WORKS*/
+#endif /* INTEGER_LDOUBLE */
/* From unsigned int to floats */
status |= H5T_register(H5T_PERS_HARD, "uint_flt", native_uint, native_float, H5T_conv_uint_float, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "uint_dbl", native_uint, native_double, H5T_conv_uint_double, H5AC_dxpl_id);
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
status |= H5T_register(H5T_PERS_HARD, "uint_ldbl", native_uint, native_ldouble, H5T_conv_uint_ldouble, H5AC_dxpl_id);
-#endif /*H5_SW_INTEGER_TO_LDOUBLE_WORKS*/
+#endif /* INTEGER_LDOUBLE */
/* From long to floats */
status |= H5T_register(H5T_PERS_HARD, "long_flt", native_long, native_float, H5T_conv_long_float, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "long_dbl", native_long, native_double, H5T_conv_long_double, H5AC_dxpl_id);
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
status |= H5T_register(H5T_PERS_HARD, "long_ldbl", native_long, native_ldouble, H5T_conv_long_ldouble, H5AC_dxpl_id);
-#endif /*H5_SW_INTEGER_TO_LDOUBLE_WORKS*/
+#endif /* INTEGER_LDOUBLE */
/* From unsigned long to floats */
-#if H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS
+#if ULONG_FP
status |= H5T_register(H5T_PERS_HARD, "ulong_flt", native_ulong, native_float, H5T_conv_ulong_float, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "ulong_dbl", native_ulong, native_double, H5T_conv_ulong_double, H5AC_dxpl_id);
-#endif /* H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS */
-#if H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS && H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#endif /* ULONG_FP */
+#if ULONG_LDOUBLE
status |= H5T_register(H5T_PERS_HARD, "ulong_ldbl", native_ulong, native_ldouble, H5T_conv_ulong_ldouble, H5AC_dxpl_id);
-#endif /* H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS && H5_SW_INTEGER_TO_LDOUBLE_WORKS */
+#endif /* ULONG_LDOUBLE */
/* From long long to floats */
status |= H5T_register(H5T_PERS_HARD, "llong_flt", native_llong, native_float, H5T_conv_llong_float, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "llong_dbl", native_llong, native_double, H5T_conv_llong_double, H5AC_dxpl_id);
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
status |= H5T_register(H5T_PERS_HARD, "llong_ldbl", native_llong, native_ldouble, H5T_conv_llong_ldouble, H5AC_dxpl_id);
-#endif /* H5_SW_INTEGER_TO_LDOUBLE_WORKS */
+#endif /* INTEGER_LDOUBLE */
/* From unsigned long long to floats */
-#if H5_ULLONG_TO_FP_CAST_WORKS && H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS
+#if ULLONG_FP
status |= H5T_register(H5T_PERS_HARD, "ullong_flt", native_ullong, native_float, H5T_conv_ullong_float, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "ullong_dbl", native_ullong, native_double, H5T_conv_ullong_double, H5AC_dxpl_id);
-#if H5_ULLONG_TO_LDOUBLE_PRECISION_WORKS
+#endif /* ULLONG_FP */
+#if ULLONG_LDOUBLE
status |= H5T_register(H5T_PERS_HARD, "ullong_ldbl", native_ullong, native_ldouble, H5T_conv_ullong_ldouble, H5AC_dxpl_id);
-#endif /* H5_ULLONG_TO_LDOUBLE_PRECISION_WORKS */
-#endif /* H5_ULLONG_TO_FP_CAST_WORKS && H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS */
+#endif /* ULLONG_LDOUBLE */
/* From floats to char */
status |= H5T_register(H5T_PERS_HARD, "flt_schar", native_float, native_schar, H5T_conv_float_schar, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_schar", native_double, native_schar, H5T_conv_double_schar, H5AC_dxpl_id);
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_INTEGER
status |= H5T_register(H5T_PERS_HARD, "ldbl_schar", native_ldouble, native_schar, H5T_conv_ldouble_schar, H5AC_dxpl_id);
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /* LDOUBLE_INTEGER */
/* From floats to unsigned char */
status |= H5T_register(H5T_PERS_HARD, "flt_uchar", native_float, native_uchar, H5T_conv_float_uchar, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_uchar", native_double, native_uchar, H5T_conv_double_uchar, H5AC_dxpl_id);
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_INTEGER
status |= H5T_register(H5T_PERS_HARD, "ldbl_uchar", native_ldouble, native_uchar, H5T_conv_ldouble_uchar, H5AC_dxpl_id);
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /* LDOUBLE_INTEGER */
/* From floats to short */
status |= H5T_register(H5T_PERS_HARD, "flt_short", native_float, native_short, H5T_conv_float_short, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_short", native_double, native_short, H5T_conv_double_short, H5AC_dxpl_id);
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_INTEGER
status |= H5T_register(H5T_PERS_HARD, "ldbl_short", native_ldouble, native_short, H5T_conv_ldouble_short, H5AC_dxpl_id);
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /* LDOUBLE_INTEGER */
/* From floats to unsigned short */
status |= H5T_register(H5T_PERS_HARD, "flt_ushort", native_float, native_ushort, H5T_conv_float_ushort, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_ushort", native_double, native_ushort, H5T_conv_double_ushort, H5AC_dxpl_id);
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_INTEGER
status |= H5T_register(H5T_PERS_HARD, "ldbl_ushort", native_ldouble, native_ushort, H5T_conv_ldouble_ushort, H5AC_dxpl_id);
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /* LDOUBLE_INTEGER */
/* From floats to int */
status |= H5T_register(H5T_PERS_HARD, "flt_int", native_float, native_int, H5T_conv_float_int, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_int", native_double, native_int, H5T_conv_double_int, H5AC_dxpl_id);
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_INTEGER
status |= H5T_register(H5T_PERS_HARD, "ldbl_int", native_ldouble, native_int, H5T_conv_ldouble_int, H5AC_dxpl_id);
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /* LDOUBLE_INTEGER */
/* From floats to unsigned int */
status |= H5T_register(H5T_PERS_HARD, "flt_uint", native_float, native_uint, H5T_conv_float_uint, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_uint", native_double, native_uint, H5T_conv_double_uint, H5AC_dxpl_id);
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS && H5_CV_LDOUBLE_TO_UINT_WORKS
+#if LDOUBLE_UINT
status |= H5T_register(H5T_PERS_HARD, "ldbl_uint", native_ldouble, native_uint, H5T_conv_ldouble_uint, H5AC_dxpl_id);
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS && H5_CV_LDOUBLE_TO_UINT_WORKS */
+#endif /* LDOUBLE_UINT */
status |= H5T_register(H5T_PERS_HARD, "flt_long", native_float, native_long, H5T_conv_float_long, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_long", native_double, native_long, H5T_conv_double_long, H5AC_dxpl_id);
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_INTEGER
status |= H5T_register(H5T_PERS_HARD, "ldbl_long", native_ldouble, native_long, H5T_conv_ldouble_long, H5AC_dxpl_id);
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /* LDOUBLE_INTEGER */
/* From floats to unsigned long */
status |= H5T_register(H5T_PERS_HARD, "flt_ulong", native_float, native_ulong, H5T_conv_float_ulong, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_ulong", native_double, native_ulong, H5T_conv_double_ulong, H5AC_dxpl_id);
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_INTEGER
status |= H5T_register(H5T_PERS_HARD, "ldbl_ulong", native_ldouble, native_ulong, H5T_conv_ldouble_ulong, H5AC_dxpl_id);
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /* LDOUBLE_INTEGER */
/* From floats to long long */
-#ifndef H5_HW_FP_TO_LLONG_NOT_WORKS
+#if FP_LLONG
status |= H5T_register(H5T_PERS_HARD, "flt_llong", native_float, native_llong, H5T_conv_float_llong, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_llong", native_double, native_llong, H5T_conv_double_llong, H5AC_dxpl_id);
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#endif /* FP_LLONG */
+#if LDOUBLE_LLONG
status |= H5T_register(H5T_PERS_HARD, "ldbl_llong", native_ldouble, native_llong, H5T_conv_ldouble_llong, H5AC_dxpl_id);
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
-#endif /* !H5_HW_FP_TO_LLONG_NOT_WORKS */
+#endif /* LDOUBLE_LLONG */
/* From floats to unsigned long long */
-#if H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS && H5_FP_TO_ULLONG_RIGHT_MAXIMUM
+#if FP_ULLONG
status |= H5T_register(H5T_PERS_HARD, "flt_ullong", native_float, native_ullong, H5T_conv_float_ullong, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_ullong", native_double, native_ullong, H5T_conv_double_ullong, H5AC_dxpl_id);
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#endif /* FP_ULLONG */
+#if LDOUBLE_ULLONG
status |= H5T_register(H5T_PERS_HARD, "ldbl_ullong", native_ldouble, native_ullong, H5T_conv_ldouble_ullong, H5AC_dxpl_id);
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
-#endif /* H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS && H5_FP_TO_ULLONG_RIGHT_MAXIMUM */
+#endif /* LDOUBLE_ULLONG */
/*
* The special no-op conversion is the fastest, so we list it last. The
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index cb1c38a..9da5842 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -190,6 +190,7 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
* equal. In this case, do not return exception but make sure the maximum is assigned
* to the destination. SLU - 2005/06/29
*/
+#ifdef H5_WANT_DCONV_EXCEPTION
#define H5T_CONV_Xx_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
if (*((ST*)S) > (DT)(D_MAX)) { \
if(cb_struct.func) { \
@@ -226,7 +227,13 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
} else \
*((DT*)D) = (DT)(*((ST*)S)); \
}
+#else
+#define H5T_CONV_Xx_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ *((DT*)D) = (DT)(*((ST*)S)); \
+}
+#endif
+#ifdef H5_WANT_DCONV_EXCEPTION
#define H5T_CONV_Ux_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
if (*((ST*)S) > (DT)(D_MAX)) { \
if(cb_struct.func) { \
@@ -246,12 +253,18 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
} else \
*((DT*)D) = (DT)(*((ST*)S)); \
}
+#else
+#define H5T_CONV_Ux_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ *((DT*)D) = (DT)(*((ST*)S)); \
+}
+#endif
#define H5T_CONV_sS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
assert(sizeof(ST)<=sizeof(DT)); \
H5T_CONV(H5T_CONV_xX, long_long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
}
+#ifdef H5_WANT_DCONV_EXCEPTION
#define H5T_CONV_sU_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
if (*((ST*)S) < 0) { \
if(cb_struct.func) { \
@@ -271,23 +284,29 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
} else \
*((DT*)D) = (DT)(*((ST*)S)); \
}
+#else
+#define H5T_CONV_sU_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ *((DT*)D) = (DT)(*((ST*)S)); \
+}
+#endif
#define H5T_CONV_sU(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
assert(sizeof(ST)<=sizeof(DT)); \
H5T_CONV(H5T_CONV_sU, long_long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
}
+#ifdef H5_WANT_DCONV_EXCEPTION
#define H5T_CONV_uS_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
if (sizeof(ST)==sizeof(DT) && *((ST*)S) > (D_MAX)) { \
if(cb_struct.func) { \
- H5T_conv_ret_t except_ret; /*callback return*/ \
- \
- except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
- src_id, dst_id, S, D, cb_struct.user_data); \
- if(except_ret == H5T_CONV_UNHANDLED) \
- /* Let compiler convert if case is ignored by user handler*/ \
+ H5T_conv_ret_t except_ret; /*callback return*/ \
+ \
+ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, \
+ src_id, dst_id, S, D, cb_struct.user_data); \
+ if(except_ret == H5T_CONV_UNHANDLED) \
+ /* Let compiler convert if case is ignored by user handler*/ \
*((DT*)D) = (D_MAX); \
- else if(except_ret == H5T_CONV_ABORT) \
+ else if(except_ret == H5T_CONV_ABORT) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") \
/* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \
} \
@@ -296,6 +315,11 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
} else \
*((DT*)D) = (DT)(*((ST*)S)); \
}
+#else
+#define H5T_CONV_uS_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ *((DT*)D) = (DT)(*((ST*)S)); \
+}
+#endif
#define H5T_CONV_uS(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
assert(sizeof(ST)<=sizeof(DT)); \
@@ -312,6 +336,7 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
H5T_CONV(H5T_CONV_Xx, long_long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
}
+#ifdef H5_WANT_DCONV_EXCEPTION
#define H5T_CONV_Su_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
if (*((ST*)S) < 0) { \
if(cb_struct.func) { \
@@ -346,6 +371,11 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
} else \
*((DT*)D) = (DT)(*((ST*)S)); \
}
+#else
+#define H5T_CONV_Su_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ *((DT*)D) = (DT)(*((ST*)S)); \
+}
+#endif
#define H5T_CONV_Su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
assert(sizeof(ST)>=sizeof(DT)); \
@@ -362,6 +392,7 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
H5T_CONV(H5T_CONV_Ux, long_long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
}
+#ifdef H5_WANT_DCONV_EXCEPTION
#define H5T_CONV_su_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
/* Assumes memory format of unsigned & signed integers is same */ \
if (*((ST*)S) < 0) { \
@@ -379,14 +410,21 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
} \
else \
*((DT*)D) = 0; \
- } \
+ } else \
+ *((DT*)D) = (DT)(*((ST*)S)); \
}
+#else
+#define H5T_CONV_su_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ *((DT*)D) = (DT)(*((ST*)S)); \
+}
+#endif
#define H5T_CONV_su(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
assert(sizeof(ST)==sizeof(DT)); \
H5T_CONV(H5T_CONV_su, long_long, STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \
}
+#ifdef H5_WANT_DCONV_EXCEPTION
#define H5T_CONV_us_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
/* Assumes memory format of unsigned & signed integers is same */ \
if (*((ST*)S) > (DT)(D_MAX)) { \
@@ -404,8 +442,14 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
} \
else \
*((DT*)D) = (D_MAX); \
- } \
+ } else \
+ *((DT*)D) = (DT)(*((ST*)S)); \
+}
+#else
+#define H5T_CONV_us_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ *((DT*)D) = (DT)(*((ST*)S)); \
}
+#endif
#define H5T_CONV_us(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
assert(sizeof(ST)==sizeof(DT)); \
@@ -420,6 +464,7 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
/* Same as H5T_CONV_Xx_CORE, except that instead of using D_MAX and D_MIN
* when an overflow occurs, use the 'float' infinity values.
*/
+#ifdef H5_WANT_DCONV_EXCEPTION
#define H5T_CONV_Ff_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
if (*((ST*)S) > (DT)(D_MAX)) { \
if(cb_struct.func) { \
@@ -454,6 +499,11 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
} else \
*((DT*)D) = (DT)(*((ST*)S)); \
}
+#else
+#define H5T_CONV_Ff_CORE(S,D,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
+ *((DT*)D) = (DT)(*((ST*)S)); \
+}
+#endif
#define H5T_CONV_Ff(STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \
assert(sizeof(ST)>=sizeof(DT)); \
@@ -7057,7 +7107,7 @@ done:
* destination values are packed.
*-------------------------------------------------------------------------
*/
-#if H5_CONVERT_DENORMAL_FLOAT
+#if FP_FP
herr_t
H5T_conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -7073,7 +7123,7 @@ H5T_conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_CONVERT_DENORMAL_FLOAT */
+#endif /* FP_FP */
/*-------------------------------------------------------------------------
@@ -7091,7 +7141,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_CONVERT_DENORMAL_FLOAT && H5_SIZEOF_LONG_DOUBLE !=0
+#if FP_LDOUBLE
herr_t
H5T_conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -7107,7 +7157,7 @@ H5T_conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_CONVERT_DENORMAL_FLOAT && H5_SIZEOF_LONG_DOUBLE !=0 */
+#endif /*FP_LDOUBLE*/
/*-------------------------------------------------------------------------
@@ -7132,7 +7182,7 @@ done:
* destination values are packed.
*-------------------------------------------------------------------------
*/
-#if H5_CONVERT_DENORMAL_FLOAT
+#if FP_FP
herr_t
H5T_conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -7148,7 +7198,7 @@ H5T_conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /*H5_CONVERT_DENORMAL_FLOAT*/
+#endif /*FP_FP*/
/*-------------------------------------------------------------------------
@@ -7166,7 +7216,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_CONVERT_DENORMAL_FLOAT && H5_SIZEOF_LONG_DOUBLE !=0
+#if FP_LDOUBLE
herr_t
H5T_conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -7183,7 +7233,7 @@ H5T_conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_CONVERT_DENORMAL_FLOAT && H5_SIZEOF_LONG_DOUBLE !=0 */
+#endif /*FP_LDOUBLE*/
/*-------------------------------------------------------------------------
@@ -7201,7 +7251,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_CONVERT_DENORMAL_FLOAT && H5_SIZEOF_LONG_DOUBLE !=0
+#if FP_LDOUBLE
herr_t
H5T_conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -7217,7 +7267,7 @@ H5T_conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_CONVERT_DENORMAL_FLOAT && H5_SIZEOF_LONG_DOUBLE !=0 */
+#endif /* FP_LDOUBLE */
/*-------------------------------------------------------------------------
@@ -7235,7 +7285,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_CONVERT_DENORMAL_FLOAT && H5_SIZEOF_LONG_DOUBLE !=0
+#if FP_LDOUBLE
herr_t
H5T_conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -7251,7 +7301,7 @@ H5T_conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_CONVERT_DENORMAL_FLOAT && H5_SIZEOF_LONG_DOUBLE !=0 */
+#endif /*FP_LDOUBLE*/
/*-------------------------------------------------------------------------
@@ -7333,7 +7383,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
herr_t
H5T_conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -7349,7 +7399,7 @@ H5T_conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_INTEGER_TO_LDOUBLE_WORKS */
+#endif /* INTEGER_LDOUBLE */
/*-------------------------------------------------------------------------
@@ -7431,7 +7481,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
herr_t
H5T_conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -7447,7 +7497,7 @@ H5T_conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_INTEGER_TO_LDOUBLE_WORKS */
+#endif /* INTEGER_LDOUBLE */
/*-------------------------------------------------------------------------
@@ -7529,7 +7579,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
herr_t
H5T_conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -7545,7 +7595,7 @@ H5T_conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_INTEGER_TO_LDOUBLE_WORKS */
+#endif /* INTEGER_LDOUBLE */
/*-------------------------------------------------------------------------
@@ -7627,7 +7677,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
herr_t
H5T_conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -7643,7 +7693,7 @@ H5T_conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_INTEGER_TO_LDOUBLE_WORKS */
+#endif /* INTEGER_LDOUBLE */
/*-------------------------------------------------------------------------
@@ -7725,7 +7775,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
herr_t
H5T_conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -7741,7 +7791,7 @@ H5T_conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_INTEGER_TO_LDOUBLE_WORKS */
+#endif /* INTEGER_LDOUBLE */
/*-------------------------------------------------------------------------
@@ -7823,7 +7873,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
herr_t
H5T_conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -7839,7 +7889,7 @@ H5T_conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_INTEGER_TO_LDOUBLE_WORKS */
+#endif /* INTEGER_LDOUBLE */
/*-------------------------------------------------------------------------
@@ -7921,7 +7971,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
herr_t
H5T_conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -7937,7 +7987,7 @@ H5T_conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_INTEGER_TO_LDOUBLE_WORKS */
+#endif /* INTEGER_LDOUBLE */
/*-------------------------------------------------------------------------
@@ -7955,7 +8005,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS
+#if ULONG_FP
herr_t
H5T_conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -7971,7 +8021,7 @@ H5T_conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS */
+#endif /* ULONG_FP */
/*-------------------------------------------------------------------------
@@ -7989,7 +8039,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS
+#if ULONG_FP
herr_t
H5T_conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -8005,7 +8055,7 @@ H5T_conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS */
+#endif /* ULONG_FP */
/*-------------------------------------------------------------------------
@@ -8023,7 +8073,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS && H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if ULONG_LDOUBLE
herr_t
H5T_conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -8039,7 +8089,7 @@ H5T_conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS && H5_SW_INTEGER_TO_LDOUBLE_WORKS */
+#endif /* ULONG_LDOUBLE */
/*-------------------------------------------------------------------------
@@ -8121,7 +8171,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
+#if INTEGER_LDOUBLE
herr_t
H5T_conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -8137,9 +8187,8 @@ H5T_conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_INTEGER_TO_LDOUBLE_WORKS */
+#endif /* INTEGER_LDOUBLE */
-#if H5_ULLONG_TO_FP_CAST_WORKS && H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS
/*-------------------------------------------------------------------------
* Function: H5T_conv_ullong_float
@@ -8156,6 +8205,7 @@ done:
*
*-------------------------------------------------------------------------
*/
+#if ULLONG_FP
herr_t
H5T_conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -8171,6 +8221,7 @@ H5T_conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
+#endif /*ULLONG_FP*/
/*-------------------------------------------------------------------------
@@ -8188,6 +8239,7 @@ done:
*
*-------------------------------------------------------------------------
*/
+#if ULLONG_FP
herr_t
H5T_conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -8203,6 +8255,7 @@ H5T_conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
+#endif /*ULLONG_FP*/
/*-------------------------------------------------------------------------
@@ -8220,7 +8273,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_ULLONG_TO_LDOUBLE_PRECISION_WORKS
+#if ULLONG_LDOUBLE
herr_t
H5T_conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -8236,8 +8289,7 @@ H5T_conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_ULLONG_TO_LDOUBLE_PRECISION_WORKS */
-#endif /* H5_ULLONG_TO_FP_CAST_WORKS && H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS */
+#endif /*ULLONG_LDOUBLE*/
/*-------------------------------------------------------------------------
@@ -8383,7 +8435,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_INTEGER
herr_t
H5T_conv_ldouble_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -8399,7 +8451,7 @@ H5T_conv_ldouble_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /* LDOUBLE_INTEGER */
/*-------------------------------------------------------------------------
@@ -8417,7 +8469,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_INTEGER
herr_t
H5T_conv_ldouble_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -8433,7 +8485,7 @@ H5T_conv_ldouble_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /* LDOUBLE_INTEGER */
/*-------------------------------------------------------------------------
@@ -8579,7 +8631,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_INTEGER
herr_t
H5T_conv_ldouble_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -8595,7 +8647,7 @@ H5T_conv_ldouble_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /* LDOUBLE_INTEGER */
/*-------------------------------------------------------------------------
@@ -8613,7 +8665,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_INTEGER
herr_t
H5T_conv_ldouble_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -8629,7 +8681,7 @@ H5T_conv_ldouble_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /* LDOUBLE_INTEGER */
/*-------------------------------------------------------------------------
@@ -8775,7 +8827,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_INTEGER
herr_t
H5T_conv_ldouble_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -8791,7 +8843,7 @@ H5T_conv_ldouble_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /* LDOUBLE_INTEGER */
/*-------------------------------------------------------------------------
@@ -8809,7 +8861,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS && H5_CV_LDOUBLE_TO_UINT_WORKS
+#if LDOUBLE_UINT
herr_t
H5T_conv_ldouble_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -8825,7 +8877,7 @@ H5T_conv_ldouble_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS && H5_CV_LDOUBLE_TO_UINT_WORKS */
+#endif /* LDOUBLE_UINT */
/*-------------------------------------------------------------------------
@@ -8971,7 +9023,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_INTEGER
herr_t
H5T_conv_ldouble_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -8987,7 +9039,7 @@ H5T_conv_ldouble_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /*H5_SW_LDOUBLE_TO_INTEGER_WORKS*/
+#endif /*LDOUBLE_INTEGER*/
/*-------------------------------------------------------------------------
@@ -9005,7 +9057,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_INTEGER
herr_t
H5T_conv_ldouble_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -9021,7 +9073,7 @@ H5T_conv_ldouble_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /* LDOUBLE_INTEGER */
/*-------------------------------------------------------------------------
@@ -9039,7 +9091,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#ifndef H5_HW_FP_TO_LLONG_NOT_WORKS
+#if FP_LLONG
herr_t
H5T_conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -9055,7 +9107,7 @@ H5T_conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* !H5_HW_FP_TO_LLONG_NOT_WORKS */
+#endif /* FP_LLONG */
/*-------------------------------------------------------------------------
@@ -9073,7 +9125,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS && H5_FP_TO_ULLONG_RIGHT_MAXIMUM
+#if FP_ULLONG
herr_t
H5T_conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -9089,7 +9141,7 @@ H5T_conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS && H5_FP_TO_ULLONG_RIGHT_MAXIMUM */
+#endif /*FP_ULLONG*/
/*-------------------------------------------------------------------------
@@ -9107,7 +9159,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#ifndef H5_HW_FP_TO_LLONG_NOT_WORKS
+#if FP_LLONG
herr_t
H5T_conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -9123,7 +9175,7 @@ H5T_conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* !H5_HW_FP_TO_LLONG_NOT_WORKS */
+#endif /*FP_LLONG*/
/*-------------------------------------------------------------------------
@@ -9141,7 +9193,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS && H5_FP_TO_ULLONG_RIGHT_MAXIMUM
+#if FP_ULLONG
herr_t
H5T_conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -9157,7 +9209,7 @@ H5T_conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS && H5_FP_TO_ULLONG_RIGHT_MAXIMUM */
+#endif /*FP_ULLONG*/
/*-------------------------------------------------------------------------
@@ -9175,7 +9227,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if !H5_HW_FP_TO_LLONG_NOT_WORKS && H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_LLONG
herr_t
H5T_conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -9191,7 +9243,7 @@ H5T_conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* !H5_HW_FP_TO_LLONG_NOT_WORKS && H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /*LDOUBLE_LLONG*/
/*-------------------------------------------------------------------------
@@ -9209,7 +9261,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-#if H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS && H5_FP_TO_ULLONG_RIGHT_MAXIMUM && H5_SW_LDOUBLE_TO_INTEGER_WORKS
+#if LDOUBLE_ULLONG
herr_t
H5T_conv_ldouble_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
@@ -9225,7 +9277,7 @@ H5T_conv_ldouble_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#endif /* H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS && H5_FP_TO_ULLONG_RIGHT_MAXIMUM && H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /*LDOUBLE_ULLONG*/
/*-------------------------------------------------------------------------
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index 6854bc2..1f406e8 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -64,6 +64,102 @@
/* Macro to ease detecting atomic datatypes */
#define H5T_IS_ATOMIC(dt) (!(H5T_IS_COMPLEX((dt)->type) || (dt)->type==H5T_OPAQUE))
+
+/* Define an interim macro for converting between floating number(float and double) and floating number.
+ * All Cray compilers don't support denormalized floating values generating exception(?). */
+#if H5_CONVERT_DENORMAL_FLOAT
+#define FP_FP 1
+#endif /*H5_CONVERT_DENORMAL_FLOAT*/
+
+/* Define an interim macro for converting between floating number(float and double) and long double.
+ * All Cray compilers don't support denormalized floating values generating exception(?). NEC doesn't
+ * support long double. */
+#if H5_SIZEOF_LONG_DOUBLE && H5_CONVERT_DENORMAL_FLOAT
+#define FP_LDOUBLE 1
+#endif /*H5_SIZEOF_LONG_DOUBLE && H5_CONVERT_DENORMAL_FLOAT*/
+
+/* Define an interim macro for converting all integers to long double. SGI compilers give some
+ * incorrect conversions. */
+#if (H5_WANT_DATA_ACCURACY && H5_INTEGER_TO_LDOUBLE_ACCURATE) || (!H5_WANT_DATA_ACCURACY)
+#define INTEGER_LDOUBLE 1
+#endif
+
+/* Define an interim macro for converting unsigned (long) long to floating numbers.
+ * 64-bit Solaris does different rounding. */
+#if (H5_WANT_DATA_ACCURACY && H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE) || (!H5_WANT_DATA_ACCURACY)
+#define ULONG_FP 1
+#endif
+
+/* Define an interim macro for converting unsigned long to long double. SGI compilers give some
+ * incorrect conversions. 64-bit Solaris does different rounding. */
+#if (H5_WANT_DATA_ACCURACY && H5_INTEGER_TO_LDOUBLE_ACCURATE && H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE) || \
+ (!H5_WANT_DATA_ACCURACY)
+#define ULONG_LDOUBLE 1
+#endif
+
+/* Define an interim macro for converting unsigned long long to floating numbers. SGI compilers give
+ * some incorect conversion. 64-bit Solaris does different rounding. Windows Visual Studio 6 does
+ * not support unsigned long long. */
+#if (H5_WANT_DATA_ACCURACY && H5_ULLONG_TO_FP_CAST_WORKS && H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE) || \
+ (!H5_WANT_DATA_ACCURACY && H5_ULLONG_TO_FP_CAST_WORKS)
+#define ULLONG_FP 1
+#endif
+
+/* Define an interim macro for converting unsigned long long to long double. SGI compilers give
+ * some incorect conversion. 64-bit Solaris does different rounding. Windows Visual Studio 6 does
+ * not support unsigned long long. For FreeBSD(sleipnir), the last 2 bytes of mantissa are lost when
+ * compiler tries to do the conversion. For Cygwin, compiler doesn't do rounding correctly. */
+#if (H5_WANT_DATA_ACCURACY && H5_ULLONG_TO_FP_CAST_WORKS && H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE && \
+ H5_ULLONG_TO_LDOUBLE_PRECISION) || (!H5_WANT_DATA_ACCURACY && H5_ULLONG_TO_FP_CAST_WORKS)
+#define ULLONG_LDOUBLE 1
+#endif
+
+/* Define an interim macro for converting long double to all integers. SGI compilers give some incorrect
+ * conversions. HP-UX 11.00 compiler generates floating exception. */
+#if (H5_WANT_DATA_ACCURACY && H5_LDOUBLE_TO_INTEGER_ACCURATE && H5_LDOUBLE_TO_INTEGER_WORKS) || \
+ (!H5_WANT_DATA_ACCURACY && H5_LDOUBLE_TO_INTEGER_WORKS)
+#define LDOUBLE_INTEGER 1
+#endif
+
+/* Define an interim macro for converting long double to unsigned int. SGI compilers give some incorrect
+ * conversions. HP-UX 11.00 compiler generates floating exception. Some Intel compilers on some Linux
+ * give incorrect values. */
+#if (H5_WANT_DATA_ACCURACY && H5_LDOUBLE_TO_INTEGER_ACCURATE && H5_LDOUBLE_TO_UINT_ACCURATE && \
+ H5_LDOUBLE_TO_INTEGER_WORKS) || (!H5_WANT_DATA_ACCURACY && H5_LDOUBLE_TO_INTEGER_WORKS)
+#define LDOUBLE_UINT 1
+#endif
+
+/* Define an interim macro for converting floating numbers to long long. The hard conversion on Windows
+ * .NET 2003 has a bug and gives wrong exception value. */
+#if (H5_WANT_DATA_ACCURACY && !H5_HW_FP_TO_LLONG_NOT_WORKS) || (!H5_WANT_DATA_ACCURACY)
+#define FP_LLONG 1
+#endif
+
+/* Define an interim macro for converting long double to long long. SGI compilers give some incorrect
+ * conversions. HP-UX 11.00 compiler generates floating exception. The hard conversion on Windows
+ * .NET 2003 has a bug and gives wrong exception value. */
+#if (H5_WANT_DATA_ACCURACY && !H5_HW_FP_TO_LLONG_NOT_WORKS && H5_LDOUBLE_TO_INTEGER_ACCURATE && \
+ H5_LDOUBLE_TO_INTEGER_WORKS) || \
+ (!H5_WANT_DATA_ACCURACY && !H5_HW_FP_TO_LLONG_NOT_WORKS && H5_LDOUBLE_TO_INTEGER_WORKS)
+#define LDOUBLE_LLONG 1
+#endif
+
+/* Define an interim macro for converting floating numbers to unsigned long long. PGI compiler does
+ * roundup when the source fraction part is greater than 0.5. HP-UX compilers set the maximal number
+ * for unsigned long long as 0x7fffffffffffffff during conversion. */
+#if (H5_WANT_DATA_ACCURACY && H5_FP_TO_ULLONG_ACCURATE && H5_FP_TO_ULLONG_RIGHT_MAXIMUM) || \
+ (!H5_WANT_DATA_ACCURACY)
+#define FP_ULLONG 1
+#endif
+
+/* Define an interim macro for converting long double to all integers. SGI compilers give some incorrect
+ * conversions. HP-UX 11.00 compiler generates floating exception. */
+#if (H5_WANT_DATA_ACCURACY && H5_LDOUBLE_TO_INTEGER_ACCURATE && H5_LDOUBLE_TO_INTEGER_WORKS && \
+ H5_FP_TO_ULLONG_ACCURATE && H5_FP_TO_ULLONG_RIGHT_MAXIMUM) || \
+ (!H5_WANT_DATA_ACCURACY && H5_LDOUBLE_TO_INTEGER_WORKS)
+#define LDOUBLE_ULLONG 1
+#endif
+
/* Statistics about a conversion function */
struct H5T_stats_t {
unsigned ncalls; /*num calls to conversion function */
diff --git a/src/H5config.h.in b/src/H5config.h.in
index 0fb003c..e20fdbe 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -4,10 +4,6 @@
values. */
#undef CONVERT_DENORMAL_FLOAT
-/* Define if your system can convert long double to unsigned int values
- correctly. */
-#undef CV_LDOUBLE_TO_UINT_WORKS
-
/* Define if `dev_t' is a scalar */
#undef DEV_T_IS_SCALAR
@@ -29,9 +25,9 @@
integer values. */
#undef FP_TO_INTEGER_OVERFLOW_WORKS
-/* Define if your system roundup accurately convert floating-point to unsigned
- long long values. */
-#undef FP_TO_ULLONG_BOTTOM_BIT_WORKS
+/* Define if your system roundup accurately converting floating-point to
+ unsigned long long values. */
+#undef FP_TO_ULLONG_ACCURATE
/* Define if your system has right maximum convert floating-point to unsigned
long long values. */
@@ -361,6 +357,20 @@
/* Define if `__tm_gmtoff' is a member of `struct tm' */
#undef HAVE___TM_GMTOFF
+/* Define if your system can accurately convert from integers to long double
+ values. */
+#undef INTEGER_TO_LDOUBLE_ACCURATE
+
+/* Define if your system can convert long double to integers accurately. */
+#undef LDOUBLE_TO_INTEGER_ACCURATE
+
+/* Define if your system can convert from long double to integer values. */
+#undef LDOUBLE_TO_INTEGER_WORKS
+
+/* Define if your system can convert long double to unsigned int values
+ correctly. */
+#undef LDOUBLE_TO_UINT_ACCURATE
+
/* Define if your system can compile long long to floating-point casts. */
#undef LLONG_TO_FP_CAST_WORKS
@@ -507,18 +517,6 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* Define if your system can accurately convert from integers to long double
- values. */
-#undef SW_INTEGER_TO_LDOUBLE_WORKS
-
-/* Define if your system can accurately convert from long double to integer
- values. */
-#undef SW_LDOUBLE_TO_INTEGER_WORKS
-
-/* Define if your system can accurately convert unsigned (long) long values to
- floating-point values. */
-#undef SW_ULONG_TO_FP_BOTTOM_BIT_WORKS
-
/* Define if your system supports pthread_attr_setscope(&attribute,
PTHREAD_SCOPE_SYSTEM) call. */
#undef SYSTEM_SCOPE_THREADS
@@ -535,7 +533,11 @@
/* Define if your system can convert unsigned long long to long double with
correct precision. */
-#undef ULLONG_TO_LDOUBLE_PRECISION_WORKS
+#undef ULLONG_TO_LDOUBLE_PRECISION
+
+/* Define if your system can accurately convert unsigned (long) long values to
+ floating-point values. */
+#undef ULONG_TO_FP_BOTTOM_BIT_ACCURATE
/* Version number of package */
#undef VERSION
@@ -544,6 +546,12 @@
don't fit into size allowed */
#undef VSNPRINTF_WORKS
+/* Data accuracy is prefered to speed during data conversions */
+#undef WANT_DATA_ACCURACY
+
+/* Check exception handling functions during data conversions */
+#undef WANT_DCONV_EXCEPTION
+
/* Define if the HDF5 v1.6 compatibility functions are to be compiled in */
#undef WANT_H5_V1_6_COMPAT