summaryrefslogtreecommitdiffstats
path: root/src/H5FD.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5FD.c')
-rw-r--r--src/H5FD.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/H5FD.c b/src/H5FD.c
index 1a4ab4d..63112bd 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -202,7 +202,7 @@ H5FD__free_cls(H5FD_class_t *cls)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_free_cls() */
+} /* end H5FD__free_cls() */
/*-------------------------------------------------------------------------
@@ -566,22 +566,22 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_fapl_close
+ * Function: H5FD_free_driver_info
*
- * Purpose: Closes a driver for a dataset transfer property list
+ * Purpose: Frees a driver's info
*
* Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
herr_t
-H5FD_fapl_close(hid_t driver_id, const void *driver_info)
+H5FD_free_driver_info(hid_t driver_id, const void *driver_info)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if(driver_id > 0) {
+ if(driver_id > 0 && driver_info) {
H5FD_class_t *driver;
/* Retrieve the driver for the ID */
@@ -589,19 +589,19 @@ H5FD_fapl_close(hid_t driver_id, const void *driver_info)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID")
/* Allow driver to free info or do it ourselves */
- if(driver_info) {
- if(driver->fapl_free) {
- if((driver->fapl_free)((void *)driver_info) < 0) /* Casting away const OK -QAK */
- HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "driver free request failed")
- } /* end if */
- else
- driver_info = H5MM_xfree((void *)driver_info); /* Casting away const OK -QAK */
- } /* end if */
- } /* end if */
+ if(driver->fapl_free) {
+ /* Free the const pointer */
+ /* Cast through uintptr_t to de-const memory */
+ if((driver->fapl_free)((void *)(uintptr_t)driver_info) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "driver free request failed")
+ }
+ else
+ driver_info = H5MM_xfree_const(driver_info);
+ }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_fapl_close() */
+} /* end H5FD_free_driver_info() */
/*-------------------------------------------------------------------------