diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-01-30 19:01:25 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-05-20 14:31:54 (GMT) |
commit | 5e76dccbe0f874e352813b5d24a6b84c80b59fcd (patch) | |
tree | 87ef50fea4c9853d40c1dd15a9566eb4c96b3f28 /src/H5FD.c | |
parent | c3974173a14380069c336dc7e65184685f41f32b (diff) | |
download | hdf5-5e76dccbe0f874e352813b5d24a6b84c80b59fcd.zip hdf5-5e76dccbe0f874e352813b5d24a6b84c80b59fcd.tar.gz hdf5-5e76dccbe0f874e352813b5d24a6b84c80b59fcd.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) /*------------------------------------------------------------------------- |