summaryrefslogtreecommitdiffstats
path: root/src/H5Pdcpl.c
diff options
context:
space:
mode:
authorMuQun Yang <ymuqun@hdfgroup.org>2005-08-31 22:08:21 (GMT)
committerMuQun Yang <ymuqun@hdfgroup.org>2005-08-31 22:08:21 (GMT)
commit9d7b2503713caa9a44385f528831a084bd356247 (patch)
treeda3e9c66f4a4b791e48a51a5e8228a5303a86f1e /src/H5Pdcpl.c
parent6265941e7630e5c8ecd047e455a6b11a329a9518 (diff)
downloadhdf5-9d7b2503713caa9a44385f528831a084bd356247.zip
hdf5-9d7b2503713caa9a44385f528831a084bd356247.tar.gz
hdf5-9d7b2503713caa9a44385f528831a084bd356247.tar.bz2
[svn-r11325] Purpose:
Update scaleoffset filter. Description: 1. Using enum type to describe scale offset type(int, Dscale or Escale) 2. Changing some macro names 3. Fixing some minor bugs Solution: Platforms tested: sol 2.8, linux 2.4, aix 5.1(32-bit and 64-bit) Misc. update:
Diffstat (limited to 'src/H5Pdcpl.c')
-rw-r--r--src/H5Pdcpl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index 8977a51..6981686 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -1293,7 +1293,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pset_scaleoffset(hid_t plist_id, int scale_factor, unsigned scale_type)
+H5Pset_scaleoffset(hid_t plist_id, H5_SO_scale_type scale_type, int scale_factor)
{
H5O_pline_t pline;
H5P_genplist_t *plist; /* Property list pointer */
@@ -1307,6 +1307,9 @@ H5Pset_scaleoffset(hid_t plist_id, int scale_factor, unsigned scale_type)
if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE))
HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list");
+ if(scale_type!=0 && scale_type!=1 && scale_type!=2)
+ HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "invalid scale type");
+
/* Get the plist structure */
if(NULL == (plist = H5I_object(plist_id)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
@@ -1319,8 +1322,8 @@ H5Pset_scaleoffset(hid_t plist_id, int scale_factor, unsigned scale_type)
* scale type = other: integer type, scale_factor is minimum number of bits
* if scale_factor = 0, then filter calculates minimum number of bits
*/
- cd_values[0] = scale_factor;
- cd_values[1] = scale_type;
+ cd_values[0] = scale_type;
+ cd_values[1] = scale_factor;
/* Add the scaleoffset filter */
if(H5P_get(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)