summaryrefslogtreecommitdiffstats
path: root/hl
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2021-11-10 18:09:38 (GMT)
committerGitHub <noreply@github.com>2021-11-10 18:09:38 (GMT)
commita777e3075ef51adb15d2618c6d2fa4687444a098 (patch)
treec0b8e1940784026a66d575cee3a5d8732a733c87 /hl
parentb488eb4ecc5397876d43f49a6892aa848ad45bdf (diff)
downloadhdf5-a777e3075ef51adb15d2618c6d2fa4687444a098.zip
hdf5-a777e3075ef51adb15d2618c6d2fa4687444a098.tar.gz
hdf5-a777e3075ef51adb15d2618c6d2fa4687444a098.tar.bz2
Fix H5DS warnings related to new H5DSwith_new_ref and H5VLobject_is_native APIs (#1184)
Diffstat (limited to 'hl')
-rw-r--r--hl/src/H5DS.c36
-rw-r--r--hl/src/H5DSpublic.h2
2 files changed, 19 insertions, 19 deletions
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index 7d93de4..c947d16 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -22,31 +22,35 @@ static herr_t H5DS_is_reserved(hid_t did);
/*-------------------------------------------------------------------------
* Function: H5DSwith_new_ref
*
- * Purpose: Detremines if new references are used with dimension scales.
+ * Purpose: Determines if new references are used with dimension scales.
* The function H5DSwith_new_ref takes any object identifier and checks
- * if new references are used for dimenison scales. Currently,
+ * if new references are used for dimension scales. Currently,
* new references are used when non-native VOL connector is used or when
* H5_DIMENSION_SCALES_WITH_NEW_REF is set up via configure option.
*
- * Return: Success: TRUE/FALSE, Failure: FAIL
+ * Return: Non-negative on success/Negative on failure
*
*-------------------------------------------------------------------------
*/
-hbool_t
-H5DSwith_new_ref(hid_t obj_id)
+herr_t
+H5DSwith_new_ref(hid_t obj_id, hbool_t *with_new_ref)
{
- hbool_t ret_value = FALSE;
hbool_t config_flag = FALSE;
hbool_t native = FALSE;
- native = H5VLobject_is_native(obj_id);
- if (native < 0)
+ if (!with_new_ref)
+ return FAIL;
+
+ if (H5VLobject_is_native(obj_id, &native) < 0)
return FAIL;
+
#ifdef H5_DIMENSION_SCALES_WITH_NEW_REF
config_flag = TRUE;
#endif
- ret_value = (config_flag || !native);
- return ret_value;
+
+ *with_new_ref = (config_flag || !native);
+
+ return SUCCEED;
}
/*-------------------------------------------------------------------------
@@ -205,8 +209,7 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
*-------------------------------------------------------------------------
*/
- is_new_ref = H5DSwith_new_ref(did);
- if (is_new_ref < 0)
+ if (H5DSwith_new_ref(did, &is_new_ref) < 0)
return FAIL;
/* get ID type */
@@ -793,8 +796,7 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx)
* determine if old or new references should be used
*-------------------------------------------------------------------------
*/
- is_new_ref = H5DSwith_new_ref(did);
- if (is_new_ref < 0)
+ if (H5DSwith_new_ref(did, &is_new_ref) < 0)
return FAIL;
/*-------------------------------------------------------------------------
@@ -1283,8 +1285,7 @@ H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx)
*-------------------------------------------------------------------------
*/
- is_new_ref = H5DSwith_new_ref(did);
- if (is_new_ref < 0)
+ if (H5DSwith_new_ref(did, &is_new_ref) < 0)
return FAIL;
/* get ID type */
@@ -1629,8 +1630,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi
*-------------------------------------------------------------------------
*/
- is_new_ref = H5DSwith_new_ref(did);
- if (is_new_ref < 0)
+ if (H5DSwith_new_ref(did, &is_new_ref) < 0)
return FAIL;
/* get the number of scales assotiated with this DIM */
diff --git a/hl/src/H5DSpublic.h b/hl/src/H5DSpublic.h
index 9aabb98..979a173 100644
--- a/hl/src/H5DSpublic.h
+++ b/hl/src/H5DSpublic.h
@@ -25,7 +25,7 @@ typedef herr_t (*H5DS_iterate_t)(hid_t dset, unsigned dim, hid_t scale, void *vi
extern "C" {
#endif
-H5_HLDLL hbool_t H5DSwith_new_ref(hid_t obj_id);
+H5_HLDLL herr_t H5DSwith_new_ref(hid_t obj_id, hbool_t *with_new_ref);
H5_HLDLL herr_t H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx);