summaryrefslogtreecommitdiffstats
path: root/src/H5Zshuffle.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-18 16:10:46 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-18 16:10:46 (GMT)
commitb0eb42058c02bff41cacae11880b4fbf174821db (patch)
treec389ee389c680cccbd2a5c5f11107b588f4bcfa0 /src/H5Zshuffle.c
parentdcf8866b6af90aa0bf50ebeceda6b0f184a07c17 (diff)
downloadhdf5-b0eb42058c02bff41cacae11880b4fbf174821db.zip
hdf5-b0eb42058c02bff41cacae11880b4fbf174821db.tar.gz
hdf5-b0eb42058c02bff41cacae11880b4fbf174821db.tar.bz2
[svn-r14208] Description:
Make H5Pget_filter_by_id() API versioned and switch internal usage to H5Pget_filter_by_id2(). Add simple regression test for H5Pget_filter_by_id1(). Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'src/H5Zshuffle.c')
-rw-r--r--src/H5Zshuffle.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c
index 190d0ea..c203ed9 100644
--- a/src/H5Zshuffle.c
+++ b/src/H5Zshuffle.c
@@ -18,9 +18,10 @@
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Ppublic.h" /* Property lists */
-#include "H5Tpublic.h" /* Datatype functions */
+#include "H5Pprivate.h" /* Property lists */
+#include "H5Tprivate.h" /* Datatypes */
#include "H5Zpkg.h" /* Data filters */
#ifdef H5_HAVE_FILTER_SHUFFLE
@@ -68,27 +69,33 @@ const H5Z_class_t H5Z_SHUFFLE[1] = {{
static herr_t
H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t UNUSED space_id)
{
- unsigned flags; /* Filter flags */
- size_t cd_nelmts=H5Z_SHUFFLE_USER_NPARMS; /* Number of filter parameters */
+ H5P_genplist_t *dcpl_plist; /* Property list pointer */
+ const H5T_t *type; /* Datatype */
+ unsigned flags; /* Filter flags */
+ size_t cd_nelmts = H5Z_SHUFFLE_USER_NPARMS; /* Number of filter parameters */
unsigned cd_values[H5Z_SHUFFLE_TOTAL_NPARMS]; /* Filter parameters */
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5Z_set_local_shuffle, FAIL)
+ /* Get the plist structure */
+ if(NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Get datatype */
+ if(NULL == (type = H5I_object_verify(type_id, H5I_DATATYPE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+
/* Get the filter's current parameters */
-#ifdef H5_WANT_H5_V1_6_COMPAT
- if(H5Pget_filter_by_id(dcpl_id,H5Z_FILTER_SHUFFLE,&flags,&cd_nelmts, cd_values,0,NULL)<0)
-#else
- if(H5Pget_filter_by_id(dcpl_id,H5Z_FILTER_SHUFFLE,&flags,&cd_nelmts, cd_values,(size_t)0,NULL,NULL)<0)
-#endif
+ if(H5P_get_filter_by_id(dcpl_plist, H5Z_FILTER_SHUFFLE, &flags, &cd_nelmts, cd_values, (size_t)0, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get shuffle parameters")
/* Set "local" parameter for this dataset */
- if((cd_values[H5Z_SHUFFLE_PARM_SIZE]=(unsigned)H5Tget_size(type_id))==0)
+ if((cd_values[H5Z_SHUFFLE_PARM_SIZE] = (unsigned)H5T_get_size(type)) == 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size")
/* Modify the filter's parameters for this dataset */
- if(H5Pmodify_filter(dcpl_id, H5Z_FILTER_SHUFFLE, flags, (size_t)H5Z_SHUFFLE_TOTAL_NPARMS, cd_values)<0)
+ if(H5P_modify_filter(dcpl_plist, H5Z_FILTER_SHUFFLE, flags, (size_t)H5Z_SHUFFLE_TOTAL_NPARMS, cd_values) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local shuffle parameters")
done: