summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2004-10-21 16:04:08 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2004-10-21 16:04:08 (GMT)
commitcacc8fa4c6bd301339ce78e8ab41a31ab8bdf654 (patch)
treef364eb370caa3dff914522121a67cc8f4e297c20 /src
parent229d19bc72ee1775c19428a46ac8e89618cfdb0b (diff)
downloadhdf5-cacc8fa4c6bd301339ce78e8ab41a31ab8bdf654.zip
hdf5-cacc8fa4c6bd301339ce78e8ab41a31ab8bdf654.tar.gz
hdf5-cacc8fa4c6bd301339ce78e8ab41a31ab8bdf654.tar.bz2
[svn-r9445] Purpose: Bug fix
Description: "char" was considered as always "signed char" in data type conversion. However, ISO C leaves the definition of "char" to individual implementation. i.e. for IBM AIX C compiler, it's treated as "unsigned char". Solution: Changed all "char" to "signed char". Don't even do "char" anymore because its definition is up to each vendor. Platforms tested: h5committest
Diffstat (limited to 'src')
-rw-r--r--src/H5T.c8
-rw-r--r--src/H5Tconv.c40
-rw-r--r--src/H5Tpkg.h8
3 files changed, 28 insertions, 28 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 602da96..0c85c3f 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -1098,8 +1098,8 @@ H5T_init_interface(void)
status |= H5T_register(H5T_PERS_HARD, "uchar_schar", native_uchar, native_schar, H5T_conv_uchar_schar, H5AC_dxpl_id);
/* From char to floats */
- status |= H5T_register(H5T_PERS_HARD, "char_flt", native_schar, native_float, H5T_conv_char_float, H5AC_dxpl_id);
- status |= H5T_register(H5T_PERS_HARD, "char_dbl", native_schar, native_double, H5T_conv_char_double, H5AC_dxpl_id);
+ 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);
/* From unsigned char to floats */
status |= H5T_register(H5T_PERS_HARD, "uchar_flt", native_uchar, native_float, H5T_conv_uchar_float, H5AC_dxpl_id);
@@ -1140,8 +1140,8 @@ H5T_init_interface(void)
#endif /* H5_ULLONG_TO_FP_CAST_WORKS */
/* From floats to char */
- status |= H5T_register(H5T_PERS_HARD, "flt_char", native_float, native_schar, H5T_conv_float_char, H5AC_dxpl_id);
- status |= H5T_register(H5T_PERS_HARD, "dbl_char", native_double, native_schar, H5T_conv_double_char, H5AC_dxpl_id);
+ 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);
/* From floats to unsigned char */
status |= H5T_register(H5T_PERS_HARD, "flt_uchar", native_float, native_uchar, H5T_conv_float_uchar, H5AC_dxpl_id);
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 30f41fe..871e8e1 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -6976,9 +6976,9 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5T_conv_char_float
+ * Function: H5T_conv_schar_float
*
- * Purpose: Convert native char to native float using hardware.
+ * Purpose: Convert native signed char to native float using hardware.
* This is a fast special case.
*
* Return: Non-negative on success/Negative on failure
@@ -6991,16 +6991,16 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5T_conv_char_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
+H5T_conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg,
hid_t UNUSED dxpl_id)
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5T_conv_char_float, FAIL);
+ FUNC_ENTER_NOAPI(H5T_conv_schar_float, FAIL);
- H5T_CONV_xF(SCHAR, FLOAT, char, float, -, -);
+ H5T_CONV_xF(SCHAR, FLOAT, signed char, float, -, -);
done:
FUNC_LEAVE_NOAPI(ret_value);
@@ -7008,9 +7008,9 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5T_conv_char_double
+ * Function: H5T_conv_schar_double
*
- * Purpose: Convert native char to native double using hardware.
+ * Purpose: Convert native signed char to native double using hardware.
* This is a fast special case.
*
* Return: Non-negative on success/Negative on failure
@@ -7023,16 +7023,16 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5T_conv_char_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
+H5T_conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg,
hid_t UNUSED dxpl_id)
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5T_conv_char_double, FAIL);
+ FUNC_ENTER_NOAPI(H5T_conv_schar_double, FAIL);
- H5T_CONV_xF(SCHAR, DOUBLE, char, double, -, -);
+ H5T_CONV_xF(SCHAR, DOUBLE, signed char, double, -, -);
done:
FUNC_LEAVE_NOAPI(ret_value);
@@ -7619,9 +7619,9 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5T_conv_float_char
+ * Function: H5T_conv_float_schar
*
- * Purpose: Convert native float to native char using
+ * Purpose: Convert native float to native signed char using
* hardware. This is a fast special case.
*
* Return: Non-negative on success/Negative on failure
@@ -7634,16 +7634,16 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5T_conv_float_char (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
+H5T_conv_float_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg,
hid_t UNUSED dxpl_id)
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5T_conv_float_char, FAIL);
+ FUNC_ENTER_NOAPI(H5T_conv_float_schar, FAIL);
- H5T_CONV_Fx(FLOAT, SCHAR, float, char, CHAR_MIN, CHAR_MAX);
+ H5T_CONV_Fx(FLOAT, SCHAR, float, signed char, SCHAR_MIN, SCHAR_MAX);
done:
FUNC_LEAVE_NOAPI(ret_value);
@@ -7683,9 +7683,9 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5T_conv_double_char
+ * Function: H5T_conv_double_schar
*
- * Purpose: Convert native float to native char using
+ * Purpose: Convert native float to native signed char using
* hardware. This is a fast special case.
*
* Return: Non-negative on success/Negative on failure
@@ -7698,16 +7698,16 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5T_conv_double_char (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
+H5T_conv_double_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
size_t nelmts, size_t buf_stride,
size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg,
hid_t UNUSED dxpl_id)
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5T_conv_double_char, FAIL);
+ FUNC_ENTER_NOAPI(H5T_conv_double_schar, FAIL);
- H5T_CONV_Fx(DOUBLE, SCHAR, double, char, CHAR_MIN, CHAR_MAX);
+ H5T_CONV_Fx(DOUBLE, SCHAR, double, signed char, SCHAR_MIN, SCHAR_MAX);
done:
FUNC_LEAVE_NOAPI(ret_value);
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index 2993f2f..f1c71c9 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -857,12 +857,12 @@ H5_DLL herr_t H5T_conv_double_float(hid_t src_id, hid_t dst_id,
size_t buf_stride, size_t bkg_stride,
void *buf, void *bkg,
hid_t dset_xfer_plist);
-H5_DLL herr_t H5T_conv_char_float(hid_t src_id, hid_t dst_id,
+H5_DLL herr_t H5T_conv_schar_float(hid_t src_id, hid_t dst_id,
H5T_cdata_t *cdata, size_t nelmts,
size_t buf_stride, size_t bkg_stride,
void *buf, void *bkg,
hid_t dset_xfer_plist);
-H5_DLL herr_t H5T_conv_char_double(hid_t src_id, hid_t dst_id,
+H5_DLL herr_t H5T_conv_schar_double(hid_t src_id, hid_t dst_id,
H5T_cdata_t *cdata, size_t nelmts,
size_t buf_stride, size_t bkg_stride,
void *buf, void *bkg,
@@ -959,7 +959,7 @@ H5_DLL herr_t H5T_conv_ullong_double(hid_t src_id, hid_t dst_id,
void *buf, void *bkg,
hid_t dset_xfer_plist);
#endif /* H5_ULLONG_TO_FP_CAST_WORKS */
-H5_DLL herr_t H5T_conv_float_char(hid_t src_id, hid_t dst_id,
+H5_DLL herr_t H5T_conv_float_schar(hid_t src_id, hid_t dst_id,
H5T_cdata_t *cdata, size_t nelmts,
size_t buf_stride, size_t bkg_stride,
void *buf, void *bkg,
@@ -1009,7 +1009,7 @@ H5_DLL herr_t H5T_conv_float_ullong(hid_t src_id, hid_t dst_id,
size_t buf_stride, size_t bkg_stride,
void *buf, void *bkg,
hid_t dset_xfer_plist);
-H5_DLL herr_t H5T_conv_double_char(hid_t src_id, hid_t dst_id,
+H5_DLL herr_t H5T_conv_double_schar(hid_t src_id, hid_t dst_id,
H5T_cdata_t *cdata, size_t nelmts,
size_t buf_stride, size_t bkg_stride,
void *buf, void *bkg,