summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-03-26 01:47:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-03-26 01:47:41 (GMT)
commitb03d04742d4d169ed851b3cd154c42a1c075da1e (patch)
tree561f8f19426d948d11c3d7d33d04c19e8ee8b54e
parentc622cc7b38791567a6e41d147121a76a20837e96 (diff)
downloadhdf5-b03d04742d4d169ed851b3cd154c42a1c075da1e.zip
hdf5-b03d04742d4d169ed851b3cd154c42a1c075da1e.tar.gz
hdf5-b03d04742d4d169ed851b3cd154c42a1c075da1e.tar.bz2
[svn-r26596] Description:
Bring r26499 from autotools_rework branch to trunk: Remove ULLONG_TO_FP_CAST_WORKS macro/define, as it only applies to older platforms we aren't supporting any longer. Tested on: Linux/32 2.6.18 (jam) w/serial & parallel (Daily tested on branch for 2+ days)
-rw-r--r--config/cmake/ConfigureChecks.cmake9
-rw-r--r--config/cmake/H5pubconf.h.in4
-rwxr-xr-xconfigure27
-rw-r--r--configure.ac18
-rw-r--r--src/H5T.c2
-rw-r--r--src/H5Tconv.c4
-rw-r--r--src/H5Tpkg.h13
-rw-r--r--src/H5Ztrans.c21
-rw-r--r--src/H5config.h.in4
-rw-r--r--test/dt_arith.c30
-rw-r--r--test/dtransform.c10
11 files changed, 7 insertions, 135 deletions
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index 7978c27..2b68779 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -260,15 +260,6 @@ ENDMACRO (H5MiscConversionTest)
# ----------------------------------------------------------------------
# Set the flag to indicate that the machine can _compile_
-# 'unsigned long long' to 'float' and 'double' typecasts.
-# (This flag should be set for all machines.)
-#
-if (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$)
- set (H5_ULLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling unsigned long long to floating-point typecasts work")
- message (STATUS "Checking IF compiling unsigned long long to floating-point typecasts work... yes")
-endif (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$)
-# ----------------------------------------------------------------------
-# Set the flag to indicate that the machine can _compile_
# 'long long' to 'float' and 'double' typecasts.
# (This flag should be set for all machines.)
#
diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in
index 95fd856..ea5df09 100644
--- a/config/cmake/H5pubconf.h.in
+++ b/config/cmake/H5pubconf.h.in
@@ -649,10 +649,6 @@
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#cmakedefine H5_TM_IN_SYS_TIME @H5_TM_IN_SYS_TIME@
-/* Define if your system can compile unsigned long long to floating-point
- casts. */
-#cmakedefine H5_ULLONG_TO_FP_CAST_WORKS @H5_ULLONG_TO_FP_CAST_WORKS@
-
/* Define if your system can convert unsigned long long to long double with
correct precision. */
#cmakedefine H5_ULLONG_TO_LDOUBLE_PRECISION @H5_ULLONG_TO_LDOUBLE_PRECISION@
diff --git a/configure b/configure
index 090becc..ea0100d 100755
--- a/configure
+++ b/configure
@@ -28152,33 +28152,6 @@ esac
## ----------------------------------------------------------------------
## Set the flag to indicate that the machine can _compile_
-## 'unsigned long long' to 'float' and 'double' typecasts.
-## (This flag should be set for all machines, except for under Windows when
-## compiled with Visual Studio 6, where the macro value is set in the
-## src/H5pubconf.h file)
-##
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiling unsigned long long to floating-point typecasts work" >&5
-$as_echo_n "checking if compiling unsigned long long to floating-point typecasts work... " >&6; }
-if ${hdf5_cv_ullong_to_fp_cast_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- hdf5_cv_ullong_to_fp_cast_works=yes
-fi
-
-
-if test ${hdf5_cv_ullong_to_fp_cast_works} = "yes"; then
-
-$as_echo "#define ULLONG_TO_FP_CAST_WORKS 1" >>confdefs.h
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-## ----------------------------------------------------------------------
-## Set the flag to indicate that the machine can _compile_
## 'long long' to 'float' and 'double' typecasts.
## (This flag should be set for all machines, except for under Windows when
## compiled with Visual Studio 6, where the macro value is set in the
diff --git a/configure.ac b/configure.ac
index 69ce240..3c9842c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2576,24 +2576,6 @@ esac
## ----------------------------------------------------------------------
## Set the flag to indicate that the machine can _compile_
-## 'unsigned long long' to 'float' and 'double' typecasts.
-## (This flag should be set for all machines, except for under Windows when
-## compiled with Visual Studio 6, where the macro value is set in the
-## src/H5pubconf.h file)
-##
-AC_MSG_CHECKING([if compiling unsigned long long to floating-point typecasts work])
-AC_CACHE_VAL([hdf5_cv_ullong_to_fp_cast_works], [hdf5_cv_ullong_to_fp_cast_works=yes])
-
-if test ${hdf5_cv_ullong_to_fp_cast_works} = "yes"; then
- AC_DEFINE([ULLONG_TO_FP_CAST_WORKS], [1],
- [Define if your system can compile unsigned long long to floating-point casts.])
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-
-## ----------------------------------------------------------------------
-## Set the flag to indicate that the machine can _compile_
## 'long long' to 'float' and 'double' typecasts.
## (This flag should be set for all machines, except for under Windows when
## compiled with Visual Studio 6, where the macro value is set in the
diff --git a/src/H5T.c b/src/H5T.c
index 9af35f8..2f45840 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -1232,10 +1232,8 @@ H5T_init_interface(void)
#endif /* H5T_CONV_INTERNAL_LLONG_LDOUBLE */
/* From unsigned long long to floats */
-#if H5T_CONV_INTERNAL_ULLONG_FP
status |= H5T_register(H5T_PERS_HARD, "ullong_flt", native_ullong, native_float, H5T__conv_ullong_float, H5AC_dxpl_id, FALSE);
status |= H5T_register(H5T_PERS_HARD, "ullong_dbl", native_ullong, native_double, H5T__conv_ullong_double, H5AC_dxpl_id, FALSE);
-#endif /* H5T_CONV_INTERNAL_ULLONG_FP */
#ifdef H5T_CONV_INTERNAL_ULLONG_LDOUBLE
status |= H5T_register(H5T_PERS_HARD, "ullong_ldbl", native_ullong, native_ldouble, H5T__conv_ullong_ldouble, H5AC_dxpl_id, FALSE);
#endif /* H5T_CONV_INTERNAL_ULLONG_LDOUBLE */
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 29d2520..d142bde 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -7932,7 +7932,6 @@ H5T__conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*
*-------------------------------------------------------------------------
*/
-#if H5T_CONV_INTERNAL_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,
@@ -7941,7 +7940,6 @@ H5T__conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
{
H5T_CONV_xF(ULLONG, FLOAT, unsigned long long, float, -, -);
}
-#endif /*H5T_CONV_INTERNAL_ULLONG_FP*/
/*-------------------------------------------------------------------------
@@ -7959,7 +7957,6 @@ H5T__conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*
*-------------------------------------------------------------------------
*/
-#if H5T_CONV_INTERNAL_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,
@@ -7968,7 +7965,6 @@ H5T__conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
{
H5T_CONV_xF(ULLONG, DOUBLE, unsigned long long, double, -, -);
}
-#endif /*H5T_CONV_INTERNAL_ULLONG_FP*/
/*-------------------------------------------------------------------------
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index a4f8b8c..ffcfe0a 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -130,22 +130,13 @@
#define H5T_CONV_INTERNAL_LLONG_LDOUBLE 1
#endif
-/* Define an internal 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_WANT_DATA_ACCURACY && H5_ULLONG_TO_FP_CAST_WORKS)
-#define H5T_CONV_INTERNAL_ULLONG_FP 1
-#endif
-
/* Define an internal 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.
* Mac OS 10.4 gives some incorrect result. */
-#if (H5_WANT_DATA_ACCURACY && H5_ULLONG_TO_FP_CAST_WORKS && \
- defined(H5_ULLONG_TO_LDOUBLE_PRECISION) && defined(H5_LLONG_TO_LDOUBLE_CORRECT)) || (!H5_WANT_DATA_ACCURACY && \
- H5_ULLONG_TO_FP_CAST_WORKS)
+#if (H5_WANT_DATA_ACCURACY && \
+ defined(H5_ULLONG_TO_LDOUBLE_PRECISION) && defined(H5_LLONG_TO_LDOUBLE_CORRECT)) || (!H5_WANT_DATA_ACCURACY)
#define H5T_CONV_INTERNAL_ULLONG_LDOUBLE 1
#endif
diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c
index 1b8c096..7d46d70 100644
--- a/src/H5Ztrans.c
+++ b/src/H5Ztrans.c
@@ -160,23 +160,6 @@ static void H5Z_print(H5Z_node *tree, FILE *stream);
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unexpected type conversion operation") \
}
-/* Due to the undefined nature of embedding macros/conditionals within macros, we employ
- * this clever little hack. We always compile in the code for the type conversion, even if
- * it isn't supported in the compiler. To avoid errors, we define ULLONG_TO_FP_XFORM_TYPE_OP_ERROR on
- * unsupported compilers, which will cause the code to execute HGOTO_ERROR and skip the code
- * that does the actual conversion */
-
-
-#ifndef H5_ULLONG_TO_FP_CAST_WORKS
-#define H5Z_XFORM_ULL_DO_OP1(RESL,RESR,TYPE,OP,SIZE) \
-{ \
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Cannot convert from unsigned long long to double: required for data transform") \
-}
-#else
-#define H5Z_XFORM_ULL_DO_OP1(RESL,RESR,TYPE,OP,SIZE) \
- H5Z_XFORM_DO_OP1(RESL,RESR,TYPE,OP,SIZE)
-#endif
-
/* Windows Intel 8.1 compiler has error converting long long to double.
* Hard code it in.
*/
@@ -213,7 +196,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream);
else if((TYPE) == H5T_NATIVE_LLONG) \
H5Z_XFORM_LL_DO_OP1((RESL), (RESR), long long, OP, (SIZE)) \
else if((TYPE) == H5T_NATIVE_ULLONG) \
- H5Z_XFORM_ULL_DO_OP1((RESL), (RESR), unsigned long long, OP, (SIZE)) \
+ H5Z_XFORM_DO_OP1((RESL), (RESR), unsigned long long, OP, (SIZE)) \
else if((TYPE) == H5T_NATIVE_FLOAT) \
H5Z_XFORM_DO_OP1((RESL), (RESR), float, OP, (SIZE)) \
else if((TYPE) == H5T_NATIVE_DOUBLE) \
@@ -245,7 +228,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream);
else if((TYPE) == H5T_NATIVE_LLONG) \
H5Z_XFORM_LL_DO_OP1((RESL), (RESR), long long, OP, (SIZE)) \
else if((TYPE) == H5T_NATIVE_ULLONG) \
- H5Z_XFORM_ULL_DO_OP1((RESL), (RESR), unsigned long long, OP, (SIZE)) \
+ H5Z_XFORM_DO_OP1((RESL), (RESR), unsigned long long, OP, (SIZE)) \
else if((TYPE) == H5T_NATIVE_FLOAT) \
H5Z_XFORM_DO_OP1((RESL), (RESR), float, OP, (SIZE)) \
else if((TYPE) == H5T_NATIVE_DOUBLE) \
diff --git a/src/H5config.h.in b/src/H5config.h.in
index 81a214e..2ab7837 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -560,10 +560,6 @@
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
-/* Define if your system can compile unsigned long long to floating-point
- casts. */
-#undef ULLONG_TO_FP_CAST_WORKS
-
/* Define if your system can convert unsigned long long to long double with
correct precision. */
#undef ULLONG_TO_LDOUBLE_PRECISION
diff --git a/test/dt_arith.c b/test/dt_arith.c
index 4444fa7..b47b6e2 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -3877,12 +3877,10 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long));
hw_float = (float)(*((long long*)aligned));
break;
-#ifdef H5_ULLONG_TO_FP_CAST_WORKS
case INT_ULLONG:
HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long));
hw_float = (float)(*((unsigned long long*)aligned));
break;
-#endif /* H5_ULLONG_TO_FP_CAST_WORKS */
case FLT_FLOAT:
case FLT_DOUBLE:
case FLT_LDOUBLE:
@@ -3930,12 +3928,10 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long));
hw_double = (double)(*((long long*)aligned));
break;
-#ifdef H5_ULLONG_TO_FP_CAST_WORKS
case INT_ULLONG:
HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long));
hw_double = (double)(*((unsigned long long*)aligned));
break;
-#endif /* H5_ULLONG_TO_FP_CAST_WORKS */
case FLT_FLOAT:
case FLT_DOUBLE:
case FLT_LDOUBLE:
@@ -3984,12 +3980,10 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
HDmemcpy(aligned, saved+j*sizeof(long long), sizeof(long long));
hw_ldouble = (long double)(*((long long*)aligned));
break;
-#ifdef H5_ULLONG_TO_FP_CAST_WORKS
case INT_ULLONG:
HDmemcpy(aligned, saved+j*sizeof(unsigned long long), sizeof(unsigned long long));
hw_ldouble = (long double)(*((unsigned long long*)aligned));
break;
-#endif /* H5_ULLONG_TO_FP_CAST_WORKS */
case FLT_FLOAT:
case FLT_DOUBLE:
case FLT_LDOUBLE:
@@ -5120,26 +5114,8 @@ run_int_fp_conv(const char *name)
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LLONG, H5T_NATIVE_FLOAT);
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LLONG, H5T_NATIVE_DOUBLE);
-#ifdef H5_ULLONG_TO_FP_CAST_WORKS
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT);
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULLONG, H5T_NATIVE_DOUBLE);
-#else /* H5_ULLONG_TO_FP_CAST_WORKS */
- {
- char str[256]; /*hello string */
-
- HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions",
- name, "unsigned long long", "float");
- printf("%-70s", str);
- SKIPPED();
- HDputs(" Test skipped due to compiler not handling conversion.");
-
- HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions",
- name, "unsigned long long", "double");
- printf("%-70s", str);
- SKIPPED();
- HDputs(" Test skipped due to compiler not handling conversion.");
- }
-#endif /* H5_ULLONG_TO_FP_CAST_WORKS */
#endif
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE
@@ -5183,9 +5159,9 @@ run_int_fp_conv(const char *name)
HDputs(" Test skipped due to compiler error in handling conversion.");
}
#endif /* H5_LLONG_TO_LDOUBLE_CORRECT */
-#if H5_ULLONG_TO_FP_CAST_WORKS && H5_ULLONG_TO_LDOUBLE_PRECISION && H5_LLONG_TO_LDOUBLE_CORRECT
+#if H5_ULLONG_TO_LDOUBLE_PRECISION && H5_LLONG_TO_LDOUBLE_CORRECT
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULLONG, H5T_NATIVE_LDOUBLE);
-#else /* H5_ULLONG_TO_FP_CAST_WORKS && H5_ULLONG_TO_LDOUBLE_PRECISION && H5_LLONG_TO_LDOUBLE_CORRECT */
+#else /* H5_ULLONG_TO_LDOUBLE_PRECISION && H5_LLONG_TO_LDOUBLE_CORRECT */
{
char str[256]; /*hello string */
@@ -5195,7 +5171,7 @@ run_int_fp_conv(const char *name)
SKIPPED();
HDputs(" Test skipped due to compiler not handling conversion.");
}
-#endif /* H5_ULLONG_TO_FP_CAST_WORKS && H5_ULLONG_TO_LDOUBLE_PRECISION && H5_LLONG_TO_LDOUBLE_CORRECT */
+#endif /* H5_ULLONG_TO_LDOUBLE_PRECISION && H5_LLONG_TO_LDOUBLE_CORRECT */
#endif
#endif
diff --git a/test/dtransform.c b/test/dtransform.c
index d80c21a..520055d 100644
--- a/test/dtransform.c
+++ b/test/dtransform.c
@@ -305,12 +305,7 @@ int main(void)
SKIPPED()
#endif
-#ifdef H5_ULLONG_TO_FP_CAST_WORKS
TEST_TYPE_CONTIG(dxpl_id_utrans_inv, unsigned long long, H5T_NATIVE_ULLONG, "ullong", transformData, 0);
-#else
- TESTING("contiguous, with type conversion (float->ullong)")
- SKIPPED()
-#endif
TEST_TYPE_CONTIG(dxpl_id_c_to_f, float, H5T_NATIVE_FLOAT, "float", windchillFfloat, 1);
TEST_TYPE_CONTIG(dxpl_id_c_to_f, double, H5T_NATIVE_DOUBLE, "double", windchillFfloat, 1);
#if H5_SIZEOF_LONG_DOUBLE!=0
@@ -333,12 +328,7 @@ int main(void)
SKIPPED()
#endif
-#ifdef H5_ULLONG_TO_FP_CAST_WORKS
TEST_TYPE_CHUNK(dxpl_id_utrans_inv, unsigned long long, H5T_NATIVE_ULLONG, "ullong", transformData, 0);
-#else
- TESTING("chunked, with type conversion (float->ullong)")
- SKIPPED()
-#endif
TEST_TYPE_CHUNK(dxpl_id_c_to_f, float, H5T_NATIVE_FLOAT, "float", windchillFfloat, 1);
TEST_TYPE_CHUNK(dxpl_id_c_to_f, double, H5T_NATIVE_DOUBLE, "double", windchillFfloat, 1);
#if H5_SIZEOF_LONG_DOUBLE!=0