From a550ccd1d2832842d89df32e7c30aac5fc8bfde3 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 31 Dec 2003 15:36:44 -0500 Subject: [svn-r8010] Purpose: Bug fix Description: Add special-case handling to floating-point conversion tests to avoid problems with denormalized values on Cray T3E & T90 platforms. (Still not working on Cray SV1, but at least it's closer). Solution: Detect denormalized values and don't try to operate on them on the Crays. Platforms tested: FreeBSD 4.9 (sleipnir) Cray T3E (hubble.cray.com) Cray T90 (gypsy.cray.com) --- config/sv1-cray | 4 + config/unicos10.0.X | 4 + config/unicosmk2.0.6.X | 4 + configure | 26 ++- configure.in | 19 ++- src/H5config.h.in | 10 ++ src/H5private.h | 11 ++ test/dtypes.c | 441 ++++++++++++++++++++++++++----------------------- 8 files changed, 314 insertions(+), 205 deletions(-) diff --git a/config/sv1-cray b/config/sv1-cray index e7b7724..3eb53ef 100644 --- a/config/sv1-cray +++ b/config/sv1-cray @@ -136,3 +136,7 @@ esac # long'. For instance, if the format would be `%lld' then set it to # `ll' or if the format would be `%qd' set it to `q'. #hdf5_cv_printf_ll=${hdf5_cv_printf_ll='ll'} + +# Hard set the flag to indicate that converting denormalized floating-point +# values doesn't work. +hdf5_cv_convert_denormal_float=${hdf5_cv_convert_denormal_float='no'} diff --git a/config/unicos10.0.X b/config/unicos10.0.X index 43c1bd9..2a7a944 100644 --- a/config/unicos10.0.X +++ b/config/unicos10.0.X @@ -136,3 +136,7 @@ ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'} # long'. For instance, if the format would be `%lld' then set it to # `ll' or if the format would be `%qd' set it to `q'. #hdf5_cv_printf_ll=${hdf5_cv_printf_ll='ll'} + +# Hard set the flag to indicate that converting denormalized floating-point +# values doesn't work. +hdf5_cv_convert_denormal_float=${hdf5_cv_convert_denormal_float='no'} diff --git a/config/unicosmk2.0.6.X b/config/unicosmk2.0.6.X index 66f7c4c..171c95b 100644 --- a/config/unicosmk2.0.6.X +++ b/config/unicosmk2.0.6.X @@ -136,3 +136,7 @@ esac # long'. For instance, if the format would be `%lld' then set it to # `ll' or if the format would be `%qd' set it to `q'. #hdf5_cv_printf_ll=${hdf5_cv_printf_ll='ll'} + +# Hard set the flag to indicate that converting denormalized floating-point +# values doesn't work. +hdf5_cv_convert_denormal_float=${hdf5_cv_convert_denormal_float='no'} diff --git a/configure b/configure index 256abe2..e393e66 100755 --- a/configure +++ b/configure @@ -29455,7 +29455,9 @@ rm -f conftest.$ac_objext conftest.$ac_ext -for ac_func in fork gethostname getpwuid getrusage + + +for ac_func in fork frexpf frexpl gethostname getpwuid getrusage do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -31791,6 +31793,28 @@ _ACEOF fi +echo "$as_me:$LINENO: checking if converting denormalized floating-point values is possible" >&5 +echo $ECHO_N "checking if converting denormalized floating-point values is possible... $ECHO_C" >&6 +if test "${hdf5_cv_convert_denormal_float+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + hdf5_cv_convert_denormal_float=yes +fi + + +if test ${hdf5_cv_convert_denormal_float} = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define CONVERT_DENORMAL_FLOAT 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + H5_VERSION="`cut -d' ' -f3 $srcdir/README.txt | head -1`" diff --git a/configure.in b/configure.in index a51c187..2eb1832 100644 --- a/configure.in +++ b/configure.in @@ -1517,7 +1517,7 @@ AC_MSG_RESULT(no)) dnl ---------------------------------------------------------------------- dnl Check for functions. dnl -AC_CHECK_FUNCS(fork gethostname getpwuid getrusage) +AC_CHECK_FUNCS(fork frexpf frexpl gethostname getpwuid getrusage) AC_CHECK_FUNCS(BSDgettimeofday longjmp setsysinfo sigaction) AC_CHECK_FUNCS(signal snprintf vsnprintf strdup system waitpid) @@ -2130,6 +2130,23 @@ if test 1 = 2; then fi dnl ---------------------------------------------------------------------- +dnl Set the flag to indicate that the machine can handle converting +dnl denormalized floating-point values. +dnl (This flag should be set for all machines, except for the Crays, where +dnl the cache value is set in it's config file) +dnl +AC_MSG_CHECKING([if converting denormalized floating-point values is possible]) +AC_CACHE_VAL([hdf5_cv_convert_denormal_float], [hdf5_cv_convert_denormal_float=yes]) + +if test ${hdf5_cv_convert_denormal_float} = "yes"; then + AC_DEFINE([CONVERT_DENORMAL_FLOAT], [1], + [Define if your system can handle converting denormalized floating-point values.]) + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +dnl ---------------------------------------------------------------------- dnl Set some variables for general configuration information to be saved dnl and installed with the libraries. dnl diff --git a/src/H5config.h.in b/src/H5config.h.in index 366ba89..6a0c8dd 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -1,5 +1,9 @@ /* src/H5config.h.in. Generated from configure.in by autoheader. */ +/* Define if your system can handle converting denormalized floating-point + values. */ +#undef CONVERT_DENORMAL_FLOAT + /* Define if `dev_t' is a scalar */ #undef DEV_T_IS_SCALAR @@ -36,6 +40,12 @@ /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK +/* Define to 1 if you have the `frexpf' function. */ +#undef HAVE_FREXPF + +/* Define to 1 if you have the `frexpl' function. */ +#undef HAVE_FREXPL + /* Define to 1 if you have the `fseek64' function. */ #undef HAVE_FSEEK64 diff --git a/src/H5private.h b/src/H5private.h index b074765..1d3e0db 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -600,6 +600,17 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDfree(M) free(M) #define HDfreopen(S,M,F) freopen(S,M,F) #define HDfrexp(X,N) frexp(X,N) +/* Check for Cray-specific 'frexpf()' and 'frexpl()' routines */ +#ifdef H5_HAVE_FREXPF +#define HDfrexpf(X,N) frexpf(X,N) +#else /* H5_HAVE_FREXPF */ +#define HDfrexpf(X,N) frexp(X,N) +#endif /* H5_HAVE_FREXPF */ +#ifdef H5_HAVE_FREXPL +#define HDfrexpl(X,N) frexpl(X,N) +#else /* H5_HAVE_FREXPL */ +#define HDfrexpl(X,N) frexp(X,N) +#endif /* H5_HAVE_FREXPL */ /* fscanf() variable arguments */ #define HDfseek(F,O,W) fseek(F,O,W) #define HDfsetpos(F,P) fsetpos(F,P) diff --git a/test/dtypes.c b/test/dtypes.c index ba35424..25f21f5 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -19,6 +19,7 @@ * Purpose: Tests the data type interface (H5T) */ +#include #include #include "h5test.h" @@ -621,7 +622,7 @@ test_compound_2(void) s_ptr->d = i*8+6; s_ptr->e = i*8+7; } - memcpy(buf, orig, nelmts*sizeof(struct st)); + HDmemcpy(buf, orig, nelmts*sizeof(struct st)); /* Build hdf5 datatypes */ array_dt=H5Tarray_create(H5T_NATIVE_INT,1, &four, NULL); @@ -738,7 +739,7 @@ test_compound_3(void) s_ptr->d = i*8+6; s_ptr->e = i*8+7; } - memcpy(buf, orig, nelmts*sizeof(struct st)); + HDmemcpy(buf, orig, nelmts*sizeof(struct st)); /* Build hdf5 datatypes */ array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL); @@ -856,7 +857,7 @@ test_compound_4(void) s_ptr->d = (i*8+6) & 0x7fff; s_ptr->e = i*8+7; } - memcpy(buf, orig, nelmts*sizeof(struct st)); + HDmemcpy(buf, orig, nelmts*sizeof(struct st)); /* Build hdf5 datatypes */ array_dt=H5Tarray_create(H5T_NATIVE_INT, 1, &four, NULL); @@ -1000,7 +1001,7 @@ test_compound_5(void) H5Tinsert(dst_type, "coll_ids", HOFFSET(dst_type_t, coll_ids), int_array ); /* Convert data */ - memcpy(buf, src, sizeof(src)); + HDmemcpy(buf, src, sizeof(src)); H5Tconvert(src_type, dst_type, (hsize_t)2, buf, bkg, H5P_DEFAULT); dst = (dst_type_t*)buf; @@ -1014,7 +1015,7 @@ test_compound_5(void) /* Check results */ - if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || + if (HDmemcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || src[1].tdim!=dst[1].tdim || src[1].coll_ids[0]!=dst[1].coll_ids[0] || src[1].coll_ids[1]!=dst[1].coll_ids[1] || @@ -1079,7 +1080,7 @@ test_compound_6(void) s_ptr->b = (i*8+1) & 0x7fff; s_ptr->d = (i*8+6) & 0x7fff; } - memcpy(buf, orig, nelmts*sizeof(struct st)); + HDmemcpy(buf, orig, nelmts*sizeof(struct st)); /* Build hdf5 datatypes */ if ((st=H5Tcreate(H5T_COMPOUND, sizeof(struct st)))<0 || @@ -2004,15 +2005,15 @@ test_conv_str_1(void) src_type = mkstr(10, H5T_STR_NULLTERM); dst_type = mkstr(5, H5T_STR_NULLTERM); buf = calloc(2, 10); - memcpy(buf, "abcdefghi\0abcdefghi\0", 20); + HDmemcpy(buf, "abcdefghi\0abcdefghi\0", 20); if (H5Tconvert(src_type, dst_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcd\0abcd\0abcdefghi\0", 20)) { + if (HDmemcmp(buf, "abcd\0abcd\0abcdefghi\0", 20)) { H5_FAILED(); puts(" Truncated C-string test failed"); goto error; } if (H5Tconvert(dst_type, src_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcd\0\0\0\0\0\0abcd\0\0\0\0\0\0", 20)) { + if (HDmemcmp(buf, "abcd\0\0\0\0\0\0abcd\0\0\0\0\0\0", 20)) { H5_FAILED(); puts(" Extended C-string test failed"); goto error; @@ -2027,15 +2028,15 @@ test_conv_str_1(void) src_type = mkstr(10, H5T_STR_NULLPAD); dst_type = mkstr(5, H5T_STR_NULLPAD); buf = calloc(2, 10); - memcpy(buf, "abcdefghijabcdefghij", 20); + HDmemcpy(buf, "abcdefghijabcdefghij", 20); if (H5Tconvert(src_type, dst_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcdeabcdeabcdefghij", 20)) { + if (HDmemcmp(buf, "abcdeabcdeabcdefghij", 20)) { H5_FAILED(); puts(" Truncated C buffer test failed"); goto error; } if (H5Tconvert(dst_type, src_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", 20)) { + if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", 20)) { H5_FAILED(); puts(" Extended C buffer test failed"); goto error; @@ -2050,15 +2051,15 @@ test_conv_str_1(void) src_type = mkstr(10, H5T_STR_SPACEPAD); dst_type = mkstr(5, H5T_STR_SPACEPAD); buf = calloc(2, 10); - memcpy(buf, "abcdefghijabcdefghij", 20); + HDmemcpy(buf, "abcdefghijabcdefghij", 20); if (H5Tconvert(src_type, dst_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcdeabcdeabcdefghij", 20)) { + if (HDmemcmp(buf, "abcdeabcdeabcdefghij", 20)) { H5_FAILED(); puts(" Truncated Fortran-string test failed"); goto error; } if (H5Tconvert(dst_type, src_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcde abcde ", 20)) { + if (HDmemcmp(buf, "abcde abcde ", 20)) { H5_FAILED(); puts(" Extended Fortran-string test failed"); goto error; @@ -2076,25 +2077,25 @@ test_conv_str_1(void) src_type = mkstr(10, H5T_STR_NULLTERM); dst_type = mkstr(10, H5T_STR_NULLTERM); buf = calloc(2, 10); - memcpy(buf, "abcdefghijabcdefghij", 20); + HDmemcpy(buf, "abcdefghijabcdefghij", 20); if (H5Tconvert(src_type, dst_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcdefghijabcdefghij", 20)) { + if (HDmemcmp(buf, "abcdefghijabcdefghij", 20)) { H5_FAILED(); puts(" Non-terminated string test 1"); goto error; } H5Tclose(dst_type); dst_type = mkstr(5, H5T_STR_NULLTERM); - memcpy(buf, "abcdefghijabcdefghij", 20); + HDmemcpy(buf, "abcdefghijabcdefghij", 20); if (H5Tconvert(src_type, dst_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcd\0abcd\0abcdefghij", 20)) { + if (HDmemcmp(buf, "abcd\0abcd\0abcdefghij", 20)) { H5_FAILED(); puts(" Non-terminated string test 2"); goto error; } - memcpy(buf, "abcdeabcdexxxxxxxxxx", 20); + HDmemcpy(buf, "abcdeabcdexxxxxxxxxx", 20); if (H5Tconvert(dst_type, src_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", 20)) { + if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", 20)) { H5_FAILED(); puts(" Non-terminated string test 2"); goto error; @@ -2109,30 +2110,30 @@ test_conv_str_1(void) src_type = mkstr(10, H5T_STR_NULLTERM); dst_type = mkstr(10, H5T_STR_SPACEPAD); buf = calloc(2, 10); - memcpy(buf, "abcdefghi\0abcdefghi\0", 20); + HDmemcpy(buf, "abcdefghi\0abcdefghi\0", 20); if (H5Tconvert(src_type, dst_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcdefghi abcdefghi ", 20)) { + if (HDmemcmp(buf, "abcdefghi abcdefghi ", 20)) { H5_FAILED(); puts(" C string to Fortran test 1"); goto error; } if (H5Tconvert(dst_type, src_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcdefghi\0abcdefghi\0", 20)) { + if (HDmemcmp(buf, "abcdefghi\0abcdefghi\0", 20)) { H5_FAILED(); puts(" Fortran to C string test 1"); goto error; } if (H5Tclose(dst_type)<0) goto error; dst_type = mkstr(5, H5T_STR_SPACEPAD); - memcpy(buf, "abcdefgh\0\0abcdefgh\0\0", 20); + HDmemcpy(buf, "abcdefgh\0\0abcdefgh\0\0", 20); if (H5Tconvert(src_type, dst_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcdeabcdeabcdefgh\0\0", 20)) { + if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", 20)) { H5_FAILED(); puts(" C string to Fortran test 2"); goto error; } if (H5Tconvert(dst_type, src_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", 20)) { + if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", 20)) { H5_FAILED(); puts(" Fortran to C string test 2"); goto error; @@ -2141,15 +2142,15 @@ test_conv_str_1(void) if (H5Tclose(dst_type)<0) goto error; src_type = mkstr(5, H5T_STR_NULLTERM); dst_type = mkstr(10, H5T_STR_SPACEPAD); - memcpy(buf, "abcd\0abcd\0xxxxxxxxxx", 20); + HDmemcpy(buf, "abcd\0abcd\0xxxxxxxxxx", 20); if (H5Tconvert(src_type, dst_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcd abcd ", 20)) { + if (HDmemcmp(buf, "abcd abcd ", 20)) { H5_FAILED(); puts(" C string to Fortran test 3"); goto error; } if (H5Tconvert(dst_type, src_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcd\0abcd\0abcd ", 20)) { + if (HDmemcmp(buf, "abcd\0abcd\0abcd ", 20)) { H5_FAILED(); puts(" Fortran to C string test 3"); goto error; @@ -2164,30 +2165,30 @@ test_conv_str_1(void) src_type = mkstr(10, H5T_STR_NULLPAD); dst_type = mkstr(10, H5T_STR_SPACEPAD); buf = calloc(2, 10); - memcpy(buf, "abcdefghijabcdefghij", 20); + HDmemcpy(buf, "abcdefghijabcdefghij", 20); if (H5Tconvert(src_type, dst_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcdefghijabcdefghij", 20)) { + if (HDmemcmp(buf, "abcdefghijabcdefghij", 20)) { H5_FAILED(); puts(" C buffer to Fortran test 1"); goto error; } if (H5Tconvert(dst_type, src_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcdefghijabcdefghij", 20)) { + if (HDmemcmp(buf, "abcdefghijabcdefghij", 20)) { H5_FAILED(); puts(" Fortran to C buffer test 1"); goto error; } if (H5Tclose(dst_type)<0) goto error; dst_type = mkstr(5, H5T_STR_SPACEPAD); - memcpy(buf, "abcdefgh\0\0abcdefgh\0\0", 20); + HDmemcpy(buf, "abcdefgh\0\0abcdefgh\0\0", 20); if (H5Tconvert(src_type, dst_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcdeabcdeabcdefgh\0\0", 20)) { + if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", 20)) { H5_FAILED(); puts(" C buffer to Fortran test 2"); goto error; } if (H5Tconvert(dst_type, src_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", 20)) { + if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", 20)) { H5_FAILED(); puts(" Fortran to C buffer test 2"); goto error; @@ -2196,15 +2197,15 @@ test_conv_str_1(void) if (H5Tclose(dst_type)<0) goto error; src_type = mkstr(5, H5T_STR_NULLPAD); dst_type = mkstr(10, H5T_STR_SPACEPAD); - memcpy(buf, "abcd\0abcd\0xxxxxxxxxx", 20); + HDmemcpy(buf, "abcd\0abcd\0xxxxxxxxxx", 20); if (H5Tconvert(src_type, dst_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcd abcd ", 20)) { + if (HDmemcmp(buf, "abcd abcd ", 20)) { H5_FAILED(); puts(" C buffer to Fortran test 3"); goto error; } if (H5Tconvert(dst_type, src_type, (hsize_t)2, buf, NULL, H5P_DEFAULT)<0) goto error; - if (memcmp(buf, "abcd\0abcd\0abcd ", 20)) { + if (HDmemcmp(buf, "abcd\0abcd\0abcd ", 20)) { H5_FAILED(); puts(" Fortran to C buffer test 3"); goto error; @@ -2932,47 +2933,47 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char*)&hw_char; switch (src_type) { case INT_CHAR: - memcpy(aligned, saved+j*sizeof(char), sizeof(char)); + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(char)); hw_char = (char)(*((signed char*)aligned)); break; case INT_UCHAR: - memcpy(aligned, saved+j*sizeof(char), sizeof(char)); + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(char)); hw_char = (char)(*((unsigned char*)aligned)); break; case INT_SHORT: - memcpy(aligned, saved+j*sizeof(short), sizeof(short)); + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short)); hw_char = (char)(*((short*)aligned)); break; case INT_USHORT: - memcpy(aligned, saved+j*sizeof(short), + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(unsigned short)); hw_char = (char)(*((unsigned short*)aligned)); break; case INT_INT: - memcpy(aligned, saved+j*sizeof(int), sizeof(int)); + HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int)); hw_char = (char)(*((int*)aligned)); break; case INT_UINT: - memcpy(aligned, saved+j*sizeof(unsigned), + HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); hw_char = (char)(*((unsigned*)aligned)); break; case INT_LONG: - memcpy(aligned, saved+j*sizeof(long), sizeof(long)); + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long)); hw_char = (char)(*((long*)aligned)); break; case INT_ULONG: - memcpy(aligned, saved+j*sizeof(long), + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(unsigned long)); hw_char = (char)(*((unsigned long*)aligned)); break; case INT_LLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); hw_char = (char)(*((long_long*)aligned)); break; case INT_ULLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(unsigned long_long)); hw_char = (char)(*((unsigned long_long*)aligned)); break; @@ -2983,49 +2984,49 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char*)&hw_uchar; switch (src_type) { case INT_CHAR: - memcpy(aligned, saved+j*sizeof(char), + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); hw_uchar = (unsigned char)(*((signed char*)aligned)); break; case INT_UCHAR: - memcpy(aligned, saved+j*sizeof(char), + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(unsigned char)); hw_uchar = (unsigned char)(*((unsigned char*)aligned)); break; case INT_SHORT: - memcpy(aligned, saved+j*sizeof(short), sizeof(short)); + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short)); hw_uchar = (unsigned char)(*((short*)aligned)); break; case INT_USHORT: - memcpy(aligned, saved+j*sizeof(short), + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(unsigned short)); hw_uchar = (unsigned char)(*((unsigned short*)aligned)); break; case INT_INT: - memcpy(aligned, saved+j*sizeof(int), sizeof(int)); + HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int)); hw_uchar = (unsigned char)(*((int*)aligned)); break; case INT_UINT: - memcpy(aligned, saved+j*sizeof(unsigned), + HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); hw_uchar = (unsigned char)(*((unsigned*)aligned)); break; case INT_LONG: - memcpy(aligned, saved+j*sizeof(long), sizeof(long)); + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long)); hw_uchar = (unsigned char)(*((long*)aligned)); break; case INT_ULONG: - memcpy(aligned, saved+j*sizeof(long), + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(unsigned long)); hw_uchar = (unsigned char)(*((unsigned long*)aligned)); break; case INT_LLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); hw_uchar = (unsigned char)(*((long_long*)aligned)); break; case INT_ULLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(unsigned long_long)); hw_uchar = (unsigned char)(*((unsigned long_long*) aligned)); @@ -3037,48 +3038,48 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char*)&hw_short; switch (src_type) { case INT_CHAR: - memcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); hw_short = (short)(*((signed char*)aligned)); break; case INT_UCHAR: - memcpy(aligned, saved+j*sizeof(char), + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(unsigned char)); hw_short = (short)(*((unsigned char*)aligned)); break; case INT_SHORT: - memcpy(aligned, saved+j*sizeof(short), sizeof(short)); + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short)); hw_short = (short)(*((short*)aligned)); break; case INT_USHORT: - memcpy(aligned, saved+j*sizeof(short), + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(unsigned short)); hw_short = (short)(*((unsigned short*)aligned)); break; case INT_INT: - memcpy(aligned, saved+j*sizeof(int), sizeof(int)); + HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int)); hw_short = (short)(*((int*)aligned)); break; case INT_UINT: - memcpy(aligned, saved+j*sizeof(unsigned), + HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); hw_short = (short)(*((unsigned*)aligned)); break; case INT_LONG: - memcpy(aligned, saved+j*sizeof(long), sizeof(long)); + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long)); hw_short = (short)(*((long*)aligned)); break; case INT_ULONG: - memcpy(aligned, saved+j*sizeof(long), + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(unsigned long)); hw_short = (short)(*((unsigned long*)aligned)); break; case INT_LLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); hw_short = (short)(*((long_long*)aligned)); break; case INT_ULLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(unsigned long_long)); hw_short = (short)(*((unsigned long_long*)aligned)); break; @@ -3089,48 +3090,48 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char*)&hw_ushort; switch (src_type) { case INT_CHAR: - memcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); hw_ushort = (unsigned short)(*((signed char*)aligned)); break; case INT_UCHAR: - memcpy(aligned, saved+j*sizeof(char), + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(unsigned char)); hw_ushort = (unsigned short)(*((unsigned char*)aligned)); break; case INT_SHORT: - memcpy(aligned, saved+j*sizeof(short), sizeof(short)); + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short)); hw_ushort = (unsigned short)(*((short*)aligned)); break; case INT_USHORT: - memcpy(aligned, saved+j*sizeof(short), + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(unsigned short)); hw_ushort = (unsigned short)(*((unsigned short*)aligned)); break; case INT_INT: - memcpy(aligned, saved+j*sizeof(int), sizeof(int)); + HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int)); hw_ushort = (unsigned short)(*((int*)aligned)); break; case INT_UINT: - memcpy(aligned, saved+j*sizeof(unsigned), + HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); hw_ushort = (unsigned short)(*((unsigned*)aligned)); break; case INT_LONG: - memcpy(aligned, saved+j*sizeof(long), sizeof(long)); + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long)); hw_ushort = (unsigned short)(*((long*)aligned)); break; case INT_ULONG: - memcpy(aligned, saved+j*sizeof(long), + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(unsigned long)); hw_ushort = (unsigned short)(*((unsigned long*)aligned)); break; case INT_LLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); hw_ushort = (unsigned short)(*((long_long*)aligned)); break; case INT_ULLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(unsigned long_long)); hw_ushort = (unsigned short)(*((unsigned long_long*) aligned)); @@ -3142,48 +3143,48 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char*)&hw_int; switch (src_type) { case INT_CHAR: - memcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); hw_int = (int)(*((signed char*)aligned)); break; case INT_UCHAR: - memcpy(aligned, saved+j*sizeof(char), + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(unsigned char)); hw_int = (int)(*((unsigned char*)aligned)); break; case INT_SHORT: - memcpy(aligned, saved+j*sizeof(short), sizeof(short)); + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short)); hw_int = (int)(*((short*)aligned)); break; case INT_USHORT: - memcpy(aligned, saved+j*sizeof(short), + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(unsigned short)); hw_int = (int)(*((unsigned short*)aligned)); break; case INT_INT: - memcpy(aligned, saved+j*sizeof(int), sizeof(int)); + HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int)); hw_int = (int)(*((int*)aligned)); break; case INT_UINT: - memcpy(aligned, saved+j*sizeof(unsigned), + HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); hw_int = (int)(*((unsigned*)aligned)); break; case INT_LONG: - memcpy(aligned, saved+j*sizeof(long), sizeof(long)); + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long)); hw_int = (int)(*((long*)aligned)); break; case INT_ULONG: - memcpy(aligned, saved+j*sizeof(long), + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(unsigned long)); hw_int = (int)(*((unsigned long*)aligned)); break; case INT_LLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); hw_int = (int)(*((long_long*)aligned)); break; case INT_ULLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(unsigned long_long)); hw_int = (int)(*((unsigned long_long*)aligned)); break; @@ -3194,49 +3195,49 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char*)&hw_uint; switch (src_type) { case INT_CHAR: - memcpy(aligned, saved+j*sizeof(char), + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); hw_uint = (unsigned int)(*((signed char*)aligned)); break; case INT_UCHAR: - memcpy(aligned, saved+j*sizeof(char), + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(unsigned char)); hw_uint = (unsigned int)(*((unsigned char*)aligned)); break; case INT_SHORT: - memcpy(aligned, saved+j*sizeof(short), sizeof(short)); + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short)); hw_uint = (unsigned int)(*((short*)aligned)); break; case INT_USHORT: - memcpy(aligned, saved+j*sizeof(short), + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(unsigned short)); hw_uint = (unsigned int)(*((unsigned short*)aligned)); break; case INT_INT: - memcpy(aligned, saved+j*sizeof(int), sizeof(int)); + HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int)); hw_uint = (unsigned int)(*((int*)aligned)); break; case INT_UINT: - memcpy(aligned, saved+j*sizeof(unsigned), + HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); hw_uint = (unsigned int)(*((unsigned*)aligned)); break; case INT_LONG: - memcpy(aligned, saved+j*sizeof(long), sizeof(long)); + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long)); hw_uint = (unsigned int)(*((long*)aligned)); break; case INT_ULONG: - memcpy(aligned, saved+j*sizeof(long), + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(unsigned long)); hw_uint = (unsigned int)(*((unsigned long*)aligned)); break; case INT_LLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); hw_uint = (unsigned int)(*((long_long*)aligned)); break; case INT_ULLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(unsigned long_long)); hw_uint = (unsigned int)(*((unsigned long_long*)aligned)); break; @@ -3247,49 +3248,49 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char*)&hw_long; switch (src_type) { case INT_CHAR: - memcpy(aligned, saved+j*sizeof(char), + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); hw_long = (long int)(*((signed char*)aligned)); break; case INT_UCHAR: - memcpy(aligned, saved+j*sizeof(char), + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(unsigned char)); hw_long = (long int)(*((unsigned char*)aligned)); break; case INT_SHORT: - memcpy(aligned, saved+j*sizeof(short), sizeof(short)); + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short)); hw_long = (long int)(*((short*)aligned)); break; case INT_USHORT: - memcpy(aligned, saved+j*sizeof(short), + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(unsigned short)); hw_long = (long int)(*((unsigned short*)aligned)); break; case INT_INT: - memcpy(aligned, saved+j*sizeof(int), sizeof(int)); + HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int)); hw_long = (long int)(*((int*)aligned)); break; case INT_UINT: - memcpy(aligned, saved+j*sizeof(unsigned), + HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); hw_long = (long int)(*((unsigned*)aligned)); break; case INT_LONG: - memcpy(aligned, saved+j*sizeof(long), sizeof(long)); + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long)); hw_long = (long int)(*((long*)aligned)); break; case INT_ULONG: - memcpy(aligned, saved+j*sizeof(long), + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(unsigned long)); hw_long = (long int)(*((unsigned long*)aligned)); break; case INT_LLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); hw_long = (long int)(*((long_long*)aligned)); break; case INT_ULLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(unsigned long_long)); hw_long = (long int)(*((unsigned long_long*)aligned)); break; @@ -3300,49 +3301,49 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char*)&hw_ulong; switch (src_type) { case INT_CHAR: - memcpy(aligned, saved+j*sizeof(char), + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); hw_ulong = (unsigned long)(*((signed char*)aligned)); break; case INT_UCHAR: - memcpy(aligned, saved+j*sizeof(char), + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(unsigned char)); hw_ulong = (unsigned long)(*((unsigned char*)aligned)); break; case INT_SHORT: - memcpy(aligned, saved+j*sizeof(short), sizeof(short)); + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short)); hw_ulong = (unsigned long)(*((short*)aligned)); break; case INT_USHORT: - memcpy(aligned, saved+j*sizeof(short), + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(unsigned short)); hw_ulong = (unsigned long)(*((unsigned short*)aligned)); break; case INT_INT: - memcpy(aligned, saved+j*sizeof(int), sizeof(int)); + HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int)); hw_ulong = (unsigned long)(*((int*)aligned)); break; case INT_UINT: - memcpy(aligned, saved+j*sizeof(unsigned), + HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); hw_ulong = (unsigned long)(*((unsigned*)aligned)); break; case INT_LONG: - memcpy(aligned, saved+j*sizeof(long), sizeof(long)); + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long)); hw_ulong = (unsigned long)(*((long*)aligned)); break; case INT_ULONG: - memcpy(aligned, saved+j*sizeof(long), + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(unsigned long)); hw_ulong = (unsigned long)(*((unsigned long*)aligned)); break; case INT_LLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); hw_ulong = (unsigned long)(*((long_long*)aligned)); break; case INT_ULLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(unsigned long_long)); hw_ulong = (unsigned long)(*((unsigned long_long*) aligned)); @@ -3354,49 +3355,49 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char*)&hw_llong; switch (src_type) { case INT_CHAR: - memcpy(aligned, saved+j*sizeof(char), + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); hw_llong = (long_long)(*((signed char*)aligned)); break; case INT_UCHAR: - memcpy(aligned, saved+j*sizeof(char), + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(unsigned char)); hw_llong = (long_long)(*((unsigned char*)aligned)); break; case INT_SHORT: - memcpy(aligned, saved+j*sizeof(short), sizeof(short)); + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short)); hw_llong = (long_long)(*((short*)aligned)); break; case INT_USHORT: - memcpy(aligned, saved+j*sizeof(short), + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(unsigned short)); hw_llong = (long_long)(*((unsigned short*)aligned)); break; case INT_INT: - memcpy(aligned, saved+j*sizeof(int), sizeof(int)); + HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int)); hw_llong = (long_long)(*((int*)aligned)); break; case INT_UINT: - memcpy(aligned, saved+j*sizeof(unsigned), + HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); hw_llong = (long_long)(*((unsigned*)aligned)); break; case INT_LONG: - memcpy(aligned, saved+j*sizeof(long), sizeof(long)); + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long)); hw_llong = (long_long)(*((long*)aligned)); break; case INT_ULONG: - memcpy(aligned, saved+j*sizeof(long), + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(unsigned long)); hw_llong = (long_long)(*((unsigned long*)aligned)); break; case INT_LLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); hw_llong = (long_long)(*((long_long*)aligned)); break; case INT_ULLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(unsigned long_long)); hw_llong = (long_long)(*((unsigned long_long*)aligned)); break; @@ -3407,53 +3408,53 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) hw = (unsigned char*)&hw_ullong; switch (src_type) { case INT_CHAR: - memcpy(aligned, saved+j*sizeof(char), + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); hw_ullong = (unsigned long_long)(*((signed char*) aligned)); break; case INT_UCHAR: - memcpy(aligned, saved+j*sizeof(char), + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(unsigned char)); hw_ullong = (unsigned long_long)(*((unsigned char*) aligned)); break; case INT_SHORT: - memcpy(aligned, saved+j*sizeof(short), sizeof(short)); + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short)); hw_ullong = (unsigned long_long)(*((short*)aligned)); break; case INT_USHORT: - memcpy(aligned, saved+j*sizeof(short), + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(unsigned short)); hw_ullong = (unsigned long_long)(*((unsigned short*) aligned)); break; case INT_INT: - memcpy(aligned, saved+j*sizeof(int), sizeof(int)); + HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int)); hw_ullong = (unsigned long_long)(*((int*)aligned)); break; case INT_UINT: - memcpy(aligned, saved+j*sizeof(unsigned), + HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); hw_ullong = (unsigned long_long)(*((unsigned*)aligned)); break; case INT_LONG: - memcpy(aligned, saved+j*sizeof(long), sizeof(long)); + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long)); hw_ullong = (unsigned long_long)(*((long*)aligned)); break; case INT_ULONG: - memcpy(aligned, saved+j*sizeof(long), + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(unsigned long)); hw_ullong = (unsigned long_long)(*((unsigned long*) aligned)); break; case INT_LLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); hw_ullong = (unsigned long_long)(*((long_long*)aligned)); break; case INT_ULLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(unsigned long_long)); hw_ullong = (unsigned long_long)(*((unsigned long_long*) aligned)); @@ -3612,44 +3613,44 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) ""); switch (src_type) { case INT_CHAR: - memcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(signed char)); printf(" %29d\n", *((signed char*)aligned)); break; case INT_UCHAR: - memcpy(aligned, saved+j*sizeof(char), sizeof(unsigned char)); + HDmemcpy(aligned, saved+j*sizeof(char), sizeof(unsigned char)); printf(" %29u\n", *((unsigned char*)aligned)); break; case INT_SHORT: - memcpy(aligned, saved+j*sizeof(short), sizeof(short)); + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(short)); printf(" %29hd\n", *((short*)aligned)); break; case INT_USHORT: - memcpy(aligned, saved+j*sizeof(short), + HDmemcpy(aligned, saved+j*sizeof(short), sizeof(unsigned short)); printf(" %29hu\n", *((unsigned short*)aligned)); break; case INT_INT: - memcpy(aligned, saved+j*sizeof(int), sizeof(int)); + HDmemcpy(aligned, saved+j*sizeof(int), sizeof(int)); printf(" %29d\n", *((int*)aligned)); break; case INT_UINT: - memcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); + HDmemcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned)); printf(" %29u\n", *((unsigned*)aligned)); break; case INT_LONG: - memcpy(aligned, saved+j*sizeof(long), sizeof(long)); + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(long)); printf(" %29ld\n", *((long*)aligned)); break; case INT_ULONG: - memcpy(aligned, saved+j*sizeof(long), sizeof(unsigned long)); + HDmemcpy(aligned, saved+j*sizeof(long), sizeof(unsigned long)); printf(" %29lu\n", *((unsigned long*)aligned)); break; case INT_LLONG: - memcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long_long*)aligned)); break; case INT_ULLONG: - memcpy(aligned, saved+j*sizeof(long_long), + HDmemcpy(aligned, saved+j*sizeof(long_long), sizeof(unsigned long_long)); HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long_long*)aligned)); @@ -3666,43 +3667,43 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) ""); switch (dst_type) { case INT_CHAR: - memcpy(aligned, buf+j*sizeof(char), sizeof(signed char)); + HDmemcpy(aligned, buf+j*sizeof(char), sizeof(signed char)); printf(" %29d\n", *((signed char*)aligned)); break; case INT_UCHAR: - memcpy(aligned, buf+j*sizeof(char), sizeof(unsigned char)); + HDmemcpy(aligned, buf+j*sizeof(char), sizeof(unsigned char)); printf(" %29u\n", *((unsigned char*)aligned)); break; case INT_SHORT: - memcpy(aligned, buf+j*sizeof(short), sizeof(short)); + HDmemcpy(aligned, buf+j*sizeof(short), sizeof(short)); printf(" %29d\n", *((short*)aligned)); break; case INT_USHORT: - memcpy(aligned, buf+j*sizeof(short), sizeof(unsigned short)); + HDmemcpy(aligned, buf+j*sizeof(short), sizeof(unsigned short)); printf(" %29u\n", *((unsigned short*)aligned)); break; case INT_INT: - memcpy(aligned, buf+j*sizeof(int), sizeof(int)); + HDmemcpy(aligned, buf+j*sizeof(int), sizeof(int)); printf(" %29d\n", *((int*)aligned)); break; case INT_UINT: - memcpy(aligned, buf+j*sizeof(unsigned), sizeof(unsigned)); + HDmemcpy(aligned, buf+j*sizeof(unsigned), sizeof(unsigned)); printf(" %29u\n", *((unsigned*)aligned)); break; case INT_LONG: - memcpy(aligned, buf+j*sizeof(long), sizeof(long)); + HDmemcpy(aligned, buf+j*sizeof(long), sizeof(long)); printf(" %29ld\n", *((long*)aligned)); break; case INT_ULONG: - memcpy(aligned, buf+j*sizeof(long), sizeof(unsigned long)); + HDmemcpy(aligned, buf+j*sizeof(long), sizeof(unsigned long)); printf(" %29lu\n", *((unsigned long*)aligned)); break; case INT_LLONG: - memcpy(aligned, buf+j*sizeof(long_long), sizeof(long_long)); + HDmemcpy(aligned, buf+j*sizeof(long_long), sizeof(long_long)); HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long_long*)aligned)); break; case INT_ULLONG: - memcpy(aligned, buf+j*sizeof(long_long), + HDmemcpy(aligned, buf+j*sizeof(long_long), sizeof(unsigned long_long)); HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long_long*)aligned)); @@ -3859,16 +3860,16 @@ my_isnan(flt_t type, void *val) if (FLT_FLOAT==type) { float x; - memcpy(&x, val, sizeof(float)); + HDmemcpy(&x, val, sizeof(float)); retval = (x!=x); } else if (FLT_DOUBLE==type) { double x; - memcpy(&x, val, sizeof(double)); + HDmemcpy(&x, val, sizeof(double)); retval = (x!=x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE } else if (FLT_LDOUBLE==type) { long double x; - memcpy(&x, val, sizeof(long double)); + HDmemcpy(&x, val, sizeof(long double)); retval = (x!=x); #endif } else { @@ -3882,16 +3883,16 @@ my_isnan(flt_t type, void *val) if (!retval) { if (FLT_FLOAT==type) { float x; - memcpy(&x, val, sizeof(float)); + HDmemcpy(&x, val, sizeof(float)); sprintf(s, "%g", x); } else if (FLT_DOUBLE==type) { double x; - memcpy(&x, val, sizeof(double)); + HDmemcpy(&x, val, sizeof(double)); sprintf(s, "%g", x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE } else if (FLT_LDOUBLE==type) { long double x; - memcpy(&x, val, sizeof(long double)); + HDmemcpy(&x, val, sizeof(long double)); sprintf(s, "%Lg", x); #endif } else { @@ -3947,7 +3948,12 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst) unsigned char *hw=NULL; /*ptr to hardware-conv'd*/ size_t i, j, k; /*counters */ int endian; /*machine endianess */ + size_t src_ebias; /* Source type's exponent bias */ size_t dst_ebias; /* Destination type's exponent bias */ + size_t src_epos; /* Source type's exponent position */ + size_t src_esize; /* Source type's exponent size */ + size_t dst_epos; /* Destination type's exponent position */ + size_t dst_esize; /* Destination type's exponent size */ size_t dst_msize; /* Destination type's mantissa size */ #ifdef HANDLE_SIGFPE @@ -4043,8 +4049,10 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst) #endif /* Get "interesting" values */ + src_ebias=H5Tget_ebias(src); dst_ebias=H5Tget_ebias(dst); - H5Tget_fields(dst,NULL,NULL,NULL,NULL,&dst_msize); + H5Tget_fields(src,NULL,&src_epos,&src_esize,NULL,NULL); + H5Tget_fields(dst,NULL,&dst_epos,&dst_esize,NULL,&dst_msize); for (i=0; i