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/H5VLint.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/H5VLint.c')
-rw-r--r-- | src/H5VLint.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/H5VLint.c b/src/H5VLint.c index 39b0f53..df1f7a4 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -318,7 +318,7 @@ H5VL__free_cls(H5VL_class_t *cls) HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEOBJ, FAIL, "VOL connector did not terminate cleanly") /* Release the class */ - H5MM_xfree((void *)cls->name); /* Casting away const OK -QAK */ + H5MM_xfree_const(cls->name); H5FL_FREE(H5VL_class_t, cls); done: @@ -670,6 +670,7 @@ done: * *------------------------------------------------------------------------- */ +H5_GCC_DIAG_OFF(cast-qual) herr_t H5VL_conn_free(const H5VL_connector_prop_t *connector_prop) { @@ -681,19 +682,20 @@ H5VL_conn_free(const H5VL_connector_prop_t *connector_prop) /* Free the connector info (if it exists) and decrement the ID */ if(connector_prop->connector_id > 0) { if(connector_prop->connector_info) - /* Free the connector info */ - if(H5VL_free_connector_info(connector_prop->connector_id, (void *)connector_prop->connector_info) < 0) /* Casting away const OK - QAK */ + /* Free the connector info, ignoring the const */ + if(H5VL_free_connector_info(connector_prop->connector_id, (void *)connector_prop->connector_info) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTRELEASE, FAIL, "unable to release VOL connector info object") /* Decrement reference count for connector ID */ if(H5I_dec_ref(connector_prop->connector_id) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTDEC, FAIL, "can't decrement reference count for connector ID") - } /* end if */ - } /* end if */ + } + } done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_conn_free() */ +H5_GCC_DIAG_ON(cast-qual) /*------------------------------------------------------------------------- @@ -1144,7 +1146,7 @@ H5VL_register_connector(const void *_cls, hbool_t app_ref, hid_t vipl_id) done: if(ret_value < 0 && saved) { if(saved->name) - H5MM_xfree((void *)(saved->name)); /* Casting away const OK -QAK */ + H5MM_xfree_const(saved->name); H5FL_FREE(H5VL_class_t, saved); } /* end if */ |