diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-01-30 19:01:25 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2020-01-30 19:01:25 (GMT) |
commit | 9da387342eea566659daed83c850220cee041059 (patch) | |
tree | 4ef05589271e0800fb5bf853bad09cd1c4dfeb7c /src/H5FD.c | |
parent | d1f2eff23148da5e39463bd351be51767755b1c1 (diff) | |
download | hdf5-9da387342eea566659daed83c850220cee041059.zip hdf5-9da387342eea566659daed83c850220cee041059.tar.gz hdf5-9da387342eea566659daed83c850220cee041059.tar.bz2 |
Added a free wrapper that lets us free constant pointers without
generating warnings.
Also, brought the const-ness of the VOL connector info in line with
the VFD info (not visible externally).
Diffstat (limited to 'src/H5FD.c')
-rw-r--r-- | src/H5FD.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -574,6 +574,7 @@ done: * *------------------------------------------------------------------------- */ +H5_GCC_DIAG_OFF(cast-qual) herr_t H5FD_fapl_close(hid_t driver_id, const void *driver_info) { @@ -591,17 +592,19 @@ H5FD_fapl_close(hid_t driver_id, const void *driver_info) /* 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 */ + /* Free the const pointer (why we turn off the diagnostic) */ + if((driver->fapl_free)((void *)driver_info) < 0) 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 */ + driver_info = H5MM_xfree_const(driver_info); + } + } done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_fapl_close() */ +H5_GCC_DIAG_ON(cast-qual) /*------------------------------------------------------------------------- |