mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-13 16:47:58 +08:00
[svn-r7820] Purpose:
Bug fix Description: Don't check the number of szip parameters set during the "can apply" and "set local" callbacks, be safe about setting the parameters instead. Platforms tested: FreeBSD 4.9 (sleipnir) too minor to require h5committest
This commit is contained in:
parent
3ddea291c6
commit
debbaac81d
@ -103,10 +103,6 @@ H5Z_can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
|
||||
if(H5Pget_filter_by_id(dcpl_id,H5Z_FILTER_SZIP,&flags,&cd_nelmts, cd_values,0,NULL)<0)
|
||||
HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get szip parameters")
|
||||
|
||||
/* Check that no parameters are currently set */
|
||||
if(cd_nelmts!=H5Z_SZIP_USER_NPARMS)
|
||||
HGOTO_ERROR(H5E_PLINE, H5E_BADVALUE, FAIL, "incorrect # of szip parameters")
|
||||
|
||||
/* Get datatype's size, for checking the "bits-per-pixel" */
|
||||
if((dtype_size=(sizeof(unsigned char)*H5Tget_size(type_id)))==0)
|
||||
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size")
|
||||
@ -178,10 +174,6 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
|
||||
if(H5Pget_filter_by_id(dcpl_id,H5Z_FILTER_SZIP,&flags,&cd_nelmts, cd_values,0,NULL)<0)
|
||||
HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get szip parameters")
|
||||
|
||||
/* Check that no parameters are currently set */
|
||||
if(cd_nelmts!=H5Z_SZIP_USER_NPARMS)
|
||||
HGOTO_ERROR(H5E_PLINE, H5E_BADVALUE, FAIL, "incorrect # of szip parameters")
|
||||
|
||||
/* Get dimensions for dataspace */
|
||||
if ((ndims=H5Sget_simple_extent_dims(space_id, dims, NULL))<0)
|
||||
HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get dataspace dimensions")
|
||||
@ -201,6 +193,7 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
|
||||
|
||||
/* Set the correct endianness flag for szip */
|
||||
/* (Note: this may not handle non-atomic datatypes well) */
|
||||
cd_values[H5Z_SZIP_PARM_MASK] &= ~(SZ_LSB_OPTION_MASK|SZ_MSB_OPTION_MASK);
|
||||
switch(dtype_order) {
|
||||
case H5T_ORDER_LE: /* Little-endian byte order */
|
||||
cd_values[H5Z_SZIP_PARM_MASK] |= SZ_LSB_OPTION_MASK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user