From dc2bc37c39fd23acd22c6fbca48aca992862ed2c Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Wed, 17 Aug 2005 10:05:08 -0500 Subject: [svn-r11254] Purpose: Bug fix Description: In some macro definition, some constant values like D_MIN and D_MAX were not casted to the destination type. They may cause problems for some system like TFLOPS. Solution: Cast them to destination type. Platforms tested: fuss - very simple changes. --- src/H5Tconv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 2076a7c..cb1c38a 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -328,7 +328,7 @@ H5FL_BLK_DEFINE_STATIC(array_seq); } \ else \ *((DT*)D) = 0; \ - } else if (sizeof(ST)>sizeof(DT) && *((ST*)S) > (D_MAX)) { \ + } else if (sizeof(ST)>sizeof(DT) && *((ST*)S) > (DT)(D_MAX)) { \ if(cb_struct.func) { \ H5T_conv_ret_t except_ret; /*callback return*/ \ \ @@ -389,7 +389,7 @@ H5FL_BLK_DEFINE_STATIC(array_seq); #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) > (D_MAX)) { \ + if (*((ST*)S) > (DT)(D_MAX)) { \ if(cb_struct.func) { \ H5T_conv_ret_t except_ret; /*callback return*/ \ \ @@ -436,7 +436,7 @@ H5FL_BLK_DEFINE_STATIC(array_seq); } \ else \ *((DT*)D) = (H5T_NATIVE_FLOAT_POS_INF_g); \ - } else if (*((ST*)S) < (D_MIN)) { \ + } else if (*((ST*)S) < (DT)(D_MIN)) { \ if(cb_struct.func) { \ H5T_conv_ret_t except_ret; /*callback return*/ \ \ -- cgit v0.12