From b6944aeb2abfdab1d0522e065e298945eefa2fe7 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 30 Jun 2017 18:35:09 -0700 Subject: Added a test for VFD IDs to testhdf5. This required adding some code to generate a fake VFD class to pass to H5FDregister(). Also, a bunch of whitespace and comment tidying. --- src/H5FD.c | 279 +++++++++++--------------------------------------------- src/H5Ipublic.h | 34 +++---- test/h5test.c | 100 ++++++++++++++++++++ test/h5test.h | 1 + test/tmisc.c | 69 +++++++++++--- 5 files changed, 226 insertions(+), 257 deletions(-) diff --git a/src/H5FD.c b/src/H5FD.c index 67cf963..9f62065 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -12,14 +12,11 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Monday, July 26, 1999 - * - * Purpose: The Virtual File Layer as described in documentation. - * This is the greatest common denominator for all types of - * storage access whether a file, memory, network, etc. This - * layer usually just dispatches the request to an actual - * file driver layer. + * Purpose: The Virtual File Layer as described in documentation. + * This is the greatest common denominator for all types of + * storage access whether a file, memory, network, etc. This + * layer usually just dispatches the request to an actual + * file driver layer. */ /****************/ @@ -112,9 +109,6 @@ static const H5I_class_t H5I_VFL_CLS[1] = {{ * Return: Success: Non-negative * Failure: Negative * - * Programmer: Robb Matzke - * Monday, July 26, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -147,9 +141,6 @@ done: * otherwise. * Failure: Never fails. * - * Programmer: Robb Matzke - * Friday, February 19, 1999 - * *------------------------------------------------------------------------- */ int @@ -189,11 +180,6 @@ H5FD_term_package(void) * * Failure: Negative * - * Programmer: Robb Matzke - * Monday, July 26, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -221,26 +207,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDregister - * - * Purpose: Registers a new file driver as a member of the virtual file - * driver class. Certain fields of the class struct are - * required and that is checked here so it doesn't have to be - * checked every time the field is accessed. - * - * Return: Success: A file driver ID which is good until the - * library is closed or the driver is - * unregistered. + * Function: H5FDregister * - * Failure: A negative value. + * Purpose: Registers a new file driver as a member of the virtual file + * driver class. Certain fields of the class struct are + * required and that is checked here so it doesn't have to be + * checked every time the field is accessed. * - * Programmer: Robb Matzke - * Monday, July 26, 1999 + * Return: Success: A file driver ID which is good until the + * library is closed or the driver is + * unregistered. * - * Modifications: - * Copied guts of function into H5FD_register - * Quincey Koziol - * Friday, January 30, 2004 + * Failure: A negative value. * *------------------------------------------------------------------------- */ @@ -255,18 +233,18 @@ H5FDregister(const H5FD_class_t *cls) /* Check arguments */ if(!cls) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "null class pointer is disallowed") + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "null class pointer is disallowed") if(!cls->open || !cls->close) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`open' and/or `close' methods are not defined") + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`open' and/or `close' methods are not defined") if(!cls->get_eoa || !cls->set_eoa) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eoa' and/or `set_eoa' methods are not defined") + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eoa' and/or `set_eoa' methods are not defined") if(!cls->get_eof) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eof' method is not defined") + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eof' method is not defined") if(!cls->read || !cls->write) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`read' and/or `write' method is not defined") - for (type=H5FD_MEM_DEFAULT; typefl_map[type]fl_map[type]>=H5FD_MEM_NTYPES) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid free-list mapping") + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`read' and/or `write' method is not defined") + for (type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,type)) + if(cls->fl_map[type] < H5FD_MEM_NOLIST || cls->fl_map[type] >= H5FD_MEM_NTYPES) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid free-list mapping") /* Create the new class ID */ if((ret_value=H5FD_register(cls, sizeof(H5FD_class_t), TRUE)) < 0) @@ -278,29 +256,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_register - * - * Purpose: Registers a new file driver as a member of the virtual file - * driver class. Certain fields of the class struct are - * required and that is checked here so it doesn't have to be - * checked every time the field is accessed. - * - * Return: Success: A file driver ID which is good until the - * library is closed or the driver is - * unregistered. + * Function: H5FD_register * - * Failure: A negative value. + * Purpose: Registers a new file driver as a member of the virtual file + * driver class. Certain fields of the class struct are + * required and that is checked here so it doesn't have to be + * checked every time the field is accessed. * - * Programmer: Robb Matzke - * Monday, July 26, 1999 + * Return: Success: A file driver ID which is good until the + * library is closed or the driver is + * unregistered. * - * Modifications: - * Broke into public and internal routines & added 'size' - * parameter to internal routine, which allows us to create - * sub-classes of H5FD_class_t for internal support (see the - * MPI drivers, etc.) - * Quincey Koziol - * January 30, 2004 + * Failure: A negative value. * *------------------------------------------------------------------------- */ @@ -325,7 +292,7 @@ H5FD_register(const void *_cls, size_t size, hbool_t app_ref) /* Copy the class structure so the caller can reuse or free it */ if(NULL == (saved = (H5FD_class_t *)H5MM_malloc(size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for file driver class struct") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for file driver class struct") HDmemcpy(saved, cls, size); /* Create the new class ID */ @@ -342,19 +309,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDunregister - * - * Purpose: Removes a driver ID from the library. This in no way affects - * file access property lists which have been defined to use - * this driver or files which are already opened under this - * driver. + * Function: H5FDunregister * - * Return: Success: Non-negative + * Purpose: Removes a driver ID from the library. This in no way affects + * file access property lists which have been defined to use + * this driver or files which are already opened under this + * driver. * - * Failure: Negative + * Return: Success: Non-negative * - * Programmer: Robb Matzke - * Monday, July 26, 1999 + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -394,9 +358,6 @@ done: * * Failure: NULL * - * Programmer: Robb Matzke - * Friday, August 20, 1999 - * *------------------------------------------------------------------------- */ H5FD_class_t * @@ -442,11 +403,6 @@ done: * Failure: 0 if an error occurs or if the driver has no * data to store in the superblock. * - * Programmer: Robb Matzke - * Monday, August 16, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ hsize_t @@ -480,11 +436,6 @@ done: * * Failure: Negative * - * Programmer: Robb Matzke - * Monday, August 16, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -511,9 +462,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Robb Matzke - * Monday, August 16, 1999 - * *------------------------------------------------------------------------- */ static herr_t @@ -542,9 +490,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Quincey Koziol - * Friday, July 19, 2013 - * *------------------------------------------------------------------------- */ herr_t @@ -592,9 +537,6 @@ done: * Failure: NULL, including when the file has no * properties. * - * Programmer: Robb Matzke - * Friday, August 13, 1999 - * *------------------------------------------------------------------------- */ void * @@ -622,9 +564,6 @@ done: * Return: Success: non-negative * Failure: negative * - * Programmer: Robb Matzke - * Tuesday, August 3, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -706,11 +645,6 @@ done: * * Failure: NULL * - * Programmer: Robb Matzke - * Tuesday, July 27, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ H5FD_t * @@ -745,16 +679,6 @@ done: * * Failure: NULL * - * Programmer: Robb Matzke - * Wednesday, August 4, 1999 - * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ H5FD_t * @@ -861,9 +785,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Robb Matzke - * Tuesday, July 27, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -893,9 +814,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Robb Matzke - * Wednesday, August 4, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -944,11 +862,6 @@ done: * comparison callback then the file pointers * themselves are compared. * - * Programmer: Robb Matzke - * Tuesday, July 27, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -975,11 +888,6 @@ done: * * Failure: Must never fail. * - * Programmer: Robb Matzke - * Wednesday, August 4, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -1025,11 +933,6 @@ done: * * Failure: negative * - * Programmer: Quincey Koziol - * Friday, August 25, 2000 - * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -1059,9 +962,6 @@ done: * * Failure: negative * - * Programmer: Quincey Koziol - * Friday, August 25, 2000 - * *------------------------------------------------------------------------- */ static int @@ -1118,9 +1018,6 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) * * Failure: The undefined address HADDR_UNDEF * - * Programmer: Robb Matzke - * Tuesday, July 27, 1999 - * *------------------------------------------------------------------------- */ haddr_t @@ -1170,11 +1067,6 @@ done: * * Failure: Negative * - * Programmer: Robb Matzke - * Wednesday, July 28, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -1207,16 +1099,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5FDget_eoa - * - * Purpose: Returns the address of the first byte after the last - * allocated memory in the file. + * Function: H5FDget_eoa * - * Return: Success: First byte after allocated memory. - * Failure: HADDR_UNDEF + * Purpose: Returns the address of the first byte after the last + * allocated memory in the file. * - * Programmer: Robb Matzke - * Friday, July 30, 1999 + * Return: Success: First byte after allocated memory. + * Failure: HADDR_UNDEF * *------------------------------------------------------------------------- */ @@ -1230,13 +1119,13 @@ H5FDget_eoa(H5FD_t *file, H5FD_mem_t type) /* Check args */ if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") if(type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file type") /* The real work */ if(HADDR_UNDEF == (ret_value = H5FD_get_eoa(file, type))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eoa request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eoa request failed") /* (Note compensating for base address subtraction in internal routine) */ ret_value += file->base_addr; @@ -1265,9 +1154,6 @@ done: * Return: Success: Non-negative * Failure: Negative, no side effect * - * Programmer: Robb Matzke - * Friday, July 30, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -1280,16 +1166,16 @@ H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr) /* Check args */ if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") if(type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file type") if(!H5F_addr_defined(addr) || addr > file->maxaddr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid end-of-address value") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid end-of-address value") /* The real work */ /* (Note compensating for base address addition in internal routine) */ if(H5FD_set_eoa(file, type, addr - file->base_addr) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file set eoa request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file set eoa request failed") done: FUNC_LEAVE_API(ret_value) @@ -1315,11 +1201,6 @@ done: * * Failure: HADDR_UNDEF * - * Programmer: Robb Matzke - * Thursday, July 29, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ haddr_t @@ -1332,11 +1213,11 @@ H5FDget_eof(H5FD_t *file, H5FD_mem_t type) /* Check arguments */ if(!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") /* The real work */ if(HADDR_UNDEF == (ret_value = H5FD_get_eof(file, type))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eof request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eof request failed") /* (Note compensating for base address subtraction in internal routine) */ ret_value += file->base_addr; @@ -1354,9 +1235,6 @@ done: * Return: Success: The maximum address allowed in the file. * Failure: HADDR_UNDEF * - * Programmer: Quincey Koziol - * Thursday, January 3, 2008 - * *------------------------------------------------------------------------- */ haddr_t @@ -1384,9 +1262,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Quincey Koziol - * Tuesday, January 8, 2008 - * *------------------------------------------------------------------------- */ herr_t @@ -1412,8 +1287,6 @@ H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags) * Return: Success: Non-negative * Failure: Negative * - * Programmer: Vailin Choi; Oct 2013 - * *------------------------------------------------------------------------- */ herr_t @@ -1438,9 +1311,6 @@ H5FD_set_feature_flags(H5FD_t *file, unsigned long feature_flags) * Return: Success: Non-negative * Failure: Negative * - * Programmer: Quincey Koziol - * Thursday, January 17, 2008 - * *------------------------------------------------------------------------- */ herr_t @@ -1483,9 +1353,6 @@ done: * * Failure: Negative. The contents of BUF is undefined. * - * Programmer: Robb Matzke - * Thursday, July 29, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -1548,9 +1415,6 @@ done: * * Failure: Negative * - * Programmer: Robb Matzke - * Thursday, July 29, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -1613,10 +1477,6 @@ done: * Programmer: Robb Matzke * Thursday, July 29, 1999 * - * Modifications: - * Quincey Koziol, May 20, 2002 - * Added 'closing' parameter - * *------------------------------------------------------------------------- */ herr_t @@ -1653,9 +1513,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Robb Matzke - * Wednesday, August 4, 1999 - * *------------------------------------------------------------------------- */ herr_t @@ -1683,9 +1540,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Quincey Koziol - * Thursday, January 31, 2008 - * *------------------------------------------------------------------------- */ herr_t @@ -1722,9 +1576,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Quincey Koziol - * Thursday, January 31, 2008 - * *------------------------------------------------------------------------- */ herr_t @@ -1752,8 +1603,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Vailin Choi; March 2015 - * *------------------------------------------------------------------------- */ herr_t @@ -1786,8 +1635,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Vailin Choi; May 2013 - * *------------------------------------------------------------------------- */ herr_t @@ -1815,8 +1662,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Vailin Choi; March 2015 - * *------------------------------------------------------------------------- */ herr_t @@ -1848,8 +1693,6 @@ done: * Return: Success: Non-negative * Failure: Negative * - * Programmer: Vailin Choi; May 2013 - * *------------------------------------------------------------------------- */ herr_t @@ -1878,9 +1721,6 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * March 27, 2002 - * *------------------------------------------------------------------------- */ herr_t @@ -1909,8 +1749,6 @@ H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum) * Programmer: Raymond Lu * Sep. 16, 2002 * - * Modifications: - * *-------------------------------------------------------------------------- */ herr_t @@ -1972,9 +1810,6 @@ done: * * Return: Non-negative if succeed; negative if fails. * - * Programmer: Quincey Koziol - * Jan. 17, 2008 - * *-------------------------------------------------------------------------- */ herr_t @@ -2000,9 +1835,6 @@ H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr) * Return: Success: The absolute base address of the file * Failure: The undefined address (HADDR_UNDEF) * - * Programmer: Quincey Koziol - * Sept. 10, 2009 - * *-------------------------------------------------------------------------- */ haddr_t @@ -2024,8 +1856,6 @@ H5FD_get_base_addr(const H5FD_t *file) * * Return: Non-negative if succeed; negative if fails. * - * Programmer: Vailin Choi; April 2013 - * *-------------------------------------------------------------------------- */ herr_t @@ -2052,9 +1882,6 @@ H5FD_set_paged_aggr(H5FD_t *file, hbool_t paged) * * Return: SUCCEED/FAIL * -* Programmer: Jacob Gruber -* Wednesday, August 17, 2011 -* *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index 896f82f..831874b 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -28,26 +28,26 @@ * fail otherwise). * * When adding types here, add a section to the 'misc19' test in test/tmisc.c - * to verify that the H5I{inc|dec|get}_ref() routines work correctly with in. + * to verify that the H5I{inc|dec|get}_ref() routines work correctly with it. * */ typedef enum H5I_type_t { - H5I_UNINIT = (-2), /*uninitialized type */ - H5I_BADID = (-1), /*invalid Type */ - H5I_FILE = 1, /*type ID for File objects */ - H5I_GROUP, /*type ID for Group objects */ - H5I_DATATYPE, /*type ID for Datatype objects */ - H5I_DATASPACE, /*type ID for Dataspace objects */ - H5I_DATASET, /*type ID for Dataset objects */ - H5I_ATTR, /*type ID for Attribute objects */ - H5I_REFERENCE, /*type ID for Reference objects */ - H5I_VFL, /*type ID for virtual file layer */ - H5I_GENPROP_CLS, /*type ID for generic property list classes */ - H5I_GENPROP_LST, /*type ID for generic property lists */ - H5I_ERROR_CLASS, /*type ID for error classes */ - H5I_ERROR_MSG, /*type ID for error messages */ - H5I_ERROR_STACK, /*type ID for error stacks */ - H5I_NTYPES /*number of library types, MUST BE LAST! */ + H5I_UNINIT = (-2), /* uninitialized type */ + H5I_BADID = (-1), /* invalid Type */ + H5I_FILE = 1, /* type ID for File objects */ + H5I_GROUP, /* type ID for Group objects */ + H5I_DATATYPE, /* type ID for Datatype objects */ + H5I_DATASPACE, /* type ID for Dataspace objects */ + H5I_DATASET, /* type ID for Dataset objects */ + H5I_ATTR, /* type ID for Attribute objects */ + H5I_REFERENCE, /* type ID for Reference objects */ + H5I_VFL, /* type ID for virtual file layer */ + H5I_GENPROP_CLS, /* type ID for generic property list classes */ + H5I_GENPROP_LST, /* type ID for generic property lists */ + H5I_ERROR_CLASS, /* type ID for error classes */ + H5I_ERROR_MSG, /* type ID for error messages */ + H5I_ERROR_STACK, /* type ID for error stacks */ + H5I_NTYPES /* number of library types, MUST BE LAST! */ } H5I_type_t; /* Type of atoms to return to users */ diff --git a/test/h5test.c b/test/h5test.c index 8db4388..af45589 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -104,6 +104,68 @@ static herr_t h5_errors(hid_t estack, void *client_data); static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix, char *fullname, size_t size, hbool_t nest_printf); + + +/* A non-usable VFD class and its functions. + * + * Usable for testing things like ID handling where we shouldn't mess with the real VFDs. + */ +static H5FD_t *dummy_vfd_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); +static H5FD_t *dummy_vfd_open(const char H5_ATTR_UNUSED *name, unsigned H5_ATTR_UNUSED flags, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED maxaddr) { return NULL; } + +static herr_t dummy_vfd_close(H5FD_t *_file); +static herr_t dummy_vfd_close(H5FD_t H5_ATTR_UNUSED *_file) { return FAIL; } + +static haddr_t dummy_vfd_get_eoa(const H5FD_t *file, H5FD_mem_t type); +static haddr_t dummy_vfd_get_eoa(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; } + +static herr_t dummy_vfd_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static herr_t dummy_vfd_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t H5_ATTR_UNUSED addr) { return FAIL; } + +static haddr_t dummy_vfd_get_eof(const H5FD_t *file, H5FD_mem_t type); +static haddr_t dummy_vfd_get_eof(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; } + +static herr_t dummy_vfd_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); +static herr_t dummy_vfd_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf) { return FAIL; } + +static herr_t dummy_vfd_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); +static herr_t dummy_vfd_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf) { return FAIL; } + +static H5FD_class_t dummy_vfd_class_g = { + "fake", /* name */ + 1, /* maxaddr */ + H5F_CLOSE_WEAK, /* fc_degree */ + NULL, /* terminate */ + NULL, /* sb_size */ + NULL, /* sb_encode */ + NULL, /* sb_decode */ + 0, /* fapl_size */ + NULL, /* fapl_get */ + NULL, /* fapl_copy */ + NULL, /* fapl_free */ + 0, /* dxpl_size */ + NULL, /* dxpl_copy */ + NULL, /* dxpl_free */ + dummy_vfd_open, /* open */ + dummy_vfd_close, /* close */ + NULL, /* cmp */ + NULL, /* query */ + NULL, /* get_type_map */ + NULL, /* alloc */ + NULL, /* free */ + dummy_vfd_get_eoa, /* get_eoa */ + dummy_vfd_set_eoa, /* set_eoa */ + dummy_vfd_get_eof, /* get_eof */ + NULL, /* get_handle */ + dummy_vfd_read, /* read */ + dummy_vfd_write, /* write */ + NULL, /* flush */ + NULL, /* truncate */ + NULL, /* lock */ + NULL, /* unlock */ + H5FD_FLMAP_DEFAULT /* fl_map */ +}; + /*------------------------------------------------------------------------- * Function: h5_errors @@ -1828,3 +1890,41 @@ error: return FAIL; } /* h5_wait_message() */ +/*------------------------------------------------------------------------- + * Function: h5_get_dummy_vfd_class() + * + * Purpose: Returns a disposable, generally non-functional, + * VFD class struct. + * + * In some of the test code, we need a disposable VFD but + * we don't want to mess with the real VFDs and we also + * don't have access to the internals of the real VFDs (which + * use static globals and functions) to easily duplicate + * them (e.g.: for testing VFD ID handling). + * + * This API call will return a pointer to a VFD class that + * can be used to construct a test VFD using H5FDregister(). + * + * Return: Success: A pointer to a VFD class struct + * Failure: NULL + * + *------------------------------------------------------------------------- + */ +H5FD_class_t * +h5_get_dummy_vfd_class(void) +{ + H5FD_class_t *vfd_class = NULL; + + if(NULL == (vfd_class = (H5FD_class_t *)HDmalloc(sizeof(H5FD_class_t)))) + TEST_ERROR; + + HDmemcpy(vfd_class, &dummy_vfd_class_g, sizeof(H5FD_class_t)); + + return vfd_class; + +error: + if(vfd_class) + HDfree(vfd_class); + return NULL; +} /* h5_get_dummy_vfd_class */ + diff --git a/test/h5test.h b/test/h5test.h index 0e23255..ce5c64d 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -136,6 +136,7 @@ H5TEST_DLL h5_stat_size_t h5_get_file_size(const char *filename, hid_t fapl); H5TEST_DLL int print_func(const char *format, ...); H5TEST_DLL int h5_make_local_copy(const char *origfilename, const char *local_copy_name); H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl); +H5TEST_DLL H5FD_class_t *h5_get_dummy_vfd_class(void); /* Functions that will replace VFD-dependent functions that violate * the single responsibility principle. Unlike their predecessors, diff --git a/test/tmisc.c b/test/tmisc.c index dc69e18..cc6a6aa 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -29,7 +29,7 @@ #include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" -#include "H5Dpkg.h" /* Datasets */ +#include "H5Dpkg.h" /* Datasets */ /* Definitions for misc. test #1 */ #define MISC1_FILE "tmisc1.h5" @@ -2984,19 +2984,21 @@ test_misc18(void) static void test_misc19(void) { - hid_t fid; /* File ID */ - hid_t sid; /* 'Space ID */ - hid_t did; /* Dataset ID */ - hid_t tid; /* 'Type ID */ - hid_t aid; /* Attribute ID */ - hid_t plid; /* Property List ID */ - hid_t pcid; /* Property Class ID */ - hid_t gid; /* Group ID */ - hid_t ecid; /* Error Class ID */ - hid_t emid; /* Error Message ID */ - hid_t esid; /* Error Stack ID */ - int rc; /* Reference count */ - herr_t ret; /* Generic return value */ + hid_t fid = -1; /* File ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hid_t tid = -1; /* Datatype ID */ + hid_t aid = -1; /* Attribute ID */ + hid_t plid = -1; /* Property List ID */ + hid_t pcid = -1; /* Property Class ID */ + hid_t gid = -1; /* Group ID */ + hid_t ecid = -1; /* Error Class ID */ + hid_t emid = -1; /* Error Message ID */ + hid_t esid = -1; /* Error Stack ID */ + hid_t vfdid = -1; /* Virtual File Driver ID */ + H5FD_class_t *vfd_cls = NULL; /* VFD class */ + int rc; /* Reference count */ + herr_t ret; /* Generic return value */ /* Check H5I operations on files */ @@ -3406,6 +3408,45 @@ test_misc19(void) } H5E_END_TRY; VERIFY(ret, FAIL, "H5Eclose_stack"); + +/* Check H5I operations on virtual file drivers */ + + /* Get a VFD class to register */ + vfd_cls = h5_get_dummy_vfd_class(); + CHECK(vfd_cls, NULL, "h5_get_dummy_vfd_class"); + + /* Register a virtual file driver */ + vfdid = H5FDregister(vfd_cls); + CHECK(vfdid, FAIL, "H5FDregister"); + + /* Check the reference count */ + rc = H5Iget_ref(vfdid); + VERIFY(rc, 1, "H5Iget_ref"); + + /* Increment the reference count */ + rc = H5Iinc_ref(vfdid); + VERIFY(rc, 2, "H5Iinc_ref"); + + /* Unregister the VFD normally */ + ret = H5FDunregister(vfdid); + CHECK(ret, FAIL, "H5FDunregister"); + + /* Check the reference count */ + rc = H5Iget_ref(vfdid); + VERIFY(rc, 1, "H5Iget_ref"); + + /* Unregister the VFD by decrementing the reference count */ + rc = H5Idec_ref(vfdid); + VERIFY(rc, 0, "H5Idec_ref"); + + /* Try unregistering the VFD again (should fail) */ + H5E_BEGIN_TRY { + ret = H5FDunregister(vfdid); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5FDunregister"); + +/* Check H5I operations on references */ + } /* end test_misc19() */ /**************************************************************** -- cgit v0.12 From 0d6930d3c2c66798033c3c5c47beb969082fea12 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 30 Jun 2017 20:53:56 -0700 Subject: Purged the unused H5I_REFERENCE from the library. --- c++/src/H5IdComponent.cpp | 2 - java/src/hdf/hdf5lib/HDF5Constants.java | 3 -- java/src/jni/h5Constants.c | 2 - src/H5.c | 1 - src/H5Adeprec.c | 1 - src/H5F.c | 1 - src/H5Fint.c | 1 - src/H5Gloc.c | 3 -- src/H5Gname.c | 1 - src/H5Gtest.c | 1 - src/H5Ipublic.h | 1 - src/H5O.c | 2 - src/H5Oflush.c | 37 ++++++++-------- src/H5R.c | 78 ++------------------------------- src/H5T.c | 1 - src/H5private.h | 1 - src/H5trace.c | 8 ---- test/links.c | 2 - test/tfile.c | 1 - test/tmisc.c | 2 - 20 files changed, 22 insertions(+), 127 deletions(-) diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index f9a08cd..457f594 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -174,7 +174,6 @@ H5I_type_t IdComponent::getHDFObjType() const /// \li \c H5I_DATASPACE /// \li \c H5I_DATASET /// \li \c H5I_ATTR -/// \li \c H5I_REFERENCE /// \li \c H5I_VFL /// \li \c H5I_GENPROP_CLS /// \li \c H5I_GENPROP_LST @@ -227,7 +226,6 @@ bool IdComponent::isValid(hid_t an_id) /// \li \c H5I_DATASPACE /// \li \c H5I_DATASET /// \li \c H5I_ATTR -/// \li \c H5I_REFERENCE /// \li \c H5I_VFL /// \li \c H5I_GENPROP_CLS /// \li \c H5I_GENPROP_LST diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 8a3d6c8..b216d03 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -309,7 +309,6 @@ public class HDF5Constants { public static final int H5I_GROUP = H5I_GROUP(); public static final int H5I_INVALID_HID = H5I_INVALID_HID(); public static final int H5I_NTYPES = H5I_NTYPES(); - public static final int H5I_REFERENCE = H5I_REFERENCE(); public static final int H5I_UNINIT = H5I_UNINIT(); public static final int H5I_VFL = H5I_VFL(); @@ -1196,8 +1195,6 @@ public class HDF5Constants { private static native final int H5I_NTYPES(); - private static native final int H5I_REFERENCE(); - private static native final int H5I_UNINIT(); private static native final int H5I_VFL(); diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index d4511e1..1b97655 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -590,8 +590,6 @@ Java_hdf_hdf5lib_HDF5Constants_H5I_1DATASET(JNIEnv *env, jclass cls) { return H5 JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1ATTR(JNIEnv *env, jclass cls) { return H5I_ATTR; } JNIEXPORT jint JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5I_1REFERENCE(JNIEnv *env, jclass cls) { return H5I_REFERENCE; } -JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1VFL(JNIEnv *env, jclass cls) { return H5I_VFL; } JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1INVALID_1HID(JNIEnv *env, jclass cls) { return H5I_INVALID_HID; } diff --git a/src/H5.c b/src/H5.c index 59984dc..f7826d4 100644 --- a/src/H5.c +++ b/src/H5.c @@ -306,7 +306,6 @@ H5_term_library(void) pending += DOWN(A_top); pending += DOWN(D_top); pending += DOWN(G_top); - pending += DOWN(R_top); pending += DOWN(S_top); pending += DOWN(T_top); diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index 9221254..c37dc3c 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -318,7 +318,6 @@ H5Aget_num_attrs(hid_t loc_id) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5F.c b/src/H5F.c index 78fce2a..8131f53 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -679,7 +679,6 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) case H5I_UNINIT: case H5I_BADID: case H5I_DATASPACE: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Fint.c b/src/H5Fint.c index e52d539..512439f 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -452,7 +452,6 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) case H5I_BADID: case H5I_FILE: case H5I_DATASPACE: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Gloc.c b/src/H5Gloc.c index c011cdf..8548b92 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -240,9 +240,6 @@ H5G_loc(hid_t loc_id, H5G_loc_t *loc) } /* end case */ break; - case H5I_REFERENCE: - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of reference") - case H5I_UNINIT: case H5I_BADID: case H5I_VFL: diff --git a/src/H5Gname.c b/src/H5Gname.c index 7b53668..a90821c 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -835,7 +835,6 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 7271cdc..8a7f8c4 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -553,7 +553,6 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index 831874b..3ac2257 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -40,7 +40,6 @@ typedef enum H5I_type_t { H5I_DATASPACE, /* type ID for Dataspace objects */ H5I_DATASET, /* type ID for Dataset objects */ H5I_ATTR, /* type ID for Attribute objects */ - H5I_REFERENCE, /* type ID for Reference objects */ H5I_VFL, /* type ID for virtual file layer */ H5I_GENPROP_CLS, /* type ID for generic property list classes */ H5I_GENPROP_LST, /* type ID for generic property lists */ diff --git a/src/H5O.c b/src/H5O.c index 152e6cc..79aaddf 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -1081,7 +1081,6 @@ H5Oclose(hid_t object_id) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: @@ -2628,7 +2627,6 @@ H5O_get_loc(hid_t object_id) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Oflush.c b/src/H5Oflush.c index 2d93221..387e0ff 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -370,40 +370,39 @@ H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_ type = H5I_get_type(oid); switch(type) { - case(H5I_GROUP): + case H5I_GROUP: /* Re-open the group */ if(NULL == (object = H5G_open(obj_loc, dxpl_id))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") break; - case(H5I_DATATYPE): + case H5I_DATATYPE: /* Re-open the named datatype */ if(NULL == (object = H5T_open(obj_loc, dxpl_id))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open named datatype") break; - case(H5I_DATASET): + case H5I_DATASET: /* Re-open the dataset */ if(NULL == (object = H5D_open(obj_loc, H5P_DATASET_ACCESS_DEFAULT, dxpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") - if(!start_swmr) /* No need to handle multiple opens when H5Fstart_swmr_write() */ - if(H5D_mult_refresh_reopen((H5D_t *)object, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to finish refresh for dataset") + if(!start_swmr) /* No need to handle multiple opens when H5Fstart_swmr_write() */ + if(H5D_mult_refresh_reopen((H5D_t *)object, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to finish refresh for dataset") break; - case(H5I_UNINIT): - case(H5I_BADID): - case(H5I_FILE): - case(H5I_DATASPACE): - case(H5I_ATTR): - case(H5I_REFERENCE): - case(H5I_VFL): - case(H5I_GENPROP_CLS): - case(H5I_GENPROP_LST): - case(H5I_ERROR_CLASS): - case(H5I_ERROR_MSG): - case(H5I_ERROR_STACK): - case(H5I_NTYPES): + case H5I_UNINIT: + case H5I_BADID: + case H5I_FILE: + case H5I_DATASPACE: + case H5I_ATTR: + case H5I_VFL: + case H5I_GENPROP_CLS: + case H5I_GENPROP_LST: + case H5I_ERROR_CLASS: + case H5I_ERROR_MSG: + case H5I_ERROR_STACK: + case H5I_NTYPES: default: HGOTO_ERROR(H5E_ARGS, H5E_CANTRELEASE, FAIL, "not a valid file object ID (dataset, group, or datatype)") break; diff --git a/src/H5R.c b/src/H5R.c index 73c1d55..dc012e8 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -71,17 +71,6 @@ hbool_t H5_PKG_INIT_VAR = FALSE; /* Local Variables */ /*******************/ -/* Reference ID class */ -static const H5I_class_t H5I_REFERENCE_CLS[1] = {{ - H5I_REFERENCE, /* ID class value */ - 0, /* Class flags */ - 0, /* # of reserved IDs for class */ - NULL /* Callback routine for closing objects of this class */ -}}; - -/* Flag indicating "top" of interface has been initialized */ -static hbool_t H5R_top_package_initialize_s = FALSE; - /*-------------------------------------------------------------------------- @@ -103,13 +92,6 @@ H5R__init_package(void) FUNC_ENTER_NOAPI_NOINIT - /* Initialize the atom group for the file IDs */ - if(H5I_register_type(H5I_REFERENCE_CLS) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to initialize interface") - - /* Mark "top" of interface as initialized, too */ - H5R_top_package_initialize_s = TRUE; - done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__init_package() */ @@ -117,46 +99,6 @@ done: /*-------------------------------------------------------------------------- NAME - H5R_top_term_package - PURPOSE - Terminate various H5R objects - USAGE - void H5R_top_term_package() - RETURNS - void - DESCRIPTION - Release IDs for the atom group, deferring full interface shutdown - until later (in H5R_term_package). - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - Can't report errors... - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -int -H5R_top_term_package(void) -{ - int n = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if(H5R_top_package_initialize_s) { - if(H5I_nmembers(H5I_REFERENCE) > 0) { - (void)H5I_clear_type(H5I_REFERENCE, FALSE, FALSE); - n++; /*H5I*/ - } /* end if */ - - /* Mark closed */ - if(0 == n) - H5R_top_package_initialize_s = FALSE; - } /* end if */ - - FUNC_LEAVE_NOAPI(n) -} /* end H5R_top_term_package() */ - - -/*-------------------------------------------------------------------------- - NAME H5R_term_package PURPOSE Terminate various H5R objects @@ -178,24 +120,12 @@ H5R_top_term_package(void) int H5R_term_package(void) { - int n = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_PKG_INIT_VAR) { - /* Sanity checks */ - HDassert(0 == H5I_nmembers(H5I_REFERENCE)); - HDassert(FALSE == H5R_top_package_initialize_s); - - /* Destroy the reference id group */ - n += (H5I_dec_type_ref(H5I_REFERENCE) > 0); - - /* Mark closed */ - if(0 == n) - H5_PKG_INIT_VAR = FALSE; - } /* end if */ + if(H5_PKG_INIT_VAR) + H5_PKG_INIT_VAR = FALSE; - FUNC_LEAVE_NOAPI(n) + FUNC_LEAVE_NOAPI(0) } /* end H5R_term_package() */ @@ -741,7 +671,7 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create dataspace") /* Atomize */ - if((ret_value = H5I_register (H5I_DATASPACE, space, TRUE)) < 0) + if((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom") done: diff --git a/src/H5T.c b/src/H5T.c index a525cd5..2f59767 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1673,7 +1673,6 @@ H5Tcopy(hid_t type_id) case H5I_GROUP: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5private.h b/src/H5private.h index ca4ebcf..ff45cec 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2593,7 +2593,6 @@ H5_DLL int H5L_term_package(void); H5_DLL int H5P_term_package(void); H5_DLL int H5PL_term_package(void); H5_DLL int H5R_term_package(void); -H5_DLL int H5R_top_term_package(void); H5_DLL int H5S_term_package(void); H5_DLL int H5S_top_term_package(void); H5_DLL int H5SL_term_package(void); diff --git a/src/H5trace.c b/src/H5trace.c index 9fb8a72..e2a746b 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -1320,10 +1320,6 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "%ld (attr)", (long)obj); break; - case H5I_REFERENCE: - fprintf(out, "%ld (reference)", (long)obj); - break; - case H5I_VFL: fprintf(out, "%ld (file driver)", (long)obj); break; @@ -1501,10 +1497,6 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "H5I_ATTR"); break; - case H5I_REFERENCE: - fprintf(out, "H5I_REFERENCE"); - break; - case H5I_VFL: fprintf(out, "H5I_VFL"); break; diff --git a/test/links.c b/test/links.c index 7b3e37d..2d9bb0d 100644 --- a/test/links.c +++ b/test/links.c @@ -7743,7 +7743,6 @@ done: case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: @@ -7830,7 +7829,6 @@ done: case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/test/tfile.c b/test/tfile.c index 533bb24..20b41e0 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1393,7 +1393,6 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, case H5I_DATATYPE: case H5I_DATASPACE: case H5I_ATTR: - case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/test/tmisc.c b/test/tmisc.c index cc6a6aa..587a937 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -3445,8 +3445,6 @@ test_misc19(void) } H5E_END_TRY; VERIFY(ret, FAIL, "H5FDunregister"); -/* Check H5I operations on references */ - } /* end test_misc19() */ /**************************************************************** -- cgit v0.12 From d342358a3b1acd5712b3c136c3985db414f6f673 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 30 Jun 2017 21:06:29 -0700 Subject: Added missing free() call to test_misc19(). --- test/tmisc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/tmisc.c b/test/tmisc.c index 587a937..bec80b2 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -3445,6 +3445,8 @@ test_misc19(void) } H5E_END_TRY; VERIFY(ret, FAIL, "H5FDunregister"); + HDfree(vfd_cls); + } /* end test_misc19() */ /**************************************************************** -- cgit v0.12 From 76b9a0e7eff83db3ed69080f62b95ae568f7129e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 Jul 2017 12:54:14 -0700 Subject: * Reverted removal of H5I_REFERENCE to avoid breaking binary compatibility. * Added a quick H5I_REFERENCE smoke check to test_misc19() in tmisc.c. --- c++/src/H5IdComponent.cpp | 2 + c++/src/H5PropList.cpp | 18 ++++++++ java/src/hdf/hdf5lib/HDF5Constants.java | 3 ++ java/src/jni/h5Constants.c | 2 + src/H5.c | 1 + src/H5Adeprec.c | 1 + src/H5F.c | 1 + src/H5Fint.c | 1 + src/H5Gloc.c | 3 ++ src/H5Gname.c | 1 + src/H5Gtest.c | 1 + src/H5I.c | 4 +- src/H5Ipublic.h | 3 ++ src/H5O.c | 2 + src/H5Oflush.c | 1 + src/H5R.c | 76 +++++++++++++++++++++++++++++++-- src/H5T.c | 1 + src/H5private.h | 1 + src/H5trace.c | 8 ++++ test/links.c | 2 + test/tfile.c | 1 + test/tmisc.c | 29 +++++++++++++ 22 files changed, 157 insertions(+), 5 deletions(-) diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 457f594..284c6c5 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -174,6 +174,7 @@ H5I_type_t IdComponent::getHDFObjType() const /// \li \c H5I_DATASPACE /// \li \c H5I_DATASET /// \li \c H5I_ATTR +/// \li \c H5I_REFERENCE (DEPRECATED) /// \li \c H5I_VFL /// \li \c H5I_GENPROP_CLS /// \li \c H5I_GENPROP_LST @@ -226,6 +227,7 @@ bool IdComponent::isValid(hid_t an_id) /// \li \c H5I_DATASPACE /// \li \c H5I_DATASET /// \li \c H5I_ATTR +/// \li \c H5I_REFERENCE (DEPRECATED) /// \li \c H5I_VFL /// \li \c H5I_GENPROP_CLS /// \li \c H5I_GENPROP_LST diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index dd7b21a..16a6316 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -138,6 +138,24 @@ PropList::PropList(const hid_t plist_id) : IdComponent() throw PropListIException("PropList constructor", "H5Pcopy failed"); } break; + /* These should really be error cases, but changing that breaks + * the stated behavior and causes test failures. + * (DER, July 2017) + */ + case H5I_BADID: + case H5I_FILE: + case H5I_GROUP: + case H5I_DATATYPE: + case H5I_DATASPACE: + case H5I_DATASET: + case H5I_ATTR: + case H5I_REFERENCE: + case H5I_VFL: + case H5I_ERROR_CLASS: + case H5I_ERROR_MSG: + case H5I_ERROR_STACK: + case H5I_NTYPES: + case H5I_UNINIT: default: id = H5P_DEFAULT; break; diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index b216d03..8a3d6c8 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -309,6 +309,7 @@ public class HDF5Constants { public static final int H5I_GROUP = H5I_GROUP(); public static final int H5I_INVALID_HID = H5I_INVALID_HID(); public static final int H5I_NTYPES = H5I_NTYPES(); + public static final int H5I_REFERENCE = H5I_REFERENCE(); public static final int H5I_UNINIT = H5I_UNINIT(); public static final int H5I_VFL = H5I_VFL(); @@ -1195,6 +1196,8 @@ public class HDF5Constants { private static native final int H5I_NTYPES(); + private static native final int H5I_REFERENCE(); + private static native final int H5I_UNINIT(); private static native final int H5I_VFL(); diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index 1b97655..d4511e1 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -590,6 +590,8 @@ Java_hdf_hdf5lib_HDF5Constants_H5I_1DATASET(JNIEnv *env, jclass cls) { return H5 JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1ATTR(JNIEnv *env, jclass cls) { return H5I_ATTR; } JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5I_1REFERENCE(JNIEnv *env, jclass cls) { return H5I_REFERENCE; } +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1VFL(JNIEnv *env, jclass cls) { return H5I_VFL; } JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5I_1INVALID_1HID(JNIEnv *env, jclass cls) { return H5I_INVALID_HID; } diff --git a/src/H5.c b/src/H5.c index f7826d4..59984dc 100644 --- a/src/H5.c +++ b/src/H5.c @@ -306,6 +306,7 @@ H5_term_library(void) pending += DOWN(A_top); pending += DOWN(D_top); pending += DOWN(G_top); + pending += DOWN(R_top); pending += DOWN(S_top); pending += DOWN(T_top); diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index c37dc3c..9221254 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -318,6 +318,7 @@ H5Aget_num_attrs(hid_t loc_id) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5F.c b/src/H5F.c index 8131f53..78fce2a 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -679,6 +679,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) case H5I_UNINIT: case H5I_BADID: case H5I_DATASPACE: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Fint.c b/src/H5Fint.c index 512439f..e52d539 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -452,6 +452,7 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) case H5I_BADID: case H5I_FILE: case H5I_DATASPACE: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 8548b92..c011cdf 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -240,6 +240,9 @@ H5G_loc(hid_t loc_id, H5G_loc_t *loc) } /* end case */ break; + case H5I_REFERENCE: + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of reference") + case H5I_UNINIT: case H5I_BADID: case H5I_VFL: diff --git a/src/H5Gname.c b/src/H5Gname.c index a90821c..7b53668 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -835,6 +835,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 8a7f8c4..7271cdc 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -553,6 +553,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5I.c b/src/H5I.c index 42edf58..b8e47a2 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -451,9 +451,9 @@ H5I_nmembers(H5I_type_t type) FUNC_ENTER_NOAPI(FAIL) if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") if(NULL == (type_ptr = H5I_id_type_list_g[type]) || type_ptr->init_count <= 0) - HGOTO_DONE(0); + HGOTO_DONE(0); /* Set return value */ H5_CHECKED_ASSIGN(ret_value, int64_t, type_ptr->id_count, uint64_t); diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index 3ac2257..c737bbe 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -30,6 +30,8 @@ * When adding types here, add a section to the 'misc19' test in test/tmisc.c * to verify that the H5I{inc|dec|get}_ref() routines work correctly with it. * + * NOTE: H5I_REFERENCE is not used by the library and has been deprecated + * with a tentative removal version of 1.12.0. (DER, July 2017) */ typedef enum H5I_type_t { H5I_UNINIT = (-2), /* uninitialized type */ @@ -40,6 +42,7 @@ typedef enum H5I_type_t { H5I_DATASPACE, /* type ID for Dataspace objects */ H5I_DATASET, /* type ID for Dataset objects */ H5I_ATTR, /* type ID for Attribute objects */ + H5I_REFERENCE, /* *DEPRECATED* type ID for Reference objects */ H5I_VFL, /* type ID for virtual file layer */ H5I_GENPROP_CLS, /* type ID for generic property list classes */ H5I_GENPROP_LST, /* type ID for generic property lists */ diff --git a/src/H5O.c b/src/H5O.c index 79aaddf..152e6cc 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -1081,6 +1081,7 @@ H5Oclose(hid_t object_id) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: @@ -2627,6 +2628,7 @@ H5O_get_loc(hid_t object_id) case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5Oflush.c b/src/H5Oflush.c index 387e0ff..9764f56 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -396,6 +396,7 @@ H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_ case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5R.c b/src/H5R.c index dc012e8..c2a10ce 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -71,6 +71,17 @@ hbool_t H5_PKG_INIT_VAR = FALSE; /* Local Variables */ /*******************/ +/* Reference ID class */ +static const H5I_class_t H5I_REFERENCE_CLS[1] = {{ + H5I_REFERENCE, /* ID class value */ + 0, /* Class flags */ + 0, /* # of reserved IDs for class */ + NULL /* Callback routine for closing objects of this class */ +}}; + +/* Flag indicating "top" of interface has been initialized */ +static hbool_t H5R_top_package_initialize_s = FALSE; + /*-------------------------------------------------------------------------- @@ -92,6 +103,13 @@ H5R__init_package(void) FUNC_ENTER_NOAPI_NOINIT +/* Initialize the atom group for the file IDs */ + if(H5I_register_type(H5I_REFERENCE_CLS) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to initialize interface") + + /* Mark "top" of interface as initialized, too */ + H5R_top_package_initialize_s = TRUE; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R__init_package() */ @@ -99,6 +117,46 @@ done: /*-------------------------------------------------------------------------- NAME + H5R_top_term_package + PURPOSE + Terminate various H5R objects + USAGE + void H5R_top_term_package() + RETURNS + void + DESCRIPTION + Release IDs for the atom group, deferring full interface shutdown + until later (in H5R_term_package). + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + Can't report errors... + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +int +H5R_top_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5R_top_package_initialize_s) { + if(H5I_nmembers(H5I_REFERENCE) > 0) { + (void)H5I_clear_type(H5I_REFERENCE, FALSE, FALSE); + n++; /*H5I*/ + } /* end if */ + + /* Mark closed */ + if(0 == n) + H5R_top_package_initialize_s = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* end H5R__init_package() */ + + +/*-------------------------------------------------------------------------- + NAME H5R_term_package PURPOSE Terminate various H5R objects @@ -120,12 +178,24 @@ done: int H5R_term_package(void) { + int n = 0; + FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_PKG_INIT_VAR) - H5_PKG_INIT_VAR = FALSE; + if(H5_PKG_INIT_VAR) { + /* Sanity checks */ + HDassert(0 == H5I_nmembers(H5I_REFERENCE)); + HDassert(FALSE == H5R_top_package_initialize_s); + + /* Destroy the reference id group */ + n += (H5I_dec_type_ref(H5I_REFERENCE) > 0); + + /* Mark closed */ + if(0 == n) + H5_PKG_INIT_VAR = FALSE; + } - FUNC_LEAVE_NOAPI(0) + FUNC_LEAVE_NOAPI(n) } /* end H5R_term_package() */ diff --git a/src/H5T.c b/src/H5T.c index 2f59767..a525cd5 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1673,6 +1673,7 @@ H5Tcopy(hid_t type_id) case H5I_GROUP: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/src/H5private.h b/src/H5private.h index ff45cec..ca4ebcf 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2593,6 +2593,7 @@ H5_DLL int H5L_term_package(void); H5_DLL int H5P_term_package(void); H5_DLL int H5PL_term_package(void); H5_DLL int H5R_term_package(void); +H5_DLL int H5R_top_term_package(void); H5_DLL int H5S_term_package(void); H5_DLL int H5S_top_term_package(void); H5_DLL int H5SL_term_package(void); diff --git a/src/H5trace.c b/src/H5trace.c index e2a746b..9fb8a72 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -1320,6 +1320,10 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "%ld (attr)", (long)obj); break; + case H5I_REFERENCE: + fprintf(out, "%ld (reference)", (long)obj); + break; + case H5I_VFL: fprintf(out, "%ld (file driver)", (long)obj); break; @@ -1497,6 +1501,10 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "H5I_ATTR"); break; + case H5I_REFERENCE: + fprintf(out, "H5I_REFERENCE"); + break; + case H5I_VFL: fprintf(out, "H5I_VFL"); break; diff --git a/test/links.c b/test/links.c index 2d9bb0d..7b3e37d 100644 --- a/test/links.c +++ b/test/links.c @@ -7743,6 +7743,7 @@ done: case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: @@ -7829,6 +7830,7 @@ done: case H5I_FILE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/test/tfile.c b/test/tfile.c index 20b41e0..533bb24 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1393,6 +1393,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, case H5I_DATATYPE: case H5I_DATASPACE: case H5I_ATTR: + case H5I_REFERENCE: case H5I_VFL: case H5I_GENPROP_CLS: case H5I_GENPROP_LST: diff --git a/test/tmisc.c b/test/tmisc.c index bec80b2..22ae558 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -30,6 +30,7 @@ #include "testhdf5.h" #include "H5srcdir.h" #include "H5Dpkg.h" /* Datasets */ +#include "H5Iprivate.h" /* IDs, can be removed when H5I_REFERENCE is gone */ /* Definitions for misc. test #1 */ #define MISC1_FILE "tmisc1.h5" @@ -3447,6 +3448,34 @@ test_misc19(void) HDfree(vfd_cls); +/* Check H5I operations on references */ + + /* Reference IDs are not used by the library so there's no + * way of testing if incr/decr, etc. work. Instead, just + * do a quick smoke check to ensure that a couple of basic + * calls return sane values. + * + * H5I_REFERENCE has been declared deprecated with a tentative + * removal version of HDF5 1.12.0. + * + * Delete this entire block when H5I_REFERENCE no longer exists. + * + * The H5Iprivate.h header was included to support H5I_nmembers() + * so that can also probably be removed as well. + */ +{ + htri_t tf; /* Boolean generic return */ + int64_t num_members; /* Number of members in type */ + + tf = H5Itype_exists(H5I_REFERENCE); + VERIFY(tf, TRUE, "H5Itype_exists"); + + num_members = 999; + num_members = H5I_nmembers(H5I_REFERENCE); + VERIFY(num_members, 0, "H5Inmembers"); + +} /* end block */ + } /* end test_misc19() */ /**************************************************************** -- cgit v0.12 From dfceb84d4756a15540b5b08826ea98c13c1399e8 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 Jul 2017 13:00:11 -0700 Subject: Fixed a minor comment typo in H5R.c --- src/H5R.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5R.c b/src/H5R.c index c2a10ce..78a77e2 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -152,7 +152,7 @@ H5R_top_term_package(void) } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* end H5R__init_package() */ +} /* end H5R_top_term_package() */ /*-------------------------------------------------------------------------- -- cgit v0.12 From 9a749a64f06187bc5ae17e848eab9aacdfc57f8a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 Jul 2017 13:01:58 -0700 Subject: More minor whitespace cleanup --- src/H5R.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/H5R.c b/src/H5R.c index 78a77e2..b000183 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -103,7 +103,7 @@ H5R__init_package(void) FUNC_ENTER_NOAPI_NOINIT -/* Initialize the atom group for the file IDs */ + /* Initialize the atom group for the file IDs */ if(H5I_register_type(H5I_REFERENCE_CLS) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to initialize interface") @@ -144,7 +144,7 @@ H5R_top_term_package(void) if(H5I_nmembers(H5I_REFERENCE) > 0) { (void)H5I_clear_type(H5I_REFERENCE, FALSE, FALSE); n++; /*H5I*/ - } /* end if */ + } /* end if */ /* Mark closed */ if(0 == n) @@ -193,7 +193,7 @@ H5R_term_package(void) /* Mark closed */ if(0 == n) H5_PKG_INIT_VAR = FALSE; - } + } /* end if */ FUNC_LEAVE_NOAPI(n) } /* end H5R_term_package() */ -- cgit v0.12