diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2010-08-05 15:53:16 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2010-08-05 15:53:16 (GMT) |
commit | bb83e1ff9a7c424ed9e8a72d737703c9f6e78ad8 (patch) | |
tree | f21ffcc406317546a0e168df2305e74846d046ba /src/H5Zscaleoffset.c | |
parent | 30ac7d89a2ceb5ea3168ac61748905d9625811eb (diff) | |
download | hdf5-bb83e1ff9a7c424ed9e8a72d737703c9f6e78ad8.zip hdf5-bb83e1ff9a7c424ed9e8a72d737703c9f6e78ad8.tar.gz hdf5-bb83e1ff9a7c424ed9e8a72d737703c9f6e78ad8.tar.bz2 |
[svn-r19172] Bug fix for #1239 - The filter's public function CAN_APPLY should return htri_t not
herr_t. To minimize the change of the library's behavior, in the function
H5Z_prelude_callback of H5Z.c, if the return value of can_apply is FALSE and
the filter is MANDATE, this function returns a FAILURE. If the return value is FALSE
but the filter is OPTIONAL, this function returns a SUCCEED. During the IO, the filter
will fail and return a size of zero. But the pipeline will skip this filter.
Tested on jam, linew, and amani. Tested on jam with szip.
Diffstat (limited to 'src/H5Zscaleoffset.c')
-rw-r--r-- | src/H5Zscaleoffset.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 5737702..4bfc8b1 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -41,7 +41,7 @@ enum H5Z_scaleoffset_t {t_bad=0, t_uchar=1, t_ushort, t_uint, t_ulong, t_ulong_l /* Local function prototypes */ static double H5Z_scaleoffset_rnd(double val); -static herr_t H5Z_can_apply_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static htri_t H5Z_can_apply_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); static enum H5Z_scaleoffset_t H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign); static herr_t H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, @@ -611,13 +611,13 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ * *------------------------------------------------------------------------- */ -static herr_t +static htri_t H5Z_can_apply_scaleoffset(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED space_id) { const H5T_t *type; /* Datatype */ H5T_class_t dtype_class; /* Datatype's class */ H5T_order_t dtype_order; /* Datatype's endianness order */ - herr_t ret_value = TRUE; /* Return value */ + htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI(H5Z_can_apply_scaleoffset, FAIL) @@ -640,9 +640,9 @@ H5Z_can_apply_scaleoffset(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED spac /* Range check datatype's endianness order */ if(dtype_order != H5T_ORDER_LE && dtype_order != H5T_ORDER_BE) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype endianness order") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FALSE, "bad datatype endianness order") } else - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "datatype class not supported by scaleoffset") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FALSE, "datatype class not supported by scaleoffset") done: FUNC_LEAVE_NOAPI(ret_value) |