From 2ff0e14765d092cd5e49d3a86f9963a982a815a7 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Wed, 16 May 2018 08:31:23 -0600 Subject: [PATCH 1/2] removed unused function --- libhdf5/hdf5file.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/libhdf5/hdf5file.c b/libhdf5/hdf5file.c index 6f78ba896..8c5a66aa7 100644 --- a/libhdf5/hdf5file.c +++ b/libhdf5/hdf5file.c @@ -3018,48 +3018,6 @@ NC4_close(int ncid, void* params) return NC_NOERR; } -/** - * @internal Close an in-memory netcdf file, writing any changes first. - * - * @param ncid File and group ID. - * @param sizep ptr into which the final size is stored - * @param memp ptr into which the final memory is stored - * - * @return ::NC_NOERR No error. - * @author Ed Hartnett -*/ -int -NC4_close_mem(int ncid, size_t* sizep, void** memp) -{ - NC_GRP_INFO_T *grp; - NC *nc; - NC_HDF5_FILE_INFO_T *h5; - int retval; - - LOG((1, "%s: ncid 0x%x", __func__, ncid)); - - /* Find our metadata for this file. */ - if ((retval = nc4_find_nc_grp_h5(ncid, &nc, &grp, &h5))) - return retval; - - assert(nc && h5 && grp); - - /* This must be the root group. */ - if (grp->parent) - return NC_EBADGRPID; - - /* If the file is not an in-memory file, then treat like normal close */ - if((h5->cmode & NC_INMEMORY) == 0) - return NC4_close(ncid,NULL); - - /* Call the nc4 close and extract memory */ - if ((retval = close_netcdf4_file(grp->nc4_info, 0, 1))) - return retval; - - - return NC_NOERR; -} - /** * @internal Learn number of dimensions, variables, global attributes, * and the ID of the first unlimited dimension (if any). From 978fc99f3f278f117773b2faa485a81aa6cf10e7 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Wed, 16 May 2018 08:35:32 -0600 Subject: [PATCH 2/2] fixed indentation --- libhdf5/hdf5file.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libhdf5/hdf5file.c b/libhdf5/hdf5file.c index 8c5a66aa7..6f5dff998 100644 --- a/libhdf5/hdf5file.c +++ b/libhdf5/hdf5file.c @@ -640,16 +640,16 @@ close_netcdf4_file(NC_HDF5_FILE_INFO_T *h5, int abort, int extractmem) if(h5->fileinfo) free(h5->fileinfo); - /* Check to see if this is an in-memory file and we want to get its - final content - */ - if(extractmem) { - /* File must be read/write */ - if(!h5->no_write) { - retval = NC4_extract_file_image(h5); - } + /* Check to see if this is an in-memory file and we want to get its + final content + */ + if(extractmem) { + /* File must be read/write */ + if(!h5->no_write) { + retval = NC4_extract_file_image(h5); } - + } + if (H5Fclose(h5->hdfid) < 0) { dumpopenobjects(h5);