From b6382ed60d918fd3d16dd61fe1a3eec906c6363d Mon Sep 17 00:00:00 2001 From: Matt L <124107509+mattjala@users.noreply.github.com> Date: Tue, 17 Dec 2024 07:52:46 -0600 Subject: [PATCH] Prevent H5Pset* routines from modifying default plists (#5172) * Prevent H5Pset_vol from changing default VOL * Prevent public routines from modifying default plists * Allow default backing FAPL for onion VFD * Require FAPL in H5Pset_vol() * Merge into existing H5P tests --- src/H5FDcore.c | 8 +-- src/H5FDdirect.c | 6 +- src/H5FDfamily.c | 6 +- src/H5FDhdfs.c | 4 +- src/H5FDlog.c | 4 +- src/H5FDmirror.c | 4 +- src/H5FDmpio.c | 18 +++--- src/H5FDonion.c | 10 ++-- src/H5FDros3.c | 11 ++-- src/H5FDsec2.c | 2 +- src/H5FDsplitter.c | 2 +- src/H5FDsubfiling/H5FDioc.c | 6 +- src/H5FDsubfiling/H5FDsubfiling.c | 9 +-- src/H5FDsubfiling/H5subfiling_common.c | 2 +- src/H5FDwindows.c | 2 +- src/H5Fmpi.c | 2 +- src/H5Lexternal.c | 4 +- src/H5Pdapl.c | 24 ++++---- src/H5Pdcpl.c | 50 ++++++++-------- src/H5Pdeprec.c | 2 +- src/H5Pdxpl.c | 52 ++++++++--------- src/H5Pfapl.c | 80 +++++++++++++------------- src/H5Pfcpl.c | 36 ++++++------ src/H5Pgcpl.c | 16 +++--- src/H5Pint.c | 43 +++++++++++++- src/H5Plapl.c | 28 ++++----- src/H5Plcpl.c | 4 +- src/H5Pmapl.c | 4 +- src/H5Pocpl.c | 34 +++++------ src/H5Pocpypl.c | 12 ++-- src/H5Pprivate.h | 3 +- src/H5Pstrcpl.c | 4 +- src/H5VLnative_attr.c | 4 +- src/H5VLnative_dataset.c | 2 +- src/H5Z.c | 2 +- src/H5Znbit.c | 2 +- src/H5Zscaleoffset.c | 2 +- src/H5Zshuffle.c | 2 +- src/H5Zszip.c | 2 +- test/tgenprop.c | 76 ++++++++++++++++++++++++ 40 files changed, 350 insertions(+), 234 deletions(-) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index a48a31416f2..fd50dcc7af0 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -525,7 +525,7 @@ H5Pset_core_write_tracking(hid_t plist_id, hbool_t is_enabled, size_t page_size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "page_size cannot be zero"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_PLIST, H5E_BADID, FAIL, "can't find object for ID"); if (H5FD_CORE != H5P_peek_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); @@ -568,7 +568,7 @@ H5Pget_core_write_tracking(hid_t plist_id, hbool_t *is_enabled /*out*/, size_t * H5TRACE3("e", "ixx", plist_id, is_enabled, page_size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_PLIST, H5E_BADID, FAIL, "can't find object for ID"); if (H5FD_CORE != H5P_peek_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); @@ -607,7 +607,7 @@ H5Pset_fapl_core(hid_t fapl_id, size_t increment, hbool_t backing_store) H5TRACE3("e", "izb", fapl_id, increment, backing_store); /* Check argument */ - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); /* Set VFD info values */ @@ -644,7 +644,7 @@ H5Pget_fapl_core(hid_t fapl_id, size_t *increment /*out*/, hbool_t *backing_stor FUNC_ENTER_API(FAIL) H5TRACE3("e", "ixx", fapl_id, increment, backing_store); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5FD_CORE != H5P_peek_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 30a3c90ab79..05804e78842 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -265,7 +265,7 @@ H5Pset_fapl_direct(hid_t fapl_id, size_t boundary, size_t block_size, size_t cbu FUNC_ENTER_API(FAIL) H5TRACE4("e", "izzz", fapl_id, boundary, block_size, cbuf_size); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5FD__direct_populate_config(boundary, block_size, cbuf_size, &fa) < 0) @@ -300,7 +300,7 @@ H5Pget_fapl_direct(hid_t fapl_id, size_t *boundary /*out*/, size_t *block_size / FUNC_ENTER_API(FAIL) H5TRACE4("e", "ixxx", fapl_id, boundary, block_size, cbuf_size); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list"); if (H5FD_DIRECT != H5P_peek_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); @@ -486,7 +486,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct"); /* Get the driver specific information */ - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list"); if (NULL == (fa = (const H5FD_direct_fapl_t *)H5P_peek_driver_info(plist))) { if (H5FD__direct_populate_config(0, 0, 0, &default_fa) < 0) diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index a26e3816332..46b12d76f45 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -384,7 +384,7 @@ H5Pget_fapl_family(hid_t fapl_id, hsize_t *msize /*out*/, hid_t *memb_fapl_id /* FUNC_ENTER_API(FAIL) H5TRACE3("e", "ixx", fapl_id, msize, memb_fapl_id); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list"); if (H5FD_FAMILY != H5P_peek_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); @@ -1135,8 +1135,8 @@ H5FD__family_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle) FUNC_ENTER_PACKAGE /* Get the plist structure and family offset */ - if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS))) - HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); + if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS, true))) + HGOTO_ERROR(H5E_VFL, H5E_BADID, FAIL, "can't find object for ID"); if (H5P_get(plist, H5F_ACS_FAMILY_OFFSET_NAME, &offset) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get offset for family driver"); diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c index 7dcd1947ba7..19e8af366ff 100644 --- a/src/H5FDhdfs.c +++ b/src/H5FDhdfs.c @@ -568,7 +568,7 @@ H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa) fprintf(stdout, "called %s.\n", __func__); #endif - plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); + plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false); if (plist == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (FAIL == H5FD__hdfs_validate_config(fa)) @@ -608,7 +608,7 @@ H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_dst /*out*/) if (fa_dst == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_dst ptr is NULL"); - plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); + plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true); if (plist == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list"); diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 660f266d2b6..81f2cccb329 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -307,7 +307,7 @@ H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned long long flags, si memset(&fa, 0, sizeof(H5FD_log_fapl_t)); /* Check arguments */ - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); /* Duplicate the log file string @@ -483,7 +483,7 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) o_flags |= O_EXCL; /* Get the driver specific information */ - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list"); if (NULL == (fa = (const H5FD_log_fapl_t *)H5P_peek_driver_info(plist))) { /* Use default driver configuration*/ diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c index 1130fac8c2d..29e3fa2b0f7 100644 --- a/src/H5FDmirror.c +++ b/src/H5FDmirror.c @@ -1270,7 +1270,7 @@ H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_dst /*out*/) if (NULL == fa_dst) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_dst is NULL"); - plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); + plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true); if (NULL == plist) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5P_peek_driver(plist) != H5FD_MIRROR) @@ -1308,7 +1308,7 @@ H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa) LOG_OP_CALL(__func__); - plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); + plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false); if (NULL == plist) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (NULL == fa) diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index aa83be4a5bb..0c5be328ceb 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -392,7 +392,7 @@ H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info) /* Check arguments */ if (fapl_id == H5P_DEFAULT) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list"); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list"); if (MPI_COMM_NULL == comm) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "MPI_COMM_NULL is not a valid communicator"); @@ -446,7 +446,7 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm /*out*/, MPI_Info *info /*out*/) *info = MPI_INFO_NULL; /* Check arguments */ - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list"); if (H5FD_MPIO != H5P_peek_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "VFL driver is not MPI-I/O"); @@ -506,7 +506,7 @@ H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode) /* Check arguments */ if (dxpl_id == H5P_DEFAULT) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list"); - if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl"); if (H5FD_MPIO_INDEPENDENT != xfer_mode && H5FD_MPIO_COLLECTIVE != xfer_mode) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "incorrect xfer_mode"); @@ -542,7 +542,7 @@ H5Pget_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode /*out*/) H5TRACE2("e", "ix", dxpl_id, xfer_mode); /* Check arguments */ - if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl"); /* Get the transfer mode */ @@ -582,7 +582,7 @@ H5Pset_dxpl_mpio_collective_opt(hid_t dxpl_id, H5FD_mpio_collective_opt_t opt_mo /* Check arguments */ if (dxpl_id == H5P_DEFAULT) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list"); - if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl"); /* Set the transfer mode */ @@ -621,7 +621,7 @@ H5Pset_dxpl_mpio_chunk_opt(hid_t dxpl_id, H5FD_mpio_chunk_opt_t opt_mode) /* Check arguments */ if (dxpl_id == H5P_DEFAULT) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list"); - if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl"); /* Set the transfer mode */ @@ -658,7 +658,7 @@ H5Pset_dxpl_mpio_chunk_opt_num(hid_t dxpl_id, unsigned num_chunk_per_proc) /* Check arguments */ if (dxpl_id == H5P_DEFAULT) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list"); - if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl"); /* Set the transfer mode */ @@ -698,7 +698,7 @@ H5Pset_dxpl_mpio_chunk_opt_ratio(hid_t dxpl_id, unsigned percent_num_proc_per_ch /* Check arguments */ if (dxpl_id == H5P_DEFAULT) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list"); - if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl"); /* Set the transfer mode */ @@ -831,7 +831,7 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR FUNC_ENTER_PACKAGE /* Get a pointer to the fapl */ - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list"); if (H5FD_mpi_self_initialized) { diff --git a/src/H5FDonion.c b/src/H5FDonion.c index dcec22197b3..59722cf074e 100644 --- a/src/H5FDonion.c +++ b/src/H5FDonion.c @@ -286,7 +286,7 @@ H5Pget_fapl_onion(hid_t fapl_id, H5FD_onion_fapl_info_t *fa_out) if (NULL == fa_out) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL info-out pointer"); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Not a valid FAPL ID"); if (H5FD_ONION != H5P_peek_driver(plist)) @@ -325,7 +325,7 @@ H5Pset_fapl_onion(hid_t fapl_id, const H5FD_onion_fapl_info_t *fa) FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*!", fapl_id, fa); - if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Not a valid FAPL ID"); if (NULL == fa) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL info pointer"); @@ -337,11 +337,11 @@ H5Pset_fapl_onion(hid_t fapl_id, const H5FD_onion_fapl_info_t *fa) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info page size"); if (H5P_DEFAULT == fa->backing_fapl_id) { - if (NULL == (backing_fapl = H5P_object_verify(H5P_FILE_ACCESS_DEFAULT, H5P_FILE_ACCESS))) + if (NULL == (backing_fapl = H5P_object_verify(H5P_FILE_ACCESS_DEFAULT, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid backing fapl id"); } else { - if (NULL == (backing_fapl = H5P_object_verify(fa->backing_fapl_id, H5P_FILE_ACCESS))) + if (NULL == (backing_fapl = H5P_object_verify(fa->backing_fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid backing fapl id"); } @@ -1676,7 +1676,7 @@ H5FDonion_get_revision_count(const char *filename, hid_t fapl_id, uint64_t *revi HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "revision count can't be null"); /* Make sure using the correct driver */ - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid FAPL ID"); if (H5FD_ONION != H5P_peek_driver(plist)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a Onion VFL driver"); diff --git a/src/H5FDros3.c b/src/H5FDros3.c index c6414af9b40..190074aa54a 100644 --- a/src/H5FDros3.c +++ b/src/H5FDros3.c @@ -380,7 +380,7 @@ H5Pset_fapl_ros3(hid_t fapl_id, const H5FD_ros3_fapl_t *fa) fprintf(stdout, "H5Pset_fapl_ros3() called.\n"); #endif - plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); + plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false); if (plist == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); @@ -460,7 +460,7 @@ H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_dst /*out*/) if (fa_dst == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_dst is NULL"); - plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); + plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true); if (plist == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list"); @@ -611,7 +611,7 @@ H5Pget_fapl_ros3_token(hid_t fapl_id, size_t size, char *token_dst /*out*/) if (token_dst == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "token_dst is NULL"); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5FD_ROS3 != H5P_peek_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); @@ -794,7 +794,7 @@ H5Pset_fapl_ros3_token(hid_t fapl_id, const char *token) if (fapl_id == H5P_DEFAULT) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list"); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5FD_ROS3 != H5P_peek_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); @@ -937,7 +937,6 @@ H5FD__ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr"); if (flags != H5F_ACC_RDONLY) HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, "only Read-Only access allowed"); - if (FAIL == H5Pget_fapl_ros3(fapl_id, &fa)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't get property list"); @@ -945,7 +944,7 @@ H5FD__ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to initialize curl global (placeholder flags)"); /* Session/security token */ - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, NULL, "not a file access property list"); if ((token_exists = H5P_exist_plist(plist, ROS3_TOKEN_PROP_NAME)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "failed to check if property token exists in plist"); diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index a964a6970c6..680b880f2c4 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -261,7 +261,7 @@ H5Pset_fapl_sec2(hid_t fapl_id) FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", fapl_id); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); ret_value = H5P_set_driver(plist, H5FD_SEC2, NULL, NULL); diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index cf893f31e90..bcd092268f2 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -354,7 +354,7 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config /*out*/) config->wo_fapl_id = H5I_INVALID_HID; /* Check and get the splitter fapl */ - if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); diff --git a/src/H5FDsubfiling/H5FDioc.c b/src/H5FDsubfiling/H5FDioc.c index 81ad0e70f82..df650c803e7 100644 --- a/src/H5FDsubfiling/H5FDioc.c +++ b/src/H5FDsubfiling/H5FDioc.c @@ -328,7 +328,7 @@ H5Pset_fapl_ioc(hid_t fapl_id, H5FD_ioc_config_t *vfd_config) H5FD_IOC_LOG_CALL(__func__); - if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (vfd_config == NULL) { @@ -382,7 +382,7 @@ H5Pget_fapl_ioc(hid_t fapl_id, H5FD_ioc_config_t *config_out) if (config_out == NULL) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_out is NULL"); - if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5FD_IOC != H5P_peek_driver(plist_ptr)) @@ -1452,7 +1452,7 @@ H5FD__ioc_del(const char *name, hid_t fapl) * out of sync */ - if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS, true))) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); assert(H5FD_IOC == H5P_peek_driver(plist)); diff --git a/src/H5FDsubfiling/H5FDsubfiling.c b/src/H5FDsubfiling/H5FDsubfiling.c index 6a04f68ee46..58be60c4e00 100644 --- a/src/H5FDsubfiling/H5FDsubfiling.c +++ b/src/H5FDsubfiling/H5FDsubfiling.c @@ -454,7 +454,7 @@ H5Pset_fapl_subfiling(hid_t fapl_id, const H5FD_subfiling_config_t *vfd_config) if (H5FD_subfiling_init() < 0) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "can't initialize subfiling VFD"); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (vfd_config == NULL) { @@ -480,7 +480,7 @@ H5Pset_fapl_subfiling(hid_t fapl_id, const H5FD_subfiling_config_t *vfd_config) comm = MPI_COMM_WORLD; /* Set MPI parameters on IOC FAPL */ - if (NULL == (ioc_plist = H5P_object_verify(vfd_config->ioc_fapl_id, H5P_FILE_ACCESS))) + if (NULL == (ioc_plist = H5P_object_verify(vfd_config->ioc_fapl_id, H5P_FILE_ACCESS, false))) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5P_set(ioc_plist, H5F_ACS_MPI_PARAMS_COMM_NAME, &comm) < 0) H5_SUBFILING_GOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI communicator on plist"); @@ -535,7 +535,7 @@ H5Pget_fapl_subfiling(hid_t fapl_id, H5FD_subfiling_config_t *config_out) if (config_out == NULL) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_out is NULL"); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5FD_SUBFILING != H5P_peek_driver(plist)) @@ -2471,7 +2471,8 @@ H5FD__subfiling_del(const char *name, hid_t fapl) H5P_genplist_t *plist = NULL; herr_t ret_value = SUCCEED; - if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS))) + + if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS, true))) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5FD_SUBFILING != H5P_peek_driver(plist)) diff --git a/src/H5FDsubfiling/H5subfiling_common.c b/src/H5FDsubfiling/H5subfiling_common.c index 63791c14c99..8158042b246 100644 --- a/src/H5FDsubfiling/H5subfiling_common.c +++ b/src/H5FDsubfiling/H5subfiling_common.c @@ -541,7 +541,7 @@ H5_open_subfiling_stub_file(const char *name, unsigned flags, MPI_Comm file_comm if ((fapl_id = H5P_create_id(H5P_CLS_FILE_ACCESS_g, FALSE)) < 0) H5_SUBFILING_GOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't create FAPL for stub file"); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) H5_SUBFILING_GOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access property list"); /* Use MPI I/O driver for stub file to allow access to vector I/O */ diff --git a/src/H5FDwindows.c b/src/H5FDwindows.c index e38a4d31b68..be6481f17c9 100644 --- a/src/H5FDwindows.c +++ b/src/H5FDwindows.c @@ -49,7 +49,7 @@ H5Pset_fapl_windows(hid_t fapl_id) FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", fapl_id); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); ret_value = H5P_set_driver(plist, H5FD_WINDOWS, NULL, NULL); diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 6786e07c064..3fb28c94936 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -371,7 +371,7 @@ H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm) unsigned long driver_feat_flags; H5FD_class_t *driver_class = NULL; - if (NULL == (plist = H5P_object_verify(acspl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(acspl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "not a file access list"); if (H5P_peek(plist, H5F_ACS_FILE_DRV_NAME, &driver_prop) < 0) diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index d7edbad0e17..bd6e27129e9 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -136,7 +136,7 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, cons obj_name = (const char *)p + fname_len + 1; /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) + if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, H5I_INVALID_HID, "can't find object for ID"); /* Get the fapl_id set for lapl_id if any */ @@ -164,7 +164,7 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, cons HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5I_INVALID_HID, "can't get elink callback info"); /* Get file access property list */ - if (NULL == (fa_plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (fa_plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, H5I_INVALID_HID, "can't find object for ID"); /* Make callback if it exists */ diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 1167fabddfa..1ec41adb92a 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -772,7 +772,7 @@ H5Pset_chunk_cache(hid_t dapl_id, size_t rdcc_nslots, size_t rdcc_nbytes, double "raw data cache w0 value must be between 0.0 and 1.0 inclusive, or H5D_CHUNK_CACHE_W0_DEFAULT"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS))) + if (NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set sizes */ @@ -813,7 +813,7 @@ H5Pget_chunk_cache(hid_t dapl_id, size_t *rdcc_nslots /*out*/, size_t *rdcc_nbyt H5TRACE4("e", "ixxx", dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS))) + if (NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get default file access plist */ @@ -1079,7 +1079,7 @@ H5Pset_virtual_view(hid_t plist_id, H5D_vds_view_t view) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid bounds option"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Update property list */ @@ -1111,7 +1111,7 @@ H5Pget_virtual_view(hid_t plist_id, H5D_vds_view_t *view /*out*/) H5TRACE2("e", "ix", plist_id, view); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value from property list */ @@ -1221,7 +1221,7 @@ H5Pset_virtual_printf_gap(hid_t plist_id, hsize_t gap_size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid printf gap size"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Update property list */ @@ -1254,7 +1254,7 @@ H5Pget_virtual_printf_gap(hid_t plist_id, hsize_t *gap_size /*out*/) H5TRACE2("e", "ix", plist_id, gap_size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value from property list */ @@ -1307,7 +1307,7 @@ H5Pset_append_flush(hid_t plist_id, unsigned ndims, const hsize_t *boundary, H5D HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback is NULL while user data is not"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set up values */ @@ -1356,7 +1356,7 @@ H5Pget_append_flush(hid_t plist_id, unsigned ndims, hsize_t boundary[], H5D_appe H5TRACE5("e", "iIu*hxx", plist_id, ndims, boundary, func, udata); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Retrieve info for append flush */ @@ -1406,7 +1406,7 @@ H5Pset_efile_prefix(hid_t plist_id, const char *prefix) H5TRACE2("e", "i*s", plist_id, prefix); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set prefix */ @@ -1439,7 +1439,7 @@ H5Pget_efile_prefix(hid_t plist_id, char *prefix /*out*/, size_t size) H5TRACE3("Zs", "ixz", plist_id, prefix, size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the current prefix */ @@ -1494,7 +1494,7 @@ H5Pset_virtual_prefix(hid_t plist_id, const char *prefix) H5TRACE2("e", "i*s", plist_id, prefix); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set prefix */ @@ -1529,7 +1529,7 @@ H5Pget_virtual_prefix(hid_t plist_id, char *prefix /*out*/, size_t size) H5TRACE3("Zs", "ixz", plist_id, prefix, size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the current prefix */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 5254f6db0d2..e023f5798f4 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1825,7 +1825,7 @@ H5Pset_layout(hid_t plist_id, H5D_layout_t layout_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "raw data layout method is not valid"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get pointer to correct default layout */ @@ -1882,7 +1882,7 @@ H5Pget_layout(hid_t plist_id) H5TRACE1("Dl", "i", plist_id); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, H5D_LAYOUT_ERROR, "can't find object for ID"); /* Peek at layout property */ @@ -1946,7 +1946,7 @@ H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]) } /* end for */ /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set chunk information in property list */ @@ -1983,7 +1983,7 @@ H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[] /*out*/) H5TRACE3("Is", "iIsx", plist_id, max_ndims, dim); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Peek at the layout property */ @@ -2056,7 +2056,7 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, const HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "invalid mapping selections"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the current layout */ @@ -2207,7 +2207,7 @@ H5Pget_virtual_count(hid_t dcpl_id, size_t *count /*out*/) if (count) { /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Retrieve the layout property */ @@ -2249,7 +2249,7 @@ H5Pget_virtual_vspace(hid_t dcpl_id, size_t idx) H5TRACE2("i", "iz", dcpl_id, idx); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Retrieve the layout property */ @@ -2303,7 +2303,7 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t idx) H5TRACE2("i", "iz", dcpl_id, idx); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Retrieve the layout property */ @@ -2403,7 +2403,7 @@ H5Pget_virtual_filename(hid_t dcpl_id, size_t idx, char *name /*out*/, size_t si H5TRACE4("Zs", "izxz", dcpl_id, idx, name, size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Retrieve the layout property */ @@ -2461,7 +2461,7 @@ H5Pget_virtual_dsetname(hid_t dcpl_id, size_t idx, char *name /*out*/, size_t si H5TRACE4("Zs", "izxz", dcpl_id, idx, name, size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Retrieve the layout property */ @@ -2509,7 +2509,7 @@ H5Pset_chunk_opts(hid_t plist_id, unsigned options) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "unknown chunk options"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Retrieve the layout property */ @@ -2557,7 +2557,7 @@ H5Pget_chunk_opts(hid_t plist_id, unsigned *options /*out*/) H5TRACE2("e", "ix", plist_id, options); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Retrieve the layout property */ @@ -2617,7 +2617,7 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "negative external file offset"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); if (H5P_peek(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) @@ -2679,7 +2679,7 @@ H5Pget_external_count(hid_t plist_id) H5TRACE1("Is", "i", plist_id); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value */ @@ -2726,7 +2726,7 @@ H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name /*out H5TRACE6("e", "iIuzxxx", plist_id, idx, name_size, name, offset, size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value */ @@ -2795,7 +2795,7 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is too large"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Always set K13 compression (and un-set CHIP compression) */ @@ -3002,7 +3002,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) H5TRACE3("e", "ii*x", plist_id, type_id, value); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the current fill value */ @@ -3185,7 +3185,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value /*out*/) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no fill value output buffer"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the fill value */ @@ -3285,7 +3285,7 @@ H5Pfill_value_defined(hid_t plist_id, H5D_fill_value_t *status) assert(status); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the fill-value status */ @@ -3323,7 +3323,7 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid allocation time setting"); /* Get the property list structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Check for resetting to default for layout type */ @@ -3407,7 +3407,7 @@ H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t *alloc_time /*out*/) H5O_fill_t fill; /* Fill value property to query */ /* Get the property list structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Retrieve fill value settings */ @@ -3447,7 +3447,7 @@ H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fill time setting"); /* Get the property list structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Retrieve previous fill value settings */ @@ -3489,7 +3489,7 @@ H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t *fill_time /*out*/) H5O_fill_t fill; /* Fill value property to query */ /* Get the property list structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Retrieve fill value settings */ @@ -3532,7 +3532,7 @@ H5Pget_dset_no_attrs_hint(hid_t dcpl_id, hbool_t *minimize /*out*/) if (NULL == minimize) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "receiving pointer cannot be NULL"); - plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE); + plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE, true); if (NULL == plist) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); @@ -3570,7 +3570,7 @@ H5Pset_dset_no_attrs_hint(hid_t dcpl_id, hbool_t minimize) FUNC_ENTER_API(FAIL) H5TRACE2("e", "ib", dcpl_id, minimize); - plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE); + plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE, false); if (NULL == plist) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c index 5c4e9629b5a..368decc348e 100644 --- a/src/H5Pdeprec.c +++ b/src/H5Pdeprec.c @@ -452,7 +452,7 @@ H5Pget_version(hid_t plist_id, unsigned *super /*out*/, unsigned *freelist /*out H5TRACE5("e", "ixxxx", plist_id, super, freelist, stab, shhdr); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get values */ diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 6babaf92da0..6b6a97bb6ed 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -966,7 +966,7 @@ H5Pset_data_transform(hid_t plist_id, const char *expression) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "expression cannot be NULL"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* See if a data transform is already set, and free it if it is */ @@ -1025,7 +1025,7 @@ H5Pget_data_transform(hid_t plist_id, char *expression /*out*/, size_t size) H5TRACE3("Zs", "ixz", plist_id, expression, size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); if (H5P_peek(plist, H5D_XFER_XFORM_NAME, &data_xform_prop) < 0) @@ -1084,7 +1084,7 @@ H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "buffer size must not be zero"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Update property list */ @@ -1121,7 +1121,7 @@ H5Pget_buffer(hid_t plist_id, void **tconv /*out*/, void **bkg /*out*/) H5TRACE3("z", "ixx", plist_id, tconv, bkg); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, 0, "can't find object for ID"); /* Return values */ @@ -1167,7 +1167,7 @@ H5Pset_preserve(hid_t plist_id, hbool_t status) H5TRACE2("e", "ib", plist_id, status); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Update property list */ @@ -1201,7 +1201,7 @@ H5Pget_preserve(hid_t plist_id) H5TRACE1("Is", "i", plist_id); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value */ @@ -1241,7 +1241,7 @@ H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid value"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Update property list */ @@ -1274,7 +1274,7 @@ H5Pget_edc_check(hid_t plist_id) H5TRACE1("Ze", "i", plist_id); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, H5Z_ERROR_EDC, "can't find object for ID"); /* Update property list */ @@ -1307,7 +1307,7 @@ H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void *op_data) H5TRACE3("e", "iZF*x", plist_id, func, op_data); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Update property list */ @@ -1343,7 +1343,7 @@ H5Pset_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t op, void *operate_dat H5TRACE3("e", "iTE*x", plist_id, op, operate_data); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Update property list */ @@ -1379,7 +1379,7 @@ H5Pget_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t *op /*out*/, void **o H5TRACE3("e", "ixx", plist_id, op, operate_data); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get property */ @@ -1417,7 +1417,7 @@ H5Pget_btree_ratios(hid_t plist_id, double *left /*out*/, double *middle /*out*/ H5TRACE4("e", "ixxx", plist_id, left, middle, right); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the split ratios */ @@ -1468,7 +1468,7 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle, double right) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0 <= X <= 1.0"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set values */ @@ -1551,7 +1551,7 @@ H5Pset_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t alloc_func, void *alloc_ H5TRACE5("e", "iMa*xMf*x", plist_id, alloc_func, alloc_info, free_func, free_info); /* Check arguments */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); /* Update property list */ @@ -1582,7 +1582,7 @@ H5Pget_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t *alloc_func /*out*/, voi H5TRACE5("e", "ixxxx", plist_id, alloc_func, alloc_info, free_func, free_info); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); if (alloc_func) @@ -1634,7 +1634,7 @@ H5Pset_hyper_vector_size(hid_t plist_id, size_t vector_size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "vector size too small"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Update property list */ @@ -1664,7 +1664,7 @@ H5Pget_hyper_vector_size(hid_t plist_id, size_t *vector_size /*out*/) H5TRACE2("e", "ix", plist_id, vector_size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Return values */ @@ -1896,7 +1896,7 @@ H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, H5TRACE2("e", "ix", plist_id, actual_chunk_opt_mode); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Return values */ @@ -1928,7 +1928,7 @@ H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_ H5TRACE2("e", "ix", plist_id, actual_io_mode); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Return values */ @@ -1960,7 +1960,7 @@ H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_ca H5TRACE3("e", "ixx", plist_id, local_no_collective_cause, global_no_collective_cause); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Return values */ @@ -2281,7 +2281,7 @@ H5Pset_dataset_io_hyperslab_selection(hid_t plist_id, unsigned rank, H5S_seloper /* block is allowed to be NULL, and will be assumed to be all '1's when NULL */ /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* See if a dataset I/O selection is already set, and free it if it is */ @@ -2378,7 +2378,7 @@ H5Pset_selection_io(hid_t plist_id, H5D_selection_io_mode_t selection_io_mode) if (plist_id == H5P_DEFAULT) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list"); - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl"); /* Set the selection I/O mode */ @@ -2413,7 +2413,7 @@ H5Pget_selection_io(hid_t plist_id, H5D_selection_io_mode_t *selection_io_mode / H5TRACE2("e", "ix", plist_id, selection_io_mode); /* Check arguments */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl"); /* Get the selection I/O mode */ @@ -2444,7 +2444,7 @@ H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selection_io_cause /*o H5TRACE2("e", "ix", plist_id, no_selection_io_cause); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Return values */ @@ -2545,7 +2545,7 @@ H5Pset_modify_write_buf(hid_t plist_id, hbool_t modify_write_buf) if (plist_id == H5P_DEFAULT) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list"); - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, false))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl"); /* Set the selection I/O mode */ @@ -2576,7 +2576,7 @@ H5Pget_modify_write_buf(hid_t plist_id, hbool_t *modify_write_buf /*out*/) H5TRACE2("e", "ix", plist_id, modify_write_buf); /* Check arguments */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl"); /* Get the selection I/O mode */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 61ed1c566d8..785009ceb03 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -1076,7 +1076,7 @@ H5Pset_alignment(hid_t fapl_id, hsize_t threshold, hsize_t alignment) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "alignment must be positive"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set values */ @@ -1110,7 +1110,7 @@ H5Pget_alignment(hid_t fapl_id, hsize_t *threshold /*out*/, hsize_t *alignment / H5TRACE3("e", "ixx", fapl_id, threshold, alignment); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get values */ @@ -1612,7 +1612,7 @@ H5Pget_driver_config_str(hid_t fapl_id, char *config_buf, size_t buf_size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "config_buf cannot be NULL if buf_size is non-zero"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, (-1), "can't find object for ID"); /* Retrieve configuration string property */ @@ -1999,7 +1999,7 @@ H5Pset_family_offset(hid_t fapl_id, hsize_t offset) /* Get the plist structure */ if (H5P_DEFAULT == fapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list"); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set value */ @@ -2034,7 +2034,7 @@ H5Pget_family_offset(hid_t fapl_id, hsize_t *offset /*out*/) /* Get the plist structure */ if (H5P_DEFAULT == fapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list"); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value */ @@ -2071,7 +2071,7 @@ H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type) /* Get the plist structure */ if (H5P_DEFAULT == fapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list"); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set value */ @@ -2106,7 +2106,7 @@ H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type /*out*/) /* Get the plist structure */ if (H5P_DEFAULT == fapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list"); - if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value */ @@ -2154,7 +2154,7 @@ H5Pset_cache(hid_t plist_id, int H5_ATTR_UNUSED mdc_nelmts, size_t rdcc_nslots, "raw data cache w0 value must be between 0.0 and 1.0 inclusive"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set sizes */ @@ -2193,7 +2193,7 @@ H5Pget_cache(hid_t plist_id, int *mdc_nelmts, size_t *rdcc_nslots /*out*/, size_ H5TRACE5("e", "i*Isxxx", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, rdcc_w0); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get sizes */ @@ -2236,7 +2236,7 @@ H5Pset_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr) H5TRACE2("e", "i*CC", plist_id, config_ptr); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* validate the new configuration */ @@ -2280,7 +2280,7 @@ H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config /*out* H5TRACE2("e", "ix", plist_id, config); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* validate the config ptr */ @@ -2322,7 +2322,7 @@ H5Pset_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) H5TRACE2("e", "i*Cc", plist_id, config_ptr); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* validate the new configuration */ @@ -2366,7 +2366,7 @@ H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config /*out*/) H5TRACE2("e", "ix", plist_id, config); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* validate the config ptr */ @@ -2419,7 +2419,7 @@ H5Pset_gc_references(hid_t plist_id, unsigned gc_ref) H5TRACE2("e", "iIu", plist_id, gc_ref); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set values */ @@ -2450,7 +2450,7 @@ H5Pget_gc_references(hid_t plist_id, unsigned *gc_ref /*out*/) H5TRACE2("e", "ix", plist_id, gc_ref); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get values */ @@ -2481,7 +2481,7 @@ H5Pset_fclose_degree(hid_t plist_id, H5F_close_degree_t degree) H5TRACE2("e", "iFd", plist_id, degree); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set values */ @@ -2511,7 +2511,7 @@ H5Pget_fclose_degree(hid_t plist_id, H5F_close_degree_t *degree /*out*/) H5TRACE2("e", "ix", plist_id, degree); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); if (degree && H5P_get(plist, H5F_ACS_CLOSE_DEGREE_NAME, degree) < 0) @@ -2550,7 +2550,7 @@ H5Pset_meta_block_size(hid_t plist_id, hsize_t size) H5TRACE2("e", "ih", plist_id, size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set values */ @@ -2581,7 +2581,7 @@ H5Pget_meta_block_size(hid_t plist_id, hsize_t *size /*out*/) H5TRACE2("e", "ix", plist_id, size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get values */ @@ -2623,7 +2623,7 @@ H5Pset_sieve_buf_size(hid_t plist_id, size_t size) H5TRACE2("e", "iz", plist_id, size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set values */ @@ -2654,7 +2654,7 @@ H5Pget_sieve_buf_size(hid_t plist_id, size_t *size /*out*/) H5TRACE2("e", "ix", plist_id, size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get values */ @@ -2695,7 +2695,7 @@ H5Pset_small_data_block_size(hid_t plist_id, hsize_t size) H5TRACE2("e", "ih", plist_id, size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set values */ @@ -2726,7 +2726,7 @@ H5Pget_small_data_block_size(hid_t plist_id, hsize_t *size /*out*/) H5TRACE2("e", "ix", plist_id, size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get values */ @@ -2864,7 +2864,7 @@ H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, H5F_libver_t high) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid (low,high) combination of library version bound"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set values */ @@ -2896,7 +2896,7 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low /*out*/, H5F_libver_t *hi H5TRACE3("e", "ixx", plist_id, low, high); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get values */ @@ -2935,7 +2935,7 @@ H5Pset_elink_file_cache_size(hid_t plist_id, unsigned efc_size) H5TRACE2("e", "iIu", plist_id, efc_size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set value */ @@ -2969,7 +2969,7 @@ H5Pget_elink_file_cache_size(hid_t plist_id, unsigned *efc_size /*out*/) H5TRACE2("e", "ix", plist_id, efc_size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value */ @@ -3006,7 +3006,7 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "inconsistent buf_ptr and buf_len"); /* Get the plist structure */ - if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get old image info */ @@ -3096,7 +3096,7 @@ H5Pget_file_image(hid_t fapl_id, void **buf /*out*/, size_t *buf_len /*out*/) H5TRACE3("e", "ixx", fapl_id, buf, buf_len); /* Get the plist structure */ - if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get values */ @@ -3168,7 +3168,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback H5TRACE2("e", "i*DI", fapl_id, callbacks_ptr); /* Get the plist structure */ - if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get old info */ @@ -3241,7 +3241,7 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback H5TRACE2("e", "ix", fapl_id, callbacks); /* Get the plist structure */ - if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get old info */ @@ -4406,7 +4406,7 @@ H5Pset_metadata_read_attempts(hid_t plist_id, unsigned attempts) "number of metadatata read attempts must be greater than 0"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set values */ @@ -4439,7 +4439,7 @@ H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts /*out*/) H5P_genplist_t *plist; /* Property list pointer */ /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the # of read attempts set */ @@ -4481,7 +4481,7 @@ H5Pset_object_flush_cb(hid_t plist_id, H5F_flush_cb_t func, void *udata) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback is NULL while user data is not"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Update property list */ @@ -4517,7 +4517,7 @@ H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func /*out*/, void **udat H5TRACE3("e", "ixx", plist_id, func, udata); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Retrieve the callback function and user data */ @@ -4560,7 +4560,7 @@ H5Pset_mdc_log_options(hid_t plist_id, hbool_t is_enabled, const char *location, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "location cannot be NULL"); /* Get the property list structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "plist_id is not a file access property list"); /* Make a copy of the passed-in location */ @@ -4600,7 +4600,7 @@ H5Pget_mdc_log_options(hid_t plist_id, hbool_t *is_enabled /*out*/, char *locati H5TRACE5("e", "ixxxx", plist_id, is_enabled, location, location_size, start_on_access); /* Get the property list structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "plist_id is not a file access property list"); /* Get simple values */ @@ -5705,7 +5705,7 @@ H5Pset_page_buffer_size(hid_t plist_id, size_t buf_size, unsigned min_meta_perc, H5TRACE4("e", "izIuIu", plist_id, buf_size, min_meta_perc, min_raw_perc); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); if (min_meta_perc > 100) @@ -5751,7 +5751,7 @@ H5Pget_page_buffer_size(hid_t plist_id, size_t *buf_size /*out*/, unsigned *min_ H5TRACE4("e", "ixxx", plist_id, buf_size, min_meta_perc, min_raw_perc); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get size */ @@ -5864,7 +5864,7 @@ H5Pset_vol(hid_t plist_id, hid_t new_vol_id, const void *new_vol_info) H5TRACE3("e", "ii*x", plist_id, new_vol_id, new_vol_info); /* Check arguments */ - if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) + if (NULL == (plist = (H5P_genplist_t *)H5P_object_verify(plist_id, H5P_FILE_ACCESS, false))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); if (plist_id == H5P_FILE_ACCESS_DEFAULT || plist_id == H5P_DEFAULT) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't set VOL connector in default property list"); diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index 9c14add1b9a..68bc5d73312 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -331,7 +331,7 @@ H5Pset_userblock(hid_t plist_id, hsize_t size) } /* end if */ /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set value */ @@ -364,7 +364,7 @@ H5Pget_userblock(hid_t plist_id, hsize_t *size /*out*/) H5TRACE2("e", "ix", plist_id, size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value */ @@ -407,7 +407,7 @@ H5Pset_sizes(hid_t plist_id, size_t sizeof_addr, size_t sizeof_size) } /* end if */ /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set value */ @@ -450,7 +450,7 @@ H5Pget_sizes(hid_t plist_id, size_t *sizeof_addr /*out*/, size_t *sizeof_size /* H5TRACE3("e", "ixx", plist_id, sizeof_addr, sizeof_size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get values */ @@ -506,7 +506,7 @@ H5Pset_sym_k(hid_t plist_id, unsigned ik, unsigned lk) H5TRACE3("e", "iIuIu", plist_id, ik, lk); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set values */ @@ -551,7 +551,7 @@ H5Pget_sym_k(hid_t plist_id, unsigned *ik /*out*/, unsigned *lk /*out*/) H5TRACE3("e", "ixx", plist_id, ik, lk); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get values */ @@ -597,7 +597,7 @@ H5Pset_istore_k(hid_t plist_id, unsigned ik) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "istore IK value exceeds maximum B-tree entries"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set value */ @@ -635,7 +635,7 @@ H5Pget_istore_k(hid_t plist_id, unsigned *ik /*out*/) H5TRACE2("e", "ix", plist_id, ik); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value */ @@ -763,7 +763,7 @@ H5Pset_shared_mesg_nindexes(hid_t plist_id, unsigned nindexes) "number of indexes is greater than H5O_SHMESG_MAX_NINDEXES"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); if (H5P_set(plist, H5F_CRT_SHMSG_NINDEXES_NAME, &nindexes) < 0) @@ -793,7 +793,7 @@ H5Pget_shared_mesg_nindexes(hid_t plist_id, unsigned *nindexes /*out*/) H5TRACE2("e", "ix", plist_id, nindexes); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); if (H5P_get(plist, H5F_CRT_SHMSG_NINDEXES_NAME, nindexes) < 0) @@ -834,7 +834,7 @@ H5Pset_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned mesg_type_ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "unrecognized flags in mesg_type_flags"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Read the current number of indexes */ @@ -890,7 +890,7 @@ H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned *mesg_type H5TRACE4("e", "iIuxx", plist_id, index_num, mesg_type_flags, min_mesg_size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Read the current number of indexes */ @@ -1131,7 +1131,7 @@ H5Pset_shared_mesg_phase_change(hid_t plist_id, unsigned max_list, unsigned min_ min_btree = 0; /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); if (H5P_set(plist, H5F_CRT_SHMSG_LIST_MAX_NAME, &max_list) < 0) @@ -1163,7 +1163,7 @@ H5Pget_shared_mesg_phase_change(hid_t plist_id, unsigned *max_list /*out*/, unsi H5TRACE3("e", "ixx", plist_id, max_list, min_btree); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value(s) */ @@ -1204,7 +1204,7 @@ H5Pset_file_space_strategy(hid_t plist_id, H5F_fspace_strategy_t strategy, hbool HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid strategy"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set value(s), if non-zero */ @@ -1245,7 +1245,7 @@ H5Pget_file_space_strategy(hid_t plist_id, H5F_fspace_strategy_t *strategy /*out H5TRACE4("e", "ixxx", plist_id, strategy, persist, threshold); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value(s) */ @@ -1348,7 +1348,7 @@ H5Pset_file_space_page_size(hid_t plist_id, hsize_t fsp_size) H5TRACE2("e", "ih", plist_id, fsp_size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); if (fsp_size < H5F_FILE_SPACE_PAGE_SIZE_MIN) @@ -1385,7 +1385,7 @@ H5Pget_file_space_page_size(hid_t plist_id, hsize_t *fsp_size /*out*/) H5TRACE2("e", "ix", plist_id, fsp_size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value */ diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index cf60f43db6d..0655761350f 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -153,7 +153,7 @@ H5Pset_local_heap_size_hint(hid_t plist_id, size_t size_hint) H5TRACE2("e", "iz", plist_id, size_hint); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value */ @@ -194,7 +194,7 @@ H5Pget_local_heap_size_hint(hid_t plist_id, size_t *size_hint /*out*/) H5O_ginfo_t ginfo; /* Group information structure */ /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value */ @@ -243,7 +243,7 @@ H5Pset_link_phase_change(hid_t plist_id, unsigned max_compact, unsigned min_dens HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "min dense value must be < 65536"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get group info */ @@ -290,7 +290,7 @@ H5Pget_link_phase_change(hid_t plist_id, unsigned *max_compact /*out*/, unsigned H5O_ginfo_t ginfo; /* Group information structure */ /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get group info */ @@ -341,7 +341,7 @@ H5Pset_est_link_info(hid_t plist_id, unsigned est_num_entries, unsigned est_name HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "est. name length must be < 65536"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get group info */ @@ -388,7 +388,7 @@ H5Pget_est_link_info(hid_t plist_id, unsigned *est_num_entries /*out*/, unsigned H5O_ginfo_t ginfo; /* Group information structure */ /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get group info */ @@ -429,7 +429,7 @@ H5Pset_link_creation_order(hid_t plist_id, unsigned crt_order_flags) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "tracking creation order is required for index"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get link info */ @@ -475,7 +475,7 @@ H5Pget_link_creation_order(hid_t plist_id, unsigned *crt_order_flags /*out*/) *crt_order_flags = 0; /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get link info */ diff --git a/src/H5Pint.c b/src/H5Pint.c index b9db9150747..b01a537cbea 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -4065,6 +4065,40 @@ H5P_isa_class(hid_t plist_id, hid_t pclass_id) FUNC_LEAVE_NOAPI(ret_value) } /* H5P_isa_class() */ +/*------------------------------------------------------------------------- + * Function: H5P_is_default_plist + * + * Purpose: Determine if the provided ID refers to a default property list. + * + * Return: True if the ID refers to a default property list, false otherwise. + * + *------------------------------------------------------------------------- + */ +bool +H5P_is_default_plist(hid_t plist_id) +{ + hid_t H5I_def_plists[] = { + H5P_LST_FILE_CREATE_ID_g, H5P_LST_FILE_ACCESS_ID_g, H5P_LST_DATASET_CREATE_ID_g, + H5P_LST_DATASET_ACCESS_ID_g, H5P_LST_DATASET_XFER_ID_g, H5P_LST_FILE_MOUNT_ID_g, + H5P_LST_GROUP_CREATE_ID_g, H5P_LST_GROUP_ACCESS_ID_g, H5P_LST_DATATYPE_CREATE_ID_g, + H5P_LST_DATATYPE_ACCESS_ID_g, H5P_LST_MAP_CREATE_ID_g, H5P_LST_MAP_ACCESS_ID_g, + H5P_LST_ATTRIBUTE_CREATE_ID_g, H5P_LST_ATTRIBUTE_ACCESS_ID_g, H5P_LST_OBJECT_COPY_ID_g, + H5P_LST_LINK_CREATE_ID_g, H5P_LST_LINK_ACCESS_ID_g, H5P_LST_VOL_INITIALIZE_ID_g, + H5P_LST_REFERENCE_ACCESS_ID_g}; + + size_t num_default_plists = (size_t)(sizeof(H5I_def_plists) / sizeof(H5I_def_plists[0])); + + if (plist_id == H5P_DEFAULT) + return true; + + for (size_t i = 0; i < num_default_plists; i++) { + if (plist_id == H5I_def_plists[i]) + return true; + } + + return false; +} + /*-------------------------------------------------------------------------- NAME H5P_object_verify @@ -4072,9 +4106,10 @@ H5P_isa_class(hid_t plist_id, hid_t pclass_id) Internal routine to query whether a property list is a certain class and retrieve the property list object associated with it. USAGE - void *H5P_object_verify(plist_id, pclass_id) + void *H5P_object_verify(plist_id, pclass_id, allow_default) hid_t plist_id; IN: Property list to query hid_t pclass_id; IN: Property class to query + bool allow_default; IN: Whether to consider the default property lists valid RETURNS Success: valid pointer to a property list object Failure: NULL @@ -4094,7 +4129,7 @@ H5P_isa_class(hid_t plist_id, hid_t pclass_id) REVISION LOG --------------------------------------------------------------------------*/ H5P_genplist_t * -H5P_object_verify(hid_t plist_id, hid_t pclass_id) +H5P_object_verify(hid_t plist_id, hid_t pclass_id, bool allow_default) { H5P_genplist_t *ret_value = NULL; /* Return value */ @@ -4104,6 +4139,10 @@ H5P_object_verify(hid_t plist_id, hid_t pclass_id) if (H5P_isa_class(plist_id, pclass_id) != TRUE) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, NULL, "property list is not a member of the class"); + if (!allow_default && H5P_is_default_plist(plist_id)) { + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOMPARE, NULL, "property list is a default list"); + } + /* Get the plist structure */ if (NULL == (ret_value = (H5P_genplist_t *)H5I_object(plist_id))) HGOTO_ERROR(H5E_ID, H5E_BADID, NULL, "can't find object for ID"); diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 19a63bc8c9e..0857f1a8bcf 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -259,7 +259,7 @@ H5P__lacc_elink_fapl_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED if (l_fapl_id != H5P_DEFAULT) { H5P_genplist_t *l_fapl_plist; - if (NULL == (l_fapl_plist = (H5P_genplist_t *)H5P_object_verify(l_fapl_id, H5P_FILE_ACCESS))) + if (NULL == (l_fapl_plist = (H5P_genplist_t *)H5P_object_verify(l_fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get property list"); if (((*(hid_t *)value) = H5P_copy_plist(l_fapl_plist, FALSE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy file access property list"); @@ -298,7 +298,7 @@ H5P__lacc_elink_fapl_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED if (l_fapl_id != H5P_DEFAULT) { H5P_genplist_t *l_fapl_plist; - if (NULL == (l_fapl_plist = (H5P_genplist_t *)H5P_object_verify(l_fapl_id, H5P_FILE_ACCESS))) + if (NULL == (l_fapl_plist = (H5P_genplist_t *)H5P_object_verify(l_fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get property list"); if (((*(hid_t *)value) = H5P_copy_plist(l_fapl_plist, FALSE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy file access property list"); @@ -334,7 +334,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) /* Check for non-default FAPL */ if (*elink_fapl != H5P_DEFAULT) { - if (NULL == (fapl_plist = (H5P_genplist_t *)H5P_object_verify(*elink_fapl, H5P_FILE_ACCESS))) + if (NULL == (fapl_plist = (H5P_genplist_t *)H5P_object_verify(*elink_fapl, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property list"); non_default_fapl = TRUE; } /* end if */ @@ -492,7 +492,7 @@ H5P__lacc_elink_fapl_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED if (l_fapl_id != H5P_DEFAULT) { H5P_genplist_t *l_fapl_plist; - if (NULL == (l_fapl_plist = (H5P_genplist_t *)H5P_object_verify(l_fapl_id, H5P_FILE_ACCESS))) + if (NULL == (l_fapl_plist = (H5P_genplist_t *)H5P_object_verify(l_fapl_id, H5P_FILE_ACCESS, true))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get property list"); if (((*(hid_t *)value) = H5P_copy_plist(l_fapl_plist, FALSE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy file access property list"); @@ -862,7 +862,7 @@ H5Pset_nlinks(hid_t plist_id, size_t nlinks) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "number of links must be positive"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set number of links */ @@ -899,7 +899,7 @@ H5Pget_nlinks(hid_t plist_id, size_t *nlinks /*out*/) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid pointer passed in"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the current number of links */ @@ -931,7 +931,7 @@ H5Pset_elink_prefix(hid_t plist_id, const char *prefix) H5TRACE2("e", "i*s", plist_id, prefix); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set prefix */ @@ -967,7 +967,7 @@ H5Pget_elink_prefix(hid_t plist_id, char *prefix /*out*/, size_t size) H5TRACE3("Zs", "ixz", plist_id, prefix, size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_ACCESS))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the current prefix */ @@ -1013,7 +1013,7 @@ H5Pset_elink_fapl(hid_t lapl_id, hid_t fapl_id) H5TRACE2("e", "ii", lapl_id, fapl_id); /* Check arguments */ - if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) + if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS, false))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link access property list"); /* Set the file access property list for the link access */ @@ -1044,7 +1044,7 @@ H5Pget_elink_fapl(hid_t lapl_id) H5TRACE1("i", "i", lapl_id); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) + if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); if (H5P_get(plist, H5L_ACS_ELINK_FAPL_NAME, &ret_value) < 0) @@ -1081,7 +1081,7 @@ H5Pset_elink_acc_flags(hid_t lapl_id, unsigned flags) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file open flags"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) + if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set flags */ @@ -1112,7 +1112,7 @@ H5Pget_elink_acc_flags(hid_t lapl_id, unsigned *flags /*out*/) H5TRACE2("e", "ix", lapl_id, flags); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) + if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get flags */ @@ -1151,7 +1151,7 @@ H5Pset_elink_cb(hid_t lapl_id, H5L_elink_traverse_t func, void *op_data) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback is NULL while user data is not"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) + if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Populate the callback info struct */ @@ -1187,7 +1187,7 @@ H5Pget_elink_cb(hid_t lapl_id, H5L_elink_traverse_t *func /*out*/, void **op_dat H5TRACE3("e", "ixx", lapl_id, func, op_data); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) + if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get callback_info */ diff --git a/src/H5Plcpl.c b/src/H5Plcpl.c index 536172e1616..51d5d721b10 100644 --- a/src/H5Plcpl.c +++ b/src/H5Plcpl.c @@ -143,7 +143,7 @@ H5Pset_create_intermediate_group(hid_t plist_id, unsigned crt_intmd_group) H5TRACE2("e", "iIu", plist_id, crt_intmd_group); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set value */ @@ -175,7 +175,7 @@ H5Pget_create_intermediate_group(hid_t plist_id, unsigned *crt_intmd_group /*out H5TRACE2("e", "ix", plist_id, crt_intmd_group); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get values */ diff --git a/src/H5Pmapl.c b/src/H5Pmapl.c index 351bc73ec0b..4ee7b7ca1c4 100644 --- a/src/H5Pmapl.c +++ b/src/H5Pmapl.c @@ -158,7 +158,7 @@ H5Pset_map_iterate_hints(hid_t mapl_id, size_t key_prefetch_size, size_t key_all H5TRACE3("e", "izz", mapl_id, key_prefetch_size, key_alloc_size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(mapl_id, H5P_MAP_ACCESS))) + if (NULL == (plist = H5P_object_verify(mapl_id, H5P_MAP_ACCESS, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set sizes */ @@ -190,7 +190,7 @@ H5Pget_map_iterate_hints(hid_t mapl_id, size_t *key_prefetch_size /*out*/, size_ H5TRACE3("e", "ixx", mapl_id, key_prefetch_size, key_alloc_size); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(mapl_id, H5P_MAP_ACCESS))) + if (NULL == (plist = H5P_object_verify(mapl_id, H5P_MAP_ACCESS, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the properties */ diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index b1647116b92..c54b7641f91 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -217,7 +217,7 @@ H5Pset_attr_phase_change(hid_t plist_id, unsigned max_compact, unsigned min_dens HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "min dense value must be < 65536"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set property values */ @@ -249,7 +249,7 @@ H5Pget_attr_phase_change(hid_t plist_id, unsigned *max_compact /*out*/, unsigned H5TRACE3("e", "ixx", plist_id, max_compact, min_dense); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get values */ @@ -290,7 +290,7 @@ H5Pset_attr_creation_order(hid_t plist_id, unsigned crt_order_flags) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "tracking creation order is required for index"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get object header flags */ @@ -341,7 +341,7 @@ H5Pget_attr_creation_order(hid_t plist_id, unsigned *crt_order_flags /*out*/) *crt_order_flags = 0; /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get object header flags */ @@ -391,7 +391,7 @@ H5Pset_obj_track_times(hid_t plist_id, hbool_t track_times) H5TRACE2("e", "ib", plist_id, track_times); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get object header flags */ @@ -435,7 +435,7 @@ H5Pget_obj_track_times(hid_t plist_id, hbool_t *track_times /*out*/) uint8_t ohdr_flags; /* Object header flags */ /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get object header flags */ @@ -560,7 +560,7 @@ H5Pmodify_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, size_t HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no client data values supplied"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Modify the filter parameters of the I/O pipeline */ @@ -619,7 +619,7 @@ H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, size_t cd HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no client data values supplied"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Call the private function */ @@ -720,7 +720,7 @@ H5Pget_nfilters(hid_t plist_id) H5TRACE1("Is", "i", plist_id); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the pipeline property to query */ @@ -791,7 +791,7 @@ H5Pget_filter2(hid_t plist_id, unsigned idx, unsigned int *flags /*out*/, size_t } /* end if */ /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, H5Z_FILTER_ERROR, "can't find object for ID"); /* Get the pipeline property to query */ @@ -916,7 +916,7 @@ H5Pget_filter_by_id2(hid_t plist_id, H5Z_filter_t id, unsigned int *flags /*out* } /* end if */ /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get filter information */ @@ -950,7 +950,7 @@ H5Pall_filters_avail(hid_t plist_id) H5TRACE1("t", "i", plist_id); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the pipeline property to query */ @@ -1018,7 +1018,7 @@ H5Premove_filter(hid_t plist_id, H5Z_filter_t filter) H5TRACE2("e", "iZf", plist_id, filter); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the pipeline property to modify */ @@ -1070,7 +1070,7 @@ H5Pset_deflate(hid_t plist_id, unsigned level) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid deflate level"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the pipeline property to append to */ @@ -1110,7 +1110,7 @@ H5Pset_fletcher32(hid_t plist_id) H5TRACE1("e", "i", plist_id); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the pipeline property to append to */ @@ -1690,7 +1690,7 @@ H5Pget_filter1(hid_t plist_id, unsigned idx, unsigned int *flags /*out*/, size_t } /* end if */ /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, H5Z_FILTER_ERROR, "can't find object for ID"); /* Get pipeline info */ @@ -1768,7 +1768,7 @@ H5Pget_filter_by_id1(hid_t plist_id, H5Z_filter_t id, unsigned int *flags /*out* } /* end if */ /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get filter info */ diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index 67337d5aff7..0c380dec373 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -618,7 +618,7 @@ H5Pset_copy_object(hid_t plist_id, unsigned cpy_option) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unknown option specified"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set value */ @@ -649,7 +649,7 @@ H5Pget_copy_object(hid_t plist_id, unsigned *cpy_option /*out*/) H5TRACE2("e", "ix", plist_id, cpy_option); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get values */ @@ -697,7 +697,7 @@ H5Padd_merge_committed_dtype_path(hid_t plist_id, const char *path) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "path is empty string"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get dtype list */ @@ -750,7 +750,7 @@ H5Pfree_merge_committed_dtype_paths(hid_t plist_id) H5TRACE1("e", "i", plist_id); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get dtype list */ @@ -801,7 +801,7 @@ H5Pset_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t func, void *op_data) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback is NULL while user data is not"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Populate the callback info struct */ @@ -842,7 +842,7 @@ H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func /*out*/, void * H5TRACE3("e", "ixx", plist_id, func, op_data); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get callback info */ diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index e26c81e97a7..5cf401d9d7b 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -200,6 +200,7 @@ H5_DLL herr_t H5P_get_filter_by_id(H5P_genplist_t *plist, H5Z_filter_t id, unsig size_t *cd_nelmts, unsigned cd_values[], size_t namelen, char name[], unsigned *filter_config); H5_DLL htri_t H5P_filter_in_pline(H5P_genplist_t *plist, H5Z_filter_t id); +H5_DLL bool H5P_is_default_plist(hid_t plist_id); /* Query internal fields of the property list struct */ H5_DLL hid_t H5P_get_plist_id(const H5P_genplist_t *plist); @@ -207,7 +208,7 @@ H5_DLL H5P_genclass_t *H5P_get_class(const H5P_genplist_t *plist); /* *SPECIAL* Don't make more of these! -QAK */ H5_DLL htri_t H5P_isa_class(hid_t plist_id, hid_t pclass_id); -H5_DLL H5P_genplist_t *H5P_object_verify(hid_t plist_id, hid_t pclass_id); +H5_DLL H5P_genplist_t *H5P_object_verify(hid_t plist_id, hid_t pclass_id, bool allow_default); /* Private DCPL routines */ H5_DLL herr_t H5P_fill_value_defined(H5P_genplist_t *plist, H5D_fill_value_t *status); diff --git a/src/H5Pstrcpl.c b/src/H5Pstrcpl.c index 86c3754844f..8e6f1fabbed 100644 --- a/src/H5Pstrcpl.c +++ b/src/H5Pstrcpl.c @@ -148,7 +148,7 @@ H5Pset_char_encoding(hid_t plist_id, H5T_cset_t encoding) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "character encoding is not valid"); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_STRING_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_STRING_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Set the character encoding */ @@ -178,7 +178,7 @@ H5Pget_char_encoding(hid_t plist_id, H5T_cset_t *encoding /*out*/) H5TRACE2("e", "ix", plist_id, encoding); /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(plist_id, H5P_STRING_CREATE))) + if (NULL == (plist = H5P_object_verify(plist_id, H5P_STRING_CREATE, true))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get value */ diff --git a/src/H5VLnative_attr.c b/src/H5VLnative_attr.c index c41496a2e13..e80e97911be 100644 --- a/src/H5VLnative_attr.c +++ b/src/H5VLnative_attr.c @@ -92,7 +92,7 @@ H5VL__native_attr_create(void *obj, const H5VL_loc_params_t *loc_params, const c if (0 == (H5F_INTENT(loc.oloc->file) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_ARGS, H5E_WRITEERROR, NULL, "no write intent on file"); - if (NULL == (plist = H5P_object_verify(aapl_id, H5P_ATTRIBUTE_ACCESS))) + if (NULL == (plist = H5P_object_verify(aapl_id, H5P_ATTRIBUTE_ACCESS, true))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "AAPL is not an attribute access property list"); if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -153,7 +153,7 @@ H5VL__native_attr_open(void *obj, const H5VL_loc_params_t *loc_params, const cha if (H5G_loc_real(obj, loc_params->obj_type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file or file object"); - if (NULL == (plist = H5P_object_verify(aapl_id, H5P_ATTRIBUTE_ACCESS))) + if (NULL == (plist = H5P_object_verify(aapl_id, H5P_ATTRIBUTE_ACCESS, true))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "AAPL is not an attribute access property list"); if (loc_params->type == H5VL_OBJECT_BY_SELF) { diff --git a/src/H5VLnative_dataset.c b/src/H5VLnative_dataset.c index 92a224908f9..94155a69bf0 100644 --- a/src/H5VLnative_dataset.c +++ b/src/H5VLnative_dataset.c @@ -122,7 +122,7 @@ H5VL__native_dataset_io_setup(size_t count, void *obj[], hid_t mem_type_id[], hi H5S_t *space; /* Dataspace to hold selection */ /* Get the plist structure */ - if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) + if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, true))) HGOTO_ERROR(H5E_DATASET, H5E_BADID, FAIL, "bad dataset transfer property list"); /* Get a pointer to the file space in the property list */ diff --git a/src/H5Z.c b/src/H5Z.c index 111d71a3148..11d51250a8d 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -460,7 +460,7 @@ H5Z__check_unregister(hid_t ocpl_id, H5Z_filter_t filter_id) FUNC_ENTER_PACKAGE /* Get the plist structure of object creation */ - if (NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE))) + if (NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE, true))) HGOTO_ERROR(H5E_PLINE, H5E_BADID, FAIL, "can't find object for ID"); /* Check if the object creation property list uses the filter */ diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 80878f67904..eb5e4d69fce 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -821,7 +821,7 @@ H5Z__set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for cd_values[]"); /* Get the plist structure */ - if (NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) + if (NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get the filter's current parameters */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 123c767ff3a..55d531da8b6 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -939,7 +939,7 @@ H5Z__set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) FUNC_ENTER_PACKAGE /* Get the plist structure */ - if (NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) + if (NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get datatype */ diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index 6db510dbff9..348fc29d31a 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -64,7 +64,7 @@ H5Z__set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_ FUNC_ENTER_PACKAGE /* Get the plist structure */ - if (NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) + if (NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get datatype */ diff --git a/src/H5Zszip.c b/src/H5Zszip.c index d636afd158e..7d6a75f65ec 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -131,7 +131,7 @@ H5Z__set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) FUNC_ENTER_PACKAGE /* Get the plist structure */ - if (NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) + if (NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE, false))) HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Get datatype */ diff --git a/test/tgenprop.c b/test/tgenprop.c index 0dd6237acfd..f4c17eb5afb 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -1926,6 +1926,80 @@ test_genprop_refcount(void) } /* ent test_genprop_refcount() */ +/**************************************************************** +** +** test_set_default_plist_fail(): Test that the default property lists are unmodifiable +** +****************************************************************/ +static void +test_set_default_plist_fail(void) +{ + hid_t vol_id = H5I_INVALID_HID; + herr_t ret = FAIL; + + /* Output message about test being performed */ + MESSAGE(5, ("Testing that default property lists are unmodifiable\n")); + + /* Attempt to modify the default generic property list */ + H5E_BEGIN_TRY + { + ret = H5Pset_vol(H5P_DEFAULT, H5VL_NATIVE, NULL); + } + H5E_END_TRY + + VERIFY(ret, FAIL, "H5Pset_vol"); + + H5E_BEGIN_TRY + { + ret = H5Pset_userblock(H5P_FILE_CREATE_DEFAULT, 1024); + } + H5E_END_TRY + + VERIFY(ret, FAIL, "H5Pset_userblock"); + + H5E_BEGIN_TRY + { + ret = H5Pset_layout(H5P_DATASET_CREATE_DEFAULT, H5D_CONTIGUOUS); + } + H5E_END_TRY + + VERIFY(ret, FAIL, "H5Pset_layout"); + + H5E_BEGIN_TRY + { + ret = H5Pset_efile_prefix(H5P_DATASET_ACCESS_DEFAULT, "prefix"); + } + H5E_END_TRY + + VERIFY(ret, FAIL, "H5Pset_efile_prefix"); + + H5E_BEGIN_TRY + { + ret = H5Pset_vol(H5P_FILE_ACCESS_DEFAULT, vol_id, NULL); + } + H5E_END_TRY + + VERIFY(ret, FAIL, "H5Pset_vol"); + + H5E_BEGIN_TRY + { + ret = H5Pset_preserve(H5P_DATASET_XFER_DEFAULT, true); + } + H5E_END_TRY + + VERIFY(ret, FAIL, "H5Pset_preserve"); + + H5E_BEGIN_TRY + { + ret = H5Pset_local_heap_size_hint(H5P_GROUP_CREATE_DEFAULT, 0); + } + H5E_END_TRY + + VERIFY(ret, FAIL, "H5Pset_local_heap_size_hint"); + + return; +} + #ifndef H5_NO_DEPRECATED_SYMBOLS /**************************************************************** ** @@ -2167,6 +2241,8 @@ test_genprop(void H5_ATTR_UNUSED *params) test_genprop_list_add_remove_prop(); /* Test adding and removing the same property several times to HDF5 property list */ + test_set_default_plist_fail(); /* Test that default property lists cannot be modified */ + test_genprop_equal(); /* Tests for more H5Pequal verification */ test_genprop_path(); /* Tests for class path verification */ test_genprop_refcount(); /* Tests for class reference counting */