From d840c1864c7d6a64da84292b08be24d4224cd249 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Tue, 16 Jul 2019 16:02:08 -0600 Subject: [PATCH] removed unused prototype --- include/nc4internal.h | 2 +- libhdf4/hdf4file.c | 4 ++++ libhdf5/hdf5file.c | 4 ++++ libsrc4/nc4internal.c | 26 ++++++++++++++++++++++---- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/include/nc4internal.h b/include/nc4internal.h index 383f8709e..e0c076aa9 100644 --- a/include/nc4internal.h +++ b/include/nc4internal.h @@ -335,7 +335,7 @@ int nc4_type_free(NC_TYPE_INFO_T *type); /* These list functions add and delete vars, atts. */ int nc4_nc4f_list_add(NC *nc, const char *path, int mode); -void nc4_file_list_del(NC *nc); +int nc4_nc4f_list_del(NC_FILE_INFO_T *h5); int nc4_var_list_add(NC_GRP_INFO_T* grp, const char* name, int ndims, NC_VAR_INFO_T **var); int nc4_var_list_add2(NC_GRP_INFO_T* grp, const char* name, diff --git a/libhdf4/hdf4file.c b/libhdf4/hdf4file.c index bc3c055b4..4e079bcfa 100644 --- a/libhdf4/hdf4file.c +++ b/libhdf4/hdf4file.c @@ -724,6 +724,10 @@ NC_HDF4_close(int ncid, void *ignore) nclistfree(h5->allgroups); nclistfree(h5->alltypes); + /* Free the NC_FILE_INFO_T struct. */ + if ((retval = nc4_nc4f_list_del(h5))) + return retval; + /* Free the nc4_info struct; above code should have reclaimed everything else */ free(h5); diff --git a/libhdf5/hdf5file.c b/libhdf5/hdf5file.c index 1b110a281..a916dc0ec 100644 --- a/libhdf5/hdf5file.c +++ b/libhdf5/hdf5file.c @@ -311,6 +311,10 @@ nc4_close_netcdf4_file(NC_FILE_INFO_T *h5, int abort, NC_memio *memio) if (h5->format_file_info) free(h5->format_file_info); + /* Free the NC_FILE_INFO_T struct. */ + if ((retval = nc4_nc4f_list_del(h5))) + return retval; + /* Free the nc4_info struct; above code should have reclaimed everything else */ free(h5); diff --git a/libsrc4/nc4internal.c b/libsrc4/nc4internal.c index c86a48569..168097ea6 100644 --- a/libsrc4/nc4internal.c +++ b/libsrc4/nc4internal.c @@ -1273,13 +1273,15 @@ dim_free(NC_DIM_INFO_T *dim) * @author Dennis Heimbigner */ int -nc4_dim_list_del(NC_GRP_INFO_T* grp, NC_DIM_INFO_T *dim) +nc4_dim_list_del(NC_GRP_INFO_T *grp, NC_DIM_INFO_T *dim) { - if(grp && dim) { - int pos = ncindexfind(grp->dim,(NC_OBJ*)dim); + if (grp && dim) + { + int pos = ncindexfind(grp->dim, (NC_OBJ *)dim); if(pos >= 0) - ncindexidel(grp->dim,pos); + ncindexidel(grp->dim, pos); } + return dim_free(dim); } @@ -1364,6 +1366,22 @@ nc4_att_list_del(NCindex *list, NC_ATT_INFO_T *att) return att_free(att); } +/** + * @internal Free all resources and memory associated with a + * NC_FILE_INFO_T. + * + * @param h5 Pointer to NC_FILE_INFO_T to be freed. + * + * @return ::NC_NOERR No error. + * @author Ed Hartnett + */ +int +nc4_nc4f_list_del(NC_FILE_INFO_T *h5) +{ + assert(h5); + return NC_NOERR; +} + /** * @internal Normalize a UTF8 name. Put the result in norm_name, which * can be NC_MAX_NAME + 1 in size. This function makes sure the free()