From 9e5a68214a5e40bb8e43c5ec2a928dc70e8a6017 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 28 Mar 2020 21:53:43 -0500 Subject: Don't track file offset position when using pread / pwrite. --- src/H5FDcore.c | 42 +++++++++++++++++++++++------------------- src/H5FDlog.c | 29 +++++++++++++++++++++++++---- src/H5FDprivate.h | 2 ++ src/H5FDsec2.c | 39 ++++++++++++++++++++++++++++++--------- 4 files changed, 80 insertions(+), 32 deletions(-) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 552b7ca..91338d7 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -82,7 +82,7 @@ typedef struct H5FD_core_t { DWORD nFileIndexLow; DWORD nFileIndexHigh; DWORD dwVolumeSerialNumber; - + HANDLE hFile; /* Native windows file handle */ #endif /* H5_HAVE_WIN32_API */ hbool_t dirty; /* changes not saved? */ @@ -382,7 +382,9 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) int myerrno = errno; time_t mytime = HDtime(NULL); +#ifndef H5_HAVE_PREADWRITE offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); +#endif /* H5_HAVE_PREADWRITE */ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write to backing store failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', ptr = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), ptr, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ @@ -405,7 +407,7 @@ done: * * Purpose: Initializes any interface-specific data or routines. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ @@ -757,9 +759,9 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr if((file_image_info.buffer != NULL) && !(H5F_ACC_CREAT & flags)) { if(HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW) >= 0) HGOTO_ERROR(H5E_FILE, H5E_FILEEXISTS, NULL, "file already exists") - + /* If backing store is requested, create and stat the file - * Note: We are forcing the O_CREAT flag here, even though this is + * Note: We are forcing the O_CREAT flag here, even though this is * technically an open. */ if(fa->backing_store) { @@ -856,14 +858,14 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr /* Read in existing data, being careful of interrupted system calls, * partial results, and the end of the file. */ - + uint8_t *mem = file->mem; /* memory pointer for writes */ HDoff_t offset = (HDoff_t)0; /* offset for reading */ - + while(size > 0) { h5_posix_io_t bytes_in = 0; /* # of bytes to read */ h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */ - + /* Trying to read more bytes than the return type can handle is * undefined behavior in POSIX. */ @@ -871,7 +873,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr bytes_in = H5_POSIX_MAX_IO_BYTES; else bytes_in = (h5_posix_io_t)size; - + do { #ifdef H5_HAVE_PREADWRITE bytes_read = HDpread(file->fd, mem, bytes_in, offset); @@ -881,19 +883,21 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr bytes_read = HDread(file->fd, mem, bytes_in); #endif /* H5_HAVE_PREADWRITE */ } while(-1 == bytes_read && EINTR == errno); - + if(-1 == bytes_read) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); +#ifndef H5_HAVE_PREADWRITE offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); +#endif /* H5_HAVE_PREADWRITE */ HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', file->mem = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), file->mem, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset); } /* end if */ - + HDassert(bytes_read >= 0); HDassert((size_t)bytes_read <= size); - + mem += bytes_read; size -= (size_t)bytes_read; } /* end while */ @@ -1467,24 +1471,24 @@ done: * than the end-of-address. * * Addendum -- 12/2/11 - * For file images opened with the core file driver, it is + * For file images opened with the core file driver, it is * necessary that we avoid reallocating the core file driver's * buffer uneccessarily. * * To this end, I have made the following functional changes - * to this function. + * to this function. * - * If we are closing, and there is no backing store, this + * If we are closing, and there is no backing store, this * function becomes a no-op. * * If we are closing, and there is backing store, we set the - * eof to equal the eoa, and truncate the backing store to + * eof to equal the eoa, and truncate the backing store to * the new eof * - * If we are not closing, we realloc the buffer to size equal - * to the smallest multiple of the allocation increment that - * equals or exceeds the eoa and set the eof accordingly. - * Note that we no longer truncate the backing store to the + * If we are not closing, we realloc the buffer to size equal + * to the smallest multiple of the allocation increment that + * equals or exceeds the eoa and set the eof accordingly. + * Note that we no longer truncate the backing store to the * new eof if applicable. * -- JRM * diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 60255e5..c9aa44d 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -78,8 +78,10 @@ typedef struct H5FD_log_t { int fd; /* the unix file */ haddr_t eoa; /* end of allocated region */ haddr_t eof; /* end of file; current file size */ +#ifndef H5_HAVE_PREADWRITE haddr_t pos; /* current file I/O position */ H5FD_file_op_t op; /* last operation */ +#endif /* H5_HAVE_PREADWRITE */ char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */ #ifndef H5_HAVE_WIN32_API /* On most systems the combination of device and i-node number uniquely @@ -108,7 +110,7 @@ typedef struct H5FD_log_t { DWORD nFileIndexLow; DWORD nFileIndexHigh; DWORD dwVolumeSerialNumber; - + HANDLE hFile; /* Native windows file handle */ #endif /* H5_HAVE_WIN32_API */ @@ -578,8 +580,10 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) file->fd = fd; H5_CHECKED_ASSIGN(file->eof, haddr_t, sb.st_size, h5_stat_size_t); +#ifndef H5_HAVE_PREADWRITE file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; +#endif /* H5_HAVE_PREADWRITE */ #ifdef H5_HAVE_WIN32_API file->hFile = (HANDLE)_get_osfhandle(fd); if(INVALID_HANDLE_VALUE == file->hFile) @@ -1255,7 +1259,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd while(size > 0) { h5_posix_io_t bytes_in = 0; /* # of bytes to read */ - h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */ + h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */ /* Trying to read more bytes than the return type can handle is * undefined behavior in POSIX. @@ -1279,7 +1283,9 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd int myerrno = errno; time_t mytime = HDtime(NULL); +#ifndef H5_HAVE_PREADWRITE offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); +#endif /* H5_HAVE_PREADWRITE */ if(file->fa.flags & H5FD_LOG_LOC_READ) HDfprintf(file->logfp, "Error! Reading: %10a-%10a (%10Zu bytes)\n", orig_addr, (orig_addr + orig_size) - 1, orig_size); @@ -1295,7 +1301,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd HDassert(bytes_read >= 0); HDassert((size_t)bytes_read <= size); - + size -= (size_t)bytes_read; addr += (haddr_t)bytes_read; buf = (char *)buf + bytes_read; @@ -1344,15 +1350,19 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd #endif /* H5_HAVE_GETTIMEOFDAY */ } /* end if */ +#ifndef H5_HAVE_PREADWRITE /* Update current position */ file->pos = addr; file->op = OP_READ; +#endif /* H5_HAVE_PREADWRITE */ done: if(ret_value < 0) { +#ifndef H5_HAVE_PREADWRITE /* Reset last file I/O information */ file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; +#endif /* H5_HAVE_PREADWRITE */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -1472,7 +1482,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had while(size > 0) { h5_posix_io_t bytes_in = 0; /* # of bytes to write */ - h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ + h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ /* Trying to write more bytes than the return type can handle is * undefined behavior in POSIX. @@ -1496,7 +1506,9 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had int myerrno = errno; time_t mytime = HDtime(NULL); +#ifndef H5_HAVE_PREADWRITE offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); +#endif /* H5_HAVE_PREADWRITE */ if(file->fa.flags & H5FD_LOG_LOC_WRITE) HDfprintf(file->logfp, "Error! Writing: %10a-%10a (%10Zu bytes)\n", orig_addr, (orig_addr + orig_size) - 1, orig_size); @@ -1555,17 +1567,24 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had #endif /* H5_HAVE_GETTIMEOFDAY */ } /* end if */ +#ifndef H5_HAVE_PREADWRITE /* Update current position and eof */ file->pos = addr; file->op = OP_WRITE; if(file->pos > file->eof) file->eof = file->pos; +#else /* H5_HAVE_PREADWRITE */ + if(addr > file->eof) + file->eof = addr; +#endif /* H5_HAVE_PREADWRITE */ done: if(ret_value < 0) { +#ifndef H5_HAVE_PREADWRITE /* Reset last file I/O information */ file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; +#endif /* H5_HAVE_PREADWRITE */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -1674,9 +1693,11 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U /* Update the eof value */ file->eof = file->eoa; +#ifndef H5_HAVE_PREADWRITE /* Reset last file I/O information */ file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; +#endif /* H5_HAVE_PREADWRITE */ } /* end if */ done: diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 2e3d3ce..0f014bf 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -59,12 +59,14 @@ typedef struct H5FD_class_mpi_t { /* Library Private Typedefs */ /****************************/ +#ifndef H5_HAVE_PREADWRITE /* File operations */ typedef enum { OP_UNKNOWN = 0, /* Unknown last file operation */ OP_READ = 1, /* Last file I/O operation was a read */ OP_WRITE = 2 /* Last file I/O operation was a write */ } H5FD_file_op_t; +#endif /* H5_HAVE_PREADWRITE */ /* Define structure to hold initial file image and other relevant information */ diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index a393490..98021ca 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -55,8 +55,10 @@ typedef struct H5FD_sec2_t { int fd; /* the filesystem file descriptor */ haddr_t eoa; /* end of allocated region */ haddr_t eof; /* end of file; current file size */ +#ifndef H5_HAVE_PREADWRITE haddr_t pos; /* current file I/O position */ H5FD_file_op_t op; /* last operation */ +#endif /* H5_HAVE_PREADWRITE */ char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */ #ifndef H5_HAVE_WIN32_API /* On most systems the combination of device and i-node number uniquely @@ -85,7 +87,7 @@ typedef struct H5FD_sec2_t { DWORD nFileIndexLow; DWORD nFileIndexHigh; DWORD dwVolumeSerialNumber; - + HANDLE hFile; /* Native windows file handle */ #endif /* H5_HAVE_WIN32_API */ @@ -355,8 +357,10 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) file->fd = fd; H5_CHECKED_ASSIGN(file->eof, haddr_t, sb.st_size, h5_stat_size_t); +#ifndef H5_HAVE_PREADWRITE file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; +#endif /* H5_HAVE_PREADWRITE */ #ifdef H5_HAVE_WIN32_API file->hFile = (HANDLE)_get_osfhandle(fd); if(INVALID_HANDLE_VALUE == file->hFile) @@ -599,7 +603,7 @@ H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) * either the filesystem end-of-file or the HDF5 end-of-address * markers. * - * Return: End of file address, the first address past the end of the + * Return: End of file address, the first address past the end of the * "file", either the filesystem file or the HDF5 file. * * Programmer: Robb Matzke @@ -716,39 +720,45 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS bytes_read = HDread(file->fd, buf, bytes_in); #endif /* H5_HAVE_PREADWRITE */ } while(-1 == bytes_read && EINTR == errno); - + if(-1 == bytes_read) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); +#ifndef H5_HAVE_PREADWRITE offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); +#endif /* H5_HAVE_PREADWRITE */ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset); } /* end if */ - + if(0 == bytes_read) { /* end of file but not end of format address space */ HDmemset(buf, 0, size); break; } /* end if */ - + HDassert(bytes_read >= 0); HDassert((size_t)bytes_read <= size); - + size -= (size_t)bytes_read; addr += (haddr_t)bytes_read; buf = (char *)buf + bytes_read; } /* end while */ +#ifndef H5_HAVE_PREADWRITE /* Update current position */ file->pos = addr; file->op = OP_READ; +#endif /* H5_HAVE_PREADWRITE */ done: if(ret_value < 0) { +#ifndef H5_HAVE_PREADWRITE /* Reset last file I/O information */ file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; +#endif /* H5_HAVE_PREADWRITE */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -802,7 +812,7 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU while(size > 0) { h5_posix_io_t bytes_in = 0; /* # of bytes to write */ - h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ + h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ /* Trying to write more bytes than the return type can handle is * undefined behavior in POSIX. @@ -821,16 +831,18 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU bytes_wrote = HDwrite(file->fd, buf, bytes_in); #endif /* H5_HAVE_PREADWRITE */ } while(-1 == bytes_wrote && EINTR == errno); - + if(-1 == bytes_wrote) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); +#ifndef H5_HAVE_PREADWRITE offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); +#endif /* H5_HAVE_PREADWRITE */ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ - + HDassert(bytes_wrote > 0); HDassert((size_t)bytes_wrote <= size); @@ -839,17 +851,24 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU buf = (const char *)buf + bytes_wrote; } /* end while */ +#ifndef H5_HAVE_PREADWRITE /* Update current position and eof */ file->pos = addr; file->op = OP_WRITE; if(file->pos > file->eof) file->eof = file->pos; +#else /* H5_HAVE_PREADWRITE */ + if(addr > file->eof) + file->eof = addr; +#endif /* H5_HAVE_PREADWRITE */ done: if(ret_value < 0) { +#ifndef H5_HAVE_PREADWRITE /* Reset last file I/O information */ file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; +#endif /* H5_HAVE_PREADWRITE */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -915,9 +934,11 @@ H5FD_sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_ /* Update the eof value */ file->eof = file->eoa; +#ifndef H5_HAVE_PREADWRITE /* Reset last file I/O information */ file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; +#endif /* H5_HAVE_PREADWRITE */ } /* end if */ done: -- cgit v0.12 From ee6f7d1c96f2def94b96ebb5fdb34d592a80c8ad Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Fri, 19 Jun 2020 12:14:10 -0500 Subject: Fix issue in H5VL_wrap_register where datatype VOL objects are casted to H5T_t * --- src/H5VLint.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/H5VLint.c b/src/H5VLint.c index 861629f..98785f8 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -2363,23 +2363,25 @@ H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref) /* Sanity check */ HDassert(obj); + /* Retrieve the VOL object wrapping context */ + if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") + if(NULL == vol_wrap_ctx || NULL == vol_wrap_ctx->connector) + HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, H5I_INVALID_HID, "VOL object wrap context or its connector is NULL???") + /* If the datatype is already VOL-managed, the datatype's vol_obj * field will get clobbered later, so disallow this. */ - if(type == H5I_DATATYPE) - if(TRUE == H5T_already_vol_managed((const H5T_t *)obj)) - HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype") + if(type == H5I_DATATYPE) { + if(vol_wrap_ctx->connector->id == H5VL_NATIVE) + if(TRUE == H5T_already_vol_managed((const H5T_t *)obj)) + HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype") + } /* Wrap the object with VOL connector info */ if(NULL == (new_obj = H5VL__wrap_obj(obj, type))) HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, H5I_INVALID_HID, "can't wrap library object") - /* Retrieve the VOL object wrapping context */ - if(H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context") - if(NULL == vol_wrap_ctx || NULL == vol_wrap_ctx->connector) - HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, H5I_INVALID_HID, "VOL object wrap context or its connector is NULL???") - /* Get an ID for the object */ if((ret_value = H5VL_register_using_vol_id(type, new_obj, vol_wrap_ctx->connector->id, app_ref)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to get an ID for the object") -- cgit v0.12 From 6e740457cc338a7c4db95be4458c76828da7a872 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Jul 2020 11:09:05 -0700 Subject: Minor normalization with 1.10 branch --- src/H5Adense.c | 80 +++++++++------------- src/H5Aint.c | 207 ++++++++++++++++++++++++++------------------------------- src/H5B2.c | 17 +---- src/H5B2hdr.c | 11 +-- src/H5EAdbg.c | 58 ++++++++-------- src/H5Eint.c | 3 +- src/H5F.c | 134 +++++++++++++++---------------------- src/H5Gloc.c | 4 +- src/H5Ochunk.c | 11 +-- src/H5Ocont.c | 6 +- src/H5TS.c | 1 + 11 files changed, 220 insertions(+), 312 deletions(-) diff --git a/src/H5Adense.c b/src/H5Adense.c index a73fcc6..fd92e8f 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -171,7 +171,6 @@ typedef struct H5A_bt2_ud_rmbi_t { * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 4 2006 * *------------------------------------------------------------------------- @@ -290,9 +289,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 11 2006 + * Programmer: Quincey Koziol + * Dec 11 2006 * *------------------------------------------------------------------------- */ @@ -351,9 +349,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 11 2006 + * Programmer: Quincey Koziol + * Dec 11 2006 * *------------------------------------------------------------------------- */ @@ -440,9 +437,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 4 2006 + * Programmer: Quincey Koziol + * Dec 4 2006 * *------------------------------------------------------------------------- */ @@ -598,7 +594,7 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, February 20, 2007 * *------------------------------------------------------------------------- @@ -632,7 +628,7 @@ H5A__dense_write_bt2_cb2(void *_record, void *_op_data, hbool_t *changed) * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, December 5, 2006 * *------------------------------------------------------------------------- @@ -743,9 +739,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 4 2006 + * Programmer: Quincey Koziol + * Dec 4 2006 * *------------------------------------------------------------------------- */ @@ -840,9 +835,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 5 2006 + * Programmer: Quincey Koziol + * Dec 5 2006 * *------------------------------------------------------------------------- */ @@ -883,9 +877,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Jan 3 2007 + * Programmer: Quincey Koziol + * Jan 3 2007 * *------------------------------------------------------------------------- */ @@ -1065,9 +1058,8 @@ done: * * Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 5 2006 + * Programmer: Quincey Koziol + * Dec 5 2006 * *------------------------------------------------------------------------- */ @@ -1161,9 +1153,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 5 2006 + * Programmer: Quincey Koziol + * Dec 5 2006 * *------------------------------------------------------------------------- */ @@ -1296,9 +1287,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 11 2006 + * Programmer: Quincey Koziol + * Dec 11 2006 * *------------------------------------------------------------------------- */ @@ -1360,9 +1350,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 11 2006 + * Programmer: Quincey Koziol + * Dec 11 2006 * *------------------------------------------------------------------------- */ @@ -1448,9 +1437,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Feb 14 2007 + * Programmer: Quincey Koziol + * Feb 14 2007 * *------------------------------------------------------------------------- */ @@ -1574,9 +1562,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Feb 14 2007 + * Programmer: Quincey Koziol + * Feb 14 2007 * *------------------------------------------------------------------------- */ @@ -1702,9 +1689,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 11 2006 + * Programmer: Quincey Koziol + * Dec 11 2006 * *------------------------------------------------------------------------- */ @@ -1788,9 +1774,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Jan 3 2007 + * Programmer: Quincey Koziol + * Jan 3 2007 * *------------------------------------------------------------------------- */ @@ -1852,9 +1837,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Dec 6 2006 + * Programmer: Quincey Koziol + * Dec 6 2006 * *------------------------------------------------------------------------- */ diff --git a/src/H5Aint.c b/src/H5Aint.c index cd0ab80..d6ea1f4 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -122,10 +122,10 @@ const unsigned H5O_attr_ver_bounds[] = { /* Local Variables */ /*******************/ -typedef H5A_t* H5A_t_ptr; +typedef H5A_t* H5A_t_ptr; H5FL_SEQ_DEFINE(H5A_t_ptr); - + /*------------------------------------------------------------------------- * Function: H5A__create * @@ -288,16 +288,16 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5A__create() */ - + /*------------------------------------------------------------------------- * Function: H5A__create_by_name * - * Purpose: Create an attribute on object, according to it's name + * Purpose: Create an attribute on object, according to it's name * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * December 6, 2017 + * Programmer: Quincey Koziol + * December 6, 2017 * *------------------------------------------------------------------------- */ @@ -306,8 +306,8 @@ H5A__create_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr const H5T_t *type, const H5S_t *space, hid_t acpl_id) { H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ H5A_t *attr = NULL; /* Attribute from object header */ H5A_t *ret_value = NULL; /* Return value */ @@ -349,22 +349,21 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__create_by_name() */ - + /*------------------------------------------------------------------------- * Function: H5A__open_common * - * Purpose: - * Finishes initializing an attributes the open + * Purpose: Finishes initializing an attributes the open * * Usage: * herr_t H5A__open_common(loc, name) * const H5G_loc_t *loc; IN: Pointer to group location for object * H5A_t *attr; IN/OUT: Pointer to attribute to initialize * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * December 18, 2006 + * Programmer: Quincey Koziol + * December 18, 2006 * *------------------------------------------------------------------------- */ @@ -406,7 +405,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__open_common() */ - + /*------------------------------------------------------------------------- * Function: H5A__open * @@ -451,13 +450,13 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__open() */ - + /*------------------------------------------------------------------------- * Function: H5A__open_by_idx * * Purpose: Open an attribute according to its index order * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * April 2, 1998 @@ -515,7 +514,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__open_by_idx() */ - + /*------------------------------------------------------------------------- * Function: H5A__open_by_name * @@ -579,7 +578,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__open_by_name() */ - + /*-------------------------------------------------------------------------- NAME H5A__read @@ -681,12 +680,12 @@ done: if(tconv_buf) tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf); if(bkg_buf) - bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); + bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5A__read() */ - + /*-------------------------------------------------------------------------- NAME H5A__write @@ -800,7 +799,7 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5A__write() */ - + /*-------------------------------------------------------------------------- NAME H5A__get_name @@ -821,7 +820,7 @@ ssize_t H5A__get_name(H5A_t *attr, size_t buf_size, char *buf) { size_t copy_len, nbytes; - ssize_t ret_value = -1; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -846,7 +845,7 @@ H5A__get_name(H5A_t *attr, size_t buf_size, char *buf) FUNC_LEAVE_NOAPI(ret_value) } /* H5A__get_name() */ - + /*------------------------------------------------------------------------- * Function: H5A_get_space * @@ -883,14 +882,13 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_get_space() */ - + /*------------------------------------------------------------------------- * Function: H5A__get_type * * Purpose: Returns an ID for the datatype of an attribute * * Return: Success: A valid ID for the datatype of an attribute - * * Failure: H5I_INVALID_HID * *------------------------------------------------------------------------- @@ -946,7 +944,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__get_type() */ - + /*-------------------------------------------------------------------------- NAME H5A__get_create_plist @@ -978,7 +976,7 @@ H5A__get_create_plist(H5A_t* attr) /* Create the property list object to return */ if((new_plist_id = H5P_copy_plist(plist, TRUE)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy attribute creation properties") + HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy attribute creation properties") if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_plist_id))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get property list") @@ -992,7 +990,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__get_create_plist() */ - + /*------------------------------------------------------------------------- * Function: H5A__get_info * @@ -1033,14 +1031,13 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__get_info() */ - + /*------------------------------------------------------------------------- * Function: H5A__copy * * Purpose: Copies attribute OLD_ATTR. * * Return: Success: Pointer to a new copy of the OLD_ATTR argument. - * * Failure: NULL * * Programmer: Robb Matzke @@ -1096,7 +1093,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__copy() */ - + /*------------------------------------------------------------------------- * Function: H5A__shared_free * @@ -1148,7 +1145,7 @@ H5A__shared_free(H5A_t *attr) FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__shared_free() */ - + /*------------------------------------------------------------------------- * Function: H5A__close_cb * @@ -1180,7 +1177,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__close_cb() */ - + /*------------------------------------------------------------------------- * Function: H5A__close * @@ -1231,7 +1228,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__close() */ - + /*------------------------------------------------------------------------- * Function: H5A_oloc * @@ -1263,7 +1260,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_oloc() */ - + /*------------------------------------------------------------------------- * Function: H5A_nameof * @@ -1295,7 +1292,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_nameof() */ - + /*------------------------------------------------------------------------- * Function: H5A_type * @@ -1325,7 +1322,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_type() */ - + /*------------------------------------------------------------------------- * Function: H5A__exists_by_name * @@ -1371,7 +1368,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__exists_by_name() */ - + /*------------------------------------------------------------------------- * Function: H5A__compact_build_table_cb * @@ -1381,7 +1378,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2006 * * Modification:Raymond Lu @@ -1432,7 +1428,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__compact_build_table_cb() */ - + /*------------------------------------------------------------------------- * Function: H5A__compact_build_table * @@ -1444,8 +1440,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * Dec 18, 2006 + * Programmer: Quincey Koziol + * Dec 18, 2006 * *------------------------------------------------------------------------- */ @@ -1495,18 +1491,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__compact_build_table() */ - + /*------------------------------------------------------------------------- * Function: H5A__dense_build_table_cb * * Purpose: Callback routine for building table of attributes from dense * attribute storage. * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 11 2006 * *------------------------------------------------------------------------- @@ -1539,7 +1533,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__dense_build_table_cb() */ - + /*------------------------------------------------------------------------- * Function: H5A__dense_build_table * @@ -1624,21 +1618,20 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__dense_build_table() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_cmp_name_inc * - * Purpose: Callback routine for comparing two attribute names, in + * Purpose: Callback routine for comparing two attribute names, in * increasing alphabetic order * - * Return: An integer less than, equal to, or greater than zero if the + * Return: An integer less than, equal to, or greater than zero if the * first argument is considered to be respectively less than, * equal to, or greater than the second. If two members compare * as equal, their order in the sorted array is undefined. * (i.e. same as strcmp()) * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 11 2006 * *------------------------------------------------------------------------- @@ -1652,7 +1645,7 @@ H5A__attr_cmp_name_inc(const void *attr1, const void *attr2) (*(const H5A_t * const *)attr2)->shared->name)) } /* end H5A__attr_cmp_name_inc() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_cmp_name_dec * @@ -1666,7 +1659,6 @@ H5A__attr_cmp_name_inc(const void *attr1, const void *attr2) * (i.e. opposite of strcmp()) * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 8 2007 * *------------------------------------------------------------------------- @@ -1680,7 +1672,7 @@ H5A__attr_cmp_name_dec(const void *attr1, const void *attr2) (*(const H5A_t * const *)attr1)->shared->name)) } /* end H5A__attr_cmp_name_dec() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_cmp_corder_inc * @@ -1693,7 +1685,6 @@ H5A__attr_cmp_name_dec(const void *attr1, const void *attr2) * as equal, their order in the sorted array is undefined. * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 8 2007 * *------------------------------------------------------------------------- @@ -1715,21 +1706,20 @@ H5A__attr_cmp_corder_inc(const void *attr1, const void *attr2) FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__attr_cmp_corder_inc() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_cmp_corder_dec * - * Purpose: Callback routine for comparing two attributes, in + * Purpose: Callback routine for comparing two attributes, in * decreasing creation order * - * Return: An integer less than, equal to, or greater than zero if the + * Return: An integer less than, equal to, or greater than zero if the * second argument is considered to be respectively less than, * equal to, or greater than the first. If two members compare * as equal, their order in the sorted array is undefined. * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Feb 8 2007 + * Programmer: Quincey Koziol + * Feb 8 2007 * *------------------------------------------------------------------------- */ @@ -1750,17 +1740,16 @@ H5A__attr_cmp_corder_dec(const void *attr1, const void *attr2) FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__attr_cmp_corder_dec() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_sort_table * * Purpose: Sort table containing a list of attributes for an object * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * Dec 11, 2006 + * Programmer: Quincey Koziol + * Dec 11, 2006 * *------------------------------------------------------------------------- */ @@ -1795,7 +1784,7 @@ H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type, FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5A__attr_sort_table() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_iterate_table * @@ -1804,8 +1793,8 @@ H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type, * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol - * Dec 18, 2006 + * Programmer: Quincey Koziol + * Dec 18, 2006 * *------------------------------------------------------------------------- */ @@ -1877,7 +1866,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__attr_iterate_table() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_release_table * @@ -1885,7 +1874,7 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Dec 11, 2006 * *------------------------------------------------------------------------- @@ -1893,7 +1882,7 @@ done: herr_t H5A__attr_release_table(H5A_attr_table_t *atable) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1918,18 +1907,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__attr_release_table() */ - + /*------------------------------------------------------------------------- * Function: H5A__get_ainfo * * Purpose: Retrieves the "attribute info" message for an object. Also * sets the number of attributes correctly, if it isn't set up yet. * - * Return: Success: TRUE/FALSE whether message was found & retrieved - * Failure: FAIL if error occurred + * Return: TRUE/FALSE/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 11 2007 * *------------------------------------------------------------------------- @@ -1949,11 +1936,11 @@ H5A__get_ainfo(H5F_t *f, H5O_t *oh, H5O_ainfo_t *ainfo) /* Check if the "attribute info" message exists */ if((ret_value = H5O_msg_exists_oh(oh, H5O_AINFO_ID)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "unable to check object header") + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "unable to check object header") if(ret_value > 0) { /* Retrieve the "attribute info" structure */ if(NULL == H5O_msg_read_oh(f, oh, H5O_AINFO_ID, ainfo)) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't read AINFO message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't read AINFO message") /* Check if we don't know how many attributes there are */ if(ainfo->nattrs == HSIZET_MAX) { @@ -1982,7 +1969,7 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5A__get_ainfo() */ - + /*------------------------------------------------------------------------- * Function: H5A__set_version * @@ -1993,7 +1980,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 17 2007 * *------------------------------------------------------------------------- @@ -2044,7 +2030,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__set_version() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_copy_file * @@ -2254,10 +2240,10 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s H5MM_memcpy(buf, attr_src->shared->data, attr_src->shared->data_size); - /* Allocate background memory */ - if(H5T_path_bkg(tpath_src_mem) || H5T_path_bkg(tpath_mem_dst)) - if(NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, NULL, "memory allocation failed") + /* Allocate background memory */ + if(H5T_path_bkg(tpath_src_mem) || H5T_path_bkg(tpath_mem_dst)) + if(NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, NULL, "memory allocation failed") /* Convert from source file to memory */ if(H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg_buf) < 0) @@ -2265,9 +2251,9 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s H5MM_memcpy(reclaim_buf, buf, buf_size); - /* Set background buffer to all zeros */ - if(bkg_buf) - HDmemset(bkg_buf, 0, buf_size); + /* Set background buffer to all zeros */ + if(bkg_buf) + HDmemset(bkg_buf, 0, buf_size); /* Convert from memory to destination file */ if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg_buf) < 0) @@ -2327,7 +2313,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__attr_copy_file() */ - + /*------------------------------------------------------------------------- * Function: H5A__attr_post_copy_file * @@ -2420,7 +2406,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__attr_post_copy_file() */ - + /*------------------------------------------------------------------------- * Function: H5A__dense_post_copy_file_cb * @@ -2478,7 +2464,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__dense_post_copy_file_cb() */ - + /*------------------------------------------------------------------------- * Function: H5A__dense_post_copy_file_all * @@ -2487,7 +2473,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Peter Cao - * xcao@hdfgroup.org * July 20, 2007 * *------------------------------------------------------------------------- @@ -2525,7 +2510,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__dense_post_copy_file_all */ - + /*------------------------------------------------------------------------- * Function: H5A__rename_by_name * @@ -2533,7 +2518,7 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * February 20, 2007 * *------------------------------------------------------------------------- @@ -2543,10 +2528,10 @@ H5A__rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_na const char *new_attr_name) { H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2575,7 +2560,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__rename_by_name() */ - + /*------------------------------------------------------------------------- * Function: H5A__iterate_common * @@ -2583,7 +2568,7 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * December 6, 2017 * *------------------------------------------------------------------------- @@ -2610,7 +2595,7 @@ H5A__iterate_common(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, FUNC_LEAVE_NOAPI(ret_value) } /* H5A__iterate_common() */ - + /*------------------------------------------------------------------------- * Function: H5A__iterate * @@ -2675,7 +2660,7 @@ done: } /* end H5A__iterate() */ #ifndef H5_NO_DEPRECATED_SYMBOLS - + /*------------------------------------------------------------------------- * Function: H5A__iterate_old * @@ -2683,7 +2668,7 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * December 6, 2017 * *------------------------------------------------------------------------- @@ -2725,7 +2710,7 @@ H5A__iterate_old(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * December 6, 2017 * *------------------------------------------------------------------------- @@ -2734,8 +2719,8 @@ herr_t H5A__delete_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_name) { H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2763,7 +2748,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5A__delete_by_name() */ - + /*------------------------------------------------------------------------- * Function: H5A__delete_by_idx * @@ -2771,7 +2756,7 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * December 6, 2017 * *------------------------------------------------------------------------- @@ -2781,8 +2766,8 @@ H5A__delete_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_ty H5_iter_order_t order, hsize_t n) { H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5B2.c b/src/H5B2.c index c9ed303..5c83de2 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -15,7 +15,7 @@ * * Created: H5B2.c * Jan 31 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implements a B-tree, with several modifications from * the "standard" methods. @@ -129,7 +129,6 @@ H5FL_DEFINE_STATIC(H5B2_t); * filled in), negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 31 2005 * *------------------------------------------------------------------------- @@ -200,7 +199,6 @@ done: * NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 15 2009 * *------------------------------------------------------------------------- @@ -264,7 +262,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -307,7 +304,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 23 2015 * *------------------------------------------------------------------------- @@ -379,7 +375,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 5 2009 * *------------------------------------------------------------------------- @@ -414,7 +409,6 @@ H5B2_get_addr(const H5B2_t *bt2, haddr_t *addr_p) * Return: Value from callback: non-negative on success, negative on error * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 11 2005 * *------------------------------------------------------------------------- @@ -465,7 +459,6 @@ H5B2_iterate(H5B2_t *bt2, H5B2_operator_t op, void *op_data) * Return: Non-negative (TRUE/FALSE) on success, negative on failure. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 23 2005 * *------------------------------------------------------------------------- @@ -705,7 +698,6 @@ done: * Return: Non-negative on success, negative on failure. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 23 2005 * *------------------------------------------------------------------------- @@ -894,7 +886,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 25 2005 * *------------------------------------------------------------------------- @@ -968,7 +959,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 14 2006 * *------------------------------------------------------------------------- @@ -1051,7 +1041,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 25 2005 * *------------------------------------------------------------------------- @@ -1092,7 +1081,6 @@ H5B2_get_nrec(const H5B2_t *bt2, hsize_t *nrec) * Return: Non-negative on success, negative on failure. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 8 2005 * *------------------------------------------------------------------------- @@ -1150,7 +1138,6 @@ done: * Return: Non-negative on success, negative on failure. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 10 2005 * *------------------------------------------------------------------------- @@ -1384,7 +1371,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 15 2009 * *------------------------------------------------------------------------- @@ -1493,7 +1479,6 @@ done: * Return: Non-negative on success, negative on failure. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 9 2005 * *------------------------------------------------------------------------- diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index 68669e8..9ba8235 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -15,7 +15,7 @@ * * Created: H5B2int.c * Feb 27 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Internal routines for managing v2 B-trees. * @@ -101,7 +101,6 @@ H5FL_SEQ_DEFINE(H5B2_node_info_t); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -230,7 +229,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 27 2009 * *------------------------------------------------------------------------- @@ -276,7 +274,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- @@ -355,7 +352,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 13 2009 * *------------------------------------------------------------------------- @@ -391,7 +387,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 13 2009 * *------------------------------------------------------------------------- @@ -428,7 +423,6 @@ done: * Return: SUCCEED (Can't fail) * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 27 2009 * *------------------------------------------------------------------------- @@ -456,7 +450,6 @@ H5B2__hdr_fuse_incr(H5B2_hdr_t *hdr) * Return: The file's reference count after the decrement. (Can't fail) * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 27 2009 * *------------------------------------------------------------------------- @@ -485,7 +478,6 @@ H5B2__hdr_fuse_decr(H5B2_hdr_t *hdr) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 13 2009 * *------------------------------------------------------------------------- @@ -517,7 +509,6 @@ done: * Return: Non-NULL pointer to header on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2015 * *------------------------------------------------------------------------- diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index eb3624b..20c6a4d 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -174,15 +174,14 @@ END_FUNC(PKG) /* end H5EA__hdr_debug() */ /*------------------------------------------------------------------------- - * Function: H5EA__iblock_debug + * Function: H5EA__iblock_debug * - * Purpose: Prints debugging info about a extensible array index block. + * Purpose: Prints debugging info about a extensible array index block. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 11 2008 + * Programmer: Quincey Koziol + * Sep 11 2008 * *------------------------------------------------------------------------- */ @@ -214,7 +213,7 @@ H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int inde /* Load the extensible array header */ if(NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) - H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") + H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Sanity check */ HDassert(H5F_addr_eq(hdr->idx_blk_addr, addr)); @@ -228,16 +227,16 @@ H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int inde /* Print the values */ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Array class ID:", hdr->cparam.cls->name); + "Array class ID:", hdr->cparam.cls->name); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "Index Block size:", - iblock->size); + "Index Block size:", + iblock->size); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "# of data block addresses in index block:", - iblock->ndblk_addrs); + "# of data block addresses in index block:", + iblock->ndblk_addrs); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "# of super block addresses in index block:", - iblock->nsblk_addrs); + "# of super block addresses in index block:", + iblock->nsblk_addrs); /* Check if there are any elements in index block */ if(hdr->cparam.idx_blk_elmts > 0) { @@ -292,21 +291,20 @@ CATCH if(iblock && H5EA__iblock_unprotect(iblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array index block") if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) - H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") + H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__iblock_debug() */ - + /*------------------------------------------------------------------------- - * Function: H5EA__sblock_debug + * Function: H5EA__sblock_debug * - * Purpose: Prints debugging info about a extensible array super block. + * Purpose: Prints debugging info about a extensible array super block. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 30 2008 + * Programmer: Quincey Koziol + * Sep 30 2008 * *------------------------------------------------------------------------- */ @@ -338,7 +336,7 @@ H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Load the extensible array header */ if(NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) - H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") + H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Protect super block */ /* (Note: setting parent of super block to 'hdr' for this operation should be OK -QAK) */ @@ -350,16 +348,16 @@ H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Print the values */ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Array class ID:", hdr->cparam.cls->name); + "Array class ID:", hdr->cparam.cls->name); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "Super Block size:", - sblock->size); + "Super Block size:", + sblock->size); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "# of data block addresses in super block:", - sblock->ndblks); + "# of data block addresses in super block:", + sblock->ndblks); HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, - "# of elements in data blocks from this super block:", - sblock->dblk_nelmts); + "# of elements in data blocks from this super block:", + sblock->dblk_nelmts); /* Check if there are any data block addresses in super block */ if(sblock->ndblks > 0) { diff --git a/src/H5Eint.c b/src/H5Eint.c index fe72449..2371a5f 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -33,7 +33,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5CXprivate.h" /* API Contexts */ #include "H5Epkg.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ @@ -576,7 +575,7 @@ H5E__walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *o ret_value = (op->u.func2)((unsigned)(estack->nused - (size_t)(i + 1)), estack->slot + i, client_data); } /* end else */ - if(ret_value < 0) + if(ret_value < 0) HERROR(H5E_ERROR, H5E_CANTLIST, "can't walk error stack"); } /* end if */ } /* end else */ diff --git a/src/H5F.c b/src/H5F.c index 3dbd292..9d426ac 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -549,8 +549,8 @@ done: * Purpose: Returns a pointer to the file handle of the low-level file * driver. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -637,9 +637,7 @@ done: * the list of file creation and file access properties. * * Return: Success: A file ID - * * Failure: H5I_INVALID_HID - * *------------------------------------------------------------------------- */ hid_t @@ -739,9 +737,7 @@ done: * See Also: H5Fpublic.h for a list of possible values for FLAGS. * * Return: Success: A file ID - * * Failure: H5I_INVALID_HID - * *------------------------------------------------------------------------- */ hid_t @@ -820,7 +816,8 @@ done: * not remove them from the cache. The OBJECT_ID can be a file, * dataset, group, attribute, or named data type. * - * Return: Non-negative on success/Negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1008,7 +1005,8 @@ done: * Purpose: Public API to retrieve the file's 'intent' flags passed * during H5Fopen() * - * Return: Non-negative on success/negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1079,9 +1077,7 @@ done: * Purpose: Retrieves the amount of free space in the file. * * Return: Success: Amount of free space for type - * * Failure: -1 - * *------------------------------------------------------------------------- */ hssize_t @@ -1175,9 +1171,7 @@ done: * this now. * * Return: Success: Bytes copied / number of bytes needed - * * Failure: -1 - * *------------------------------------------------------------------------- */ ssize_t @@ -1212,8 +1206,8 @@ done: * filled in by the caller. This allows us to adapt for * obsolete versions of the structure. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1249,8 +1243,8 @@ done: * configuration, using the contents of the instance of * H5AC_cache_config_t pointed to by config_ptr. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1283,8 +1277,8 @@ done: * the hit rate statistics were reset either manually or * automatically. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1320,8 +1314,8 @@ done: * the ptr parameters are NULL, the associated datum is * not returned. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1360,8 +1354,8 @@ done: * you are controlling cache size from your program instead * of using our cache size control code. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1402,9 +1396,7 @@ done: * not the actual name after resolving symlinks, etc. * * Return: Success: The length of the file name - * * Failure: -1 - * *------------------------------------------------------------------------- */ ssize_t @@ -1444,8 +1436,8 @@ done: * in the SOHM table if there is one. * 3. The amount of free space tracked in the file. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1486,8 +1478,8 @@ done: * Purpose: To retrieve the collection of read retries for metadata * items with checksum. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1525,9 +1517,7 @@ done: * sections. * * Return: Success: The total # of free space sections - * * Failure: -1 - * *------------------------------------------------------------------------- */ ssize_t @@ -1562,8 +1552,8 @@ done: * provided file, potentially closing any cached files * unless they are held open from somewhere\ else. * - * Return: SUCCEED/FAIL - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1618,8 +1608,8 @@ done: * set up flush dependency/proxy even for file opened without * SWMR to resolve issues with opened objects. * - * Return: Non-negative on success/negative on failure - * + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1654,7 +1644,8 @@ done: * Purpose: Start metadata cache logging operations for a file. * - Logging must have been set up via the fapl. * - * Return: Non-negative on success/Negative on errors + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1686,7 +1677,8 @@ done: * - Does not close the log file. * - Logging must have been set up via the fapl. * - * Return: Non-negative on success/Negative on errors + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1718,7 +1710,8 @@ done: * set up via the fapl. is_currently_logging determines if * log messages are being recorded at this time. * - * Return: Non-negative on success/Negative on errors + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1752,7 +1745,8 @@ done: * H5Fset_latest_format() starting release 1.10.2. * See explanation for H5Fset_latest_format() in H5Fdeprec.c. * - * Return: Non-negative on success/Negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1788,7 +1782,8 @@ done: * downgrade persistent file space to non-persistent * for 1.8 library. * - * Return: Non-negative on success/Negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1822,7 +1817,8 @@ done: * * Purpose: Resets statistics for the page buffer layer. * - * Return: Non-negative on success/Negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1852,7 +1848,8 @@ done: * * Purpose: Retrieves statistics for the page buffer layer. * - * Return: Non-negative on success/Negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1890,7 +1887,8 @@ done: * image_len: --size of the on disk metadata cache image * --zero if no cache image * - * Return: Non-negative on success/Negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1918,14 +1916,12 @@ done: /*------------------------------------------------------------------------- * Function: H5Fget_eoa * - * Purpose: Returns the address of the first byte after the last + * Purpose: Gets the address of the first byte after the last * allocated memory in the file. * (See H5FDget_eoa() in H5FD.c) * - * Return: Success: First byte after allocated memory. - * Failure: HADDR_UNDEF - * - * Non-negative on success/Negative on failure + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1958,7 +1954,8 @@ done: * * Purpose: Set the EOA for the file to the maximum of (EOA, EOF) + increment * - * Return: Non-negative on success/Negative on errors + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -1984,24 +1981,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fget_dset_no_attrs_hint - * - * Purpose: - * - * Get the file-level setting to create minimized dataset object headers. - * Result is stored at pointer `minimize`. - * - * Return: + * Function: H5Fget_dset_no_attrs_hint * - * Success: SUCCEED (0) (non-negative value) - * Failure: FAIL (-1) (negative value) + * Purpose: Get the file-level setting to create minimized dataset object headers. + * Result is stored at pointer `minimize`. * - * Programmer: - * - * Jacob Smith - * 15 August 2018 - * - * Changes: None. + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t @@ -2029,23 +2015,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fset_dset_no_attrs_hint - * - * Purpose: - * - * Set the file-level setting to create minimized dataset object headers. + * Function: H5Fset_dset_no_attrs_hint * - * Return: + * Purpose: Set the file-level setting to create minimized dataset object + * headers. * - * Success: SUCCEED (0) (non-negative value) - * Failure: FAIL (-1) (negative value) - * - * Programmer: - * - * Jacob Smith - * 15 August 2018 - * - * Changes: None. + * Return: Success: Non-negative + * Failure: Negative *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 0243b41..2461c51 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -809,9 +809,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_loc_info + * Function: H5G_loc_info * - * Purpose: Retrieve the data model information for an object from a group location + * Purpose: Retrieve the data model information for an object from a group location * and path to that object * * Return: Non-negative on success/Negative on failure diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index 72402e4..cb31cec 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -15,7 +15,7 @@ * * Created: H5Ochunk.c * Jul 13 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Object header chunk routines. * @@ -84,7 +84,6 @@ H5FL_DEFINE(H5O_chunk_proxy_t); * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 13 2008 * *------------------------------------------------------------------------- @@ -146,14 +145,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_chunk_protect + * Function: H5O__chunk_protect * * Purpose: Protect an object header chunk for modifications * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 17 2008 * *------------------------------------------------------------------------- @@ -227,7 +225,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 17 2008 * *------------------------------------------------------------------------- @@ -278,7 +275,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 6 2010 * *------------------------------------------------------------------------- @@ -319,7 +315,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 13 2008 * *------------------------------------------------------------------------- @@ -370,7 +365,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 13 2008 * *------------------------------------------------------------------------- @@ -415,7 +409,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 13, 2008 * *------------------------------------------------------------------------- diff --git a/src/H5Ocont.c b/src/H5Ocont.c index ad54272..68a88e2 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -15,7 +15,7 @@ * * Created: H5Ocont.c * Aug 6 1997 - * Robb Matzke + * Robb Matzke * * Purpose: The object header continuation message. This * message is only generated and read from within @@ -83,7 +83,6 @@ H5FL_DEFINE(H5O_cont_t); * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -127,7 +126,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 7 1997 * *------------------------------------------------------------------------- @@ -166,7 +164,6 @@ H5O__cont_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co * Failure: zero * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 6 2005 * *------------------------------------------------------------------------- @@ -253,7 +250,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- diff --git a/src/H5TS.c b/src/H5TS.c index 3643ed5..ee3b219 100644 --- a/src/H5TS.c +++ b/src/H5TS.c @@ -678,3 +678,4 @@ H5TS_create_thread(void *(*func)(void *), H5TS_attr_t *attr, void *udata) } /* H5TS_create_thread */ #endif /* H5_HAVE_THREADSAFE */ + -- cgit v0.12 From ef6db167a86e6c065d46963dbd75cd325fe83813 Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Tue, 28 Jul 2020 16:26:20 -0500 Subject: H5R: fix encoding of references that are part of compound types Add corresponding test and some debug information --- src/H5Rint.c | 2 +- src/H5T.c | 4 +- src/H5Tpkg.h | 2 +- src/H5Tref.c | 31 ++++++ test/trefer.c | 303 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 338 insertions(+), 4 deletions(-) diff --git a/src/H5Rint.c b/src/H5Rint.c index 6dfbf2b..0acc887 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -86,7 +86,7 @@ } while(0) /* Debug */ -//#define H5R_DEBUG +// #define H5R_DEBUG #ifdef H5R_DEBUG #define H5R_LOG_DEBUG(...) do { \ HDfprintf(stdout, " # %s(): ", __func__); \ diff --git a/src/H5T.c b/src/H5T.c index 25c1f75..991095d 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -5718,9 +5718,9 @@ H5T_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) break; case H5T_VLEN: /* Recurse on the VL information if it's VL, compound or array, then free VL sequence */ - /* Recurse if it's VL, compound, enum or array */ + /* Recurse if it's VL, compound, enum or array (ignore references here so that we can encode them as part of the same blob)*/ /* (If the force_conv flag is _not_ set, the type cannot change in size, so don't recurse) */ - if(dt->shared->parent->shared->force_conv && H5T_IS_COMPLEX(dt->shared->parent->shared->type)) { + if(dt->shared->parent->shared->force_conv && H5T_IS_COMPLEX(dt->shared->parent->shared->type) && (dt->shared->parent->shared->type != H5T_REFERENCE)) { if((changed = H5T_set_loc(dt->shared->parent, file, loc)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); if(changed > 0) diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 600d7aa..3eaec8c 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -49,7 +49,7 @@ #define H5T_NAMELEN 32 /* Macro to ease detecting "complex" datatypes (i.e. those with base types or fields) */ -#define H5T_IS_COMPLEX(t) ((t) == H5T_COMPOUND || (t) == H5T_ENUM || (t) == H5T_VLEN || (t) == H5T_ARRAY) +#define H5T_IS_COMPLEX(t) ((t) == H5T_COMPOUND || (t) == H5T_ENUM || (t) == H5T_VLEN || (t) == H5T_ARRAY || (t) == H5T_REFERENCE) /* Macro to ease detecting fixed "string" datatypes */ #define H5T_IS_FIXED_STRING(dt) (H5T_STRING == (dt)->type) diff --git a/src/H5Tref.c b/src/H5Tref.c index 7c59e75..42e3da2 100644 --- a/src/H5Tref.c +++ b/src/H5Tref.c @@ -40,6 +40,19 @@ #define H5T_REF_OBJ_DISK_SIZE(f) (H5F_SIZEOF_ADDR(f)) #define H5T_REF_DSETREG_DISK_SIZE(f) (H5HG_HEAP_ID_SIZE(f)) +/* Debug */ +// #define H5T_REF_DEBUG +#ifdef H5T_REF_DEBUG +#define H5T_REF_LOG_DEBUG(...) do { \ + HDfprintf(stdout, " # %s(): ", __func__); \ + HDfprintf(stdout, __VA_ARGS__); \ + HDfprintf(stdout, "\n"); \ + HDfflush(stdout); \ + } while (0) +#else +#define H5T_REF_LOG_DEBUG(...) do { } while (0) +#endif + /******************/ /* Local Typedefs */ /******************/ @@ -133,6 +146,7 @@ H5T__ref_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) htri_t ret_value = FALSE; /* Indicate success, but no location change */ FUNC_ENTER_PACKAGE + H5T_REF_LOG_DEBUG("loc=%d", (int)loc); HDassert(dt); /* f is NULL when loc == H5T_LOC_MEMORY */ @@ -319,6 +333,7 @@ H5T__ref_mem_isnull(const H5VL_object_t H5_ATTR_UNUSED *src_file, herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC_NOERR + H5T_REF_LOG_DEBUG(""); /* Check parameters */ HDassert(src_buf); @@ -346,6 +361,7 @@ H5T__ref_mem_setnull(H5VL_object_t H5_ATTR_UNUSED *dst_file, void *dst_buf, herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC_NOERR + H5T_REF_LOG_DEBUG(""); HDmemset(dst_buf, 0, H5T_REF_MEM_SIZE); @@ -373,6 +389,7 @@ H5T__ref_mem_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf size_t ret_value = 0; /* Return value */ FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); /* Sanity check */ HDassert(src_buf); @@ -471,6 +488,7 @@ H5T__ref_mem_read(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); /* Sanity check */ HDassert(src_buf); @@ -557,6 +575,7 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); /* Sanity check */ HDassert(src_buf); @@ -670,6 +689,7 @@ H5T__ref_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); /* Check parameters */ HDassert(src_file); @@ -712,6 +732,7 @@ H5T__ref_disk_setnull(H5VL_object_t *dst_file, void *dst_buf, void *bg_buf) herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); HDassert(dst_file); HDassert(dst_buf); @@ -761,6 +782,7 @@ H5T__ref_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_bu size_t ret_value = 0; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); HDassert(src_buf); @@ -810,6 +832,7 @@ H5T__ref_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t H5_ATTR_ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); HDassert(src_file); HDassert(src_buf); @@ -856,6 +879,7 @@ H5T__ref_disk_write(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); HDassert(src_buf); HDassert(src_size); @@ -915,6 +939,7 @@ static herr_t H5T__ref_obj_disk_isnull(const H5VL_object_t *src_file, herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); /* Check parameters */ HDassert(src_file); @@ -967,6 +992,7 @@ H5T__ref_obj_disk_getsize(H5VL_object_t *src_file, const void H5_ATTR_UNUSED *sr size_t ret_value = 0; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); HDassert(src_file); HDassert(src_buf); @@ -1014,6 +1040,7 @@ H5T__ref_obj_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t src_ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); HDassert(src_file); HDassert(src_buf); @@ -1068,6 +1095,7 @@ H5T__ref_dsetreg_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); /* Check parameters */ HDassert(src_file); @@ -1123,6 +1151,7 @@ H5T__ref_dsetreg_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, #else FUNC_ENTER_STATIC_NOERR #endif + H5T_REF_LOG_DEBUG(""); HDassert(src_buf); @@ -1171,6 +1200,7 @@ H5T__ref_dsetreg_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + H5T_REF_LOG_DEBUG(""); HDassert(src_file); HDassert(src_buf); @@ -1221,6 +1251,7 @@ H5T_ref_reclaim(void *elem, const H5T_t *dt) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT + H5T_REF_LOG_DEBUG(""); /* Sanity checks */ HDassert(elem); diff --git a/test/trefer.c b/test/trefer.c index fd97239..f9a6863 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -24,6 +24,7 @@ #define FILE_REF_PARAM "trefer_param.h5" #define FILE_REF_OBJ "trefer_obj.h5" #define FILE_REF_VL_OBJ "trefer_vl_obj.h5" +#define FILE_REF_CMPND_OBJ "trefer_cmpnd_obj.h5" #define FILE_REF_REG "trefer_reg.h5" #define FILE_REF_REG_1D "trefer_reg_1d.h5" #define FILE_REF_OBJ_DEL "trefer_obj_del.h5" @@ -56,6 +57,15 @@ typedef struct s1_t { float c; } s1_t; +/* Compound datatype with reference */ +typedef struct s2_t { + H5R_ref_t ref0; /* reference */ + H5R_ref_t ref1; /* reference */ + H5R_ref_t ref2; /* reference */ + H5R_ref_t ref3; /* reference */ + unsigned int dim_idx; /* dimension index of the dataset */ +} s2_t; + #define GROUPNAME "/group" #define GROUPNAME2 "group2" #define GROUPNAME3 "group3" @@ -806,6 +816,297 @@ test_reference_vlen_obj(void) /**************************************************************** ** +** test_reference_cmpnd_obj(): Test basic H5R (reference) object reference +** within a compound type. +** Tests references to various kinds of objects +** +****************************************************************/ +static void +test_reference_cmpnd_obj(void) +{ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, /* Dataset ID */ + dset2; /* Dereferenced dataset ID */ + hid_t group; /* Group ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t cmpnd_dims[] = {1}; + hid_t dapl_id; /* Dataset access property list */ + H5R_ref_t *wbuf, /* buffer to write to disk */ + *rbuf; /* buffer read from disk */ + unsigned *ibuf, *obuf; + unsigned i, j; /* Counters */ + H5O_type_t obj_type; /* Object type */ + herr_t ret; /* Generic return value */ + s2_t cmpnd_wbuf, cmpnd_rbuf; + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Object Reference Functions within compound type\n")); + + /* Allocate write & read buffers */ + wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); + rbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); + ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); + obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); + + for (i = 0; i < SPACE1_DIM1; i++) + obuf[i] = i * 3; + + /* Create file */ + fid1 = H5Fcreate(FILE_REF_CMPND_OBJ, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(fid1, H5I_INVALID_HID, "H5Fcreate"); + + /* Create dataspace for datasets */ + sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); + CHECK(sid1, H5I_INVALID_HID, "H5Screate_simple"); + + /* Create dataset access property list */ + dapl_id = H5Pcreate(H5P_DATASET_ACCESS); + CHECK(dapl_id, H5I_INVALID_HID, "H5Pcreate"); + + /* Create a group */ + group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(group, H5I_INVALID_HID, "H5Gcreate2"); + + /* Create a dataset (inside Group1) */ + dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2"); + + /* Write selection to disk */ + ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obuf); + CHECK(ret, FAIL, "H5Dwrite"); + + /* Close Dataset */ + ret = H5Dclose(dataset); + CHECK(ret, FAIL, "H5Dclose"); + + /* Create another dataset (inside Group1) */ + dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, FAIL, "H5Dcreate2"); + + /* Close Dataset */ + ret = H5Dclose(dataset); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close disk dataspace */ + ret = H5Sclose(sid1); + CHECK(ret, FAIL, "H5Sclose"); + + /* Create a datatype to refer to */ + tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t)); + CHECK(tid1, H5I_INVALID_HID, "H5Tcreate"); + + /* Insert fields */ + ret = H5Tinsert(tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT); + CHECK(ret, FAIL, "H5Tinsert"); + + ret = H5Tinsert(tid1, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT); + CHECK(ret, FAIL, "H5Tinsert"); + + ret = H5Tinsert(tid1, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT); + CHECK(ret, FAIL, "H5Tinsert"); + + /* Save datatype for later */ + ret = H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); + + /* Close datatype */ + ret = H5Tclose(tid1); + CHECK(ret, FAIL, "H5Tclose"); + + /* Close group */ + ret = H5Gclose(group); + CHECK(ret, FAIL, "H5Gclose"); + + /* Create compound type */ + tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s2_t)); + CHECK(tid1, H5I_INVALID_HID, "H5Tcreate"); + + /* Insert fields */ + ret = H5Tinsert(tid1, "ref0", HOFFSET(s2_t, ref0), H5T_STD_REF); + CHECK(ret, FAIL, "H5Tinsert"); + + ret = H5Tinsert(tid1, "ref1", HOFFSET(s2_t, ref1), H5T_STD_REF); + CHECK(ret, FAIL, "H5Tinsert"); + + ret = H5Tinsert(tid1, "ref2", HOFFSET(s2_t, ref2), H5T_STD_REF); + CHECK(ret, FAIL, "H5Tinsert"); + + ret = H5Tinsert(tid1, "ref3", HOFFSET(s2_t, ref3), H5T_STD_REF); + CHECK(ret, FAIL, "H5Tinsert"); + + ret = H5Tinsert(tid1, "dim_idx", HOFFSET(s2_t, dim_idx), H5T_NATIVE_INT); + CHECK(ret, FAIL, "H5Tinsert"); + + /* Create dataspace for datasets */ + sid1 = H5Screate_simple(SPACE1_RANK, cmpnd_dims, NULL); + CHECK(sid1, H5I_INVALID_HID, "H5Screate_simple"); + + /* Create a dataset */ + dataset = H5Dcreate2(fid1, "Dataset3", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2"); + + /* Create reference to dataset */ + ret = H5Rcreate_object(fid1, "/Group1/Dataset1", H5P_DEFAULT, &wbuf[0]); + CHECK(ret, FAIL, "H5Rcreate_object"); + ret = H5Rget_obj_type3(&wbuf[0], H5P_DEFAULT, &obj_type); + CHECK(ret, FAIL, "H5Rget_obj_type3"); + VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3"); + + /* Create reference to dataset */ + ret = H5Rcreate_object(fid1, "/Group1/Dataset2", H5P_DEFAULT, &wbuf[1]); + CHECK(ret, FAIL, "H5Rcreate_object"); + ret = H5Rget_obj_type3(&wbuf[1], H5P_DEFAULT, &obj_type); + CHECK(ret, FAIL, "H5Rget_obj_type3"); + VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3"); + + /* Create reference to group */ + ret = H5Rcreate_object(fid1, "/Group1", H5P_DEFAULT, &wbuf[2]); + CHECK(ret, FAIL, "H5Rcreate_object"); + ret = H5Rget_obj_type3(&wbuf[2], H5P_DEFAULT, &obj_type); + CHECK(ret, FAIL, "H5Rget_obj_type3"); + VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type3"); + + /* Create reference to named datatype */ + ret = H5Rcreate_object(fid1, "/Group1/Datatype1", H5P_DEFAULT, &wbuf[3]); + CHECK(ret, FAIL, "H5Rcreate_object"); + ret = H5Rget_obj_type3(&wbuf[3], H5P_DEFAULT, &obj_type); + CHECK(ret, FAIL, "H5Rget_obj_type3"); + VERIFY(obj_type, H5O_TYPE_NAMED_DATATYPE, "H5Rget_obj_type3"); + + /* Store dimensions */ + cmpnd_wbuf.ref0 = wbuf[0]; + cmpnd_wbuf.ref1 = wbuf[1]; + cmpnd_wbuf.ref2 = wbuf[2]; + cmpnd_wbuf.ref3 = wbuf[3]; + cmpnd_wbuf.dim_idx = SPACE1_DIM1; + + /* Write selection to disk */ + ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, &cmpnd_wbuf); + CHECK(ret, FAIL, "H5Dwrite"); + + /* Close disk dataspace */ + ret = H5Sclose(sid1); + CHECK(ret, FAIL, "H5Sclose"); + + /* Close Dataset */ + ret = H5Dclose(dataset); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close datatype */ + ret = H5Tclose(tid1); + CHECK(ret, FAIL, "H5Tclose"); + + /* Close file */ + ret = H5Fclose(fid1); + CHECK(ret, FAIL, "H5Fclose"); + + /* Re-open the file */ + fid1 = H5Fopen(FILE_REF_CMPND_OBJ, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid1, H5I_INVALID_HID, "H5Fopen"); + + /* Open the dataset */ + dataset = H5Dopen2(fid1, "/Dataset3", H5P_DEFAULT); + CHECK(dataset, H5I_INVALID_HID, "H5Dopen2"); + + tid1 = H5Dget_type(dataset); + CHECK(tid1, H5I_INVALID_HID, "H5Dget_type"); + + /* Read selection from disk */ + ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, &cmpnd_rbuf); + CHECK(ret, FAIL, "H5Dread"); + + VERIFY(cmpnd_rbuf.dim_idx, SPACE1_DIM1, "H5Dread"); + rbuf[0] = cmpnd_rbuf.ref0; + rbuf[1] = cmpnd_rbuf.ref1; + rbuf[2] = cmpnd_rbuf.ref2; + rbuf[3] = cmpnd_rbuf.ref3; + + /* Close datatype */ + ret = H5Tclose(tid1); + CHECK(ret, FAIL, "H5Tclose"); + + /* Open dataset object */ + dset2 = H5Ropen_object(&rbuf[0], H5P_DEFAULT, dapl_id); + CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object"); + + /* Check information in referenced dataset */ + sid1 = H5Dget_space(dset2); + CHECK(sid1, H5I_INVALID_HID, "H5Dget_space"); + + ret = (int)H5Sget_simple_extent_npoints(sid1); + VERIFY(ret, SPACE1_DIM1, "H5Sget_simple_extent_npoints"); + + /* Read from disk */ + ret = H5Dread(dset2, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf); + CHECK(ret, FAIL, "H5Dread"); + + for(i = 0; i < SPACE1_DIM1; i++) + VERIFY(ibuf[i], i * 3, "Data"); + + /* Close dereferenced Dataset */ + ret = H5Dclose(dset2); + CHECK(ret, FAIL, "H5Dclose"); + + /* Open group object. GAPL isn't supported yet. But it's harmless to pass in */ + group = H5Ropen_object(&rbuf[2], H5P_DEFAULT, H5P_DEFAULT); + CHECK(group, H5I_INVALID_HID, "H5Ropen_object"); + + /* Close group */ + ret = H5Gclose(group); + CHECK(ret, FAIL, "H5Gclose"); + + /* Open datatype object. TAPL isn't supported yet. But it's harmless to pass in */ + tid1 = H5Ropen_object(&rbuf[3], H5P_DEFAULT, H5P_DEFAULT); + CHECK(tid1, H5I_INVALID_HID, "H5Ropen_object"); + + /* Verify correct datatype */ + { + H5T_class_t tclass; + + tclass = H5Tget_class(tid1); + VERIFY(tclass, H5T_COMPOUND, "H5Tget_class"); + + ret= H5Tget_nmembers(tid1); + VERIFY(ret, 3, "H5Tget_nmembers"); + } + + /* Close datatype */ + ret = H5Tclose(tid1); + CHECK(ret, FAIL, "H5Tclose"); + + /* Close Dataset */ + ret = H5Dclose(dataset); + CHECK(ret, FAIL, "H5Dclose"); + + /* Close dataset access property list */ + ret = H5Pclose(dapl_id); + CHECK(ret, FAIL, "H5Pclose"); + + /* Close file */ + ret = H5Fclose(fid1); + CHECK(ret, FAIL, "H5Fclose"); + + /* Destroy references */ + for(j = 0; j < SPACE1_DIM1; j++) { + ret = H5Rdestroy(&wbuf[j]); + CHECK(ret, FAIL, "H5Rdestroy"); + } + for(j = 0; j < SPACE1_DIM1; j++) { + ret = H5Rdestroy(&rbuf[j]); + CHECK(ret, FAIL, "H5Rdestroy"); + } + + /* Free memory buffers */ + HDfree(wbuf); + HDfree(rbuf); + HDfree(ibuf); + HDfree(obuf); +} /* test_reference_cmpnd_obj() */ + +/**************************************************************** +** ** test_reference_region(): Test basic H5R (reference) object reference code. ** Tests references to various kinds of objects ** @@ -3131,6 +3432,7 @@ test_reference(void) test_reference_params(); /* Test for correct parameter checking */ test_reference_obj(); /* Test basic H5R object reference code */ test_reference_vlen_obj(); /* Test reference within vlen */ + test_reference_cmpnd_obj(); /* Test reference within compound type */ /* Loop through all the combinations of low/high version bounds */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { @@ -3177,6 +3479,7 @@ cleanup_reference(void) HDremove(FILE_REF_PARAM); HDremove(FILE_REF_OBJ); HDremove(FILE_REF_VL_OBJ); + HDremove(FILE_REF_CMPND_OBJ); HDremove(FILE_REF_REG); HDremove(FILE_REF_REG_1D); HDremove(FILE_REF_OBJ_DEL); -- cgit v0.12 From fc57490e02835ddfce644135e93e893f77b379d3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 31 Jul 2020 07:49:48 -0500 Subject: Mingw copy disabled --- tools/test/h5diff/CMakeTests.cmake | 7 ++++--- tools/test/h5jam/tellub.c | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 74e3929..5aa1d1a 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -341,9 +341,10 @@ # Overwrite system dependent files (Windows) and not VS2015 # set (COPY_WINDOWS_FILES false) - if (MINGW) - set (COPY_WINDOWS_FILES true) - endif () + # MinGW tests may depend on host system + #if (MINGW) + # set (COPY_WINDOWS_FILES true) + #endif () if (WIN32 AND MSVC_VERSION LESS 1900) set (COPY_WINDOWS_FILES true) endif () diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c index e7bb561..453444d 100644 --- a/tools/test/h5jam/tellub.c +++ b/tools/test/h5jam/tellub.c @@ -71,6 +71,7 @@ parse_command_line (int argc, const char *argv[]) case 'h': usage (h5tools_getprogname()); h5tools_setstatus(EXIT_SUCCESS); + break; case '?': default: usage (h5tools_getprogname()); @@ -105,7 +106,7 @@ int main (int argc, const char *argv[]) { char *ifname; - hid_t ifile; + hid_t ifile = H5I_INVALID_HID; hsize_t usize; htri_t testval; herr_t status; @@ -165,7 +166,8 @@ main (int argc, const char *argv[]) done: H5Pclose (plist); - H5Fclose (ifile); + if(ifile >= 0) + H5Fclose (ifile); leave(h5tools_getstatus()); } /* end main() */ -- cgit v0.12 From 08dca47475f41e93348cf0c2ea708e787c232014 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 31 Jul 2020 11:40:29 -0700 Subject: Minor normalizations with hdf5_1_10 --- test/chunk_info.c | 28 +-- test/dtypes.c | 598 ++++++++++++++++++++++----------------------------- test/gen_new_super.c | 34 ++- test/gen_nullspace.c | 27 ++- test/links.c | 19 +- test/th5o.c | 22 +- test/trefer.c | 8 +- test/vds_swmr.h | 2 - test/vfd.c | 7 +- 9 files changed, 331 insertions(+), 414 deletions(-) diff --git a/test/chunk_info.c b/test/chunk_info.c index 0afff66..3ed1d56 100644 --- a/test/chunk_info.c +++ b/test/chunk_info.c @@ -685,7 +685,7 @@ test_get_chunk_info_highest_v18(hid_t fapl) /* Verify that the number of chunks is NUM_CHUNKS */ if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR - VERIFY(nchunks, NUM_CHUNKS, "H5Dget_num_chunks, number of chunks"); + if(nchunks != NUM_CHUNKS) TEST_ERROR /* Attempt to get info of a chunk from an empty dataset, verify the returned address and size in the case of H5D_ALLOC_TIME_EARLY */ @@ -693,11 +693,12 @@ test_get_chunk_info_highest_v18(hid_t fapl) reinit_vars(&read_flt_msk, &addr, &size); ret = H5Dget_chunk_info(dset, dspace, chk_index, out_offset, &read_flt_msk, &addr, &size); if(ret < 0) TEST_ERROR + /* Because of H5D_ALLOC_TIME_EARLY, addr cannot be HADDR_UNDEF and size not 0 */ if(addr == HADDR_UNDEF) - FAIL_PUTS_ERROR(MSG_CHK_ADDR); + TEST_ERROR if(size == EMPTY_CHK_SIZE) - FAIL_PUTS_ERROR(MSG_CHK_SIZE); + TEST_ERROR chk_index = 10; reinit_vars(&read_flt_msk, &addr, &size); @@ -705,9 +706,9 @@ test_get_chunk_info_highest_v18(hid_t fapl) if(ret < 0) TEST_ERROR /* Because of H5D_ALLOC_TIME_EARLY, addr cannot be HADDR_UNDEF and size not 0 */ if(addr == HADDR_UNDEF) - FAIL_PUTS_ERROR(MSG_CHK_ADDR); + TEST_ERROR if(size == EMPTY_CHK_SIZE) - FAIL_PUTS_ERROR(MSG_CHK_SIZE); + TEST_ERROR /* Attempt to get info of a chunk given its coords from an empty dataset, verify the returned address and size */ @@ -717,9 +718,9 @@ test_get_chunk_info_highest_v18(hid_t fapl) TEST_ERROR /* Because of H5D_ALLOC_TIME_EARLY, addr cannot be HADDR_UNDEF and size not 0 */ if(addr == HADDR_UNDEF) - FAIL_PUTS_ERROR(MSG_CHK_ADDR); + TEST_ERROR if(size == 0) - FAIL_PUTS_ERROR(MSG_CHK_SIZE); + TEST_ERROR if(H5Dclose(dset) < 0) TEST_ERROR @@ -819,7 +820,7 @@ test_chunk_info_single_chunk(const char *filename, hid_t fapl) /* Get the number of chunks and verify that no chunk has been written */ if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR - VERIFY(nchunks, NO_CHUNK_WRITTEN, "H5Dget_num_chunks, number of chunks"); + if(nchunks != NO_CHUNK_WRITTEN) TEST_ERROR /* Initialize the array of chunk data for the single chunk */ for(ii = 0; ii < NX; ii++) @@ -832,7 +833,7 @@ test_chunk_info_single_chunk(const char *filename, hid_t fapl) /* Get and verify that one chunk had been written */ if(H5Dget_num_chunks(dset, dspace, &nchunks) < 0) TEST_ERROR - VERIFY(nchunks, ONE_CHUNK_WRITTEN, "H5Dget_num_chunks, number of chunks"); + if(nchunks != ONE_CHUNK_WRITTEN) TEST_ERROR /* Offset of the only chunk */ offset[0] = 0; @@ -1937,8 +1938,7 @@ error: * * Purpose: Tests functions related to chunk information * - * Return: Success: SUCCEED - * Failure: FAIL + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Binh-Minh Ribler * November 5, 2018 @@ -1969,19 +1969,19 @@ main(void) nerrors += test_flt_msk_with_skip_compress(fapl) < 0 ? 1 : 0; if(nerrors) - TEST_ERROR + goto error; HDprintf("All chunk query tests passed.\n"); h5_cleanup(FILENAME, fapl); - return SUCCEED; + return EXIT_SUCCESS; error: nerrors = MAX(1, nerrors); HDprintf("***** %d QUERY CHUNK INFO TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - return FAIL; + return EXIT_FAILURE; } /**************************************************************************** diff --git a/test/dtypes.c b/test/dtypes.c index 0f95830..6dfc47d 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -134,10 +134,8 @@ typedef enum { static int num_opaque_conversions_g = 0; static int opaque_check(int tag_it); -static herr_t convert_opaque(hid_t st, hid_t dt, - H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, +static herr_t convert_opaque(hid_t st, hid_t dt, H5T_cdata_t *cdata, + size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *bkg, hid_t dset_xfer_plid); static int opaque_long(void); static int opaque_funcs(void); @@ -146,16 +144,13 @@ static int opaque_funcs(void); /*------------------------------------------------------------------------- * Function: reset_hdf5 * - * Purpose: Reset the hdf5 library. This causes statistics to be printed - * and counters to be reset. + * Purpose: Reset the hdf5 library. This causes statistics to be printed + * and counters to be reset. * - * Return: void + * Return: void * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, November 16, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -189,14 +184,10 @@ reset_hdf5(void) * Purpose: Test type classes * * Return: Success: 0 - * * Failure: number of errors * * Programmer: Robb Matzke * Tuesday, December 9, 1997 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -290,20 +281,16 @@ test_classes(void) * Purpose: Are we able to copy a datatype? * * Return: Success: 0 - * * Failure: number of errors * * Programmer: Robb Matzke * Tuesday, December 9, 1997 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_copy(void) { - hid_t a_copy; + hid_t a_copy; herr_t status; TESTING("H5Tcopy()"); @@ -313,12 +300,12 @@ test_copy(void) /* We should not be able to close a built-in byte */ H5E_BEGIN_TRY { - status = H5Tclose (H5T_NATIVE_SCHAR); + status = H5Tclose (H5T_NATIVE_SCHAR); } H5E_END_TRY; if (status>=0) { - H5_FAILED(); - HDputs (" Should not be able to close a predefined type!"); - goto error; + H5_FAILED(); + HDputs (" Should not be able to close a predefined type!"); + goto error; } PASSED(); @@ -336,7 +323,6 @@ test_copy(void) * in nested types) * * Return: Success: 0 - * * Failure: number of errors * * Programmer: Quincey Koziol @@ -512,14 +498,10 @@ error: * Purpose: Tests various things about compound datatypes. * * Return: Success: 0 - * * Failure: number of errors * * Programmer: Robb Matzke * Wednesday, January 7, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -673,38 +655,34 @@ error: /*------------------------------------------------------------------------- * Function: test_compound_2 * - * Purpose: Tests a compound type conversion where the source and - * destination are the same except for the order of the - * elements. - * - * Return: Success: 0 + * Purpose: Tests a compound type conversion where the source and + * destination are the same except for the order of the + * elements. * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 17, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_compound_2(void) { struct st { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } *s_ptr; struct dt { - int e, d, c[4], b, a; + int e, d, c[4], b, a; } *d_ptr; const size_t nelmts = NTESTELEM; - const hsize_t four = 4; - unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; - hid_t st=-1, dt=-1; - hid_t array_dt; - int64_t nmembs; - int i; + const hsize_t four = 4; + unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; + hid_t st=-1, dt=-1; + hid_t array_dt; + int64_t nmembs; + int i; TESTING("compound element reordering"); @@ -716,15 +694,15 @@ test_compound_2(void) bkg = (unsigned char*)HDmalloc(nelmts * sizeof(struct dt)); orig = (unsigned char*)HDmalloc(nelmts * sizeof(struct st)); for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)((void *)orig)) + i; - s_ptr->a = i*8+0; - s_ptr->b = i*8+1; - s_ptr->c[0] = i*8+2; - s_ptr->c[1] = i*8+3; - s_ptr->c[2] = i*8+4; - s_ptr->c[3] = i*8+5; - s_ptr->d = i*8+6; - s_ptr->e = i*8+7; + s_ptr = ((struct st*)((void *)orig)) + i; + s_ptr->a = i*8+0; + s_ptr->b = i*8+1; + s_ptr->c[0] = i*8+2; + s_ptr->c[1] = i*8+3; + s_ptr->c[2] = i*8+4; + s_ptr->c[3] = i*8+5; + s_ptr->d = i*8+6; + s_ptr->e = i*8+7; } HDmemcpy(buf, orig, nelmts*sizeof(struct st)); @@ -754,26 +732,26 @@ test_compound_2(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)((void *)orig)) + i; - d_ptr = ((struct dt*)((void *)buf)) + i; - if (s_ptr->a != d_ptr->a || - s_ptr->b != d_ptr->b || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->d != d_ptr->d || - s_ptr->e != d_ptr->e) { - H5_FAILED(); - HDprintf(" i=%d\n", i); - HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], - s_ptr->c[3], s_ptr->d, s_ptr->e); - HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], - d_ptr->c[3], d_ptr->d, d_ptr->e); - goto error; - } + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; + if (s_ptr->a != d_ptr->a || + s_ptr->b != d_ptr->b || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->d != d_ptr->d || + s_ptr->e != d_ptr->e) { + H5_FAILED(); + HDprintf(" i=%d\n", i); + HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], + s_ptr->c[3], s_ptr->d, s_ptr->e); + HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], + d_ptr->c[3], d_ptr->d, d_ptr->e); + goto error; + } } /* Release resources */ @@ -804,29 +782,25 @@ error: /*------------------------------------------------------------------------- * Function: test_compound_3 * - * Purpose: Tests compound conversions where the source and destination - * are the same except the destination is missing a couple - * members which appear in the source. + * Purpose: Tests compound conversions where the source and destination + * are the same except the destination is missing a couple + * members which appear in the source. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 17, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int test_compound_3(void) { struct st { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } *s_ptr; - struct dt { - int a, c[4], e; + struct dt { + int a, c[4], e; } *d_ptr; const size_t nelmts = NTESTELEM; @@ -884,24 +858,24 @@ test_compound_3(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)((void *)orig)) + i; - d_ptr = ((struct dt*)((void *)buf)) + i; - if (s_ptr->a != d_ptr->a || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->e != d_ptr->e) { - H5_FAILED(); - HDprintf(" i=%d\n", i); - HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], - s_ptr->c[3], s_ptr->d, s_ptr->e); - HDprintf(" dst={a=%d, c=[%d,%d,%d,%d], e=%d\n", - d_ptr->a, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], - d_ptr->c[3], d_ptr->e); - goto error; - } + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; + if (s_ptr->a != d_ptr->a || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->e != d_ptr->e) { + H5_FAILED(); + HDprintf(" i=%d\n", i); + HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], + s_ptr->c[3], s_ptr->d, s_ptr->e); + HDprintf(" dst={a=%d, c=[%d,%d,%d,%d], e=%d\n", + d_ptr->a, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], + d_ptr->c[3], d_ptr->e); + goto error; + } } /* Release resources */ @@ -931,19 +905,15 @@ error: /*------------------------------------------------------------------------- * Function: test_compound_4 * - * Purpose: Tests compound conversions when the destination has the same - * fields as the source but one or more of the fields are - * smaller. + * Purpose: Tests compound conversions when the destination has the same + * fields as the source but one or more of the fields are + * smaller. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 17, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -951,13 +921,13 @@ test_compound_4(void) { struct st { - int a, b, c[4], d, e; + int a, b, c[4], d, e; } *s_ptr; struct dt { - short b; - int a, c[4]; - short d; - int e; + short b; + int a, c[4]; + short d; + int e; } *d_ptr; const size_t nelmts = NTESTELEM; @@ -1017,26 +987,26 @@ test_compound_4(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)((void *)orig)) + i; - d_ptr = ((struct dt*)((void *)buf)) + i; - if (s_ptr->a != d_ptr->a || - s_ptr->b != d_ptr->b || - s_ptr->c[0] != d_ptr->c[0] || - s_ptr->c[1] != d_ptr->c[1] || - s_ptr->c[2] != d_ptr->c[2] || - s_ptr->c[3] != d_ptr->c[3] || - s_ptr->d != d_ptr->d || - s_ptr->e != d_ptr->e) { - H5_FAILED(); - HDprintf(" i=%d\n", i); - HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], - s_ptr->c[3], s_ptr->d, s_ptr->e); - HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", - d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], - d_ptr->c[3], d_ptr->d, d_ptr->e); - goto error; - } + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; + if (s_ptr->a != d_ptr->a || + s_ptr->b != d_ptr->b || + s_ptr->c[0] != d_ptr->c[0] || + s_ptr->c[1] != d_ptr->c[1] || + s_ptr->c[2] != d_ptr->c[2] || + s_ptr->c[3] != d_ptr->c[3] || + s_ptr->d != d_ptr->d || + s_ptr->e != d_ptr->e) { + H5_FAILED(); + HDprintf(" i=%d\n", i); + HDprintf(" src={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + s_ptr->a, s_ptr->b, s_ptr->c[0], s_ptr->c[1], s_ptr->c[2], + s_ptr->c[3], s_ptr->d, s_ptr->e); + HDprintf(" dst={a=%d, b=%d, c=[%d,%d,%d,%d], d=%d, e=%d\n", + d_ptr->a, d_ptr->b, d_ptr->c[0], d_ptr->c[1], d_ptr->c[2], + d_ptr->c[3], d_ptr->d, d_ptr->e); + goto error; + } } /* Release resources */ @@ -1066,20 +1036,16 @@ error: /*------------------------------------------------------------------------- * Function: test_compound_5 * - * Purpose: Many versions of HDF5 have a bug in the optimized compound + * Purpose: Many versions of HDF5 have a bug in the optimized compound * datatype conversion function, H5T_conv_struct_opt(), which * is triggered when the top-level type contains a struct * which must undergo a conversion. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 17, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1156,7 +1122,8 @@ test_compound_5(void) src[1].coll_ids[2]!=dst[1].coll_ids[2] || src[1].coll_ids[3]!=dst[1].coll_ids[3]) { H5_FAILED(); - } else { + } + else { PASSED(); retval = 0; } @@ -1171,19 +1138,15 @@ test_compound_5(void) /*------------------------------------------------------------------------- * Function: test_compound_6 * - * Purpose: Tests compound conversions when the destination has the same - * fields as the source but one or more of the fields are - * larger. + * Purpose: Tests compound conversions when the destination has the same + * fields as the source but one or more of the fields are + * larger. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, December 13, 2000 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1244,18 +1207,18 @@ test_compound_6(void) /* Compare results */ for (i=0; i<(int)nelmts; i++) { - s_ptr = ((struct st*)((void *)orig)) + i; - d_ptr = ((struct dt*)((void *)buf)) + i; - if (s_ptr->b != d_ptr->b || - s_ptr->d != d_ptr->d) { - H5_FAILED(); - HDprintf(" i=%d\n", i); - HDprintf(" src={b=%d, d=%d\n", - (int)s_ptr->b, (int)s_ptr->d); - HDprintf(" dst={b=%ld, d=%ld\n", - d_ptr->b, d_ptr->d); - goto error; - } + s_ptr = ((struct st*)((void *)orig)) + i; + d_ptr = ((struct dt*)((void *)buf)) + i; + if (s_ptr->b != d_ptr->b || + s_ptr->d != d_ptr->d) { + H5_FAILED(); + HDprintf(" i=%d\n", i); + HDprintf(" src={b=%d, d=%d\n", + (int)s_ptr->b, (int)s_ptr->d); + HDprintf(" dst={b=%ld, d=%ld\n", + d_ptr->b, d_ptr->d); + goto error; + } } /* Release resources */ @@ -1284,15 +1247,14 @@ error: /*------------------------------------------------------------------------- * Function: test_compound_7 * - * Purpose: Tests inserting fields into compound datatypes when the field + * Purpose: Tests inserting fields into compound datatypes when the field * overlaps the end of the compound datatype. Also, tests * increasing compound type size. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, December 18, 2001 * * Modifications: @@ -1686,9 +1648,6 @@ test_compound_8(void) * * Programmer: Raymond Lu * Wednesday, June 9, 2004 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4758,17 +4717,13 @@ test_conv_enum_2(void) /*------------------------------------------------------------------------- * Function: test_conv_bitfield * - * Purpose: Test bitfield conversions. - * - * Return: Success: 0 + * Purpose: Test bitfield conversions. * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 20, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4790,10 +4745,9 @@ test_conv_bitfield(void) buf[2] = buf[3] = 0x55; /*irrelevant*/ if (H5Tconvert(st, dt, (size_t)1, buf, NULL, H5P_DEFAULT) < 0) goto error; if (buf[0]!=0xAA || buf[1]!=0xAA || buf[2]!=0 || buf[3]!=0) { - H5_FAILED(); - printf(" s=0xaaaa, d=0x%02x%02x%02x%02x (test 1)\n", - buf[3], buf[2], buf[1], buf[0]); - goto error; + H5_FAILED(); + HDprintf(" s=0xaaaa, d=0x%02x%02x%02x%02x (test 1)\n", buf[3], buf[2], buf[1], buf[0]); + goto error; } /* @@ -4809,10 +4763,9 @@ test_conv_bitfield(void) buf[0] = 0xA8; buf[1] = 0x2A; buf[2] = buf[3] = 0; if (H5Tconvert(st, dt, (size_t)1, buf, NULL, H5P_DEFAULT) < 0) goto error; if (buf[0]!=0 || buf[1]!=0xA8 || buf[2]!=0x2A || buf[3]!=0) { - H5_FAILED(); - printf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 2)\n", - buf[3], buf[2], buf[1], buf[0]); - goto error; + H5_FAILED(); + HDprintf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 2)\n", buf[3], buf[2], buf[1], buf[0]); + goto error; } /* @@ -4823,10 +4776,9 @@ test_conv_bitfield(void) buf[0] = 0xA8; buf[1] = 0x2A; buf[2] = buf[3] = 0; if (H5Tconvert(st, dt, (size_t)1, buf, NULL, H5P_DEFAULT) < 0) goto error; if (buf[0]!=0xff || buf[1]!=0xAB || buf[2]!=0xEA || buf[3]!=0xff) { - H5_FAILED(); - printf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 3)\n", - buf[3], buf[2], buf[1], buf[0]); - goto error; + H5_FAILED(); + HDprintf(" s=0x2AA8 d=0x%02x%02x%02x%02x (test 3)\n", buf[3], buf[2], buf[1], buf[0]); + goto error; } H5Tclose(st); @@ -4855,18 +4807,14 @@ error: /*------------------------------------------------------------------------- * Function: test_bitfield_funcs * - * Purpose: Test some datatype functions that are and aren't supposed + * Purpose: Test some datatype functions that are and aren't supposed * work for bitfield type. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, April 5, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4984,17 +4932,13 @@ error: /*------------------------------------------------------------------------- * Function: convert_opaque * - * Purpose: A fake opaque conversion functions - * - * Return: Success: 0 + * Purpose: A fake opaque conversion functions * - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, June 4, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -5003,7 +4947,8 @@ convert_opaque(hid_t H5_ATTR_UNUSED st, hid_t H5_ATTR_UNUSED dt, H5T_cdata_t *cd size_t H5_ATTR_UNUSED bkg_stride, void H5_ATTR_UNUSED *_buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dset_xfer_plid) { - if (H5T_CONV_CONV==cdata->command) num_opaque_conversions_g++; + if (H5T_CONV_CONV==cdata->command) + num_opaque_conversions_g++; return 0; } @@ -5011,17 +4956,13 @@ convert_opaque(hid_t H5_ATTR_UNUSED st, hid_t H5_ATTR_UNUSED dt, H5T_cdata_t *cd /*------------------------------------------------------------------------- * Function: test_opaque * - * Purpose: Driver function to test opaque datatypes - * - * Return: Success: 0 + * Purpose: Driver function to test opaque datatypes * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * June 2, 2004 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -5054,25 +4995,23 @@ test_opaque(void) /*------------------------------------------------------------------------- * Function: opaque_check * - * Purpose: Test opaque datatypes - * - * Return: Success: 0 + * Purpose: Test opaque datatypes * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 20, 1999 - * *------------------------------------------------------------------------- */ static int opaque_check(int tag_it) { #define OPAQUE_NELMTS 1000 - hid_t st=-1, dt=-1; + hid_t st=-1, dt=-1; herr_t status; - char buf[1]; /*not really used*/ - int saved; + char buf[1]; /*not really used*/ + int saved; saved = num_opaque_conversions_g = 0; @@ -5088,29 +5027,29 @@ opaque_check(int tag_it) /* Make sure that we can't convert between the types yet */ H5E_BEGIN_TRY { - status = H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT); + status = H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT); } H5E_END_TRY; if (status>=0) { - H5_FAILED(); - printf(" opaque conversion should have failed but succeeded\n"); - goto error; + H5_FAILED(); + HDprintf(" opaque conversion should have failed but succeeded\n"); + goto error; } /* Register a conversion function */ if (H5Tregister(H5T_PERS_HARD, "o_test", st, dt, convert_opaque) < 0) - goto error; + goto error; /* Try the conversion again, this time it should work */ if (H5Tconvert(st, dt, (size_t)OPAQUE_NELMTS, buf, NULL, H5P_DEFAULT) < 0) goto error; if (saved+1 != num_opaque_conversions_g) { - H5_FAILED(); - printf(" unexpected number of opaque conversions\n"); - goto error; + H5_FAILED(); + HDprintf(" unexpected number of opaque conversions\n"); + goto error; } /* Unregister conversion function */ if (H5Tunregister(H5T_PERS_HARD, "o_test", st, dt, convert_opaque) < 0) - goto error; + goto error; H5Tclose(st); H5Tclose(dt); @@ -5127,12 +5066,12 @@ opaque_check(int tag_it) /*------------------------------------------------------------------------- * Function: opaque_long * - * Purpose: Test named (committed) opaque datatypes w/very long tags + * Purpose: Test named (committed) opaque datatypes w/very long tags * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 14, 2005 * *------------------------------------------------------------------------- @@ -5142,7 +5081,7 @@ opaque_long(void) { char *long_tag = NULL; hid_t dt = -1; - herr_t ret; + herr_t ret; /* Build opaque type */ if((dt=H5Tcreate(H5T_OPAQUE, (size_t)4)) < 0) TEST_ERROR @@ -5154,7 +5093,7 @@ opaque_long(void) /* Set opaque type's tag */ H5E_BEGIN_TRY { - ret = H5Tset_tag(dt, long_tag); + ret = H5Tset_tag(dt, long_tag); } H5E_END_TRY; if(ret != FAIL) TEST_ERROR @@ -5179,24 +5118,20 @@ error: /*------------------------------------------------------------------------- * Function: opaque_funcs * - * Purpose: Test some type functions that are and aren't supposed to + * Purpose: Test some type functions that are and aren't supposed to * work with opaque type. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, April 5, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int opaque_funcs(void) { - hid_t type = -1, super=-1; + hid_t type = -1, super=-1; size_t size; H5T_pad_t inpad; H5T_cset_t cset; @@ -5803,7 +5738,7 @@ test_encode(void) } H5E_BEGIN_TRY { - ret = H5Tclose(decoded_tid3); + ret = H5Tclose(decoded_tid3); } H5E_END_TRY; if(ret!=FAIL) { H5_FAILED(); @@ -6102,14 +6037,13 @@ static int test_int_float_except(void) { #if H5_SIZEOF_INT==4 && H5_SIZEOF_FLOAT==4 - float buf[CONVERT_SIZE] = {(float)INT_MIN - 172.0f, (float)INT_MAX - 32.0f, - (float)INT_MAX - 68.0f, (float)4.5f}; - int buf_int[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX-127, 4}; + float buf[CONVERT_SIZE] = {(float)INT_MIN - 172.0f, (float)INT_MAX - 32.0f, (float)INT_MAX - 68.0f, (float)4.5f}; + int buf_int[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX-127, 4}; float buf_float[CONVERT_SIZE] = {(float)INT_MIN, (float)INT_MAX + 1.0f, (float)INT_MAX - 127.0f, 4}; - int *intp; /* Pointer to buffer, as integers */ - int buf2[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX - 72, 0}; + int *intp; /* Pointer to buffer, as integers */ + int buf2[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX - 72, 0}; float buf2_float[CONVERT_SIZE] = {(float)INT_MIN, (float)INT_MAX, (float)INT_MAX - 127.0f, (float)0.0f}; - int buf2_int[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX - 127, 0}; + int buf2_int[CONVERT_SIZE] = {INT_MIN, INT_MAX, INT_MAX - 127, 0}; float *floatp; /* Pointer to buffer #2, as floats */ hid_t dxpl; /* Dataset transfer property list */ except_info_t e; /* Exception information */ @@ -6165,8 +6099,8 @@ test_int_float_except(void) /* Convert second buffer */ HDmemset(&e, 0, sizeof(except_info_t)); - if(H5Tconvert(H5T_NATIVE_INT, H5T_NATIVE_FLOAT, (size_t)CONVERT_SIZE, - buf2, NULL, dxpl) < 0) TEST_ERROR + if(H5Tconvert(H5T_NATIVE_INT, H5T_NATIVE_FLOAT, (size_t)CONVERT_SIZE, buf2, NULL, dxpl) < 0) + TEST_ERROR /* Check the buffer after conversion, as floats */ for(u = 0; u < CONVERT_SIZE; u++) { @@ -6183,8 +6117,8 @@ test_int_float_except(void) /* Convert buffer */ HDmemset(&e, 0, sizeof(except_info_t)); - if(H5Tconvert(H5T_NATIVE_FLOAT, H5T_NATIVE_INT, (size_t)CONVERT_SIZE, - buf2, NULL, dxpl) < 0) TEST_ERROR + if(H5Tconvert(H5T_NATIVE_FLOAT, H5T_NATIVE_INT, (size_t)CONVERT_SIZE, buf2, NULL, dxpl) < 0) + TEST_ERROR /* Check the buffer after conversion, as integers */ for(u = 0; u < CONVERT_SIZE; u++) { @@ -6415,7 +6349,7 @@ test_set_order_compound(hid_t fapl) hid_t cmpd = -1, memb_cmpd = -1, memb_array1 = -1, memb_array2 = -1, cmpd_array = -1; hid_t vl_id = -1; hsize_t dims[2] = {3, 4}; /* Array dimenstions */ - char filename[1024]; + char filename[1024]; herr_t ret; /* Generic return value */ TESTING("H5Tset/get_order for compound type"); @@ -6521,18 +6455,14 @@ error: /*------------------------------------------------------------------------- * Function: test_named_indirect_reopen * - * Purpose: Tests that open named datatypes can be reopened indirectly + * Purpose: Tests that open named datatypes can be reopened indirectly * through H5Dget_type without causing problems. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Thursday, June 4, 2009 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -6540,11 +6470,11 @@ test_named_indirect_reopen(hid_t fapl) { hid_t file=-1, type=-1, reopened_type=-1, strtype=-1, dset=-1, space=-1; static hsize_t dims[1] = {3}; - size_t dt_size; - int enum_value; - const char *tag = "opaque_tag"; - char *tag_ret = NULL; - char filename[1024]; + size_t dt_size; + int enum_value; + const char *tag = "opaque_tag"; + char *tag_ret = NULL; + char filename[1024]; TESTING("indirectly reopening committed datatypes"); @@ -6708,11 +6638,11 @@ test_named_indirect_reopen(hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(type); - H5Tclose(strtype); - H5Tclose(reopened_type); - H5Sclose(space); - H5Dclose(dset); + H5Tclose(type); + H5Tclose(strtype); + H5Tclose(reopened_type); + H5Sclose(space); + H5Dclose(dset); H5Fclose(file); } H5E_END_TRY; if(tag_ret) @@ -6912,12 +6842,12 @@ test_delete_obj_named(hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(attr); - H5Dclose(dset); - H5Pclose(fapl2); - H5Fclose(filea1); - H5Fclose(filea2); - H5Fclose(fileb); + H5Tclose(attr); + H5Dclose(dset); + H5Pclose(fapl2); + H5Fclose(filea1); + H5Fclose(filea2); + H5Fclose(fileb); } H5E_END_TRY; return 1; } /* end test_delete_obj_named() */ @@ -7075,15 +7005,15 @@ test_delete_obj_named_fileid(hid_t fapl) error: H5E_BEGIN_TRY { - H5Aclose(attr); - H5Tclose(type); - H5Dclose(dset); - H5Pclose(fapl2); - H5Fclose(filea1); - H5Fclose(filea2); - H5Fclose(fileb); - H5Fclose(attr_fid); - H5Fclose(type_fid); + H5Aclose(attr); + H5Tclose(type); + H5Dclose(dset); + H5Pclose(fapl2); + H5Fclose(filea1); + H5Fclose(filea2); + H5Fclose(fileb); + H5Fclose(attr_fid); + H5Fclose(type_fid); } H5E_END_TRY; return 1; } /* end test_delete_obj_named_fileid() */ @@ -7092,12 +7022,12 @@ error: /*------------------------------------------------------------------------- * Function: test_deprec * - * Purpose: Tests deprecated API routines for datatypes. + * Purpose: Tests deprecated API routines for datatypes. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 27, 2007 * *------------------------------------------------------------------------- @@ -7167,31 +7097,31 @@ test_deprec(hid_t fapl) /* Predefined types cannot be committed */ H5E_BEGIN_TRY { - status = H5Tcommit1(file, "test_named_1 (should not exist)", H5T_NATIVE_INT); + status = H5Tcommit1(file, "test_named_1 (should not exist)", H5T_NATIVE_INT); } H5E_END_TRY; if(status >= 0) - FAIL_PUTS_ERROR(" Predefined types should not be committable!") + FAIL_PUTS_ERROR(" Predefined types should not be committable!") /* Copy a predefined datatype and commit the copy */ if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR if(H5Tcommit1(file, "native-int", type) < 0) FAIL_STACK_ERROR if((status = H5Tcommitted(type)) < 0) FAIL_STACK_ERROR if(0 == status) - FAIL_PUTS_ERROR(" H5Tcommitted() returned false!") + FAIL_PUTS_ERROR(" H5Tcommitted() returned false!") /* We should not be able to modify a type after it has been committed. */ H5E_BEGIN_TRY { - status = H5Tset_precision(type, (size_t)256); + status = H5Tset_precision(type, (size_t)256); } H5E_END_TRY; if(status >= 0) - FAIL_PUTS_ERROR(" Committed type is not constant!") + FAIL_PUTS_ERROR(" Committed type is not constant!") /* We should not be able to re-commit a committed type */ H5E_BEGIN_TRY { - status = H5Tcommit1(file, "test_named_2 (should not exist)", type); + status = H5Tcommit1(file, "test_named_2 (should not exist)", type); } H5E_END_TRY; if(status >= 0) - FAIL_PUTS_ERROR(" Committed types should not be recommitted!") + FAIL_PUTS_ERROR(" Committed types should not be recommitted!") /* * Close the committed type and reopen it. It should return a named type. @@ -7200,7 +7130,7 @@ test_deprec(hid_t fapl) if((type = H5Topen1(file, "native-int")) < 0) FAIL_STACK_ERROR if((status = H5Tcommitted(type)) < 0) FAIL_STACK_ERROR if(!status) - FAIL_PUTS_ERROR(" Opened named types should be named types!") + FAIL_PUTS_ERROR(" Opened named types should be named types!") /* Close */ if(H5Tclose(type) < 0) FAIL_STACK_ERROR @@ -7230,8 +7160,8 @@ test_deprec(hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(type); - H5Fclose(file); + H5Tclose(type); + H5Fclose(file); } H5E_END_TRY; return 1; } /* end test_deprec() */ @@ -7241,13 +7171,13 @@ error: /*------------------------------------------------------------------------- * Function: test_utf_ascii_conv * - * Purpose: Make sure the library doesn't conversion strings between + * Purpose: Make sure the library doesn't conversion strings between * ASCII and UTF8. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 10 November 2011 *------------------------------------------------------------------------- */ @@ -7437,13 +7367,13 @@ test_utf_ascii_conv(void) error: H5E_BEGIN_TRY { - H5Tclose(utf8_vtid); - H5Tclose(ascii_vtid); - H5Tclose(utf8_tid); - H5Tclose(ascii_tid); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid); + H5Tclose(utf8_vtid); + H5Tclose(ascii_vtid); + H5Tclose(utf8_tid); + H5Tclose(ascii_tid); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid); } H5E_END_TRY; return 1; } @@ -7827,16 +7757,13 @@ error: * * Programmer: Robb Matzke * Tuesday, December 9, 1997 - * - * Modifications: - * *------------------------------------------------------------------------- */ int main(void) { long nerrors = 0; - hid_t fapl = -1; + hid_t fapl = H5I_INVALID_HID; /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); @@ -7845,7 +7772,7 @@ main(void) fapl = h5_fileaccess(); if(ALIGNMENT) - printf("Testing non-aligned conversions (ALIGNMENT=%d)....\n", ALIGNMENT); + HDprintf("Testing non-aligned conversions (ALIGNMENT=%d)....\n", ALIGNMENT); /* Do the tests */ nerrors += test_classes(); @@ -7900,8 +7827,7 @@ main(void) nerrors += test_versionbounds(); if(nerrors) { - HDprintf("***** %lu FAILURE%s! *****\n", - nerrors, 1==nerrors?"":"S"); + HDprintf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); HDexit(EXIT_FAILURE); } diff --git a/test/gen_new_super.c b/test/gen_new_super.c index ed43a39..d371f5f 100644 --- a/test/gen_new_super.c +++ b/test/gen_new_super.c @@ -23,26 +23,22 @@ * put into the 'test' directory in the 1.4+ branch of the library. */ -#include -#include "testhdf5.h" +#include "h5test.h" #define TESTFILE "tsupern.h5" #define ISTORE_IK 64 /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Create a file with a new version (>0) of the superblock + * Purpose: Create a file with a new version (>0) of the superblock * - * Return: Success: - * Failure: + * Return: EXIT_SUCCESS * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 15, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -54,27 +50,27 @@ main(void) /* Create a file creation property list */ fcpl = H5Pcreate(H5P_FILE_CREATE); - assert(fcpl>=0); + HDassert(fcpl >= 0); - ret=H5Pset_istore_k(fcpl,ISTORE_IK); - assert(ret>=0); + ret = H5Pset_istore_k(fcpl,ISTORE_IK); + HDassert(ret >= 0); /* Creating a file with the non-default file creation property list should * create a version 1 superblock */ /* Create file with custom file creation property list */ - file= H5Fcreate(TESTFILE, H5F_ACC_TRUNC , fcpl, H5P_DEFAULT); - assert(file>=0); + file = H5Fcreate(TESTFILE, H5F_ACC_TRUNC , fcpl, H5P_DEFAULT); + HDassert(file >= 0); /* Close FCPL */ - ret=H5Pclose(fcpl); - assert(ret>=0); + ret = H5Pclose(fcpl); + HDassert(ret >= 0); /* Close file */ - ret=H5Fclose(file); - assert(ret>=0); + ret = H5Fclose(file); + HDassert(ret >= 0); - return 0; + return EXIT_SUCCESS; } diff --git a/test/gen_nullspace.c b/test/gen_nullspace.c index e4e75ac..26df3f1 100644 --- a/test/gen_nullspace.c +++ b/test/gen_nullspace.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, April 17, 2004 * * Purpose: Create a dataset with a null dataspace and an attribute @@ -24,8 +24,7 @@ * put into the 'test' directory in the 1.6.x branch of the library. */ -#include -#include "testhdf5.h" +#include "h5test.h" #define NULLFILE "tnullspace.h5" #define NULLDATASET "null_dataset" @@ -43,44 +42,44 @@ main(void) /* Create the file */ fid = H5Fcreate(NULLFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(fid>0); + HDassert(fid > 0); sid = H5Screate(H5S_NULL); - assert(sid>0); + HDassert(sid > 0); /* Create dataset */ did = H5Dcreate2(fid, NULLDATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(did>0); + HDassert(did > 0); /* Close the dataset */ ret = H5Dclose(did); - assert(ret>=0); + HDassert(ret >= 0); /* Open the root group */ gid = H5Gopen2(fid, "/", H5P_DEFAULT); - assert(gid > 0); + HDassert(gid > 0); /* Create an attribute for the group */ attr = H5Acreate2(gid, NULLATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); - assert(attr > 0); + HDassert(attr > 0); /* Close attribute */ ret = H5Aclose(attr); - assert(ret>=0); + HDassert(ret >= 0); /* Close the group */ ret = H5Gclose(gid); - assert(ret>=0); + HDassert(ret >= 0); /* Close the dataspace */ ret = H5Sclose(sid); - assert(ret>=0); + HDassert(ret >= 0); /* Close the file */ ret = H5Fclose(fid); - assert(ret>=0); + HDassert(ret >= 0); - return 0; + return EXIT_SUCCESS; } diff --git a/test/links.c b/test/links.c index 60d3152..cd9f05c 100644 --- a/test/links.c +++ b/test/links.c @@ -9037,15 +9037,15 @@ error: static int external_link_query(hid_t fapl, hbool_t new_format) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1; /* Group IDs */ - const char *file_name; /* Name of the file the external link points to */ - const char *object_name; /* Name of the object the external link points to */ - H5O_info2_t oi; /* Object information */ - H5L_info2_t li; /* Link information */ - char filename1[NAME_BUF_SIZE], - filename2[NAME_BUF_SIZE], /* Names of files to externally link across */ - query_buf[NAME_BUF_SIZE]; /* Buffer to hold query result */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group IDs */ + const char *file_name; /* Name of the file the external link points to */ + const char *object_name; /* Name of the object the external link points to */ + H5O_info2_t oi; /* Object information */ + H5L_info2_t li; /* Link information */ + char filename1[NAME_BUF_SIZE], + filename2[NAME_BUF_SIZE], /* Names of files to externally link across */ + query_buf[NAME_BUF_SIZE]; /* Buffer to hold query result */ if(new_format) TESTING("query aspects of external link (w/new group format)") @@ -18286,7 +18286,6 @@ main(void) nerrors += test_deprec(my_fapl, new_format); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - /* tests for external link */ /* Test external file cache first, so it sees the default efc setting on the fapl */ diff --git a/test/th5o.c b/test/th5o.c index ab4a8de..4bc2096 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -243,17 +243,17 @@ test_h5o_close(void) static void test_h5o_open_by_addr(void) { - hid_t fid; /* HDF5 File ID */ - hid_t grp, dset, dtype, dspace; /* Object identifiers */ - H5L_info2_t li; /* Buffer for H5Lget_info */ - haddr_t grp_addr; /* Addresses for objects */ - haddr_t dset_addr; - haddr_t dtype_addr; - hsize_t dims[RANK]; - H5I_type_t id_type; /* Type of IDs returned from H5Oopen */ - H5G_info_t ginfo; /* Group info struct */ - H5T_class_t type_class; /* Class of the datatype */ - herr_t ret; /* Value returned from API calls */ + hid_t fid; /* HDF5 File ID */ + hid_t grp, dset, dtype, dspace; /* Object identifiers */ + H5L_info2_t li; /* Buffer for H5Lget_info2 */ + haddr_t grp_addr; /* Addresses for objects */ + haddr_t dset_addr; + haddr_t dtype_addr; + hsize_t dims[RANK]; + H5I_type_t id_type; /* Type of IDs returned from H5Oopen */ + H5G_info_t ginfo; /* Group info struct */ + H5T_class_t type_class; /* Class of the datatype */ + herr_t ret; /* Value returned from API calls */ /* Create a new HDF5 file */ fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); diff --git a/test/trefer.c b/test/trefer.c index fd97239..68fef09 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -87,12 +87,12 @@ test_reference_params(void) hid_t aapl_id; /* Attribute access property list */ hid_t dapl_id; /* Dataset access property list */ hsize_t dims1[] = {SPACE1_DIM1}; - H5R_ref_t *wbuf, /* buffer to write to disk */ + H5R_ref_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temp. buffer read from disk */ unsigned *obuf; H5R_type_t type; /* Reference type */ - unsigned int i; /* Counters */ + unsigned int i; /* Counters */ const char *write_comment = "Foo!"; /* Comments for group */ hid_t ret_id; /* Generic hid_t return value */ ssize_t name_size; /* Size of reference name */ @@ -320,10 +320,10 @@ test_reference_obj(void) hid_t tid1; /* Datatype ID */ hsize_t dims1[] = {SPACE1_DIM1}; hid_t dapl_id; /* Dataset access property list */ - H5R_ref_t *wbuf, /* buffer to write to disk */ + H5R_ref_t *wbuf, /* buffer to write to disk */ *rbuf; /* buffer read from disk */ unsigned *ibuf, *obuf; - unsigned i, j; /* Counters */ + unsigned i, j; /* Counters */ H5O_type_t obj_type; /* Object type */ herr_t ret; /* Generic return value */ diff --git a/test/vds_swmr.h b/test/vds_swmr.h index edb01bc..0a194ff 100644 --- a/test/vds_swmr.h +++ b/test/vds_swmr.h @@ -95,7 +95,5 @@ H5TEST_DLLVAR char VDS_FILE_NAME[NAME_LEN]; /* Dataset names */ H5TEST_DLLVAR char SOURCE_DSET_PATH[NAME_LEN]; H5TEST_DLLVAR char VDS_DSET_NAME[NAME_LEN]; - -/* Fill values */ #endif /* VDS_SWMR_H */ diff --git a/test/vfd.c b/test/vfd.c index 038c967..bb04e97 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -3286,8 +3286,7 @@ error: * * Purpose: Tests the basic features of Virtual File Drivers * - * Return: Success: 0 - * Failure: 1 + * Return: EXIT_SUCCESS/EXIT_FAILURE * *------------------------------------------------------------------------- */ @@ -3317,11 +3316,11 @@ main(void) if(nerrors) { HDprintf("***** %d Virtual File Driver TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : ""); - return 1; + return EXIT_FAILURE; } /* end if */ HDprintf("All Virtual File Driver tests passed.\n"); - return 0; + return EXIT_SUCCESS; } /* end main() */ -- cgit v0.12 From 64ffb37ff6e43966d570bc737b6fa7f96acded56 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 31 Jul 2020 12:23:57 -0700 Subject: Fixed bad parens in H5trace.c --- src/H5trace.c | 86 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/src/H5trace.c b/src/H5trace.c index 91019a4..db33673 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -311,7 +311,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'a': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -764,7 +764,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - HDfprintf (out, "BADTYPE(D%c)", type[1]); + HDfprintf(out, "BADTYPE(D%c)", type[1]); goto error; } /* end switch */ break; @@ -1149,7 +1149,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -1226,7 +1226,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - HDfprintf (out, "BADTYPE(H%c)", type[1]); + HDfprintf(out, "BADTYPE(H%c)", type[1]); goto error; } /* end switch */ break; @@ -1414,7 +1414,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case H5I_NTYPES: - HDfprintf (out, "%ld (ntypes - error)", (long)obj); + HDfprintf(out, "%ld (ntypes - error)", (long)obj); break; default: @@ -1518,7 +1518,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { int is = HDva_arg(ap, int); - HDfprintf (out, "%d", is); + HDfprintf(out, "%d", is); asize[argno] = is; } /* end else */ break; @@ -1638,7 +1638,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - HDfprintf (out, "BADTYPE(I%c)", type[1]); + HDfprintf(out, "BADTYPE(I%c)", type[1]); goto error; } /* end switch */ break; @@ -1664,7 +1664,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'l': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -1808,7 +1808,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { off_t offset = HDva_arg(ap, off_t); - HDfprintf (out, "%ld", (long)offset); + HDfprintf(out, "%ld", (long)offset); } /* end else */ break; @@ -2517,7 +2517,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - HDfprintf (out, "BADTYPE(T%c)", type[1]); + HDfprintf(out, "BADTYPE(T%c)", type[1]); goto error; } /* end switch */ break; @@ -2533,9 +2533,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...) htri_t tri_var = HDva_arg (ap, htri_t); if(tri_var>0) - HDfprintf (out, "TRUE"); + HDfprintf(out, "TRUE"); else if(!tri_var) - HDfprintf (out, "FALSE"); + HDfprintf(out, "FALSE"); else HDfprintf(out, "FAIL(%d)", (int)tri_var); } /* end else */ @@ -2592,7 +2592,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - HDfprintf (out, "BADTYPE(U%c)", type[1]); + HDfprintf(out, "BADTYPE(U%c)", type[1]); goto error; } /* end switch */ break; @@ -2602,7 +2602,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'a': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2638,7 +2638,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'A': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2656,7 +2656,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'b': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2686,7 +2686,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'B': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2716,7 +2716,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'C': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2733,7 +2733,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'c': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2769,7 +2769,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'd': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2796,7 +2796,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'e': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2820,7 +2820,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'f': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2844,7 +2844,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'g': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2886,7 +2886,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'h': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2925,7 +2925,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'i': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2949,7 +2949,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'j': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -2973,7 +2973,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'k': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3000,7 +3000,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'l': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3027,7 +3027,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'L': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3051,7 +3051,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'm': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3078,7 +3078,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'n': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3108,7 +3108,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'o': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3144,7 +3144,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'r': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3171,7 +3171,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 's': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3194,7 +3194,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'S': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3251,7 +3251,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 't': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3299,7 +3299,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'u': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3317,7 +3317,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'v': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3422,7 +3422,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'w': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3448,7 +3448,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'x': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3466,7 +3466,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'y': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3502,7 +3502,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'z': if(ptr) { if(vp) - HDfprintf (out, "0x%p", vp); + HDfprintf(out, "0x%p", vp); else HDfprintf(out, "NULL"); } /* end if */ @@ -3712,7 +3712,7 @@ error: HDfprintf(out, ";\n"); else { last_call_depth = current_depth++; - HDfprintf (out, ")"); + HDfprintf(out, ")"); } /* end else */ HDfflush(out); -- cgit v0.12 From b9de162eae800a9459f0f1f07d2b043f73f8a907 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sat, 1 Aug 2020 10:26:22 -0700 Subject: Minor normalizations with 1.12 branch --- bin/release | 216 +++++++++++++------------- src/H5AC.c | 2 +- src/H5EAdbg.c | 2 +- src/H5FD.c | 2 +- src/H5I.c | 120 +++++++------- src/H5Ofsinfo.c | 2 +- src/H5Spoint.c | 2 +- src/H5Tdbg.c | 12 +- src/H5Z.c | 126 +++++++-------- src/H5public.h | 16 +- src/H5system.c | 8 +- test/H5srcdir.h | 4 +- test/gen_bogus.c | 2 +- test/gen_specmetaread.c | 3 +- tools/src/h5format_convert/h5format_convert.c | 6 +- tools/src/misc/h5mkgrp.c | 8 +- 16 files changed, 265 insertions(+), 266 deletions(-) diff --git a/bin/release b/bin/release index a34191e..95f58ea 100755 --- a/bin/release +++ b/bin/release @@ -39,7 +39,7 @@ USAGE() { cat << EOF Usage: $0 -d [--docver BRANCHNAME] [-h] [--nocheck] [--private] ... - -d DIR The name of the directory where the releas(es) should be + -d DIR The name of the directory where the releas(es) should be placed. --docver BRANCHNAME This is added for 1.8 and beyond to get the correct version of documentation files from the hdf5docs @@ -53,10 +53,10 @@ The other command-line options are the names of the programs to use for compressing the resulting tar archive (if none are given then "tar" is assumed): - tar -- use tar and don't do any compressing. - gzip -- use gzip with "-9" and append ".gz" to the output name. + tar -- use tar and don't do any compressing. + gzip -- use gzip with "-9" and append ".gz" to the output name. bzip2 -- use bzip2 with "-9" and append ".bz2" to the output name. - zip -- convert all text files to DOS style and form a zip file for Windows use. + zip -- convert all text files to DOS style and form a zip file for Windows use. cmake-tgz -- create a tar file using the gzip default level with a build-unix.sh command file and all other CMake files needed to build HDF5 source using CMake on unix machines. @@ -122,8 +122,8 @@ EOF tar2zip() { if [ $# -ne 3 ]; then - echo "usage: tar2zip " - return 1 + echo "usage: tar2zip " + return 1 fi ztmpdir=/tmp/ztmpdir$$ mkdir -p $ztmpdir @@ -135,10 +135,10 @@ tar2zip() (cd $ztmpdir; tar xf -) < $tarfile # sanity check if [ ! -d $ztmpdir/$version ]; then - echo "untar did not create $ztmpdir/$version source dir" - # cleanup - rm -rf $ztmpdir - return 1 + echo "untar did not create $ztmpdir/$version source dir" + # cleanup + rm -rf $ztmpdir + return 1 fi # step 2: convert text files # There maybe a simpler way to do this. @@ -147,11 +147,11 @@ tar2zip() # -q quiet mode # grep redirect output to /dev/null because -q or -s are not portable. find $ztmpdir/$version | \ - while read inf; do \ - if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \ - unix2dos -q -k $inf; \ - fi\ - done + while read inf; do \ + if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \ + unix2dos -q -k $inf; \ + fi\ + done # step 3: make zipball # -9 maximum compression # -y Store symbolic links as such in the zip archive @@ -202,8 +202,8 @@ tar2zip() tar2cmakezip() { if [ $# -ne 3 ]; then - echo "usage: tar2cmakezip " - return 1 + echo "usage: tar2cmakezip " + return 1 fi cmziptmpdir=/tmp/cmziptmpdir$$ cmziptmpsubdir=$cmziptmpdir/CMake-$HDF5_VERS @@ -216,10 +216,10 @@ tar2cmakezip() (cd $cmziptmpsubdir; tar xf -) < $tarfile # sanity check if [ ! -d $cmziptmpsubdir/$version ]; then - echo "untar did not create $cmziptmpsubdir/$version source dir" - # cleanup - rm -rf $cmziptmpdir - return 1 + echo "untar did not create $cmziptmpsubdir/$version source dir" + # cleanup + rm -rf $cmziptmpdir + return 1 fi # step 2: add batch file for building CMake on window @@ -245,11 +245,11 @@ tar2cmakezip() # -q quiet mode # grep redirect output to /dev/null because -q or -s are not portable. find $cmziptmpsubdir/$version | \ - while read inf; do \ - if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \ - unix2dos -q -k $inf; \ - fi\ - done + while read inf; do \ + if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \ + unix2dos -q -k $inf; \ + fi\ + done # step 3: make zipball # -9 maximum compression @@ -301,8 +301,8 @@ tar2cmakezip() tar2cmaketgz() { if [ $# -ne 3 ]; then - echo "usage: tar2cmaketgz " - return 1 + echo "usage: tar2cmaketgz " + return 1 fi cmgztmpdir=/tmp/cmgztmpdir$$ cmgztmpsubdir=$cmgztmpdir/CMake-$HDF5_VERS @@ -315,10 +315,10 @@ tar2cmaketgz() (cd $cmgztmpsubdir; tar xf -) < $tarfile # sanity check if [ ! -d $cmgztmpsubdir/$version ]; then - echo "untar did not create $cmgztmpsubdir/$version source dir" - # cleanup - rm -rf $cmgztmpdir - return 1 + echo "untar did not create $cmgztmpsubdir/$version source dir" + # cleanup + rm -rf $cmgztmpdir + return 1 fi @@ -384,8 +384,8 @@ tar2cmaketgz() tar2hpccmaketgz() { if [ $# -ne 3 ]; then - echo "usage: tar2hpccmaketgz " - return 1 + echo "usage: tar2hpccmaketgz " + return 1 fi cmgztmpdir=/tmp/cmgztmpdir$$ cmgztmpsubdir=$cmgztmpdir/HPC-CMake-$HDF5_VERS @@ -398,10 +398,10 @@ tar2hpccmaketgz() (cd $cmgztmpsubdir; tar xf -) < $tarfile # sanity check if [ ! -d $cmgztmpsubdir/$version ]; then - echo "untar did not create $cmgztmpsubdir/$version source dir" - # cleanup - rm -rf $cmgztmpdir - return 1 + echo "untar did not create $cmgztmpsubdir/$version source dir" + # cleanup + rm -rf $cmgztmpdir + return 1 fi @@ -442,7 +442,7 @@ check=yes release_date=`date +%F` today=`date +%Y%m%d` pmode='no' -tmpdir="../#release_tmp.$$" # tmp work directory +tmpdir="../#release_tmp.$$" # tmp work directory DOC_URL=https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5doc.git CPPLUS_RM_NAME=cpplus_RM MAINT_MODE_ENABLED="" @@ -459,11 +459,11 @@ fi RESTORE_VERSION() { if [ X-${VERS_OLD} != X- ]; then - echo restoring version information back to $VERS_OLD - rm -f config/lt_vers.am - cp $tmpdir/lt_vers.am config/lt_vers.am - bin/h5vers -s $VERS_OLD - VERS_OLD= + echo restoring version information back to $VERS_OLD + rm -f config/lt_vers.am + cp $tmpdir/lt_vers.am config/lt_vers.am + bin/h5vers -s $VERS_OLD + VERS_OLD= fi } @@ -473,32 +473,32 @@ while [ -n "$1" ]; do arg=$1 shift case "$arg" in - -d) - DEST=$1 - shift - ;; - --nocheck) - check=no - ;; - -h) - USAGE - exit 0 - ;; - --private) - pmode=yes - ;; + -d) + DEST=$1 + shift + ;; + --nocheck) + check=no + ;; + -h) + USAGE + exit 0 + ;; + --private) + pmode=yes + ;; --docver) DOCVERSION=$1 shift ;; - -*) - echo "Unknown switch: $arg" 1>&2 - USAGE - exit 1 - ;; - *) - methods="$methods $arg" - ;; + -*) + echo "Unknown switch: $arg" 1>&2 + USAGE + exit 1 + ;; + *) + methods="$methods $arg" + ;; esac done @@ -553,7 +553,7 @@ if [ "X$fail" = "Xyes" ]; then echo "--nocheck argument to the bin/release command." exit 1 else - echo "Continuing anyway..." + echo "Continuing anyway..." fi fi @@ -595,61 +595,61 @@ MD5file=$HDF5_VERS.md5 cp /dev/null $DEST/$MD5file for comp in $methods; do case $comp in - tar) - cp -p $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.tar - (cd $DEST; md5sum $HDF5_VERS.tar >> $MD5file) - ;; - gzip) - test "$verbose" && echo " Running gzip..." 1>&2 - gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz - (cd $DEST; md5sum $HDF5_VERS.tar.gz >> $MD5file) - ;; + tar) + cp -p $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.tar + (cd $DEST; md5sum $HDF5_VERS.tar >> $MD5file) + ;; + gzip) + test "$verbose" && echo " Running gzip..." 1>&2 + gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz + (cd $DEST; md5sum $HDF5_VERS.tar.gz >> $MD5file) + ;; cmake-tgz) - test "$verbose" && echo " Creating CMake tar.gz file..." 1>&2 - tar2cmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.tar.gz 1>&2 - (cd $DEST; md5sum CMake-$HDF5_VERS.tar.gz >> $MD5file) + test "$verbose" && echo " Creating CMake tar.gz file..." 1>&2 + tar2cmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.tar.gz 1>&2 + (cd $DEST; md5sum CMake-$HDF5_VERS.tar.gz >> $MD5file) ;; hpc-cmake-tgz) - test "$verbose" && echo " Creating HPC-CMake tar.gz file..." 1>&2 - tar2hpccmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/HPC-CMake-$HDF5_VERS.tar.gz 1>&2 - (cd $DEST; md5sum HPC-CMake-$HDF5_VERS.tar.gz >> $MD5file) + test "$verbose" && echo " Creating HPC-CMake tar.gz file..." 1>&2 + tar2hpccmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/HPC-CMake-$HDF5_VERS.tar.gz 1>&2 + (cd $DEST; md5sum HPC-CMake-$HDF5_VERS.tar.gz >> $MD5file) + ;; + bzip2) + test "$verbose" && echo " Running bzip2..." 1>&2 + bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2 + (cd $DEST; md5sum $HDF5_VERS.tar.bz2 >> $MD5file) + ;; + zip) + test "$verbose" && echo " Creating zip ball..." 1>&2 + tar2zip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.zip 1>&2 + (cd $DEST; md5sum $HDF5_VERS.zip >> $MD5file) ;; - bzip2) - test "$verbose" && echo " Running bzip2..." 1>&2 - bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2 - (cd $DEST; md5sum $HDF5_VERS.tar.bz2 >> $MD5file) - ;; - zip) - test "$verbose" && echo " Creating zip ball..." 1>&2 - tar2zip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.zip 1>&2 - (cd $DEST; md5sum $HDF5_VERS.zip >> $MD5file) - ;; cmake-zip) test "$verbose" && echo " Creating CMake-zip ball..." 1>&2 tar2cmakezip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.zip 1>&2 (cd $DEST; md5sum CMake-$HDF5_VERS.zip >> $MD5file) ;; - doc) + doc) if [ "${DOCVERSION}" = "" ]; then DOCVERSION=master fi - test "$verbose" && echo " Creating docs..." 1>&2 - # Check out docs from git repo - (cd $tmpdir; git clone -q $DOC_URL ${DOCVERSION} > /dev/null) || exit 1 + test "$verbose" && echo " Creating docs..." 1>&2 + # Check out docs from git repo + (cd $tmpdir; git clone -q $DOC_URL ${DOCVERSION} > /dev/null) || exit 1 # Create doxygen C++ RM - (cd c++/src && doxygen cpp_doc_config > /dev/null ) || exit 1 - # Replace version of C++ RM with just-created version - rm -rf $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1 - mv c++/src/$CPPLUS_RM_NAME $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1 + (cd c++/src && doxygen cpp_doc_config > /dev/null ) || exit 1 + # Replace version of C++ RM with just-created version + rm -rf $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1 + mv c++/src/$CPPLUS_RM_NAME $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1 # Compress the docs and move them to the release area - mv $tmpdir/${DOCVERSION} $tmpdir/${HDF5_VERS}_docs || exit 1 - (cd $tmpdir && tar cf ${HDF5_VERS}_docs.tar ${HDF5_VERS}_docs) || exit 1 - mv $tmpdir/${HDF5_VERS}_docs.tar $DEST || exit 1 - ;; - *) - echo "***Error*** Unknown method $comp" - exit 1 - ;; + mv $tmpdir/${DOCVERSION} $tmpdir/${HDF5_VERS}_docs || exit 1 + (cd $tmpdir && tar cf ${HDF5_VERS}_docs.tar ${HDF5_VERS}_docs) || exit 1 + mv $tmpdir/${HDF5_VERS}_docs.tar $DEST || exit 1 + ;; + *) + echo "***Error*** Unknown method $comp" + exit 1 + ;; esac done diff --git a/src/H5AC.c b/src/H5AC.c index f8805b3..6972a31 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -138,7 +138,7 @@ static const H5AC_class_t *const H5AC_class_s[] = { /*------------------------------------------------------------------------- * Function: H5AC_init * - * Purpose: Initialize the interface from some other layer. + * Purpose: Initialize the interface from some other layer. * * Return: Success: non-negative * Failure: negative diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index 20c6a4d..e5b68be 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -295,7 +295,7 @@ CATCH END_FUNC(PKG) /* end H5EA__iblock_debug() */ - + /*------------------------------------------------------------------------- * Function: H5EA__sblock_debug * diff --git a/src/H5FD.c b/src/H5FD.c index 2e80c7f..2cd69df 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -1436,7 +1436,7 @@ done: * constant H5P_DEFAULT). The bytes to be written come from the * buffer BUF. * - * Return: SNon-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ diff --git a/src/H5I.c b/src/H5I.c index 11209d6..a739c4e 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -33,9 +33,9 @@ #include "H5ACprivate.h" /* Metadata cache */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5FLprivate.h" /* Free Lists */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Gprivate.h" /* Groups */ #include "H5Ipkg.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ @@ -145,7 +145,7 @@ static int H5I__iterate_pub_cb(void *obj, hid_t id, void *udata); static int H5I__find_id_cb(void *_item, void *_key, void *_udata); static int H5I__id_dump_cb(void *_item, void *_key, void *_udata); - + /*------------------------------------------------------------------------- * Function: H5I_term_package * @@ -197,7 +197,7 @@ H5I_term_package(void) FUNC_LEAVE_NOAPI(n) } /* end H5I_term_package() */ - + /*------------------------------------------------------------------------- * Function: H5Iregister_type * @@ -278,7 +278,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iregister_type() */ - + /*------------------------------------------------------------------------- * Function: H5I_register_type * @@ -339,7 +339,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_register_type() */ - + /*------------------------------------------------------------------------- * Function: H5Itype_exists * @@ -371,7 +371,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Itype_exists() */ - + /*------------------------------------------------------------------------- * Function: H5Inmembers * @@ -421,7 +421,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Inmembers() */ - + /*------------------------------------------------------------------------- * Function: H5I_nmembers * @@ -458,7 +458,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_nmembers() */ - + /*------------------------------------------------------------------------- * Function: H5I__unwrap * @@ -502,7 +502,7 @@ H5I__unwrap(void *obj_ptr, H5I_type_t type) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__unwrap() */ - + /*------------------------------------------------------------------------- * Function: H5Iclear_type * @@ -535,7 +535,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iclear_type() */ - + /*------------------------------------------------------------------------- * Function: H5I_clear_type * @@ -577,7 +577,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_clear_type() */ - + /*------------------------------------------------------------------------- * Function: H5I__clear_type_cb * @@ -643,7 +643,7 @@ H5I__clear_type_cb(void *_id, void H5_ATTR_UNUSED *key, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__clear_type_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Idestroy_type * @@ -677,7 +677,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Idestroy_type() */ - + /*------------------------------------------------------------------------- * Function: H5I__destroy_type * @@ -729,7 +729,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__destroy_type() */ - + /*------------------------------------------------------------------------- * Function: H5Iregister * @@ -757,7 +757,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iregister() */ - + /*------------------------------------------------------------------------- * Function: H5I_register * @@ -819,7 +819,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_register() */ - + /*------------------------------------------------------------------------- * Function: H5I_register_using_existing_id * @@ -890,7 +890,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_register_using_existing_id() */ - + /*------------------------------------------------------------------------- * Function: H5I_subst * @@ -927,7 +927,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_subst() */ - + /*------------------------------------------------------------------------- * Function: H5I_object * @@ -957,7 +957,7 @@ H5I_object(hid_t id) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_object() */ - + /*------------------------------------------------------------------------- * Function: H5Iobject_verify * @@ -991,7 +991,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iobject_verify() */ - + /*------------------------------------------------------------------------- * Function: H5I_object_verify * @@ -1026,7 +1026,7 @@ H5I_object_verify(hid_t id, H5I_type_t id_type) FUNC_LEAVE_NOAPI(ret_value) } /* H5I_object_verify() */ - + /*------------------------------------------------------------------------- * Function: H5I_get_type * @@ -1060,7 +1060,7 @@ H5I_get_type(hid_t id) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_get_type() */ - + /*------------------------------------------------------------------------- * Function: H5Iget_type * @@ -1087,13 +1087,13 @@ H5Iget_type(hid_t id) ret_value = H5I_get_type(id); if(ret_value <= H5I_BADID || (int)ret_value >= H5I_next_type || NULL == H5I_object(id)) - HGOTO_DONE(H5I_BADID); + HGOTO_DONE(H5I_BADID); done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_type() */ - + /*------------------------------------------------------------------------- * Function: H5I_is_file_object * @@ -1144,7 +1144,7 @@ done: FUNC_LEAVE_NOAPI(ret_value); } /* H5I_is_file_object() */ - + /*------------------------------------------------------------------------- * Function: H5Iremove_verify * @@ -1180,7 +1180,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iremove_verify() */ - + /*------------------------------------------------------------------------- * Function: H5I__remove_verify * @@ -1213,7 +1213,7 @@ H5I__remove_verify(hid_t id, H5I_type_t id_type) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__remove_verify() */ - + /*------------------------------------------------------------------------- * Function: H5I__remove_common * @@ -1258,7 +1258,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__remove_common() */ - + /*------------------------------------------------------------------------- * Function: H5I_remove * @@ -1298,7 +1298,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_remove() */ - + /*------------------------------------------------------------------------- * Function: H5Idec_ref * @@ -1334,7 +1334,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Idec_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_dec_ref * @@ -1404,7 +1404,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_dec_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_dec_app_ref * @@ -1452,7 +1452,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_dec_app_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_dec_app_ref_always_close * @@ -1494,7 +1494,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_dec_app_ref_always_close() */ - + /*------------------------------------------------------------------------- * Function: H5Iinc_ref * @@ -1525,7 +1525,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iinc_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_inc_ref * @@ -1563,7 +1563,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_inc_ref() */ - + /*------------------------------------------------------------------------- * Function: H5Iget_ref * @@ -1594,7 +1594,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_get_ref * @@ -1627,7 +1627,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_get_ref() */ - + /*------------------------------------------------------------------------- * Function: H5Iinc_type_ref * @@ -1660,7 +1660,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iinc_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I__inc_type_ref * @@ -1694,14 +1694,14 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__inc_type_ref() */ - + /*------------------------------------------------------------------------- * Function: H5Idec_type_ref * * Purpose: Decrements the reference count on an entire type of IDs. * If the type reference count becomes zero then the type is * destroyed along with all atoms in that type regardless of - * their reference counts. Destroying IDs involves calling + * their reference counts. Destroying IDs involves calling * the free-func for each ID's object and then adding the ID * struct to the ID free list. Public interface to * H5I_dec_type_ref. @@ -1736,14 +1736,14 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Idec_type_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I_dec_type_ref * * Purpose: Decrements the reference count on an entire type of IDs. * If the type reference count becomes zero then the type is * destroyed along with all atoms in that type regardless of - * their reference counts. Destroying IDs involves calling + * their reference counts. Destroying IDs involves calling * the free-func for each ID's object and then adding the ID * struct to the ID free list. * Returns the number of references to the type on success; a @@ -1789,7 +1789,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_dec_type_ref() */ - + /*------------------------------------------------------------------------- * Function: H5Iget_type_ref * @@ -1822,7 +1822,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_ref() */ - + /*------------------------------------------------------------------------- * Function: H5I__get_type_ref * @@ -1857,7 +1857,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__get_type_ref() */ - + /*------------------------------------------------------------------------- * Function: H5Iis_valid * @@ -1887,7 +1887,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iis_valid() */ - + /*------------------------------------------------------------------------- * Function: H5I__search_cb * @@ -1922,7 +1922,7 @@ H5I__search_cb(void *obj, hid_t id, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__search_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Isearch * @@ -1973,7 +1973,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Isearch() */ - + /*------------------------------------------------------------------------- * Function: H5I__iterate_pub_cb * @@ -2013,7 +2013,7 @@ H5I__iterate_pub_cb(void H5_ATTR_UNUSED *obj, hid_t id, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__iterate_pub_cb() */ - + /*------------------------------------------------------------------------- * Function: H5Iiterate * @@ -2060,7 +2060,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iiterate() */ - + /*------------------------------------------------------------------------- * Function: H5I__iterate_cb * @@ -2108,7 +2108,7 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__iterate_cb() */ - + /*------------------------------------------------------------------------- * Function: H5I_iterate * @@ -2167,7 +2167,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_iterate() */ - + /*------------------------------------------------------------------------- * Function: H5I__find_id * @@ -2212,7 +2212,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__find_id() */ - + /*------------------------------------------------------------------------- * Function: H5Iget_name * @@ -2263,7 +2263,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_name() */ - + /*------------------------------------------------------------------------- * Function: H5Iget_file_id * @@ -2307,7 +2307,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_file_id() */ - + /*------------------------------------------------------------------------- * Function: H5I__find_id_cb * @@ -2345,7 +2345,7 @@ H5I__find_id_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) FUNC_LEAVE_NOAPI(ret_value) } /* end H5I__find_id_cb() */ - + /*------------------------------------------------------------------------- * Function: H5I_find_id * @@ -2394,7 +2394,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_find_id() */ - + /*------------------------------------------------------------------------- * Function: H5I__id_dump_cb * @@ -2482,7 +2482,7 @@ H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) FUNC_LEAVE_NOAPI(H5_ITER_CONT) } /* end H5I__id_dump_cb() */ - + /*------------------------------------------------------------------------- * Function: H5I_dump_ids_for_type * diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index 78e8e19..e2fa4e5 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -110,7 +110,7 @@ H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, /* Allocate space for message */ if(NULL == (fsinfo = H5FL_CALLOC(H5O_fsinfo_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") for(ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++) fsinfo->fs_addr[ptype - 1] = HADDR_UNDEF; diff --git a/src/H5Spoint.c b/src/H5Spoint.c index be9015f..f53033b 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 16, 1998 * * Purpose: Point selection dataspace I/O functions. diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index 7af736a..6188138 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -13,11 +13,11 @@ /*------------------------------------------------------------------------- * - * Created: H5Tdbg.c - * Jul 19 2007 - * Quincey Koziol + * Created: H5Tdbg.c + * Jul 19 2007 + * Quincey Koziol * - * Purpose: Dump debugging information about a datatype + * Purpose: Dump debugging information about a datatype * *------------------------------------------------------------------------- */ @@ -72,7 +72,7 @@ /*******************/ - + /*------------------------------------------------------------------------- * Function: H5T__print_stats * @@ -137,7 +137,7 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5T__print_stats() */ - + /*------------------------------------------------------------------------- * Function: H5T_debug * diff --git a/src/H5Z.c b/src/H5Z.c index af5b888..3bd4bcb 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -35,10 +35,10 @@ #ifdef H5Z_DEBUG typedef struct H5Z_stats_t { struct { - hsize_t total; /* total number of bytes processed */ - hsize_t errors; /* bytes of total attributable to errors */ + hsize_t total; /* total number of bytes processed */ + hsize_t errors; /* bytes of total attributable to errors */ H5_timevals_t times; /* execution time including errors */ - } stats[2]; /* 0 = output, 1 = input */ + } stats[2]; /* 0 = output, 1 = input */ } H5Z_stats_t; #endif /* H5Z_DEBUG */ @@ -132,9 +132,9 @@ H5Z_term_package(void) if(H5_PKG_INIT_VAR) { #ifdef H5Z_DEBUG - char comment[16], bandwidth[32]; - int dir, nprint = 0; - size_t i; + char comment[16], bandwidth[32]; + int dir, nprint = 0; + size_t i; if(H5DEBUG(Z)) { for(i = 0; i < H5Z_table_used_g; i++) { @@ -142,33 +142,34 @@ H5Z_term_package(void) if(0 == H5Z_stat_table_g[i].stats[dir].total) continue; - if(0 == nprint++) { - /* Print column headers */ - HDfprintf(H5DEBUG(Z), "H5Z: filter statistics " - "accumulated over life of library:\n"); - HDfprintf(H5DEBUG(Z), - " %-16s %10s %10s %8s %8s %8s %10s\n", - "Filter", "Total", "Errors", "User", - "System", "Elapsed", "Bandwidth"); - HDfprintf(H5DEBUG(Z), - " %-16s %10s %10s %8s %8s %8s %10s\n", - "------", "-----", "------", "----", - "------", "-------", "---------"); - } /* end if */ - - /* Truncate the comment to fit in the field */ - HDstrncpy(comment, H5Z_table_g[i].name, sizeof comment); - comment[sizeof(comment) - 1] = '\0'; - - /* - * Format bandwidth to have four significant digits and - * units of `B/s', `kB/s', `MB/s', `GB/s', or `TB/s' or - * the word `Inf' if the elapsed time is zero. - */ - H5_bandwidth(bandwidth, (double)(H5Z_stat_table_g[i].stats[dir].total), + if(0 == nprint++) { + /* Print column headers */ + HDfprintf(H5DEBUG(Z), "H5Z: filter statistics " + "accumulated over life of library:\n"); + HDfprintf(H5DEBUG(Z), + " %-16s %10s %10s %8s %8s %8s %10s\n", + "Filter", "Total", "Errors", "User", + "System", "Elapsed", "Bandwidth"); + HDfprintf(H5DEBUG(Z), + " %-16s %10s %10s %8s %8s %8s %10s\n", + "------", "-----", "------", "----", + "------", "-------", "---------"); + } /* end if */ + + /* Truncate the comment to fit in the field */ + HDstrncpy(comment, H5Z_table_g[i].name, sizeof comment); + comment[sizeof(comment) - 1] = '\0'; + + /* + * Format bandwidth to have four significant digits and + * units of `B/s', `kB/s', `MB/s', `GB/s', or `TB/s' or + * the word `Inf' if the elapsed time is zero. + */ + H5_bandwidth(bandwidth, + (double)(H5Z_stat_table_g[i].stats[dir].total), H5Z_stat_table_g[i].stats[dir].times.elapsed); - /* Print the statistics */ + /* Print the statistics */ HDfprintf(H5DEBUG(Z), " %s%-15s %10Hd %10Hd %8T %8T %8T %10s\n", (dir ? "<" : ">"), comment, H5Z_stat_table_g[i].stats[dir].total, @@ -177,12 +178,12 @@ H5Z_term_package(void) H5Z_stat_table_g[i].stats[dir].times.system, H5Z_stat_table_g[i].stats[dir].times.elapsed, bandwidth); - } /* end for */ - } /* end for */ - } /* end if */ + } /* end for */ + } /* end for */ + } /* end if */ #endif /* H5Z_DEBUG */ - /* Free the table of filters */ + /* Free the table of filters */ if(H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); @@ -1256,7 +1257,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, int fclass_idx; /* Index of filter class in global table */ H5Z_class2_t *fclass = NULL; /* Filter class pointer */ #ifdef H5Z_DEBUG - H5Z_stats_t *fstats = NULL; /* Filter stats pointer */ + H5Z_stats_t *fstats = NULL; /* Filter stats pointer */ H5_timer_t timer; /* Timer for filter operations */ H5_timevals_t times; /* Elapsed time for each operation */ #endif @@ -1278,12 +1279,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, H5_timer_init(&timer); #endif if(pline && (flags & H5Z_FLAG_REVERSE)) { /* Read */ - for(i = pline->nused; i > 0; --i) { - idx = i - 1; - if(*filter_mask & ((unsigned)1 << idx)) { - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } /* end if */ + for(i = pline->nused; i > 0; --i) { + idx = i - 1; + if(*filter_mask & ((unsigned)1 << idx)) { + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } /* If the filter isn't registered and the application doesn't * indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"), @@ -1304,7 +1305,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) issue_error = TRUE; - } /* end if */ + } else issue_error = TRUE; @@ -1353,24 +1354,25 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, *nbytes = *buf_size; failed |= (unsigned)1 << idx; H5E_clear_stack(NULL); - } /* end if */ + } else *nbytes = new_nbytes; - } /* end for */ - } else if (pline) { /* Write */ - for(idx = 0; idx < pline->nused; idx++) { - if(*filter_mask & ((unsigned)1 << idx)) { - failed |= (unsigned)1 << idx; - continue; /* filter excluded */ - } /* end if */ - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + } + } + else if(pline) { /* Write */ + for(idx = 0; idx < pline->nused; idx++) { + if(*filter_mask & ((unsigned)1 << idx)) { + failed |= (unsigned)1 << idx; + continue; /* filter excluded */ + } + if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { /* Check if filter is optional -- If it isn't, then error */ - if((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered") - failed |= (unsigned)1 << idx; + if((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered") + failed |= (unsigned)1 << idx; H5E_clear_stack(NULL); - continue; /* filter excluded */ - } /* end if */ + continue; /* filter excluded */ + } /* end if */ fclass = &H5Z_table_g[fclass_idx]; @@ -1390,25 +1392,25 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, fstats->stats[0].times.system += times.system; fstats->stats[0].times.user += times.user; - fstats->stats[0].total += MAX(*nbytes, new_nbytes); + fstats->stats[0].total += MAX(*nbytes, new_nbytes); if(0 == new_nbytes) fstats->stats[0].errors += *nbytes; #endif if(0 == new_nbytes) { if(0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { - if((cb_struct.func && (H5Z_CB_FAIL==cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data))) + if((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data))) || !cb_struct.func) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure") *nbytes = *buf_size; - } /* end if */ + } failed |= (unsigned)1 << idx; H5E_clear_stack(NULL); - } /* end if */ + } else *nbytes = new_nbytes; - } /* end for */ + } /* end for */ } *filter_mask = failed; diff --git a/src/H5public.h b/src/H5public.h index 93cb2ea..d3edd23 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -38,7 +38,7 @@ #include #endif #ifdef H5_STDC_HEADERS -# include /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */ +# include /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */ # include /*for variadic functions in H5VLpublic.h */ #endif #ifndef __cplusplus @@ -183,7 +183,7 @@ typedef long long ssize_t; */ #if H5_SIZEOF_LONG_LONG >= 8 H5_GCC_DIAG_OFF(long-long) -typedef unsigned long long hsize_t; +typedef unsigned long long hsize_t; typedef signed long long hssize_t; H5_GCC_DIAG_ON(long-long) # define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG @@ -229,7 +229,7 @@ H5_GCC_DIAG_ON(long-long) #else # error "nothing appropriate for H5_PRINTF_HADDR_FMT" #endif -#define HADDR_MAX (HADDR_UNDEF-1) +#define HADDR_MAX (HADDR_UNDEF-1) /* uint32_t type is used for creation order field for messages. It may be * defined in Posix.1g, otherwise it is defined here. @@ -297,7 +297,7 @@ typedef enum { H5_ITER_INC, /* Increasing order */ H5_ITER_DEC, /* Decreasing order */ H5_ITER_NATIVE, /* No particular order, whatever is fastest */ - H5_ITER_N /* Number of iteration orders */ + H5_ITER_N /* Number of iteration orders */ } H5_iter_order_t; /* Iteration callback values */ @@ -314,10 +314,10 @@ typedef enum { * links in groups/attributes on objects. */ typedef enum H5_index_t { - H5_INDEX_UNKNOWN = -1, /* Unknown index type */ - H5_INDEX_NAME, /* Index on names */ - H5_INDEX_CRT_ORDER, /* Index on creation order */ - H5_INDEX_N /* Number of indices defined */ + H5_INDEX_UNKNOWN = -1, /* Unknown index type */ + H5_INDEX_NAME, /* Index on names */ + H5_INDEX_CRT_ORDER, /* Index on creation order */ + H5_INDEX_N /* Number of indices defined */ } H5_index_t; /* diff --git a/src/H5system.c b/src/H5system.c index b3db39c..24935fd 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -13,11 +13,11 @@ /*------------------------------------------------------------------------- * - * Created: H5system.c - * Aug 21 2006 - * Quincey Koziol + * Created: H5system.c + * Aug 21 2006 + * Quincey Koziol * - * Purpose: System call wrapper implementations. + * Purpose: System call wrapper implementations. * *------------------------------------------------------------------------- */ diff --git a/test/H5srcdir.h b/test/H5srcdir.h index b02d432..019cfda 100644 --- a/test/H5srcdir.h +++ b/test/H5srcdir.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, March 17, 2010 * * Purpose: srcdir querying support. @@ -20,8 +20,6 @@ #ifndef _H5SRCDIR_H #define _H5SRCDIR_H -/* Include the header file with the correct relative path for the srcdir string */ - #ifdef __cplusplus extern "C" { #endif diff --git a/test/gen_bogus.c b/test/gen_bogus.c index 1ab18a4..ab2620f 100644 --- a/test/gen_bogus.c +++ b/test/gen_bogus.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Apr 17, 2007 * * Purpose: This program is run to generate an HDF5 data file with several diff --git a/test/gen_specmetaread.c b/test/gen_specmetaread.c index fd484d1..f2625a7 100644 --- a/test/gen_specmetaread.c +++ b/test/gen_specmetaread.c @@ -23,9 +23,8 @@ * the library on the trunk as of when this file is checked in. */ -#include -#include "testhdf5.h" +#include "h5test.h" #define FILENAME "specmetaread.h5" #define DIM 10 diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index d63f36f..e60097b 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -64,7 +64,7 @@ static struct long_options l_opts[] = { { NULL, 0, '\0' } }; - + /*------------------------------------------------------------------------- * Function: usage * @@ -185,7 +185,7 @@ error: return(-1); ; } /* parse_command_line() */ - + /*------------------------------------------------------------------------- * Function: leave * @@ -387,7 +387,7 @@ error: return -1; } /* end convert_dsets_cb() */ - + /*------------------------------------------------------------------------- * Function: main * diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index 4d2d2b8..ad3b7b8 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -49,7 +49,7 @@ typedef struct mkgrp_opt_t { mkgrp_opt_t params_g; /* Command line parameter settings */ - + /*------------------------------------------------------------------------- * Function: leave * @@ -81,7 +81,7 @@ leave(int ret) HDexit(ret); } /* end leave() */ - + /*------------------------------------------------------------------------- * Function: usage * @@ -113,7 +113,7 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, "\n"); } /* end usage() */ - + /*------------------------------------------------------------------------- * Function: parse_command_line * @@ -248,7 +248,7 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options) return 0; } /* parse_command_line() */ - + /*------------------------------------------------------------------------- * Function: main * -- cgit v0.12 From bc1bed2c55981f1802f87f83054d375431a0088f Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 Aug 2020 09:11:27 -0700 Subject: Squash merge of file locking fixes --- c++/src/H5FaccProp.cpp | 47 ++++++ c++/src/H5FaccProp.h | 6 + config/cmake/ConfigureChecks.cmake | 25 +++ config/cmake/H5pubconf.h.in | 6 + config/cmake/libhdf5.settings.cmake.in | 1 + configure.ac | 50 ++++++ fortran/src/H5Pf.c | 77 +++++++++ fortran/src/H5Pff.F90 | 102 ++++++++++++ fortran/src/H5f90proto.h | 2 + fortran/src/hdf5_fortrandll.def.in | 2 + java/src/hdf/hdf5lib/H5.java | 45 +++++ java/src/jni/h5pFAPLImp.c | 72 ++++++++ java/src/jni/h5pFAPLImp.h | 27 +++ java/test/TestH5Pfapl.java | 32 ++++ java/test/testfiles/JUnit-TestH5Pfapl.txt | 3 +- release_docs/RELEASE.txt | 111 ++++++++++++- src/H5F.c | 149 ----------------- src/H5FD.c | 8 +- src/H5FDcore.c | 42 ++++- src/H5FDdirect.c | 59 ++++++- src/H5FDfamily.c | 6 +- src/H5FDlog.c | 48 +++++- src/H5FDmulti.c | 4 +- src/H5FDsec2.c | 60 +++++-- src/H5FDsplitter.c | 31 ++-- src/H5FDstdio.c | 53 +++++- src/H5Fint.c | 266 ++++++++++++++++++++++++++++-- src/H5Fpkg.h | 7 + src/H5Fprivate.h | 2 + src/H5Ftest.c | 33 ++++ src/H5Pfapl.c | 127 ++++++++++++++ src/H5Ppublic.h | 2 + src/H5err.txt | 2 + src/H5private.h | 4 +- src/H5system.c | 6 +- src/libhdf5.settings.in | 1 + test/h5test.c | 58 +++++++ test/h5test.h | 1 + test/swmr.c | 190 ++++++++++++++------- 39 files changed, 1458 insertions(+), 309 deletions(-) diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index 5a478e7..a028e00 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -685,6 +685,53 @@ unsigned FileAccPropList::getGcReferences() const } //-------------------------------------------------------------------------- +// Function: FileAccPropList::setFileLocking +///\brief Sets file locking flags. +///\param use_file_locking - IN: Flag that determines if file locks should +// be used or not. +///\param ignore_when_disabled - IN: Flag that determines if file locks +// should be be used when disabled on the file system or not. +///\exception H5::PropListIException +///\par Description +/// For information, please refer to the H5Pset_file_locking API in +/// the HDF5 C Reference Manual. +// Programmer Dana Robinson - 2020 +//-------------------------------------------------------------------------- +void FileAccPropList::setFileLocking(hbool_t use_file_locking, hbool_t ignore_when_disabled) const +{ + herr_t ret_value = H5Pset_file_locking(id, use_file_locking, ignore_when_disabled); + + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::setFileLocking", "H5Pset_file_locking failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: FileAccPropList::getFileLocking +///\brief Gets file locking flags. +///\param use_file_locking - OUT: Flag that determines if file locks +// should be used or not. +///\param ignore_when_disabled - OUT: Flag that determines if file locks +// should be be used when disabled on the file system or not. +///\exception H5::PropListIException +///\par Description +/// For information, please refer to the H5Pget_file_locking API in +/// the HDF5 C Reference Manual. +// Programmer Dana Robinson - 2020 +//-------------------------------------------------------------------------- +void FileAccPropList::getFileLocking(hbool_t& use_file_locking, hbool_t& ignore_when_disabled) const +{ + herr_t ret_value = H5Pget_file_locking(id, &use_file_locking, &ignore_when_disabled); + + if (ret_value < 0) + { + throw PropListIException("FileAccPropList::getFileLocking", "H5Pget_file_locking failed"); + } +} + + +//-------------------------------------------------------------------------- // Function: FileAccPropList::setLibverBounds ///\brief Sets bounds on versions of library format to be used when creating /// or writing objects. diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 58f049e..2475cf5 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -126,6 +126,12 @@ class H5_DLLCPP FileAccPropList : public PropList { // Returns garbage collecting references setting. unsigned getGcReferences() const; + // Sets file locking parameters + void setFileLocking(hbool_t use_file_locking, hbool_t ignore_when_disabled) const; + + // Gets file locking parameters + void getFileLocking(hbool_t& use_file_locking, hbool_t& ignore_when_disabled) const; + // Sets bounds on versions of library format to be used when creating // or writing objects. void setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const; diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 2930969..ab121e9 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -61,6 +61,31 @@ if (HDF5_ENABLE_CODESTACK) endif () MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK) +# ---------------------------------------------------------------------- +# Check if they would like to use file locking by default +#----------------------------------------------------------------------------- +option (HDF5_USE_FILE_LOCKING "Use file locking by default (mainly for SWMR)" ON) +if (HDF5_USE_FILE_LOCKING) + set (${HDF_PREFIX}_USE_FILE_LOCKING 1) +endif () + +# ---------------------------------------------------------------------- +# Check if they would like to ignore file locks when disabled on a file system +#----------------------------------------------------------------------------- +option (HDF5_IGNORE_DISABLED_FILE_LOCKS "Ignore file locks when disabled on file system" ON) +if (HDF5_IGNORE_DISABLED_FILE_LOCKS) + set (${HDF_PREFIX}_IGNORE_DISABLED_FILE_LOCKS 1) +endif () + +# Set the libhdf5.settings file variable +if (HDF5_IGNORE_DISABLED_FILE_LOCKS AND HDF5_USE_FILE_LOCKING) + set (HDF5_FILE_LOCKING_SETTING "best-effort") +elseif (HDF5_IGNORE_DISABLED_FILE_LOCKS) + set (HDF5_FILE_LOCKING_SETTING "yes") +else () + set (HDF5_FILE_LOCKING_SETTING "no") +endif () + #----------------------------------------------------------------------------- # Are we going to use HSIZE_T #----------------------------------------------------------------------------- diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 64b4852..fdf4c7d 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -489,6 +489,9 @@ /* Define if the compiler understands __inline__ */ #cmakedefine H5_HAVE___INLINE__ @H5_HAVE___INLINE__@ +/* Define if the library will ignore file locks when disabled */ +#cmakedefine H5_IGNORE_DISABLED_FILE_LOCKS @H5_IGNORE_DISABLED_FILE_LOCKS@ + /* Define if the high-level library headers should be included in hdf5.h */ #cmakedefine H5_INCLUDE_HL @H5_INCLUDE_HL@ @@ -729,6 +732,9 @@ /* Define using v1.14 public API symbols by default */ #cmakedefine H5_USE_114_API_DEFAULT @H5_USE_114_API_DEFAULT@ +/* Define if the library will use file locking */ +#cmakedefine H5_FILE_LOCKING @H5_USE_FILE_LOCKING@ + /* Define if a memory checking tool will be used on the library, to cause library to be very picky about memory operations and also disable the internal free list manager code. */ diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index b745765..ebcbd61 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -85,5 +85,6 @@ Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@ Using memory checker: @HDF5_ENABLE_USING_MEMCHECKER@ Memory allocation sanity checks: @HDF5_MEMORY_ALLOC_SANITY_CHECK@ Function Stack Tracing: @HDF5_ENABLE_CODESTACK@ + Use file locking: @HDF5_FILE_LOCKING_SETTING@ Strict File Format Checks: @HDF5_STRICT_FORMAT_CHECKS@ Optimization Instrumentation: @HDF5_Enable_Instrument@ diff --git a/configure.ac b/configure.ac index f79e9e6..6e0b4c7 100644 --- a/configure.ac +++ b/configure.ac @@ -2316,6 +2316,56 @@ case "X-$OPTIMIZATION" in esac ## ---------------------------------------------------------------------- +## Check if file locking should be used +## +AC_MSG_CHECKING([enable file locking]) +AC_ARG_ENABLE([file-locking], + [AS_HELP_STRING([--enable-file-locking=(yes|no|best-effort)], + [Sets the default for whether or not to use file + locking when opening files. Can be overridden + with the HDF5_USE_FILE_LOCKING environment variable + and the H5Pset_file_locking() API call. + best-effort attempts to use file locking but does + not fail when file locks have been disabled on + the file system (useful with Lustre). + [default=best-effort] + ])], + [DESIRED_FILE_LOCKING=$enableval]) + +## Set defaults +if test "X-$DESIRED_FILE_LOCKING" = X- ; then + DESIRED_FILE_LOCKING=best-effort +fi + +## Allow this variable to be substituted in +## other files (src/libhdf5.settings.in, etc.) +AC_SUBST([DESIRED_FILE_LOCKING]) +AC_SUBST([USE_FILE_LOCKING]) +AC_SUBST([IGNORE_DISABLED_FILE_LOCKS]) + +case "X-$DESIRED_FILE_LOCKING" in + X-best-effort) + AC_MSG_RESULT([best-effort]) + AC_DEFINE([USE_FILE_LOCKING], [1], + [Define if the library will use file locking]) + AC_DEFINE([IGNORE_DISABLED_FILE_LOCKS], [1], + [Define if the library will ignore file locks when disabled]) + ;; + X-yes) + AC_MSG_RESULT([yes]) + AC_DEFINE([USE_FILE_LOCKING], [1], + [Define if the library will use file locking]) + ;; + X-no) + AC_MSG_RESULT([no]) + ;; + *) + AC_MSG_ERROR([Unrecognized value: $USE_FILE_LOCKING]) + ;; +esac + + +## ---------------------------------------------------------------------- ## Enable/disable internal package-level debugging output ## AC_MSG_CHECKING([for internal debug output]) diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 7cb3db8..9816d7b 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -5241,6 +5241,83 @@ h5pget_file_image_c(hid_t_f *fapl_id, void **buf_ptr, size_t_f *buf_len_ptr) return ret_value; } +/****if* H5Pf/h5pset_file_locking_c + * NAME + * h5pset_file_locking_c + * PURPOSE + * Call H5Pset_file_locking to set file locking properties. + * INPUTS + * prp_id - file access property list identifier + * use_file_locking - TRUE/FALSE flag + * ignore_disabled_file_locking - TRUE/FALSE flag + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Dana Robinson + * Summer 2020 + * SOURCE +*/ +int_f +h5pset_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking) +/******/ +{ + int ret_value = 0; + hid_t c_prp_id = H5I_INVALID_HID; + herr_t status; + hbool_t c_use_flag = 1; + hbool_t c_ignore_flag = 1; + + if (*use_file_locking == 0) c_use_flag = 0; + if (*ignore_disabled_file_locking == 0) c_ignore_flag = 1; + + c_prp_id = (hid_t)*prp_id; + + status = H5Pset_file_locking(c_prp_id, c_use_flag, c_ignore_flag); + + if ( status < 0 ) ret_value = -1; + + return ret_value; +} + + +/****if* H5Pf/h5pget_file_locking_c + * NAME + * h5pget_file_locking_c + * PURPOSE + * Call H5Pget_file_locking to get file locking properties. + * INPUTS + * prp_id - file access property list identifier + * use_file_locking - TRUE/FALSE flag + * ignore_disabled_file_locking - TRUE/FALSE flag + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Dana Robinson + * Summer 2020 + * SOURCE +*/ +int_f +h5pget_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking) +/******/ +{ + int ret_value = 0; + hid_t c_prp_id = H5I_INVALID_HID; + hbool_t c_use_flag = 1; + hbool_t c_ignore_flag = 1; + herr_t c_ret; + + c_prp_id = (hid_t)*prp_id; + + c_ret = H5Pget_file_locking(c_prp_id, &c_use_flag, &c_ignore_flag); + + if ( c_ret < 0 ) ret_value = -1; + + *use_file_locking = (int_f)c_use_flag; + *ignore_disabled_file_locking = (int_f)c_ignore_flag; + + return ret_value; +} + #ifdef H5_HAVE_PARALLEL /****if* H5Pf/h5pset_fapl_mpio_c * NAME diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 index 7e06cf3..40c4e95 100644 --- a/fortran/src/H5Pff.F90 +++ b/fortran/src/H5Pff.F90 @@ -8263,5 +8263,107 @@ END SUBROUTINE h5pget_virtual_dsetname_f END SUBROUTINE h5pget_vol_id_f +!****s* H5P (F03)/h5pget_file_locking_f_F03 +! +! NAME +! h5pget_file_locking_f +! +! PURPOSE +! Gets the file locking properties. File locking is mainly used to help +! enforce SWMR semantics. +! +! INPUTS +! fapl_id - Target file access property list identifier. +! +! OUTPUTS +! use_file_locking - Whether or not to use file locks. +! ignore_disabled_locks - Whether or not to ignore file locks when locking +! is disabled on a file system. +! hdferr - error code: +! 0 on success and -1 on failure +! +! AUTHOR +! Dana Robinson +! Summer 2020 +! +! Fortran2003 Interface: + SUBROUTINE h5pget_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, hdferr) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: fapl_id + LOGICAL , INTENT(OUT) :: use_file_locking + LOGICAL , INTENT(OUT) :: ignore_disabled_locks + INTEGER , INTENT(OUT) :: hdferr +!***** + LOGICAL(C_BOOL) :: c_use_flag + LOGICAL(C_BOOL) :: c_ignore_flag + + INTERFACE + INTEGER FUNCTION h5pget_file_locking_c(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pget_file_locking') + IMPORT :: HID_T, C_BOOL + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN), VALUE :: fapl_id + LOGICAL(C_BOOL), INTENT(OUT) :: use_file_locking + LOGICAL(C_BOOL), INTENT(OUT) :: ignore_disabled_locks + END FUNCTION h5pget_file_locking_c + END INTERFACE + + hdferr = INT(h5pget_file_locking_c(fapl_id, c_use_flag, c_ignore_flag)) + + ! Transfer value of C C_BOOL type to Fortran LOGICAL + use_file_locking = c_use_flag + ignore_disabled_locks = c_ignore_flag + + END SUBROUTINE h5pget_file_locking_f + +!****s* H5P (F03)/h5pset_file_locking_f_F03 +! +! NAME +! h5pset_file_locking_f +! +! PURPOSE +! Sets the file locking properties. File locking is mainly used to help +! enforce SWMR semantics. +! +! INPUTS +! fapl_id - Target file access property list identifier. +! use_file_locking - Whether or not to use file locks. +! ignore_disabled_locks - Whether or not to ignore file locks when locking +! is disabled on a file system. +! hdferr - error code: +! 0 on success and -1 on failure +! +! AUTHOR +! Dana Robinson +! Summer 2020 +! +! Fortran2003 Interface: + SUBROUTINE h5pset_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, hdferr) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: fapl_id + LOGICAL , INTENT(IN) :: use_file_locking + LOGICAL , INTENT(IN) :: ignore_disabled_locks + INTEGER , INTENT(OUT) :: hdferr +!***** + LOGICAL(C_BOOL) :: c_use_flag + LOGICAL(C_BOOL) :: c_ignore_flag + + INTERFACE + INTEGER FUNCTION h5pset_file_locking_c(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pset_file_locking') + IMPORT :: HID_T, C_BOOL + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN), VALUE :: fapl_id + LOGICAL(C_BOOL), INTENT(IN) :: use_file_locking + LOGICAL(C_BOOL), INTENT(IN) :: ignore_disabled_locks + END FUNCTION h5pset_file_locking_c + END INTERFACE + + ! Transfer value of Fortran LOGICAL to C C_BOOL type + c_use_flag = use_file_locking + c_ignore_flag = ignore_disabled_locks + + hdferr = INT(h5pset_file_locking_c(fapl_id, c_use_flag, c_ignore_flag)) + + END SUBROUTINE h5pset_file_locking_f + END MODULE H5P diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 695efcd..56a685e 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -481,6 +481,8 @@ H5_FCDLL int_f h5pset_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); H5_FCDLL int_f h5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); H5_FCDLL int_f h5pset_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0); H5_FCDLL int_f h5pget_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0); +H5_FCDLL int_f h5pset_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking); +H5_FCDLL int_f h5pget_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking); #ifdef H5_HAVE_PARALLEL H5_FCDLL int_f h5pget_mpio_actual_io_mode_c(hid_t_f *dxpl_id, int_f *actual_io_mode); H5_FCDLL int_f h5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info); diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 9c69e5a..4207239 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -339,6 +339,8 @@ H5P_mp_H5PGET_DSET_NO_ATTRS_HINT_F H5P_mp_H5PSET_DSET_NO_ATTRS_HINT_F H5P_mp_H5PSET_VOL_F H5P_mp_H5PGET_VOL_ID_F +H5P_mp_H5PSET_FILE_LOCKING_F +H5P_mp_H5PGET_FILE_LOCKING_F ; Parallel @H5_NOPAREXP@H5P_mp_H5PSET_FAPL_MPIO_F @H5_NOPAREXP@H5P_mp_H5PGET_FAPL_MPIO_F diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 1527dc2..ae1eb3d 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -6687,6 +6687,51 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_evict_on_close(long fapl_id, boolean evict_on_close) throws HDF5LibraryException; + /** + * H5Pget_use_file_locking retrieves whether we are using file locking. + * + * @param fapl_id + * IN: File access property list identifier + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native boolean H5Pget_use_file_locking(long fapl_id) + throws HDF5LibraryException; + + /** + * H5Pget_use_file_locking retrieves whether we ignore file locks when they are disabled. + * + * @param fapl_id + * IN: File access property list identifier + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native boolean H5Pget_ignore_disabled_file_locking(long fapl_id) + throws HDF5LibraryException; + + /** + * H5Pset_file_locking sets parameters related to file locking. + * + * @param fapl_id + * IN: File access property list identifier + * + * @param use_file_locking + * IN: Whether the library will use file locking when opening files (mainly for SWMR semantics). + * + * @param ignore_when_disabled + * IN: Whether file locking will be ignored when disabled on a file system (useful for Lustre). + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native void H5Pset_file_locking(long fapl_id, boolean use_file_locking, boolean ignore_when_disabled) + throws HDF5LibraryException; + // ///// unimplemented ///// // herr_t H5Pset_vol(hid_t plist_id, hid_t new_vol_id, const void *new_vol_info); // herr_t H5Pget_vol_id(hid_t plist_id, hid_t *vol_id); diff --git a/java/src/jni/h5pFAPLImp.c b/java/src/jni/h5pFAPLImp.c index 9ae8775..dbfbb5a 100644 --- a/java/src/jni/h5pFAPLImp.c +++ b/java/src/jni/h5pFAPLImp.c @@ -1377,6 +1377,78 @@ done: /* * Class: hdf_hdf5lib_H5 + * Method: H5Pset_file_locking + * Signature: (JZZ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1file_1locking + (JNIEnv *env, jclass clss, jlong fapl_id, jboolean use_file_locking, jboolean ignore_when_disabled) +{ + hbool_t use_file_locking_val = TRUE; + hbool_t ignore_when_disabled_val = TRUE; + + UNUSED(clss); + + use_file_locking_val = (use_file_locking == JNI_TRUE) ? TRUE : FALSE; + ignore_when_disabled_val = (ignore_when_disabled == JNI_TRUE) ? TRUE : FALSE; + + if (H5Pset_file_locking((hid_t)fapl_id, use_file_locking_val, ignore_when_disabled_val) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + return; +} /* end Java_hdf_hdf5lib_H5_H5Pset_1file_1locking */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_use_file_locking + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1use_1file_1locking + (JNIEnv *env, jclass clss, jlong fapl_id) +{ + hbool_t use_file_locking_val = TRUE; + hbool_t unused = TRUE; + jboolean bval = JNI_FALSE; + + UNUSED(clss); + + if (H5Pget_file_locking((hid_t)fapl_id, &use_file_locking_val, &unused) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + bval = (use_file_locking_val == TRUE) ? JNI_TRUE : JNI_FALSE; + +done: + return bval; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1use_1file_1locking */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_ignore_disabled_file_locking + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1ignore_1disabled_1file_1locking + (JNIEnv *env, jclass clss, jlong fapl_id) +{ + hbool_t ignore_when_disabled_val = TRUE; + hbool_t unused = TRUE; + jboolean bval = JNI_FALSE; + + UNUSED(clss); + + if (H5Pget_file_locking((hid_t)fapl_id, &unused, &ignore_when_disabled_val) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + bval = (ignore_when_disabled_val == TRUE) ? JNI_TRUE : JNI_FALSE; + +done: + return bval; +} /* end Java_hdf_hdf5lib_H5_H5Pget_1ignore_1disabled_1file_1locking */ + +/* + * Class: hdf_hdf5lib_H5 * Method: H5Pset_metadata_read_attempts * Signature: (JJ)V */ diff --git a/java/src/jni/h5pFAPLImp.h b/java/src/jni/h5pFAPLImp.h index 9b353e6..b9b4556 100644 --- a/java/src/jni/h5pFAPLImp.h +++ b/java/src/jni/h5pFAPLImp.h @@ -392,6 +392,33 @@ Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close /* * Class: hdf_hdf5lib_H5 + * Method: H5Pset_file_locking + * Signature: (JZZ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Pset_1file_1locking +(JNIEnv *env, jclass clss, jlong fapl_id, jboolean use_file_locking, jboolean ignore_when_disabled); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_use_file_locking + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1use_1file_1locking +(JNIEnv *env, jclass clss, jlong fapl_id); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Pget_ignore_disabled_file_locking + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Pget_1ignore_1disabled_1file_1locking +(JNIEnv *env, jclass clss, jlong fapl_id); + +/* + * Class: hdf_hdf5lib_H5 * Method: H5Pset_metadata_read_attempts * Signature: (JJ)V */ diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index 10a79dd..4233580 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1398,4 +1398,36 @@ public class TestH5Pfapl { fail("H5P_evict_on_close: " + err); } } + + @Test + public void testH5P_file_locking() { + boolean use_file_locking = false; + boolean ignore_disabled_file_locking = false; + try { + // false values (usually not the default) + H5.H5Pset_file_locking(fapl_id, false, false); + use_file_locking = H5.H5Pget_use_file_locking(fapl_id); + ignore_disabled_file_locking = H5.H5Pget_ignore_disabled_file_locking(fapl_id); + assertFalse("H5P_file_locking", use_file_locking); + assertFalse("H5P_file_locking", ignore_disabled_file_locking); + + // true values (typically the default) + H5.H5Pset_file_locking(fapl_id, true, true); + use_file_locking = H5.H5Pget_use_file_locking(fapl_id); + ignore_disabled_file_locking = H5.H5Pget_ignore_disabled_file_locking(fapl_id); + assertTrue("H5P_file_locking", use_file_locking); + assertTrue("H5P_file_locking", ignore_disabled_file_locking); + } + catch (HDF5PropertyListInterfaceException err) { + // parallel is not supported + if (err.getMinorErrorNumber() != HDF5Constants.H5E_UNSUPPORTED) { + err.printStackTrace(); + fail("H5P_test_file_locking: " + err); + } + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5P_test_file_locking: " + err); + } + } } diff --git a/java/test/testfiles/JUnit-TestH5Pfapl.txt b/java/test/testfiles/JUnit-TestH5Pfapl.txt index c4f37d0..c34ac1c 100644 --- a/java/test/testfiles/JUnit-TestH5Pfapl.txt +++ b/java/test/testfiles/JUnit-TestH5Pfapl.txt @@ -28,6 +28,7 @@ JUnit version 4.11 .testH5Pset_elink_fapl .testH5P_hyper_vector_size .testH5P_gc_references +.testH5P_file_locking .testH5P_family_offset .testH5P_fapl_core .testH5P_fapl_muti @@ -37,5 +38,5 @@ JUnit version 4.11 Time: XXXX -OK (35 tests) +OK (36 tests) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index b9641d1..6013603 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -330,6 +330,55 @@ New Features (ADB - 2018/07/16) + - Add file locking configure and CMake options + + HDF5 1.10.0 introduced a file locking scheme, primarily to help + enforce SWMR setup. Formerly, the only user-level control of the scheme + was via the HDF5_USE_FILE_LOCKING environment variable. + + This change introduces configure-time options that control whether + or not file locking will be used and whether or not the library + ignores errors when locking has been disabled on the file system + (useful on some HPC Lustre installations). + + In both the Autotools and CMake, the settings have the effect of changing + the default property list settings (see the H5Pset/get_file_locking() + entry, below). + + The yes/no/best-effort file locking configure setting has also been + added to the libhdf5.settings file. + + Autotools: + + An --enable-file-locking=(yes|no|best-effort) option has been added. + + yes: Use file locking. + no: Do not use file locking. + best-effort: Use file locking and ignore "disabled" errors. + + CMake: + + Two self-explanatory options have been added: + + HDF5_USE_FILE_LOCKING + HDF5_IGNORE_DISABLED_FILE_LOCKS + + Setting both of these to ON is the equivalent to the Autotools' + best-effort setting. + + NOTE: + The precedence order of the various file locking control mechanisms is: + + 1) HDF5_USE_FILE_LOCKING environment variable (highest) + + 2) H5Pset_file_locking() + + 3) configure/CMake options (which set the property list defaults) + + 4) library defaults (currently best-effort) + + (DER - 2020/07/30, HDFFV-11092) + Library: -------- @@ -507,6 +556,32 @@ New Features (DER - 2020/03/18, HDFFV-11057) + - Add BEST-EFFORT value to HDF5_USE_FILE_LOCKING environment variable + + This change adds a BEST-EFFORT to the TRUE/FALSE, 1/0 settings that + were previously accepted. This option turns on file locking but + ignores locking errors when the library detects that file locking + has been disabled on a file system (useful on some HPC Lustre + installations). + + The capitalization of BEST-EFFORT is mandatory. + + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. + + (DER - 2020/07/30, HDFFV-11092) + + + - Add H5Pset/get_file_locking() API calls + + This change adds new API calls which can be used to set or get the + file locking parameters. The single API call sets both the "use file + locking" flag and the "ignore disabled file locking" flag. + + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. + + (DER - 2020/07/30, HDFFV-11092) Parallel Library: ----------------- @@ -537,11 +612,21 @@ New Features (MSB, 2019/01/08, HDFFV-10443) + - Add wrappers for H5Pset/get_file_locking() API calls + + h5pget_file_locking_f() + h5pset_file_locking_f() + + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. + + (DER - 2020/07/30, HDFFV-11092) + C++ Library: ------------ - Added new wrappers for H5Pset/get_create_intermediate_group() - LinkCreatPropList::setCreateIntermediateGroup() LinkCreatPropList::getCreateIntermediateGroup() + LinkCreatPropList::setCreateIntermediateGroup() (BMR - 2019/04/22, HDFFV-10622) @@ -550,6 +635,16 @@ New Features (BMR - 2019/02/14, HDFFV-10532) + - Add wrappers for H5Pset/get_file_locking() API calls + + FileAccPropList::setFileLocking() + FileAccPropList::getFileLocking() + + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. + + (DER - 2020/07/30, HDFFV-11092) + Java Library: ---------------- @@ -587,6 +682,20 @@ New Features (DER - 2018/12/08, HDFFV-10252) + - Add wrappers for H5Pset/get_file_locking() API calls + + H5Pset_file_locking() + H5Pget_use_file_locking() + H5Pget_ignore_disabled_file_locking() + + Unlike the C++ and Fortran wrappers, there are separate getters for the + two file locking settings, each of which returns a boolean value. + + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. + + (DER - 2020/07/30, HDFFV-11092) + Tools: ------ diff --git a/src/H5F.c b/src/H5F.c index 9d426ac..c6db109 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -73,8 +73,6 @@ typedef struct { /* Local Prototypes */ /********************/ -static herr_t H5F__close_cb(H5VL_object_t *file_vol_obj); - /* Callback for getting object counts in a file */ static int H5F__get_all_count_cb(void H5_ATTR_UNUSED *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void *key); @@ -86,9 +84,6 @@ static int H5F__get_all_ids_cb(void H5_ATTR_UNUSED *obj_ptr, hid_t obj_id, void /* Package Variables */ /*********************/ -/* Package initialization variable */ -hbool_t H5_PKG_INIT_VAR = FALSE; - /*****************************/ /* Library Private Variables */ @@ -105,150 +100,6 @@ H5FL_EXTERN(H5VL_t); /* Declare a free list to manage the H5VL_object_t struct */ H5FL_EXTERN(H5VL_object_t); -/* File ID class */ -static const H5I_class_t H5I_FILE_CLS[1] = {{ - H5I_FILE, /* ID class value */ - 0, /* Class flags */ - 0, /* # of reserved IDs for class */ - (H5I_free_t)H5F__close_cb /* Callback routine for closing objects of this class */ -}}; - - - -/*------------------------------------------------------------------------- - * Function: H5F_init - * - * Purpose: Initialize the interface from some other layer. - * - * Return: Success: non-negative - * - * Failure: negative - *------------------------------------------------------------------------- - */ -herr_t -H5F_init(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - /* FUNC_ENTER() does all the work */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_init() */ - - -/*-------------------------------------------------------------------------- -NAME - H5F__init_package -- Initialize interface-specific information -USAGE - herr_t H5F__init_package() -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. - ---------------------------------------------------------------------------*/ -herr_t -H5F__init_package(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_PACKAGE - - /* - * Initialize the atom group for the file IDs. - */ - if(H5I_register_type(H5I_FILE_CLS) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to initialize interface") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5F__init_package() */ - - -/*------------------------------------------------------------------------- - * Function: H5F_term_package - * - * Purpose: Terminate this interface: free all memory and reset global - * variables to their initial values. Release all ID groups - * associated with this interface. - * - * Return: Success: Positive if anything was done that might - * have affected other interfaces; - * zero otherwise. - * - * Failure: Never fails - * - *------------------------------------------------------------------------- - */ -int -H5F_term_package(void) -{ - int n = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if(H5_PKG_INIT_VAR) { - if(H5I_nmembers(H5I_FILE) > 0) { - (void)H5I_clear_type(H5I_FILE, FALSE, FALSE); - n++; /*H5I*/ - } /* end if */ - else { - /* Make certain we've cleaned up all the shared file objects */ - H5F_sfile_assert_num(0); - - /* Destroy the file object id group */ - n += (H5I_dec_type_ref(H5I_FILE) > 0); - - /* Mark closed */ - if(0 == n) - H5_PKG_INIT_VAR = FALSE; - } /* end else */ - } /* end if */ - - FUNC_LEAVE_NOAPI(n) -} /* end H5F_term_package() */ - - -/*------------------------------------------------------------------------- - * Function: H5F__close_cb - * - * Purpose: Closes a file or causes the close operation to be pended. - * This function is called from the API and gets called - * by H5Fclose->H5I_dec_ref->H5F__close_cb when H5I_dec_ref() - * decrements the file ID reference count to zero. The file ID - * is removed from the H5I_FILE group by H5I_dec_ref() just - * before H5F__close_cb() is called. If there are open object - * headers then the close is pended by moving the file to the - * H5I_FILE_CLOSING ID group (the f->closing contains the ID - * assigned to file). - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -static herr_t -H5F__close_cb(H5VL_object_t *file_vol_obj) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_STATIC - - /* Sanity check */ - HDassert(file_vol_obj); - - /* Close the file */ - if(H5VL_file_close(file_vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close file") - - /* Free the VOL object */ - if(H5VL_free_object(file_vol_obj) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to free VOL object") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F__close_cb() */ /*------------------------------------------------------------------------- diff --git a/src/H5FD.c b/src/H5FD.c index 2e80c7f..edcc121 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -1642,7 +1642,7 @@ H5FDlock(H5FD_t *file, hbool_t rw) /* Call private function */ if(H5FD_lock(file, rw) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file lock request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "file lock request failed") done: FUNC_LEAVE_API(ret_value) @@ -1672,7 +1672,7 @@ H5FD_lock(H5FD_t *file, hbool_t rw) /* Dispatch to driver */ if(file->cls->lock && (file->cls->lock)(file, rw) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "driver lock request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "driver lock request failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1704,7 +1704,7 @@ H5FDunlock(H5FD_t *file) /* Call private function */ if(H5FD_unlock(file) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file unlock request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "file unlock request failed") done: FUNC_LEAVE_API(ret_value) @@ -1733,7 +1733,7 @@ H5FD_unlock(H5FD_t *file) /* Dispatch to driver */ if(file->cls->unlock && (file->cls->unlock)(file) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "driver unlock request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "driver unlock request failed") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 0551dd0..a20f0c1 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -36,6 +36,9 @@ /* The driver identification number, initialized at runtime */ static hid_t H5FD_CORE_g = 0; +/* Whether to ignore file locks when disabled (env var value) */ +static htri_t ignore_disabled_file_locks_s = FAIL; + /* The skip list node type. Represents a region in the file. */ typedef struct H5FD_core_region_t { haddr_t start; /* Start address of the region */ @@ -56,6 +59,7 @@ typedef struct H5FD_core_t { hbool_t backing_store; /* write to file name on flush */ hbool_t write_tracking; /* Whether to track writes */ size_t bstore_page_size; /* backing store page size */ + hbool_t ignore_disabled_file_locks; int fd; /* backing store file descriptor */ /* Information for determining uniqueness of a file with a backing store */ #ifndef H5_HAVE_WIN32_API @@ -412,10 +416,20 @@ done: static herr_t H5FD__init_package(void) { + char *lock_env_var = NULL; /* Environment variable pointer */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT + /* Check the use disabled file locks environment variable */ + lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ + else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE")) + ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ + else + ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ + if(H5FD_core_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize core VFD") @@ -798,6 +812,16 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr /* Save file image callbacks */ file->fi_callbacks = file_image_info.callbacks; + /* Check the file locking flags in the fapl */ + if(ignore_disabled_file_locks_s != FAIL) + /* The environment variable was set, so use that preferentially */ + file->ignore_disabled_file_locks = ignore_disabled_file_locks_s; + else { + /* Use the value in the property list */ + if(H5P_get(plist, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME, &file->ignore_disabled_file_locks) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get ignore disabled file locks property") + } + if(fd >= 0) { /* Retrieve information for determining uniqueness of file */ #ifdef H5_HAVE_WIN32_API @@ -1615,8 +1639,12 @@ H5FD_core_lock(H5FD_t *_file, hbool_t rw) /* Place a non-blocking lock on the file */ if(HDflock(file->fd, lock_flags | LOCK_NB) < 0) { - if(ENOSYS == errno) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)") + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } else HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to lock file") } /* end if */ @@ -1652,11 +1680,15 @@ H5FD_core_unlock(H5FD_t *_file) if(file->fd >= 0) { if(HDflock(file->fd, LOCK_UN) < 0) { - if(ENOSYS == errno) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)") + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } else HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to unlock file") - } /* end if */ + } } /* end if */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 34c4346..dcd8b13 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -38,6 +38,9 @@ /* The driver identification number, initialized at runtime */ static hid_t H5FD_DIRECT_g = 0; +/* Whether to ignore file locks when disabled (env var value) */ +static htri_t ignore_disabled_file_locks_s = FAIL; + /* File operations */ #define OP_UNKNOWN 0 #define OP_READ 1 @@ -71,6 +74,7 @@ typedef struct H5FD_direct_t { haddr_t pos; /*current file I/O position */ int op; /*last operation */ H5FD_direct_fapl_t fa; /*file access properties */ + hbool_t ignore_disabled_file_locks; #ifndef H5_HAVE_WIN32_API /* * On most systems the combination of device and i-node number uniquely @@ -193,10 +197,20 @@ DESCRIPTION static herr_t H5FD__init_package(void) { + char *lock_env_var = NULL; /* Environment variable pointer */ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + /* Check the use disabled file locks environment variable */ + lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ + else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ + else + ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ + if(H5FD_direct_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize direct VFD") @@ -518,6 +532,16 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd file->fa.fbsize = fa->fbsize; file->fa.cbsize = fa->cbsize; + /* Check the file locking flags in the fapl */ + if(ignore_disabled_file_locks_s != FAIL) + /* The environment variable was set, so use that preferentially */ + file->ignore_disabled_file_locks = ignore_disabled_file_locks_s; + else { + /* Use the value in the property list */ + if(H5P_get(plist, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME, &file->ignore_disabled_file_locks) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get ignore disabled file locks property") + } + /* Try to decide if data alignment is required. The reason to check it here * is to handle correctly the case that the file is in a different file system * than the one where the program is running. @@ -1334,17 +1358,28 @@ done: static herr_t H5FD_direct_lock(H5FD_t *_file, hbool_t rw) { - H5FD_direct_t *file = (H5FD_direct_t*)_file; /* VFD file struct */ - const int lock = rw ? LOCK_EX : LOCK_SH; - herr_t ret_value = SUCCEED; /* Return value */ + H5FD_direct_t *file = (H5FD_direct_t*)_file; /* VFD file struct */ + int lock_flags; /* file locking flags */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT HDassert(file); - /* Place the lock with non-blocking */ - if(HDflock(file->fd, lock | LOCK_NB) < 0) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to flock file") + /* Set exclusive or shared lock based on rw status */ + lock_flags = rw ? LOCK_EX : LOCK_SH; + + /* Place a non-blocking lock on the file */ + if(HDflock(file->fd, lock_flags | LOCK_NB) < 0) { + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } + else + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock file") + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -1372,8 +1407,16 @@ H5FD_direct_unlock(H5FD_t *_file) HDassert(file); - if(HDflock(file->fd, LOCK_UN) < 0) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to flock (unlock) file") + if(HDflock(file->fd, LOCK_UN) < 0) { + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } + else + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock file") + } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index d110ef7..154878e 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -1372,9 +1372,9 @@ H5FD_family_lock(H5FD_t *_file, hbool_t rw) for(v = 0; v < u; v++) { if(H5FD_unlock(file->memb[v]) < 0) /* Push error, but keep going */ - HDONE_ERROR(H5E_IO, H5E_CANTUNLOCK, FAIL, "unable to unlock member files") + HDONE_ERROR(H5E_IO, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock member files") } /* end for */ - HGOTO_ERROR(H5E_IO, H5E_CANTLOCK, FAIL, "unable to lock member files") + HGOTO_ERROR(H5E_IO, H5E_CANTLOCKFILE, FAIL, "unable to lock member files") } /* end if */ done: @@ -1406,7 +1406,7 @@ H5FD_family_unlock(H5FD_t *_file) for(u = 0; u < file->nmembs; u++) if(file->memb[u]) if(H5FD_unlock(file->memb[u]) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTUNLOCK, FAIL, "unable to unlock member files") + HGOTO_ERROR(H5E_IO, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock member files") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 78b7742..af6d8e0 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -40,6 +40,9 @@ /* The driver identification number, initialized at runtime */ static hid_t H5FD_LOG_g = 0; +/* Whether to ignore file locks when disabled (env var value) */ +static htri_t ignore_disabled_file_locks_s = FAIL; + /* Driver-specific file access properties */ typedef struct H5FD_log_fapl_t { char *logfile; /* Allocated log file name */ @@ -80,6 +83,7 @@ typedef struct H5FD_log_t { haddr_t eof; /* end of file; current file size */ haddr_t pos; /* current file I/O position */ H5FD_file_op_t op; /* last operation */ + hbool_t ignore_disabled_file_locks; char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */ #ifndef H5_HAVE_WIN32_API /* On most systems the combination of device and i-node number uniquely @@ -234,10 +238,20 @@ H5FL_DEFINE_STATIC(H5FD_log_t); static herr_t H5FD__init_package(void) { + char *lock_env_var = NULL; /* Environment variable pointer */ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + /* Check the use disabled file locks environment variable */ + lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ + else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ + else + ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ + if(H5FD_log_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize log VFD") @@ -625,6 +639,16 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) } /* end if */ } /* end if */ + /* Check the file locking flags in the fapl */ + if(ignore_disabled_file_locks_s != FAIL) + /* The environment variable was set, so use that preferentially */ + file->ignore_disabled_file_locks = ignore_disabled_file_locks_s; + else { + /* Use the value in the property list */ + if(H5P_get(plist, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME, &file->ignore_disabled_file_locks) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get ignore disabled file locks property") + } + /* Check for non-default FAPL */ if(H5P_FILE_ACCESS_DEFAULT != fapl_id) { /* This step is for h5repart tool only. If user wants to change file driver from @@ -1671,11 +1695,15 @@ H5FD_log_lock(H5FD_t *_file, hbool_t rw) /* Place a non-blocking lock on the file */ if(HDflock(file->fd, lock_flags | LOCK_NB) < 0) { - if(ENOSYS == errno) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)") + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } else - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to lock file") - } /* end if */ + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock file") + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -1704,11 +1732,15 @@ H5FD_log_unlock(H5FD_t *_file) HDassert(file); if(HDflock(file->fd, LOCK_UN) < 0) { - if(ENOSYS == errno) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)") + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } else - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to unlock file") - } /* end if */ + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock file") + } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 72f4da5..f80cac5 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -1856,7 +1856,7 @@ H5FD_multi_lock(H5FD_t *_file, hbool_t rw) } /* end if */ if(nerrors) - H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error locking member files", -1) + H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTLOCKFILE, "error locking member files", -1) return 0; } /* H5FD_multi_lock() */ @@ -1893,7 +1893,7 @@ H5FD_multi_unlock(H5FD_t *_file) } END_MEMBERS; if(nerrors) - H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error unlocking member files", -1) + H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTUNLOCKFILE, "error unlocking member files", -1) return 0; } /* H5FD_multi_unlock() */ diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 3551905..f0ce82d 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -39,6 +39,9 @@ /* The driver identification number, initialized at runtime */ static hid_t H5FD_SEC2_g = 0; +/* Whether to ignore file locks when disabled (env var value) */ +static htri_t ignore_disabled_file_locks_s = FAIL; + /* The description of a file belonging to this driver. The 'eoa' and 'eof' * determine the amount of hdf5 address space in use and the high-water mark * of the file (the current size of the underlying filesystem file). The @@ -57,6 +60,7 @@ typedef struct H5FD_sec2_t { haddr_t eof; /* end of file; current file size */ haddr_t pos; /* current file I/O position */ H5FD_file_op_t op; /* last operation */ + hbool_t ignore_disabled_file_locks; char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */ #ifndef H5_HAVE_WIN32_API /* On most systems the combination of device and i-node number uniquely @@ -190,10 +194,20 @@ H5FL_DEFINE_STATIC(H5FD_sec2_t); static herr_t H5FD__init_package(void) { + char *lock_env_var = NULL; /* Environment variable pointer */ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC + /* Check the use disabled file locks environment variable */ + lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ + else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ + else + ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ + if(H5FD_sec2_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize sec2 VFD") @@ -219,7 +233,7 @@ done: hid_t H5FD_sec2_init(void) { - hid_t ret_value = H5I_INVALID_HID; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI(H5I_INVALID_HID) @@ -316,6 +330,7 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) struct _BY_HANDLE_FILE_INFORMATION fileinfo; #endif h5_stat_t sb; + H5P_genplist_t *plist; /* Property list pointer */ H5FD_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -373,17 +388,26 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) file->inode = sb.st_ino; #endif /* H5_HAVE_WIN32_API */ + /* Get the FAPL */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) + HGOTO_ERROR(H5E_VFL, H5E_BADTYPE, NULL, "not a file access property list") + + /* Check the file locking flags in the fapl */ + if(ignore_disabled_file_locks_s != FAIL) + /* The environment variable was set, so use that preferentially */ + file->ignore_disabled_file_locks = ignore_disabled_file_locks_s; + else { + /* Use the value in the property list */ + if(H5P_get(plist, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME, &file->ignore_disabled_file_locks) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get ignore disabled file locks property") + } + /* Retain a copy of the name used to open the file, for possible error reporting */ HDstrncpy(file->filename, name, sizeof(file->filename)); file->filename[sizeof(file->filename) - 1] = '\0'; /* Check for non-default FAPL */ if(H5P_FILE_ACCESS_DEFAULT != fapl_id) { - H5P_genplist_t *plist; /* Property list pointer */ - - /* Get the FAPL */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) - HGOTO_ERROR(H5E_VFL, H5E_BADTYPE, NULL, "not a file access property list") /* This step is for h5repart tool only. If user wants to change file driver from * family to one that uses single files (sec2, etc.) while using h5repart, this @@ -961,11 +985,15 @@ H5FD_sec2_lock(H5FD_t *_file, hbool_t rw) /* Place a non-blocking lock on the file */ if(HDflock(file->fd, lock_flags | LOCK_NB) < 0) { - if(ENOSYS == errno) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)") + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } else - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to lock file") - } /* end if */ + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock file") + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -994,11 +1022,15 @@ H5FD_sec2_unlock(H5FD_t *_file) HDassert(file); if(HDflock(file->fd, LOCK_UN) < 0) { - if(ENOSYS == errno) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)") + if(file->ignore_disabled_file_locks && ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; + } else - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to unlock file") - } /* end if */ + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock file") + } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index 4ed3c4a..eb30b1f 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -1221,16 +1221,12 @@ H5FD_splitter_lock(H5FD_t *_file, hbool_t rw) HDassert(file->rw_file); /* Place the lock on each file */ - if (H5FD_lock(file->rw_file, rw) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTLOCK, FAIL, "unable to lock R/W file") - } - if (file->wo_file != NULL) { - if (H5FD_lock(file->wo_file, rw) < 0) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_lock", - H5E_VFL, H5E_CANTLOCK, FAIL, - "unable to lock W/O file") - } - } + if (H5FD_lock(file->rw_file, rw) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock R/W file") + + if (file->wo_file != NULL) + if (H5FD_lock(file->wo_file, rw) < 0) + H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_lock", H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock W/O file") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1260,15 +1256,12 @@ H5FD_splitter_unlock(H5FD_t *_file) HDassert(file->rw_file); /* Remove the lock on each file */ - if (H5FD_unlock(file->rw_file) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL, "unable to unlock R/W file") - } - if (file->wo_file != NULL) { - if (H5FD_unlock(file->wo_file) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL, - "unable to unlock W/O file") - } - } + if (H5FD_unlock(file->rw_file) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock R/W file") + + if (file->wo_file != NULL) + if (H5FD_unlock(file->wo_file) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock W/O file") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index d29a1b4..4e9ef39 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -52,6 +52,9 @@ /* The driver identification number, initialized at runtime */ static hid_t H5FD_STDIO_g = 0; +/* Whether to ignore file locks when disabled (env var value) */ +static htri_t ignore_disabled_file_locks_s = -1; + /* The maximum number of bytes which can be written in a single I/O operation */ static size_t H5_STDIO_MAX_IO_BYTES_g = (size_t)-1; @@ -82,6 +85,7 @@ typedef struct H5FD_stdio_t { haddr_t eof; /* end of file; current file size */ haddr_t pos; /* current file I/O position */ unsigned write_access; /* Flag to indicate the file was opened with write access */ + hbool_t ignore_disabled_file_locks; H5FD_stdio_file_op op; /* last operation */ #ifndef H5_HAVE_WIN32_API /* On most systems the combination of device and i-node number uniquely @@ -231,11 +235,23 @@ static const H5FD_class_t H5FD_stdio_g = { hid_t H5FD_stdio_init(void) { + char *lock_env_var = NULL; /* Environment variable pointer */ + /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - if (H5I_VFL!=H5Iget_type(H5FD_STDIO_g)) + /* Check the use disabled file locks environment variable */ + lock_env_var = getenv("HDF5_USE_FILE_LOCKING"); + if(lock_env_var && !strcmp(lock_env_var, "BEST-EFFORT")) + ignore_disabled_file_locks_s = 1; /* Override: Ignore disabled locks */ + else if(lock_env_var && !strcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + ignore_disabled_file_locks_s = 0; /* Override: Don't ignore disabled locks */ + else + ignore_disabled_file_locks_s = -1; /* Environment variable not set, or not set correctly */ + + if (H5I_VFL != H5Iget_type(H5FD_STDIO_g)) H5FD_STDIO_g = H5FDregister(&H5FD_stdio_g); + return H5FD_STDIO_g; } /* end H5FD_stdio_init() */ @@ -318,7 +334,7 @@ H5Pset_fapl_stdio(hid_t fapl_id) *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_stdio_open( const char *name, unsigned flags, hid_t /*UNUSED*/ fapl_id, +H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { FILE *f = NULL; @@ -396,6 +412,21 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t /*UNUSED*/ fapl_id, file->eof = (haddr_t)x; } + /* Check the file locking flags in the fapl */ + if(ignore_disabled_file_locks_s != -1) + /* The environment variable was set, so use that preferentially */ + file->ignore_disabled_file_locks = ignore_disabled_file_locks_s; + else { + hbool_t unused; + + /* Use the value in the property list */ + if(H5Pget_file_locking(fapl_id, &unused, &file->ignore_disabled_file_locks) < 0) { + free(file); + fclose(f); + H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTGET, "unable to get use disabled file locks property", NULL); + } + } + /* Get the file descriptor (needed for truncate and some Windows information) */ #ifdef H5_HAVE_WIN32_API file->fd = _fileno(file->fp); @@ -1104,10 +1135,13 @@ H5FD_stdio_lock(H5FD_t *_file, hbool_t rw) /* Place a non-blocking lock on the file */ if(flock(file->fd, lock_flags | LOCK_NB) < 0) { - if(ENOSYS == errno) - H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_FCNTL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)", -1) + if(file->ignore_disabled_file_locks && ENOSYS == errno) + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; else - H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_FCNTL, "file lock failed", -1) + H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTLOCKFILE, "file lock failed", -1) } /* end if */ /* Flush the stream */ @@ -1152,10 +1186,13 @@ H5FD_stdio_unlock(H5FD_t *_file) /* Place a non-blocking lock on the file */ if(flock(file->fd, LOCK_UN) < 0) { - if(ENOSYS == errno) - H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_FCNTL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)", -1) + if(file->ignore_disabled_file_locks && ENOSYS == errno) + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. + */ + errno = 0; else - H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_FCNTL, "file unlock failed", -1) + H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTUNLOCKFILE, "file unlock failed", -1) } /* end if */ #endif /* H5_HAVE_FLOCK */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 0bda894..8b2d18f 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -76,12 +76,14 @@ typedef struct H5F_olist_t { /* Local Prototypes */ /********************/ +static herr_t H5F__close_cb(H5VL_object_t *file_vol_obj); static herr_t H5F__set_vol_conn(H5F_t *file); static herr_t H5F__get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr); static int H5F__get_objects_cb(void *obj_ptr, hid_t obj_id, void *key); static herr_t H5F__build_name(const char *prefix, const char *file_name, char **full_name/*out*/); static char *H5F__getenv_prefix_name(char **env_prefix/*in,out*/); static H5F_t *H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf); +static herr_t H5F__check_if_using_file_locks(H5P_genplist_t *fapl, hbool_t *use_file_locking); static herr_t H5F__build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *name, char ** /*out*/ actual_name); static herr_t H5F__flush_phase1(H5F_t *f); static herr_t H5F__flush_phase2(H5F_t *f, hbool_t closing); @@ -91,6 +93,15 @@ static herr_t H5F__flush_phase2(H5F_t *f, hbool_t closing); /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + +/* Based on the value of the HDF5_USE_FILE_LOCKING environment variable. + * TRUE/FALSE have obvious meanings. FAIL means the environment variable was + * not set, so the code should ignore it and use the fapl value instead. + */ +htri_t use_locks_env_g = FAIL; + /*****************************/ /* Library Private Variables */ @@ -107,6 +118,186 @@ H5FL_DEFINE(H5F_t); /* Declare a free list to manage the H5F_shared_t struct */ H5FL_DEFINE(H5F_shared_t); +/* File ID class */ +static const H5I_class_t H5I_FILE_CLS[1] = {{ + H5I_FILE, /* ID class value */ + 0, /* Class flags */ + 0, /* # of reserved IDs for class */ + (H5I_free_t)H5F__close_cb /* Callback routine for closing objects of this class */ +}}; + + + +/*------------------------------------------------------------------------- + * Function: H5F_init + * + * Purpose: Initialize the interface from some other layer. + * + * Return: Success: non-negative + * + * Failure: negative + *------------------------------------------------------------------------- + */ +herr_t +H5F_init(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + /* FUNC_ENTER() does all the work */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F_init() */ + + +/*-------------------------------------------------------------------------- +NAME + H5F__init_package -- Initialize interface-specific information +USAGE + herr_t H5F__init_package() +RETURNS + Non-negative on success/Negative on failure +DESCRIPTION + Initializes any interface-specific data or routines. + +--------------------------------------------------------------------------*/ +herr_t +H5F__init_package(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* + * Initialize the atom group for the file IDs. + */ + if(H5I_register_type(H5I_FILE_CLS) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to initialize interface") + + /* Check the file locking environment variable */ + if(H5F__parse_file_lock_env_var(&use_locks_env_g) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to parse file locking environment variable") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5F__init_package() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_term_package + * + * Purpose: Terminate this interface: free all memory and reset global + * variables to their initial values. Release all ID groups + * associated with this interface. + * + * Return: Success: Positive if anything was done that might + * have affected other interfaces; + * zero otherwise. + * + * Failure: Never fails + * + *------------------------------------------------------------------------- + */ +int +H5F_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5_PKG_INIT_VAR) { + if(H5I_nmembers(H5I_FILE) > 0) { + (void)H5I_clear_type(H5I_FILE, FALSE, FALSE); + n++; /*H5I*/ + } /* end if */ + else { + /* Make certain we've cleaned up all the shared file objects */ + H5F_sfile_assert_num(0); + + /* Destroy the file object id group */ + n += (H5I_dec_type_ref(H5I_FILE) > 0); + + /* Mark closed */ + if(0 == n) + H5_PKG_INIT_VAR = FALSE; + } /* end else */ + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* end H5F_term_package() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__close_cb + * + * Purpose: Closes a file or causes the close operation to be pended. + * This function is called from the API and gets called + * by H5Fclose->H5I_dec_ref->H5F__close_cb when H5I_dec_ref() + * decrements the file ID reference count to zero. The file ID + * is removed from the H5I_FILE group by H5I_dec_ref() just + * before H5F__close_cb() is called. If there are open object + * headers then the close is pended by moving the file to the + * H5I_FILE_CLOSING ID group (the f->closing contains the ID + * assigned to file). + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +H5F__close_cb(H5VL_object_t *file_vol_obj) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(file_vol_obj); + + /* Close the file */ + if(H5VL_file_close(file_vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close file") + + /* Free the VOL object */ + if(H5VL_free_object(file_vol_obj) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to free VOL object") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__close_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__parse_file_lock_env_var + * + * Purpose: Parses the HDF5_USE_FILE_LOCKING environment variable. + * + * NOTE: This is done in a separate function so we can call it from + * the test code. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5F__parse_file_lock_env_var(htri_t *use_locks) +{ + char *lock_env_var = NULL; /* Environment variable pointer */ + + FUNC_ENTER_PACKAGE_NOERR + + /* Check the file locking environment variable */ + lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); + if(lock_env_var && (!HDstrcmp(lock_env_var, "FALSE") || !HDstrcmp(lock_env_var, "0"))) + *use_locks = FALSE; /* Override: Never use locks */ + else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "BEST-EFFORT") || !HDstrcmp(lock_env_var, "1"))) + *use_locks = TRUE; /* Override: Always use locks */ + else + *use_locks = FAIL; /* Environment variable not set, or not set correctly */ + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5F__parse_file_lock_env_var() */ /*------------------------------------------------------------------------- @@ -1426,6 +1617,52 @@ H5F__dest(H5F_t *f, hbool_t flush) /*------------------------------------------------------------------------- + * Function: H5F__check_if_using_file_locks + * + * Purpose: Determines if this file will use file locks. + * + * There are three ways that file locking can be controlled: + * + * 1) The configure/cmake option that sets the H5_USE_FILE_LOCKING + * symbol (which is used as the default fapl value). + * + * 2) The H5Pset_file_locking() API call, which will override + * the configuration default. + * + * 3) The HDF5_USE_FILE_LOCKING environment variable, which overrides + * everything above. + * + * The main reason to disable file locking is to prevent errors on file + * systems where locking is not supported or has been disabled (as is + * often the case in parallel file systems). + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +static herr_t +H5F__check_if_using_file_locks(H5P_genplist_t *fapl, hbool_t *use_file_locking) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Make sure the out parameter has a value */ + *use_file_locking = TRUE; + + /* Check the fapl property */ + if(H5P_get(fapl, H5F_ACS_USE_FILE_LOCKING_NAME, use_file_locking) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get use file locking flag") + + /* Check the environment variable */ + if(use_locks_env_g != FAIL) + *use_file_locking = (use_locks_env_g == TRUE) ? TRUE : FALSE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__check_if_using_file_locks() */ + + +/*------------------------------------------------------------------------- * Function: H5F_open * * Purpose: Opens (or creates) a file. This function understands the @@ -1514,8 +1751,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) hbool_t set_flag = FALSE; /*set the status_flags in the superblock */ hbool_t clear = FALSE; /*clear the status_flags */ hbool_t evict_on_close; /* evict on close value from plist */ - char *lock_env_var = NULL;/*env var pointer */ - hbool_t use_file_locking; /*read from env var */ + hbool_t use_file_locking = TRUE; /* Using file locks? */ hbool_t ci_load = FALSE; /* whether MDC ci load requested */ hbool_t ci_write = FALSE; /* whether MDC CI write requested */ H5F_t *ret_value = NULL; /*actual return value */ @@ -1533,15 +1769,13 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) if(NULL == (drvr = H5FD_get_class(fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "unable to retrieve VFL class") - /* Check the environment variable that determines if we care - * about file locking. File locking should be used unless explicitly - * disabled. - */ - lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); - if(lock_env_var && !HDstrcmp(lock_env_var, "FALSE")) - use_file_locking = FALSE; - else - use_file_locking = TRUE; + /* Get the file access property list, for future queries */ + if(NULL == (a_plist = (H5P_genplist_t *)H5I_object(fapl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list") + + /* Check if we are using file locking */ + if (H5F__check_if_using_file_locks(a_plist, &use_file_locking) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "unable to get file locking flag") /* * Opening a file is a two step process. First we try to open the @@ -1618,8 +1852,8 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) if(H5FD_lock(lf, (hbool_t)((flags & H5F_ACC_RDWR) ? TRUE : FALSE)) < 0) { /* Locking failed - Closing will remove the lock */ if(H5FD_close(lf) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to close low-level file info") - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to lock the file") + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "unable to close low-level file info") + HGOTO_ERROR(H5E_FILE, H5E_CANTLOCKFILE, NULL, "unable to lock the file") } /* end if */ /* Create the 'top' file structure */ @@ -1651,10 +1885,6 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) shared = file->shared; lf = shared->lf; - /* Get the file access property list, for future queries */ - if(NULL == (a_plist = (H5P_genplist_t *)H5I_object(fapl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list") - /* Check if page buffering is enabled */ if(H5P_get(a_plist, H5F_ACS_PAGE_BUFFER_SIZE_NAME, &page_buf_size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get page buffer size") @@ -1795,7 +2025,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) /* Remove the file lock for SWMR_WRITE */ if(use_file_locking && (H5F_INTENT(file) & H5F_ACC_SWMR_WRITE)) { if(H5FD_unlock(file->shared->lf) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to unlock the file") + HGOTO_ERROR(H5E_FILE, H5E_CANTUNLOCKFILE, NULL, "unable to unlock the file") } /* end if */ } /* end if */ else { /* H5F_ACC_RDONLY: check consistency of status_flags */ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 46185ff..3a39e67 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -384,6 +384,7 @@ struct H5F_t { unsigned nmounts; /* Number of children mounted to this file */ }; + /*****************************/ /* Package Private Variables */ /*****************************/ @@ -394,6 +395,10 @@ H5FL_EXTERN(H5F_t); /* Declare a free list to manage the H5F_shared_t struct */ H5FL_EXTERN(H5F_shared_t); +/* Whether or not to use file locking (based on the environment variable) + * FAIL means ignore the environment variable. + */ +H5_DLLVAR htri_t use_locks_env_g; /******************************/ /* Package Private Prototypes */ @@ -412,6 +417,7 @@ H5_DLL herr_t H5F__start_swmr_write(H5F_t *f); H5_DLL herr_t H5F__close(H5F_t *f); H5_DLL herr_t H5F__set_libver_bounds(H5F_t *f, H5F_libver_t low, H5F_libver_t high); H5_DLL herr_t H5F__get_cont_info(const H5F_t *f, H5VL_file_cont_info_t *info); +H5_DLL herr_t H5F__parse_file_lock_env_var(htri_t *use_locks); /* File mount related routines */ H5_DLL herr_t H5F__mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t plist_id); @@ -472,6 +478,7 @@ H5_DLL herr_t H5F__check_cached_stab_test(hid_t file_id); H5_DLL herr_t H5F__get_maxaddr_test(hid_t file_id, haddr_t *maxaddr); H5_DLL herr_t H5F__get_sbe_addr_test(hid_t file_id, haddr_t *sbe_addr); H5_DLL htri_t H5F__same_file_test(hid_t file_id1, hid_t file_id2); +H5_DLL herr_t H5F__reparse_file_lock_variable_test(void); #endif /* H5F_TESTING */ #endif /* _H5Fpkg_H */ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index c5d4c89..5fa4f7f 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -518,6 +518,8 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_PAGE_BUFFER_SIZE_NAME "page_buffer_size" /* the maximum size for the page buffer cache */ #define H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME "page_buffer_min_meta_perc" /* the min metadata percentage for the page buffer cache */ #define H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME "page_buffer_min_raw_perc" /* the min raw data percentage for the page buffer cache */ +#define H5F_ACS_USE_FILE_LOCKING_NAME "use_file_locking" /* whether or not we use file locks for SWMR control and to prevent multiple writers */ +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME "ignore_disabled_file_locks" /* whether or not we ignore "locks disabled" errors */ #ifdef H5_HAVE_PARALLEL #define H5F_ACS_MPI_PARAMS_COMM_NAME "mpi_params_comm" /* the MPI communicator */ #define H5F_ACS_MPI_PARAMS_INFO_NAME "mpi_params_info" /* the MPI info struct */ diff --git a/src/H5Ftest.c b/src/H5Ftest.c index 49a2a22..f17af2f 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -267,3 +267,36 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__same_file_test() */ + +/*------------------------------------------------------------------------- + * Function: H5F__reparse_file_lock_variable_test + * + * Purpose: Re-parse the file locking environment variable. + * + * Since getenv(3) is fairly expensive, we only parse it once, + * when the library opens. This test function is used to + * re-parse the environment variable after we've changed it + * with setnev(3). + * + * Return: SUCCEED/FAIL + * + * Programmer: Dana Robinson + * Summer 2020 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F__reparse_file_lock_variable_test(void) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_PACKAGE + + /* Check the file locking environment variable */ + if(H5F__parse_file_lock_env_var(&use_locks_env_g) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to parse file locking environment variable") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__reparse_file_lock_variable_test() */ + diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 30b590f..7b332d0 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -281,6 +281,29 @@ #define H5F_ACS_VOL_CONN_COPY H5P__facc_vol_copy #define H5F_ACS_VOL_CONN_CMP H5P__facc_vol_cmp #define H5F_ACS_VOL_CONN_CLOSE H5P__facc_vol_close +/* Definition for using file locking or not. The default is set + * via the configure step. + */ +#define H5F_ACS_USE_FILE_LOCKING_SIZE sizeof(hbool_t) +#if defined H5_USE_FILE_LOCKING && H5_USE_FILE_LOCKING +#define H5F_ACS_USE_FILE_LOCKING_DEF TRUE +#else +#define H5F_ACS_USE_FILE_LOCKING_DEF FALSE +#endif +#define H5F_ACS_USE_FILE_LOCKING_ENC H5P__encode_hbool_t +#define H5F_ACS_USE_FILE_LOCKING_DEC H5P__decode_hbool_t +/* Definition for whether we ignore file locking errors when we can + * tell that file locking has been disabled on the file system. + * The default is set via the configure step. + */ +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_SIZE sizeof(hbool_t) +#if defined H5_IGNORE_DISABLED_FILE_LOCKS && H5_IGNORE_DISABLED_FILE_LOCKS +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEF TRUE +#else +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEF FALSE +#endif +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_ENC H5P__encode_hbool_t +#define H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEC H5P__decode_hbool_t /******************/ @@ -447,6 +470,8 @@ static const H5AC_cache_image_config_t H5F_def_mdc_initCacheImageCfg_g = H5F_ACS static const size_t H5F_def_page_buf_size_g = H5F_ACS_PAGE_BUFFER_SIZE_DEF; /* Default page buffer size */ static const unsigned H5F_def_page_buf_min_meta_perc_g = H5F_ACS_PAGE_BUFFER_MIN_META_PERC_DEF; /* Default page buffer minimum metadata size */ static const unsigned H5F_def_page_buf_min_raw_perc_g = H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_DEF; /* Default page buffer mininum raw data size */ +static const hbool_t H5F_def_use_file_locking_g = H5F_ACS_USE_FILE_LOCKING_DEF; /* Default use file locking flag */ +static const hbool_t H5F_def_ignore_disabled_file_locks_g = H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEF; /* Default ignore disabled file locks flag */ /*------------------------------------------------------------------------- @@ -705,6 +730,16 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass) H5F_ACS_VOL_CONN_DEL, H5F_ACS_VOL_CONN_COPY, H5F_ACS_VOL_CONN_CMP, H5F_ACS_VOL_CONN_CLOSE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register the use file locking flag */ + if(H5P__register_real(pclass, H5F_ACS_USE_FILE_LOCKING_NAME, H5F_ACS_USE_FILE_LOCKING_SIZE, &H5F_def_use_file_locking_g, + NULL, NULL, NULL, H5F_ACS_USE_FILE_LOCKING_ENC, H5F_ACS_USE_FILE_LOCKING_DEC, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the ignore disabled file locks flag */ + if(H5P__register_real(pclass, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_SIZE, &H5F_def_ignore_disabled_file_locks_g, + NULL, NULL, NULL, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_ENC, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_DEC, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__facc_reg_prop() */ @@ -4551,6 +4586,98 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_evict_on_close() */ + +/*------------------------------------------------------------------------- + * Function: H5Pset_file_locking + * + * Purpose: Sets the file locking property values. + * + * Overrides the default file locking flag setting that was + * set when the library was configured. + * + * Can be overridden by the HDF5_USE_FILE_LOCKING environment + * variable. + * + * File locking is used when creating/opening a file to prevent + * problematic file accesses. + * + * Return: SUCCEED/FAIL + * + * Programmer: Dana Robinson + * Spring 2020 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_file_locking(hid_t fapl_id, hbool_t use_file_locking, hbool_t ignore_when_disabled) +{ + H5P_genplist_t *plist; /* property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE3("e", "ibb", fapl_id, use_file_locking, ignore_when_disabled); + + /* Make sure this is a fapl */ + if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not a file access plist") + + /* Get the plist structure */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Set values */ + if(H5P_set(plist, H5F_ACS_USE_FILE_LOCKING_NAME, &use_file_locking) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set use file locking property") + if(H5P_set(plist, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME, &ignore_when_disabled) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set ignore disabled file locks property") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_file_locking() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_file_locking + * + * Purpose: Gets the file locking property values. + * + * File locking is used when creating/opening a file to prevent + * problematic file accesses. + * + * Return: SUCCEED/FAIL + * + * Programmer: Dana Robinson + * Spring 2020 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_file_locking(hid_t fapl_id, hbool_t *use_file_locking, hbool_t *ignore_when_disabled) +{ + H5P_genplist_t *plist; /* property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE3("e", "i*b*b", fapl_id, use_file_locking, ignore_when_disabled); + + /* Make sure this is a fapl */ + if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not an access plist") + + /* Get the plist structure */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get values */ + if(H5P_get(plist, H5F_ACS_USE_FILE_LOCKING_NAME, use_file_locking) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get use file locking property") + if(H5P_get(plist, H5F_ACS_IGNORE_DISABLED_FILE_LOCKS_NAME, ignore_when_disabled) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get ignore disabled file locks property") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_file_locking() */ + #ifdef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index bb33561..9dfa050 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -380,6 +380,8 @@ H5_DLL herr_t H5Pset_mdc_log_options(hid_t plist_id, hbool_t is_enabled, const c H5_DLL herr_t H5Pget_mdc_log_options(hid_t plist_id, hbool_t *is_enabled, char *location, size_t *location_size, hbool_t *start_on_access); H5_DLL herr_t H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close); H5_DLL herr_t H5Pget_evict_on_close(hid_t fapl_id, hbool_t *evict_on_close); +H5_DLL herr_t H5Pset_file_locking(hid_t fapl_id, hbool_t use_file_locking, hbool_t ignore_when_disabled); +H5_DLL herr_t H5Pget_file_locking(hid_t fapl_id, hbool_t *use_file_locking, hbool_t *ignore_when_disabled); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5Pset_all_coll_metadata_ops(hid_t plist_id, hbool_t is_collective); H5_DLL herr_t H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective); diff --git a/src/H5err.txt b/src/H5err.txt index 9fec521..24ac2ac 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -136,6 +136,8 @@ MINOR, FILEACC, H5E_BADFILE, Bad file ID accessed MINOR, FILEACC, H5E_TRUNCATED, File has been truncated MINOR, FILEACC, H5E_MOUNT, File mount error MINOR, FILEACC, H5E_CANTDELETEFILE, Unable to delete file +MINOR, FILEACC, H5E_CANTLOCKFILE, Unable to lock file +MINOR, FILEACC, H5E_CANTUNLOCKFILE, Unable to unlock file # Generic low-level file I/O errors MINOR, FILE, H5E_SEEKERROR, Seek failed diff --git a/src/H5private.h b/src/H5private.h index 836d7d5..08aebdf 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -888,8 +888,8 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDflock /* NOTE: flock(2) is not present on all POSIX systems. * If it is not present, we try a flock() equivalent based on - * fcntl(2), then fall back to a function that always fails if - * it is not present at all (Windows uses a separate Wflock() + * fcntl(2), then fall back to a function that always succeeds + * if it is not present at all (Windows uses a separate Wflock() * function). */ #if defined(H5_HAVE_FLOCK) diff --git a/src/H5system.c b/src/H5system.c index b3db39c..a6a68b3 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -689,14 +689,14 @@ Pflock(int fd, int operation) { * Purpose: Wrapper function for systems where no file locking is * available. * - * Return: Failure: -1 (always fails) + * Return: 0 (success) * *------------------------------------------------------------------------- */ int H5_ATTR_CONST Nflock(int H5_ATTR_UNUSED fd, int H5_ATTR_UNUSED operation) { - /* just fail */ - return -1; + /* just succeed */ + return 0; } /* end Nflock() */ diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in index fb9deec..98390b8 100644 --- a/src/libhdf5.settings.in +++ b/src/libhdf5.settings.in @@ -89,5 +89,6 @@ Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@ Using memory checker: @USINGMEMCHECKER@ Memory allocation sanity checks: @MEMORYALLOCSANITYCHECK@ Function stack tracing: @CODESTACK@ + Use file locking: @DESIRED_FILE_LOCKING@ Strict file format checks: @STRICT_FORMAT_CHECKS@ Optimization instrumentation: @INSTRUMENT_LIBRARY@ diff --git a/test/h5test.c b/test/h5test.c index 1b445dd..858f30a 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -2236,3 +2236,61 @@ done: return ret_value; } /* end h5_duplicate_file_by_bytes() */ +/*------------------------------------------------------------------------- + * Function: h5_check_if_file_locking_enabled + * + * Purpose: Checks if file locking is enabled on this file system. + * + * Return: SUCCEED/FAIL + * are_enabled will be FALSE if file locking is disabled on + * the file system of if there were errors. + * + *------------------------------------------------------------------------- + */ +herr_t +h5_check_if_file_locking_enabled(hbool_t *are_enabled) +{ + const char *filename = "locking_test_file"; + mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; + int fd = -1; + + *are_enabled = TRUE; + + if((fd = HDcreat(filename, mode)) < 0) + goto error; + + /* Test HDflock() to see if it works */ + if(HDflock(fd, LOCK_EX | LOCK_NB) < 0) { + if(ENOSYS == errno) { + /* When errno is set to ENOSYS, the file system does not support + * locking, so ignore it. This is most frequently used on + * Lustre. If we also want to check for disabled NFS locks + * we'll need to check for ENOLCK, too. That isn't done by + * default here since that could also represent an actual + * error condition. + */ + errno = 0; + *are_enabled = FALSE; + } + else + goto error; + } + if(HDflock(fd, LOCK_UN) < 0) + goto error; + + if(HDclose(fd) < 0) + goto error; + if(HDremove(filename) < 0) + goto error; + + return SUCCEED; + +error: + *are_enabled = FALSE; + if (fd > -1) { + HDclose(fd); + HDremove(filename); + } + return FAIL; +} /* end h5_check_if_file_locking_enabled() */ + diff --git a/test/h5test.h b/test/h5test.h index 3eeb1f8..697bde6 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -211,6 +211,7 @@ H5TEST_DLL H5VL_class_t *h5_get_dummy_vol_class(void); H5TEST_DLL const char *h5_get_version_string(H5F_libver_t libver); H5TEST_DLL int h5_compare_file_bytes(char *fname1, char *fname2); H5TEST_DLL int h5_duplicate_file_by_bytes(const char *orig, const char *dest); +H5TEST_DLL herr_t h5_check_if_file_locking_enabled(hbool_t *are_enabled); /* Functions that will replace components of a FAPL */ H5TEST_DLL herr_t h5_get_vfd_fapl(hid_t fapl_id); diff --git a/test/swmr.c b/test/swmr.c index bab91bd..a839a74 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -91,7 +91,7 @@ static int test_file_lock_concur(hid_t fapl); static int test_file_lock_swmr_concur(hid_t fapl); /* Test file lock environment variable */ -static int test_file_lock_env_var(hid_t fapl); +static int test_file_locking(hid_t in_fapl, hbool_t turn_locking_on, hbool_t env_var_override); /* Tests for SWMR VFD flag */ static int test_swmr_vfd_flag(void); @@ -4256,8 +4256,11 @@ test_file_lock_same(hid_t in_fapl) /* Output message about test being performed */ TESTING("File open with different combinations of flags--single process access"); + /* Set locking in the fapl */ if((fapl = H5Pcopy(in_fapl)) < 0) FAIL_STACK_ERROR + if(H5Pset_file_locking(fapl, TRUE, TRUE) < 0) + FAIL_STACK_ERROR /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[1], fapl, filename, sizeof(filename)); @@ -4416,9 +4419,11 @@ test_file_lock_swmr_same(hid_t in_fapl) /* Output message about test being performed */ TESTING("File open with different combinations of flags + SWMR flags--single process access"); - /* Get a copy of the parameter in_fapl */ + /* Set locking in the fapl */ if((fapl = H5Pcopy(in_fapl)) < 0) FAIL_STACK_ERROR + if(H5Pset_file_locking(fapl, TRUE, TRUE) < 0) + FAIL_STACK_ERROR /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[1], fapl, filename, sizeof(filename)); @@ -4726,8 +4731,11 @@ test_file_lock_concur(hid_t in_fapl) /* Output message about test being performed */ TESTING("File open with different combinations of flags--concurrent access"); + /* Set locking in the fapl */ if((fapl = H5Pcopy(in_fapl)) < 0) FAIL_STACK_ERROR + if(H5Pset_file_locking(fapl, TRUE, TRUE) < 0) + FAIL_STACK_ERROR /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[1], fapl, filename, sizeof(filename)); @@ -5102,8 +5110,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Output message about test being performed */ TESTING("File open with different combintations of flags + SWMR flags--concurrent access"); + /* Set locking in the fapl */ if((fapl = H5Pcopy(in_fapl)) < 0) FAIL_STACK_ERROR + if(H5Pset_file_locking(fapl, TRUE, TRUE) < 0) + FAIL_STACK_ERROR /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[2], fapl, filename, sizeof(filename)); @@ -5134,7 +5145,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5155,7 +5166,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(child_fid == FAIL) HDexit(EXIT_SUCCESS); - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5205,13 +5216,13 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Fork child process */ if((childpid = HDfork()) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; - /* Close unused write end for out_pdf */ + /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) HDexit(EXIT_FAILURE); @@ -5230,7 +5241,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(child_fid == FAIL) HDexit(EXIT_SUCCESS); - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5243,7 +5254,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Open the test file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Notify child process */ notify = 1; @@ -5256,7 +5267,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Wait for child process to complete */ if(HDwaitpid(childpid, &child_status, child_wait_option) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Check if child terminated normally */ if(WIFEXITED(child_status)) { @@ -5284,7 +5295,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5305,7 +5316,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(child_fid == FAIL) HDexit(EXIT_SUCCESS); - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5354,11 +5365,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Fork child process */ if((childpid = HDfork()) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5379,7 +5390,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(child_fid == FAIL) HDexit(EXIT_SUCCESS); - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5392,7 +5403,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Open the test file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR|H5F_ACC_SWMR_WRITE, fapl)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Notify child process */ notify = 1; @@ -5405,7 +5416,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Wait for child process to complete */ if(HDwaitpid(childpid, &child_status, child_wait_option) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Check if child terminated normally */ if(WIFEXITED(child_status)) { @@ -5428,11 +5439,11 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Fork child process */ if((childpid = HDfork()) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5456,7 +5467,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) HDexit(EXIT_SUCCESS); } - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5469,7 +5480,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Open the test file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR|H5F_ACC_SWMR_WRITE, fapl)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Notify child process */ notify = 1; @@ -5482,7 +5493,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Wait for child process to complete */ if(HDwaitpid(childpid, &child_status, child_wait_option) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Check if child terminated normally */ if(WIFEXITED(child_status)) { @@ -5509,7 +5520,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5530,7 +5541,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(child_fid == FAIL) HDexit(EXIT_SUCCESS); - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5584,7 +5595,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5598,14 +5609,14 @@ test_file_lock_swmr_concur(hid_t in_fapl) /* Open the test file */ H5E_BEGIN_TRY { - child_fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT); + child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl); } H5E_END_TRY; /* Should fail */ if(child_fid == FAIL) HDexit(EXIT_SUCCESS); - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5659,7 +5670,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5734,7 +5745,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5812,7 +5823,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5835,7 +5846,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) HDexit(EXIT_SUCCESS); } - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5889,7 +5900,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -5910,7 +5921,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(child_fid == FAIL) HDexit(EXIT_SUCCESS); - /* Close the pipe */ + /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); @@ -5922,7 +5933,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) FAIL_STACK_ERROR /* Open the test file */ - if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + if((fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR /* Notify child process */ @@ -5964,7 +5975,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) if(childpid == 0) { /* Child process */ hid_t child_fid; /* File ID */ - int child_notify = 0; + int child_notify = 0; /* Close unused write end for out_pdf */ if(HDclose(out_pdf[1]) < 0) @@ -6059,7 +6070,7 @@ error: ** *****************************************************************/ static int -test_file_lock_env_var(hid_t in_fapl) +test_file_locking(hid_t in_fapl, hbool_t turn_locking_on, hbool_t env_var_override) { #if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) SKIPPED(); @@ -6074,18 +6085,40 @@ test_file_lock_env_var(hid_t in_fapl) int child_wait_option=0; /* Options passed to waitpid */ int out_pdf[2]; int notify = 0; + int exit_status = 0; + herr_t ret; + + if (turn_locking_on && env_var_override) + TESTING("File locking: ON w/ env var override") + else if (turn_locking_on && !env_var_override) + TESTING("File locking: ON") + else if (!turn_locking_on && env_var_override) + TESTING("File locking: OFF w/ env var override") + else + TESTING("File locking: OFF") - - TESTING("File locking environment variable"); - - - /* Set the environment variable */ - if(HDsetenv("HDF5_USE_FILE_LOCKING", "FALSE", TRUE) < 0) + /* Copy the incoming fapl */ + if((fapl = H5Pcopy(in_fapl)) < 0) TEST_ERROR - if((fapl = H5Pcopy(in_fapl)) < 0) + /* Set locking in the fapl */ + if(H5Pset_file_locking(fapl, turn_locking_on ? TRUE : FALSE, TRUE) < 0) TEST_ERROR + /* If requested, set the environment variable */ + if (env_var_override) { + if(HDsetenv("HDF5_USE_FILE_LOCKING", turn_locking_on ? "FALSE" : "TRUE", TRUE) < 0) + TEST_ERROR + if(H5F__reparse_file_lock_variable_test() < 0) + TEST_ERROR + } + else { + if(HDsetenv("HDF5_USE_FILE_LOCKING", "", TRUE) < 0) + TEST_ERROR + if(H5F__reparse_file_lock_variable_test() < 0) + TEST_ERROR + } + /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[1], fapl, filename, sizeof(filename)); @@ -6097,10 +6130,8 @@ test_file_lock_env_var(hid_t in_fapl) if(H5Fclose(fid) < 0) TEST_ERROR - /* Open a file for read-only and then read-write. This would - * normally fail due to the file locking scheme but should - * pass when the environment variable is set to disable file - * locking. + /* Open a file for read-only and then read-write. This will fail + * when the locking scheme is turned on. */ /* Create 1 pipe */ @@ -6115,7 +6146,7 @@ test_file_lock_env_var(hid_t in_fapl) /* Child process */ - hid_t child_fid; /* File ID */ + hid_t child_fid = H5I_INVALID_HID; /* File ID */ int child_notify = 0; /* Close unused write end for out_pdf */ @@ -6126,18 +6157,23 @@ test_file_lock_env_var(hid_t in_fapl) while(child_notify != 1) { if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0) HDexit(EXIT_FAILURE); - } /* end while */ + } - /* Open the test file */ - if((child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) - TEST_ERROR + /* Open and close the test file */ + H5E_BEGIN_TRY { + child_fid = H5Fopen(filename, H5F_ACC_RDWR, fapl); + ret = H5Fclose(child_fid); + } H5E_END_TRY; /* Close the pipe */ if(HDclose(out_pdf[0]) < 0) HDexit(EXIT_FAILURE); - HDexit(EXIT_SUCCESS); - } /* end if */ + if(H5I_INVALID_HID == child_fid || FAIL == ret) + HDexit(EXIT_FAILURE); + else + HDexit(EXIT_SUCCESS); + } /* end child process work */ /* close unused read end for out_pdf */ if(HDclose(out_pdf[0]) < 0) @@ -6160,15 +6196,28 @@ test_file_lock_env_var(hid_t in_fapl) if(HDwaitpid(childpid, &child_status, child_wait_option) < 0) TEST_ERROR - /* Check if child terminated normally */ - if(WIFEXITED(child_status)) { - /* Check exit status of the child */ - if(WEXITSTATUS(child_status) != 0) - TEST_ERROR - } /* end if */ + /* Check exit status of the child */ + if(WIFEXITED(child_status)) + exit_status = WEXITSTATUS(child_status); else TEST_ERROR + /* The child process should have passed or failed as follows: + * + * locks on: FAIL + * locks off: PASS + * locks on, env var override: PASS + * locks off, env var override: FAIL + */ + if(turn_locking_on && !env_var_override && (0 == exit_status)) + TEST_ERROR + else if(!turn_locking_on && !env_var_override && (0 != exit_status)) + TEST_ERROR + else if(turn_locking_on && env_var_override && (0 != exit_status)) + TEST_ERROR + else if(!turn_locking_on && env_var_override && (0 == exit_status)) + TEST_ERROR + /* Close the file */ if(H5Fclose(fid) < 0) TEST_ERROR @@ -6192,7 +6241,7 @@ error: #endif /* !(defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID)) */ -} /* end test_file_lock_env_var() */ +} /* end test_file_locking() */ static int @@ -7019,7 +7068,7 @@ error: H5Fclose(fid3); } H5E_END_TRY; - return -1; + return 1; } /* test_multiple_same() */ @@ -7036,6 +7085,7 @@ main(void) char *driver = NULL; /* VFD string (from env variable) */ char *lock_env_var = NULL; /* file locking env var pointer */ hbool_t use_file_locking; /* read from env var */ + hbool_t file_locking_enabled = FALSE; /* Checks if the file system supports locks */ /* Skip this test if SWMR I/O is not supported for the VFD specified * by the environment variable. @@ -7056,6 +7106,13 @@ main(void) else use_file_locking = TRUE; + /* Check if file locking is enabled on this file system */ + if(use_file_locking) + if(h5_check_if_file_locking_enabled(&file_locking_enabled) < 0) { + HDprintf("Error when determining if file locks are enabled\n"); + return EXIT_FAILURE; + } + /* Set up */ h5_reset(); @@ -7097,7 +7154,7 @@ main(void) nerrors += test_append_flush_dataset_fixed(fapl); nerrors += test_append_flush_dataset_multiple(fapl); - if(use_file_locking) { + if(use_file_locking && file_locking_enabled) { /* * Tests for: * file open flags--single process access @@ -7127,7 +7184,12 @@ main(void) /* This test changes the HDF5_USE_FILE_LOCKING environment variable * so it should be run last. */ - nerrors += test_file_lock_env_var(fapl); + if (use_file_locking && file_locking_enabled) { + nerrors += test_file_locking(fapl, TRUE, TRUE); + nerrors += test_file_locking(fapl, TRUE, FALSE); + nerrors += test_file_locking(fapl, FALSE, TRUE); + nerrors += test_file_locking(fapl, FALSE, FALSE); + } if(nerrors) goto error; -- cgit v0.12 From 6e7199250237518a7ad8e414d7f7f236b4912175 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 Aug 2020 09:35:17 -0700 Subject: Minor change to header comments in file locking C++ changes. --- c++/src/H5FaccProp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 2475cf5..ee90fa4 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -126,10 +126,10 @@ class H5_DLLCPP FileAccPropList : public PropList { // Returns garbage collecting references setting. unsigned getGcReferences() const; - // Sets file locking parameters + // Sets file locking parameters. void setFileLocking(hbool_t use_file_locking, hbool_t ignore_when_disabled) const; - // Gets file locking parameters + // Gets file locking parameters. void getFileLocking(hbool_t& use_file_locking, hbool_t& ignore_when_disabled) const; // Sets bounds on versions of library format to be used when creating -- cgit v0.12 From bd685b0e803e13a10243bd0e50fa01c5fceffc67 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 Aug 2020 15:47:46 -0700 Subject: Fixed missing parens in VFDs --- src/H5FDcore.c | 2 +- src/H5FDdirect.c | 2 +- src/H5FDlog.c | 2 +- src/H5FDsec2.c | 2 +- src/H5FDstdio.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index a20f0c1..7a31fdf 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -425,7 +425,7 @@ H5FD__init_package(void) lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ - else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE")) + else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ else ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index dcd8b13..6494fff 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -206,7 +206,7 @@ H5FD__init_package(void) lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ - else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ else ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ diff --git a/src/H5FDlog.c b/src/H5FDlog.c index af6d8e0..045662a 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -247,7 +247,7 @@ H5FD__init_package(void) lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ - else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ else ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index f0ce82d..eee554a 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -203,7 +203,7 @@ H5FD__init_package(void) lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ - else if(lock_env_var && !HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ else ignore_disabled_file_locks_s = FAIL; /* Environment variable not set, or not set correctly */ diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 4e9ef39..574cd9d 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -244,7 +244,7 @@ H5FD_stdio_init(void) lock_env_var = getenv("HDF5_USE_FILE_LOCKING"); if(lock_env_var && !strcmp(lock_env_var, "BEST-EFFORT")) ignore_disabled_file_locks_s = 1; /* Override: Ignore disabled locks */ - else if(lock_env_var && !strcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1")) + else if(lock_env_var && (!strcmp(lock_env_var, "TRUE") || !strcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = 0; /* Override: Don't ignore disabled locks */ else ignore_disabled_file_locks_s = -1; /* Environment variable not set, or not set correctly */ -- cgit v0.12 From b2c90cc84ec84f51233d69f5eb951d48ba20d37e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 3 Aug 2020 18:43:19 -0700 Subject: Updated the file locking Fortran property list wrappers and added a test. --- fortran/src/H5Pf.c | 77 ---------------------------------------- fortran/src/H5Pff.F90 | 16 ++++----- fortran/src/H5f90proto.h | 2 -- fortran/test/fortranlib_test.F90 | 6 +++- fortran/test/tH5P.F90 | 73 +++++++++++++++++++++++++++++++++++++ 5 files changed, 86 insertions(+), 88 deletions(-) diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 9816d7b..7cb3db8 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -5241,83 +5241,6 @@ h5pget_file_image_c(hid_t_f *fapl_id, void **buf_ptr, size_t_f *buf_len_ptr) return ret_value; } -/****if* H5Pf/h5pset_file_locking_c - * NAME - * h5pset_file_locking_c - * PURPOSE - * Call H5Pset_file_locking to set file locking properties. - * INPUTS - * prp_id - file access property list identifier - * use_file_locking - TRUE/FALSE flag - * ignore_disabled_file_locking - TRUE/FALSE flag - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Dana Robinson - * Summer 2020 - * SOURCE -*/ -int_f -h5pset_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking) -/******/ -{ - int ret_value = 0; - hid_t c_prp_id = H5I_INVALID_HID; - herr_t status; - hbool_t c_use_flag = 1; - hbool_t c_ignore_flag = 1; - - if (*use_file_locking == 0) c_use_flag = 0; - if (*ignore_disabled_file_locking == 0) c_ignore_flag = 1; - - c_prp_id = (hid_t)*prp_id; - - status = H5Pset_file_locking(c_prp_id, c_use_flag, c_ignore_flag); - - if ( status < 0 ) ret_value = -1; - - return ret_value; -} - - -/****if* H5Pf/h5pget_file_locking_c - * NAME - * h5pget_file_locking_c - * PURPOSE - * Call H5Pget_file_locking to get file locking properties. - * INPUTS - * prp_id - file access property list identifier - * use_file_locking - TRUE/FALSE flag - * ignore_disabled_file_locking - TRUE/FALSE flag - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Dana Robinson - * Summer 2020 - * SOURCE -*/ -int_f -h5pget_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking) -/******/ -{ - int ret_value = 0; - hid_t c_prp_id = H5I_INVALID_HID; - hbool_t c_use_flag = 1; - hbool_t c_ignore_flag = 1; - herr_t c_ret; - - c_prp_id = (hid_t)*prp_id; - - c_ret = H5Pget_file_locking(c_prp_id, &c_use_flag, &c_ignore_flag); - - if ( c_ret < 0 ) ret_value = -1; - - *use_file_locking = (int_f)c_use_flag; - *ignore_disabled_file_locking = (int_f)c_ignore_flag; - - return ret_value; -} - #ifdef H5_HAVE_PARALLEL /****if* H5Pf/h5pset_fapl_mpio_c * NAME diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 index 40c4e95..38e3aac 100644 --- a/fortran/src/H5Pff.F90 +++ b/fortran/src/H5Pff.F90 @@ -8298,16 +8298,16 @@ END SUBROUTINE h5pget_virtual_dsetname_f LOGICAL(C_BOOL) :: c_ignore_flag INTERFACE - INTEGER FUNCTION h5pget_file_locking_c(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pget_file_locking') + INTEGER FUNCTION h5pget_file_locking(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pget_file_locking') IMPORT :: HID_T, C_BOOL IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: fapl_id LOGICAL(C_BOOL), INTENT(OUT) :: use_file_locking LOGICAL(C_BOOL), INTENT(OUT) :: ignore_disabled_locks - END FUNCTION h5pget_file_locking_c + END FUNCTION h5pget_file_locking END INTERFACE - hdferr = INT(h5pget_file_locking_c(fapl_id, c_use_flag, c_ignore_flag)) + hdferr = INT(h5pget_file_locking(fapl_id, c_use_flag, c_ignore_flag)) ! Transfer value of C C_BOOL type to Fortran LOGICAL use_file_locking = c_use_flag @@ -8348,20 +8348,20 @@ END SUBROUTINE h5pget_virtual_dsetname_f LOGICAL(C_BOOL) :: c_ignore_flag INTERFACE - INTEGER FUNCTION h5pset_file_locking_c(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pset_file_locking') + INTEGER FUNCTION h5pset_file_locking(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pset_file_locking') IMPORT :: HID_T, C_BOOL IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: fapl_id - LOGICAL(C_BOOL), INTENT(IN) :: use_file_locking - LOGICAL(C_BOOL), INTENT(IN) :: ignore_disabled_locks - END FUNCTION h5pset_file_locking_c + LOGICAL(C_BOOL), INTENT(IN), VALUE :: use_file_locking + LOGICAL(C_BOOL), INTENT(IN), VALUE :: ignore_disabled_locks + END FUNCTION h5pset_file_locking END INTERFACE ! Transfer value of Fortran LOGICAL to C C_BOOL type c_use_flag = use_file_locking c_ignore_flag = ignore_disabled_locks - hdferr = INT(h5pset_file_locking_c(fapl_id, c_use_flag, c_ignore_flag)) + hdferr = INT(h5pset_file_locking(fapl_id, c_use_flag, c_ignore_flag)) END SUBROUTINE h5pset_file_locking_f diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 56a685e..695efcd 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -481,8 +481,6 @@ H5_FCDLL int_f h5pset_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); H5_FCDLL int_f h5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks); H5_FCDLL int_f h5pset_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0); H5_FCDLL int_f h5pget_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nbytes, real_f *rdcc_w0); -H5_FCDLL int_f h5pset_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking); -H5_FCDLL int_f h5pget_file_locking_c(hid_t_f *prp_id, int_f *use_file_locking, int_f *ignore_disabled_file_locking); #ifdef H5_HAVE_PARALLEL H5_FCDLL int_f h5pget_mpio_actual_io_mode_c(hid_t_f *dxpl_id, int_f *actual_io_mode); H5_FCDLL int_f h5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info); diff --git a/fortran/test/fortranlib_test.F90 b/fortran/test/fortranlib_test.F90 index 92f9279..1fb3e68 100644 --- a/fortran/test/fortranlib_test.F90 +++ b/fortran/test/fortranlib_test.F90 @@ -183,9 +183,13 @@ PROGRAM fortranlibtest CALL write_test_status(ret_total_error, ' Multi file driver test', total_error) ret_total_error = 0 - CALL test_chunk_cache (cleanup, ret_total_error) + CALL test_chunk_cache(cleanup, ret_total_error) CALL write_test_status(ret_total_error, ' Dataset chunk cache configuration', total_error) + ret_total_error = 0 + CALL test_misc_properties(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Miscellaneous properties', total_error) + ! ! '=========================================' ! 'Testing ATTRIBUTE interface ' diff --git a/fortran/test/tH5P.F90 b/fortran/test/tH5P.F90 index 7fe3971..19bee75 100644 --- a/fortran/test/tH5P.F90 +++ b/fortran/test/tH5P.F90 @@ -724,4 +724,77 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) END SUBROUTINE test_chunk_cache +!------------------------------------------------------------------------- +! Function: test_misc_properties +! +! Purpose: Tests setting and getting of miscellaneous properties. Does +! not test the underlying functionality as that is done in +! the C library tests. +! +! Tests APIs: +! H5P_GET/SET_FILE_LOCKING_F +! +! Return: Success: 0 +! Failure: -1 +! +!------------------------------------------------------------------------- +! +SUBROUTINE test_misc_properties(cleanup, total_error) + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(hid_t) :: fapl_id = -1 ! Local fapl + LOGICAL :: use_file_locking ! (H5Pset/get_file_locking_f) + LOGICAL :: ignore_disabled_locks ! (H5Pset/get_file_locking_f) + INTEGER :: error + + ! Create a default fapl + CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl_id, error) + CALL check("H5Pcreate_f", error, total_error) + + ! Test H5Pset/get_file_locking_f + ! true values + use_file_locking = .TRUE. + ignore_disabled_locks = .TRUE. + CALL h5pset_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error) + CALL check("h5pset_set_file_locking_f", error, total_error) + use_file_locking = .FALSE. + ignore_disabled_locks = .FALSE. + CALL h5pget_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error) + CALL check("h5pget_set_file_locking_f", error, total_error) + if(use_file_locking .neqv. .TRUE.) then + total_error = total_error + 1 + write(*,*) "Got wrong use_file_locking flag from h5pget_file_locking_f" + endif + if(ignore_disabled_locks .neqv. .TRUE.) then + total_error = total_error + 1 + write(*,*) "Got wrong ignore_disabled_locks flag from h5pget_file_locking_f" + endif + + ! false values + use_file_locking = .FALSE. + ignore_disabled_locks = .FALSE. + CALL h5pset_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error) + CALL check("h5pset_set_file_locking_f", error, total_error) + use_file_locking = .TRUE. + ignore_disabled_locks = .TRUE. + CALL h5pget_file_locking_f(fapl_id, use_file_locking, ignore_disabled_locks, error) + CALL check("h5pget_set_file_locking_f", error, total_error) + if(use_file_locking .neqv. .FALSE.) then + total_error = total_error + 1 + write(*,*) "Got wrong use_file_locking flag from h5pget_file_locking_f" + endif + if(ignore_disabled_locks .neqv. .FALSE.) then + total_error = total_error + 1 + write(*,*) "Got wrong ignore_disabled_locks flag from h5pget_file_locking_f" + endif + + ! Close the fapl + CALL H5Pclose_f(fapl_id, error) + CALL check("H5Pclose_f", error, total_error) + +END SUBROUTINE test_misc_properties + END MODULE TH5P -- cgit v0.12 From be02566f49f953bc80c5b5018871138e201ea633 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 4 Aug 2020 09:14:36 -0700 Subject: Fixes indenting in tools test scripts --- tools/test/h5copy/testh5copy.sh.in | 10 +- tools/test/h5diff/h5diff_plugin.sh.in | 117 +++++----- tools/test/h5diff/testh5diff.sh.in | 43 ++-- tools/test/h5dump/h5dump_plugin.sh.in | 28 +-- tools/test/h5dump/testh5dump.sh.in | 381 ++++++++++++++++---------------- tools/test/h5dump/testh5dumppbits.sh.in | 158 ++++++------- tools/test/h5dump/testh5dumpvds.sh.in | 172 +++++++------- tools/test/h5dump/testh5dumpxml.sh.in | 31 ++- tools/test/h5ls/h5ls_plugin.sh.in | 6 +- tools/test/misc/testh5mkgrp.sh.in | 91 ++++---- 10 files changed, 529 insertions(+), 508 deletions(-) diff --git a/tools/test/h5copy/testh5copy.sh.in b/tools/test/h5copy/testh5copy.sh.in index 2440ca4..84e3b65 100644 --- a/tools/test/h5copy/testh5copy.sh.in +++ b/tools/test/h5copy/testh5copy.sh.in @@ -200,6 +200,7 @@ TOOLTEST() fi runh5diff=no fi + if [ "$3" = -o ]; then outputfile=$4 else @@ -219,6 +220,7 @@ TOOLTEST() $RUNSERIAL $H5COPY_BIN $@ ) > $actualout 2> $actualerr RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -268,6 +270,7 @@ TOOLTEST_PREFILL() $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name2 ) > $actualout 2> $actualerr RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -282,6 +285,7 @@ TOOLTEST_PREFILL() $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $obj_name -d $obj_name2 ) > $actualout 2> $actualerr RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -313,6 +317,7 @@ TOOLTEST_SAME() else runh5diff=no fi + if [ "$3" = -o ]; then outputfile=$4 else @@ -330,6 +335,7 @@ TOOLTEST_SAME() $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name ) > $actualout 2> $actualerr RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -344,6 +350,7 @@ TOOLTEST_SAME() $RUNSERIAL $H5COPY_BIN -i $outputfile -o $outputfile -v -s $grp_name -d $grp_name2 ) > $actualout 2> $actualerr RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -406,6 +413,7 @@ TOOLTEST_FAIL() if [ "$1" = -i ]; then inputfile=$2 fi + if [ "$3" = -o ]; then outputfile=$4 fi @@ -417,8 +425,8 @@ TOOLTEST_FAIL() #echo "#############################" $RUNSERIAL $H5COPY_BIN $@ ) > $actualout 2> $actualerr - RET=$? + # save actualout and actualerr in case they are needed later. cp $actualout $actualout_sav STDOUT_FILTER $actualout diff --git a/tools/test/h5diff/h5diff_plugin.sh.in b/tools/test/h5diff/h5diff_plugin.sh.in index 341cba5..ffc43da 100644 --- a/tools/test/h5diff/h5diff_plugin.sh.in +++ b/tools/test/h5diff/h5diff_plugin.sh.in @@ -135,24 +135,24 @@ CLEAN_TESTFILES_AND_TESTDIR() # -h print help page while [ $# -gt 0 ]; do case "$1" in - -p) # reset the tool name and bin to run ph5diff tests - TESTNAME=ph5diff - H5DIFF=../../src/h5diff/ph5diff # The tool name - H5DIFF_BIN=`pwd`/$H5DIFF # The path of the tool binary - pmode=yes - shift - ;; + -p) # reset the tool name and bin to run ph5diff tests + TESTNAME=ph5diff + H5DIFF=../../src/h5diff/ph5diff # The tool name + H5DIFF_BIN=`pwd`/$H5DIFF # The path of the tool binary + pmode=yes + shift + ;; -h) # print help page - echo "$0 [-p] [-h]" - echo " -p run ph5diff tests" - echo " -h print help page" - shift - exit 0 - ;; + echo "$0 [-p] [-h]" + echo " -p run ph5diff tests" + echo " -h print help page" + shift + exit 0 + ;; *) # unknown option echo "$0: Unknown option ($1)" - exit 1 - ;; + exit 1 + ;; esac done @@ -218,19 +218,21 @@ TOOLTEST() { # Run test. TESTING $H5DIFF $@ ( - #echo "#############################" - #echo "Expected output for '$H5DIFF $@'" - #echo "#############################" - cd $TESTDIR - eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@" + #echo "#############################" + #echo "Expected output for '$H5DIFF $@'" + #echo "#############################" + cd $TESTDIR + eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@" ) >$actual 2>$actual_err EXIT_CODE=$? + # save actual and actual_err in case they are needed later. cp $actual $actual_sav STDOUT_FILTER $actual cp $actual_err $actual_err_sav STDERR_FILTER $actual_err cat $actual_err >> $actual + # don't add exit code check in pmode, as it causes failure. (exit code # is from mpirun not tool) # if any problem occurs relate to an exit code, it will be caught in @@ -260,27 +262,29 @@ TOOLTEST() { actual_sorted=actual_sorted sort $expect -o $expect_sorted sort $actual -o $actual_sorted + # remove "EXIT CODE:" line from expect file. test for exit code # is done by serial mode. grep -v "EXIT CODE:" $expect_sorted > $expect_sorted.noexit mv $expect_sorted.noexit $expect_sorted - if $CMP $expect_sorted $actual_sorted; then - echo " PASSED" - else - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if test yes = "$verbose"; then - echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" - $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' - echo "====The actual output ($actual_sav)" - sed 's/^/ /' < $actual_sav - echo "====The actual stderr ($actual_err_sav)" - sed 's/^/ /' < $actual_err_sav - echo "====End of actual stderr ($actual_err_sav)" - echo "" + + if $CMP $expect_sorted $actual_sorted; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if test yes = "$verbose"; then + echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" + $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' + echo "====The actual output ($actual_sav)" + sed 's/^/ /' < $actual_sav + echo "====The actual stderr ($actual_err_sav)" + sed 's/^/ /' < $actual_err_sav + echo "====End of actual stderr ($actual_err_sav)" + echo "" + fi fi fi - fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then @@ -306,18 +310,20 @@ TOOLTEST_ERR() { # Run test. TESTING $H5DIFF $@ ( - #echo "#############################" - #echo "Expected output for '$H5DIFF $@'" - #echo "#############################" - cd $TESTDIR - eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@" + #echo "#############################" + #echo "Expected output for '$H5DIFF $@'" + #echo "#############################" + cd $TESTDIR + eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@" ) >$actual 2>$actual_err EXIT_CODE=$? + # save actual and actual_err in case they are needed later. cp $actual $actual_sav STDOUT_FILTER $actual cp $actual_err $actual_err_sav STDERR_FILTER $actual_err + # don't add exit code check in pmode, as it causes failure. (exit code # is from mpirun not tool) # if any problem occurs relate to an exit code, it will be caught in @@ -348,23 +354,24 @@ TOOLTEST_ERR() { sort $expect_err -o $expect_sorted sort $actual_err -o $actual_sorted mv $expect_sorted.noexit $expect_sorted - if $CMP $expect_sorted $actual_sorted; then - echo " PASSED" - else - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if test yes = "$verbose"; then - echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" - $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' - echo "====The actual output ($actual_sav)" - sed 's/^/ /' < $actual_sav - echo "====The actual stderr ($actual_err_sav)" - sed 's/^/ /' < $actual_err_sav - echo "====End of actual stderr ($actual_err_sav)" - echo "" + + if $CMP $expect_sorted $actual_sorted; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if test yes = "$verbose"; then + echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" + $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' + echo "====The actual output ($actual_sav)" + sed 's/^/ /' < $actual_sav + echo "====The actual stderr ($actual_err_sav)" + sed 's/^/ /' < $actual_err_sav + echo "====End of actual stderr ($actual_err_sav)" + echo "" + fi fi fi - fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index 4e622ee..9f88ee1 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -500,18 +500,20 @@ TOOLTEST() { # Run test. TESTING $H5DIFF $@ ( - #echo "#############################" - #echo "Expected output for '$H5DIFF $@'" - #echo "#############################" - cd $TESTDIR - eval $RUNCMD $H5DIFF_BIN "$@" + #echo "#############################" + #echo "Expected output for '$H5DIFF $@'" + #echo "#############################" + cd $TESTDIR + eval $RUNCMD $H5DIFF_BIN "$@" ) >$actual 2>$actual_err EXIT_CODE=$? + # save actual and actual_err in case they are needed later. cp $actual $actual_sav STDOUT_FILTER $actual cp $actual_err $actual_err_sav STDERR_FILTER $actual_err + # don't add exit code check in pmode, as it causes failure. (exit code # is from mpirun not tool) # if any problem occurs relate to an exit code, it will be caught in @@ -545,23 +547,24 @@ TOOLTEST() { # is done by serial mode. grep -v "EXIT CODE:" $expect_sorted > $expect_sorted.noexit mv $expect_sorted.noexit $expect_sorted - if $CMP $expect_sorted $actual_sorted; then - echo " PASSED" - else - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if test yes = "$verbose"; then - echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" - $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' - echo "====The actual output ($actual_sav)" - sed 's/^/ /' < $actual_sav - echo "====The actual stderr ($actual_err_sav)" - sed 's/^/ /' < $actual_err_sav - echo "====End of actual stderr ($actual_err_sav)" - echo "" + + if $CMP $expect_sorted $actual_sorted; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if test yes = "$verbose"; then + echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" + $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' + echo "====The actual output ($actual_sav)" + sed 's/^/ /' < $actual_sav + echo "====The actual stderr ($actual_err_sav)" + sed 's/^/ /' < $actual_err_sav + echo "====End of actual stderr ($actual_err_sav)" + echo "" + fi fi fi - fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then diff --git a/tools/test/h5dump/h5dump_plugin.sh.in b/tools/test/h5dump/h5dump_plugin.sh.in index 6a00a16..d940ab3 100644 --- a/tools/test/h5dump/h5dump_plugin.sh.in +++ b/tools/test/h5dump/h5dump_plugin.sh.in @@ -181,8 +181,8 @@ TOOLTEST() { # Run test. TESTING $H5DUMP $@ ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $H5DUMP_BIN "$@" + cd $TESTDIR + $ENVCMD $RUNSERIAL $H5DUMP_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -192,24 +192,24 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual > /dev/null 2>&1 ; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $caseless $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $caseless $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi } diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index 53c8927..b69346e 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -465,14 +465,14 @@ TESTING() { TOOLTEST() { # check if caseless compare and diff requested if [ "$1" = ignorecase ]; then - caseless="-i" - # replace cmp with diff which runs much longer. - xCMP="$DIFF -i" - shift + caseless="-i" + # replace cmp with diff which runs much longer. + xCMP="$DIFF -i" + shift else - caseless="" - # stick with faster cmp if ignorecase is not requested. - xCMP="$CMP" + caseless="" + # stick with faster cmp if ignorecase is not requested. + xCMP="$CMP" fi expect="$TESTDIR/$1" @@ -485,8 +485,8 @@ TOOLTEST() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -495,24 +495,24 @@ TOOLTEST() { cp $actual_err $actual_err_sav STDERR_FILTER $actual_err - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $xCMP $expect $actual > /dev/null 2>&1 ; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $caseless $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $caseless $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi } @@ -534,41 +534,41 @@ TOOLTEST2() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" - cp $actualdata $expectdata - echo " Expected data (*.exp) missing" + cp $actual $expect + echo " Expected result (*.ddl) missing" nerrors="`expr $nerrors + 1`" - elif $CMP $expectdata $actualdata; then - echo " PASSED" - else + elif $CMP $expect $actual; then + if [ ! -f $expectdata ]; then + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expectdata $actualdata; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' + fi + else echo "*FAILED*" - echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + echo " Expected result (*.ddl) differs from actual result (*.out)" nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' - fi - else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actualdata $actual_err + rm -f $actual $actualdata $actual_err fi } @@ -592,56 +592,55 @@ TOOLTEST2A() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" - cp $actualdata $expectdata - echo " Expected data (*.exp) missing" + cp $actual $expect + echo " Expected result (*.ddl) missing" nerrors="`expr $nerrors + 1`" - elif $DIFF $expectdata $actualdata; then - if [ ! -f $expectmeta ]; then - # Create the expect meta file if it doesn't yet exist. - echo " CREATED" - cp $actualmeta $expectmeta - echo " Expected metafile (*.ddl) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expectmeta $actualmeta; then - echo " PASSED" + elif $CMP $expect $actual; then + if [ ! -f $expectdata ]; then + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" + elif $DIFF $expectdata $actualdata; then + if [ ! -f $expectmeta ]; then + # Create the expect meta file if it doesn't yet exist. + echo " CREATED" + cp $actualmeta $expectmeta + echo " Expected metafile (*.ddl) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expectmeta $actualmeta; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected metafile (*.ddl) differs from actual metafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectmeta $actualmeta |sed 's/^/ /' + fi else - echo "*FAILED*" - echo " Expected metafile (*.ddl) differs from actual metafile (*.txt)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectmeta $actualmeta |sed 's/^/ /' + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' fi - else + else echo "*FAILED*" - echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + echo " Expected result (*.ddl) differs from actual result (*.out)" nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' - fi - else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actualdata $actual_err $actualmeta + rm -f $actual $actualdata $actual_err $actualmeta fi - } # same as TOOLTEST2 but only compares the generated data file to the expected data file @@ -658,28 +657,28 @@ TOOLTEST2B() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. - echo " CREATED" - cp $actualdata $expectdata - echo " Expected data (*.exp) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expectdata $actualdata; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actualdata $actual_err + rm -f $actual $actualdata $actual_err fi } @@ -699,8 +698,8 @@ TOOLTEST3() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -719,23 +718,23 @@ TOOLTEST3() { $actual_err > $actual_ext if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -757,8 +756,8 @@ TOOLTEST4() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -777,30 +776,30 @@ TOOLTEST4() { $actual_err > $actual_ext if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - if $CMP $expect_err $actual_ext; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -822,8 +821,8 @@ TOOLTEST5() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -842,33 +841,33 @@ TOOLTEST5() { $actual_err > $actual_ext if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - if $CMP $expect_err $actual_ext; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi - } + # ADD_HELP_TEST TOOLTEST_HELP() { @@ -880,27 +879,27 @@ TOOLTEST_HELP() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect-CREATED - echo " Expected output (*.txt) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect-CREATED + echo " Expected output (*.txt) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected output (*.txt) differs from actual output (*.out)" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + echo " Expected output (*.txt) differs from actual output (*.out)" + nerrors="`expr $nerrors + 1`" fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi } @@ -920,14 +919,16 @@ GREPTEST() # Run test. TESTING $DUMPER -p $@ ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" ) >$actual 2>$actual_err + if [ "$txttype" = "ERRTXT" ]; then $GREP "$expectdata" $actual_err > /dev/null else $GREP "$expectdata" $actual > /dev/null fi + if [ $? -eq 0 ]; then echo " PASSED" else @@ -937,7 +938,7 @@ GREPTEST() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi } @@ -956,14 +957,16 @@ GREPTEST2() # Run test. TESTING $DUMPER -p $@ ( - cd $TESTDIR - $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@" ) >$actual 2>$actual_err + if [ "$txttype" = "ERRTXT" ]; then $GREP "$expectdata" $actual_err > /dev/null else $GREP "$expectdata" $actual > /dev/null fi + if [ $? -eq 0 ]; then echo " PASSED" else @@ -973,21 +976,21 @@ GREPTEST2() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi } # Print a "SKIP" message SKIP() { - TESTING $DUMPER $@ + TESTING $DUMPER $@ echo " -SKIP-" } # Print a line-line message left justified in a field of 70 characters # PRINT_H5DIFF() { - SPACES=" " - echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' } @@ -997,10 +1000,11 @@ DIFFTEST() { PRINT_H5DIFF $@ ( - cd $TESTDIR - $RUNSERIAL $H5DIFF_BIN "$@" -q + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN "$@" -q ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" @@ -1014,8 +1018,8 @@ DIFFTEST() # beginning with the word "Verifying". # PRINT_H5IMPORT() { - SPACES=" " - echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' } # Call the h5import tool @@ -1025,15 +1029,16 @@ IMPORTTEST() # remove the output hdf5 file if it exists hdf5_file="$TESTDIR/$5" if [ -f $hdf5_file ]; then - rm -f $hdf5_file + rm -f $hdf5_file fi PRINT_H5IMPORT $@ ( - cd $TESTDIR - $RUNSERIAL $H5IMPORT_BIN "$@" + cd $TESTDIR + $RUNSERIAL $H5IMPORT_BIN "$@" ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" @@ -1138,9 +1143,9 @@ TOOLTEST tcomp-4.ddl --enable-error-stack tcompound_complex.h5 TOOLTEST tcompound_complex2.ddl --enable-error-stack tcompound_complex2.h5 # tests for bitfields and opaque data types if test $WORDS_BIGENDIAN != "yes"; then -TOOLTEST tbitnopaque_le.ddl --enable-error-stack tbitnopaque.h5 + TOOLTEST tbitnopaque_le.ddl --enable-error-stack tbitnopaque.h5 else -TOOLTEST tbitnopaque_be.ddl --enable-error-stack tbitnopaque.h5 + TOOLTEST tbitnopaque_be.ddl --enable-error-stack tbitnopaque.h5 fi #test for the nested compound type @@ -1318,12 +1323,12 @@ TOOLTEST tallfilters.ddl --enable-error-stack -H -p -d all tfilters.h5 TOOLTEST tuserfilter.ddl --enable-error-stack -H -p -d myfilter tfilters.h5 if test $USE_FILTER_DEFLATE = "yes" ; then - # data read internal filters - TOOLTEST treadintfilter.ddl --enable-error-stack -d deflate -d shuffle -d fletcher32 -d nbit -d scaleoffset tfilters.h5 - if test $USE_FILTER_SZIP = "yes"; then - # data read - TOOLTEST treadfilter.ddl --enable-error-stack -d all -d szip tfilters.h5 - fi + # data read internal filters + TOOLTEST treadintfilter.ddl --enable-error-stack -d deflate -d shuffle -d fletcher32 -d nbit -d scaleoffset tfilters.h5 + if test $USE_FILTER_SZIP = "yes"; then + # data read + TOOLTEST treadfilter.ddl --enable-error-stack -d all -d szip tfilters.h5 + fi fi # test for displaying objects with very long names @@ -1380,9 +1385,9 @@ TOOLTEST tbin4.ddl --enable-error-stack -d double -b FILE -o out4.bin tbin # Clean up binary output files if test -z "$HDF5_NOCLEANUP"; then - rm -f out[1-4].bin - rm -f out1.h5 - rm -f out3.h5 + rm -f out[1-4].bin + rm -f out1.h5 + rm -f out3.h5 fi # test for dataset region references @@ -1394,7 +1399,7 @@ TOOLTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o tbinregR. # Clean up text output files if test -z "$HDF5_NOCLEANUP"; then - rm -f tbinregR.txt + rm -f tbinregR.txt fi # tests for group creation order diff --git a/tools/test/h5dump/testh5dumppbits.sh.in b/tools/test/h5dump/testh5dumppbits.sh.in index febce2c..ff0659a 100644 --- a/tools/test/h5dump/testh5dumppbits.sh.in +++ b/tools/test/h5dump/testh5dumppbits.sh.in @@ -236,26 +236,25 @@ TOOLTEST() { cp $actual_err $actual_err_sav STDERR_FILTER $actual_err - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi - } @@ -274,36 +273,36 @@ TOOLTEST2() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" - cp $actualdata $expectdata - echo " Expected data (*.exp) missing" + cp $actual $expect + echo " Expected result (*.ddl) missing" nerrors="`expr $nerrors + 1`" - elif $CMP $expectdata $actualdata; then - echo " PASSED" - else + elif $CMP $expect $actual; then + if [ ! -f $expectdata ]; then + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expectdata $actualdata; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' + fi + else echo "*FAILED*" - echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + echo " Expected result (*.ddl) differs from actual result (*.out)" nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' - fi - else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file @@ -328,8 +327,8 @@ TOOLTEST3() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -348,23 +347,23 @@ TOOLTEST3() { $actual_err > $actual_ext if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -385,8 +384,8 @@ TOOLTEST4() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -405,30 +404,30 @@ TOOLTEST4() { $actual_err > $actual_ext if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - if $CMP $expect_err $actual_ext; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -442,8 +441,8 @@ SKIP() { # Print a line-line message left justified in a field of 70 characters # PRINT_H5DIFF() { - SPACES=" " - echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' } @@ -453,10 +452,11 @@ DIFFTEST() { PRINT_H5DIFF $@ ( - cd $TESTDIR - $RUNSERIAL $H5DIFF_BIN "$@" -q + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN "$@" -q ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" @@ -470,8 +470,8 @@ DIFFTEST() # beginning with the word "Verifying". # PRINT_H5IMPORT() { - SPACES=" " - echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' } # Call the h5import tool @@ -481,22 +481,22 @@ IMPORTTEST() # remove the output hdf5 file if it exists hdf5_file="$TESTDIR/$5" if [ -f $hdf5_file ]; then - rm -f $hdf5_file + rm -f $hdf5_file fi PRINT_H5IMPORT $@ ( - cd $TESTDIR - $RUNSERIAL $H5IMPORT_BIN "$@" + cd $TESTDIR + $RUNSERIAL $H5IMPORT_BIN "$@" ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" else echo " PASSED" fi - } diff --git a/tools/test/h5dump/testh5dumpvds.sh.in b/tools/test/h5dump/testh5dumpvds.sh.in index f89234e..29ff238 100644 --- a/tools/test/h5dump/testh5dumpvds.sh.in +++ b/tools/test/h5dump/testh5dumpvds.sh.in @@ -205,8 +205,8 @@ TOOLTEST() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -216,26 +216,25 @@ TOOLTEST() { STDERR_FILTER $actual_err cat $actual_err >> $actual - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi - } @@ -254,42 +253,42 @@ TOOLTEST2() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err cat $actual_err >> $actual if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - if [ ! -f $expectdata ]; then - # Create the expect data file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" - cp $actualdata $expectdata - echo " Expected data (*.exp) missing" + cp $actual $expect + echo " Expected result (*.ddl) missing" nerrors="`expr $nerrors + 1`" - elif $CMP $expectdata $actualdata; then - echo " PASSED" - else + elif $CMP $expect $actual; then + if [ ! -f $expectdata ]; then + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + echo " Expected data (*.exp) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expectdata $actualdata; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' + fi + else echo "*FAILED*" - echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + echo " Expected result (*.ddl) differs from actual result (*.out)" nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' - fi - else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actualdata $actual_err + rm -f $actual $actualdata $actual_err fi } @@ -309,8 +308,8 @@ TOOLTEST3() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -326,27 +325,27 @@ TOOLTEST3() { -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ -e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \ -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ - $actual_err > $actual_ext + $actual_err > $actual_ext cat $actual_ext >> $actual if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ddl) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } @@ -367,8 +366,8 @@ TOOLTEST4() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. @@ -384,47 +383,46 @@ TOOLTEST4() { -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ -e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \ -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ - $actual_err > $actual_ext + $actual_err > $actual_ext #cat $actual_ext >> $actual if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect elif $CMP $expect $actual; then - if $CMP $expect_err $actual_ext; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.err) differs from actual result (*.oerr)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' - fi + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav + rm -f $actual $actual_err $actual_sav $actual_err_sav fi - } # Print a "SKIP" message SKIP() { - TESTING $DUMPER $@ + TESTING $DUMPER $@ echo " -SKIP-" } # Print a line-line message left justified in a field of 70 characters # PRINT_H5DIFF() { - SPACES=" " - echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' } @@ -434,25 +432,25 @@ DIFFTEST() { PRINT_H5DIFF $@ ( - cd $TESTDIR - $RUNSERIAL $H5DIFF_BIN "$@" -q + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN "$@" -q ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" else echo " PASSED" fi - } # Print a line-line message left justified in a field of 70 characters # beginning with the word "Verifying". # PRINT_H5IMPORT() { - SPACES=" " - echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' } # Call the h5import tool @@ -462,22 +460,22 @@ IMPORTTEST() # remove the output hdf5 file if it exists hdf5_file="$TESTDIR/$5" if [ -f $hdf5_file ]; then - rm -f $hdf5_file + rm -f $hdf5_file fi PRINT_H5IMPORT $@ ( - cd $TESTDIR - $RUNSERIAL $H5IMPORT_BIN "$@" + cd $TESTDIR + $RUNSERIAL $H5IMPORT_BIN "$@" ) RET=$? + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" else echo " PASSED" fi - } @@ -491,7 +489,7 @@ COPY_TESTFILES_TO_TESTDIR ####### test for dataset vds ###### - # Data read +# Data read if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST tvds-1.ddl --enable-error-stack 1_vds.h5 TOOLTEST tvds-2.ddl --enable-error-stack 2_vds.h5 @@ -504,7 +502,7 @@ if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST vds-gap2.ddl --vds-gap-size=2 --enable-error-stack vds-eiger.h5 fi - # Layout read +# Layout read if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST tvds_layout-1.ddl -p --enable-error-stack 1_vds.h5 TOOLTEST tvds_layout-2.ddl -p --enable-error-stack 2_vds.h5 diff --git a/tools/test/h5dump/testh5dumpxml.sh.in b/tools/test/h5dump/testh5dumpxml.sh.in index f7af300..52a13c2 100644 --- a/tools/test/h5dump/testh5dumpxml.sh.in +++ b/tools/test/h5dump/testh5dumpxml.sh.in @@ -262,36 +262,35 @@ TOOLTEST() { # Run test. TESTING $DUMPER $@ ( - cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.xml) missing" - nerrors="`expr $nerrors + 1`" + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.xml) missing" + nerrors="`expr $nerrors + 1`" elif $CMP $expect $actual; then - echo " PASSED" + echo " PASSED" else - echo "*FAILED*" - echo " Expected result (*.xml) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo "*FAILED*" + echo " Expected result (*.xml) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err fi } # Print a "SKIP" message SKIP() { - TESTING $DUMPER $@ - echo " -SKIP-" + TESTING $DUMPER $@ + echo " -SKIP-" } diff --git a/tools/test/h5ls/h5ls_plugin.sh.in b/tools/test/h5ls/h5ls_plugin.sh.in index c89269d..28370e6 100644 --- a/tools/test/h5ls/h5ls_plugin.sh.in +++ b/tools/test/h5ls/h5ls_plugin.sh.in @@ -139,8 +139,8 @@ CLEAN_TESTFILES_AND_TESTDIR() # Print a $* message left justified in a field of 70 characters # MESSAGE() { - SPACES=" " - echo "$* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo "$* $SPACES" | cut -c1-70 | tr -d '\012' } # Print a line-line message left justified in a field of 70 characters @@ -206,7 +206,7 @@ TOOLTEST() { echo "" fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect echo " Expected result (*.ls) missing" diff --git a/tools/test/misc/testh5mkgrp.sh.in b/tools/test/misc/testh5mkgrp.sh.in index 3ad1f71..b08cce1 100644 --- a/tools/test/misc/testh5mkgrp.sh.in +++ b/tools/test/misc/testh5mkgrp.sh.in @@ -150,10 +150,11 @@ TOOLTEST() { TESTING $H5MKGRP $@ ( - cd $TESTDIR - $RUNSERIAL $H5MKGRP_BIN $@ + cd $TESTDIR + $RUNSERIAL $H5MKGRP_BIN $@ ) > output.out RET=$? + if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" @@ -164,7 +165,7 @@ TOOLTEST() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f output.out + rm -f output.out fi fi } @@ -181,8 +182,8 @@ H5LSTEST() # any unexpected output from that stream too. VERIFY_H5LS $@ ( - cd $TESTDIR - $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@ + cd $TESTDIR + $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@ ) 2>&1 |sed 's/Modified:.*/Modified: XXXX-XX-XX XX:XX:XX XXX/' >$actual # save actual in case it is needed later. @@ -190,25 +191,25 @@ H5LSTEST() STDOUT_FILTER $actual STDERR_FILTER $actual - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.ls) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.ls) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' - fi - - # Clean up output file - if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_sav - fi + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ls) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expect $actual; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.ls) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_sav + fi } # Single run of tool @@ -258,30 +259,30 @@ CMPTEST() # any unexpected output from that stream too. TESTING $H5MKGRP $@ ( - cd $TESTDIR - $RUNSERIAL $H5MKGRP_BIN $@ + cd $TESTDIR + $RUNSERIAL $H5MKGRP_BIN $@ ) >$actual 2>$actual_err cat $actual_err >> $actual - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - echo " Expected result (*.txt) missing" - nerrors="`expr $nerrors + 1`" - elif $CMP $expect $actual; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.txt) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' - fi - - # Clean up output file - if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err - fi + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.txt) missing" + nerrors="`expr $nerrors + 1`" + elif $CMP $expect $actual; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.txt) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err + fi } ############################################################################## -- cgit v0.12 From fa7f8ad2f3fe509ff69dc574ddad0ae4d329ccca Mon Sep 17 00:00:00 2001 From: David Young Date: Thu, 30 Jul 2020 17:21:24 -0500 Subject: Improve code readability: extract common subexpressions into temporary variables. --- src/H5Dvirtual.c | 202 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 106 insertions(+), 96 deletions(-) diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index e07f538..bf6104d 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -313,6 +313,8 @@ done: herr_t H5D_virtual_update_min_dims(H5O_layout_t *layout, size_t idx) { + H5O_storage_virtual_t *virt = &layout->storage.u.virt; + H5O_storage_virtual_ent_t *ent = &virt->list[idx]; H5S_sel_type sel_type; int rank; hsize_t bounds_start[H5S_MAX_RANK]; @@ -324,10 +326,10 @@ H5D_virtual_update_min_dims(H5O_layout_t *layout, size_t idx) HDassert(layout); HDassert(layout->type == H5D_VIRTUAL); - HDassert(idx < layout->storage.u.virt.list_nalloc); + HDassert(idx < virt->list_nalloc); /* Get type of selection */ - if(H5S_SEL_ERROR == (sel_type = H5S_GET_SELECT_TYPE(layout->storage.u.virt.list[idx].source_dset.virtual_select))) + if(H5S_SEL_ERROR == (sel_type = H5S_GET_SELECT_TYPE(ent->source_dset.virtual_select))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get selection type") /* Do not update min_dims for "all" or "none" selections */ @@ -335,19 +337,19 @@ H5D_virtual_update_min_dims(H5O_layout_t *layout, size_t idx) HGOTO_DONE(SUCCEED) /* Get rank of vspace */ - if((rank = H5S_GET_EXTENT_NDIMS(layout->storage.u.virt.list[idx].source_dset.virtual_select)) < 0) + if((rank = H5S_GET_EXTENT_NDIMS(ent->source_dset.virtual_select)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get number of dimensions") /* Get selection bounds */ - if(H5S_SELECT_BOUNDS(layout->storage.u.virt.list[idx].source_dset.virtual_select, bounds_start, bounds_end) < 0) + if(H5S_SELECT_BOUNDS(ent->source_dset.virtual_select, bounds_start, bounds_end) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get selection bounds") /* Update min_dims */ for(i = 0; i < rank; i++) /* Don't check unlimited dimensions in the selection */ - if((i != layout->storage.u.virt.list[idx].unlim_dim_virtual) - && (bounds_end[i] >= layout->storage.u.virt.min_dims[i])) - layout->storage.u.virt.min_dims[i] = bounds_end[i] + (hsize_t)1; + if((i != ent->unlim_dim_virtual) + && (bounds_end[i] >= virt->min_dims[i])) + virt->min_dims[i] = bounds_end[i] + (hsize_t)1; done: FUNC_LEAVE_NOAPI(ret_value) @@ -419,6 +421,7 @@ done: herr_t H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout) { + H5O_storage_virtual_t *virt = &layout->storage.u.virt; uint8_t *heap_block = NULL; /* Block to add to heap */ size_t *str_size = NULL; /* Array for VDS entry string lengths */ uint8_t *heap_block_p; /* Pointer into the heap block, while encoding */ @@ -433,16 +436,16 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout) /* Sanity checking */ HDassert(f); HDassert(layout); - HDassert(layout->storage.u.virt.serial_list_hobjid.addr == HADDR_UNDEF); + HDassert(virt->serial_list_hobjid.addr == HADDR_UNDEF); /* Create block if # of used entries > 0 */ - if(layout->storage.u.virt.list_nused > 0) { + if(virt->list_nused > 0) { /* Set the low/high bounds according to 'f' for the API context */ H5CX_set_libver_bounds(f); /* Allocate array for caching results of strlen */ - if(NULL == (str_size = (size_t *)H5MM_malloc(2 * layout->storage.u.virt.list_nused * sizeof(size_t)))) + if(NULL == (str_size = (size_t *)H5MM_malloc(2 * virt->list_nused * sizeof(size_t)))) HGOTO_ERROR(H5E_OHDR, H5E_RESOURCE, FAIL, "unable to allocate string length array") /* @@ -453,29 +456,30 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout) block_size = (size_t)1 + H5F_SIZEOF_SIZE(f); /* Calculate size of each entry */ - for(i = 0; i < layout->storage.u.virt.list_nused; i++) { + for(i = 0; i < virt->list_nused; i++) { + H5O_storage_virtual_ent_t *ent = &virt->list[i]; hssize_t select_serial_size; /* Size of serialized selection */ - HDassert(layout->storage.u.virt.list[i].source_file_name); - HDassert(layout->storage.u.virt.list[i].source_dset_name); - HDassert(layout->storage.u.virt.list[i].source_select); - HDassert(layout->storage.u.virt.list[i].source_dset.virtual_select); + HDassert(ent->source_file_name); + HDassert(ent->source_dset_name); + HDassert(ent->source_select); + HDassert(ent->source_dset.virtual_select); /* Source file name */ - str_size[2 * i] = HDstrlen(layout->storage.u.virt.list[i].source_file_name) + (size_t)1; + str_size[2 * i] = HDstrlen(ent->source_file_name) + (size_t)1; block_size += str_size[2 * i]; /* Source dset name */ - str_size[(2 * i) + 1] = HDstrlen(layout->storage.u.virt.list[i].source_dset_name) + (size_t)1; + str_size[(2 * i) + 1] = HDstrlen(ent->source_dset_name) + (size_t)1; block_size += str_size[(2 * i) + 1]; /* Source selection */ - if((select_serial_size = H5S_SELECT_SERIAL_SIZE(layout->storage.u.virt.list[i].source_select)) < 0) + if((select_serial_size = H5S_SELECT_SERIAL_SIZE(ent->source_select)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size") block_size += (size_t)select_serial_size; /* Virtual dataset selection */ - if((select_serial_size = H5S_SELECT_SERIAL_SIZE(layout->storage.u.virt.list[i].source_dset.virtual_select)) < 0) + if((select_serial_size = H5S_SELECT_SERIAL_SIZE(ent->source_dset.virtual_select)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size") block_size += (size_t)select_serial_size; } /* end for */ @@ -498,25 +502,26 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout) *heap_block_p++ = (uint8_t)H5O_LAYOUT_VDS_GH_ENC_VERS; /* Number of entries */ - tmp_nentries = (hsize_t)layout->storage.u.virt.list_nused; + tmp_nentries = (hsize_t)virt->list_nused; H5F_ENCODE_LENGTH(f, heap_block_p, tmp_nentries) /* Encode each entry */ - for(i = 0; i < layout->storage.u.virt.list_nused; i++) { + for(i = 0; i < virt->list_nused; i++) { + H5O_storage_virtual_ent_t *ent = &virt->list[i]; /* Source file name */ - H5MM_memcpy((char *)heap_block_p, layout->storage.u.virt.list[i].source_file_name, str_size[2 * i]); + H5MM_memcpy((char *)heap_block_p, ent->source_file_name, str_size[2 * i]); heap_block_p += str_size[2 * i]; /* Source dataset name */ - H5MM_memcpy((char *)heap_block_p, layout->storage.u.virt.list[i].source_dset_name, str_size[(2 * i) + 1]); + H5MM_memcpy((char *)heap_block_p, ent->source_dset_name, str_size[(2 * i) + 1]); heap_block_p += str_size[(2 * i) + 1]; /* Source selection */ - if(H5S_SELECT_SERIALIZE(layout->storage.u.virt.list[i].source_select, &heap_block_p) < 0) + if(H5S_SELECT_SERIALIZE(ent->source_select, &heap_block_p) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to serialize source selection") /* Virtual selection */ - if(H5S_SELECT_SERIALIZE(layout->storage.u.virt.list[i].source_dset.virtual_select, &heap_block_p) < 0) + if(H5S_SELECT_SERIALIZE(ent->source_dset.virtual_select, &heap_block_p) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to serialize virtual selection") } /* end for */ @@ -525,7 +530,7 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout) UINT32ENCODE(heap_block_p, chksum) /* Insert block into global heap */ - if(H5HG_insert(f, block_size, heap_block, &(layout->storage.u.virt.serial_list_hobjid)) < 0) /* Casting away const OK --NAF */ + if(H5HG_insert(f, block_size, heap_block, &(virt->serial_list_hobjid)) < 0) /* Casting away const OK --NAF */ HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to insert virtual dataset heap block") } /* end if */ @@ -556,6 +561,7 @@ herr_t H5D__virtual_copy_layout(H5O_layout_t *layout) { H5O_storage_virtual_ent_t *orig_list = NULL; + H5O_storage_virtual_t *virt = &layout->storage.u.virt; hid_t orig_source_fapl; hid_t orig_source_dapl; H5P_genplist_t *plist; @@ -569,127 +575,129 @@ H5D__virtual_copy_layout(H5O_layout_t *layout) /* Save original entry list and top-level property lists and reset in layout * so the originals aren't closed on error */ - orig_source_fapl = layout->storage.u.virt.source_fapl; - layout->storage.u.virt.source_fapl = -1; - orig_source_dapl = layout->storage.u.virt.source_dapl; - layout->storage.u.virt.source_dapl = -1; - orig_list = layout->storage.u.virt.list; - layout->storage.u.virt.list = NULL; + orig_source_fapl = virt->source_fapl; + virt->source_fapl = -1; + orig_source_dapl = virt->source_dapl; + virt->source_dapl = -1; + orig_list = virt->list; + virt->list = NULL; /* Copy entry list */ - if(layout->storage.u.virt.list_nused > 0) { + if(virt->list_nused > 0) { HDassert(orig_list); /* Allocate memory for the list */ - if(NULL == (layout->storage.u.virt.list = (H5O_storage_virtual_ent_t *)H5MM_calloc(layout->storage.u.virt.list_nused * sizeof(H5O_storage_virtual_ent_t)))) + if(NULL == (virt->list = H5MM_calloc(virt->list_nused * sizeof(virt->list[0])))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate memory for virtual dataset entry list") - layout->storage.u.virt.list_nalloc = layout->storage.u.virt.list_nused; + virt->list_nalloc = virt->list_nused; /* Copy the list entries, though set source_dset.dset and sub_dset to * NULL */ - for(i = 0; i < layout->storage.u.virt.list_nused; i++) { + for(i = 0; i < virt->list_nused; i++) { + H5O_storage_virtual_ent_t *ent = &virt->list[i]; + /* Copy virtual selection */ - if(NULL == (layout->storage.u.virt.list[i].source_dset.virtual_select + if(NULL == (ent->source_dset.virtual_select = H5S_copy(orig_list[i].source_dset.virtual_select, FALSE, TRUE))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy virtual selection") /* Copy original source names */ - if(NULL == (layout->storage.u.virt.list[i].source_file_name + if(NULL == (ent->source_file_name = H5MM_strdup(orig_list[i].source_file_name))) HGOTO_ERROR(H5E_DATASET, H5E_RESOURCE, FAIL, "unable to duplicate source file name") - if(NULL == (layout->storage.u.virt.list[i].source_dset_name + if(NULL == (ent->source_dset_name = H5MM_strdup(orig_list[i].source_dset_name))) HGOTO_ERROR(H5E_DATASET, H5E_RESOURCE, FAIL, "unable to duplicate source dataset name") /* Copy source selection */ - if(NULL == (layout->storage.u.virt.list[i].source_select + if(NULL == (ent->source_select = H5S_copy(orig_list[i].source_select, FALSE, TRUE))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy source selection") /* Initialize clipped selections */ if(orig_list[i].unlim_dim_virtual < 0) { - layout->storage.u.virt.list[i].source_dset.clipped_source_select = layout->storage.u.virt.list[i].source_select; - layout->storage.u.virt.list[i].source_dset.clipped_virtual_select = layout->storage.u.virt.list[i].source_dset.virtual_select; + ent->source_dset.clipped_source_select = ent->source_select; + ent->source_dset.clipped_virtual_select = ent->source_dset.virtual_select; } /* end if */ /* Copy parsed names */ - if(H5D__virtual_copy_parsed_name(&layout->storage.u.virt.list[i].parsed_source_file_name, orig_list[i].parsed_source_file_name) < 0) + if(H5D__virtual_copy_parsed_name(&ent->parsed_source_file_name, orig_list[i].parsed_source_file_name) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy parsed source file name") - layout->storage.u.virt.list[i].psfn_static_strlen = orig_list[i].psfn_static_strlen; - layout->storage.u.virt.list[i].psfn_nsubs = orig_list[i].psfn_nsubs; - if(H5D__virtual_copy_parsed_name(&layout->storage.u.virt.list[i].parsed_source_dset_name, orig_list[i].parsed_source_dset_name) < 0) + ent->psfn_static_strlen = orig_list[i].psfn_static_strlen; + ent->psfn_nsubs = orig_list[i].psfn_nsubs; + if(H5D__virtual_copy_parsed_name(&ent->parsed_source_dset_name, orig_list[i].parsed_source_dset_name) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy parsed source dataset name") - layout->storage.u.virt.list[i].psdn_static_strlen = orig_list[i].psdn_static_strlen; - layout->storage.u.virt.list[i].psdn_nsubs = orig_list[i].psdn_nsubs; + ent->psdn_static_strlen = orig_list[i].psdn_static_strlen; + ent->psdn_nsubs = orig_list[i].psdn_nsubs; /* Copy source names in source dset or add reference as appropriate */ if(orig_list[i].source_dset.file_name) { if(orig_list[i].source_dset.file_name == orig_list[i].source_file_name) - layout->storage.u.virt.list[i].source_dset.file_name = layout->storage.u.virt.list[i].source_file_name; + ent->source_dset.file_name = ent->source_file_name; else if(orig_list[i].parsed_source_file_name && (orig_list[i].source_dset.file_name != orig_list[i].parsed_source_file_name->name_segment)) { - HDassert(layout->storage.u.virt.list[i].parsed_source_file_name); - HDassert(layout->storage.u.virt.list[i].parsed_source_file_name->name_segment); - layout->storage.u.virt.list[i].source_dset.file_name = layout->storage.u.virt.list[i].parsed_source_file_name->name_segment; + HDassert(ent->parsed_source_file_name); + HDassert(ent->parsed_source_file_name->name_segment); + ent->source_dset.file_name = ent->parsed_source_file_name->name_segment; } /* end if */ else - if(NULL == (layout->storage.u.virt.list[i].source_dset.file_name + if(NULL == (ent->source_dset.file_name = H5MM_strdup(orig_list[i].source_dset.file_name))) HGOTO_ERROR(H5E_DATASET, H5E_RESOURCE, FAIL, "unable to duplicate source file name") } /* end if */ if(orig_list[i].source_dset.dset_name) { if(orig_list[i].source_dset.dset_name == orig_list[i].source_dset_name) - layout->storage.u.virt.list[i].source_dset.dset_name = layout->storage.u.virt.list[i].source_dset_name; + ent->source_dset.dset_name = ent->source_dset_name; else if(orig_list[i].parsed_source_dset_name && (orig_list[i].source_dset.dset_name != orig_list[i].parsed_source_dset_name->name_segment)) { - HDassert(layout->storage.u.virt.list[i].parsed_source_dset_name); - HDassert(layout->storage.u.virt.list[i].parsed_source_dset_name->name_segment); - layout->storage.u.virt.list[i].source_dset.dset_name = layout->storage.u.virt.list[i].parsed_source_dset_name->name_segment; + HDassert(ent->parsed_source_dset_name); + HDassert(ent->parsed_source_dset_name->name_segment); + ent->source_dset.dset_name = ent->parsed_source_dset_name->name_segment; } /* end if */ else - if(NULL == (layout->storage.u.virt.list[i].source_dset.dset_name + if(NULL == (ent->source_dset.dset_name = H5MM_strdup(orig_list[i].source_dset.dset_name))) HGOTO_ERROR(H5E_DATASET, H5E_RESOURCE, FAIL, "unable to duplicate source dataset name") } /* end if */ /* Copy other fields in entry */ - layout->storage.u.virt.list[i].unlim_dim_source = orig_list[i].unlim_dim_source; - layout->storage.u.virt.list[i].unlim_dim_virtual = orig_list[i].unlim_dim_virtual; - layout->storage.u.virt.list[i].unlim_extent_source = orig_list[i].unlim_extent_source; - layout->storage.u.virt.list[i].unlim_extent_virtual = orig_list[i].unlim_extent_virtual; - layout->storage.u.virt.list[i].clip_size_source = orig_list[i].clip_size_source; - layout->storage.u.virt.list[i].clip_size_virtual = orig_list[i].clip_size_virtual; - layout->storage.u.virt.list[i].source_space_status = orig_list[i].source_space_status; - layout->storage.u.virt.list[i].virtual_space_status = orig_list[i].virtual_space_status; + ent->unlim_dim_source = orig_list[i].unlim_dim_source; + ent->unlim_dim_virtual = orig_list[i].unlim_dim_virtual; + ent->unlim_extent_source = orig_list[i].unlim_extent_source; + ent->unlim_extent_virtual = orig_list[i].unlim_extent_virtual; + ent->clip_size_source = orig_list[i].clip_size_source; + ent->clip_size_virtual = orig_list[i].clip_size_virtual; + ent->source_space_status = orig_list[i].source_space_status; + ent->virtual_space_status = orig_list[i].virtual_space_status; } /* end for */ } /* end if */ else { /* Zero out other fields related to list, just to be sure */ - layout->storage.u.virt.list = NULL; - layout->storage.u.virt.list_nalloc = 0; + virt->list = NULL; + virt->list_nalloc = 0; } /* end else */ /* Copy property lists */ if(orig_source_fapl >= 0) { if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(orig_source_fapl, H5I_GENPROP_LST))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - if((layout->storage.u.virt.source_fapl = H5P_copy_plist(plist, FALSE)) < 0) + if((virt->source_fapl = H5P_copy_plist(plist, FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy fapl") } /* end if */ if(orig_source_dapl >= 0) { if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(orig_source_dapl, H5I_GENPROP_LST))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - if((layout->storage.u.virt.source_dapl = H5P_copy_plist(plist, FALSE)) < 0) + if((virt->source_dapl = H5P_copy_plist(plist, FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy dapl") } /* end if */ /* New layout is not fully initialized */ - layout->storage.u.virt.init = FALSE; + virt->init = FALSE; done: /* Release allocated resources on failure */ @@ -721,6 +729,7 @@ herr_t H5D__virtual_reset_layout(H5O_layout_t *layout) { size_t i, j; + H5O_storage_virtual_t *virt = &layout->storage.u.virt; herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE @@ -731,53 +740,54 @@ H5D__virtual_reset_layout(H5O_layout_t *layout) /* Free the list entries. Note we always attempt to free everything even in * the case of a failure. Because of this, and because we free the list * afterwards, we do not need to zero out the memory in the list. */ - for(i = 0; i < layout->storage.u.virt.list_nused; i++) { + for(i = 0; i < virt->list_nused; i++) { + H5O_storage_virtual_ent_t *ent = &virt->list[i]; /* Free source_dset */ - if(H5D__virtual_reset_source_dset(&layout->storage.u.virt.list[i], &layout->storage.u.virt.list[i].source_dset) < 0) + if(H5D__virtual_reset_source_dset(ent, &ent->source_dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset source dataset") /* Free original source names */ - (void)H5MM_xfree(layout->storage.u.virt.list[i].source_file_name); - (void)H5MM_xfree(layout->storage.u.virt.list[i].source_dset_name); + (void)H5MM_xfree(ent->source_file_name); + (void)H5MM_xfree(ent->source_dset_name); /* Free sub_dset */ - for(j = 0; j < layout->storage.u.virt.list[i].sub_dset_nalloc; j++) - if(H5D__virtual_reset_source_dset(&layout->storage.u.virt.list[i], &layout->storage.u.virt.list[i].sub_dset[j]) < 0) + for(j = 0; j < ent->sub_dset_nalloc; j++) + if(H5D__virtual_reset_source_dset(ent, &ent->sub_dset[j]) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset source dataset") - layout->storage.u.virt.list[i].sub_dset = (H5O_storage_virtual_srcdset_t *)H5MM_xfree(layout->storage.u.virt.list[i].sub_dset); + ent->sub_dset = H5MM_xfree(ent->sub_dset); /* Free source_select */ - if(layout->storage.u.virt.list[i].source_select) - if(H5S_close(layout->storage.u.virt.list[i].source_select) < 0) + if(ent->source_select) + if(H5S_close(ent->source_select) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release source selection") /* Free parsed_source_file_name */ - H5D_virtual_free_parsed_name(layout->storage.u.virt.list[i].parsed_source_file_name); + H5D_virtual_free_parsed_name(ent->parsed_source_file_name); /* Free parsed_source_dset_name */ - H5D_virtual_free_parsed_name(layout->storage.u.virt.list[i].parsed_source_dset_name); - } /* end for */ + H5D_virtual_free_parsed_name(ent->parsed_source_dset_name); + } /* Free the list */ - layout->storage.u.virt.list = (H5O_storage_virtual_ent_t *)H5MM_xfree(layout->storage.u.virt.list); - layout->storage.u.virt.list_nalloc = (size_t)0; - layout->storage.u.virt.list_nused = (size_t)0; - (void)HDmemset(layout->storage.u.virt.min_dims, 0, sizeof(layout->storage.u.virt.min_dims)); + virt->list = H5MM_xfree(virt->list); + virt->list_nalloc = (size_t)0; + virt->list_nused = (size_t)0; + (void)HDmemset(virt->min_dims, 0, sizeof(virt->min_dims)); /* Close access property lists */ - if(layout->storage.u.virt.source_fapl >= 0) { - if(H5I_dec_ref(layout->storage.u.virt.source_fapl) < 0) + if(virt->source_fapl >= 0) { + if(H5I_dec_ref(virt->source_fapl) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't close source fapl") - layout->storage.u.virt.source_fapl = -1; - } /* end if */ - if(layout->storage.u.virt.source_dapl >= 0) { - if(H5I_dec_ref(layout->storage.u.virt.source_dapl) < 0) + virt->source_fapl = -1; + } + if(virt->source_dapl >= 0) { + if(H5I_dec_ref(virt->source_dapl) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't close source dapl") - layout->storage.u.virt.source_dapl = -1; - } /* end if */ + virt->source_dapl = -1; + } /* The list is no longer initialized */ - layout->storage.u.virt.init = FALSE; + virt->init = FALSE; /* Note the lack of a done: label. This is because there are no HGOTO_ERROR * calls. If one is added, a done: label must also be added */ -- cgit v0.12 From 7b48e3409a8c3ba1e83c929656e84196a6dc2e6d Mon Sep 17 00:00:00 2001 From: David Young Date: Tue, 7 Jul 2020 12:52:00 -0500 Subject: Fix a bug in H5D__virtual_write_one to stop an assertion from failing deep in H5Dwrite---project the *clipped* virtual selection instead of the virtual selection: assertion "((src_space)->select.num_elem) == ((dst_space)->select.num_elem)" failed: file "../../../vchoi_fork/src/H5Sselect.c", line 2617, function "H5S_select_project_intersection" with this backtrace: at /home/dyoung/plain-nbsd/src/lib/libc/gen/raise.c:48 at /home/dyoung/plain-nbsd/src/lib/libc/stdlib/abort.c:74 file=0xae9e3e80 "../../../vchoi_fork/src/H5Sselect.c", line=2617, function=0xae9e4ca0 <__func__.15686> "H5S_select_project_intersection", failedexpr=0xae9e0e54 "((src_space)->select.num_elem) == ((dst_space)->select.num_elem)") at /home/dyoung/plain-nbsd/src/lib/libc/gen/assert.c:72 dst_space=0xae26f0dc, src_intersect_space=0xae0b577c, new_space_ptr=0xbfb85fac, share_selection=true) at ../../../vchoi_fork/src/H5Sselect.c:2749 type_info=type_info@entry=0xbfb86084, file_space=file_space@entry=0xae0b577c, source_dset=0xae24741c, io_info=) at ../../../vchoi_fork/src/H5Dvirtual.c:2784 type_info=0xbfb86084, nelmts=256, file_space=0xae0b577c, mem_space=0xae26ec8c, fm=0xadf0401c) at ../../../vchoi_fork/src/H5Dvirtual.c:2873 mem_type_id=216172782113783837, mem_space=0xae26ec8c, file_space=0xae0b577c, buf=0xae203808) at ../../../vchoi_fork/src/H5Dio.c:780 mem_type_id=216172782113783837, mem_space_id=288230376151711754, file_space_id=288230376151711755, dxpl_id=792633534417207304, buf=0xae203808, req=0x0) at ../../../vchoi_fork/src/H5VLnative_dataset.c:206 mem_type_id=216172782113783837, mem_space_id=288230376151711754, file_space_id=288230376151711755, dxpl_id=792633534417207304, buf=0xae203808, req=0x0, cls=) at ../../../vchoi_fork/src/H5VLcallback.c:2152 mem_type_id=216172782113783837, mem_space_id=288230376151711754, file_space_id=288230376151711755, dxpl_id=792633534417207304, buf=0xae203808, req=0x0) at ../../../vchoi_fork/src/H5VLcallback.c:2186 mem_type_id=216172782113783837, mem_space_id=288230376151711754, file_space_id=288230376151711755, dxpl_id=792633534417207304, buf=0xae203808) at ../../../vchoi_fork/src/H5Dio.c:313 --- src/H5Dvirtual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index e07f538..8519ec8 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -2781,7 +2781,7 @@ H5D__virtual_write_one(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, * extent in the unlimited dimension. -NAF */ /* Project intersection of file space and mapping virtual space onto * mapping source space */ - if(H5S_select_project_intersection(source_dset->virtual_select, source_dset->clipped_source_select, file_space, &projected_src_space, TRUE) < 0) + if(H5S_select_project_intersection(source_dset->clipped_virtual_select, source_dset->clipped_source_select, file_space, &projected_src_space, TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "can't project virtual intersection onto source space") /* Perform write on source dataset */ -- cgit v0.12 From 33f35183cbfdde70ee8f803acb5b735ad4dfe086 Mon Sep 17 00:00:00 2001 From: mainzer Date: Wed, 5 Aug 2020 15:39:49 -0500 Subject: When flushing, the metadata cache attempts to flush entries in increasing address order. To facilitate this, the metadata cache needs a list of of dirty entries in increasing address order. This is implemented via a skip list of all dirty entries in the cache. To date this skip list has been maintained at all times. However, profiling indicates that we can avoid significant overhead by constructing the skip list of dirty entries just before a flush, taking it down afterwareds, and not maintaining it during normal operation. This commit implements this optimization for both serial and parallel. Tested serial and parallel, debug and production on charis and jelly. --- src/H5AC.c | 483 ++++++++---- src/H5ACmpio.c | 42 +- src/H5ACprivate.h | 2 + src/H5C.c | 1684 ++++++++++++++++++++++++++++++++-------- src/H5Cdbg.c | 41 +- src/H5Cimage.c | 13 +- src/H5Cmpio.c | 391 ++++++---- src/H5Cpkg.h | 471 +++++++---- src/H5Cprivate.h | 5 +- src/H5Fint.c | 10 + test/cache.c | 2099 ++++++++++++++++++++++++++------------------------ test/cache_common.c | 171 +++- test/cache_common.h | 59 ++ test/cache_tagging.c | 13 +- test/ohdr.c | 24 + 15 files changed, 3651 insertions(+), 1857 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index f8805b3..59cabde 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -136,14 +136,14 @@ static const H5AC_class_t *const H5AC_class_s[] = { /*------------------------------------------------------------------------- - * Function: H5AC_init + * Function: H5AC_init * - * Purpose: Initialize the interface from some other layer. + * Purpose: Initialize the interface from some other layer. * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, January 18, 2003 * *------------------------------------------------------------------------- @@ -162,13 +162,13 @@ done: /*------------------------------------------------------------------------- - * Function H5AC__init_package + * Function: H5AC__init_package * - * Purpose: Initialize interface-specific information + * Purpose: Initialize interface-specific information * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 18, 2002 * *------------------------------------------------------------------------- @@ -198,15 +198,15 @@ H5AC__init_package(void) /*------------------------------------------------------------------------- - * Function: H5AC_term_package + * Function: H5AC_term_package * - * Purpose: Terminate this interface. + * Purpose: Terminate this interface. * - * Return: Success: Positive if anything was done that might - * affect other interfaces; zero otherwise. - * Failure: Negative. + * Return: Success: Positive if anything was done that might + * affect other interfaces; zero otherwise. + * Failure: Negative. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 18, 2002 * *------------------------------------------------------------------------- @@ -284,7 +284,7 @@ herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_config_t * image_config_ptr) { #ifdef H5_HAVE_PARALLEL - char prefix[H5C__PREFIX_LEN] = ""; + char prefix[H5C__PREFIX_LEN] = ""; H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ struct H5C_cache_image_ctl_t int_ci_config = H5C__DEFAULT_CACHE_IMAGE_CTL; @@ -309,9 +309,9 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co #ifdef H5_HAVE_PARALLEL if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { - MPI_Comm mpi_comm; - int mpi_rank; - int mpi_size; + MPI_Comm mpi_comm; + int mpi_rank; + int mpi_size; if(MPI_COMM_NULL == (mpi_comm = H5F_mpi_get_comm(f))) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI communicator") @@ -400,7 +400,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co #endif /* H5_HAVE_PARALLEL */ if(NULL == f->shared->cache) - HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") #ifdef H5_HAVE_PARALLEL if(aux_ptr != NULL) @@ -472,6 +472,14 @@ done: * matzke@llnl.gov * Jul 9 1997 * + * Changes: + * + * In the parallel case, added code to setup the MDC slist + * before the call to H5AC__flush_entries() and take it down + * afterwards. + * + * JRM -- 7/29/20 + * *------------------------------------------------------------------------- */ herr_t @@ -497,58 +505,115 @@ H5AC_dest(H5F_t *f) #endif /* H5AC_DUMP_STATS_ON_CLOSE */ /* Check if log messages are being emitted */ - if(H5C_get_logging_status(f->shared->cache, &log_enabled, &curr_logging) < 0) + if(H5C_get_logging_status(f->shared->cache, + &log_enabled, &curr_logging) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to get logging status") - if(log_enabled && curr_logging) + if(log_enabled && curr_logging) { + if(H5C_log_write_destroy_cache_msg(f->shared->cache) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, \ + "unable to emit log message") + } + /* Tear down logging */ - if(log_enabled) + if(log_enabled) { + if(H5C_log_tear_down(f->shared->cache) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "mdc logging tear-down failed") + + HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, \ + "mdc logging tear-down failed") + } #ifdef H5_HAVE_PARALLEL + /* destroying the cache, so clear all collective entries */ if(H5C_clear_coll_entries(f->shared->cache, FALSE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed") + + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, \ + "H5C_clear_coll_entries() failed") aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(f->shared->cache); - if(aux_ptr) + + if(aux_ptr) { + /* Sanity check */ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + + + /* If the file was opened R/W, attempt to flush all entries + * from rank 0 & Bcast clean list to other ranks. + * + * Must not flush in the R/O case, as this will trigger the + * free space manager settle routines. + * + * Must also enable the skip list before the call to + * H5AC__flush_entries() and disable it afterwards, as the + * skip list will be disabled after the previous flush. + * + * Note that H5C_dest() does slist setup and take down as well. + * Unfortunately, we can't do the setup and take down just once, + * as H5C_dest() is called directly in the test code. + * + * Fortunately, the cache should be clean or close to it at this + * point, so the overhead should be minimal. + */ + if(H5F_ACC_RDWR & H5F_INTENT(f)) { - /* If the file was opened R/W, attempt to flush all entries - * from rank 0 & Bcast clean list to other ranks. - * - * Must not flush in the R/O case, as this will trigger the - * free space manager settle routines. - */ - if(H5F_ACC_RDWR & H5F_INTENT(f)) - if(H5AC__flush_entries(f) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush") + /* enable and load the slist */ + if ( H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "set slist enabled failed") + + if(H5AC__flush_entries(f) < 0) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush") + + /* disable the slist -- should be empty */ + if ( H5C_set_slist_enabled(f->shared->cache, FALSE, FALSE) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "disable slist failed") + } + } #endif /* H5_HAVE_PARALLEL */ /* Destroy the cache */ if(H5C_dest(f) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't destroy cache") + f->shared->cache = NULL; #ifdef H5_HAVE_PARALLEL + if(aux_ptr != NULL) { + if(aux_ptr->d_slist_ptr != NULL) { + HDassert(H5SL_count(aux_ptr->d_slist_ptr) == 0); H5SL_close(aux_ptr->d_slist_ptr); + } /* end if */ + if(aux_ptr->c_slist_ptr != NULL) { + HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0); H5SL_close(aux_ptr->c_slist_ptr); + } /* end if */ + if(aux_ptr->candidate_slist_ptr != NULL) { + HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0); H5SL_close(aux_ptr->candidate_slist_ptr); + } /* end if */ + aux_ptr->magic = 0; aux_ptr = H5FL_FREE(H5AC_aux_t, aux_ptr); + } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -561,12 +626,12 @@ done: * Function: H5AC_evict * * Purpose: Evict all entries except the pinned entries - * in the cache. + * in the cache. * * Return: Non-negative on success/Negative on failure * * Programmer: Vailin Choi - * Dec 2013 + * Dec 2013 * *------------------------------------------------------------------------- */ @@ -600,9 +665,9 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_expunge_entry * - * Purpose: Expunge the target entry from the cache without writing it - * to disk even if it is dirty. The entry must not be either - * pinned or protected. + * Purpose: Expunge the target entry from the cache without writing it + * to disk even if it is dirty. The entry must not be either + * pinned or protected. * * Return: Non-negative on success/Negative on failure * @@ -643,13 +708,13 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_flush * - * Purpose: Flush (and possibly destroy) the metadata cache associated - * with the specified file. + * Purpose: Flush (and possibly destroy) the metadata cache associated + * with the specified file. * - * If the cache contains protected entries, the function will - * fail, as protected entries cannot be flushed. However - * all unprotected entries should be flushed before the - * function returns failure. + * If the cache contains protected entries, the function will + * fail, as protected entries cannot be flushed. However + * all unprotected entries should be flushed before the + * function returns failure. * * Return: Non-negative on success/Negative on failure if there was a * request to flush all items and something was protected. @@ -701,15 +766,15 @@ done: * Function: H5AC_get_entry_status * * Purpose: Given a file address, determine whether the metadata - * cache contains an entry at that location. If it does, - * also determine whether the entry is dirty, protected, - * pinned, etc. and return that information to the caller - * in *status. + * cache contains an entry at that location. If it does, + * also determine whether the entry is dirty, protected, + * pinned, etc. and return that information to the caller + * in *status. * - * If the specified entry doesn't exist, set *status_ptr - * to zero. + * If the specified entry doesn't exist, set *status_ptr + * to zero. * - * On error, the value of *status is undefined. + * On error, the value of *status is undefined. * * Return: Non-negative on success/Negative on failure * @@ -721,14 +786,14 @@ done: herr_t H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status) { - hbool_t in_cache; /* Entry @ addr is in the cache */ - hbool_t is_dirty; /* Entry @ addr is in the cache and dirty */ - hbool_t is_protected; /* Entry @ addr is in the cache and protected */ - hbool_t is_pinned; /* Entry @ addr is in the cache and pinned */ - hbool_t is_corked; - hbool_t is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */ - hbool_t is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */ - hbool_t image_is_up_to_date; /* Entry @ addr is in the cache and has an up to date image */ + hbool_t in_cache; /* Entry @ addr is in the cache */ + hbool_t is_dirty; /* Entry @ addr is in the cache and dirty */ + hbool_t is_protected; /* Entry @ addr is in the cache and protected */ + hbool_t is_pinned; /* Entry @ addr is in the cache and pinned */ + hbool_t is_corked; + hbool_t is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */ + hbool_t is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */ + hbool_t image_is_up_to_date; /* Entry @ addr is in the cache and has an up to date image */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -741,21 +806,21 @@ H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_status() failed") if(in_cache) { - *status |= H5AC_ES__IN_CACHE; - if(is_dirty) - *status |= H5AC_ES__IS_DIRTY; - if(is_protected) - *status |= H5AC_ES__IS_PROTECTED; - if(is_pinned) - *status |= H5AC_ES__IS_PINNED; - if(is_corked) - *status |= H5AC_ES__IS_CORKED; - if(is_flush_dep_parent) - *status |= H5AC_ES__IS_FLUSH_DEP_PARENT; - if(is_flush_dep_child) - *status |= H5AC_ES__IS_FLUSH_DEP_CHILD; - if(image_is_up_to_date) - *status |= H5AC_ES__IMAGE_IS_UP_TO_DATE; + *status |= H5AC_ES__IN_CACHE; + if(is_dirty) + *status |= H5AC_ES__IS_DIRTY; + if(is_protected) + *status |= H5AC_ES__IS_PROTECTED; + if(is_pinned) + *status |= H5AC_ES__IS_PINNED; + if(is_corked) + *status |= H5AC_ES__IS_CORKED; + if(is_flush_dep_parent) + *status |= H5AC_ES__IS_FLUSH_DEP_PARENT; + if(is_flush_dep_child) + *status |= H5AC_ES__IS_FLUSH_DEP_CHILD; + if(image_is_up_to_date) + *status |= H5AC_ES__IMAGE_IS_UP_TO_DATE; } /* end if */ else *status = 0; @@ -875,8 +940,8 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_mark_entry_dirty * - * Purpose: Mark a pinned or protected entry as dirty. The target - * entry MUST be either pinned, protected, or both. + * Purpose: Mark a pinned or protected entry as dirty. The target + * entry MUST be either pinned, protected, or both. * * Return: Non-negative on success/Negative on failure * @@ -929,8 +994,8 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_mark_entry_clean * - * Purpose: Mark a pinned entry as clean. The target - * entry MUST be pinned. + * Purpose: Mark a pinned entry as clean. The target + * entry MUST be pinned. * * Return: Non-negative on success/Negative on failure * @@ -982,8 +1047,8 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_mark_entry_unserialized * - * Purpose: Mark a pinned or protected entry as unserialized. The target - * entry MUST be either pinned, protected, or both. + * Purpose: Mark a pinned or protected entry as unserialized. The target + * entry MUST be either pinned, protected, or both. * * Return: Non-negative on success/Negative on failure * @@ -1024,8 +1089,8 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_mark_entry_serialized * - * Purpose: Mark a pinned entry as serialized. The target - * entry MUST be pinned. + * Purpose: Mark a pinned entry as serialized. The target + * entry MUST be pinned. * * Return: Non-negative on success/Negative on failure * @@ -1124,7 +1189,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_pin_protected_entry() * - * Purpose: Pin a protected cache entry. The entry must be protected + * Purpose: Pin a protected cache entry. The entry must be protected * at the time of call, and must be unpinned. * * Return: Non-negative on success/Negative on failure @@ -1203,9 +1268,112 @@ done: /*------------------------------------------------------------------------- + * + * Function: H5AC_prep_for_file_flush + * + * Purpose: This function should be called just prior to the first + * call to H5AC_flush() during a file flush. + * + * Its purpose is to handly any setup required prior to + * metadata cache flush. + * + * Initially, this means setting up the slist prior to the + * flush. We do this in a seperate call because + * H5F__flush_phase2() make repeated calls to H5AC_flush(). + * Handling this detail in separate calls allows us to avoid + * the overhead of setting up and taking down the skip list + * repeatedly. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: John Mainzer + * 5/5/20 + * + * Changes: None. + * + *------------------------------------------------------------------------- + */ +herr_t +H5AC_prep_for_file_flush(H5F_t *f) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); + HDassert(f->shared->cache); + + if ( H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist enabled failed") + +done: + + FUNC_LEAVE_NOAPI(ret_value) + +} /* H5AC_prep_for_file_flush() */ + + +/*------------------------------------------------------------------------- + * + * Function: H5AC_secure_from_file_flush + * + * Purpose: This function should be called just after the last + * call to H5AC_flush() during a file flush. + * + * Its purpose is to perform any necessary cleanup after the + * metadata cache flush. + * + * The objective of the call is to allow the metadata cache + * to do any necessary necessary cleanup work after a cache + * flush. + * + * Initially, this means taking down the slist after the + * flush. We do this in a seperate call because + * H5F__flush_phase2() make repeated calls to H5AC_flush(). + * Handling this detail in separate calls allows us to avoid + * the overhead of setting up and taking down the skip list + * repeatedly. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: John Mainzer + * 5/5/20 + * + * Changes: None. + * + *------------------------------------------------------------------------- + */ +herr_t +H5AC_secure_from_file_flush(H5F_t *f) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); + HDassert(f->shared->cache); + + if ( H5C_set_slist_enabled(f->shared->cache, FALSE, FALSE) < 0) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist enabled failed") + +done: + + FUNC_LEAVE_NOAPI(ret_value) + +} /* H5AC_secure_from_file_flush() */ + + +/*------------------------------------------------------------------------- + * * Function: H5AC_create_flush_dependency() * - * Purpose: Create a flush dependency between two entries in the metadata + * Purpose: Create a flush dependency between two entries in the metadata * cache. * * Return: Non-negative on success/Negative on failure @@ -1250,16 +1418,16 @@ done: * Function: H5AC_protect * * Purpose: If the target entry is not in the cache, load it. If - * necessary, attempt to evict one or more entries to keep - * the cache within its maximum size. + * necessary, attempt to evict one or more entries to keep + * the cache within its maximum size. * - * Mark the target entry as protected, and return its address - * to the caller. The caller must call H5AC_unprotect() when - * finished with the entry. + * Mark the target entry as protected, and return its address + * to the caller. The caller must call H5AC_unprotect() when + * finished with the entry. * - * While it is protected, the entry may not be either evicted - * or flushed -- nor may it be accessed by another call to - * H5AC_protect. Any attempt to do so will result in a failure. + * While it is protected, the entry may not be either evicted + * or flushed -- nor may it be accessed by another call to + * H5AC_protect. Any attempt to do so will result in a failure. * * Return: Success: Ptr to the object. * Failure: NULL @@ -1301,7 +1469,7 @@ H5AC_protect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *udata, /* Check for invalid access request */ if((0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) && (0 == (flags & H5C__READ_ONLY_FLAG))) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "no write intent on file") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "no write intent on file") #if H5AC_DO_TAGGING_SANITY_CHECKS if(!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(type) < 0) @@ -1331,7 +1499,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_resize_entry * - * Purpose: Resize a pinned or protected entry. + * Purpose: Resize a pinned or protected entry. * * Return: Non-negative on success/Negative on failure * @@ -1384,8 +1552,8 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_unpin_entry() * - * Purpose: Unpin a cache entry. The entry must be unprotected at - * the time of call, and must be pinned. + * Purpose: Unpin a cache entry. The entry must be unprotected at + * the time of call, and must be pinned. * * Return: Non-negative on success/Negative on failure * @@ -1427,7 +1595,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_destroy_flush_dependency() * - * Purpose: Destroy a flush dependency between two entries. + * Purpose: Destroy a flush dependency between two entries. * * Return: Non-negative on success/Negative on failure * @@ -1470,27 +1638,27 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_unprotect * - * Purpose: Undo an H5AC_protect() call -- specifically, mark the - * entry as unprotected, remove it from the protected list, - * and give it back to the replacement policy. + * Purpose: Undo an H5AC_protect() call -- specifically, mark the + * entry as unprotected, remove it from the protected list, + * and give it back to the replacement policy. * - * The TYPE and ADDR arguments must be the same as those in - * the corresponding call to H5AC_protect() and the THING - * argument must be the value returned by that call to - * H5AC_protect(). + * The TYPE and ADDR arguments must be the same as those in + * the corresponding call to H5AC_protect() and the THING + * argument must be the value returned by that call to + * H5AC_protect(). * - * If the deleted flag is TRUE, simply remove the target entry - * from the cache, clear it, and free it without writing it to - * disk. + * If the deleted flag is TRUE, simply remove the target entry + * from the cache, clear it, and free it without writing it to + * disk. * - * This version of the function is a complete re-write to - * use the new metadata cache. While there isn't all that - * much difference between the old and new Purpose sections, - * the original version is given below. + * This version of the function is a complete re-write to + * use the new metadata cache. While there isn't all that + * much difference between the old and new Purpose sections, + * the original version is given below. * - * Original purpose section: + * Original purpose section: * - * This function should be called to undo the effect of + * This function should be called to undo the effect of * H5AC_protect(). The TYPE and ADDR arguments should be the * same as the corresponding call to H5AC_protect() and the * THING argument should be the value returned by H5AC_protect(). @@ -1509,8 +1677,8 @@ herr_t H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned flags) { - hbool_t dirtied; - hbool_t deleted; + hbool_t dirtied; + hbool_t deleted; #ifdef H5_HAVE_PARALLEL H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ @@ -1531,14 +1699,14 @@ H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, HDassert( ((H5AC_info_t *)thing)->type == type ); dirtied = (hbool_t)(((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG) || - (((H5AC_info_t *)thing)->dirtied)); + (((H5AC_info_t *)thing)->dirtied)); deleted = (hbool_t)((flags & H5C__DELETED_FLAG) == H5C__DELETED_FLAG); /* Check if the size changed out from underneath us, if we're not deleting * the entry. */ if(dirtied && !deleted) { - size_t curr_size = 0; + size_t curr_size = 0; if((type->image_len)(thing, &curr_size) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing") @@ -1625,7 +1793,7 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, if(internal_config.rpt_fcn == NULL) config_ptr->rpt_fcn_enabled = FALSE; else - config_ptr->rpt_fcn_enabled = TRUE; + config_ptr->rpt_fcn_enabled = TRUE; config_ptr->open_trace_file = FALSE; config_ptr->close_trace_file = FALSE; config_ptr->trace_file_name[0] = '\0'; @@ -1658,12 +1826,12 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, if(NULL != (aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr))) { config_ptr->dirty_bytes_threshold = aux_ptr->dirty_bytes_threshold; - config_ptr->metadata_write_strategy = aux_ptr->metadata_write_strategy; + config_ptr->metadata_write_strategy = aux_ptr->metadata_write_strategy; } /* end if */ else { #endif /* H5_HAVE_PARALLEL */ config_ptr->dirty_bytes_threshold = H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD; - config_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY; + config_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY; #ifdef H5_HAVE_PARALLEL } /* end else */ } @@ -1800,7 +1968,7 @@ herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr) { H5C_auto_size_ctl_t internal_config; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1880,16 +2048,16 @@ done: * Function: H5AC_validate_config() * * Purpose: Run a sanity check on the contents of the supplied - * instance of H5AC_cache_config_t. + * instance of H5AC_cache_config_t. * * Do nothing and return SUCCEED if no errors are detected, * and flag an error and return FAIL otherwise. * - * At present, this function operates by packing the data - * from the instance of H5AC_cache_config_t into an instance - * of H5C_auto_size_ctl_t, and then calling - * H5C_validate_resize_config(). As H5AC_cache_config_t and - * H5C_auto_size_ctl_t diverge, we may have to change this. + * At present, this function operates by packing the data + * from the instance of H5AC_cache_config_t into an instance + * of H5C_auto_size_ctl_t, and then calling + * H5C_validate_resize_config(). As H5AC_cache_config_t and + * H5C_auto_size_ctl_t diverge, we may have to change this. * * Return: Non-negative on success/Negative on failure * @@ -1914,7 +2082,7 @@ H5AC_validate_config(H5AC_cache_config_t *config_ptr) /* don't bother to test trace_file_name unless open_trace_file is TRUE */ if(config_ptr->open_trace_file) { - size_t name_len; + size_t name_len; /* Can't really test the trace_file_name field without trying to * open the file, so we will content ourselves with a couple of @@ -1957,17 +2125,17 @@ done: * Function: H5AC_validate_cache_image_config() * * Purpose: Run a sanity check on the contents of the supplied - * instance of H5AC_cache_image_config_t. + * instance of H5AC_cache_image_config_t. * * Do nothing and return SUCCEED if no errors are detected, * and flag an error and return FAIL otherwise. * - * At present, this function operates by packing the data - * from the instance of H5AC_cache_image_config_t into an - * instance of H5C_cache_image_ctl_t, and then calling - * H5C_validate_cache_image_config(). If and when + * At present, this function operates by packing the data + * from the instance of H5AC_cache_image_config_t into an + * instance of H5C_cache_image_ctl_t, and then calling + * H5C_validate_cache_image_config(). If and when * H5AC_cache_image_config_t and H5C_cache_image_ctl_t - * diverge, we may have to change this. + * diverge, we may have to change this. * * Return: Non-negative on success/Negative on failure * @@ -2013,13 +2181,13 @@ done: * Function: H5AC__check_if_write_permitted * * Purpose: Determine if a write is permitted under the current - * circumstances, and set *write_permitted_ptr accordingly. - * As a general rule it is, but when we are running in parallel - * mode with collective I/O, we must ensure that a read cannot - * cause a write. + * circumstances, and set *write_permitted_ptr accordingly. + * As a general rule it is, but when we are running in parallel + * mode with collective I/O, we must ensure that a read cannot + * cause a write. * - * In the event of failure, the value of *write_permitted_ptr - * is undefined. + * In the event of failure, the value of *write_permitted_ptr + * is undefined. * * Return: Non-negative on success/Negative on failure. * @@ -2035,9 +2203,9 @@ H5_ATTR_UNUSED *f, hbool_t *write_permitted_ptr) { #ifdef H5_HAVE_PARALLEL - H5AC_aux_t * aux_ptr = NULL; + H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ - hbool_t write_permitted = TRUE; + hbool_t write_permitted = TRUE; FUNC_ENTER_STATIC_NOERR @@ -2051,9 +2219,9 @@ H5_ATTR_UNUSED HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); if((aux_ptr->mpi_rank == 0) || (aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED)) - write_permitted = aux_ptr->write_permitted; + write_permitted = aux_ptr->write_permitted; else - write_permitted = FALSE; + write_permitted = FALSE; } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -2067,12 +2235,12 @@ H5_ATTR_UNUSED * Function: H5AC__ext_config_2_int_config() * * Purpose: Utility function to translate an instance of - * H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t. + * H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t. * - * Places translation in *int_conf_ptr and returns SUCCEED - * if successful. Returns FAIL on failure. + * Places translation in *int_conf_ptr and returns SUCCEED + * if successful. Returns FAIL on failure. * - * Does only minimal sanity checking. + * Does only minimal sanity checking. * * Return: Non-negative on success/Negative on failure * @@ -2453,7 +2621,7 @@ done: * Purpose: Given a file address, retrieve the ring for an entry at that * address. * - * On error, the value of *ring is not modified. + * On error, the value of *ring is not modified. * * Return: Non-negative on success/Negative on failure * @@ -2531,11 +2699,11 @@ H5AC_set_ring(H5AC_ring_t ring, H5AC_ring_t *orig_ring) * are in the process of a file shutdown, post an error * message, and return FAIL. * - * Note that this function simply passes the call on to - * the metadata cache proper, and returns the result. + * Note that this function simply passes the call on to + * the metadata cache proper, and returns the result. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * September 17, 2016 @@ -2608,7 +2776,7 @@ done: * Function: H5AC_remove_entry() * * Purpose: Remove an entry from the cache. Must be not protected, pinned, - * dirty, involved in flush dependencies, etc. + * dirty, involved in flush dependencies, etc. * * Return: Non-negative on success/Negative on failure * @@ -2669,4 +2837,3 @@ H5AC_get_mdc_image_info(H5AC_t *cache_ptr, haddr_t *image_addr, hsize_t *image_l done: FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_get_mdc_image_info() */ - diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index f097e83..1c914b0 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -791,7 +791,7 @@ H5AC__log_dirtied_entry(const H5AC_info_t *entry_ptr) else { aux_ptr->dirty_bytes += entry_ptr->size; #if H5AC_DEBUG_DIRTY_BYTES_CREATION - aux_ptr->unprotect_dirty_bytes += entry_size; + aux_ptr->unprotect_dirty_bytes += entry_ptr->size; aux_ptr->unprotect_dirty_bytes_updates += 1; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ } /* end else */ @@ -989,7 +989,7 @@ H5AC__log_inserted_entry(const H5AC_info_t *entry_ptr) aux_ptr->dirty_bytes += entry_ptr->size; #if H5AC_DEBUG_DIRTY_BYTES_CREATION - aux_ptr->insert_dirty_bytes += size; + aux_ptr->insert_dirty_bytes += entry_ptr->size; aux_ptr->insert_dirty_bytes_updates += 1; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ @@ -1875,6 +1875,8 @@ done: * Programmer: John Mainzer * April 28, 2010 * + * Changes: None. + * *------------------------------------------------------------------------- */ static herr_t @@ -1894,7 +1896,8 @@ H5AC__rsp__p0_only__flush(H5F_t *f) aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); HDassert(aux_ptr != NULL); HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); - HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY); + HDassert(aux_ptr->metadata_write_strategy == \ + H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY); /* To prevent "messages from the future" we must * synchronize all processes before we start the flush. @@ -1903,9 +1906,12 @@ H5AC__rsp__p0_only__flush(H5F_t *f) * However, when flushing from within the close operation from a file, * it's possible to skip this barrier (on the second flush of the cache). */ - if(!H5CX_get_mpi_file_flushing()) - if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm))) + if ( ! H5CX_get_mpi_file_flushing() ) { + + if ( MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm)) ) + HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result) + } /* Flush data to disk, from rank 0 process */ if(aux_ptr->mpi_rank == 0) { @@ -1921,23 +1927,30 @@ H5AC__rsp__p0_only__flush(H5F_t *f) aux_ptr->write_permitted = FALSE; /* Check for error on the write operation */ - if(result < 0) + if ( result < 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.") /* this code exists primarily for the test bed -- it allows us to * enforce POSIX semantics on the server that pretends to be a * file system in our parallel tests. */ - if(aux_ptr->write_done) + if ( aux_ptr->write_done ) { + (aux_ptr->write_done)(); + } } /* end if */ /* Propagate cleaned entries to other ranks. */ - if(H5AC__propagate_flushed_and_still_clean_entries_list(f) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.") + if ( H5AC__propagate_flushed_and_still_clean_entries_list(f) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "Can't propagate clean entries list.") done: + FUNC_LEAVE_NOAPI(ret_value) + } /* H5AC__rsp__p0_only__flush() */ @@ -2104,16 +2117,22 @@ H5AC__run_sync_point(H5F_t *f, int sync_point_op) /* Sanity checks */ HDassert(f != NULL); + cache_ptr = f->shared->cache; + HDassert(cache_ptr != NULL); + aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); + HDassert(aux_ptr != NULL); HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); HDassert((sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) || - (sync_point_op == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED)); + (sync_point_op == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED)); + #if H5AC_DEBUG_DIRTY_BYTES_CREATION -HDfprintf(stdout, "%d:H5AC_propagate...:%u: (u/uu/i/iu/r/ru) = %zu/%u/%zu/%u/%zu/%u\n", +HDfprintf(stdout, + "%d:H5AC_propagate...:%u: (u/uu/i/iu/r/ru) = %zu/%u/%zu/%u/%zu/%u\n", aux_ptr->mpi_rank, aux_ptr->dirty_bytes_propagations, aux_ptr->unprotect_dirty_bytes, @@ -2188,6 +2207,7 @@ HDfprintf(stdout, "%d:H5AC_propagate...:%u: (u/uu/i/iu/r/ru) = %zu/%u/%zu/%u/%zu #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ done: + FUNC_LEAVE_NOAPI(ret_value) } /* H5AC__run_sync_point() */ diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index b932e16..21e7396 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -387,6 +387,8 @@ H5_DLL herr_t H5AC_insert_entry(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned int flags); H5_DLL herr_t H5AC_pin_protected_entry(void *thing); H5_DLL herr_t H5AC_prep_for_file_close(H5F_t *f); +H5_DLL herr_t H5AC_prep_for_file_flush(H5F_t *f); +H5_DLL herr_t H5AC_secure_from_file_flush(H5F_t *f); H5_DLL herr_t H5AC_create_flush_dependency(void *parent_thing, void *child_thing); H5_DLL void * H5AC_protect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *udata, unsigned flags); diff --git a/src/H5C.c b/src/H5C.c index 91e4158..b70c6dc 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -237,6 +237,82 @@ H5FL_SEQ_DEFINE_STATIC(H5C_cache_entry_ptr_t); * Programmer: John Mainzer * 6/2/04 * + * Modifications: + * + * JRM -- 7/20/04 + * Updated for the addition of the hash table. + * + * JRM -- 10/5/04 + * Added call to H5C_reset_cache_hit_rate_stats(). Also + * added initialization for cache_is_full flag and for + * resize_ctl. + * + * JRM -- 11/12/04 + * Added initialization for the new size_decreased field. + * + * JRM -- 11/17/04 + * Added/updated initialization for the automatic cache + * size control data structures. + * + * JRM -- 6/24/05 + * Added support for the new write_permitted field of + * the H5C_t structure. + * + * JRM -- 7/5/05 + * Added the new log_flush parameter and supporting code. + * + * JRM -- 9/21/05 + * Added the new aux_ptr parameter and supporting code. + * + * JRM -- 1/20/06 + * Added initialization of the new prefix field in H5C_t. + * + * JRM -- 3/16/06 + * Added initialization for the pinned entry related fields. + * + * JRM -- 5/31/06 + * Added initialization for the trace_file_ptr field. + * + * JRM -- 8/19/06 + * Added initialization for the flush_in_progress field. + * + * JRM -- 8/25/06 + * Added initialization for the slist_len_increase and + * slist_size_increase fields. These fields are used + * for sanity checking in the flush process, and are not + * compiled in unless H5C_DO_SANITY_CHECKS is TRUE. + * + * JRM -- 3/28/07 + * Added initialization for the new is_read_only and + * ro_ref_count fields. + * + * JRM -- 7/27/07 + * Added initialization for the new evictions_enabled + * field of H5C_t. + * + * JRM -- 12/31/07 + * Added initialization for the new flash cache size increase + * related fields of H5C_t. + * + * JRM -- 11/5/08 + * Added initialization for the new clean_index_size and + * dirty_index_size fields of H5C_t. + * + * + * Missing entries? + * + * + * JRM -- 4/20/20 + * Added initialization for the slist_enabled field. Recall + * that the slist is used to flush metadata cache entries + * in (roughly) increasing address order. While this is + * needed at flush and close, it is not used elsewhere. + * The slist_enabled field exists to allow us to construct + * the slist when needed, and leave it empty otherwise -- thus + * avoiding the overhead of maintaining it. + * + * JRM -- 4/29/20 + * *------------------------------------------------------------------------- */ H5C_t * @@ -332,10 +408,16 @@ H5C_create(size_t max_cache_size, cache_ptr->ignore_tags = FALSE; cache_ptr->num_objs_corked = 0; + /* slist field initializations */ + cache_ptr->slist_enabled = ! H5C__SLIST_OPT_ENABLED; cache_ptr->slist_changed = FALSE; cache_ptr->slist_len = 0; cache_ptr->slist_size = (size_t)0; + /* slist_ring_len, slist_ring_size, and + * slist_ptr initializaed above. + */ + #if H5C_DO_SANITY_CHECKS cache_ptr->slist_len_increase = 0; cache_ptr->slist_size_increase = 0; @@ -828,6 +910,20 @@ done: * Programmer: John Mainzer * 6/2/04 * + * Modifications: + * + * JRM -- 5/15/20 + * + * Updated the function to enable the slist prior to the + * call to H5C__flush_invalidate_cache(). + * + * Arguably, it shouldn't be necessary to re-enable the + * slist after the call to H5C__flush_invalidate_cache(), as + * the metadata cache should be discarded. However, in the + * test code, we make multiple calls to H5C_dest(). Thus + * we re-enable the slist on failure if it and the cache + * still exist. + * *------------------------------------------------------------------------- */ herr_t @@ -848,33 +944,60 @@ H5C_dest(H5F_t * f) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't display cache image stats") #endif /* H5AC_DUMP_IMAGE_STATS_ON_CLOSE */ + /* Enable the slist, as it is needed in the flush */ + if ( H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist enabled failed") + /* Flush and invalidate all cache entries */ - if(H5C__flush_invalidate_cache(f, H5C__NO_FLAGS_SET) < 0 ) + if ( H5C__flush_invalidate_cache(f, H5C__NO_FLAGS_SET) < 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") /* Generate & write cache image if requested */ - if(cache_ptr->image_ctl.generate_image) - if(H5C__generate_cache_image(f, cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "Can't generate metadata cache image") + if ( cache_ptr->image_ctl.generate_image ) { + + if ( H5C__generate_cache_image(f, cache_ptr) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, \ + "Can't generate metadata cache image") + } + + /* Question: Is it possible for cache_ptr->slist be non-null at this + * point? If no, shouldn't this if statement be an assert? + */ + if ( cache_ptr->slist_ptr != NULL ) { + + HDassert(cache_ptr->slist_len == 0); + HDassert(cache_ptr->slist_size == 0); - if(cache_ptr->slist_ptr != NULL) { H5SL_close(cache_ptr->slist_ptr); + cache_ptr->slist_ptr = NULL; + } /* end if */ if(cache_ptr->tag_list != NULL) { + H5SL_destroy(cache_ptr->tag_list, H5C_free_tag_list_cb, NULL); cache_ptr->tag_list = NULL; + } /* end if */ - if(cache_ptr->log_info != NULL) + if(cache_ptr->log_info != NULL) { + H5MM_xfree(cache_ptr->log_info); + } #ifndef NDEBUG #if H5C_DO_SANITY_CHECKS - if(cache_ptr->get_entry_ptr_from_addr_counter > 0) - HDfprintf(stdout, "*** %ld calls to H5C_get_entry_ptr_from_add(). ***\n", - cache_ptr->get_entry_ptr_from_addr_counter); + + if ( cache_ptr->get_entry_ptr_from_addr_counter > 0 ) { + + HDfprintf(stdout, + "*** %ld calls to H5C_get_entry_ptr_from_add(). ***\n", + cache_ptr->get_entry_ptr_from_addr_counter); + } #endif /* H5C_DO_SANITY_CHECKS */ cache_ptr->magic = 0; @@ -883,7 +1006,19 @@ H5C_dest(H5F_t * f) cache_ptr = H5FL_FREE(H5C_t, cache_ptr); done: + + if ( ( ret_value < 0 ) && ( cache_ptr ) && ( cache_ptr->slist_ptr ) ) { + + /* need this for test code -- see change note for details */ + + if ( H5C_set_slist_enabled(f->shared->cache, FALSE, FALSE) < 0 ) + + HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "disable slist on flush dest failure failed") + } + FUNC_LEAVE_NOAPI(ret_value) + } /* H5C_dest() */ @@ -897,6 +1032,14 @@ done: * Programmer: Vailin Choi * Dec 2013 * + * Modifications: + * + * JRM -- 5/5/20 + * + * Added code to enable the skip list prior to the call + * to H5C__flush_invalidate_cache(), and disable it + * afterwards. + * *------------------------------------------------------------------------- */ herr_t @@ -909,9 +1052,23 @@ H5C_evict(H5F_t * f) /* Sanity check */ HDassert(f); + /* Enable the slist, as it is needed in the flush */ + if ( H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist enabled failed") + + /* Flush and invalidate all cache entries except the pinned entries */ - if(H5C__flush_invalidate_cache(f, H5C__EVICT_ALLOW_LAST_PINS_FLAG) < 0 ) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict entries in the cache") + if ( H5C__flush_invalidate_cache(f, H5C__EVICT_ALLOW_LAST_PINS_FLAG) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, + "unable to evict entries in the cache") + + /* Disable the slist, + */ + if ( H5C_set_slist_enabled(f->shared->cache, FALSE, TRUE) < 0) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist disabled failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2879,6 +3036,179 @@ done: /*------------------------------------------------------------------------- + * + * Function: H5C_set_slist_enabled() + * + * Purpose: Enable or disable the slist as directed. + * + * The slist (skip list) is an address ordered list of + * dirty entries in the metadata cache. However, this + * list is only needed during flush and close, where we + * use it to write entries in more or less increasing + * address order. + * + * This function sets up and enables further operations + * on the slist, or disable the slist. This in turn + * allows us to avoid the overhead of maintaining the + * slist when it is not needed. + * + * + * If the slist_enabled parameter is TRUE, the function + * + * 1) Verifies that the slist is empty. + * + * 2) Scans the index list, and inserts all dirty entries + * into the slist. + * + * 3) Sets cache_ptr->slist_enabled = TRUE. + * + * Note that the clear_slist parameter is ignored if + * the slist_enabed parameter is TRUE. + * + * + * If the slist_enabled_parameter is FALSE, the function + * shuts down the slist. + * + * Normally the slist will be empty at this point, however + * that need not be the case if H5C_flush_cache() has been + * called with the H5C__FLUSH_MARKED_ENTRIES_FLAG. + * + * Thus shutdown proceeds as follows: + * + * 1) Test to see if the slist is empty. If it is, proceed + * to step 3. + * + * 2) Test to see if the clear_slist parameter is TRUE. + * + * If it is, remove all entries from the slist. + * + * If it isn't, throw an error. + * + * 3) set cache_ptr->slist_enabled = FALSE. + * + * Return: SUCCEED on success, and FAIL on failure. + * + * Programmer: John Mainzer + * 5/1/20 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ +herr_t +H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, + hbool_t clear_slist) +{ + H5C_cache_entry_t * entry_ptr; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + if ( ( cache_ptr == NULL ) || ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry") + +#if H5C__SLIST_OPT_ENABLED + + if ( slist_enabled ) { + + if ( cache_ptr->slist_enabled ) { + + HDassert(FALSE); + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist already enabled?") + } + + if ( ( cache_ptr->slist_len != 0 ) || + ( cache_ptr->slist_size != 0 ) ) { + + HDassert(FALSE); + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist not empty (1)?") + } + + + /* set cache_ptr->slist_enabled to TRUE so that the slist + * mainenance macros will be enabled. + */ + cache_ptr->slist_enabled = TRUE; + + + /* scan the index list and insert all dirty entries in the slist */ + entry_ptr = cache_ptr->il_head; + + while ( entry_ptr != NULL ) { + + HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); + + if ( entry_ptr->is_dirty ) { + + H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) + } + + entry_ptr = entry_ptr->il_next; + } + + /* we don't maintain a dirty index len, so we can't do a cross + * check against it. Note that there is no point in cross checking + * against the dirty LRU size, as the dirty LRU may not be maintained, + * and in any case, there is no requirement that all dirty entries + * will reside on the dirty LRU. + */ + HDassert( cache_ptr->dirty_index_size == cache_ptr->slist_size ); + + } else { /* take down the skip list */ + + if ( ! cache_ptr->slist_enabled ) { + + HDassert(FALSE); + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist already disabled?") + } + + if ( ( cache_ptr->slist_len != 0 ) || + ( cache_ptr->slist_size != 0 ) ) { + + if ( clear_slist ) { + + H5SL_node_t *node_ptr; + + node_ptr = H5SL_first(cache_ptr->slist_ptr); + + while ( node_ptr != NULL ) { + + entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); + + H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, FALSE); + + node_ptr = H5SL_first(cache_ptr->slist_ptr); + } + } else { + + HDassert(FALSE); + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist not empty (2)?") + } + } + + cache_ptr->slist_enabled = FALSE; + + HDassert( 0 == cache_ptr->slist_len ); + HDassert( 0 == cache_ptr->slist_size ); + } + +#else /* H5C__SLIST_OPT_ENABLED is FALSE */ + + HDassert(cache_ptr->slist_enabled); + +#endif /* H5C__SLIST_OPT_ENABLED is FALSE */ + +done: + + FUNC_LEAVE_NOAPI(ret_value) + +} /* H5C_set_slist_enabled() */ + + +/*------------------------------------------------------------------------- * Function: H5C_unpin_entry() * * Purpose: Unpin a cache entry. The entry can be either protected or @@ -2890,7 +3220,7 @@ done: * 3/22/06 * * Changes: Added extreme sanity checks on entry and exit. - JRM -- 4/26/14 + * JRM -- 4/26/14 * *------------------------------------------------------------------------- */ @@ -2956,6 +3286,81 @@ done: * Programmer: John Mainzer * 6/2/04 * + * Modifications: + * + * JRM -- 7/21/04 + * Updated for the addition of the hash table. + * + * JRM -- 10/28/04 + * Added code to set cache_full to TRUE whenever we try to + * make space in the cache. + * + * JRM -- 11/12/04 + * Added code to call to H5C_make_space_in_cache() after the + * call to H5C__auto_adjust_cache_size() if that function + * sets the size_decreased flag is TRUE. + * + * JRM -- 4/25/05 + * The size_decreased flag can also be set to TRUE in + * H5C_set_cache_auto_resize_config() if a new configuration + * forces an immediate reduction in cache size. Modified + * the code to deal with this eventuallity. + * + * JRM -- 6/24/05 + * Added support for the new write_permitted field of H5C_t. + * + * JRM -- 10/22/05 + * Hand optimizations. + * + * JRM -- 5/3/06 + * Added code to set the new dirtied field in + * H5C_cache_entry_t to FALSE prior to return. + * + * JRM -- 6/23/06 + * Modified code to allow dirty entries to be loaded from + * disk. This is necessary as a bug fix in the object + * header code requires us to modify a header as it is read. + * + * JRM -- 3/28/07 + * Added the flags parameter and supporting code. At least + * for now, this parameter is used to allow the entry to + * be protected read only, thus allowing multiple protects. + * + * Also added code to allow multiple read only protects + * of cache entries. + * + * JRM -- 7/27/07 + * Added code supporting the new evictions_enabled field + * in H5C_t. + * + * JRM -- 1/3/08 + * Added to do a flash cache size increase if appropriate + * when a large entry is loaded. + * + * JRM -- 11/13/08 + * Modified function to call H5C_make_space_in_cache() when + * the min_clean_size is violated, not just when there isn't + * enough space for and entry that has just been loaded. + * + * The purpose of this modification is to avoid "metadata + * blizzards" in the write only case. In such instances, + * the cache was allowed to fill with dirty metadata. When + * we finally needed to evict an entry to make space, we had + * to flush out a whole cache full of metadata -- which has + * interesting performance effects. We hope to avoid (or + * perhaps more accurately hide) this effect by maintaining + * the min_clean_size, which should force us to start flushing + * entries long before we actually have to evict something + * to make space. + * + * + * Missing entries? + * + * + * JRM -- 5/8/20 + * Updated for the possibility that the slist will be + * disabled. + * *------------------------------------------------------------------------- */ herr_t @@ -2997,9 +3402,15 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) HDassert( H5F_addr_defined(addr) ); HDassert( thing ); HDassert( ! ( pin_entry && unpin_entry ) ); - HDassert( ( ! free_file_space ) || ( deleted ) ); /* deleted flag must accompany free_file_space */ - HDassert( ( ! take_ownership ) || ( deleted ) ); /* deleted flag must accompany take_ownership */ - HDassert( ! ( free_file_space && take_ownership ) ); /* can't have both free_file_space & take_ownership */ + + /* deleted flag must accompany free_file_space */ + HDassert( ( ! free_file_space ) || ( deleted ) ); + + /* deleted flag must accompany take_ownership */ + HDassert( ( ! take_ownership ) || ( deleted ) ); + + /* can't have both free_file_space & take_ownership */ + HDassert( ! ( free_file_space && take_ownership ) ); entry_ptr = (H5C_cache_entry_t *)thing; @@ -3012,47 +3423,65 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) was_clean = ! ( entry_ptr->is_dirty ); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /* if the entry has multiple read only protects, just decrement * the ro_ref_counter. Don't actually unprotect until the ref count * drops to zero. */ - if(entry_ptr->ro_ref_count > 1) { + if ( entry_ptr->ro_ref_count > 1 ) { + /* Sanity check */ HDassert(entry_ptr->is_protected); HDassert(entry_ptr->is_read_only); - if(dirtied) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Read only entry modified??") + if ( dirtied ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ + "Read only entry modified??") /* Reduce the RO ref count */ (entry_ptr->ro_ref_count)--; /* Pin or unpin the entry as requested. */ - if(pin_entry) { + if ( pin_entry ) { + /* Pin the entry from a client */ - if(H5C__pin_entry_from_client(cache_ptr, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client") - } else if(unpin_entry) { + if ( H5C__pin_entry_from_client(cache_ptr, entry_ptr) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, \ + "Can't pin entry by client") + + } else if ( unpin_entry ) { + /* Unpin the entry from a client */ - if(H5C__unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry by client") + if ( H5C__unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, \ + "Can't unpin entry by client") + } /* end if */ } else { - if(entry_ptr->is_read_only) { + + if ( entry_ptr->is_read_only ) { + /* Sanity check */ HDassert(entry_ptr->ro_ref_count == 1); - if(dirtied) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Read only entry modified??") + if ( dirtied ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ + "Read only entry modified??") entry_ptr->is_read_only = FALSE; entry_ptr->ro_ref_count = 0; + } /* end if */ #ifdef H5_HAVE_PARALLEL @@ -3081,63 +3510,102 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) } /* end if */ #endif /* H5_HAVE_PARALLEL */ - if(!entry_ptr->is_protected) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Entry already unprotected??") + if ( ! entry_ptr->is_protected ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ + "Entry already unprotected??") /* Mark the entry as dirty if appropriate */ entry_ptr->is_dirty = (entry_ptr->is_dirty || dirtied); - if(dirtied) - if(entry_ptr->image_up_to_date) { + if ( dirtied ) { + + if ( entry_ptr->image_up_to_date ) { + entry_ptr->image_up_to_date = FALSE; - if(entry_ptr->flush_dep_nparents > 0) - if(H5C__mark_flush_dep_unserialized(entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "Can't propagate serialization status to fd parents") + + if ( entry_ptr->flush_dep_nparents > 0 ) { + + if ( H5C__mark_flush_dep_unserialized(entry_ptr) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ + "Can't propagate serialization status to fd parents") + + } /* end if */ } /* end if */ + } /* end if */ /* Check for newly dirtied entry */ - if(was_clean && entry_ptr->is_dirty) { + if ( was_clean && entry_ptr->is_dirty ) { + /* Update index for newly dirtied entry */ H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr) - /* If the entry's type has a 'notify' callback send a 'entry dirtied' - * notice now that the entry is fully integrated into the cache. + /* If the entry's type has a 'notify' callback send a + * 'entry dirtied' notice now that the entry is fully + * integrated into the cache. */ - if(entry_ptr->type->notify && - (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_DIRTIED, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client about entry dirty flag set") + if ( ( entry_ptr->type->notify ) && + ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_DIRTIED, + entry_ptr) < 0 ) ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ + "can't notify client about entry dirty flag set") /* Propagate the flush dep dirty flag up the flush dependency chain - * if appropriate */ - if(entry_ptr->flush_dep_nparents > 0) - if(H5C__mark_flush_dep_dirty(entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Can't propagate flush dep dirty flag") + * if appropriate + */ + if ( entry_ptr->flush_dep_nparents > 0 ) { + + if ( H5C__mark_flush_dep_dirty(entry_ptr) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ + "Can't propagate flush dep dirty flag") + } } /* end if */ /* Check for newly clean entry */ - else if(!was_clean && !entry_ptr->is_dirty) { - /* If the entry's type has a 'notify' callback send a 'entry cleaned' - * notice now that the entry is fully integrated into the cache. + else if ( ! was_clean && ! entry_ptr->is_dirty ) { + + /* If the entry's type has a 'notify' callback send a + * 'entry cleaned' notice now that the entry is fully + * integrated into the cache. */ - if(entry_ptr->type->notify && - (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_CLEANED, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client about entry dirty flag cleared") + if ( ( entry_ptr->type->notify ) && + ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_CLEANED, + entry_ptr) < 0 ) ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ + "can't notify client about entry dirty flag cleared") /* Propagate the flush dep clean flag up the flush dependency chain - * if appropriate */ - if(entry_ptr->flush_dep_nparents > 0) - if(H5C__mark_flush_dep_clean(entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Can't propagate flush dep dirty flag") + * if appropriate + */ + if ( entry_ptr->flush_dep_nparents > 0 ) { + + if ( H5C__mark_flush_dep_clean(entry_ptr) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ + "Can't propagate flush dep dirty flag") + + } } /* end else-if */ /* Pin or unpin the entry as requested. */ - if(pin_entry) { + if ( pin_entry ) { + /* Pin the entry from a client */ - if(H5C__pin_entry_from_client(cache_ptr, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client") - } else if(unpin_entry) { + if ( H5C__pin_entry_from_client(cache_ptr, entry_ptr) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, \ + "Can't pin entry by client") + + } else if ( unpin_entry ) { + /* Unpin the entry from a client */ - if(H5C__unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry by client") + if ( H5C__unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, \ + "Can't unpin entry by client") } /* end if */ /* H5C__UPDATE_RP_FOR_UNPROTECT will place the unprotected entry on @@ -3150,10 +3618,15 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) /* if the entry is dirty, 'or' its flush_marker with the set flush flag, * and then add it to the skip list if it isn't there already. */ - if(entry_ptr->is_dirty) { + if ( entry_ptr->is_dirty ) { + entry_ptr->flush_marker |= set_flush_marker; - if(!entry_ptr->in_slist) + + if ( !entry_ptr->in_slist ) { + + /* this is a no-op if cache_ptr->slist_enabled is FALSE */ H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) + } } /* end if */ /* this implementation of the "deleted" option is a bit inefficient, as @@ -3165,44 +3638,72 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) * makes good use of existing code. * JRM - 5/19/04 */ - if(deleted) { - unsigned flush_flags = (H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_INVALIDATE_FLAG); + if ( deleted ) { + + unsigned flush_flags = (H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_INVALIDATE_FLAG); /* verify that the target entry is in the cache. */ H5C__SEARCH_INDEX(cache_ptr, addr, test_entry_ptr, FAIL) - if(test_entry_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "entry not in hash table?!?") - else if(test_entry_ptr != entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "hash table contains multiple entries for addr?!?") + + if ( test_entry_ptr == NULL ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ + "entry not in hash table?!?") + + else if ( test_entry_ptr != entry_ptr ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ + "hash table contains multiple entries for addr?!?") /* Set the 'free file space' flag for the flush, if needed */ - if(free_file_space) + if ( free_file_space ) { + flush_flags |= H5C__FREE_FILE_SPACE_FLAG; + } /* Set the "take ownership" flag for the flush, if needed */ - if(take_ownership) + if ( take_ownership ) { + flush_flags |= H5C__TAKE_OWNERSHIP_FLAG; + } /* Delete the entry from the skip list on destroy */ flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; - HDassert(((!was_clean) || dirtied) == entry_ptr->in_slist); - if(H5C__flush_single_entry(f, entry_ptr, flush_flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't flush entry") + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( ( ( ! was_clean ) || dirtied ) == \ + ( entry_ptr->in_slist ) ) ); + + if ( H5C__flush_single_entry(f, entry_ptr, flush_flags) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ + "Can't flush entry") + } /* end if */ #ifdef H5_HAVE_PARALLEL - else if(clear_entry) { + else if ( clear_entry ) { /* verify that the target entry is in the cache. */ H5C__SEARCH_INDEX(cache_ptr, addr, test_entry_ptr, FAIL) - if(test_entry_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "entry not in hash table?!?") - else if(test_entry_ptr != entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "hash table contains multiple entries for addr?!?") - if(H5C__flush_single_entry(f, entry_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't clear entry") + if ( test_entry_ptr == NULL ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ + "entry not in hash table?!?") + + else if ( test_entry_ptr != entry_ptr ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ + "hash table contains multiple entries for addr?!?") + + if ( H5C__flush_single_entry(f, entry_ptr, + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ + "Can't clear entry") + } /* end else if */ #endif /* H5_HAVE_PARALLEL */ } @@ -3210,14 +3711,18 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) done: + #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) { - HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) { + + HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) + } /* H5C_unprotect() */ @@ -5035,6 +5540,7 @@ done: /*------------------------------------------------------------------------- + * * Function: H5C__flush_invalidate_cache * * Purpose: Flush and destroy the entries contained in the target @@ -5064,6 +5570,51 @@ done: * Programmer: John Mainzer * 3/24/065 * + * Modifications: + * + * To support the fractal heap, the cache must now deal with + * entries being dirtied, resized, and/or renamed inside + * flush callbacks. Updated function to support this. + * + * -- JRM 8/27/06 + * + * Added code to detect and manage the case in which a + * flush callback changes the s-list out from under + * the function. The only way I can think of in which this + * can happen is if a flush function loads an entry + * into the cache that isn't there already. Quincey tells + * me that this will never happen, but I'm not sure I + * believe him. + * + * Note that this is a pretty bad scenario if it ever + * happens. The code I have added should allow us to + * handle the situation under all but the worst conditions, + * but one can argue that we should just scream and die if + * we ever detect the condidtion. + * + * -- JRM 10/13/07 + * + * Missing entries? + * + * + * Added support for the H5C__EVICT_ALLOW_LAST_PINS_FLAG. + * This flag is used to flush and evict all entries in + * the metadata cache that are not pinned -- typically, + * everything other than the superblock. + * + * ??? -- ??/??/?? + * + * Added sanity checks to verify that the skip list is + * enabled on entry. On the face of it, it would make + * sense to enable the slist on entry, and disable it + * on exit, as this function is not called repeatedly. + * However, since this function can be called from + * H5C_flush_cache(), this would create cases in the test + * code where we would have to check the flags to determine + * whether we must setup and take down the slist. + * + * JRM -- 5/5/20 + * *------------------------------------------------------------------------- */ static herr_t @@ -5081,6 +5632,7 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(cache_ptr->slist_ptr); + HDassert(cache_ptr->slist_enabled); #if H5C_DO_SANITY_CHECKS { @@ -5099,7 +5651,8 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) HDassert(cache_ptr->slist_ring_len[H5C_RING_UNDEFINED] == 0); HDassert(cache_ptr->slist_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - for(i = H5C_RING_USER; i < H5C_RING_NTYPES; i++) { + for ( i = H5C_RING_USER; i < H5C_RING_NTYPES; i++ ) { + index_len += cache_ptr->index_ring_len[i]; index_size += cache_ptr->index_ring_size[i]; clean_index_size += cache_ptr->clean_index_ring_size[i]; @@ -5107,6 +5660,7 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) slist_len += cache_ptr->slist_ring_len[i]; slist_size += cache_ptr->slist_ring_size[i]; + } /* end for */ HDassert(cache_ptr->index_len == index_len); @@ -5119,49 +5673,68 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) #endif /* H5C_DO_SANITY_CHECKS */ /* remove ageout markers if present */ - if(cache_ptr->epoch_markers_active > 0) - if(H5C__autoadjust__ageout__remove_all_markers(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error removing all epoch markers") + if ( cache_ptr->epoch_markers_active > 0 ) { + + if ( H5C__autoadjust__ageout__remove_all_markers(cache_ptr) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "error removing all epoch markers") + } /* flush invalidate each ring, starting from the outermost ring and * working inward. */ ring = H5C_RING_USER; - while(ring < H5C_RING_NTYPES) { + + while ( ring < H5C_RING_NTYPES) { + if(H5C_flush_invalidate_ring(f, ring, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate ring failed") + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, + "flush invalidate ring failed") ring++; + } /* end while */ /* Invariants, after destroying all entries in the hash table */ - if(!(flags & H5C__EVICT_ALLOW_LAST_PINS_FLAG)) { + if( ! ( flags & H5C__EVICT_ALLOW_LAST_PINS_FLAG ) ) { + HDassert(cache_ptr->index_size == 0); HDassert(cache_ptr->clean_index_size == 0); HDassert(cache_ptr->pel_len == 0); HDassert(cache_ptr->pel_size == 0); + } /* end if */ else { + H5C_cache_entry_t *entry_ptr; /* Cache entry */ unsigned u; /* Local index variable */ /* All rings except ring 4 should be empty now */ /* (Ring 4 has the superblock) */ - for(u = H5C_RING_USER; u < H5C_RING_SB; u++) { + for ( u = H5C_RING_USER; u < H5C_RING_SB; u++ ) { + HDassert(cache_ptr->index_ring_len[u] == 0); HDassert(cache_ptr->index_ring_size[u] == 0); HDassert(cache_ptr->clean_index_ring_size[u] == 0); + } /* end for */ /* Check that any remaining pinned entries are in the superblock ring */ + entry_ptr = cache_ptr->pel_head_ptr; + while(entry_ptr) { + /* Check ring */ HDassert(entry_ptr->ring == H5C_RING_SB); /* Advance to next entry in pinned entry list */ entry_ptr = entry_ptr->next; + } /* end while */ } /* end else */ + HDassert(cache_ptr->dirty_index_size == 0); HDassert(cache_ptr->slist_len == 0); HDassert(cache_ptr->slist_size == 0); @@ -5171,7 +5744,9 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) HDassert(cache_ptr->LRU_list_size == 0); done: + FUNC_LEAVE_NOAPI(ret_value) + } /* H5C__flush_invalidate_cache() */ @@ -5209,6 +5784,20 @@ done: * Programmer: John Mainzer * 9/1/15 * + * Changes: Added support for the H5C__EVICT_ALLOW_LAST_PINS_FLAG. + * This flag is used to flush and evict all entries in + * the metadata cache that are not pinned -- typically, + * everything other than the superblock. + * + * ??? -- ??/??/?? + * + * A recent optimization turns off the slist unless a flush + * is in progress. This should not effect this function, as + * it is only called during a flush. Added an assertion to + * verify this. + * + * JRM -- 5/6/20 + * *------------------------------------------------------------------------- */ static herr_t @@ -5235,9 +5824,12 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) HDassert(f); HDassert(f->shared); + cache_ptr = f->shared->cache; + HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(cache_ptr->slist_enabled); HDassert(cache_ptr->slist_ptr); HDassert(ring > H5C_RING_UNDEFINED); HDassert(ring < H5C_RING_NTYPES); @@ -5279,19 +5871,25 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) */ /* compute the number of pinned entries in this ring */ + entry_ptr = cache_ptr->pel_head_ptr; cur_ring_pel_len = 0; - while(entry_ptr != NULL) { + + while ( entry_ptr != NULL ) { + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(entry_ptr->ring >= ring); if(entry_ptr->ring == ring) cur_ring_pel_len++; entry_ptr = entry_ptr->next; + } /* end while */ old_ring_pel_len = cur_ring_pel_len; + while(cache_ptr->index_ring_len[ring] > 0) { + /* first, try to flush-destroy any dirty entries. Do this by * making a scan through the slist. Note that new dirty entries * may be created by the flush call backs. Thus it is possible @@ -5334,25 +5932,33 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) /* this done, start the scan of the slist */ restart_slist_scan = TRUE; - while(restart_slist_scan || (node_ptr != NULL)) { - if(restart_slist_scan) { + + while ( restart_slist_scan || ( node_ptr != NULL ) ) { + + if ( restart_slist_scan ) { + restart_slist_scan = FALSE; /* Start at beginning of skip list */ node_ptr = H5SL_first(cache_ptr->slist_ptr); - if(node_ptr == NULL) + + if ( node_ptr == NULL ) /* the slist is empty -- break out of inner loop */ break; /* Get cache entry for this node */ next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - if(NULL == next_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") + + if ( NULL == next_entry_ptr ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "next_entry_ptr == NULL ?!?!") HDassert(next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(next_entry_ptr->is_dirty); HDassert(next_entry_ptr->in_slist); HDassert(next_entry_ptr->ring >= ring); + } /* end if */ entry_ptr = next_entry_ptr; @@ -5378,18 +5984,26 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) * from the slist. */ node_ptr = H5SL_next(node_ptr); + if(node_ptr != NULL) { + next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); + if(NULL == next_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "next_entry_ptr == NULL ?!?!") + HDassert(next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(next_entry_ptr->is_dirty); HDassert(next_entry_ptr->in_slist); HDassert(next_entry_ptr->ring >= ring); HDassert(entry_ptr != next_entry_ptr); } /* end if */ - else + else { + next_entry_ptr = NULL; + } /* Note that we now remove nodes from the slist as we flush * the associated entries, instead of leaving them there @@ -5401,22 +6015,31 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) * flush, we must keep the slist in canonical form at all * times. */ - if(((!entry_ptr->flush_me_last) || - ((entry_ptr->flush_me_last) && - (cache_ptr->num_last_entries >= cache_ptr->slist_len))) && - (entry_ptr->flush_dep_nchildren == 0) && - (entry_ptr->ring == ring)) { - if(entry_ptr->is_protected) { + if ( ( ( !entry_ptr->flush_me_last ) || + ( ( entry_ptr->flush_me_last ) && + ( cache_ptr->num_last_entries >= cache_ptr->slist_len ) ) + ) && + ( entry_ptr->flush_dep_nchildren == 0 ) && + ( entry_ptr->ring == ring ) ) { + + if ( entry_ptr->is_protected ) { + /* we have major problems -- but lets flush * everything we can before we flag an error. */ protected_entries++; + } /* end if */ - else if(entry_ptr->is_pinned) { - if(H5C__flush_single_entry(f, entry_ptr, H5C__DURING_FLUSH_FLAG) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty pinned entry flush failed") + else if ( entry_ptr->is_pinned ) { + + if ( H5C__flush_single_entry(f, entry_ptr, + H5C__DURING_FLUSH_FLAG) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "dirty pinned entry flush failed") + + if ( cache_ptr->slist_changed ) { - if(cache_ptr->slist_changed) { /* The slist has been modified by something * other than the simple removal of the * of the flushed entry after the flush. @@ -5427,13 +6050,22 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) restart_slist_scan = TRUE; cache_ptr->slist_changed = FALSE; H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr); + } /* end if */ } /* end else-if */ else { - if(H5C__flush_single_entry(f, entry_ptr, (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry flush destroy failed") - if(cache_ptr->slist_changed) { + if ( H5C__flush_single_entry(f, entry_ptr, + (cooked_flags | + H5C__DURING_FLUSH_FLAG | + H5C__FLUSH_INVALIDATE_FLAG | + H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) ) < 0) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, + "dirty entry flush destroy failed") + + if ( cache_ptr->slist_changed ) { + /* The slist has been modified by something * other than the simple removal of the * of the flushed entry after the flush. @@ -5459,9 +6091,15 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) * out from under us. */ - if(node_ptr == NULL) { - HDassert(cache_ptr->slist_len == (uint32_t)((int32_t)initial_slist_len + cache_ptr->slist_len_increase)); - HDassert(cache_ptr->slist_size == (size_t)((ssize_t)initial_slist_size + cache_ptr->slist_size_increase)); + if ( node_ptr == NULL ) { + + HDassert(cache_ptr->slist_len == + (uint32_t)((int32_t)initial_slist_len + + cache_ptr->slist_len_increase)); + + HDassert(cache_ptr->slist_size == + (size_t)((ssize_t)initial_slist_size + + cache_ptr->slist_size_increase)); } /* end if */ #endif /* H5C_DO_SANITY_CHECKS */ @@ -5485,7 +6123,9 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) cache_ptr->entries_relocated_counter = 0; next_entry_ptr = cache_ptr->il_head; - while(next_entry_ptr != NULL) { + + while ( next_entry_ptr != NULL ) { + entry_ptr = next_entry_ptr; HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(entry_ptr->ring >= ring); @@ -5494,18 +6134,28 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) HDassert((next_entry_ptr == NULL) || (next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC)); - if((!entry_ptr->flush_me_last || (entry_ptr->flush_me_last && cache_ptr->num_last_entries >= cache_ptr->slist_len)) - && entry_ptr->flush_dep_nchildren == 0 && entry_ptr->ring == ring) { - if(entry_ptr->is_protected) { + if ( ( ( ! entry_ptr->flush_me_last ) || + ( entry_ptr->flush_me_last && + ( cache_ptr->num_last_entries >= cache_ptr->slist_len ) ) + ) && + ( entry_ptr->flush_dep_nchildren == 0 ) && + ( entry_ptr->ring == ring ) ) { + + if ( entry_ptr->is_protected ) { + /* we have major problems -- but lets flush and * destroy everything we can before we flag an * error. */ protected_entries++; - if(!entry_ptr->in_slist) + + if ( ! entry_ptr->in_slist ) { + HDassert(!(entry_ptr->is_dirty)); + } } /* end if */ - else if(!(entry_ptr->is_pinned)) { + else if ( ! ( entry_ptr->is_pinned ) ) { + /* if *entry_ptr is dirty, it is possible * that one or more other entries may be * either removed from the cache, loaded @@ -5534,8 +6184,14 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) */ cache_ptr->entry_watched_for_removal = next_entry_ptr; - if(H5C__flush_single_entry(f, entry_ptr, (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Entry flush destroy failed") + if ( H5C__flush_single_entry(f, entry_ptr, + (cooked_flags | + H5C__DURING_FLUSH_FLAG | + H5C__FLUSH_INVALIDATE_FLAG | + H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "Entry flush destroy failed") /* Restart the index list scan if necessary. Must * do this if the next entry is evicted, and also if @@ -5545,10 +6201,12 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) * if this results in the size of the pinned entry * failing to decline during the pass. */ - if((NULL != next_entry_ptr && NULL == cache_ptr->entry_watched_for_removal) - || (cache_ptr->entries_loaded_counter > 0) - || (cache_ptr->entries_inserted_counter > 0) - || (cache_ptr->entries_relocated_counter > 0)) { + if ( ( ( NULL != next_entry_ptr ) && + ( NULL == cache_ptr->entry_watched_for_removal ) + ) || + ( cache_ptr->entries_loaded_counter > 0 ) || + ( cache_ptr->entries_inserted_counter > 0 ) || + ( cache_ptr->entries_relocated_counter > 0 ) ) { next_entry_ptr = cache_ptr->il_head; @@ -5557,9 +6215,12 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) cache_ptr->entries_relocated_counter = 0; H5C__UPDATE_STATS_FOR_INDEX_SCAN_RESTART(cache_ptr) + } /* end if */ - else + else { + cache_ptr->entry_watched_for_removal = NULL; + } } /* end if */ } /* end if */ } /* end for loop scanning hash table */ @@ -5575,35 +6236,53 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) old_ring_pel_len = cur_ring_pel_len; entry_ptr = cache_ptr->pel_head_ptr; cur_ring_pel_len = 0; - while(entry_ptr != NULL) { + + while ( entry_ptr != NULL ) { + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(entry_ptr->ring >= ring); - if(entry_ptr->ring == ring) + if ( entry_ptr->ring == ring ) { + cur_ring_pel_len++; + } entry_ptr = entry_ptr->next; + } /* end while */ /* Check if the number of pinned entries in the ring is positive, and * it is not declining. Scream and die if so. */ - if(cur_ring_pel_len > 0 && cur_ring_pel_len >= old_ring_pel_len) { + if ( ( cur_ring_pel_len > 0 ) && + ( cur_ring_pel_len >= old_ring_pel_len ) ) { + /* Don't error if allowed to have pinned entries remaining */ - if(evict_flags) + if ( evict_flags ) { + HGOTO_DONE(TRUE) + } - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Pinned entry count not decreasing, cur_ring_pel_len = %d, old_ring_pel_len = %d, ring = %d", (int)cur_ring_pel_len, (int)old_ring_pel_len, (int)ring) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "Pinned entry count not decreasing, cur_ring_pel_len = %d, old_ring_pel_len = %d, ring = %d", \ + (int)cur_ring_pel_len, \ + (int)old_ring_pel_len, (int)ring) } /* end if */ HDassert(protected_entries == cache_ptr->pl_len); - if(protected_entries > 0 && protected_entries == cache_ptr->index_len) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Only protected entries left in cache, protected_entries = %d", (int)protected_entries) + if ( ( protected_entries > 0 ) && + ( protected_entries == cache_ptr->index_len ) ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "Only protected entries left in cache, protected_entries = %d",\ + (int)protected_entries) + } /* main while loop */ /* Invariants, after destroying all entries in the ring */ - for(i = (int)H5C_RING_UNDEFINED; i <= (int)ring; i++) { + for ( i = (int)H5C_RING_UNDEFINED; i <= (int)ring; i++ ) { + HDassert(cache_ptr->index_ring_len[i] == 0); HDassert(cache_ptr->index_ring_size[i] == (size_t)0); HDassert(cache_ptr->clean_index_ring_size[i] == (size_t)0); @@ -5611,21 +6290,31 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) HDassert(cache_ptr->slist_ring_len[i] == 0); HDassert(cache_ptr->slist_ring_size[i] == (size_t)0); + } /* end for */ HDassert(protected_entries <= cache_ptr->pl_len); - if(protected_entries > 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cache has protected entries") - else if(cur_ring_pel_len > 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't unpin all pinned entries in ring") + if ( protected_entries > 0 ) { + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "Cache has protected entries") + + } else if ( cur_ring_pel_len > 0 ) { + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "Can't unpin all pinned entries in ring") + } done: + FUNC_LEAVE_NOAPI(ret_value) + } /* H5C_flush_invalidate_ring() */ /*------------------------------------------------------------------------- + * * Function: H5C__flush_ring * * Purpose: Flush the entries contained in the specified cache and @@ -5647,6 +6336,14 @@ done: * Programmer: John Mainzer * 9/1/15 * + * Changes: A recent optimization turns off the slist unless a flush + * is in progress. This should not effect this function, as + * it is only called during a flush. Added an assertion to + * verify this. + * + * JRM -- 5/6/20 + * + * *------------------------------------------------------------------------- */ static herr_t @@ -5673,24 +6370,31 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(cache_ptr->slist_enabled); HDassert(cache_ptr->slist_ptr); HDassert((flags & H5C__FLUSH_INVALIDATE_FLAG) == 0); HDassert(ring > H5C_RING_UNDEFINED); HDassert(ring < H5C_RING_NTYPES); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") + if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) || + ( H5C_validate_pinned_entry_list(cache_ptr ) < 0 ) || + ( H5C_validate_lru_list(cache_ptr) < 0 ) ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, + "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ ignore_protected = ( (flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0 ); flush_marked_entries = ( (flags & H5C__FLUSH_MARKED_ENTRIES_FLAG) != 0 ); - if(!flush_marked_entries) - for(i = (int)H5C_RING_UNDEFINED; i < (int)ring; i++) + if ( ! flush_marked_entries ) { + + for ( i = (int)H5C_RING_UNDEFINED; i < (int)ring; i++ ) { + HDassert(cache_ptr->slist_ring_len[i] == 0); + } + } HDassert(cache_ptr->flush_in_progress); @@ -5711,9 +6415,10 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) */ cache_ptr->slist_changed = FALSE; - while((cache_ptr->slist_ring_len[ring] > 0) && - (protected_entries == 0) && - (flushed_entries_last_pass)) { + while ( ( cache_ptr->slist_ring_len[ring] > 0 ) && + ( protected_entries == 0 ) && + ( flushed_entries_last_pass ) ) { + flushed_entries_last_pass = FALSE; #if H5C_DO_SANITY_CHECKS @@ -5757,26 +6462,33 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) restart_slist_scan = TRUE; - while((restart_slist_scan ) || (node_ptr != NULL)) { - if(restart_slist_scan) { + while ( ( restart_slist_scan ) || ( node_ptr != NULL ) ) { + + if ( restart_slist_scan ) { + restart_slist_scan = FALSE; /* Start at beginning of skip list */ node_ptr = H5SL_first(cache_ptr->slist_ptr); - if(node_ptr == NULL) + if ( node_ptr == NULL ) { + /* the slist is empty -- break out of inner loop */ break; + } /* Get cache entry for this node */ next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - if(NULL == next_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") + if ( NULL == next_entry_ptr ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "next_entry_ptr == NULL ?!?!") HDassert(next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(next_entry_ptr->is_dirty); HDassert(next_entry_ptr->in_slist); + } /* end if */ entry_ptr = next_entry_ptr; @@ -5801,54 +6513,76 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(entry_ptr->in_slist); HDassert(entry_ptr->is_dirty); - if(!flush_marked_entries || entry_ptr->flush_marker) + + if ( ( ! flush_marked_entries ) || ( entry_ptr->flush_marker ) ) { + HDassert(entry_ptr->ring >= ring); + } /* Advance node pointer now, before we delete its target * from the slist. */ node_ptr = H5SL_next(node_ptr); - if(node_ptr != NULL) { + + if ( node_ptr != NULL ) { + next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - if(NULL == next_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") + + if ( NULL == next_entry_ptr ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "next_entry_ptr == NULL ?!?!") HDassert(next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(next_entry_ptr->is_dirty); HDassert(next_entry_ptr->in_slist); - if(!flush_marked_entries || next_entry_ptr->flush_marker) + if ( ! flush_marked_entries || next_entry_ptr->flush_marker ) { + HDassert(next_entry_ptr->ring >= ring); + } HDassert(entry_ptr != next_entry_ptr); + } /* end if */ - else + else { + next_entry_ptr = NULL; + } - if((!flush_marked_entries || entry_ptr->flush_marker) - && (!entry_ptr->flush_me_last || - (entry_ptr->flush_me_last - && (cache_ptr->num_last_entries >= cache_ptr->slist_len - || (flush_marked_entries && entry_ptr->flush_marker)))) - && (entry_ptr->flush_dep_nchildren == 0 - || entry_ptr->flush_dep_ndirty_children == 0) - && entry_ptr->ring == ring) { + if ( ( ! flush_marked_entries || entry_ptr->flush_marker ) && + ( ( ! entry_ptr->flush_me_last ) || + ( ( entry_ptr->flush_me_last ) && + ( ( cache_ptr->num_last_entries >= cache_ptr->slist_len )|| + ( flush_marked_entries && entry_ptr->flush_marker ) ) + ) + ) && + ( ( entry_ptr->flush_dep_nchildren == 0 ) || + ( entry_ptr->flush_dep_ndirty_children == 0 ) ) && + ( entry_ptr->ring == ring ) ) { HDassert(entry_ptr->flush_dep_nunser_children == 0); - if(entry_ptr->is_protected) { + if ( entry_ptr->is_protected ) { + /* we probably have major problems -- but lets * flush everything we can before we decide * whether to flag an error. */ tried_to_flush_protected_entry = TRUE; protected_entries++; + } /* end if */ else { - if(H5C__flush_single_entry(f, entry_ptr, (flags | H5C__DURING_FLUSH_FLAG)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry") - if(cache_ptr->slist_changed) { + if ( H5C__flush_single_entry(f, entry_ptr, + (flags | H5C__DURING_FLUSH_FLAG)) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "Can't flush entry") + + if ( cache_ptr->slist_changed ) { + /* The slist has been modified by something * other than the simple removal of the * of the flushed entry after the flush. @@ -5859,34 +6593,46 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) restart_slist_scan = TRUE; cache_ptr->slist_changed = FALSE; H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) + } /* end if */ flushed_entries_last_pass = TRUE; + } /* end else */ } /* end if */ } /* while ( ( restart_slist_scan ) || ( node_ptr != NULL ) ) */ #if H5C_DO_SANITY_CHECKS /* Verify that the slist size and length are as expected. */ - HDassert((uint32_t)((int32_t)initial_slist_len + cache_ptr->slist_len_increase) == cache_ptr->slist_len); - HDassert((size_t)((ssize_t)initial_slist_size + cache_ptr->slist_size_increase) == cache_ptr->slist_size); + HDassert((uint32_t)((int32_t)initial_slist_len + \ + cache_ptr->slist_len_increase) == cache_ptr->slist_len); + HDassert((size_t)((ssize_t)initial_slist_size + \ + cache_ptr->slist_size_increase) == cache_ptr->slist_size); #endif /* H5C_DO_SANITY_CHECKS */ + } /* while */ HDassert(protected_entries <= cache_ptr->pl_len); - if(((cache_ptr->pl_len > 0) && (!ignore_protected)) || (tried_to_flush_protected_entry)) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "cache has protected items") + if ( ( ( cache_ptr->pl_len > 0 ) && ( ! ignore_protected ) ) || + ( tried_to_flush_protected_entry ) ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "cache has protected items") #if H5C_DO_SANITY_CHECKS - if(!flush_marked_entries) { + if ( ! flush_marked_entries ) { + HDassert(cache_ptr->slist_ring_len[ring] == 0); HDassert(cache_ptr->slist_ring_size[ring] == 0); + } /* end if */ #endif /* H5C_DO_SANITY_CHECKS */ done: + FUNC_LEAVE_NOAPI(ret_value) + } /* H5C__flush_ring() */ @@ -5906,12 +6652,6 @@ done: * be cleared and not flushed, and the call can't be part of a * sequence of flushes. * - * If the caller knows the address of the skip list node at - * which the target entry resides, it can avoid a lookup - * by supplying that address in the tgt_node_ptr parameter. - * If this parameter is NULL, the function will do a skip list - * search for the entry instead. - * * The function does nothing silently if there is no entry * at the supplied address, or if the entry found has the * wrong type. @@ -5921,6 +6661,69 @@ done: * * Programmer: John Mainzer, 5/5/04 * + * Modifications: + * + * JRM -- 7/21/04 + * Updated function for the addition of the hash table. + * + * QAK -- 11/26/04 + * Updated function for the switch from TBBTs to skip lists. + * + * JRM -- 1/6/05 + * Updated function to reset the flush_marker field. + * Also replace references to H5F_FLUSH_INVALIDATE and + * H5F_FLUSH_CLEAR_ONLY with references to + * H5C__FLUSH_INVALIDATE_FLAG and H5C__FLUSH_CLEAR_ONLY_FLAG + * respectively. + * + * JRM -- 6/24/05 + * Added code to remove dirty entries from the slist after + * they have been flushed. Also added a sanity check that + * will scream if we attempt a write when writes are + * completely disabled. + * + * JRM -- 7/5/05 + * Added code to call the new log_flush callback whenever + * a dirty entry is written to disk. Note that the callback + * is not called if the H5C__FLUSH_CLEAR_ONLY_FLAG is set, + * as there is no write to file in this case. + * + * JRM -- 8/21/06 + * Added code maintaining the flush_in_progress and + * destroy_in_progress fields in H5C_cache_entry_t. + * + * Also added flush_flags parameter to the call to + * type_ptr->flush() so that the flush routine can report + * whether the entry has been resized or renamed. Added + * code using the flush_flags variable to detect the case + * in which the target entry is resized during flush, and + * update the caches data structures accordingly. + * + * JRM -- 3/29/07 + * Added sanity checks on the new is_read_only and + * ro_ref_count fields. + * + * QAK -- 2/07/08 + * Separated "destroy entry" concept from "remove entry from + * cache" concept, by adding the 'take_ownership' flag and + * the "destroy_entry" variable. + * + * JRM -- 11/5/08 + * Added call to H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN() to + * maintain the new clean_index_size and clean_index_size + * fields of H5C_t. + * + * + * Missing entries?? + * + * + * JRM -- 5/8/20 + * Updated sanity checks for the possibility that the slist + * is disabled. + * + * Also updated main comment to conform more closely with + * the current state of the code. + * *------------------------------------------------------------------------- */ herr_t @@ -5955,30 +6758,39 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) HDassert(entry_ptr->type); /* setup external flags from the flags parameter */ - destroy = ((flags & H5C__FLUSH_INVALIDATE_FLAG) != 0); - clear_only = ((flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); - free_file_space = ((flags & H5C__FREE_FILE_SPACE_FLAG) != 0); - take_ownership = ((flags & H5C__TAKE_OWNERSHIP_FLAG) != 0); - del_from_slist_on_destroy = ((flags & H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) != 0); - during_flush = ((flags & H5C__DURING_FLUSH_FLAG) != 0); - generate_image = ((flags & H5C__GENERATE_IMAGE_FLAG) != 0); - update_page_buffer = ((flags & H5C__UPDATE_PAGE_BUFFER_FLAG) != 0); + destroy = ((flags & H5C__FLUSH_INVALIDATE_FLAG) != 0); + clear_only = ((flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); + free_file_space = ((flags & H5C__FREE_FILE_SPACE_FLAG) != 0); + take_ownership = ((flags & H5C__TAKE_OWNERSHIP_FLAG) != 0); + del_from_slist_on_destroy = + ((flags & H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) != 0); + during_flush = ((flags & H5C__DURING_FLUSH_FLAG) != 0); + generate_image = ((flags & H5C__GENERATE_IMAGE_FLAG) != 0); + update_page_buffer = ((flags & H5C__UPDATE_PAGE_BUFFER_FLAG) != 0); /* Set the flag for destroying the entry, based on the 'take ownership' * and 'destroy' flags */ - if(take_ownership) + if ( take_ownership ) { + destroy_entry = FALSE; - else + + } else { + destroy_entry = destroy; + } /* we will write the entry to disk if it exists, is dirty, and if the * clear only flag is not set. */ - if(entry_ptr->is_dirty && !clear_only) + if ( entry_ptr->is_dirty && !clear_only ) { + write_entry = TRUE; - else + + } else { + write_entry = FALSE; + } /* if we have received close warning, and we have been instructed to * generate a metadata cache image, and we have actually constructed @@ -5987,8 +6799,11 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * Set suppress_image_entry_writes to TRUE if indicated by the * image_ctl flags. */ - if(cache_ptr->close_warning_received && cache_ptr->image_ctl.generate_image - && cache_ptr->num_entries_in_image > 0 && cache_ptr->image_entries) { + if ( ( cache_ptr->close_warning_received ) && + ( cache_ptr->image_ctl.generate_image ) && + ( cache_ptr->num_entries_in_image > 0 ) && + ( cache_ptr->image_entries != NULL ) ) { + /* Sanity checks */ HDassert(entry_ptr->image_up_to_date || !(entry_ptr->include_in_image)); HDassert(entry_ptr->image_ptr || !(entry_ptr->include_in_image)); @@ -5998,32 +6813,60 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) suppress_image_entry_frees = TRUE; - if(cache_ptr->image_ctl.flags & H5C_CI__SUPRESS_ENTRY_WRITES) + if ( cache_ptr->image_ctl.flags & H5C_CI__SUPRESS_ENTRY_WRITES ) { + suppress_image_entry_writes = TRUE; + + } /* end if */ } /* end if */ - /* run initial sanity checks */ -#if H5C_DO_SANITY_CHECKS - if(entry_ptr->in_slist) { - HDassert(entry_ptr->is_dirty); + /* run initial sanity checks */ +#if H5C_DO_SANITY_CHECKS + if ( cache_ptr->slist_enabled ) { - if((entry_ptr->flush_marker) && (!entry_ptr->is_dirty)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry in slist failed sanity checks") - } /* end if */ - else { - HDassert(!entry_ptr->is_dirty); - HDassert(!entry_ptr->flush_marker); + if ( entry_ptr->in_slist ) { - if((entry_ptr->is_dirty) || (entry_ptr->flush_marker)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry failed sanity checks") - } /* end else */ + HDassert(entry_ptr->is_dirty); + + if ( ( entry_ptr->flush_marker ) && ( ! entry_ptr->is_dirty ) ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "entry in slist failed sanity checks") + } /* end if */ + else { + + HDassert(!entry_ptr->is_dirty); + HDassert(!entry_ptr->flush_marker); + + if ( ( entry_ptr->is_dirty ) || ( entry_ptr->flush_marker ) ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "entry failed sanity checks") + + } /* end else */ + } else { /* slist is disabled */ + + HDassert( ! entry_ptr->in_slist ); + + if ( ! entry_ptr->is_dirty ) { + + if ( entry_ptr->flush_marker ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "flush marked clean entry?") + + } + } #endif /* H5C_DO_SANITY_CHECKS */ - if(entry_ptr->is_protected) { + if ( entry_ptr->is_protected ) { + HDassert(!entry_ptr->is_protected); /* Attempt to flush a protected entry -- scream and die. */ - HGOTO_ERROR(H5E_CACHE, H5E_PROTECT, FAIL, "Attempt to flush a protected entry") + HGOTO_ERROR(H5E_CACHE, H5E_PROTECT, FAIL, \ + "Attempt to flush a protected entry") + } /* end if */ /* Set entry_ptr->flush_in_progress = TRUE and set @@ -6042,24 +6885,36 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * been requested to generate an image. In those cases, serialize the * entry. */ - if(write_entry || generate_image) { + if ( write_entry || generate_image ) { + HDassert(entry_ptr->is_dirty); - if(NULL == entry_ptr->image_ptr) { - if(NULL == (entry_ptr->image_ptr = H5MM_malloc(entry_ptr->size + H5C_IMAGE_EXTRA_SPACE))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for on disk image buffer") + if ( NULL == entry_ptr->image_ptr ) { + + if ( NULL == (entry_ptr->image_ptr = + H5MM_malloc(entry_ptr->size + H5C_IMAGE_EXTRA_SPACE)) ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, \ + "memory allocation failed for on disk image buffer") + #if H5C_DO_MEMORY_SANITY_CHECKS - H5MM_memcpy(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); + H5MM_memcpy(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, + H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ + } /* end if */ - if(!(entry_ptr->image_up_to_date)) { + if ( ! ( entry_ptr->image_up_to_date ) ) { + /* Sanity check */ HDassert(!entry_ptr->prefetched); /* Generate the entry's image */ - if(H5C__generate_image(f, cache_ptr, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't generate entry's image") + if ( H5C__generate_image(f, cache_ptr, entry_ptr) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, \ + "can't generate entry's image") + } /* end if ( ! (entry_ptr->image_up_to_date) ) */ } /* end if */ @@ -6069,12 +6924,16 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * in the entry's type, we silently skip the write. This * flag should only be used in test code. */ - if(write_entry) { + if ( write_entry ) { + HDassert(entry_ptr->is_dirty); #if H5C_DO_SANITY_CHECKS - if(cache_ptr->check_write_permitted && !(cache_ptr->write_permitted)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Write when writes are always forbidden!?!?!") + if ( ( cache_ptr->check_write_permitted ) && + ( ! ( cache_ptr->write_permitted ) ) ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Write when writes are always forbidden!?!?!") #endif /* H5C_DO_SANITY_CHECKS */ /* Write the image to disk unless the write is suppressed. @@ -6084,41 +6943,60 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * H5AC__CLASS_SKIP_WRITES is set in the entry's type. This * flag should only be used in test code */ - if((!suppress_image_entry_writes || !entry_ptr->include_in_image) - && (((entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0)) { + if ( ( ( ! suppress_image_entry_writes ) || + ( ! entry_ptr->include_in_image ) ) && + ( ( (entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0 ) ) { + H5FD_mem_t mem_type = H5FD_MEM_DEFAULT; #ifdef H5_HAVE_PARALLEL - if(cache_ptr->coll_write_list) { - if(H5SL_insert(cache_ptr->coll_write_list, entry_ptr, &entry_ptr->addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "unable to insert skip list item") + if ( cache_ptr->coll_write_list ) { + + if ( H5SL_insert(cache_ptr->coll_write_list, entry_ptr, + &entry_ptr->addr) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, \ + "unable to insert skip list item") } /* end if */ else { #endif /* H5_HAVE_PARALLEL */ - if(entry_ptr->prefetched) { + if ( entry_ptr->prefetched ) { + HDassert(entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID); + mem_type = cache_ptr-> class_table_ptr[entry_ptr->prefetch_type_id]-> mem_type; } /* end if */ - else + else { + mem_type = entry_ptr->type->mem_type; + } + + if ( H5F_block_write(f, mem_type, entry_ptr->addr, + entry_ptr->size, entry_ptr->image_ptr) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "Can't write image to file") - if(H5F_block_write(f, mem_type, entry_ptr->addr, entry_ptr->size, entry_ptr->image_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't write image to file") #ifdef H5_HAVE_PARALLEL } #endif /* H5_HAVE_PARALLEL */ + } /* end if */ /* if the entry has a notify callback, notify it that we have * just flushed the entry. */ - if(entry_ptr->type->notify && - (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_AFTER_FLUSH, entry_ptr) < 0 ) - HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client of entry flush") + if ( ( entry_ptr->type->notify ) && + ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_AFTER_FLUSH, + entry_ptr) < 0 ) ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ + "can't notify client of entry flush") + } /* if ( write_entry ) */ /* At this point, all pre-serialize and serialize calls have been @@ -6130,16 +7008,21 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) */ /* start by updating the statistics */ - if(clear_only) { + if ( clear_only ) { + /* only log a clear if the entry was dirty */ - if(was_dirty) { + if ( was_dirty ) { + H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) + } /* end if */ } else if(write_entry) { + HDassert(was_dirty); /* only log a flush if we actually wrote to disk */ H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) + } /* end else if */ /* Note that the algorithm below is (very) similar to the set of operations @@ -6148,12 +7031,18 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) */ /* Update the cache internal data structures. */ - if(destroy) { + if ( destroy ) { + /* Sanity checks */ - if(take_ownership) + if ( take_ownership ) { + HDassert(!destroy_entry); - else + + } else { + HDassert(destroy_entry); + } + HDassert(!entry_ptr->is_pinned); /* Update stats, while entry is still in the cache */ @@ -6163,8 +7052,12 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * to be removed from the cache, send a 'before eviction' notice while * the entry is still fully integrated in the cache. */ - if(entry_ptr->type->notify && (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_BEFORE_EVICT, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client about entry to evict") + if ( ( entry_ptr->type->notify ) && + ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_BEFORE_EVICT, + entry_ptr) < 0 ) ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ + "can't notify client about entry to evict") /* Update the cache internal data structures as appropriate * for a destroy. Specifically: @@ -6184,31 +7077,40 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) */ H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr, FAIL) - if(entry_ptr->in_slist && del_from_slist_on_destroy) + if ( ( entry_ptr->in_slist ) && ( del_from_slist_on_destroy ) ) { + H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, during_flush) + } #ifdef H5_HAVE_PARALLEL /* Check for collective read access flag */ - if(entry_ptr->coll_access) { + if ( entry_ptr->coll_access ) { + entry_ptr->coll_access = FALSE; + H5C__REMOVE_FROM_COLL_LIST(cache_ptr, entry_ptr, FAIL) + } /* end if */ #endif /* H5_HAVE_PARALLEL */ H5C__UPDATE_RP_FOR_EVICTION(cache_ptr, entry_ptr, FAIL) /* Remove entry from tag list */ - if(H5C__untag_entry(cache_ptr, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, "can't remove entry from tag list") + if ( H5C__untag_entry(cache_ptr, entry_ptr) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, \ + "can't remove entry from tag list") /* verify that the entry is no longer part of any flush dependencies */ HDassert(entry_ptr->flush_dep_nparents == 0); HDassert(entry_ptr->flush_dep_nchildren == 0); + } /* end if */ else { + HDassert(clear_only || write_entry); HDassert(entry_ptr->is_dirty); - HDassert(entry_ptr->in_slist); + HDassert((!cache_ptr->slist_enabled) || (entry_ptr->in_slist)); /* We are either doing a flush or a clear. * @@ -6232,20 +7134,34 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr); /* Check for entry changing status and do notifications, etc. */ - if(was_dirty) { - /* If the entry's type has a 'notify' callback send a 'entry cleaned' - * notice now that the entry is fully integrated into the cache. + if ( was_dirty ) { + + /* If the entry's type has a 'notify' callback send a + * 'entry cleaned' notice now that the entry is fully + * integrated into the cache. */ - if(entry_ptr->type->notify && - (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_CLEANED, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client about entry dirty flag cleared") + if ( ( entry_ptr->type->notify ) && + ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_CLEANED, + entry_ptr) < 0 ) ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ + "can't notify client about entry dirty flag cleared") + + /* Propagate the clean flag up the flush dependency chain + * if appropriate + */ + if ( entry_ptr->flush_dep_ndirty_children != 0 ) { - /* Propagate the clean flag up the flush dependency chain if appropriate */ - if(entry_ptr->flush_dep_ndirty_children != 0) HDassert(entry_ptr->flush_dep_ndirty_children == 0); - if(entry_ptr->flush_dep_nparents > 0) - if(H5C__mark_flush_dep_clean(entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKCLEAN, FAIL, "Can't propagate flush dep clean flag") + } + + if ( entry_ptr->flush_dep_nparents > 0 ) { + + if ( H5C__mark_flush_dep_clean(entry_ptr) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKCLEAN, FAIL, \ + "Can't propagate flush dep clean flag") + } } /* end if */ } /* end else */ @@ -6253,7 +7169,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) entry_ptr->flush_in_progress = FALSE; /* capture the cache entry address for the log_flush call at the - end before the entry_ptr gets freed */ + * end before the entry_ptr gets freed + */ entry_addr = entry_ptr->addr; /* Internal cache data structures should now be up to date, and @@ -6261,7 +7178,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * * Now discard the entry if appropriate. */ - if(destroy) { + if ( destroy ) { + /* Sanity check */ HDassert(0 == entry_ptr->flush_dep_nparents); @@ -6272,10 +7190,14 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * * Otherwise, free the buffer if it exists. */ - if(suppress_image_entry_frees && entry_ptr->include_in_image) + if ( suppress_image_entry_frees && entry_ptr->include_in_image ) { + entry_ptr->image_ptr = NULL; - else if(entry_ptr->image_ptr != NULL) + + } else if ( entry_ptr->image_ptr != NULL ) { + entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr); + } /* If the entry is not a prefetched entry, verify that the flush * dependency parents addresses array has been transferred. @@ -6283,15 +7205,18 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * If the entry is prefetched, the free_isr routine will dispose of * the flush dependency parents addresses array if necessary. */ - if(!entry_ptr->prefetched) { + if ( ! entry_ptr->prefetched ) { + HDassert(0 == entry_ptr->fd_parent_count); HDassert(NULL == entry_ptr->fd_parent_addrs); + } /* end if */ /* Check whether we should free the space in the file that * the entry occupies */ - if(free_file_space) { + if ( free_file_space ) { + hsize_t fsf_size; /* Sanity checks */ @@ -6311,16 +7236,27 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * it to get the size of the block of file space to free. * Otherwise use entry_ptr->size. */ - if(entry_ptr->type->fsf_size) { - if((entry_ptr->type->fsf_size)((void *)entry_ptr, &fsf_size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "unable to get file space free size") + if ( entry_ptr->type->fsf_size ) { + + if ( (entry_ptr->type->fsf_size)((void *)entry_ptr, &fsf_size) + < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, \ + "unable to get file space free size") + } /* end if */ - else /* no file space free size callback -- use entry size */ + else { /* no file space free size callback -- use entry size */ + fsf_size = entry_ptr->size; + } /* Release the space on disk */ - if(H5MF_xfree(f, entry_ptr->type->mem_type, entry_ptr->addr, fsf_size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "unable to free file space for cache entry") + if ( H5MF_xfree(f, entry_ptr->type->mem_type, + entry_ptr->addr, fsf_size) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, \ + "unable to free file space for cache entry") + } /* end if ( free_file_space ) */ /* Reset the pointer to the cache the entry is within. -QAK */ @@ -6343,22 +7279,32 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) */ cache_ptr->entries_removed_counter++; cache_ptr->last_entry_removed_ptr = entry_ptr; - if(entry_ptr == cache_ptr->entry_watched_for_removal) + + if ( entry_ptr == cache_ptr->entry_watched_for_removal ) { + cache_ptr->entry_watched_for_removal = NULL; + } /* Check for actually destroying the entry in memory */ /* (As opposed to taking ownership of it) */ - if(destroy_entry) { - if(entry_ptr->is_dirty) { + if ( destroy_entry ) { + + if ( entry_ptr->is_dirty ) { + /* Reset dirty flag */ entry_ptr->is_dirty = FALSE; - /* If the entry's type has a 'notify' callback send a 'entry cleaned' - * notice now that the entry is fully integrated into the cache. + /* If the entry's type has a 'notify' callback send a + * 'entry cleaned' notice now that the entry is fully + * integrated into the cache. */ - if(entry_ptr->type->notify && - (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_CLEANED, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client about entry dirty flag cleared") + if ( ( entry_ptr->type->notify ) && + ( (entry_ptr->type->notify) + (H5C_NOTIFY_ACTION_ENTRY_CLEANED, entry_ptr) < 0 ) ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ + "can't notify client about entry dirty flag cleared") + } /* end if */ /* we are about to discard the in core representation -- @@ -6370,10 +7316,14 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) /* verify that the image has been freed */ HDassert(entry_ptr->image_ptr == NULL); - if(entry_ptr->type->free_icr((void *)entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "free_icr callback failed") + if ( entry_ptr->type->free_icr((void *)entry_ptr) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "free_icr callback failed") + } /* end if */ else { + HDassert(take_ownership); /* client is taking ownership of the entry. @@ -6381,33 +7331,50 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * unless the entry is re-inserted properly */ entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC; + } /* end else */ } /* if (destroy) */ /* Check if we have to update the page buffer with cleared entries * so it doesn't go out of date */ - if(update_page_buffer) { + if ( update_page_buffer ) { + /* Sanity check */ HDassert(!destroy); HDassert(entry_ptr->image_ptr); - if(f->shared->page_buf && f->shared->page_buf->page_size >= entry_ptr->size) - if(H5PB_update_entry(f->shared->page_buf, entry_ptr->addr, entry_ptr->size, entry_ptr->image_ptr) > 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Failed to update PB with metadata cache") + if ( ( f->shared->page_buf ) && + ( f->shared->page_buf->page_size >= entry_ptr->size ) ) { + + if ( H5PB_update_entry(f->shared->page_buf, entry_ptr->addr, + entry_ptr->size, entry_ptr->image_ptr) > 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Failed to update PB with metadata cache") + } /* end if */ } /* end if */ - if(cache_ptr->log_flush) - if((cache_ptr->log_flush)(cache_ptr, entry_addr, was_dirty, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "log_flush callback failed") + if ( cache_ptr->log_flush ) { + + if ( (cache_ptr->log_flush)(cache_ptr, entry_addr, + was_dirty, flags) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "log_flush callback failed") + + } /* end if */ done: + HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || ( ! entry_ptr->flush_in_progress ) ); + HDassert( ( ret_value != SUCCEED ) || ( destroy_entry ) || ( take_ownership ) || ( ! entry_ptr->is_dirty ) ); FUNC_LEAVE_NOAPI(ret_value) + } /* H5C__flush_single_entry() */ @@ -7613,8 +8580,18 @@ H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr) * Programmer: Mike McGreevy * November 3, 2010 * + * Changes: Modified function to setup the slist before calling + * H%C_flush_cache(), and take it down afterwards. Note + * that the slist need not be empty after the call to + * H5C_flush_cache() since we are only flushing marked + * entries. Thus must set the clear_slist parameter + * of H5C_set_slist_enabled to TRUE. + * + * JRM -- 5/6/20 + * *------------------------------------------------------------------------- */ + herr_t H5C__flush_marked_entries(H5F_t * f) { @@ -7625,12 +8602,31 @@ H5C__flush_marked_entries(H5F_t * f) /* Assertions */ HDassert(f != NULL); + + /* Enable the slist, as it is needed in the flush */ + if ( H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist enabled failed") + + /* Flush all marked entries */ - if(H5C_flush_cache(f, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0) + if ( H5C_flush_cache(f, H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache") + /* Disable the slist. Set the clear_slist parameter to TRUE + * since we called H5C_flush_cache() with the + * H5C__FLUSH_MARKED_ENTRIES_FLAG. + */ + if ( H5C_set_slist_enabled(f->shared->cache, FALSE, TRUE) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "disable slist failed") + done: + FUNC_LEAVE_NOAPI(ret_value) + } /* H5C__flush_marked_entries */ @@ -8500,6 +9496,10 @@ done: * Programmer: Mohamad Chaarawi * 2/10/16 * + * Changes: Updated sanity checks for the possibility that the skip + * list is disabled. + * JRM 5/16/20 + * *------------------------------------------------------------------------- */ herr_t @@ -8528,16 +9528,24 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) old_addr = entry_ptr->addr; /* Call client's pre-serialize callback, if there's one */ - if(entry_ptr->type->pre_serialize && - (entry_ptr->type->pre_serialize)(f, (void *)entry_ptr, - entry_ptr->addr, entry_ptr->size, &new_addr, &new_len, &serialize_flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to pre-serialize entry") + if ( ( entry_ptr->type->pre_serialize ) && + ( (entry_ptr->type->pre_serialize)(f, (void *)entry_ptr, + entry_ptr->addr, entry_ptr->size, + &new_addr, &new_len, + &serialize_flags) < 0 ) ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "unable to pre-serialize entry") /* Check for any flags set in the pre-serialize callback */ - if(serialize_flags != H5C__SERIALIZE_NO_FLAGS_SET) { + if ( serialize_flags != H5C__SERIALIZE_NO_FLAGS_SET ) { + /* Check for unexpected flags from serialize callback */ - if(serialize_flags & ~(H5C__SERIALIZE_RESIZED_FLAG | H5C__SERIALIZE_MOVED_FLAG)) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unknown serialize flag(s)") + if ( serialize_flags & ~(H5C__SERIALIZE_RESIZED_FLAG | + H5C__SERIALIZE_MOVED_FLAG) ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "unknown serialize flag(s)") #ifdef H5_HAVE_PARALLEL /* In the parallel case, resizes and moves in @@ -8566,28 +9574,40 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) * If that ceases to be the case, further * tests will be necessary. */ - if(cache_ptr->aux_ptr != NULL) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "resize/move in serialize occurred in parallel case") + if ( cache_ptr->aux_ptr != NULL ) + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "resize/move in serialize occurred in parallel case") #endif /* If required, resize the buffer and update the entry and the cache - * data structures */ - if(serialize_flags & H5C__SERIALIZE_RESIZED_FLAG) { + * data structures + */ + if ( serialize_flags & H5C__SERIALIZE_RESIZED_FLAG ) { + /* Sanity check */ HDassert(new_len > 0); /* Allocate a new image buffer */ - if(NULL == (entry_ptr->image_ptr = H5MM_realloc(entry_ptr->image_ptr, new_len + H5C_IMAGE_EXTRA_SPACE))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for on disk image buffer") + if ( NULL == (entry_ptr->image_ptr = + H5MM_realloc(entry_ptr->image_ptr, + new_len + H5C_IMAGE_EXTRA_SPACE)) ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, \ + "memory allocation failed for on disk image buffer") + #if H5C_DO_MEMORY_SANITY_CHECKS - H5MM_memcpy(((uint8_t *)entry_ptr->image_ptr) + new_len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); + H5MM_memcpy(((uint8_t *)entry_ptr->image_ptr) + new_len, + H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ /* Update statistics for resizing the entry */ - H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_len); + H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, \ + new_len); /* Update the hash table for the size change */ - H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, new_len, entry_ptr, !(entry_ptr->is_dirty)); + H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, \ + new_len, entry_ptr, !(entry_ptr->is_dirty)); /* The entry can't be protected since we are in the process of * flushing it. Thus we must update the replacement policy data @@ -8598,25 +9618,32 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) /* As we haven't updated the cache data structures for * for the flush or flush destroy yet, the entry should - * be in the slist. Thus update it for the size change. + * be in the slist if the slist is enabled. Since + * H5C__UPDATE_SLIST_FOR_SIZE_CHANGE() is a no-op if the + * slist is enabled, call it un-conditionally. */ HDassert(entry_ptr->is_dirty); - HDassert(entry_ptr->in_slist); - H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, new_len); + HDassert((entry_ptr->in_slist) || (!cache_ptr->slist_enabled)); + + H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, \ + new_len); /* Finally, update the entry for its new size */ entry_ptr->size = new_len; + } /* end if */ /* If required, udate the entry and the cache data structures * for a move */ - if(serialize_flags & H5C__SERIALIZE_MOVED_FLAG) { + if ( serialize_flags & H5C__SERIALIZE_MOVED_FLAG ) { + /* Update stats and entries relocated counter */ H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) /* We must update cache data structures for the change in address */ - if(entry_ptr->addr == old_addr) { + if ( entry_ptr->addr == old_addr ) { + /* Delete the entry from the hash table and the slist */ H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr, FAIL); H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, FALSE); @@ -8627,18 +9654,26 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) /* And then reinsert in the index and slist */ H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL); H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL); + } /* end if */ - else /* move is already done for us -- just do sanity checks */ + else { /* move is already done for us -- just do sanity checks */ + HDassert(entry_ptr->addr == new_addr); + } } /* end if */ } /* end if(serialize_flags != H5C__SERIALIZE_NO_FLAGS_SET) */ /* Serialize object into buffer */ - if(entry_ptr->type->serialize(f, entry_ptr->image_ptr, entry_ptr->size, (void *)entry_ptr) < 0) + if ( entry_ptr->type->serialize(f, entry_ptr->image_ptr, entry_ptr->size, + (void *)entry_ptr) < 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to serialize entry") + #if H5C_DO_MEMORY_SANITY_CHECKS - HDassert(0 == HDmemcmp(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE)); + HDassert(0 == HDmemcmp(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size,\ + H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE)); #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ + entry_ptr->image_up_to_date = TRUE; /* Propagate the fact that the entry is serialized up the @@ -8648,9 +9683,14 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) * for flush dependency parents. */ HDassert(entry_ptr->flush_dep_nunser_children == 0); - if(entry_ptr->flush_dep_nparents > 0) - if(H5C__mark_flush_dep_serialized(entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "Can't propagate serialization status to fd parents") + + if ( entry_ptr->flush_dep_nparents > 0 ) { + + if ( H5C__mark_flush_dep_serialized(entry_ptr) < 0 ) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ + "Can't propagate serialization status to fd parents") + } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index d5599f2..085ac77 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -260,6 +260,7 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name) /*------------------------------------------------------------------------- + * * Function: H5C_dump_cache_skip_list * * Purpose: Debugging routine that prints a summary of the contents of @@ -271,6 +272,12 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name) * Programmer: John Mainzer * 11/15/14 * + * Changes: Updated function for the slist_enabled field in H6C_t. + * Recall that to minimize slist overhead, the slist is + * empty and not maintained if cache_ptr->slist_enabled is + * false. + * JRM -- 5/6/20 + * *------------------------------------------------------------------------- */ #ifndef NDEBUG @@ -288,11 +295,16 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(calling_fcn != NULL); - HDfprintf(stdout, "\n\nDumping metadata cache skip list from %s.\n", calling_fcn); + HDfprintf(stdout, "\n\nDumping metadata cache skip list from %s.\n", + calling_fcn); + HDfprintf(stdout, " slist enabled = %d.\n", + (int)(cache_ptr->slist_enabled)); HDfprintf(stdout, " slist len = %u.\n", cache_ptr->slist_len); - HDfprintf(stdout, " slist size = %lld.\n", (long long)(cache_ptr->slist_size)); + HDfprintf(stdout, " slist size = %lld.\n", + (long long)(cache_ptr->slist_size)); if(cache_ptr->slist_len > 0) { + /* If we get this far, all entries in the cache are listed in the * skip list -- scan the skip list generating the desired output. */ @@ -300,13 +312,20 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) "Num: Addr: Len: Prot/Pind: Dirty: Type:\n"); i = 0; + node_ptr = H5SL_first(cache_ptr->slist_ptr); - if(node_ptr != NULL) + + if ( node_ptr != NULL ) { + entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - else + + } else { + entry_ptr = NULL; + } + + while ( entry_ptr != NULL ) { - while(entry_ptr != NULL) { HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); HDfprintf(stdout, @@ -323,19 +342,27 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) node_ptr, H5SL_item(node_ptr)); /* increment node_ptr before we delete its target */ + node_ptr = H5SL_next(node_ptr); - if(node_ptr != NULL) + + if ( node_ptr != NULL ) { + entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - else + + } else { + entry_ptr = NULL; + } i++; + } /* end while */ } /* end if */ HDfprintf(stdout, "\n\n"); FUNC_LEAVE_NOAPI(ret_value) + } /* H5C_dump_cache_skip_list() */ #endif /* NDEBUG */ diff --git a/src/H5Cimage.c b/src/H5Cimage.c index ee286d9..9dd2ac6 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -461,6 +461,10 @@ done: * * Programmer: John Mainzer, 8/10/15 * + * Changes: Updated sanity checks for possibility that the slist + * is disabled. + * JRM -- 5/17/20 + * *------------------------------------------------------------------------- */ herr_t @@ -700,9 +704,14 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, * and H5C__FLUSH_CLEAR_ONLY_FLAG flags set. */ pf_entry_ptr->image_ptr = NULL; - if(pf_entry_ptr->is_dirty) { - HDassert(pf_entry_ptr->in_slist); + + if ( pf_entry_ptr->is_dirty ) { + + HDassert(((cache_ptr->slist_enabled) && (pf_entry_ptr->in_slist)) || \ + ((!cache_ptr->slist_enabled) && (!pf_entry_ptr->in_slist))); + flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; + } /* end if */ if(H5C__flush_single_entry(f, pf_entry_ptr, flush_flags) < 0) diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 199c494..31dc647 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -18,7 +18,7 @@ * Quincey Koziol * * Purpose: Functions in this file implement support for parallel I/O for - * generic cache code. + * generic cache code. * *------------------------------------------------------------------------- */ @@ -28,20 +28,20 @@ /****************/ #include "H5Cmodule.h" /* This source code file is part of the H5C module */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ +#include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ -#include "H5Cpkg.h" /* Cache */ +#include "H5Cpkg.h" /* Cache */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* Files */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* Files */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5MMprivate.h" /* Memory management */ #ifdef H5_HAVE_PARALLEL @@ -87,74 +87,74 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, * * Purpose: Apply the supplied candidate list. * - * We used to do this by simply having each process write - * every mpi_size-th entry in the candidate list, starting - * at index mpi_rank, and mark all the others clean. + * We used to do this by simply having each process write + * every mpi_size-th entry in the candidate list, starting + * at index mpi_rank, and mark all the others clean. * - * However, this can cause unnecessary contention in a file - * system by increasing the number of processes writing to - * adjacent locations in the HDF5 file. + * However, this can cause unnecessary contention in a file + * system by increasing the number of processes writing to + * adjacent locations in the HDF5 file. * - * To attempt to minimize this, we now arange matters such - * that each process writes n adjacent entries in the - * candidate list, and marks all others clean. We must do - * this in such a fashion as to guarantee that each entry - * on the candidate list is written by exactly one process, - * and marked clean by all others. + * To attempt to minimize this, we now arange matters such + * that each process writes n adjacent entries in the + * candidate list, and marks all others clean. We must do + * this in such a fashion as to guarantee that each entry + * on the candidate list is written by exactly one process, + * and marked clean by all others. * - * To do this, first construct a table mapping mpi_rank - * to the index of the first entry in the candidate list to - * be written by the process of that mpi_rank, and then use - * the table to control which entries are written and which - * are marked as clean as a function of the mpi_rank. + * To do this, first construct a table mapping mpi_rank + * to the index of the first entry in the candidate list to + * be written by the process of that mpi_rank, and then use + * the table to control which entries are written and which + * are marked as clean as a function of the mpi_rank. * - * Note that the table must be identical on all processes, as - * all see the same candidate list, mpi_size, and mpi_rank -- - * the inputs used to construct the table. + * Note that the table must be identical on all processes, as + * all see the same candidate list, mpi_size, and mpi_rank -- + * the inputs used to construct the table. * - * We construct the table as follows. Let: + * We construct the table as follows. Let: * - * n = num_candidates / mpi_size; + * n = num_candidates / mpi_size; * - * m = num_candidates % mpi_size; + * m = num_candidates % mpi_size; * - * Now allocate an array of integers of length mpi_size + 1, - * and call this array candidate_assignment_table. + * Now allocate an array of integers of length mpi_size + 1, + * and call this array candidate_assignment_table. * - * Conceptually, if the number of candidates is a multiple - * of the mpi_size, we simply pass through the candidate list - * and assign n entries to each process to flush, with the - * index of the first entry to flush in the location in - * the candidate_assignment_table indicated by the mpi_rank - * of the process. + * Conceptually, if the number of candidates is a multiple + * of the mpi_size, we simply pass through the candidate list + * and assign n entries to each process to flush, with the + * index of the first entry to flush in the location in + * the candidate_assignment_table indicated by the mpi_rank + * of the process. * - * In the more common case in which the candidate list isn't - * isn't a multiple of the mpi_size, we pretend it is, and - * give num_candidates % mpi_size processes one extra entry - * each to make things work out. + * In the more common case in which the candidate list isn't + * isn't a multiple of the mpi_size, we pretend it is, and + * give num_candidates % mpi_size processes one extra entry + * each to make things work out. * - * Once the table is constructed, we determine the first and - * last entry this process is to flush as follows: + * Once the table is constructed, we determine the first and + * last entry this process is to flush as follows: * - * first_entry_to_flush = candidate_assignment_table[mpi_rank] + * first_entry_to_flush = candidate_assignment_table[mpi_rank] * - * last_entry_to_flush = - * candidate_assignment_table[mpi_rank + 1] - 1; + * last_entry_to_flush = + * candidate_assignment_table[mpi_rank + 1] - 1; * - * With these values determined, we simply scan through the - * candidate list, marking all entries in the range - * [first_entry_to_flush, last_entry_to_flush] for flush, - * and all others to be cleaned. + * With these values determined, we simply scan through the + * candidate list, marking all entries in the range + * [first_entry_to_flush, last_entry_to_flush] for flush, + * and all others to be cleaned. * - * Finally, we scan the LRU from tail to head, flushing - * or marking clean the candidate entries as indicated. - * If necessary, we scan the pinned list as well. + * Finally, we scan the LRU from tail to head, flushing + * or marking clean the candidate entries as indicated. + * If necessary, we scan the pinned list as well. * - * Note that this function will fail if any protected or - * clean entries appear on the candidate list. + * Note that this function will fail if any protected or + * clean entries appear on the candidate list. * - * This function is used in managing sync points, and - * shouldn't be used elsewhere. + * This function is used in managing sync points, and + * shouldn't be used elsewhere. * * Return: Success: SUCCEED * @@ -163,6 +163,10 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, * Programmer: John Mainzer * 3/17/10 * + * Changes: Updated sanity checks to allow for the possibility that + * the slist is disabled. + * JRM -- 8/3/20 + * *------------------------------------------------------------------------- */ herr_t @@ -183,14 +187,17 @@ H5C_apply_candidate_list(H5F_t * f, unsigned * candidate_assignment_table = NULL; unsigned entries_to_flush[H5C_RING_NTYPES]; unsigned entries_to_clear[H5C_RING_NTYPES]; - haddr_t addr; - H5C_cache_entry_t * entry_ptr = NULL; + haddr_t addr; + H5C_cache_entry_t * entry_ptr = NULL; + #if H5C_DO_SANITY_CHECKS - haddr_t last_addr; + haddr_t last_addr; #endif /* H5C_DO_SANITY_CHECKS */ + #if H5C_APPLY_CANDIDATE_LIST__DEBUG - char tbl_buf[1024]; + char tbl_buf[1024]; #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ + unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -200,7 +207,8 @@ H5C_apply_candidate_list(H5F_t * f, HDassert(cache_ptr != NULL); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(num_candidates > 0); - HDassert(num_candidates <= cache_ptr->slist_len); + HDassert( ( ! cache_ptr->slist_enabled ) || + ( num_candidates <= cache_ptr->slist_len )); HDassert(candidates_list_ptr != NULL); HDassert(0 <= mpi_rank); HDassert(mpi_rank < mpi_size); @@ -410,13 +418,14 @@ done: /*------------------------------------------------------------------------- + * * Function: H5C_construct_candidate_list__clean_cache * * Purpose: Construct the list of entries that should be flushed to - * clean all entries in the cache. + * clean all entries in the cache. * - * This function is used in managing sync points, and - * shouldn't be used elsewhere. + * This function is used in managing sync points, and + * shouldn't be used elsewhere. * * Return: Success: SUCCEED * @@ -425,6 +434,16 @@ done: * Programmer: John Mainzer * 3/17/10 * + * Changes: With the slist optimization, the slist is not maintained + * unless a flush is in progress. Thus we can not longer use + * cache_ptr->slist_size to determine the total size of + * the entries we must insert in the candidate list. + * + * To address this, we now use cache_ptr->dirty_index_size + * instead. + * + * JRM -- 7/27/20 + * *------------------------------------------------------------------------- */ herr_t @@ -438,60 +457,82 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - /* As a sanity check, set space needed to the size of the skip list. - * This should be the sum total of the sizes of all the dirty entries - * in the metadata cache. + /* As a sanity check, set space needed to the dirty_index_size. This + * should be the sum total of the sizes of all the dirty entries in + * in the metadata cache. Note that if the slist is enabled, + * cache_ptr->slist_size should equal cache_ptr->dirty_index_size. */ - space_needed = cache_ptr->slist_size; + space_needed = cache_ptr->dirty_index_size; + + HDassert( ( ! cache_ptr->slist_enabled ) || + ( space_needed == cache_ptr->slist_size ) ); + /* Recall that while we shouldn't have any protected entries at this * point, it is possible that some dirty entries may reside on the * pinned list at this point. */ - HDassert( cache_ptr->slist_size <= + HDassert( cache_ptr->dirty_index_size <= (cache_ptr->dLRU_list_size + cache_ptr->pel_size) ); - HDassert( cache_ptr->slist_len <= - (cache_ptr->dLRU_list_len + cache_ptr->pel_len) ); + HDassert( ( ! cache_ptr->slist_enabled ) || + ( cache_ptr->slist_len <= + (cache_ptr->dLRU_list_len + cache_ptr->pel_len) ) ); + if(space_needed > 0) { /* we have work to do */ + H5C_cache_entry_t *entry_ptr; unsigned nominated_entries_count = 0; size_t nominated_entries_size = 0; - haddr_t nominated_addr; + haddr_t nominated_addr; - HDassert( cache_ptr->slist_len > 0 ); + HDassert( ( ! cache_ptr->slist_enabled ) || + ( cache_ptr->slist_len > 0 ) ); /* Scan the dirty LRU list from tail forward and nominate sufficient * entries to free up the necessary space. */ entry_ptr = cache_ptr->dLRU_tail_ptr; - while((nominated_entries_size < space_needed) && - (nominated_entries_count < cache_ptr->slist_len) && - (entry_ptr != NULL)) { + + while ( ( nominated_entries_size < space_needed ) && + ( ( ! cache_ptr->slist_enabled ) || + ( nominated_entries_count < cache_ptr->slist_len ) ) && + ( entry_ptr != NULL ) ) { + HDassert( ! (entry_ptr->is_protected) ); HDassert( ! (entry_ptr->is_read_only) ); HDassert( entry_ptr->ro_ref_count == 0 ); HDassert( entry_ptr->is_dirty ); - HDassert( entry_ptr->in_slist ); + HDassert( ( ! cache_ptr->slist_enabled ) || + ( entry_ptr->in_slist ) ); nominated_addr = entry_ptr->addr; + if(H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed") + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "H5AC_add_candidate() failed") nominated_entries_size += entry_ptr->size; nominated_entries_count++; entry_ptr = entry_ptr->aux_prev; + } /* end while */ + HDassert( entry_ptr == NULL ); /* it is possible that there are some dirty entries on the * protected entry list as well -- scan it too if necessary */ entry_ptr = cache_ptr->pel_head_ptr; - while((nominated_entries_size < space_needed) && - (nominated_entries_count < cache_ptr->slist_len) && - (entry_ptr != NULL)) { + + while ( ( nominated_entries_size < space_needed ) && + ( ( ! cache_ptr->slist_enabled ) || + ( nominated_entries_count < cache_ptr->slist_len ) ) && + ( entry_ptr != NULL ) ) { + if(entry_ptr->is_dirty) { + HDassert( ! (entry_ptr->is_protected) ); HDassert( ! (entry_ptr->is_read_only) ); HDassert( entry_ptr->ro_ref_count == 0 ); @@ -499,22 +540,31 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) HDassert( entry_ptr->in_slist ); nominated_addr = entry_ptr->addr; + if(H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed") + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "H5AC_add_candidate() failed") nominated_entries_size += entry_ptr->size; nominated_entries_count++; + } /* end if */ entry_ptr = entry_ptr->next; + } /* end while */ - HDassert( nominated_entries_count == cache_ptr->slist_len ); + HDassert( ( ! cache_ptr->slist_enabled ) || + ( nominated_entries_count == cache_ptr->slist_len ) ); HDassert( nominated_entries_size == space_needed ); + } /* end if */ done: + FUNC_LEAVE_NOAPI(ret_value) + } /* H5C_construct_candidate_list__clean_cache() */ @@ -522,10 +572,10 @@ done: * Function: H5C_construct_candidate_list__min_clean * * Purpose: Construct the list of entries that should be flushed to - * get the cache back within its min clean constraints. + * get the cache back within its min clean constraints. * - * This function is used in managing sync points, and - * shouldn't be used elsewhere. + * This function is used in managing sync points, and + * shouldn't be used elsewhere. * * Return: Success: SUCCEED * @@ -534,6 +584,12 @@ done: * Programmer: John Mainzer * 3/17/10 * + * Changes: With the slist optimization, the slist is not maintained + * unless a flush is in progress. Updated sanity checks to + * reflect this. + * + * JRM -- 7/27/20 + * *------------------------------------------------------------------------- */ herr_t @@ -551,54 +607,77 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr) * cache back within its min clean constraints. */ if(cache_ptr->max_cache_size > cache_ptr->index_size) { - if(((cache_ptr->max_cache_size - cache_ptr->index_size) + - cache_ptr->cLRU_list_size) >= cache_ptr->min_clean_size) + + if ( ( (cache_ptr->max_cache_size - cache_ptr->index_size) + + cache_ptr->cLRU_list_size) >= cache_ptr->min_clean_size ) { + space_needed = 0; - else + + } else { + space_needed = cache_ptr->min_clean_size - ((cache_ptr->max_cache_size - cache_ptr->index_size) + cache_ptr->cLRU_list_size); + } } /* end if */ else { - if(cache_ptr->min_clean_size <= cache_ptr->cLRU_list_size) + + if(cache_ptr->min_clean_size <= cache_ptr->cLRU_list_size) { + space_needed = 0; - else + + } else { + space_needed = cache_ptr->min_clean_size - cache_ptr->cLRU_list_size; + } } /* end else */ if(space_needed > 0) { /* we have work to do */ + H5C_cache_entry_t *entry_ptr; unsigned nominated_entries_count = 0; size_t nominated_entries_size = 0; - HDassert( cache_ptr->slist_len > 0 ); + HDassert( ( ! cache_ptr->slist_enabled ) || + ( cache_ptr->slist_len > 0 ) ); /* Scan the dirty LRU list from tail forward and nominate sufficient * entries to free up the necessary space. */ entry_ptr = cache_ptr->dLRU_tail_ptr; - while((nominated_entries_size < space_needed) && - (nominated_entries_count < cache_ptr->slist_len) && - (entry_ptr != NULL) && - (!entry_ptr->flush_me_last)) { - haddr_t nominated_addr; + + while ( ( nominated_entries_size < space_needed ) && + ( ( ! cache_ptr->slist_enabled ) || + ( nominated_entries_count < cache_ptr->slist_len ) ) && + ( entry_ptr != NULL ) && + ( ! entry_ptr->flush_me_last ) ) { + + haddr_t nominated_addr; HDassert( ! (entry_ptr->is_protected) ); HDassert( ! (entry_ptr->is_read_only) ); HDassert( entry_ptr->ro_ref_count == 0 ); HDassert( entry_ptr->is_dirty ); - HDassert( entry_ptr->in_slist ); + HDassert( ( ! cache_ptr->slist_enabled ) || + ( entry_ptr->in_slist ) ); nominated_addr = entry_ptr->addr; + if(H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed") + + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "H5AC_add_candidate() failed") nominated_entries_size += entry_ptr->size; nominated_entries_count++; entry_ptr = entry_ptr->aux_prev; + } /* end while */ - HDassert( nominated_entries_count <= cache_ptr->slist_len ); + + HDassert( ( ! cache_ptr->slist_enabled ) || + ( nominated_entries_count <= cache_ptr->slist_len ) ); + HDassert( nominated_entries_size <= cache_ptr->dirty_index_size ); HDassert( nominated_entries_size >= space_needed ); } /* end if */ @@ -612,24 +691,24 @@ done: * Function: H5C_mark_entries_as_clean * * Purpose: When the H5C code is used to implement the metadata caches - * in PHDF5, only the cache with MPI_rank 0 is allowed to - * actually write entries to disk -- all other caches must - * retain dirty entries until they are advised that the - * entries are clean. + * in PHDF5, only the cache with MPI_rank 0 is allowed to + * actually write entries to disk -- all other caches must + * retain dirty entries until they are advised that the + * entries are clean. * - * This function exists to allow the H5C code to receive these - * notifications. + * This function exists to allow the H5C code to receive these + * notifications. * - * The function receives a list of entry base addresses - * which must refer to dirty entries in the cache. If any - * of the entries are either clean or don't exist, the - * function flags an error. + * The function receives a list of entry base addresses + * which must refer to dirty entries in the cache. If any + * of the entries are either clean or don't exist, the + * function flags an error. * - * The function scans the list of entries and flushes all - * those that are currently unprotected with the - * H5C__FLUSH_CLEAR_ONLY_FLAG. Those that are currently - * protected are flagged for clearing when they are - * unprotected. + * The function scans the list of entries and flushes all + * those that are currently unprotected with the + * H5C__FLUSH_CLEAR_ONLY_FLAG. Those that are currently + * protected are flagged for clearing when they are + * unprotected. * * Return: Non-negative on success/Negative on failure * @@ -644,22 +723,22 @@ H5C_mark_entries_as_clean(H5F_t * f, haddr_t * ce_array_ptr) { H5C_t * cache_ptr; - unsigned entries_cleared; + unsigned entries_cleared; unsigned pinned_entries_cleared; hbool_t progress; - unsigned entries_examined; - unsigned initial_list_len; - haddr_t addr; - unsigned pinned_entries_marked = 0; + unsigned entries_examined; + unsigned initial_list_len; + haddr_t addr; + unsigned pinned_entries_marked = 0; #if H5C_DO_SANITY_CHECKS - unsigned protected_entries_marked = 0; - unsigned other_entries_marked = 0; - haddr_t last_addr; + unsigned protected_entries_marked = 0; + unsigned other_entries_marked = 0; + haddr_t last_addr; #endif /* H5C_DO_SANITY_CHECKS */ - H5C_cache_entry_t * clear_ptr = NULL; - H5C_cache_entry_t * entry_ptr = NULL; + H5C_cache_entry_t * clear_ptr = NULL; + H5C_cache_entry_t * entry_ptr = NULL; unsigned u; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -706,7 +785,7 @@ H5C_mark_entries_as_clean(H5F_t * f, if(entry_ptr == NULL) { #if H5C_DO_SANITY_CHECKS - HDfprintf(stdout, + HDfprintf(stdout, "H5C_mark_entries_as_clean: entry[%u] = %a not in cache.\n", u, addr); @@ -715,7 +794,7 @@ H5C_mark_entries_as_clean(H5F_t * f, } /* end if */ else if(!entry_ptr->is_dirty) { #if H5C_DO_SANITY_CHECKS - HDfprintf(stdout, + HDfprintf(stdout, "H5C_mark_entries_as_clean: entry %a is not dirty!?!\n", addr); #endif /* H5C_DO_SANITY_CHECKS */ @@ -735,13 +814,13 @@ H5C_mark_entries_as_clean(H5F_t * f, } /* end if */ entry_ptr->clear_on_unprotect = TRUE; - if(entry_ptr->is_pinned) - pinned_entries_marked++; + if(entry_ptr->is_pinned) + pinned_entries_marked++; #if H5C_DO_SANITY_CHECKS - else if(entry_ptr->is_protected) - protected_entries_marked++; - else - other_entries_marked++; + else if(entry_ptr->is_protected) + protected_entries_marked++; + else + other_entries_marked++; #endif /* H5C_DO_SANITY_CHECKS */ } } @@ -769,7 +848,7 @@ H5C_mark_entries_as_clean(H5F_t * f, * of the pre_serialize / serialize routines, this may * cease to be the case -- requiring a review of this * point. - * JRM -- 4/7/15 + * JRM -- 4/7/15 */ entries_cleared = 0; entries_examined = 0; @@ -873,9 +952,9 @@ done: herr_t H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial) { - uint32_t clear_cnt; - H5C_cache_entry_t * entry_ptr = NULL; - herr_t ret_value = SUCCEED; + uint32_t clear_cnt; + H5C_cache_entry_t * entry_ptr = NULL; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -1084,7 +1163,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C__flush_candidate_entries * - * Purpose: Flush or clear (as indicated) the candidate entries that + * Purpose: Flush or clear (as indicated) the candidate entries that * have been marked in the metadata cache. In so doing, * observe rings and flush dependencies. * @@ -1113,9 +1192,9 @@ done: * Return: Non-negative on success/Negative on failure. * * Programmer: John Mainzer - * 2/10/17 + * 2/10/17 * - * Changes: None. + * Changes: None. * *------------------------------------------------------------------------- */ @@ -1124,17 +1203,17 @@ H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES unsigned entries_to_clear[H5C_RING_NTYPES]) { #if H5C_DO_SANITY_CHECKS - int i; - uint32_t index_len = 0; - size_t index_size = (size_t)0; - size_t clean_index_size = (size_t)0; - size_t dirty_index_size = (size_t)0; - size_t slist_size = (size_t)0; - uint32_t slist_len = 0; + int i; + uint32_t index_len = 0; + size_t index_size = (size_t)0; + size_t clean_index_size = (size_t)0; + size_t dirty_index_size = (size_t)0; + size_t slist_size = (size_t)0; + uint32_t slist_len = 0; #endif /* H5C_DO_SANITY_CHECKS */ - H5C_ring_t ring; + H5C_ring_t ring; H5C_t * cache_ptr; - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -1164,7 +1243,7 @@ H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES clean_index_size += cache_ptr->clean_index_ring_size[i]; dirty_index_size += cache_ptr->dirty_index_ring_size[i]; - slist_len += cache_ptr->slist_ring_len[i]; + slist_len += cache_ptr->slist_ring_len[i]; slist_size += cache_ptr->slist_ring_size[i]; } /* end for */ @@ -1206,7 +1285,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C__flush_candidates_in_ring * - * Purpose: Flush or clear (as indicated) the candidate entries + * Purpose: Flush or clear (as indicated) the candidate entries * contained in the specified cache and ring. All candidate * entries in rings outside the specified ring must have been * flushed (or cleared) on entry. @@ -1235,7 +1314,7 @@ done: * Return: Non-negative on success/Negative on failure. * * Programmer: John Mainzer - * 2/10/17 + * 2/10/17 * *------------------------------------------------------------------------- */ diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 8712af5..ac761f6 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -47,13 +47,22 @@ /* Number of epoch markers active */ #define H5C__MAX_EPOCH_MARKERS 10 + /* Cache configuration settings */ #define H5C__HASH_TABLE_LEN (64 * 1024) /* must be a power of 2 */ #define H5C__H5C_T_MAGIC 0x005CAC0E + /* Initial allocated size of the "flush_dep_parent" array */ #define H5C_FLUSH_DEP_PARENT_INIT 8 + +/* Set to TRUE to enable the slist optimization. If this field is TRUE, + * the slist is disabled whenever a flush is not in progress. + */ +#define H5C__SLIST_OPT_ENABLED TRUE + + /**************************************************************************** * * We maintain doubly linked lists of instances of H5C_cache_entry_t for a @@ -1568,49 +1577,82 @@ if ( ( (cache_ptr)->index_size != \ * Added code to maintain the cache_ptr->slist_ring_len * and cache_ptr->slist_ring_size arrays. * + * JRM -- 4/29/20 + * Reworked macro to support the slist_enabled field + * of H5C_t. If slist_enabled == TRUE, the macro + * functions as before. Otherwise, the macro is a no-op, + * and the slist must be empty. + * *------------------------------------------------------------------------- */ +/* NOTE: The H5C__INSERT_ENTRY_IN_SLIST() macro is set up so that + * + * H5C_DO_SANITY_CHECKS + * + * and + * + * H5C_DO_SLIST_SANITY_CHECKS + * + * can be selected independantly. This is easy to miss as the + * two #defines are easy to confuse. + */ + #if H5C_DO_SLIST_SANITY_CHECKS + #define ENTRY_IN_SLIST(cache_ptr, entry_ptr) \ H5C_entry_in_skip_list((cache_ptr), (entry_ptr)) + #else /* H5C_DO_SLIST_SANITY_CHECKS */ + #define ENTRY_IN_SLIST(cache_ptr, entry_ptr) FALSE + #endif /* H5C_DO_SLIST_SANITY_CHECKS */ + #if H5C_DO_SANITY_CHECKS #define H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, fail_val) \ { \ HDassert( (cache_ptr) ); \ HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( (entry_ptr)->size > 0 ); \ - HDassert( H5F_addr_defined((entry_ptr)->addr) ); \ - HDassert( !((entry_ptr)->in_slist) ); \ - HDassert( !ENTRY_IN_SLIST((cache_ptr), (entry_ptr)) ); \ - HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ - HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ - HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ - (cache_ptr)->slist_len ); \ - HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ - (cache_ptr)->slist_size ); \ \ - if(H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) < 0) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), "can't insert entry in skip list") \ + if ( (cache_ptr)->slist_enabled ) { \ + \ + HDassert( (entry_ptr) ); \ + HDassert( (entry_ptr)->size > 0 ); \ + HDassert( H5F_addr_defined((entry_ptr)->addr) ); \ + HDassert( !((entry_ptr)->in_slist) ); \ + HDassert( ! ENTRY_IN_SLIST((cache_ptr), (entry_ptr)) ); \ + HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ + HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ + HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_len ); \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_size ); \ \ - (entry_ptr)->in_slist = TRUE; \ - (cache_ptr)->slist_changed = TRUE; \ - (cache_ptr)->slist_len++; \ - (cache_ptr)->slist_size += (entry_ptr)->size; \ - ((cache_ptr)->slist_ring_len[(entry_ptr)->ring])++; \ - ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) += (entry_ptr)->size; \ - (cache_ptr)->slist_len_increase++; \ - (cache_ptr)->slist_size_increase += (int64_t)((entry_ptr)->size); \ + if ( H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, \ + &((entry_ptr)->addr)) < 0) \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ + "can't insert entry in skip list") \ \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - HDassert( (cache_ptr)->slist_size > 0 ); \ + (entry_ptr)->in_slist = TRUE; \ + (cache_ptr)->slist_changed = TRUE; \ + (cache_ptr)->slist_len++; \ + (cache_ptr)->slist_size += (entry_ptr)->size; \ + ((cache_ptr)->slist_ring_len[(entry_ptr)->ring])++; \ + ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) += (entry_ptr)->size;\ + (cache_ptr)->slist_len_increase++; \ + (cache_ptr)->slist_size_increase += (int64_t)((entry_ptr)->size); \ \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + HDassert( (cache_ptr)->slist_size > 0 ); \ + \ + } else { /* slist disabled */ \ + \ + HDassert( (cache_ptr)->slist_len == 0 ); \ + HDassert( (cache_ptr)->slist_size == 0 ); \ + } \ } /* H5C__INSERT_ENTRY_IN_SLIST */ #else /* H5C_DO_SANITY_CHECKS */ @@ -1619,31 +1661,42 @@ if ( ( (cache_ptr)->index_size != \ { \ HDassert( (cache_ptr) ); \ HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( (entry_ptr)->size > 0 ); \ - HDassert( H5F_addr_defined((entry_ptr)->addr) ); \ - HDassert( !((entry_ptr)->in_slist) ); \ - HDassert( !ENTRY_IN_SLIST((cache_ptr), (entry_ptr)) ); \ - HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ - HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ - HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ - (cache_ptr)->slist_len ); \ - HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ - (cache_ptr)->slist_size ); \ \ - if(H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &(entry_ptr)->addr) < 0) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), "can't insert entry in skip list") \ + if ( (cache_ptr)->slist_enabled ) { \ + \ + HDassert( (entry_ptr) ); \ + HDassert( (entry_ptr)->size > 0 ); \ + HDassert( ! ENTRY_IN_SLIST((cache_ptr), (entry_ptr)) ); \ + HDassert( H5F_addr_defined((entry_ptr)->addr) ); \ + HDassert( !((entry_ptr)->in_slist) ); \ + HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ + HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ + HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_len ); \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_size ); \ + HDassert( (cache_ptr)->slist_ptr ); \ + \ + if ( H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, \ + &((entry_ptr)->addr)) < 0) \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), \ + "can't insert entry in skip list") \ \ - (entry_ptr)->in_slist = TRUE; \ - (cache_ptr)->slist_changed = TRUE; \ - (cache_ptr)->slist_len++; \ - (cache_ptr)->slist_size += (entry_ptr)->size; \ - ((cache_ptr)->slist_ring_len[(entry_ptr)->ring])++; \ - ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) += (entry_ptr)->size; \ + (entry_ptr)->in_slist = TRUE; \ + (cache_ptr)->slist_changed = TRUE; \ + (cache_ptr)->slist_len++; \ + (cache_ptr)->slist_size += (entry_ptr)->size; \ + ((cache_ptr)->slist_ring_len[(entry_ptr)->ring])++; \ + ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) += (entry_ptr)->size;\ \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - HDassert( (cache_ptr)->slist_size > 0 ); \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + HDassert( (cache_ptr)->slist_size > 0 ); \ \ + } else { /* slist disabled */ \ + \ + HDassert( (cache_ptr)->slist_len == 0 ); \ + HDassert( (cache_ptr)->slist_size == 0 ); \ + } \ } /* H5C__INSERT_ENTRY_IN_SLIST */ #endif /* H5C_DO_SANITY_CHECKS */ @@ -1661,80 +1714,129 @@ if ( ( (cache_ptr)->index_size != \ * * Programmer: John Mainzer, 5/10/04 * + * Modifications: + * + * JRM -- 7/21/04 + * Updated function for the addition of the hash table. + * + * JRM - 7/27/04 + * Converted from the function H5C_remove_entry_from_tree() + * to the macro H5C__REMOVE_ENTRY_FROM_TREE in the hopes of + * wringing a little more performance out of the cache. + * + * QAK -- 11/27/04 + * Switched over to using skip list routines. + * + * JRM -- 3/28/07 + * Updated sanity checks for the new is_read_only and + * ro_ref_count fields in H5C_cache_entry_t. + * + * JRM -- 12/13/14 + * Added code to set cache_ptr->slist_changed to TRUE + * when an entry is removed from the slist. + * + * JRM -- 4/29/20 + * Reworked macro to support the slist_enabled field + * of H5C_t. If slist_enabled == TRUE, the macro + * functions as before. Otherwise, the macro is a no-op, + * and the slist must be empty. + * *------------------------------------------------------------------------- */ #if H5C_DO_SANITY_CHECKS -#define H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, during_flush) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - HDassert( (entry_ptr)->in_slist ); \ - HDassert( (cache_ptr)->slist_ptr ); \ - HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ - HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ - HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ - (cache_ptr)->slist_len ); \ - HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ - (cache_ptr)->slist_size ); \ - \ - if ( H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) \ - != (entry_ptr) ) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "can't delete entry from skip list") \ - \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - if(!(during_flush)) \ - (cache_ptr)->slist_changed = TRUE; \ - (cache_ptr)->slist_len--; \ - HDassert( (cache_ptr)->slist_size >= (entry_ptr)->size ); \ - (cache_ptr)->slist_size -= (entry_ptr)->size; \ - ((cache_ptr)->slist_ring_len[(entry_ptr)->ring])--; \ - HDassert( (cache_ptr)->slist_ring_size[(entry_ptr->ring)] >= \ - (entry_ptr)->size ); \ - ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (entry_ptr)->size; \ - (cache_ptr)->slist_len_increase--; \ - (cache_ptr)->slist_size_increase -= (int64_t)((entry_ptr)->size); \ - (entry_ptr)->in_slist = FALSE; \ +#define H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, during_flush) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + \ + if ( (cache_ptr)->slist_enabled ) { \ + \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->size > 0 ); \ + HDassert( (entry_ptr)->in_slist ); \ + HDassert( (cache_ptr)->slist_ptr ); \ + HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ + HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ + HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_len ); \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_size ); \ + HDassert( (cache_ptr)->slist_size >= (entry_ptr)->size ); \ + \ + if ( H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) \ + != (entry_ptr) ) \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, \ + "can't delete entry from skip list") \ + \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + if(!(during_flush)) \ + (cache_ptr)->slist_changed = TRUE; \ + (cache_ptr)->slist_len--; \ + HDassert( (cache_ptr)->slist_size >= (entry_ptr)->size ); \ + (cache_ptr)->slist_size -= (entry_ptr)->size; \ + ((cache_ptr)->slist_ring_len[(entry_ptr)->ring])--; \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr->ring)] >= \ + (entry_ptr)->size ); \ + ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (entry_ptr)->size;\ + (cache_ptr)->slist_len_increase--; \ + (cache_ptr)->slist_size_increase -= (int64_t)((entry_ptr)->size); \ + (entry_ptr)->in_slist = FALSE; \ + \ + } else { /* slist disabled */ \ + \ + HDassert( (cache_ptr)->slist_len == 0 ); \ + HDassert( (cache_ptr)->slist_size == 0 ); \ + } \ } /* H5C__REMOVE_ENTRY_FROM_SLIST */ #else /* H5C_DO_SANITY_CHECKS */ -#define H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, during_flush) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->in_slist ); \ - HDassert( (cache_ptr)->slist_ptr ); \ - HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ - HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ - HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ - (cache_ptr)->slist_len ); \ - HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ - (cache_ptr)->slist_size ); \ - \ - if ( H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) \ - != (entry_ptr) ) \ - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "can't delete entry from skip list") \ - \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - if(!(during_flush)) \ - (cache_ptr)->slist_changed = TRUE; \ - (cache_ptr)->slist_len--; \ - HDassert( (cache_ptr)->slist_size >= (entry_ptr)->size ); \ - (cache_ptr)->slist_size -= (entry_ptr)->size; \ - ((cache_ptr)->slist_ring_len[(entry_ptr)->ring])--; \ - HDassert( (cache_ptr)->slist_ring_size[(entry_ptr->ring)] >= \ - (entry_ptr)->size ); \ - ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (entry_ptr)->size; \ - (entry_ptr)->in_slist = FALSE; \ +#define H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, during_flush) \ +{ \ + HDassert( (cache_ptr) ); \ + HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ + \ + if ( (cache_ptr)->slist_enabled ) { \ + \ + HDassert( (entry_ptr) ); \ + HDassert( !((entry_ptr)->is_read_only) ); \ + HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ + HDassert( (entry_ptr)->in_slist ); \ + HDassert( (cache_ptr)->slist_ptr ); \ + HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ + HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ + HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_len ); \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_size ); \ + \ + if ( H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) \ + != (entry_ptr) ) \ + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, \ + "can't delete entry from skip list") \ + \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + if(!(during_flush)) \ + (cache_ptr)->slist_changed = TRUE; \ + (cache_ptr)->slist_len--; \ + HDassert( (cache_ptr)->slist_size >= (entry_ptr)->size ); \ + (cache_ptr)->slist_size -= (entry_ptr)->size; \ + ((cache_ptr)->slist_ring_len[(entry_ptr)->ring])--; \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr->ring)] >= \ + (entry_ptr)->size ); \ + ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (entry_ptr)->size;\ + (entry_ptr)->in_slist = FALSE; \ + \ + } else { /* slist disabled */ \ + \ + HDassert( (cache_ptr)->slist_len == 0 ); \ + HDassert( (cache_ptr)->slist_size == 0 ); \ + } \ } /* H5C__REMOVE_ENTRY_FROM_SLIST */ + #endif /* H5C_DO_SANITY_CHECKS */ @@ -1770,6 +1872,12 @@ if ( ( (cache_ptr)->index_size != \ * Added code to maintain the cache_ptr->slist_ring_len * and cache_ptr->slist_ring_size arrays. * + * JRM -- 4/29/20 + * Reworked macro to support the slist_enabled field + * of H5C_t. If slist_enabled == TRUE, the macro + * functions as before. Otherwise, the macro is a no-op, + * and the slist must be empty. + * *------------------------------------------------------------------------- */ @@ -1779,32 +1887,43 @@ if ( ( (cache_ptr)->index_size != \ { \ HDassert( (cache_ptr) ); \ HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (old_size) > 0 ); \ - HDassert( (new_size) > 0 ); \ - HDassert( (old_size) <= (cache_ptr)->slist_size ); \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - HDassert( ((cache_ptr)->slist_len > 1) || \ - ( (cache_ptr)->slist_size == (old_size) ) ); \ - HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ - HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ - HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ - (cache_ptr)->slist_len ); \ - HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ - (cache_ptr)->slist_size ); \ \ - (cache_ptr)->slist_size -= (old_size); \ - (cache_ptr)->slist_size += (new_size); \ + if ( (cache_ptr)->slist_enabled ) { \ + \ + HDassert( (old_size) > 0 ); \ + HDassert( (new_size) > 0 ); \ + HDassert( (old_size) <= (cache_ptr)->slist_size ); \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + HDassert( ((cache_ptr)->slist_len > 1) || \ + ( (cache_ptr)->slist_size == (old_size) ) ); \ + HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ + HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ + HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_len ); \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_size ); \ + \ + (cache_ptr)->slist_size -= (old_size); \ + (cache_ptr)->slist_size += (new_size); \ + \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr->ring)] \ + >= (old_size) ); \ \ - HDassert( (cache_ptr)->slist_ring_size[(entry_ptr->ring)] >=(old_size) ); \ - ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (old_size); \ - ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) += (new_size); \ + ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (old_size); \ + ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) += (new_size); \ \ - (cache_ptr)->slist_size_increase -= (int64_t)(old_size); \ - (cache_ptr)->slist_size_increase += (int64_t)(new_size); \ + (cache_ptr)->slist_size_increase -= (int64_t)(old_size); \ + (cache_ptr)->slist_size_increase += (int64_t)(new_size); \ \ - HDassert( (new_size) <= (cache_ptr)->slist_size ); \ - HDassert( ( (cache_ptr)->slist_len > 1 ) || \ - ( (cache_ptr)->slist_size == (new_size) ) ); \ + HDassert( (new_size) <= (cache_ptr)->slist_size ); \ + HDassert( ( (cache_ptr)->slist_len > 1 ) || \ + ( (cache_ptr)->slist_size == (new_size) ) ); \ + \ + } else { /* slist disabled */ \ + \ + HDassert( (cache_ptr)->slist_len == 0 ); \ + HDassert( (cache_ptr)->slist_size == 0 ); \ + } \ } /* H5C__UPDATE_SLIST_FOR_SIZE_CHANGE */ #else /* H5C_DO_SANITY_CHECKS */ @@ -1813,29 +1932,39 @@ if ( ( (cache_ptr)->index_size != \ { \ HDassert( (cache_ptr) ); \ HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (old_size) > 0 ); \ - HDassert( (new_size) > 0 ); \ - HDassert( (old_size) <= (cache_ptr)->slist_size ); \ - HDassert( (cache_ptr)->slist_len > 0 ); \ - HDassert( ((cache_ptr)->slist_len > 1) || \ - ( (cache_ptr)->slist_size == (old_size) ) ); \ - HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ - HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ - HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ - (cache_ptr)->slist_len ); \ - HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ - (cache_ptr)->slist_size ); \ \ - (cache_ptr)->slist_size -= (old_size); \ - (cache_ptr)->slist_size += (new_size); \ + if ( (cache_ptr)->slist_enabled ) { \ + \ + HDassert( (old_size) > 0 ); \ + HDassert( (new_size) > 0 ); \ + HDassert( (old_size) <= (cache_ptr)->slist_size ); \ + HDassert( (cache_ptr)->slist_len > 0 ); \ + HDassert( ((cache_ptr)->slist_len > 1) || \ + ( (cache_ptr)->slist_size == (old_size) ) ); \ + HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ + HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ + HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_len ); \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ + (cache_ptr)->slist_size ); \ + \ + (cache_ptr)->slist_size -= (old_size); \ + (cache_ptr)->slist_size += (new_size); \ + \ + HDassert( (cache_ptr)->slist_ring_size[(entry_ptr->ring)] >= \ + (old_size) ); \ + ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (old_size); \ + ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) += (new_size); \ \ - HDassert( (cache_ptr)->slist_ring_size[(entry_ptr->ring)] >=(old_size) ); \ - ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (old_size); \ - ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) += (new_size); \ + HDassert( (new_size) <= (cache_ptr)->slist_size ); \ + HDassert( ( (cache_ptr)->slist_len > 1 ) || \ + ( (cache_ptr)->slist_size == (new_size) ) ); \ \ - HDassert( (new_size) <= (cache_ptr)->slist_size ); \ - HDassert( ( (cache_ptr)->slist_len > 1 ) || \ - ( (cache_ptr)->slist_size == (new_size) ) ); \ + } else { /* slist disabled */ \ + \ + HDassert( (cache_ptr)->slist_len == 0 ); \ + HDassert( (cache_ptr)->slist_size == 0 ); \ + } \ } /* H5C__UPDATE_SLIST_FOR_SIZE_CHANGE */ #endif /* H5C_DO_SANITY_CHECKS */ @@ -3726,7 +3855,8 @@ typedef struct H5C_tag_info_t { * which contains the 'next' entry for an iteration. Removing * this entry must trigger a rescan of the iteration, so each * entry removed from the cache is compared against this pointer - * and the pointer is reset to NULL if the watched entry is removed. + * and the pointer is reset to NULL if the watched entry is + * removed. * (This functions similarly to a "dead man's switch") * * @@ -3740,6 +3870,36 @@ typedef struct H5C_tag_info_t { * are flushed. (this has been changed -- dirty entries are now removed from * the skip list as they are flushed. JRM - 10/25/05) * + * Update 4/21/20: + * + * Profiling indicates that the cost of maintaining the skip list is + * significant. As it is only used on flush and close, maintaining it + * only when needed is an obvious optimization. + * + * To do this, we add a flag to control maintenanace of the skip list. + * This flag is initially set to FALSE, which disables all operations + * on the skip list. + * + * At the beginning of either flush or close, we scan the index list, + * insert all dirtly entries in the skip list, and enable operations + * on skip list by setting above control flag to true. + * + * At the end of a complete flush, we verify that the skip list is empty, + * and set the control flag back to false, so as to avoid skip list + * maintenance overhead until the next flush or close. + * + * In the case of a partial flush (i.e. flush marked entries), we remove + * all remaining entries from the skip list, and then set the control flag + * back to false -- again avoiding skip list maintenance overhead until + * the next flush or close. + * + * slist_enabled: Boolean flag used to control operation of the skip + * list. If this filed is FALSE, operations on the + * slist are no-ops, and the slist must be empty. If + * it is TRUE, operations on the slist proceed as usual, + * and all dirty entries in the metadata cache must be + * listed in the slist. + * * slist_changed: Boolean flag used to indicate whether the contents of * the slist has changed since the last time this flag was * reset. This is used in the cache flush code to detect @@ -4649,6 +4809,7 @@ typedef struct H5C_tag_info_t { * NDEBUG is not #defined. * ****************************************************************************/ + struct H5C_t { uint32_t magic; hbool_t flush_in_progress; @@ -4664,7 +4825,7 @@ struct H5C_t { hbool_t evictions_enabled; hbool_t close_warning_received; - /* Fields for maintaining [hash table] index of entries */ + /* Fields for maintaining the [hash table] index of entries */ uint32_t index_len; size_t index_size; uint32_t index_ring_len[H5C_RING_NTYPES]; @@ -4685,6 +4846,7 @@ struct H5C_t { H5C_cache_entry_t * entry_watched_for_removal; /* Fields for maintaining list of in-order entries, for flushing */ + hbool_t slist_enabled; hbool_t slist_changed; uint32_t slist_len; size_t slist_size; @@ -4882,7 +5044,8 @@ struct H5C_t { #ifndef NDEBUG int64_t get_entry_ptr_from_addr_counter; #endif /* NDEBUG */ -}; + +}; /* H5C_t */ /* Define typedef for tagged cache entry iteration callbacks */ typedef int (*H5C_tag_iter_cb_t)(H5C_cache_entry_t *entry, void *ctx); diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 0ba0234..cdccb4f 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -2288,7 +2288,10 @@ H5_DLL herr_t H5C_resize_entry(void *thing, size_t new_size); H5_DLL herr_t H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_ptr); H5_DLL herr_t H5C_set_cache_image_config(const H5F_t *f, H5C_t *cache_ptr, H5C_cache_image_ctl_t *config_ptr); -H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled); +H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr, + hbool_t evictions_enabled); +H5_DLL herr_t H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, + hbool_t clear_slist); H5_DLL herr_t H5C_set_prefix(H5C_t *cache_ptr, char *prefix); H5_DLL herr_t H5C_stats(H5C_t *cache_ptr, const char *cache_name, hbool_t display_detailed_stats); diff --git a/src/H5Fint.c b/src/H5Fint.c index 0bda894..4a4b8b6 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1914,6 +1914,11 @@ H5F__flush_phase2(H5F_t *f, hbool_t closing) /* Sanity check arguments */ HDassert(f); + /* Inform the metadata cache that we are about to flush */ + if(H5AC_prep_for_file_flush(f) < 0) + /* Push error, but keep going*/ + HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "prep for MDC flush failed") + /* Flush the entire metadata cache */ if(H5AC_flush(f) < 0) /* Push error, but keep going*/ @@ -1946,6 +1951,11 @@ H5F__flush_phase2(H5F_t *f, hbool_t closing) H5CX_set_mpi_file_flushing(FALSE); #endif /* H5_HAVE_PARALLEL */ + /* Inform the metadata cache that we are done with the flush */ + if(H5AC_secure_from_file_flush(f) < 0) + /* Push error, but keep going*/ + HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "secure from MDC flush failed") + /* Flush out the metadata accumulator */ if(H5F__accum_flush(f->shared) < 0) /* Push error, but keep going*/ diff --git a/test/cache.c b/test/cache.c index bb18728..8eda0a2 100644 --- a/test/cache.c +++ b/test/cache.c @@ -2933,21 +2933,25 @@ express_test, unsigned paged) /*------------------------------------------------------------------------- * Function: check_insert_entry() * - * Purpose: Verify that H5C_insert_entry behaves as expected. - * Test the behaviour with different flags. + * Purpose: Verify that H5C_insert_entry behaves as expected. + * Test the behaviour with different flags. * - * This test was added primarily to test basic insert - * pinned entry functionallity, but I through in explicit - * tests for other functionallity that is tested implicitly - * elsewhere. + * This test was added primarily to test basic insert + * pinned entry functionallity, but I through in explicit + * tests for other functionallity that is tested implicitly + * elsewhere. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 8/10/06 * * Modifications: * + * Updated tests to accommodate the case in which the + * slist is disabled. + * JRM -- 5/14/20 + * *------------------------------------------------------------------------- */ @@ -3154,52 +3158,59 @@ check_insert_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 4) || - (cache_ptr->index_size != 4 * entry_sizes[entry_type]) || - (cache_ptr->slist_len != 4) || - (cache_ptr->slist_size != 4 * entry_sizes[entry_type]) || - (cache_ptr->pl_len != 0) || - (cache_ptr->pl_size != (size_t)0) || - (cache_ptr->pel_len != 2) || - (cache_ptr->pel_size != 2 * entry_sizes[entry_type]) || - (cache_ptr->LRU_list_len != 2) || - (cache_ptr->LRU_list_size != 2 * entry_sizes[entry_type]) + if ( ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 4 * entry_sizes[entry_type] ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 4 ) || + ( cache_ptr->slist_size != 4 * entry_sizes[entry_type] ) + ) + ) || + ( cache_ptr->pl_len != 0 ) || + ( cache_ptr->pl_size != (size_t)0 ) || + ( cache_ptr->pel_len != 2 ) || + ( cache_ptr->pel_size != 2 * entry_sizes[entry_type] ) || + ( cache_ptr->LRU_list_len != 2 ) || + ( cache_ptr->LRU_list_size != 2 * entry_sizes[entry_type] ) #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - || (cache_ptr->dLRU_list_len != 2) || - (cache_ptr->dLRU_list_size != 2 * entry_sizes[entry_type]) || - (cache_ptr->cLRU_list_len != 0) || - (cache_ptr->cLRU_list_size != (size_t)0) + || + ( cache_ptr->dLRU_list_len != 2 ) || + ( cache_ptr->dLRU_list_size != 2 * entry_sizes[entry_type] ) || + ( cache_ptr->cLRU_list_len != 0 ) || + ( cache_ptr->cLRU_list_size != (size_t)0 ) #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - ) { + ) { - pass = FALSE; - failure_mssg = "Unexpected insert results 10."; - } + pass = FALSE; + failure_mssg = "Unexpected insert results 10."; + } } /* Finally, if stats collection is enabled, verify that the expected * stats are collected. */ #if H5C_COLLECT_CACHE_STATS - if(pass) { - - if((cache_ptr->insertions[entry_type] != 4) || - (cache_ptr->pinned_insertions[entry_type] != 2) || - (cache_ptr->pins[entry_type] != 2) || - (cache_ptr->unpins[entry_type] != 0) || - (cache_ptr->dirty_pins[entry_type] != 0) || - (cache_ptr->max_index_len != 4) || - (cache_ptr->max_index_size != 4 * entry_sizes[entry_type]) || - (cache_ptr->max_slist_len != 4) || - (cache_ptr->max_slist_size != 4 * entry_sizes[entry_type]) || - (cache_ptr->max_pl_len != 0) || - (cache_ptr->max_pl_size != (size_t)0) || - (cache_ptr->max_pel_len != 2) || - (cache_ptr->max_pel_size != 2 * entry_sizes[entry_type])) { - - pass = FALSE; - failure_mssg = "Unexpected insert results 11."; - } + if ( pass ) { + + if ( ( cache_ptr->insertions[entry_type] != 4 ) || + ( cache_ptr->pinned_insertions[entry_type] != 2 ) || + ( cache_ptr->pins[entry_type] != 2 ) || + ( cache_ptr->unpins[entry_type] != 0 ) || + ( cache_ptr->dirty_pins[entry_type] != 0 ) || + ( cache_ptr->max_index_len != 4 ) || + ( cache_ptr->max_index_size != 4 * entry_sizes[entry_type] ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 4 ) || + ( cache_ptr->slist_size != 4 * entry_sizes[entry_type] ) + ) + ) || + ( cache_ptr->max_pl_len != 0 ) || + ( cache_ptr->max_pl_size != (size_t)0 ) || + ( cache_ptr->max_pel_len != 2 ) || + ( cache_ptr->max_pel_size != 2 * entry_sizes[entry_type] ) ) { + + pass = FALSE; + failure_mssg = "Unexpected insert results 11."; + } } #endif /* H5C_COLLECT_CACHE_STATS */ @@ -3208,7 +3219,7 @@ check_insert_entry(unsigned paged) if(pass) { unpin_entry(entry_type, 2); - unpin_entry(entry_type, 3); + unpin_entry(entry_type, 3); } if(pass) { @@ -3316,18 +3327,25 @@ check_flush_cache(unsigned paged) /*------------------------------------------------------------------------- + * * Function: check_flush_cache__empty_cache() * - * Purpose: Verify that flush_cache behaves as expected with an empty + * Purpose : Verify that flush_cache behaves as expected with an empty * cache. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 1/12/05 * * Modifications: * + * Added code to setup and take down the skip list before + * and after calls to H5C_flush_cache(). Do this via the + * H5C_FLUSH_CACHE macro. + * + * JRM -- 5/14/20 + * *------------------------------------------------------------------------- */ @@ -3335,7 +3353,6 @@ static void check_flush_cache__empty_cache(H5F_t * file_ptr) { H5C_t * cache_ptr = file_ptr->shared->cache; - herr_t result; if(cache_ptr == NULL) { @@ -3352,53 +3369,37 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) /* Test behaviour on an empty cache. Can't do much sanity * checking in this case, so simply check the return values. + * + * Check of return values is done in the H5C_FLUSH_CACHE() macro. */ - if(pass) { + if ( pass ) { - result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); - - if(result < 0) { - - pass = FALSE; - failure_mssg = "flush with flags = 0x00 failed on empty cache.\n"; - } + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, \ + "flush with flags = 0x00 failed on empty cache.\n") } - if(pass) { - - result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); - - if(result < 0) { + if ( pass ) { - pass = FALSE; - failure_mssg = "flush with flags = 0x04 failed on empty cache.\n"; - } + H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_INVALIDATE_FLAG, \ + "flush with flags = 0x04 failed on empty cache.\n") } - if(pass) { - - result = H5C_flush_cache(file_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG); + if ( pass ) { - if(result < 0) { - - pass = FALSE; - failure_mssg = "flush with flags = 0x08 failed on empty cache.\n"; - } + H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG, \ + "flush with flags = 0x08 failed on empty cache.\n") } - if(pass) { - - result = H5C_flush_cache(file_ptr, H5C__FLUSH_MARKED_ENTRIES_FLAG); + if ( pass ) { - if(result < 0) { - - pass = FALSE; - failure_mssg = "flush with flags = 0x10 failed on empty cache.\n"; - } + H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_MARKED_ENTRIES_FLAG, \ + "flush with flags = 0x10 failed on empty cache.\n") } + return; + } /* check_flush_cache__empty_cache() */ @@ -4959,15 +4960,21 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /*------------------------------------------------------------------------- * Function: check_flush_cache__multi_entry_test() * - * Purpose: Run a multi entry flush cache test. + * Purpose : Run a multi entry flush cache test. * - * Return: void - * - * Programmer: John Mainzer + * Return: void + * + * Programmer: John Mainzer * 1/13/05 * * Modifications: * + * Added code to setup and take down the skip list before + * and after calls to H5C_flush_cache(). Do this via the + * H5C_FLUSH_CACHE macro. + * + * JRM -- 5/14/20 + * *------------------------------------------------------------------------- */ @@ -4980,7 +4987,6 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, { H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; - herr_t result; unsigned u; size_t total_entry_size = 0; test_entry_t * base_addr; @@ -4989,8 +4995,8 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, #if 0 /* JRM */ /* This gets used a lot, so lets leave it in. */ - HDfprintf(stdout, "check_flush_cache__multi_entry_test: test %d\n", - test_num); + HDfprintf(stdout, "check_flush_cache__multi_entry_test: test %d\n", + test_num); #endif /* JRM */ if(cache_ptr == NULL) { @@ -5001,8 +5007,8 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, test_num); failure_mssg = msg; } - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0)) { + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { pass = FALSE; @@ -5021,13 +5027,13 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, } u = 0; - while(pass && (u < spec_size)) - { - if(((unsigned)spec[u].entry_num != u) || - (spec[u].entry_type < 0) || - (spec[u].entry_type >= NUMBER_OF_ENTRY_TYPES) || - (spec[u].entry_index < 0) || - (spec[u].entry_index > max_indices[spec[u].entry_type])) { + while ( pass && ( u < spec_size ) ) { + + if ( ( (unsigned)spec[u].entry_num != u ) || + ( spec[u].entry_type < 0 ) || + ( spec[u].entry_type >= NUMBER_OF_ENTRY_TYPES ) || + ( spec[u].entry_index < 0 ) || + ( spec[u].entry_index > max_indices[spec[u].entry_type] ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -5039,8 +5045,8 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, } u = 0; - while(pass && (u < spec_size)) - { + while ( pass && (u < spec_size) ) { + if(spec[u].insert_flag) { insert_entry(file_ptr, spec[u].entry_type, spec[u].entry_index, @@ -5061,11 +5067,10 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, flush_flags); + H5C_FLUSH_CACHE(file_ptr, flush_flags, "dummy failure message.\n") - if(result < 0) { + if ( ! pass ) { - pass = FALSE; HDsnprintf(msg, (size_t)128, "flush with flags 0x%x failed in multi entry test #%d.", flush_flags, test_num); @@ -5107,22 +5112,22 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, if(pass) { - if((((flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0) + if ( ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0) && - ((cache_ptr->index_len != spec_size) + ( ( cache_ptr->index_len != spec_size ) || - (cache_ptr->index_size != total_entry_size) - ) - ) + ( cache_ptr->index_size != total_entry_size ) + ) + ) || - (((flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0) + ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0) && - ((cache_ptr->index_len != 0) + ( ( cache_ptr->index_len != 0 ) || - (cache_ptr->index_size != 0) - ) - ) - ) { + ( cache_ptr->index_size != 0 ) + ) + ) + ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -5135,9 +5140,9 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if(pass) { - result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); + H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_INVALIDATE_FLAG, "dummy mssg.\n") - if(result < 0) { + if ( ! pass ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -5145,8 +5150,8 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, test_num); failure_mssg = msg; } - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0)) { + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -5158,8 +5163,8 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, } u = 0; - while(pass && (u < spec_size)) - { + while ( pass && ( u < spec_size ) ) { + base_addr = entries[spec[u].entry_type]; entry_ptr = &(base_addr[spec[u].entry_index]); @@ -5176,17 +5181,24 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, /*------------------------------------------------------------------------- + * * Function: check_flush_cache__pe_multi_entry_test() * - * Purpose: Run a multi entry flush cache test. + * Purpose: Run a multi entry flush cache test. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/5/06 * * Modifications: * + * Added code to setup and take down the skip list before + * and after calls to H5C_flush_cache(). Do this via the + * H5C_FLUSH_CACHE macro. + * + * JRM -- 5/16/20 + * *------------------------------------------------------------------------- */ @@ -5199,7 +5211,6 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, { H5C_t *cache_ptr = file_ptr->shared->cache; static char msg[128]; - herr_t result; unsigned u; int j; size_t total_entry_size = 0; @@ -5221,8 +5232,8 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, test_num); failure_mssg = msg; } - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0)) { + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { pass = FALSE; @@ -5241,15 +5252,15 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, } u = 0; - while(pass && (u < spec_size)) - { - if(((unsigned)spec[u].entry_num != u) || - (spec[u].entry_type < 0) || - (spec[u].entry_type >= NUMBER_OF_ENTRY_TYPES) || - (spec[u].entry_index < 0) || - (spec[u].entry_index > max_indices[spec[u].entry_type]) || - (spec[u].num_pins < 0) || - (spec[u].num_pins > MAX_PINS)) { + while ( pass && ( u < spec_size ) ) { + + if ( ( (unsigned)spec[u].entry_num != u ) || + ( spec[u].entry_type < 0 ) || + ( spec[u].entry_type >= NUMBER_OF_ENTRY_TYPES ) || + ( spec[u].entry_index < 0 ) || + ( spec[u].entry_index > max_indices[spec[u].entry_type] ) || + ( spec[u].num_pins < 0 ) || + ( spec[u].num_pins > MAX_PINS ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -5278,25 +5289,24 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, total_entry_size += entry_sizes[spec[u].entry_type]; - for (j = 0; j < spec[u].num_pins; j++) - { + for (j = 0; j < spec[u].num_pins; j++) { + create_pinned_entry_dependency(file_ptr, - spec[u].entry_type, - spec[u].entry_index, - spec[u].pin_type[j], - spec[u].pin_idx[j]); - } + spec[u].entry_type, + spec[u].entry_index, + spec[u].pin_type[j], + spec[u].pin_idx[j]); + } u++; } if(pass) { - result = H5C_flush_cache(file_ptr, flush_flags); + H5C_FLUSH_CACHE(file_ptr, flush_flags, "dummy failure message.\n") - if(result < 0) { + if ( ! pass ) { - pass = FALSE; HDsnprintf(msg, (size_t)128, "flush with flags 0x%x failed in pe multi entry test #%d.", flush_flags, test_num); @@ -5305,14 +5315,14 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, } u = 0; - while(pass && (u < spec_size)) - { + while ( pass && ( u < spec_size ) ) { + base_addr = entries[spec[u].entry_type]; entry_ptr = &(base_addr[spec[u].entry_index]); - if((entry_ptr->deserialized != spec[u].expected_deserialized) || - (entry_ptr->serialized != spec[u].expected_serialized) || - (entry_ptr->destroyed != spec[u].expected_destroyed)) { + if ( ( entry_ptr->deserialized != spec[u].expected_deserialized ) || + ( entry_ptr->serialized != spec[u].expected_serialized ) || + ( entry_ptr->destroyed != spec[u].expected_destroyed ) ) { #if 0 /* This is useful debugging code. Lets keep it around. */ @@ -5338,22 +5348,22 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, if(pass) { - if((((flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0) + if ( ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0) && - ((cache_ptr->index_len != spec_size) + ( ( cache_ptr->index_len != spec_size ) || - (cache_ptr->index_size != total_entry_size) - ) - ) + ( cache_ptr->index_size != total_entry_size ) + ) + ) || - (((flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0) + ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ) && - ((cache_ptr->index_len != 0) + ( ( cache_ptr->index_len != 0 ) || - (cache_ptr->index_size != 0) - ) - ) - ) { + ( cache_ptr->index_size != 0 ) + ) + ) + ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -5364,11 +5374,11 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, } /* clean up the cache to prep for the next test */ - if(pass) { + if ( pass ) { - result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); + H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_INVALIDATE_FLAG, "dummy mssg.\n") - if(result < 0) { + if ( ! pass ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -5376,8 +5386,8 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, test_num); failure_mssg = msg; } - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0)) { + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -5389,8 +5399,8 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, } u = 0; - while(pass && (u < spec_size)) - { + while ( pass && ( u < spec_size ) ) { + base_addr = entries[spec[u].entry_type]; entry_ptr = &(base_addr[spec[u].entry_index]); @@ -9181,16 +9191,22 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /*------------------------------------------------------------------------- * Function: check_flush_cache__flush_op_test() * - * Purpose: Run a flush op flush cache test. Of the nature of - * flush operations, this is a multi-entry test. + * Purpose: Run a flush op flush cache test. Of the nature of + * flush operations, this is a multi-entry test. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 9/3/06 * * Modifications: * + * Added code to setup and take down the skip list before + * and after calls to H5C_flush_cache(). Do this via the + * H5C_FLUSH_CACHE macro. + * + * JRM -- 5/16/20 + * *------------------------------------------------------------------------- */ @@ -9200,16 +9216,15 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, unsigned int flush_flags, int spec_size, const struct fo_flush_cache_test_spec spec[], - unsigned init_expected_index_len, - size_t init_expected_index_size, - unsigned expected_index_len, - size_t expected_index_size, - int check_size, - struct fo_flush_entry_check check[]) + unsigned init_expected_index_len, + size_t init_expected_index_size, + unsigned expected_index_len, + size_t expected_index_size, + int check_size, + struct fo_flush_entry_check check[]) { H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; - herr_t result; int i; int j; test_entry_t * base_addr; @@ -9228,8 +9243,8 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, test_num); failure_mssg = msg; } - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0)) { + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { pass = FALSE; @@ -9248,17 +9263,17 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, } i = 0; - while(pass && (i < spec_size)) - { - if((spec[i].entry_num != i) || - (spec[i].entry_type < 0) || - (spec[i].entry_type >= NUMBER_OF_ENTRY_TYPES) || - (spec[i].entry_index < 0) || - (spec[i].entry_index > max_indices[spec[i].entry_type]) || - (spec[i].num_pins < 0) || - (spec[i].num_pins > MAX_PINS) || - (spec[i].num_flush_ops < 0) || - (spec[i].num_flush_ops > MAX_FLUSH_OPS)) { + while ( pass && ( i < spec_size ) ) { + + if ( ( spec[i].entry_num != i ) || + ( spec[i].entry_type < 0 ) || + ( spec[i].entry_type >= NUMBER_OF_ENTRY_TYPES ) || + ( spec[i].entry_index < 0 ) || + ( spec[i].entry_index > max_indices[spec[i].entry_type] ) || + ( spec[i].num_pins < 0 ) || + ( spec[i].num_pins > MAX_PINS ) || + ( spec[i].num_flush_ops < 0 ) || + ( spec[i].num_flush_ops > MAX_FLUSH_OPS ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -9270,36 +9285,36 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, } i = 0; - while(pass && (i < check_size)) - { - if((check[i].entry_num != i) || - (check[i].entry_type < 0) || - (check[i].entry_type >= NUMBER_OF_ENTRY_TYPES) || - (check[i].entry_index < 0) || - (check[i].entry_index > max_indices[check[i].entry_type]) || + while ( pass && ( i < check_size ) ) { + + if ( ( check[i].entry_num != i) || + ( check[i].entry_type < 0) || + ( check[i].entry_type >= NUMBER_OF_ENTRY_TYPES) || + ( check[i].entry_index < 0) || + ( check[i].entry_index > max_indices[check[i].entry_type]) || #ifndef H5_HAVE_STDBOOL_H /* Check for nonsense values if hbool_t is an integral * type instead of a real Boolean. */ - ((check[i].in_cache != TRUE) && - (check[i].in_cache != FALSE)) || - ((check[i].at_main_addr != TRUE) && - (check[i].at_main_addr != FALSE)) || - ((check[i].is_dirty != TRUE) && - (check[i].is_dirty != FALSE)) || - ((check[i].is_protected != TRUE) && - (check[i].is_protected != FALSE)) || - ((check[i].is_pinned != TRUE) && - (check[i].is_pinned != FALSE)) || - ((check[i].expected_deserialized != TRUE) && - (check[i].expected_deserialized != FALSE)) || - ((check[i].expected_serialized != TRUE) && - (check[i].expected_serialized != FALSE)) || - ((check[i].expected_destroyed != TRUE) && - (check[i].expected_destroyed != FALSE)) || + ( ( check[i].in_cache != TRUE ) && + ( check[i].in_cache != FALSE ) ) || + ( ( check[i].at_main_addr != TRUE ) && + ( check[i].at_main_addr != FALSE ) ) || + ( ( check[i].is_dirty != TRUE ) && + ( check[i].is_dirty != FALSE ) ) || + ( ( check[i].is_protected != TRUE ) && + ( check[i].is_protected != FALSE ) ) || + ( ( check[i].is_pinned != TRUE ) && + ( check[i].is_pinned != FALSE ) ) || + ( ( check[i].expected_deserialized != TRUE ) && + ( check[i].expected_deserialized != FALSE ) ) || + ( ( check[i].expected_serialized != TRUE ) && + ( check[i].expected_serialized != FALSE ) ) || + ( ( check[i].expected_destroyed != TRUE ) && + ( check[i].expected_destroyed != FALSE ) ) || #endif /* H5_HAVE_STDBOOL_H */ - (check[i].expected_size <= (size_t)0) - ) { + ( check[i].expected_size <= (size_t)0 ) + ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -9311,8 +9326,8 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, } i = 0; - while(pass && (i < spec_size)) - { + while ( pass && ( i < spec_size ) ) { + if(spec[i].insert_flag) { insert_entry(file_ptr, spec[i].entry_type, spec[i].entry_index, @@ -9330,34 +9345,34 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, spec[i].flags); } - for (j = 0; j < spec[i].num_pins; j++) - { + for (j = 0; j < spec[i].num_pins; j++) + { create_pinned_entry_dependency(file_ptr, spec[i].entry_type, spec[i].entry_index, spec[i].pin_type[j], spec[i].pin_idx[j]); - } + } - for (j = 0; j < spec[i].num_flush_ops; j++) - { - add_flush_op(spec[i].entry_type, - spec[i].entry_index, - spec[i].flush_ops[j].op_code, - spec[i].flush_ops[j].type, - spec[i].flush_ops[j].idx, - spec[i].flush_ops[j].flag, - spec[i].flush_ops[j].size, + for (j = 0; j < spec[i].num_flush_ops; j++) { + + add_flush_op(spec[i].entry_type, + spec[i].entry_index, + spec[i].flush_ops[j].op_code, + spec[i].flush_ops[j].type, + spec[i].flush_ops[j].idx, + spec[i].flush_ops[j].flag, + spec[i].flush_ops[j].size, spec[i].flush_ops[j].order_ptr); - } + } i++; } - if(pass) { + if ( pass ) { - if((cache_ptr->index_len != init_expected_index_len) || - (cache_ptr->index_size != init_expected_index_size)) { + if ( ( cache_ptr->index_len != init_expected_index_len ) || + ( cache_ptr->index_size != init_expected_index_size ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -9369,9 +9384,9 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, flush_flags); + H5C_FLUSH_CACHE(file_ptr, flush_flags, "dummy failure message") - if(result < 0) { + if ( ! pass ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -9383,14 +9398,14 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, i = 0; - while(pass && (i < spec_size)) - { + while ( pass && ( i < spec_size ) ) { + base_addr = entries[spec[i].entry_type]; entry_ptr = &(base_addr[spec[i].entry_index]); - if((entry_ptr->deserialized != spec[i].expected_deserialized) || - (entry_ptr->serialized != spec[i].expected_serialized) || - (entry_ptr->destroyed != spec[i].expected_destroyed)) { + if ( ( entry_ptr->deserialized != spec[i].expected_deserialized ) || + ( entry_ptr->serialized != spec[i].expected_serialized ) || + ( entry_ptr->destroyed != spec[i].expected_destroyed ) ) { #if 0 /* This is useful debugging code. Lets keep it around. */ @@ -9419,136 +9434,166 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, if(pass) { i = 0; - while(pass && (i < check_size)) - { - if(check[i].in_cache != entry_in_cache(cache_ptr, - check[i].entry_type, - check[i].entry_index)) { + while ( pass && (i < check_size ) ) { + + if ( check[i].in_cache != entry_in_cache(cache_ptr, + check[i].entry_type, + check[i].entry_index) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Check1 failed on entry %d after flush op test #%d.", i, test_num); failure_mssg = msg; - } + } base_addr = entries[check[i].entry_type]; entry_ptr = &(base_addr[check[i].entry_index]); - if((entry_ptr->size != check[i].expected_size) || - ((!entry_ptr->header.destroy_in_progress) && - (check[i].in_cache) && - (entry_ptr->header.size != check[i].expected_size)) || - (entry_ptr->at_main_addr != check[i].at_main_addr) || - (entry_ptr->is_dirty != check[i].is_dirty) || - (entry_ptr->header.is_dirty != check[i].is_dirty) || - (entry_ptr->is_protected != check[i].is_protected) || - (entry_ptr->header.is_protected != check[i].is_protected) || - (entry_ptr->is_pinned != check[i].is_pinned) || - (entry_ptr->header.is_pinned != check[i].is_pinned) || - (entry_ptr->deserialized != check[i].expected_deserialized) || - (entry_ptr->serialized != check[i].expected_serialized) || - (entry_ptr->destroyed != check[i].expected_destroyed)) { + if ( ( entry_ptr->size != check[i].expected_size) || + ( ( !entry_ptr->header.destroy_in_progress) && + ( check[i].in_cache ) && + ( entry_ptr->header.size != check[i].expected_size ) ) || + ( entry_ptr->at_main_addr != check[i].at_main_addr ) || + ( entry_ptr->is_dirty != check[i].is_dirty ) || + ( entry_ptr->header.is_dirty != check[i].is_dirty ) || + ( entry_ptr->is_protected != check[i].is_protected ) || + ( entry_ptr->header.is_protected != check[i].is_protected ) || + ( entry_ptr->is_pinned != check[i].is_pinned ) || + ( entry_ptr->header.is_pinned != check[i].is_pinned ) || + ( entry_ptr->deserialized != check[i].expected_deserialized ) || + ( entry_ptr->serialized != check[i].expected_serialized ) || + ( entry_ptr->destroyed != check[i].expected_destroyed ) ) { #if 0 /* This is useful debugging code. Lets keep it around for a while. */ - if(entry_ptr->size != check[i].expected_size) { - HDfprintf(stdout, "entry_ptr->size (expected) = %d (%d).\n", - (int)(entry_ptr->size), - (int)(check[i].expected_size)); - } - if((!entry_ptr->header.destroy_in_progress) && - (check[i].in_cache) && - (entry_ptr->header.size != check[i].expected_size)) { - HDfprintf(stdout, + if ( entry_ptr->size != check[i].expected_size ) { + + HDfprintf(stdout, "entry_ptr->size (expected) = %d (%d).\n", + (int)(entry_ptr->size), + (int)(check[i].expected_size)); + } + + if ( ( ! entry_ptr->header.destroy_in_progress ) && + ( check[i].in_cache ) && + ( entry_ptr->header.size != check[i].expected_size ) ) { + + HDfprintf(stdout, "(!destroy in progress and in cache and size (expected) = %d (%d).\n", (int)(entry_ptr->header.size), - (int)(check[i].expected_size)); - } - if(entry_ptr->at_main_addr != check[i].at_main_addr) { - HDfprintf(stdout, "(%d,%d) at main addr (expected) = %d (%d).\n", - (int)(check[i].entry_type), - (int)(check[i].entry_index), + (int)(check[i].expected_size)); + } + + if ( entry_ptr->at_main_addr != check[i].at_main_addr ) { + + HDfprintf(stdout, + "(%d,%d) at main addr (expected) = %d (%d).\n", + (int)(check[i].entry_type), + (int)(check[i].entry_index), (int)(entry_ptr->at_main_addr), - (int)(check[i].at_main_addr)); + (int)(check[i].at_main_addr)); + } + + if ( entry_ptr->is_dirty != check[i].is_dirty ) { + + HDfprintf(stdout, + "entry_ptr->is_dirty (expected) = %d (%d).\n", + (int)(entry_ptr->is_dirty), + (int)(check[i].is_dirty)); + } + + if ( entry_ptr->header.is_dirty != check[i].is_dirty ) { + + HDfprintf(stdout, + "entry_ptr->header.is_dirty (expected) = %d (%d).\n", + (int)(entry_ptr->header.is_dirty), + (int)(check[i].is_dirty)); + } + + if ( entry_ptr->is_protected != check[i].is_protected ) { + + HDfprintf(stdout, + "entry_ptr->is_protected (expected) = %d (%d).\n", + (int)(entry_ptr->is_protected), + (int)(check[i].is_protected)); + } + + if ( entry_ptr->header.is_protected != check[i].is_protected ) { + + HDfprintf(stdout, + "entry_ptr->header.is_protected (expected) = %d (%d).\n", + (int)(entry_ptr->is_protected), + (int)(check[i].is_protected)); + } + + if ( entry_ptr->is_pinned != check[i].is_pinned ) { + + HDfprintf(stdout, + "entry_ptr->is_pinned (expected) = %d (%d).\n", + (int)(entry_ptr->is_pinned), + (int)(check[i].is_pinned)); + } + + if ( entry_ptr->header.is_pinned != check[i].is_pinned ) { + + HDfprintf(stdout, + "entry_ptr->header.is_pinned (expected) = %d (%d).\n", + (int)(entry_ptr->header.is_pinned), + (int)(check[i].is_pinned)); + } + + if ( entry_ptr->deserialized != check[i].expected_deserialized ) { + + HDfprintf(stdout, + "entry_ptr->deserialized (expected) = %d (%d).\n", + (int)(entry_ptr->deserialized), + (int)(check[i].expected_deserialized)); + } + + if ( entry_ptr->serialized != check[i].expected_serialized ) { + + HDfprintf(stdout, + "entry_ptr->serialized (expected) = %d (%d).\n", + (int)(entry_ptr->serialized), + (int)(check[i].expected_serialized)); + } + + if ( entry_ptr->destroyed != check[i].expected_destroyed ) { + + HDfprintf(stdout, \ + "entry_ptr->destroyed (expected) = %d (%d).\n", + (int)(entry_ptr->destroyed), + (int)(check[i].expected_destroyed)); } - if(entry_ptr->is_dirty != check[i].is_dirty) { - HDfprintf(stdout, "entry_ptr->is_dirty (expected) = %d (%d).\n", - (int)(entry_ptr->is_dirty), - (int)(check[i].is_dirty)); - } - if(entry_ptr->header.is_dirty != check[i].is_dirty) { - HDfprintf(stdout, "entry_ptr->header.is_dirty (expected) = %d (%d).\n", - (int)(entry_ptr->header.is_dirty), - (int)(check[i].is_dirty)); - } - if(entry_ptr->is_protected != check[i].is_protected) { - HDfprintf(stdout, "entry_ptr->is_protected (expected) = %d (%d).\n", - (int)(entry_ptr->is_protected), - (int)(check[i].is_protected)); - } - if(entry_ptr->header.is_protected != check[i].is_protected) { - HDfprintf(stdout, "entry_ptr->header.is_protected (expected) = %d (%d).\n", - (int)(entry_ptr->is_protected), - (int)(check[i].is_protected)); - } - if(entry_ptr->is_pinned != check[i].is_pinned) { - HDfprintf(stdout, "entry_ptr->is_pinned (expected) = %d (%d).\n", - (int)(entry_ptr->is_pinned), - (int)(check[i].is_pinned)); - } - if(entry_ptr->header.is_pinned != check[i].is_pinned) { - HDfprintf(stdout, "entry_ptr->header.is_pinned (expected) = %d (%d).\n", - (int)(entry_ptr->header.is_pinned), - (int)(check[i].is_pinned)); - } - if(entry_ptr->deserialized != - check[i].expected_deserialized) { - HDfprintf(stdout, - "entry_ptr->deserialized (expected) = %d (%d).\n", - (int)(entry_ptr->deserialized), - (int)(check[i].expected_deserialized)); - } - if(entry_ptr->serialized != check[i].expected_serialized) { - HDfprintf(stdout, - "entry_ptr->serialized (expected) = %d (%d).\n", - (int)(entry_ptr->serialized), - (int)(check[i].expected_serialized)); - } - if(entry_ptr->destroyed != check[i].expected_destroyed) { - HDfprintf(stdout, "entry_ptr->destroyed (expected) = %d (%d).\n", - (int)(entry_ptr->destroyed), - (int)(check[i].expected_destroyed)); - } #endif pass = FALSE; HDsnprintf(msg, (size_t)128, "Check2 failed on entry %d after flush op test #%d.", i, test_num); failure_mssg = msg; - } - i++; + } + i++; } } - if(pass) { + if ( pass ) { - if((((flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0) + if ( ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0 ) && - ((cache_ptr->index_len != expected_index_len) + ( ( cache_ptr->index_len != expected_index_len ) || - (cache_ptr->index_size != expected_index_size) - ) - ) + ( cache_ptr->index_size != expected_index_size ) + ) + ) || - (((flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0) + ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ) && - ((cache_ptr->index_len != 0) + ( ( cache_ptr->index_len != 0 ) || - (cache_ptr->index_size != 0) - ) - ) - ) { + ( cache_ptr->index_size != 0 ) + ) + ) + ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -9561,20 +9606,19 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if(pass) { - result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); + H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_INVALIDATE_FLAG, "dummy mssg.") - if(result < 0) { + if ( ! pass ) { - pass = FALSE; HDsnprintf(msg, (size_t)128, "Flush failed on cleanup in flush op test #%d.", test_num); failure_mssg = msg; } - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0) || - (cache_ptr->clean_index_size != 0) || - (cache_ptr->dirty_index_size != 0)) { + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) || + ( cache_ptr->clean_index_size != 0 ) || + ( cache_ptr->dirty_index_size != 0 ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -9586,12 +9630,12 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, } i = 0; - while(pass && (i < spec_size)) - { - base_addr = entries[spec[i].entry_type]; - entry_ptr = &(base_addr[spec[i].entry_index]); + while ( pass && ( i < spec_size ) ) { - entry_ptr->size = entry_sizes[spec[i].entry_type]; + base_addr = entries[spec[i].entry_type]; + entry_ptr = &(base_addr[spec[i].entry_index]); + + entry_ptr->size = entry_sizes[spec[i].entry_type]; entry_ptr->deserialized = FALSE; entry_ptr->serialized = FALSE; @@ -9601,12 +9645,12 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, } i = 0; - while(pass && (i < check_size)) - { - base_addr = entries[check[i].entry_type]; - entry_ptr = &(base_addr[check[i].entry_index]); + while ( pass && ( i < check_size ) ) { - entry_ptr->size = entry_sizes[check[i].entry_type]; + base_addr = entries[check[i].entry_type]; + entry_ptr = &(base_addr[check[i].entry_index]); + + entry_ptr->size = entry_sizes[check[i].entry_type]; entry_ptr->deserialized = FALSE; entry_ptr->serialized = FALSE; @@ -9623,22 +9667,28 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, /*------------------------------------------------------------------------- * Function: check_flush_cache__flush_op_eviction_test() * - * Purpose: Verify that flush operations work as expected when an + * Purpose: Verify that flush operations work as expected when an * entry is evicted. * * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 10/3/06 * * Modifications: * - * Updated test for minor changes in the behaviour - * of H5C__flush_single_entry(). + * Updated test for minor changes in the behaviour + * of H5C__flush_single_entry(). + * + * JRM -- 2/16/15 * - * JRM -- 2/16/15 + * Added code to setup and take down the skip list before + * and after calls to H5C_flush_cache(). Do this via the + * H5C_FLUSH_CACHE macro. + * + * JRM -- 5/16/20 * *------------------------------------------------------------------------- */ @@ -9651,7 +9701,6 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) int num_variable_entries = 10; int num_monster_entries = 31; int num_large_entries = 0; - herr_t result; test_entry_t * entry_ptr; test_entry_t * base_addr; struct expected_entry_status expected[10 + 31 + 14] = @@ -10840,15 +10889,12 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); + H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_INVALIDATE_FLAG, \ + "Cache flush invalidate failed after flush op eviction test") - if(result < 0) { - - pass = FALSE; - failure_mssg = "Cache flush invalidate failed after flush op eviction test"; - } - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0)) { + if ( ( pass ) && + ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) ) { pass = FALSE; failure_mssg = "Unexpected cache len/size after cleanup of flush op eviction test"; @@ -12493,15 +12539,21 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /*------------------------------------------------------------------------- * Function: check_flush_cache__single_entry_test() * - * Purpose: Run a single entry flush cache test. + * Purpose: Run a single entry flush cache test. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 1/12/05 * * Modifications: * + * Added code to setup and take down the skip list before + * and after calls to H5C_flush_cache(). Do this via the + * H5C_FLUSH_CACHE macro. + * + * JRM -- 5/14/20 + * *------------------------------------------------------------------------- */ @@ -12519,7 +12571,6 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, { H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; - herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr = NULL; @@ -12531,8 +12582,8 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, test_num); failure_mssg = msg; } - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0)) { + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -12540,8 +12591,10 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, test_num); failure_mssg = msg; } - else if((entry_type < 0) || (entry_type >= NUMBER_OF_ENTRY_TYPES) || - (entry_idx < 0) || (entry_idx > max_indices[entry_type])) { + else if ( ( entry_type < 0 ) || + ( entry_type >= NUMBER_OF_ENTRY_TYPES ) || + ( entry_idx < 0 ) || + ( entry_idx > max_indices[entry_type] ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -12569,19 +12622,20 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, flush_flags); + H5C_FLUSH_CACHE(file_ptr, flush_flags, "dummy failure mssg.") - if(result < 0) { + if ( ! pass ) { /* construct and set actual failure message */ - pass = FALSE; HDsnprintf(msg, (size_t)128, "flush with flags 0x%x failed in single entry test #%d.", flush_flags, test_num); + failure_mssg = msg; } - else if((entry_ptr->deserialized != expected_deserialized) || - (entry_ptr->serialized != expected_serialized) || - (entry_ptr->destroyed != expected_destroyed)) { + else if ( ( entry_ptr->deserialized != expected_deserialized ) || + ( entry_ptr->serialized != expected_serialized ) || + ( entry_ptr->destroyed != expected_destroyed ) ) { + #if 0 /* This is useful debugging code -- lets keep it for a while */ HDfprintf(stdout, @@ -12599,22 +12653,22 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, test_num); failure_mssg = msg; } - else if((((flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0) + else if ( ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0) && - ((cache_ptr->index_len != 1) + ( ( cache_ptr->index_len != 1 ) || - (cache_ptr->index_size != entry_sizes[entry_type]) - ) - ) + ( cache_ptr->index_size != entry_sizes[entry_type] ) + ) + ) || - (((flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0) + ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0) && - ((cache_ptr->index_len != 0) + ( ( cache_ptr->index_len != 0 ) || - (cache_ptr->index_size != 0) - ) - ) - ) { + ( cache_ptr->index_size != 0 ) + ) + ) + ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -12628,18 +12682,18 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if(pass) { - result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); + H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_INVALIDATE_FLAG, \ + "dummy failure mssg.") - if(result < 0) { + if ( ! pass ) { /* construct and set actual failure message */ - pass = FALSE; HDsnprintf(msg, (size_t)128, "Flush failed on cleanup in single entry test #%d.", test_num); failure_mssg = msg; } - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0)) { + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -12663,22 +12717,27 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, /*------------------------------------------------------------------------- * Function: check_flush_cache__pinned_single_entry_test() * - * Purpose: Run a pinned single entry flush cache test. + * Purpose: Run a pinned single entry flush cache test. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 3/28/06 * * Modifications: * - * JRM -- 5/17/06 - * Added the pop_mark_dirty_prot and pop_mark_dirty_pinned - * flags and supporting code to allow us to test the - * H5C_mark_entry_dirty() call. Use the - * call to mark the entry dirty while the entry is protected - * if pop_mark_dirty_prot is TRUE, and to mark the entry - * dirty while it is pinned if pop_mark_dirty_pinned is TRUE. + * JRM -- 5/17/06 + * Added the pop_mark_dirty_prot and pop_mark_dirty_pinned + * flags and supporting code to allow us to test the + * H5C_mark_entry_dirty() call. Use the + * call to mark the entry dirty while the entry is protected + * if pop_mark_dirty_prot is TRUE, and to mark the entry + * dirty while it is pinned if pop_mark_dirty_pinned is TRUE. + * + * JRM -- 5/14/20 + * Added code to setup and take down the skip list before + * and after calls to H5C_flush_cache(). Do this via the + * H5C_FLUSH_CACHE macro. * *------------------------------------------------------------------------- */ @@ -12689,10 +12748,10 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, int entry_type, int entry_idx, hbool_t unprot_dirty_flag, - hbool_t mark_dirty, - hbool_t pop_mark_dirty_prot, - hbool_t pop_mark_dirty_pinned, - hbool_t unprotect_unpin, + hbool_t mark_dirty, + hbool_t pop_mark_dirty_prot, + hbool_t pop_mark_dirty_pinned, + hbool_t unprotect_unpin, unsigned int flags, unsigned int flush_flags, hbool_t expected_serialized, @@ -12701,7 +12760,6 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; hbool_t expected_deserialized = TRUE; - herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr = NULL; @@ -12713,8 +12771,8 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, test_num); failure_mssg = msg; } - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0)) { + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -12722,7 +12780,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, test_num); failure_mssg = msg; } - else if((entry_type < 0) || (entry_type >= NUMBER_OF_ENTRY_TYPES) || + else if ( (entry_type < 0) || (entry_type >= NUMBER_OF_ENTRY_TYPES) || (entry_idx < 0) || (entry_idx > max_indices[entry_type])) { pass = FALSE; @@ -12739,41 +12797,41 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, protect_entry(file_ptr, entry_type, entry_idx); - if(pop_mark_dirty_prot) { + if(pop_mark_dirty_prot) { - mark_entry_dirty(entry_type, entry_idx); - } + mark_entry_dirty(entry_type, entry_idx); + } unprotect_entry(file_ptr, entry_type, entry_idx, (unprot_dirty_flag ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) | (flags | H5C__PIN_ENTRY_FLAG)); - if(mark_dirty) { + if(mark_dirty) { mark_entry_dirty(entry_type, entry_idx); - } + } - if(pop_mark_dirty_pinned) { + if(pop_mark_dirty_pinned) { - mark_entry_dirty(entry_type, entry_idx); - } + mark_entry_dirty(entry_type, entry_idx); + } } if(pass) { - result = H5C_flush_cache(file_ptr, flush_flags); + H5C_FLUSH_CACHE(file_ptr, flush_flags, "dummy failure message\n") - if(result < 0) { + if ( ! pass ) { /* construct and set the correct failure message */ - pass = FALSE; HDsnprintf(msg, (size_t)128, "flush with flags 0x%x failed in pinned single entry test #%d.", - flush_flags, test_num); + flush_flags, test_num); failure_mssg = msg; } - else if((entry_ptr->deserialized != expected_deserialized) || - (entry_ptr->serialized != expected_serialized) || - (entry_ptr->destroyed != expected_destroyed)) { + else if ( ( entry_ptr->deserialized != expected_deserialized ) || + ( entry_ptr->serialized != expected_serialized ) || + ( entry_ptr->destroyed != expected_destroyed ) ) { + #if 0 /* this is useful debugging code -- keep it around */ HDfprintf(stdout, "desrlzd = %d(%d), srlzd = %d(%d), dest = %d(%d)\n", @@ -12790,22 +12848,22 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, test_num); failure_mssg = msg; } - else if((((flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0) + else if ( ( ( ( flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0 ) && - ((cache_ptr->index_len != 1) + ( ( cache_ptr->index_len != 1 ) || - (cache_ptr->index_size != entry_sizes[entry_type]) - ) - ) + ( cache_ptr->index_size != entry_sizes[entry_type] ) + ) + ) || - (((flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0) + ( ( ( flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ) && - ((cache_ptr->index_len != 0) + ( ( cache_ptr->index_len != 0 ) || - (cache_ptr->index_size != 0) - ) - ) - ) { + ( cache_ptr->index_size != 0 ) + ) + ) + ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -12836,18 +12894,17 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); + H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_INVALIDATE_FLAG, "dummy mssg\n") - if(result < 0) { + if ( ! pass ) { - pass = FALSE; HDsnprintf(msg, (size_t)128, "Flush failed on cleanup in pinned single entry test #%d.", test_num); failure_mssg = msg; } - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0)) { + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, @@ -14233,14 +14290,20 @@ check_pin_protected_entry(unsigned paged) /*------------------------------------------------------------------------- * Function: check_resize_entry() * - * Purpose: Verify that H5C_resize_entry() and H5C_unprotect() resize - * entries as expected. - * - * Return: void + * Purpose: Verify that H5C_resize_entry() and H5C_unprotect() resize + * entries as expected. + * + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 7/7/06 * + * Modifications: + * + * Updated function to allow for disabling of the slist. + * + * JRM -- 5/18/20 + * *------------------------------------------------------------------------- */ @@ -14421,16 +14484,16 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 1) || - (cache_ptr->index_size != (LARGE_ENTRY_SIZE / 2)) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != (LARGE_ENTRY_SIZE / 2))) { + if ( ( cache_ptr->index_len != 1 ) || + ( cache_ptr->index_size != (LARGE_ENTRY_SIZE / 2) ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 1 ) || + ( cache_ptr->slist_size != (LARGE_ENTRY_SIZE / 2) ) ) ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 3."); failure_mssg = msg; - - } + } } if(pass) { @@ -14506,16 +14569,16 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 1) || - (cache_ptr->index_size != LARGE_ENTRY_SIZE) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) { + if ( ( cache_ptr->index_len != 1 ) || + ( cache_ptr->index_size != LARGE_ENTRY_SIZE ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 1 ) || + ( cache_ptr->slist_size != LARGE_ENTRY_SIZE ) ) ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 4."); failure_mssg = msg; - - } + } } if(pass) { @@ -14574,16 +14637,17 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 1) || - (cache_ptr->index_size != (LARGE_ENTRY_SIZE / 4)) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != (LARGE_ENTRY_SIZE / 4))) { + if ( ( cache_ptr->index_len != 1 ) || + ( cache_ptr->index_size != (LARGE_ENTRY_SIZE / 4) ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 1 ) || + ( cache_ptr->slist_size != (LARGE_ENTRY_SIZE / 4) ) ) ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 5."); failure_mssg = msg; - } + } } if(pass) { @@ -14634,16 +14698,17 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 1) || - (cache_ptr->index_size != LARGE_ENTRY_SIZE) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) { + if ( ( cache_ptr->index_len != 1 ) || + ( cache_ptr->index_size != LARGE_ENTRY_SIZE ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 1 ) || + ( cache_ptr->slist_size != LARGE_ENTRY_SIZE) ) ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 6."); failure_mssg = msg; - } + } } if(pass) { @@ -14719,16 +14784,16 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0) || - (cache_ptr->slist_len != 0) || - (cache_ptr->slist_size != 0)) { + if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 0 ) || + ( cache_ptr->slist_size != 0) ) ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 7."); failure_mssg = msg; - - } + } } @@ -14736,19 +14801,20 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0) || - (cache_ptr->slist_len != 0) || - (cache_ptr->slist_size != 0)) { + if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 0 ) || + ( cache_ptr->slist_size != 0) ) ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 8."); failure_mssg = msg; + } - } base_addr = entries[LARGE_ENTRY_TYPE]; entry_ptr = &(base_addr[3]); - entry_size = LARGE_ENTRY_SIZE; + entry_size = LARGE_ENTRY_SIZE; } if(pass) { @@ -14766,17 +14832,17 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 3) || - (cache_ptr->index_size != 3 * LARGE_ENTRY_SIZE) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) { - + if ( ( cache_ptr->index_len != 3 ) || + ( cache_ptr->index_size != 3 * LARGE_ENTRY_SIZE ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 1 ) || + ( cache_ptr->slist_size != LARGE_ENTRY_SIZE) ) ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 9."); failure_mssg = msg; - } + } } if(pass) { @@ -14787,10 +14853,11 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 4) || - (cache_ptr->index_size != 4 * LARGE_ENTRY_SIZE) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) { + if ( ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 4 * LARGE_ENTRY_SIZE ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 1) || + ( cache_ptr->slist_size != LARGE_ENTRY_SIZE) ) ) ) { pass = FALSE; @@ -14866,18 +14933,18 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 4) || - (cache_ptr->index_size != - ((3 * LARGE_ENTRY_SIZE) + (LARGE_ENTRY_SIZE / 2))) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != - (LARGE_ENTRY_SIZE + (LARGE_ENTRY_SIZE / 2)))) { + if ( ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != + ((3 * LARGE_ENTRY_SIZE) + (LARGE_ENTRY_SIZE / 2)) ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 2 ) || + ( cache_ptr->slist_size != + (LARGE_ENTRY_SIZE + (LARGE_ENTRY_SIZE / 2)) ) ) ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 11."); failure_mssg = msg; - - } + } } if(pass) { @@ -14953,16 +15020,16 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 4) || - (cache_ptr->index_size != 4 * LARGE_ENTRY_SIZE) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != 2 * LARGE_ENTRY_SIZE)) { + if ( ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 4 * LARGE_ENTRY_SIZE ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 2 ) || + ( cache_ptr->slist_size != 2 * LARGE_ENTRY_SIZE ) ) ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 12."); failure_mssg = msg; - - } + } } if(pass) { @@ -15021,18 +15088,18 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 4) || - (cache_ptr->index_size != - ((3 * LARGE_ENTRY_SIZE) + (LARGE_ENTRY_SIZE / 4))) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != - (LARGE_ENTRY_SIZE + (LARGE_ENTRY_SIZE / 4)))) { + if ( ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != + ((3 * LARGE_ENTRY_SIZE) + (LARGE_ENTRY_SIZE / 4)) ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 2 ) || + ( cache_ptr->slist_size != + (LARGE_ENTRY_SIZE + (LARGE_ENTRY_SIZE / 4)) ) ) ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 13."); failure_mssg = msg; - - } + } } if(pass) { @@ -15083,16 +15150,16 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 4) || - (cache_ptr->index_size != (4 * LARGE_ENTRY_SIZE)) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != (2 * LARGE_ENTRY_SIZE))) { + if ( ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != (4 * LARGE_ENTRY_SIZE) ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 2 ) || + ( cache_ptr->slist_size != (2 * LARGE_ENTRY_SIZE)) ) ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 14."); failure_mssg = msg; - - } + } } if(pass) { @@ -15168,16 +15235,16 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 3) || - (cache_ptr->index_size != (3 * LARGE_ENTRY_SIZE)) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != LARGE_ENTRY_SIZE)) { + if ( ( cache_ptr->index_len != 3 ) || + ( cache_ptr->index_size != (3 * LARGE_ENTRY_SIZE) ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 1 ) || + ( cache_ptr->slist_size != LARGE_ENTRY_SIZE) ) ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 15."); failure_mssg = msg; - - } + } } if(pass) { @@ -15195,16 +15262,16 @@ check_resize_entry(unsigned paged) if(pass) { - if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0) || - (cache_ptr->slist_len != 0) || - (cache_ptr->slist_size != 0)) { + if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 0 ) || + ( cache_ptr->slist_size != 0 ) ) ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 16."); failure_mssg = msg; - - } + } } if(pass) { @@ -15228,16 +15295,19 @@ check_resize_entry(unsigned paged) /*------------------------------------------------------------------------- * Function: check_evictions_enabled() * - * Purpose: Verify that H5C_get_evictions_enabled() and - * H5C_set_evictions_enabled() functions perform as expected. + * Purpose: Verify that H5C_get_evictions_enabled() and + * H5C_set_evictions_enabled() functions perform as expected. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 8/2/07 * * Modifications: * + * Updated function to allow for disabling of the slist. + * + * JRM -- 5/18/20 * *------------------------------------------------------------------------- */ @@ -15331,17 +15401,17 @@ check_evictions_enabled(unsigned paged) /* verify that it is empty */ if(pass) { - if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0) || - (cache_ptr->slist_len != 0) || - (cache_ptr->slist_size != 0) || - (cache_ptr->evictions_enabled != TRUE)) { + if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 0 ) || + ( cache_ptr->slist_size != 0 ) ) ) || + ( cache_ptr->evictions_enabled != TRUE ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 1."); failure_mssg = msg; - - } + } } if(show_progress) /* 3 */ @@ -15383,18 +15453,17 @@ check_evictions_enabled(unsigned paged) /* verify that the cache is full */ if(pass) { - if((cache_ptr->index_len != 16) || - (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 0) || - (cache_ptr->slist_size != 0) || - (cache_ptr->evictions_enabled != TRUE)) { - + if ( ( cache_ptr->index_len != 16 ) || + ( cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 0 ) || + ( cache_ptr->slist_size != 0 ) ) ) || + ( cache_ptr->evictions_enabled != TRUE ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 2."); failure_mssg = msg; - - } + } } if(show_progress) /* 6 */ @@ -15416,17 +15485,17 @@ check_evictions_enabled(unsigned paged) /* verify that an entry has been evicted */ if(pass) { - if((cache_ptr->index_len != 16) || - (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 0) || - (cache_ptr->slist_size != 0) || - (cache_ptr->evictions_enabled != TRUE)) { + if ( ( cache_ptr->index_len != 16 ) || + ( cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 0 ) || + ( cache_ptr->slist_size != 0 ) ) ) || + ( cache_ptr->evictions_enabled != TRUE ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 3."); failure_mssg = msg; - - } + } } if(show_progress) /* 8 */ @@ -15483,17 +15552,17 @@ check_evictions_enabled(unsigned paged) /* verify that another entry has been evicted */ if(pass) { - if((cache_ptr->index_len != 16) || - (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != TRUE)) { + if ( ( cache_ptr->index_len != 16 ) || + ( cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 1 ) || + ( cache_ptr->slist_size != MONSTER_ENTRY_SIZE ) ) ) || + ( cache_ptr->evictions_enabled != TRUE ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 4."); failure_mssg = msg; - - } + } } if(show_progress) /* 11 */ @@ -15555,17 +15624,17 @@ check_evictions_enabled(unsigned paged) /* verify that evictions are disabled */ if(pass) { - if((cache_ptr->index_len != 16) || - (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != FALSE)) { + if ( ( cache_ptr->index_len != 16 ) || + ( cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 1 ) || + ( cache_ptr->slist_size != MONSTER_ENTRY_SIZE ) ) ) || + ( cache_ptr->evictions_enabled != FALSE ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 5."); failure_mssg = msg; - - } + } } if(show_progress) /* 14 */ @@ -15587,17 +15656,17 @@ check_evictions_enabled(unsigned paged) /* verify that no entry has been evicted */ if(pass) { - if((cache_ptr->index_len != 17) || - (cache_ptr->index_size != 17 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 1) || - (cache_ptr->slist_size != MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != FALSE)) { + if ( ( cache_ptr->index_len != 17 ) || + ( cache_ptr->index_size != 17 * MONSTER_ENTRY_SIZE ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 1 ) || + ( cache_ptr->slist_size != MONSTER_ENTRY_SIZE ) ) ) || + ( cache_ptr->evictions_enabled != FALSE ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 6."); failure_mssg = msg; - - } + } } if(show_progress) /* 16 */ @@ -15618,17 +15687,17 @@ check_evictions_enabled(unsigned paged) /* verify that no entry has been evicted */ if(pass) { - if((cache_ptr->index_len != 18) || - (cache_ptr->index_size != 18 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != FALSE)) { + if ( ( cache_ptr->index_len != 18 ) || + ( cache_ptr->index_size != 18 * MONSTER_ENTRY_SIZE ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 2 ) || + ( cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE ) ) ) || + ( cache_ptr->evictions_enabled != FALSE ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 7."); failure_mssg = msg; - - } + } } if(show_progress) /* 18 */ @@ -15667,17 +15736,17 @@ check_evictions_enabled(unsigned paged) /* verify that no entries have been evicted */ if(pass) { - if((cache_ptr->index_len != 18) || - (cache_ptr->index_size != 18 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != TRUE)) { + if ( ( cache_ptr->index_len != 18 ) || + ( cache_ptr->index_size != 18 * MONSTER_ENTRY_SIZE ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 2 ) || + ( cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE ) ) ) || + ( cache_ptr->evictions_enabled != TRUE ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 8."); failure_mssg = msg; - - } + } } if(show_progress) /* 21 */ @@ -15702,17 +15771,17 @@ check_evictions_enabled(unsigned paged) if(pass) { - if((cache_ptr->index_len != 16) || - (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != TRUE)) { + if ( ( cache_ptr->index_len != 16 ) || + ( cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 2 ) || + ( cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE ) ) ) || + ( cache_ptr->evictions_enabled != TRUE ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 9."); failure_mssg = msg; - - } + } } if(show_progress) /* 23 */ @@ -15823,17 +15892,17 @@ check_evictions_enabled(unsigned paged) /* verify that the cache has grown */ if(pass) { - if((cache_ptr->index_len != 17) || - (cache_ptr->index_size != 17 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 2) || - (cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != FALSE)) { + if ( ( cache_ptr->index_len != 17 ) || + ( cache_ptr->index_size != 17 * MONSTER_ENTRY_SIZE ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 2 ) || + ( cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE ) ) ) || + ( cache_ptr->evictions_enabled != FALSE ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 10."); failure_mssg = msg; - - } + } } if(show_progress) /* 28 */ @@ -15871,17 +15940,17 @@ check_evictions_enabled(unsigned paged) /* verify that the cache has returned to its maximum size */ if(pass) { - if((cache_ptr->index_len != 16) || - (cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE) || - (cache_ptr->slist_len != 3) || - (cache_ptr->slist_size != 3 * MONSTER_ENTRY_SIZE) || - (cache_ptr->evictions_enabled != TRUE)) { + if ( ( cache_ptr->index_len != 16 ) || + ( cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->slist_len != 3 ) || + ( cache_ptr->slist_size != 3 * MONSTER_ENTRY_SIZE ) ) ) || + ( cache_ptr->evictions_enabled != TRUE ) ) { pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected cache status 11."); failure_mssg = msg; - - } + } } if(show_progress) /* 31 */ @@ -15964,17 +16033,22 @@ check_evictions_enabled(unsigned paged) /*------------------------------------------------------------------------- * Function: check_flush_protected_err() + * + * Purpose: Verify that an attempt to flush the cache when it contains + * a protected entry will generate an error. * - * Purpose: Verify that an attempt to flush the cache when it contains - * a protected entry will generate an error. - * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 6/24/04 * * Modifications: * + * Added code to setup and take down the skip list before + * and after calls to H5C_flush_cache(). + * + * JRM -- 5/14/20 + * *------------------------------------------------------------------------- */ @@ -15982,6 +16056,7 @@ static unsigned check_flush_protected_err(unsigned paged) { H5F_t * file_ptr = NULL; + H5C_t * cache_ptr = NULL; if(paged) TESTING("flush cache with protected entry error (paged aggregation)") @@ -16001,27 +16076,45 @@ check_flush_protected_err(unsigned paged) file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged); + if ( pass ) { + + cache_ptr = file_ptr->shared->cache; + } + protect_entry(file_ptr, 0, 0); - if(H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET) >= 0) { + /* enable slist prior to flush */ + if ( ( pass ) && + ( H5C_set_slist_enabled(cache_ptr, TRUE, FALSE) < 0 ) ) { pass = FALSE; - failure_mssg = "flush succeeded on cache with protected entry.\n"; + failure_mssg = "unable to enable slist prior to flush.\n"; + } - } else { + if ( ( pass ) && + ( H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET) >= 0 ) ) { - unprotect_entry(file_ptr, 0, 0, H5C__DIRTIED_FLAG); + pass = FALSE; + failure_mssg = "flush succeeded on cache with protected entry.\n"; + } - if(H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET) < 0) { + /* disable the slist after the flush */ + if ( ( pass ) && + ( H5C_set_slist_enabled(cache_ptr, FALSE, FALSE) < 0 ) ) { - pass = FALSE; - failure_mssg = "flush failed after unprotect.\n"; + pass = FALSE; + failure_mssg = "unable to disable slist after flush.\n"; + } - } else { + unprotect_entry(file_ptr, 0, 0, H5C__DIRTIED_FLAG); - takedown_cache(file_ptr, FALSE, FALSE); - } + if ( pass ) { + + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, \ + "flush failed after unprotect.\n") } + + takedown_cache(file_ptr, FALSE, FALSE); } if(pass) { PASSED(); } else { H5_FAILED(); } @@ -17075,12 +17168,12 @@ check_move_entry_errs(unsigned paged) /*------------------------------------------------------------------------- * Function: check_resize_entry_errs() * - * Purpose: Verify that invalid calls to H5C_resize_entry() - * generates errors as expected. + * Purpose: Verify that invalid calls to H5C_resize_entry() + * generates errors as expected. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 7/7/06 * *------------------------------------------------------------------------- @@ -17135,9 +17228,9 @@ check_resize_entry_errs(unsigned paged) } else { - unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); + unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); - } + } } if(pass) { @@ -17152,9 +17245,9 @@ check_resize_entry_errs(unsigned paged) } else { - unpin_entry(0, 0); + unpin_entry(0, 0); - } + } } if(pass) { @@ -30952,13 +31045,21 @@ done: /*------------------------------------------------------------------------- * Function: check_flush_deps_order() * - * Purpose: Verify that the order that entries with flush dependencies + * Purpose: Verify that the order that entries with flush dependencies * is correct * - * Return: 0 on success, non-zero on failure + * Return: 0 on success, non-zero on failure + * + * Programmer: Quincey Koziol + * 3/17/09 * - * Programmer: Quincey Koziol - * 3/17/09 + * Modifications: + * + * Added code to setup and take down the skip list before + * and after calls to H5C_flush_cache(). Do this via the + * H5C_FLUSH_CACHE macro. + * + * JRM -- 5/14/20 * *------------------------------------------------------------------------- */ @@ -31049,8 +31150,6 @@ check_flush_deps_order(unsigned paged) /* Flush the cache and verify that the entries were flushed in correct order */ { - herr_t result; /* Generic return value */ - add_flush_op(entry_type, 0, FLUSH_OP__ORDER, entry_type, 0, FALSE, (size_t)0, &flush_order); add_flush_op(entry_type, 1, FLUSH_OP__ORDER, @@ -31065,8 +31164,8 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); - if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, "dummy mssg") + if(!pass) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency @@ -31144,8 +31243,6 @@ check_flush_deps_order(unsigned paged) /* Flush the cache and verify that the entries were flushed in correct order */ { - herr_t result; /* Generic return value */ - add_flush_op(entry_type, 0, FLUSH_OP__ORDER, entry_type, 0, FALSE, (size_t)0, &flush_order); add_flush_op(entry_type, 1, FLUSH_OP__ORDER, @@ -31171,8 +31268,8 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); - if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, "dummy mssg") + if(!pass) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency @@ -31251,8 +31348,6 @@ check_flush_deps_order(unsigned paged) /* Flush the cache and verify that the entries were flushed in correct order */ { - herr_t result; /* Generic return value */ - add_flush_op(entry_type, 0, FLUSH_OP__ORDER, entry_type, 0, FALSE, (size_t)0, &flush_order); add_flush_op(entry_type, 1, FLUSH_OP__ORDER, @@ -31283,8 +31378,8 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); - if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, "dummy mssg") + if(!pass) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency @@ -31370,8 +31465,6 @@ check_flush_deps_order(unsigned paged) /* Flush the cache and verify that the entries were flushed in correct order */ { - herr_t result; /* Generic return value */ - add_flush_op(entry_type, 0, FLUSH_OP__ORDER, entry_type, 0, FALSE, (size_t)0, &flush_order); add_flush_op(entry_type, 1, FLUSH_OP__ORDER, @@ -31402,8 +31495,8 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); - if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, "dummy mssg") + if(!pass) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency @@ -31529,8 +31622,6 @@ check_flush_deps_order(unsigned paged) /* Flush the cache and verify that the entries were flushed in correct order */ { - herr_t result; /* Generic return value */ - add_flush_op(entry_type, 0, FLUSH_OP__ORDER, entry_type, 0, FALSE, (size_t)0, &flush_order); add_flush_op(entry_type, 1, FLUSH_OP__ORDER, @@ -31578,8 +31669,8 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); - if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, "dummy mssg") + if(!pass) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency @@ -31739,8 +31830,6 @@ check_flush_deps_order(unsigned paged) /* Flush the cache and verify that the entries were flushed in correct order */ { - herr_t result; /* Generic return value */ - add_flush_op(entry_type, 0, FLUSH_OP__ORDER, entry_type, 0, FALSE, (size_t)0, &flush_order); add_flush_op(entry_type, 1, FLUSH_OP__ORDER, @@ -31788,8 +31877,8 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); - if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, "dummy mssg") + if(!pass) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency @@ -31904,8 +31993,6 @@ check_flush_deps_order(unsigned paged) /* Flush the cache and verify that the entries were flushed in correct order */ { - herr_t result; /* Generic return value */ - add_flush_op(entry_type, 0, FLUSH_OP__ORDER, entry_type, 0, FALSE, (size_t)0, &flush_order); add_flush_op(entry_type, 1, FLUSH_OP__ORDER, @@ -31946,8 +32033,8 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); - if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, "dummy mssg") + if(!pass) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency @@ -32038,8 +32125,6 @@ check_flush_deps_order(unsigned paged) /* Flush the cache and verify that the entries were flushed in correct order */ { - herr_t result; /* Generic return value */ - add_flush_op(entry_type, 0, FLUSH_OP__ORDER, entry_type, 0, FALSE, (size_t)0, &flush_order); add_flush_op(entry_type, 1, FLUSH_OP__ORDER, @@ -32080,8 +32165,8 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); - if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, "dummy mssg") + if(!pass) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency @@ -32221,8 +32306,6 @@ check_flush_deps_order(unsigned paged) /* Flush the cache and verify that the entries were flushed in correct order */ { - herr_t result; /* Generic return value */ - add_flush_op(entry_type, 0, FLUSH_OP__ORDER, entry_type, 0, FALSE, (size_t)0, &flush_order); add_flush_op(entry_type, 1, FLUSH_OP__ORDER, @@ -32273,8 +32356,8 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); - if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, "dummy mssg") + if(!pass) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency @@ -32458,8 +32541,6 @@ check_flush_deps_order(unsigned paged) /* Flush the cache and verify that the entries were flushed in correct order */ { - herr_t result; /* Generic return value */ - add_flush_op(entry_type, 0, FLUSH_OP__ORDER, entry_type, 0, FALSE, (size_t)0, &flush_order); add_flush_op(entry_type, 1, FLUSH_OP__ORDER, @@ -32512,8 +32593,8 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); - if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, "dummy mssg") + if(!pass) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency @@ -32715,8 +32796,6 @@ check_flush_deps_order(unsigned paged) /* Flush the cache and verify that the entries were flushed in correct order */ { - herr_t result; /* Generic return value */ - add_flush_op(entry_type, 0, FLUSH_OP__ORDER, entry_type, 0, FALSE, (size_t)0, &flush_order); add_flush_op(entry_type, 1, FLUSH_OP__ORDER, @@ -32769,8 +32848,8 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); - if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, "dummy mssg") + if(!pass) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency @@ -33007,8 +33086,6 @@ check_flush_deps_order(unsigned paged) /* Flush the cache and verify that the entries were flushed in correct order */ { - herr_t result; /* Generic return value */ - add_flush_op(entry_type, 0, FLUSH_OP__ORDER, entry_type, 0, FALSE, (size_t)0, &flush_order); add_flush_op(entry_type, 1, FLUSH_OP__ORDER, @@ -33056,8 +33133,8 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); - if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, "dummy mssg") + if(!pass) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency @@ -33323,8 +33400,6 @@ check_flush_deps_order(unsigned paged) /* Flush the cache and verify that the entries were flushed in correct order */ { - herr_t result; /* Generic return value */ - add_flush_op(entry_type, 0, FLUSH_OP__ORDER, entry_type, 0, FALSE, (size_t)0, &flush_order); add_flush_op(entry_type, 1, FLUSH_OP__ORDER, @@ -33372,8 +33447,8 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); - if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, "dummy mssg") + if(!pass) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries * after destroy flush dependency @@ -34551,30 +34626,35 @@ check_entry_deletions_during_scans(unsigned paged) /*------------------------------------------------------------------------- + * * Function: cedds__expunge_dirty_entry_in_flush_test() * - * Purpose: Verify that H5C_flush_cache() can handle the removal of - * a dirty entry from the cache during its scan of the - * skip list. + * Purpose: Verify that H5C_flush_cache() can handle the removal of + * a dirty entry from the cache during its scan of the + * skip list. * - * Do this by setting up a full cache, with the last entry - * on the LRU being both dirty and having a flush operation - * that deletes the second to last entry on the LRU. Then - * flush the cache, triggering the flush of the last - * item, and thereby the deletion of the second to last item. + * Do this by setting up a full cache, with the last entry + * on the LRU being both dirty and having a flush operation + * that deletes the second to last entry on the LRU. Then + * flush the cache, triggering the flush of the last + * item, and thereby the deletion of the second to last item. * - * H5C_flush_cache() should handle this deletion gracefully. + * H5C_flush_cache() should handle this deletion gracefully. * * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/4/15 * * Modifications: * - * None. + * Added code to setup and take down the skip list before + * and after calls to H5C_flush_cache(). Do this via the + * H5C_FLUSH_CACHE macro. + * + * JRM -- 5/14/20 * *------------------------------------------------------------------------- */ @@ -34584,7 +34664,6 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) { H5C_t * cache_ptr = file_ptr->shared->cache; int i; - herr_t result; struct expected_entry_status expected[36] = { /* the expected array is used to maintain a table of the expected status of every @@ -34681,44 +34760,41 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) } - if(pass) { + if ( pass ) { - /* to summarize, at present the following entries - * are in cache with the following characteristics: - * - * in - * entry: cache? size: dirty? pinned? pins: flush operations: - * - * (HET, 0) Y 16 KB Y N - expunge (HET 1) - * - * (HET, 1) Y 16 KB Y N - - + /* to summarize, at present the following entries + * are in cache with the following characteristics: * - * (HET, 2) Y 16 KB Y N - - + * in + * entry: cache? size: dirty? pinned? pins: flush operations: * - * (HET, 3) Y 16 KB Y N - - - * - * Recall that in this test bed, flush operations are excuted the - * first time the associated entry is flushed, and are then - * deleted. - */ + * (HET, 0) Y 16 KB Y N - expunge (HET 1) + * + * (HET, 1) Y 16 KB Y N - - + * + * (HET, 2) Y 16 KB Y N - - + * + * (HET, 3) Y 16 KB Y N - - + * + * Recall that in this test bed, flush operations are excuted the + * first time the associated entry is flushed, and are then + * deleted. + */ - /* verify the expected status of all entries we have loaded to date: */ - verify_entry_status(cache_ptr, 0, 4, expected); + /* verify the expected status of all entries we have loaded to date: */ + verify_entry_status(cache_ptr, 0, 4, expected); } /* flush the cache to run the test. In the process, clean up after test. */ - if(pass) { - - result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); + if ( pass ) { - if(result < 0) { + H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_INVALIDATE_FLAG, \ + "Cache flush inval failed in cedds expunge dirty entry in flush test") - pass = FALSE; - failure_mssg = "Cache flush invalidate failed in cedds expunge dirty entry in flush test"; - } - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0)) { + if ( ( pass ) && + ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) ) { pass = FALSE; failure_mssg = "Unexpected cache len/size after cedds expunge dirty entry in flush test"; @@ -34730,7 +34806,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) /* If we are collecting stats, check to see if we get the expected * values. */ - if(pass) + if(pass) if((cache_ptr->insertions[HUGE_ENTRY_TYPE] != 0) || (cache_ptr->pinned_insertions[HUGE_ENTRY_TYPE] != 0) || (cache_ptr->clears[HUGE_ENTRY_TYPE] != 1) || @@ -34778,30 +34854,34 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) /*------------------------------------------------------------------------- * Function: cedds__H5C_make_space_in_cache() * - * Purpose: Verify that H5C__make_space_in_cache() can handle the - * removal from the cache of the next item in its reverse scan - * of the LRU list. + * Purpose: Verify that H5C__make_space_in_cache() can handle the + * removal from the cache of the next item in its reverse scan + * of the LRU list. * - * Do this by setting up a full cache, with the last entry - * on the LRU being both dirty and having a flush operation - * that deleted the second to last entry on the LRU. Then - * load an additional entry, triggering the flush of the last - * item, and thereby the deletion of the second to last item. + * Do this by setting up a full cache, with the last entry + * on the LRU being both dirty and having a flush operation + * that deleted the second to last entry on the LRU. Then + * load an additional entry, triggering the flush of the last + * item, and thereby the deletion of the second to last item. * - * H5C__make_space_in_cache() should detect this deletion, and - * restart its scan of the LRU from the tail, instead of - * examining the now deleted next item up on the LRU. + * H5C__make_space_in_cache() should detect this deletion, and + * restart its scan of the LRU from the tail, instead of + * examining the now deleted next item up on the LRU. * * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/4/15 * * Modifications: * - * None. + * Added code to setup and take down the skip list before + * and after calls to H5C_flush_cache(). Do this via the + * H5C_FLUSH_CACHE macro. + * + * JRM -- 5/14/20 * *------------------------------------------------------------------------- */ @@ -34813,7 +34893,6 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) int i; const int num_huge_entries = 4; const int num_monster_entries = 32; - herr_t result; struct expected_entry_status expected[36] = { /* the expected array is used to maintain a table of the expected status of every @@ -35060,17 +35139,14 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) /* flush the cache and end the test. */ - if(pass) { - - result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); + if ( pass ) { - if(result < 0) { + H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_INVALIDATE_FLAG, \ + "Cache flush invalidate failed after flush op eviction test") - pass = FALSE; - failure_mssg = "Cache flush invalidate failed after flush op eviction test"; - } - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0)) { + if ( ( pass ) && + ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) ) { pass = FALSE; failure_mssg = "Unexpected cache len/size after cleanup of flush op eviction test"; @@ -35159,30 +35235,34 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) /*------------------------------------------------------------------------- * Function: cedds__H5C__autoadjust__ageout__evict_aged_out_entries() * - * Purpose: Verify that H5C__autoadjust__ageout__evict_aged_out_entries() - * can handle the removal from the cache of the next item in - * its reverse scan of the LRU list. + * Purpose: Verify that H5C__autoadjust__ageout__evict_aged_out_entries() + * can handle the removal from the cache of the next item in + * its reverse scan of the LRU list. * - * Do this by setting up a full cache, with the last entry - * on the LRU being both dirty and having a flush operation - * that deletes the second to last entry on the LRU. Then - * access the first item in the LRU repeatedly until the - * item, and thereby the deletion of the second to last item. + * Do this by setting up a full cache, with the last entry + * on the LRU being both dirty and having a flush operation + * that deletes the second to last entry on the LRU. Then + * access the first item in the LRU repeatedly until the + * item, and thereby the deletion of the second to last item. * - * H5C__make_space_in_cache() should detect this deletion, and - * restart its scan of the LRU from the tail, instead of - * examining the now deleted next item up on the LRU. + * H5C__make_space_in_cache() should detect this deletion, and + * restart its scan of the LRU from the tail, instead of + * examining the now deleted next item up on the LRU. * * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/4/15 * * Modifications: * - * None. + * Added code to setup and take down the skip list before + * and after calls to H5C_flush_cache(). Do this via the + * H5C_FLUSH_CACHE macro. + * + * JRM -- 5/14/20 * *------------------------------------------------------------------------- */ @@ -35496,17 +35576,14 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) /* flush the cache and end the test. */ - if(pass) { - - result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); + if ( pass ) { - if(result < 0) { + H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_INVALIDATE_FLAG, \ + "Cache flush invalidate failed after flush op eviction test") - pass = FALSE; - failure_mssg = "Cache flush invalidate failed after flush op eviction test"; - } - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0)) { + if ( ( pass ) && + ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) ) { pass = FALSE; failure_mssg = "Unexpected cache len/size after cleanup of flush op eviction test"; @@ -35569,91 +35646,95 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) /*------------------------------------------------------------------------- * Function: cedds__H5C_flush_invalidate_cache__bucket_scan() * - * Purpose: Note: We now use the index list when we scan the - * contents of the metadata cache, so in principal, - * this test is obsolete. However, even using the - * index list, restarts are possible, and must be - * handled gracefully. - * - * As it turns out, this test triggers index list - * scan restarts, and thus with minor changes is - * still a useful test. - * - * For this reason, with the exception of changing - * to check the index_scan_restart stat instead of - * hash bucket restarts, I'm leaving the test - * alone. If and when it starts to fail due to - * other changes, we can re-work it to test - * index list scan restarts explicitly. - * - * JRM -- 11/2/16 - * - * Verify that H5C_flush_invalidate_cache() can handle - * the removal from the cache of the next item in - * its scans of hash buckets. - * - * !!!!!!!!!!WARNING !!!!!!!!!! - * - * This test may fail to function correctly if the hash - * table size or hash function is altered. - * - * To setup the test, this function depends on the fact that - * H5C_flush_invalidate_cache() does alternating scans of the - * slist and the index. If this changes, the test will likely - * also cease to function correctly. - * - * The test relies on a known hash function and hash table - * size to select a set of test entries that will all hash - * to the same hash bucket -- call it the test hash bucket. - * It also relies on known behavior of the cache to place - * the entries in the test bucket in a known order. - * - * To avoid pre-mature flushes of the entries in the - * test hash bucket, all entries are initially clean, - * with the exception of the first entry which is dirty. - * It avoids premature flushing by being the parent in - * a flush dependency. The first entry in the test bucket - * also has a flush op which expunges the second entry -- - * setting up the failure. - * - * An additional dirty entry is added (which must hash - * to a different bucket, and must have a higher address - * than at least the first entry in the test hash bucket. - * This entry is the child in a flush dependency with the - * first entry in the above hash bucket, and contains - * a flush op to destroy this flush dependency. - * - * Since the first entry in the test hash bucket has a lower - * address that the other dirty entry, the scan of the - * slist encounters it first, and passes over it because - * it has a flush dependency height of 1. - * - * The scan then encounters the second dirty entry and flushes - * it -- causing it to destroy the flush dependency and thus - * reducing the flush dependency height of the first entry in - * the test hash bucket to zero. - * - * After completing a scan of the slist, - * H5C_flush_invalidate_cache() then scans the index, - * flushing all entries of flush dependency height zero. - * - * This sets up the potential error when the first entry - * in the test hash bucket is flushed -- expunging the - * second entry as a side effect. If - * H5C_flush_invalidate_cache() fails to detect this, - * it will attempt to continue its scan of the bucket with - * an entry that has been deleted from the cache. + * Purpose: Note: We now use the index list when we scan the + * contents of the metadata cache, so in principal, + * this test is obsolete. However, even using the + * index list, restarts are possible, and must be + * handled gracefully. + * + * As it turns out, this test triggers index list + * scan restarts, and thus with minor changes is + * still a useful test. + * + * For this reason, with the exception of changing + * to check the index_scan_restart stat instead of + * hash bucket restarts, I'm leaving the test + * alone. If and when it starts to fail due to + * other changes, we can re-work it to test + * index list scan restarts explicitly. + * + * JRM -- 11/2/16 + * + * Verify that H5C_flush_invalidate_cache() can handle + * the removal from the cache of the next item in + * its scans of hash buckets. + * + * !!!!!!!!!!WARNING !!!!!!!!!! + * + * This test may fail to function correctly if the hash + * table size or hash function is altered. + * + * To setup the test, this function depends on the fact that + * H5C_flush_invalidate_cache() does alternating scans of the + * slist and the index. If this changes, the test will likely + * also cease to function correctly. + * + * The test relies on a known hash function and hash table + * size to select a set of test entries that will all hash + * to the same hash bucket -- call it the test hash bucket. + * It also relies on known behavior of the cache to place + * the entries in the test bucket in a known order. + * + * To avoid pre-mature flushes of the entries in the + * test hash bucket, all entries are initially clean, + * with the exception of the first entry which is dirty. + * It avoids premature flushing by being the parent in + * a flush dependency. The first entry in the test bucket + * also has a flush op which expunges the second entry -- + * setting up the failure. + * + * An additional dirty entry is added (which must hash + * to a different bucket, and must have a higher address + * than at least the first entry in the test hash bucket. + * This entry is the child in a flush dependency with the + * first entry in the above hash bucket, and contains + * a flush op to destroy this flush dependency. + * + * Since the first entry in the test hash bucket has a lower + * address that the other dirty entry, the scan of the + * slist encounters it first, and passes over it because + * it has a flush dependency height of 1. + * + * The scan then encounters the second dirty entry and flushes + * it -- causing it to destroy the flush dependency and thus + * reducing the flush dependency height of the first entry in + * the test hash bucket to zero. + * + * After completing a scan of the slist, + * H5C_flush_invalidate_cache() then scans the index, + * flushing all entries of flush dependency height zero. + * + * This sets up the potential error when the first entry + * in the test hash bucket is flushed -- expunging the + * second entry as a side effect. If + * H5C_flush_invalidate_cache() fails to detect this, + * it will attempt to continue its scan of the bucket with + * an entry that has been deleted from the cache. * * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/9/15 * * Modifications: * - * None. + * Added code to setup and take down the skip list before + * and after calls to H5C_flush_cache(). Do this via the + * H5C_FLUSH_CACHE macro. + * + * JRM -- 5/14/20 * *------------------------------------------------------------------------- */ @@ -35664,7 +35745,6 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) H5C_t * cache_ptr = file_ptr->shared->cache; int i; int expected_hash_bucket = 0; - herr_t result; haddr_t entry_addr; test_entry_t * entry_ptr; test_entry_t * base_addr = NULL; @@ -35883,17 +35963,14 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) /* test setup complete -- flush the cache to run and end the test. */ - if(pass) { - - result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); + if ( pass ) { - if(result < 0) { + H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_INVALIDATE_FLAG, \ + "Cache flush invalidate failed after flush op eviction test") - pass = FALSE; - failure_mssg = "Cache flush invalidate failed after flush op eviction test"; - } - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0)) { + if ( ( pass ) && + ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) ) { pass = FALSE; failure_mssg = "Unexpected cache len/size after cleanup of flush op eviction test"; @@ -36036,26 +36113,34 @@ check_stats(unsigned paged) /*------------------------------------------------------------------------- * Function: check_stats__smoke_check_1() * - * Purpose: Test to see if the statistics collection code is working - * more or less as expected. Do this by performing a number - * of operations in the cache, and checking to verify that - * they result in the expected statistics. + * Purpose: Test to see if the statistics collection code is working + * more or less as expected. Do this by performing a number + * of operations in the cache, and checking to verify that + * they result in the expected statistics. * - * Note that this function is not intended to be a full test - * of the statistics collection facility -- only a cursory - * check that will serve as a place holder until more complete - * tests are implemented. + * Note that this function is not intended to be a full test + * of the statistics collection facility -- only a cursory + * check that will serve as a place holder until more complete + * tests are implemented. * * Do nothing if pass is FALSE on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 4/22/15 * * Modifications: * - * None. + * Modified slist stats checks to allow for the case that + * the slist is disabled. + * + * Also added code to setup and take down the skip list before + * and after calls to H5C_flush_cache(). Do this via the + * H5C_FLUSH_CACHE macro. + * + * JRM -- 5/14/20 + * * *------------------------------------------------------------------------- */ @@ -36063,9 +36148,8 @@ check_stats(unsigned paged) static void check_stats__smoke_check_1(H5F_t * file_ptr) { - H5C_t * cache_ptr = file_ptr->shared->cache; + H5C_t * cache_ptr = file_ptr->shared->cache; int i; - herr_t result; if(pass) { if(cache_ptr == NULL) { @@ -36129,36 +36213,39 @@ check_stats__smoke_check_1(H5F_t * file_ptr) failure_mssg = "Unexpected monster size entry stats in check_stats__smoke_check_1(1)."; } /* end if */ - if(pass) - if((cache_ptr->total_ht_insertions != 32) || - (cache_ptr->total_ht_deletions != 0) || - (cache_ptr->successful_ht_searches != 0) || - (cache_ptr->total_successful_ht_search_depth != 0) || - (cache_ptr->failed_ht_searches != 32) || - (cache_ptr->total_failed_ht_search_depth != 48) || - (cache_ptr->max_index_len != 32) || - (cache_ptr->max_index_size != 2 * 1024 * 1024) || - (cache_ptr->max_clean_index_size != 0) || - (cache_ptr->max_dirty_index_size != 2 * 1024 * 1024) || - (cache_ptr->max_slist_len != 32) || - (cache_ptr->max_slist_size != 2 * 1024 * 1024) || - (cache_ptr->max_pl_len != 0) || - (cache_ptr->max_pl_size != 0) || - (cache_ptr->max_pel_len != 0) || - (cache_ptr->max_pel_size != 0) || - (cache_ptr->calls_to_msic != 0) || - (cache_ptr->total_entries_skipped_in_msic != 0) || - (cache_ptr->total_entries_scanned_in_msic != 0) || - (cache_ptr->max_entries_skipped_in_msic != 0) || - (cache_ptr->max_entries_scanned_in_msic != 0) || - (cache_ptr->entries_scanned_to_make_space != 0) || - (cache_ptr->slist_scan_restarts != 0) || - (cache_ptr->LRU_scan_restarts != 0) || - (cache_ptr->index_scan_restarts != 0)) { + if ( pass ) { + + if ( ( cache_ptr->total_ht_insertions != 32 ) || + ( cache_ptr->total_ht_deletions != 0 ) || + ( cache_ptr->successful_ht_searches != 0 ) || + ( cache_ptr->total_successful_ht_search_depth != 0 ) || + ( cache_ptr->failed_ht_searches != 32 ) || + ( cache_ptr->total_failed_ht_search_depth != 48 ) || + ( cache_ptr->max_index_len != 32 ) || + ( cache_ptr->max_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_clean_index_size != 0 ) || + ( cache_ptr->max_dirty_index_size != 2 * 1024 * 1024 ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->max_slist_len != 32 ) || + ( cache_ptr->max_slist_size != 2 * 1024 * 1024 ) ) ) || + ( cache_ptr->max_pl_len != 0 ) || + ( cache_ptr->max_pl_size != 0 ) || + ( cache_ptr->max_pel_len != 0 ) || + ( cache_ptr->max_pel_size != 0 ) || + ( cache_ptr->calls_to_msic != 0 ) || + ( cache_ptr->total_entries_skipped_in_msic != 0 ) || + ( cache_ptr->total_entries_scanned_in_msic != 0 ) || + ( cache_ptr->max_entries_skipped_in_msic != 0 ) || + ( cache_ptr->max_entries_scanned_in_msic != 0 ) || + ( cache_ptr->entries_scanned_to_make_space != 0 ) || + ( cache_ptr->slist_scan_restarts != 0 ) || + ( cache_ptr->LRU_scan_restarts != 0 ) || + ( cache_ptr->index_scan_restarts != 0 ) ) { pass = FALSE; failure_mssg = "Unexpected cache stats in check_stats__smoke_check_1(1)."; } /* end if */ + } #if H5C_COLLECT_CACHE_ENTRY_STATS if(pass) @@ -36214,36 +36301,39 @@ check_stats__smoke_check_1(H5F_t * file_ptr) failure_mssg = "Unexpected monster size entry stats in check_stats__smoke_check_1(2)."; } /* end if */ - if(pass) - if((cache_ptr->total_ht_insertions != 32) || - (cache_ptr->total_ht_deletions != 0) || - (cache_ptr->successful_ht_searches != 32) || - (cache_ptr->total_successful_ht_search_depth != 96) || - (cache_ptr->failed_ht_searches != 32) || - (cache_ptr->total_failed_ht_search_depth != 48) || - (cache_ptr->max_index_len != 32) || - (cache_ptr->max_index_size != 2 * 1024 * 1024) || - (cache_ptr->max_clean_index_size != 0) || - (cache_ptr->max_dirty_index_size != 2 * 1024 * 1024) || - (cache_ptr->max_slist_len != 32) || - (cache_ptr->max_slist_size != 2 * 1024 * 1024) || - (cache_ptr->max_pl_len != 1) || - (cache_ptr->max_pl_size != 64 * 1024) || - (cache_ptr->max_pel_len != 0) || - (cache_ptr->max_pel_size != 0) || - (cache_ptr->calls_to_msic != 0) || - (cache_ptr->total_entries_skipped_in_msic != 0) || - (cache_ptr->total_entries_scanned_in_msic != 0) || - (cache_ptr->max_entries_skipped_in_msic != 0) || - (cache_ptr->max_entries_scanned_in_msic != 0) || - (cache_ptr->entries_scanned_to_make_space != 0) || - (cache_ptr->slist_scan_restarts != 0) || - (cache_ptr->LRU_scan_restarts != 0) || - (cache_ptr->index_scan_restarts != 0)) { + if ( pass ) { + + if ( ( cache_ptr->total_ht_insertions != 32 ) || + ( cache_ptr->total_ht_deletions != 0 ) || + ( cache_ptr->successful_ht_searches != 32 ) || + ( cache_ptr->total_successful_ht_search_depth != 96 ) || + ( cache_ptr->failed_ht_searches != 32 ) || + ( cache_ptr->total_failed_ht_search_depth != 48 ) || + ( cache_ptr->max_index_len != 32 ) || + ( cache_ptr->max_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_clean_index_size != 0 ) || + ( cache_ptr->max_dirty_index_size != 2 * 1024 * 1024 ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->max_slist_len != 32 ) || + ( cache_ptr->max_slist_size != 2 * 1024 * 1024 ) ) ) || + ( cache_ptr->max_pl_len != 1 ) || + ( cache_ptr->max_pl_size != 64 * 1024 ) || + ( cache_ptr->max_pel_len != 0 ) || + ( cache_ptr->max_pel_size != 0 ) || + ( cache_ptr->calls_to_msic != 0 ) || + ( cache_ptr->total_entries_skipped_in_msic != 0 ) || + ( cache_ptr->total_entries_scanned_in_msic != 0 ) || + ( cache_ptr->max_entries_skipped_in_msic != 0 ) || + ( cache_ptr->max_entries_scanned_in_msic != 0 ) || + ( cache_ptr->entries_scanned_to_make_space != 0 ) || + ( cache_ptr->slist_scan_restarts != 0 ) || + ( cache_ptr->LRU_scan_restarts != 0 ) || + ( cache_ptr->index_scan_restarts != 0 ) ) { pass = FALSE; failure_mssg = "Unexpected cache stats in check_stats__smoke_check_1(2)."; } /* end if */ + } #if H5C_COLLECT_CACHE_ENTRY_STATS if(pass) @@ -36299,36 +36389,39 @@ check_stats__smoke_check_1(H5F_t * file_ptr) failure_mssg = "Unexpected monster size entry stats in check_stats__smoke_check_1(3)."; } /* end if */ - if(pass) - if((cache_ptr->total_ht_insertions != 33) || - (cache_ptr->total_ht_deletions != 1) || - (cache_ptr->successful_ht_searches != 32) || - (cache_ptr->total_successful_ht_search_depth != 96) || - (cache_ptr->failed_ht_searches != 33) || - (cache_ptr->total_failed_ht_search_depth != 52) || - (cache_ptr->max_index_len != 32) || - (cache_ptr->max_index_size != 2 * 1024 * 1024) || - (cache_ptr->max_clean_index_size != 2 * 1024 * 1024) || - (cache_ptr->max_dirty_index_size != 2 * 1024 * 1024) || - (cache_ptr->max_slist_len != 32) || - (cache_ptr->max_slist_size != 2 * 1024 * 1024) || - (cache_ptr->max_pl_len != 1) || - (cache_ptr->max_pl_size != 64 * 1024) || - (cache_ptr->max_pel_len != 0) || - (cache_ptr->max_pel_size != 0) || - (cache_ptr->calls_to_msic != 1) || - (cache_ptr->total_entries_skipped_in_msic != 0) || - (cache_ptr->total_entries_scanned_in_msic != 33) || - (cache_ptr->max_entries_skipped_in_msic != 0) || - (cache_ptr->max_entries_scanned_in_msic != 33) || - (cache_ptr->entries_scanned_to_make_space != 33) || - (cache_ptr->slist_scan_restarts != 0) || - (cache_ptr->LRU_scan_restarts != 0) || - (cache_ptr->index_scan_restarts != 0)) { + if ( pass ) { + + if ( ( cache_ptr->total_ht_insertions != 33 ) || + ( cache_ptr->total_ht_deletions != 1 ) || + ( cache_ptr->successful_ht_searches != 32 ) || + ( cache_ptr->total_successful_ht_search_depth != 96 ) || + ( cache_ptr->failed_ht_searches != 33 ) || + ( cache_ptr->total_failed_ht_search_depth != 52 ) || + ( cache_ptr->max_index_len != 32 ) || + ( cache_ptr->max_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_clean_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_dirty_index_size != 2 * 1024 * 1024 ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->max_slist_len != 32 ) || + ( cache_ptr->max_slist_size != 2 * 1024 * 1024 ) ) ) || + ( cache_ptr->max_pl_len != 1 ) || + ( cache_ptr->max_pl_size != 64 * 1024 ) || + ( cache_ptr->max_pel_len != 0 ) || + ( cache_ptr->max_pel_size != 0 ) || + ( cache_ptr->calls_to_msic != 1 ) || + ( cache_ptr->total_entries_skipped_in_msic != 0 ) || + ( cache_ptr->total_entries_scanned_in_msic != 33 ) || + ( cache_ptr->max_entries_skipped_in_msic != 0 ) || + ( cache_ptr->max_entries_scanned_in_msic != 33 ) || + ( cache_ptr->entries_scanned_to_make_space != 33 ) || + ( cache_ptr->slist_scan_restarts != 0 ) || + ( cache_ptr->LRU_scan_restarts != 0 ) || + ( cache_ptr->index_scan_restarts != 0 ) ) { pass = FALSE; failure_mssg = "Unexpected cache stats in check_stats__smoke_check_1(3)."; } /* end if */ + } #if H5C_COLLECT_CACHE_ENTRY_STATS if(pass) @@ -36356,17 +36449,14 @@ check_stats__smoke_check_1(H5F_t * file_ptr) /* flush the cache to end the test and collect all entry stats */ - if(pass) { - - result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); + if ( pass ) { - if(result < 0) { + H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_INVALIDATE_FLAG, \ + "Cache flush invalidate failed in check_stats__smoke_check_1()") - pass = FALSE; - failure_mssg = "Cache flush invalidate failed in check_stats__smoke_check_1()"; - } /* end if */ - else if((cache_ptr->index_len != 0) || - (cache_ptr->index_size != 0)) { + if ( ( pass ) && + ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) ) { pass = FALSE; failure_mssg = "Unexpected cache len/size after check_stats__smoke_check_1()"; @@ -36403,36 +36493,39 @@ check_stats__smoke_check_1(H5F_t * file_ptr) failure_mssg = "Unexpected monster size entry stats in check_stats__smoke_check_1(4)."; } /* end if */ - if(pass) - if((cache_ptr->total_ht_insertions != 33) || - (cache_ptr->total_ht_deletions != 33) || - (cache_ptr->successful_ht_searches != 33) || - (cache_ptr->total_successful_ht_search_depth != 99) || - (cache_ptr->failed_ht_searches != 33) || - (cache_ptr->total_failed_ht_search_depth != 52) || - (cache_ptr->max_index_len != 32) || - (cache_ptr->max_index_size != 2 * 1024 * 1024) || - (cache_ptr->max_clean_index_size != 2 * 1024 * 1024) || - (cache_ptr->max_dirty_index_size != 2 * 1024 * 1024) || - (cache_ptr->max_slist_len != 32) || - (cache_ptr->max_slist_size != 2 * 1024 * 1024) || - (cache_ptr->max_pl_len != 1) || - (cache_ptr->max_pl_size != 64 * 1024) || - (cache_ptr->max_pel_len != 0) || - (cache_ptr->max_pel_size != 0) || - (cache_ptr->calls_to_msic != 1) || - (cache_ptr->total_entries_skipped_in_msic != 0) || - (cache_ptr->total_entries_scanned_in_msic != 33) || - (cache_ptr->max_entries_skipped_in_msic != 0) || - (cache_ptr->max_entries_scanned_in_msic != 33) || - (cache_ptr->entries_scanned_to_make_space != 33) || - (cache_ptr->slist_scan_restarts != 0) || - (cache_ptr->LRU_scan_restarts != 0) || - (cache_ptr->index_scan_restarts != 0)) { + if ( pass ) { + + if ( ( cache_ptr->total_ht_insertions != 33 ) || + ( cache_ptr->total_ht_deletions != 33 ) || + ( cache_ptr->successful_ht_searches != 33 ) || + ( cache_ptr->total_successful_ht_search_depth != 99 ) || + ( cache_ptr->failed_ht_searches != 33 ) || + ( cache_ptr->total_failed_ht_search_depth != 52 ) || + ( cache_ptr->max_index_len != 32 ) || + ( cache_ptr->max_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_clean_index_size != 2 * 1024 * 1024 ) || + ( cache_ptr->max_dirty_index_size != 2 * 1024 * 1024 ) || + ( ( cache_ptr->slist_enabled ) && + ( ( cache_ptr->max_slist_len != 32 ) || + ( cache_ptr->max_slist_size != 2 * 1024 * 1024 ) ) ) || + ( cache_ptr->max_pl_len != 1 ) || + ( cache_ptr->max_pl_size != 64 * 1024 ) || + ( cache_ptr->max_pel_len != 0 ) || + ( cache_ptr->max_pel_size != 0 ) || + ( cache_ptr->calls_to_msic != 1 ) || + ( cache_ptr->total_entries_skipped_in_msic != 0 ) || + ( cache_ptr->total_entries_scanned_in_msic != 33 ) || + ( cache_ptr->max_entries_skipped_in_msic != 0 ) || + ( cache_ptr->max_entries_scanned_in_msic != 33 ) || + ( cache_ptr->entries_scanned_to_make_space != 33 ) || + ( cache_ptr->slist_scan_restarts != 0 ) || + ( cache_ptr->LRU_scan_restarts != 0 ) || + ( cache_ptr->index_scan_restarts != 0 ) ) { pass = FALSE; failure_mssg = "Unexpected cache stats in check_stats__smoke_check_1(4)."; } /* end if */ + } #if H5C_COLLECT_CACHE_ENTRY_STATS if(pass) diff --git a/test/cache_common.c b/test/cache_common.c index 1dc13a1..52ff33e 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -3111,12 +3111,25 @@ expunge_entry(H5F_t * file_ptr, * Function: flush_cache() * * Purpose: Flush the specified cache, destroying all entries if - requested. If requested, dump stats first. + * requested. If requested, dump stats first. * * Return: void * * Programmer: John Mainzer - * 6/23/04 + * 6/23/04 + * + * Changes: Added code to setup and take down the skip list before + * and after calls to H5C_flush_cache(). Do this via calls + * to the H5C_FLUSH_CACHE macro. + * + * This is necessary, as H5C_flush() is called repeatedly + * during file flush. If we setup and took down the + * skip list on H5C_flush_cache(), we would find ourselves + * doing this repeatedly -- which is contrary to the + * objective of the exercise (avoiding as many skip list + * operations as possible). + * + * JRM -- 5/14/20 * *------------------------------------------------------------------------- */ @@ -3139,25 +3152,30 @@ flush_cache(H5F_t * file_ptr, cache_ptr = file_ptr->shared->cache; - if(destroy_entries) - result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); + if ( destroy_entries ) { - else - result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); + H5C_FLUSH_CACHE(file_ptr, H5C__FLUSH_INVALIDATE_FLAG, \ + "error in H5C_flush_cache().") - if(dump_stats) - H5C_stats(cache_ptr, "test cache", dump_detailed_stats); + } else { - if(result < 0) { - pass = FALSE; - failure_mssg = "error in H5C_flush_cache()."; + H5C_FLUSH_CACHE(file_ptr, H5C__NO_FLAGS_SET, \ + "error in H5C_flush_cache().") + } + + if ( dump_stats ) { + + H5C_stats(cache_ptr, "test cache", dump_detailed_stats); } - else if((destroy_entries) && ((cache_ptr->index_len != 0) - || (cache_ptr->index_size != 0) - || (cache_ptr->clean_index_size != 0) - || (cache_ptr->dirty_index_size != 0))) { - if(verbose) { + if ( ( pass ) && ( destroy_entries ) && + ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) || + ( cache_ptr->clean_index_size != 0 ) || + ( cache_ptr->dirty_index_size != 0 ) ) ) { + + if ( verbose ) { + HDfprintf(stdout, "%s: unexpected il/is/cis/dis = %lld/%lld/%lld/%lld.\n", FUNC, @@ -3961,14 +3979,19 @@ unprotect_entry(H5F_t * file_ptr, * Function: row_major_scan_forward() * * Purpose: Do a sequence of inserts, protects, unprotects, moves, - * destroys while scanning through the set of entries. If - * pass is false on entry, do nothing. + * destroys while scanning through the set of entries. If + * pass is false on entry, do nothing. * * Return: void * * Programmer: John Mainzer * 6/12/04 * + * Changes: Updated slist size == dirty index size checks to + * bypass the test if cache_ptr->slist_enabled is FALSE. + * + * JRM -- 5/8/20 + * *------------------------------------------------------------------------- */ void @@ -3983,7 +4006,7 @@ row_major_scan_forward(H5F_t * file_ptr, hbool_t do_moves, hbool_t move_to_main_addr, hbool_t do_destroys, - hbool_t do_mult_ro_protects, + hbool_t do_mult_ro_protects, int dirty_destroys, int dirty_unprotects) { @@ -4022,7 +4045,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "1(i, %d, %d) ", type, tmp_idx); insert_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ tmp_idx--; @@ -4033,7 +4059,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "2(p, %d, %d) ", type, tmp_idx); protect_entry(file_ptr, type, tmp_idx); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ tmp_idx--; @@ -4044,7 +4073,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "3(u, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ /* (don't decrement tmp_idx) */ @@ -4055,7 +4087,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "4(r, %d, %d, %d) ", type, tmp_idx, (int)move_to_main_addr); move_entry(cache_ptr, type, tmp_idx, move_to_main_addr); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ tmp_idx--; @@ -4066,7 +4101,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "5(p, %d, %d) ", type, tmp_idx); protect_entry(file_ptr, type, tmp_idx); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ tmp_idx -= 2; @@ -4077,7 +4115,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "6(u, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ if(do_mult_ro_protects) { @@ -4089,7 +4130,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "7(p-ro, %d, %d) ", type, tmp_idx); protect_entry_ro(file_ptr, type, tmp_idx); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ tmp_idx--; @@ -4100,7 +4144,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "8(p-ro, %d, %d) ", type, tmp_idx); protect_entry_ro(file_ptr, type, tmp_idx); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ tmp_idx--; @@ -4111,7 +4158,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "9(p-ro, %d, %d) ", type, tmp_idx); protect_entry_ro(file_ptr, type, tmp_idx); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ /* (don't decrement tmp_idx) */ @@ -4122,7 +4172,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "10(u-ro, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ tmp_idx--; @@ -4133,7 +4186,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "11(u-ro, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ tmp_idx--; @@ -4144,7 +4200,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "12(u-ro, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ } /* if ( do_mult_ro_protects ) */ @@ -4153,7 +4212,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "13(p, %d, %d) ", type, idx); protect_entry(file_ptr, type, idx); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ tmp_idx = idx - lag + 2; @@ -4164,7 +4226,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "14(u, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ tmp_idx--; @@ -4175,7 +4240,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "15(p, %d, %d) ", type, tmp_idx); protect_entry(file_ptr, type, tmp_idx); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ if(do_destroys) { @@ -4187,7 +4255,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "16(u, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); break; case 1: @@ -4196,14 +4267,20 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "17(u, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ else { if(verbose) HDfprintf(stdout, "18(u, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end else */ break; @@ -4212,7 +4289,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "19(u-del, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__DELETED_FLAG); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); break; case 3: @@ -4221,14 +4301,20 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "20(u-del, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, H5C__DELETED_FLAG); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ else { if(verbose) HDfprintf(stdout, "21(u-del, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, (dirty_destroys ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) | H5C__DELETED_FLAG); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end else */ break; @@ -4245,7 +4331,10 @@ row_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "22(u, %d, %d) ", type, tmp_idx); unprotect_entry(file_ptr, type, tmp_idx, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); - HDassert(cache_ptr->slist_size == cache_ptr->dirty_index_size); + + HDassert( ( ! cache_ptr->slist_enabled ) || \ + ( cache_ptr->slist_size == \ + cache_ptr->dirty_index_size ) ); } /* end if */ } /* end elsef */ diff --git a/test/cache_common.h b/test/cache_common.h index 785dc21..807ba35 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -134,6 +134,65 @@ (NOTIFY_ENTRY_SIZE * NUM_NOTIFY_ENTRIES)) #define ADDR_SPACE_SIZE (haddr_t)(MAX_ADDR - BASE_ADDR) + +/*********************************************************************** + * + * Macro: H5C_FLUSH_CACHE + * + * Purpose: Wrap a call to H5C_flush_cache() in calls to + * H5C_set_slist_enabled() to setup and take down the slist. + * + * This is necessary, as H5C_flush_cache() needs the + * slist to be active. Further, since it is called + * repeatedly during file flush, it would be inefficient + * for it to setup the slist on entry, and take it down + * on exit. + * + * Note that the slist need not be empty if the flags + * indicate a partial flush (i.e. + * H5C__FLUSH_MARKED_ENTRIES_FLAG). Compute clear_slist + * and pass it into H5C_set_slist_enabled as appropriate. + * + * On error, set pass to FALSE, and set failure_mssg + * to the supplied error message. + * + * Return: N/A + * + * Programmer: John Mainzer + * 5/14/20 + * + * Changes: None. + * + ***********************************************************************/ + +#define H5C_FLUSH_CACHE(file, flags, fail_mssg) \ +{ \ + hbool_t clear_slist; \ + herr_t rslt; \ + \ + clear_slist = ( (flags & H5C__FLUSH_MARKED_ENTRIES_FLAG) != 0 ); \ + \ + rslt = H5C_set_slist_enabled((file)->shared->cache, TRUE, FALSE); \ + \ + if ( rslt >= 0 ) { \ + \ + rslt = H5C_flush_cache((file), (flags)); \ + } \ + \ + if ( rslt >= 0 ) { \ + \ + rslt = H5C_set_slist_enabled((file)->shared->cache, FALSE, \ + clear_slist); \ + } \ + \ + if( rslt < 0 ) { \ + \ + pass = FALSE; \ + failure_mssg = (fail_mssg); \ + } \ +} /* H5C_FLUSH_CACHE */ + + #define MAX_PINS 8 /* Maximum number of entries that can be * directly pinned by a single entry. */ diff --git a/test/cache_tagging.c b/test/cache_tagging.c index cf0cd8d..499f23b 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -348,11 +348,20 @@ evict_entries(hid_t fid) /* Mark all entries investigated */ mark_all_entries_investigated(fid); + /* setup the skip list prior to calling H5C_flush_cache() */ + if ( H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0 ) + TEST_ERROR; + /* Evict all we can from the cache to examine full tag creation tree */ - /* This function will likely return failure since the root group - * is still protected. Thus, don't check its return value. */ + /* This function will likely return failure since the root group + * is still protected. Thus, don't check its return value. + */ H5C_flush_cache(f, H5C__FLUSH_INVALIDATE_FLAG); + /* shutdown the slist -- allow it to be non-empty */ + if ( H5C_set_slist_enabled(f->shared->cache, FALSE, TRUE) < 0 ) + TEST_ERROR; + return 0; error: diff --git a/test/ohdr.c b/test/ohdr.c index ad76576..709f67f 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -126,8 +126,12 @@ test_cont(char *filename, hid_t fapl) FAIL_STACK_ERROR if(1 != H5O_link(&oh_locB, 1)) FAIL_STACK_ERROR + if(H5AC_prep_for_file_flush(f) < 0) + FAIL_STACK_ERROR if(H5AC_flush(f) < 0) FAIL_STACK_ERROR + if(H5AC_secure_from_file_flush(f) < 0) + FAIL_STACK_ERROR if(H5O__expunge_chunks_test(&oh_locA) < 0) FAIL_STACK_ERROR @@ -1681,8 +1685,12 @@ main(void) FAIL_STACK_ERROR if(1 != H5O_link(&oh_loc, 1)) FAIL_STACK_ERROR + if(H5AC_prep_for_file_flush(f) < 0) + FAIL_STACK_ERROR if(H5AC_flush(f) < 0) FAIL_STACK_ERROR + if(H5AC_secure_from_file_flush(f) < 0) + FAIL_STACK_ERROR if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) FAIL_STACK_ERROR if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro)) @@ -1698,8 +1706,12 @@ main(void) time_new = 33333333; if(H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR + if(H5AC_prep_for_file_flush(f) < 0) + FAIL_STACK_ERROR if(H5AC_flush(f) < 0) FAIL_STACK_ERROR + if(H5AC_secure_from_file_flush(f) < 0) + FAIL_STACK_ERROR if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) FAIL_STACK_ERROR if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro)) @@ -1729,8 +1741,12 @@ main(void) if(H5O_msg_create(&oh_loc, H5O_MTIME_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR } /* end for */ + if(H5AC_prep_for_file_flush(f) < 0) + FAIL_STACK_ERROR if(H5AC_flush(f) < 0) FAIL_STACK_ERROR + if(H5AC_secure_from_file_flush(f) < 0) + FAIL_STACK_ERROR if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) FAIL_STACK_ERROR @@ -1772,8 +1788,12 @@ main(void) time_new = (i + 1) * 1000 + 10; if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR + if(H5AC_prep_for_file_flush(f) < 0) + FAIL_STACK_ERROR if(H5AC_flush(f) < 0) FAIL_STACK_ERROR + if(H5AC_secure_from_file_flush(f) < 0) + FAIL_STACK_ERROR if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1802,8 +1822,12 @@ main(void) time_new = 22222222; if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, H5O_MSG_FLAG_CONSTANT, 0, &time_new) < 0) FAIL_STACK_ERROR + if(H5AC_prep_for_file_flush(f) < 0) + FAIL_STACK_ERROR if(H5AC_flush(f) < 0) FAIL_STACK_ERROR + if(H5AC_secure_from_file_flush(f) < 0) + FAIL_STACK_ERROR if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) FAIL_STACK_ERROR if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro)) -- cgit v0.12 From 65e92e1d56dd2e04ebe7b7713fee9e9e38cd8849 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 5 Aug 2020 17:15:57 -0700 Subject: Warning fixes in tools and h5test.c --- test/h5test.c | 23 ++++++++++++------- tools/lib/h5diff_attr.c | 49 ++++++++++++++++++++-------------------- tools/src/h5diff/h5diff_common.c | 5 +++- 3 files changed, 43 insertions(+), 34 deletions(-) diff --git a/test/h5test.c b/test/h5test.c index 1b445dd..28513b9 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -2097,8 +2097,14 @@ h5_compare_file_bytes(char *f1name, char *f2name) HDrewind(f1ptr); HDrewind(f2ptr); for (ii = 0; ii < f1size; ii++) { - HDfread(&f1char, 1, 1, f1ptr); - HDfread(&f2char, 1, 1, f2ptr); + if(HDfread(&f1char, 1, 1, f1ptr) != 1) { + ret_value = -1; + goto done; + } + if(HDfread(&f2char, 1, 1, f2ptr) != 1) { + ret_value = -1; + goto done; + } if (f1char != f2char) { HDfprintf(stderr, "Mismatch @ 0x%llX: 0x%X != 0x%X\n", ii, f1char, f2char); ret_value = -1; @@ -2107,13 +2113,11 @@ h5_compare_file_bytes(char *f1name, char *f2name) } done: - if (f1ptr) { + if (f1ptr) HDfclose(f1ptr); - } - if (f2ptr) { + if (f2ptr) HDfclose(f2ptr); - } - return(ret_value); + return ret_value; } /* end h5_compare_file_bytes() */ /*------------------------------------------------------------------------- @@ -2220,7 +2224,10 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest) } while (read_size > 0) { - HDfread(dup_buf, read_size, 1, orig_ptr); /* warning: no error-check */ + if(HDfread(dup_buf, read_size, 1, orig_ptr) != 1) { + ret_value = -1; + goto done; + } HDfwrite(dup_buf, read_size, 1, dest_ptr); fsize -= read_size; read_size = MIN(fsize, max_buf); diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index b7ec2e8..48663e2 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -333,7 +333,7 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, hsize_t dims1[H5S_MAX_RANK]; /* dimensions of dataset */ hsize_t dims2[H5S_MAX_RANK]; /* dimensions of dataset */ hsize_t nfound = 0; - int j; + size_t sz; diff_err_t ret_value = opts->err_stat; H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat); @@ -384,19 +384,19 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, H5TOOLS_DEBUG("attr_names: %s - %s", name1, name2); if (name1) { - j = (int)HDstrlen(name1); - H5TOOLS_DEBUG("attr1_name: %s - %d", name1, j); - if (j > 0) { - opts->obj_name[0] = (char *)HDmalloc((size_t)j + 1); - HDstrncpy(opts->obj_name[0], name1, (size_t)j + 1); + sz = HDstrlen(name1); + H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz); + if (sz > 0) { + opts->obj_name[0] = (char *)HDmalloc(sz + 1); + HDstrncpy(opts->obj_name[0], name1, sz + 1); } } if (name2) { - j = (int)HDstrlen(name2); - H5TOOLS_DEBUG("attr2_name: %s - %d", name2, j); - if (j > 0) { - opts->obj_name[1] = (char *)HDmalloc((size_t)j + 1); - HDstrncpy(opts->obj_name[1], name2, (size_t)j + 1); + sz = HDstrlen(name2); + H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz); + if (sz > 0) { + opts->obj_name[1] = (char *)HDmalloc(sz + 1); + HDstrncpy(opts->obj_name[1], name2, sz + 1); } } H5TOOLS_DEBUG("attr_names: %s - %s", opts->obj_name[0], opts->obj_name[1]); @@ -404,6 +404,9 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, /* pass dims1 and dims2 for maxdims as well since attribute's maxdims * are always same */ if(diff_can_type(ftype1_id, ftype2_id, rank1, rank2, dims1, dims2, dims1, dims2, opts, 0) == 1) { + + int j; + /*----------------------------------------------------------------- * "upgrade" the smaller memory size *------------------------------------------------------------------ @@ -461,22 +464,18 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, H5TOOLS_DEBUG("attr_names: %s - %s : %s - %s", name1, name2, path1, path2); if (name1) { - j = (int)HDstrlen(name1) + (int)HDstrlen(path1) + 7; - H5TOOLS_DEBUG("attr1_name: %s - %d", name1, j); - if (j > 0) { - opts->obj_name[0] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); - HDsnprintf(opts->obj_name[0], j, "%s of <%s>", name1, path1); - opts->obj_name[0][j] = '\0'; - } + sz = HDstrlen(name1) + HDstrlen(path1) + 7; + H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz); + opts->obj_name[0] = (char *)HDcalloc(sz + 1, sizeof(char)); + HDsnprintf(opts->obj_name[0], sz, "%s of <%s>", name1, path1); + opts->obj_name[0][sz] = '\0'; } if (name2) { - j = (int)HDstrlen(name2) + (int)HDstrlen(path2) + 7; - H5TOOLS_DEBUG("attr2_name: %s - %d", name2, j); - if (j > 0) { - opts->obj_name[1] = (char *)HDcalloc((size_t)j + 1, sizeof(char)); - HDsnprintf(opts->obj_name[1], j, "%s of <%s>", name2, path2); - opts->obj_name[1][j] = '\0'; - } + sz = HDstrlen(name2) + HDstrlen(path2) + 7; + H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz); + opts->obj_name[1] = (char *)HDcalloc(sz + 1, sizeof(char)); + HDsnprintf(opts->obj_name[1], sz, "%s of <%s>", name2, path2); + opts->obj_name[1][sz] = '\0'; } /*--------------------------------------------------------------------- diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index a02ad5a..a4fe3bb 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -90,6 +90,7 @@ static void check_options(diff_opt_t* opts) * Return: *------------------------------------------------------------------------- */ +#if 0 static void parse_hsize_list(const char *h_list, subset_d *d) { @@ -139,6 +140,7 @@ parse_hsize_list(const char *h_list, subset_d *d) d->len = size_count; H5TOOLS_ENDDEBUG(""); } +#endif /*------------------------------------------------------------------------- * Function: parse_subset_params @@ -149,6 +151,7 @@ parse_hsize_list(const char *h_list, subset_d *d) * Failure: NULL *------------------------------------------------------------------------- */ +#if 0 static struct subset_t * parse_subset_params(const char *dset) { @@ -190,7 +193,7 @@ parse_subset_params(const char *dset) return s; } - +#endif /*------------------------------------------------------------------------- * Function: parse_command_line -- cgit v0.12 From 8e7f3e38a7a3ada0500d830df6b76b1caa31dc3d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 5 Aug 2020 22:13:38 -0700 Subject: Fixes warnings in the splitter VFD and tests --- src/H5FDsplitter.c | 94 ++++++++------------ test/vfd.c | 257 ++++++++++++++++++++++++++++++----------------------- 2 files changed, 186 insertions(+), 165 deletions(-) diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index 4ed3c4a..3c33f57 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -27,8 +27,6 @@ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5FDsec2.h" /* Generic Functions */ -#include "H5FDstdio.h" /* Generic Functions */ #include "H5Pprivate.h" /* Property lists */ /* The driver identification number, initialized at runtime */ @@ -93,7 +91,7 @@ typedef struct H5FD_splitter_t { #if H5FD_SPLITTER_DEBUG_OP_CALLS #define H5FD_SPLITTER_LOG_CALL(name) do { \ HDprintf("called %s()\n", (name)); \ - fflush(stdout); \ + HDfflush(stdout); \ } while (0) #else #define H5FD_SPLITTER_LOG_CALL(name) /* no-op */ @@ -302,27 +300,22 @@ done: herr_t H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config) { - H5FD_splitter_fapl_t info; + H5FD_splitter_fapl_t *info = NULL; H5P_genplist_t *plist_ptr = NULL; herr_t ret_value = SUCCEED; - H5Eclear2(H5E_DEFAULT); - FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Dr", fapl_id, vfd_config); H5FD_SPLITTER_LOG_CALL("H5Pset_fapl_splitter"); - if (H5FD_SPLITTER_MAGIC != vfd_config->magic) { + if (H5FD_SPLITTER_MAGIC != vfd_config->magic) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid configuration (magic number mismatch)") - } - if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version) { + if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invlaid config (version number mismatch)") - } - if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) { + if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid property list") - } /* Make sure that the W/O channel supports write-only capability. @@ -338,48 +331,46 @@ H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config) unsigned long wo_driver_flags = 0; wo_plist_ptr = (H5P_genplist_t *)H5I_object(vfd_config->wo_fapl_id); - if (NULL == wo_plist_ptr) { + if (NULL == wo_plist_ptr) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - } - if (H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0) { + if (H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID & info") - } wo_driver = (H5FD_class_t *)H5I_object(wo_driver_prop.driver_id); - if (NULL == wo_driver) { + if (NULL == wo_driver) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid driver ID in file access property list") - } - if (H5FD_driver_query(wo_driver, &wo_driver_flags) < 0) { + if (H5FD_driver_query(wo_driver, &wo_driver_flags) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't query VFD flags") - } - if (0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags)) { + if (0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags)) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "unsuitable W/O driver") - } } /* end if W/O VFD is non-default */ + if (NULL == (info = H5MM_calloc(sizeof(H5FD_splitter_fapl_t)))) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "can't allocate memory for splitter struct") - info.ignore_wo_errs = vfd_config->ignore_wo_errs; - HDstrncpy(info.wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX); - HDstrncpy(info.log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX); - info.rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ - info.wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ + info->ignore_wo_errs = vfd_config->ignore_wo_errs; + HDstrncpy(info->wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX); + HDstrncpy(info->log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX); + info->rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ + info->wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ /* Set non-default channel FAPL IDs in splitter configuration info */ if (H5P_DEFAULT != vfd_config->rw_fapl_id) { - if (FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) { + if (FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") - } - info.rw_fapl_id = vfd_config->rw_fapl_id; + info->rw_fapl_id = vfd_config->rw_fapl_id; } if (H5P_DEFAULT != vfd_config->wo_fapl_id) { - if (FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) { + if (FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") - } - info.wo_fapl_id = vfd_config->wo_fapl_id; + info->wo_fapl_id = vfd_config->wo_fapl_id; } - ret_value = H5P_set_driver(plist_ptr, H5FD_SPLITTER, &info); + if(H5P_set_driver(plist_ptr, H5FD_SPLITTER, info) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set driver") done: + H5MM_xfree(info); + FUNC_LEAVE_API(ret_value) } /* end H5Pset_fapl_splitter() */ @@ -409,45 +400,36 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_out) H5FD_SPLITTER_LOG_CALL("H5Pget_fapl_splitter"); /* Check arguments */ - if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) { + if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - } - if (config_out == NULL) { + if (config_out == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_out pointer is null") - } - if (H5FD_SPLITTER_MAGIC != config_out->magic) { + if (H5FD_SPLITTER_MAGIC != config_out->magic) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (magic number mismatch)") - } - if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version) { + if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (version unsafe)") - } /* Pre-set out FAPL IDs with intent to replace these values */ config_out->rw_fapl_id = H5I_INVALID_HID; config_out->wo_fapl_id = H5I_INVALID_HID; /* Check and get the splitter fapl */ - if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) { + if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - } - if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr)) { - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver") - } - if (NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr))) { - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "unable to get specific-driver info") - } + if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr)) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "incorrect VFL driver") + if (NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr))) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "unable to get specific-driver info") HDstrncpy(config_out->wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX); HDstrncpy(config_out->log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX); config_out->ignore_wo_errs = fapl_ptr->ignore_wo_errs; /* Copy R/W and W/O FAPLs */ - if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy R/W FAPL"); - } - if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy W/O FAPL"); - } + if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, FAIL, "can't copy R/W FAPL"); + if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, FAIL, "can't copy W/O FAPL"); done: FUNC_LEAVE_API(ret_value) diff --git a/test/vfd.c b/test/vfd.c index bb04e97..09ef106 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -2258,46 +2258,51 @@ static int compare_splitter_config_info(hid_t fapl_id, H5FD_splitter_vfd_config_t *info) { int ret_value = 0; - H5FD_splitter_vfd_config_t fetched_info; + H5FD_splitter_vfd_config_t *fetched_info = NULL; - fetched_info.magic = H5FD_SPLITTER_MAGIC; - fetched_info.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; - fetched_info.rw_fapl_id = H5I_INVALID_HID; - fetched_info.wo_fapl_id = H5I_INVALID_HID; + if (NULL == (fetched_info = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) + SPLITTER_TEST_FAULT("memory allocation for fetched_info struct failed"); - if (H5Pget_fapl_splitter(fapl_id, &fetched_info) < 0) { - SPLITTER_TEST_FAULT("can't get splitter info\n"); + fetched_info->magic = H5FD_SPLITTER_MAGIC; + fetched_info->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; + fetched_info->rw_fapl_id = H5I_INVALID_HID; + fetched_info->wo_fapl_id = H5I_INVALID_HID; + + if (H5Pget_fapl_splitter(fapl_id, fetched_info) < 0) { + SPLITTER_TEST_FAULT("can't get splitter info"); } if (info->rw_fapl_id == H5P_DEFAULT) { - if (H5Pget_driver(fetched_info.rw_fapl_id) != H5Pget_driver(H5P_FILE_ACCESS_DEFAULT)) { + if (H5Pget_driver(fetched_info->rw_fapl_id) != H5Pget_driver(H5P_FILE_ACCESS_DEFAULT)) { SPLITTER_TEST_FAULT("Read-Write driver mismatch (default)\n"); } } else { - if (H5Pget_driver(fetched_info.rw_fapl_id) != H5Pget_driver(info->rw_fapl_id)) { + if (H5Pget_driver(fetched_info->rw_fapl_id) != H5Pget_driver(info->rw_fapl_id)) { SPLITTER_TEST_FAULT("Read-Write driver mismatch\n"); } } if (info->wo_fapl_id == H5P_DEFAULT) { - if (H5Pget_driver(fetched_info.wo_fapl_id) != H5Pget_driver(H5P_FILE_ACCESS_DEFAULT)) { + if (H5Pget_driver(fetched_info->wo_fapl_id) != H5Pget_driver(H5P_FILE_ACCESS_DEFAULT)) { SPLITTER_TEST_FAULT("Write-Only driver mismatch (default)\n"); } } else { - if (H5Pget_driver(fetched_info.wo_fapl_id) != H5Pget_driver(info->wo_fapl_id)) { + if (H5Pget_driver(fetched_info->wo_fapl_id) != H5Pget_driver(info->wo_fapl_id)) { SPLITTER_TEST_FAULT("Write-Only driver mismatch\n"); } } - if ( (HDstrlen(info->wo_path) != HDstrlen(fetched_info.wo_path)) || - HDstrncmp(info->wo_path, fetched_info.wo_path, H5FD_SPLITTER_PATH_MAX)) + if ( (HDstrlen(info->wo_path) != HDstrlen(fetched_info->wo_path)) || + HDstrncmp(info->wo_path, fetched_info->wo_path, H5FD_SPLITTER_PATH_MAX)) { - HDfprintf(stderr, "MISMATCH: '%s' :: '%s'\n", info->wo_path, fetched_info.wo_path); + HDfprintf(stderr, "MISMATCH: '%s' :: '%s'\n", info->wo_path, fetched_info->wo_path); HEXPRINT(H5FD_SPLITTER_PATH_MAX, info->wo_path); - HEXPRINT(H5FD_SPLITTER_PATH_MAX, fetched_info.wo_path); + HEXPRINT(H5FD_SPLITTER_PATH_MAX, fetched_info->wo_path); SPLITTER_TEST_FAULT("Write-Only file path mismatch\n"); } done: + HDfree(fetched_info); + return ret_value; } /* end compare_splitter_config_info() */ @@ -2331,37 +2336,42 @@ run_splitter_test(const struct splitter_dataset_def *data, hid_t space_id = H5I_INVALID_HID; hid_t fapl_id_out = H5I_INVALID_HID; hid_t fapl_id_cpy = H5I_INVALID_HID; - H5FD_splitter_vfd_config_t vfd_config; - char filename_rw[H5FD_SPLITTER_PATH_MAX + 1]; + H5FD_splitter_vfd_config_t *vfd_config = NULL; + char *filename_rw = NULL; FILE *logfile = NULL; int ret_value = 0; - vfd_config.magic = H5FD_SPLITTER_MAGIC; - vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; - vfd_config.ignore_wo_errs = ignore_wo_errors; - vfd_config.rw_fapl_id = sub_fapl_ids[0]; - vfd_config.wo_fapl_id = sub_fapl_ids[1]; + if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) + SPLITTER_TEST_FAULT("memory allocation for vfd_config struct failed"); + if (NULL == (filename_rw = HDcalloc(H5FD_SPLITTER_PATH_MAX + 1, sizeof(char)))) + SPLITTER_TEST_FAULT("memory allocation for filename_rw string failed"); + + vfd_config->magic = H5FD_SPLITTER_MAGIC; + vfd_config->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; + vfd_config->ignore_wo_errs = ignore_wo_errors; + vfd_config->rw_fapl_id = sub_fapl_ids[0]; + vfd_config->wo_fapl_id = sub_fapl_ids[1]; - if (splitter_prepare_file_paths(&vfd_config, filename_rw) < 0) { + if (splitter_prepare_file_paths(vfd_config, filename_rw) < 0) { SPLITTER_TEST_FAULT("can't prepare file paths\n"); } if (provide_logfile_path == FALSE) { - *vfd_config.log_file_path = '\0'; /* reset as empty string */ + vfd_config->log_file_path[0] = '\0'; /* reset as empty string */ } /* Create a new fapl to use the SPLITTER file driver */ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == H5I_INVALID_HID) { SPLITTER_TEST_FAULT("can't create FAPL ID\n"); } - if (H5Pset_fapl_splitter(fapl_id, &vfd_config) < 0) { + if (H5Pset_fapl_splitter(fapl_id, vfd_config) < 0) { SPLITTER_TEST_FAULT("can't set splitter FAPL\n"); } if (H5Pget_driver(fapl_id) != H5FD_SPLITTER) { SPLITTER_TEST_FAULT("set FAPL not SPLITTER\n"); } - if (compare_splitter_config_info(fapl_id, &vfd_config) < 0) { + if (compare_splitter_config_info(fapl_id, vfd_config) < 0) { SPLITTER_TEST_FAULT("information mismatch\n"); } @@ -2374,7 +2384,7 @@ run_splitter_test(const struct splitter_dataset_def *data, if (H5I_INVALID_HID == fapl_id_cpy) { SPLITTER_TEST_FAULT("can't copy FAPL\n"); } - if (compare_splitter_config_info(fapl_id_cpy, &vfd_config) < 0) { + if (compare_splitter_config_info(fapl_id_cpy, vfd_config) < 0) { SPLITTER_TEST_FAULT("information mismatch\n"); } if (H5Pclose(fapl_id_cpy) < 0) { @@ -2401,7 +2411,7 @@ run_splitter_test(const struct splitter_dataset_def *data, if (H5Pget_driver(fapl_id_out) != H5FD_SPLITTER) { SPLITTER_TEST_FAULT("wrong file FAPL driver\n"); } - if (compare_splitter_config_info(fapl_id_out, &vfd_config) < 0) { + if (compare_splitter_config_info(fapl_id_out, vfd_config) < 0) { SPLITTER_TEST_FAULT("information mismatch\n"); } if (H5Pclose(fapl_id_out) < 0) { @@ -2439,12 +2449,12 @@ run_splitter_test(const struct splitter_dataset_def *data, } /* Verify that the R/W and W/O files are identical */ - if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) { + if (h5_compare_file_bytes(filename_rw, vfd_config->wo_path) < 0) { SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n"); } /* Verify existence of logfile iff appropriate */ - logfile = fopen(vfd_config.log_file_path, "r"); + logfile = fopen(vfd_config->log_file_path, "r"); if ( (TRUE == provide_logfile_path && NULL == logfile) || (FALSE == provide_logfile_path && NULL != logfile) ) { @@ -2454,19 +2464,22 @@ run_splitter_test(const struct splitter_dataset_def *data, done: if (ret_value < 0) { H5E_BEGIN_TRY { - (void)H5Dclose(dset_id); - (void)H5Sclose(space_id); - (void)H5Pclose(fapl_id_out); - (void)H5Pclose(fapl_id_cpy); - (void)H5Pclose(fapl_id); - (void)H5Fclose(file_id); + H5Dclose(dset_id); + H5Sclose(space_id); + H5Pclose(fapl_id_out); + H5Pclose(fapl_id_cpy); + H5Pclose(fapl_id); + H5Fclose(file_id); } H5E_END_TRY; } - if (logfile != NULL) { + + if (logfile != NULL) fclose(logfile); - } - return ret_value; + HDfree(vfd_config); + HDfree(filename_rw); + + return ret_value; } /* end run_splitter_test() */ @@ -2488,25 +2501,28 @@ done: static int driver_is_splitter_compatible(hid_t fapl_id) { - H5FD_splitter_vfd_config_t vfd_config; + H5FD_splitter_vfd_config_t *vfd_config = NULL; hid_t split_fapl_id = H5I_INVALID_HID; herr_t ret = SUCCEED; int ret_value = 0; - split_fapl_id = H5Pcreate(H5P_FILE_ACCESS); - if (H5I_INVALID_HID == split_fapl_id) { + if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) { + FAIL_PUTS_ERROR("memory allocation for vfd_config struct failed"); + } + + if(H5I_INVALID_HID == (split_fapl_id = H5Pcreate(H5P_FILE_ACCESS))) { FAIL_PUTS_ERROR("Can't create contained FAPL"); } - vfd_config.magic = H5FD_SPLITTER_MAGIC; - vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; - vfd_config.ignore_wo_errs = FALSE; - vfd_config.rw_fapl_id = H5P_DEFAULT; - vfd_config.wo_fapl_id = fapl_id; - HDstrncpy(vfd_config.wo_path, "nonesuch", H5FD_SPLITTER_PATH_MAX); - *vfd_config.log_file_path = '\0'; + vfd_config->magic = H5FD_SPLITTER_MAGIC; + vfd_config->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; + vfd_config->ignore_wo_errs = FALSE; + vfd_config->rw_fapl_id = H5P_DEFAULT; + vfd_config->wo_fapl_id = fapl_id; + HDstrncpy(vfd_config->wo_path, "nonesuch", H5FD_SPLITTER_PATH_MAX); + vfd_config->log_file_path[0] = '\0'; H5E_BEGIN_TRY { - ret = H5Pset_fapl_splitter(split_fapl_id, &vfd_config); + ret = H5Pset_fapl_splitter(split_fapl_id, vfd_config); } H5E_END_TRY; if (SUCCEED == ret) { ret_value = -1; @@ -2517,12 +2533,17 @@ driver_is_splitter_compatible(hid_t fapl_id) } split_fapl_id = H5I_INVALID_HID; + HDfree(vfd_config); + return ret_value; error: H5E_BEGIN_TRY { - (void)H5Pclose(split_fapl_id); + H5Pclose(split_fapl_id); } H5E_END_TRY; + + HDfree(vfd_config); + return -1; } /* end driver_is_splitter_compatible() */ @@ -2545,19 +2566,24 @@ splitter_RO_test( const struct splitter_dataset_def *data, hid_t child_fapl_id) { - char filename_rw[H5FD_SPLITTER_PATH_MAX + 1]; - H5FD_splitter_vfd_config_t vfd_config; + char *filename_rw = NULL; + H5FD_splitter_vfd_config_t *vfd_config = NULL; hid_t fapl_id = H5I_INVALID_HID; - int ret_value = 0; hid_t file_id = H5I_INVALID_HID; + int ret_value = 0; - vfd_config.magic = H5FD_SPLITTER_MAGIC; - vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; - vfd_config.ignore_wo_errs = FALSE; - vfd_config.rw_fapl_id = child_fapl_id; - vfd_config.wo_fapl_id = child_fapl_id; + if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) + SPLITTER_TEST_FAULT("memory allocation for vfd_config struct failed"); + if (NULL == (filename_rw = HDcalloc(H5FD_SPLITTER_PATH_MAX + 1, sizeof(char)))) + SPLITTER_TEST_FAULT("memory allocation for filename_rw string failed"); - if (splitter_prepare_file_paths(&vfd_config, filename_rw) < 0) { + vfd_config->magic = H5FD_SPLITTER_MAGIC; + vfd_config->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; + vfd_config->ignore_wo_errs = FALSE; + vfd_config->rw_fapl_id = child_fapl_id; + vfd_config->wo_fapl_id = child_fapl_id; + + if (splitter_prepare_file_paths(vfd_config, filename_rw) < 0) { SPLITTER_TEST_FAULT("can't prepare splitter file paths\n"); } @@ -2566,7 +2592,7 @@ splitter_RO_test( if (H5I_INVALID_HID == fapl_id) { SPLITTER_TEST_FAULT("can't create FAPL ID\n"); } - if (H5Pset_fapl_splitter(fapl_id, &vfd_config) < 0) { + if (H5Pset_fapl_splitter(fapl_id, vfd_config) < 0) { SPLITTER_TEST_FAULT("can't set splitter FAPL\n"); } if (H5Pget_driver(fapl_id) != H5FD_SPLITTER) { @@ -2588,7 +2614,7 @@ splitter_RO_test( * Should fail. */ - if (splitter_create_single_file_at(vfd_config.wo_path, vfd_config.wo_fapl_id, data) < 0) { + if (splitter_create_single_file_at(vfd_config->wo_path, vfd_config->wo_fapl_id, data) < 0) { SPLITTER_TEST_FAULT("can't write W/O file\n"); } H5E_BEGIN_TRY { @@ -2597,13 +2623,13 @@ splitter_RO_test( if (file_id >= 0) { SPLITTER_TEST_FAULT("R/O open with extant W/O file unexpectedly successful\n"); } - HDremove(vfd_config.wo_path); + HDremove(vfd_config->wo_path); /* Attempt R/O open when only R/W file exists * Should fail. */ - if (splitter_create_single_file_at(filename_rw, vfd_config.rw_fapl_id, data) < 0) { + if (splitter_create_single_file_at(filename_rw, vfd_config->rw_fapl_id, data) < 0) { SPLITTER_TEST_FAULT("can't create R/W file\n"); } H5E_BEGIN_TRY { @@ -2616,7 +2642,7 @@ splitter_RO_test( /* Attempt R/O open when both R/W and W/O files exist */ - if (splitter_create_single_file_at(vfd_config.wo_path, vfd_config.wo_fapl_id, data) < 0) { + if (splitter_create_single_file_at(vfd_config->wo_path, vfd_config->wo_fapl_id, data) < 0) { SPLITTER_TEST_FAULT("can't create W/O file\n"); } file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id); @@ -2642,10 +2668,14 @@ splitter_RO_test( done: if (ret_value < 0) { H5E_BEGIN_TRY { - (void)H5Pclose(fapl_id); - (void)H5Fclose(file_id); + H5Pclose(fapl_id); + H5Fclose(file_id); } H5E_END_TRY; - } /* end if error */ + } + + HDfree(vfd_config); + HDfree(filename_rw); + return ret_value; } /* end splitter_RO_test() */ @@ -2784,9 +2814,9 @@ splitter_create_single_file_at( done: if (ret_value < 0) { H5E_BEGIN_TRY { - (void)H5Dclose(dset_id); - (void)H5Sclose(space_id); - (void)H5Fclose(file_id); + H5Dclose(dset_id); + H5Sclose(space_id); + H5Fclose(file_id); } H5E_END_TRY; } /* end if error */ return ret_value; @@ -2847,7 +2877,7 @@ splitter_compare_expected_data(hid_t file_id, done: if (ret_value < 0) { H5E_BEGIN_TRY { - (void)H5Dclose(dset_id); + H5Dclose(dset_id); } H5E_END_TRY; } return ret_value; @@ -2880,9 +2910,9 @@ done: static int splitter_tentative_open_test(hid_t child_fapl_id) { - const char filename_tmp[H5FD_SPLITTER_PATH_MAX + 1] = "splitter_tmp.h5"; - char filename_rw[H5FD_SPLITTER_PATH_MAX + 1]; - H5FD_splitter_vfd_config_t vfd_config; + const char *filename_tmp = "splitter_tmp.h5"; + char *filename_rw = NULL; + H5FD_splitter_vfd_config_t *vfd_config = NULL; hid_t fapl_id = H5I_INVALID_HID; hid_t file_id = H5I_INVALID_HID; int buf[SPLITTER_SIZE][SPLITTER_SIZE]; /* for comparison */ @@ -2892,6 +2922,11 @@ splitter_tentative_open_test(hid_t child_fapl_id) struct splitter_dataset_def data; /* for comparison */ int ret_value = 0; + if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) + SPLITTER_TEST_FAULT("memory allocation for vfd_config struct failed"); + if (NULL == (filename_rw = HDcalloc(H5FD_SPLITTER_PATH_MAX + 1, sizeof(char)))) + SPLITTER_TEST_FAULT("memory allocation for filename_rw string failed"); + /* pre-fill data buffer to write */ for (i=0; i < SPLITTER_SIZE; i++) { for (j=0; j < SPLITTER_SIZE; j++) { @@ -2906,13 +2941,13 @@ splitter_tentative_open_test(hid_t child_fapl_id) data.n_dims = 2; data.dset_name = SPLITTER_DATASET_NAME; - vfd_config.magic = H5FD_SPLITTER_MAGIC; - vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; - vfd_config.ignore_wo_errs = FALSE; - vfd_config.rw_fapl_id = child_fapl_id; - vfd_config.wo_fapl_id = child_fapl_id; + vfd_config->magic = H5FD_SPLITTER_MAGIC; + vfd_config->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION; + vfd_config->ignore_wo_errs = FALSE; + vfd_config->rw_fapl_id = child_fapl_id; + vfd_config->wo_fapl_id = child_fapl_id; - if (splitter_prepare_file_paths(&vfd_config, filename_rw) < 0) { + if (splitter_prepare_file_paths(vfd_config, filename_rw) < 0) { SPLITTER_TEST_FAULT("can't prepare splitter file paths\n"); } @@ -2920,7 +2955,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == H5I_INVALID_HID) { SPLITTER_TEST_FAULT("can't create FAPL ID\n"); } - if (H5Pset_fapl_splitter(fapl_id, &vfd_config) < 0) { + if (H5Pset_fapl_splitter(fapl_id, vfd_config) < 0) { SPLITTER_TEST_FAULT("can't set splitter FAPL\n"); } if (H5Pget_driver(fapl_id) != H5FD_SPLITTER) { @@ -2950,7 +2985,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (file_exists(filename_rw, child_fapl_id)) { SPLITTER_TEST_FAULT("R/W file unexpectedly created\n"); } - if (file_exists(vfd_config.wo_path, child_fapl_id)) { + if (file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("W/O file unexpectedly created\n"); } @@ -2960,7 +2995,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) * Should fail. */ - if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config.wo_path) < 0) { + if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config->wo_path) < 0) { SPLITTER_TEST_FAULT("Can't create W/O file copy.\n"); } H5E_BEGIN_TRY { @@ -2972,11 +3007,11 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (file_exists(filename_rw, child_fapl_id)) { SPLITTER_TEST_FAULT("R/W file unexpectedly created\n"); } - if (!file_exists(vfd_config.wo_path, child_fapl_id)) { + if (!file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n"); } - HDremove(vfd_config.wo_path); - if (file_exists(vfd_config.wo_path, child_fapl_id)) { + HDremove(vfd_config->wo_path); + if (file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("failed to remove W/O file\n"); } @@ -2998,7 +3033,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (!file_exists(filename_rw, child_fapl_id)) { SPLITTER_TEST_FAULT("R/W file mysteriously disappeared\n"); } - if (file_exists(vfd_config.wo_path, child_fapl_id)) { + if (file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("W/O file unexpectedly created\n"); } @@ -3007,7 +3042,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) * Both files present. */ - if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config.wo_path) < 0) { + if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config->wo_path) < 0) { SPLITTER_TEST_FAULT("Can't create W/O file copy.\n"); } file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id); @@ -3021,7 +3056,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (!file_exists(filename_rw, child_fapl_id)) { SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n"); } - if (!file_exists(vfd_config.wo_path, child_fapl_id)) { + if (!file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n"); } @@ -3041,14 +3076,14 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (!file_exists(filename_rw, child_fapl_id)) { SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n"); } - if (!file_exists(vfd_config.wo_path, child_fapl_id)) { + if (!file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n"); } - if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) { + if (h5_compare_file_bytes(filename_rw, vfd_config->wo_path) < 0) { SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n"); } HDremove(filename_rw); - HDremove(vfd_config.wo_path); + HDremove(vfd_config->wo_path); /* * H5Fcreate() with TRUNC access. @@ -3058,7 +3093,7 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (h5_duplicate_file_by_bytes(filename_tmp, filename_rw) < 0) { SPLITTER_TEST_FAULT("Can't create R/W file copy.\n"); } - if (file_exists(vfd_config.wo_path, child_fapl_id)) { + if (file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("failed to remove W/O file\n"); } file_id = H5Fcreate(filename_rw, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); @@ -3072,21 +3107,21 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (!file_exists(filename_rw, child_fapl_id)) { SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n"); } - if (!file_exists(vfd_config.wo_path, child_fapl_id)) { + if (!file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n"); } - if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) { + if (h5_compare_file_bytes(filename_rw, vfd_config->wo_path) < 0) { SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n"); } HDremove(filename_rw); - HDremove(vfd_config.wo_path); + HDremove(vfd_config->wo_path); /* * H5Fcreate() with TRUNC access. * Only W/O present. */ - if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config.wo_path) < 0) { + if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config->wo_path) < 0) { SPLITTER_TEST_FAULT("Can't create W/O file copy.\n"); } if (file_exists(filename_rw, child_fapl_id)) { @@ -3103,14 +3138,14 @@ splitter_tentative_open_test(hid_t child_fapl_id) if (!file_exists(filename_rw, child_fapl_id)) { SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n"); } - if (!file_exists(vfd_config.wo_path, child_fapl_id)) { + if (!file_exists(vfd_config->wo_path, child_fapl_id)) { SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n"); } - if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) { + if (h5_compare_file_bytes(filename_rw, vfd_config->wo_path) < 0) { SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n"); } HDremove(filename_rw); - HDremove(vfd_config.wo_path); + HDremove(vfd_config->wo_path); /* H5Fcreate with both files absent is tested elsewhere */ @@ -3125,10 +3160,14 @@ splitter_tentative_open_test(hid_t child_fapl_id) done: if (ret_value < 0) { H5E_BEGIN_TRY { - (void)H5Pclose(fapl_id); - (void)H5Fclose(file_id); + H5Pclose(fapl_id); + H5Fclose(file_id); } H5E_END_TRY; - } /* end if error */ + } + + HDfree(vfd_config); + HDfree(filename_rw); + return ret_value; } /* end splitter_tentative_open_test() */ @@ -3165,7 +3204,7 @@ file_exists(const char *filename, hid_t fapl_id) error: H5E_BEGIN_TRY { - (void)H5Fclose(file_id); + H5Fclose(file_id); } H5E_END_TRY; return ret_value; } /* end file_exists() */ @@ -3272,9 +3311,9 @@ test_splitter(void) return 0; error: - if (child_fapl_id != H5I_INVALID_HID) { - (void)H5Pclose(child_fapl_id); - } + if (child_fapl_id != H5I_INVALID_HID) + H5Pclose(child_fapl_id); + return -1; } /* end test_splitter() */ @@ -3317,7 +3356,7 @@ main(void) HDprintf("***** %d Virtual File Driver TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : ""); return EXIT_FAILURE; - } /* end if */ + } HDprintf("All Virtual File Driver tests passed.\n"); -- cgit v0.12 From e327843f7af9857bdd4b560cd47ca3afe52bb74c Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 5 Aug 2020 22:51:34 -0700 Subject: Adds -Wnull-dereference to the warnings we ignore in flex/bison generated code (that we have no control over). --- hl/src/H5LTanalyze.c | 1163 +++++++++++++++++++++++++----------------- hl/src/H5LTanalyze.l | 7 + hl/src/H5LTparse.c | 1368 ++++++++++++++++++++++---------------------------- hl/src/H5LTparse.h | 155 +++--- 4 files changed, 1392 insertions(+), 1301 deletions(-) diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index c05db67..e5f0bea 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -1,25 +1,25 @@ -#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" -#pragma GCC diagnostic ignored "-Wlarger-than=" -#pragma GCC diagnostic ignored "-Wmissing-prototypes" -#pragma GCC diagnostic ignored "-Wnested-externs" -#pragma GCC diagnostic ignored "-Wold-style-definition" -#pragma GCC diagnostic ignored "-Wredundant-decls" -#pragma GCC diagnostic ignored "-Wsign-compare" -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wstrict-overflow" -#pragma GCC diagnostic ignored "-Wstrict-prototypes" -#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" -#pragma GCC diagnostic ignored "-Wswitch-default" -#pragma GCC diagnostic ignored "-Wunused-function" -#pragma GCC diagnostic ignored "-Wunused-macros" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#elif defined __SUNPRO_CC -#pragma disable_warn -#elif defined _MSC_VER -#pragma warning(push, 1) -#endif +#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" +#pragma GCC diagnostic ignored "-Wlarger-than=" +#pragma GCC diagnostic ignored "-Wmissing-prototypes" +#pragma GCC diagnostic ignored "-Wnested-externs" +#pragma GCC diagnostic ignored "-Wold-style-definition" +#pragma GCC diagnostic ignored "-Wredundant-decls" +#pragma GCC diagnostic ignored "-Wsign-compare" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wstrict-overflow" +#pragma GCC diagnostic ignored "-Wstrict-prototypes" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +#pragma GCC diagnostic ignored "-Wswitch-default" +#pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#elif defined __SUNPRO_CC +#pragma disable_warn +#elif defined _MSC_VER +#pragma warning(push, 1) +#endif #line 2 "hl/src/H5LTanalyze.c" #line 4 "hl/src/H5LTanalyze.c" @@ -30,11 +30,17 @@ #define yy_create_buffer H5LTyy_create_buffer #define yy_delete_buffer H5LTyy_delete_buffer -#define yy_flex_debug H5LTyy_flex_debug +#define yy_scan_buffer H5LTyy_scan_buffer +#define yy_scan_string H5LTyy_scan_string +#define yy_scan_bytes H5LTyy_scan_bytes #define yy_init_buffer H5LTyy_init_buffer #define yy_flush_buffer H5LTyy_flush_buffer #define yy_load_buffer_state H5LTyy_load_buffer_state #define yy_switch_to_buffer H5LTyy_switch_to_buffer +#define yypush_buffer_state H5LTyypush_buffer_state +#define yypop_buffer_state H5LTyypop_buffer_state +#define yyensure_buffer_stack H5LTyyensure_buffer_stack +#define yy_flex_debug H5LTyy_flex_debug #define yyin H5LTyyin #define yyleng H5LTyyleng #define yylex H5LTyylex @@ -49,12 +55,246 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define H5LTyy_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer H5LTyy_create_buffer +#endif + +#ifdef yy_delete_buffer +#define H5LTyy_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer H5LTyy_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define H5LTyy_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer H5LTyy_scan_buffer +#endif + +#ifdef yy_scan_string +#define H5LTyy_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string H5LTyy_scan_string +#endif + +#ifdef yy_scan_bytes +#define H5LTyy_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes H5LTyy_scan_bytes +#endif + +#ifdef yy_init_buffer +#define H5LTyy_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer H5LTyy_init_buffer +#endif + +#ifdef yy_flush_buffer +#define H5LTyy_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer H5LTyy_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define H5LTyy_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state H5LTyy_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define H5LTyy_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer H5LTyy_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define H5LTyypush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state H5LTyypush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define H5LTyypop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state H5LTyypop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define H5LTyyensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack H5LTyyensure_buffer_stack +#endif + +#ifdef yylex +#define H5LTyylex_ALREADY_DEFINED +#else +#define yylex H5LTyylex +#endif + +#ifdef yyrestart +#define H5LTyyrestart_ALREADY_DEFINED +#else +#define yyrestart H5LTyyrestart +#endif + +#ifdef yylex_init +#define H5LTyylex_init_ALREADY_DEFINED +#else +#define yylex_init H5LTyylex_init +#endif + +#ifdef yylex_init_extra +#define H5LTyylex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra H5LTyylex_init_extra +#endif + +#ifdef yylex_destroy +#define H5LTyylex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy H5LTyylex_destroy +#endif + +#ifdef yyget_debug +#define H5LTyyget_debug_ALREADY_DEFINED +#else +#define yyget_debug H5LTyyget_debug +#endif + +#ifdef yyset_debug +#define H5LTyyset_debug_ALREADY_DEFINED +#else +#define yyset_debug H5LTyyset_debug +#endif + +#ifdef yyget_extra +#define H5LTyyget_extra_ALREADY_DEFINED +#else +#define yyget_extra H5LTyyget_extra +#endif + +#ifdef yyset_extra +#define H5LTyyset_extra_ALREADY_DEFINED +#else +#define yyset_extra H5LTyyset_extra +#endif + +#ifdef yyget_in +#define H5LTyyget_in_ALREADY_DEFINED +#else +#define yyget_in H5LTyyget_in +#endif + +#ifdef yyset_in +#define H5LTyyset_in_ALREADY_DEFINED +#else +#define yyset_in H5LTyyset_in +#endif + +#ifdef yyget_out +#define H5LTyyget_out_ALREADY_DEFINED +#else +#define yyget_out H5LTyyget_out +#endif + +#ifdef yyset_out +#define H5LTyyset_out_ALREADY_DEFINED +#else +#define yyset_out H5LTyyset_out +#endif + +#ifdef yyget_leng +#define H5LTyyget_leng_ALREADY_DEFINED +#else +#define yyget_leng H5LTyyget_leng +#endif + +#ifdef yyget_text +#define H5LTyyget_text_ALREADY_DEFINED +#else +#define yyget_text H5LTyyget_text +#endif + +#ifdef yyget_lineno +#define H5LTyyget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno H5LTyyget_lineno +#endif + +#ifdef yyset_lineno +#define H5LTyyset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno H5LTyyset_lineno +#endif + +#ifdef yywrap +#define H5LTyywrap_ALREADY_DEFINED +#else +#define yywrap H5LTyywrap +#endif + +#ifdef yyalloc +#define H5LTyyalloc_ALREADY_DEFINED +#else +#define yyalloc H5LTyyalloc +#endif + +#ifdef yyrealloc +#define H5LTyyrealloc_ALREADY_DEFINED +#else +#define yyrealloc H5LTyyrealloc +#endif + +#ifdef yyfree +#define H5LTyyfree_ALREADY_DEFINED +#else +#define yyfree H5LTyyfree +#endif + +#ifdef yytext +#define H5LTyytext_ALREADY_DEFINED +#else +#define yytext H5LTyytext +#endif + +#ifdef yyleng +#define H5LTyyleng_ALREADY_DEFINED +#else +#define yyleng H5LTyyleng +#endif + +#ifdef yyin +#define H5LTyyin_ALREADY_DEFINED +#else +#define yyin H5LTyyin +#endif + +#ifdef yyout +#define H5LTyyout_ALREADY_DEFINED +#else +#define yyout H5LTyyout +#endif + +#ifdef yy_flex_debug +#define H5LTyy_flex_debug_ALREADY_DEFINED +#else +#define yy_flex_debug H5LTyy_flex_debug +#endif + +#ifdef yylineno +#define H5LTyylineno_ALREADY_DEFINED +#else +#define yylineno H5LTyylineno +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -75,7 +315,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -92,7 +332,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -125,65 +365,61 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ +/* begin standard C++ headers. */ -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE H5LTyyrestart(H5LTyyin ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -200,30 +436,30 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif -extern yy_size_t H5LTyyleng; +extern int yyleng; -extern FILE *H5LTyyin, *H5LTyyout; +extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) - + #define YY_LINENO_REWIND_TO(ptr) + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ - /* Undo effects of setting up H5LTyytext. */ \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up H5LTyytext again */ \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -238,12 +474,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -283,8 +519,8 @@ struct yy_buffer_state * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via H5LTyyrestart()), so that the user can continue scanning by - * just pointing H5LTyyin at a new input file. + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 @@ -294,7 +530,7 @@ struct yy_buffer_state /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -305,103 +541,98 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] -/* yy_hold_char holds the character lost when H5LTyytext is formed. */ +/* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t H5LTyyleng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ -/* Flag which is used to allow H5LTyywrap()'s to do buffer switches - * instead of setting up a fresh H5LTyyin. A bit of a hack ... +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; -void H5LTyyrestart (FILE *input_file ); -void H5LTyy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE H5LTyy_create_buffer (FILE *file,int size ); -void H5LTyy_delete_buffer (YY_BUFFER_STATE b ); -void H5LTyy_flush_buffer (YY_BUFFER_STATE b ); -void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void H5LTyypop_buffer_state (void ); +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); -static void H5LTyyensure_buffer_stack (void ); -static void H5LTyy_load_buffer_state (void ); -static void H5LTyy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) -#define YY_FLUSH_BUFFER H5LTyy_flush_buffer(YY_CURRENT_BUFFER ) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); -YY_BUFFER_STATE H5LTyy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE H5LTyy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char *bytes,yy_size_t len ); - -void *H5LTyyalloc (yy_size_t ); -void *H5LTyyrealloc (void *,yy_size_t ); -void H5LTyyfree (void * ); - -#define yy_new_buffer H5LTyy_create_buffer +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); +#define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ - H5LTyyensure_buffer_stack (); \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ - H5LTyyensure_buffer_stack (); \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ +typedef flex_uint8_t YY_CHAR; -typedef unsigned char YY_CHAR; - -FILE *H5LTyyin = (FILE *) 0, *H5LTyyout = (FILE *) 0; +FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; -extern int H5LTyylineno; +extern int yylineno; +int yylineno = 1; -int H5LTyylineno = 1; - -extern char *H5LTyytext; -#define yytext_ptr H5LTyytext +extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif +#define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the - * corresponding action - sets up H5LTyytext. + * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - H5LTyyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - #define YY_NUM_RULES 66 #define YY_END_OF_BUFFER 67 /* This struct is not used in this scanner, @@ -411,7 +642,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_acclist[437] = +static const flex_int16_t yy_acclist[437] = { 0, 64, 64, 64, 64, 67, 66, 64, 66, 64, 65, 66, 56, 66, 55, 66, 62, 66, 63, 66, 66, @@ -463,7 +694,7 @@ static yyconst flex_int16_t yy_acclist[437] = 57, 21, 57, 34, 34, 57 } ; -static yyconst flex_int16_t yy_accept[546] = +static const flex_int16_t yy_accept[546] = { 0, 1, 2, 3, 4, 5, 6, 7, 9, 12, 14, 16, 18, 20, 21, 22, 23, 24, 26, 28, 30, @@ -527,7 +758,7 @@ static yyconst flex_int16_t yy_accept[546] = 432, 434, 435, 437, 437 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -559,7 +790,7 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[42] = +static const YY_CHAR yy_meta[42] = { 0, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, @@ -568,7 +799,7 @@ static yyconst flex_int32_t yy_meta[42] = 1 } ; -static yyconst flex_int16_t yy_base[547] = +static const flex_int16_t yy_base[547] = { 0, 0, 0, 41, 0, 610, 611, 81, 83, 611, 0, 611, 611, 56, 599, 580, 575, 611, 611, 611, 611, @@ -632,7 +863,7 @@ static yyconst flex_int16_t yy_base[547] = 0, 611, 0, 611, 106, 275 } ; -static yyconst flex_int16_t yy_def[547] = +static const flex_int16_t yy_def[547] = { 0, 544, 1, 544, 3, 544, 544, 544, 544, 544, 545, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, @@ -696,7 +927,7 @@ static yyconst flex_int16_t yy_def[547] = 546, 544, 546, 0, 544, 544 } ; -static yyconst flex_int16_t yy_nxt[653] = +static const flex_int16_t yy_nxt[653] = { 0, 6, 7, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 12, 6, 6, 13, 6, 6, 6, @@ -772,7 +1003,7 @@ static yyconst flex_int16_t yy_nxt[653] = 544, 544 } ; -static yyconst flex_int16_t yy_chk[653] = +static const flex_int16_t yy_chk[653] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -848,15 +1079,15 @@ static yyconst flex_int16_t yy_chk[653] = 544, 544 } ; -extern int H5LTyy_flex_debug; -int H5LTyy_flex_debug = 0; +extern int yy_flex_debug; +int yy_flex_debug = 0; static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; static char *yy_full_match; static int yy_lp; #define REJECT \ { \ -*yy_cp = (yy_hold_char); /* undo effects of setting up H5LTyytext */ \ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \ yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ ++(yy_lp); \ goto find_rule; \ @@ -865,7 +1096,7 @@ goto find_rule; \ #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -char *H5LTyytext; +char *yytext; #line 1 "hl/src/H5LTanalyze.l" /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * @@ -893,6 +1124,13 @@ char *H5LTyytext; /* Turn off suggest const & malloc attribute warnings in gcc */ #if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#endif + +/* Turn off null dereference warnings in gcc. + * We have no control over this generated code. + */ +#if defined __GNUC__ && 600 <= __GNUC__ * 100 +#pragma GCC diagnostic ignored "-Wnull-dereference" #endif int my_yyinput(char *, int); @@ -942,8 +1180,9 @@ extern hbool_t is_opq_tag; hbool_t first_quote = 1; +#line 1162 "hl/src/H5LTanalyze.c" -#line 925 "hl/src/H5LTanalyze.c" +#line 1164 "hl/src/H5LTanalyze.c" #define INITIAL 0 #define TAG_STRING 1 @@ -952,36 +1191,36 @@ hbool_t first_quote = 1; #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int H5LTyylex_destroy (void ); +int yylex_destroy ( void ); -int H5LTyyget_debug (void ); +int yyget_debug ( void ); -void H5LTyyset_debug (int debug_flag ); +void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE H5LTyyget_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -void H5LTyyset_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *H5LTyyget_in (void ); +FILE *yyget_in ( void ); -void H5LTyyset_in (FILE * in_str ); +void yyset_in ( FILE * _in_str ); -FILE *H5LTyyget_out (void ); +FILE *yyget_out ( void ); -void H5LTyyset_out (FILE * out_str ); +void yyset_out ( FILE * _out_str ); -yy_size_t H5LTyyget_leng (void ); + int yyget_leng ( void ); -char *H5LTyyget_text (void ); +char *yyget_text ( void ); -int H5LTyyget_lineno (void ); +int yyget_lineno ( void ); -void H5LTyyset_lineno (int line_number ); +void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -989,35 +1228,43 @@ void H5LTyyset_lineno (int line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int H5LTyywrap (void ); +extern "C" int yywrap ( void ); #else -extern int H5LTyywrap (void ); +extern int yywrap ( void ); #endif #endif - static void yyunput (int c,char *buf_ptr ); +#ifndef YY_NO_UNPUT + + static void yyunput ( int c, char *buf_ptr ); + +#endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1025,7 +1272,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( H5LTyytext, H5LTyyleng, 1, H5LTyyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1036,20 +1283,20 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ - (c = getc( H5LTyyin )) != EOF && c != '\n'; ++n ) \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ - if ( c == EOF && ferror( H5LTyyin ) ) \ + if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, H5LTyyin))==0 && ferror(H5LTyyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -1057,7 +1304,7 @@ static int input (void ); break; \ } \ errno=0; \ - clearerr(H5LTyyin); \ + clearerr(yyin); \ } \ }\ \ @@ -1090,12 +1337,12 @@ static int input (void ); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int H5LTyylex (void); +extern int yylex (void); -#define YY_DECL int H5LTyylex (void) +#define YY_DECL int yylex (void) #endif /* !YY_DECL */ -/* Code executed at the beginning of each rule, after H5LTyytext and H5LTyyleng +/* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION @@ -1104,7 +1351,7 @@ extern int H5LTyylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -1114,15 +1361,10 @@ extern int H5LTyylex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 82 "hl/src/H5LTanalyze.l" - - -#line 1103 "hl/src/H5LTanalyze.c" - + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + if ( !(yy_init) ) { (yy_init) = 1; @@ -1133,33 +1375,39 @@ YY_DECL /* Create the reject buffer large enough to save one state per allowed character. */ if ( ! (yy_state_buf) ) - (yy_state_buf) = (yy_state_type *)H5LTyyalloc(YY_STATE_BUF_SIZE ); + (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE ); if ( ! (yy_state_buf) ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyylex()" ); + YY_FATAL_ERROR( "out of dynamic memory in yylex()" ); if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ - if ( ! H5LTyyin ) - H5LTyyin = stdin; + if ( ! yyin ) + yyin = stdin; - if ( ! H5LTyyout ) - H5LTyyout = stdout; + if ( ! yyout ) + yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { - H5LTyyensure_buffer_stack (); + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 89 "hl/src/H5LTanalyze.l" + + +#line 1383 "hl/src/H5LTanalyze.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); - /* Support of H5LTyytext. */ + /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of @@ -1175,14 +1423,14 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 545 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } @@ -1191,7 +1439,9 @@ yy_match: yy_find_action: yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; + find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ { if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) @@ -1215,293 +1465,293 @@ do_action: /* This label is used only to access EOF actions. */ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 84 "hl/src/H5LTanalyze.l" +#line 91 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I8BE_TOKEN);} YY_BREAK case 2: YY_RULE_SETUP -#line 85 "hl/src/H5LTanalyze.l" +#line 92 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I8LE_TOKEN);} YY_BREAK case 3: YY_RULE_SETUP -#line 86 "hl/src/H5LTanalyze.l" +#line 93 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I16BE_TOKEN);} YY_BREAK case 4: YY_RULE_SETUP -#line 87 "hl/src/H5LTanalyze.l" +#line 94 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I16LE_TOKEN);} YY_BREAK case 5: YY_RULE_SETUP -#line 88 "hl/src/H5LTanalyze.l" +#line 95 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I32BE_TOKEN);} YY_BREAK case 6: YY_RULE_SETUP -#line 89 "hl/src/H5LTanalyze.l" +#line 96 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I32LE_TOKEN);} YY_BREAK case 7: YY_RULE_SETUP -#line 90 "hl/src/H5LTanalyze.l" +#line 97 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I64BE_TOKEN);} YY_BREAK case 8: YY_RULE_SETUP -#line 91 "hl/src/H5LTanalyze.l" +#line 98 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I64LE_TOKEN);} YY_BREAK case 9: YY_RULE_SETUP -#line 93 "hl/src/H5LTanalyze.l" +#line 100 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U8BE_TOKEN);} YY_BREAK case 10: YY_RULE_SETUP -#line 94 "hl/src/H5LTanalyze.l" +#line 101 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U8LE_TOKEN);} YY_BREAK case 11: YY_RULE_SETUP -#line 95 "hl/src/H5LTanalyze.l" +#line 102 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U16BE_TOKEN);} YY_BREAK case 12: YY_RULE_SETUP -#line 96 "hl/src/H5LTanalyze.l" +#line 103 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U16LE_TOKEN);} YY_BREAK case 13: YY_RULE_SETUP -#line 97 "hl/src/H5LTanalyze.l" +#line 104 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U32BE_TOKEN);} YY_BREAK case 14: YY_RULE_SETUP -#line 98 "hl/src/H5LTanalyze.l" +#line 105 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U32LE_TOKEN);} YY_BREAK case 15: YY_RULE_SETUP -#line 99 "hl/src/H5LTanalyze.l" +#line 106 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U64BE_TOKEN);} YY_BREAK case 16: YY_RULE_SETUP -#line 100 "hl/src/H5LTanalyze.l" +#line 107 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U64LE_TOKEN);} YY_BREAK case 17: YY_RULE_SETUP -#line 102 "hl/src/H5LTanalyze.l" +#line 109 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_CHAR_TOKEN);} YY_BREAK case 18: YY_RULE_SETUP -#line 103 "hl/src/H5LTanalyze.l" +#line 110 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_SCHAR_TOKEN);} YY_BREAK case 19: YY_RULE_SETUP -#line 104 "hl/src/H5LTanalyze.l" +#line 111 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_UCHAR_TOKEN);} YY_BREAK case 20: YY_RULE_SETUP -#line 105 "hl/src/H5LTanalyze.l" +#line 112 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_SHORT_TOKEN);} YY_BREAK case 21: YY_RULE_SETUP -#line 106 "hl/src/H5LTanalyze.l" +#line 113 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_USHORT_TOKEN);} YY_BREAK case 22: YY_RULE_SETUP -#line 107 "hl/src/H5LTanalyze.l" +#line 114 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_INT_TOKEN);} YY_BREAK case 23: YY_RULE_SETUP -#line 108 "hl/src/H5LTanalyze.l" +#line 115 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_UINT_TOKEN);} YY_BREAK case 24: YY_RULE_SETUP -#line 109 "hl/src/H5LTanalyze.l" +#line 116 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_LONG_TOKEN);} YY_BREAK case 25: YY_RULE_SETUP -#line 110 "hl/src/H5LTanalyze.l" +#line 117 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_ULONG_TOKEN);} YY_BREAK case 26: YY_RULE_SETUP -#line 111 "hl/src/H5LTanalyze.l" +#line 118 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_LLONG_TOKEN);} YY_BREAK case 27: YY_RULE_SETUP -#line 112 "hl/src/H5LTanalyze.l" +#line 119 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_ULLONG_TOKEN);} YY_BREAK case 28: YY_RULE_SETUP -#line 114 "hl/src/H5LTanalyze.l" +#line 121 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F32BE_TOKEN);} YY_BREAK case 29: YY_RULE_SETUP -#line 115 "hl/src/H5LTanalyze.l" +#line 122 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F32LE_TOKEN);} YY_BREAK case 30: YY_RULE_SETUP -#line 116 "hl/src/H5LTanalyze.l" +#line 123 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F64BE_TOKEN);} YY_BREAK case 31: YY_RULE_SETUP -#line 117 "hl/src/H5LTanalyze.l" +#line 124 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F64LE_TOKEN);} YY_BREAK case 32: YY_RULE_SETUP -#line 118 "hl/src/H5LTanalyze.l" +#line 125 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_FLOAT_TOKEN);} YY_BREAK case 33: YY_RULE_SETUP -#line 119 "hl/src/H5LTanalyze.l" +#line 126 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_DOUBLE_TOKEN);} YY_BREAK case 34: YY_RULE_SETUP -#line 120 "hl/src/H5LTanalyze.l" +#line 127 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_LDOUBLE_TOKEN);} YY_BREAK case 35: YY_RULE_SETUP -#line 122 "hl/src/H5LTanalyze.l" +#line 129 "hl/src/H5LTanalyze.l" {return token(H5T_STRING_TOKEN);} YY_BREAK case 36: YY_RULE_SETUP -#line 123 "hl/src/H5LTanalyze.l" +#line 130 "hl/src/H5LTanalyze.l" {return token(STRSIZE_TOKEN);} YY_BREAK case 37: YY_RULE_SETUP -#line 124 "hl/src/H5LTanalyze.l" +#line 131 "hl/src/H5LTanalyze.l" {return token(STRPAD_TOKEN);} YY_BREAK case 38: YY_RULE_SETUP -#line 125 "hl/src/H5LTanalyze.l" +#line 132 "hl/src/H5LTanalyze.l" {return token(CSET_TOKEN);} YY_BREAK case 39: YY_RULE_SETUP -#line 126 "hl/src/H5LTanalyze.l" +#line 133 "hl/src/H5LTanalyze.l" {return token(CTYPE_TOKEN);} YY_BREAK case 40: YY_RULE_SETUP -#line 127 "hl/src/H5LTanalyze.l" -{return token(H5T_STR_NULLTERM_TOKEN);} +#line 134 "hl/src/H5LTanalyze.l" +{return token(H5T_STR_NULLTERM_TOKEN);} YY_BREAK case 41: YY_RULE_SETUP -#line 128 "hl/src/H5LTanalyze.l" -{return token(H5T_STR_NULLPAD_TOKEN);} +#line 135 "hl/src/H5LTanalyze.l" +{return token(H5T_STR_NULLPAD_TOKEN);} YY_BREAK case 42: YY_RULE_SETUP -#line 129 "hl/src/H5LTanalyze.l" -{return token(H5T_STR_SPACEPAD_TOKEN);} +#line 136 "hl/src/H5LTanalyze.l" +{return token(H5T_STR_SPACEPAD_TOKEN);} YY_BREAK case 43: YY_RULE_SETUP -#line 130 "hl/src/H5LTanalyze.l" +#line 137 "hl/src/H5LTanalyze.l" {return token(H5T_CSET_ASCII_TOKEN);} YY_BREAK case 44: YY_RULE_SETUP -#line 131 "hl/src/H5LTanalyze.l" +#line 138 "hl/src/H5LTanalyze.l" {return token(H5T_CSET_UTF8_TOKEN);} YY_BREAK case 45: YY_RULE_SETUP -#line 132 "hl/src/H5LTanalyze.l" +#line 139 "hl/src/H5LTanalyze.l" {return token(H5T_C_S1_TOKEN);} YY_BREAK case 46: YY_RULE_SETUP -#line 133 "hl/src/H5LTanalyze.l" +#line 140 "hl/src/H5LTanalyze.l" {return token(H5T_FORTRAN_S1_TOKEN);} YY_BREAK case 47: YY_RULE_SETUP -#line 134 "hl/src/H5LTanalyze.l" +#line 141 "hl/src/H5LTanalyze.l" {return token(H5T_VARIABLE_TOKEN);} YY_BREAK case 48: YY_RULE_SETUP -#line 136 "hl/src/H5LTanalyze.l" +#line 143 "hl/src/H5LTanalyze.l" {return token(H5T_COMPOUND_TOKEN);} YY_BREAK case 49: YY_RULE_SETUP -#line 137 "hl/src/H5LTanalyze.l" +#line 144 "hl/src/H5LTanalyze.l" {return token(H5T_ENUM_TOKEN);} YY_BREAK case 50: YY_RULE_SETUP -#line 138 "hl/src/H5LTanalyze.l" +#line 145 "hl/src/H5LTanalyze.l" {return token(H5T_ARRAY_TOKEN);} YY_BREAK case 51: YY_RULE_SETUP -#line 139 "hl/src/H5LTanalyze.l" +#line 146 "hl/src/H5LTanalyze.l" {return token(H5T_VLEN_TOKEN);} YY_BREAK case 52: YY_RULE_SETUP -#line 141 "hl/src/H5LTanalyze.l" +#line 148 "hl/src/H5LTanalyze.l" {return token(H5T_OPAQUE_TOKEN);} YY_BREAK case 53: YY_RULE_SETUP -#line 142 "hl/src/H5LTanalyze.l" +#line 149 "hl/src/H5LTanalyze.l" {return token(OPQ_SIZE_TOKEN);} YY_BREAK case 54: YY_RULE_SETUP -#line 143 "hl/src/H5LTanalyze.l" +#line 150 "hl/src/H5LTanalyze.l" {return token(OPQ_TAG_TOKEN);} YY_BREAK case 55: YY_RULE_SETUP -#line 145 "hl/src/H5LTanalyze.l" -{ - if( is_str_size || (is_enum && is_enum_memb) || +#line 152 "hl/src/H5LTanalyze.l" +{ + if( is_str_size || (is_enum && is_enum_memb) || is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) || (csindex>-1 && cmpd_stack[csindex].is_field) ) { - H5LTyylval.ival = atoi(H5LTyytext); - return NUMBER; + H5LTyylval.ival = atoi(yytext); + return NUMBER; } else REJECT; } YY_BREAK case 56: YY_RULE_SETUP -#line 155 "hl/src/H5LTanalyze.l" +#line 162 "hl/src/H5LTanalyze.l" { /*if it's first quote, and is a compound field name or an enum symbol*/ - if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) + if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) && first_quote) { first_quote = 0; BEGIN TAG_STRING; @@ -1513,12 +1763,12 @@ YY_RULE_SETUP case 57: /* rule 57 can match eol */ YY_RULE_SETUP -#line 165 "hl/src/H5LTanalyze.l" +#line 172 "hl/src/H5LTanalyze.l" { #ifdef H5_HAVE_WIN32_API - H5LTyylval.sval = _strdup(H5LTyytext); + H5LTyylval.sval = _strdup(yytext); #else /* H5_HAVE_WIN32_API */ - H5LTyylval.sval = strdup(H5LTyytext); + H5LTyylval.sval = strdup(yytext); #endif /* H5_HAVE_WIN32_API */ BEGIN INITIAL; return STRING; @@ -1526,52 +1776,52 @@ YY_RULE_SETUP YY_BREAK case 58: YY_RULE_SETUP -#line 175 "hl/src/H5LTanalyze.l" +#line 182 "hl/src/H5LTanalyze.l" {return token('{');} YY_BREAK case 59: YY_RULE_SETUP -#line 176 "hl/src/H5LTanalyze.l" +#line 183 "hl/src/H5LTanalyze.l" {return token('}');} YY_BREAK case 60: YY_RULE_SETUP -#line 177 "hl/src/H5LTanalyze.l" +#line 184 "hl/src/H5LTanalyze.l" {return token('[');} YY_BREAK case 61: YY_RULE_SETUP -#line 178 "hl/src/H5LTanalyze.l" +#line 185 "hl/src/H5LTanalyze.l" {return token(']');} YY_BREAK case 62: YY_RULE_SETUP -#line 179 "hl/src/H5LTanalyze.l" +#line 186 "hl/src/H5LTanalyze.l" {return token(':');} YY_BREAK case 63: YY_RULE_SETUP -#line 180 "hl/src/H5LTanalyze.l" +#line 187 "hl/src/H5LTanalyze.l" {return token(';');} YY_BREAK case 64: /* rule 64 can match eol */ YY_RULE_SETUP -#line 181 "hl/src/H5LTanalyze.l" +#line 188 "hl/src/H5LTanalyze.l" ; YY_BREAK case 65: /* rule 65 can match eol */ YY_RULE_SETUP -#line 182 "hl/src/H5LTanalyze.l" +#line 189 "hl/src/H5LTanalyze.l" { return 0; } YY_BREAK case 66: YY_RULE_SETUP -#line 184 "hl/src/H5LTanalyze.l" +#line 191 "hl/src/H5LTanalyze.l" ECHO; YY_BREAK -#line 1553 "hl/src/H5LTanalyze.c" +#line 1803 "hl/src/H5LTanalyze.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(TAG_STRING): yyterminate(); @@ -1589,15 +1839,15 @@ ECHO; { /* We're scanning a new file or input source. It's * possible that this happened because the user - * just pointed H5LTyyin at a new source and called - * H5LTyylex(). If so, then we have to assure + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = H5LTyyin; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } @@ -1650,11 +1900,11 @@ ECHO; { (yy_did_buffer_switch_on_eof) = 0; - if ( H5LTyywrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up - * H5LTyytext, we can now set up + * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the @@ -1703,7 +1953,8 @@ ECHO; "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -} /* end of H5LTyylex */ + } /* end of user's declarations */ +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -1714,9 +1965,9 @@ ECHO; */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1745,7 +1996,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1758,7 +2009,7 @@ static int yy_get_next_buffer (void) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1784,7 +2035,7 @@ static int yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - H5LTyyrestart(H5LTyyin ); + yyrestart( yyin ); } else @@ -1798,12 +2049,15 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) H5LTyyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -1819,9 +2073,9 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; - + yy_state_type yy_current_state; + char *yy_cp; + yy_current_state = (yy_start); (yy_state_ptr) = (yy_state_buf); @@ -1829,14 +2083,14 @@ static int yy_get_next_buffer (void) for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 545 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; *(yy_state_ptr)++ = yy_current_state; } @@ -1850,16 +2104,16 @@ static int yy_get_next_buffer (void) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - - register YY_CHAR yy_c = 1; + int yy_is_jam; + + YY_CHAR yy_c = 1; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 545 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 544); if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; @@ -1867,22 +2121,24 @@ static int yy_get_next_buffer (void) return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) -{ - register char *yy_cp; +#ifndef YY_NO_UNPUT + static void yyunput (int c, char * yy_bp ) +{ + char *yy_cp; + yy_cp = (yy_c_buf_p); - /* undo effects of setting up H5LTyytext */ + /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + int number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1891,7 +2147,7 @@ static int yy_get_next_buffer (void) yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -1904,6 +2160,8 @@ static int yy_get_next_buffer (void) (yy_c_buf_p) = yy_cp; } +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1913,7 +2171,7 @@ static int yy_get_next_buffer (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) @@ -1928,7 +2186,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1945,14 +2203,14 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - H5LTyyrestart(H5LTyyin ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( H5LTyywrap( ) ) - return EOF; + if ( yywrap( ) ) + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1971,7 +2229,7 @@ static int yy_get_next_buffer (void) } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve H5LTyytext */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); return c; @@ -1980,35 +2238,35 @@ static int yy_get_next_buffer (void) /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ - void H5LTyyrestart (FILE * input_file ) + void yyrestart (FILE * input_file ) { - + if ( ! YY_CURRENT_BUFFER ){ - H5LTyyensure_buffer_stack (); + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - H5LTyy_init_buffer(YY_CURRENT_BUFFER,input_file ); - H5LTyy_load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ - void H5LTyy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - + /* TODO. We should be able to replace this entire function body * with - * H5LTyypop_buffer_state(); - * H5LTyypush_buffer_state(new_buffer); + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); */ - H5LTyyensure_buffer_stack (); + yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -2021,61 +2279,61 @@ static int yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during - * EOF (H5LTyywrap()) processing, but the only time this flag - * is looked at is after H5LTyywrap() is called, so it's safe + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } -static void H5LTyy_load_buffer_state (void) +static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - H5LTyyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ - YY_BUFFER_STATE H5LTyy_create_buffer (FILE * file, int size ) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) H5LTyyalloc(sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) H5LTyyalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - H5LTyy_init_buffer(b,file ); + yy_init_buffer( b, file ); return b; } /** Destroy the buffer. - * @param b a buffer created with H5LTyy_create_buffer() - * + * @param b a buffer created with yy_create_buffer() + * */ - void H5LTyy_delete_buffer (YY_BUFFER_STATE b ) + void yy_delete_buffer (YY_BUFFER_STATE b ) { - + if ( ! b ) return; @@ -2083,27 +2341,27 @@ static void H5LTyy_load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - H5LTyyfree((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - H5LTyyfree((void *) b ); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, - * such as during a H5LTyyrestart() or at EOF. + * such as during a yyrestart() or at EOF. */ - static void H5LTyy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; - - H5LTyy_flush_buffer(b ); + + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then H5LTyy_init_buffer was _probably_ - * called from H5LTyyrestart() or through yy_get_next_buffer. + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ @@ -2112,15 +2370,15 @@ static void H5LTyy_load_buffer_state (void) } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ - void H5LTyy_flush_buffer (YY_BUFFER_STATE b ) + void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; @@ -2140,23 +2398,23 @@ static void H5LTyy_load_buffer_state (void) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ -void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer ) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; - H5LTyyensure_buffer_stack(); + yyensure_buffer_stack(); - /* This block is copied from H5LTyy_switch_to_buffer. */ + /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ @@ -2170,27 +2428,27 @@ void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer ) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; - /* copied from H5LTyy_switch_to_buffer. */ - H5LTyy_load_buffer_state( ); + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ -void H5LTyypop_buffer_state (void) +void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; - H5LTyy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -2198,22 +2456,22 @@ void H5LTyypop_buffer_state (void) /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void H5LTyyensure_buffer_stack (void) +static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; - + if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)H5LTyyalloc + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyyensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); @@ -2225,15 +2483,15 @@ static void H5LTyyensure_buffer_stack (void) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)H5LTyyrealloc + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyyensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -2244,80 +2502,80 @@ static void H5LTyyensure_buffer_stack (void) /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * + * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE H5LTyy_scan_buffer (char * base, yy_size_t size ) +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) H5LTyyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_scan_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - H5LTyy_switch_to_buffer(b ); + yy_switch_to_buffer( b ); return b; } -/** Setup the input buffer state to scan a string. The next call to H5LTyylex() will +/** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use - * H5LTyy_scan_bytes() instead. + * yy_scan_bytes() instead. */ -YY_BUFFER_STATE H5LTyy_scan_string (yyconst char * yystr ) +YY_BUFFER_STATE yy_scan_string (const char * yystr ) { - - return H5LTyy_scan_bytes(yystr,strlen(yystr) ); + + return yy_scan_bytes( yystr, (int) strlen(yystr) ); } -/** Setup the input buffer state to scan the given bytes. The next call to H5LTyylex() will +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * + * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) H5LTyyalloc(n ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_scan_bytes()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = H5LTyy_scan_buffer(buf,n ); + b = yy_scan_buffer( buf, n ); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in H5LTyy_scan_bytes()" ); + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -2331,9 +2589,9 @@ YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_ #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (const char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -2343,107 +2601,107 @@ static void yy_fatal_error (yyconst char* msg ) #define yyless(n) \ do \ { \ - /* Undo effects of setting up H5LTyytext. */ \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - H5LTyytext[H5LTyyleng] = (yy_hold_char); \ - (yy_c_buf_p) = H5LTyytext + yyless_macro_arg; \ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ - H5LTyyleng = yyless_macro_arg; \ + yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ -int H5LTyyget_lineno (void) +int yyget_lineno (void) { - - return H5LTyylineno; + + return yylineno; } /** Get the input stream. - * + * */ -FILE *H5LTyyget_in (void) +FILE *yyget_in (void) { - return H5LTyyin; + return yyin; } /** Get the output stream. - * + * */ -FILE *H5LTyyget_out (void) +FILE *yyget_out (void) { - return H5LTyyout; + return yyout; } /** Get the length of the current token. - * + * */ -yy_size_t H5LTyyget_leng (void) +int yyget_leng (void) { - return H5LTyyleng; + return yyleng; } /** Get the current token. - * + * */ -char *H5LTyyget_text (void) +char *yyget_text (void) { - return H5LTyytext; + return yytext; } /** Set the current line number. - * @param line_number - * + * @param _line_number line number + * */ -void H5LTyyset_lineno (int line_number ) +void yyset_lineno (int _line_number ) { - - H5LTyylineno = line_number; + + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. - * - * @see H5LTyy_switch_to_buffer + * @param _in_str A readable stream. + * + * @see yy_switch_to_buffer */ -void H5LTyyset_in (FILE * in_str ) +void yyset_in (FILE * _in_str ) { - H5LTyyin = in_str ; + yyin = _in_str ; } -void H5LTyyset_out (FILE * out_str ) +void yyset_out (FILE * _out_str ) { - H5LTyyout = out_str ; + yyout = _out_str ; } -int H5LTyyget_debug (void) +int yyget_debug (void) { - return H5LTyy_flex_debug; + return yy_flex_debug; } -void H5LTyyset_debug (int bdebug ) +void yyset_debug (int _bdebug ) { - H5LTyy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. - * This function is called from H5LTyylex_destroy(), so don't allocate here. + * This function is called from yylex_destroy(), so don't allocate here. */ - (yy_buffer_stack) = 0; + (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; + (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; @@ -2454,39 +2712,39 @@ static int yy_init_globals (void) /* Defined in main.c */ #ifdef YY_STDINIT - H5LTyyin = stdin; - H5LTyyout = stdout; + yyin = stdin; + yyout = stdout; #else - H5LTyyin = (FILE *) 0; - H5LTyyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by - * H5LTyylex_init() + * yylex_init() */ return 0; } -/* H5LTyylex_destroy is for both reentrant and non-reentrant scanners. */ -int H5LTyylex_destroy (void) +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - H5LTyy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; - H5LTyypop_buffer_state(); + yypop_buffer_state(); } /* Destroy the stack itself. */ - H5LTyyfree((yy_buffer_stack) ); + yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; - H5LTyyfree ( (yy_state_buf) ); + yyfree ( (yy_state_buf) ); (yy_state_buf) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time - * H5LTyylex() is called, initialization will occur. */ + * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; @@ -2497,18 +2755,19 @@ int H5LTyylex_destroy (void) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy (char* s1, const char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (const char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -2516,13 +2775,14 @@ static int yy_flex_strlen (yyconst char * s ) } #endif -void *H5LTyyalloc (yy_size_t size ) +void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } -void *H5LTyyrealloc (void * ptr, yy_size_t size ) +void *yyrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2530,35 +2790,34 @@ void *H5LTyyrealloc (void * ptr, yy_size_t size ) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } -void H5LTyyfree (void * ptr ) +void yyfree (void * ptr ) { - free( (char *) ptr ); /* see H5LTyyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 184 "hl/src/H5LTanalyze.l" - +#line 191 "hl/src/H5LTanalyze.l" int my_yyinput(char *buf, int max_size) { int ret; - - memcpy(buf, myinput, input_len); + + memcpy(buf, myinput, input_len); ret = (int)input_len; return ret; } int H5LTyyerror(const char *msg) { - printf("ERROR: %s before \"%s\".\n", msg, H5LTyytext); + printf("ERROR: %s before \"%s\".\n", msg, yytext); return 0; } -int H5LTyywrap() +int yywrap() { return(1); } diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index 5015053..cdd5b0d 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -28,6 +28,13 @@ #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" #endif +/* Turn off null dereference warnings in gcc. + * We have no control over this generated code. + */ +#if defined __GNUC__ && 600 <= __GNUC__ * 100 +#pragma GCC diagnostic ignored "-Wnull-dereference" +#endif + int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index d8661a7..a9b3dc3 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1,30 +1,30 @@ -#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" -#pragma GCC diagnostic ignored "-Wlarger-than=" -#pragma GCC diagnostic ignored "-Wmissing-prototypes" -#pragma GCC diagnostic ignored "-Wnested-externs" -#pragma GCC diagnostic ignored "-Wold-style-definition" -#pragma GCC diagnostic ignored "-Wredundant-decls" -#pragma GCC diagnostic ignored "-Wsign-compare" -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wstrict-overflow" -#pragma GCC diagnostic ignored "-Wstrict-prototypes" -#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" -#pragma GCC diagnostic ignored "-Wswitch-default" -#pragma GCC diagnostic ignored "-Wunused-function" -#pragma GCC diagnostic ignored "-Wunused-macros" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#elif defined __SUNPRO_CC -#pragma disable_warn -#elif defined _MSC_VER -#pragma warning(push, 1) -#endif -/* A Bison parser, made by GNU Bison 2.7. */ +#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" +#pragma GCC diagnostic ignored "-Wlarger-than=" +#pragma GCC diagnostic ignored "-Wmissing-prototypes" +#pragma GCC diagnostic ignored "-Wnested-externs" +#pragma GCC diagnostic ignored "-Wold-style-definition" +#pragma GCC diagnostic ignored "-Wredundant-decls" +#pragma GCC diagnostic ignored "-Wsign-compare" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wstrict-overflow" +#pragma GCC diagnostic ignored "-Wstrict-prototypes" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +#pragma GCC diagnostic ignored "-Wswitch-default" +#pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#elif defined __SUNPRO_CC +#pragma disable_warn +#elif defined _MSC_VER +#pragma warning(push, 1) +#endif +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -66,7 +66,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7" +#define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -85,14 +85,14 @@ #define yyparse H5LTyyparse #define yylex H5LTyylex #define yyerror H5LTyyerror -#define yylval H5LTyylval -#define yychar H5LTyychar #define yydebug H5LTyydebug #define yynerrs H5LTyynerrs +#define yylval H5LTyylval +#define yychar H5LTyychar + /* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 20 "hl/src/H5LTparse.y" +#line 20 "hl/src/H5LTparse.y" /* yacc.c:339 */ #include #include @@ -127,7 +127,7 @@ struct arr_info { }; /*stack for nested array type*/ struct arr_info arr_stack[STACK_SIZE]; -int asindex = -1; /*pointer to the top of array stack*/ +int asindex = -1; /*pointer to the top of array stack*/ hbool_t is_str_size = 0; /*flag to lexer for string size*/ hbool_t is_str_pad = 0; /*flag to lexer for string padding*/ @@ -135,7 +135,7 @@ H5T_str_t str_pad; /*variable for string padding*/ H5T_cset_t str_cset; /*variable for string character set*/ hbool_t is_variable = 0; /*variable for variable-length string*/ size_t str_size; /*variable for string size*/ - + hid_t enum_id; /*type ID*/ hbool_t is_enum = 0; /*flag to lexer for enum type*/ hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/ @@ -145,14 +145,13 @@ hbool_t is_opq_size = 0; /*flag to lexer for opaque type size*/ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ -/* Line 371 of yacc.c */ -#line 128 "hl/src/H5LTparse.c" +#line 127 "hl/src/H5LTparse.c" /* yacc.c:339 */ -# ifndef YY_NULL +# ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# define YY_NULLPTR nullptr # else -# define YY_NULL 0 +# define YY_NULLPTR 0 # endif # endif @@ -168,7 +167,7 @@ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ by #include "H5LTparse.h". */ #ifndef YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED # define YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -176,113 +175,99 @@ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ extern int H5LTyydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - H5T_STD_I8BE_TOKEN = 258, - H5T_STD_I8LE_TOKEN = 259, - H5T_STD_I16BE_TOKEN = 260, - H5T_STD_I16LE_TOKEN = 261, - H5T_STD_I32BE_TOKEN = 262, - H5T_STD_I32LE_TOKEN = 263, - H5T_STD_I64BE_TOKEN = 264, - H5T_STD_I64LE_TOKEN = 265, - H5T_STD_U8BE_TOKEN = 266, - H5T_STD_U8LE_TOKEN = 267, - H5T_STD_U16BE_TOKEN = 268, - H5T_STD_U16LE_TOKEN = 269, - H5T_STD_U32BE_TOKEN = 270, - H5T_STD_U32LE_TOKEN = 271, - H5T_STD_U64BE_TOKEN = 272, - H5T_STD_U64LE_TOKEN = 273, - H5T_NATIVE_CHAR_TOKEN = 274, - H5T_NATIVE_SCHAR_TOKEN = 275, - H5T_NATIVE_UCHAR_TOKEN = 276, - H5T_NATIVE_SHORT_TOKEN = 277, - H5T_NATIVE_USHORT_TOKEN = 278, - H5T_NATIVE_INT_TOKEN = 279, - H5T_NATIVE_UINT_TOKEN = 280, - H5T_NATIVE_LONG_TOKEN = 281, - H5T_NATIVE_ULONG_TOKEN = 282, - H5T_NATIVE_LLONG_TOKEN = 283, - H5T_NATIVE_ULLONG_TOKEN = 284, - H5T_IEEE_F32BE_TOKEN = 285, - H5T_IEEE_F32LE_TOKEN = 286, - H5T_IEEE_F64BE_TOKEN = 287, - H5T_IEEE_F64LE_TOKEN = 288, - H5T_NATIVE_FLOAT_TOKEN = 289, - H5T_NATIVE_DOUBLE_TOKEN = 290, - H5T_NATIVE_LDOUBLE_TOKEN = 291, - H5T_STRING_TOKEN = 292, - STRSIZE_TOKEN = 293, - STRPAD_TOKEN = 294, - CSET_TOKEN = 295, - CTYPE_TOKEN = 296, - H5T_VARIABLE_TOKEN = 297, - H5T_STR_NULLTERM_TOKEN = 298, - H5T_STR_NULLPAD_TOKEN = 299, - H5T_STR_SPACEPAD_TOKEN = 300, - H5T_CSET_ASCII_TOKEN = 301, - H5T_CSET_UTF8_TOKEN = 302, - H5T_C_S1_TOKEN = 303, - H5T_FORTRAN_S1_TOKEN = 304, - H5T_OPAQUE_TOKEN = 305, - OPQ_SIZE_TOKEN = 306, - OPQ_TAG_TOKEN = 307, - H5T_COMPOUND_TOKEN = 308, - H5T_ENUM_TOKEN = 309, - H5T_ARRAY_TOKEN = 310, - H5T_VLEN_TOKEN = 311, - STRING = 312, - NUMBER = 313 - }; + enum yytokentype + { + H5T_STD_I8BE_TOKEN = 258, + H5T_STD_I8LE_TOKEN = 259, + H5T_STD_I16BE_TOKEN = 260, + H5T_STD_I16LE_TOKEN = 261, + H5T_STD_I32BE_TOKEN = 262, + H5T_STD_I32LE_TOKEN = 263, + H5T_STD_I64BE_TOKEN = 264, + H5T_STD_I64LE_TOKEN = 265, + H5T_STD_U8BE_TOKEN = 266, + H5T_STD_U8LE_TOKEN = 267, + H5T_STD_U16BE_TOKEN = 268, + H5T_STD_U16LE_TOKEN = 269, + H5T_STD_U32BE_TOKEN = 270, + H5T_STD_U32LE_TOKEN = 271, + H5T_STD_U64BE_TOKEN = 272, + H5T_STD_U64LE_TOKEN = 273, + H5T_NATIVE_CHAR_TOKEN = 274, + H5T_NATIVE_SCHAR_TOKEN = 275, + H5T_NATIVE_UCHAR_TOKEN = 276, + H5T_NATIVE_SHORT_TOKEN = 277, + H5T_NATIVE_USHORT_TOKEN = 278, + H5T_NATIVE_INT_TOKEN = 279, + H5T_NATIVE_UINT_TOKEN = 280, + H5T_NATIVE_LONG_TOKEN = 281, + H5T_NATIVE_ULONG_TOKEN = 282, + H5T_NATIVE_LLONG_TOKEN = 283, + H5T_NATIVE_ULLONG_TOKEN = 284, + H5T_IEEE_F32BE_TOKEN = 285, + H5T_IEEE_F32LE_TOKEN = 286, + H5T_IEEE_F64BE_TOKEN = 287, + H5T_IEEE_F64LE_TOKEN = 288, + H5T_NATIVE_FLOAT_TOKEN = 289, + H5T_NATIVE_DOUBLE_TOKEN = 290, + H5T_NATIVE_LDOUBLE_TOKEN = 291, + H5T_STRING_TOKEN = 292, + STRSIZE_TOKEN = 293, + STRPAD_TOKEN = 294, + CSET_TOKEN = 295, + CTYPE_TOKEN = 296, + H5T_VARIABLE_TOKEN = 297, + H5T_STR_NULLTERM_TOKEN = 298, + H5T_STR_NULLPAD_TOKEN = 299, + H5T_STR_SPACEPAD_TOKEN = 300, + H5T_CSET_ASCII_TOKEN = 301, + H5T_CSET_UTF8_TOKEN = 302, + H5T_C_S1_TOKEN = 303, + H5T_FORTRAN_S1_TOKEN = 304, + H5T_OPAQUE_TOKEN = 305, + OPQ_SIZE_TOKEN = 306, + OPQ_TAG_TOKEN = 307, + H5T_COMPOUND_TOKEN = 308, + H5T_ENUM_TOKEN = 309, + H5T_ARRAY_TOKEN = 310, + H5T_VLEN_TOKEN = 311, + STRING = 312, + NUMBER = 313 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE + +union YYSTYPE { -/* Line 387 of yacc.c */ -#line 72 "hl/src/H5LTparse.y" +#line 72 "hl/src/H5LTparse.y" /* yacc.c:355 */ int ival; /*for integer token*/ char *sval; /*for name string*/ hid_t hid; /*for hid_t token*/ +#line 232 "hl/src/H5LTparse.c" /* yacc.c:355 */ +}; -/* Line 387 of yacc.c */ -#line 236 "hl/src/H5LTparse.c" -} YYSTYPE; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE H5LTyylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -hid_t H5LTyyparse (void *YYPARSE_PARAM); -#else -hid_t H5LTyyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus hid_t H5LTyyparse (void); -#else -hid_t H5LTyyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED */ /* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 264 "hl/src/H5LTparse.c" +#line 249 "hl/src/H5LTparse.c" /* yacc.c:358 */ #ifdef short # undef short @@ -296,11 +281,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -320,8 +302,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -343,6 +324,33 @@ typedef short int yytype_int16; # endif #endif +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# endif +#endif + /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -350,24 +358,26 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif + #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -385,8 +395,7 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -398,8 +407,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -415,7 +424,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -423,15 +432,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -441,7 +448,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -466,16 +473,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif @@ -494,7 +501,7 @@ union yyalloc for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -510,17 +517,19 @@ union yyalloc #define YYNNTS 46 /* YYNRULES -- Number of rules. */ #define YYNRULES 95 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 143 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 313 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -558,52 +567,7 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 4, 6, 8, 10, 12, 14, 16, - 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, - 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, - 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, - 78, 80, 82, 84, 86, 88, 90, 92, 93, 99, - 100, 103, 104, 112, 114, 115, 118, 120, 121, 128, - 129, 132, 133, 134, 140, 142, 147, 148, 149, 150, - 151, 167, 169, 171, 172, 173, 174, 175, 176, 197, - 199, 201, 203, 205, 207, 209, 211, 213, 215, 216, - 224, 225, 228, 229, 236, 238 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 67, 0, -1, -1, 68, -1, 69, -1, 72, -1, - 80, -1, 87, -1, 70, -1, 71, -1, 95, -1, - 105, -1, 88, -1, 3, -1, 4, -1, 5, -1, - 6, -1, 7, -1, 8, -1, 9, -1, 10, -1, - 11, -1, 12, -1, 13, -1, 14, -1, 15, -1, - 16, -1, 17, -1, 18, -1, 19, -1, 20, -1, - 21, -1, 22, -1, 23, -1, 24, -1, 25, -1, - 26, -1, 27, -1, 28, -1, 29, -1, 30, -1, - 31, -1, 32, -1, 33, -1, 34, -1, 35, -1, - 36, -1, -1, 53, 73, 59, 74, 60, -1, -1, - 74, 75, -1, -1, 68, 76, 63, 77, 63, 78, - 65, -1, 57, -1, -1, 64, 79, -1, 58, -1, - -1, 55, 81, 59, 82, 68, 60, -1, -1, 82, - 83, -1, -1, -1, 61, 84, 86, 85, 62, -1, - 58, -1, 56, 59, 68, 60, -1, -1, -1, -1, - -1, 50, 59, 51, 89, 93, 65, 90, 52, 91, - 63, 94, 63, 65, 92, 60, -1, 58, -1, 57, - -1, -1, -1, -1, -1, -1, 37, 59, 38, 96, - 101, 65, 97, 39, 102, 65, 98, 40, 103, 65, - 99, 41, 104, 65, 100, 60, -1, 42, -1, 58, - -1, 43, -1, 44, -1, 45, -1, 46, -1, 47, - -1, 48, -1, 49, -1, -1, 54, 59, 70, 65, - 106, 107, 60, -1, -1, 107, 108, -1, -1, 63, - 110, 63, 109, 111, 65, -1, 57, -1, 58, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 105, 105, 106, 108, 109, 110, 111, 113, 114, @@ -652,13 +616,13 @@ static const char *const yytname[] = "$@5", "dimsize", "vlen_type", "opaque_type", "$@6", "@7", "$@8", "$@9", "opaque_size", "opaque_tag", "string_type", "$@10", "$@11", "$@12", "$@13", "@14", "strsize", "strpad", "cset", "ctype", "enum_type", "$@15", - "enum_list", "enum_def", "$@16", "enum_symbol", "enum_val", YY_NULL + "enum_list", "enum_def", "$@16", "enum_symbol", "enum_val", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -671,71 +635,18 @@ static const yytype_uint16 yytoknum[] = }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 66, 67, 67, 68, 68, 68, 68, 69, 69, - 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 71, 71, 71, 71, 71, 71, 71, 73, 72, 74, - 74, 76, 75, 77, 78, 78, 79, 81, 80, 82, - 82, 84, 85, 83, 86, 87, 89, 90, 91, 92, - 88, 93, 94, 96, 97, 98, 99, 100, 95, 101, - 101, 102, 102, 102, 103, 103, 104, 104, 106, 105, - 107, 107, 109, 108, 110, 111 -}; +#define YYPACT_NINF -25 -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 5, 0, - 2, 0, 7, 1, 0, 2, 1, 0, 6, 0, - 2, 0, 0, 5, 1, 4, 0, 0, 0, 0, - 15, 1, 1, 0, 0, 0, 0, 0, 20, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 7, - 0, 2, 0, 6, 1, 1 -}; +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-25))) -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 2, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 0, 0, 47, 0, 57, - 0, 0, 3, 4, 8, 9, 5, 6, 7, 12, - 10, 11, 0, 0, 0, 0, 0, 0, 1, 73, - 66, 49, 0, 59, 0, 0, 0, 0, 88, 0, - 65, 79, 80, 0, 71, 0, 48, 51, 50, 90, - 61, 0, 60, 74, 67, 0, 0, 0, 58, 0, - 0, 0, 89, 0, 91, 64, 62, 0, 68, 53, - 0, 94, 0, 0, 81, 82, 83, 0, 0, 54, - 92, 63, 75, 0, 0, 0, 0, 0, 72, 0, - 56, 55, 52, 95, 0, 0, 0, 93, 84, 85, - 0, 69, 76, 0, 0, 70, 0, 86, 87, 0, - 77, 0, 78 -}; +#define YYTABLE_NINF -1 -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 41, 42, 43, 44, 45, 46, 54, 67, 78, - 85, 100, 115, 121, 47, 56, 69, 82, 87, 103, - 96, 48, 49, 66, 90, 108, 133, 75, 119, 50, - 65, 89, 117, 134, 141, 73, 107, 130, 139, 51, - 79, 86, 94, 116, 102, 124 -}; +#define yytable_value_is_error(Yytable_value) \ + 0 -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -25 + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { 114, -25, -25, -25, -25, -25, -25, -25, -25, -25, @@ -755,7 +666,29 @@ static const yytype_int16 yypact[] = -25, 143, -25 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 2, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 0, 0, 47, 0, 57, + 0, 0, 3, 4, 8, 9, 5, 6, 7, 12, + 10, 11, 0, 0, 0, 0, 0, 0, 1, 73, + 66, 49, 0, 59, 0, 0, 0, 0, 88, 0, + 65, 79, 80, 0, 71, 0, 48, 51, 50, 90, + 61, 0, 60, 74, 67, 0, 0, 0, 58, 0, + 0, 0, 89, 0, 91, 64, 62, 0, 68, 53, + 0, 94, 0, 0, 81, 82, 83, 0, 0, 54, + 92, 63, 75, 0, 0, 0, 0, 0, 72, 0, + 56, 55, 52, 95, 0, 0, 0, 93, 84, 85, + 0, 69, 76, 0, 0, 70, 0, 86, 87, 0, + 77, 0, 78 +}; + + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -25, -25, -21, -25, 108, -25, -25, -25, -25, -25, @@ -765,10 +698,19 @@ static const yytype_int8 yypgoto[] = -25, -25, -25, -25, -25, -25 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 41, 42, 43, 44, 45, 46, 54, 67, 78, + 85, 100, 115, 121, 47, 56, 69, 82, 87, 103, + 96, 48, 49, 66, 90, 108, 133, 75, 119, 50, + 65, 89, 117, 134, 141, 73, 107, 130, 139, 51, + 79, 86, 94, 116, 102, 124 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, @@ -794,12 +736,6 @@ static const yytype_uint8 yytable[] = 132, 136, 140, 142 }; -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-25))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - static const yytype_uint8 yycheck[] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -825,8 +761,8 @@ static const yytype_uint8 yycheck[] = 65, 41, 65, 60 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, @@ -846,30 +782,46 @@ static const yytype_uint8 yystos[] = 65, 100, 60 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 66, 67, 67, 68, 68, 68, 68, 69, 69, + 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 71, 71, 71, 71, 71, 71, 71, 73, 72, 74, + 74, 76, 75, 77, 78, 78, 79, 81, 80, 82, + 82, 84, 85, 83, 86, 87, 89, 90, 91, 92, + 88, 93, 94, 96, 97, 98, 99, 100, 95, 101, + 101, 102, 102, 102, 103, 103, 104, 104, 106, 105, + 107, 107, 109, 108, 110, 111 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 5, 0, + 2, 0, 7, 1, 0, 2, 1, 0, 6, 0, + 2, 0, 0, 5, 1, 4, 0, 0, 0, 0, + 15, 1, 1, 0, 0, 0, 0, 0, 20, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 7, + 0, 2, 0, 6, 1, 1 +}; + + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + #define YYRECOVERING() (!!yyerrstatus) @@ -886,27 +838,15 @@ do \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -916,40 +856,36 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { FILE *yyo = yyoutput; YYUSE (yyo); @@ -958,14 +894,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -973,22 +903,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); @@ -999,16 +918,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1019,49 +930,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1075,7 +979,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1098,15 +1002,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -1122,16 +1019,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1161,27 +1050,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1204,11 +1093,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULL; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1216,10 +1105,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1269,7 +1154,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; @@ -1336,31 +1221,17 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif { YYUSE (yyvaluep); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1369,18 +1240,8 @@ yydestruct (yymsg, yytype, yyvaluep) /* The lookahead symbol. */ int yychar; - -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - +YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; @@ -1389,35 +1250,16 @@ int yynerrs; | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -hid_t -yyparse (void *YYPARSE_PARAM) -#else -hid_t -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) hid_t yyparse (void) -#else -hid_t -yyparse () - -#endif -#endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ @@ -1485,23 +1327,23 @@ yyparse () #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1509,22 +1351,22 @@ yyparse () # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1533,10 +1375,10 @@ yyparse () yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1565,7 +1407,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (); } if (yychar <= YYEOF) @@ -1630,7 +1472,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1644,440 +1486,439 @@ yyreduce: switch (yyn) { case 2: -/* Line 1792 of yacc.c */ -#line 105 "hl/src/H5LTparse.y" +#line 105 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } +#line 1470 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 3: -/* Line 1792 of yacc.c */ -#line 106 "hl/src/H5LTparse.y" +#line 106 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { return (yyval.hid);} +#line 1476 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 13: -/* Line 1792 of yacc.c */ -#line 120 "hl/src/H5LTparse.y" +#line 120 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } +#line 1482 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 14: -/* Line 1792 of yacc.c */ -#line 121 "hl/src/H5LTparse.y" +#line 121 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } +#line 1488 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 15: -/* Line 1792 of yacc.c */ -#line 122 "hl/src/H5LTparse.y" +#line 122 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } +#line 1494 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 16: -/* Line 1792 of yacc.c */ -#line 123 "hl/src/H5LTparse.y" +#line 123 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } +#line 1500 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 17: -/* Line 1792 of yacc.c */ -#line 124 "hl/src/H5LTparse.y" +#line 124 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } +#line 1506 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 18: -/* Line 1792 of yacc.c */ -#line 125 "hl/src/H5LTparse.y" +#line 125 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } +#line 1512 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 19: -/* Line 1792 of yacc.c */ -#line 126 "hl/src/H5LTparse.y" +#line 126 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } +#line 1518 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 20: -/* Line 1792 of yacc.c */ -#line 127 "hl/src/H5LTparse.y" +#line 127 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } +#line 1524 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 21: -/* Line 1792 of yacc.c */ -#line 128 "hl/src/H5LTparse.y" +#line 128 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } +#line 1530 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 22: -/* Line 1792 of yacc.c */ -#line 129 "hl/src/H5LTparse.y" +#line 129 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } +#line 1536 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 23: -/* Line 1792 of yacc.c */ -#line 130 "hl/src/H5LTparse.y" +#line 130 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } +#line 1542 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 24: -/* Line 1792 of yacc.c */ -#line 131 "hl/src/H5LTparse.y" +#line 131 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } +#line 1548 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 25: -/* Line 1792 of yacc.c */ -#line 132 "hl/src/H5LTparse.y" +#line 132 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } +#line 1554 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 26: -/* Line 1792 of yacc.c */ -#line 133 "hl/src/H5LTparse.y" +#line 133 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } +#line 1560 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 27: -/* Line 1792 of yacc.c */ -#line 134 "hl/src/H5LTparse.y" +#line 134 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } +#line 1566 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 28: -/* Line 1792 of yacc.c */ -#line 135 "hl/src/H5LTparse.y" +#line 135 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } +#line 1572 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 29: -/* Line 1792 of yacc.c */ -#line 136 "hl/src/H5LTparse.y" +#line 136 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } +#line 1578 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 30: -/* Line 1792 of yacc.c */ -#line 137 "hl/src/H5LTparse.y" +#line 137 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } +#line 1584 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 31: -/* Line 1792 of yacc.c */ -#line 138 "hl/src/H5LTparse.y" +#line 138 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } +#line 1590 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 32: -/* Line 1792 of yacc.c */ -#line 139 "hl/src/H5LTparse.y" +#line 139 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } +#line 1596 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 33: -/* Line 1792 of yacc.c */ -#line 140 "hl/src/H5LTparse.y" +#line 140 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } +#line 1602 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 34: -/* Line 1792 of yacc.c */ -#line 141 "hl/src/H5LTparse.y" +#line 141 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } +#line 1608 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 35: -/* Line 1792 of yacc.c */ -#line 142 "hl/src/H5LTparse.y" +#line 142 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } +#line 1614 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 36: -/* Line 1792 of yacc.c */ -#line 143 "hl/src/H5LTparse.y" +#line 143 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } +#line 1620 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 37: -/* Line 1792 of yacc.c */ -#line 144 "hl/src/H5LTparse.y" +#line 144 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } +#line 1626 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 38: -/* Line 1792 of yacc.c */ -#line 145 "hl/src/H5LTparse.y" +#line 145 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } +#line 1632 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 39: -/* Line 1792 of yacc.c */ -#line 146 "hl/src/H5LTparse.y" +#line 146 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } +#line 1638 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 40: -/* Line 1792 of yacc.c */ -#line 149 "hl/src/H5LTparse.y" +#line 149 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } +#line 1644 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 41: -/* Line 1792 of yacc.c */ -#line 150 "hl/src/H5LTparse.y" +#line 150 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } +#line 1650 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 42: -/* Line 1792 of yacc.c */ -#line 151 "hl/src/H5LTparse.y" +#line 151 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } +#line 1656 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 43: -/* Line 1792 of yacc.c */ -#line 152 "hl/src/H5LTparse.y" +#line 152 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } +#line 1662 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 44: -/* Line 1792 of yacc.c */ -#line 153 "hl/src/H5LTparse.y" +#line 153 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } +#line 1668 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 45: -/* Line 1792 of yacc.c */ -#line 154 "hl/src/H5LTparse.y" +#line 154 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } +#line 1674 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 46: -/* Line 1792 of yacc.c */ -#line 155 "hl/src/H5LTparse.y" +#line 155 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } +#line 1680 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 47: -/* Line 1792 of yacc.c */ -#line 159 "hl/src/H5LTparse.y" +#line 159 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } +#line 1686 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 48: -/* Line 1792 of yacc.c */ -#line 161 "hl/src/H5LTparse.y" - { (yyval.hid) = cmpd_stack[csindex].id; +#line 161 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; - cmpd_stack[csindex].first_memb = 1; + cmpd_stack[csindex].first_memb = 1; csindex--; } +#line 1696 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 51: -/* Line 1792 of yacc.c */ -#line 170 "hl/src/H5LTparse.y" +#line 170 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } +#line 1702 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 52: -/* Line 1792 of yacc.c */ -#line 172 "hl/src/H5LTparse.y" - { +#line 172 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { size_t origin_size, new_size; hid_t dtype_id = cmpd_stack[csindex].id; /*Adjust size and insert member, consider both member size and offset.*/ if(cmpd_stack[csindex].first_memb) { /*reclaim the size 1 temporarily set*/ - new_size = H5Tget_size((yyvsp[(1) - (7)].hid)) + (yyvsp[(6) - (7)].ival); + new_size = H5Tget_size((yyvsp[-6].hid)) + (yyvsp[-1].ival); H5Tset_size(dtype_id, new_size); /*member name is saved in yylval.sval by lexer*/ - H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), (yyvsp[(6) - (7)].ival), (yyvsp[(1) - (7)].hid)); + H5Tinsert(dtype_id, (yyvsp[-3].sval), (yyvsp[-1].ival), (yyvsp[-6].hid)); cmpd_stack[csindex].first_memb = 0; } else { origin_size = H5Tget_size(dtype_id); - - if((yyvsp[(6) - (7)].ival) == 0) { - new_size = origin_size + H5Tget_size((yyvsp[(1) - (7)].hid)); + + if((yyvsp[-1].ival) == 0) { + new_size = origin_size + H5Tget_size((yyvsp[-6].hid)); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), origin_size, (yyvsp[(1) - (7)].hid)); + H5Tinsert(dtype_id, (yyvsp[-3].sval), origin_size, (yyvsp[-6].hid)); } else { - new_size = (yyvsp[(6) - (7)].ival) + H5Tget_size((yyvsp[(1) - (7)].hid)); + new_size = (yyvsp[-1].ival) + H5Tget_size((yyvsp[-6].hid)); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), (yyvsp[(6) - (7)].ival), (yyvsp[(1) - (7)].hid)); + H5Tinsert(dtype_id, (yyvsp[-3].sval), (yyvsp[-1].ival), (yyvsp[-6].hid)); } } - if((yyvsp[(4) - (7)].sval)) { - free((yyvsp[(4) - (7)].sval)); - (yyvsp[(4) - (7)].sval) = NULL; + if((yyvsp[-3].sval)) { + free((yyvsp[-3].sval)); + (yyvsp[-3].sval) = NULL; } cmpd_stack[csindex].is_field = 0; - H5Tclose((yyvsp[(1) - (7)].hid)); - + H5Tclose((yyvsp[-6].hid)); + new_size = H5Tget_size(dtype_id); } +#line 1741 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 53: -/* Line 1792 of yacc.c */ -#line 208 "hl/src/H5LTparse.y" +#line 208 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.sval) = strdup(yylval.sval); free(yylval.sval); yylval.sval = NULL; } +#line 1751 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 54: -/* Line 1792 of yacc.c */ -#line 215 "hl/src/H5LTparse.y" +#line 215 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } +#line 1757 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 55: -/* Line 1792 of yacc.c */ -#line 217 "hl/src/H5LTparse.y" +#line 217 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.ival) = yylval.ival; } +#line 1763 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 57: -/* Line 1792 of yacc.c */ -#line 221 "hl/src/H5LTparse.y" +#line 221 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { asindex++; /*pushd onto the stack*/ } +#line 1769 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 58: -/* Line 1792 of yacc.c */ -#line 223 "hl/src/H5LTparse.y" - { - (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); +#line 223 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { + (yyval.hid) = H5Tarray_create2((yyvsp[-1].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); arr_stack[asindex].ndims = 0; asindex--; - H5Tclose((yyvsp[(5) - (6)].hid)); + H5Tclose((yyvsp[-1].hid)); } +#line 1780 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 61: -/* Line 1792 of yacc.c */ -#line 233 "hl/src/H5LTparse.y" +#line 233 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } +#line 1786 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 62: -/* Line 1792 of yacc.c */ -#line 234 "hl/src/H5LTparse.y" +#line 234 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { unsigned ndims = arr_stack[asindex].ndims; - arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; + arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; arr_stack[asindex].ndims++; - arr_stack[asindex].is_dim = 0; + arr_stack[asindex].is_dim = 0; } +#line 1796 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 65: -/* Line 1792 of yacc.c */ -#line 245 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } +#line 245 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { (yyval.hid) = H5Tvlen_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); } +#line 1802 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 66: -/* Line 1792 of yacc.c */ -#line 250 "hl/src/H5LTparse.y" +#line 250 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { is_opq_size = 1; } +#line 1808 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 67: -/* Line 1792 of yacc.c */ -#line 251 "hl/src/H5LTparse.y" - { +#line 251 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { size_t size = (size_t)yylval.ival; (yyval.hid) = H5Tcreate(H5T_OPAQUE, size); - is_opq_size = 0; + is_opq_size = 0; } +#line 1818 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 68: -/* Line 1792 of yacc.c */ -#line 256 "hl/src/H5LTparse.y" +#line 256 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { is_opq_tag = 1; } +#line 1824 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 69: -/* Line 1792 of yacc.c */ -#line 257 "hl/src/H5LTparse.y" - { - H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); +#line 257 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { + H5Tset_tag((yyvsp[-6].hid), yylval.sval); free(yylval.sval); yylval.sval = NULL; is_opq_tag = 0; } +#line 1835 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 70: -/* Line 1792 of yacc.c */ -#line 263 "hl/src/H5LTparse.y" - { (yyval.hid) = (yyvsp[(7) - (15)].hid); } +#line 263 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { (yyval.hid) = (yyvsp[-8].hid); } +#line 1841 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 73: -/* Line 1792 of yacc.c */ -#line 271 "hl/src/H5LTparse.y" +#line 271 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { is_str_size = 1; } +#line 1847 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 74: -/* Line 1792 of yacc.c */ -#line 272 "hl/src/H5LTparse.y" - { - if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) +#line 272 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { + if((yyvsp[-1].ival) == H5T_VARIABLE_TOKEN) is_variable = 1; - else + else str_size = yylval.ival; - is_str_size = 0; + is_str_size = 0; } +#line 1859 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 75: -/* Line 1792 of yacc.c */ -#line 280 "hl/src/H5LTparse.y" +#line 280 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { - if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) + if((yyvsp[-1].ival) == H5T_STR_NULLTERM_TOKEN) str_pad = H5T_STR_NULLTERM; - else if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLPAD_TOKEN) + else if((yyvsp[-1].ival) == H5T_STR_NULLPAD_TOKEN) str_pad = H5T_STR_NULLPAD; - else if((yyvsp[(9) - (10)].ival) == H5T_STR_SPACEPAD_TOKEN) + else if((yyvsp[-1].ival) == H5T_STR_SPACEPAD_TOKEN) str_pad = H5T_STR_SPACEPAD; } +#line 1872 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 76: -/* Line 1792 of yacc.c */ -#line 289 "hl/src/H5LTparse.y" - { - if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) +#line 289 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { + if((yyvsp[-1].ival) == H5T_CSET_ASCII_TOKEN) str_cset = H5T_CSET_ASCII; - else if((yyvsp[(13) - (14)].ival) == H5T_CSET_UTF8_TOKEN) + else if((yyvsp[-1].ival) == H5T_CSET_UTF8_TOKEN) str_cset = H5T_CSET_UTF8; } +#line 1883 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 77: -/* Line 1792 of yacc.c */ -#line 296 "hl/src/H5LTparse.y" +#line 296 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { - if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) + if((yyvsp[-1].hid) == H5T_C_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_C_S1); - else if((yyvsp[(17) - (18)].hid) == H5T_FORTRAN_S1_TOKEN) + else if((yyvsp[-1].hid) == H5T_FORTRAN_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_FORTRAN_S1); } +#line 1894 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 78: -/* Line 1792 of yacc.c */ -#line 303 "hl/src/H5LTparse.y" - { - hid_t str_id = (yyvsp[(19) - (20)].hid); +#line 303 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { + hid_t str_id = (yyvsp[-1].hid); /*set string size*/ if(is_variable) { @@ -2085,93 +1926,93 @@ yyreduce: is_variable = 0; } else H5Tset_size(str_id, str_size); - + /*set string padding and character set*/ H5Tset_strpad(str_id, str_pad); H5Tset_cset(str_id, str_cset); - (yyval.hid) = str_id; + (yyval.hid) = str_id; } +#line 1915 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 79: -/* Line 1792 of yacc.c */ -#line 320 "hl/src/H5LTparse.y" +#line 320 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_VARIABLE_TOKEN;} +#line 1921 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 81: -/* Line 1792 of yacc.c */ -#line 323 "hl/src/H5LTparse.y" +#line 323 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} +#line 1927 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 82: -/* Line 1792 of yacc.c */ -#line 324 "hl/src/H5LTparse.y" +#line 324 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} +#line 1933 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 83: -/* Line 1792 of yacc.c */ -#line 325 "hl/src/H5LTparse.y" +#line 325 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} +#line 1939 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 84: -/* Line 1792 of yacc.c */ -#line 327 "hl/src/H5LTparse.y" +#line 327 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} +#line 1945 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 85: -/* Line 1792 of yacc.c */ -#line 328 "hl/src/H5LTparse.y" +#line 328 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} +#line 1951 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 86: -/* Line 1792 of yacc.c */ -#line 330 "hl/src/H5LTparse.y" +#line 330 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.hid) = H5T_C_S1_TOKEN;} +#line 1957 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 87: -/* Line 1792 of yacc.c */ -#line 331 "hl/src/H5LTparse.y" +#line 331 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} +#line 1963 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 88: -/* Line 1792 of yacc.c */ -#line 335 "hl/src/H5LTparse.y" - { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } +#line 335 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { is_enum = 1; enum_id = H5Tenum_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); } +#line 1969 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 89: -/* Line 1792 of yacc.c */ -#line 337 "hl/src/H5LTparse.y" +#line 337 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } +#line 1975 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 92: -/* Line 1792 of yacc.c */ -#line 342 "hl/src/H5LTparse.y" +#line 342 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { is_enum_memb = 1; /*indicate member of enum*/ #ifdef H5_HAVE_WIN32_API - enum_memb_symbol = _strdup(yylval.sval); + enum_memb_symbol = _strdup(yylval.sval); #else /* H5_HAVE_WIN32_API */ - enum_memb_symbol = strdup(yylval.sval); + enum_memb_symbol = strdup(yylval.sval); #endif /* H5_HAVE_WIN32_API */ free(yylval.sval); yylval.sval = NULL; } +#line 1990 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 93: -/* Line 1792 of yacc.c */ -#line 353 "hl/src/H5LTparse.y" +#line 353 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { char char_val=(char)yylval.ival; short short_val=(short)yylval.ival; @@ -2182,43 +2023,43 @@ yyreduce: hid_t native = H5Tget_native_type(super, H5T_DIR_ASCEND); H5T_order_t super_order = H5Tget_order(super); H5T_order_t native_order = H5Tget_order(native); - + if(is_enum && is_enum_memb) { /*if it's an enum member*/ /*To handle machines of different endianness*/ if(H5Tequal(native, H5T_NATIVE_SCHAR) || H5Tequal(native, H5T_NATIVE_UCHAR)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &char_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &char_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &char_val); } else if(H5Tequal(native, H5T_NATIVE_SHORT) || H5Tequal(native, H5T_NATIVE_USHORT)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &short_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &short_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &short_val); } else if(H5Tequal(native, H5T_NATIVE_INT) || H5Tequal(native, H5T_NATIVE_UINT)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &int_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &int_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &int_val); } else if(H5Tequal(native, H5T_NATIVE_LONG) || H5Tequal(native, H5T_NATIVE_ULONG)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &long_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &long_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &long_val); } else if(H5Tequal(native, H5T_NATIVE_LLONG) || H5Tequal(native, H5T_NATIVE_ULLONG)) { if(super_order != native_order) - H5Tconvert(native, super, 1, &llong_val, NULL, H5P_DEFAULT); + H5Tconvert(native, super, 1, &llong_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &llong_val); } - is_enum_memb = 0; + is_enum_memb = 0; if(enum_memb_symbol) free(enum_memb_symbol); } H5Tclose(super); H5Tclose(native); } +#line 2037 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; -/* Line 1792 of yacc.c */ -#line 2200 "hl/src/H5LTparse.c" +#line 2041 "hl/src/H5LTparse.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2240,7 +2081,7 @@ yyreduce: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -2255,9 +2096,9 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -2308,20 +2149,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -2340,7 +2181,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -2353,29 +2194,29 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -2426,14 +2267,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow @@ -2444,8 +2285,5 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 0ecd15d..e38116a 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ #ifndef YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED # define YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -40,105 +40,92 @@ extern int H5LTyydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - H5T_STD_I8BE_TOKEN = 258, - H5T_STD_I8LE_TOKEN = 259, - H5T_STD_I16BE_TOKEN = 260, - H5T_STD_I16LE_TOKEN = 261, - H5T_STD_I32BE_TOKEN = 262, - H5T_STD_I32LE_TOKEN = 263, - H5T_STD_I64BE_TOKEN = 264, - H5T_STD_I64LE_TOKEN = 265, - H5T_STD_U8BE_TOKEN = 266, - H5T_STD_U8LE_TOKEN = 267, - H5T_STD_U16BE_TOKEN = 268, - H5T_STD_U16LE_TOKEN = 269, - H5T_STD_U32BE_TOKEN = 270, - H5T_STD_U32LE_TOKEN = 271, - H5T_STD_U64BE_TOKEN = 272, - H5T_STD_U64LE_TOKEN = 273, - H5T_NATIVE_CHAR_TOKEN = 274, - H5T_NATIVE_SCHAR_TOKEN = 275, - H5T_NATIVE_UCHAR_TOKEN = 276, - H5T_NATIVE_SHORT_TOKEN = 277, - H5T_NATIVE_USHORT_TOKEN = 278, - H5T_NATIVE_INT_TOKEN = 279, - H5T_NATIVE_UINT_TOKEN = 280, - H5T_NATIVE_LONG_TOKEN = 281, - H5T_NATIVE_ULONG_TOKEN = 282, - H5T_NATIVE_LLONG_TOKEN = 283, - H5T_NATIVE_ULLONG_TOKEN = 284, - H5T_IEEE_F32BE_TOKEN = 285, - H5T_IEEE_F32LE_TOKEN = 286, - H5T_IEEE_F64BE_TOKEN = 287, - H5T_IEEE_F64LE_TOKEN = 288, - H5T_NATIVE_FLOAT_TOKEN = 289, - H5T_NATIVE_DOUBLE_TOKEN = 290, - H5T_NATIVE_LDOUBLE_TOKEN = 291, - H5T_STRING_TOKEN = 292, - STRSIZE_TOKEN = 293, - STRPAD_TOKEN = 294, - CSET_TOKEN = 295, - CTYPE_TOKEN = 296, - H5T_VARIABLE_TOKEN = 297, - H5T_STR_NULLTERM_TOKEN = 298, - H5T_STR_NULLPAD_TOKEN = 299, - H5T_STR_SPACEPAD_TOKEN = 300, - H5T_CSET_ASCII_TOKEN = 301, - H5T_CSET_UTF8_TOKEN = 302, - H5T_C_S1_TOKEN = 303, - H5T_FORTRAN_S1_TOKEN = 304, - H5T_OPAQUE_TOKEN = 305, - OPQ_SIZE_TOKEN = 306, - OPQ_TAG_TOKEN = 307, - H5T_COMPOUND_TOKEN = 308, - H5T_ENUM_TOKEN = 309, - H5T_ARRAY_TOKEN = 310, - H5T_VLEN_TOKEN = 311, - STRING = 312, - NUMBER = 313 - }; + enum yytokentype + { + H5T_STD_I8BE_TOKEN = 258, + H5T_STD_I8LE_TOKEN = 259, + H5T_STD_I16BE_TOKEN = 260, + H5T_STD_I16LE_TOKEN = 261, + H5T_STD_I32BE_TOKEN = 262, + H5T_STD_I32LE_TOKEN = 263, + H5T_STD_I64BE_TOKEN = 264, + H5T_STD_I64LE_TOKEN = 265, + H5T_STD_U8BE_TOKEN = 266, + H5T_STD_U8LE_TOKEN = 267, + H5T_STD_U16BE_TOKEN = 268, + H5T_STD_U16LE_TOKEN = 269, + H5T_STD_U32BE_TOKEN = 270, + H5T_STD_U32LE_TOKEN = 271, + H5T_STD_U64BE_TOKEN = 272, + H5T_STD_U64LE_TOKEN = 273, + H5T_NATIVE_CHAR_TOKEN = 274, + H5T_NATIVE_SCHAR_TOKEN = 275, + H5T_NATIVE_UCHAR_TOKEN = 276, + H5T_NATIVE_SHORT_TOKEN = 277, + H5T_NATIVE_USHORT_TOKEN = 278, + H5T_NATIVE_INT_TOKEN = 279, + H5T_NATIVE_UINT_TOKEN = 280, + H5T_NATIVE_LONG_TOKEN = 281, + H5T_NATIVE_ULONG_TOKEN = 282, + H5T_NATIVE_LLONG_TOKEN = 283, + H5T_NATIVE_ULLONG_TOKEN = 284, + H5T_IEEE_F32BE_TOKEN = 285, + H5T_IEEE_F32LE_TOKEN = 286, + H5T_IEEE_F64BE_TOKEN = 287, + H5T_IEEE_F64LE_TOKEN = 288, + H5T_NATIVE_FLOAT_TOKEN = 289, + H5T_NATIVE_DOUBLE_TOKEN = 290, + H5T_NATIVE_LDOUBLE_TOKEN = 291, + H5T_STRING_TOKEN = 292, + STRSIZE_TOKEN = 293, + STRPAD_TOKEN = 294, + CSET_TOKEN = 295, + CTYPE_TOKEN = 296, + H5T_VARIABLE_TOKEN = 297, + H5T_STR_NULLTERM_TOKEN = 298, + H5T_STR_NULLPAD_TOKEN = 299, + H5T_STR_SPACEPAD_TOKEN = 300, + H5T_CSET_ASCII_TOKEN = 301, + H5T_CSET_UTF8_TOKEN = 302, + H5T_C_S1_TOKEN = 303, + H5T_FORTRAN_S1_TOKEN = 304, + H5T_OPAQUE_TOKEN = 305, + OPQ_SIZE_TOKEN = 306, + OPQ_TAG_TOKEN = 307, + H5T_COMPOUND_TOKEN = 308, + H5T_ENUM_TOKEN = 309, + H5T_ARRAY_TOKEN = 310, + H5T_VLEN_TOKEN = 311, + STRING = 312, + NUMBER = 313 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE + +union YYSTYPE { -/* Line 2058 of yacc.c */ -#line 72 "hl/src/H5LTparse.y" +#line 72 "hl/src/H5LTparse.y" /* yacc.c:1909 */ int ival; /*for integer token*/ char *sval; /*for name string*/ hid_t hid; /*for hid_t token*/ +#line 119 "hl/src/H5LTparse.h" /* yacc.c:1909 */ +}; -/* Line 2058 of yacc.c */ -#line 122 "hl/src/H5LTparse.h" -} YYSTYPE; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE H5LTyylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int H5LTyyparse (void *YYPARSE_PARAM); -#else -int H5LTyyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus int H5LTyyparse (void); -#else -int H5LTyyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED */ -- cgit v0.12 From b1c78579da25704d2c688a6047f58ebaf62cae82 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 5 Aug 2020 22:56:15 -0700 Subject: Fixes -Wnull-dereference warning in hl/src/H5DS.c --- hl/src/H5DS.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 63fb461..82dc129 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -1460,10 +1460,6 @@ out: * * Date: January 11, 2005 * -* Comments: -* -* Modifications: -* *------------------------------------------------------------------------- */ @@ -1481,6 +1477,9 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) char ** buf; /* discarding the 'const' qualifier in the free */ char const ** const_buf; /* buf calls */ } u; + + HDmemset(&u, 0, sizeof(u)); + /*------------------------------------------------------------------------- * parameter checking *------------------------------------------------------------------------- -- cgit v0.12 From bd6f3bcdabc88c83393ff36149a80bd71f9365f4 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 5 Aug 2020 23:14:40 -0700 Subject: Fixes -Wnull-dereference warnings around the cache logging calls --- src/H5AC.c | 70 +++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index 6972a31..402f562 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -918,9 +918,10 @@ H5AC_mark_entry_dirty(void *thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_mark_entry_dirty_msg(cache_ptr, entry_ptr, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_mark_entry_dirty_msg(cache_ptr, entry_ptr, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_mark_entry_dirty() */ @@ -971,9 +972,10 @@ H5AC_mark_entry_clean(void *thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_mark_entry_clean_msg(cache_ptr, entry_ptr, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_mark_entry_clean_msg(cache_ptr, entry_ptr, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_mark_entry_clean() */ @@ -1013,9 +1015,10 @@ H5AC_mark_entry_unserialized(void *thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_mark_unserialized_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_mark_unserialized_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_mark_entry_unserialized() */ @@ -1054,9 +1057,10 @@ H5AC_mark_entry_serialized(void *thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_mark_serialized_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_mark_serialized_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_mark_entry_serialized() */ @@ -1156,9 +1160,10 @@ H5AC_pin_protected_entry(void *thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_pin_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_pin_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_pin_protected_entry() */ @@ -1238,9 +1243,10 @@ H5AC_create_flush_dependency(void * parent_thing, void * child_thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_create_fd_msg(cache_ptr, (H5AC_info_t *)parent_thing, (H5AC_info_t *)child_thing, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_create_fd_msg(cache_ptr, (H5AC_info_t *)parent_thing, (H5AC_info_t *)child_thing, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_create_flush_dependency() */ @@ -1373,9 +1379,10 @@ H5AC_resize_entry(void *thing, size_t new_size) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_resize_entry_msg(cache_ptr, entry_ptr, new_size, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_resize_entry_msg(cache_ptr, entry_ptr, new_size, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_resize_entry() */ @@ -1416,9 +1423,10 @@ H5AC_unpin_entry(void *thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_unpin_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_unpin_entry_msg(cache_ptr, entry_ptr, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_unpin_entry() */ @@ -1459,9 +1467,10 @@ H5AC_destroy_flush_dependency(void * parent_thing, void * child_thing) done: /* If currently logging, generate a message */ - if(cache_ptr->log_info->logging) - if(H5C_log_write_destroy_fd_msg(cache_ptr, (H5AC_info_t *)parent_thing, (H5AC_info_t *)child_thing, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache_ptr != NULL && cache_ptr->log_info != NULL) + if(cache_ptr->log_info->logging) + if(H5C_log_write_destroy_fd_msg(cache_ptr, (H5AC_info_t *)parent_thing, (H5AC_info_t *)child_thing, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_destroy_flush_dependency() */ @@ -2637,9 +2646,10 @@ H5AC_remove_entry(void *_entry) done: /* If currently logging, generate a message */ - if(cache->log_info->logging) - if(H5C_log_write_remove_entry_msg(cache, entry, ret_value) < 0) - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") + if(cache != NULL && cache->log_info != NULL) + if(cache->log_info->logging) + if(H5C_log_write_remove_entry_msg(cache, entry, ret_value) < 0) + HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_remove_entry() */ -- cgit v0.12 From 91ca481ff152e7a6b0326fcdb59e506141d2d32a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 6 Aug 2020 08:41:27 -0700 Subject: Reverts H5FDsplitter.c changes so they don't conflict with Quincey's big cleanup patch --- src/H5FDsplitter.c | 94 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 38 deletions(-) diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index 3c33f57..4ed3c4a 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -27,6 +27,8 @@ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ +#include "H5FDsec2.h" /* Generic Functions */ +#include "H5FDstdio.h" /* Generic Functions */ #include "H5Pprivate.h" /* Property lists */ /* The driver identification number, initialized at runtime */ @@ -91,7 +93,7 @@ typedef struct H5FD_splitter_t { #if H5FD_SPLITTER_DEBUG_OP_CALLS #define H5FD_SPLITTER_LOG_CALL(name) do { \ HDprintf("called %s()\n", (name)); \ - HDfflush(stdout); \ + fflush(stdout); \ } while (0) #else #define H5FD_SPLITTER_LOG_CALL(name) /* no-op */ @@ -300,22 +302,27 @@ done: herr_t H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config) { - H5FD_splitter_fapl_t *info = NULL; + H5FD_splitter_fapl_t info; H5P_genplist_t *plist_ptr = NULL; herr_t ret_value = SUCCEED; + H5Eclear2(H5E_DEFAULT); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Dr", fapl_id, vfd_config); H5FD_SPLITTER_LOG_CALL("H5Pset_fapl_splitter"); - if (H5FD_SPLITTER_MAGIC != vfd_config->magic) + if (H5FD_SPLITTER_MAGIC != vfd_config->magic) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid configuration (magic number mismatch)") - if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version) + } + if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invlaid config (version number mismatch)") + } - if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) + if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid property list") + } /* Make sure that the W/O channel supports write-only capability. @@ -331,46 +338,48 @@ H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config) unsigned long wo_driver_flags = 0; wo_plist_ptr = (H5P_genplist_t *)H5I_object(vfd_config->wo_fapl_id); - if (NULL == wo_plist_ptr) + if (NULL == wo_plist_ptr) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - if (H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0) + } + if (H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0) { HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID & info") + } wo_driver = (H5FD_class_t *)H5I_object(wo_driver_prop.driver_id); - if (NULL == wo_driver) + if (NULL == wo_driver) { HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid driver ID in file access property list") - if (H5FD_driver_query(wo_driver, &wo_driver_flags) < 0) + } + if (H5FD_driver_query(wo_driver, &wo_driver_flags) < 0) { HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't query VFD flags") - if (0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags)) + } + if (0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags)) { HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "unsuitable W/O driver") + } } /* end if W/O VFD is non-default */ - if (NULL == (info = H5MM_calloc(sizeof(H5FD_splitter_fapl_t)))) - HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "can't allocate memory for splitter struct") - info->ignore_wo_errs = vfd_config->ignore_wo_errs; - HDstrncpy(info->wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX); - HDstrncpy(info->log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX); - info->rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ - info->wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ + info.ignore_wo_errs = vfd_config->ignore_wo_errs; + HDstrncpy(info.wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX); + HDstrncpy(info.log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX); + info.rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ + info.wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ /* Set non-default channel FAPL IDs in splitter configuration info */ if (H5P_DEFAULT != vfd_config->rw_fapl_id) { - if (FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) + if (FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") - info->rw_fapl_id = vfd_config->rw_fapl_id; + } + info.rw_fapl_id = vfd_config->rw_fapl_id; } if (H5P_DEFAULT != vfd_config->wo_fapl_id) { - if (FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) + if (FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") - info->wo_fapl_id = vfd_config->wo_fapl_id; + } + info.wo_fapl_id = vfd_config->wo_fapl_id; } - if(H5P_set_driver(plist_ptr, H5FD_SPLITTER, info) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set driver") + ret_value = H5P_set_driver(plist_ptr, H5FD_SPLITTER, &info); done: - H5MM_xfree(info); - FUNC_LEAVE_API(ret_value) } /* end H5Pset_fapl_splitter() */ @@ -400,36 +409,45 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_out) H5FD_SPLITTER_LOG_CALL("H5Pget_fapl_splitter"); /* Check arguments */ - if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - if (config_out == NULL) + } + if (config_out == NULL) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_out pointer is null") - if (H5FD_SPLITTER_MAGIC != config_out->magic) + } + if (H5FD_SPLITTER_MAGIC != config_out->magic) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (magic number mismatch)") - if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version) + } + if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (version unsafe)") + } /* Pre-set out FAPL IDs with intent to replace these values */ config_out->rw_fapl_id = H5I_INVALID_HID; config_out->wo_fapl_id = H5I_INVALID_HID; /* Check and get the splitter fapl */ - if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr)) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "incorrect VFL driver") - if (NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr))) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "unable to get specific-driver info") + } + if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr)) { + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver") + } + if (NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr))) { + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "unable to get specific-driver info") + } HDstrncpy(config_out->wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX); HDstrncpy(config_out->log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX); config_out->ignore_wo_errs = fapl_ptr->ignore_wo_errs; /* Copy R/W and W/O FAPLs */ - if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, FAIL, "can't copy R/W FAPL"); - if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, FAIL, "can't copy W/O FAPL"); + if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0) { + HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy R/W FAPL"); + } + if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0) { + HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy W/O FAPL"); + } done: FUNC_LEAVE_API(ret_value) -- cgit v0.12 From 07e4ef9da47eda1f23ca72c748fbb6d4b309540b Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 6 Aug 2020 15:56:04 -0500 Subject: Clean up private / package / static namespace issues (function naming, which header file, FUNC_ENTER / LEAVE, etc). Removed remaining personal email addresses from library source code (still needs cleaned from other directories). Misc. warning, style, and whitespace cleanup. --- MANIFEST | 1 + src/CMakeLists.txt | 1 + src/H5.c | 24 +- src/H5AC.c | 16 +- src/H5ACdbg.c | 6 - src/H5ACmodule.h | 2 +- src/H5ACmpio.c | 3 +- src/H5ACprivate.h | 2 +- src/H5ACpublic.h | 4 +- src/H5Abtree2.c | 3 +- src/H5Adense.c | 14 +- src/H5Adeprec.c | 2 +- src/H5Aint.c | 5 +- src/H5Amodule.h | 2 +- src/H5Apkg.h | 3 - src/H5B.c | 14 +- src/H5B2.c | 3 - src/H5B2cache.c | 24 +- src/H5B2dbg.c | 5 +- src/H5B2hdr.c | 7 +- src/H5B2int.c | 16 +- src/H5B2internal.c | 12 +- src/H5B2leaf.c | 16 +- src/H5B2module.h | 2 +- src/H5B2stat.c | 2 +- src/H5B2test.c | 2 +- src/H5Bcache.c | 7 +- src/H5C.c | 532 +++++------- src/H5CS.c | 4 - src/H5CX.c | 2 +- src/H5Cdbg.c | 68 -- src/H5Cimage.c | 48 -- src/H5Cmodule.h | 2 +- src/H5Cpkg.h | 2 - src/H5Cprivate.h | 3 - src/H5Cpublic.h | 2 - src/H5Dbtree.c | 7 +- src/H5Dbtree2.c | 17 +- src/H5Dchunk.c | 147 ++-- src/H5Dcompact.c | 2 +- src/H5Dcontig.c | 2 +- src/H5Ddeprec.c | 2 +- src/H5Dearray.c | 4 +- src/H5Defl.c | 5 +- src/H5Dfarray.c | 4 +- src/H5Dfill.c | 4 +- src/H5Dint.c | 18 +- src/H5Dmpio.c | 38 +- src/H5Dnone.c | 2 +- src/H5Dpkg.h | 5 +- src/H5Dsingle.c | 2 +- src/H5Dtest.c | 2 +- src/H5Dvirtual.c | 4 +- src/H5E.c | 12 +- src/H5EA.c | 17 +- src/H5EAcache.c | 31 +- src/H5EAdblkpage.c | 7 +- src/H5EAdblock.c | 11 +- src/H5EAhdr.c | 22 +- src/H5EAiblock.c | 34 +- src/H5EAint.c | 4 +- src/H5EApkg.h | 2 +- src/H5EAsblock.c | 2 +- src/H5EAstat.c | 7 +- src/H5EAtest.c | 4 +- src/H5Edeprec.c | 2 +- src/H5Eint.c | 2 +- src/H5Emodule.h | 2 +- src/H5Epkg.h | 2 +- src/H5FA.c | 9 +- src/H5FAcache.c | 18 +- src/H5FAdbg.c | 2 +- src/H5FAhdr.c | 4 +- src/H5FAint.c | 2 +- src/H5FAmodule.h | 2 +- src/H5FAstat.c | 6 +- src/H5FAtest.c | 2 +- src/H5FDcore.c | 37 +- src/H5FDcore.h | 2 +- src/H5FDdirect.c | 265 +++--- src/H5FDdirect.h | 2 +- src/H5FDdrvr_module.h | 2 +- src/H5FDfamily.c | 312 +++---- src/H5FDfamily.h | 2 +- src/H5FDhdfs.c | 1313 ++++++++++------------------- src/H5FDhdfs.h | 11 +- src/H5FDlog.c | 256 +++--- src/H5FDlog.h | 2 +- src/H5FDmirror.c | 878 ++++++++++---------- src/H5FDmirror.h | 292 ------- src/H5FDmirror_priv.h | 323 ++++++++ src/H5FDmodule.h | 2 +- src/H5FDmpi.c | 33 +- src/H5FDmpi.h | 2 +- src/H5FDmpio.c | 2 +- src/H5FDmpio.h | 2 +- src/H5FDmulti.c | 21 +- src/H5FDmulti.h | 2 +- src/H5FDpkg.h | 2 +- src/H5FDprivate.h | 2 +- src/H5FDpublic.h | 2 +- src/H5FDros3.c | 728 +++++++--------- src/H5FDs3comms.c | 1705 ++++++++++++-------------------------- src/H5FDsec2.c | 187 ++--- src/H5FDsec2.h | 2 +- src/H5FDspace.c | 14 +- src/H5FDsplitter.c | 774 ++++++++--------- src/H5FDstdio.c | 2 +- src/H5FDstdio.h | 2 +- src/H5FDtest.c | 1 - src/H5FDwindows.h | 4 +- src/H5FL.c | 2 +- src/H5FLmodule.h | 2 +- src/H5FLprivate.h | 4 +- src/H5FS.c | 11 +- src/H5FScache.c | 12 +- src/H5FSdbg.c | 2 +- src/H5FSint.c | 2 +- src/H5FSmodule.h | 2 +- src/H5FSpkg.h | 2 +- src/H5FSprivate.h | 2 +- src/H5FSsection.c | 147 +--- src/H5Faccum.c | 18 +- src/H5Fcwfs.c | 2 +- src/H5Fdbg.c | 3 +- src/H5Fdeprec.c | 2 +- src/H5Fefc.c | 2 +- src/H5Ffake.c | 2 - src/H5Fint.c | 2 +- src/H5Fio.c | 6 +- src/H5Fmodule.h | 2 +- src/H5Fmount.c | 12 +- src/H5Fmpi.c | 2 +- src/H5Fpkg.h | 2 +- src/H5Fprivate.h | 14 +- src/H5Fquery.c | 3 +- src/H5Fspace.c | 2 +- src/H5Fsuper.c | 5 +- src/H5Fsuper_cache.c | 14 +- src/H5Ftest.c | 2 +- src/H5Gbtree2.c | 145 ++-- src/H5Gcache.c | 2 +- src/H5Gcompact.c | 20 +- src/H5Gdense.c | 167 ++-- src/H5Gdeprec.c | 10 +- src/H5Gent.c | 9 +- src/H5Gint.c | 36 +- src/H5Glink.c | 48 +- src/H5Gloc.c | 10 +- src/H5Gmodule.h | 2 +- src/H5Gname.c | 78 +- src/H5Gnode.c | 96 +-- src/H5Gobj.c | 33 +- src/H5Gpkg.h | 2 +- src/H5Gprivate.h | 2 +- src/H5Gpublic.h | 2 +- src/H5Groot.c | 4 +- src/H5Gstab.c | 39 +- src/H5Gtest.c | 3 +- src/H5Gtraverse.c | 7 +- src/H5HF.c | 65 +- src/H5HFbtree2.c | 2 +- src/H5HFcache.c | 42 +- src/H5HFdbg.c | 35 +- src/H5HFdblock.c | 45 +- src/H5HFdtable.c | 81 +- src/H5HFhdr.c | 260 +++--- src/H5HFhuge.c | 64 +- src/H5HFiblock.c | 123 ++- src/H5HFiter.c | 132 +-- src/H5HFman.c | 31 +- src/H5HFmodule.h | 2 +- src/H5HFpkg.h | 128 ++- src/H5HFprivate.h | 18 +- src/H5HFsection.c | 385 ++++----- src/H5HFspace.c | 42 +- src/H5HFstat.c | 2 +- src/H5HFtest.c | 11 +- src/H5HFtiny.c | 86 +- src/H5HG.c | 4 +- src/H5HGcache.c | 2 +- src/H5HGdbg.c | 3 +- src/H5HGmodule.h | 2 +- src/H5HGpkg.h | 2 +- src/H5HGprivate.h | 2 +- src/H5HGquery.c | 2 +- src/H5HL.c | 2 +- src/H5HLcache.c | 2 +- src/H5HLdbg.c | 2 +- src/H5HLdblk.c | 2 +- src/H5HLint.c | 2 +- src/H5HLprfx.c | 2 +- src/H5HP.c | 72 +- src/H5Imodule.h | 2 +- src/H5Ipkg.h | 2 +- src/H5Itest.c | 2 +- src/H5L.c | 97 ++- src/H5Lexternal.c | 2 +- src/H5Lmodule.h | 2 +- src/H5Lpkg.h | 24 +- src/H5Lprivate.h | 22 - src/H5Lpublic.h | 2 +- src/H5MF.c | 36 +- src/H5MFaggr.c | 10 +- src/H5MFdbg.c | 5 +- src/H5MFmodule.h | 2 +- src/H5MFpkg.h | 3 +- src/H5MFprivate.h | 3 +- src/H5MFsection.c | 17 +- src/H5MM.c | 2 +- src/H5MMprivate.h | 2 +- src/H5MMpublic.h | 6 +- src/H5MP.c | 30 +- src/H5MPmodule.h | 2 +- src/H5MPpkg.h | 2 +- src/H5MPprivate.h | 2 +- src/H5MPtest.c | 18 +- src/H5Oainfo.c | 55 +- src/H5Oalloc.c | 17 +- src/H5Oattr.c | 112 +-- src/H5Oattribute.c | 54 -- src/H5Obogus.c | 36 +- src/H5Obtreek.c | 54 +- src/H5Ocache.c | 10 +- src/H5Ocache_image.c | 36 +- src/H5Ocopy.c | 34 +- src/H5Ocopy_ref.c | 112 ++- src/H5Odbg.c | 6 +- src/H5Odrvinfo.c | 57 +- src/H5Odtype.c | 170 ++-- src/H5Oefl.c | 60 +- src/H5Ofill.c | 179 ++-- src/H5Oflush.c | 2 +- src/H5Ofsinfo.c | 248 +++--- src/H5Oginfo.c | 65 +- src/H5Oint.c | 132 ++- src/H5Olayout.c | 4 +- src/H5Olinfo.c | 46 +- src/H5Olink.c | 57 +- src/H5Omessage.c | 36 +- src/H5Omodule.h | 2 +- src/H5Omtime.c | 86 +- src/H5Oname.c | 54 +- src/H5Onull.c | 1 - src/H5Opkg.h | 5 + src/H5Opline.c | 241 +++--- src/H5Oprivate.h | 11 +- src/H5Opublic.h | 2 +- src/H5Orefcount.c | 57 +- src/H5Osdspace.c | 105 +-- src/H5Oshared.c | 6 +- src/H5Oshared.h | 2 +- src/H5Oshmesg.c | 38 +- src/H5Ostab.c | 14 +- src/H5Otest.c | 4 +- src/H5Ounknown.c | 2 +- src/H5P.c | 2 +- src/H5PBmodule.h | 2 +- src/H5Pdapl.c | 42 +- src/H5Pdcpl.c | 80 +- src/H5Pdeprec.c | 2 +- src/H5Pdxpl.c | 18 +- src/H5Pencdec.c | 6 +- src/H5Pfapl.c | 164 ++-- src/H5Pfcpl.c | 39 +- src/H5Pfmpl.c | 14 +- src/H5Pgcpl.c | 2 +- src/H5Pint.c | 6 +- src/H5Plapl.c | 8 +- src/H5Plcpl.c | 14 +- src/H5Pmodule.h | 2 +- src/H5Pocpl.c | 83 +- src/H5Pocpypl.c | 2 +- src/H5Ppkg.h | 2 +- src/H5Pstrcpl.c | 2 +- src/H5Ptest.c | 2 +- src/H5RS.c | 14 +- src/H5Rdeprec.c | 152 +++- src/H5Rint.c | 193 ----- src/H5Rpkg.h | 4 - src/H5SL.c | 101 ++- src/H5SLmodule.h | 2 +- src/H5SM.c | 127 +-- src/H5SMbtree2.c | 42 - src/H5SMcache.c | 8 +- src/H5SMmessage.c | 26 +- src/H5SMmodule.h | 2 +- src/H5SMpkg.h | 14 +- src/H5SMprivate.h | 2 +- src/H5SMtest.c | 2 +- src/H5ST.c | 72 +- src/H5Sall.c | 2 +- src/H5Sdbg.c | 1 - src/H5Sdeprec.c | 1 - src/H5Shyper.c | 10 +- src/H5Smodule.h | 2 +- src/H5Snone.c | 2 +- src/H5Spkg.h | 2 +- src/H5Sselect.c | 38 +- src/H5Stest.c | 2 +- src/H5T.c | 32 +- src/H5TSprivate.h | 2 - src/H5Tcompound.c | 12 - src/H5Tconv.c | 106 +-- src/H5Tcset.c | 8 - src/H5Tdeprec.c | 2 +- src/H5Tenum.c | 49 +- src/H5Tfields.c | 13 - src/H5Tfixed.c | 9 - src/H5Tfloat.c | 4 - src/H5Tmodule.h | 2 +- src/H5Toffset.c | 20 +- src/H5Topaque.c | 4 - src/H5Torder.c | 14 +- src/H5Tpad.c | 8 - src/H5Tpkg.h | 3 +- src/H5Tprecis.c | 24 +- src/H5Tprivate.h | 1 - src/H5Tref.c | 8 +- src/H5Tstrpad.c | 8 - src/H5Tvisit.c | 2 +- src/H5VLnative_link.c | 22 +- src/H5VLnative_object.c | 8 +- src/H5VM.c | 77 +- src/H5VMprivate.h | 112 ++- src/H5WB.c | 6 +- src/H5WBprivate.h | 2 +- src/H5Z.c | 48 +- src/H5Zdeflate.c | 20 +- src/H5Zfletcher32.c | 27 +- src/H5Zmodule.h | 2 +- src/H5Znbit.c | 268 +++--- src/H5Zprivate.h | 2 +- src/H5Zpublic.h | 2 +- src/H5Zscaleoffset.c | 192 ++--- src/H5Zshuffle.c | 34 +- src/H5Zszip.c | 50 +- src/H5Ztrans.c | 342 ++++---- src/H5checksum.c | 22 +- src/H5detect.c | 25 - src/H5private.h | 5 +- src/H5system.c | 2 - src/H5timer.c | 2 +- src/H5trace.c | 2 +- src/hdf5.lnt | 6 +- test/accum.c | 4 +- test/big.c | 4 +- test/btree2.c | 12 +- test/dsets.c | 4 +- test/earray.c | 54 +- test/fheap.c | 141 +--- test/hdfs.c | 29 +- test/mirror_vfd.c | 2 + test/pool.c | 4 +- test/swmr_addrem_writer.c | 20 - test/swmr_generator.c | 28 - test/swmr_remove_writer.c | 20 - test/swmr_sparse_writer.c | 20 - test/swmr_start_write.c | 10 - test/swmr_writer.c | 16 - test/tattr.c | 11 +- utils/mirror_vfd/mirror_remote.h | 2 + 362 files changed, 6711 insertions(+), 10270 deletions(-) create mode 100644 src/H5FDmirror_priv.h diff --git a/MANIFEST b/MANIFEST index 9720ebf..6aaf772 100644 --- a/MANIFEST +++ b/MANIFEST @@ -692,6 +692,7 @@ ./src/H5FDlog.h ./src/H5FDmirror.c ./src/H5FDmirror.h +./src/H5FDmirror_priv.h ./src/H5FDmodule.h ./src/H5FDmpi.c ./src/H5FDmpi.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 39a9e3e..022e5a3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -839,6 +839,7 @@ set (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5FApkg.h ${HDF5_SRC_DIR}/H5FAprivate.h + ${HDF5_SRC_DIR}/H5FDmirror_priv.h ${HDF5_SRC_DIR}/H5FDpkg.h ${HDF5_SRC_DIR}/H5FDprivate.h diff --git a/src/H5.c b/src/H5.c index 31b8546..4e5648a 100644 --- a/src/H5.c +++ b/src/H5.c @@ -50,9 +50,9 @@ /********************/ /* Local Prototypes */ /********************/ -static void H5_debug_mask(const char*); +static void H5__debug_mask(const char*); #ifdef H5_HAVE_PARALLEL -static int H5_mpi_delete_cb(MPI_Comm comm, int keyval, void *attr_val, int *flag); +static int H5__mpi_delete_cb(MPI_Comm comm, int keyval, void *attr_val, int *flag); #endif /*H5_HAVE_PARALLEL*/ /*********************/ @@ -139,7 +139,7 @@ H5_init_library(void) int key_val; if(MPI_SUCCESS != (mpi_code = MPI_Comm_create_keyval(MPI_COMM_NULL_COPY_FN, - (MPI_Comm_delete_attr_function *)H5_mpi_delete_cb, + (MPI_Comm_delete_attr_function *)H5__mpi_delete_cb, &key_val, NULL))) HMPI_GOTO_ERROR(FAIL, "MPI_Comm_create_keyval failed", mpi_code) @@ -219,10 +219,6 @@ H5_init_library(void) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize vol interface") if(H5P_init() < 0) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize property list interface") - if(H5T_init() < 0) - HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize datatype interface") - if(H5D_init() < 0) - HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize dataset interface") if(H5AC_init() < 0) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize metadata caching interface") if(H5L_init() < 0) @@ -235,8 +231,8 @@ H5_init_library(void) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize vol interface") /* Debugging? */ - H5_debug_mask("-all"); - H5_debug_mask(HDgetenv("HDF5_DEBUG")); + H5__debug_mask("-all"); + H5__debug_mask(HDgetenv("HDF5_DEBUG")); done: FUNC_LEAVE_NOAPI(ret_value) @@ -639,7 +635,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5_debug_mask + * Function: H5__debug_mask * * Purpose: Set runtime debugging flags according to the string S. The * string should contain file numbers and package names @@ -662,7 +658,7 @@ done: *------------------------------------------------------------------------- */ static void -H5_debug_mask(const char *s) +H5__debug_mask(const char *s) { FILE *stream = stderr; char pkg_name[32], *rest; @@ -738,12 +734,12 @@ H5_debug_mask(const char *s) return; -} /* end H5_debug_mask() */ +} /* end H5__debug_mask() */ #ifdef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- - * Function: H5_mpi_delete_cb + * Function: H5__mpi_delete_cb * * Purpose: Callback attribute on MPI_COMM_SELF to terminate the HDF5 * library when the communicator is destroyed, i.e. on MPI_Finalize. @@ -752,7 +748,7 @@ H5_debug_mask(const char *s) * *------------------------------------------------------------------------- */ -static int H5_mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void H5_ATTR_UNUSED *attr_val, int H5_ATTR_UNUSED *flag) +static int H5__mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void H5_ATTR_UNUSED *attr_val, int H5_ATTR_UNUSED *flag) { H5_term_library(); return MPI_SUCCESS; diff --git a/src/H5AC.c b/src/H5AC.c index 402f562..51e5102 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -15,7 +15,7 @@ * * Created: H5AC.c * Jul 9 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Functions in this file implement a cache for * things which exist on disk. All "things" associated @@ -239,8 +239,6 @@ H5AC_term_package(void) * * Programmer: John Mainzer, 1/10/17 * - * Changes: None. - * *------------------------------------------------------------------------- */ hbool_t @@ -275,7 +273,6 @@ H5AC_cache_image_pending(const H5F_t *f) * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 9 1997 * *------------------------------------------------------------------------- @@ -469,7 +466,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 9 1997 * *------------------------------------------------------------------------- @@ -587,7 +583,6 @@ H5AC_evict(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't evict cache") done: - /* If currently logging, generate a message */ if(f->shared->cache->log_info->logging) if(H5C_log_write_evict_cache_msg(f->shared->cache, ret_value) < 0) @@ -655,7 +650,6 @@ done: * request to flush all items and something was protected. * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 9 1997 * *------------------------------------------------------------------------- @@ -775,7 +769,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 9 1997 * *------------------------------------------------------------------------- @@ -1075,7 +1068,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 9 1997 * *------------------------------------------------------------------------- @@ -1271,7 +1263,6 @@ done: * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Sep 2 1997 * *------------------------------------------------------------------------- @@ -1509,7 +1500,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Sep 2 1997 * *------------------------------------------------------------------------- @@ -1536,8 +1526,8 @@ H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, HDassert(type->image_len); HDassert(H5F_addr_defined(addr)); HDassert(thing); - HDassert( ((H5AC_info_t *)thing)->addr == addr ); - HDassert( ((H5AC_info_t *)thing)->type == type ); + HDassert(((H5AC_info_t *)thing)->addr == addr); + HDassert(((H5AC_info_t *)thing)->type == type); dirtied = (hbool_t)(((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG) || (((H5AC_info_t *)thing)->dirtied)); diff --git a/src/H5ACdbg.c b/src/H5ACdbg.c index b40f8d0..94f3d83 100644 --- a/src/H5ACdbg.c +++ b/src/H5ACdbg.c @@ -270,10 +270,6 @@ H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr, * * Programmer: John Mainzer, 5/30/14 * - * Changes: None. - * - * JRM -- 9/17/16 - * *------------------------------------------------------------------------- */ #ifndef NDEBUG @@ -351,8 +347,6 @@ H5AC_get_serialization_in_progress(H5F_t *f) * * Programmer: John Mainzer, 6/18/16 * - * Changes: None. - * *------------------------------------------------------------------------- */ #ifndef NDEBUG diff --git a/src/H5ACmodule.h b/src/H5ACmodule.h index e218b31..8c6eae2 100644 --- a/src/H5ACmodule.h +++ b/src/H5ACmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index f097e83..c6ffc80 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -15,7 +15,7 @@ * * Created: H5ACmpio.c * Jun 20 2015 - * Quincey Koziol + * Quincey Koziol * * Purpose: Functions in this file implement support for parallel * I/O cache functionality @@ -2284,7 +2284,6 @@ H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, * request to flush all items and something was protected. * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 22 2009 * *------------------------------------------------------------------------- diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index b932e16..f6c3d6b 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -15,7 +15,7 @@ * * Created: H5ACprivate.h * Jul 9 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Constants and typedefs available to the rest of the * library. diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index a48aa69..e6f4010 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -15,12 +15,10 @@ * * Created: H5ACpublic.h * Jul 10 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Public include file for cache functions. * - * Modifications: - * *------------------------------------------------------------------------- */ #ifndef _H5ACpublic_H diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index 3377aa2..843799e 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -15,7 +15,7 @@ * * Created: H5Abtree2.c * Dec 4 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: v2 B-tree callbacks for indexing attributes on objects * @@ -152,7 +152,6 @@ const H5B2_class_t H5A_BT2_CORDER[1]={{ /* B-tree class information */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 4 2006 * *------------------------------------------------------------------------- diff --git a/src/H5Adense.c b/src/H5Adense.c index fd92e8f..ac6501a 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -15,7 +15,7 @@ * * Created: H5Adense.c * Dec 4 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Routines for operating on "dense" attribute storage * for an object. @@ -209,9 +209,6 @@ H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo) /* Retrieve the heap's address in the file */ if(H5HF_get_heap_addr(fheap, &ainfo->fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get fractal heap address") -#ifdef QAK -HDfprintf(stderr, "%s: ainfo->fheap_addr = %a\n", FUNC, ainfo->fheap_addr); -#endif /* QAK */ #ifndef NDEBUG { @@ -221,9 +218,6 @@ HDfprintf(stderr, "%s: ainfo->fheap_addr = %a\n", FUNC, ainfo->fheap_addr); if(H5HF_get_id_len(fheap, &fheap_id_len) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length") HDassert(fheap_id_len == H5O_FHEAP_ID_LEN); -#ifdef QAK -HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); -#endif /* QAK */ } #endif /* NDEBUG */ @@ -243,9 +237,6 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); /* Retrieve the v2 B-tree's address in the file */ if(H5B2_get_addr(bt2_name, &ainfo->name_bt2_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get v2 B-tree address for name index") -#ifdef QAK -HDfprintf(stderr, "%s: ainfo->name_bt2_addr = %a\n", FUNC, ainfo->name_bt2_addr); -#endif /* QAK */ /* Check if we should create a creation order index v2 B-tree */ if(ainfo->index_corder) { @@ -264,9 +255,6 @@ HDfprintf(stderr, "%s: ainfo->name_bt2_addr = %a\n", FUNC, ainfo->name_bt2_addr) /* Retrieve the v2 B-tree's address in the file */ if(H5B2_get_addr(bt2_corder, &ainfo->corder_bt2_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get v2 B-tree address for creation order index") -#ifdef QAK -HDfprintf(stderr, "%s: ainfo->corder_bt2_addr = %a\n", FUNC, ainfo->corder_bt2_addr); -#endif /* QAK */ } /* end if */ done: diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index dd5eae3..c4d8bb8 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -15,7 +15,7 @@ * * Created: H5Adeprec.c * November 27 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Deprecated functions from the H5A interface. These * functions are here for compatibility purposes and may be diff --git a/src/H5Aint.c b/src/H5Aint.c index d6ea1f4..5ecfd06 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -14,8 +14,8 @@ /*------------------------------------------------------------------------- * * Created: H5Aint.c - * Dec 18 2006 - * Quincey Koziol + * Dec 18 2006 + * Quincey Koziol * * Purpose: Internal routines for managing attributes. * @@ -2416,7 +2416,6 @@ done: * Failure: Negative * * Programmer: Peter Cao - * xcao@hdfgroup.org * July 20, 2007 * *------------------------------------------------------------------------- diff --git a/src/H5Amodule.h b/src/H5Amodule.h index 8ed056b..6b835e1 100644 --- a/src/H5Amodule.h +++ b/src/H5Amodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Apkg.h b/src/H5Apkg.h index f3870c0..39fdea3 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -263,9 +263,6 @@ H5_DLL herr_t H5O__attr_remove(const H5O_loc_t *loc, const char *name); H5_DLL herr_t H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5_iter_order_t order, hsize_t n); H5_DLL htri_t H5O__attr_exists(const H5O_loc_t *loc, const char *name); -#ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL int H5O__attr_count(const H5O_loc_t *loc); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ H5_DLL H5A_t *H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info); H5_DLL herr_t H5A__attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *mesg_src, diff --git a/src/H5B.c b/src/H5B.c index f909d90..2ab5198 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -15,7 +15,7 @@ * * Created: H5B.c * Jul 10 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Implements balanced, sibling-linked, N-ary trees * capable of storing any type of data with unique key @@ -206,7 +206,6 @@ H5FL_SEQ_DEFINE_STATIC(size_t); * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Jun 23 1997 * *------------------------------------------------------------------------- @@ -291,7 +290,6 @@ done: * UDATA is undefined). * * Programmer: Robb Matzke - * matzke@llnl.gov * Jun 23 1997 * *------------------------------------------------------------------------- @@ -387,7 +385,6 @@ done: * returned through the NEW_ADDR argument). Negative on failure. * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 3 1997 * *------------------------------------------------------------------------- @@ -542,7 +539,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jun 23 1997 * *------------------------------------------------------------------------- @@ -700,7 +696,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 8 1997 * *------------------------------------------------------------------------- @@ -789,7 +784,6 @@ H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, * Failure: H5B_INS_ERROR * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 9 1997 * *------------------------------------------------------------------------- @@ -1118,7 +1112,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jun 23 1997 * *------------------------------------------------------------------------- @@ -1185,7 +1178,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jun 23 1997 * *------------------------------------------------------------------------- @@ -1679,7 +1671,6 @@ done: * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 27 2008 * *------------------------------------------------------------------------- @@ -1786,7 +1777,6 @@ H5B_shared_free(void *_shared) * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 18 2000 * *------------------------------------------------------------------------- @@ -1852,7 +1842,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 3 2008 * *------------------------------------------------------------------------- @@ -2066,7 +2055,6 @@ done: * Failure: FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 26, 2008 * *------------------------------------------------------------------------- diff --git a/src/H5B2.c b/src/H5B2.c index 5c83de2..06806aa 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -1497,9 +1497,6 @@ H5B2_delete(H5F_t *f, haddr_t addr, void *ctx_udata, H5B2_remove_t op, HDassert(H5F_addr_defined(addr)); /* Lock the v2 B-tree header into memory */ -#ifdef QAK -HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr); -#endif /* QAK */ if(NULL == (hdr = H5B2__hdr_protect(f, addr, ctx_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect v2 B-tree header") diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 80cb6c5..3b7dd5d 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -15,7 +15,7 @@ * * Created: H5B2cache.c * Jan 31 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement v2 B-tree metadata cache methods. * @@ -171,7 +171,6 @@ const H5AC_class_t H5AC_BT2_LEAF[1] = {{ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 18, 2010 * *------------------------------------------------------------------------- @@ -240,7 +239,6 @@ H5B2__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 1 2005 * *------------------------------------------------------------------------- @@ -339,7 +337,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 20, 2010 * *------------------------------------------------------------------------- @@ -370,7 +367,6 @@ H5B2__cache_hdr_image_len(const void *_thing, size_t *image_len) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 1 2005 * *------------------------------------------------------------------------- @@ -442,7 +438,6 @@ H5B2__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le * Return: Non-negative on success/Negative on failure * * Programmer: Neil Fortner - * nfortne2@hdfgroup.org * Apr 24 2012 * *------------------------------------------------------------------------- @@ -530,7 +525,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Mike McGreevy - * mcgreevy@hdfgroup.org * June 18, 2008 * *------------------------------------------------------------------------- @@ -562,7 +556,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 18, 2010 * *------------------------------------------------------------------------- @@ -637,7 +630,6 @@ H5B2__cache_int_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, voi * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -756,7 +748,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 20, 2010 * *------------------------------------------------------------------------- @@ -788,7 +779,6 @@ H5B2__cache_int_image_len(const void *_thing, size_t *image_len) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 3 2005 * *------------------------------------------------------------------------- @@ -875,7 +865,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Neil Fortner - * nfortne2@hdfgroup.org * Apr 25 2012 * *------------------------------------------------------------------------- @@ -886,7 +875,7 @@ H5B2__cache_int_notify(H5AC_notify_action_t action, void *_thing) H5B2_internal_t *internal = (H5B2_internal_t *)_thing; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -952,7 +941,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Mike McGreevy - * mcgreevy@hdfgroup.org * June 18, 2008 * *------------------------------------------------------------------------- @@ -985,7 +973,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 18, 2010 * *------------------------------------------------------------------------- @@ -1060,7 +1047,6 @@ H5B2__cache_leaf_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -1159,7 +1145,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 20, 2010 * *------------------------------------------------------------------------- @@ -1191,7 +1176,6 @@ H5B2__cache_leaf_image_len(const void *_thing, size_t *image_len) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -1264,7 +1248,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Neil Fortner - * nfortne2@hdfgroup.org * Apr 25 2012 * *------------------------------------------------------------------------- @@ -1275,7 +1258,7 @@ H5B2__cache_leaf_notify(H5AC_notify_action_t action, void *_thing) H5B2_leaf_t *leaf = (H5B2_leaf_t *)_thing; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -1341,7 +1324,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Mike McGreevy - * mcgreevy@hdfgroup.org * June 18, 2008 * *------------------------------------------------------------------------- diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index b5b1c03..0d93ed6 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -15,7 +15,7 @@ * * Created: H5B2dbg.c * Feb 2 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Dump debugging information about a v2 B-tree. * @@ -80,7 +80,6 @@ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -175,7 +174,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 4 2005 * *------------------------------------------------------------------------- @@ -287,7 +285,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 7 2005 * *------------------------------------------------------------------------- diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index 9ba8235..fc5e7f8 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -174,7 +174,7 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, /* Compute size to store # of records in each node */ /* (uses leaf # of records because its the largest) */ - u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[0].max_nrec); + u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[0].max_nrec); H5_CHECKED_ASSIGN(hdr->max_nrec_size, uint8_t, u_max_nrec_size, unsigned) HDassert(hdr->max_nrec_size <= H5B2_SIZEOF_RECORDS_PER_NODE); @@ -190,7 +190,7 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, hdr->node_info[u].cum_max_nrec = ((hdr->node_info[u].max_nrec + 1) * hdr->node_info[u - 1].cum_max_nrec) + hdr->node_info[u].max_nrec; - u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec); + u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec); H5_CHECKED_ASSIGN(hdr->node_info[u].cum_max_nrec_size, uint8_t, u_max_nrec_size, unsigned) if(NULL == (hdr->node_info[u].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[u].max_nrec))) @@ -573,7 +573,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2015 * *------------------------------------------------------------------------- @@ -605,7 +604,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -682,7 +680,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 15 2009 * *------------------------------------------------------------------------- diff --git a/src/H5B2int.c b/src/H5B2int.c index 53ac835..3f9ae74 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -15,7 +15,7 @@ * * Created: H5B2int.c * Feb 27 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Internal routines for managing v2 B-trees. * @@ -97,7 +97,6 @@ H5FL_SEQ_EXTERN(H5B2_node_info_t); * record to locate is greater than all records to search). * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 3 2005 * *------------------------------------------------------------------------- @@ -141,7 +140,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 28 2006 * *------------------------------------------------------------------------- @@ -336,7 +334,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 3 2005 * *------------------------------------------------------------------------- @@ -370,7 +367,7 @@ H5B2__split_root(H5B2_hdr_t *hdr) hdr->node_info[hdr->depth].merge_nrec = (hdr->node_info[hdr->depth].max_nrec * hdr->merge_percent) / 100; hdr->node_info[hdr->depth].cum_max_nrec = ((hdr->node_info[hdr->depth].max_nrec + 1) * hdr->node_info[hdr->depth - 1].cum_max_nrec) + hdr->node_info[hdr->depth].max_nrec; - u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec); + u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec); H5_CHECKED_ASSIGN(hdr->node_info[hdr->depth].cum_max_nrec_size, uint8_t, u_max_nrec_size, unsigned) if(NULL == (hdr->node_info[hdr->depth].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[hdr->depth].max_nrec))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create node native key block factory") @@ -414,7 +411,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 9 2005 * *------------------------------------------------------------------------- @@ -658,7 +654,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 9 2005 * *------------------------------------------------------------------------- @@ -1032,7 +1027,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 4 2005 * *------------------------------------------------------------------------- @@ -1195,7 +1189,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 4 2005 * *------------------------------------------------------------------------- @@ -1437,7 +1430,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 23 2015 * *------------------------------------------------------------------------- @@ -1497,7 +1489,6 @@ done: * Return: Value from callback, non-negative on success, negative on error * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 11 2005 * *------------------------------------------------------------------------- @@ -1612,7 +1603,6 @@ done: * Return: Value from callback, non-negative on success, negative on error * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 9 2005 * *------------------------------------------------------------------------- @@ -1779,7 +1769,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@lbl.gov * Dec 1 2016 * *------------------------------------------------------------------------- @@ -1877,7 +1866,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@lbl.gov * Dec 1 2016 * *------------------------------------------------------------------------- diff --git a/src/H5B2internal.c b/src/H5B2internal.c index 1fee0af..82f676f 100644 --- a/src/H5B2internal.c +++ b/src/H5B2internal.c @@ -15,7 +15,7 @@ * * Created: H5B2internal.c * Dec 01 2016 - * Quincey Koziol + * Quincey Koziol * * Purpose: Routines for managing v2 B-tree internal ndoes. * @@ -87,7 +87,6 @@ H5FL_DEFINE(H5B2_internal_t); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 3 2005 * *------------------------------------------------------------------------- @@ -183,7 +182,6 @@ done: * Return: Pointer to internal node on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 25 2006 * *------------------------------------------------------------------------- @@ -277,7 +275,6 @@ done: * Return: Non-negative on success, negative on failure. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 9 2005 * *------------------------------------------------------------------------- @@ -350,7 +347,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 2 2005 * *------------------------------------------------------------------------- @@ -513,7 +509,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 24 2015 * *------------------------------------------------------------------------- @@ -782,7 +777,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 3 2005 * *------------------------------------------------------------------------- @@ -1015,7 +1009,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 14 2006 * *------------------------------------------------------------------------- @@ -1300,7 +1293,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -1349,7 +1341,6 @@ done: * Return: Non-negative on success, negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 19 2005 * *------------------------------------------------------------------------- @@ -1390,7 +1381,6 @@ H5B2__assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t H5_ATTR_NDEBUG_U * Return: Non-negative on success, negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 19 2005 * *------------------------------------------------------------------------- diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c index 1fde36d..d2cfbe0 100644 --- a/src/H5B2leaf.c +++ b/src/H5B2leaf.c @@ -15,7 +15,7 @@ * * Created: H5B2leaf.c * Dec 01 2016 - * Quincey Koziol + * Quincey Koziol * * Purpose: Routines for managing v2 B-tree leaf ndoes. * @@ -88,7 +88,6 @@ H5FL_DEFINE(H5B2_leaf_t); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -174,7 +173,6 @@ done: * Return: Pointer to leaf node on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 5 2010 * *------------------------------------------------------------------------- @@ -266,7 +264,6 @@ done: * Return: Non-negative on success, negative on failure. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 9 2005 * *------------------------------------------------------------------------- @@ -340,7 +337,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 3 2005 * *------------------------------------------------------------------------- @@ -453,7 +449,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 23 2015 * *------------------------------------------------------------------------- @@ -608,7 +603,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 4 2005 * *------------------------------------------------------------------------- @@ -765,14 +759,14 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 3 2005 * *------------------------------------------------------------------------- */ herr_t H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, - H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_remove_t op, void *op_data) + H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_remove_t op, + void *op_data) { H5B2_leaf_t *leaf; /* Pointer to leaf node */ haddr_t leaf_addr = HADDR_UNDEF; /* Leaf address on disk */ @@ -874,7 +868,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 14 2006 * *------------------------------------------------------------------------- @@ -976,7 +969,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 2 2005 * *------------------------------------------------------------------------- @@ -1021,7 +1013,6 @@ done: * Return: Non-negative on success, negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 19 2005 * *------------------------------------------------------------------------- @@ -1045,7 +1036,6 @@ H5B2__assert_leaf(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, * Return: Non-negative on success, negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 19 2005 * *------------------------------------------------------------------------- diff --git a/src/H5B2module.h b/src/H5B2module.h index 35c982c..6e8c92a 100644 --- a/src/H5B2module.h +++ b/src/H5B2module.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5B2stat.c b/src/H5B2stat.c index 5dd9cc2..5c09b3d 100644 --- a/src/H5B2stat.c +++ b/src/H5B2stat.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Monday, March 6, 2006 * * Purpose: v2 B-tree metadata statistics functions. diff --git a/src/H5B2test.c b/src/H5B2test.c index 7affd49..ee37c54 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Thursday, February 3, 2005 * * Purpose: v2 B-tree testing functions. diff --git a/src/H5Bcache.c b/src/H5Bcache.c index c2c7a80..80fb200 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -15,7 +15,7 @@ * * Created: H5Bcache.c * Oct 31 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement B-tree metadata cache methods. * @@ -98,7 +98,6 @@ const H5AC_class_t H5AC_BT[1] = {{ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 18, 2010 * *------------------------------------------------------------------------- @@ -135,7 +134,6 @@ H5B__cache_get_initial_load_size(void *_udata, size_t *image_len) * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 24, 2008 * *------------------------------------------------------------------------- @@ -241,7 +239,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 20, 2010 * *------------------------------------------------------------------------- @@ -277,7 +274,6 @@ H5B__cache_image_len(const void *_thing, size_t *image_len) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 24, 2008 * *------------------------------------------------------------------------- @@ -363,7 +359,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 26, 2008 * *------------------------------------------------------------------------- diff --git a/src/H5C.c b/src/H5C.c index 91e4158..fd4386c 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -147,11 +147,11 @@ static herr_t H5C__flash_increase_cache_size(H5C_t * cache_ptr, static herr_t H5C__flush_invalidate_cache(H5F_t *f, unsigned flags); -static herr_t H5C_flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags); +static herr_t H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags); static herr_t H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags); -static void * H5C_load_entry(H5F_t * f, +static void * H5C__load_entry(H5F_t * f, #ifdef H5_HAVE_PARALLEL hbool_t coll_access, #endif /* H5_HAVE_PARALLEL */ @@ -166,19 +166,20 @@ static herr_t H5C__mark_flush_dep_clean(H5C_cache_entry_t * entry); static herr_t H5C__serialize_ring(H5F_t *f, H5C_ring_t ring); static herr_t H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr); - +static herr_t H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, + H5C_cache_entry_t *entry_ptr); static herr_t H5C__verify_len_eoa(H5F_t *f, const H5C_class_t * type, haddr_t addr, size_t *len, hbool_t actual); #if H5C_DO_SLIST_SANITY_CHECKS -static hbool_t H5C_entry_in_skip_list(H5C_t * cache_ptr, +static hbool_t H5C__entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr); #endif /* H5C_DO_SLIST_SANITY_CHECKS */ #if H5C_DO_EXTREME_SANITY_CHECKS -static herr_t H5C_validate_lru_list(H5C_t * cache_ptr); -static herr_t H5C_validate_pinned_entry_list(H5C_t * cache_ptr); -static herr_t H5C_validate_protected_entry_list(H5C_t * cache_ptr); +static herr_t H5C__validate_lru_list(H5C_t * cache_ptr); +static herr_t H5C__validate_pinned_entry_list(H5C_t * cache_ptr); +static herr_t H5C__validate_protected_entry_list(H5C_t * cache_ptr); #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ #ifndef NDEBUG @@ -406,17 +407,17 @@ H5C_create(size_t max_cache_size, (cache_ptr->resize_ctl).max_increment = H5C__DEF_AR_MAX_INCREMENT; (cache_ptr->resize_ctl).flash_incr_mode = H5C_flash_incr__off; - (cache_ptr->resize_ctl).flash_multiple = 1.0f; - (cache_ptr->resize_ctl).flash_threshold = 0.25f; + (cache_ptr->resize_ctl).flash_multiple = (double)1.0f; + (cache_ptr->resize_ctl).flash_threshold = (double)0.25f; (cache_ptr->resize_ctl).decr_mode = H5C_decr__off; - (cache_ptr->resize_ctl).upper_hr_threshold = H5C__DEF_AR_UPPER_THRESHHOLD; - (cache_ptr->resize_ctl).decrement = H5C__DEF_AR_DECREMENT; + (cache_ptr->resize_ctl).upper_hr_threshold = (double)H5C__DEF_AR_UPPER_THRESHHOLD; + (cache_ptr->resize_ctl).decrement = (double)H5C__DEF_AR_DECREMENT; (cache_ptr->resize_ctl).apply_max_decrement = TRUE; (cache_ptr->resize_ctl).max_decrement = H5C__DEF_AR_MAX_DECREMENT; (cache_ptr->resize_ctl).epochs_before_eviction = H5C__DEF_AR_EPCHS_B4_EVICT; (cache_ptr->resize_ctl).apply_empty_reserve = TRUE; - (cache_ptr->resize_ctl).empty_reserve = H5C__DEF_AR_EMPTY_RESERVE; + (cache_ptr->resize_ctl).empty_reserve = (double)H5C__DEF_AR_EMPTY_RESERVE; cache_ptr->epoch_markers_active = 0; @@ -691,7 +692,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, /*------------------------------------------------------------------------- - * Function: H5C_free_tag_list_cb + * Function: H5C__free_tag_list_cb * * Purpose: Callback function to free tag nodes from the skip list. * @@ -703,11 +704,11 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, *------------------------------------------------------------------------- */ static herr_t -H5C_free_tag_list_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data) +H5C__free_tag_list_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data) { H5C_tag_info_t *tag_info = (H5C_tag_info_t *)_item; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(tag_info); @@ -715,7 +716,7 @@ H5C_free_tag_list_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED tag_info = H5FL_FREE(H5C_tag_info_t, tag_info); FUNC_LEAVE_NOAPI(0) -} /* H5C_free_tag_list_cb() */ +} /* H5C__free_tag_list_cb() */ /*------------------------------------------------------------------------- @@ -863,7 +864,7 @@ H5C_dest(H5F_t * f) } /* end if */ if(cache_ptr->tag_list != NULL) { - H5SL_destroy(cache_ptr->tag_list, H5C_free_tag_list_cb, NULL); + H5SL_destroy(cache_ptr->tag_list, H5C__free_tag_list_cb, NULL); cache_ptr->tag_list = NULL; } /* end if */ @@ -951,7 +952,7 @@ H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flag HDassert(H5F_addr_defined(addr)); #if H5C_DO_EXTREME_SANITY_CHECKS - if(H5C_validate_lru_list(cache_ptr) < 0) + if(H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -986,7 +987,7 @@ H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flag done: #if H5C_DO_EXTREME_SANITY_CHECKS - if(H5C_validate_lru_list(cache_ptr) < 0) + if(H5C__validate_lru_list(cache_ptr) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1094,9 +1095,9 @@ H5C_flush_cache(H5F_t *f, unsigned flags) #endif /* H5C_DO_SANITY_CHECKS */ #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1277,9 +1278,9 @@ H5C_insert_entry(H5F_t * f, #if H5C_DO_EXTREME_SANITY_CHECKS /* no need to verify that entry is not already in the index as */ /* we already make that check below. */ - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1468,9 +1469,9 @@ H5C_insert_entry(H5F_t * f, H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, FAIL) #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed just before done") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1500,9 +1501,9 @@ H5C_insert_entry(H5F_t * f, done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1828,9 +1829,9 @@ H5C_move_entry(H5C_t * cache_ptr, HDassert(H5F_addr_ne(old_addr, new_addr)); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1932,9 +1933,9 @@ H5C_move_entry(H5C_t * cache_ptr, done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1981,8 +1982,8 @@ H5C_resize_entry(void *thing, size_t new_size) HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "Entry isn't pinned or protected??") #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2081,8 +2082,8 @@ H5C_resize_entry(void *thing, size_t new_size) done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0)) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2123,9 +2124,9 @@ H5C_pin_protected_entry(void *thing) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2140,9 +2141,9 @@ H5C_pin_protected_entry(void *thing) done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2210,9 +2211,9 @@ H5C_protect(H5F_t * f, HDassert( H5F_addr_defined(addr) ); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2338,7 +2339,7 @@ H5C_protect(H5F_t * f, hit = FALSE; - if(NULL == (thing = H5C_load_entry(f, + if(NULL == (thing = H5C__load_entry(f, #ifdef H5_HAVE_PARALLEL coll_access, #endif /* H5_HAVE_PARALLEL */ @@ -2592,9 +2593,9 @@ H5C_protect(H5F_t * f, done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2910,9 +2911,9 @@ H5C_unpin_entry(void *_entry_ptr) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2923,9 +2924,9 @@ H5C_unpin_entry(void *_entry_ptr) done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -3012,9 +3013,9 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) was_clean = ! ( entry_ptr->is_dirty ); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -3211,9 +3212,9 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) done: #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) { + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) { HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -3958,7 +3959,7 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) enum H5C_resize_status status = in_spec; /* will change if needed */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( f ); HDassert( cache_ptr ); @@ -4274,7 +4275,7 @@ H5C__autoadjust__ageout(H5F_t * f, double hit_rate, enum H5C_resize_status * sta size_t test_size; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( f ); HDassert( cache_ptr ); @@ -4375,10 +4376,10 @@ done: static herr_t H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ int i; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -4492,7 +4493,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte H5C_cache_entry_t * prev_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( f ); HDassert( cache_ptr ); @@ -4675,10 +4676,10 @@ done: static herr_t H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ int i; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -4745,11 +4746,11 @@ done: static herr_t H5C__autoadjust__ageout__remove_all_markers(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ - int i; int ring_buf_index; + int i; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -4822,11 +4823,11 @@ done: static herr_t H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ - int i; int ring_buf_index; + int i; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -4912,7 +4913,7 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, double hit_rate; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -5128,7 +5129,7 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) */ ring = H5C_RING_USER; while(ring < H5C_RING_NTYPES) { - if(H5C_flush_invalidate_ring(f, ring, flags) < 0) + if(H5C__flush_invalidate_ring(f, ring, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate ring failed") ring++; } /* end while */ @@ -5176,7 +5177,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5C_flush_invalidate_ring + * Function: H5C__flush_invalidate_ring * * Purpose: Flush and destroy the entries contained in the target * cache and ring. @@ -5212,7 +5213,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) +H5C__flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) { H5C_t *cache_ptr; hbool_t restart_slist_scan; @@ -5231,7 +5232,7 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) #endif /* H5C_DO_SANITY_CHECKS */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC HDassert(f); HDassert(f->shared); @@ -5326,7 +5327,7 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) * This flag is set to TRUE by H5C__flush_single_entry if the slist * is modified by a pre_serialize, serialize, or notify callback. * - * H5C_flush_invalidate_ring() uses this flag to detect any + * H5C__flush_invalidate_ring() uses this flag to detect any * modifications to the slist that might corrupt the scan of * the slist -- and restart the scan in this event. */ @@ -5622,7 +5623,7 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_flush_invalidate_ring() */ +} /* H5C__flush_invalidate_ring() */ /*------------------------------------------------------------------------- @@ -5679,9 +5680,9 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) HDassert(ring < H5C_RING_NTYPES); #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -6477,7 +6478,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5C_load_entry + * Function: H5C__load_entry * * Purpose: Attempt to load the entry at the specified disk address * and with the specified type into memory. If successful. @@ -6494,7 +6495,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5C_load_entry(H5F_t * f, +H5C__load_entry(H5F_t * f, #ifdef H5_HAVE_PARALLEL hbool_t coll_access, #endif /* H5_HAVE_PARALLEL */ @@ -6514,7 +6515,7 @@ H5C_load_entry(H5F_t * f, #endif /* H5_HAVE_PARALLEL */ void * ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(f); @@ -6812,7 +6813,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_load_entry() */ +} /* H5C__load_entry() */ /*------------------------------------------------------------------------- @@ -7160,7 +7161,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5C_validate_lru_list + * Function: H5C__validate_lru_list * * Purpose: Debugging function that scans the LRU list for errors. * @@ -7172,123 +7173,73 @@ done: * * Programmer: John Mainzer, 7/14/05 * - * Changes: - * - * Added code to verify that the LRU contains no pinned - * entries. JRM -- 4/25/14 - * *------------------------------------------------------------------------- */ #if H5C_DO_EXTREME_SANITY_CHECKS - static herr_t -H5C_validate_lru_list(H5C_t * cache_ptr) +H5C__validate_lru_list(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ int32_t len = 0; size_t size = 0; H5C_cache_entry_t * entry_ptr = NULL; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT - - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + FUNC_ENTER_STATIC - if ( ( ( cache_ptr->LRU_head_ptr == NULL ) - || - ( cache_ptr->LRU_tail_ptr == NULL ) - ) - && - ( cache_ptr->LRU_head_ptr != cache_ptr->LRU_tail_ptr ) - ) { + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + if(((cache_ptr->LRU_head_ptr == NULL) || (cache_ptr->LRU_tail_ptr == NULL)) + && (cache_ptr->LRU_head_ptr != cache_ptr->LRU_tail_ptr)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 1 failed") - } if(cache_ptr->LRU_list_len < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 2 failed") - if ( ( cache_ptr->LRU_list_len == 1 ) - && - ( ( cache_ptr->LRU_head_ptr != cache_ptr->LRU_tail_ptr ) - || - ( cache_ptr->LRU_head_ptr == NULL ) - || - ( cache_ptr->LRU_head_ptr->size != cache_ptr->LRU_list_size ) - ) - ) { - + if((cache_ptr->LRU_list_len == 1) && + ((cache_ptr->LRU_head_ptr != cache_ptr->LRU_tail_ptr) || + (cache_ptr->LRU_head_ptr == NULL) || (cache_ptr->LRU_head_ptr->size != cache_ptr->LRU_list_size))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 3 failed") - } - - if ( ( cache_ptr->LRU_list_len >= 1 ) - && - ( ( cache_ptr->LRU_head_ptr == NULL ) - || - ( cache_ptr->LRU_head_ptr->prev != NULL ) - || - ( cache_ptr->LRU_tail_ptr == NULL ) - || - ( cache_ptr->LRU_tail_ptr->next != NULL ) - ) - ) { + if((cache_ptr->LRU_list_len >= 1) && + ((cache_ptr->LRU_head_ptr == NULL) || (cache_ptr->LRU_head_ptr->prev != NULL) + || (cache_ptr->LRU_tail_ptr == NULL) || (cache_ptr->LRU_tail_ptr->next != NULL))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 4 failed") - } entry_ptr = cache_ptr->LRU_head_ptr; - while ( entry_ptr != NULL ) - { - - if ( ( entry_ptr != cache_ptr->LRU_head_ptr ) && - ( ( entry_ptr->prev == NULL ) || - ( entry_ptr->prev->next != entry_ptr ) ) ) { - + while(entry_ptr != NULL) { + if((entry_ptr != cache_ptr->LRU_head_ptr) && + ((entry_ptr->prev == NULL) || (entry_ptr->prev->next != entry_ptr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 5 failed") - } - - if ( ( entry_ptr != cache_ptr->LRU_tail_ptr ) && - ( ( entry_ptr->next == NULL ) || - ( entry_ptr->next->prev != entry_ptr ) ) ) { + if((entry_ptr != cache_ptr->LRU_tail_ptr) && + ((entry_ptr->next == NULL) || (entry_ptr->next->prev != entry_ptr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 6 failed") - } - - if ( ( entry_ptr->is_pinned ) || - ( entry_ptr->pinned_from_client ) || - ( entry_ptr->pinned_from_cache ) ) { + if((entry_ptr->is_pinned) || + (entry_ptr->pinned_from_client) || (entry_ptr->pinned_from_cache)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 7 failed") - } len++; size += entry_ptr->size; entry_ptr = entry_ptr->next; } - if ( ( cache_ptr->LRU_list_len != len ) || - ( cache_ptr->LRU_list_size != size ) ) { - + if((cache_ptr->LRU_list_len != len) || (cache_ptr->LRU_list_size != size)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 8 failed") - } done: - - if ( ret_value != SUCCEED ) { - + if(ret_value != SUCCEED) HDassert(0); - } FUNC_LEAVE_NOAPI(ret_value) - -} /* H5C_validate_lru_list() */ - +} /* H5C__validate_lru_list() */ #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /*------------------------------------------------------------------------- * - * Function: H5C_validate_pinned_entry_list + * Function: H5C__validate_pinned_entry_list * * Purpose: Debugging function that scans the pinned entry list for * errors. @@ -7301,126 +7252,78 @@ done: * * Programmer: John Mainzer, 4/25/14 * - * Changes: - * - * None. - * *------------------------------------------------------------------------- */ #if H5C_DO_EXTREME_SANITY_CHECKS - static herr_t -H5C_validate_pinned_entry_list(H5C_t * cache_ptr) +H5C__validate_pinned_entry_list(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ int32_t len = 0; size_t size = 0; H5C_cache_entry_t * entry_ptr = NULL; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT - - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + FUNC_ENTER_STATIC - if ( ( ( cache_ptr->pel_head_ptr == NULL ) - || - ( cache_ptr->pel_tail_ptr == NULL ) - ) - && - ( cache_ptr->pel_head_ptr != cache_ptr->pel_tail_ptr ) - ) { + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + if(((cache_ptr->pel_head_ptr == NULL) || (cache_ptr->pel_tail_ptr == NULL)) + && (cache_ptr->pel_head_ptr != cache_ptr->pel_tail_ptr)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 1 failed") - } if(cache_ptr->pel_len < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 2 failed") - if ( ( cache_ptr->pel_len == 1 ) - && - ( ( cache_ptr->pel_head_ptr != cache_ptr->pel_tail_ptr ) - || - ( cache_ptr->pel_head_ptr == NULL ) - || - ( cache_ptr->pel_head_ptr->size != cache_ptr->pel_size ) - ) - ) { - + if((cache_ptr->pel_len == 1) && + ((cache_ptr->pel_head_ptr != cache_ptr->pel_tail_ptr) || + (cache_ptr->pel_head_ptr == NULL) || + (cache_ptr->pel_head_ptr->size != cache_ptr->pel_size))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 3 failed") - } - - if ( ( cache_ptr->pel_len >= 1 ) - && - ( ( cache_ptr->pel_head_ptr == NULL ) - || - ( cache_ptr->pel_head_ptr->prev != NULL ) - || - ( cache_ptr->pel_tail_ptr == NULL ) - || - ( cache_ptr->pel_tail_ptr->next != NULL ) - ) - ) { + if((cache_ptr->pel_len >= 1) && + ((cache_ptr->pel_head_ptr == NULL) || + (cache_ptr->pel_head_ptr->prev != NULL) || + (cache_ptr->pel_tail_ptr == NULL) || + (cache_ptr->pel_tail_ptr->next != NULL))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 4 failed") - } entry_ptr = cache_ptr->pel_head_ptr; - while ( entry_ptr != NULL ) - { - - if ( ( entry_ptr != cache_ptr->pel_head_ptr ) && - ( ( entry_ptr->prev == NULL ) || - ( entry_ptr->prev->next != entry_ptr ) ) ) { - + while(entry_ptr != NULL) { + if((entry_ptr != cache_ptr->pel_head_ptr) && + ((entry_ptr->prev == NULL) || (entry_ptr->prev->next != entry_ptr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 5 failed") - } - - if ( ( entry_ptr != cache_ptr->pel_tail_ptr ) && - ( ( entry_ptr->next == NULL ) || - ( entry_ptr->next->prev != entry_ptr ) ) ) { + if((entry_ptr != cache_ptr->pel_tail_ptr) && + ((entry_ptr->next == NULL) || (entry_ptr->next->prev != entry_ptr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 6 failed") - } - - if ( ! entry_ptr->is_pinned ) { + if(!entry_ptr->is_pinned) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 7 failed") - } - - if ( ! ( ( entry_ptr->pinned_from_client ) || - ( entry_ptr->pinned_from_cache ) ) ) { + if(!(entry_ptr->pinned_from_client || entry_ptr->pinned_from_cache)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 8 failed") - } len++; size += entry_ptr->size; entry_ptr = entry_ptr->next; } - if ( ( cache_ptr->pel_len != len ) || - ( cache_ptr->pel_size != size ) ) { - + if((cache_ptr->pel_len != len) || (cache_ptr->pel_size != size)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 9 failed") - } done: - - if ( ret_value != SUCCEED ) { - + if(ret_value != SUCCEED) HDassert(0); - } FUNC_LEAVE_NOAPI(ret_value) - -} /* H5C_validate_pinned_entry_list() */ - +} /* H5C__validate_pinned_entry_list() */ #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /*------------------------------------------------------------------------- * - * Function: H5C_validate_protected_entry_list + * Function: H5C__validate_protected_entry_list * * Purpose: Debugging function that scans the protected entry list for * errors. @@ -7433,26 +7336,21 @@ done: * * Programmer: John Mainzer, 4/25/14 * - * Changes: - * - * None. - * *------------------------------------------------------------------------- */ #if H5C_DO_EXTREME_SANITY_CHECKS - static herr_t -H5C_validate_protected_entry_list(H5C_t * cache_ptr) +H5C__validate_protected_entry_list(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ int32_t len = 0; size_t size = 0; H5C_cache_entry_t * entry_ptr = NULL; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); if(((cache_ptr->pl_head_ptr == NULL) || (cache_ptr->pl_tail_ptr == NULL)) && (cache_ptr->pl_head_ptr != cache_ptr->pl_tail_ptr)) @@ -7461,91 +7359,55 @@ H5C_validate_protected_entry_list(H5C_t * cache_ptr) if(cache_ptr->pl_len < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 2 failed") - if ( ( cache_ptr->pl_len == 1 ) - && - ( ( cache_ptr->pl_head_ptr != cache_ptr->pl_tail_ptr ) - || - ( cache_ptr->pl_head_ptr == NULL ) - || - ( cache_ptr->pl_head_ptr->size != cache_ptr->pl_size ) - ) - ) { - + if((cache_ptr->pl_len == 1) && + ((cache_ptr->pl_head_ptr != cache_ptr->pl_tail_ptr) || + (cache_ptr->pl_head_ptr == NULL) || + (cache_ptr->pl_head_ptr->size != cache_ptr->pl_size))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 3 failed") - } - - if ( ( cache_ptr->pl_len >= 1 ) - && - ( ( cache_ptr->pl_head_ptr == NULL ) - || - ( cache_ptr->pl_head_ptr->prev != NULL ) - || - ( cache_ptr->pl_tail_ptr == NULL ) - || - ( cache_ptr->pl_tail_ptr->next != NULL ) - ) - ) { + if((cache_ptr->pl_len >= 1) && + ((cache_ptr->pl_head_ptr == NULL) || + (cache_ptr->pl_head_ptr->prev != NULL) || + (cache_ptr->pl_tail_ptr == NULL) || + (cache_ptr->pl_tail_ptr->next != NULL))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 4 failed") - } entry_ptr = cache_ptr->pl_head_ptr; - while ( entry_ptr != NULL ) - { - - if ( ( entry_ptr != cache_ptr->pl_head_ptr ) && - ( ( entry_ptr->prev == NULL ) || - ( entry_ptr->prev->next != entry_ptr ) ) ) { - + while(entry_ptr != NULL) { + if((entry_ptr != cache_ptr->pl_head_ptr) && + ((entry_ptr->prev == NULL) || (entry_ptr->prev->next != entry_ptr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 5 failed") - } - - if ( ( entry_ptr != cache_ptr->pl_tail_ptr ) && - ( ( entry_ptr->next == NULL ) || - ( entry_ptr->next->prev != entry_ptr ) ) ) { + if((entry_ptr != cache_ptr->pl_tail_ptr) && + ((entry_ptr->next == NULL) || (entry_ptr->next->prev != entry_ptr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 6 failed") - } - - if ( ! entry_ptr->is_protected ) { + if(!entry_ptr->is_protected) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 7 failed") - } - - if ( ( entry_ptr->is_read_only ) && - ( entry_ptr->ro_ref_count <= 0 ) ) { + if(entry_ptr->is_read_only && (entry_ptr->ro_ref_count <= 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 8 failed") - } len++; size += entry_ptr->size; entry_ptr = entry_ptr->next; } - if ( ( cache_ptr->pl_len != len ) || - ( cache_ptr->pl_size != size ) ) { - + if((cache_ptr->pl_len != len) || (cache_ptr->pl_size != size)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 9 failed") - } done: - - if ( ret_value != SUCCEED ) { - + if(ret_value != SUCCEED) HDassert(0); - } FUNC_LEAVE_NOAPI(ret_value) - -} /* H5C_validate_protected_entry_list() */ - +} /* H5C__validate_protected_entry_list() */ #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /*------------------------------------------------------------------------- * - * Function: H5C_entry_in_skip_list + * Function: H5C__entry_in_skip_list * * Purpose: Debugging function that scans skip list to see if it * is in present. We need this, as it is possible for @@ -7556,49 +7418,39 @@ done: * * Programmer: John Mainzer, 11/1/14 * - * Changes: - * - * None. - * *------------------------------------------------------------------------- */ #if H5C_DO_SLIST_SANITY_CHECKS - static hbool_t -H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr) +H5C__entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr) { - hbool_t in_slist = FALSE; - H5SL_node_t * node_ptr = NULL; - H5C_cache_entry_t * entry_ptr = NULL; + H5SL_node_t *node_ptr; + hbool_t in_slist; - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( cache_ptr->slist_ptr ); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(cache_ptr->slist_ptr); node_ptr = H5SL_first(cache_ptr->slist_ptr); + in_slist = FALSE; + while((node_ptr != NULL) && (!in_slist)) { + H5C_cache_entry_t *entry_ptr; - while ( ( node_ptr != NULL ) && ( ! in_slist ) ) - { entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - HDassert( entry_ptr ); - HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); - HDassert( entry_ptr->is_dirty ); - HDassert( entry_ptr->in_slist ); - - if ( entry_ptr == target_ptr ) { + HDassert(entry_ptr); + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(entry_ptr->is_dirty); + HDassert(entry_ptr->in_slist); + if(entry_ptr == target_ptr) in_slist = TRUE; - - } else { - + else node_ptr = H5SL_next(node_ptr); - } } return(in_slist); - -} /* H5C_entry_in_skip_list() */ +} /* H5C__entry_in_skip_list() */ #endif /* H5C_DO_SLIST_SANITY_CHECKS */ @@ -8062,9 +7914,9 @@ H5C__serialize_cache(H5F_t *f) #endif /* H5C_DO_SANITY_CHECKS */ #if H5C_DO_EXTREME_SANITY_CHECKS - if((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || - (H5C_validate_lru_list(cache_ptr) < 0)) + if((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || + (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -8502,7 +8354,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) { haddr_t new_addr = HADDR_UNDEF; @@ -8511,7 +8363,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) unsigned serialize_flags = H5C__SERIALIZE_NO_FLAGS_SET; herr_t ret_value = SUCCEED; - FUNC_ENTER_PACKAGE + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); diff --git a/src/H5CS.c b/src/H5CS.c index 3fccce4..324d383 100644 --- a/src/H5CS.c +++ b/src/H5CS.c @@ -123,8 +123,6 @@ H5CS__get_stack(void) * Programmer: Quincey Koziol * Thursday, February 6, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -214,8 +212,6 @@ H5CS_push(const char *func_name) * Programmer: Quincey Koziol * Thursday, February 6, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5CX.c b/src/H5CX.c index b78d9ec..6beaf56 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, February 19, 2018 * * Purpose: diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index d5599f2..425bda3 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -1086,74 +1086,6 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED * cache_ptr) return; } /* H5C_stats__reset() */ -extern void -H5C__dump_entry(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr, - hbool_t dump_parents, const char *prefix, int indent); - -static void -H5C__dump_parents(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr, const char *prefix, int indent) -{ - unsigned u; - - for(u = 0; u < entry_ptr->flush_dep_nparents; u++) - H5C__dump_entry(cache_ptr, entry_ptr->flush_dep_parent[u], TRUE, prefix, indent + 2); -} - -typedef struct H5C__dump_child_ctx_t { - H5C_t *cache_ptr; - const H5C_cache_entry_t *parent; - hbool_t dump_parents; - const char *prefix; - int indent; -} H5C__dump_child_ctx_t; - -static int -H5C__dump_children_cb(H5C_cache_entry_t *entry_ptr, void *_ctx) -{ - H5C__dump_child_ctx_t *ctx = (H5C__dump_child_ctx_t *)_ctx; - - if(entry_ptr->tag_info->tag != entry_ptr->addr) { - unsigned u; - - HDassert(entry_ptr->flush_dep_nparents); - for(u = 0; u < entry_ptr->flush_dep_nparents; u++) - if(ctx->parent == entry_ptr->flush_dep_parent[u]) - H5C__dump_entry(ctx->cache_ptr, entry_ptr, ctx->dump_parents, ctx->prefix, ctx->indent + 2); - } /* end if */ - - return(H5_ITER_CONT); -} /* end H5C__dump_children_cb() */ - -static void -H5C__dump_children(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr, - hbool_t dump_parents, const char *prefix, int indent) -{ - H5C__dump_child_ctx_t ctx; - - HDassert(entry_ptr->tag_info); - - ctx.cache_ptr = cache_ptr; - ctx.parent = entry_ptr; - ctx.dump_parents = dump_parents; - ctx.prefix = prefix; - ctx.indent = indent; - H5C__iter_tagged_entries(cache_ptr, entry_ptr->tag_info->tag, FALSE, H5C__dump_children_cb, &ctx); -} /* end H5C__dump_children() */ - -void -H5C__dump_entry(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr, - hbool_t dump_parents, const char *prefix, int indent) -{ - HDassert(cache_ptr); - HDassert(entry_ptr); - - HDfprintf(stderr, "%*s%s: entry_ptr = (%a, '%s', %a, %t, %u, %u/%u)\n", indent, "", prefix, entry_ptr->addr, entry_ptr->type->name, entry_ptr->tag_info ? entry_ptr->tag_info->tag : HADDR_UNDEF, entry_ptr->is_dirty, entry_ptr->flush_dep_nparents, entry_ptr->flush_dep_nchildren, entry_ptr->flush_dep_ndirty_children); - if(dump_parents && entry_ptr->flush_dep_nparents) - H5C__dump_parents(cache_ptr, entry_ptr, "Parent", indent); - if(entry_ptr->flush_dep_nchildren) - H5C__dump_children(cache_ptr, entry_ptr, FALSE, "Child", indent); -} /* end H5C__dump_entry() */ - /*------------------------------------------------------------------------- * Function: H5C_flush_dependency_exists() diff --git a/src/H5Cimage.c b/src/H5Cimage.c index ee286d9..26cbe7d 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -864,54 +864,6 @@ H5C__free_image_entries_array(H5C_t * cache_ptr) /*------------------------------------------------------------------------- - * Function: H5C_force_cache_image_load() - * - * Purpose: On rare occasions, it is necessary to run - * H5MF_tidy_self_referential_fsm_hack() prior to the first - * metadata cache access. This is a problem as if there is a - * cache image at the end of the file, that routine will - * discard it. - * - * We solve this issue by calling this function, which will - * load the cache image and then call - * H5MF_tidy_self_referential_fsm_hack() to discard it. - * - * Return: SUCCEED on success, and FAIL on failure. - * - * Programmer: John Mainzer - * 1/11/17 - * - *------------------------------------------------------------------------- - */ -herr_t -H5C_force_cache_image_load(H5F_t *f) -{ - H5C_t *cache_ptr; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(cache_ptr->load_image); - - /* Load the cache image, if requested */ - if(cache_ptr->load_image) { - cache_ptr->load_image = FALSE; - if(H5C__load_cache_image(f) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "can't load cache image") - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_force_cache_image_load() */ - - -/*------------------------------------------------------------------------- * Function: H5C_get_cache_image_config * * Purpose: Copy the current configuration for cache image generation diff --git a/src/H5Cmodule.h b/src/H5Cmodule.h index 534404d..5b23490 100644 --- a/src/H5Cmodule.h +++ b/src/H5Cmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 8712af5..22c67ce 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -4911,8 +4911,6 @@ H5_DLL herr_t H5C__mark_flush_dep_unserialized(H5C_cache_entry_t * entry_ptr); H5_DLL herr_t H5C__make_space_in_cache(H5F_t * f, size_t space_needed, hbool_t write_permitted); H5_DLL herr_t H5C__flush_marked_entries(H5F_t * f); -H5_DLL herr_t H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, - H5C_cache_entry_t *entry_ptr); H5_DLL herr_t H5C__serialize_cache(H5F_t *f); H5_DLL herr_t H5C__iter_tagged_entries(H5C_t *cache, haddr_t tag, hbool_t match_global, H5C_tag_iter_cb_t cb, void *cb_ctx); diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 0ba0234..f82f8df 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -20,8 +20,6 @@ * Purpose: Constants and typedefs available to the rest of the * library. * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -2243,7 +2241,6 @@ H5_DLL herr_t H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flags); H5_DLL herr_t H5C_flush_cache(H5F_t *f, unsigned flags); H5_DLL herr_t H5C_flush_tagged_entries(H5F_t *f, haddr_t tag); -H5_DLL herr_t H5C_force_cache_image_load(H5F_t * f); H5_DLL herr_t H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, hbool_t match_global); H5_DLL herr_t H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags); H5_DLL herr_t H5C_get_tag(const void *thing, /*OUT*/ haddr_t *tag); diff --git a/src/H5Cpublic.h b/src/H5Cpublic.h index 62107d9..565f41b 100644 --- a/src/H5Cpublic.h +++ b/src/H5Cpublic.h @@ -19,8 +19,6 @@ * * Purpose: Public include file for cache functions. * - * Modifications: - * *------------------------------------------------------------------------- */ #ifndef _H5Cpublic_H diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index 098e01b..c80f90a 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Wednesday, October 8, 1997 * * Purpose: v1 B-tree indexed (chunked) I/O functions. The chunks are @@ -338,7 +338,7 @@ H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key) HDassert(udata->layout->ndims > 0 && udata->layout->ndims <= H5O_LAYOUT_NDIMS); /* Compare the offsets but ignore the other fields */ - ret_value = H5VM_vector_cmp_u(udata->layout->ndims, lt_key->scaled, rt_key->scaled); + ret_value = H5VM__vector_cmp_u(udata->layout->ndims, lt_key->scaled, rt_key->scaled); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__btree_cmp2() */ @@ -620,8 +620,7 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * March 28, 2002 * *------------------------------------------------------------------------- diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index ccb786b..b9cf6cd 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -112,7 +112,7 @@ static herr_t H5D__bt2_found_cb(const void *nrecord, void *op_data); */ static herr_t H5D__bt2_remove_cb(const void *nrecord, void *_udata); -/* Callback for H5B2_modify() which is called in H5D__bt2_idx_insert() */ +/* Callback for H5B2_update() which is called in H5D__bt2_idx_insert() */ static herr_t H5D__bt2_mod_cb(void *_record, void *_op_data, hbool_t *changed); /* Chunked layout indexing callbacks for v2 B-tree indexing */ @@ -256,7 +256,7 @@ H5D__bt2_crt_context(void *_udata) * Compute the size required for encoding the size of a chunk, * allowing for an extra byte, in case the filter makes the chunk larger. */ - ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8); + ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8); if(ctx->chunk_size_len > 8) ctx->chunk_size_len = 8; @@ -355,7 +355,7 @@ H5D__bt2_compare(const void *_udata, const void *_rec2, int *result) HDassert(rec2); /* Compare the offsets but ignore the other fields */ - *result = H5VM_vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled); + *result = H5VM__vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled); FUNC_LEAVE_NOAPI(ret_value) } /* H5D__bt2_compare() */ @@ -773,7 +773,7 @@ H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info) * Compute the size required for encoding the size of a chunk, * allowing for an extra byte, in case the filter makes the chunk larger. */ - chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); + chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); if(chunk_size_len > 8) chunk_size_len = 8; @@ -837,7 +837,7 @@ H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage) * Function: H5D__bt2_mod_cb * * Purpose: Modify record for dataset chunk when it is found in a v2 B-tree. - * This is the callback for H5B2_modify() which is called in + * This is the callback for H5B2_update() which is called in * H5D__bt2_idx_insert(). * * Return: Success: non-negative @@ -1266,13 +1266,6 @@ done: * * Programmer: Vailin Choi; June 2010 * - * Modifications: - * Vailin Choi; March 2011 - * Initialize size of an unfiltered chunk. - * This is a fix for for the assertion failure in: - * [src/H5FSsection.c:968: H5FS_sect_link_size: Assertion `bin < sinfo->nbins' failed.] - * which is uncovered by test_unlink_chunked_dataset() in test/unlink.c - * *------------------------------------------------------------------------- */ static herr_t diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index ee83564..4d351dd 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Thursday, April 24, 2008 * * Purpose: Abstract indexed (chunked) I/O functions. The logical @@ -278,7 +278,7 @@ H5D__nonexistent_readvv(const H5D_io_info_t *io_info, size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); -/* format convert cb */ +/* Format convert cb */ static int H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata); /* Helper routines */ @@ -300,9 +300,7 @@ static herr_t H5D__create_chunk_file_map_all(H5D_chunk_map_t *fm, const H5D_io_info_t *io_info); static herr_t H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t *io_info); - static herr_t H5D__create_chunk_mem_map_1d(const H5D_chunk_map_t *fm); - static herr_t H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm); static herr_t H5D__chunk_file_cb(void *elem, const H5T_t *type, unsigned ndims, const hsize_t *coords, void *fm); @@ -327,8 +325,8 @@ static herr_t H5D__chunk_collective_fill(const H5D_t *dset, static int H5D__chunk_cmp_addr(const void *addr1, const void *addr2); #endif /* H5_HAVE_PARALLEL */ -static int -H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata); +/* Debugging helper routine callback */ +static int H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata); /*********************/ /* Package Variables */ @@ -835,7 +833,7 @@ H5D__chunk_set_sizes(H5D_t *dset) unsigned enc_bytes_per_dim; /* Number of bytes required to encode this dimension */ /* Get encoded size of dim, in bytes */ - enc_bytes_per_dim = (H5VM_log2_gen(dset->shared->layout.u.chunk.dim[u]) + 8) / 8; + enc_bytes_per_dim = (H5VM__log2_gen(dset->shared->layout.u.chunk.dim[u]) + 8) / 8; /* Check if this is the largest value so far */ if(enc_bytes_per_dim > max_enc_bytes_per_dim) @@ -999,14 +997,14 @@ H5D__chunk_init(H5F_t *f, const H5D_t * const dset, hid_t dapl_id) rdcc->scaled_dims[u] = (dset->shared->curr_dims[u] + dset->shared->layout.u.chunk.dim[u] - 1) / dset->shared->layout.u.chunk.dim[u]; - if( !(scaled_power2up = H5VM_power2up(rdcc->scaled_dims[u])) ) + if(!(scaled_power2up = H5VM__power2up(rdcc->scaled_dims[u]))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") /* Inital 'power2up' values for scaled dimensions */ rdcc->scaled_power2up[u] = scaled_power2up; /* Number of bits required to encode scaled dimension size */ - rdcc->scaled_encode_bits[u] = H5VM_log2_gen(rdcc->scaled_power2up[u]); + rdcc->scaled_encode_bits[u] = H5VM__log2_gen(rdcc->scaled_power2up[u]); } /* end for */ } /* end if */ @@ -2821,12 +2819,12 @@ H5D__chunk_flush(H5D_t *dset) /* Loop over all entries in the chunk cache */ for(ent = rdcc->head; ent; ent = next) { - next = ent->next; + next = ent->next; if(H5D__chunk_flush_entry(dset, ent, FALSE) < 0) nerrors++; } /* end for */ if(nerrors) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") + HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2970,7 +2968,7 @@ H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) /* Reset index structures */ if((storage->ops->reset)(storage, reset_addr) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset chunk index info") + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset chunk index info") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2992,7 +2990,7 @@ done: static herr_t H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last) { - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(last); @@ -3615,14 +3613,14 @@ H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t flush) static herr_t H5D__chunk_cache_prune(const H5D_t *dset, size_t size) { - const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); - size_t total = rdcc->nbytes_max; - const int nmeth = 2; /*number of methods */ - int w[1]; /*weighting as an interval */ - H5D_rdcc_ent_t *p[2], *cur; /*list pointers */ - H5D_rdcc_ent_t *n[2]; /*list next pointers */ - int nerrors = 0; /* Accumulated error count during preemptions */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); + size_t total = rdcc->nbytes_max; + const int nmeth = 2; /* Number of methods */ + int w[1]; /* Weighting as an interval */ + H5D_rdcc_ent_t *p[2], *cur; /* List pointers */ + H5D_rdcc_ent_t *n[2]; /* List next pointers */ + int nerrors = 0; /* Accumulated error count during preemptions */ + herr_t ret_value = SUCCEED;/* Return value */ FUNC_ENTER_STATIC @@ -3643,62 +3641,62 @@ H5D__chunk_cache_prune(const H5D_t *dset, size_t size) while((p[0] || p[1]) && (rdcc->nbytes_used + size) > total) { int i; /* Local index variable */ - /* Introduce new pointers */ - for(i = 0; i < nmeth - 1; i++) + /* Introduce new pointers */ + for(i = 0; i < nmeth - 1; i++) if(0 == w[i]) p[i + 1] = rdcc->head; - /* Compute next value for each pointer */ - for(i = 0; i < nmeth; i++) + /* Compute next value for each pointer */ + for(i = 0; i < nmeth; i++) n[i] = p[i] ? p[i]->next : NULL; - /* Give each method a chance */ - for(i = 0; i < nmeth && (rdcc->nbytes_used + size) > total; i++) { - if(0 == i && p[0] && !p[0]->locked && + /* Give each method a chance */ + for(i = 0; i < nmeth && (rdcc->nbytes_used + size) > total; i++) { + if(0 == i && p[0] && !p[0]->locked && ((0 == p[0]->rd_count && 0 == p[0]->wr_count) || - (0 == p[0]->rd_count && dset->shared->layout.u.chunk.size == p[0]->wr_count) || - (dset->shared->layout.u.chunk.size == p[0]->rd_count && 0 == p[0]->wr_count))) { - /* - * Method 0: Preempt entries that have been completely written - * and/or completely read but not entries that are partially - * written or partially read. - */ - cur = p[0]; - } else if(1 == i && p[1] && !p[1]->locked) { - /* - * Method 1: Preempt the entry without regard to - * considerations other than being locked. This is the last - * resort preemption. - */ - cur = p[1]; - } else { - /* Nothing to preempt at this point */ - cur = NULL; - } + (0 == p[0]->rd_count && dset->shared->layout.u.chunk.size == p[0]->wr_count) || + (dset->shared->layout.u.chunk.size == p[0]->rd_count && 0 == p[0]->wr_count))) { + /* + * Method 0: Preempt entries that have been completely written + * and/or completely read but not entries that are partially + * written or partially read. + */ + cur = p[0]; + } else if(1 == i && p[1] && !p[1]->locked) { + /* + * Method 1: Preempt the entry without regard to + * considerations other than being locked. This is the last + * resort preemption. + */ + cur = p[1]; + } else { + /* Nothing to preempt at this point */ + cur = NULL; + } - if(cur) { + if(cur) { int j; /* Local index variable */ - for(j = 0; j < nmeth; j++) { - if(p[j] == cur) + for(j = 0; j < nmeth; j++) { + if(p[j] == cur) p[j] = NULL; - if(n[j] == cur) + if(n[j] == cur) n[j] = cur->next; - } /* end for */ - if(H5D__chunk_cache_evict(dset, cur, TRUE) < 0) + } /* end for */ + if(H5D__chunk_cache_evict(dset, cur, TRUE) < 0) nerrors++; - } /* end if */ - } /* end for */ + } /* end if */ + } /* end for */ - /* Advance pointers */ - for(i = 0; i < nmeth; i++) + /* Advance pointers */ + for(i = 0; i < nmeth; i++) p[i] = n[i]; - for(i = 0; i < nmeth - 1; i++) + for(i = 0; i < nmeth - 1; i++) w[i] -= 1; } /* end while */ if(nerrors) - HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to preempt one or more raw data cache entry") + HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to preempt one or more raw data cache entry") done: FUNC_LEAVE_NOAPI(ret_value) @@ -4347,7 +4345,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ hbool_t unfilt_edge_chunk_dim[H5O_LAYOUT_NDIMS]; /* Whether there are unfiltered edge chunks at the edge of each dimension */ hsize_t edge_chunk_scaled[H5O_LAYOUT_NDIMS]; /* Offset of the unfiltered edge chunks at the edge of each dimension */ unsigned nunfilt_edge_chunk_dims = 0; /* Number of dimensions on an edge */ - const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); + H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); /* Convenience variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -4556,9 +4554,8 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") #ifndef NDEBUG /* None of the chunks should be allocated */ - if(H5D_CHUNK_IDX_NONE != sc->idx_type) { + if(H5D_CHUNK_IDX_NONE != sc->idx_type) HDassert(!H5F_addr_defined(udata.chunk_block.offset)); - } /* Make sure the chunk is really in the dataset and outside the * original dimensions */ @@ -5126,8 +5123,8 @@ H5D__chunk_cmp_addr(const void *addr1, const void *addr2) * * Return: Non-negative on success/Negative on failure * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * March 26, 2002 + * Programmer: Pedro Vicente + * March 26, 2002 * *------------------------------------------------------------------------- */ @@ -5252,7 +5249,7 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * Algorithm: Robb Matzke * March 27, 2002 * @@ -5405,13 +5402,13 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) elmts_per_chunk = 1; for(u = 0; u < space_ndims; u++) { elmts_per_chunk *= layout->u.chunk.dim[u]; - chunk_dim[u] = layout->u.chunk.dim[u]; - shrunk_dim[u] = (space_dim[u] < old_dim[u]); + chunk_dim[u] = layout->u.chunk.dim[u]; + shrunk_dim[u] = (space_dim[u] < old_dim[u]); } /* end for */ /* Create a dataspace for a chunk & set the extent */ if(NULL == (chunk_space = H5S_create_simple(space_ndims, chunk_dim, NULL))) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Reset hyperslab start array */ /* (hyperslabs will always start from origin) */ @@ -5599,7 +5596,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) /* Remove the chunk from disk, if present */ if(H5F_addr_defined(chk_udata.chunk_block.offset)) { /* Update the offset in idx_udata */ - idx_udata.scaled = udata.common.scaled; + idx_udata.scaled = udata.common.scaled; /* Remove the chunk from disk */ if((sc->ops->remove)(&idx_info, &idx_udata) < 0) @@ -5989,7 +5986,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) if(pline && pline->nused) { must_filter = TRUE; if((udata->common.layout->flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) && - H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, udata->common.layout->dim, chunk_rec->scaled, udata->dset_dims)) + H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, udata->common.layout->dim, chunk_rec->scaled, udata->dset_dims)) must_filter = FALSE; } @@ -6890,12 +6887,12 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - allow_chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)(idx_info->layout->size)) + 8) / 8); + allow_chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)(idx_info->layout->size)) + 8) / 8); if(allow_chunk_size_len > 8) allow_chunk_size_len = 8; /* Compute encoded size of chunk */ - new_chunk_size_len = (H5VM_log2_gen((uint64_t)(new_chunk->length)) + 8) / 8; + new_chunk_size_len = (H5VM__log2_gen((uint64_t)(new_chunk->length)) + 8) / 8; if(new_chunk_size_len > 8) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "encoded chunk size is more than 8 bytes?!?") @@ -6932,9 +6929,9 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old } /* end else */ } /* end if */ else { - HDassert(!H5F_addr_defined(new_chunk->offset)); - HDassert(new_chunk->length == idx_info->layout->size); - alloc_chunk = TRUE; + HDassert(!H5F_addr_defined(new_chunk->offset)); + HDassert(new_chunk->length == idx_info->layout->size); + alloc_chunk = TRUE; } /* end else */ /* Actually allocate space for the chunk in the file */ diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 809cdfc..1792fa2 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * August 5, 2002 * * Purpose: Compact dataset I/O functions. These routines are similar diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 655f660..662be69 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 28, 2000 * * Purpose: diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index f4f4223..7668389 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -15,7 +15,7 @@ * * Created: H5Ddeprec.c * April 5 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Deprecated functions from the H5D interface. These * functions are here for compatibility purposes and may be diff --git a/src/H5Dearray.c b/src/H5Dearray.c index a53489e..56be6a7 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -252,7 +252,7 @@ H5D__earray_crt_context(void *_udata) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8); + ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8); if(ctx->chunk_size_len > 8) ctx->chunk_size_len = 8; @@ -937,7 +937,7 @@ H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); + chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); if(chunk_size_len > 8) chunk_size_len = 8; diff --git a/src/H5Defl.c b/src/H5Defl.c index 91caa61..79cec8c 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 30, 2004 */ @@ -336,9 +336,6 @@ done: * Programmer: Robb Matzke * Wednesday, March 4, 1998 * - * Modifications: - * Robb Matzke, 1999-07-28 - * The ADDR argument is passed by value. *------------------------------------------------------------------------- */ static herr_t diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index a9202c2..a79471a 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -248,7 +248,7 @@ H5D__farray_crt_context(void *_udata) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8); + ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8); if(ctx->chunk_size_len > 8) ctx->chunk_size_len = 8; @@ -892,7 +892,7 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); + chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); if(chunk_size_len > 8) chunk_size_len = 8; diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 94c7b1c..0efe98a 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -15,7 +15,7 @@ * * Created: H5Dfill.c * Jun 19 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Fill value operations for datasets * @@ -647,7 +647,7 @@ done: static herr_t H5D__fill_release(H5D_fill_buf_info_t *fb_info) { - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(fb_info); diff --git a/src/H5Dint.c b/src/H5Dint.c index c063bb9..d662cec 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -97,6 +97,7 @@ static herr_t H5D__vlen_get_buf_size_cb(void *elem, hid_t type_id, unsigned ndim const hsize_t *point, void *op_data); static herr_t H5D__vlen_get_buf_size_gen_cb(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *op_data); +static herr_t H5D__check_filters(H5D_t *dataset); /*********************/ @@ -671,7 +672,7 @@ H5D__cache_dataspace_info(const H5D_t *dset) for(u = 0; u < dset->shared->ndims; u++) { hsize_t scaled_power2up; /* Scaled value, rounded to next power of 2 */ - if( !(scaled_power2up = H5VM_power2up(dset->shared->curr_dims[u])) ) + if(!(scaled_power2up = H5VM__power2up(dset->shared->curr_dims[u]))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") dset->shared->curr_power2up[u] = scaled_power2up; } @@ -908,7 +909,7 @@ H5D__prepare_minimized_oh(H5F_t *file, H5D_t *dset, H5O_loc_t *oloc) HDassert(dset); HDassert(oloc); - oh = H5O__create_ohdr(file, dset->shared->dcpl_id); + oh = H5O_create_ohdr(file, dset->shared->dcpl_id); if(NULL == oh) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "can't instantiate object header") @@ -917,7 +918,7 @@ H5D__prepare_minimized_oh(H5F_t *file, H5D_t *dset, H5O_loc_t *oloc) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "computed header size is invalid") /* Special allocation of space for compact datsets is handled by the call here. */ - if(H5O__apply_ohdr(file, oh, dset->shared->dcpl_id, ohdr_size, (size_t)1, oloc) == FAIL) + if(H5O_apply_ohdr(file, oh, dset->shared->dcpl_id, ohdr_size, (size_t)1, oloc) == FAIL) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "can't apply object header to file") done: @@ -1022,7 +1023,8 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) if(TRUE == use_minimized_header) { if(H5D__prepare_minimized_oh(file, dset, oloc) == FAIL) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create minimized dataset object header") - } else { + } /* end if */ + else { /* Add the dataset's raw data size to the size of the header, if the * raw data will be stored as compact */ @@ -2960,13 +2962,13 @@ done: * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ -herr_t +static herr_t H5D__check_filters(H5D_t *dataset) { H5O_fill_t *fill; /* Dataset's fill value */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_STATIC /* Check args */ HDassert(dataset); @@ -3086,14 +3088,14 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size) dset->shared->cache.chunk.scaled_dims[dim_idx] > dset->shared->cache.chunk.nslots)) update_chunks = TRUE; - if(!(scaled_power2up = H5VM_power2up(scaled))) + if(!(scaled_power2up = H5VM__power2up(scaled))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") /* Check if the number of bits required to encode the scaled size value changed */ if(dset->shared->cache.chunk.scaled_power2up[dim_idx] != scaled_power2up) { /* Update the 'power2up' & 'encode_bits' values for the current dimension */ dset->shared->cache.chunk.scaled_power2up[dim_idx] = scaled_power2up; - dset->shared->cache.chunk.scaled_encode_bits[dim_idx] = H5VM_log2_gen(scaled_power2up); + dset->shared->cache.chunk.scaled_encode_bits[dim_idx] = H5VM__log2_gen(scaled_power2up); /* Indicate that the cached chunk indices need to be updated */ update_chunks = TRUE; diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index cfed02e..e56f341 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1342,9 +1342,9 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HDassert(fm); /* Obtain the current rank of the process and the number of processes */ - if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) + if((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") - if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) + if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") /* Set the actual-chunk-opt-mode property. */ @@ -1356,10 +1356,10 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in H5CX_set_mpio_actual_io_mode(H5D_MPIO_CHUNK_COLLECTIVE); /* Build a list of selected chunks in the collective io operation */ - if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) + if(H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "couldn't construct filtered I/O info list") - if (io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */ + if(io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */ H5D_chk_idx_info_t index_info; H5D_chunk_ud_t udata; hsize_t mpi_buf_count; @@ -1379,15 +1379,15 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in * updating each chunk with the data modifications from other processes, * then re-filtering the chunk. */ - for (i = 0; i < chunk_list_num_entries; i++) - if (mpi_rank == chunk_list[i].owners.new_owner) - if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0) + for(i = 0; i < chunk_list_num_entries; i++) + if(mpi_rank == chunk_list[i].owners.new_owner) + if(H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't process chunk entry") /* Gather the new chunk sizes to all processes for a collective reallocation * of the chunks in the file. */ - if (H5D__mpio_array_gatherv(chunk_list, chunk_list_num_entries, sizeof(H5D_filtered_collective_io_info_t), + if(H5D__mpio_array_gatherv(chunk_list, chunk_list_num_entries, sizeof(H5D_filtered_collective_io_info_t), (void **) &collective_chunk_list, &collective_chunk_list_num_entries, true, 0, io_info->comm, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes") @@ -1480,9 +1480,9 @@ done: H5MM_free(collective_chunk_list); /* Free the MPI buf and file types, if they were derived */ - if (mem_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) + if(mem_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - if (file_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) + if(file_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) FUNC_LEAVE_NOAPI(ret_value) @@ -1770,9 +1770,9 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i HDassert(fm); /* Obtain the current rank of the process and the number of processes */ - if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) + if((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") - if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) + if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") /* Set the actual chunk opt mode property */ @@ -1784,7 +1784,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i H5CX_set_mpio_actual_io_mode(H5D_MPIO_CHUNK_COLLECTIVE); /* Build a list of selected chunks in the collective IO operation */ - if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) + if(H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "couldn't construct filtered I/O info list") /* Set up contiguous I/O info object */ @@ -1799,9 +1799,9 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Set dataset storage for I/O info */ io_info->store = &store; - if (io_info->op_type == H5D_IO_OP_READ) { /* Filtered collective read */ - for (i = 0; i < chunk_list_num_entries; i++) - if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0) + if(io_info->op_type == H5D_IO_OP_READ) { /* Filtered collective read */ + for(i = 0; i < chunk_list_num_entries; i++) + if(H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't process chunk entry") } /* end if */ else { /* Filtered collective write */ @@ -1852,14 +1852,14 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Check if this process has a chunk to work on for this iteration */ hbool_t have_chunk_to_process = (i < chunk_list_num_entries) && (mpi_rank == chunk_list[i].owners.new_owner); - if (have_chunk_to_process) - if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0) + if(have_chunk_to_process) + if(H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't process chunk entry") /* Gather the new chunk sizes to all processes for a collective re-allocation * of the chunks in the file */ - if (H5D__mpio_array_gatherv(&chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(H5D_filtered_collective_io_info_t), + if(H5D__mpio_array_gatherv(&chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(H5D_filtered_collective_io_info_t), (void **) &collective_chunk_list, &collective_chunk_list_num_entries, true, 0, io_info->comm, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes") diff --git a/src/H5Dnone.c b/src/H5Dnone.c index 40ddcb8..751d067 100644 --- a/src/H5Dnone.c +++ b/src/H5Dnone.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Vailin Choi +/* Programmer: Vailin Choi * September 2010 * * Purpose: Implicit (Non Index) chunked I/O functions. diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 37a27d3..5efcc9b 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -234,8 +234,8 @@ typedef struct H5D_io_info_t { typedef struct H5D_chk_idx_info_t { H5F_t *f; /* File pointer for operation */ const H5O_pline_t *pline; /* I/O pipeline info */ - H5O_layout_chunk_t *layout; /* Chunk layout description */ - H5O_storage_chunk_t *storage; /* Chunk storage description */ + H5O_layout_chunk_t *layout; /* Chunk layout description */ + H5O_storage_chunk_t *storage; /* Chunk storage description */ } H5D_chk_idx_info_t; /* @@ -566,7 +566,6 @@ H5_DLL herr_t H5D__get_chunk_info_by_coord(const H5D_t *dset, const hsize_t *coo H5_DLL haddr_t H5D__get_offset(const H5D_t *dset); H5_DLL herr_t H5D__vlen_get_buf_size(H5D_t *dset, hid_t type_id, hid_t space_id, hsize_t *size); H5_DLL herr_t H5D__vlen_get_buf_size_gen(H5VL_object_t *vol_obj, hid_t type_id, hid_t space_id, hsize_t *size); -H5_DLL herr_t H5D__check_filters(H5D_t *dataset); H5_DLL herr_t H5D__set_extent(H5D_t *dataset, const hsize_t *size); H5_DLL herr_t H5D__flush_sieve_buf(H5D_t *dataset); H5_DLL herr_t H5D__flush_real(H5D_t *dataset); diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c index 33274bb..cd71e93 100644 --- a/src/H5Dsingle.c +++ b/src/H5Dsingle.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Vailin Choi +/* Programmer: Vailin Choi * May 2011; updated 10/2015 * * Purpose: Single Chunk I/O functions. diff --git a/src/H5Dtest.c b/src/H5Dtest.c index 916ec72..7c791d4 100644 --- a/src/H5Dtest.c +++ b/src/H5Dtest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Thursday, May 27, 2004 * * Purpose: Dataset testing functions. diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index e07f538..799ee2b 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Wednesday, January 28, 2015 * * Purpose: @@ -2238,7 +2238,7 @@ H5D__virtual_is_data_cached(const H5D_shared_t *shared_dset) size_t i, j; /* Local index variables */ hbool_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDassert(shared_dset); diff --git a/src/H5E.c b/src/H5E.c index f204864..0f7a031 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -391,7 +391,7 @@ H5E__get_stack(void) /*------------------------------------------------------------------------- - * Function: H5E_free_class + * Function: H5E__free_class * * Purpose: Private function to free an error class. * @@ -403,9 +403,9 @@ H5E__get_stack(void) *------------------------------------------------------------------------- */ static herr_t -H5E_free_class(H5E_cls_t *cls) +H5E__free_class(H5E_cls_t *cls) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments */ HDassert(cls); @@ -417,7 +417,7 @@ H5E_free_class(H5E_cls_t *cls) cls = H5FL_FREE(H5E_cls_t, cls); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5E_free_class() */ +} /* end H5E__free_class() */ /*------------------------------------------------------------------------- @@ -502,7 +502,7 @@ H5E__register_class(const char *cls_name, const char *lib_name, const char *vers done: if(!ret_value) - if(cls && H5E_free_class(cls) < 0) + if(cls && H5E__free_class(cls) < 0) HDONE_ERROR(H5E_ERROR, H5E_CANTRELEASE, NULL, "unable to free error class") FUNC_LEAVE_NOAPI(ret_value) @@ -572,7 +572,7 @@ H5E__unregister_class(H5E_cls_t *cls) HGOTO_ERROR(H5E_ERROR, H5E_BADITER, FAIL, "unable to free all messages in this error class") /* Free error class structure */ - if(H5E_free_class(cls) < 0) + if(H5E__free_class(cls) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTRELEASE, FAIL, "unable to free error class") done: diff --git a/src/H5EA.c b/src/H5EA.c index 56663dc..a027792 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -15,7 +15,7 @@ * * Created: H5EA.c * Jun 17 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implements an "extensible array" for storing elements * in an array whose high bounds can extend and shrink. @@ -124,7 +124,6 @@ H5FL_BLK_DEFINE(ea_native_elmt); * NULL on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * Oct 10 2016 * *------------------------------------------------------------------------- @@ -190,7 +189,6 @@ END_FUNC(STATIC) /* end H5EA__new() */ * NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 17 2008 * *------------------------------------------------------------------------- @@ -241,7 +239,6 @@ END_FUNC(PRIV) /* end H5EA_create() */ * NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 28 2008 * *------------------------------------------------------------------------- @@ -283,7 +280,6 @@ END_FUNC(PRIV) /* end H5EA_open() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 21 2008 * *------------------------------------------------------------------------- @@ -314,7 +310,6 @@ END_FUNC(PRIV) /* end H5EA_get_nelmts() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 21 2008 * *------------------------------------------------------------------------- @@ -347,7 +342,6 @@ END_FUNC(PRIV) /* end H5EA_get_addr() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -559,7 +553,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, (page_idx * sblock->dblk_page_size); /* Check if page has been initialized yet */ - if(!H5VM_bit_get(sblock->page_init, page_init_idx)) { + if(!H5VM__bit_get(sblock->page_init, page_init_idx)) { /* Check if we are allowed to create the thing */ if(0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */ /* Create the data block page */ @@ -567,7 +561,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in super block */ - H5VM_bit_set(sblock->page_init, page_init_idx, TRUE); + H5VM__bit_set(sblock->page_init, page_init_idx, TRUE); sblock_cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ else @@ -656,7 +650,6 @@ END_FUNC(STATIC) /* end H5EA__lookup_elmt() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -721,7 +714,6 @@ END_FUNC(PRIV) /* end H5EA_set() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- @@ -786,7 +778,6 @@ END_FUNC(PRIV) /* end H5EA_get() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 27 2009 * *------------------------------------------------------------------------- @@ -836,7 +827,6 @@ END_FUNC(PRIV) /* end H5EA_depend() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 21 2008 * *------------------------------------------------------------------------- @@ -937,7 +927,6 @@ END_FUNC(PRIV) /* end H5EA_close() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 28 2008 * *------------------------------------------------------------------------- diff --git a/src/H5EAcache.c b/src/H5EAcache.c index affa127..f7534fb 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -15,7 +15,7 @@ * * Created: H5EAcache.c * Aug 26 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement extensible array metadata cache methods. * @@ -239,7 +239,6 @@ const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1] = {{ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 16, 2013 * *------------------------------------------------------------------------- @@ -305,7 +304,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 16, 2013 * *------------------------------------------------------------------------- @@ -429,7 +427,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 16, 2013 * *------------------------------------------------------------------------- @@ -459,7 +456,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_image_len() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 16, 2013 * *------------------------------------------------------------------------- @@ -606,7 +602,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_notify() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 16, 2013 * *------------------------------------------------------------------------- @@ -635,7 +630,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_free_icr() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -708,7 +702,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -815,7 +808,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -845,7 +837,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_image_len() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -932,7 +923,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_serialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1001,7 +991,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_notify() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1030,7 +1019,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_free_icr() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1122,7 +1110,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1226,7 +1213,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1256,7 +1242,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_image_len() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1330,7 +1315,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_serialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 31 2009 * *------------------------------------------------------------------------- @@ -1414,7 +1398,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_notify() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1443,7 +1426,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_free_icr() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1536,7 +1518,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1639,7 +1620,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1672,7 +1652,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_image_len() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1744,7 +1723,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_serialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 31 2009 * *------------------------------------------------------------------------- @@ -1828,7 +1806,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_notify() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1904,7 +1881,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_fsf_size() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -1970,7 +1946,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -2043,7 +2018,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -2073,7 +2047,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_image_len() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -2125,7 +2098,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_serialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 31 2009 * *------------------------------------------------------------------------- @@ -2209,7 +2181,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_notify() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c index 6dd2e98..ee5c904 100644 --- a/src/H5EAdblkpage.c +++ b/src/H5EAdblkpage.c @@ -15,7 +15,7 @@ * * Created: H5EAdblkpage.c * Nov 20 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Data block page routines for extensible arrays. * @@ -91,7 +91,6 @@ H5FL_DEFINE_STATIC(H5EA_dblk_page_t); * Return: Non-NULL pointer to data block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 20 2008 * *------------------------------------------------------------------------- @@ -141,7 +140,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_alloc() */ * Return: Valid file address on success/HADDR_UNDEF on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 20 2008 * *------------------------------------------------------------------------- @@ -206,7 +204,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_create() */ * Return: Non-NULL pointer to data block page on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 20 2008 * *------------------------------------------------------------------------- @@ -267,7 +264,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_protect() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 20 2008 * *------------------------------------------------------------------------- @@ -298,7 +294,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_unprotect() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 20 2008 * *------------------------------------------------------------------------- diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c index d926fd5..c72dc7c 100644 --- a/src/H5EAdblock.c +++ b/src/H5EAdblock.c @@ -15,7 +15,7 @@ * * Created: H5EAdblock.c * Sep 11 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Data block routines for extensible arrays. * @@ -92,7 +92,6 @@ H5FL_DEFINE_STATIC(H5EA_dblock_t); * Return: Non-NULL pointer to data block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- @@ -153,7 +152,6 @@ END_FUNC(PKG) /* end H5EA__dblock_alloc() */ * Return: Valid file address on success/HADDR_UNDEF on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -248,7 +246,6 @@ END_FUNC(PKG) /* end H5EA__dblock_create() */ * Return: Super block index on success/Can't fail * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- @@ -269,7 +266,7 @@ H5EA__dblock_sblk_idx(const H5EA_hdr_t *hdr, hsize_t idx)) /* Determine the superblock information for the index */ H5_CHECK_OVERFLOW(idx, /*From:*/hsize_t, /*To:*/uint64_t); - sblk_idx = H5VM_log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1)); + sblk_idx = H5VM__log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1)); /* Set return value */ ret_value = sblk_idx; @@ -285,7 +282,6 @@ END_FUNC(PKG) /* end H5EA__dblock_sblk_idx() */ * Return: Non-NULL pointer to data block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 18 2008 * *------------------------------------------------------------------------- @@ -348,7 +344,6 @@ END_FUNC(PKG) /* end H5EA__dblock_protect() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- @@ -379,7 +374,6 @@ END_FUNC(PKG) /* end H5EA__dblock_unprotect() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 22 2008 * *------------------------------------------------------------------------- @@ -442,7 +436,6 @@ END_FUNC(PKG) /* end H5EA__dblock_delete() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index ec40298..07330c1 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -15,7 +15,7 @@ * * Created: H5EAhdr.c * Aug 26 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Array header routines for extensible arrays. * @@ -110,7 +110,6 @@ H5FL_SEQ_DEFINE_STATIC(H5EA_sblk_info_t); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 26 2008 * *------------------------------------------------------------------------- @@ -180,7 +179,6 @@ END_FUNC(PKG) /* end H5EA__hdr_alloc() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 18 2008 * *------------------------------------------------------------------------- @@ -201,7 +199,7 @@ H5EA__hdr_init(H5EA_hdr_t *hdr, void *ctx_udata)) HDassert(hdr->cparam.sup_blk_min_data_ptrs); /* Compute general information */ - hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM_log2_of2(hdr->cparam.data_blk_min_elmts)); + hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM__log2_of2(hdr->cparam.data_blk_min_elmts)); hdr->dblk_page_nelmts = (size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits; hdr->arr_off_size = (unsigned char)H5EA_SIZEOF_OFFSET_BITS(hdr->cparam.max_nelmts_bits); @@ -245,7 +243,6 @@ END_FUNC(PKG) /* end H5EA__hdr_init() */ * Return: Non-NULL pointer to buffer for elements on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 16 2008 * *------------------------------------------------------------------------- @@ -264,7 +261,7 @@ H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts)) /* Compute the index of the element buffer factory */ H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t); - idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); + idx = H5VM__log2_of2((uint32_t)nelmts) - H5VM__log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); /* Check for needing to increase size of array of factories */ if(idx >= hdr->elmt_fac.nalloc) { @@ -312,7 +309,6 @@ END_FUNC(PKG) /* end H5EA__hdr_alloc_elmts() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 18 2008 * *------------------------------------------------------------------------- @@ -331,7 +327,7 @@ H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts)) /* Compute the index of the element buffer factory */ H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t); - idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); + idx = H5VM__log2_of2((uint32_t)nelmts) - H5VM__log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); /* Free buffer for elements in index block */ HDassert(idx < hdr->elmt_fac.nalloc); @@ -349,7 +345,6 @@ END_FUNC(PKG) /* end H5EA__hdr_free_elmts() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 17 2008 * *------------------------------------------------------------------------- @@ -464,7 +459,6 @@ END_FUNC(PKG) /* end H5EA__hdr_create() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 26 2008 * *------------------------------------------------------------------------- @@ -497,7 +491,6 @@ END_FUNC(PKG) /* end H5EA__hdr_incr() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 26 2008 * *------------------------------------------------------------------------- @@ -533,7 +526,6 @@ END_FUNC(PKG) /* end H5EA__hdr_decr() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 26 2008 * *------------------------------------------------------------------------- @@ -559,7 +551,6 @@ END_FUNC(PKG) /* end H5EA__hdr_fuse_incr() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 26 2008 * *------------------------------------------------------------------------- @@ -589,7 +580,6 @@ END_FUNC(PKG) /* end H5EA__hdr_fuse_decr() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -619,7 +609,6 @@ END_FUNC(PKG) /* end H5EA__hdr_modified() */ * Return: Non-NULL pointer to header on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 31 2013 * *------------------------------------------------------------------------- @@ -677,7 +666,6 @@ END_FUNC(PKG) /* end H5EA__hdr_protect() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 1 2013 * *------------------------------------------------------------------------- @@ -708,7 +696,6 @@ END_FUNC(PKG) /* end H5EA__hdr_unprotect() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 26 2008 * *------------------------------------------------------------------------- @@ -765,7 +752,6 @@ END_FUNC(PKG) /* end H5EA__hdr_delete() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- diff --git a/src/H5EAiblock.c b/src/H5EAiblock.c index 1b5957a..c45d15a 100644 --- a/src/H5EAiblock.c +++ b/src/H5EAiblock.c @@ -15,7 +15,7 @@ * * Created: H5EAiblock.c * Sep 9 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Index block routines for extensible arrays. * @@ -42,7 +42,7 @@ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ @@ -98,7 +98,6 @@ H5FL_SEQ_DEFINE_STATIC(haddr_t); * Return: Non-NULL pointer to index block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -129,11 +128,6 @@ H5EA__iblock_alloc(H5EA_hdr_t *hdr)) iblock->nsblks = H5EA_SBLK_FIRST_IDX(hdr->cparam.sup_blk_min_data_ptrs); iblock->ndblk_addrs = 2 * ((size_t)hdr->cparam.sup_blk_min_data_ptrs - 1); iblock->nsblk_addrs = hdr->nsblks - iblock->nsblks; -#ifdef QAK -HDfprintf(stderr, "%s: iblock->nsblks = %u\n", FUNC, iblock->nsblks); -HDfprintf(stderr, "%s: iblock->ndblk_addrs = %Zu\n", FUNC, iblock->ndblk_addrs); -HDfprintf(stderr, "%s: iblock->nsblk_addrs = %Zu\n", FUNC, iblock->nsblk_addrs); -#endif /* QAK */ /* Allocate buffer for elements in index block */ if(hdr->cparam.idx_blk_elmts > 0) @@ -169,7 +163,6 @@ END_FUNC(PKG) /* end H5EA__iblock_alloc() */ * Return: Valid file address on success/HADDR_UNDEF on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -183,10 +176,6 @@ H5EA__iblock_create(H5EA_hdr_t *hdr, hbool_t *stats_changed)) haddr_t iblock_addr; /* Extensible array index block address */ hbool_t inserted = FALSE; /* Whether the header was inserted into cache */ -#ifdef QAK -HDfprintf(stderr, "%s: Called\n", FUNC); -#endif /* QAK */ - /* Sanity check */ HDassert(hdr); HDassert(stats_changed); @@ -197,9 +186,6 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Set size of index block on disk */ iblock->size = H5EA_IBLOCK_SIZE(iblock); -#ifdef QAK -HDfprintf(stderr, "%s: iblock->size = %Zu\n", FUNC, iblock->size); -#endif /* QAK */ /* Allocate space for the index block on disk */ if(HADDR_UNDEF == (iblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_IBLOCK, (hsize_t)iblock->size))) @@ -284,7 +270,6 @@ END_FUNC(PKG) /* end H5EA__iblock_create() */ * Return: Non-NULL pointer to index block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -296,10 +281,6 @@ H5EA__iblock_protect(H5EA_hdr_t *hdr, unsigned flags)) /* Local variables */ H5EA_iblock_t *iblock = NULL; /* Pointer to index block */ -#ifdef QAK -HDfprintf(stderr, "%s: Called\n", FUNC); -#endif /* QAK */ - /* Sanity check */ HDassert(hdr); @@ -340,7 +321,6 @@ END_FUNC(PKG) /* end H5EA__iblock_protect() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -351,10 +331,6 @@ H5EA__iblock_unprotect(H5EA_iblock_t *iblock, unsigned cache_flags)) /* Local variables */ -#ifdef QAK -HDfprintf(stderr, "%s: Called\n", FUNC); -#endif /* QAK */ - /* Sanity check */ HDassert(iblock); @@ -375,7 +351,6 @@ END_FUNC(PKG) /* end H5EA__iblock_unprotect() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2008 * *------------------------------------------------------------------------- @@ -387,10 +362,6 @@ H5EA__iblock_delete(H5EA_hdr_t *hdr)) /* Local variables */ H5EA_iblock_t *iblock = NULL; /* Pointer to index block */ -#ifdef QAK -HDfprintf(stderr, "%s: Called\n", FUNC); -#endif /* QAK */ - /* Sanity check */ HDassert(hdr); HDassert(H5F_addr_defined(hdr->idx_blk_addr)); @@ -459,7 +430,6 @@ END_FUNC(PKG) /* end H5EA__iblock_delete() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2008 * *------------------------------------------------------------------------- diff --git a/src/H5EAint.c b/src/H5EAint.c index 2baf1f4..ef8cd7a 100644 --- a/src/H5EAint.c +++ b/src/H5EAint.c @@ -15,7 +15,7 @@ * * Created: H5EAint.c * Jun 17 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Internal routines for extnsible arrays. * @@ -86,7 +86,6 @@ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 26 2009 * *------------------------------------------------------------------------- @@ -116,7 +115,6 @@ END_FUNC(PKG) /* end H5EA__create_flush_depend() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 26 2009 * *------------------------------------------------------------------------- diff --git a/src/H5EApkg.h b/src/H5EApkg.h index b70231d..ad1fdfc 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -146,7 +146,7 @@ #define H5EA_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8) /* Compute the first super block index that will hold a certain # of data block pointers */ -#define H5EA_SBLK_FIRST_IDX(m) (2 * H5VM_log2_of2((uint32_t)m)) +#define H5EA_SBLK_FIRST_IDX(m) (2 * H5VM__log2_of2((uint32_t)m)) /****************************/ /* Package Private Typedefs */ diff --git a/src/H5EAsblock.c b/src/H5EAsblock.c index fb7c458..b5b9d94 100644 --- a/src/H5EAsblock.c +++ b/src/H5EAsblock.c @@ -42,7 +42,7 @@ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ diff --git a/src/H5EAstat.c b/src/H5EAstat.c index 509d3f8..68e0b1e 100644 --- a/src/H5EAstat.c +++ b/src/H5EAstat.c @@ -15,7 +15,7 @@ * * Created: H5EAstat.c * Sep 11 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Extensible array metadata statistics functions. * @@ -87,7 +87,6 @@ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 21 2008 * *------------------------------------------------------------------------- @@ -98,10 +97,6 @@ H5EA_get_stats(const H5EA_t *ea, H5EA_stat_t *stats)) /* Local variables */ -#ifdef QAK -HDfprintf(stderr, "%s: Called\n", FUNC); -#endif /* QAK */ - /* * Check arguments. */ diff --git a/src/H5EAtest.c b/src/H5EAtest.c index 8926d6a..a0802bc 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Thursday, August 28, 2008 * * Purpose: Extensible array testing functions. @@ -38,7 +38,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5VMprivate.h" /* Vector functions */ +#include "H5VMprivate.h" /* Vector functions */ /****************/ diff --git a/src/H5Edeprec.c b/src/H5Edeprec.c index 4462303..437c431 100644 --- a/src/H5Edeprec.c +++ b/src/H5Edeprec.c @@ -15,7 +15,7 @@ * * Created: H5Edeprec.c * April 11 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Deprecated functions from the H5E interface. These * functions are here for compatibility purposes and may be diff --git a/src/H5Eint.c b/src/H5Eint.c index 2371a5f..cf1d649 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -15,7 +15,7 @@ * * Created: H5Eint.c * April 11 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: General use, "internal" routines for error handling. * diff --git a/src/H5Emodule.h b/src/H5Emodule.h index 2d1bcd0..fbfc262 100644 --- a/src/H5Emodule.h +++ b/src/H5Emodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Epkg.h b/src/H5Epkg.h index 83f3816..eac5829 100644 --- a/src/H5Epkg.h +++ b/src/H5Epkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, April 11, 2007 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5FA.c b/src/H5FA.c index f8bb094..871793e 100644 --- a/src/H5FA.c +++ b/src/H5FA.c @@ -15,7 +15,7 @@ * * Created: H5FA.c * April 2009 - * Vailin Choi + * Vailin Choi * * Purpose: Implements a Fixed Array for storing elements * of datasets with fixed dimensions. @@ -112,7 +112,6 @@ H5FL_BLK_DEFINE(fa_native_elmt); * NULL on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * Oct 17 2016 * *------------------------------------------------------------------------- @@ -396,13 +395,13 @@ H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt)) dblk_page_nelmts = dblock->dblk_page_nelmts; /* Check if the page has been created yet */ - if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) { /* Create the data block page */ if(H5FA__dblk_page_create(hdr, dblk_page_addr, dblk_page_nelmts) < 0) H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in data block */ - H5VM_bit_set(dblock->dblk_page_init, page_idx, TRUE); + H5VM__bit_set(dblock->dblk_page_init, page_idx, TRUE); dblock_cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ @@ -483,7 +482,7 @@ H5FA_get(const H5FA_t *fa, hsize_t idx, void *elmt)) page_idx = (size_t)(idx / dblock->dblk_page_nelmts); /* Check if the page is defined yet */ - if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) { /* Call the class's 'fill' callback */ if((hdr->cparam.cls->fill)(elmt, (size_t)1) < 0) H5E_THROW(H5E_CANTSET, "can't set element to class's fill value") diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 8f5e696..90770fb 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -15,7 +15,7 @@ * * Created: H5FAcache.c * Jul 2 2009 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement fixed array metadata cache methods. * @@ -180,7 +180,6 @@ const H5AC_class_t H5AC_FARRAY_DBLK_PAGE[1] = {{ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 31, 2013 * *------------------------------------------------------------------------- @@ -246,7 +245,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 12, 2013 * *------------------------------------------------------------------------- @@ -359,7 +357,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 12, 2013 * *------------------------------------------------------------------------- @@ -389,7 +386,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_image_len() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 12, 2013 * *------------------------------------------------------------------------- @@ -527,7 +523,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_notify() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 12, 2013 * *------------------------------------------------------------------------- @@ -556,7 +551,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_free_icr() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 12, 2013 * *------------------------------------------------------------------------- @@ -644,7 +638,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -744,7 +737,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -777,7 +769,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_image_len() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -924,7 +915,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_notify() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -1001,7 +991,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_fsf_size() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -1068,7 +1057,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_verify_chksum() */ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -1141,7 +1129,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_deserialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -1171,7 +1158,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_image_len() */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -1223,7 +1209,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_serialize() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * Oct 17 2016 * *------------------------------------------------------------------------- @@ -1286,7 +1271,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_notify() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index b578cf2..431e6fa 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -229,7 +229,7 @@ H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Read and print each page's elements in the data block */ for(page_idx = 0; page_idx < dblock->npages; page_idx++) { - if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) { HDfprintf(stream, "%*s%-*s %Hu %s\n", indent, "", fwidth, "Page %Zu:", page_idx, "empty"); diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 506c767..b25d50b 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -414,7 +414,6 @@ END_FUNC(PKG) /* end H5FA__hdr_modified() */ * Return: Non-NULL pointer to header on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 12 2013 * *------------------------------------------------------------------------- @@ -471,7 +470,6 @@ END_FUNC(PKG) /* end H5FA__hdr_protect() */ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 12 2013 * *------------------------------------------------------------------------- @@ -491,7 +489,7 @@ H5FA__hdr_unprotect(H5FA_hdr_t *hdr, unsigned cache_flags)) CATCH -END_FUNC(PKG) /* end H5EA__hdr_unprotect() */ +END_FUNC(PKG) /* end H5FA__hdr_unprotect() */ /*------------------------------------------------------------------------- diff --git a/src/H5FAint.c b/src/H5FAint.c index 9d3bce8..3a1375a 100644 --- a/src/H5FAint.c +++ b/src/H5FAint.c @@ -15,7 +15,7 @@ * * Created: H5FAint.c * Fall 2012 - * Dana Robinson + * Dana Robinson * * Purpose: Internal routines for fixed arrays. * diff --git a/src/H5FAmodule.h b/src/H5FAmodule.h index f675faf..57a85b1 100644 --- a/src/H5FAmodule.h +++ b/src/H5FAmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5FAstat.c b/src/H5FAstat.c index 49a56a9..882da99 100644 --- a/src/H5FAstat.c +++ b/src/H5FAstat.c @@ -35,9 +35,9 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FApkg.h" /* Fixed Arrays */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FApkg.h" /* Fixed Arrays */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5FAtest.c b/src/H5FAtest.c index e55d408..2bcdc01 100644 --- a/src/H5FAtest.c +++ b/src/H5FAtest.c @@ -36,7 +36,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5VMprivate.h" /* Vector functions */ +#include "H5VMprivate.h" /* Vector functions */ /****************/ diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 0551dd0..2afe7ea 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, August 10, 1999 * * Purpose: A driver which stores the HDF5 data in main memory using @@ -144,8 +144,8 @@ static herr_t H5FD__core_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, ha size_t size, const void *buf); static herr_t H5FD__core_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); static herr_t H5FD__core_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_core_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_core_unlock(H5FD_t *_file); +static herr_t H5FD__core_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__core_unlock(H5FD_t *_file); static const H5FD_class_t H5FD_core_g = { "core", /* name */ @@ -177,8 +177,8 @@ static const H5FD_class_t H5FD_core_g = { H5FD__core_write, /* write */ H5FD__core_flush, /* flush */ H5FD__core_truncate, /* truncate */ - H5FD_core_lock, /* lock */ - H5FD_core_unlock, /* unlock */ + H5FD__core_lock, /* lock */ + H5FD__core_unlock, /* unlock */ H5FD_FLMAP_DICHOTOMY /* fl_map */ }; @@ -345,7 +345,7 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) HDoff_t offset = (HDoff_t)addr; /* Offset to write at */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -414,7 +414,7 @@ H5FD__init_package(void) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5FD_core_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize core VFD") @@ -1581,7 +1581,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_core_lock + * Function: H5FD__core_lock * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": @@ -1595,13 +1595,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_lock(H5FD_t *_file, hbool_t rw) +H5FD__core_lock(H5FD_t *_file, hbool_t rw) { H5FD_core_t *file = (H5FD_core_t*)_file; /* VFD file struct */ int lock_flags; /* file locking flags */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -1609,7 +1609,6 @@ H5FD_core_lock(H5FD_t *_file, hbool_t rw) * descriptor, this is a no-op. */ if(file->fd >= 0) { - /* Set exclusive or shared lock based on rw status */ lock_flags = rw ? LOCK_EX : LOCK_SH; @@ -1620,16 +1619,15 @@ H5FD_core_lock(H5FD_t *_file, hbool_t rw) else HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to lock file") } /* end if */ - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_core_lock() */ +} /* end H5FD__core_lock() */ /*------------------------------------------------------------------------- - * Function: H5FD_core_unlock + * Function: H5FD__core_unlock * * Purpose: To remove the existing lock on the file * @@ -1640,17 +1638,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_core_unlock(H5FD_t *_file) +H5FD__core_unlock(H5FD_t *_file) { H5FD_core_t *file = (H5FD_core_t*)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); - if(file->fd >= 0) { - + if(file->fd >= 0) if(HDflock(file->fd, LOCK_UN) < 0) { if(ENOSYS == errno) HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)") @@ -1658,9 +1655,7 @@ H5FD_core_unlock(H5FD_t *_file) HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to unlock file") } /* end if */ - } /* end if */ - done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_core_unlock() */ +} /* end H5FD__core_unlock() */ diff --git a/src/H5FDcore.h b/src/H5FDcore.h index 5fe2912..63b6f27 100644 --- a/src/H5FDcore.h +++ b/src/H5FDcore.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Purpose: The public header file for the core driver. diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 34c4346..1dbf857 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, 20 September 2006 * * Purpose: The Direct I/O file driver forces the data to be written to @@ -23,15 +23,15 @@ #include "H5FDdrvr_module.h" /* This source code file is part of the H5FD driver module */ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5FDdirect.h" /* Direct file driver */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5FDdirect.h" /* Direct file driver */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ #ifdef H5_HAVE_DIRECT @@ -109,69 +109,68 @@ typedef struct H5FD_direct_t { * which can be addressed entirely by the second * argument of the file seek function. */ -#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) -#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || \ - ((A) & ~(haddr_t)MAXADDR)) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) -#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ - HADDR_UNDEF==(A)+(Z) || \ - (HDoff_t)((A)+(Z))<(HDoff_t)(A)) +#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ + HADDR_UNDEF == (A) + (Z) || \ + (HDoff_t)((A) + (Z)) < (HDoff_t)(A)) /* Prototypes */ -static herr_t H5FD_direct_term(void); -static void *H5FD_direct_fapl_get(H5FD_t *file); -static void *H5FD_direct_fapl_copy(const void *_old_fa); -static H5FD_t *H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, +static herr_t H5FD__direct_term(void); +static void *H5FD__direct_fapl_get(H5FD_t *file); +static void *H5FD__direct_fapl_copy(const void *_old_fa); +static H5FD_t *H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_direct_close(H5FD_t *_file); -static int H5FD_direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_direct_query(const H5FD_t *_f1, unsigned long *flags); -static haddr_t H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_direct_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); -static herr_t H5FD_direct_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, +static herr_t H5FD__direct_close(H5FD_t *_file); +static int H5FD__direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD__direct_query(const H5FD_t *_f1, unsigned long *flags); +static haddr_t H5FD__direct_get_eoa(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__direct_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static haddr_t H5FD__direct_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__direct_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); +static herr_t H5FD__direct_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD_direct_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, +static herr_t H5FD__direct_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_direct_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_direct_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_direct_unlock(H5FD_t *_file); +static herr_t H5FD__direct_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__direct_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__direct_unlock(H5FD_t *_file); static const H5FD_class_t H5FD_direct_g = { - "direct", /*name */ - MAXADDR, /*maxaddr */ - H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_direct_term, /*terminate */ - NULL, /*sb_size */ - NULL, /*sb_encode */ - NULL, /*sb_decode */ - sizeof(H5FD_direct_fapl_t), /*fapl_size */ - H5FD_direct_fapl_get, /*fapl_get */ - H5FD_direct_fapl_copy, /*fapl_copy */ - NULL, /*fapl_free */ - 0, /*dxpl_size */ - NULL, /*dxpl_copy */ - NULL, /*dxpl_free */ - H5FD_direct_open, /*open */ - H5FD_direct_close, /*close */ - H5FD_direct_cmp, /*cmp */ - H5FD_direct_query, /*query */ - NULL, /*get_type_map */ - NULL, /*alloc */ - NULL, /*free */ - H5FD_direct_get_eoa, /*get_eoa */ - H5FD_direct_set_eoa, /*set_eoa */ - H5FD_direct_get_eof, /*get_eof */ - H5FD_direct_get_handle, /*get_handle */ - H5FD_direct_read, /*read */ - H5FD_direct_write, /*write */ - NULL, /*flush */ - H5FD_direct_truncate, /*truncate */ - H5FD_direct_lock, /*lock */ - H5FD_direct_unlock, /*unlock */ - H5FD_FLMAP_DICHOTOMY /*fl_map */ + "direct", /* name */ + MAXADDR, /* maxaddr */ + H5F_CLOSE_WEAK, /* fc_degree */ + H5FD__direct_term, /* terminate */ + NULL, /* sb_size */ + NULL, /* sb_encode */ + NULL, /* sb_decode */ + sizeof(H5FD_direct_fapl_t), /* fapl_size */ + H5FD__direct_fapl_get, /* fapl_get */ + H5FD__direct_fapl_copy, /* fapl_copy */ + NULL, /* fapl_free */ + 0, /* dxpl_size */ + NULL, /* dxpl_copy */ + NULL, /* dxpl_free */ + H5FD__direct_open, /* open */ + H5FD__direct_close, /* close */ + H5FD__direct_cmp, /* cmp */ + H5FD__direct_query, /* query */ + NULL, /* get_type_map */ + NULL, /* alloc */ + NULL, /* free */ + H5FD__direct_get_eoa, /* get_eoa */ + H5FD__direct_set_eoa, /* set_eoa */ + H5FD__direct_get_eof, /* get_eof */ + H5FD__direct_get_handle, /* get_handle */ + H5FD__direct_read, /* read */ + H5FD__direct_write, /* write */ + NULL, /* flush */ + H5FD__direct_truncate, /* truncate */ + H5FD__direct_lock, /* lock */ + H5FD__direct_unlock, /* unlock */ + H5FD_FLMAP_DICHOTOMY /* fl_map */ }; /* Declare a free list to manage the H5FD_direct_t struct */ @@ -238,7 +237,7 @@ done: /*--------------------------------------------------------------------------- - * Function: H5FD_direct_term + * Function: H5FD__direct_term * * Purpose: Shut down the VFD * @@ -250,15 +249,15 @@ done: *--------------------------------------------------------------------------- */ static herr_t -H5FD_direct_term(void) +H5FD__direct_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Reset VFL ID */ H5FD_DIRECT_g=0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_direct_term() */ +} /* end H5FD__direct_term() */ /*------------------------------------------------------------------------- @@ -361,7 +360,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_fapl_get + * Function: H5FD__direct_fapl_get * * Purpose: Returns a file access property list which indicates how the * specified file is being accessed. The return list could be @@ -375,28 +374,26 @@ done: * Programmer: Raymond Lu * Wednesday, 18 October 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_direct_fapl_get(H5FD_t *_file) +H5FD__direct_fapl_get(H5FD_t *_file) { H5FD_direct_t *file = (H5FD_direct_t*)_file; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set return value */ - ret_value= H5FD_direct_fapl_copy(&(file->fa)); + ret_value= H5FD__direct_fapl_copy(&(file->fa)); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_direct_fapl_get() */ +} /* end H5FD__direct_fapl_get() */ /*------------------------------------------------------------------------- - * Function: H5FD_direct_fapl_copy + * Function: H5FD__direct_fapl_copy * * Purpose: Copies the direct-specific file access properties. * @@ -407,17 +404,15 @@ done: * Programmer: Raymond Lu * Wednesday, 18 October 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_direct_fapl_copy(const void *_old_fa) +H5FD__direct_fapl_copy(const void *_old_fa) { const H5FD_direct_fapl_t *old_fa = (const H5FD_direct_fapl_t*)_old_fa; H5FD_direct_fapl_t *new_fa = H5MM_calloc(sizeof(H5FD_direct_fapl_t)); - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(new_fa); @@ -425,11 +420,11 @@ H5FD_direct_fapl_copy(const void *_old_fa) H5MM_memcpy(new_fa, old_fa, sizeof(H5FD_direct_fapl_t)); FUNC_LEAVE_NOAPI(new_fa) -} /* end H5FD_direct_fapl_copy() */ +} /* end H5FD__direct_fapl_copy() */ /*------------------------------------------------------------------------- - * Function: H5FD_direct_open + * Function: H5FD__direct_open * * Purpose: Create and/or opens a Unix file for direct I/O as an HDF5 file. * @@ -442,12 +437,10 @@ H5FD_direct_fapl_copy(const void *_old_fa) * Programmer: Raymond Lu * Wednesday, 20 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) +H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { int o_flags; int fd=(-1); @@ -462,7 +455,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd void *buf1, *buf2; H5FD_t *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check on file offsets */ HDassert(sizeof(HDoff_t)>=sizeof(size_t)); @@ -577,7 +570,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_close + * Function: H5FD__direct_close * * Purpose: Closes the file. * @@ -588,17 +581,15 @@ done: * Programmer: Raymond Lu * Wednesday, 20 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_close(H5FD_t *_file) +H5FD__direct_close(H5FD_t *_file) { H5FD_direct_t *file = (H5FD_direct_t*)_file; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if (HDclose(file->fd)<0) HSYS_GOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file") @@ -611,7 +602,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_cmp + * Function: H5FD__direct_cmp * * Purpose: Compares two files belonging to this driver using an * arbitrary (but consistent) ordering. @@ -624,18 +615,16 @@ done: * Programmer: Raymond Lu * Thursday, 21 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static int -H5FD_direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2) +H5FD__direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { const H5FD_direct_t *f1 = (const H5FD_direct_t*)_f1; const H5FD_direct_t *f2 = (const H5FD_direct_t*)_f2; int ret_value=0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #ifdef H5_HAVE_WIN32_API if (f1->fileindexhi < f2->fileindexhi) HGOTO_DONE(-1) @@ -668,7 +657,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_query + * Function: H5FD__direct_query * * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) @@ -680,14 +669,12 @@ done: * Programmer: Raymond Lu * Thursday, 21 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED * _f, unsigned long *flags /* out */) +H5FD__direct_query(const H5FD_t H5_ATTR_UNUSED * _f, unsigned long *flags /* out */) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set the VFL feature flags that this driver supports */ if(flags) { @@ -704,7 +691,7 @@ H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED * _f, unsigned long *flags /* out /*------------------------------------------------------------------------- - * Function: H5FD_direct_get_eoa + * Function: H5FD__direct_get_eoa * * Purpose: Gets the end-of-address marker for the file. The EOA marker * is the first address past the last byte allocated in the @@ -717,26 +704,21 @@ H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED * _f, unsigned long *flags /* out * Programmer: Raymond Lu * Wednesday, 20 September 2006 * - * Modifications: - * Raymond Lu - * 21 Dec. 2006 - * Added the parameter TYPE. It's only used for MULTI driver. - * *------------------------------------------------------------------------- */ static haddr_t -H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__direct_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_direct_t *file = (const H5FD_direct_t*)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eoa) } /*------------------------------------------------------------------------- - * Function: H5FD_direct_set_eoa + * Function: H5FD__direct_set_eoa * * Purpose: Set the end-of-address marker for the file. This function is * called shortly after an existing HDF5 file is opened in order @@ -749,19 +731,14 @@ H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) * Programmer: Raymond Lu * Wednesday, 20 September 2006 * - * Modifications: - * Raymond Lu - * 21 Dec. 2006 - * Added the parameter TYPE. It's only used for MULTI driver. - * *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) +H5FD__direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) { H5FD_direct_t *file = (H5FD_direct_t*)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR file->eoa = addr; @@ -770,7 +747,7 @@ H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) /*------------------------------------------------------------------------- - * Function: H5FD_direct_get_eof + * Function: H5FD__direct_get_eof * * Purpose: Returns the end-of-file marker, which is the greater of * either the Unix end-of-file or the HDF5 end-of-address @@ -785,16 +762,14 @@ H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) * Programmer: Raymond Lu * Wednesday, 20 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static haddr_t -H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__direct_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_direct_t *file = (const H5FD_direct_t*)_file; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC FUNC_LEAVE_NOAPI(file->eof) } @@ -810,17 +785,15 @@ H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) * Programmer: Raymond Lu * 21 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void** file_handle) +H5FD__direct_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void** file_handle) { H5FD_direct_t *file = (H5FD_direct_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -832,7 +805,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_read + * Function: H5FD__direct_read * * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR * into buffer BUF according to data transfer properties in @@ -846,12 +819,10 @@ done: * Programmer: Raymond Lu * Thursday, 21 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, +H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { H5FD_direct_t *file = (H5FD_direct_t*)_file; @@ -867,7 +838,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN size_t copy_size = size; /* Size remaining to read when using copy buffer */ size_t copy_offset; /* Offset into copy buffer of the requested data */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file && file->pub.cls); HDassert(buf); @@ -1018,7 +989,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_write + * Function: H5FD__direct_write * * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR * from buffer BUF according to data transfer properties in @@ -1031,12 +1002,10 @@ done: * Programmer: Raymond Lu * Thursday, 21 September 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, +H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, const void *buf) { H5FD_direct_t *file = (H5FD_direct_t*)_file; @@ -1055,7 +1024,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U size_t copy_size = size; /* Size remaining to write when using copy buffer */ size_t copy_offset; /* Offset into copy buffer of the data to write */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file && file->pub.cls); HDassert(buf); @@ -1253,7 +1222,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_truncate + * Function: H5FD__direct_truncate * * Purpose: Makes sure that the true file size is the same (or larger) * than the end-of-address. @@ -1268,12 +1237,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) { H5FD_direct_t *file = (H5FD_direct_t*)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -1314,11 +1283,11 @@ H5FD_direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATT done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_direct_truncate() */ +} /* end H5FD__direct_truncate() */ /*------------------------------------------------------------------------- - * Function: H5FD_direct_lock + * Function: H5FD__direct_lock * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": @@ -1332,13 +1301,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_lock(H5FD_t *_file, hbool_t rw) +H5FD__direct_lock(H5FD_t *_file, hbool_t rw) { H5FD_direct_t *file = (H5FD_direct_t*)_file; /* VFD file struct */ const int lock = rw ? LOCK_EX : LOCK_SH; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -1348,11 +1317,11 @@ H5FD_direct_lock(H5FD_t *_file, hbool_t rw) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_direct_lock() */ +} /* end H5FD__direct_lock() */ /*------------------------------------------------------------------------- - * Function: H5FD_direct_unlock + * Function: H5FD__direct_unlock * * Purpose: To remove the existing lock on the file * @@ -1363,12 +1332,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_direct_unlock(H5FD_t *_file) +H5FD__direct_unlock(H5FD_t *_file) { H5FD_direct_t *file = (H5FD_direct_t*)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -1377,7 +1346,7 @@ H5FD_direct_unlock(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_direct_unlock() */ +} /* end H5FD__direct_unlock() */ #endif /* H5_HAVE_DIRECT */ diff --git a/src/H5FDdirect.h b/src/H5FDdirect.h index 805f3be..630a1e6 100644 --- a/src/H5FDdirect.h +++ b/src/H5FDdirect.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, 20 September 2006 * * Purpose: The public header file for the direct driver. diff --git a/src/H5FDdrvr_module.h b/src/H5FDdrvr_module.h index 59a419e..34beb32 100644 --- a/src/H5FDdrvr_module.h +++ b/src/H5FDdrvr_module.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index d110ef7..aa604c2 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, November 10, 1997 * * Purpose: Implements a family of files that acts as a single hdf5 @@ -79,67 +79,67 @@ typedef struct H5FD_family_fapl_t { } H5FD_family_fapl_t; /* Callback prototypes */ -static herr_t H5FD_family_term(void); -static void *H5FD_family_fapl_get(H5FD_t *_file); -static void *H5FD_family_fapl_copy(const void *_old_fa); -static herr_t H5FD_family_fapl_free(void *_fa); -static hsize_t H5FD_family_sb_size(H5FD_t *_file); -static herr_t H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, +static herr_t H5FD__family_term(void); +static void *H5FD__family_fapl_get(H5FD_t *_file); +static void *H5FD__family_fapl_copy(const void *_old_fa); +static herr_t H5FD__family_fapl_free(void *_fa); +static hsize_t H5FD__family_sb_size(H5FD_t *_file); +static herr_t H5FD__family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/); -static herr_t H5FD_family_sb_decode(H5FD_t *_file, const char *name, +static herr_t H5FD__family_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf); -static H5FD_t *H5FD_family_open(const char *name, unsigned flags, +static H5FD_t *H5FD__family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_family_close(H5FD_t *_file); -static int H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_family_query(const H5FD_t *_f1, unsigned long *flags); -static haddr_t H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa); -static haddr_t H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); -static herr_t H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, +static herr_t H5FD__family_close(H5FD_t *_file); +static int H5FD__family_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD__family_query(const H5FD_t *_f1, unsigned long *flags); +static haddr_t H5FD__family_get_eoa(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa); +static haddr_t H5FD__family_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); +static herr_t H5FD__family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *_buf/*out*/); -static herr_t H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, +static herr_t H5FD__family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *_buf); -static herr_t H5FD_family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_family_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_family_unlock(H5FD_t *_file); +static herr_t H5FD__family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__family_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__family_unlock(H5FD_t *_file); /* The class struct */ static const H5FD_class_t H5FD_family_g = { - "family", /*name */ - HADDR_MAX, /*maxaddr */ - H5F_CLOSE_WEAK, /*fc_degree */ - H5FD_family_term, /*terminate */ - H5FD_family_sb_size, /*sb_size */ - H5FD_family_sb_encode, /*sb_encode */ - H5FD_family_sb_decode, /*sb_decode */ - sizeof(H5FD_family_fapl_t), /*fapl_size */ - H5FD_family_fapl_get, /*fapl_get */ - H5FD_family_fapl_copy, /*fapl_copy */ - H5FD_family_fapl_free, /*fapl_free */ - 0, /*dxpl_size */ - NULL, /*dxpl_copy */ - NULL, /*dxpl_free */ - H5FD_family_open, /*open */ - H5FD_family_close, /*close */ - H5FD_family_cmp, /*cmp */ - H5FD_family_query, /*query */ - NULL, /*get_type_map */ - NULL, /*alloc */ - NULL, /*free */ - H5FD_family_get_eoa, /*get_eoa */ - H5FD_family_set_eoa, /*set_eoa */ - H5FD_family_get_eof, /*get_eof */ - H5FD_family_get_handle, /*get_handle */ - H5FD_family_read, /*read */ - H5FD_family_write, /*write */ - H5FD_family_flush, /*flush */ - H5FD_family_truncate, /*truncate */ - H5FD_family_lock, /*lock */ - H5FD_family_unlock, /*unlock */ - H5FD_FLMAP_DICHOTOMY /*fl_map */ + "family", /* name */ + HADDR_MAX, /* maxaddr */ + H5F_CLOSE_WEAK, /* fc_degree */ + H5FD__family_term, /* terminate */ + H5FD__family_sb_size, /* sb_size */ + H5FD__family_sb_encode, /* sb_encode */ + H5FD__family_sb_decode, /* sb_decode */ + sizeof(H5FD_family_fapl_t), /* fapl_size */ + H5FD__family_fapl_get, /* fapl_get */ + H5FD__family_fapl_copy, /* fapl_copy */ + H5FD__family_fapl_free, /* fapl_free */ + 0, /* dxpl_size */ + NULL, /* dxpl_copy */ + NULL, /* dxpl_free */ + H5FD__family_open, /* open */ + H5FD__family_close, /* close */ + H5FD__family_cmp, /* cmp */ + H5FD__family_query, /* query */ + NULL, /* get_type_map */ + NULL, /* alloc */ + NULL, /* free */ + H5FD__family_get_eoa, /* get_eoa */ + H5FD__family_set_eoa, /* set_eoa */ + H5FD__family_get_eof, /* get_eof */ + H5FD__family_get_handle, /* get_handle */ + H5FD__family_read, /* read */ + H5FD__family_write, /* write */ + H5FD__family_flush, /* flush */ + H5FD__family_truncate, /* truncate */ + H5FD__family_lock, /* lock */ + H5FD__family_unlock, /* unlock */ + H5FD_FLMAP_DICHOTOMY /* fl_map */ }; @@ -203,7 +203,7 @@ done: /*--------------------------------------------------------------------------- - * Function: H5FD_family_term + * Function: H5FD__family_term * * Purpose: Shut down the VFD * @@ -215,15 +215,15 @@ done: *--------------------------------------------------------------------------- */ static herr_t -H5FD_family_term(void) +H5FD__family_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Reset VFL ID */ H5FD_FAMILY_g=0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_family_term() */ +} /* end H5FD__family_term() */ /*------------------------------------------------------------------------- @@ -242,13 +242,6 @@ H5FD_family_term(void) * 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. - * *------------------------------------------------------------------------- */ herr_t @@ -296,13 +289,6 @@ done: * 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. - * *------------------------------------------------------------------------- */ herr_t @@ -335,7 +321,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_family_fapl_get + * Function: H5FD__family_fapl_get * * Purpose: Gets a file access property list which could be used to * create an identical file. @@ -347,19 +333,17 @@ done: * Programmer: Robb Matzke * Friday, August 13, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_family_fapl_get(H5FD_t *_file) +H5FD__family_fapl_get(H5FD_t *_file) { H5FD_family_t *file = (H5FD_family_t*)_file; H5FD_family_fapl_t *fa = NULL; H5P_genplist_t *plist; /* Property list pointer */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(NULL == (fa = (H5FD_family_fapl_t *)H5MM_calloc(sizeof(H5FD_family_fapl_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -373,16 +357,16 @@ H5FD_family_fapl_get(H5FD_t *_file) ret_value=fa; done: - if(ret_value==NULL) { + if(ret_value==NULL) if(fa!=NULL) H5MM_xfree(fa); - } /* end if */ + FUNC_LEAVE_NOAPI(ret_value) } /*------------------------------------------------------------------------- - * Function: H5FD_family_fapl_copy + * Function: H5FD__family_fapl_copy * * Purpose: Copies the family-specific file access properties. * @@ -393,19 +377,17 @@ done: * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_family_fapl_copy(const void *_old_fa) +H5FD__family_fapl_copy(const void *_old_fa) { const H5FD_family_fapl_t *old_fa = (const H5FD_family_fapl_t*)_old_fa; H5FD_family_fapl_t *new_fa = NULL; H5P_genplist_t *plist; /* Property list pointer */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(NULL == (new_fa = (H5FD_family_fapl_t *)H5MM_malloc(sizeof(H5FD_family_fapl_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -428,16 +410,16 @@ H5FD_family_fapl_copy(const void *_old_fa) ret_value=new_fa; done: - if(ret_value==NULL) { + if(ret_value==NULL) if(new_fa!=NULL) H5MM_xfree(new_fa); - } /* end if */ + FUNC_LEAVE_NOAPI(ret_value) } /*------------------------------------------------------------------------- - * Function: H5FD_family_fapl_free + * Function: H5FD__family_fapl_free * * Purpose: Frees the family-specific file access properties. * @@ -448,17 +430,15 @@ done: * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_family_fapl_free(void *_fa) +H5FD__family_fapl_free(void *_fa) { H5FD_family_fapl_t *fa = (H5FD_family_fapl_t*)_fa; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5I_dec_ref(fa->memb_fapl_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close driver ID") @@ -470,7 +450,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_family_sb_size + * Function: H5FD__family_sb_size * * Purpose: Returns the size of the private information to be stored in * the superblock. @@ -482,14 +462,12 @@ done: * Programmer: Raymond Lu * Tuesday, May 10, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static hsize_t -H5FD_family_sb_size(H5FD_t H5_ATTR_UNUSED *_file) +H5FD__family_sb_size(H5FD_t H5_ATTR_UNUSED *_file) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* 8 bytes field for the size of member file size field should be * enough for now. */ @@ -498,7 +476,7 @@ H5FD_family_sb_size(H5FD_t H5_ATTR_UNUSED *_file) /*------------------------------------------------------------------------- - * Function: H5FD_family_sb_encode + * Function: H5FD__family_sb_encode * * Purpose: Encode driver information for the superblock. The NAME * argument is a nine-byte buffer which will be initialized with @@ -513,16 +491,14 @@ H5FD_family_sb_size(H5FD_t H5_ATTR_UNUSED *_file) * Programmer: Raymond Lu * Tuesday, May 10, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/) +H5FD__family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/) { H5FD_family_t *file = (H5FD_family_t*)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Name and version number */ HDstrncpy(name, "NCSAfami", (size_t)9); @@ -532,18 +508,18 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out* * This is to guarantee backward compatibility. If a file is created with * v1.6 library and the driver info isn't saved in the superblock. We open * it with v1.8, the FILE->MEMB_SIZE will be the actual size of the first - * member file (see H5FD_family_open). So it isn't safe to use FILE->MEMB_SIZE. + * member file (see H5FD__family_open). So it isn't safe to use FILE->MEMB_SIZE. * If the file is created with v1.8, the correctness of FILE->PMEM_SIZE is - * checked in H5FD_family_sb_decode. SLU - 2009/3/21 + * checked in H5FD__family_sb_decode. SLU - 2009/3/21 */ UINT64ENCODE(buf, (uint64_t)file->pmem_size); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_family_sb_encode() */ +} /* end H5FD__family_sb_encode() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_sb_decode + * Function: H5FD__family_sb_decode * * Purpose: This function has 2 separate purpose. One is to decodes the * superblock information for this driver. The NAME argument is @@ -561,13 +537,13 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out* *------------------------------------------------------------------------- */ static herr_t -H5FD_family_sb_decode(H5FD_t *_file, const char H5_ATTR_UNUSED *name, const unsigned char *buf) +H5FD__family_sb_decode(H5FD_t *_file, const char H5_ATTR_UNUSED *name, const unsigned char *buf) { H5FD_family_t *file = (H5FD_family_t*)_file; uint64_t msize; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Read member file size. Skip name template for now although it's saved. */ UINT64DECODE(buf, msize); @@ -594,11 +570,11 @@ H5FD_family_sb_decode(H5FD_t *_file, const char H5_ATTR_UNUSED *name, const unsi done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_sb_decode() */ +} /* end H5FD__family_sb_decode() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_open + * Function: H5FD__family_open * * Purpose: Creates and/or opens a family of files as an HDF5 file. * @@ -621,7 +597,7 @@ done: */ H5_GCC_DIAG_OFF(format-nonliteral) static H5FD_t * -H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, +H5FD__family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { H5FD_family_t *file = NULL; @@ -630,7 +606,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, unsigned t_flags = flags & ~H5F_ACC_CREAT; H5FD_t *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ if(!name || !*name) @@ -769,12 +745,12 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_open() */ +} /* end H5FD__family_open() */ H5_GCC_DIAG_ON(format-nonliteral) /*------------------------------------------------------------------------- - * Function: H5FD_family_close + * Function: H5FD__family_close * * Purpose: Closes a family of files. * @@ -790,14 +766,14 @@ H5_GCC_DIAG_ON(format-nonliteral) *------------------------------------------------------------------------- */ static herr_t -H5FD_family_close(H5FD_t *_file) +H5FD__family_close(H5FD_t *_file) { H5FD_family_t *file = (H5FD_family_t*)_file; unsigned nerrors = 0; /* Number of errors while closing member files */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Close as many members as possible. Use private function here to avoid clearing * the error stack. We need the error message to indicate wrong member file size. */ @@ -822,11 +798,11 @@ H5FD_family_close(H5FD_t *_file) H5MM_xfree(file); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_close() */ +} /* end H5FD__family_close() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_cmp + * Function: H5FD__family_cmp * * Purpose: Compares two file families to see if they are the same. It * does this by comparing the first member of the two families. @@ -839,18 +815,16 @@ H5FD_family_close(H5FD_t *_file) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static int -H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) +H5FD__family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { const H5FD_family_t *f1 = (const H5FD_family_t*)_f1; const H5FD_family_t *f2 = (const H5FD_family_t*)_f2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(f1->nmembs >= 1 && f1->memb[0]); HDassert(f2->nmembs >= 1 && f2->memb[0]); @@ -858,11 +832,11 @@ H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) ret_value = H5FDcmp(f1->memb[0], f2->memb[0]); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_cmp() */ +} /* end H5FD__family_cmp() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_query + * Function: H5FD__family_query * * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) @@ -876,11 +850,11 @@ H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) *------------------------------------------------------------------------- */ static herr_t -H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */) +H5FD__family_query(const H5FD_t * _file, unsigned long *flags /* out */) { const H5FD_family_t *file = (const H5FD_family_t*)_file; /* Family VFD info */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set the VFL feature flags that this driver supports */ if(flags) { @@ -896,11 +870,11 @@ H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */) } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_family_query() */ +} /* end H5FD__family_query() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_get_eoa + * Function: H5FD__family_get_eoa * * Purpose: Returns the end-of-address marker for the file. The EOA * marker is the first address past the last byte allocated in @@ -913,26 +887,21 @@ H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * Raymond Lu - * 21 Dec. 2006 - * Added the parameter TYPE. It's only used for MULTI driver. - * *------------------------------------------------------------------------- */ static haddr_t -H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_family_t *file = (const H5FD_family_t*)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eoa) } /*------------------------------------------------------------------------- - * Function: H5FD_family_set_eoa + * Function: H5FD__family_set_eoa * * Purpose: Set the end-of-address marker for the file. * @@ -943,11 +912,6 @@ H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * Raymond Lu - * 21 Dec. 2006 - * Added the parameter TYPE. It's only used for MULTI driver. - * *------------------------------------------------------------------------- */ /* Disable warning for "format not a string literal" here -QAK */ @@ -958,7 +922,7 @@ H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) */ H5_GCC_DIAG_OFF(format-nonliteral) static herr_t -H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa) +H5FD__family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa) { H5FD_family_t *file = (H5FD_family_t*)_file; haddr_t addr = abs_eoa; @@ -966,7 +930,7 @@ H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Allocate space for the member name buffer */ if(NULL == (memb_name = (char *)H5MM_malloc(H5FD_FAM_MEMB_NAME_BUF_SIZE))) @@ -1027,7 +991,7 @@ H5_GCC_DIAG_ON(format-nonliteral) /*------------------------------------------------------------------------- - * Function: H5FD_family_get_eof + * Function: H5FD__family_get_eof * * Purpose: Returns the end-of-file marker, which is the greater of * either the total family size or the current EOA marker. @@ -1041,19 +1005,17 @@ H5_GCC_DIAG_ON(format-nonliteral) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static haddr_t -H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type) +H5FD__family_get_eof(const H5FD_t *_file, H5FD_mem_t type) { const H5FD_family_t *file = (const H5FD_family_t*)_file; haddr_t eof=0; int i; /* Local index variable */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Find the last member that has a non-zero EOF and break out of the loop @@ -1085,7 +1047,7 @@ H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type) /*------------------------------------------------------------------------- - * Function: H5FD_family_get_handle + * Function: H5FD__family_get_handle * * Purpose: Returns the file handle of FAMILY file driver. * @@ -1094,12 +1056,10 @@ H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type) * Programmer: Raymond Lu * Sept. 16, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) +H5FD__family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) { H5FD_family_t *file = (H5FD_family_t *)_file; H5P_genplist_t *plist; @@ -1107,7 +1067,7 @@ H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) int memb; herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the plist structure and family offset */ if(NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS))) @@ -1127,7 +1087,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_family_read + * Function: H5FD__family_read * * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR * into buffer BUF according to data transfer properties in @@ -1141,12 +1101,10 @@ done: * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, +H5FD__family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *_buf/*out*/) { H5FD_family_t *file = (H5FD_family_t*)_file; @@ -1158,7 +1116,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Get the member data transfer property list. If the transfer property @@ -1197,7 +1155,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_family_write + * Function: H5FD__family_write * * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR * from buffer BUF according to data transfer properties in @@ -1210,12 +1168,10 @@ done: * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, +H5FD__family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *_buf) { H5FD_family_t *file = (H5FD_family_t*)_file; @@ -1227,7 +1183,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Get the member data transfer property list. If the transfer property @@ -1266,7 +1222,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_family_flush + * Function: H5FD__family_flush * * Purpose: Flushes all family members. * @@ -1279,13 +1235,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) +H5FD__family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) { H5FD_family_t *file = (H5FD_family_t*)_file; unsigned u, nerrors = 0; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC for(u = 0; u < file->nmembs; u++) if(file->memb[u] && H5FD_flush(file->memb[u], closing) < 0) @@ -1296,11 +1252,11 @@ H5FD_family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_flush() */ +} /* end H5FD__family_flush() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_truncate + * Function: H5FD__family_truncate * * Purpose: Truncates all family members. * @@ -1314,13 +1270,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) +H5FD__family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) { H5FD_family_t *file = (H5FD_family_t*)_file; unsigned u, nerrors = 0; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC for(u = 0; u < file->nmembs; u++) if(file->memb[u] && H5FD_truncate(file->memb[u], closing) < 0) @@ -1331,11 +1287,11 @@ H5FD_family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closin done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_truncate() */ +} /* end H5FD__family_truncate() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_lock + * Function: H5FD__family_lock * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": @@ -1349,13 +1305,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_family_lock(H5FD_t *_file, hbool_t rw) +H5FD__family_lock(H5FD_t *_file, hbool_t rw) { H5FD_family_t *file = (H5FD_family_t *)_file; /* VFD file struct */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Place the lock on all the member files */ for(u = 0; u < file->nmembs; u++) @@ -1379,11 +1335,11 @@ H5FD_family_lock(H5FD_t *_file, hbool_t rw) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_lock() */ +} /* end H5FD__family_lock() */ /*------------------------------------------------------------------------- - * Function: H5FD_family_unlock + * Function: H5FD__family_unlock * * Purpose: To remove the existing lock on the file * @@ -1394,13 +1350,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_family_unlock(H5FD_t *_file) +H5FD__family_unlock(H5FD_t *_file) { H5FD_family_t *file = (H5FD_family_t *)_file; /* VFD file struct */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Remove the lock on the member files */ for(u = 0; u < file->nmembs; u++) @@ -1410,5 +1366,5 @@ H5FD_family_unlock(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_family_unlock() */ +} /* end H5FD__family_unlock() */ diff --git a/src/H5FDfamily.h b/src/H5FDfamily.h index 1584cf6..45bdccc 100644 --- a/src/H5FDfamily.h +++ b/src/H5FDfamily.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 4, 1999 * * Purpose: The public header file for the family driver. diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c index 3d086ea..29d032e 100644 --- a/src/H5FDhdfs.c +++ b/src/H5FDhdfs.c @@ -20,9 +20,6 @@ * File System (HDFS). */ -/* This source code file is part of the H5FD driver module */ -#include "H5FDdrvr_module.h" - #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FDprivate.h" /* File drivers */ @@ -32,8 +29,12 @@ #include "H5MMprivate.h" /* Memory management */ #ifdef H5_HAVE_LIBHDFS + +/* This source code file is part of the H5FD driver module */ +#include "H5FDdrvr_module.h" + +/* HDFS routines */ #include "hdfs.h" -#endif /* toggle function call prints: 1 turns on */ #define HDFS_DEBUG 0 @@ -74,7 +75,7 @@ static hid_t H5FD_HDFS_g = 0; #define HDFS_STATS_POW(bin_i, out_ptr) { \ unsigned long long donotshadowresult = 1; \ unsigned donotshadowindex = 0; \ - for (donotshadowindex = 0; \ + for(donotshadowindex = 0; \ donotshadowindex < (((bin_i) * HDFS_STATS_INTERVAL) + \ HDFS_STATS_START_POWER); \ donotshadowindex++) \ @@ -118,8 +119,6 @@ static unsigned long long hdfs_stats_boundaries[HDFS_STATS_BIN_COUNT]; * * Programmer: Jacob Smith * - * Changes: None - * ***************************************************************************/ typedef struct { unsigned long long count; @@ -130,7 +129,6 @@ typedef struct { #endif /* HDFS_STATS */ -#ifdef H5_HAVE_LIBHDFS /* "unique" identifier for `hdfs_t` structures. * Randomly generated by unweighted dice rolls. @@ -146,9 +144,7 @@ typedef struct { * * Contain/retain information associated with a file hosted on Hadoop * Distributed File System (HDFS). Instantiated and populated via - * `H5FD_hdfs_handle_open()` and cleaned up via `H5FD_hdfs_handle_close()`. - * - * + * `H5FD__hdfs_handle_open()` and cleaned up via `H5FD__hdfs_handle_close()`. * * `magic` (unisgned long) * @@ -175,8 +171,6 @@ typedef struct { * Programmer: Jacob Smith * May 2018 * - * Changes: None - * *************************************************************************** */ typedef struct { @@ -187,194 +181,6 @@ typedef struct { } hdfs_t; -/*-------------------------------------------------------------------------- - * Function: H5FD_hdfs_handle_open - * - * Purpose: Create a HDFS file handle, 'opening' the target file. - * - * Return: Success: Pointer to HDFS container/handle of opened file. - * Failure: NULL - * - * Programmer: Gerd Herber - * May 2018 - * - * Changes: None. - *-------------------------------------------------------------------------- - */ -static hdfs_t * -H5FD_hdfs_handle_open( - const char *path, - const char *namenode_name, - const int32_t namenode_port, - const char *user_name, - const char *kerberos_ticket_cache, - const int32_t stream_buffer_size) -{ - struct hdfsBuilder *builder = NULL; - hdfs_t *handle = NULL; - hdfs_t *ret_value = NULL; - - FUNC_ENTER_NOAPI_NOINIT - -#if HDFS_DEBUG - HDfprintf(stdout, "called H5FD_hdfs_handle_open.\n"); -#endif - - if (path == NULL || path[0] == '\0') { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "path cannot be null.\n") - } - if (namenode_name == NULL /* || namenode_name[0] == '\0' */ ) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "namenode name cannot be null.\n") - } - if (namenode_port < 0 || namenode_port > 65535) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "namenode port must be non-negative and <= 65535.\n") - } - if (stream_buffer_size < 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "buffer size must non-negative.\n") - } - - handle = (hdfs_t *)H5MM_malloc(sizeof(hdfs_t)); - if (handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, - "could not malloc space for handle.\n") - } - - handle->magic = (unsigned long)HDFS_HDFST_MAGIC; - handle->filesystem = NULL; /* TODO: not a pointer; NULL may cause bug */ - handle->fileinfo = NULL; - handle->file = NULL; /* TODO: not a pointer; NULL may cause bug */ - - builder = hdfsNewBuilder(); - if (!builder) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "(hdfs) failed to create builder") - } - hdfsBuilderSetNameNode(builder, namenode_name); - hdfsBuilderSetNameNodePort(builder, (tPort)namenode_port); - if (user_name != NULL && user_name[0] != '\0') { - hdfsBuilderSetUserName(builder, user_name); - } - if (kerberos_ticket_cache != NULL && kerberos_ticket_cache[0] != '\0') { - hdfsBuilderSetKerbTicketCachePath(builder, kerberos_ticket_cache); - } - /* Call to `hdfsBuilderConnect` releases builder, regardless of success. */ - handle->filesystem = hdfsBuilderConnect(builder); - if (!handle->filesystem) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "(hdfs) could not connect to default namenode") - } - handle->fileinfo = hdfsGetPathInfo(handle->filesystem, path); - if (!handle->fileinfo) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "hdfsGetPathInfo failed") - } - handle->file = hdfsOpenFile( - handle->filesystem, - path, - O_RDONLY, - stream_buffer_size, - 0, - 0); - if (!handle->file) { - HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, - "(hdfs) could not open") - } - - ret_value = handle; - -done: - if (ret_value == NULL && handle != NULL) { - /* error; clean up */ - HDassert(handle->magic == HDFS_HDFST_MAGIC); - handle->magic++; - if (handle->file != NULL) { - if (FAIL == (hdfsCloseFile(handle->filesystem, handle->file))) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, - "unable to close hdfs file handle") - } - } - if (handle->fileinfo != NULL) { - hdfsFreeFileInfo(handle->fileinfo, 1); - } - if (handle->filesystem != NULL) { - if (FAIL == (hdfsDisconnect(handle->filesystem))) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, - "unable to disconnect from hdfs") - } - } - H5MM_xfree(handle); - } - - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5FD_hdfs_handle_open() */ - - -/*-------------------------------------------------------------------------- - * Function: H5FD_hdfs_handle_close - * - * Purpose: 'Close' an HDFS file container/handle, releasing underlying - * resources. - * - * Return: Success: `SUCCEED` (0) - * Failure: `FAIL` (-1) - * - * Programmer: Gerd Herber - * May 2018 - * - * Changes: None. - *-------------------------------------------------------------------------- - */ -static herr_t -H5FD_hdfs_handle_close(hdfs_t *handle) -{ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if HDFS_DEBUG - HDfprintf(stdout, "called H5FD_hdfs_close.\n"); -#endif - - if (handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle cannot be null.\n") - } - if (handle->magic != HDFS_HDFST_MAGIC) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle has invalid magic.\n") - } - - handle->magic++; - if (handle->file != NULL) { - if (FAIL == (hdfsCloseFile(handle->filesystem, handle->file))) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "unable to close hdfs file handle") - } - } - if (handle->fileinfo != NULL) { - hdfsFreeFileInfo(handle->fileinfo, 1); - } - if (handle->filesystem != NULL) { - if (FAIL == (hdfsDisconnect(handle->filesystem))) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "unable to disconnect hdfs file system") - } - } - - H5MM_xfree(handle); - -done: - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5FD_hdfs_close() */ - -#endif /* H5_HAVE_LIBHDFS */ - /*************************************************************************** * @@ -432,17 +238,13 @@ done: * * Programmer: Jacob Smith * - * Changes: None. - * *************************************************************************** */ typedef struct H5FD_hdfs_t { H5FD_t pub; H5FD_hdfs_fapl_t fa; haddr_t eoa; -#ifdef H5_HAVE_LIBHDFS hdfs_t *hdfs_handle; -#endif #if HDFS_STATS hdfs_statsbin meta[HDFS_STATS_BIN_COUNT + 1]; hdfs_statsbin raw[HDFS_STATS_BIN_COUNT + 1]; @@ -459,75 +261,72 @@ typedef struct H5FD_hdfs_t { * Only included if HDFS code should compile. * */ -#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) -#ifdef H5_HAVE_LIBHDFS +#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) #define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR)) -#endif /* H5_HAVE_LIBHDFS */ /* Prototypes */ -static herr_t H5FD_hdfs_term(void); -static void *H5FD_hdfs_fapl_get(H5FD_t *_file); -static void *H5FD_hdfs_fapl_copy(const void *_old_fa); -static herr_t H5FD_hdfs_fapl_free(void *_fa); -static H5FD_t *H5FD_hdfs_open(const char *name, unsigned flags, hid_t fapl_id, +static herr_t H5FD__hdfs_term(void); +static void *H5FD__hdfs_fapl_get(H5FD_t *_file); +static void *H5FD__hdfs_fapl_copy(const void *_old_fa); +static herr_t H5FD__hdfs_fapl_free(void *_fa); +static H5FD_t *H5FD__hdfs_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_hdfs_close(H5FD_t *_file); -static int H5FD_hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_hdfs_query(const H5FD_t *_f1, unsigned long *flags); -static haddr_t H5FD_hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_hdfs_get_handle(H5FD_t *_file, hid_t fapl, +static herr_t H5FD__hdfs_close(H5FD_t *_file); +static int H5FD__hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD__hdfs_query(const H5FD_t *_f1, unsigned long *flags); +static haddr_t H5FD__hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static haddr_t H5FD__hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__hdfs_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); -static herr_t H5FD_hdfs_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, +static herr_t H5FD__hdfs_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD_hdfs_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, +static herr_t H5FD__hdfs_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_hdfs_truncate(H5FD_t *_file, hid_t dxpl_id, +static herr_t H5FD__hdfs_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_hdfs_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_hdfs_unlock(H5FD_t *_file); -static herr_t H5FD_hdfs_validate_config(const H5FD_hdfs_fapl_t * fa); +static herr_t H5FD__hdfs_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__hdfs_unlock(H5FD_t *_file); + +static herr_t H5FD__hdfs_validate_config(const H5FD_hdfs_fapl_t * fa); static const H5FD_class_t H5FD_hdfs_g = { "hdfs", /* name */ MAXADDR, /* maxaddr */ H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_hdfs_term, /* terminate */ + H5FD__hdfs_term, /* terminate */ NULL, /* sb_size */ NULL, /* sb_encode */ NULL, /* sb_decode */ sizeof(H5FD_hdfs_fapl_t), /* fapl_size */ - H5FD_hdfs_fapl_get, /* fapl_get */ - H5FD_hdfs_fapl_copy, /* fapl_copy */ - H5FD_hdfs_fapl_free, /* fapl_free */ + H5FD__hdfs_fapl_get, /* fapl_get */ + H5FD__hdfs_fapl_copy, /* fapl_copy */ + H5FD__hdfs_fapl_free, /* fapl_free */ 0, /* dxpl_size */ NULL, /* dxpl_copy */ NULL, /* dxpl_free */ - H5FD_hdfs_open, /* open */ - H5FD_hdfs_close, /* close */ - H5FD_hdfs_cmp, /* cmp */ - H5FD_hdfs_query, /* query */ + H5FD__hdfs_open, /* open */ + H5FD__hdfs_close, /* close */ + H5FD__hdfs_cmp, /* cmp */ + H5FD__hdfs_query, /* query */ NULL, /* get_type_map */ NULL, /* alloc */ NULL, /* free */ - H5FD_hdfs_get_eoa, /* get_eoa */ - H5FD_hdfs_set_eoa, /* set_eoa */ - H5FD_hdfs_get_eof, /* get_eof */ - H5FD_hdfs_get_handle, /* get_handle */ - H5FD_hdfs_read, /* read */ - H5FD_hdfs_write, /* write */ + H5FD__hdfs_get_eoa, /* get_eoa */ + H5FD__hdfs_set_eoa, /* set_eoa */ + H5FD__hdfs_get_eof, /* get_eof */ + H5FD__hdfs_get_handle, /* get_handle */ + H5FD__hdfs_read, /* read */ + H5FD__hdfs_write, /* write */ NULL, /* flush */ - H5FD_hdfs_truncate, /* truncate */ - H5FD_hdfs_lock, /* lock */ - H5FD_hdfs_unlock, /* unlock */ + H5FD__hdfs_truncate, /* truncate */ + H5FD__hdfs_lock, /* lock */ + H5FD__hdfs_unlock, /* unlock */ H5FD_FLMAP_DICHOTOMY /* fl_map */ }; -#ifdef H5_HAVE_LIBHDFS /* Declare a free list to manage the H5FD_hdfs_t struct */ H5FL_DEFINE_STATIC(H5FD_hdfs_t); -#endif /* H5_HAVE_LIBHDFS */ /*------------------------------------------------------------------------- @@ -537,9 +336,6 @@ H5FL_DEFINE_STATIC(H5FD_hdfs_t); * * Return: Non-negative on success/Negative on failure * - * Changes: Rename as appropriate for hdfs vfd. - * Jacob Smith 2018 - * *------------------------------------------------------------------------- */ static herr_t @@ -549,14 +345,11 @@ H5FD__init_package(void) FUNC_ENTER_STATIC - if (H5FD_hdfs_init() < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, - "unable to initialize hdfs VFD") - } + if(H5FD_hdfs_init() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize hdfs VFD") done: FUNC_LEAVE_NOAPI(ret_value) - } /* H5FD__init_package() */ @@ -584,11 +377,11 @@ H5FD_hdfs_init(void) FUNC_ENTER_NOAPI(FAIL) #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_init() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif if(H5I_VFL != H5I_get_type(H5FD_HDFS_g)) - H5FD_HDFS_g = H5FD_register( &H5FD_hdfs_g, sizeof(H5FD_class_t), FALSE); + H5FD_HDFS_g = H5FD_register(&H5FD_hdfs_g, sizeof(H5FD_class_t), FALSE); #if HDFS_STATS /* pre-compute statsbin boundaries @@ -609,7 +402,7 @@ done: /*--------------------------------------------------------------------------- - * Function: H5FD_hdfs_term + * Function: H5FD__hdfs_term * * Purpose: Shut down the VFD * @@ -618,82 +411,162 @@ done: * Programmer: Quincey Koziol * Friday, Jan 30, 2004 * - * Changes: Rename as appropriate for hdfs vfd. - * Jacob Smith 2018 - * *--------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_term(void) +H5FD__hdfs_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_term() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif /* Reset VFL ID */ H5FD_HDFS_g = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_hdfs_term() */ +} /* end H5FD__hdfs_term() */ -/*------------------------------------------------------------------------- - * Function: H5Pset_fapl_hdfs - * - * Purpose: Modify the file access property list to use the H5FD_HDFS - * driver defined in this source file. All driver specfic - * properties are passed in as a pointer to a suitably - * initialized instance of H5FD_hdfs_fapl_t +/*-------------------------------------------------------------------------- + * Function: H5FD__hdfs_handle_open * - * Return: SUCCEED/FAIL + * Purpose: Create a HDFS file handle, 'opening' the target file. * - * Programmer: John Mainzer - * 9/10/17 + * Return: Success: Pointer to HDFS container/handle of opened file. + * Failure: NULL * - * Changes: Rename as appropriate for hdfs vfd. - * Jacob Smith 2018 + * Programmer: Gerd Herber + * May 2018 * - *------------------------------------------------------------------------- + *-------------------------------------------------------------------------- */ -herr_t -H5Pset_fapl_hdfs(hid_t fapl_id, - H5FD_hdfs_fapl_t *fa) +static hdfs_t * +H5FD__hdfs_handle_open(const char *path, const char *namenode_name, + const int32_t namenode_port, const char *user_name, + const char *kerberos_ticket_cache, const int32_t stream_buffer_size) { - H5P_genplist_t *plist = NULL; /* Property list pointer */ - herr_t ret_value = FAIL; - - FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, fa); + struct hdfsBuilder *builder = NULL; + hdfs_t *handle = NULL; + hdfs_t *ret_value = NULL; - HDassert(fa != NULL); + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDfprintf(stdout, "H5Pset_fapl_hdfs() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif - plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); - if (plist == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, \ - "not a file access property list") - } + if(path == NULL || path[0] == '\0') + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "path cannot be null") + if(namenode_name == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "namenode name cannot be null") + if(namenode_port < 0 || namenode_port > 65535) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "namenode port must be non-negative and <= 65535") + if(stream_buffer_size < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "buffer size must non-negative") - if (FAIL == H5FD_hdfs_validate_config(fa)) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "invalid hdfs config") - } + handle = (hdfs_t *)H5MM_malloc(sizeof(hdfs_t)); + if(handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "could not malloc space for handle") - ret_value = H5P_set_driver(plist, H5FD_HDFS, (void *)fa); + handle->magic = (unsigned long)HDFS_HDFST_MAGIC; + handle->filesystem = NULL; /* TODO: not a pointer; NULL may cause bug */ + handle->fileinfo = NULL; + handle->file = NULL; /* TODO: not a pointer; NULL may cause bug */ + + builder = hdfsNewBuilder(); + if(!builder) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "(hdfs) failed to create builder") + hdfsBuilderSetNameNode(builder, namenode_name); + hdfsBuilderSetNameNodePort(builder, (tPort)namenode_port); + if(user_name != NULL && user_name[0] != '\0') + hdfsBuilderSetUserName(builder, user_name); + if(kerberos_ticket_cache != NULL && kerberos_ticket_cache[0] != '\0') + hdfsBuilderSetKerbTicketCachePath(builder, kerberos_ticket_cache); + + /* Call to `hdfsBuilderConnect` releases builder, regardless of success. */ + handle->filesystem = hdfsBuilderConnect(builder); + if(!handle->filesystem) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "(hdfs) could not connect to default namenode") + handle->fileinfo = hdfsGetPathInfo(handle->filesystem, path); + if(!handle->fileinfo) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "hdfsGetPathInfo failed") + handle->file = hdfsOpenFile(handle->filesystem, path, O_RDONLY, stream_buffer_size, 0, 0); + if(!handle->file) + HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "(hdfs) could not open") + + ret_value = handle; done: - FUNC_LEAVE_API(ret_value) + if(ret_value == NULL && handle != NULL) { + /* error; clean up */ + HDassert(handle->magic == HDFS_HDFST_MAGIC); + handle->magic++; + if(handle->file != NULL) + if(FAIL == (hdfsCloseFile(handle->filesystem, handle->file))) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to close hdfs file handle") + if(handle->fileinfo != NULL) + hdfsFreeFileInfo(handle->fileinfo, 1); + if(handle->filesystem != NULL) + if(FAIL == (hdfsDisconnect(handle->filesystem))) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to disconnect from hdfs") + H5MM_xfree(handle); + } -} /* H5Pset_fapl_hdfs() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* H5FD__hdfs_handle_open() */ + + +/*-------------------------------------------------------------------------- + * Function: H5FD__hdfs_handle_close + * + * Purpose: 'Close' an HDFS file container/handle, releasing underlying + * resources. + * + * Return: Success: `SUCCEED` (0) + * Failure: `FAIL` (-1) + * + * Programmer: Gerd Herber + * May 2018 + * + *-------------------------------------------------------------------------- + */ +static herr_t +H5FD__hdfs_handle_close(hdfs_t *handle) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + +#if HDFS_DEBUG + HDfprintf(stdout, "called %s.\n", FUNC); +#endif + + if(handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null") + if(handle->magic != HDFS_HDFST_MAGIC) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic") + + handle->magic++; + if(handle->file != NULL) + if(FAIL == (hdfsCloseFile(handle->filesystem, handle->file))) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close hdfs file handle") + if(handle->fileinfo != NULL) + hdfsFreeFileInfo(handle->fileinfo, 1); + if(handle->filesystem != NULL) + if(FAIL == (hdfsDisconnect(handle->filesystem))) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to disconnect hdfs file system") + + H5MM_xfree(handle); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5FD__hdfs_handle_close() */ /*------------------------------------------------------------------------- - * Function: H5FD_hdfs_validate_config() + * Function: H5FD__hdfs_validate_config() * * Purpose: Test to see if the supplied instance of H5FD_hdfs_fapl_t * contains internally consistant data. Return SUCCEED if so, @@ -710,37 +583,70 @@ done: * Programmer: Jacob Smith * 9/10/17 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_validate_config(const H5FD_hdfs_fapl_t * fa) +H5FD__hdfs_validate_config(const H5FD_hdfs_fapl_t * fa) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(fa != NULL); - if ( fa->version != H5FD__CURR_HDFS_FAPL_T_VERSION ) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Unknown H5FD_hdfs_fapl_t version"); - } - - if ( fa->namenode_port > 65535 ) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Invalid namenode port number"); - } - if ( fa->namenode_port < 0 ) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Invalid namenode port number"); - } + if(fa->version != H5FD__CURR_HDFS_FAPL_T_VERSION) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_hdfs_fapl_t version"); + if(fa->namenode_port > 65535) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid namenode port number"); + if(fa->namenode_port < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid namenode port number"); done: FUNC_LEAVE_NOAPI(ret_value) +} /* H5FD__hdfs_validate_config() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pset_fapl_hdfs + * + * Purpose: Modify the file access property list to use the H5FD_HDFS + * driver defined in this source file. All driver specfic + * properties are passed in as a pointer to a suitably + * initialized instance of H5FD_hdfs_fapl_t + * + * Return: SUCCEED/FAIL + * + * Programmer: John Mainzer + * 9/10/17 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa) +{ + H5P_genplist_t *plist = NULL; /* Property list pointer */ + herr_t ret_value = FAIL; -} /* H5FD_hdfs_validate_config() */ + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*x", fapl_id, fa); + + HDassert(fa != NULL); + +#if HDFS_DEBUG + HDfprintf(stdout, "called %s.\n", FUNC); +#endif + + plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); + if(plist == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") + if(FAIL == H5FD__hdfs_validate_config(fa)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid hdfs config") + + ret_value = H5P_set_driver(plist, H5FD_HDFS, (void *)fa); + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Pset_fapl_hdfs() */ /*------------------------------------------------------------------------- @@ -756,13 +662,10 @@ done: * Programmer: John Mainzer * 9/10/17 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t -H5Pget_fapl_hdfs(hid_t fapl_id, - H5FD_hdfs_fapl_t *fa_out) +H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out) { const H5FD_hdfs_fapl_t *fa = NULL; H5P_genplist_t *plist = NULL; @@ -772,40 +675,31 @@ H5Pget_fapl_hdfs(hid_t fapl_id, H5TRACE2("e", "i*x", fapl_id, fa_out); #if HDFS_DEBUG - HDfprintf(stdout, "H5Pget_fapl_hdfs() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif - if (fa_out == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "fa_out is NULL") - } + if(fa_out == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL") plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); - if (plist == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, - "not a file access list") - } - if (H5FD_HDFS != H5P_peek_driver(plist)) { - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, - "incorrect VFL driver") - } + if(plist == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") + if(H5FD_HDFS != H5P_peek_driver(plist)) + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver") fa = (const H5FD_hdfs_fapl_t *)H5P_peek_driver_info(plist); - if (fa == NULL) { - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, - "bad VFL driver info") - } + if(fa == NULL) + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info") /* Copy the hdfs fapl data out */ HDmemcpy(fa_out, fa, sizeof(H5FD_hdfs_fapl_t)); done: FUNC_LEAVE_API(ret_value) - } /* H5Pget_fapl_hdfs() */ /*------------------------------------------------------------------------- - * Function: H5FD_hdfs_fapl_get + * Function: H5FD__hdfs_fapl_get * * Purpose: Gets a file access property list which could be used to * create an identical file. @@ -817,24 +711,20 @@ done: * Programmer: John Mainzer * 9/8/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_hdfs_fapl_get(H5FD_t *_file) +H5FD__hdfs_fapl_get(H5FD_t *_file) { H5FD_hdfs_t *file = (H5FD_hdfs_t*)_file; H5FD_hdfs_fapl_t *fa = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC fa = (H5FD_hdfs_fapl_t *)H5MM_calloc(sizeof(H5FD_hdfs_fapl_t)); - if (fa == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "memory allocation failed") - } + if(fa == NULL) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed") /* Copy the fields of the structure */ HDmemcpy(fa, &(file->fa), sizeof(H5FD_hdfs_fapl_t)); @@ -842,17 +732,15 @@ H5FD_hdfs_fapl_get(H5FD_t *_file) ret_value = fa; done: - if (ret_value == NULL && fa != NULL) { + if(ret_value == NULL && fa != NULL) H5MM_xfree(fa); /* clean up on error */ - } FUNC_LEAVE_NOAPI(ret_value) - -} /* H5FD_hdfs_fapl_get() */ +} /* H5FD__hdfs_fapl_get() */ /*------------------------------------------------------------------------- - * Function: H5FD_hdfs_fapl_copy + * Function: H5FD__hdfs_fapl_copy * * Purpose: Copies the hdfs-specific file access properties. * @@ -863,40 +751,34 @@ done: * Programmer: John Mainzer * 9/8/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_hdfs_fapl_copy(const void *_old_fa) +H5FD__hdfs_fapl_copy(const void *_old_fa) { const H5FD_hdfs_fapl_t *old_fa = (const H5FD_hdfs_fapl_t*)_old_fa; H5FD_hdfs_fapl_t *new_fa = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC new_fa = (H5FD_hdfs_fapl_t *)H5MM_malloc(sizeof(H5FD_hdfs_fapl_t)); - if (new_fa == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "memory allocation failed") - } + if(new_fa == NULL) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed") HDmemcpy(new_fa, old_fa, sizeof(H5FD_hdfs_fapl_t)); ret_value = new_fa; done: - if (ret_value == NULL && new_fa != NULL) { + if(ret_value == NULL && new_fa != NULL) H5MM_xfree(new_fa); /* clean up on error */ - } FUNC_LEAVE_NOAPI(ret_value) - -} /* H5FD_hdfs_fapl_copy() */ +} /* H5FD__hdfs_fapl_copy() */ /*------------------------------------------------------------------------- - * Function: H5FD_hdfs_fapl_free + * Function: H5FD__hdfs_fapl_free * * Purpose: Frees the hdfs-specific file access properties. * @@ -905,30 +787,27 @@ done: * Programmer: John Mainzer * 9/8/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_fapl_free(void *_fa) +H5FD__hdfs_fapl_free(void *_fa) { H5FD_hdfs_fapl_t *fa = (H5FD_hdfs_fapl_t*)_fa; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(fa != NULL); /* sanity check */ H5MM_xfree(fa); FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5FD__hdfs_fapl_free() */ -} /* H5FD_hdfs_fapl_free() */ #if HDFS_STATS - /*---------------------------------------------------------------------------- * - * Function: hdfs_reset_stats() + * Function: hdfs__reset_stats() * * Purpose: * @@ -945,28 +824,24 @@ H5FD_hdfs_fapl_free(void *_fa) * Programmer: Jacob Smith * 2017-12-08 * - * Changes: None. - * *---------------------------------------------------------------------------- */ static herr_t -hdfs_reset_stats(H5FD_hdfs_t *file) +hdfs__reset_stats(H5FD_hdfs_t *file) { unsigned i = 0; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDprintf("hdfs_reset_stats() called\n"); + HDprintf("hdfs__reset_stats() called\n"); #endif - if (file == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "file was null") - } + if(file == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file was null") - for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) { + for(i = 0; i <= HDFS_STATS_BIN_COUNT; i++) { file->raw[i].bytes = 0; file->raw[i].count = 0; file->raw[i].min = (unsigned long long)HDFS_STATS_STARTING_MIN; @@ -981,13 +856,13 @@ hdfs_reset_stats(H5FD_hdfs_t *file) done: FUNC_LEAVE_NOAPI(ret_value); -} /* hdfs_reset_stats */ +} /* hdfs__reset_stats */ #endif /* HDFS_STATS */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_open() + * Function: H5FD__hdfs_open() * * Purpose: * @@ -1006,137 +881,78 @@ done: * Programmer: Jacob Smith * 2017-11-02 * - * Changes: None. - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS static H5FD_t * -H5FD_hdfs_open( - const char *path, - unsigned flags, - hid_t fapl_id, - haddr_t maxaddr) +H5FD__hdfs_open(const char *path, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { H5FD_t *ret_value = NULL; H5FD_hdfs_t *file = NULL; hdfs_t *handle = NULL; H5FD_hdfs_fapl_t fa; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_open() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif /* HDFS_DEBUG */ /* Sanity check on file offsets */ HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t)); /* Check arguments */ - if (!path || !*path) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "invalid file name") - } - if (0 == maxaddr || HADDR_UNDEF == maxaddr) { - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, - "bogus maxaddr") - } - if (ADDR_OVERFLOW(maxaddr)) { - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, - "bogus maxaddr") - } - if (flags != H5F_ACC_RDONLY) { - HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, - "only Read-Only access allowed") - } - if (fapl_id == H5P_DEFAULT || fapl_id == H5P_FILE_ACCESS_DEFAULT) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "fapl cannot be H5P_DEFAULT") - } - if (FAIL == H5Pget_fapl_hdfs(fapl_id, &fa)) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "can't get property list") - } - - handle = H5FD_hdfs_handle_open( - path, - fa.namenode_name, - fa.namenode_port, - fa.user_name, - fa.kerberos_ticket_cache, - fa.stream_buffer_size); - - if (handle == NULL) { - HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, - "could not open") - } + if(!path || !*path) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name") + if(0 == maxaddr || HADDR_UNDEF == maxaddr) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr") + if(ADDR_OVERFLOW(maxaddr)) + HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr") + if(flags != H5F_ACC_RDONLY) + HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, "only Read-Only access allowed") + if(fapl_id == H5P_DEFAULT || fapl_id == H5P_FILE_ACCESS_DEFAULT) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "fapl cannot be H5P_DEFAULT") + if(FAIL == H5Pget_fapl_hdfs(fapl_id, &fa)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't get property list") + + handle = H5FD__hdfs_handle_open(path, fa.namenode_name, fa.namenode_port, + fa.user_name, fa.kerberos_ticket_cache, fa.stream_buffer_size); + if(handle == NULL) + HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "could not open") HDassert(handle->magic == HDFS_HDFST_MAGIC); - /* create new file struct - */ + /* Create new file struct */ file = H5FL_CALLOC(H5FD_hdfs_t); - if (file == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "unable to allocate file struct") - } + if(file == NULL) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate file struct") file->hdfs_handle = handle; HDmemcpy(&(file->fa), &fa, sizeof(H5FD_hdfs_fapl_t)); #if HDFS_STATS - if (FAIL == hdfs_reset_stats(file)) { - HGOTO_ERROR(H5E_INTERNAL, H5E_UNINITIALIZED, NULL, - "unable to reset file statistics") - } + if(FAIL == hdfs__reset_stats(file)) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNINITIALIZED, NULL, "unable to reset file statistics") #endif /* HDFS_STATS */ ret_value = (H5FD_t*)file; done: - if (ret_value == NULL) { - if (handle != NULL) { - if (FAIL == H5FD_hdfs_handle_close(handle)) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, - "unable to close HDFS file handle") - } - } - if (file != NULL) { + if(ret_value == NULL) { + if(handle != NULL) + if(FAIL == H5FD__hdfs_handle_close(handle)) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to close HDFS file handle") + if(file != NULL) file = H5FL_FREE(H5FD_hdfs_t, file); - } } /* end if null return value (error) */ FUNC_LEAVE_NOAPI(ret_value) +} /* H5FD__hdfs_open() */ -} /* H5FD_hdfs_open() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static H5FD_t * -H5FD_hdfs_open( - const char H5_ATTR_UNUSED *path, - unsigned H5_ATTR_UNUSED flags, - hid_t H5_ATTR_UNUSED fapl_id, - haddr_t H5_ATTR_UNUSED maxaddr) -{ - H5FD_t *ret_value = NULL; - - FUNC_ENTER_NOAPI_NOINIT - - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, - "Illegal open of unsupported virtual file (hdfs)"); - -done: - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5FD_hdfs_open() */ - -#endif /* H5_HAVE_LIBHDFS */ #if HDFS_STATS /*---------------------------------------------------------------------------- * - * Function: hdfs_fprint_stats() + * Function: hdfs__fprint_stats() * * Purpose: * @@ -1186,14 +1002,10 @@ done: * * Programmer: Jacob Smith * - * Changes: None. - * *---------------------------------------------------------------------------- */ static herr_t -hdfs_fprint_stats( - FILE *stream, - const H5FD_hdfs_t *file) +hdfs__fprint_stats(FILE *stream, const H5FD_hdfs_t *file) { herr_t ret_value = SUCCEED; parsed_url_t *purl = NULL; @@ -1212,49 +1024,43 @@ hdfs_fprint_stats( unsigned suffix_i = 0; const char suffixes[] = { ' ', 'K', 'M', 'G', 'T', 'P' }; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - if (stream == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "file stream cannot be null" ) - } - if (file == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "file cannot be null") - } - if (file->hdfs_handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "hdfs handle cannot be null") - } - if (file->hdfs_handle->magic != HDFS_HDFST_MAGIC) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "hdfs handle has invalid magic") - } + if(stream == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file stream cannot be null") + if(file == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file cannot be null") + if(file->hdfs_handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hdfs handle cannot be null") + if(file->hdfs_handle->magic != HDFS_HDFST_MAGIC) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hdfs handle has invalid magic") /******************* * AGGREGATE STATS * *******************/ - for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) { + for(i = 0; i <= HDFS_STATS_BIN_COUNT; i++) { const hdfs_statsbin *r = &file->raw[i]; const hdfs_statsbin *m = &file->meta[i]; - if (m->min < min_meta) { min_meta = m->min; } - if (r->min < min_raw) { min_raw = r->min; } - if (m->max > max_meta) { max_meta = m->max; } - if (r->max > max_raw) { max_raw = r->max; } + if(m->min < min_meta) + min_meta = m->min; + if(r->min < min_raw) + min_raw = r->min; + if(m->max > max_meta) + max_meta = m->max; + if(r->max > max_raw) + max_raw = r->max; count_raw += r->count; count_meta += m->count; bytes_raw += r->bytes; bytes_meta += m->bytes; } - if (count_raw > 0) { + if(count_raw > 0) average_raw = (double)bytes_raw / (double)count_raw; - } - if (count_meta > 0) { + if(count_meta > 0) average_meta = (double)bytes_meta / (double)count_meta; - } /****************** * PRINT OVERVIEW * @@ -1265,9 +1071,8 @@ hdfs_fprint_stats( HDfprintf(stream, "TOTAL BYTES: %llu (%llu meta, %llu raw)\n", bytes_raw + bytes_meta, bytes_meta, bytes_raw); - if (count_raw + count_meta == 0) { + if(count_raw + count_meta == 0) goto done; - } /************************* * PRINT AGGREGATE STATS * @@ -1275,55 +1080,49 @@ hdfs_fprint_stats( HDfprintf(stream, "SIZES meta raw\n"); HDfprintf(stream, " min "); - if (count_meta == 0) { + if(count_meta == 0) HDfprintf(stream, " 0.000 "); - } else { + else { re_dub = (double)min_meta; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) { + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); } - if (count_raw == 0) { + if(count_raw == 0) HDfprintf(stream, " 0.000 \n"); - } else { + else { re_dub = (double)min_raw; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) { + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); } HDfprintf(stream, " avg "); re_dub = (double)average_meta; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) { + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); re_dub = (double)average_raw; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) { + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); HDfprintf(stream, " max "); re_dub = (double)max_meta; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) { + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); re_dub = (double)max_raw; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) { + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); @@ -1336,7 +1135,7 @@ hdfs_fprint_stats( HDfprintf(stream, " up-to meta raw meta raw meta raw\n"); - for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) { + for(i = 0; i <= HDFS_STATS_BIN_COUNT; i++) { const hdfs_statsbin *m; const hdfs_statsbin *r; unsigned long long range_end = 0; @@ -1351,55 +1150,47 @@ hdfs_fprint_stats( m = &file->meta[i]; r = &file->raw[i]; - if (r->count == 0 && m->count == 0) { + if(r->count == 0 && m->count == 0) continue; - } range_end = hdfs_stats_boundaries[i]; - if (i == HDFS_STATS_BIN_COUNT) { + if(i == HDFS_STATS_BIN_COUNT) { range_end = hdfs_stats_boundaries[i-1]; HDfprintf(stream, ">"); - } else { - HDfprintf(stream, " "); } + else + HDfprintf(stream, " "); bm_val = (double)m->bytes; - for (suffix_i = 0; bm_val >= 1024.0; suffix_i++) { + for(suffix_i = 0; bm_val >= 1024.0; suffix_i++) bm_val /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); bm_suffix = suffixes[suffix_i]; br_val = (double)r->bytes; - for (suffix_i = 0; br_val >= 1024.0; suffix_i++) { + for(suffix_i = 0; br_val >= 1024.0; suffix_i++) br_val /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); br_suffix = suffixes[suffix_i]; - if (m->count > 0) { + if(m->count > 0) am_val = (double)(m->bytes) / (double)(m->count); - } - for (suffix_i = 0; am_val >= 1024.0; suffix_i++) { + for(suffix_i = 0; am_val >= 1024.0; suffix_i++) am_val /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); am_suffix = suffixes[suffix_i]; - if (r->count > 0) { + if(r->count > 0) ar_val = (double)(r->bytes) / (double)(r->count); - } - for (suffix_i = 0; ar_val >= 1024.0; suffix_i++) { + for(suffix_i = 0; ar_val >= 1024.0; suffix_i++) ar_val /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); ar_suffix = suffixes[suffix_i]; re_dub = (double)range_end; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) { + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - } HDassert(suffix_i < sizeof(suffixes)); HDfprintf( @@ -1412,18 +1203,18 @@ hdfs_fprint_stats( br_val, br_suffix, /* rawdata bytes */ am_val, am_suffix, /* metadata average */ ar_val, ar_suffix); /* rawdata average */ - fflush(stream); + HDfflush(stream); } done: FUNC_LEAVE_NOAPI(ret_value); -} /* hdfs_fprint_stats */ +} /* hdfs__fprint_stats */ #endif /* HDFS_STATS */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_close() + * Function: H5FD__hdfs_close() * * Purpose: * @@ -1436,77 +1227,47 @@ done: * Programmer: Jacob Smith * 2017-11-02 * - * Changes: None. - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS - static herr_t -H5FD_hdfs_close(H5FD_t *_file) +H5FD__hdfs_close(H5FD_t *_file) { herr_t ret_value = SUCCEED; H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_close() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif - /* Sanity checks - */ + /* Sanity checks */ HDassert(file != NULL); HDassert(file->hdfs_handle != NULL); HDassert(file->hdfs_handle->magic == HDFS_HDFST_MAGIC); - /* Close the underlying request handle - */ - if (file->hdfs_handle != NULL) { - if (FAIL == H5FD_hdfs_handle_close(file->hdfs_handle)) { - HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "unable to close HDFS file handle") - } - } + /* Close the underlying request handle */ + if(file->hdfs_handle != NULL) + if(FAIL == H5FD__hdfs_handle_close(file->hdfs_handle)) + HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close HDFS file handle") #if HDFS_STATS /* TODO: mechanism to re-target stats printout */ - if (FAIL == hdfs_fprint_stats(stdout, file)) { - HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL, - "problem while writing file statistics") - } + if(FAIL == hdfs__fprint_stats(stdout, file)) + HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL, "problem while writing file statistics") #endif /* HDFS_STATS */ - /* Release the file info - */ + /* Release the file info */ file = H5FL_FREE(H5FD_hdfs_t, file); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_hdfs_close() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static herr_t -H5FD_hdfs_close(H5FD_t H5_ATTR_UNUSED *_file) -{ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "Illegal close of unsupported Virtual File (hdfs)") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_hdfs_close() */ - -#endif /* H5_HAVE_LIBHDFS */ +} /* end H5FD__hdfs_close() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_cmp() + * Function: H5FD__hdfs_cmp() * * Purpose: * @@ -1520,19 +1281,10 @@ done: * Programmer: Gerd Herber * May 2018 * - * Changes: - * - * + Replace `if (ret_value == 0)` chain with `HGOTO_DONE` jumps. - * Jacob Smith 17 May 2018 - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS - static int -H5FD_hdfs_cmp( - const H5FD_t *_f1, - const H5FD_t *_f2) +H5FD__hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { int ret_value = 0; const H5FD_hdfs_t *f1 = (const H5FD_hdfs_t *)_f1; @@ -1540,10 +1292,10 @@ H5FD_hdfs_cmp( hdfsFileInfo *finfo1 = NULL; hdfsFileInfo *finfo2 = NULL; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_cmp() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif /* HDFS_DEBUG */ HDassert(f1->hdfs_handle != NULL); @@ -1556,40 +1308,24 @@ H5FD_hdfs_cmp( HDassert(finfo1 != NULL); HDassert(finfo2 != NULL); - if (finfo1->mKind != finfo2->mKind) { HGOTO_DONE(-1); } - if (finfo1->mName != finfo2->mName) { HGOTO_DONE(-1); } - if (finfo1->mLastMod != finfo2->mLastMod) { HGOTO_DONE(-1); } - if (finfo1->mSize != finfo2->mSize) { HGOTO_DONE(-1); } - if (finfo1->mReplication != finfo2->mReplication) { HGOTO_DONE(-1); } - if (finfo1->mBlockSize != finfo2->mBlockSize) { HGOTO_DONE(-1); } - if (strcmp(finfo1->mOwner, finfo2->mOwner)) { HGOTO_DONE(-1); } - if (strcmp(finfo1->mGroup, finfo2->mGroup)) { HGOTO_DONE(-1); } - if (finfo1->mPermissions != finfo2->mPermissions) { HGOTO_DONE(-1); } - if (finfo1->mLastAccess != finfo2->mLastAccess) { HGOTO_DONE(-1); } + if(finfo1->mKind != finfo2->mKind) { HGOTO_DONE(-1); } + if(finfo1->mName != finfo2->mName) { HGOTO_DONE(-1); } + if(finfo1->mLastMod != finfo2->mLastMod) { HGOTO_DONE(-1); } + if(finfo1->mSize != finfo2->mSize) { HGOTO_DONE(-1); } + if(finfo1->mReplication != finfo2->mReplication) { HGOTO_DONE(-1); } + if(finfo1->mBlockSize != finfo2->mBlockSize) { HGOTO_DONE(-1); } + if(HDstrcmp(finfo1->mOwner, finfo2->mOwner)) { HGOTO_DONE(-1); } + if(HDstrcmp(finfo1->mGroup, finfo2->mGroup)) { HGOTO_DONE(-1); } + if(finfo1->mPermissions != finfo2->mPermissions) { HGOTO_DONE(-1); } + if(finfo1->mLastAccess != finfo2->mLastAccess) { HGOTO_DONE(-1); } done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD_hdfs_cmp() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static int -H5FD_hdfs_cmp( - const H5FD_t H5_ATTR_UNUSED *_f1, - const H5FD_t H5_ATTR_UNUSED *_f2) -{ - int ret_value = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD_hdfs_cmp() */ - -#endif /* H5_HAVE_LIBHDFS */ +} /* H5FD__hdfs_cmp() */ /*------------------------------------------------------------------------- - * Function: H5FD_hdfs_query + * Function: H5FD__hdfs_query * * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) @@ -1608,28 +1344,26 @@ H5FD_hdfs_cmp( *------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_query( - const H5FD_t H5_ATTR_UNUSED *_file, - unsigned long *flags) /* out variable */ +H5FD__hdfs_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_query() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif - if (flags) { + if(flags) { *flags = 0; *flags |= H5FD_FEAT_DATA_SIEVE; } FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5FD_hdfs_query() */ +} /* H5FD__hdfs_query() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_get_eoa() + * Function: H5FD__hdfs_get_eoa() * * Purpose: * @@ -1644,50 +1378,26 @@ H5FD_hdfs_query( * Programmer: Jacob Smith * 2017-11-02 * - * Changes: None. - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS - static haddr_t -H5FD_hdfs_get_eoa( - const H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_hdfs_t *file = (const H5FD_hdfs_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_get_eoa() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif FUNC_LEAVE_NOAPI(file->eoa) -} /* end H5FD_hdfs_get_eoa() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static haddr_t -H5FD_hdfs_get_eoa( - const H5FD_t H5_ATTR_UNUSED *_file, - H5FD_mem_t H5_ATTR_UNUSED type) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - -#if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_get_eoa() called.\n"); -#endif - - FUNC_LEAVE_NOAPI(0) -} /* end H5FD_hdfs_get_eoa() */ - -#endif /* H5_HAVE_LIBHDFS */ +} /* end H5FD__hdfs_get_eoa() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_set_eoa() + * Function: H5FD__hdfs_set_eoa() * * Purpose: * @@ -1700,54 +1410,28 @@ H5FD_hdfs_get_eoa( * Programmer: Jacob Smith * 2017-11-03 * - * Changes: None. - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS - static herr_t -H5FD_hdfs_set_eoa( - H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - haddr_t addr) +H5FD__hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) { H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_set_eoa() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif file->eoa = addr; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5FD_hdfs_set_eoa() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static herr_t -H5FD_hdfs_set_eoa( - H5FD_t H5_ATTR_UNUSED *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - haddr_t H5_ATTR_UNUSED addr) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - -#if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_set_eoa() called.\n"); -#endif - - FUNC_LEAVE_NOAPI(FAIL) -} /* H5FD_hdfs_set_eoa() */ - -#endif /* H5_HAVE_LIBHDFS */ +} /* H5FD__hdfs_set_eoa() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_get_eof() + * Function: H5FD__hdfs_get_eof() * * Purpose: * @@ -1763,49 +1447,27 @@ H5FD_hdfs_set_eoa( * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS - static haddr_t -H5FD_hdfs_get_eof( - const H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_hdfs_t *file = (const H5FD_hdfs_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_get_eof() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif HDassert(file->hdfs_handle != NULL); HDassert(file->hdfs_handle->magic == HDFS_HDFST_MAGIC); FUNC_LEAVE_NOAPI((size_t) file->hdfs_handle->fileinfo->mSize) -} /* end H5FD_hdfs_get_eof() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static haddr_t -H5FD_hdfs_get_eof( - const H5FD_t H5_ATTR_UNUSED *_file, - H5FD_mem_t H5_ATTR_UNUSED type) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - -#if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_get_eof() called.\n"); -#endif - - FUNC_LEAVE_NOAPI((size_t)0) -} /* end H5FD_hdfs_get_eof() */ - -#endif /* H5_HAVE_LIBHDFS */ +} /* end H5FD__hdfs_get_eof() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_get_handle() + * Function: H5FD__hdfs_get_handle() * * Purpose: * @@ -1818,67 +1480,33 @@ H5FD_hdfs_get_eof( * Programmer: Jacob Smith * 2017-11-02 * - * Changes: None. - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS - static herr_t -H5FD_hdfs_get_handle( - H5FD_t *_file, - hid_t H5_ATTR_UNUSED fapl, - void **file_handle) +H5FD__hdfs_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle) { herr_t ret_value = SUCCEED; H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_get_handle() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif /* HDFS_DEBUG */ - if (!file_handle) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "file handle not valid") - } + if(!file_handle) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") *file_handle = file->hdfs_handle; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_hdfs_get_handle() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static herr_t -H5FD_hdfs_get_handle( - H5FD_t H5_ATTR_UNUSED *_file, - hid_t H5_ATTR_UNUSED fapl, - void H5_ATTR_UNUSED **file_handle) -{ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_get_handle() called.\n"); -#endif /* HDFS_DEBUG */ - - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, - "Illegal get-handle of unsupported virtual file (hdfs)"); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_hdfs_get_handle() */ - -#endif /* H5_HAVE_LIBHDFS */ +} /* end H5FD__hdfs_get_handle() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_read() + * Function: H5FD__hdfs_read() * * Purpose: * @@ -1896,20 +1524,11 @@ done: * Programmer: Jacob Smith * 2017-11-?? * - * Changes: None. - * *------------------------------------------------------------------------- */ -#ifdef H5_HAVE_LIBHDFS - static herr_t -H5FD_hdfs_read( - H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t addr, /* start offset */ - size_t size, /* length of read */ - void *buf) /* out */ +H5FD__hdfs_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, + hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf) { herr_t ret_value = SUCCEED; H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file; @@ -1920,10 +1539,10 @@ H5FD_hdfs_read( unsigned bin_i = 0; #endif /* HDFS_STATS */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_read() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif /* HDFS_DEBUG */ HDassert(file != NULL); @@ -1933,44 +1552,33 @@ H5FD_hdfs_read( filesize = (size_t) file->hdfs_handle->fileinfo->mSize; - if ((addr > filesize) || ((addr + size) > filesize)) { - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, - "range exceeds file address") - } + if((addr > filesize) || ((addr + size) > filesize)) + HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "range exceeds file address") - if (FAIL == hdfsPread( - file->hdfs_handle->filesystem, - file->hdfs_handle->file, - (tOffset)addr, - buf, - (tSize)size)) - { - HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, - "unable to execute read") - } + if(FAIL == hdfsPread(file->hdfs_handle->filesystem, file->hdfs_handle->file, + (tOffset)addr, buf, (tSize)size)) + HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unable to execute read") #if HDFS_STATS - /* Find which "bin" this read fits in. Can be "overflow" bin. - */ - for (bin_i = 0; bin_i < HDFS_STATS_BIN_COUNT; bin_i++) { - if ((unsigned long long)size < hdfs_stats_boundaries[bin_i]) { + /* Find which "bin" this read fits in. Can be "overflow" bin. */ + for(bin_i = 0; bin_i < HDFS_STATS_BIN_COUNT; bin_i++) + if((unsigned long long)size < hdfs_stats_boundaries[bin_i]) break; - } - } bin = (type == H5FD_MEM_DRAW) ? &file->raw[bin_i] : &file->meta[bin_i]; - /* Store collected stats in appropriate bin - */ - if (bin->count == 0) { + /* Store collected stats in appropriate bin */ + if(bin->count == 0) { bin->min = size; bin->max = size; } else { - if (size < bin->min) { bin->min = size; } - if (size > bin->max) { bin->max = size; } + if(size < bin->min) + bin->min = size; + if(size > bin->max) + bin->max = size; } bin->count++; bin->bytes += (unsigned long long)size; @@ -1979,40 +1587,12 @@ H5FD_hdfs_read( done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_hdfs_read() */ - -#else /* H5_HAVE_LIBHDFS not defined */ - -static herr_t -H5FD_hdfs_read( - H5FD_t H5_ATTR_UNUSED *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t H5_ATTR_UNUSED addr, - size_t H5_ATTR_UNUSED size, - void H5_ATTR_UNUSED *buf) -{ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - -#if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_read() called.\n"); -#endif /* HDFS_DEBUG */ - - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, - "Illegal get-handle of unsupported virtual file (hdfs)"); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_hdfs_read() */ - -#endif /* H5_HAVE_LIBHDFS */ +} /* end H5FD__hdfs_read() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_write() + * Function: H5FD__hdfs_write() * * Purpose: * @@ -2026,38 +1606,31 @@ done: * Programmer: Jacob Smith * 2017-10-23 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_write( - H5FD_t H5_ATTR_UNUSED *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t H5_ATTR_UNUSED addr, - size_t H5_ATTR_UNUSED size, - const void H5_ATTR_UNUSED *buf) +H5FD__hdfs_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, + hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, + const void H5_ATTR_UNUSED *buf) { herr_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_write() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, - "cannot write to read-only file.") + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot write to read-only file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD_hdfs_write() */ +} /* H5FD__hdfs_write() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_truncate() + * Function: H5FD__hdfs_truncate() * * Purpose: * @@ -2073,35 +1646,30 @@ done: * Programmer: Jacob Smith * 2017-10-23 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_truncate( - H5FD_t H5_ATTR_UNUSED *_file, - hid_t H5_ATTR_UNUSED dxpl_id, - hbool_t H5_ATTR_UNUSED closing) +H5FD__hdfs_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, + hbool_t H5_ATTR_UNUSED closing) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if HDFS_DEBUG - HDfprintf(stdout, "H5FD_hdfs_truncate() called.\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, - "cannot truncate read-only file.") + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot truncate read-only file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_hdfs_truncate() */ +} /* end H5FD__hdfs_truncate() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_lock() + * Function: H5FD__hdfs_lock() * * Purpose: * @@ -2118,23 +1686,22 @@ done: * Programmer: Jacob Smith * 2017-11-03 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_lock( +H5FD__hdfs_lock( H5FD_t H5_ATTR_UNUSED *_file, hbool_t H5_ATTR_UNUSED rw) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR + FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_hdfs_lock() */ +} /* end H5FD__hdfs_lock() */ /*------------------------------------------------------------------------- * - * Function: H5FD_hdfs_unlock() + * Function: H5FD__hdfs_unlock() * * Purpose: * @@ -2148,14 +1715,14 @@ H5FD_hdfs_lock( * Programmer: Jacob Smith * 2017-11-03 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t -H5FD_hdfs_unlock(H5FD_t H5_ATTR_UNUSED *_file) +H5FD__hdfs_unlock(H5FD_t H5_ATTR_UNUSED *_file) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR + FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_hdfs_unlock() */ +} /* end H5FD__hdfs_unlock() */ +#endif /* H5_HAVE_LIBHDFS */ diff --git a/src/H5FDhdfs.h b/src/H5FDhdfs.h index 37252f0..d67ab9e 100644 --- a/src/H5FDhdfs.h +++ b/src/H5FDhdfs.h @@ -22,8 +22,13 @@ #ifndef H5FDhdfs_H #define H5FDhdfs_H -#define H5FD_HDFS (H5FD_hdfs_init()) +#ifdef H5_HAVE_LIBHDFS +#define H5FD_HDFS (H5FD_hdfs_init()) +#else /* H5_HAVE_LIBHDFS */ +#define H5FD_HDFS (-1) +#endif /* H5_HAVE_LIBHDFS */ +#ifdef H5_HAVE_LIBHDFS #ifdef __cplusplus extern "C" { #endif @@ -90,8 +95,6 @@ extern "C" { * Programmer: Jacob Smith * 2018-04-23 * - * Changes: None - * ****************************************************************************/ #define H5FD__CURR_HDFS_FAPL_T_VERSION 1 @@ -116,7 +119,7 @@ H5_DLL herr_t H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa); #ifdef __cplusplus } #endif +#endif /* H5_HAVE_LIBHDFS */ #endif /* ifndef H5FDhdfs_H */ - diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 78b7742..8793a76 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 17, 2000 * * Purpose: The POSIX unbuffered file driver using only the HDF5 public @@ -151,71 +151,71 @@ typedef struct H5FD_log_t { * which can be addressed entirely by the second * argument of the file seek function. */ -#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) -#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR)) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) #define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ - HADDR_UNDEF==(A)+(Z) || \ - (HDoff_t)((A)+(Z))<(HDoff_t)(A)) + HADDR_UNDEF == (A) + (Z) || \ + (HDoff_t)((A) + (Z)) < (HDoff_t)(A)) /* Prototypes */ -static herr_t H5FD_log_term(void); -static void *H5FD_log_fapl_get(H5FD_t *file); -static void *H5FD_log_fapl_copy(const void *_old_fa); -static herr_t H5FD_log_fapl_free(void *_fa); -static H5FD_t *H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, +static herr_t H5FD__log_term(void); +static void *H5FD__log_fapl_get(H5FD_t *file); +static void *H5FD__log_fapl_copy(const void *_old_fa); +static herr_t H5FD__log_fapl_free(void *_fa); +static H5FD_t *H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_log_close(H5FD_t *_file); -static int H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_log_query(const H5FD_t *_f1, unsigned long *flags); -static haddr_t H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); +static herr_t H5FD__log_close(H5FD_t *_file); +static int H5FD__log_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD__log_query(const H5FD_t *_f1, unsigned long *flags); +static haddr_t H5FD__log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); static herr_t H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size); -static haddr_t H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_log_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); -static herr_t H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, +static haddr_t H5FD__log_get_eoa(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static haddr_t H5FD__log_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__log_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); +static herr_t H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, +static herr_t H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_log_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_log_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_log_unlock(H5FD_t *_file); +static herr_t H5FD__log_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__log_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__log_unlock(H5FD_t *_file); static const H5FD_class_t H5FD_log_g = { - "log", /*name */ - MAXADDR, /*maxaddr */ - H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_log_term, /*terminate */ - NULL, /*sb_size */ - NULL, /*sb_encode */ - NULL, /*sb_decode */ - sizeof(H5FD_log_fapl_t), /*fapl_size */ - H5FD_log_fapl_get, /*fapl_get */ - H5FD_log_fapl_copy, /*fapl_copy */ - H5FD_log_fapl_free, /*fapl_free */ - 0, /*dxpl_size */ - NULL, /*dxpl_copy */ - NULL, /*dxpl_free */ - H5FD_log_open, /*open */ - H5FD_log_close, /*close */ - H5FD_log_cmp, /*cmp */ - H5FD_log_query, /*query */ - NULL, /*get_type_map */ - H5FD_log_alloc, /*alloc */ - H5FD__log_free, /*free */ - H5FD_log_get_eoa, /*get_eoa */ - H5FD_log_set_eoa, /*set_eoa */ - H5FD_log_get_eof, /*get_eof */ - H5FD_log_get_handle, /*get_handle */ - H5FD_log_read, /*read */ - H5FD_log_write, /*write */ - NULL, /*flush */ - H5FD_log_truncate, /*truncate */ - H5FD_log_lock, /*lock */ - H5FD_log_unlock, /*unlock */ - H5FD_FLMAP_DICHOTOMY /*fl_map */ + "log", /* name */ + MAXADDR, /* maxaddr */ + H5F_CLOSE_WEAK, /* fc_degree */ + H5FD__log_term, /* terminate */ + NULL, /* sb_size */ + NULL, /* sb_encode */ + NULL, /* sb_decode */ + sizeof(H5FD_log_fapl_t), /* fapl_size */ + H5FD__log_fapl_get, /* fapl_get */ + H5FD__log_fapl_copy, /* fapl_copy */ + H5FD__log_fapl_free, /* fapl_free */ + 0, /* dxpl_size */ + NULL, /* dxpl_copy */ + NULL, /* dxpl_free */ + H5FD__log_open, /* open */ + H5FD__log_close, /* close */ + H5FD__log_cmp, /* cmp */ + H5FD__log_query, /* query */ + NULL, /* get_type_map */ + H5FD__log_alloc, /* alloc */ + H5FD__log_free, /* free */ + H5FD__log_get_eoa, /* get_eoa */ + H5FD__log_set_eoa, /* set_eoa */ + H5FD__log_get_eof, /* get_eof */ + H5FD__log_get_handle, /* get_handle */ + H5FD__log_read, /* read */ + H5FD__log_write, /* write */ + NULL, /* flush */ + H5FD__log_truncate, /* truncate */ + H5FD__log_lock, /* lock */ + H5FD__log_unlock, /* unlock */ + H5FD_FLMAP_DICHOTOMY /* fl_map */ }; /* Declare a free list to manage the H5FD_log_t struct */ @@ -279,7 +279,7 @@ done: /*--------------------------------------------------------------------------- - * Function: H5FD_log_term + * Function: H5FD__log_term * * Purpose: Shut down the VFD * @@ -291,15 +291,15 @@ done: *--------------------------------------------------------------------------- */ static herr_t -H5FD_log_term(void) +H5FD__log_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Reset VFL ID */ H5FD_LOG_g = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_log_term() */ +} /* end H5FD__log_term() */ /*------------------------------------------------------------------------- @@ -352,7 +352,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_log_fapl_get + * Function: H5FD__log_fapl_get * * Purpose: Returns a file access property list which indicates how the * specified file is being accessed. The return list could be @@ -368,22 +368,22 @@ done: *------------------------------------------------------------------------- */ static void * -H5FD_log_fapl_get(H5FD_t *_file) +H5FD__log_fapl_get(H5FD_t *_file) { H5FD_log_t *file = (H5FD_log_t *)_file; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set return value */ - ret_value = H5FD_log_fapl_copy(&(file->fa)); + ret_value = H5FD__log_fapl_copy(&(file->fa)); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_fapl_get() */ +} /* end H5FD__log_fapl_get() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_fapl_copy + * Function: H5FD__log_fapl_copy * * Purpose: Copies the log-specific file access properties. * @@ -396,13 +396,13 @@ H5FD_log_fapl_get(H5FD_t *_file) *------------------------------------------------------------------------- */ static void * -H5FD_log_fapl_copy(const void *_old_fa) +H5FD__log_fapl_copy(const void *_old_fa) { const H5FD_log_fapl_t *old_fa = (const H5FD_log_fapl_t*)_old_fa; H5FD_log_fapl_t *new_fa = NULL; /* New FAPL info */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(old_fa); @@ -430,11 +430,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_fapl_copy() */ +} /* end H5FD__log_fapl_copy() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_fapl_free + * Function: H5FD__log_fapl_free * * Purpose: Frees the log-specific file access properties. * @@ -446,11 +446,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_fapl_free(void *_fa) +H5FD__log_fapl_free(void *_fa) { H5FD_log_fapl_t *fa = (H5FD_log_fapl_t*)_fa; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Free the fapl information */ if(fa->logfile) @@ -458,11 +458,11 @@ H5FD_log_fapl_free(void *_fa) H5MM_xfree(fa); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_log_fapl_free() */ +} /* end H5FD__log_fapl_free() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_open + * Function: H5FD__log_open * * Purpose: Create and/or opens a file as an HDF5 file. * @@ -477,7 +477,7 @@ H5FD_log_fapl_free(void *_fa) *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) +H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { H5FD_log_t *file = NULL; H5P_genplist_t *plist; /* Property list */ @@ -492,7 +492,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) h5_stat_t sb; H5FD_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check on file offsets */ HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t)); @@ -649,11 +649,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_open() */ +} /* end H5FD__log_open() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_close + * Function: H5FD__log_close * * Purpose: Closes an HDF5 file. * @@ -666,13 +666,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_close(H5FD_t *_file) +H5FD__log_close(H5FD_t *_file) { H5FD_log_t *file = (H5FD_log_t *)_file; H5_timer_t close_timer; /* Timer for close() call */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(file); @@ -794,11 +794,11 @@ H5FD_log_close(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_close() */ +} /* end H5FD__log_close() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_cmp + * Function: H5FD__log_cmp * * Purpose: Compares two files belonging to this driver using an * arbitrary (but consistent) ordering. @@ -813,13 +813,13 @@ done: *------------------------------------------------------------------------- */ static int -H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2) +H5FD__log_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { const H5FD_log_t *f1 = (const H5FD_log_t *)_f1; const H5FD_log_t *f2 = (const H5FD_log_t *)_f2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #ifdef H5_HAVE_WIN32_API if(f1->dwVolumeSerialNumber < f2->dwVolumeSerialNumber) HGOTO_DONE(-1) @@ -850,11 +850,11 @@ H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_cmp() */ +} /* end H5FD__log_cmp() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_query + * Function: H5FD__log_query * * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) @@ -867,11 +867,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */) +H5FD__log_query(const H5FD_t *_file, unsigned long *flags /* out */) { const H5FD_log_t *file = (const H5FD_log_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set the VFL feature flags that this driver supports */ if(flags) { @@ -890,11 +890,11 @@ H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */) } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_log_query() */ +} /* end H5FD__log_query() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_alloc + * Function: H5FD__log_alloc * * Purpose: Allocate file memory. * @@ -907,13 +907,13 @@ H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */) *------------------------------------------------------------------------- */ static haddr_t -H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hsize_t size) +H5FD__log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hsize_t size) { H5FD_log_t *file = (H5FD_log_t *)_file; haddr_t addr; haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Compute the address for the block to allocate */ addr = file->eoa; @@ -937,7 +937,7 @@ H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hsi ret_value = addr; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_alloc() */ +} /* end H5FD__log_alloc() */ /*------------------------------------------------------------------------- @@ -978,7 +978,7 @@ H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, /*------------------------------------------------------------------------- - * Function: H5FD_log_get_eoa + * Function: H5FD__log_get_eoa * * Purpose: Gets the end-of-address marker for the file. The EOA marker * is the first address past the last byte allocated in the @@ -993,18 +993,18 @@ H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, *------------------------------------------------------------------------- */ static haddr_t -H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__log_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_log_t *file = (const H5FD_log_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eoa) -} /* end H5FD_log_get_eoa() */ +} /* end H5FD__log_get_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_set_eoa + * Function: H5FD__log_set_eoa * * Purpose: Set the end-of-address marker for the file. This function is * called shortly after an existing HDF5 file is opened in order @@ -1018,11 +1018,11 @@ H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) +H5FD__log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) { H5FD_log_t *file = (H5FD_log_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(file->fa.flags != 0) { /* Check for increasing file size */ @@ -1061,11 +1061,11 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) file->eoa = addr; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_log_set_eoa() */ +} /* end H5FD__log_set_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_get_eof + * Function: H5FD__log_get_eof * * Purpose: Returns the end-of-file marker, which is the greater of * either the filesystem end-of-file or the HDF5 end-of-address @@ -1082,18 +1082,18 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__log_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_log_t *file = (const H5FD_log_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eof) -} /* end H5FD_log_get_eof() */ +} /* end H5FD__log_get_eof() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_get_handle + * Function: H5FD__log_get_handle * * Purpose: Returns the file handle of LOG file driver. * @@ -1105,12 +1105,12 @@ H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_log_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle) +H5FD__log_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle) { H5FD_log_t *file = (H5FD_log_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -1119,11 +1119,11 @@ H5FD_log_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_get_handle() */ +} /* end H5FD__log_get_handle() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_read + * Function: H5FD__log_read * * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR * into buffer BUF according to data transfer properties in @@ -1139,7 +1139,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, +H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { H5FD_log_t *file = (H5FD_log_t *)_file; @@ -1154,7 +1154,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd HDoff_t offset = (HDoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file && file->pub.cls); HDassert(buf); @@ -1325,11 +1325,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_read() */ +} /* end H5FD__log_read() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_write + * Function: H5FD__log_write * * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR * from buffer BUF according to data transfer properties in @@ -1343,7 +1343,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, +H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, const void *buf) { H5FD_log_t *file = (H5FD_log_t *)_file; @@ -1358,7 +1358,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had HDoff_t offset = (HDoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file && file->pub.cls); HDassert(size > 0); @@ -1531,11 +1531,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_write() */ +} /* end H5FD__log_write() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_truncate + * Function: H5FD__log_truncate * * Purpose: Makes sure that the true file size is the same (or larger) * than the end-of-address. @@ -1548,12 +1548,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) { H5FD_log_t *file = (H5FD_log_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -1639,11 +1639,11 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_truncate() */ +} /* end H5FD__log_truncate() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_lock + * Function: H5FD__log_lock * * Purpose: Place a lock on the file * @@ -1655,13 +1655,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_lock(H5FD_t *_file, hbool_t rw) +H5FD__log_lock(H5FD_t *_file, hbool_t rw) { H5FD_log_t *file = (H5FD_log_t *)_file; /* VFD file struct */ int lock_flags; /* file locking flags */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(file); @@ -1679,11 +1679,11 @@ H5FD_log_lock(H5FD_t *_file, hbool_t rw) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_lock() */ +} /* end H5FD__log_lock() */ /*------------------------------------------------------------------------- - * Function: H5FD_log_unlock + * Function: H5FD__log_unlock * * Purpose: Remove the existing lock on the file * @@ -1694,12 +1694,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_log_unlock(H5FD_t *_file) +H5FD__log_unlock(H5FD_t *_file) { H5FD_log_t *file = (H5FD_log_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -1712,5 +1712,5 @@ H5FD_log_unlock(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_log_unlock() */ +} /* end H5FD__log_unlock() */ diff --git a/src/H5FDlog.h b/src/H5FDlog.h index a69bb18..db51f3d 100644 --- a/src/H5FDlog.h +++ b/src/H5FDlog.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 17, 2000 * * Purpose: The public header file for the log driver. diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c index ef035c1..6bee4a7 100644 --- a/src/H5FDmirror.c +++ b/src/H5FDmirror.c @@ -25,6 +25,7 @@ #include "H5Fprivate.h" /* File access */ #include "H5FDprivate.h" /* File drivers */ #include "H5FDmirror.h" /* "Mirror" definitions */ +#include "H5FDmirror_priv.h" /* Private header for the mirror VFD */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ @@ -136,32 +137,32 @@ typedef struct H5FD_mirror_t { #if MIRROR_DEBUG_OP_CALLS #define LOG_OP_CALL(name) do { \ HDprintf("called %s()\n", (name)); \ - fflush(stdout); \ + HDfflush(stdout); \ } while (0) #else #define LOG_OP_CALL(name) /* no-op */ #endif /* MIRROR_DEBUG_OP_CALLS */ /* Prototypes */ -static herr_t H5FD_mirror_term(void); -static void *H5FD_mirror_fapl_get(H5FD_t *_file); -static void *H5FD_mirror_fapl_copy(const void *_old_fa); -static herr_t H5FD_mirror_fapl_free(void *_fa); -static haddr_t H5FD_mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_mirror_get_eof(const H5FD_t *_file, H5FD_mem_t type); -static H5FD_t *H5FD_mirror_open(const char *name, unsigned flags, \ +static herr_t H5FD__mirror_term(void); +static void *H5FD__mirror_fapl_get(H5FD_t *_file); +static void *H5FD__mirror_fapl_copy(const void *_old_fa); +static herr_t H5FD__mirror_fapl_free(void *_fa); +static haddr_t H5FD__mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static haddr_t H5FD__mirror_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static H5FD_t *H5FD__mirror_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_mirror_close(H5FD_t *_file); -static herr_t H5FD_mirror_query(const H5FD_t *_file, unsigned long *flags); -static herr_t H5FD_mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, \ +static herr_t H5FD__mirror_close(H5FD_t *_file); +static herr_t H5FD__mirror_query(const H5FD_t *_file, unsigned long *flags); +static herr_t H5FD__mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_mirror_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, +static herr_t H5FD__mirror_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD_mirror_truncate(H5FD_t *_file, hid_t dxpl_id, \ +static herr_t H5FD__mirror_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_mirror_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_mirror_unlock(H5FD_t *_file); +static herr_t H5FD__mirror_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__mirror_unlock(H5FD_t *_file); static herr_t H5FD__mirror_verify_reply(H5FD_mirror_t *file); @@ -169,40 +170,46 @@ static const H5FD_class_t H5FD_mirror_g = { "mirror", /* name */ MAXADDR, /* maxaddr */ H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_mirror_term, /* terminate */ + H5FD__mirror_term, /* terminate */ NULL, /* sb_size */ NULL, /* sb_encode */ NULL, /* sb_decode */ 0, /* fapl_size */ - H5FD_mirror_fapl_get, /* fapl_get */ - H5FD_mirror_fapl_copy, /* fapl_copy */ - H5FD_mirror_fapl_free, /* fapl_free */ + H5FD__mirror_fapl_get, /* fapl_get */ + H5FD__mirror_fapl_copy, /* fapl_copy */ + H5FD__mirror_fapl_free, /* fapl_free */ 0, /* dxpl_size */ NULL, /* dxpl_copy */ NULL, /* dxpl_free */ - H5FD_mirror_open, /* open */ - H5FD_mirror_close, /* close */ + H5FD__mirror_open, /* open */ + H5FD__mirror_close, /* close */ NULL, /* cmp */ - H5FD_mirror_query, /* query */ + H5FD__mirror_query, /* query */ NULL, /* get_type_map */ NULL, /* alloc */ NULL, /* free */ - H5FD_mirror_get_eoa, /* get_eoa */ - H5FD_mirror_set_eoa, /* set_eoa */ - H5FD_mirror_get_eof, /* get_eof */ + H5FD__mirror_get_eoa, /* get_eoa */ + H5FD__mirror_set_eoa, /* set_eoa */ + H5FD__mirror_get_eof, /* get_eof */ NULL, /* get_handle */ - H5FD_mirror_read, /* read */ - H5FD_mirror_write, /* write */ + H5FD__mirror_read, /* read */ + H5FD__mirror_write, /* write */ NULL, /* flush */ - H5FD_mirror_truncate, /* truncate */ - H5FD_mirror_lock, /* lock */ - H5FD_mirror_unlock, /* unlock */ + H5FD__mirror_truncate, /* truncate */ + H5FD__mirror_lock, /* lock */ + H5FD__mirror_unlock, /* unlock */ H5FD_FLMAP_DICHOTOMY /* fl_map */ }; +/* Declare a free list to manage the transmission buffers */ +H5FL_BLK_DEFINE_STATIC(xmit); + /* Declare a free list to manage the H5FD_mirror_t struct */ H5FL_DEFINE_STATIC(H5FD_mirror_t); +/* Declare a free list to manage the H5FD_mirror_xmit_open_t struct */ +H5FL_DEFINE_STATIC(H5FD_mirror_xmit_open_t); + /*------------------------------------------------------------------------- * Function: H5FD__init_package @@ -219,12 +226,10 @@ H5FD__init_package(void) FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD__init_package"); + LOG_OP_CALL(FUNC); - if (H5FD_mirror_init() < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, - "unable to initialize mirror VFD"); - } + if(H5FD_mirror_init() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize mirror VFD"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -248,12 +253,10 @@ H5FD_mirror_init(void) FUNC_ENTER_NOAPI(FAIL) - LOG_OP_CALL("H5FD_mirror_init"); + LOG_OP_CALL(FUNC); - if (H5I_VFL != H5I_get_type(H5FD_MIRROR_g)) { - H5FD_MIRROR_g = H5FD_register(&H5FD_mirror_g, sizeof(H5FD_class_t), - FALSE); - } + if(H5I_VFL != H5I_get_type(H5FD_MIRROR_g)) + H5FD_MIRROR_g = H5FD_register(&H5FD_mirror_g, sizeof(H5FD_class_t), FALSE); ret_value = H5FD_MIRROR_g; @@ -263,7 +266,7 @@ done: /* --------------------------------------------------------------------------- - * Function: H5FD_mirror_term + * Function: H5FD__mirror_term * * Purpose: Shut down the VFD * @@ -271,17 +274,17 @@ done: * --------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_term(void) +H5FD__mirror_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Reset VFL ID */ H5FD_MIRROR_g = 0; - LOG_OP_CALL("H5FD_mirror_term"); + LOG_OP_CALL(FUNC); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_mirror_term() */ +} /* end H5FD__mirror_term() */ /* --------------------------------------------------------------------------- @@ -301,10 +304,14 @@ size_t H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *_buf) { uint16_t n = 0; - LOG_OP_CALL("H5FD__mirror_xmit_decode_uint16"); + + LOG_OP_CALL(__func__); + HDassert(_buf && out); + HDmemcpy(&n, _buf, sizeof(n)); *out = (uint16_t)HDntohs(n); + return 2; /* number of bytes eaten */ } /* end H5FD__mirror_xmit_decode_uint16() */ @@ -326,14 +333,17 @@ size_t H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *_buf) { uint32_t n = 0; - LOG_OP_CALL("H5FD__mirror_xmit_decode_uint32"); + + LOG_OP_CALL(__func__); + HDassert(_buf && out); + HDmemcpy(&n, _buf, sizeof(n)); *out = (uint32_t)HDntohl(n); + return 4; /* number of bytes eaten */ } /* end H5FD__mirror_xmit_decode_uint32() */ - /* --------------------------------------------------------------------------- * Function: is_host_little_endian @@ -357,12 +367,11 @@ is_host_little_endian(void) uint8_t u8[4]; } echeck; echeck.u32 = 0xA1B2C3D4; - if (echeck.u8[0] == 0xD4) { + + if(echeck.u8[0] == 0xD4) return TRUE; - } - else { + else return FALSE; - } } /* end is_host_little_endian() */ @@ -385,15 +394,17 @@ size_t H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *_buf) { uint64_t n = 0; - LOG_OP_CALL("H5FD__mirror_xmit_decode_uint64"); + + LOG_OP_CALL(__func__); + HDassert(_buf && out); + HDmemcpy(&n, _buf, sizeof(n)); - if (TRUE == is_host_little_endian()) { + if(TRUE == is_host_little_endian()) *out = BSWAP_64(n); - } - else { + else *out = n; - } + return 8; } /* end H5FD__mirror_xmit_decode_uint64() */ @@ -412,9 +423,12 @@ H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *_buf) size_t H5FD__mirror_xmit_decode_uint8(uint8_t *out, const unsigned char *_buf) { - LOG_OP_CALL("H5FD__mirror_xmit_decode_uint8"); + LOG_OP_CALL(__func__); + HDassert(_buf && out); + HDmemcpy(out, _buf, sizeof(uint8_t)); + return 1; /* number of bytes eaten */ } /* end H5FD__mirror_xmit_decode_uint8() */ @@ -435,10 +449,14 @@ size_t H5FD__mirror_xmit_encode_uint16(unsigned char *_dest, uint16_t v) { uint16_t n = 0; - LOG_OP_CALL("H5FD__mirror_xmit_encode_uint16"); + + LOG_OP_CALL(__func__); + HDassert(_dest); + n = (uint16_t)HDhtons(v); HDmemcpy(_dest, &n, sizeof(n)); + return 2; } /* end H5FD__mirror_xmit_encode_uint16() */ @@ -459,10 +477,14 @@ size_t H5FD__mirror_xmit_encode_uint32(unsigned char *_dest, uint32_t v) { uint32_t n = 0; - LOG_OP_CALL("H5FD__mirror_xmit_encode_uint32"); + + LOG_OP_CALL(__func__); + HDassert(_dest); + n = (uint32_t)HDhtonl(v); HDmemcpy(_dest, &n, sizeof(n)); + return 4; } /* end H5FD__mirror_xmit_encode_uint32() */ @@ -483,12 +505,15 @@ size_t H5FD__mirror_xmit_encode_uint64(unsigned char *_dest, uint64_t v) { uint64_t n = v; - LOG_OP_CALL("H5FD__mirror_xmit_decode_uint64"); + + LOG_OP_CALL(__func__); + HDassert(_dest); - if (TRUE == is_host_little_endian()) { + + if(TRUE == is_host_little_endian()) n = BSWAP_64(v); - } HDmemcpy(_dest, &n, sizeof(n)); + return 8; } /* H5FD__mirror_xmit_encode_uint64() */ @@ -509,9 +534,12 @@ H5FD__mirror_xmit_encode_uint64(unsigned char *_dest, uint64_t v) size_t H5FD__mirror_xmit_encode_uint8(unsigned char *dest, uint8_t v) { - LOG_OP_CALL("H5FD__mirror_xmit_encode_uint8"); + LOG_OP_CALL(__func__); + HDassert(dest); + HDmemcpy(dest, &v, sizeof(v)); + return 1; } /* end H5FD__mirror_xmit_encode_uint8() */ @@ -540,8 +568,11 @@ H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out, const unsigned char *buf) { size_t n_eaten = 0; - LOG_OP_CALL("H5FD_mirror_xmit_decode_header"); + + LOG_OP_CALL(__func__); + HDassert(out && buf); + n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->magic), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->version), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->session_token), @@ -550,6 +581,7 @@ H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out, &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->op), &buf[n_eaten]); HDassert(n_eaten == H5FD_MIRROR_XMIT_HEADER_SIZE); + return n_eaten; } /* end H5FD_mirror_xmit_decode_header() */ @@ -578,11 +610,15 @@ H5FD_mirror_xmit_decode_lock(H5FD_mirror_xmit_lock_t *out, const unsigned char *buf) { size_t n_eaten = 0; - LOG_OP_CALL("H5FD_mirror_xmit_decode_lock"); + + LOG_OP_CALL(__func__); + HDassert(out && buf); + n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->rw), &buf[n_eaten]); HDassert(n_eaten == H5FD_MIRROR_XMIT_LOCK_SIZE); + return n_eaten; } /* end H5FD_mirror_xmit_decode_lock() */ @@ -612,8 +648,11 @@ H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out, const unsigned char *buf) { size_t n_eaten = 0; - LOG_OP_CALL("H5FD_mirror_xmit_decode_open"); + + LOG_OP_CALL(__func__); + HDassert(out && buf); + n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf); n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->flags), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->maxaddr), &buf[n_eaten]); @@ -622,8 +661,9 @@ H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out, HDassert((H5FD_MIRROR_XMIT_OPEN_SIZE - H5FD_MIRROR_XMIT_FILEPATH_MAX) == n_eaten); HDstrncpy(out->filename, (const char *)&buf[n_eaten], - H5FD_MIRROR_XMIT_FILEPATH_MAX-1); - out->filename[H5FD_MIRROR_XMIT_FILEPATH_MAX-1] = 0; /* force final NULL */ + H5FD_MIRROR_XMIT_FILEPATH_MAX - 1); + out->filename[H5FD_MIRROR_XMIT_FILEPATH_MAX - 1] = 0; /* force final NULL */ + return H5FD_MIRROR_XMIT_OPEN_SIZE; } /* end H5FD_mirror_xmit_decode_open() */ @@ -653,15 +693,19 @@ H5FD_mirror_xmit_decode_reply(H5FD_mirror_xmit_reply_t *out, const unsigned char *buf) { size_t n_eaten = 0; - LOG_OP_CALL("H5FD_mirror_xmit_decode_reply"); + + LOG_OP_CALL(__func__); + HDassert(out && buf); + n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf); n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->status), &buf[n_eaten]); HDassert((H5FD_MIRROR_XMIT_REPLY_SIZE - H5FD_MIRROR_STATUS_MESSAGE_MAX) == n_eaten); HDstrncpy(out->message, (const char *)&buf[n_eaten], - H5FD_MIRROR_STATUS_MESSAGE_MAX-1); - out->message[H5FD_MIRROR_STATUS_MESSAGE_MAX-1] = 0; /* force NULL term */ + H5FD_MIRROR_STATUS_MESSAGE_MAX - 1); + out->message[H5FD_MIRROR_STATUS_MESSAGE_MAX - 1] = 0; /* force NULL term */ + return H5FD_MIRROR_XMIT_REPLY_SIZE; } /* end H5FD_mirror_xmit_decode_reply() */ @@ -690,12 +734,16 @@ H5FD_mirror_xmit_decode_set_eoa(H5FD_mirror_xmit_eoa_t *out, const unsigned char *buf) { size_t n_eaten = 0; - LOG_OP_CALL("H5FD_mirror_xmit_decode_set_eoa"); + + LOG_OP_CALL(__func__); + HDassert(out && buf); + n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf); n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->type), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->eoa_addr), &buf[n_eaten]); HDassert(n_eaten == H5FD_MIRROR_XMIT_EOA_SIZE); + return n_eaten; } /* end H5FD_mirror_xmit_decode_set_eoa() */ @@ -724,13 +772,17 @@ H5FD_mirror_xmit_decode_write(H5FD_mirror_xmit_write_t *out, const unsigned char *buf) { size_t n_eaten = 0; - LOG_OP_CALL("H5FD_mirror_xmit_decode_write"); + + LOG_OP_CALL(__func__); + HDassert(out && buf); + n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf); n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->type), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->offset), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->size), &buf[n_eaten]); HDassert(n_eaten == H5FD_MIRROR_XMIT_WRITE_SIZE); + return n_eaten; } /* end H5FD_mirror_xmit_decode_write() */ @@ -754,14 +806,18 @@ H5FD_mirror_xmit_encode_header(unsigned char *dest, const H5FD_mirror_xmit_t *x) { size_t n_writ = 0; - LOG_OP_CALL("H5FD_mirror_xmit_encode_header"); + + LOG_OP_CALL(__func__); + HDassert(dest && x); + n_writ += H5FD__mirror_xmit_encode_uint32((dest+n_writ), x->magic); n_writ += H5FD__mirror_xmit_encode_uint8((dest+n_writ), x->version); n_writ += H5FD__mirror_xmit_encode_uint32((dest+n_writ), x->session_token); n_writ += H5FD__mirror_xmit_encode_uint32((dest+n_writ), x->xmit_count); n_writ += H5FD__mirror_xmit_encode_uint8((dest+n_writ), x->op); HDassert(n_writ == H5FD_MIRROR_XMIT_HEADER_SIZE); + return n_writ; } /* end H5FD_mirror_xmit_encode_header() */ @@ -784,12 +840,16 @@ H5FD_mirror_xmit_encode_lock(unsigned char *dest, const H5FD_mirror_xmit_lock_t *x) { size_t n_writ = 0; - LOG_OP_CALL("H5FD_mirror_xmit_encode_lock"); + + LOG_OP_CALL(__func__); + HDassert(dest && x); + n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub)); n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->rw); HDassert(n_writ == H5FD_MIRROR_XMIT_LOCK_SIZE); + return n_writ; } /* end H5FD_mirror_xmit_encode_lock() */ @@ -813,13 +873,14 @@ H5FD_mirror_xmit_encode_open(unsigned char *dest, const H5FD_mirror_xmit_open_t *x) { size_t n_writ = 0; - LOG_OP_CALL("H5FD_mirror_xmit_encode_open"); + + LOG_OP_CALL(__func__); + HDassert(dest && x); + /* clear entire structure, but especially its filepath string area */ - for (n_writ = 0; n_writ < H5FD_MIRROR_XMIT_OPEN_SIZE; n_writ++) { - *(dest+n_writ) = 0; - } - n_writ = 0; + HDmemset(dest, 0, H5FD_MIRROR_XMIT_OPEN_SIZE); + n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub)); n_writ += H5FD__mirror_xmit_encode_uint32(&dest[n_writ], x->flags); @@ -827,8 +888,8 @@ H5FD_mirror_xmit_encode_open(unsigned char *dest, n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->size_t_blob); HDassert((H5FD_MIRROR_XMIT_OPEN_SIZE - H5FD_MIRROR_XMIT_FILEPATH_MAX) == n_writ); - HDstrncpy((char *)&dest[n_writ], x->filename, - H5FD_MIRROR_XMIT_FILEPATH_MAX); + HDstrncpy((char *)&dest[n_writ], x->filename, H5FD_MIRROR_XMIT_FILEPATH_MAX); + return H5FD_MIRROR_XMIT_OPEN_SIZE; } /* end H5FD_mirror_xmit_encode_open() */ @@ -853,20 +914,21 @@ H5FD_mirror_xmit_encode_reply(unsigned char *dest, const H5FD_mirror_xmit_reply_t *x) { size_t n_writ = 0; - LOG_OP_CALL("H5FD_mirror_xmit_encode_reply"); + + LOG_OP_CALL(__func__); + HDassert(dest && x); + /* clear entire structure, but especially its message string area */ - for (n_writ = 0; n_writ < H5FD_MIRROR_XMIT_REPLY_SIZE; n_writ++) { - *(dest+n_writ) = 0; - } - n_writ = 0; + HDmemset(dest, 0, H5FD_MIRROR_XMIT_REPLY_SIZE); + n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub)); n_writ += H5FD__mirror_xmit_encode_uint32(&dest[n_writ], x->status); HDassert((H5FD_MIRROR_XMIT_REPLY_SIZE - H5FD_MIRROR_STATUS_MESSAGE_MAX) == n_writ); - HDstrncpy((char *)&dest[n_writ], x->message, - H5FD_MIRROR_STATUS_MESSAGE_MAX); + HDstrncpy((char *)&dest[n_writ], x->message, H5FD_MIRROR_STATUS_MESSAGE_MAX); + return H5FD_MIRROR_XMIT_REPLY_SIZE; } /* end H5FD_mirror_xmit_encode_reply() */ @@ -890,13 +952,17 @@ H5FD_mirror_xmit_encode_set_eoa(unsigned char *dest, const H5FD_mirror_xmit_eoa_t *x) { size_t n_writ = 0; - LOG_OP_CALL("H5FD_mirror_xmit_encode_set_eoa"); + + LOG_OP_CALL(__func__); + HDassert(dest && x); + n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub)); n_writ += H5FD__mirror_xmit_encode_uint8(&dest[n_writ], x->type); n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->eoa_addr); HDassert(n_writ == H5FD_MIRROR_XMIT_EOA_SIZE); + return n_writ; } /* end H5FD_mirror_xmit_encode_set_eoa() */ @@ -920,14 +986,18 @@ H5FD_mirror_xmit_encode_write(unsigned char *dest, const H5FD_mirror_xmit_write_t *x) { size_t n_writ = 0; - LOG_OP_CALL("H5FD_mirror_xmit_encode_write"); + + LOG_OP_CALL(__func__); + HDassert(dest && x); + n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub)); n_writ += H5FD__mirror_xmit_encode_uint8(&dest[n_writ], x->type); n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->offset); n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->size); HDassert(n_writ == H5FD_MIRROR_XMIT_WRITE_SIZE); + return n_writ; } /* end H5FD_mirror_xmit_encode_write() */ @@ -942,16 +1012,16 @@ H5FD_mirror_xmit_encode_write(unsigned char *dest, * Return: TRUE if valid; else FALSE. * --------------------------------------------------------------------------- */ -hbool_t +H5_ATTR_PURE hbool_t H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit) { - LOG_OP_CALL("H5FD_mirror_xmit_is_close"); + LOG_OP_CALL(__func__); + HDassert(xmit); - if ( (TRUE == H5FD_mirror_xmit_is_xmit(xmit)) && - (H5FD_MIRROR_OP_CLOSE == xmit->op) ) - { + + if((TRUE == H5FD_mirror_xmit_is_xmit(xmit)) && (H5FD_MIRROR_OP_CLOSE == xmit->op)) return TRUE; - } + return FALSE; } /* end H5FD_mirror_xmit_is_close() */ @@ -966,16 +1036,16 @@ H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit) * Return: TRUE if valid; else FALSE. * --------------------------------------------------------------------------- */ -hbool_t +H5_ATTR_PURE hbool_t H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit) { - LOG_OP_CALL("H5FD_mirror_xmit_is_lock"); + LOG_OP_CALL(__func__); + HDassert(xmit); - if ( (TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && - (H5FD_MIRROR_OP_LOCK == xmit->pub.op) ) - { + + if((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_LOCK == xmit->pub.op)) return TRUE; - } + return FALSE; } /* end H5FD_mirror_xmit_is_lock() */ @@ -990,16 +1060,17 @@ H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit) * Return: TRUE if valid; else FALSE. * --------------------------------------------------------------------------- */ -hbool_t +H5_ATTR_PURE hbool_t H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit) { - LOG_OP_CALL("H5FD_mirror_xmit_is_open"); + LOG_OP_CALL(__func__); + HDassert(xmit); - if ( (TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && - (H5FD_MIRROR_OP_OPEN == xmit->pub.op) ) - { + + if((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_OPEN == xmit->pub.op)) + return TRUE; - } + return FALSE; } /* end H5FD_mirror_xmit_is_open() */ @@ -1014,16 +1085,16 @@ H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit) * Return: TRUE if valid; else FALSE. * --------------------------------------------------------------------------- */ -hbool_t +H5_ATTR_PURE hbool_t H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit) { - LOG_OP_CALL("H5FD_mirror_xmit_is_set_eoa"); + LOG_OP_CALL(__func__); + HDassert(xmit); - if ( (TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && - (H5FD_MIRROR_OP_SET_EOA == xmit->pub.op) ) - { + + if((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_SET_EOA == xmit->pub.op)) return TRUE; - } + return FALSE; } /* end H5FD_mirror_xmit_is_eoa() */ @@ -1038,16 +1109,16 @@ H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit) * Return: TRUE if valid; else FALSE. * --------------------------------------------------------------------------- */ -hbool_t +H5_ATTR_PURE hbool_t H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit) { - LOG_OP_CALL("H5FD_mirror_xmit_is_reply"); + LOG_OP_CALL(__func__); + HDassert(xmit); - if ( (TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && - (H5FD_MIRROR_OP_REPLY == xmit->pub.op) ) - { + + if((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_REPLY == xmit->pub.op)) return TRUE; - } + return FALSE; } /* end H5FD_mirror_xmit_is_reply() */ @@ -1062,16 +1133,16 @@ H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit) * Return: TRUE if valid; else FALSE. * --------------------------------------------------------------------------- */ -hbool_t +H5_ATTR_PURE hbool_t H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit) { - LOG_OP_CALL("H5FD_mirror_xmit_is_write"); + LOG_OP_CALL(__func__); + HDassert(xmit); - if ( (TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && - (H5FD_MIRROR_OP_WRITE == xmit->pub.op) ) - { + + if((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_WRITE == xmit->pub.op)) return TRUE; - } + return FALSE; } /* end H5FD_mirror_xmit_is_write() */ @@ -1086,16 +1157,16 @@ H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit) * Return: TRUE if valid; else FALSE. * --------------------------------------------------------------------------- */ -hbool_t +H5_ATTR_PURE hbool_t H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit) { - LOG_OP_CALL("H5FD_mirror_xmit_is_xmit"); + LOG_OP_CALL(__func__); + HDassert(xmit); - if ( (H5FD_MIRROR_XMIT_MAGIC != xmit->magic) || - (H5FD_MIRROR_XMIT_CURR_VERSION != xmit->version) ) - { + + if((H5FD_MIRROR_XMIT_MAGIC != xmit->magic) || (H5FD_MIRROR_XMIT_CURR_VERSION != xmit->version)) return FALSE; - } + return TRUE; } /* end H5FD_mirror_xmit_is_xmit() */ @@ -1111,60 +1182,55 @@ H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit) * Return: SUCCEED if ok, else FAIL. * ---------------------------------------------------------------------------- */ -herr_t +static herr_t H5FD__mirror_verify_reply(H5FD_mirror_t *file) { - char xmit_buf[H5FD_MIRROR_XMIT_REPLY_SIZE]; + unsigned char *xmit_buf = NULL; struct H5FD_mirror_xmit_reply_t reply; ssize_t read_ret = 0; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT; + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD__mirror_verify_reply"); + LOG_OP_CALL(FUNC); HDassert(file && file->sock_fd); + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer"); + read_ret = HDread(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_REPLY_SIZE); - if (read_ret < 0) { + if(read_ret < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unable to read reply"); - } - if (read_ret != H5FD_MIRROR_XMIT_REPLY_SIZE) { + if(read_ret != H5FD_MIRROR_XMIT_REPLY_SIZE) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unexpected read size"); - } LOG_XMIT_BYTES("reply", xmit_buf, read_ret); - if (H5FD_mirror_xmit_decode_reply(&reply, (const unsigned char *)xmit_buf) - != H5FD_MIRROR_XMIT_REPLY_SIZE) - { + if(H5FD_mirror_xmit_decode_reply(&reply, xmit_buf) != H5FD_MIRROR_XMIT_REPLY_SIZE) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "unable to decode reply xmit"); - } - if (H5FD_mirror_xmit_is_reply(&reply) != TRUE) { + if(H5FD_mirror_xmit_is_reply(&reply) != TRUE) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "xmit op code was not REPLY"); - } - if (reply.pub.session_token != file->xmit.session_token) { + if(reply.pub.session_token != file->xmit.session_token) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "wrong session"); - } - - if (reply.pub.xmit_count != (file->xmit_i)++) { + if(reply.pub.xmit_count != (file->xmit_i)++) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "xmit out of sync"); - } - - if (reply.status != H5FD_MIRROR_STATUS_OK) { - HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, - "%s", (const char *)(reply.message)); - } + if(reply.status != H5FD_MIRROR_STATUS_OK) + HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "%s", (const char *)(reply.message)); done: + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value); } /* end H5FD__mirror_verify_reply() */ /* ------------------------------------------------------------------------- - * Function: H5FD_mirror_fapl_get + * Function: H5FD__mirror_fapl_get * * Purpose: Get the file access propety list which could be used to create * an identical file. @@ -1174,37 +1240,35 @@ done: * ------------------------------------------------------------------------- */ static void * -H5FD_mirror_fapl_get(H5FD_t *_file) +H5FD__mirror_fapl_get(H5FD_t *_file) { H5FD_mirror_t *file = (H5FD_mirror_t *)_file; H5FD_mirror_fapl_t *fa = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_fapl_get"); + LOG_OP_CALL(FUNC); fa = (H5FD_mirror_fapl_t *)H5MM_calloc(sizeof(H5FD_mirror_fapl_t)); - if (NULL == fa) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "calloc failed"); - } + if(NULL == fa) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "calloc failed"); HDmemcpy(fa, &(file->fa), sizeof(H5FD_mirror_fapl_t)); ret_value = fa; done: - if (ret_value == NULL) { - if (fa != NULL) { + if(ret_value == NULL) + if(fa != NULL) H5MM_xfree(fa); - } - } + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mirror_fapl_get() */ +} /* end H5FD__mirror_fapl_get() */ /* ------------------------------------------------------------------------- - * Function: H5FD_mirror_fapl_copy + * Function: H5FD__mirror_fapl_copy * * Purpose: Copies the mirror vfd-specific file access properties. * @@ -1213,37 +1277,34 @@ done: * ------------------------------------------------------------------------- */ static void * -H5FD_mirror_fapl_copy(const void *_old_fa) +H5FD__mirror_fapl_copy(const void *_old_fa) { const H5FD_mirror_fapl_t *old_fa = (const H5FD_mirror_fapl_t *)_old_fa; H5FD_mirror_fapl_t *new_fa = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_fapl_copy"); + LOG_OP_CALL(FUNC); new_fa = (H5FD_mirror_fapl_t *)H5MM_malloc(sizeof(H5FD_mirror_fapl_t)); - if (new_fa == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "memory allocation failed"); - } + if(new_fa == NULL) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed"); HDmemcpy(new_fa, old_fa, sizeof(H5FD_mirror_fapl_t)); ret_value = new_fa; done: - if (ret_value == NULL) { - if (new_fa != NULL) { + if(ret_value == NULL) + if(new_fa != NULL) H5MM_xfree(new_fa); - } - } + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mirror_fapl_copy() */ +} /* end H5FD__mirror_fapl_copy() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_fapl_free + * Function: H5FD__mirror_fapl_free * * Purpose: Frees the mirror VFD-specific file access properties. * @@ -1251,13 +1312,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_fapl_free(void *_fa) +H5FD__mirror_fapl_free(void *_fa) { H5FD_mirror_fapl_t *fa = (H5FD_mirror_fapl_t*)_fa; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - LOG_OP_CALL("H5FD_mirror_fapl_free"); + LOG_OP_CALL(FUNC); /* sanity check */ HDassert(fa != NULL); @@ -1267,7 +1328,7 @@ H5FD_mirror_fapl_free(void *_fa) H5MM_xfree(fa); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_mirror_fapl_free() */ +} /* end H5FD__mirror_fapl_free() */ /* ------------------------------------------------------------------------- @@ -1289,26 +1350,20 @@ H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out) FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", fapl_id, fa_out); - LOG_OP_CALL("H5Pget_fapl_mirror"); + LOG_OP_CALL(FUNC); - if (NULL == fa_out) { + if(NULL == fa_out) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL"); - } plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); - if (NULL == plist) { - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, - "not a file access property list"); - } - - if (H5P_peek_driver(plist) != H5FD_MIRROR) { + if(NULL == plist) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); + if(H5P_peek_driver(plist) != H5FD_MIRROR) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); - } fa = (const H5FD_mirror_fapl_t *)H5P_peek_driver_info(plist); - if (NULL == fa) { + if(NULL == fa) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info"); - } HDassert(fa->magic == H5FD_MIRROR_FAPL_MAGIC); /* sanity check */ @@ -1337,22 +1392,17 @@ H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa) FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", fapl_id, fa); - LOG_OP_CALL("H5Pset_fapl_mirror"); + LOG_OP_CALL(FUNC); plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); - if (NULL == plist) { - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, - "not a file access property list"); - } - if (NULL == fa) { + if(NULL == plist) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); + if(NULL == fa) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null fapl_t pointer"); - } - if (H5FD_MIRROR_FAPL_MAGIC != fa->magic) { + if(H5FD_MIRROR_FAPL_MAGIC != fa->magic) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fapl_t magic"); - } - if (H5FD_MIRROR_CURR_FAPL_T_VERSION != fa->version) { + if(H5FD_MIRROR_CURR_FAPL_T_VERSION != fa->version) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unknown fapl_t version"); - } ret_value = H5P_set_driver(plist, H5FD_MIRROR, (const void *)fa); @@ -1362,7 +1412,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_mirror_open + * Function: H5FD__mirror_open * * Purpose: Create and/or opens a file as an HDF5 file. * @@ -1376,64 +1426,51 @@ done: *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_mirror_open(const char *name, +H5FD__mirror_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { -#define MIRR_OPEN_MAXBUF 16 /* local symbol to give meaning to magic number */ - /* #defined because it is needed at compile time */ - /* Large enough to hold a port number string */ int live_socket = -1; struct sockaddr_in target_addr; socklen_t addr_size; - char xmit_buf[H5FD_MIRROR_XMIT_OPEN_SIZE]; + unsigned char *xmit_buf = NULL; H5FD_mirror_fapl_t fa; H5FD_mirror_t *file = NULL; - H5FD_mirror_xmit_open_t open_xmit; + H5FD_mirror_xmit_open_t *open_xmit = NULL; H5FD_t *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_open"); + LOG_OP_CALL(FUNC); /* --------------- */ /* Check arguments */ /* --------------- */ - if (!name || !*name) { + if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name"); - } - if (HDstrlen(name) >= H5FD_MIRROR_XMIT_FILEPATH_MAX) { + if(HDstrlen(name) >= H5FD_MIRROR_XMIT_FILEPATH_MAX) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "filename is too long"); - } - if (0 == maxaddr || HADDR_UNDEF == maxaddr) { + if(0 == maxaddr || HADDR_UNDEF == maxaddr) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr"); - } - if (ADDR_OVERFLOW(maxaddr)) { + if(ADDR_OVERFLOW(maxaddr)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr"); - } - if (H5Pget_fapl_mirror(fapl_id, &fa) == FAIL) { + if(H5Pget_fapl_mirror(fapl_id, &fa) == FAIL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't get config info"); - } - - if (H5FD_MIRROR_FAPL_MAGIC != fa.magic) { + if(H5FD_MIRROR_FAPL_MAGIC != fa.magic) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid fapl magic"); - } - - if (H5FD_MIRROR_CURR_FAPL_T_VERSION != fa.version) { + if(H5FD_MIRROR_CURR_FAPL_T_VERSION != fa.version) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid fapl version"); - } /* --------------------- */ /* Handshake with remote */ /* --------------------- */ live_socket = HDsocket(AF_INET, SOCK_STREAM, 0); - if (live_socket < 0) { + if(live_socket < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't create socket"); - } target_addr.sin_family = AF_INET; target_addr.sin_port = HDhtons((uint16_t)fa.handshake_port); @@ -1441,21 +1478,16 @@ H5FD_mirror_open(const char *name, HDmemset(target_addr.sin_zero, '\0', sizeof target_addr.sin_zero); addr_size = sizeof(target_addr); - if (HDconnect(live_socket, (struct sockaddr *)&target_addr, addr_size) < 0) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "can't connect to remote server"); - } + if(HDconnect(live_socket, (struct sockaddr *)&target_addr, addr_size) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't connect to remote server"); /* ------------- */ /* Open the file */ /* ------------- */ file = (H5FD_mirror_t *)H5FL_CALLOC(H5FD_mirror_t); - if (NULL == file) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "unable to allocate file struct"); - } + if(NULL == file) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate file struct"); file->sock_fd = live_socket; file->xmit_i = 0; @@ -1466,49 +1498,53 @@ H5FD_mirror_open(const char *name, file->xmit.session_token = (uint32_t)(0x01020304 ^ file->sock_fd); /* TODO: hashing? */ /* int --> uint32_t may truncate on some systems... shouldn't matter? */ + open_xmit = (H5FD_mirror_xmit_open_t *)H5FL_CALLOC(H5FD_mirror_xmit_open_t); + if(NULL == open_xmit) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate open_xmit struct"); + file->xmit.op = H5FD_MIRROR_OP_OPEN; - open_xmit.pub = file->xmit; - open_xmit.flags = (uint32_t)flags; - open_xmit.maxaddr = (uint64_t)maxaddr; - open_xmit.size_t_blob = (uint64_t)((size_t)(-1)); - HDsnprintf(open_xmit.filename, H5FD_MIRROR_XMIT_FILEPATH_MAX-1, "%s", name); - - if (H5FD_mirror_xmit_encode_open((unsigned char *)xmit_buf, - (const H5FD_mirror_xmit_open_t *)&open_xmit) - != H5FD_MIRROR_XMIT_OPEN_SIZE) - { + open_xmit->pub = file->xmit; + open_xmit->flags = (uint32_t)flags; + open_xmit->maxaddr = (uint64_t)maxaddr; + open_xmit->size_t_blob = (uint64_t)((size_t)(-1)); + HDsnprintf(open_xmit->filename, H5FD_MIRROR_XMIT_FILEPATH_MAX-1, "%s", name); + + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate xmit buffer"); + + if(H5FD_mirror_xmit_encode_open(xmit_buf, open_xmit) != H5FD_MIRROR_XMIT_OPEN_SIZE) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, NULL, "unable to encode open"); - } LOG_XMIT_BYTES("open", xmit_buf, H5FD_MIRROR_XMIT_OPEN_SIZE); - if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_OPEN_SIZE) < 0) { + if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_OPEN_SIZE) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, NULL, "unable to transmit open"); - } - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "invalid reply"); - } ret_value = (H5FD_t *)file; done: - if (NULL == ret_value) { - if (file) { + if(NULL == ret_value) { + if(file) file = H5FL_FREE(H5FD_mirror_t, file); - } - if (live_socket >= 0 && HDclose(live_socket) < 0) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, - "can't close socket"); - } + if(live_socket >= 0 && HDclose(live_socket) < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "can't close socket"); } + + if(open_xmit) + open_xmit = H5FL_FREE(H5FD_mirror_xmit_open_t, open_xmit); + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value) -#undef MIRR_OPEN_MAXBUF -} /* end H5FD_mirror_open() */ +} /* end H5FD__mirror_open() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_close + * Function: H5FD__mirror_close * * Purpose: Closes the HDF5 file. * @@ -1523,16 +1559,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_close(H5FD_t *_file) +H5FD__mirror_close(H5FD_t *_file) { H5FD_mirror_t *file = (H5FD_mirror_t *)_file; - unsigned char xmit_buf[H5FD_MIRROR_XMIT_HEADER_SIZE]; + unsigned char *xmit_buf = NULL; int xmit_encoded = 0; /* monitor point of failure */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_close"); + LOG_OP_CALL(FUNC); /* Sanity check */ HDassert(file); @@ -1541,68 +1577,59 @@ H5FD_mirror_close(H5FD_t *_file) file->xmit.xmit_count = (file->xmit_i)++; file->xmit.op = H5FD_MIRROR_OP_CLOSE; - if (H5FD_mirror_xmit_encode_header(xmit_buf, - (const H5FD_mirror_xmit_t *)&(file->xmit)) - != H5FD_MIRROR_XMIT_HEADER_SIZE) - { + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer"); + + if(H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) != H5FD_MIRROR_XMIT_HEADER_SIZE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to encode close"); - } xmit_encoded = 1; LOG_XMIT_BYTES("close", xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE); - if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) { + if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to transmit close"); - } - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply"); - } - if (HDclose(file->sock_fd) < 0) { + if(HDclose(file->sock_fd) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "can't close socket"); - } done: - if (ret_value == FAIL) { - if (xmit_encoded == 0) { + if(ret_value == FAIL) { + if(xmit_encoded == 0) { /* Encode failed; send GOODBYE to force writer halt. * We can ignore any response from the writer, if we receive * any reply at all. */ - if (HDwrite(file->sock_fd, "GOODBYE", HDstrlen("GOODBYE")) < 0) { - HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to transmit close"); - if (HDclose(file->sock_fd) < 0) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "can't close socket"); - } + if(HDwrite(file->sock_fd, "GOODBYE", HDstrlen("GOODBYE")) < 0) { + HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to transmit close"); + if(HDclose(file->sock_fd) < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "can't close socket"); file->sock_fd = -1; /* invalidate for later */ } /* end if problem writing goodbye; go down hard */ else - if (HDshutdown(file->sock_fd, SHUT_WR) < 0) { - HDONE_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, - "can't shutdown socket write: %s", - HDstrerror(errno)); - } /* end else-if problem shutting down socket */ + if(HDshutdown(file->sock_fd, SHUT_WR) < 0) + HDONE_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't shutdown socket write: %s", HDstrerror(errno)); } /* end if xmit encode failed */ - if (file->sock_fd >= 0) { - if (HDclose(file->sock_fd) < 0) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "can't close socket"); - } - } /* end if socket not closed by going down hard */ + if(file->sock_fd >= 0) + if(HDclose(file->sock_fd) < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "can't close socket"); } /* end if error */ file = H5FL_FREE(H5FD_mirror_t, file); /* always release resources */ + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mirror_close() */ +} /* end H5FD__mirror_close() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_query + * Function: H5FD__mirror_query * * Purpose: Get the driver feature flags implemented by the driver. * @@ -1610,11 +1637,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) +H5FD__mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) { - FUNC_ENTER_NOAPI_NOINIT_NOERR; + FUNC_ENTER_STATIC_NOERR; - LOG_OP_CALL("H5FD_mirror_query"); + LOG_OP_CALL(FUNC); /* Notice: the Mirror VFD Writer currently uses only the Sec2 driver as * the underying driver -- as such, the Mirror VFD implementation copies @@ -1624,23 +1651,21 @@ H5FD_mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) * is never included. * -- JOS 2020-01-13 */ - if (flags) { - *flags = 0 \ - | H5FD_FEAT_AGGREGATE_METADATA \ + if(flags) + *flags = H5FD_FEAT_AGGREGATE_METADATA \ | H5FD_FEAT_ACCUMULATE_METADATA \ | H5FD_FEAT_DATA_SIEVE \ | H5FD_FEAT_AGGREGATE_SMALLDATA \ | H5FD_FEAT_POSIX_COMPAT_HANDLE \ | H5FD_FEAT_SUPPORTS_SWMR_IO \ | H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; - } FUNC_LEAVE_NOAPI(SUCCEED); -} /* end H5FD_mirror_query() */ +} /* end H5FD__mirror_query() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_get_eoa + * Function: H5FD__mirror_get_eoa * * Purpose: Gets the end-of-address marker for the file. The EOA marker * is the first address past the last byte allocated in the @@ -1652,22 +1677,22 @@ H5FD_mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) *------------------------------------------------------------------------- */ static haddr_t -H5FD_mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_mirror_t *file = (const H5FD_mirror_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - LOG_OP_CALL("H5FD_mirror_get_eoa"); + LOG_OP_CALL(FUNC); HDassert(file); FUNC_LEAVE_NOAPI(file->eoa) -} /* end H5FD_mirror_get_eoa() */ +} /* end H5FD__mirror_get_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_set_eoa + * Function: H5FD__mirror_set_eoa * * Purpose: Set the end-of-address marker for the file. This function is * called shortly after an existing HDF5 file is opened in order @@ -1677,16 +1702,16 @@ H5FD_mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) +H5FD__mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) { H5FD_mirror_xmit_eoa_t xmit_eoa; - unsigned char xmit_buf[H5FD_MIRROR_XMIT_EOA_SIZE]; + unsigned char *xmit_buf = NULL; H5FD_mirror_t *file = (H5FD_mirror_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_set_eoa"); + LOG_OP_CALL(FUNC); HDassert(file); @@ -1699,31 +1724,31 @@ H5FD_mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) xmit_eoa.type = (uint8_t)type; xmit_eoa.eoa_addr = (uint64_t)addr; - if (H5FD_mirror_xmit_encode_set_eoa(xmit_buf, - (const H5FD_mirror_xmit_eoa_t *)&xmit_eoa) - != H5FD_MIRROR_XMIT_EOA_SIZE) - { + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer"); + + if(H5FD_mirror_xmit_encode_set_eoa(xmit_buf, &xmit_eoa) != H5FD_MIRROR_XMIT_EOA_SIZE) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode set-eoa"); - } LOG_XMIT_BYTES("set-eoa", xmit_buf, H5FD_MIRROR_XMIT_EOA_SIZE); - if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_EOA_SIZE) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, - "unable to transmit set-eoa"); - } + if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_EOA_SIZE) < 0) + HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit set-eoa"); - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply"); - } done: + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mirror_set_eoa() */ +} /* end H5FD__mirror_set_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_get_eof + * Function: H5FD__mirror_get_eof * * Purpose: Returns the end-of-file marker, which is the greater of * either the filesystem end-of-file or the HDF5 end-of-address @@ -1736,49 +1761,43 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5FD_mirror_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__mirror_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_mirror_t *file = (const H5FD_mirror_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - LOG_OP_CALL("H5FD_mirror_get_eof"); + LOG_OP_CALL(FUNC); HDassert(file); FUNC_LEAVE_NOAPI(file->eof) -} /* end H5FD_mirror_get_eof() */ +} /* end H5FD__mirror_get_eof() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_read + * Function: H5FD__mirror_read * - * Purpose: Required to register the driver. - * If called, MUST fail. + * Purpose: Required to register the driver, but if called, MUST fail. * * Return: FAIL *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_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) +H5FD__mirror_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) { - herr_t ret_value = FAIL; + FUNC_ENTER_STATIC_NOERR - FUNC_ENTER_NOAPI_NOINIT_NOERR + LOG_OP_CALL(FUNC); - LOG_OP_CALL("H5FD_mirror_read"); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mirror_read() */ + FUNC_LEAVE_NOAPI(FAIL) +} /* end H5FD__mirror_read() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_write + * Function: H5FD__mirror_write * * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR * from buffer BUF according to data transfer properties in @@ -1795,21 +1814,17 @@ H5FD_mirror_read(H5FD_t H5_ATTR_UNUSED *_file, *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_write(H5FD_t *_file, - H5FD_mem_t type, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t addr, - size_t size, - const void *buf) +H5FD__mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, + haddr_t addr, size_t size, const void *buf) { H5FD_mirror_xmit_write_t xmit_write; - unsigned char xmit_buf[H5FD_MIRROR_XMIT_WRITE_SIZE]; + unsigned char *xmit_buf = NULL; H5FD_mirror_t *file = (H5FD_mirror_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_write"); + LOG_OP_CALL(FUNC); HDassert(file); HDassert(buf); @@ -1822,43 +1837,41 @@ H5FD_mirror_write(H5FD_t *_file, xmit_write.offset = (uint64_t)addr; xmit_write.type = (uint8_t)type; + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer"); /* Notify Writer of incoming data to write. */ - if (H5FD_mirror_xmit_encode_write(xmit_buf, - (const H5FD_mirror_xmit_write_t *)&xmit_write) - != H5FD_MIRROR_XMIT_WRITE_SIZE) - { + if(H5FD_mirror_xmit_encode_write(xmit_buf, &xmit_write) != H5FD_MIRROR_XMIT_WRITE_SIZE) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode write"); - } LOG_XMIT_BYTES("write", xmit_buf, H5FD_MIRROR_XMIT_WRITE_SIZE); - if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_WRITE_SIZE) < 0) { + if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_WRITE_SIZE) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit write"); - } /* Check that our write xmission was received */ - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply"); - } /* Send the data to be written */ - if (HDwrite(file->sock_fd, buf, size) < 0) { + if(HDwrite(file->sock_fd, buf, size) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit data"); - } /* Writer should reply that it got the data and is still okay/ready */ - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply"); - } done: + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mirror_write() */ +} /* end H5FD__mirror_write() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_truncate + * Function: H5FD__mirror_truncate * * Purpose: Makes sure that the true file size is the same (or larger) * than the end-of-address. @@ -1867,45 +1880,45 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_truncate(H5FD_t *_file, - hid_t H5_ATTR_UNUSED dxpl_id, - hbool_t H5_ATTR_UNUSED closing) +H5FD__mirror_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, + hbool_t H5_ATTR_UNUSED closing) { - unsigned char xmit_buf[H5FD_MIRROR_XMIT_HEADER_SIZE]; + unsigned char *xmit_buf = NULL; H5FD_mirror_t *file = (H5FD_mirror_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_truncate"); + LOG_OP_CALL(FUNC); file->xmit.xmit_count = (file->xmit_i)++; file->xmit.op = H5FD_MIRROR_OP_TRUNCATE; - if (H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) - != H5FD_MIRROR_XMIT_HEADER_SIZE) - { + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer"); + + if(H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) != H5FD_MIRROR_XMIT_HEADER_SIZE) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode truncate"); - } LOG_XMIT_BYTES("truncate", xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE); - if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, - "unable to transmit truncate"); - } + if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) + HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit truncate"); - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply"); - } done: + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mirror_truncate() */ +} /* end H5FD__mirror_truncate() */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_lock + * Function: H5FD__mirror_lock * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": @@ -1916,16 +1929,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_lock(H5FD_t *_file, hbool_t rw) +H5FD__mirror_lock(H5FD_t *_file, hbool_t rw) { H5FD_mirror_xmit_lock_t xmit_lock; - unsigned char xmit_buf[H5FD_MIRROR_XMIT_LOCK_SIZE]; + unsigned char *xmit_buf = NULL; H5FD_mirror_t *file = (H5FD_mirror_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT; + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_lock"); + LOG_OP_CALL(FUNC); file->xmit.xmit_count = (file->xmit_i)++; file->xmit.op = H5FD_MIRROR_OP_LOCK; @@ -1933,30 +1946,31 @@ H5FD_mirror_lock(H5FD_t *_file, hbool_t rw) xmit_lock.pub = file->xmit; xmit_lock.rw = (uint64_t)rw; - if (H5FD_mirror_xmit_encode_lock(xmit_buf, - (const H5FD_mirror_xmit_lock_t *)&xmit_lock) - != H5FD_MIRROR_XMIT_LOCK_SIZE) - { + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer"); + + if(H5FD_mirror_xmit_encode_lock(xmit_buf, &xmit_lock) != H5FD_MIRROR_XMIT_LOCK_SIZE) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode lock"); - } LOG_XMIT_BYTES("lock", xmit_buf, H5FD_MIRROR_XMIT_LOCK_SIZE); - if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_LOCK_SIZE) < 0) { + if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_LOCK_SIZE) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit lock"); - } - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply"); - } done: + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value); -} /* end H5FD_mirror_lock */ +} /* end H5FD__mirror_lock */ /*------------------------------------------------------------------------- - * Function: H5FD_mirror_unlock + * Function: H5FD__mirror_unlock * * Purpose: Remove the existing lock on the file. * @@ -1964,38 +1978,40 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mirror_unlock(H5FD_t *_file) +H5FD__mirror_unlock(H5FD_t *_file) { - unsigned char xmit_buf[H5FD_MIRROR_XMIT_HEADER_SIZE]; + unsigned char *xmit_buf = NULL; H5FD_mirror_t *file = (H5FD_mirror_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT; + FUNC_ENTER_STATIC - LOG_OP_CALL("H5FD_mirror_unlock"); + LOG_OP_CALL(FUNC); file->xmit.xmit_count = (file->xmit_i)++; file->xmit.op = H5FD_MIRROR_OP_UNLOCK; - if (H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) - != H5FD_MIRROR_XMIT_HEADER_SIZE) - { + xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); + if(NULL == xmit_buf) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer"); + + if(H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) != H5FD_MIRROR_XMIT_HEADER_SIZE) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode unlock"); - } LOG_XMIT_BYTES("unlock", xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE); - if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) { + if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit unlock"); - } - if (H5FD__mirror_verify_reply(file) == FAIL) { + if(H5FD__mirror_verify_reply(file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply"); - } done: + if(xmit_buf) + xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf); + FUNC_LEAVE_NOAPI(ret_value); -} /* end H5FD_mirror_unlock */ +} /* end H5FD__mirror_unlock */ #endif /* H5_HAVE_MIRROR_VFD */ diff --git a/src/H5FDmirror.h b/src/H5FDmirror.h index fb66b7b..7d15c1b 100644 --- a/src/H5FDmirror.h +++ b/src/H5FDmirror.h @@ -65,297 +65,6 @@ H5_DLL hid_t H5FD_mirror_init(void); H5_DLL herr_t H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out); H5_DLL herr_t H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa); -/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - * IPC - Mirror VFD and Remote Worker application. - * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = - */ - - -/* The maximum allowed size for a receiving buffer when accepting bytes to - * write. Writes larger than this size are performed by multiple accept-write - * steps by the Writer. */ -#define H5FD_MIRROR_DATA_BUFFER_MAX H5_GB /* 1 Gigabyte */ - -#define H5FD_MIRROR_XMIT_CURR_VERSION 1 -#define H5FD_MIRROR_XMIT_MAGIC 0x87F8005B - -#define H5FD_MIRROR_OP_OPEN 1 -#define H5FD_MIRROR_OP_CLOSE 2 -#define H5FD_MIRROR_OP_WRITE 3 -#define H5FD_MIRROR_OP_TRUNCATE 4 -#define H5FD_MIRROR_OP_REPLY 5 -#define H5FD_MIRROR_OP_SET_EOA 6 -#define H5FD_MIRROR_OP_LOCK 7 -#define H5FD_MIRROR_OP_UNLOCK 8 - -#define H5FD_MIRROR_STATUS_OK 0 -#define H5FD_MIRROR_STATUS_ERROR 1 -#define H5FD_MIRROR_STATUS_MESSAGE_MAX 256 /* Dedicated error message size */ - -/* Maximum length of a path/filename string, including the NULL-terminator. - * Must not be smaller than H5FD_SPLITTER_PATH_MAX. */ -#define H5FD_MIRROR_XMIT_FILEPATH_MAX 4097 - -/* Define the exact sizes of the various xmit blobs as sent over the wire. - * This is used to minimize the number of bytes transmitted as well as to - * sanity-check received bytes. - * Any modifications to the xmit structures and/or the encode/decode functions - * must be reflected here. - * */ -#define H5FD_MIRROR_XMIT_HEADER_SIZE 14 -#define H5FD_MIRROR_XMIT_EOA_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 9) -#define H5FD_MIRROR_XMIT_LOCK_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 8) -#define H5FD_MIRROR_XMIT_OPEN_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 20 + H5FD_MIRROR_XMIT_FILEPATH_MAX) -#define H5FD_MIRROR_XMIT_REPLY_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 4 + H5FD_MIRROR_STATUS_MESSAGE_MAX) -#define H5FD_MIRROR_XMIT_WRITE_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 17) - -/* Maximum length of any xmit. */ -#define H5FD_MIRROR_XMIT_BUFFER_MAX MAX2( MAX3(H5FD_MIRROR_XMIT_HEADER_SIZE, \ - H5FD_MIRROR_XMIT_EOA_SIZE, \ - H5FD_MIRROR_XMIT_LOCK_SIZE), \ - MAX3(H5FD_MIRROR_XMIT_OPEN_SIZE, \ - H5FD_MIRROR_XMIT_REPLY_SIZE, \ - H5FD_MIRROR_XMIT_WRITE_SIZE) ) \ - -/* --------------------------------------------------------------------------- - * Structure: H5FD_mirror_xmit_t - * - * Common structure 'header' for all mirror VFD/worker IPC. - * Must be the first component of a derived operation xmit structure, - * such as file-open or write command. - * - * `magic` (uint32_t) - * A "unique" number identifying the structure and endianness of - * transmitting maching. - * Must be set to H5FD_MIRROR_XMIT_MAGIC native to the VFD "sender". - * - * `version` (uint8_t) - * Number used to identify the structure membership. - * Allows sane modifications to this structure in the future. - * Must be set to H5FD_MIRROR_XMIT_CURR_VERSION. - * - * `session_token` (uint32_t) - * A "unique" number identifying the session between VFD sender and - * remote receiver/worker/writer. Exists to help sanity-check. - * - * `xmit_count` (uint32_t) - * Which transmission this is since the session began. - * Used to sanity-check transmission errors. - * First xmit (file-open) must be 0. - * - * `op` (uint8_t) - * Number identifying which operation to perform. - * Corresponds with the extended structure outside of this xmit header. - * Possible values are all defined H5FD_MIRROR_OP_* constants. - * - * --------------------------------------------------------------------------- - */ -typedef struct H5FD_mirror_xmit_t { - uint32_t magic; - uint8_t version; - uint32_t session_token; - uint32_t xmit_count; - uint8_t op; -} H5FD_mirror_xmit_t; - -/* --------------------------------------------------------------------------- - * Structure: H5FD_mirror_xmit_eoa_t - * - * Structure containing eoa-set information from VFD sender. - * - * `pub` (H5FD_mirror_xmit_t) - * Common transmission header, containing session information. - * Must be first. - * - * `type` (uint8_t) - * System-independent alias for H5F[D]_mem_t. - * Specifies datatype to be written. - * - * `eoa_addr` (uint64_t) - * New address for eoa. - * (Natively 'haddr_t', always a 64-bit field) - * - * --------------------------------------------------------------------------- - */ -typedef struct H5FD_mirror_xmit_eoa_t { - H5FD_mirror_xmit_t pub; - uint8_t type; - uint64_t eoa_addr; -} H5FD_mirror_xmit_eoa_t; - -/* --------------------------------------------------------------------------- - * Structure: H5FD_mirror_xmit_lock_t - * - * Structure containing eoa-set information from VFD sender. - * - * `pub` (H5FD_mirror_xmit_t) - * Common transmission header, containing session information. - * Must be first. - * - * `rw` (uint64_t) - * The Read/Write mode flag passed into H5FDlock(). - * (Natively `hbool_t`, an 'int') TODO: native int may be 64-bit? - * - * --------------------------------------------------------------------------- - */ -typedef struct H5FD_mirror_xmit_lock_t { - H5FD_mirror_xmit_t pub; - uint64_t rw; -} H5FD_mirror_xmit_lock_t; - -/* --------------------------------------------------------------------------- - * Structure: H5FD_mirror_xmit_open_t - * - * Structure containing file-open information from the VFD sender. - * - * `pub` (H5FD_mirror_xmit_t) - * Common transmission header, containing session information. - * Must be first. - * - * `flags` (uint32_t) - * VFL-layer file-open flags passed directly to H5FDopen(). - * (Natively 'unsigned [int]') TODO: native int may be 64-bit? - * - * `maxaddr` (uint64_t) - * VFL-layer maximum allowed address space for the file to open passed - * directly to H5FDopen(). - * (Natively 'haddr_t', always a 64-bit field) - * - * `size_t_blob` (uint64_t) - * A number indicating how large a size_t is on the sending system. - * Must be set to (uint64_t)((size_t)(-1)) - * (maximum possible value of size_t, cast to uint64_t). - * The receiving system inspects this value -- if the local (remote) - * size_t is smaller than that of the Sender, issues a warning. - * Not an error, as: - * 1. It is assumed that underlying file systems/drivers have become - * smart enough to handle file sizes that otherwise might be - * constrained. - * 2. The Mirror Writer ingests bytes to write multiple 'slices' if the - * size is greater than H5FD_MIRROR_DATA_BUFFER_MAX, regardless of - * any size_t storage size disparity. - * - * `filename` (char[]) - * String giving the filename and path of file to open. - * - * --------------------------------------------------------------------------- - */ -typedef struct H5FD_mirror_xmit_open_t { - H5FD_mirror_xmit_t pub; - uint32_t flags; - uint64_t maxaddr; - uint64_t size_t_blob; - char filename[H5FD_MIRROR_XMIT_FILEPATH_MAX]; -} H5FD_mirror_xmit_open_t; - -/* --------------------------------------------------------------------------- - * Structure: H5FD_mirror_xmit_reply_t - * - * Structure used by the remote receiver/worker/writer to respond to - * a command from the VFD sender. - * - * `pub` (H5FD_mirror_xmit_t) - * Common transmission header, containing session information. - * Must be first. - * - * `status` (uint32_t) - * Number indicating whether the command was successful or if an - * occured. - * Allowed values are H5FD_MIRROR_STATUS_OK and - * H5FD_MIRROR_STATUS_ERROR. - * - * `message` (char[]) - * Error message. Populated if and only if there was a problem. - * It is possible that a message may reach the end of the alloted - * space without a NULL terminator -- the onus is on the programmer to - * handle this situation. - * - * --------------------------------------------------------------------------- - */ -typedef struct H5FD_mirror_xmit_reply_t { - H5FD_mirror_xmit_t pub; - uint32_t status; - char message[H5FD_MIRROR_STATUS_MESSAGE_MAX]; -} H5FD_mirror_xmit_reply_t; - -/* --------------------------------------------------------------------------- - * Structure: H5FD_mirror_xmit_write_t - * - * Structure containing data-write information from VFD sender. - * - * The data to be written is transmitted in subsequent, packets - * and may be broken up into more than one transmission buffer. - * The VFD sender and remote receiver/worker/writer must coordinate - * the receipt of data. - * - * `pub` (H5FD_mirror_xmit_t) - * Common transmission header, containing session information. - * Must be first. - * - * `type` (uint8_t) - * Specifies datatype to be written. - * (Natively 'H5FD_mem_t', an enumerated type in H5Fpublic.h) - * - * `offset` (uint64_t) - * Start location of write in file. - * (Natively 'haddr_t', always a 64-bit field) - * - * `size` (uint64_t) - * Size of the data to be written, in bytes. - * (Natively 'size_t', accommodate the largest possible as 64-bits) - * - * --------------------------------------------------------------------------- - */ -typedef struct H5FD_mirror_xmit_write_t { - H5FD_mirror_xmit_t pub; - uint8_t type; - uint64_t offset; - uint64_t size; -} H5FD_mirror_xmit_write_t; - - - -/* Encode/decode routines are required to "pack" the xmit data into a known - * byte format for transmission over the wire. - * - * All component numbers must be stored in "network" word order (Big-Endian). - * - * All components must be packed in the order given in the structure definition. - * - * All components must be packed with zero padding between. - */ - -H5_DLL size_t H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *buf); -H5_DLL size_t H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *buf); -H5_DLL size_t H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *buf); -H5_DLL size_t H5FD__mirror_xmit_decode_uint8(uint8_t *out, const unsigned char *buf); -H5_DLL size_t H5FD__mirror_xmit_encode_uint16(unsigned char *dest, uint16_t v); -H5_DLL size_t H5FD__mirror_xmit_encode_uint32(unsigned char *dest, uint32_t v); -H5_DLL size_t H5FD__mirror_xmit_encode_uint64(unsigned char *dest, uint64_t v); -H5_DLL size_t H5FD__mirror_xmit_encode_uint8(unsigned char *dest, uint8_t v); - -H5_DLL size_t H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out, const unsigned char *buf); -H5_DLL size_t H5FD_mirror_xmit_decode_lock(H5FD_mirror_xmit_lock_t *out, const unsigned char *buf); -H5_DLL size_t H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out, const unsigned char *buf); -H5_DLL size_t H5FD_mirror_xmit_decode_reply(H5FD_mirror_xmit_reply_t *out, const unsigned char *buf); -H5_DLL size_t H5FD_mirror_xmit_decode_set_eoa(H5FD_mirror_xmit_eoa_t *out, const unsigned char *buf); -H5_DLL size_t H5FD_mirror_xmit_decode_write(H5FD_mirror_xmit_write_t *out, const unsigned char *buf); - -H5_DLL size_t H5FD_mirror_xmit_encode_header(unsigned char *dest, const H5FD_mirror_xmit_t *x); -H5_DLL size_t H5FD_mirror_xmit_encode_lock(unsigned char *dest, const H5FD_mirror_xmit_lock_t *x); -H5_DLL size_t H5FD_mirror_xmit_encode_open(unsigned char *dest, const H5FD_mirror_xmit_open_t *x); -H5_DLL size_t H5FD_mirror_xmit_encode_reply(unsigned char *dest, const H5FD_mirror_xmit_reply_t *x); -H5_DLL size_t H5FD_mirror_xmit_encode_set_eoa(unsigned char *dest, const H5FD_mirror_xmit_eoa_t *x); -H5_DLL size_t H5FD_mirror_xmit_encode_write(unsigned char *dest, const H5FD_mirror_xmit_write_t *x); - -H5_DLL hbool_t H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit); -H5_DLL hbool_t H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit); - #ifdef __cplusplus } #endif @@ -368,4 +77,3 @@ H5_DLL hbool_t H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit); #endif /* H5FDmirror_H */ - diff --git a/src/H5FDmirror_priv.h b/src/H5FDmirror_priv.h new file mode 100644 index 0000000..dc15441 --- /dev/null +++ b/src/H5FDmirror_priv.h @@ -0,0 +1,323 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Purpose: Public, shared definitions for Mirror VFD & remote Writer. + */ + +#ifndef H5FDmirror_priv_H +#define H5FDmirror_priv_H + +#ifdef H5_HAVE_MIRROR_VFD + +#ifdef __cplusplus +extern "C" { +#endif + +/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + * IPC - Mirror VFD and Remote Worker application. + * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + */ + +/* The maximum allowed size for a receiving buffer when accepting bytes to + * write. Writes larger than this size are performed by multiple accept-write + * steps by the Writer. */ +#define H5FD_MIRROR_DATA_BUFFER_MAX H5_GB /* 1 Gigabyte */ + +#define H5FD_MIRROR_XMIT_CURR_VERSION 1 +#define H5FD_MIRROR_XMIT_MAGIC 0x87F8005B + +#define H5FD_MIRROR_OP_OPEN 1 +#define H5FD_MIRROR_OP_CLOSE 2 +#define H5FD_MIRROR_OP_WRITE 3 +#define H5FD_MIRROR_OP_TRUNCATE 4 +#define H5FD_MIRROR_OP_REPLY 5 +#define H5FD_MIRROR_OP_SET_EOA 6 +#define H5FD_MIRROR_OP_LOCK 7 +#define H5FD_MIRROR_OP_UNLOCK 8 + +#define H5FD_MIRROR_STATUS_OK 0 +#define H5FD_MIRROR_STATUS_ERROR 1 +#define H5FD_MIRROR_STATUS_MESSAGE_MAX 256 /* Dedicated error message size */ + +/* Maximum length of a path/filename string, including the NULL-terminator. + * Must not be smaller than H5FD_SPLITTER_PATH_MAX. */ +#define H5FD_MIRROR_XMIT_FILEPATH_MAX 4097 + +/* Define the exact sizes of the various xmit blobs as sent over the wire. + * This is used to minimize the number of bytes transmitted as well as to + * sanity-check received bytes. + * Any modifications to the xmit structures and/or the encode/decode functions + * must be reflected here. + * */ +#define H5FD_MIRROR_XMIT_HEADER_SIZE 14 +#define H5FD_MIRROR_XMIT_EOA_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 9) +#define H5FD_MIRROR_XMIT_LOCK_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 8) +#define H5FD_MIRROR_XMIT_OPEN_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 20 + H5FD_MIRROR_XMIT_FILEPATH_MAX) +#define H5FD_MIRROR_XMIT_REPLY_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 4 + H5FD_MIRROR_STATUS_MESSAGE_MAX) +#define H5FD_MIRROR_XMIT_WRITE_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 17) + +/* Maximum length of any xmit. */ +#define H5FD_MIRROR_XMIT_BUFFER_MAX MAX2( MAX3(H5FD_MIRROR_XMIT_HEADER_SIZE, \ + H5FD_MIRROR_XMIT_EOA_SIZE, \ + H5FD_MIRROR_XMIT_LOCK_SIZE), \ + MAX3(H5FD_MIRROR_XMIT_OPEN_SIZE, \ + H5FD_MIRROR_XMIT_REPLY_SIZE, \ + H5FD_MIRROR_XMIT_WRITE_SIZE) ) \ + +/* --------------------------------------------------------------------------- + * Structure: H5FD_mirror_xmit_t + * + * Common structure 'header' for all mirror VFD/worker IPC. + * Must be the first component of a derived operation xmit structure, + * such as file-open or write command. + * + * `magic` (uint32_t) + * A "unique" number identifying the structure and endianness of + * transmitting maching. + * Must be set to H5FD_MIRROR_XMIT_MAGIC native to the VFD "sender". + * + * `version` (uint8_t) + * Number used to identify the structure membership. + * Allows sane modifications to this structure in the future. + * Must be set to H5FD_MIRROR_XMIT_CURR_VERSION. + * + * `session_token` (uint32_t) + * A "unique" number identifying the session between VFD sender and + * remote receiver/worker/writer. Exists to help sanity-check. + * + * `xmit_count` (uint32_t) + * Which transmission this is since the session began. + * Used to sanity-check transmission errors. + * First xmit (file-open) must be 0. + * + * `op` (uint8_t) + * Number identifying which operation to perform. + * Corresponds with the extended structure outside of this xmit header. + * Possible values are all defined H5FD_MIRROR_OP_* constants. + * + * --------------------------------------------------------------------------- + */ +typedef struct H5FD_mirror_xmit_t { + uint32_t magic; + uint8_t version; + uint32_t session_token; + uint32_t xmit_count; + uint8_t op; +} H5FD_mirror_xmit_t; + +/* --------------------------------------------------------------------------- + * Structure: H5FD_mirror_xmit_eoa_t + * + * Structure containing eoa-set information from VFD sender. + * + * `pub` (H5FD_mirror_xmit_t) + * Common transmission header, containing session information. + * Must be first. + * + * `type` (uint8_t) + * System-independent alias for H5F[D]_mem_t. + * Specifies datatype to be written. + * + * `eoa_addr` (uint64_t) + * New address for eoa. + * (Natively 'haddr_t', always a 64-bit field) + * + * --------------------------------------------------------------------------- + */ +typedef struct H5FD_mirror_xmit_eoa_t { + H5FD_mirror_xmit_t pub; + uint8_t type; + uint64_t eoa_addr; +} H5FD_mirror_xmit_eoa_t; + +/* --------------------------------------------------------------------------- + * Structure: H5FD_mirror_xmit_lock_t + * + * Structure containing eoa-set information from VFD sender. + * + * `pub` (H5FD_mirror_xmit_t) + * Common transmission header, containing session information. + * Must be first. + * + * `rw` (uint64_t) + * The Read/Write mode flag passed into H5FDlock(). + * (Natively `hbool_t`, an 'int') TODO: native int may be 64-bit? + * + * --------------------------------------------------------------------------- + */ +typedef struct H5FD_mirror_xmit_lock_t { + H5FD_mirror_xmit_t pub; + uint64_t rw; +} H5FD_mirror_xmit_lock_t; + +/* --------------------------------------------------------------------------- + * Structure: H5FD_mirror_xmit_open_t + * + * Structure containing file-open information from the VFD sender. + * + * `pub` (H5FD_mirror_xmit_t) + * Common transmission header, containing session information. + * Must be first. + * + * `flags` (uint32_t) + * VFL-layer file-open flags passed directly to H5FDopen(). + * (Natively 'unsigned [int]') TODO: native int may be 64-bit? + * + * `maxaddr` (uint64_t) + * VFL-layer maximum allowed address space for the file to open passed + * directly to H5FDopen(). + * (Natively 'haddr_t', always a 64-bit field) + * + * `size_t_blob` (uint64_t) + * A number indicating how large a size_t is on the sending system. + * Must be set to (uint64_t)((size_t)(-1)) + * (maximum possible value of size_t, cast to uint64_t). + * The receiving system inspects this value -- if the local (remote) + * size_t is smaller than that of the Sender, issues a warning. + * Not an error, as: + * 1. It is assumed that underlying file systems/drivers have become + * smart enough to handle file sizes that otherwise might be + * constrained. + * 2. The Mirror Writer ingests bytes to write multiple 'slices' if the + * size is greater than H5FD_MIRROR_DATA_BUFFER_MAX, regardless of + * any size_t storage size disparity. + * + * `filename` (char[]) + * String giving the filename and path of file to open. + * + * --------------------------------------------------------------------------- + */ +typedef struct H5FD_mirror_xmit_open_t { + H5FD_mirror_xmit_t pub; + uint32_t flags; + uint64_t maxaddr; + uint64_t size_t_blob; + char filename[H5FD_MIRROR_XMIT_FILEPATH_MAX]; +} H5FD_mirror_xmit_open_t; + +/* --------------------------------------------------------------------------- + * Structure: H5FD_mirror_xmit_reply_t + * + * Structure used by the remote receiver/worker/writer to respond to + * a command from the VFD sender. + * + * `pub` (H5FD_mirror_xmit_t) + * Common transmission header, containing session information. + * Must be first. + * + * `status` (uint32_t) + * Number indicating whether the command was successful or if an + * occured. + * Allowed values are H5FD_MIRROR_STATUS_OK and + * H5FD_MIRROR_STATUS_ERROR. + * + * `message` (char[]) + * Error message. Populated if and only if there was a problem. + * It is possible that a message may reach the end of the alloted + * space without a NULL terminator -- the onus is on the programmer to + * handle this situation. + * + * --------------------------------------------------------------------------- + */ +typedef struct H5FD_mirror_xmit_reply_t { + H5FD_mirror_xmit_t pub; + uint32_t status; + char message[H5FD_MIRROR_STATUS_MESSAGE_MAX]; +} H5FD_mirror_xmit_reply_t; + +/* --------------------------------------------------------------------------- + * Structure: H5FD_mirror_xmit_write_t + * + * Structure containing data-write information from VFD sender. + * + * The data to be written is transmitted in subsequent, packets + * and may be broken up into more than one transmission buffer. + * The VFD sender and remote receiver/worker/writer must coordinate + * the receipt of data. + * + * `pub` (H5FD_mirror_xmit_t) + * Common transmission header, containing session information. + * Must be first. + * + * `type` (uint8_t) + * Specifies datatype to be written. + * (Natively 'H5FD_mem_t', an enumerated type in H5Fpublic.h) + * + * `offset` (uint64_t) + * Start location of write in file. + * (Natively 'haddr_t', always a 64-bit field) + * + * `size` (uint64_t) + * Size of the data to be written, in bytes. + * (Natively 'size_t', accommodate the largest possible as 64-bits) + * + * --------------------------------------------------------------------------- + */ +typedef struct H5FD_mirror_xmit_write_t { + H5FD_mirror_xmit_t pub; + uint8_t type; + uint64_t offset; + uint64_t size; +} H5FD_mirror_xmit_write_t; + + + +/* Encode/decode routines are required to "pack" the xmit data into a known + * byte format for transmission over the wire. + * + * All component numbers must be stored in "network" word order (Big-Endian). + * + * All components must be packed in the order given in the structure definition. + * + * All components must be packed with zero padding between. + */ + +H5_DLL size_t H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *buf); +H5_DLL size_t H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *buf); +H5_DLL size_t H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *buf); +H5_DLL size_t H5FD__mirror_xmit_decode_uint8(uint8_t *out, const unsigned char *buf); +H5_DLL size_t H5FD__mirror_xmit_encode_uint16(unsigned char *dest, uint16_t v); +H5_DLL size_t H5FD__mirror_xmit_encode_uint32(unsigned char *dest, uint32_t v); +H5_DLL size_t H5FD__mirror_xmit_encode_uint64(unsigned char *dest, uint64_t v); +H5_DLL size_t H5FD__mirror_xmit_encode_uint8(unsigned char *dest, uint8_t v); + +H5_DLL size_t H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out, const unsigned char *buf); +H5_DLL size_t H5FD_mirror_xmit_decode_lock(H5FD_mirror_xmit_lock_t *out, const unsigned char *buf); +H5_DLL size_t H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out, const unsigned char *buf); +H5_DLL size_t H5FD_mirror_xmit_decode_reply(H5FD_mirror_xmit_reply_t *out, const unsigned char *buf); +H5_DLL size_t H5FD_mirror_xmit_decode_set_eoa(H5FD_mirror_xmit_eoa_t *out, const unsigned char *buf); +H5_DLL size_t H5FD_mirror_xmit_decode_write(H5FD_mirror_xmit_write_t *out, const unsigned char *buf); + +H5_DLL size_t H5FD_mirror_xmit_encode_header(unsigned char *dest, const H5FD_mirror_xmit_t *x); +H5_DLL size_t H5FD_mirror_xmit_encode_lock(unsigned char *dest, const H5FD_mirror_xmit_lock_t *x); +H5_DLL size_t H5FD_mirror_xmit_encode_open(unsigned char *dest, const H5FD_mirror_xmit_open_t *x); +H5_DLL size_t H5FD_mirror_xmit_encode_reply(unsigned char *dest, const H5FD_mirror_xmit_reply_t *x); +H5_DLL size_t H5FD_mirror_xmit_encode_set_eoa(unsigned char *dest, const H5FD_mirror_xmit_eoa_t *x); +H5_DLL size_t H5FD_mirror_xmit_encode_write(unsigned char *dest, const H5FD_mirror_xmit_write_t *x); + +H5_DLL hbool_t H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit); +H5_DLL hbool_t H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit); +H5_DLL hbool_t H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit); +H5_DLL hbool_t H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit); +H5_DLL hbool_t H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit); +H5_DLL hbool_t H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit); +H5_DLL hbool_t H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit); + +#ifdef __cplusplus +} +#endif + +#endif /* H5_HAVE_MIRROR_VFD */ + +#endif /* H5FDmirror_priv_H */ + diff --git a/src/H5FDmodule.h b/src/H5FDmodule.h index ea1a9fd..11686be 100644 --- a/src/H5FDmodule.h +++ b/src/H5FDmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index b2959a5..43fa340 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 30, 2004 * * Purpose: Common routines for all MPI-based VFL drivers. @@ -43,8 +43,6 @@ * Programmer: Quincey Koziol * Friday, January 30, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -82,8 +80,6 @@ done: * Programmer: Quincey Koziol * Friday, January 30, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -120,8 +116,6 @@ done: * Programmer: Quincey Koziol * Friday, January 30, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ MPI_Comm @@ -158,8 +152,6 @@ done: * Programmer: John Mainzer * 4/4/17 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -197,13 +189,6 @@ done: * Programmer: Unknown * January 30, 1998 * - * Modifications: - * Robb Matzke, 1999-04-23 - * An error is reported for address overflows. The ADDR output - * argument is optional. - * - * Robb Matzke, 1999-08-06 - * Modified to work with the virtual file layer. *------------------------------------------------------------------------- */ haddr_t @@ -235,16 +220,6 @@ H5FD_mpi_MPIOff_to_haddr(MPI_Offset mpi_off) * Programmer: Unknown * January 30, 1998 * - * Modifications: - * Robb Matzke, 1999-04-23 - * An error is reported for address overflows. The ADDR output - * argument is optional. - * - * Robb Matzke, 1999-07-28 - * The ADDR argument is passed by value. - * - * Robb Matzke, 1999-08-06 - * Modified to work with the virtual file layer. *------------------------------------------------------------------------- */ herr_t @@ -290,9 +265,6 @@ H5FD_mpi_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off/*out*/) * Programmer: rky * 19981207 * - * Modifications: - * Robb Matzke, 1999-08-09 - * Modified to work with the virtual file layer. *------------------------------------------------------------------------- */ herr_t @@ -345,9 +317,6 @@ done: * Programmer: rky * 19981207 * - * Modifications: - * Robb Matzke, 1999-08-09 - * Modified to work with the virtual file layer. *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5FDmpi.h b/src/H5FDmpi.h index 2d62c79..da9f59b 100644 --- a/src/H5FDmpi.h +++ b/src/H5FDmpi.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 30, 2004 * * Purpose: The public header file for common items for all MPI VFL drivers diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 3d2e0cf..9475093 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 29, 1999 * * Purpose: This is the MPI-2 I/O driver. diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h index 6ee0a1a..9d02153 100644 --- a/src/H5FDmpio.h +++ b/src/H5FDmpio.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Purpose: The public header file for the mpio driver. diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 72f4da5..fbca8e4 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, November 10, 1997 * * Purpose: Implements a file driver which dispatches I/O requests to @@ -1234,14 +1234,6 @@ H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * Raymond Lu - * 21 Dec. 2006 - * Added the parameter TYPE. It's only used for MULTI driver. - * If the TYPE is H5FD_MEM_DEFAULT, simply find the biggest - * EOA of individual file because the EOA for the whole file - * is meaningless. - * *------------------------------------------------------------------------- */ static haddr_t @@ -1334,17 +1326,6 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) * Programmer: Robb Matzke * Wednesday, August 4, 1999 * - * Modifications: - * Raymond Lu - * 10 January 2007 - * EOA for the whole file is discarded because it's meaningless - * for MULTI file. This function only sets eoa for individual - * file. - * - * Raymond Lu - * 21 June 2011 - * Backward compatibility of EOA. Please the comment in the - * code. *------------------------------------------------------------------------- */ static herr_t diff --git a/src/H5FDmulti.h b/src/H5FDmulti.h index 0bd5718..b3c3c62 100644 --- a/src/H5FDmulti.h +++ b/src/H5FDmulti.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Purpose: The public header file for the "multi" driver. diff --git a/src/H5FDpkg.h b/src/H5FDpkg.h index 22b5d17..8ffffd1 100644 --- a/src/H5FDpkg.h +++ b/src/H5FDpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 3, 2008 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 2e3d3ce..7d5b66d 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, July 26, 1999 */ #ifndef _H5FDprivate_H diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 61bf212..7297cf8 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, July 26, 1999 */ #ifndef _H5FDpublic_H diff --git a/src/H5FDros3.c b/src/H5FDros3.c index d99272c..38e34a0 100644 --- a/src/H5FDros3.c +++ b/src/H5FDros3.c @@ -13,7 +13,7 @@ /* * Read-Only S3 Virtual File Driver (VFD) * - * Programmer: Jacob Smith + * Programmer: Jacob Smith * 2017-10-13 * * Purpose: @@ -212,66 +212,67 @@ typedef struct H5FD_ros3_t { * Only included if it may be used -- ROS3 VFD is enabled. * */ -#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) #define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR)) /* Prototypes */ -static herr_t H5FD_ros3_term(void); -static void *H5FD_ros3_fapl_get(H5FD_t *_file); -static void *H5FD_ros3_fapl_copy(const void *_old_fa); -static herr_t H5FD_ros3_fapl_free(void *_fa); -static H5FD_t *H5FD_ros3_open(const char *name, unsigned flags, hid_t fapl_id, +static herr_t H5FD__ros3_term(void); +static void *H5FD__ros3_fapl_get(H5FD_t *_file); +static void *H5FD__ros3_fapl_copy(const void *_old_fa); +static herr_t H5FD__ros3_fapl_free(void *_fa); +static H5FD_t *H5FD__ros3_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_ros3_close(H5FD_t *_file); -static int H5FD_ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_ros3_query(const H5FD_t *_f1, unsigned long *flags); -static haddr_t H5FD_ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_ros3_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_ros3_get_eof(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_ros3_get_handle(H5FD_t *_file, hid_t fapl, +static herr_t H5FD__ros3_close(H5FD_t *_file); +static int H5FD__ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD__ros3_query(const H5FD_t *_f1, unsigned long *flags); +static haddr_t H5FD__ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__ros3_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static haddr_t H5FD__ros3_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__ros3_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); -static herr_t H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, +static herr_t H5FD__ros3_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD_ros3_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, +static herr_t H5FD__ros3_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_ros3_truncate(H5FD_t *_file, hid_t dxpl_id, +static herr_t H5FD__ros3_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_ros3_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_ros3_unlock(H5FD_t *_file); -static herr_t H5FD_ros3_validate_config(const H5FD_ros3_fapl_t * fa); +static herr_t H5FD__ros3_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__ros3_unlock(H5FD_t *_file); + +static herr_t H5FD__ros3_validate_config(const H5FD_ros3_fapl_t * fa); static const H5FD_class_t H5FD_ros3_g = { "ros3", /* name */ MAXADDR, /* maxaddr */ H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_ros3_term, /* terminate */ + H5FD__ros3_term, /* terminate */ NULL, /* sb_size */ NULL, /* sb_encode */ NULL, /* sb_decode */ sizeof(H5FD_ros3_fapl_t), /* fapl_size */ - H5FD_ros3_fapl_get, /* fapl_get */ - H5FD_ros3_fapl_copy, /* fapl_copy */ - H5FD_ros3_fapl_free, /* fapl_free */ + H5FD__ros3_fapl_get, /* fapl_get */ + H5FD__ros3_fapl_copy, /* fapl_copy */ + H5FD__ros3_fapl_free, /* fapl_free */ 0, /* dxpl_size */ NULL, /* dxpl_copy */ NULL, /* dxpl_free */ - H5FD_ros3_open, /* open */ - H5FD_ros3_close, /* close */ - H5FD_ros3_cmp, /* cmp */ - H5FD_ros3_query, /* query */ + H5FD__ros3_open, /* open */ + H5FD__ros3_close, /* close */ + H5FD__ros3_cmp, /* cmp */ + H5FD__ros3_query, /* query */ NULL, /* get_type_map */ NULL, /* alloc */ NULL, /* free */ - H5FD_ros3_get_eoa, /* get_eoa */ - H5FD_ros3_set_eoa, /* set_eoa */ - H5FD_ros3_get_eof, /* get_eof */ - H5FD_ros3_get_handle, /* get_handle */ - H5FD_ros3_read, /* read */ - H5FD_ros3_write, /* write */ + H5FD__ros3_get_eoa, /* get_eoa */ + H5FD__ros3_set_eoa, /* set_eoa */ + H5FD__ros3_get_eof, /* get_eof */ + H5FD__ros3_get_handle, /* get_handle */ + H5FD__ros3_read, /* read */ + H5FD__ros3_write, /* write */ NULL, /* flush */ - H5FD_ros3_truncate, /* truncate */ - H5FD_ros3_lock, /* lock */ - H5FD_ros3_unlock, /* unlock */ + H5FD__ros3_truncate, /* truncate */ + H5FD__ros3_lock, /* lock */ + H5FD__ros3_unlock, /* unlock */ H5FD_FLMAP_DICHOTOMY /* fl_map */ }; @@ -297,14 +298,11 @@ H5FD__init_package(void) FUNC_ENTER_STATIC - if (H5FD_ros3_init() < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, - "unable to initialize ros3 VFD") - } + if(H5FD_ros3_init() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize ros3 VFD") done: FUNC_LEAVE_NOAPI(ret_value) - } /* end H5FD__init_package() */ @@ -335,7 +333,7 @@ H5FD_ros3_init(void) HDfprintf(stdout, "H5FD_ros3_init() called.\n"); #endif - if (H5I_VFL != H5I_get_type(H5FD_ROS3_g)) + if(H5I_VFL != H5I_get_type(H5FD_ROS3_g)) H5FD_ROS3_g = H5FD_register(&H5FD_ros3_g, sizeof(H5FD_class_t), FALSE); #if ROS3_STATS @@ -343,6 +341,7 @@ H5FD_ros3_init(void) */ for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) { unsigned long long value = 0; + ROS3_STATS_POW(bin_i, &value) ros3_stats_boundaries[bin_i] = value; } @@ -353,12 +352,11 @@ H5FD_ros3_init(void) done: FUNC_LEAVE_NOAPI(ret_value) - } /* end H5FD_ros3_init() */ /*--------------------------------------------------------------------------- - * Function: H5FD_ros3_term + * Function: H5FD__ros3_term * * Purpose: Shut down the VFD * @@ -369,20 +367,19 @@ done: *--------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_term(void) +H5FD__ros3_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_term() called.\n"); + HDfprintf(stdout, "H5FD__ros3_term() called.\n"); #endif /* Reset VFL ID */ H5FD_ROS3_g = 0; FUNC_LEAVE_NOAPI(SUCCEED) - -} /* end H5FD_ros3_term() */ +} /* end H5FD__ros3_term() */ /*------------------------------------------------------------------------- @@ -401,8 +398,7 @@ H5FD_ros3_term(void) *------------------------------------------------------------------------- */ herr_t -H5Pset_fapl_ros3(hid_t fapl_id, - H5FD_ros3_fapl_t *fa) +H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa) { H5P_genplist_t *plist = NULL; /* Property list pointer */ herr_t ret_value = FAIL; @@ -417,25 +413,21 @@ H5Pset_fapl_ros3(hid_t fapl_id, #endif plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); - if (plist == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, \ - "not a file access property list") - } + if(plist == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - if (FAIL == H5FD_ros3_validate_config(fa)) { + if(FAIL == H5FD__ros3_validate_config(fa)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid ros3 config") - } ret_value = H5P_set_driver(plist, H5FD_ROS3, (void *)fa); done: FUNC_LEAVE_API(ret_value) - } /* end H5Pset_fapl_ros3() */ /*------------------------------------------------------------------------- - * Function: H5FD_ros3_validate_config() + * Function: H5FD__ros3_validate_config() * * Purpose: Test to see if the supplied instance of H5FD_ros3_fapl_t * contains internally consistant data. Return SUCCEED if so, @@ -455,34 +447,25 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_validate_config(const H5FD_ros3_fapl_t * fa) +H5FD__ros3_validate_config(const H5FD_ros3_fapl_t * fa) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(fa != NULL); - if ( fa->version != H5FD_CURR_ROS3_FAPL_T_VERSION ) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Unknown H5FD_ros3_fapl_t version"); - } + if(fa->version != H5FD_CURR_ROS3_FAPL_T_VERSION) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_ros3_fapl_t version"); - /* if set to authenticate, region and id cannot be empty strings - */ - if (fa->authenticate == TRUE) { - if ((fa->aws_region[0] == '\0') || - (fa->secret_id[0] == '\0')) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Inconsistent authentication information"); - } - } + /* if set to authenticate, region and id cannot be empty strings */ + if(fa->authenticate == TRUE) + if((fa->aws_region[0] == '\0') || (fa->secret_id[0] == '\0')) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Inconsistent authentication information"); done: FUNC_LEAVE_NOAPI(ret_value) - -} /* end H5FD_ros3_validate_config() */ +} /* end H5FD__ros3_validate_config() */ /*------------------------------------------------------------------------- @@ -498,13 +481,10 @@ done: * Programmer: John Mainzer * 9/10/17 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t -H5Pget_fapl_ros3(hid_t fapl_id, - H5FD_ros3_fapl_t *fa_out) +H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_out) { const H5FD_ros3_fapl_t *fa = NULL; H5P_genplist_t *plist = NULL; @@ -517,35 +497,30 @@ H5Pget_fapl_ros3(hid_t fapl_id, HDfprintf(stdout, "H5Pget_fapl_ros3() called.\n"); #endif - if (fa_out == NULL) { + if(fa_out == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL") - } plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); - if (plist == NULL) { + if(plist == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") - } - if (H5FD_ROS3 != H5P_peek_driver(plist)) { + if(H5FD_ROS3 != H5P_peek_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver") - } fa = (const H5FD_ros3_fapl_t *)H5P_peek_driver_info(plist); - if (fa == NULL) { + if(fa == NULL) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info") - } /* Copy the ros3 fapl data out */ HDmemcpy(fa_out, fa, sizeof(H5FD_ros3_fapl_t)); done: FUNC_LEAVE_API(ret_value) - } /* end H5Pget_fapl_ros3() */ /*------------------------------------------------------------------------- - * Function: H5FD_ros3_fapl_get + * Function: H5FD__ros3_fapl_get * * Purpose: Gets a file access property list which could be used to * create an identical file. @@ -557,24 +532,20 @@ done: * Programmer: John Mainzer * 9/8/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_ros3_fapl_get(H5FD_t *_file) +H5FD__ros3_fapl_get(H5FD_t *_file) { H5FD_ros3_t *file = (H5FD_ros3_t*)_file; H5FD_ros3_fapl_t *fa = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC fa = (H5FD_ros3_fapl_t *)H5MM_calloc(sizeof(H5FD_ros3_fapl_t)); - if (fa == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "memory allocation failed") - } + if(fa == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Copy the fields of the structure */ HDmemcpy(fa, &(file->fa), sizeof(H5FD_ros3_fapl_t)); @@ -583,18 +554,16 @@ H5FD_ros3_fapl_get(H5FD_t *_file) ret_value = fa; done: - if (ret_value == NULL) { - if (fa != NULL) { + if(ret_value == NULL) + if(fa != NULL) H5MM_xfree(fa); - } - } - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_ros3_fapl_get() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FD__ros3_fapl_get() */ /*------------------------------------------------------------------------- - * Function: H5FD_ros3_fapl_copy + * Function: H5FD__ros3_fapl_copy * * Purpose: Copies the ros3-specific file access properties. * @@ -605,41 +574,35 @@ done: * Programmer: John Mainzer * 9/8/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5FD_ros3_fapl_copy(const void *_old_fa) +H5FD__ros3_fapl_copy(const void *_old_fa) { const H5FD_ros3_fapl_t *old_fa = (const H5FD_ros3_fapl_t*)_old_fa; H5FD_ros3_fapl_t *new_fa = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC new_fa = (H5FD_ros3_fapl_t *)H5MM_malloc(sizeof(H5FD_ros3_fapl_t)); - if (new_fa == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "memory allocation failed"); - } + if(new_fa == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); HDmemcpy(new_fa, old_fa, sizeof(H5FD_ros3_fapl_t)); ret_value = new_fa; done: - if (ret_value == NULL) { - if (new_fa != NULL) { + if(ret_value == NULL) + if(new_fa != NULL) H5MM_xfree(new_fa); - } - } - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_ros3_fapl_copy() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FD__ros3_fapl_copy() */ /*------------------------------------------------------------------------- - * Function: H5FD_ros3_fapl_free + * Function: H5FD__ros3_fapl_free * * Purpose: Frees the ros3-specific file access properties. * @@ -648,27 +611,23 @@ done: * Programmer: John Mainzer * 9/8/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_fapl_free(void *_fa) +H5FD__ros3_fapl_free(void *_fa) { H5FD_ros3_fapl_t *fa = (H5FD_ros3_fapl_t*)_fa; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(fa != NULL); /* sanity check */ H5MM_xfree(fa); FUNC_LEAVE_NOAPI(SUCCEED) - -} /* end H5FD_ros3_fapl_free() */ +} /* end H5FD__ros3_fapl_free() */ #if ROS3_STATS - /*---------------------------------------------------------------------------- * * Function: ros3_reset_stats() @@ -696,18 +655,16 @@ ros3_reset_stats(H5FD_ros3_t *file) unsigned i = 0; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if ROS3_DEBUG HDprintf("ros3_reset_stats() called\n"); #endif - if (file == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "file was null"); - } + if(file == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file was null"); - for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) { + for(i = 0; i <= ROS3_STATS_BIN_COUNT; i++) { file->raw[i].bytes = 0; file->raw[i].count = 0; file->raw[i].min = (unsigned long long)ROS3_STATS_STARTING_MIN; @@ -721,15 +678,13 @@ ros3_reset_stats(H5FD_ros3_t *file) done: FUNC_LEAVE_NOAPI(ret_value); - } /* end ros3_reset_stats() */ - #endif /* ROS3_STATS */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_open() + * Function: H5FD__ros3_open() * * Purpose: * @@ -759,11 +714,7 @@ done: *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_ros3_open( - const char *url, - unsigned flags, - hid_t fapl_id, - haddr_t maxaddr) +H5FD__ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { H5FD_ros3_t *file = NULL; struct tm *now = NULL; @@ -773,117 +724,89 @@ H5FD_ros3_open( H5FD_ros3_fapl_t fa; H5FD_t *ret_value = NULL; - - - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_open() called.\n"); + HDfprintf(stdout, "H5FD__ros3_open() called.\n"); #endif /* Sanity check on file offsets */ HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t)); /* Check arguments */ - if (!url || !*url) + if(!url || !*url) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name") - if (0 == maxaddr || HADDR_UNDEF == maxaddr) + if(0 == maxaddr || HADDR_UNDEF == maxaddr) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr") - if (ADDR_OVERFLOW(maxaddr)) + if(ADDR_OVERFLOW(maxaddr)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr") - if (flags != H5F_ACC_RDONLY) - HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, - "only Read-Only access allowed") + if(flags != H5F_ACC_RDONLY) + HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, "only Read-Only access allowed") - if (FAIL == H5Pget_fapl_ros3(fapl_id, &fa)) { + if(FAIL == H5Pget_fapl_ros3(fapl_id, &fa)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't get property list") - } - if (CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT)) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "unable to initialize curl global (placeholder flags)") - } + if(CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to initialize curl global (placeholder flags)") /* open file; procedure depends on whether or not the fapl instructs to * authenticate requests or not. */ - if (fa.authenticate == TRUE) { + if(fa.authenticate == TRUE) { /* compute signing key (part of AWS/S3 REST API) * can be re-used by user/key for 7 days after creation. * find way to re-use/share */ now = gmnow(); HDassert( now != NULL ); - if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "problem while writing iso8601 timestamp") - } - if (FAIL == H5FD_s3comms_signing_key(signing_key, - (const char *)fa.secret_key, - (const char *)fa.aws_region, - (const char *)iso8601now) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "problem while computing signing key") - } - - handle = H5FD_s3comms_s3r_open( - url, - (const char *)fa.aws_region, - (const char *)fa.secret_id, - (const unsigned char *)signing_key); - } else { + if(ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem while writing iso8601 timestamp") + if(FAIL == H5FD_s3comms_signing_key(signing_key, (const char *)fa.secret_key, + (const char *)fa.aws_region, (const char *)iso8601now)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem while computing signing key") + + handle = H5FD_s3comms_s3r_open( url, (const char *)fa.aws_region, + (const char *)fa.secret_id, (const unsigned char *)signing_key); + } + else handle = H5FD_s3comms_s3r_open(url, NULL, NULL, NULL); - } /* if/else should authenticate */ - if (handle == NULL) { + if(handle == NULL) /* If we want to check CURL's say on the matter in a controlled * fashion, this is the place to do it, but would need to make a * few minor changes to s3comms `s3r_t` and `s3r_read()`. */ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "could not open"); - } - /* create new file struct - */ + /* create new file struct */ file = H5FL_CALLOC(H5FD_ros3_t); - if (file == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "unable to allocate file struct") - } + if(file == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct") file->s3r_handle = handle; HDmemcpy(&(file->fa), &fa, sizeof(H5FD_ros3_fapl_t)); #if ROS3_STATS - if (FAIL == ros3_reset_stats(file)) { - HGOTO_ERROR(H5E_INTERNAL, H5E_UNINITIALIZED, NULL, - "unable to reset file statistics") - } + if(FAIL == ros3_reset_stats(file)) + HGOTO_ERROR(H5E_INTERNAL, H5E_UNINITIALIZED, NULL, "unable to reset file statistics") #endif /* ROS3_STATS */ ret_value = (H5FD_t*)file; done: - if (ret_value == NULL) { - if (handle != NULL) { - if (FAIL == H5FD_s3comms_s3r_close(handle)) { - HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, - "unable to close s3 file handle") - } - } - if (file != NULL) { + if(ret_value == NULL) { + if(handle != NULL) + if(FAIL == H5FD_s3comms_s3r_close(handle)) + HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to close s3 file handle") + if(file != NULL) file = H5FL_FREE(H5FD_ros3_t, file); - } curl_global_cleanup(); /* early cleanup because open failed */ } /* end if null return value (error) */ FUNC_LEAVE_NOAPI(ret_value) - -} /* end H5FD_ros3_open() */ +} /* end H5FD__ros3_open() */ #if ROS3_STATS - /*---------------------------------------------------------------------------- * * Function: ros3_fprint_stats() @@ -939,8 +862,7 @@ done: *---------------------------------------------------------------------------- */ static herr_t -ros3_fprint_stats(FILE *stream, - const H5FD_ros3_t *file) +ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file) { herr_t ret_value = SUCCEED; parsed_url_t *purl = NULL; @@ -959,26 +881,16 @@ ros3_fprint_stats(FILE *stream, unsigned suffix_i = 0; const char suffixes[] = { ' ', 'K', 'M', 'G', 'T', 'P' }; + FUNC_ENTER_STATIC - - FUNC_ENTER_NOAPI_NOINIT - - if (stream == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "file stream cannot be null" ); - } - if (file == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "file cannot be null"); - } - if (file->s3r_handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "s3 request handle cannot be null"); - } - if (file->s3r_handle->purl == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "parsed url structure cannot be null"); - } + if(stream == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file stream cannot be null" ); + if(file == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file cannot be null"); + if(file->s3r_handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "s3 request handle cannot be null"); + if(file->s3r_handle->purl == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "parsed url structure cannot be null"); purl = file->s3r_handle->purl; /****************** @@ -986,9 +898,9 @@ ros3_fprint_stats(FILE *stream, ******************/ HDfprintf(stream, "stats for %s://%s", purl->scheme, purl->host); - if (purl->port != NULL && purl->port[0] != '\0') + if(purl->port != NULL && purl->port[0] != '\0') HDfprintf(stream, ":%s", purl->port); - if (purl->query != NULL && purl->query[0] != '\0') { + if(purl->query != NULL && purl->query[0] != '\0') { if (purl->path != NULL && purl->path[0] != '\0') HDfprintf(stream, "/%s", purl->path); else @@ -1003,23 +915,27 @@ ros3_fprint_stats(FILE *stream, * AGGREGATE STATS * *******************/ - for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) { + for(i = 0; i <= ROS3_STATS_BIN_COUNT; i++) { const ros3_statsbin *r = &file->raw[i]; const ros3_statsbin *m = &file->meta[i]; - if (m->min < min_meta) min_meta = m->min; - if (r->min < min_raw) min_raw = r->min; - if (m->max > max_meta) max_meta = m->max; - if (r->max > max_raw) max_raw = r->max; + if(m->min < min_meta) + min_meta = m->min; + if(r->min < min_raw) + min_raw = r->min; + if(m->max > max_meta) + max_meta = m->max; + if(r->max > max_raw) + max_raw = r->max; count_raw += r->count; count_meta += m->count; bytes_raw += r->bytes; bytes_meta += m->bytes; } - if (count_raw > 0) + if(count_raw > 0) average_raw = (double)bytes_raw / (double)count_raw; - if (count_meta > 0) + if(count_meta > 0) average_meta = (double)bytes_meta / (double)count_meta; /****************** @@ -1031,7 +947,7 @@ ros3_fprint_stats(FILE *stream, HDfprintf(stream, "TOTAL BYTES: %llu (%llu meta, %llu raw)\n", bytes_raw + bytes_meta, bytes_meta, bytes_raw); - if (count_raw + count_meta == 0) + if(count_raw + count_meta == 0) goto done; /************************* @@ -1040,21 +956,21 @@ ros3_fprint_stats(FILE *stream, HDfprintf(stream, "SIZES meta raw\n"); HDfprintf(stream, " min "); - if (count_meta == 0) { + if(count_meta == 0) HDfprintf(stream, " 0.000 "); - } else { + else { re_dub = (double)min_meta; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); } - if (count_raw == 0) { + if(count_raw == 0) HDfprintf(stream, " 0.000 \n"); - } else { + else { re_dub = (double)min_raw; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); @@ -1062,26 +978,26 @@ ros3_fprint_stats(FILE *stream, HDfprintf(stream, " avg "); re_dub = (double)average_meta; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); re_dub = (double)average_raw; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); HDfprintf(stream, " max "); re_dub = (double)max_meta; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); re_dub = (double)max_raw; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); @@ -1095,7 +1011,7 @@ ros3_fprint_stats(FILE *stream, HDfprintf(stream, " up-to meta raw meta raw meta raw\n"); - for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) { + for(i = 0; i <= ROS3_STATS_BIN_COUNT; i++) { const ros3_statsbin *m; const ros3_statsbin *r; unsigned long long range_end = 0; @@ -1110,46 +1026,46 @@ ros3_fprint_stats(FILE *stream, m = &file->meta[i]; r = &file->raw[i]; - if (r->count == 0 && m->count == 0) + if(r->count == 0 && m->count == 0) continue; range_end = ros3_stats_boundaries[i]; - if (i == ROS3_STATS_BIN_COUNT) { + if(i == ROS3_STATS_BIN_COUNT) { range_end = ros3_stats_boundaries[i-1]; HDfprintf(stream, ">"); - } else { - HDfprintf(stream, " "); } + else + HDfprintf(stream, " "); bm_val = (double)m->bytes; - for (suffix_i = 0; bm_val >= 1024.0; suffix_i++) + for(suffix_i = 0; bm_val >= 1024.0; suffix_i++) bm_val /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); bm_suffix = suffixes[suffix_i]; br_val = (double)r->bytes; - for (suffix_i = 0; br_val >= 1024.0; suffix_i++) + for(suffix_i = 0; br_val >= 1024.0; suffix_i++) br_val /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); br_suffix = suffixes[suffix_i]; - if (m->count > 0) + if(m->count > 0) am_val = (double)(m->bytes) / (double)(m->count); - for (suffix_i = 0; am_val >= 1024.0; suffix_i++) + for(suffix_i = 0; am_val >= 1024.0; suffix_i++) am_val /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); am_suffix = suffixes[suffix_i]; - if (r->count > 0) + if(r->count > 0) ar_val = (double)(r->bytes) / (double)(r->count); - for (suffix_i = 0; ar_val >= 1024.0; suffix_i++) + for(suffix_i = 0; ar_val >= 1024.0; suffix_i++) ar_val /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); ar_suffix = suffixes[suffix_i]; re_dub = (double)range_end; - for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) + for(suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; HDassert(suffix_i < sizeof(suffixes)); @@ -1163,7 +1079,7 @@ ros3_fprint_stats(FILE *stream, am_val, am_suffix, /* metadata average */ ar_val, ar_suffix); /* rawdata average */ - fflush(stream); + HDfflush(stream); } done: @@ -1175,7 +1091,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_close() + * Function: H5FD__ros3_close() * * Purpose: * @@ -1191,52 +1107,45 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_close(H5FD_t H5_ATTR_UNUSED *_file) +H5FD__ros3_close(H5FD_t H5_ATTR_UNUSED *_file) { H5FD_ros3_t *file = (H5FD_ros3_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_close() called.\n"); + HDfprintf(stdout, "H5FD__ros3_close() called.\n"); #endif - /* Sanity checks - */ + /* Sanity checks */ HDassert(file != NULL); HDassert(file->s3r_handle != NULL); /* Close the underlying request handle */ - if (FAIL == H5FD_s3comms_s3r_close(file->s3r_handle)) { - HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "unable to close S3 request handle") - } + if(FAIL == H5FD_s3comms_s3r_close(file->s3r_handle)) + HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close S3 request handle") #if ROS3_STATS /* TODO: mechanism to re-target stats printout */ - if (ros3_fprint_stats(stdout, file) == FAIL) { - HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL, - "problem while writing file statistics") - } + if(ros3_fprint_stats(stdout, file) == FAIL) + HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL, "problem while writing file statistics") #endif /* ROS3_STATS */ - /* Release the file info - */ + /* Release the file info */ file = H5FL_FREE(H5FD_ros3_t, file); done: curl_global_cleanup(); /* cleanup to answer init on open */ FUNC_LEAVE_NOAPI(ret_value) - -} /* end H5FD_ros3_close() */ +} /* end H5FD__ros3_close() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_cmp() + * Function: H5FD__ros3_cmp() * * Purpose: * @@ -1265,9 +1174,7 @@ done: *------------------------------------------------------------------------- */ static int -H5FD_ros3_cmp( - const H5FD_t *_f1, - const H5FD_t *_f2) +H5FD__ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { const H5FD_ros3_t *f1 = (const H5FD_ros3_t *)_f1; const H5FD_ros3_t *f2 = (const H5FD_ros3_t *)_f2; @@ -1275,10 +1182,10 @@ H5FD_ros3_cmp( const parsed_url_t *purl2 = NULL; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_cmp() called.\n"); + HDfprintf(stdout, "H5FD__ros3_cmp() called.\n"); #endif HDassert(f1->s3r_handle != NULL); @@ -1294,113 +1201,80 @@ H5FD_ros3_cmp( HDassert(purl2->host != NULL); /* URL: SCHEME */ - if (HDstrcmp(purl1->scheme, purl2->scheme)) { + if(HDstrcmp(purl1->scheme, purl2->scheme)) HGOTO_DONE(-1); - } /* URL: HOST */ - if (HDstrcmp(purl1->host, purl2->host)) { + if(HDstrcmp(purl1->host, purl2->host)) HGOTO_DONE(-1); - } /* URL: PORT */ - if (purl1->port && purl2->port) { - if (HDstrcmp(purl1->port, purl2->port)) { + if(purl1->port && purl2->port) { + if(HDstrcmp(purl1->port, purl2->port)) HGOTO_DONE(-1); - } } - else - if (purl1->port) { + else if(purl1->port) HGOTO_DONE(-1); - } - else - if (purl2->port) { + else if(purl2->port) HGOTO_DONE(-1); - } /* URL: PATH */ - if (purl1->path && purl2->path) { - if (HDstrcmp(purl1->path, purl2->path)) { + if(purl1->path && purl2->path) { + if(HDstrcmp(purl1->path, purl2->path)) HGOTO_DONE(-1); - } } - else - if (purl1->path && !purl2->path) { + else if(purl1->path && !purl2->path) HGOTO_DONE(-1); - } - else - if (purl2->path && !purl1->path) { + else if(purl2->path && !purl1->path) HGOTO_DONE(-1); - } /* URL: QUERY */ - if (purl1->query && purl2->query) { - if (HDstrcmp(purl1->query, purl2->query)) { + if(purl1->query && purl2->query) { + if(HDstrcmp(purl1->query, purl2->query)) HGOTO_DONE(-1); - } } - else - if (purl1->query && !purl2->query) { + else if(purl1->query && !purl2->query) HGOTO_DONE(-1); - } - else - if (purl2->query && !purl1->query) { + else if(purl2->query && !purl1->query) HGOTO_DONE(-1); - } /* FAPL: AWS_REGION */ - if (f1->fa.aws_region[0] != '\0' && f2->fa.aws_region[0] != '\0') { - if (HDstrcmp(f1->fa.aws_region, f2->fa.aws_region)) { + if(f1->fa.aws_region[0] != '\0' && f2->fa.aws_region[0] != '\0') { + if(HDstrcmp(f1->fa.aws_region, f2->fa.aws_region)) HGOTO_DONE(-1); - } } - else - if (f1->fa.aws_region[0] != '\0') { + else if(f1->fa.aws_region[0] != '\0') HGOTO_DONE(-1); - } - else - if (f2->fa.aws_region[0] != '\0') { + else if(f2->fa.aws_region[0] != '\0') HGOTO_DONE(-1); - } /* FAPL: SECRET_ID */ - if (f1->fa.secret_id[0] != '\0' && f2->fa.secret_id[0] != '\0') { - if (HDstrcmp(f1->fa.secret_id, f2->fa.secret_id)) { + if(f1->fa.secret_id[0] != '\0' && f2->fa.secret_id[0] != '\0') { + if(HDstrcmp(f1->fa.secret_id, f2->fa.secret_id)) HGOTO_DONE(-1); - } } - else - if (f1->fa.secret_id[0] != '\0') { + else if(f1->fa.secret_id[0] != '\0') HGOTO_DONE(-1); - } - else - if (f2->fa.secret_id[0] != '\0') { + else if(f2->fa.secret_id[0] != '\0') HGOTO_DONE(-1); - } /* FAPL: SECRET_KEY */ - if (f1->fa.secret_key[0] != '\0' && f2->fa.secret_key[0] != '\0') { - if (HDstrcmp(f1->fa.secret_key, f2->fa.secret_key)) { + if(f1->fa.secret_key[0] != '\0' && f2->fa.secret_key[0] != '\0') { + if(HDstrcmp(f1->fa.secret_key, f2->fa.secret_key)) HGOTO_DONE(-1); - } } - else - if (f1->fa.secret_key[0] != '\0') { + else if(f1->fa.secret_key[0] != '\0') HGOTO_DONE(-1); - } - else - if (f2->fa.secret_key[0] != '\0') { + else if(f2->fa.secret_key[0] != '\0') HGOTO_DONE(-1); - } done: FUNC_LEAVE_NOAPI(ret_value) - -} /* H5FD_ros3_cmp() */ +} /* H5FD__ros3_cmp() */ /*------------------------------------------------------------------------- - * Function: H5FD_ros3_query + * Function: H5FD__ros3_query * * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) @@ -1419,30 +1293,28 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_query(const H5FD_t H5_ATTR_UNUSED *_file, - unsigned long *flags /* out */) +H5FD__ros3_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_query() called.\n"); + HDfprintf(stdout, "H5FD__ros3_query() called.\n"); #endif /* Set the VFL feature flags that this driver supports */ - if (flags) { + if(flags) { *flags = 0; /* OK to perform data sieving for faster raw data reads & writes */ *flags |= H5FD_FEAT_DATA_SIEVE; } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) - -} /* H5FD_ros3_query() */ +} /* H5FD__ros3_query() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_get_eoa() + * Function: H5FD__ros3_get_eoa() * * Purpose: * @@ -1460,25 +1332,23 @@ H5FD_ros3_query(const H5FD_t H5_ATTR_UNUSED *_file, *------------------------------------------------------------------------- */ static haddr_t -H5FD_ros3_get_eoa(const H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_ros3_t *file = (const H5FD_ros3_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_get_eoa() called.\n"); + HDfprintf(stdout, "H5FD__ros3_get_eoa() called.\n"); #endif FUNC_LEAVE_NOAPI(file->eoa) - -} /* end H5FD_ros3_get_eoa() */ +} /* end H5FD__ros3_get_eoa() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_set_eoa() + * Function: H5FD__ros3_set_eoa() * * Purpose: * @@ -1494,28 +1364,25 @@ H5FD_ros3_get_eoa(const H5FD_t *_file, *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_set_eoa(H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - haddr_t addr) +H5FD__ros3_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) { H5FD_ros3_t *file = (H5FD_ros3_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_set_eoa() called.\n"); + HDfprintf(stdout, "H5FD__ros3_set_eoa() called.\n"); #endif file->eoa = addr; FUNC_LEAVE_NOAPI(SUCCEED) - -} /* H5FD_ros3_set_eoa() */ +} /* H5FD__ros3_set_eoa() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_get_eof() + * Function: H5FD__ros3_get_eof() * * Purpose: * @@ -1532,25 +1399,23 @@ H5FD_ros3_set_eoa(H5FD_t *_file, *------------------------------------------------------------------------- */ static haddr_t -H5FD_ros3_get_eof(const H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__ros3_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_ros3_t *file = (const H5FD_ros3_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_get_eof() called.\n"); + HDfprintf(stdout, "H5FD__ros3_get_eof() called.\n"); #endif FUNC_LEAVE_NOAPI(H5FD_s3comms_s3r_get_filesize(file->s3r_handle)) - -} /* end H5FD_ros3_get_eof() */ +} /* end H5FD__ros3_get_eof() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_get_handle() + * Function: H5FD__ros3_get_handle() * * Purpose: * @@ -1566,34 +1431,31 @@ H5FD_ros3_get_eof(const H5FD_t *_file, *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_get_handle(H5FD_t *_file, - hid_t H5_ATTR_UNUSED fapl, - void **file_handle) +H5FD__ros3_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, + void **file_handle) { H5FD_ros3_t *file = (H5FD_ros3_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_get_handle() called.\n"); + HDfprintf(stdout, "H5FD__ros3_get_handle() called.\n"); #endif - if (!file_handle) { + if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") - } *file_handle = file->s3r_handle; done: FUNC_LEAVE_NOAPI(ret_value) - -} /* end H5FD_ros3_get_handle() */ +} /* end H5FD__ros3_get_handle() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_read() + * Function: H5FD__ros3_read() * * Purpose * @@ -1614,12 +1476,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_read(H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t addr, /* start offset */ - size_t size, /* length of read */ - void *buf) /* out */ +H5FD__ros3_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, + hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, + void *buf) { H5FD_ros3_t *file = (H5FD_ros3_t *)_file; size_t filesize = 0; @@ -1631,10 +1490,10 @@ H5FD_ros3_read(H5FD_t *_file, #endif /* ROS3_STATS */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_read() called.\n"); + HDfprintf(stdout, "H5FD__ros3_read() called.\n"); #endif HDassert(file != NULL); @@ -1643,40 +1502,32 @@ H5FD_ros3_read(H5FD_t *_file, filesize = H5FD_s3comms_s3r_get_filesize(file->s3r_handle); - if ((addr > filesize) || ((addr + size) > filesize)) { + if((addr > filesize) || ((addr + size) > filesize)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "range exceeds file address") - } - if (H5FD_s3comms_s3r_read(file->s3r_handle, addr, size, buf) == FAIL) { + if(H5FD_s3comms_s3r_read(file->s3r_handle, addr, size, buf) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unable to execute read") - } #if ROS3_STATS - /* Find which "bin" this read fits in. Can be "overflow" bin. - */ - for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) { - if ((unsigned long long)size < ros3_stats_boundaries[bin_i]) { + /* Find which "bin" this read fits in. Can be "overflow" bin. */ + for(bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) + if((unsigned long long)size < ros3_stats_boundaries[bin_i]) break; - } - } bin = (type == H5FD_MEM_DRAW) ? &file->raw[bin_i] : &file->meta[bin_i]; - /* Store collected stats in appropriate bin - */ - if (bin->count == 0) { + /* Store collected stats in appropriate bin */ + if(bin->count == 0) { bin->min = size; bin->max = size; } else { - if (size < bin->min) { + if(size < bin->min) bin->min = size; - } - if (size > bin->max) { + if(size > bin->max) bin->max = size; - } } bin->count++; bin->bytes += (unsigned long long)size; @@ -1685,13 +1536,12 @@ H5FD_ros3_read(H5FD_t *_file, done: FUNC_LEAVE_NOAPI(ret_value) - -} /* end H5FD_ros3_read() */ +} /* end H5FD__ros3_read() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_write() + * Function: H5FD__ros3_write() * * Purpose: * @@ -1708,33 +1558,28 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_write(H5FD_t H5_ATTR_UNUSED *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t H5_ATTR_UNUSED addr, - size_t H5_ATTR_UNUSED size, - const void H5_ATTR_UNUSED *buf) +H5FD__ros3_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, + hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr, + size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf) { herr_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_write() called.\n"); + HDfprintf(stdout, "H5FD__ros3_write() called.\n"); #endif - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, - "cannot write to read-only file.") + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot write to read-only file.") done: FUNC_LEAVE_NOAPI(ret_value) - -} /* H5FD_ros3_write() */ +} /* H5FD__ros3_write() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_truncate() + * Function: H5FD__ros3_truncate() * * Purpose: * @@ -1753,30 +1598,27 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_truncate(H5FD_t H5_ATTR_UNUSED *_file, - hid_t H5_ATTR_UNUSED dxpl_id, - hbool_t H5_ATTR_UNUSED closing) +H5FD__ros3_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, + hbool_t H5_ATTR_UNUSED closing) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if ROS3_DEBUG - HDfprintf(stdout, "H5FD_ros3_truncate() called.\n"); + HDfprintf(stdout, "H5FD__ros3_truncate() called.\n"); #endif - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, - "cannot truncate read-only file.") + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot truncate read-only file.") done: FUNC_LEAVE_NOAPI(ret_value) - -} /* end H5FD_ros3_truncate() */ +} /* end H5FD__ros3_truncate() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_lock() + * Function: H5FD__ros3_lock() * * Purpose: * @@ -1796,18 +1638,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_lock(H5FD_t H5_ATTR_UNUSED *_file, +H5FD__ros3_lock(H5FD_t H5_ATTR_UNUSED *_file, hbool_t H5_ATTR_UNUSED rw) { - FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(SUCCEED) + FUNC_ENTER_STATIC_NOERR -} /* end H5FD_ros3_lock() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5FD__ros3_lock() */ /*------------------------------------------------------------------------- * - * Function: H5FD_ros3_unlock() + * Function: H5FD__ros3_unlock() * * Purpose: * @@ -1824,12 +1666,12 @@ H5FD_ros3_lock(H5FD_t H5_ATTR_UNUSED *_file, *------------------------------------------------------------------------- */ static herr_t -H5FD_ros3_unlock(H5FD_t H5_ATTR_UNUSED *_file) +H5FD__ros3_unlock(H5FD_t H5_ATTR_UNUSED *_file) { - FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(SUCCEED) + FUNC_ENTER_STATIC_NOERR -} /* end H5FD_ros3_unlock() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5FD__ros3_unlock() */ #endif /* H5_HAVE_ROS3_VFD */ diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c index d9d4c88..e79ee0d 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -148,9 +148,8 @@ curlwritecallback(char *ptr, size_t product = (size * nmemb); size_t written = 0; - if (sds->magic != S3COMMS_CALLBACK_DATASTRUCT_MAGIC) { + if(sds->magic != S3COMMS_CALLBACK_DATASTRUCT_MAGIC) return written; - } if (size > 0) { HDmemcpy(&(sds->data[sds->size]), ptr, product); @@ -159,7 +158,6 @@ curlwritecallback(char *ptr, } return written; - } /* end curlwritecallback() */ @@ -236,22 +234,19 @@ H5FD_s3comms_hrb_node_set( FUNC_ENTER_NOAPI_NOINIT #if S3COMMS_DEBUG - HDfprintf(stdout, "called H5FD_s3comms_hrb_node_set.\n"); + HDfprintf(stdout, "called H5FD_s3comms_hrb_node_set."); HDprintf("NAME: %s\n", name); HDprintf("VALUE: %s\n", value); HDprintf("LIST:\n->"); - for (node_ptr = (*L); node_ptr != NULL; node_ptr = node_ptr->next) { + for(node_ptr = (*L); node_ptr != NULL; node_ptr = node_ptr->next) HDfprintf(stdout, "{%s}\n->", node_ptr->cat); - } HDprintf("(null)\n"); - fflush(stdout); + HDfflush(stdout); node_ptr = NULL; #endif - if (name == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to operate on null name.\n"); - } + if(name == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to operate on null name"); namelen = HDstrlen(name); /*********************** @@ -261,20 +256,17 @@ H5FD_s3comms_hrb_node_set( /* copy and lowercase name */ lowername = (char *)H5MM_malloc(sizeof(char) * (namelen + 1)); - if (lowername == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, - "cannot make space for lowercase name copy.\n"); - } - for (i = 0; i < namelen; i++) { - lowername[i] = (char)tolower((int)name[i]); - } + if(lowername == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for lowercase name copy."); + for(i = 0; i < namelen; i++) + lowername[i] = (char)HDtolower((int)name[i]); lowername[namelen] = 0; /* If value supplied, copy name, value, and concatenated "name: value". * If NULL, we will be removing a node or doing nothing, so no need for * copies */ - if (value != NULL) { + if(value != NULL) { int ret = 0; size_t valuelen = HDstrlen(value); size_t catlen = namelen + valuelen + 2; /* +2 from ": " */ @@ -282,38 +274,28 @@ H5FD_s3comms_hrb_node_set( namecpy = (char *)H5MM_malloc(sizeof(char) * (namelen + 1)); - if (namecpy == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, - "cannot make space for name copy.\n"); - } + if(namecpy == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for name copy."); HDmemcpy(namecpy, name, (namelen + 1)); valuecpy = (char *)H5MM_malloc(sizeof(char) * (valuelen + 1)); - if (valuecpy == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, - "cannot make space for value copy.\n"); - } + if(valuecpy == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for value copy."); HDmemcpy(valuecpy, value, (valuelen + 1)); nvcat = (char *)H5MM_malloc(sizeof(char) * catwrite); - if (nvcat == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, - "cannot make space for concatenated string.\n"); - } + if(nvcat == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for concatenated string."); ret = HDsnprintf(nvcat, catwrite, "%s: %s", name, value); - if (ret < 0 || (size_t)ret > catlen) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot concatenate `%s: %s", name, value); - } + if(ret < 0 || (size_t)ret > catlen) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot concatenate `%s: %s", name, value); HDassert( catlen == HDstrlen(nvcat) ); /* create new_node, should we need it */ new_node = (hrb_node_t *)H5MM_malloc(sizeof(hrb_node_t)); - if (new_node == NULL) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, - "cannot make space for new set.\n"); - } + if(new_node == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for new set."); new_node->magic = S3COMMS_HRB_NODE_MAGIC; new_node->name = NULL; @@ -327,14 +309,12 @@ H5FD_s3comms_hrb_node_set( * ACT ON LIST * ***************/ - if (*L == NULL) { - if (value == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "trying to remove node from empty list"); - } + if(*L == NULL) { + if(value == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove node from empty list"); else { #if S3COMMS_DEBUG -HDprintf("CREATE NEW\n"); fflush(stdout); +HDprintf("CREATE NEW\n"); HDfflush(stdout); #endif /******************* * CREATE NEW LIST * @@ -358,13 +338,13 @@ HDprintf("CREATE NEW\n"); fflush(stdout); /* Check whether to modify/remove first node in list */ - if (strcmp(lowername, node_ptr->lowername) == 0) { + if(HDstrcmp(lowername, node_ptr->lowername) == 0) { is_looking = FALSE; if (value == NULL) { #if S3COMMS_DEBUG -HDprintf("REMOVE HEAD\n"); fflush(stdout); +HDprintf("REMOVE HEAD\n"); HDfflush(stdout); #endif /*************** * REMOVE HEAD * @@ -373,41 +353,41 @@ HDprintf("REMOVE HEAD\n"); fflush(stdout); *L = node_ptr->next; #if S3COMMS_DEBUG -HDprintf("FREEING CAT (node)\n"); fflush(stdout); +HDprintf("FREEING CAT (node)\n"); HDfflush(stdout); #endif H5MM_xfree(node_ptr->cat); #if S3COMMS_DEBUG -HDprintf("FREEING LOWERNAME (node)\n"); fflush(stdout); +HDprintf("FREEING LOWERNAME (node)\n"); HDfflush(stdout); #endif H5MM_xfree(node_ptr->lowername); #if S3COMMS_DEBUG -HDprintf("FREEING NAME (node)\n"); fflush(stdout); +HDprintf("FREEING NAME (node)\n"); HDfflush(stdout); #endif H5MM_xfree(node_ptr->name); #if S3COMMS_DEBUG -HDprintf("FREEING VALUE (node)\n"); fflush(stdout); +HDprintf("FREEING VALUE (node)\n"); HDfflush(stdout); #endif H5MM_xfree(node_ptr->value); #if S3COMMS_DEBUG HDprintf("MAGIC OK? %s\n", (node_ptr->magic == S3COMMS_HRB_NODE_MAGIC) ? "YES" : "NO"); -fflush(stdout); +HDfflush(stdout); #endif HDassert( node_ptr->magic == S3COMMS_HRB_NODE_MAGIC ); node_ptr->magic += 1ul; #if S3COMMS_DEBUG -HDprintf("FREEING POINTER\n"); fflush(stdout); +HDprintf("FREEING POINTER\n"); HDfflush(stdout); #endif H5MM_xfree(node_ptr); #if S3COMMS_DEBUG -HDprintf("FREEING WORKING LOWERNAME\n"); fflush(stdout); +HDprintf("FREEING WORKING LOWERNAME\n"); HDfflush(stdout); #endif H5MM_xfree(lowername); lowername = NULL; } else { #if S3COMMS_DEBUG -HDprintf("MODIFY HEAD\n"); fflush(stdout); +HDprintf("MODIFY HEAD\n"); HDfflush(stdout); #endif /*************** * MODIFY HEAD * @@ -429,17 +409,15 @@ HDprintf("MODIFY HEAD\n"); fflush(stdout); } } else - if (strcmp(lowername, node_ptr->lowername) < 0) { + if (HDstrcmp(lowername, node_ptr->lowername) < 0) { is_looking = FALSE; - if (value == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "trying to remove a node 'before' head"); - } + if(value == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove a node 'before' head"); else { #if S3COMMS_DEBUG -HDprintf("PREPEND NEW HEAD\n"); fflush(stdout); +HDprintf("PREPEND NEW HEAD\n"); HDfflush(stdout); #endif /******************* * INSERT NEW HEAD * @@ -458,24 +436,22 @@ HDprintf("PREPEND NEW HEAD\n"); fflush(stdout); * SEARCH LIST * ***************/ - while (is_looking) { - if (node_ptr->next == NULL) { + while(is_looking) { + if(node_ptr->next == NULL) { is_looking = FALSE; - if (value == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "trying to remove absent node"); - } + if(value == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node"); else { #if S3COMMS_DEBUG -HDprintf("APPEND A NODE\n"); fflush(stdout); +HDprintf("APPEND A NODE\n"); HDfflush(stdout); #endif /******************* * APPEND NEW NODE * *******************/ - HDassert( strcmp(lowername, node_ptr->lowername) > 0 ); + HDassert( HDstrcmp(lowername, node_ptr->lowername) > 0 ); new_node->name = namecpy; new_node->value = valuecpy; new_node->lowername = lowername; @@ -484,23 +460,21 @@ HDprintf("APPEND A NODE\n"); fflush(stdout); } } else - if (strcmp(lowername, node_ptr->next->lowername) < 0) { + if(HDstrcmp(lowername, node_ptr->next->lowername) < 0) { is_looking = FALSE; - if (value == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "trying to remove absent node"); - } + if(value == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node"); else { #if S3COMMS_DEBUG -HDprintf("INSERT A NODE\n"); fflush(stdout); +HDprintf("INSERT A NODE\n"); HDfflush(stdout); #endif /******************* * INSERT NEW NODE * *******************/ - HDassert( strcmp(lowername, node_ptr->lowername) > 0 ); + HDassert( HDstrcmp(lowername, node_ptr->lowername) > 0 ); new_node->name = namecpy; new_node->value = valuecpy; new_node->lowername = lowername; @@ -510,11 +484,11 @@ HDprintf("INSERT A NODE\n"); fflush(stdout); } } else - if (strcmp(lowername, node_ptr->next->lowername) == 0) { + if(HDstrcmp(lowername, node_ptr->next->lowername) == 0) { is_looking = FALSE; - if (value == NULL) { + if(value == NULL) { /***************** * REMOVE A NODE * *****************/ @@ -523,7 +497,7 @@ HDprintf("INSERT A NODE\n"); fflush(stdout); node_ptr->next = tmp->next; #if S3COMMS_DEBUG -HDprintf("REMOVE A NODE\n"); fflush(stdout); +HDprintf("REMOVE A NODE\n"); HDfflush(stdout); #endif H5MM_xfree(tmp->cat); H5MM_xfree(tmp->lowername); @@ -539,7 +513,7 @@ HDprintf("REMOVE A NODE\n"); fflush(stdout); } else { #if S3COMMS_DEBUG -HDprintf("MODIFY A NODE\n"); fflush(stdout); +HDprintf("MODIFY A NODE\n"); HDfflush(stdout); #endif /***************** * MODIFY A NODE * @@ -572,14 +546,17 @@ HDprintf("MODIFY A NODE\n"); fflush(stdout); } /* end while is_looking */ done: - if (ret_value == FAIL) { - /* clean up - */ - if (nvcat != NULL) { H5MM_xfree(nvcat); } - if (namecpy != NULL) { H5MM_xfree(namecpy); } - if (lowername != NULL) { H5MM_xfree(lowername); } - if (valuecpy != NULL) { H5MM_xfree(valuecpy); } - if (new_node != NULL) { + if(ret_value == FAIL) { + /* clean up */ + if(nvcat != NULL) + H5MM_xfree(nvcat); + if(namecpy != NULL) + H5MM_xfree(namecpy); + if(lowername != NULL) + H5MM_xfree(lowername); + if(valuecpy != NULL) + H5MM_xfree(valuecpy); + if(new_node != NULL) { HDassert( new_node->magic == S3COMMS_HRB_NODE_MAGIC ); new_node->magic += 1ul; H5MM_xfree(new_node); @@ -638,12 +615,10 @@ H5FD_s3comms_hrb_destroy(hrb_t **_buf) HDfprintf(stdout, "called H5FD_s3comms_hrb_destroy.\n"); #endif - if (_buf != NULL && *_buf != NULL) { + if(_buf != NULL && *_buf != NULL) { buf = *_buf; - if (buf->magic != S3COMMS_HRB_MAGIC) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "pointer's magic does not match.\n"); - } + if(buf->magic != S3COMMS_HRB_MAGIC) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pointer's magic does not match."); H5MM_xfree(buf->verb); H5MM_xfree(buf->version); @@ -707,53 +682,38 @@ H5FD_s3comms_hrb_init_request(const char *_verb, HDfprintf(stdout, "called H5FD_s3comms_hrb_init_request.\n"); #endif - if (_resource == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "resource string cannot be null.\n"); - } + if(_resource == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "resource string cannot be null."); - /* populate valid NULLs with defaults - */ - if (_verb == NULL) { + /* populate valid NULLs with defaults */ + if(_verb == NULL) _verb = "GET"; - } - - if (_http_version == NULL) { + if(_http_version == NULL) _http_version = "HTTP/1.1"; - } - /* malloc space for and prepare structure - */ + /* malloc space for and prepare structure */ request = (hrb_t *)H5MM_malloc(sizeof(hrb_t)); - if (request == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, - "no space for request structure"); - } + if(request == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for request structure"); request->magic = S3COMMS_HRB_MAGIC; request->body = NULL; request->body_len = 0; request->first_header = NULL; - - /* malloc and copy strings for the structure - */ + /* malloc and copy strings for the structure */ reslen = HDstrlen(_resource); if (_resource[0] == '/') { res = (char *)H5MM_malloc(sizeof(char) * (reslen+1)); - if (res == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, - "no space for resource string"); - } + if(res == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for resource string"); HDmemcpy(res, _resource, (reslen+1)); } else { res = (char *)H5MM_malloc(sizeof(char) * (reslen+2)); - if (res == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, - "no space for resource string"); - } + if(res == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for resource string"); *res = '/'; HDmemcpy((&res[1]), _resource, (reslen+1)); HDassert( (reslen+1) == HDstrlen(res) ); @@ -761,24 +721,18 @@ H5FD_s3comms_hrb_init_request(const char *_verb, verblen = HDstrlen(_verb) + 1; verb = (char *)H5MM_malloc(sizeof(char) * verblen); - if (verb == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "no space for verb string"); - } + if(verb == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no space for verb string"); HDstrncpy(verb, _verb, verblen); vrsnlen = HDstrlen(_http_version) + 1; vrsn = (char *)H5MM_malloc(sizeof(char) * vrsnlen); - if (vrsn == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "no space for http-version string"); - } + if(vrsn == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no space for http-version string"); HDstrncpy(vrsn, _http_version, vrsnlen); - - /* place new copies into structure - */ + /* place new copies into structure */ request->resource = res; request->verb = verb; request->version = vrsn; @@ -786,13 +740,16 @@ H5FD_s3comms_hrb_init_request(const char *_verb, ret_value = request; done: - /* if there is an error, clean up after ourselves - */ + /* if there is an error, clean up after ourselves */ if (ret_value == NULL) { - if (request != NULL) H5MM_xfree(request); - if (vrsn != NULL) H5MM_xfree(vrsn); - if (verb != NULL) H5MM_xfree(verb); - if (res != NULL) H5MM_xfree(res); + if(request != NULL) + H5MM_xfree(request); + if(vrsn != NULL) + H5MM_xfree(vrsn); + if(verb != NULL) + H5MM_xfree(verb); + if(res != NULL) + H5MM_xfree(res); } FUNC_LEAVE_NOAPI(ret_value) @@ -836,14 +793,10 @@ H5FD_s3comms_s3r_close(s3r_t *handle) HDfprintf(stdout, "called H5FD_s3comms_s3r_close.\n"); #endif - if (handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle cannot be null.\n"); - } - if (handle->magic != S3COMMS_S3R_MAGIC) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle has invalid magic.\n"); - } + if(handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null."); + if(handle->magic != S3COMMS_S3R_MAGIC) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic."); curl_easy_cleanup(handle->curlhandle); @@ -854,10 +807,8 @@ H5FD_s3comms_s3r_close(s3r_t *handle) HDassert( handle->httpverb != NULL ); H5MM_xfree(handle->httpverb); - if (FAIL == H5FD_s3comms_free_purl(handle->purl)) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to release parsed url structure") - } + if(FAIL == H5FD_s3comms_free_purl(handle->purl)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to release parsed url structure") H5MM_xfree(handle); @@ -893,9 +844,8 @@ H5FD_s3comms_s3r_get_filesize(s3r_t *handle) FUNC_ENTER_NOAPI_NOINIT_NOERR - if (handle != NULL) { + if(handle != NULL) ret_value = handle->filesize; - } FUNC_LEAVE_NOAPI(ret_value) } /* H5FD_s3comms_s3r_get_filesize */ @@ -953,58 +903,33 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle) HDfprintf(stdout, "called H5FD_s3comms_s3r_getsize.\n"); #endif - if (handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle cannot be null.\n"); - } - if (handle->magic != S3COMMS_S3R_MAGIC) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle has invalid magic.\n"); - } - if (handle->curlhandle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle has bad (null) curlhandle.\n") - } + if(handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null."); + if(handle->magic != S3COMMS_S3R_MAGIC) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic."); + if(handle->curlhandle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) curlhandle.") /******************** * PREPARE FOR HEAD * ********************/ curlh = handle->curlhandle; + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_NOBODY, 1L)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_NOBODY)."); - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_NOBODY, - 1L) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "error while setting CURL option (CURLOPT_NOBODY). " - "(placeholder flags)"); - } - - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_HEADERDATA, - &sds) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "error while setting CURL option (CURLOPT_HEADERDATA). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HEADERDATA, &sds)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_HEADERDATA)."); HDassert( handle->httpverb == NULL ); handle->httpverb = (char *)H5MM_malloc(sizeof(char) * 16); - if (handle->httpverb == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "unable to allocate space for S3 request HTTP verb"); - } + if(handle->httpverb == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "unable to allocate space for S3 request HTTP verb"); HDmemcpy(handle->httpverb, "HEAD", 5); headerresponse = (char *)H5MM_malloc(sizeof(char) * CURL_MAX_HTTP_HEADER); - if (headerresponse == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "unable to allocate space for curl header response"); - } + if(headerresponse == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "unable to allocate space for curl header response"); sds.data = headerresponse; /******************* @@ -1015,65 +940,43 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle) * but, with a NULL destination and NOBODY and HEADERDATA supplied above, * only http metadata will be sent by server and recorded by s3comms */ - if (FAIL == - H5FD_s3comms_s3r_read(handle, 0, 0, NULL) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem in reading during getsize.\n"); - } + if(FAIL == H5FD_s3comms_s3r_read(handle, 0, 0, NULL)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem in reading during getsize."); - if (sds.size > CURL_MAX_HTTP_HEADER) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "HTTP metadata buffer overrun\n"); - } else if (sds.size == 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "No HTTP metadata\n"); + if(sds.size > CURL_MAX_HTTP_HEADER) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HTTP metadata buffer overrun"); + else if (sds.size == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "No HTTP metadata"); #if S3COMMS_DEBUG - } else { + else HDfprintf(stderr, "GETSIZE: OK\n"); #endif - } /****************** * PARSE RESPONSE * ******************/ - start = strstr(headerresponse, - "\r\nContent-Length: "); - if (start == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not find \"Content-Length\" in response.\n"); - } + start = HDstrstr(headerresponse, "\r\nContent-Length: "); + if(start == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not find \"Content-Length\" in response."); - /* move "start" to beginning of value in line; find end of line - */ + /* move "start" to beginning of value in line; find end of line */ start = start + HDstrlen("\r\nContent-Length: "); - end = strstr(start, "\r\n"); - if (end == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not find end of content length line"); - } + end = HDstrstr(start, "\r\n"); + if(end == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not find end of content length line"); /* place null terminator at end of numbers */ *end = '\0'; - content_length = strtoumax((const char *)start, - NULL, - 0); - - if (UINTMAX_MAX > SIZE_MAX && content_length > SIZE_MAX) { - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "content_length overflows size_t\n"); - } + content_length = HDstrtoumax((const char *)start, NULL, 0); + if(UINTMAX_MAX > SIZE_MAX && content_length > SIZE_MAX) + HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "content_length overflows size_t"); - if (content_length == 0 || - errno == ERANGE) /* errno set by strtoumax*/ - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not convert found \"Content-Length\" response (\"%s\")", - start); /* range is null-terminated, remember */ - } + if(content_length == 0 || errno == ERANGE) /* errno set by HDstrtoumax*/ + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not convert found \"Content-Length\" response (\"%s\")", start); /* range is null-terminated, remember */ handle->filesize = (size_t)content_length; @@ -1081,32 +984,17 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle) * UNDO HEAD SETTINGS * **********************/ - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_NOBODY, - NULL) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "error while setting CURL option (CURLOPT_NOBODY). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_NOBODY, NULL)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_NOBODY)."); - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_HEADERDATA, - NULL) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "error while setting CURL option (CURLOPT_HEADERDATA). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HEADERDATA, NULL)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_HEADERDATA)."); done: H5MM_xfree(headerresponse); sds.magic += 1; /* set to bad magic */ FUNC_LEAVE_NOAPI(ret_value); - } /* H5FD_s3comms_s3r_getsize */ @@ -1167,26 +1055,19 @@ H5FD_s3comms_s3r_open(const char *url, HDfprintf(stdout, "called H5FD_s3comms_s3r_open.\n"); #endif + if(url == NULL || url[0] == '\0') + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "url cannot be null."); - - if (url == NULL || url[0] == '\0') { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "url cannot be null.\n"); - } - - if (FAIL == H5FD_s3comms_parse_url(url, &purl)) { + if(FAIL == H5FD_s3comms_parse_url(url, &purl)) /* probably a malformed url, but could be internal error */ - HGOTO_ERROR(H5E_ARGS, H5E_CANTCREATE, NULL, - "unable to create parsed url structure"); - } + HGOTO_ERROR(H5E_ARGS, H5E_CANTCREATE, NULL, "unable to create parsed url structure"); + HDassert( purl != NULL ); /* if above passes, this must be true */ HDassert( purl->magic == S3COMMS_PARSED_URL_MAGIC ); handle = (s3r_t *)H5MM_malloc(sizeof(s3r_t)); - if (handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, - "could not malloc space for handle.\n"); - } + if(handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "could not malloc space for handle."); handle->magic = S3COMMS_S3R_MAGIC; handle->purl = purl; @@ -1200,50 +1081,35 @@ H5FD_s3comms_s3r_open(const char *url, * RECORD AUTHENTICATION INFORMATION * *************************************/ - if ((region != NULL && *region != '\0') || - (id != NULL && *id != '\0') || - (signing_key != NULL)) - { - /* if one exists, all three must exist - */ - if (region == NULL || region[0] == '\0') { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "region cannot be null.\n"); - } - if (id == NULL || id[0] == '\0') { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "secret id cannot be null.\n"); - } - if (signing_key == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "signing key cannot be null.\n"); - } + if((region != NULL && *region != '\0') || + (id != NULL && *id != '\0') || + (signing_key != NULL)) { - /* copy strings - */ + /* if one exists, all three must exist */ + if(region == NULL || region[0] == '\0') + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "region cannot be null."); + if(id == NULL || id[0] == '\0') + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "secret id cannot be null."); + if(signing_key == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "signing key cannot be null."); + + /* copy strings */ tmplen = HDstrlen(region) + 1; handle->region = (char *)H5MM_malloc(sizeof(char) * tmplen); - if (handle->region == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "could not malloc space for handle region copy.\n"); - } + if(handle->region == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle region copy."); HDmemcpy(handle->region, region, tmplen); tmplen = HDstrlen(id) + 1; handle->secret_id = (char *)H5MM_malloc(sizeof(char) * tmplen); - if (handle->secret_id == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "could not malloc space for handle ID copy.\n"); - } + if(handle->secret_id == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle ID copy."); HDmemcpy(handle->secret_id, id, tmplen); tmplen = SHA256_DIGEST_LENGTH; - handle->signing_key = - (unsigned char *)H5MM_malloc(sizeof(unsigned char) * tmplen); - if (handle->signing_key == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "could not malloc space for handle key copy.\n"); - } + handle->signing_key = (unsigned char *)H5MM_malloc(sizeof(unsigned char) * tmplen); + if(handle->signing_key == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle key copy."); HDmemcpy(handle->signing_key, signing_key, tmplen); } /* if authentication information provided */ @@ -1252,61 +1118,23 @@ H5FD_s3comms_s3r_open(const char *url, ************************/ curlh = curl_easy_init(); + if(curlh == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem creating curl easy handle!"); - if (curlh == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "problem creating curl easy handle!\n"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTPGET, 1L)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_HTTPGET)."); - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_HTTPGET, - 1L) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "error while setting CURL option (CURLOPT_HTTPGET). " - "(placeholder flags)"); - } - - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_HTTP_VERSION, - CURL_HTTP_VERSION_1_1) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "error while setting CURL option (CURLOPT_HTTP_VERSION). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_HTTP_VERSION)."); - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_FAILONERROR, - 1L) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "error while setting CURL option (CURLOPT_FAILONERROR). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_FAILONERROR, 1L)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_FAILONERROR)."); - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_WRITEFUNCTION, - curlwritecallback) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "error while setting CURL option (CURLOPT_WRITEFUNCTION). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_WRITEFUNCTION, curlwritecallback)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_WRITEFUNCTION)."); - if ( CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_URL, - url) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "error while setting CURL option (CURLOPT_URL). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_URL, url)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_URL)."); #if S3COMMS_CURL_VERBOSITY > 1 /* CURL will print (to stdout) information for each operation @@ -1322,12 +1150,8 @@ H5FD_s3comms_s3r_open(const char *url, * GET FILE SIZE * *******************/ - if (FAIL == - H5FD_s3comms_s3r_getsize(handle) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "problem in H5FD_s3comms_s3r_getsize.\n"); - } + if(FAIL == H5FD_s3comms_s3r_getsize(handle)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem in H5FD_s3comms_s3r_getsize."); /********************* * FINAL PREPARATION * @@ -1339,27 +1163,22 @@ H5FD_s3comms_s3r_open(const char *url, ret_value = handle; done: - if (ret_value == NULL) { - if (curlh != NULL) { + if(ret_value == NULL) { + if(curlh != NULL) curl_easy_cleanup(curlh); - } - if (FAIL == H5FD_s3comms_free_purl(purl)) { - HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, - "unable to free parsed url structure") - } - if (handle != NULL) { + if(FAIL == H5FD_s3comms_free_purl(purl)) + HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to free parsed url structure") + if(handle != NULL) { H5MM_xfree(handle->region); H5MM_xfree(handle->secret_id); H5MM_xfree(handle->signing_key); - if (handle->httpverb != NULL) { + if(handle->httpverb != NULL) H5MM_xfree(handle->httpverb); - } H5MM_xfree(handle); } } FUNC_LEAVE_NOAPI(ret_value) - } /* H5FD_s3comms_s3r_open */ @@ -1433,27 +1252,17 @@ H5FD_s3comms_s3r_read(s3r_t *handle, * ABSOLUTELY NECESSARY SANITY-CHECKS * **************************************/ - if (handle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle cannot be null.\n"); - } - if (handle->magic != S3COMMS_S3R_MAGIC) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle has invalid magic.\n"); - } - if (handle->curlhandle == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle has bad (null) curlhandle.\n") - } - if (handle->purl == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle has bad (null) url.\n") - } + if(handle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null."); + if(handle->magic != S3COMMS_S3R_MAGIC) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic."); + if(handle->curlhandle == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) curlhandle.") + if(handle->purl == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) url.") HDassert( handle->purl->magic == S3COMMS_PARSED_URL_MAGIC ); - if (offset > handle->filesize || (len + offset) > handle->filesize) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to read past EoF") - } + if(offset > handle->filesize || (len + offset) > handle->filesize) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to read past EoF") curlh = handle->curlhandle; @@ -1461,26 +1270,16 @@ H5FD_s3comms_s3r_read(s3r_t *handle, * PREPARE WRITEDATA * *********************/ - if (dest != NULL) { - sds = (struct s3r_datastruct *)H5MM_malloc( - sizeof(struct s3r_datastruct)); - if (sds == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "could not malloc destination datastructure.\n"); - } + if(dest != NULL) { + sds = (struct s3r_datastruct *)H5MM_malloc(sizeof(struct s3r_datastruct)); + if(sds == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc destination datastructure."); sds->magic = S3COMMS_CALLBACK_DATASTRUCT_MAGIC; sds->data = (char *)dest; sds->size = 0; - if (CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_WRITEDATA, - sds) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, - "error while setting CURL option (CURLOPT_WRITEDATA). " - "(placeholder flags)"); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_WRITEDATA, sds)) + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "error while setting CURL option (CURLOPT_WRITEDATA)."); } /********************* @@ -1488,34 +1287,22 @@ H5FD_s3comms_s3r_read(s3r_t *handle, *********************/ if (len > 0) { - rangebytesstr = (char *)H5MM_malloc(sizeof(char) * \ - (S3COMMS_MAX_RANGE_STRING_SIZE+1) ); - if (rangebytesstr == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "could not malloc range format string.\n"); - } - ret = HDsnprintf(rangebytesstr, - (S3COMMS_MAX_RANGE_STRING_SIZE), + rangebytesstr = (char *)H5MM_malloc(sizeof(char) * (S3COMMS_MAX_RANGE_STRING_SIZE+1) ); + if(rangebytesstr == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string."); + ret = HDsnprintf(rangebytesstr, (S3COMMS_MAX_RANGE_STRING_SIZE), "bytes="H5_PRINTF_HADDR_FMT"-"H5_PRINTF_HADDR_FMT, - offset, - offset + len - 1); - if (ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to format HTTP Range value"); - } else if (offset > 0) { - rangebytesstr = (char *)H5MM_malloc(sizeof(char) * \ - (S3COMMS_MAX_RANGE_STRING_SIZE+1)); - if (rangebytesstr == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "could not malloc range format string.\n"); - } - ret = HDsnprintf(rangebytesstr, - (S3COMMS_MAX_RANGE_STRING_SIZE), - "bytes="H5_PRINTF_HADDR_FMT"-", - offset); - if (ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to format HTTP Range value"); + offset, offset + len - 1); + if(ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format HTTP Range value"); + } else if(offset > 0) { + rangebytesstr = (char *)H5MM_malloc(sizeof(char) * (S3COMMS_MAX_RANGE_STRING_SIZE+1)); + if(rangebytesstr == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string."); + ret = HDsnprintf(rangebytesstr, (S3COMMS_MAX_RANGE_STRING_SIZE), + "bytes="H5_PRINTF_HADDR_FMT"-", offset); + if(ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format HTTP Range value"); } /******************* @@ -1523,26 +1310,18 @@ H5FD_s3comms_s3r_read(s3r_t *handle, *******************/ if (handle->signing_key == NULL) { - /* Do not authenticate. - */ - if (rangebytesstr != NULL) { - /* Pass in range directly - */ + /* Do not authenticate. */ + if(rangebytesstr != NULL) { + /* Pass in range directly */ char *bytesrange_ptr = NULL; /* pointer past "bytes=" portion */ - bytesrange_ptr = strchr(rangebytesstr, '='); + bytesrange_ptr = HDstrchr(rangebytesstr, '='); HDassert( bytesrange_ptr != NULL ); bytesrange_ptr++; /* move to first char past '=' */ HDassert( *bytesrange_ptr != '\0' ); - if (CURLE_OK != - curl_easy_setopt(curlh, - CURLOPT_RANGE, - bytesrange_ptr) ) - { - HGOTO_ERROR(H5E_VFL, H5E_UNINITIALIZED, FAIL, - "error while setting CURL option (CURLOPT_RANGE). "); - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_RANGE, bytesrange_ptr)) + HGOTO_ERROR(H5E_VFL, H5E_UNINITIALIZED, FAIL, "error while setting CURL option (CURLOPT_RANGE). "); } } else { /* authenticate request @@ -1575,30 +1354,18 @@ H5FD_s3comms_s3r_read(s3r_t *handle, /**** VERIFY INFORMATION EXISTS ****/ - if (handle->region == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle must have non-null region.\n"); - } - if (handle->secret_id == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle must have non-null secret_id.\n"); - } - if (handle->signing_key == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle must have non-null signing_key.\n"); - } - if (handle->httpverb == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle must have non-null httpverb.\n"); - } - if (handle->purl->host == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle must have non-null host.\n"); - } - if (handle->purl->path == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "handle must have non-null resource.\n"); - } + if(handle->region == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null region."); + if(handle->secret_id == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null secret_id."); + if(handle->signing_key == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null signing_key."); + if(handle->httpverb == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null httpverb."); + if(handle->purl->host == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null host."); + if(handle->purl->path == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null resource."); /**** CREATE HTTP REQUEST STRUCTURE (hrb_t) ****/ @@ -1606,198 +1373,93 @@ H5FD_s3comms_s3r_read(s3r_t *handle, (const char *)handle->httpverb, (const char *)handle->purl->path, "HTTP/1.1"); - if (request == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not allocate hrb_t request.\n"); - } + if(request == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not allocate hrb_t request."); HDassert( request->magic == S3COMMS_HRB_MAGIC ); now = gmnow(); - if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not format ISO8601 time.\n"); - } + if(ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not format ISO8601 time."); - if (FAIL == - H5FD_s3comms_hrb_node_set( - &headers, - "x-amz-date", - (const char *)iso8601now) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to set x-amz-date header") - } - if (headers == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem building headers list. " - "(placeholder flags)\n"); - } + if(FAIL == H5FD_s3comms_hrb_node_set( &headers, "x-amz-date", (const char *)iso8601now)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set x-amz-date header") + if(headers == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list."); HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC ); - if (FAIL == - H5FD_s3comms_hrb_node_set( - &headers, - "x-amz-content-sha256", - (const char *)EMPTY_SHA256) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to set x-amz-content-sha256 header") - } - if (headers == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem building headers list. " - "(placeholder flags)\n"); - } + if(FAIL == H5FD_s3comms_hrb_node_set(&headers, "x-amz-content-sha256", (const char *)EMPTY_SHA256)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set x-amz-content-sha256 header") + if(headers == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list."); HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC ); - if (rangebytesstr != NULL) { - if (FAIL == - H5FD_s3comms_hrb_node_set( - &headers, - "Range", - (const char *)rangebytesstr) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to set range header") - } - if (headers == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem building headers list. " - "(placeholder flags)\n"); - } + if(rangebytesstr != NULL) { + if(FAIL == H5FD_s3comms_hrb_node_set( &headers, "Range", rangebytesstr)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set range header") + if(headers == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list."); HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC ); } - if (FAIL == - H5FD_s3comms_hrb_node_set( - &headers, - "Host", - (const char *)handle->purl->host) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to set host header") - } - if (headers == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem building headers list. " - "(placeholder flags)\n"); - } + if(FAIL == H5FD_s3comms_hrb_node_set(&headers, "Host", handle->purl->host)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set host header") + if(headers == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list."); HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC ); request->first_header = headers; /**** COMPUTE AUTHORIZATION ****/ - if (FAIL == /* buffer1 -> canonical request */ - H5FD_s3comms_aws_canonical_request( - buffer1, - 512, - signed_headers, - 48, - request) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "(placeholder flags)\n"); - } - if ( FAIL == /* buffer2->string-to-sign */ - H5FD_s3comms_tostringtosign(buffer2, - buffer1, - iso8601now, - handle->region) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "(placeholder flags)\n"); - } - if (FAIL == /* buffer1 -> signature */ - H5FD_s3comms_HMAC_SHA256(handle->signing_key, - SHA256_DIGEST_LENGTH, - buffer2, - HDstrlen(buffer2), - buffer1) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "(placeholder flags)\n"); - } + /* buffer1 -> canonical request */ + if(FAIL == H5FD_s3comms_aws_canonical_request(buffer1, 512, signed_headers, 48, request)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad canonical request"); + /* buffer2->string-to-sign */ + if(FAIL == H5FD_s3comms_tostringtosign(buffer2, buffer1, iso8601now, handle->region)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad string-to-sign"); + /* buffer1 -> signature */ + if(FAIL == H5FD_s3comms_HMAC_SHA256(handle->signing_key, SHA256_DIGEST_LENGTH, buffer2, HDstrlen(buffer2), buffer1)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad signature"); iso8601now[8] = 0; /* trim to yyyyMMDD */ - ret = S3COMMS_FORMAT_CREDENTIAL(buffer2, - handle->secret_id, - iso8601now, - handle->region, - "s3"); - if (ret == 0 || ret >= S3COMMS_MAX_CREDENTIAL_SIZE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to format aws4 credential string"); - - ret = HDsnprintf( - authorization, - 512, + ret = S3COMMS_FORMAT_CREDENTIAL(buffer2, handle->secret_id, iso8601now, handle->region, "s3"); + if(ret == 0 || ret >= S3COMMS_MAX_CREDENTIAL_SIZE) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format aws4 credential string"); + + ret = HDsnprintf( authorization, 512, "AWS4-HMAC-SHA256 Credential=%s,SignedHeaders=%s,Signature=%s", - buffer2, - signed_headers, - buffer1); - if (ret <= 0 || ret >= 512) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to format aws4 authorization string"); - } + buffer2, signed_headers, buffer1); + if(ret <= 0 || ret >= 512) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format aws4 authorization string"); - /* append authorization header to http request buffer - */ - if (H5FD_s3comms_hrb_node_set( - &headers, - "Authorization", - (const char *)authorization) - == FAIL) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to set Authorization header") - } - if (headers == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem building headers list. " - "(placeholder flags)\n"); - } + /* append authorization header to http request buffer */ + if(H5FD_s3comms_hrb_node_set(&headers, "Authorization", (const char *)authorization) == FAIL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set Authorization header") + if(headers == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list."); - /* update hrb's "first header" pointer - */ + /* update hrb's "first header" pointer */ request->first_header = headers; /**** SET CURLHANDLE HTTP HEADERS FROM GENERATED DATA ****/ node = request->first_header; - while (node != NULL) { + while(node != NULL) { HDassert( node->magic == S3COMMS_HRB_NODE_MAGIC ); - curlheaders = curl_slist_append(curlheaders, - (const char *)node->cat); - if (curlheaders == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not append header to curl slist. " - "(placeholder flags)\n"); - } + curlheaders = curl_slist_append(curlheaders, (const char *)node->cat); + if(curlheaders == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not append header to curl slist."); node = node->next; } - /* sanity-check - */ - if (curlheaders == NULL) { + /* sanity-check */ + if(curlheaders == NULL) /* above loop was probably never run */ - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "curlheaders was never populated.\n"); - } - - /* finally, set http headers in curl handle - */ - if (curl_easy_setopt( - curlh, - CURLOPT_HTTPHEADER, - curlheaders) - != CURLE_OK) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "error while setting CURL option " - "(CURLOPT_HTTPHEADER). (placeholder flags)"); - } + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "curlheaders was never populated."); + /* finally, set http headers in curl handle */ + if(curl_easy_setopt(curlh, CURLOPT_HTTPHEADER, curlheaders) != CURLE_OK) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_HTTPHEADER)."); } /* end if should authenticate (info provided) */ /******************* @@ -1813,107 +1475,79 @@ H5FD_s3comms_s3r_read(s3r_t *handle, char curlerrbuf[CURL_ERROR_SIZE]; curlerrbuf[0] = '\0'; - if (CURLE_OK != - curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, curlerrbuf) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem setting error buffer") - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, curlerrbuf)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem setting error buffer") p_status = curl_easy_perform(curlh); - if (p_status != CURLE_OK) { - if (CURLE_OK != - curl_easy_getinfo(curlh, CURLINFO_RESPONSE_CODE, &httpcode) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem getting response code") - } + if(p_status != CURLE_OK) { + if(CURLE_OK != curl_easy_getinfo(curlh, CURLINFO_RESPONSE_CODE, &httpcode)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem getting response code") HDfprintf(stderr, "CURL ERROR CODE: %d\nHTTP CODE: %d\n", p_status, httpcode); HDfprintf(stderr, "%s\n", curl_easy_strerror(p_status)); - HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, - "problem while performing request.\n"); - } - if (CURLE_OK != - curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, NULL) ) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem unsetting error buffer") + HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "problem while performing request."); } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, NULL)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem unsetting error buffer") } /* verbose error reporting */ #else p_status = curl_easy_perform(curlh); - if (p_status != CURLE_OK) { - HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, - "curl cannot perform request\n") - } + if(p_status != CURLE_OK) + HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "curl cannot perform request") #endif #if S3COMMS_DEBUG - if (dest != NULL) { + if(dest != NULL) { HDfprintf(stderr, "len: %d\n", (int)len); HDfprintf(stderr, "CHECKING FOR BUFFER OVERFLOW\n"); - if (sds == NULL) { + if(sds == NULL) HDfprintf(stderr, "sds is NULL!\n"); - } else { HDfprintf(stderr, "sds: 0x%lx\n", (long long)sds); HDfprintf(stderr, "sds->size: %d\n", (int)sds->size); - if (len > sds->size) { + if(len > sds->size) HDfprintf(stderr, "buffer overwrite\n"); - } } } - else { + else HDfprintf(stderr, "performed on entire file\n"); - } #endif done: /* clean any malloc'd resources */ - if (curlheaders != NULL) { + if(curlheaders != NULL) { curl_slist_free_all(curlheaders); curlheaders = NULL; } - if (rangebytesstr != NULL) { + if(rangebytesstr != NULL) { H5MM_xfree(rangebytesstr); rangebytesstr = NULL; } - if (sds != NULL) { + if(sds != NULL) { H5MM_xfree(sds); sds = NULL; } - if (request != NULL) { - while (headers != NULL) - if (FAIL == - H5FD_s3comms_hrb_node_set(&headers, headers->name, NULL)) - { - HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot release header node") - } + if(request != NULL) { + while(headers != NULL) + if(FAIL == H5FD_s3comms_hrb_node_set(&headers, headers->name, NULL)) + HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot release header node") HDassert( NULL == headers ); - if (FAIL == H5FD_s3comms_hrb_destroy(&request)) { - HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot release header request structure") - } + if(FAIL == H5FD_s3comms_hrb_destroy(&request)) + HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot release header request structure") HDassert( NULL == request ); } - if (curlh != NULL) { + if(curlh != NULL) { /* clear any Range */ - if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_RANGE, NULL) ) { - HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot unset CURLOPT_RANGE") - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_RANGE, NULL)) + HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot unset CURLOPT_RANGE") /* clear headers */ - if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTPHEADER, NULL) ) { - HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot unset CURLOPT_HTTPHEADER") - } + if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTPHEADER, NULL)) + HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot unset CURLOPT_HTTPHEADER") } FUNC_LEAVE_NOAPI(ret_value); @@ -1951,9 +1585,8 @@ gmnow(void) struct tm *ret_value = NULL; /* Doctor assert, checks against error in time() */ - if ( (time_t)(-1) != time(now_ptr) ) { - ret_value = gmtime(now_ptr); - } + if((time_t)(-1) != HDtime(now_ptr)) + ret_value = HDgmtime(now_ptr); HDassert( ret_value != NULL ); @@ -2035,102 +1668,66 @@ H5FD_s3comms_aws_canonical_request( HDfprintf(stdout, "called H5FD_s3comms_aws_canonical_request.\n"); #endif - if (http_request == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "hrb object cannot be null.\n"); - } + if(http_request == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hrb object cannot be null."); HDassert( http_request->magic == S3COMMS_HRB_MAGIC ); - if (canonical_request_dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "canonical request destination cannot be null.\n"); - } + if(canonical_request_dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "canonical request destination cannot be null."); - if (signed_headers_dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "signed headers destination cannot be null.\n"); - } + if(signed_headers_dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "signed headers destination cannot be null."); - /* HTTP verb, resource path, and query string lines - */ + /* HTTP verb, resource path, and query string lines */ cr_len = (HDstrlen(http_request->verb) + HDstrlen(http_request->resource) + HDstrlen(query_params) + (size_t)3); /* three newline chars */ - if (cr_len >= cr_size) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "not enough space in canonical request"); - } - ret = HDsnprintf( /* TODO: compiler warning */ - canonical_request_dest, - (cr_size-1), + if(cr_len >= cr_size) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in canonical request"); + /* TODO: compiler warning */ + ret = HDsnprintf(canonical_request_dest, (cr_size - 1), "%s\n%s\n%s\n", - http_request->verb, - http_request->resource, - query_params); - if (ret < 0 || (size_t)ret >= cr_size) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to compose canonical request first line"); - } + http_request->verb, http_request->resource, query_params); + if(ret < 0 || (size_t)ret >= cr_size) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to compose canonical request first line"); - /* write in canonical headers, building signed headers concurrently - */ + /* write in canonical headers, building signed headers concurrently */ node = http_request->first_header; /* assumed sorted */ - while (node != NULL) { + while(node != NULL) { HDassert(node->magic == S3COMMS_HRB_NODE_MAGIC); - ret = HDsnprintf( - tmpstr, - 256, - "%s:%s\n", - node->lowername, - node->value); - if (ret < 0 || ret >= 256) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to concatenate HTTP header %s:%s", - node->lowername, - node->value); - } + ret = HDsnprintf( tmpstr, 256, "%s:%s\n", node->lowername, node->value); + if(ret < 0 || ret >= 256) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to concatenate HTTP header %s:%s", node->lowername, node->value); cr_len += HDstrlen(tmpstr); - if (cr_len + 1 > cr_size) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "not enough space in canonical request"); - } - strcat(canonical_request_dest, tmpstr); - - ret = HDsnprintf( - tmpstr, - 256, - "%s;", - node->lowername); - if (ret < 0 || ret >= 256) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to append semicolon to lowername %s", - node->lowername); - } + if(cr_len + 1 > cr_size) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in canonical request"); + HDstrcat(canonical_request_dest, tmpstr); + + ret = HDsnprintf( tmpstr, 256, "%s;", node->lowername); + if(ret < 0 || ret >= 256) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to append semicolon to lowername %s", node->lowername); sh_len += HDstrlen(tmpstr); - if (sh_len + 1 > sh_size) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "not enough space in signed headers"); - } - strcat(signed_headers_dest, tmpstr); + if(sh_len + 1 > sh_size) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in signed headers"); + HDstrcat(signed_headers_dest, tmpstr); node = node->next; } /* end while node is not NULL */ - /* remove tailing ';' from signed headers sequence - */ + /* remove trailing ';' from signed headers sequence */ signed_headers_dest[HDstrlen(signed_headers_dest) - 1] = '\0'; /* append signed headers and payload hash * NOTE: at present, no HTTP body is handled, per the nature of * requests/range-gets */ - strcat(canonical_request_dest, "\n"); - strcat(canonical_request_dest, signed_headers_dest); - strcat(canonical_request_dest, "\n"); - strcat(canonical_request_dest, EMPTY_SHA256); + HDstrcat(canonical_request_dest, "\n"); + HDstrcat(canonical_request_dest, signed_headers_dest); + HDstrcat(canonical_request_dest, "\n"); + HDstrcat(canonical_request_dest, EMPTY_SHA256); done: FUNC_LEAVE_NOAPI(ret_value); @@ -2184,30 +1781,20 @@ H5FD_s3comms_bytes_to_hex( HDfprintf(stdout, "called H5FD_s3comms_bytes_to_hex.\n"); #endif - if (dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "hex destination cannot be null.\n") - } - if (msg == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "bytes sequence cannot be null.\n") - } + if(dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hex destination cannot be null.") + if(msg == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bytes sequence cannot be null.") for (i = 0; i < msg_len; i++) { - int chars_written = HDsnprintf(&(dest[i * 2]), - 3, /* 'X', 'X', '\n' */ - (lowercase == TRUE) ? "%02x" : "%02X", - msg[i]); - if (chars_written != 2) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem while writing hex chars for %c", - msg[i]); - } + int chars_written = HDsnprintf(&(dest[i * 2]), 3, /* 'X', 'X', '\n' */ + (lowercase == TRUE) ? "%02x" : "%02X", msg[i]); + if(chars_written != 2) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem while writing hex chars for %c", msg[i]); } done: FUNC_LEAVE_NOAPI(ret_value); - } /* end H5FD_s3comms_bytes_to_hex() */ @@ -2239,13 +1826,18 @@ H5FD_s3comms_free_purl(parsed_url_t *purl) HDprintf("called H5FD_s3comms_free_purl.\n"); #endif - if (purl != NULL) { + if(purl != NULL) { HDassert( purl->magic == S3COMMS_PARSED_URL_MAGIC ); - if (purl->scheme != NULL) { H5MM_xfree(purl->scheme); } - if (purl->host != NULL) { H5MM_xfree(purl->host); } - if (purl->port != NULL) { H5MM_xfree(purl->port); } - if (purl->path != NULL) { H5MM_xfree(purl->path); } - if (purl->query != NULL) { H5MM_xfree(purl->query); } + if(purl->scheme != NULL) + H5MM_xfree(purl->scheme); + if(purl->host != NULL) + H5MM_xfree(purl->host); + if(purl->port != NULL) + H5MM_xfree(purl->port); + if(purl->path != NULL) + H5MM_xfree(purl->path); + if(purl->query != NULL) + H5MM_xfree(purl->query); purl->magic += 1ul; H5MM_xfree(purl); } @@ -2302,29 +1894,14 @@ H5FD_s3comms_HMAC_SHA256( HDfprintf(stdout, "called H5FD_s3comms_HMAC_SHA256.\n"); #endif - if (dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "destination cannot be null."); - } + if(dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null."); - HMAC(EVP_sha256(), - key, - (int)key_len, - (const unsigned char *)msg, - msg_len, - md, - &md_len); - - if (H5FD_s3comms_bytes_to_hex( - dest, - (const unsigned char *)md, - (size_t)md_len, - true) - == FAIL) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not convert to hex string."); - } + HMAC(EVP_sha256(), key, (int)key_len, (const unsigned char *)msg, + msg_len, md, &md_len); + + if(H5FD_s3comms_bytes_to_hex(dest, (const unsigned char *)md, (size_t)md_len, true) == FAIL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not convert to hex string."); done: FUNC_LEAVE_NOAPI(ret_value); @@ -2407,93 +1984,73 @@ H5FD__s3comms_load_aws_creds_from_file( int found_setting = 0; char *line_buffer = &(buffer[0]); - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #if S3COMMS_DEBUG HDfprintf(stdout, "called load_aws_creds_from_file.\n"); #endif /* format target line for start of profile */ - if (32 < HDsnprintf(profile_line, 32, "[%s]", profile_name)) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, - "unable to format profile label") - } + if(32 < HDsnprintf(profile_line, 32, "[%s]", profile_name)) + HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format profile label") /* look for start of profile */ do { /* clear buffer */ - for (buffer_i=0; buffer_i < 128; buffer_i++) { + for(buffer_i=0; buffer_i < 128; buffer_i++) buffer[buffer_i] = 0; - } line_buffer = fgets(line_buffer, 128, file); - if (line_buffer == NULL) { /* reached end of file */ + if(line_buffer == NULL) /* reached end of file */ goto done; - } - } while (strncmp(line_buffer, profile_line, HDstrlen(profile_line))); + } while (HDstrncmp(line_buffer, profile_line, HDstrlen(profile_line))); /* extract credentials from lines */ do { /* clear buffer */ - for (buffer_i=0; buffer_i < 128; buffer_i++) { + for(buffer_i=0; buffer_i < 128; buffer_i++) buffer[buffer_i] = 0; - } /* collect a line from file */ line_buffer = fgets(line_buffer, 128, file); - if (line_buffer == NULL) { + if(line_buffer == NULL) goto done; /* end of file */ - } /* loop over names to see if line looks like assignment */ - for (setting_i = 0; setting_i < setting_count; setting_i++) { + for(setting_i = 0; setting_i < setting_count; setting_i++) { size_t setting_name_len = 0; const char *setting_name = NULL; char line_prefix[128]; setting_name = setting_names[setting_i]; setting_name_len = HDstrlen(setting_name); - if (HDsnprintf(line_prefix, 128, "%s=", setting_name) < 0) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, - "unable to format line prefix") - } + if(HDsnprintf(line_prefix, 128, "%s=", setting_name) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format line prefix") /* found a matching name? */ - if (!HDstrncmp(line_buffer, line_prefix, setting_name_len + 1)) { + if(!HDstrncmp(line_buffer, line_prefix, setting_name_len + 1)) { found_setting = 1; /* skip NULL destination buffer */ - if (setting_pointers[setting_i] == NULL) { + if(setting_pointers[setting_i] == NULL) break; - } /* advance to end of name in string */ do { line_buffer++; } while (*line_buffer != 0 && *line_buffer != '='); - if (*line_buffer == 0 || *(line_buffer+1) == 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "incomplete assignment in file") - } + if(*line_buffer == 0 || *(line_buffer+1) == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "incomplete assignment in file") line_buffer++; /* was pointing at '='; advance */ /* copy line buffer into out pointer */ - if (HDstrncpy( - setting_pointers[setting_i], - (const char *)line_buffer, - HDstrlen(line_buffer)) - == NULL) - { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, - "unable to copy line into pointer") - } + HDstrncpy(setting_pointers[setting_i], (const char *)line_buffer, HDstrlen(line_buffer)); /* "trim" tailing whitespace by replacing with null terminator*/ buffer_i = 0; - while (!isspace(setting_pointers[setting_i][buffer_i])) { + while(!HDisspace(setting_pointers[setting_i][buffer_i])) buffer_i++; - } setting_pointers[setting_i][buffer_i] = '\0'; break; /* have read setting; don't compare with others */ @@ -2561,76 +2118,46 @@ H5FD_s3comms_load_aws_profile(const char *profile_name, #else ret = HDsnprintf(awspath, 117, "%s/.aws/", getenv("HOME")) ; #endif - if (ret < 0 || (size_t)ret >= 117) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, - "unable to format home-aws path") - } + if(ret < 0 || (size_t)ret >= 117) + HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format home-aws path") ret = HDsnprintf(filepath, 128, "%s%s", awspath, "credentials"); - if (ret < 0 || (size_t)ret >= 128) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, - "unable to format credentials path") - } - - credfile = fopen(filepath, "r"); - if (credfile != NULL) { - if (H5FD__s3comms_load_aws_creds_from_file( - credfile, - profile_name, - key_id_out, - secret_access_key_out, - aws_region_out) - == FAIL) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to load from aws credentials") - } - if (fclose(credfile) == EOF) { - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, - "unable to close credentials file") - } + if(ret < 0 || (size_t)ret >= 128) + HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format credentials path") + + credfile = HDfopen(filepath, "r"); + if(credfile != NULL) { + if(H5FD__s3comms_load_aws_creds_from_file(credfile, profile_name, key_id_out, + secret_access_key_out, aws_region_out) == FAIL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to load from aws credentials") + if(HDfclose(credfile) == EOF) + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close credentials file") credfile = NULL; } /* end if credential file opened */ ret = HDsnprintf(filepath, 128, "%s%s", awspath, "config"); - if (ret < 0 || (size_t)ret >= 128) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, - "unable to format config path") - } - credfile = fopen(filepath, "r"); - if (credfile != NULL) { - if (H5FD__s3comms_load_aws_creds_from_file( - credfile, - profile_name, + if(ret < 0 || (size_t)ret >= 128) + HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format config path") + credfile = HDfopen(filepath, "r"); + if(credfile != NULL) { + if(H5FD__s3comms_load_aws_creds_from_file( credfile, profile_name, (*key_id_out == 0) ? key_id_out : NULL, (*secret_access_key_out == 0) ? secret_access_key_out : NULL, - (*aws_region_out == 0) ? aws_region_out : NULL) - == FAIL) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to load from aws config") - } - if (fclose(credfile) == EOF) { - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, - "unable to close config file") - } + (*aws_region_out == 0) ? aws_region_out : NULL) == FAIL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to load from aws config") + if(HDfclose(credfile) == EOF) + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close config file") credfile = NULL; } /* end if credential file opened */ /* fail if not all three settings were loaded */ - if (*key_id_out == 0 || - *secret_access_key_out == 0 || - *aws_region_out == 0) - { + if(*key_id_out == 0 || *secret_access_key_out == 0 || *aws_region_out == 0) ret_value = FAIL; - } done: - if (credfile != NULL) { - if (fclose(credfile) == EOF) { - HDONE_ERROR(H5E_ARGS, H5E_ARGS, FAIL, - "problem error-closing aws configuration file") - } - } + if(credfile != NULL) + if(HDfclose(credfile) == EOF) + HDONE_ERROR(H5E_ARGS, H5E_ARGS, FAIL, "problem error-closing aws configuration file") + FUNC_LEAVE_NOAPI(ret_value); } /* end H5FD_s3comms_load_aws_profile() */ @@ -2675,16 +2202,14 @@ H5FD_s3comms_nlowercase( HDfprintf(stdout, "called H5FD_s3comms_nlowercase.\n"); #endif - if (dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "destination cannot be null.\n"); - } + if(dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null."); - if (len > 0) { + if(len > 0) { HDmemcpy(dest, s, len); do { len--; - dest[len] = (char)tolower( (int)dest[len] ); + dest[len] = (char)HDtolower((int)dest[len]); } while (len > 0); } @@ -2743,18 +2268,14 @@ H5FD_s3comms_parse_url( HDprintf("called H5FD_s3comms_parse_url.\n"); #endif - if (str == NULL || *str == '\0') { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "invalid url string"); - } + if(str == NULL || *str == '\0') + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid url string"); urllen = (long int)HDstrlen(str); purl = (parsed_url_t *)H5MM_malloc(sizeof(parsed_url_t)); - if (purl == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "can't allocate space for parsed_url_t"); - } + if(purl == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for parsed_url_t"); purl->magic = S3COMMS_PARSED_URL_MAGIC; purl->scheme = NULL; purl->host = NULL; @@ -2767,38 +2288,27 @@ H5FD_s3comms_parse_url( ***************/ tmpstr = HDstrchr(curstr, ':'); - if (tmpstr == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "invalid SCHEME construction: probably not URL"); - } + if(tmpstr == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid SCHEME construction: probably not URL"); len = tmpstr - curstr; HDassert( (0 <= len) && (len < urllen) ); - /* check for restrictions - */ - for (i = 0; i < len; i++) { + /* check for restrictions */ + for(i = 0; i < len; i++) { /* scheme = [a-zA-Z+-.]+ (terminated by ":") */ - if (!isalpha(curstr[i]) && - '+' != curstr[i] && - '-' != curstr[i] && - '.' != curstr[i]) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "invalid SCHEME construction"); - } + if(!HDisalpha(curstr[i]) && '+' != curstr[i] && '-' != curstr[i] && + '.' != curstr[i]) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid SCHEME construction"); } - /* copy lowercased scheme to structure - */ + + /* copy lowercased scheme to structure */ purl->scheme = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); - if (purl->scheme == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "can't allocate space for SCHEME"); - } + if(purl->scheme == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for SCHEME"); (void)HDstrncpy(purl->scheme, curstr, (size_t)len); purl->scheme[len] = '\0'; - for ( i = 0; i < len; i++ ) { - purl->scheme[i] = (char)tolower(purl->scheme[i]); - } + for(i = 0; i < len; i++ ) + purl->scheme[i] = (char)HDtolower(purl->scheme[i]); /* Skip "://" */ tmpstr += 3; @@ -2808,46 +2318,33 @@ H5FD_s3comms_parse_url( * READ HOST * *************/ - if (*curstr == '[') { + if(*curstr == '[') { /* IPv6 */ - while (']' != *tmpstr) { - if (tmpstr == 0) { /* end of string reached! */ - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "reached end of URL: incomplete IPv6 HOST"); - } + while(']' != *tmpstr) { + /* end of string reached! */ + if(tmpstr == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "reached end of URL: incomplete IPv6 HOST"); tmpstr++; } tmpstr++; } /* end if (IPv6) */ else { - while (0 != *tmpstr) { - if (':' == *tmpstr || - '/' == *tmpstr || - '?' == *tmpstr) - { + while(0 != *tmpstr) { + if(':' == *tmpstr || '/' == *tmpstr || '?' == *tmpstr) break; - } tmpstr++; } } /* end else (IPv4) */ len = tmpstr - curstr; - if (len == 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "HOST substring cannot be empty"); - } - else - if (len > urllen) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem with length of HOST substring"); - } + if(len == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HOST substring cannot be empty"); + else if(len > urllen) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of HOST substring"); - /* copy host - */ + /* copy host */ purl->host = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); - if (purl->host == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "can't allocate space for HOST"); - } + if(purl->host == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for HOST"); (void)HDstrncpy(purl->host, curstr, (size_t)len); purl->host[len] = 0; @@ -2855,36 +2352,24 @@ H5FD_s3comms_parse_url( * READ PORT * *************/ - if (':' == *tmpstr) { + if(':' == *tmpstr) { tmpstr += 1; /* advance past ':' */ curstr = tmpstr; - while ((0 != *tmpstr) && ('/' != *tmpstr) && ('?' != *tmpstr)) { + while((0 != *tmpstr) && ('/' != *tmpstr) && ('?' != *tmpstr)) tmpstr++; - } len = tmpstr - curstr; - if (len == 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "PORT element cannot be empty"); - } - else - if (len > urllen) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem with length of PORT substring"); - } - for (i = 0; i < len; i ++) { - if (!isdigit(curstr[i])) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "PORT is not a decimal string"); - } - } - - /* copy port - */ + if(len == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT element cannot be empty"); + else if(len > urllen) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of PORT substring"); + for(i = 0; i < len; i ++) + if(!HDisdigit(curstr[i])) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT is not a decimal string"); + + /* copy port */ purl->port = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); - if (purl->port == NULL) { /* cannot malloc */ - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "can't allocate space for PORT"); - } + if(purl->port == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PORT"); (void)HDstrncpy(purl->port, curstr, (size_t)len); purl->port[len] = 0; } /* end if PORT element */ @@ -2893,27 +2378,21 @@ H5FD_s3comms_parse_url( * READ PATH * *************/ - if ('/' == *tmpstr) { + if('/' == *tmpstr) { /* advance past '/' */ tmpstr += 1; curstr = tmpstr; - /* seek end of PATH - */ - while ((0 != *tmpstr) && ('?' != *tmpstr)) { + /* seek end of PATH */ + while((0 != *tmpstr) && ('?' != *tmpstr)) tmpstr++; - } len = tmpstr - curstr; - if (len > urllen) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem with length of PATH substring"); - } - if (len > 0) { + if(len > urllen) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of PATH substring"); + if(len > 0) { purl->path = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); - if (purl->path == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "can't allocate space for PATH"); - } /* cannot malloc path pointer */ + if(purl->path == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PATH"); (void)HDstrncpy(purl->path, curstr, (size_t)len); purl->path[len] = 0; } @@ -2923,25 +2402,19 @@ H5FD_s3comms_parse_url( * READ QUERY * **************/ - if ('?' == *tmpstr) { + if('?' == *tmpstr) { tmpstr += 1; curstr = tmpstr; - while (0 != *tmpstr) { + while(0 != *tmpstr) tmpstr++; - } len = tmpstr - curstr; - if (len == 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "QUERY cannot be empty"); - } else if (len > urllen) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem with length of QUERY substring"); - } + if(len == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "QUERY cannot be empty"); + else if(len > urllen) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of QUERY substring"); purl->query = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); - if (purl->query == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, - "can't allocate space for QUERY"); - } /* cannot malloc path pointer */ + if(purl->query == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for QUERY"); (void)HDstrncpy(purl->query, curstr, (size_t)len); purl->query[len] = 0; } /* end if QUERY exists */ @@ -2950,9 +2423,9 @@ H5FD_s3comms_parse_url( ret_value = SUCCEED; done: - if (ret_value == FAIL) { + if(ret_value == FAIL) H5FD_s3comms_free_purl(purl); - } + FUNC_LEAVE_NOAPI(ret_value); } /* end H5FD_s3comms_parse_url() */ @@ -3016,9 +2489,8 @@ H5FD_s3comms_percent_encode_char( HDfprintf(stdout, "called H5FD_s3comms_percent_encode_char.\n"); #endif - if (repr == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination `repr`.\n") - } + if(repr == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination `repr`.") #if S3COMMS_DEBUG H5FD_s3comms_bytes_to_hex((char *)hex, s, 1, FALSE); @@ -3026,7 +2498,7 @@ H5FD_s3comms_percent_encode_char( HDfprintf(stdout, " CHAR-HEX: \"%s\"\n", hex); #endif - if (c <= (unsigned char)0x7f) { + if(c <= (unsigned char)0x7f) { /* character represented in a single "byte" * and single percent-code */ @@ -3035,11 +2507,8 @@ H5FD_s3comms_percent_encode_char( #endif *repr_len = 3; chars_written = HDsnprintf(repr, 4, "%%%02X", c); - if (chars_written < 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot write char %c", - c); - } + if(chars_written < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot write char %c", c); } /* end if single-byte unicode char */ else { /* multi-byte, multi-percent representation @@ -3092,16 +2561,9 @@ H5FD_s3comms_percent_encode_char( acc += (stack_size > 2) ? 0x20 : 0; /* 0x00100000 */ acc += (stack_size > 3) ? 0x10 : 0; /* 0x00010000 */ stack_size--; - chars_written = HDsnprintf( - repr, - 4, - "%%%02X", - (unsigned char)(acc + stack[stack_size])); - if (chars_written < 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot write char %c", - c); - } + chars_written = HDsnprintf( repr, 4, "%%%02X", (unsigned char)(acc + stack[stack_size])); + if(chars_written < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot write char %c", c); *repr_len += 3; /************************ @@ -3109,17 +2571,11 @@ H5FD_s3comms_percent_encode_char( ************************/ /* 10xxxxxx */ - for (i = 0; i < stack_size; i++) { - chars_written = HDsnprintf( - &repr[i*3 + 3], - 4, - "%%%02X", - (unsigned char)(0x80 + stack[stack_size - 1 - i])); - if (chars_written < 0) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "cannot write char %c", - c); - } + for(i = 0; i < stack_size; i++) { + chars_written = HDsnprintf( &repr[i*3 + 3], 4, + "%%%02X", (unsigned char)(0x80 + stack[stack_size - 1 - i])); + if(chars_written < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot write char %c", c); *repr_len += 3; } /* end for each continuation byte */ } /* end else (multi-byte) */ @@ -3190,38 +2646,24 @@ H5FD_s3comms_signing_key( HDfprintf(stdout, "called H5FD_s3comms_signing_key.\n"); #endif - if (md == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Destination `md` cannot be NULL.\n") - } - if (secret == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "`secret` cannot be NULL.\n") - } - if (region == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "`region` cannot be NULL.\n") - } - if (iso8601now == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "`iso8601now` cannot be NULL.\n") - } + if(md == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Destination `md` cannot be NULL.") + if(secret == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`secret` cannot be NULL.") + if(region == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`region` cannot be NULL.") + if(iso8601now == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`iso8601now` cannot be NULL.") AWS4_secret_len = 4 + HDstrlen(secret) + 1; AWS4_secret = (char*)H5MM_malloc(sizeof(char *) * AWS4_secret_len); - if (AWS4_secret == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Could not allocate space.\n") - } + if(AWS4_secret == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Could not allocate space.") - /* prepend "AWS4" to start of the secret key - */ + /* prepend "AWS4" to start of the secret key */ ret = HDsnprintf(AWS4_secret, AWS4_secret_len,"%s%s", "AWS4", secret); - if ((size_t)ret != (AWS4_secret_len - 1)) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem writing AWS4+secret `%s`", - secret); - } + if((size_t)ret != (AWS4_secret_len - 1)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem writing AWS4+secret `%s`", secret); /* hash_func, key, len(key), msg, len(msg), digest_dest, digest_len_dest * we know digest length, so ignore via NULL @@ -3320,37 +2762,26 @@ H5FD_s3comms_tostringtosign( HDfprintf(stdout, "called H5FD_s3comms_tostringtosign.\n"); #endif - if (dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "destination buffer cannot be null.\n") - } - if (req == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "canonical request cannot be null.\n") - } - if (now == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Timestring cannot be NULL.\n") - } - if (region == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Region cannot be NULL.\n") - } + if(dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer cannot be null.") + if(req == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "canonical request cannot be null.") + if(now == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Timestring cannot be NULL.") + if(region == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Region cannot be NULL.") - for (i = 0; i < 128; i++) { + for(i = 0; i < 128; i++) tmp[i] = '\0'; - } - for (i = 0; i < SHA256_DIGEST_LENGTH * 2 + 1; i++) { + for(i = 0; i < SHA256_DIGEST_LENGTH * 2 + 1; i++) { checksum[i] = '\0'; hexsum[i] = '\0'; } HDstrncpy(day, now, 8); day[8] = '\0'; ret = HDsnprintf(tmp, 127, "%s/%s/s3/aws4_request", day, region); - if (ret <= 0 || ret >= 127) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "problem adding day and region to string") - } + if(ret <= 0 || ret >= 127) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem adding day and region to string") HDmemcpy((dest + d), "AWS4-HMAC-SHA256\n", 17); d = 17; @@ -3363,24 +2794,14 @@ H5FD_s3comms_tostringtosign( d += HDstrlen(tmp); dest[d++] = '\n'; - SHA256((const unsigned char *)req, - HDstrlen(req), - checksum); + SHA256((const unsigned char *)req, HDstrlen(req), checksum); - if (H5FD_s3comms_bytes_to_hex( - hexsum, - (const unsigned char *)checksum, - SHA256_DIGEST_LENGTH, - true) - == FAIL) - { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "could not create hex string"); - } + if(H5FD_s3comms_bytes_to_hex(hexsum, (const unsigned char *)checksum, + SHA256_DIGEST_LENGTH, true) == FAIL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not create hex string"); - for (i = 0; i < SHA256_DIGEST_LENGTH * 2; i++) { + for(i = 0; i < SHA256_DIGEST_LENGTH * 2; i++) dest[d++] = hexsum[i]; - } dest[d] = '\0'; @@ -3432,21 +2853,16 @@ H5FD_s3comms_trim(char *dest, HDfprintf(stdout, "called H5FD_s3comms_trim.\n"); #endif - if (dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "destination cannot be null.") - } - if (s == NULL) { + if(dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null.") + if(s == NULL) s_len = 0; - } - if (s_len > 0) { + if(s_len > 0) { /* Find first non-whitespace character from start; * reduce total length per character. */ - while ((s_len > 0) && - isspace((unsigned char)s[0]) && s_len > 0) - { + while((s_len > 0) && HDisspace((unsigned char)s[0]) && s_len > 0) { s++; s_len--; } @@ -3455,14 +2871,13 @@ H5FD_s3comms_trim(char *dest, * reduce length per-character. * If length is 0 already, there is no non-whitespace character. */ - if (s_len > 0) { + if(s_len > 0) { do { s_len--; - } while( isspace((unsigned char)s[s_len]) ); + } while(HDisspace((unsigned char)s[s_len])); s_len++; - /* write output into dest - */ + /* write output into dest */ HDmemcpy(dest, s, s_len); } } @@ -3534,54 +2949,36 @@ H5FD_s3comms_uriencode( HDfprintf(stdout, "H5FD_s3comms_uriencode called.\n"); #endif - if (s == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "source string cannot be NULL"); - } - if (dest == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "destination cannot be NULL"); - } + if(s == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source string cannot be NULL"); + if(dest == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be NULL"); /* Write characters to destination, converting to percent-encoded * "hex-utf-8" strings if necessary. * e.g., '$' -> "%24" */ - for (s_off = 0; s_off < s_len; s_off++) { + for(s_off = 0; s_off < s_len; s_off++) { c = s[s_off]; - if (isalnum(c) || - c == '.' || - c == '-' || - c == '_' || - c == '~' || - (c == '/' && encode_slash == FALSE)) - { + if(HDisalnum(c) || c == '.' || c == '-' || c == '_' || + c == '~' || (c == '/' && encode_slash == FALSE)) dest[dest_off++] = c; - } else { hex_off = 0; - if (H5FD_s3comms_percent_encode_char( - hex_buffer, - (const unsigned char)c, - &hex_len) - == FAIL) - { + if(H5FD_s3comms_percent_encode_char(hex_buffer, (const unsigned char)c, + &hex_len) == FAIL) { hex_buffer[0] = c; hex_buffer[1] = 0; - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "unable to percent-encode character \'%s\' " - "at %d in \"%s\"", hex_buffer, (int)s_off, s); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to percent-encode character \'%s\' " "at %d in \"%s\"", hex_buffer, (int)s_off, s); } - for (hex_off = 0; hex_off < hex_len; hex_off++) { + for(hex_off = 0; hex_off < hex_len; hex_off++) dest[dest_off++] = hex_buffer[hex_off]; - } } /* end else (not a regular character) */ } /* end for each character */ - if (dest_off < s_len) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "buffer overflow"); + if(dest_off < s_len) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "buffer overflow"); *n_written = dest_off; diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 3551905..f2ceb3b 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 29, 1999 * * Purpose: The POSIX unbuffered file driver using only the HDF5 public @@ -95,7 +95,6 @@ typedef struct H5FD_sec2_t { * a single file. */ hbool_t fam_to_single; - } H5FD_sec2_t; /* @@ -113,37 +112,37 @@ typedef struct H5FD_sec2_t { * which can be addressed entirely by the second * argument of the file seek function. */ -#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) -#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR)) +#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1) +#define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR)) #define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) #define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ - HADDR_UNDEF==(A)+(Z) || \ - (HDoff_t)((A)+(Z))<(HDoff_t)(A)) + HADDR_UNDEF == (A) + (Z) || \ + (HDoff_t)((A) + (Z)) < (HDoff_t)(A)) /* Prototypes */ -static herr_t H5FD_sec2_term(void); -static H5FD_t *H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, +static herr_t H5FD__sec2_term(void); +static H5FD_t *H5FD__sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_sec2_close(H5FD_t *_file); -static int H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_sec2_query(const H5FD_t *_f1, unsigned long *flags); -static haddr_t H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_sec2_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); -static herr_t H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, +static herr_t H5FD__sec2_close(H5FD_t *_file); +static int H5FD__sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD__sec2_query(const H5FD_t *_f1, unsigned long *flags); +static haddr_t H5FD__sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__sec2_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static haddr_t H5FD__sec2_get_eof(const H5FD_t *_file, H5FD_mem_t type); +static herr_t H5FD__sec2_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); +static herr_t H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, +static herr_t H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_sec2_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_sec2_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_sec2_unlock(H5FD_t *_file); +static herr_t H5FD__sec2_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__sec2_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__sec2_unlock(H5FD_t *_file); static const H5FD_class_t H5FD_sec2_g = { "sec2", /* name */ MAXADDR, /* maxaddr */ H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_sec2_term, /* terminate */ + H5FD__sec2_term, /* terminate */ NULL, /* sb_size */ NULL, /* sb_encode */ NULL, /* sb_decode */ @@ -154,23 +153,23 @@ static const H5FD_class_t H5FD_sec2_g = { 0, /* dxpl_size */ NULL, /* dxpl_copy */ NULL, /* dxpl_free */ - H5FD_sec2_open, /* open */ - H5FD_sec2_close, /* close */ - H5FD_sec2_cmp, /* cmp */ - H5FD_sec2_query, /* query */ + H5FD__sec2_open, /* open */ + H5FD__sec2_close, /* close */ + H5FD__sec2_cmp, /* cmp */ + H5FD__sec2_query, /* query */ NULL, /* get_type_map */ NULL, /* alloc */ NULL, /* free */ - H5FD_sec2_get_eoa, /* get_eoa */ - H5FD_sec2_set_eoa, /* set_eoa */ - H5FD_sec2_get_eof, /* get_eof */ - H5FD_sec2_get_handle, /* get_handle */ - H5FD_sec2_read, /* read */ - H5FD_sec2_write, /* write */ + H5FD__sec2_get_eoa, /* get_eoa */ + H5FD__sec2_set_eoa, /* set_eoa */ + H5FD__sec2_get_eof, /* get_eof */ + H5FD__sec2_get_handle, /* get_handle */ + H5FD__sec2_read, /* read */ + H5FD__sec2_write, /* write */ NULL, /* flush */ - H5FD_sec2_truncate, /* truncate */ - H5FD_sec2_lock, /* lock */ - H5FD_sec2_unlock, /* unlock */ + H5FD__sec2_truncate, /* truncate */ + H5FD__sec2_lock, /* lock */ + H5FD__sec2_unlock, /* unlock */ H5FD_FLMAP_DICHOTOMY /* fl_map */ }; @@ -235,7 +234,7 @@ done: /*--------------------------------------------------------------------------- - * Function: H5FD_sec2_term + * Function: H5FD__sec2_term * * Purpose: Shut down the VFD * @@ -247,15 +246,15 @@ done: *--------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_term(void) +H5FD__sec2_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Reset VFL ID */ H5FD_SEC2_g = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_sec2_term() */ +} /* end H5FD__sec2_term() */ /*------------------------------------------------------------------------- @@ -292,7 +291,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_sec2_open + * Function: H5FD__sec2_open * * Purpose: Create and/or opens a file as an HDF5 file. * @@ -307,7 +306,7 @@ done: *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) +H5FD__sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { H5FD_sec2_t *file = NULL; /* sec2 VFD info */ int fd = -1; /* File descriptor */ @@ -318,7 +317,7 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) h5_stat_t sb; H5FD_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check on file offsets */ HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t)); @@ -407,11 +406,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_open() */ +} /* end H5FD__sec2_open() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_close + * Function: H5FD__sec2_close * * Purpose: Closes an HDF5 file. * @@ -424,12 +423,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_close(H5FD_t *_file) +H5FD__sec2_close(H5FD_t *_file) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(file); @@ -443,11 +442,11 @@ H5FD_sec2_close(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_close() */ +} /* end H5FD__sec2_close() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_cmp + * Function: H5FD__sec2_cmp * * Purpose: Compares two files belonging to this driver using an * arbitrary (but consistent) ordering. @@ -462,13 +461,13 @@ done: *------------------------------------------------------------------------- */ static int -H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2) +H5FD__sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { const H5FD_sec2_t *f1 = (const H5FD_sec2_t *)_f1; const H5FD_sec2_t *f2 = (const H5FD_sec2_t *)_f2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR #ifdef H5_HAVE_WIN32_API if(f1->dwVolumeSerialNumber < f2->dwVolumeSerialNumber) HGOTO_DONE(-1) @@ -497,11 +496,11 @@ H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_cmp() */ +} /* end H5FD__sec2_cmp() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_query + * Function: H5FD__sec2_query * * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) @@ -514,11 +513,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */) +H5FD__sec2_query(const H5FD_t *_file, unsigned long *flags /* out */) { const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file; /* sec2 VFD info */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set the VFL feature flags that this driver supports */ /* Notice: the Mirror VFD Writer currently uses only the Sec2 driver as @@ -543,11 +542,11 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */) } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_sec2_query() */ +} /* end H5FD__sec2_query() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_get_eoa + * Function: H5FD__sec2_get_eoa * * Purpose: Gets the end-of-address marker for the file. The EOA marker * is the first address past the last byte allocated in the @@ -561,18 +560,18 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */) *------------------------------------------------------------------------- */ static haddr_t -H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eoa) -} /* end H5FD_sec2_get_eoa() */ +} /* end H5FD__sec2_get_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_set_eoa + * Function: H5FD__sec2_set_eoa * * Purpose: Set the end-of-address marker for the file. This function is * called shortly after an existing HDF5 file is opened in order @@ -586,20 +585,20 @@ H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) +H5FD__sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR file->eoa = addr; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_sec2_set_eoa() */ +} /* end H5FD__sec2_set_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_get_eof + * Function: H5FD__sec2_get_eof * * Purpose: Returns the end-of-file marker, which is the greater of * either the filesystem end-of-file or the HDF5 end-of-address @@ -614,18 +613,18 @@ H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__sec2_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eof) -} /* end H5FD_sec2_get_eof() */ +} /* end H5FD__sec2_get_eof() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_get_handle + * Function: H5FD__sec2_get_handle * * Purpose: Returns the file handle of sec2 file driver. * @@ -637,12 +636,12 @@ H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle) +H5FD__sec2_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -651,11 +650,11 @@ H5FD_sec2_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handl done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_get_handle() */ +} /* end H5FD__sec2_get_handle() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_read + * Function: H5FD__sec2_read * * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR * into buffer BUF according to data transfer properties in @@ -671,14 +670,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, +H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf /*out*/) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; HDoff_t offset = (HDoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file && file->pub.cls); HDassert(buf); @@ -691,17 +690,15 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS #ifndef H5_HAVE_PREADWRITE /* Seek to the correct location (if we don't have pread) */ - if(addr != file->pos || OP_READ != file->op) { + if(addr != file->pos || OP_READ != file->op) if(HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") - } #endif /* H5_HAVE_PREADWRITE */ /* Read data, being careful of interrupted system calls, partial results, * and the end of the file. */ while(size > 0) { - h5_posix_io_t bytes_in = 0; /* # of bytes to read */ h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */ @@ -758,11 +755,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_read() */ +} /* end H5FD__sec2_read() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_write + * Function: H5FD__sec2_write * * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR * from buffer BUF according to data transfer properties in @@ -776,14 +773,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, +H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, const void *buf) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; HDoff_t offset = (HDoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file && file->pub.cls); HDassert(buf); @@ -796,17 +793,15 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU #ifndef H5_HAVE_PREADWRITE /* Seek to the correct location (if we don't have pwrite) */ - if(addr != file->pos || OP_WRITE != file->op) { + if(addr != file->pos || OP_WRITE != file->op) if(HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") - } #endif /* H5_HAVE_PREADWRITE */ /* Write the data, being careful of interrupted system calls and partial * results */ while(size > 0) { - h5_posix_io_t bytes_in = 0; /* # of bytes to write */ h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ @@ -859,11 +854,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_write() */ +} /* end H5FD__sec2_write() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_truncate + * Function: H5FD__sec2_truncate * * Purpose: Makes sure that the true file size is the same (or larger) * than the end-of-address. @@ -876,12 +871,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -928,11 +923,11 @@ H5FD_sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_truncate() */ +} /* end H5FD__sec2_truncate() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_lock + * Function: H5FD__sec2_lock * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": @@ -946,13 +941,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_lock(H5FD_t *_file, hbool_t rw) +H5FD__sec2_lock(H5FD_t *_file, hbool_t rw) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; /* VFD file struct */ int lock_flags; /* file locking flags */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -969,11 +964,11 @@ H5FD_sec2_lock(H5FD_t *_file, hbool_t rw) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_lock() */ +} /* end H5FD__sec2_lock() */ /*------------------------------------------------------------------------- - * Function: H5FD_sec2_unlock + * Function: H5FD__sec2_unlock * * Purpose: To remove the existing lock on the file * @@ -984,12 +979,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_unlock(H5FD_t *_file) +H5FD__sec2_unlock(H5FD_t *_file) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(file); @@ -1002,5 +997,5 @@ H5FD_sec2_unlock(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_sec2_unlock() */ +} /* end H5FD__sec2_unlock() */ diff --git a/src/H5FDsec2.h b/src/H5FDsec2.h index a4ade0b..d669582 100644 --- a/src/H5FDsec2.h +++ b/src/H5FDsec2.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Purpose: The public header file for the sec2 driver. diff --git a/src/H5FDspace.c b/src/H5FDspace.c index e1f0cb2..22d7e22 100644 --- a/src/H5FDspace.c +++ b/src/H5FDspace.c @@ -15,7 +15,7 @@ * * Created: H5FDspace.c * Jan 3 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Space allocation routines for the file driver code. * @@ -84,7 +84,7 @@ H5FL_DEFINE(H5FD_free_t); /*------------------------------------------------------------------------- - * Function: H5FD_extend + * Function: H5FD__extend * * Purpose: Extend the EOA space of a file. * @@ -99,12 +99,12 @@ H5FL_DEFINE(H5FD_free_t); *------------------------------------------------------------------------- */ static haddr_t -H5FD_extend(H5FD_t *file, H5FD_mem_t type, hsize_t size) +H5FD__extend(H5FD_t *file, H5FD_mem_t type, hsize_t size) { haddr_t eoa; /* Address of end-of-allocated space */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(file); @@ -129,7 +129,7 @@ H5FD_extend(H5FD_t *file, H5FD_mem_t type, hsize_t size) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_extend() */ +} /* end H5FD__extend() */ /*------------------------------------------------------------------------- @@ -203,7 +203,7 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size); HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "driver allocation request failed") } /* end if */ else { - ret_value = H5FD_extend(file, type, size + extra); + ret_value = H5FD__extend(file, type, size + extra); if(!H5F_addr_defined(ret_value)) HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "driver eoa update request failed") } /* end else */ @@ -439,7 +439,7 @@ H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t blk_end, hsize_ /* Check if the block is exactly at the end of the file */ if(H5F_addr_eq(blk_end, eoa)) { /* Extend the object by extending the underlying file */ - if(HADDR_UNDEF == H5FD_extend(file, type, extra_requested)) + if(HADDR_UNDEF == H5FD__extend(file, type, extra_requested)) HGOTO_ERROR(H5E_VFL, H5E_CANTEXTEND, FAIL, "driver extend request failed") /* Mark EOA info dirty in cache, so change will get encoded */ diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index 4ed3c4a..18a8735 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -27,8 +27,6 @@ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5FDsec2.h" /* Generic Functions */ -#include "H5FDstdio.h" /* Generic Functions */ #include "H5Pprivate.h" /* Property lists */ /* The driver identification number, initialized at runtime */ @@ -83,9 +81,8 @@ typedef struct H5FD_splitter_t { #define H5FD_SPLITTER_WO_ERROR(file, funcname, errmajor, errminor, ret, mesg) \ { \ H5FD__splitter_log_error((file), (funcname), (mesg)); \ - if (FALSE == (file)->fa.ignore_wo_errs) { \ + if(FALSE == (file)->fa.ignore_wo_errs) \ HGOTO_ERROR((errmajor), (errminor), (ret), (mesg)) \ - } \ } #define H5FD_SPLITTER_DEBUG_OP_CALLS 0 /* debugging print toggle; 0 disables */ @@ -93,7 +90,7 @@ typedef struct H5FD_splitter_t { #if H5FD_SPLITTER_DEBUG_OP_CALLS #define H5FD_SPLITTER_LOG_CALL(name) do { \ HDprintf("called %s()\n", (name)); \ - fflush(stdout); \ + HDfflush(stdout); \ } while (0) #else #define H5FD_SPLITTER_LOG_CALL(name) /* no-op */ @@ -103,73 +100,75 @@ typedef struct H5FD_splitter_t { /* Print error messages from W/O channel to log file */ static herr_t H5FD__splitter_log_error(const H5FD_splitter_t *file, const char *atfunc, const char *msg); - static int H5FD__copy_plist(hid_t fapl_id, hid_t *id_out_ptr); /* Prototypes */ -static herr_t H5FD_splitter_term(void); -static hsize_t H5FD_splitter_sb_size(H5FD_t *_file); -static herr_t H5FD_splitter_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/); -static herr_t H5FD_splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf); -static void *H5FD_splitter_fapl_get(H5FD_t *_file); -static void *H5FD_splitter_fapl_copy(const void *_old_fa); -static herr_t H5FD_splitter_fapl_free(void *_fapl); -static H5FD_t *H5FD_splitter_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static herr_t H5FD_splitter_close(H5FD_t *_file); -static int H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_splitter_query(const H5FD_t *_file, unsigned long *flags /* out */); -static herr_t H5FD_splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map); -static haddr_t H5FD_splitter_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); -static herr_t H5FD_splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size); -static haddr_t H5FD_splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type); -static herr_t H5FD_splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr); -static haddr_t H5FD_splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type); -static herr_t H5FD_splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void** file_handle); -static herr_t H5FD_splitter_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf); -static herr_t H5FD_splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf); -static herr_t H5FD_splitter_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD_splitter_lock(H5FD_t *_file, hbool_t rw); -static herr_t H5FD_splitter_unlock(H5FD_t *_file); +static herr_t H5FD__splitter_term(void); +static hsize_t H5FD__splitter_sb_size(H5FD_t *_file); +static herr_t H5FD__splitter_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/); +static herr_t H5FD__splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf); +static void *H5FD__splitter_fapl_get(H5FD_t *_file); +static void *H5FD__splitter_fapl_copy(const void *_old_fa); +static herr_t H5FD__splitter_fapl_free(void *_fapl); +static H5FD_t *H5FD__splitter_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); +static herr_t H5FD__splitter_close(H5FD_t *_file); +static int H5FD__splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD__splitter_query(const H5FD_t *_file, unsigned long *flags /* out */); +static herr_t H5FD__splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map); +static haddr_t H5FD__splitter_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); +static herr_t H5FD__splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size); +static haddr_t H5FD__splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type); +static herr_t H5FD__splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr); +static haddr_t H5FD__splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type); +static herr_t H5FD__splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void** file_handle); +static herr_t H5FD__splitter_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf); +static herr_t H5FD__splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf); +static herr_t H5FD__splitter_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__splitter_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__splitter_unlock(H5FD_t *_file); static const H5FD_class_t H5FD_splitter_g = { "splitter", /* name */ MAXADDR, /* maxaddr */ H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_splitter_term, /* terminate */ - H5FD_splitter_sb_size, /* sb_size */ - H5FD_splitter_sb_encode, /* sb_encode */ - H5FD_splitter_sb_decode, /* sb_decode */ + H5FD__splitter_term, /* terminate */ + H5FD__splitter_sb_size, /* sb_size */ + H5FD__splitter_sb_encode, /* sb_encode */ + H5FD__splitter_sb_decode, /* sb_decode */ sizeof(H5FD_splitter_fapl_t), /* fapl_size */ - H5FD_splitter_fapl_get, /* fapl_get */ - H5FD_splitter_fapl_copy, /* fapl_copy */ - H5FD_splitter_fapl_free, /* fapl_free */ + H5FD__splitter_fapl_get, /* fapl_get */ + H5FD__splitter_fapl_copy, /* fapl_copy */ + H5FD__splitter_fapl_free, /* fapl_free */ 0, /* dxpl_size */ NULL, /* dxpl_copy */ NULL, /* dxpl_free */ - H5FD_splitter_open, /* open */ - H5FD_splitter_close, /* close */ - H5FD_splitter_cmp, /* cmp */ - H5FD_splitter_query, /* query */ - H5FD_splitter_get_type_map, /* get_type_map */ - H5FD_splitter_alloc, /* alloc */ - H5FD_splitter_free, /* free */ - H5FD_splitter_get_eoa, /* get_eoa */ - H5FD_splitter_set_eoa, /* set_eoa */ - H5FD_splitter_get_eof, /* get_eof */ - H5FD_splitter_get_handle, /* get_handle */ - H5FD_splitter_read, /* read */ - H5FD_splitter_write, /* write */ - H5FD_splitter_flush, /* flush */ - H5FD_splitter_truncate, /* truncate */ - H5FD_splitter_lock, /* lock */ - H5FD_splitter_unlock, /* unlock */ + H5FD__splitter_open, /* open */ + H5FD__splitter_close, /* close */ + H5FD__splitter_cmp, /* cmp */ + H5FD__splitter_query, /* query */ + H5FD__splitter_get_type_map, /* get_type_map */ + H5FD__splitter_alloc, /* alloc */ + H5FD__splitter_free, /* free */ + H5FD__splitter_get_eoa, /* get_eoa */ + H5FD__splitter_set_eoa, /* set_eoa */ + H5FD__splitter_get_eof, /* get_eof */ + H5FD__splitter_get_handle, /* get_handle */ + H5FD__splitter_read, /* read */ + H5FD__splitter_write, /* write */ + H5FD__splitter_flush, /* flush */ + H5FD__splitter_truncate, /* truncate */ + H5FD__splitter_lock, /* lock */ + H5FD__splitter_unlock, /* unlock */ H5FD_FLMAP_DICHOTOMY /* fl_map */ }; /* Declare a free list to manage the H5FD_splitter_t struct */ H5FL_DEFINE_STATIC(H5FD_splitter_t); +/* Declare a free list to manage the H5FD_splitter_fapl_t struct */ +H5FL_DEFINE_STATIC(H5FD_splitter_fapl_t); + /*------------------------------------------------------------------------- * Function: H5FD__init_package @@ -186,11 +185,10 @@ H5FD__init_package(void) FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD__init_package"); + H5FD_SPLITTER_LOG_CALL(FUNC); - if (H5FD_splitter_init() < 0) { + if(H5FD_splitter_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize splitter VFD") - } done: FUNC_LEAVE_NOAPI(ret_value) @@ -214,11 +212,10 @@ H5FD_splitter_init(void) FUNC_ENTER_NOAPI(FAIL) - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_init"); + H5FD_SPLITTER_LOG_CALL(FUNC); - if (H5I_VFL != H5I_get_type(H5FD_SPLITTER_g)) { + if(H5I_VFL != H5I_get_type(H5FD_SPLITTER_g)) H5FD_SPLITTER_g = H5FDregister(&H5FD_splitter_g); - } ret_value = H5FD_SPLITTER_g; @@ -228,7 +225,7 @@ done: /*--------------------------------------------------------------------------- - * Function: H5FD_splitter_term + * Function: H5FD__splitter_term * * Purpose: Shut down the splitter VFD. * @@ -236,17 +233,17 @@ done: *--------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_term(void) +H5FD__splitter_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_term"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Reset VFL ID */ H5FD_SPLITTER_g = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_splitter_term() */ +} /* end H5FD__splitter_term() */ /*------------------------------------------------------------------------- @@ -265,25 +262,22 @@ H5FD__copy_plist(hid_t fapl_id, int ret_value = 0; H5P_genplist_t *plist_ptr = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD__copy_plist"); + H5FD_SPLITTER_LOG_CALL(FUNC); HDassert(id_out_ptr != NULL); - if (FALSE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) { + if(FALSE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "not a file access property list"); - } plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id); - if (NULL == plist_ptr) { + if(NULL == plist_ptr) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "unable to get property list"); - } *id_out_ptr = H5P_copy_plist(plist_ptr, FALSE); - if (H5I_INVALID_HID == *id_out_ptr) { + if(H5I_INVALID_HID == *id_out_ptr) HGOTO_ERROR(H5E_VFL, H5E_BADTYPE, -1, "unable to copy file access property list"); - } done: FUNC_LEAVE_NOAPI(ret_value); @@ -302,28 +296,21 @@ done: herr_t H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config) { - H5FD_splitter_fapl_t info; + H5FD_splitter_fapl_t *info = NULL; H5P_genplist_t *plist_ptr = NULL; herr_t ret_value = SUCCEED; - H5Eclear2(H5E_DEFAULT); - FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Dr", fapl_id, vfd_config); - H5FD_SPLITTER_LOG_CALL("H5Pset_fapl_splitter"); + H5FD_SPLITTER_LOG_CALL(FUNC); - if (H5FD_SPLITTER_MAGIC != vfd_config->magic) { + if(H5FD_SPLITTER_MAGIC != vfd_config->magic) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid configuration (magic number mismatch)") - } - if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invlaid config (version number mismatch)") - } - - if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) { + if(H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid config (version number mismatch)") + if(NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid property list") - } - /* Make sure that the W/O channel supports write-only capability. * Some drivers (e.g. family or multi) do revision of the superblock @@ -331,55 +318,54 @@ H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config) * Uses the feature flag H5FD_FEAT_DEFAULT_VFD_COMPATIBLE as the * determining attribute. */ - if (H5P_DEFAULT != vfd_config->wo_fapl_id) { + if(H5P_DEFAULT != vfd_config->wo_fapl_id) { H5FD_class_t *wo_driver = NULL; H5FD_driver_prop_t wo_driver_prop; H5P_genplist_t *wo_plist_ptr = NULL; unsigned long wo_driver_flags = 0; wo_plist_ptr = (H5P_genplist_t *)H5I_object(vfd_config->wo_fapl_id); - if (NULL == wo_plist_ptr) { + if(NULL == wo_plist_ptr) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - } - if (H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0) { + if(H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID & info") - } wo_driver = (H5FD_class_t *)H5I_object(wo_driver_prop.driver_id); - if (NULL == wo_driver) { + if(NULL == wo_driver) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid driver ID in file access property list") - } - if (H5FD_driver_query(wo_driver, &wo_driver_flags) < 0) { + if(H5FD_driver_query(wo_driver, &wo_driver_flags) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't query VFD flags") - } - if (0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags)) { + if(0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags)) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "unsuitable W/O driver") - } } /* end if W/O VFD is non-default */ + info = H5FL_CALLOC(H5FD_splitter_fapl_t); + if(NULL == info) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate file access property list struct") - info.ignore_wo_errs = vfd_config->ignore_wo_errs; - HDstrncpy(info.wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX); - HDstrncpy(info.log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX); - info.rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ - info.wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ + info->ignore_wo_errs = vfd_config->ignore_wo_errs; + HDstrncpy(info->wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX); + HDstrncpy(info->log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX); + info->rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ + info->wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */ /* Set non-default channel FAPL IDs in splitter configuration info */ - if (H5P_DEFAULT != vfd_config->rw_fapl_id) { - if (FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) { + if(H5P_DEFAULT != vfd_config->rw_fapl_id) { + if(FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") - } - info.rw_fapl_id = vfd_config->rw_fapl_id; + info->rw_fapl_id = vfd_config->rw_fapl_id; } - if (H5P_DEFAULT != vfd_config->wo_fapl_id) { - if (FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) { + if(H5P_DEFAULT != vfd_config->wo_fapl_id) { + if(FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") - } - info.wo_fapl_id = vfd_config->wo_fapl_id; + info->wo_fapl_id = vfd_config->wo_fapl_id; } - ret_value = H5P_set_driver(plist_ptr, H5FD_SPLITTER, &info); + ret_value = H5P_set_driver(plist_ptr, H5FD_SPLITTER, info); done: + if(info) + info = H5FL_FREE(H5FD_splitter_fapl_t, info); + FUNC_LEAVE_API(ret_value) } /* end H5Pset_fapl_splitter() */ @@ -406,48 +392,39 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_out) FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Dr", fapl_id, config_out); - H5FD_SPLITTER_LOG_CALL("H5Pget_fapl_splitter"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ - if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) { + if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - } - if (config_out == NULL) { + if(config_out == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_out pointer is null") - } - if (H5FD_SPLITTER_MAGIC != config_out->magic) { + if(H5FD_SPLITTER_MAGIC != config_out->magic) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (magic number mismatch)") - } - if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version) { + if(H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (version unsafe)") - } /* Pre-set out FAPL IDs with intent to replace these values */ config_out->rw_fapl_id = H5I_INVALID_HID; config_out->wo_fapl_id = H5I_INVALID_HID; /* Check and get the splitter fapl */ - if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) { + if(NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - } - if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr)) { + if(H5FD_SPLITTER != H5P_peek_driver(plist_ptr)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver") - } - if (NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr))) { + if(NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr))) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "unable to get specific-driver info") - } HDstrncpy(config_out->wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX); HDstrncpy(config_out->log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX); config_out->ignore_wo_errs = fapl_ptr->ignore_wo_errs; /* Copy R/W and W/O FAPLs */ - if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0) { + if(H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy R/W FAPL"); - } - if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0) { + if(H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy W/O FAPL"); - } done: FUNC_LEAVE_API(ret_value) @@ -455,7 +432,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_splitter_flush + * Function: H5FD__splitter_flush * * Purpose: Flushes all data to disk for both channels. * @@ -463,32 +440,28 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) +H5FD__splitter_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_flush"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Public API for dxpl "context" */ - if (H5FDflush(file->rw_file, dxpl_id, closing) < 0) { + if(H5FDflush(file->rw_file, dxpl_id, closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFLUSH, FAIL, "unable to flush R/W file") - } - if (H5FDflush(file->wo_file, dxpl_id, closing) < 0) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_flush", - H5E_VFL, H5E_CANTFLUSH, FAIL, - "unable to flush W/O file") - } + if(H5FDflush(file->wo_file, dxpl_id, closing) < 0) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTFLUSH, FAIL, "unable to flush W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_flush() */ +} /* end H5FD__splitter_flush() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_read + * Function: H5FD__splitter_read * * Purpose: Reads SIZE bytes of data from the R/W channel, beginning at * address ADDR into buffer BUF according to data transfer @@ -502,45 +475,37 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_read( - H5FD_t *_file, - H5FD_mem_t H5_ATTR_UNUSED type, - hid_t H5_ATTR_UNUSED dxpl_id, - haddr_t addr, - size_t size, - void *buf /*out*/) +H5FD__splitter_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, + hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_read"); + H5FD_SPLITTER_LOG_CALL(FUNC); HDassert(file && file->pub.cls); HDassert(buf); /* Check for overflow conditions */ - if (!H5F_addr_defined(addr)) { + if(!H5F_addr_defined(addr)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined, addr = %llu", (unsigned long long)addr) - } - if (REGION_OVERFLOW(addr, size)) { + if(REGION_OVERFLOW(addr, size)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu", (unsigned long long)addr) - } /* Only read from R/W channel */ /* Public API for dxpl "context" */ - if (H5FDread(file->rw_file, type, dxpl_id, addr, size, buf) < 0) { + if(H5FDread(file->rw_file, type, dxpl_id, addr, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "Reading from R/W channel failed") - } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_read() */ +} /* end H5FD__splitter_read() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_write + * Function: H5FD__splitter_write * * Purpose: Writes SIZE bytes of data to R/W and W/O channels, beginning * at address ADDR from buffer BUF according to data transfer @@ -550,38 +515,34 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf) +H5FD__splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, + haddr_t addr, size_t size, const void *buf) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; H5P_genplist_t *plist_ptr = NULL; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_write"); + H5FD_SPLITTER_LOG_CALL(FUNC); - if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(dxpl_id))) { + if(NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - } /* Write to each file */ /* Public API for dxpl "context" */ - if (H5FDwrite(file->rw_file, type, dxpl_id, addr, size, buf) < 0) { + if(H5FDwrite(file->rw_file, type, dxpl_id, addr, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "R/W file write failed") - } - if (H5FDwrite(file->wo_file, type, dxpl_id, addr, size, buf) < 0) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_write", - H5E_VFL, H5E_WRITEERROR, FAIL, - "unable to write W/O file") - } + if(H5FDwrite(file->wo_file, type, dxpl_id, addr, size, buf) < 0) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_write() */ +} /* end H5FD__splitter_write() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_fapl_get + * Function: H5FD__splitter_fapl_get * * Purpose: Returns a file access property list which indicates how the * specified file is being accessed. The return list could be @@ -593,23 +554,23 @@ done: *------------------------------------------------------------------------- */ static void * -H5FD_splitter_fapl_get(H5FD_t *_file) +H5FD__splitter_fapl_get(H5FD_t *_file) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_fapl_get"); + H5FD_SPLITTER_LOG_CALL(FUNC); - ret_value = H5FD_splitter_fapl_copy(&(file->fa)); + ret_value = H5FD__splitter_fapl_copy(&(file->fa)); FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5FD__splitter_fapl_get() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_fapl_copy + * Function: H5FD__splitter_fapl_copy * * Purpose: Copies the file access properties. * @@ -618,56 +579,45 @@ H5FD_splitter_fapl_get(H5FD_t *_file) *------------------------------------------------------------------------- */ static void * -H5FD_splitter_fapl_copy(const void *_old_fa) +H5FD__splitter_fapl_copy(const void *_old_fa) { const H5FD_splitter_fapl_t *old_fa_ptr = (const H5FD_splitter_fapl_t *)_old_fa; H5FD_splitter_fapl_t *new_fa_ptr = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_fapl_copy"); + H5FD_SPLITTER_LOG_CALL(FUNC); HDassert(old_fa_ptr); - new_fa_ptr = (H5FD_splitter_fapl_t *)H5MM_calloc(sizeof(H5FD_splitter_fapl_t)); - if (NULL == new_fa_ptr) { + new_fa_ptr = H5FL_CALLOC(H5FD_splitter_fapl_t); + if(NULL == new_fa_ptr) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate log file FAPL") - } - if (HDmemcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_splitter_fapl_t)) == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, NULL, "unable to shallow-copy info") - } - if (HDstrncpy(new_fa_ptr->wo_path, old_fa_ptr->wo_path, H5FD_SPLITTER_PATH_MAX) == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, NULL, "unable to copy write-only channel file path") - } - if (HDstrncpy(new_fa_ptr->log_file_path, old_fa_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX) == NULL) { - HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, NULL, "unable to copy log file path") - } + HDmemcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_splitter_fapl_t)); + HDstrncpy(new_fa_ptr->wo_path, old_fa_ptr->wo_path, H5FD_SPLITTER_PATH_MAX); + HDstrncpy(new_fa_ptr->log_file_path, old_fa_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX); /* Copy R/W and W/O FAPLs */ - if (H5FD__copy_plist(old_fa_ptr->rw_fapl_id, &(new_fa_ptr->rw_fapl_id)) < 0) { + if(H5FD__copy_plist(old_fa_ptr->rw_fapl_id, &(new_fa_ptr->rw_fapl_id)) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy R/W FAPL"); - } - if (H5FD__copy_plist(old_fa_ptr->wo_fapl_id, &(new_fa_ptr->wo_fapl_id)) < 0) { + if(H5FD__copy_plist(old_fa_ptr->wo_fapl_id, &(new_fa_ptr->wo_fapl_id)) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy W/O FAPL"); - } ret_value = (void *)new_fa_ptr; done: - if (NULL == ret_value) { - if (new_fa_ptr) { - H5MM_free(new_fa_ptr); - } - } + if(NULL == ret_value) + if(new_fa_ptr) + new_fa_ptr = H5FL_FREE(H5FD_splitter_fapl_t, new_fa_ptr); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_fapl_copy() */ +} /* end H5FD__splitter_fapl_copy() */ /*-------------------------------------------------------------------------- - * Function: H5FD_splitter_fapl_free + * Function: H5FD__splitter_fapl_free * * Purpose: Releases the file access lists * @@ -675,35 +625,33 @@ done: *-------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_fapl_free(void *_fapl) +H5FD__splitter_fapl_free(void *_fapl) { H5FD_splitter_fapl_t *fapl = (H5FD_splitter_fapl_t*)_fapl; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_fapl_free"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ HDassert(fapl); - if (H5I_dec_ref(fapl->rw_fapl_id) < 0) { + if(H5I_dec_ref(fapl->rw_fapl_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close R/W FAPL ID") - } - if (H5I_dec_ref(fapl->wo_fapl_id) < 0) { + if(H5I_dec_ref(fapl->wo_fapl_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close W/O FAPL ID") - } /* Free the property list */ - H5MM_free(fapl); + fapl = H5FL_FREE(H5FD_splitter_fapl_t, fapl); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_fapl_free() */ +} /* end H5FD__splitter_fapl_free() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_open + * Function: H5FD__splitter_open * * Purpose: Create and/or opens a file as an HDF5 file. * @@ -714,123 +662,99 @@ done: *------------------------------------------------------------------------- */ static H5FD_t * -H5FD_splitter_open(const char *name, unsigned flags, hid_t splitter_fapl_id, haddr_t maxaddr) +H5FD__splitter_open(const char *name, unsigned flags, hid_t splitter_fapl_id, haddr_t maxaddr) { H5FD_splitter_t *file_ptr = NULL; /* Splitter VFD info */ const H5FD_splitter_fapl_t *fapl_ptr = NULL; /* Driver-specific property list */ H5P_genplist_t *plist_ptr = NULL; H5FD_t *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_open"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ - if (!name || !*name) { + if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name") - } - if (0 == maxaddr || HADDR_UNDEF == maxaddr) { + if(0 == maxaddr || HADDR_UNDEF == maxaddr) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr") - } - if (ADDR_OVERFLOW(maxaddr)) { + if(ADDR_OVERFLOW(maxaddr)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr") - } - if ( (H5P_FILE_ACCESS_DEFAULT == splitter_fapl_id) || - (H5FD_SPLITTER != H5Pget_driver(splitter_fapl_id)) ) - { + if((H5P_FILE_ACCESS_DEFAULT == splitter_fapl_id) || + (H5FD_SPLITTER != H5Pget_driver(splitter_fapl_id)) ) /* presupposes that H5P_FILE_ACCESS_DEFAULT is not a splitter */ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "driver is not splitter") - } file_ptr = (H5FD_splitter_t *)H5FL_CALLOC(H5FD_splitter_t); - if (NULL == file_ptr) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct") - } + if(NULL == file_ptr) + HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate file struct") file_ptr->fa.rw_fapl_id = H5I_INVALID_HID; file_ptr->fa.wo_fapl_id = H5I_INVALID_HID; /* Get the driver-specific file access properties */ plist_ptr = (H5P_genplist_t *)H5I_object(splitter_fapl_id); - if (NULL == plist_ptr) { + if(NULL == plist_ptr) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") - } fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr); - if (NULL == fapl_ptr) { + if(NULL == fapl_ptr) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "unable to get VFL driver info") - } /* Copy simpler info */ - if (HDstrncpy(file_ptr->fa.wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX) == NULL) { - HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, NULL, "unable to copy write-only path") - } - if (HDstrncpy(file_ptr->fa.log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX) == NULL) { - HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, NULL, "unable to copy logfile path") - } + HDstrncpy(file_ptr->fa.wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX); + HDstrncpy(file_ptr->fa.log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX); file_ptr->fa.ignore_wo_errs = fapl_ptr->ignore_wo_errs; /* Copy R/W and W/O channel FAPLs. */ - if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(file_ptr->fa.rw_fapl_id)) < 0) { + if(H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(file_ptr->fa.rw_fapl_id)) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy R/W FAPL"); - } - if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(file_ptr->fa.wo_fapl_id)) < 0) { + if(H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(file_ptr->fa.wo_fapl_id)) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy W/O FAPL"); - } /* Prepare log file if necessary. * If application wants to ignore the errors from W/O channel and * provided a name for the log file, then open it */ - if (!file_ptr->logfp) { - if (file_ptr->fa.log_file_path[0] != '\0') { + if(!file_ptr->logfp) { + if(file_ptr->fa.log_file_path[0] != '\0') { file_ptr->logfp = HDfopen(file_ptr->fa.log_file_path, "w"); - if (file_ptr->logfp == NULL) { + if(file_ptr->logfp == NULL) HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open log file") - } } /* end if logfile path given */ } /* end if logfile pointer/handle does not exist */ file_ptr->rw_file = H5FD_open(name, flags, fapl_ptr->rw_fapl_id, HADDR_UNDEF); - if (!file_ptr->rw_file) { + if(!file_ptr->rw_file) HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open R/W file") - } file_ptr->wo_file = H5FD_open(fapl_ptr->wo_path, flags, fapl_ptr->wo_fapl_id, HADDR_UNDEF); - if (!file_ptr->wo_file) { - H5FD_SPLITTER_WO_ERROR(file_ptr, "H5FD_splitter_open", - H5E_VFL, H5E_CANTOPENFILE, NULL, - "unable to open W/O file") - } + if(!file_ptr->wo_file) + H5FD_SPLITTER_WO_ERROR(file_ptr, FUNC, H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open W/O file") ret_value = (H5FD_t*)file_ptr; done: - if (NULL == ret_value) { - if (file_ptr) { - if (H5I_INVALID_HID != file_ptr->fa.rw_fapl_id) { + if(NULL == ret_value) { + if(file_ptr) { + if(H5I_INVALID_HID != file_ptr->fa.rw_fapl_id) H5I_dec_ref(file_ptr->fa.rw_fapl_id); - } - if (H5I_INVALID_HID != file_ptr->fa.wo_fapl_id) { + if(H5I_INVALID_HID != file_ptr->fa.wo_fapl_id) H5I_dec_ref(file_ptr->fa.wo_fapl_id); - } - if (file_ptr->rw_file) { + if(file_ptr->rw_file) H5FD_close(file_ptr->rw_file); - } - if (file_ptr->wo_file) { + if(file_ptr->wo_file) H5FD_close(file_ptr->wo_file); - } - if (file_ptr->logfp) { + if(file_ptr->logfp) HDfclose(file_ptr->logfp); - } H5FL_FREE(H5FD_splitter_t, file_ptr); } } /* end if error */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_open() */ +} /* end H5FD__splitter_open() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_close + * Function: H5FD__splitter_close * * Purpose: Closes files on both read-write and write-only channels. * @@ -839,39 +763,31 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_close(H5FD_t *_file) +H5FD__splitter_close(H5FD_t *_file) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_close"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Sanity check */ HDassert(file); - if (H5I_dec_ref(file->fa.rw_fapl_id) < 0) { + if(H5I_dec_ref(file->fa.rw_fapl_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_ARGS, FAIL, "can't close R/W FAPL") - } - if (H5I_dec_ref(file->fa.wo_fapl_id) < 0) { + if(H5I_dec_ref(file->fa.wo_fapl_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_ARGS, FAIL, "can't close W/O FAPL") - } - if (file->rw_file) { - if (H5FD_close(file->rw_file) == FAIL) { + if(file->rw_file) + if(H5FD_close(file->rw_file) == FAIL) HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close R/W file") - } - } - if (file->wo_file) { - if (H5FD_close(file->wo_file) == FAIL) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_close", - H5E_VFL, H5E_CANTCLOSEFILE, FAIL, - "unable to close W/O file") - } - } + if(file->wo_file) + if(H5FD_close(file->wo_file) == FAIL) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close W/O file") - if (file->logfp) { + if(file->logfp) { HDfclose(file->logfp); file->logfp = NULL; } @@ -882,11 +798,11 @@ H5FD_splitter_close(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_close() */ +} /* end H5FD__splitter_close() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_get_eoa + * Function: H5FD__splitter_get_eoa * * Purpose: Returns the end-of-address marker for the file. The EOA * marker is the first address past the last byte allocated in @@ -898,30 +814,29 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5FD_splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file; haddr_t ret_value = HADDR_UNDEF; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_eoa"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Sanity check */ HDassert(file); HDassert(file->rw_file); - if ((ret_value = H5FD_get_eoa(file->rw_file, type)) == HADDR_UNDEF) { + if((ret_value = H5FD_get_eoa(file->rw_file, type)) == HADDR_UNDEF) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, HADDR_UNDEF, "unable to get eoa") - } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_get_eoa */ +} /* end H5FD__splitter_get_eoa */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_set_eoa + * Function: H5FD__splitter_set_eoa * * Purpose: Set the end-of-address marker for the file. This function is * called shortly after an existing HDF5 file is opened in order @@ -931,37 +846,33 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) +H5FD__splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_set_eoa";) + H5FD_SPLITTER_LOG_CALL(FUNC) /* Sanity check */ HDassert(file); HDassert(file->rw_file); HDassert(file->wo_file); - if (H5FD_set_eoa(file->rw_file, type, addr) < 0) { + if(H5FD_set_eoa(file->rw_file, type, addr) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "H5FDset_eoa failed for R/W file") - } - if (H5FD_set_eoa(file->wo_file, type, addr) < 0) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_set_eoa", - H5E_VFL, H5E_CANTSET, FAIL, - "unable to set EOA for W/O file") - } + if(H5FD_set_eoa(file->wo_file, type, addr) < 0) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTSET, FAIL, "unable to set EOA for W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_set_eoa() */ +} /* end H5FD__splitter_set_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_get_eof + * Function: H5FD__splitter_get_eof * * Purpose: Returns the end-of-address marker for the file. The EOA * marker is the first address past the last byte allocated in @@ -973,30 +884,29 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5FD_splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) +H5FD__splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file; haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_eof"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Sanity check */ HDassert(file); HDassert(file->rw_file); - if (HADDR_UNDEF == (ret_value = H5FD_get_eof(file->rw_file, type))) { + if(HADDR_UNDEF == (ret_value = H5FD_get_eof(file->rw_file, type))) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "unable to get eof") - } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_get_eof */ +} /* end H5FD__splitter_get_eof */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_truncate + * Function: H5FD__splitter_truncate * * Purpose: Notify driver to truncate the file back to the allocated size. * @@ -1004,36 +914,32 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) +H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_truncate"); + H5FD_SPLITTER_LOG_CALL(FUNC); HDassert(file); HDassert(file->rw_file); HDassert(file->wo_file); - if (H5FDtruncate(file->rw_file, dxpl_id, closing) < 0) { + if(H5FDtruncate(file->rw_file, dxpl_id, closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "unable to truncate R/W file") - } - if (H5FDtruncate(file->wo_file, dxpl_id, closing) < 0) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_truncate", - H5E_VFL, H5E_CANTUPDATE, FAIL, - "unable to truncate W/O file") - } + if(H5FDtruncate(file->wo_file, dxpl_id, closing) < 0) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTUPDATE, FAIL, "unable to truncate W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_truncate */ +} /* end H5FD__splitter_truncate */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_sb_size + * Function: H5FD__splitter_sb_size * * Purpose: Obtains the number of bytes required to store the driver file * access data in the HDF5 superblock. @@ -1047,29 +953,28 @@ done: *------------------------------------------------------------------------- */ static hsize_t -H5FD_splitter_sb_size(H5FD_t *_file) +H5FD__splitter_sb_size(H5FD_t *_file) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; hsize_t ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_sb_size"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Sanity check */ HDassert(file); HDassert(file->rw_file); - if (file->rw_file) { + if(file->rw_file) ret_value = H5FD_sb_size(file->rw_file); - } FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_sb_size */ +} /* end H5FD__splitter_sb_size */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_sb_encode + * Function: H5FD__splitter_sb_encode * * Purpose: Encode driver-specific data into the output arguments. * @@ -1077,30 +982,29 @@ H5FD_splitter_sb_size(H5FD_t *_file) *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/) +H5FD__splitter_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_sb_encode"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Sanity check */ HDassert(file); HDassert(file->rw_file); - if (file->rw_file && H5FD_sb_encode(file->rw_file, name, buf) < 0) { + if(file->rw_file && H5FD_sb_encode(file->rw_file, name, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTENCODE, FAIL, "unable to encode the superblock in R/W file") - } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_sb_encode */ +} /* end H5FD__splitter_sb_encode */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_sb_decode + * Function: H5FD__splitter_sb_decode * * Purpose: Decodes the driver information block. * @@ -1110,30 +1014,29 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) +H5FD__splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_sb_decode"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Sanity check */ HDassert(file); HDassert(file->rw_file); - if (H5FD_sb_load(file->rw_file, name, buf) < 0) { + if(H5FD_sb_load(file->rw_file, name, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDECODE, FAIL, "unable to decode the superblock in R/W file") - } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_sb_decode */ +} /* end H5FD__splitter_sb_decode */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_cmp + * Function: H5FD__splitter_cmp * * Purpose: Compare the keys of two files. * @@ -1142,15 +1045,15 @@ done: *------------------------------------------------------------------------- */ static int -H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2) +H5FD__splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { const H5FD_splitter_t *f1 = (const H5FD_splitter_t *)_f1; const H5FD_splitter_t *f2 = (const H5FD_splitter_t *)_f2; herr_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_cmp"); + H5FD_SPLITTER_LOG_CALL(FUNC); HDassert(f1); HDassert(f2); @@ -1158,11 +1061,11 @@ H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2) ret_value = H5FD_cmp(f1->rw_file, f2->rw_file); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_cmp */ +} /* end H5FD__splitter_cmp */ /*-------------------------------------------------------------------------- - * Function: H5FD_splitter_get_handle + * Function: H5FD__splitter_get_handle * * Purpose: Returns a pointer to the file handle of low-level virtual * file driver. @@ -1171,17 +1074,15 @@ H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2) *-------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_get_handle( - H5FD_t *_file, - hid_t H5_ATTR_UNUSED fapl, - void **file_handle) +H5FD__splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, + void **file_handle) { H5FD_splitter_t *file = (H5FD_splitter_t*)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_handle"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ HDassert(file); @@ -1189,18 +1090,16 @@ H5FD_splitter_get_handle( HDassert(file_handle); /* Only do for R/W channel */ - if (H5FD_get_vfd_handle(file->rw_file, file->fa.rw_fapl_id, file_handle) < 0) - { + if(H5FD_get_vfd_handle(file->rw_file, file->fa.rw_fapl_id, file_handle) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "unable to get handle of R/W file") - } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_get_handle */ +} /* end H5FD__splitter_get_handle */ /*-------------------------------------------------------------------------- - * Function: H5FD_splitter_lock + * Function: H5FD__splitter_lock * * Purpose: Sets a file lock. * @@ -1208,37 +1107,32 @@ done: *-------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_lock(H5FD_t *_file, hbool_t rw) +H5FD__splitter_lock(H5FD_t *_file, hbool_t rw) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_lock"); + H5FD_SPLITTER_LOG_CALL(FUNC); HDassert(file); HDassert(file->rw_file); /* Place the lock on each file */ - if (H5FD_lock(file->rw_file, rw) < 0) { + if(H5FD_lock(file->rw_file, rw) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTLOCK, FAIL, "unable to lock R/W file") - } - if (file->wo_file != NULL) { - if (H5FD_lock(file->wo_file, rw) < 0) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_lock", - H5E_VFL, H5E_CANTLOCK, FAIL, - "unable to lock W/O file") - } - } + if(file->wo_file != NULL) + if(H5FD_lock(file->wo_file, rw) < 0) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTLOCK, FAIL, "unable to lock W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_lock */ +} /* end H5FD__splitter_lock */ /*-------------------------------------------------------------------------- - * Function: H5FD_splitter_unlock + * Function: H5FD__splitter_unlock * * Purpose: Removes a file lock. * @@ -1246,37 +1140,33 @@ done: *-------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_unlock(H5FD_t *_file) +H5FD__splitter_unlock(H5FD_t *_file) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_unlock"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ HDassert(file); HDassert(file->rw_file); /* Remove the lock on each file */ - if (H5FD_unlock(file->rw_file) < 0) { + if(H5FD_unlock(file->rw_file) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL, "unable to unlock R/W file") - } - if (file->wo_file != NULL) { - if (H5FD_unlock(file->wo_file) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL, - "unable to unlock W/O file") - } - } + if(file->wo_file != NULL) + if(H5FD_unlock(file->wo_file) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL, "unable to unlock W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_unlock */ +} /* end H5FD__splitter_unlock */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_query + * Function: H5FD__splitter_query * * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) @@ -1285,40 +1175,37 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_query(const H5FD_t *_file, unsigned long *flags /* out */) +H5FD__splitter_query(const H5FD_t *_file, unsigned long *flags /* out */) { const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_query"); + H5FD_SPLITTER_LOG_CALL(FUNC); - if (file) { + if(file) { HDassert(file); HDassert(file->rw_file); - if (H5FDquery(file->rw_file, flags) < 0) { - HGOTO_ERROR(H5E_VFL, H5E_CANTLOCK, FAIL, - "unable to query R/W file"); - } + if(H5FDquery(file->rw_file, flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTLOCK, FAIL, "unable to query R/W file"); } else { /* There is no file. Because this is a pure passthrough VFD, * it has no features of its own. */ - if (flags) { + if(flags) *flags = 0; - } } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_query() */ +} /* end H5FD__splitter_query() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_alloc + * Function: H5FD__splitter_alloc * * Purpose: Allocate file memory. * @@ -1326,37 +1213,33 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5FD_splitter_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) +H5FD__splitter_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_alloc"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ HDassert(file); HDassert(file->rw_file); /* Allocate memory for each file, only return the return value for R/W file. */ - if ((ret_value = H5FDalloc(file->rw_file, type, dxpl_id, size)) == HADDR_UNDEF) { + if((ret_value = H5FDalloc(file->rw_file, type, dxpl_id, size)) == HADDR_UNDEF) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate for R/W file") - } - if (H5FDalloc(file->wo_file, type, dxpl_id, size) == HADDR_UNDEF) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_alloc", - H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, - "unable to alloc for W/O file") - } + if(H5FDalloc(file->wo_file, type, dxpl_id, size) == HADDR_UNDEF) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to alloc for W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_alloc() */ +} /* end H5FD__splitter_alloc() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_get_type_map + * Function: H5FD__splitter_get_type_map * * Purpose: Retrieve the memory type mapping for this file * @@ -1364,31 +1247,30 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) +H5FD__splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) { const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_type_map"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ HDassert(file); HDassert(file->rw_file); /* Retrieve memory type mapping for R/W channel only */ - if (H5FD_get_fs_type_map(file->rw_file, type_map) < 0) { + if(H5FD_get_fs_type_map(file->rw_file, type_map) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "unable to allocate for R/W file") - } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_get_type_map() */ +} /* end H5FD__splitter_get_type_map() */ /*------------------------------------------------------------------------- - * Function: H5FD_splitter_free + * Function: H5FD__splitter_free * * Purpose: Free the resources for the splitter VFD. * @@ -1396,32 +1278,28 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size) +H5FD__splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size) { H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL("H5FD_splitter_free"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ HDassert(file); HDassert(file->rw_file); - if (H5FDfree(file->rw_file, type, dxpl_id, addr, size) < 0) { + if(H5FDfree(file->rw_file, type, dxpl_id, addr, size) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free for R/W file") - } - if (H5FDfree(file->wo_file, type, dxpl_id, addr, size) < 0) { - H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_free", - H5E_VFL, H5E_CANTINIT, FAIL, - "unable to free for W/O file") - } + if(H5FDfree(file->wo_file, type, dxpl_id, addr, size) < 0) + H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTINIT, FAIL, "unable to free for W/O file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_splitter_free() */ +} /* end H5FD__splitter_free() */ /*------------------------------------------------------------------------- @@ -1435,33 +1313,29 @@ done: static herr_t H5FD__splitter_log_error(const H5FD_splitter_t *file, const char *atfunc, const char *msg) { - size_t size = 0; - char *s = NULL; herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC_NOERR - H5FD_SPLITTER_LOG_CALL("H5FD__splitter_log_error"); + H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ HDassert(file); HDassert(atfunc && *atfunc); HDassert(msg && *msg); - if (file->logfp != NULL) { - size = strlen(atfunc) + strlen(msg) + 3; /* ':', ' ', '\n' */ - s = (char *)malloc(sizeof(char) * (size+1)); - if (NULL == s) { + if(file->logfp != NULL) { + size_t size; + char *s; + + size = HDstrlen(atfunc) + HDstrlen(msg) + 3; /* ':', ' ', '\n' */ + s = (char *)HDmalloc(sizeof(char) * (size + 1)); + if(NULL == s) ret_value = FAIL; - } - else - if (size < (size_t)HDsnprintf(s, size+1, "%s: %s\n", atfunc, msg)) { + else if(size < (size_t)HDsnprintf(s, size+1, "%s: %s\n", atfunc, msg)) ret_value = FAIL; - } - else - if (size != HDfwrite(s, 1, size, file->logfp)) { + else if(size != HDfwrite(s, 1, size, file->logfp)) ret_value = FAIL; - } HDfree(s); } diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index d29a1b4..1d401c2 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Wednesday, October 22, 1997 * * Purpose: The C STDIO virtual file driver which only uses calls from stdio.h. diff --git a/src/H5FDstdio.h b/src/H5FDstdio.h index f99aacf..9a5bc78 100644 --- a/src/H5FDstdio.h +++ b/src/H5FDstdio.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Purpose: The public header file for the sec2 driver. diff --git a/src/H5FDtest.c b/src/H5FDtest.c index 2eb176d..7afc1bf 100644 --- a/src/H5FDtest.c +++ b/src/H5FDtest.c @@ -110,6 +110,5 @@ H5FD__supports_swmr_test(const char *vfd_name) ret_value = !HDstrcmp(vfd_name, "log") || !HDstrcmp(vfd_name, "sec2"); FUNC_LEAVE_NOAPI(ret_value) - } /* end H5FD__supports_swmr_test() */ diff --git a/src/H5FDwindows.h b/src/H5FDwindows.h index 5cf68a1..5e23712 100644 --- a/src/H5FDwindows.h +++ b/src/H5FDwindows.h @@ -12,8 +12,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Scott Wegner - * Based on code by Robb Matzke + * Programmer: Scott Wegner + * Based on code by Robb Matzke * Thursday, May 24 2007 * * Purpose: The public header file for the windows driver. diff --git a/src/H5FL.c b/src/H5FL.c index 66d27fb..e50616a 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, March 23, 2000 * * Purpose: Manage priority queues of free-lists (of blocks of bytes). diff --git a/src/H5FLmodule.h b/src/H5FLmodule.h index 48b8d2b..dbce75c 100644 --- a/src/H5FLmodule.h +++ b/src/H5FLmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h index 94a51e5..a2c019a 100644 --- a/src/H5FLprivate.h +++ b/src/H5FLprivate.h @@ -15,12 +15,10 @@ * * Created: H5FLprivate.h * Mar 23 2000 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private non-prototype header. * - * Modifications: - * *------------------------------------------------------------------------- */ #ifndef _H5FLprivate_H diff --git a/src/H5FS.c b/src/H5FS.c index 6d574c0..cb60c0e 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 2, 2006 * * Purpose: Free space tracking functions. @@ -787,9 +787,6 @@ H5FS__dirty(H5FS_t *fspace) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE -#ifdef QAK -HDfprintf(stderr, "%s: Marking free space header as dirty\n", FUNC); -#endif /* QAK */ /* Sanity check */ HDassert(fspace); @@ -1206,9 +1203,6 @@ void H5FS__assert(const H5FS_t *fspace) { FUNC_ENTER_PACKAGE_NOERR -#ifdef QAK -HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__assert", fspace->tot_sect_count); -#endif /* QAK */ /* Checks for section info, if it's available */ if(fspace->sinfo) { @@ -1224,9 +1218,6 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__assert", fspace-> HDassert(fspace->tot_sect_count >= fspace->serial_sect_count); HDassert(fspace->tot_sect_count >= fspace->ghost_sect_count); HDassert(fspace->tot_sect_count == (fspace->serial_sect_count + fspace->ghost_sect_count)); -#ifdef QAK - HDassert(fspace->serial_sect_count > 0 || fspace->ghost_sect_count == 0); -#endif /* QAK */ FUNC_LEAVE_NOAPI_VOID } /* end H5FS__assert() */ diff --git a/src/H5FScache.c b/src/H5FScache.c index c3e3998..ed468b4 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -15,7 +15,7 @@ * * Created: H5FScache.c * May 2 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement file free space metadata cache methods. * @@ -163,7 +163,6 @@ const H5AC_class_t H5AC_FSPACE_SINFO[1] = {{ * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -235,7 +234,6 @@ H5FS__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 18 2013 * *------------------------------------------------------------------------- @@ -350,7 +348,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -796,7 +793,6 @@ H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UN * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@lbl.gov * January 3, 2017 * *------------------------------------------------------------------------- @@ -860,7 +856,6 @@ done: * Failure: FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2006 * *------------------------------------------------------------------------- @@ -1032,7 +1027,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l unsigned sect_cnt_size; /* The size of the section size counts */ /* Compute the size of the section counts */ - sect_cnt_size = H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); + sect_cnt_size = H5VM__limit_enc_size((uint64_t)fspace->serial_sect_count); /* Reset the section count, the "add" routine will update it */ old_tot_sect_count = fspace->tot_sect_count; @@ -1132,7 +1127,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14, 2013 * *------------------------------------------------------------------------- @@ -1300,7 +1294,7 @@ H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len, /* Set up user data for iterator */ udata.sinfo = sinfo; udata.image = ℑ - udata.sect_cnt_size = H5VM_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); + udata.sect_cnt_size = H5VM__limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); /* Iterate over all the bins */ for(bin = 0; bin < sinfo->nbins; bin++) diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c index c615b68..9708e9e 100644 --- a/src/H5FSdbg.c +++ b/src/H5FSdbg.c @@ -15,7 +15,7 @@ * * Created: H5FSdbg.c * May 9 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Dump debugging information about a free space manager * diff --git a/src/H5FSint.c b/src/H5FSint.c index 6ba5748..926b818 100644 --- a/src/H5FSint.c +++ b/src/H5FSint.c @@ -15,7 +15,7 @@ * * Created: H5FSint.c * Fall 2012 - * Dana Robinson + * Dana Robinson * * Purpose: Internal routines for free space managers. * diff --git a/src/H5FSmodule.h b/src/H5FSmodule.h index b2869dd..88c663b 100644 --- a/src/H5FSmodule.h +++ b/src/H5FSmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index 2c56ab6..0cc328e 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 2, 2006 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h index d2e1f90..e02a8e2 100644 --- a/src/H5FSprivate.h +++ b/src/H5FSprivate.h @@ -15,7 +15,7 @@ * * Created: H5FSprivate.h * May 2 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private header for library accessible file free space routines. * diff --git a/src/H5FSsection.c b/src/H5FSsection.c index d783901..269f63c 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, July 31, 2006 * * Purpose: Free space tracking functions. @@ -144,10 +144,10 @@ HDfprintf(stderr, "%s: fspace->addr = %a\n", FUNC, fspace->addr); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Set non-zero values */ - sinfo->nbins = H5VM_log2_gen(fspace->max_sect_size); + sinfo->nbins = H5VM__log2_gen(fspace->max_sect_size); sinfo->sect_prefix_size = H5FS_SINFO_PREFIX_SIZE(f); sinfo->sect_off_size = (fspace->max_sect_addr + 7) / 8; - sinfo->sect_len_size = H5VM_limit_enc_size((uint64_t)fspace->max_sect_size); + sinfo->sect_len_size = H5VM__limit_enc_size((uint64_t)fspace->max_sect_size); #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: fspace->max_sect_size = %Hu\n", FUNC, fspace->max_sect_size); HDfprintf(stderr, "%s: fspace->max_sect_addr = %u\n", FUNC, fspace->max_sect_addr); @@ -518,12 +518,6 @@ H5FS__sect_serialize_size(H5FS_t *fspace) /* Check arguments. */ HDassert(fspace); -#ifdef QAK -HDfprintf(stderr, "%s: Check 1.0 - fspace->sect_size = %Hu\n", "H5FS__sect_serialize_size", fspace->sect_size); -HDfprintf(stderr, "%s: fspace->serial_sect_count = %Zu\n", "H5FS__sect_serialize_size", fspace->serial_sect_count); -HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu\n", "H5FS__sect_serialize_size", fspace->alloc_sect_size); -HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS__sect_serialize_size", fspace->sinfo->serial_size_count); -#endif /* QAK */ /* Compute the size of the buffer required to serialize all the sections */ if(fspace->serial_sect_count > 0) { @@ -533,11 +527,7 @@ HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS__sect_se sect_buf_size = fspace->sinfo->sect_prefix_size; /* Count for each differently sized serializable section */ -#ifdef QAK -HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS__sect_serialize_size", fspace->sinfo->serial_size_count); -HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", "H5FS__sect_serialize_size", fspace->serial_sect_count); -#endif /* QAK */ - sect_buf_size += fspace->sinfo->serial_size_count * H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); + sect_buf_size += fspace->sinfo->serial_size_count * H5VM__limit_enc_size((uint64_t)fspace->serial_sect_count); /* Size for each differently sized serializable section */ sect_buf_size += fspace->sinfo->serial_size_count * fspace->sinfo->sect_len_size; @@ -604,10 +594,6 @@ H5FS__sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls, fspace->serial_sect_count++; /* Increment amount of space required to serialize all sections */ -#ifdef QAK -HDfprintf(stderr, "%s: sinfo->serial_size = %Zu\n", FUNC, fspace->sinfo->serial_size); -HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size); -#endif /* QAK */ fspace->sinfo->serial_size += cls->serial_size; /* Update the free space sections' serialized size */ @@ -664,10 +650,6 @@ H5FS__sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls) fspace->serial_sect_count--; /* Decrement amount of space required to serialize all sections */ -#ifdef QAK -HDfprintf(stderr, "%s: fspace->serial_size = %Zu\n", FUNC, fspace->sinfo->serial_size); -HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size); -#endif /* QAK */ fspace->sinfo->serial_size -= cls->serial_size; /* Update the free space sections' serialized size */ @@ -710,9 +692,6 @@ H5FS__size_node_decr(H5FS_sinfo_t *sinfo, unsigned bin, H5FS_node_t *fspace_node * the bin's skiplist is also a skiplist...) */ sinfo->bins[bin].tot_sect_count--; -#ifdef QAK -HDfprintf(stderr, "%s: sinfo->bins[%u].sect_count = %Zu\n", FUNC, bin, sinfo->bins[bin].sect_count); -#endif /* QAK */ /* Check for 'ghost' or 'serializable' section */ if(cls->flags & H5FS_CLS_GHOST_OBJ) { @@ -798,7 +777,7 @@ H5FS__sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, HDassert(cls); /* Determine correct bin which holds items of at least the section's size */ - bin = H5VM_log2_gen(sect->size); + bin = H5VM__log2_gen(sect->size); HDassert(bin < sinfo->nbins); if(sinfo->bins[bin].bin_list == NULL) HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "node's bin is empty?") @@ -853,9 +832,6 @@ H5FS__sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, if(!(cls->flags & H5FS_CLS_SEPAR_OBJ)) { H5FS_section_info_t *tmp_sect_node; /* Temporary section node */ -#ifdef QAK -HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC, (unsigned)sect->type); -#endif /* QAK */ tmp_sect_node = (H5FS_section_info_t *)H5SL_remove(fspace->sinfo->merge_list, §->addr); if(tmp_sect_node == NULL || tmp_sect_node != sect) HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "can't find section node on size list") @@ -866,9 +842,6 @@ HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't increase free space section size on disk") /* Decrement amount of free space managed */ -#ifdef QAK -HDfprintf(stderr, "%s: fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); -#endif /* QAK */ fspace->tot_space -= sect->size; done: @@ -982,9 +955,6 @@ H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC -#ifdef QAK -HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, sect->addr); -#endif /* QAK */ /* Check arguments. */ HDassert(sinfo); @@ -993,16 +963,15 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, s HDassert(sect->size); /* Determine correct bin which holds items of the section's size */ - bin = H5VM_log2_gen(sect->size); + bin = H5VM__log2_gen(sect->size); HDassert(bin < sinfo->nbins); if(sinfo->bins[bin].bin_list == NULL) { if(NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for free space nodes") } /* end if */ - else { + else /* Check for node list of the correct size already */ fspace_node = (H5FS_node_t *)H5SL_search(sinfo->bins[bin].bin_list, §->size); - } /* end else */ /* Check if we need to create a new skip list for nodes of this size */ if(fspace_node == NULL) { @@ -1030,9 +999,6 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, s /* (Different from the # of items in the bin's skiplist, since each node on * the bin's skiplist is also a skiplist...) */ -#ifdef QAK -HDfprintf(stderr, "%s: sinfo->bins[%u].sect_count = %Zu\n", FUNC, bin, sinfo->bins[bin].sect_count); -#endif /* QAK */ sinfo->bins[bin].tot_sect_count++; if(cls->flags & H5FS_CLS_GHOST_OBJ) { sinfo->bins[bin].ghost_sect_count++; @@ -1095,9 +1061,6 @@ H5FS__sect_link_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, /* Add section to the address-ordered list of sections, if allowed */ if(!(cls->flags & H5FS_CLS_SEPAR_OBJ)) { -#ifdef QAK -HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUNC, (unsigned)sect->type); -#endif /* QAK */ if(fspace->sinfo->merge_list == NULL) if(NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, NULL))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for merging free space sections") @@ -1146,21 +1109,12 @@ H5FS__sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags) cls = &fspace->sect_cls[sect->type]; /* Add section to size tracked data structures */ -#ifdef QAK -HDfprintf(stderr, "%s: Check 1.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); -#endif /* QAK */ if(H5FS__sect_link_size(fspace->sinfo, cls, sect) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't add section to size tracking data structures") -#ifdef QAK -HDfprintf(stderr, "%s: Check 2.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); -#endif /* QAK */ /* Update rest of free space manager data structures for section addition */ if(H5FS__sect_link_rest(fspace, cls, sect, flags) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't add section to non-size tracking data structures") -#ifdef QAK -HDfprintf(stderr, "%s: Check 3.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); -#endif /* QAK */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1304,9 +1258,6 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) } while(modified); } /* end if */ HDassert(*sect); -#ifdef QAK -HDfprintf(stderr, "%s: Done merging, (*sect) = {%a, %Hu, %u, %s}\n", FUNC, (*sect)->addr, (*sect)->size, (*sect)->type, ((*sect)->state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED")); -#endif /* QAK */ /* Loop until no more shrinking */ do { @@ -1319,10 +1270,6 @@ HDfprintf(stderr, "%s: Done merging, (*sect) = {%a, %Hu, %u, %s}\n", FUNC, (*sec if((status = (*sect_cls->can_shrink)(*sect, op_data)) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't check for shrinking container") if(status > 0) { -#ifdef QAK -HDfprintf(stderr, "%s: Can shrink!\n", FUNC); -#endif /* QAK */ - /* Remove SECT from free-space manager */ /* (only possible to happen on second+ pass through loop) */ if(remove_sect) { @@ -1365,18 +1312,7 @@ HDfprintf(stderr, "%s: Can shrink!\n", FUNC); if(remove_sect && (*sect != NULL)) *sect = NULL; -#ifdef QAK -HDfprintf(stderr, "%s: Done shrinking\n", FUNC); -if(*sect) - HDfprintf(stderr, "%s: (*sect) = {%a, %Hu, %u, %s}\n", FUNC, (*sect)->addr, (*sect)->size, (*sect)->type, ((*sect)->state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED")); -else - HDfprintf(stderr, "%s: *sect = %p\n", FUNC, *sect); -#endif /* QAK */ - done: -#ifdef QAK -HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); -#endif /* QAK */ FUNC_LEAVE_NOAPI(ret_value) } /* H5FS__sect_merge() */ @@ -1704,12 +1640,8 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node HDassert(node); /* Determine correct bin which holds items of at least the section's size */ - bin = H5VM_log2_gen(request); + bin = H5VM__log2_gen(request); HDassert(bin < fspace->sinfo->nbins); -#ifdef QAK -HDfprintf(stderr, "%s: fspace->sinfo->nbins = %u\n", FUNC, fspace->sinfo->nbins); -HDfprintf(stderr, "%s: bin = %u\n", FUNC, bin); -#endif /* QAK */ alignment = fspace->alignment; if(!((alignment > 1) && (request >= fspace->align_thres))) alignment = 0; /* no alignment */ @@ -1841,10 +1773,6 @@ H5FS_sect_find(H5F_t *f, H5FS_t *fspace, hsize_t request, H5FS_section_info_t ** FUNC_ENTER_NOAPI(FAIL) -#ifdef QAK -HDfprintf(stderr, "%s: request = %Hu\n", FUNC, request); -#endif /* QAK */ - /* Check arguments. */ HDassert(fspace); HDassert(fspace->nclasses); @@ -1852,11 +1780,6 @@ HDfprintf(stderr, "%s: request = %Hu\n", FUNC, request); HDassert(node); /* Check for any sections on free space list */ -#ifdef QAK -HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_count); -HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", FUNC, fspace->serial_sect_count); -HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_sect_count); -#endif /* QAK */ if(fspace->tot_sect_count > 0) { /* Get a pointer to the section info */ if(H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) @@ -1871,9 +1794,6 @@ HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_se if(ret_value > 0) { /* Note that we've modified the section info */ sinfo_modified = TRUE; -#ifdef QAK -HDfprintf(stderr, "%s: (*node)->size = %Hu, (*node)->addr = %a, (*node)->type = %u\n", FUNC, (*node)->size, (*node)->addr, (*node)->type); -#endif /* QAK */ } /* end if */ } /* end if */ @@ -1890,7 +1810,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FS_iterate_sect_cb + * Function: H5FS__iterate_sect_cb * * Purpose: Skip list iterator callback to iterate over free space sections * of a particular size @@ -1903,13 +1823,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_iterate_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) +H5FS__iterate_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) { H5FS_section_info_t *sect_info = (H5FS_section_info_t *)_item; /* Free space section to work on */ H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect_info); @@ -1922,11 +1842,11 @@ H5FS_iterate_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_iterate_sect_cb() */ +} /* H5FS__iterate_sect_cb() */ /*------------------------------------------------------------------------- - * Function: H5FS_iterate_node_cb + * Function: H5FS__iterate_node_cb * * Purpose: Skip list iterator callback to iterate over free space sections * in a bin @@ -1939,13 +1859,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_iterate_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) +H5FS__iterate_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) { H5FS_node_t *fspace_node = (H5FS_node_t *)_item; /* Free space size node to work on */ H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(fspace_node); @@ -1954,12 +1874,12 @@ H5FS_iterate_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) /* Iterate through all the sections of this size */ HDassert(fspace_node->sect_list); - if(H5SL_iterate(fspace_node->sect_list, H5FS_iterate_sect_cb, udata) < 0) + if(H5SL_iterate(fspace_node->sect_list, H5FS__iterate_sect_cb, udata) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section nodes") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_iterate_node_cb() */ +} /* H5FS__iterate_node_cb() */ /*------------------------------------------------------------------------- @@ -1987,10 +1907,6 @@ H5FS_sect_iterate(H5F_t *f, H5FS_t *fspace, H5FS_operator_t op, void *op_data) HDassert(fspace); HDassert(op); -#ifdef QAK -HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_count); -#endif /* QAK */ - /* Set up user data for iterator */ udata.fspace = fspace; udata.op = op; @@ -2006,14 +1922,11 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_c sinfo_valid = TRUE; /* Iterate over all the bins */ -#ifdef QAK -HDfprintf(stderr, "%s: Iterate over section bins\n", FUNC); -#endif /* QAK */ for(bin = 0; bin < fspace->sinfo->nbins; bin++) { /* Check if there are any sections in this bin */ if(fspace->sinfo->bins[bin].bin_list) { /* Iterate over list of section size nodes for bin */ - if(H5SL_iterate(fspace->sinfo->bins[bin].bin_list, H5FS_iterate_node_cb, &udata) < 0) + if(H5SL_iterate(fspace->sinfo->bins[bin].bin_list, H5FS__iterate_node_cb, &udata) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section size nodes") } /* end if */ } /* end for */ @@ -2098,10 +2011,6 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, old_class = sect->type; old_cls = &fspace->sect_cls[sect->type]; new_cls = &fspace->sect_cls[new_class]; -#ifdef QAK -HDfprintf(stderr, "%s: old_cls->flags = %x\n", FUNC, old_cls->flags); -HDfprintf(stderr, "%s: new_cls->flags = %x\n", FUNC, new_cls->flags); -#endif /* QAK */ /* Check if the section's class change will affect the # of serializable or ghost sections */ if((old_cls->flags & H5FS_CLS_GHOST_OBJ) != (new_cls->flags & H5FS_CLS_GHOST_OBJ)) { @@ -2114,15 +2023,12 @@ HDfprintf(stderr, "%s: new_cls->flags = %x\n", FUNC, new_cls->flags); to_ghost = FALSE; else to_ghost = TRUE; -#ifdef QAK -HDfprintf(stderr, "%s: to_ghost = %u\n", FUNC, to_ghost); -#endif /* QAK */ /* Sanity check */ HDassert(fspace->sinfo->bins); /* Determine correct bin which holds items of at least the section's size */ - bin = H5VM_log2_gen(sect->size); + bin = H5VM__log2_gen(sect->size); HDassert(bin < fspace->sinfo->nbins); HDassert(fspace->sinfo->bins[bin].bin_list); @@ -2180,15 +2086,9 @@ HDfprintf(stderr, "%s: to_ghost = %u\n", FUNC, to_ghost); to_mergable = TRUE; else to_mergable = FALSE; -#ifdef QAK -HDfprintf(stderr, "%s: to_mergable = %u\n", FUNC, to_mergable); -#endif /* QAK */ /* Add or remove section from merge list, as appropriate */ if(to_mergable) { -#ifdef QAK -HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUNC, (unsigned)sect->type); -#endif /* QAK */ if(fspace->sinfo->merge_list == NULL) if(NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, NULL))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for merging free space sections") @@ -2198,9 +2098,6 @@ HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUN else { H5FS_section_info_t *tmp_sect_node; /* Temporary section node */ -#ifdef QAK -HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC, (unsigned)sect->type); -#endif /* QAK */ tmp_sect_node = (H5FS_section_info_t *)H5SL_remove(fspace->sinfo->merge_list, §->addr); if(tmp_sect_node == NULL || tmp_sect_node != sect) HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "can't find section node on size list") @@ -2246,9 +2143,6 @@ H5FS__sect_assert(const H5FS_t *fspace) hsize_t separate_obj; /* The number of separate objects managed */ FUNC_ENTER_PACKAGE_NOERR -#ifdef QAK -HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__sect_assert", fspace->tot_sect_count); -#endif /* QAK */ /* Initialize state */ separate_obj = 0; @@ -2305,9 +2199,6 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__sect_assert", fsp /* Get section node & it's class */ sect = (H5FS_section_info_t *)H5SL_item(curr_sect_node); cls = &fspace->sect_cls[sect->type]; -#ifdef QAK -HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", "H5FS__sect_assert", sect->size, sect->addr, sect->type); -#endif /* QAK */ /* Sanity check section */ HDassert(H5F_addr_defined(sect->addr)); diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 74a170b..5ad7634 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -15,7 +15,7 @@ * * Created: H5Faccum.c * Jan 10 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: File metadata "accumulator" routines. (Used to * cache small metadata I/Os and group them into a @@ -105,7 +105,6 @@ H5FL_BLK_DEFINE_STATIC(meta_accum); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 10 2008 * *------------------------------------------------------------------------- @@ -154,7 +153,7 @@ H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t new_alloc_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(new_size - 1))); + new_alloc_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(new_size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_alloc_size))) @@ -274,7 +273,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 11 2009 * *------------------------------------------------------------------------- @@ -298,7 +296,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, H5FD_t *file, size_t new_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)((size + accum->size) - 1))); + new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)((size + accum->size) - 1))); /* Check for accumulator getting too big */ if(new_size > H5F_ACCUM_MAX_SIZE) { @@ -413,7 +411,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 10 2008 * *------------------------------------------------------------------------- @@ -612,7 +609,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t new_alloc_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); + new_alloc_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_alloc_size))) @@ -656,7 +653,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t clear_size; /* Size of memory that needs clearing */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); + new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1))); /* Grow the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_size))) @@ -704,7 +701,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t new_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); + new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_size))) @@ -841,7 +838,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 10 2008 * *------------------------------------------------------------------------- @@ -1007,7 +1003,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 10 2008 * *------------------------------------------------------------------------- @@ -1050,7 +1045,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 10 2008 * *------------------------------------------------------------------------- diff --git a/src/H5Fcwfs.c b/src/H5Fcwfs.c index 26452b6..2b368d5 100644 --- a/src/H5Fcwfs.c +++ b/src/H5Fcwfs.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 19, 2011 * * Purpose: Each file has a small cache of global heap collections called diff --git a/src/H5Fdbg.c b/src/H5Fdbg.c index 535b43d..09f6829 100644 --- a/src/H5Fdbg.c +++ b/src/H5Fdbg.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Wednesday, July 9, 2003 * * Purpose: File object debugging functions. @@ -39,7 +39,6 @@ * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 1 1997 * *------------------------------------------------------------------------- diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index a047161..76a0991 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -15,7 +15,7 @@ * * Created: H5Fdeprec.c * October 1 2009 - * Quincey Koziol + * Quincey Koziol * * Purpose: Deprecated functions from the H5F interface. These * functions are here for compatibility purposes and may be diff --git a/src/H5Fefc.c b/src/H5Fefc.c index 77d29f5..c9a3a00 100644 --- a/src/H5Fefc.c +++ b/src/H5Fefc.c @@ -15,7 +15,7 @@ * * Created: H5Defc.c * December 13, 2010 - * Neil Fortner + * Neil Fortner * * Purpose: External file caching routines - implements a * cache of external files to minimize the number of diff --git a/src/H5Ffake.c b/src/H5Ffake.c index 67bd180..36fea5b 100644 --- a/src/H5Ffake.c +++ b/src/H5Ffake.c @@ -34,7 +34,6 @@ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 2, 2006 * *------------------------------------------------------------------------- @@ -79,7 +78,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 2, 2006 * *------------------------------------------------------------------------- diff --git a/src/H5Fint.c b/src/H5Fint.c index 0bda894..f206199 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1854,7 +1854,7 @@ H5F__post_open(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F__flush() */ +} /* end H5F__post_open() */ /*------------------------------------------------------------------------- diff --git a/src/H5Fio.c b/src/H5Fio.c index 34dd0d6..7a901aa 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -15,7 +15,7 @@ * * Created: H5Fio.c * Jan 10 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: File I/O routines. * @@ -86,7 +86,6 @@ * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 10 1997 * *------------------------------------------------------------------------- @@ -130,7 +129,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 10 1997 * *------------------------------------------------------------------------- @@ -175,7 +173,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 10 1997 * *------------------------------------------------------------------------- @@ -220,7 +217,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 10 1997 * *------------------------------------------------------------------------- diff --git a/src/H5Fmodule.h b/src/H5Fmodule.h index 0481512..fb362fc 100644 --- a/src/H5Fmodule.h +++ b/src/H5Fmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Fmount.c b/src/H5Fmount.c index 5e6b899..9d32fa5 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -627,7 +627,7 @@ H5F__mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs) /*------------------------------------------------------------------------- - * Function: H5F_flush_mounts_recurse + * Function: H5F__flush_mounts_recurse * * Purpose: Flush a mount hierarchy, recursively * @@ -639,20 +639,20 @@ H5F__mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs) *------------------------------------------------------------------------- */ static herr_t -H5F_flush_mounts_recurse(H5F_t *f) +H5F__flush_mounts_recurse(H5F_t *f) { unsigned nerrors = 0; /* Errors from recursive flushes */ unsigned u; /* Index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); /* Flush all child files, not stopping for errors */ for(u = 0; u < f->shared->mtab.nmounts; u++) - if(H5F_flush_mounts_recurse(f->shared->mtab.child[u].file) < 0) + if(H5F__flush_mounts_recurse(f->shared->mtab.child[u].file) < 0) nerrors++; /* Call the "real" flush routine, for this file */ @@ -665,7 +665,7 @@ H5F_flush_mounts_recurse(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_flush_mounts_recurse() */ +} /* end H5F__flush_mounts_recurse() */ /*------------------------------------------------------------------------- @@ -695,7 +695,7 @@ H5F_flush_mounts(H5F_t *f) f = f->parent; /* Flush the mounted file hierarchy */ - if(H5F_flush_mounts_recurse(f) < 0) + if(H5F__flush_mounts_recurse(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy") done: diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 0c46f59..8189821 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -15,7 +15,7 @@ * * Created: H5Fmpi.c * Jan 10 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: MPI-related routines. * diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 46185ff..fe58fdb 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 28, 2000 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index c5d4c89..1cfd103 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -116,16 +116,16 @@ typedef struct H5F_t H5F_t; /* Encode a 64-bit unsigned integer and its length into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ # define UINT64ENCODE_VARLEN(p, n) { \ - uint64_t __n = (uint64_t)(n); \ - unsigned _s = H5VM_limit_enc_size(__n); \ - \ - *(p)++ = (uint8_t)_s; \ - UINT64ENCODE_VAR(p, __n, _s); \ + uint64_t __n = (uint64_t)(n); \ + unsigned _s = H5VM__limit_enc_size(__n); \ + \ + *(p)++ = (uint8_t)_s; \ + UINT64ENCODE_VAR(p, __n, _s); \ } # define H5_ENCODE_UNSIGNED(p, n) { \ - HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ - UINT32ENCODE(p, n) \ + HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ + UINT32ENCODE(p, n) \ } /* Assumes the endianness of uint64_t is the same as double */ diff --git a/src/H5Fquery.c b/src/H5Fquery.c index e1b11c8..565f492 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -15,7 +15,7 @@ * * Created: H5Fquery.c * Jan 10 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: File structure query routines. * @@ -763,7 +763,6 @@ H5F_sieve_buf_size(const H5F_t *f) * Failure: (should not happen) * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jul 8 2005 * *------------------------------------------------------------------------- diff --git a/src/H5Fspace.c b/src/H5Fspace.c index 6baf163..3d969f9 100644 --- a/src/H5Fspace.c +++ b/src/H5Fspace.c @@ -15,7 +15,7 @@ * * Created: H5Fspace.c * Dec 30 2013 - * Quincey Koziol + * Quincey Koziol * * Purpose: Space allocation routines for the file. * diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 9fd2831..cf3f72a 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -318,7 +318,6 @@ done: * Failure: FAIL * * Programmer: Bill Wendling - * wendling@ncsa.uiuc.edu * Sept 12, 2003 * *------------------------------------------------------------------------- @@ -896,8 +895,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension") } else { - if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0) - { + if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0) { #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ f->shared->sblock = NULL; #endif /* JRM */ @@ -1067,7 +1065,6 @@ done: * Failure: FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sept 15, 2003 * *------------------------------------------------------------------------- diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 119548c..329bf21 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -15,7 +15,7 @@ * * Created: H5Fsuper_cache.c * Aug 15 2009 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement file superblock & driver info metadata cache methods. * @@ -309,7 +309,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 17, 2013 * *------------------------------------------------------------------------- @@ -338,7 +337,6 @@ H5F__cache_superblock_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * November 17, 2016 * *------------------------------------------------------------------------- @@ -428,7 +426,6 @@ H5F__cache_superblock_verify_chksum(const void *_image, size_t len, void *_udata * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 18 2013 * *------------------------------------------------------------------------- @@ -621,7 +618,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 19, 2013 * *------------------------------------------------------------------------- @@ -654,7 +650,6 @@ H5F__cache_superblock_image_len(const void *_thing, size_t *image_len) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 19 2013 * *------------------------------------------------------------------------- @@ -798,7 +793,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 20, 2013 * *------------------------------------------------------------------------- @@ -833,7 +827,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 20, 2013 * *------------------------------------------------------------------------- @@ -861,7 +854,6 @@ H5F__cache_drvrinfo_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *i * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * November 17, 2016 * *------------------------------------------------------------------------- @@ -905,7 +897,6 @@ done: * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 20 2013 * *------------------------------------------------------------------------- @@ -966,7 +957,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 20, 2013 * *------------------------------------------------------------------------- @@ -1000,7 +990,6 @@ H5F__cache_drvrinfo_image_len(const void *_thing, size_t *image_len) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 20 2013 * *------------------------------------------------------------------------- @@ -1064,7 +1053,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 20, 2013 * *------------------------------------------------------------------------- diff --git a/src/H5Ftest.c b/src/H5Ftest.c index 49a2a22..97c7e3e 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -15,7 +15,7 @@ * * Created: H5Ftest.c * Jan 3 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: File testing routines. * diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index 71e0b2d..918e18c 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -15,7 +15,7 @@ * * Created: H5Gbtree2.c * Sep 9 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: v2 B-tree callbacks for indexing fields on links * @@ -75,27 +75,27 @@ typedef struct H5G_fh_ud_cmp_t { /* v2 B-tree function callbacks */ /* v2 B-tree driver callbacks for 'creation order' index */ -static herr_t H5G_dense_btree2_corder_store(void *native, const void *udata); -static herr_t H5G_dense_btree2_corder_compare(const void *rec1, const void *rec2, int *result); -static herr_t H5G_dense_btree2_corder_encode(uint8_t *raw, const void *native, +static herr_t H5G__dense_btree2_corder_store(void *native, const void *udata); +static herr_t H5G__dense_btree2_corder_compare(const void *rec1, const void *rec2, int *result); +static herr_t H5G__dense_btree2_corder_encode(uint8_t *raw, const void *native, void *ctx); -static herr_t H5G_dense_btree2_corder_decode(const uint8_t *raw, void *native, +static herr_t H5G__dense_btree2_corder_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, +static herr_t H5G__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *record, const void *_udata); /* v2 B-tree driver callbacks for 'name' index */ -static herr_t H5G_dense_btree2_name_store(void *native, const void *udata); +static herr_t H5G__dense_btree2_name_store(void *native, const void *udata); static herr_t H5G__dense_btree2_name_compare(const void *rec1, const void *rec2, int *result); -static herr_t H5G_dense_btree2_name_encode(uint8_t *raw, const void *native, +static herr_t H5G__dense_btree2_name_encode(uint8_t *raw, const void *native, void *ctx); -static herr_t H5G_dense_btree2_name_decode(const uint8_t *raw, void *native, +static herr_t H5G__dense_btree2_name_decode(const uint8_t *raw, void *native, void *ctx); -static herr_t H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, +static herr_t H5G__dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *record, const void *_udata); /* Fractal heap function callbacks */ -static herr_t H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data); +static herr_t H5G__dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data); /*********************/ @@ -108,11 +108,11 @@ const H5B2_class_t H5G_BT2_NAME[1]={{ /* B-tree class information */ sizeof(H5G_dense_bt2_name_rec_t), /* Size of native record */ NULL, /* Create client callback context */ NULL, /* Destroy client callback context */ - H5G_dense_btree2_name_store, /* Record storage callback */ - H5G__dense_btree2_name_compare, /* Record comparison callback */ - H5G_dense_btree2_name_encode, /* Record encoding callback */ - H5G_dense_btree2_name_decode, /* Record decoding callback */ - H5G_dense_btree2_name_debug /* Record debugging callback */ + H5G__dense_btree2_name_store, /* Record storage callback */ + H5G__dense_btree2_name_compare, /* Record comparison callback */ + H5G__dense_btree2_name_encode, /* Record encoding callback */ + H5G__dense_btree2_name_decode, /* Record decoding callback */ + H5G__dense_btree2_name_debug /* Record debugging callback */ }}; /* v2 B-tree class for indexing 'creation order' field of links */ @@ -122,11 +122,11 @@ const H5B2_class_t H5G_BT2_CORDER[1]={{ /* B-tree class information */ sizeof(H5G_dense_bt2_corder_rec_t), /* Size of native record */ NULL, /* Create client callback context */ NULL, /* Destroy client callback context */ - H5G_dense_btree2_corder_store, /* Record storage callback */ - H5G_dense_btree2_corder_compare, /* Record comparison callback */ - H5G_dense_btree2_corder_encode, /* Record encoding callback */ - H5G_dense_btree2_corder_decode, /* Record decoding callback */ - H5G_dense_btree2_corder_debug /* Record debugging callback */ + H5G__dense_btree2_corder_store, /* Record storage callback */ + H5G__dense_btree2_corder_compare, /* Record comparison callback */ + H5G__dense_btree2_corder_encode, /* Record encoding callback */ + H5G__dense_btree2_corder_decode, /* Record decoding callback */ + H5G__dense_btree2_corder_debug /* Record debugging callback */ }}; /*****************************/ @@ -141,7 +141,7 @@ const H5B2_class_t H5G_BT2_CORDER[1]={{ /* B-tree class information */ /*------------------------------------------------------------------------- - * Function: H5G_dense_fh_name_cmp + * Function: H5G__dense_fh_name_cmp * * Purpose: Compares the name of a link in a fractal heap to another * name @@ -149,19 +149,18 @@ const H5B2_class_t H5G_BT2_CORDER[1]={{ /* B-tree class information */ * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata) +H5G__dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_cmp_t *udata = (H5G_fh_ud_cmp_t *)_udata; /* User data for 'op' callback */ H5O_link_t *lnk; /* Pointer to link created from heap object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information */ if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) @@ -181,11 +180,11 @@ H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_fh_name_cmp() */ +} /* end H5G__dense_fh_name_cmp() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_name_store + * Function: H5G__dense_btree2_name_store * * Purpose: Store user information into native record for v2 B-tree * @@ -198,19 +197,19 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_store(void *_nrecord, const void *_udata) +H5G__dense_btree2_name_store(void *_nrecord, const void *_udata) { const H5G_bt2_ud_ins_t *udata = (const H5G_bt2_ud_ins_t *)_udata; H5G_dense_bt2_name_rec_t *nrecord = (H5G_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Copy user information info native record */ nrecord->hash = udata->common.name_hash; H5MM_memcpy(nrecord->id, udata->id, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_name_store() */ +} /* H5G__dense_btree2_name_store() */ /*------------------------------------------------------------------------- @@ -240,16 +239,6 @@ H5G__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int HDassert(bt2_udata); HDassert(bt2_rec); -#ifdef QAK -{ -unsigned u; - -HDfprintf(stderr, "%s: bt2_udata = {'%s', %x}\n", "H5G__dense_btree2_name_compare", bt2_udata->name, (unsigned)bt2_udata->name_hash); -HDfprintf(stderr, "%s: bt2_rec = {%x, ", "H5G__dense_btree2_name_compare", (unsigned)bt2_rec->hash); -for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) - HDfprintf(stderr, "%02x%s", bt2_rec->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n")); -} -#endif /* QAK */ /* Check hash value */ if(bt2_udata->name_hash < bt2_rec->hash) *result = (-1); @@ -272,7 +261,7 @@ for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) fh_udata.cmp = 0; /* Check if the user's link and the B-tree's link have the same name */ - if(H5HF_op(bt2_udata->fheap, bt2_rec->id, H5G_dense_fh_name_cmp, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, bt2_rec->id, H5G__dense_fh_name_cmp, &fh_udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") /* Callback will set comparison value */ @@ -285,7 +274,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_name_encode + * Function: H5G__dense_btree2_name_encode * * Purpose: Encode native information into raw form for storing on disk * @@ -298,22 +287,22 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) +H5G__dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) { const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Encode the record's fields */ UINT32ENCODE(raw, nrecord->hash) H5MM_memcpy(raw, nrecord->id, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_name_encode() */ +} /* H5G__dense_btree2_name_encode() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_name_decode + * Function: H5G__dense_btree2_name_decode * * Purpose: Decode raw disk form of record into native form * @@ -326,22 +315,22 @@ H5G_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UN *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) +H5G__dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) { H5G_dense_bt2_name_rec_t *nrecord = (H5G_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Decode the record's fields */ UINT32DECODE(raw, nrecord->hash) H5MM_memcpy(nrecord->id, raw, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_name_decode() */ +} /* H5G__dense_btree2_name_decode() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_name_debug + * Function: H5G__dense_btree2_name_debug * * Purpose: Debug native form of record * @@ -354,13 +343,13 @@ H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UN *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, +H5G__dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *_nrecord, const void H5_ATTR_UNUSED *_udata) { const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord; unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDfprintf(stream, "%*s%-*s {%x, ", indent, "", fwidth, "Record:", (unsigned)nrecord->hash); @@ -368,11 +357,11 @@ H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, HDfprintf(stderr, "%02x%s", nrecord->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n")); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_name_debug() */ +} /* H5G__dense_btree2_name_debug() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_corder_store + * Function: H5G__dense_btree2_corder_store * * Purpose: Store user information into native record for v2 B-tree * @@ -385,23 +374,23 @@ H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_store(void *_nrecord, const void *_udata) +H5G__dense_btree2_corder_store(void *_nrecord, const void *_udata) { const H5G_bt2_ud_ins_t *udata = (const H5G_bt2_ud_ins_t *)_udata; H5G_dense_bt2_corder_rec_t *nrecord = (H5G_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Copy user information info native record */ nrecord->corder = udata->common.corder; H5MM_memcpy(nrecord->id, udata->id, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_corder_store() */ +} /* H5G__dense_btree2_corder_store() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_corder_compare + * Function: H5G__dense_btree2_corder_compare * * Purpose: Compare two native information records, according to some key * @@ -415,27 +404,17 @@ H5G_dense_btree2_corder_store(void *_nrecord, const void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, int *result) +H5G__dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, int *result) { const H5G_bt2_ud_common_t *bt2_udata = (const H5G_bt2_ud_common_t *)_bt2_udata; const H5G_dense_bt2_corder_rec_t *bt2_rec = (const H5G_dense_bt2_corder_rec_t *)_bt2_rec; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(bt2_udata); HDassert(bt2_rec); -#ifdef QAK -{ -unsigned u; - -HDfprintf(stderr, "%s: bt2_udata->corder = %Hd\n", "H5G_dense_btree2_corder_compare", (hsize_t)bt2_udata->corder); -HDfprintf(stderr, "%s: bt2_rec = {%Hu, ", "H5G_dense_btree2_corder_compare", (hsize_t)bt2_rec->corder); -for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) - HDfprintf(stderr, "%02x%s", bt2_rec->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n")); -} -#endif /* QAK */ /* Check creation order value */ if(bt2_udata->corder < bt2_rec->corder) *result = -1; @@ -445,11 +424,11 @@ for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) *result = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_corder_compare() */ +} /* H5G__dense_btree2_corder_compare() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_corder_encode + * Function: H5G__dense_btree2_corder_encode * * Purpose: Encode native information into raw form for storing on disk * @@ -462,22 +441,22 @@ for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) +H5G__dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx) { const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Encode the record's fields */ INT64ENCODE(raw, nrecord->corder) H5MM_memcpy(raw, nrecord->id, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_corder_encode() */ +} /* H5G__dense_btree2_corder_encode() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_corder_decode + * Function: H5G__dense_btree2_corder_decode * * Purpose: Decode raw disk form of record into native form * @@ -490,22 +469,22 @@ H5G_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_ *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) +H5G__dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx) { H5G_dense_bt2_corder_rec_t *nrecord = (H5G_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Decode the record's fields */ INT64DECODE(raw, nrecord->corder) H5MM_memcpy(nrecord->id, raw, (size_t)H5G_DENSE_FHEAP_ID_LEN); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_corder_decode() */ +} /* H5G__dense_btree2_corder_decode() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_btree2_corder_debug + * Function: H5G__dense_btree2_corder_debug * * Purpose: Debug native form of record * @@ -518,13 +497,13 @@ H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_ *------------------------------------------------------------------------- */ static herr_t -H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, +H5G__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *_nrecord, const void H5_ATTR_UNUSED *_udata) { const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord; unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDfprintf(stream, "%*s%-*s {%llu, ", indent, "", fwidth, "Record:", (unsigned long long)nrecord->corder); @@ -532,5 +511,5 @@ H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, HDfprintf(stderr, "%02x%s", nrecord->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n")); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_dense_btree2_corder_debug() */ +} /* H5G__dense_btree2_corder_debug() */ diff --git a/src/H5Gcache.c b/src/H5Gcache.c index 13a33a3..22b0488 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -15,7 +15,7 @@ * * Created: H5Gcache.c * Feb 5 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement group metadata cache methods. * diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c index 1a76012..d14ec20 100644 --- a/src/H5Gcompact.c +++ b/src/H5Gcompact.c @@ -15,7 +15,7 @@ * * Created: H5Gcompact.c * Sep 5 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Functions for handling compact storage. * @@ -75,7 +75,6 @@ static herr_t H5G__compact_lookup_cb(const void *_mesg, unsigned H5_ATTR_UNUSED * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 5 2005 * *------------------------------------------------------------------------- @@ -178,7 +177,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 6 2005 * *------------------------------------------------------------------------- @@ -257,7 +255,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_compact_remove_common_cb + * Function: H5G__compact_remove_common_cb * * Purpose: Common callback routine for deleting 'link' message for a * particular name. @@ -265,19 +263,18 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 5 2005 * *------------------------------------------------------------------------- */ static herr_t -H5G_compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata) +H5G__compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata) { const H5O_link_t *lnk = (const H5O_link_t *)_mesg; /* Pointer to link */ H5G_iter_rm_t *udata = (H5G_iter_rm_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ HDassert(lnk); @@ -295,7 +292,7 @@ H5G_compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, voi done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_compact_remove_common_cb() */ +} /* end H5G__compact_remove_common_cb() */ /*------------------------------------------------------------------------- @@ -328,7 +325,7 @@ H5G__compact_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, udata.name = name; /* Iterate over the link messages to delete the right one */ - if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE) < 0) + if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G__compact_remove_common_cb, &udata, TRUE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link message") done: @@ -376,7 +373,7 @@ H5G__compact_remove_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, udata.name = ltable.lnks[n].name; /* Iterate over the link messages to delete the right one */ - if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE) < 0) + if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G__compact_remove_common_cb, &udata, TRUE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link message") done: @@ -441,7 +438,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 20 2005 * *------------------------------------------------------------------------- @@ -487,7 +483,6 @@ done: * Return: Non-negative (TRUE/FALSE) on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 20 2005 * *------------------------------------------------------------------------- @@ -533,7 +528,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 6 2006 * *------------------------------------------------------------------------- diff --git a/src/H5Gdense.c b/src/H5Gdense.c index a2ef55c..8545d73 100644 --- a/src/H5Gdense.c +++ b/src/H5Gdense.c @@ -15,7 +15,7 @@ * * Created: H5Gdense.c * Sep 9 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Routines for operating on "dense" link storage for a * group in a file. @@ -250,7 +250,6 @@ typedef struct { * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 9 2006 * *------------------------------------------------------------------------- @@ -294,17 +293,11 @@ H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline) /* Retrieve the heap's address in the file */ if(H5HF_get_heap_addr(fheap, &(linfo->fheap_addr)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get fractal heap address") -#ifdef QAK -HDfprintf(stderr, "%s: linfo->fheap_addr = %a\n", FUNC, linfo->fheap_addr); -#endif /* QAK */ /* Retrieve the heap's ID length in the file */ if(H5HF_get_id_len(fheap, &fheap_id_len) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length") HDassert(fheap_id_len == H5G_DENSE_FHEAP_ID_LEN); -#ifdef QAK -HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); -#endif /* QAK */ /* Create the name index v2 B-tree */ HDmemset(&bt2_cparam, 0, sizeof(bt2_cparam)); @@ -321,9 +314,6 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); /* Retrieve the v2 B-tree's address in the file */ if(H5B2_get_addr(bt2_name, &(linfo->name_bt2_addr)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get v2 B-tree address for name index") -#ifdef QAK -HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr); -#endif /* QAK */ /* Check if we should create a creation order index v2 B-tree */ if(linfo->index_corder) { @@ -342,9 +332,6 @@ HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr) /* Retrieve the v2 B-tree's address in the file */ if(H5B2_get_addr(bt2_corder, &(linfo->corder_bt2_addr)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get v2 B-tree address for creation order index") -#ifdef QAK -HDfprintf(stderr, "%s: linfo->corder_bt2_addr = %a\n", FUNC, linfo->corder_bt2_addr); -#endif /* QAK */ } /* end if */ done: @@ -368,7 +355,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- @@ -394,17 +380,10 @@ H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, const H5O_link_t *lnk) HDassert(f); HDassert(linfo); HDassert(lnk); -#ifdef QAK -HDfprintf(stderr, "%s: linfo->fheap_addr = %a\n", FUNC, linfo->fheap_addr); -HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr); -#endif /* QAK */ /* Find out the size of buffer needed for serialized link */ if((link_size = H5O_msg_raw_size(f, H5O_LINK_ID, FALSE, lnk)) == 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get link size") -#ifdef QAK -HDfprintf(stderr, "%s: HDstrlen(lnk->name) = %Zu, link_size = %Zu\n", FUNC, HDstrlen(lnk->name), link_size); -#endif /* QAK */ /* Wrap the local buffer for serialized link */ if(NULL == (wb = H5WB_wrap(link_buf, sizeof(link_buf)))) @@ -472,26 +451,25 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_lookup_cb + * Function: H5G__dense_lookup_cb * * Purpose: Callback when a link is located in an index * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_lookup_cb(const void *_lnk, void *_user_lnk) +H5G__dense_lookup_cb(const void *_lnk, void *_user_lnk) { const H5O_link_t *lnk = (const H5O_link_t *)_lnk; /* Record from B-tree */ H5O_link_t *user_lnk = (H5O_link_t *)_user_lnk; /* User data from v2 B-tree link lookup */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -505,7 +483,7 @@ H5G_dense_lookup_cb(const void *_lnk, void *_user_lnk) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_lookup_cb() */ +} /* end H5G__dense_lookup_cb() */ /*------------------------------------------------------------------------- @@ -516,7 +494,6 @@ done: * Return: Non-negative (TRUE/FALSE) on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- @@ -553,7 +530,7 @@ H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, const char *name, udata.fheap = fheap; udata.name = name; udata.name_hash = H5_checksum_lookup3(name, HDstrlen(name), 0); - udata.found_op = H5G_dense_lookup_cb; /* v2 B-tree comparison callback */ + udata.found_op = H5G__dense_lookup_cb; /* v2 B-tree comparison callback */ udata.found_op_data = lnk; /* Find & copy the named link in the 'name' index */ @@ -572,7 +549,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_lookup_by_idx_fh_cb + * Function: H5G__dense_lookup_by_idx_fh_cb * * Purpose: Callback for fractal heap operator, to make copy of link when * when lookup up a link by index @@ -580,19 +557,18 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 7 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5G__dense_lookup_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_lbi_t *udata = (H5G_fh_ud_lbi_t *)_udata; /* User data for fractal heap 'op' callback */ H5O_link_t *tmp_lnk = NULL; /* Temporary pointer to link */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information & keep a copy */ if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) @@ -608,31 +584,30 @@ done: H5O_msg_free(H5O_LINK_ID, tmp_lnk); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_lookup_by_idx_fh_cb() */ +} /* end H5G__dense_lookup_by_idx_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_lookup_by_idx_bt2_cb + * Function: H5G__dense_lookup_by_idx_bt2_cb * * Purpose: v2 B-tree callback for dense link storage lookup by index * * Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 7 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata) +H5G__dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata) { const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record; H5G_bt2_ud_lbi_t *bt2_udata = (H5G_bt2_ud_lbi_t *)_bt2_udata; /* User data for callback */ H5G_fh_ud_lbi_t fh_udata; /* User data for fractal heap 'op' callback */ int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Prepare user data for callback */ /* down */ @@ -640,12 +615,12 @@ H5G_dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata) fh_udata.lnk = bt2_udata->lnk; /* Call fractal heap 'op' routine, to copy the link information */ - if(H5HF_op(bt2_udata->fheap, record->id, H5G_dense_lookup_by_idx_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, record->id, H5G__dense_lookup_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, H5_ITER_ERROR, "link found callback failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_lookup_by_idx_bt2_cb() */ +} /* end H5G__dense_lookup_by_idx_bt2_cb() */ /*------------------------------------------------------------------------- @@ -657,7 +632,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 7 2006 * *------------------------------------------------------------------------- @@ -727,7 +701,7 @@ H5G__dense_lookup_by_idx(H5F_t *f, const H5O_linfo_t *linfo, udata.lnk = lnk; /* Find & copy the link in the appropriate index */ - if(H5B2_index(bt2, order, n, H5G_dense_lookup_by_idx_bt2_cb, &udata) < 0) + if(H5B2_index(bt2, order, n, H5G__dense_lookup_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to locate link in index") } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ @@ -758,7 +732,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_build_table_cb + * Function: H5G__dense_build_table_cb * * Purpose: Callback routine for building table of links from dense * link storage. @@ -767,18 +741,17 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sept 25 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_build_table_cb(const H5O_link_t *lnk, void *_udata) +H5G__dense_build_table_cb(const H5O_link_t *lnk, void *_udata) { H5G_dense_bt_ud_t *udata = (H5G_dense_bt_ud_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ HDassert(lnk); @@ -794,7 +767,7 @@ H5G_dense_build_table_cb(const H5O_link_t *lnk, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_build_table_cb() */ +} /* end H5G__dense_build_table_cb() */ /*------------------------------------------------------------------------- @@ -843,7 +816,7 @@ H5G__dense_build_table(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, udata.curr_lnk = 0; /* Iterate over the links in the group, building a table of the link messages */ - if(H5G__dense_iterate(f, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_dense_build_table_cb, &udata) < 0) + if(H5G__dense_iterate(f, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G__dense_build_table_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links") /* Sort link table in correct iteration order */ @@ -859,7 +832,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_iterate_fh_cb + * Function: H5G__dense_iterate_fh_cb * * Purpose: Callback for fractal heap operator, to make user's callback * when iterating over links @@ -867,18 +840,17 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5G__dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_it_t *udata = (H5G_fh_ud_it_t *)_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information & keep a copy */ /* (we make a copy instead of calling the user/library callback directly in @@ -892,30 +864,29 @@ H5G_dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_iterate_fh_cb() */ +} /* end H5G__dense_iterate_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_iterate_bt2_cb + * Function: H5G__dense_iterate_bt2_cb * * Purpose: v2 B-tree callback for dense link storage iterator * * Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) +H5G__dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) { const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record; H5G_bt2_ud_it_t *bt2_udata = (H5G_bt2_ud_it_t *)_bt2_udata; /* User data for callback */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check for skipping links */ if(bt2_udata->skip > 0) @@ -928,7 +899,7 @@ H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) fh_udata.f = bt2_udata->f; /* Call fractal heap 'op' routine, to copy the link information */ - if(H5HF_op(bt2_udata->fheap, record->id, H5G_dense_iterate_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, record->id, H5G__dense_iterate_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, H5_ITER_ERROR, "heap op callback failed") /* Make the callback */ @@ -948,7 +919,7 @@ H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_iterate_bt2_cb() */ +} /* end H5G__dense_iterate_bt2_cb() */ /*------------------------------------------------------------------------- @@ -959,14 +930,14 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ herr_t H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, - H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data) + H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, + void *op_data) { H5HF_t *fheap = NULL; /* Fractal heap handle */ H5G_link_table_t ltable = {0, NULL}; /* Table of links */ @@ -1036,7 +1007,7 @@ H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, /* Iterate over the records in the v2 B-tree's "native" order */ /* (by hash of name) */ - if((ret_value = H5B2_iterate(bt2, H5G_dense_iterate_bt2_cb, &udata)) < 0) + if((ret_value = H5B2_iterate(bt2, H5G__dense_iterate_bt2_cb, &udata)) < 0) HERROR(H5E_SYM, H5E_BADITER, "link iteration failed"); /* Update the last link examined, if requested */ @@ -1067,7 +1038,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_get_name_by_idx_fh_cb + * Function: H5G__dense_get_name_by_idx_fh_cb * * Purpose: Callback for fractal heap operator, to retrieve name according * to an index @@ -1075,19 +1046,18 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 19 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5G__dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_gnbi_t *udata = (H5G_fh_ud_gnbi_t *)_udata; /* User data for fractal heap 'op' callback */ H5O_link_t *lnk; /* Pointer to link created from heap object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information */ if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) @@ -1108,31 +1078,30 @@ H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_get_name_by_idx_fh_cb() */ +} /* end H5G__dense_get_name_by_idx_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_get_name_by_idx_bt2_cb + * Function: H5G__dense_get_name_by_idx_bt2_cb * * Purpose: v2 B-tree callback for dense link storage 'get name by idx' call * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 19 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata) +H5G__dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata) { const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record; H5G_bt2_ud_gnbi_t *bt2_udata = (H5G_bt2_ud_gnbi_t *)_bt2_udata; /* User data for callback */ H5G_fh_ud_gnbi_t fh_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Prepare user data for callback */ /* down */ @@ -1141,7 +1110,7 @@ H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata) fh_udata.name_size = bt2_udata->name_size; /* Call fractal heap 'op' routine, to perform user callback */ - if(H5HF_op(bt2_udata->fheap, record->id, H5G_dense_get_name_by_idx_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, record->id, H5G__dense_get_name_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link found callback failed") /* Set the name's full length to return */ @@ -1149,7 +1118,7 @@ H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_get_name_by_idx_bt2_cb() */ +} /* end H5G__dense_get_name_by_idx_bt2_cb() */ /*------------------------------------------------------------------------- @@ -1161,7 +1130,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 19 2006 * *------------------------------------------------------------------------- @@ -1231,7 +1199,7 @@ H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, H5_index_t idx_type, udata.name_size = size; /* Retrieve the name according to the v2 B-tree's index order */ - if(H5B2_index(bt2, order, n, H5G_dense_get_name_by_idx_bt2_cb, &udata) < 0) + if(H5B2_index(bt2, order, n, H5G__dense_get_name_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLIST, FAIL, "can't locate object in v2 B-tree") /* Set return value */ @@ -1271,27 +1239,26 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_remove_fh_cb + * Function: H5G__dense_remove_fh_cb * * Purpose: Callback for fractal heap operator when removing links * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 12 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5G__dense_remove_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_rm_t *udata = (H5G_fh_ud_rm_t *)_udata; /* User data for fractal heap 'op' callback */ H5O_link_t *lnk = NULL; /* Pointer to link created from heap object */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information */ if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) @@ -1332,31 +1299,30 @@ done: H5O_msg_free(H5O_LINK_ID, lnk); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_remove_fh_cb() */ +} /* end H5G__dense_remove_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_remove_bt2_cb + * Function: H5G__dense_remove_bt2_cb * * Purpose: v2 B-tree callback for dense link storage record removal * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 12 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata) +H5G__dense_remove_bt2_cb(const void *_record, void *_bt2_udata) { const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record; H5G_bt2_ud_rm_t *bt2_udata = (H5G_bt2_ud_rm_t *)_bt2_udata; /* User data for callback */ H5G_fh_ud_rm_t fh_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set up the user data for fractal heap 'op' callback */ fh_udata.f = bt2_udata->common.f; @@ -1365,7 +1331,7 @@ H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata) fh_udata.replace_names = bt2_udata->replace_names; /* Call fractal heap 'op' routine, to perform user callback */ - if(H5HF_op(bt2_udata->common.fheap, record->id, H5G_dense_remove_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->common.fheap, record->id, H5G__dense_remove_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link removal callback failed") /* Remove record from fractal heap, if requested */ @@ -1375,7 +1341,7 @@ H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_remove_bt2_cb() */ +} /* end H5G__dense_remove_bt2_cb() */ /*------------------------------------------------------------------------- @@ -1386,7 +1352,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 12 2006 * *------------------------------------------------------------------------- @@ -1430,7 +1395,7 @@ H5G__dense_remove(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_ udata.replace_names = TRUE; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove(bt2, &udata, H5G_dense_remove_bt2_cb, &udata) < 0) + if(H5B2_remove(bt2, &udata, H5G__dense_remove_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from name index v2 B-tree") done: @@ -1445,25 +1410,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_remove_by_idx_fh_cb + * Function: H5G__dense_remove_by_idx_fh_cb * * Purpose: Callback for fractal heap operator when removing links by index * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 15 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5G__dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5G_fh_ud_rmbi_t *udata = (H5G_fh_ud_rmbi_t *)_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Decode link information */ if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj))) @@ -1473,24 +1437,23 @@ H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_remove_by_idx_fh_cb() */ +} /* end H5G__dense_remove_by_idx_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_remove_by_idx_bt2_cb + * Function: H5G__dense_remove_by_idx_bt2_cb * * Purpose: v2 B-tree callback for dense link storage record removal by index * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 15 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) +H5G__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) { H5G_bt2_ud_rmbi_t *bt2_udata = (H5G_bt2_ud_rmbi_t *)_bt2_udata; /* User data for callback */ H5G_fh_ud_rmbi_t fh_udata; /* User data for fractal heap 'op' callback */ @@ -1498,7 +1461,7 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) const uint8_t *heap_id; /* Heap ID for link */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Determine the index being used */ if(bt2_udata->idx_type == H5_INDEX_NAME) { @@ -1521,7 +1484,7 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) fh_udata.lnk = NULL; /* Call fractal heap 'op' routine, to perform user callback */ - if(H5HF_op(bt2_udata->fheap, heap_id, H5G_dense_remove_by_idx_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, heap_id, H5G__dense_remove_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link removal callback failed") HDassert(fh_udata.lnk); @@ -1579,7 +1542,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for 'other' index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_remove_by_idx_bt2_cb() */ +} /* end H5G__dense_remove_by_idx_bt2_cb() */ /*------------------------------------------------------------------------- @@ -1591,7 +1554,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 14 2006 * *------------------------------------------------------------------------- @@ -1662,7 +1624,7 @@ H5G__dense_remove_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_ful udata.grp_full_path_r = grp_full_path_r; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove_by_idx(bt2, order, n, H5G_dense_remove_by_idx_bt2_cb, &udata) < 0) + if(H5B2_remove_by_idx(bt2, order, n, H5G__dense_remove_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from indexed v2 B-tree") } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ @@ -1700,7 +1662,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 12 2006 * *------------------------------------------------------------------------- @@ -1743,7 +1704,7 @@ H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link) udata.replace_names = FALSE; /* Delete the name index, adjusting the ref. count on links removed */ - if(H5B2_delete(f, linfo->name_bt2_addr, NULL, H5G_dense_remove_bt2_cb, &udata) < 0) + if(H5B2_delete(f, linfo->name_bt2_addr, NULL, H5G__dense_remove_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for name index") /* Close the fractal heap */ diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 126456b..1d85eb7 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -15,7 +15,7 @@ * * Created: H5Gdeprec.c * June 21 2006 - * James Laird + * James Laird * * Purpose: Deprecated functions from the H5G interface. These * functions are here for compatibility purposes and may be @@ -986,7 +986,7 @@ H5G__get_objinfo_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, c H5G_trav_goi_t *udata = (H5G_trav_goi_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC; + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(lnk == NULL && obj_loc == NULL) @@ -1082,7 +1082,7 @@ H5G__get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, HDassert(name && *name); /* Reset stat buffer */ - if (statbuf) + if(statbuf) HDmemset(statbuf, 0, sizeof(H5G_stat_t)); /* Set up user data for retrieving information */ @@ -1091,11 +1091,11 @@ H5G__get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, udata.loc_file = loc->oloc->file; /* Traverse the group hierarchy to locate the object to get info about */ - if (H5G_traverse(loc, name, (unsigned)(follow_link ? H5G_TARGET_NORMAL : (H5G_TARGET_SLINK | H5G_TARGET_UDLINK)), H5G__get_objinfo_cb, &udata) < 0) + if(H5G_traverse(loc, name, (unsigned)(follow_link ? H5G_TARGET_NORMAL : (H5G_TARGET_SLINK | H5G_TARGET_UDLINK)), H5G__get_objinfo_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "name doesn't exist"); /* If we're pointing at a soft or UD link, get the real link length and type */ - if (statbuf && follow_link == 0) { + if(statbuf && follow_link == 0) { H5L_info2_t linfo; /* Link information buffer */ herr_t ret; diff --git a/src/H5Gent.c b/src/H5Gent.c index 19aef10..632ffa0 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, September 19, 1997 */ @@ -86,7 +86,6 @@ H5FL_BLK_EXTERN(str_buf); * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 18 1997 * *------------------------------------------------------------------------- @@ -128,7 +127,6 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 18 1997 * *------------------------------------------------------------------------- @@ -194,7 +192,6 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 18 1997 * *------------------------------------------------------------------------- @@ -234,7 +231,6 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 18 1997 * *------------------------------------------------------------------------- @@ -306,7 +302,6 @@ done: * Failure: Negative * * Programmer: Pedro Vicente - * pvn@ncsa.uiuc.edu * ???day, August ??, 2002 * * Notes: 'depth' parameter determines how much of the group entry @@ -385,7 +380,6 @@ H5G__ent_reset(H5G_entry_t *ent) * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 20 2005 * *------------------------------------------------------------------------- @@ -530,7 +524,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 29 1997 * *------------------------------------------------------------------------- diff --git a/src/H5Gint.c b/src/H5Gint.c index 0f9f9cb..c3c8719 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -15,7 +15,7 @@ * * Created: H5Gint.c * April 5 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: General use, "internal" routines for groups. * @@ -88,6 +88,7 @@ typedef struct { /********************/ static herr_t H5G__open_oid(H5G_t *grp); +static herr_t H5G__visit_cb(const H5O_link_t *lnk, void *_udata); /*********************/ @@ -179,7 +180,6 @@ done: * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 11 1997 * *------------------------------------------------------------------------- @@ -719,7 +719,7 @@ H5G_unmount(H5G_t *grp) /*------------------------------------------------------------------------- - * Function: H5G_iterate_cb + * Function: H5G__iterate_cb * * Purpose: Callback function for iterating over links in a group * @@ -732,12 +732,12 @@ H5G_unmount(H5G_t *grp) *------------------------------------------------------------------------- */ static herr_t -H5G_iterate_cb(const H5O_link_t *lnk, void *_udata) +H5G__iterate_cb(const H5O_link_t *lnk, void *_udata) { H5G_iter_appcall_ud_t *udata = (H5G_iter_appcall_ud_t *)_udata; /* User data for callback */ herr_t ret_value = H5_ITER_ERROR; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(lnk); @@ -770,7 +770,7 @@ H5G_iterate_cb(const H5O_link_t *lnk, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_iterate_cb() */ +} /* end H5G__iterate_cb() */ /*------------------------------------------------------------------------- @@ -818,7 +818,7 @@ H5G_iterate(H5G_loc_t *loc, const char *group_name, udata.op_data = op_data; /* Call the real group iteration routine */ - if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, skip, last_lnk, H5G_iterate_cb, &udata)) < 0) + if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, skip, last_lnk, H5G__iterate_cb, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "error iterating over links") done: @@ -835,7 +835,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_free_visit_visited + * Function: H5G__free_visit_visited * * Purpose: Free the key for an object visited during a group traversal * @@ -847,18 +847,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *operator_data/*in,out*/) +H5G__free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *operator_data/*in,out*/) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR item = H5FL_FREE(H5_obj_t, item); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_free_visit_visited() */ +} /* end H5G__free_visit_visited() */ /*------------------------------------------------------------------------- - * Function: H5G_visit_cb + * Function: H5G__visit_cb * * Purpose: Callback function for recursively visiting links from a group * @@ -871,7 +871,7 @@ H5G_free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *------------------------------------------------------------------------- */ static herr_t -H5G_visit_cb(const H5O_link_t *lnk, void *_udata) +H5G__visit_cb(const H5O_link_t *lnk, void *_udata) { H5G_iter_visit_ud_t *udata = (H5G_iter_visit_ud_t *)_udata; /* User data for callback */ H5L_info2_t info; /* Link info */ @@ -884,7 +884,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata) size_t len_needed; /* Length of path string needed */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(lnk); @@ -998,7 +998,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata) udata->curr_loc = &obj_loc; /* Iterate over links in group */ - ret_value = H5G__obj_iterate(&obj_oloc, idx_type, udata->order, (hsize_t)0, NULL, H5G_visit_cb, udata); + ret_value = H5G__obj_iterate(&obj_oloc, idx_type, udata->order, (hsize_t)0, NULL, H5G__visit_cb, udata); /* Restore location */ udata->curr_loc = old_loc; @@ -1016,7 +1016,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_visit_cb() */ +} /* end H5G__visit_cb() */ /*------------------------------------------------------------------------- @@ -1140,14 +1140,14 @@ H5G_visit(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, } /* end if */ /* Call the link iteration routine */ - if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, (hsize_t)0, NULL, H5G_visit_cb, &udata)) < 0) + if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, (hsize_t)0, NULL, H5G__visit_cb, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't visit links") done: /* Release user data resources */ H5MM_xfree(udata.path); if(udata.visited) - H5SL_destroy(udata.visited, H5G_free_visit_visited, NULL); + H5SL_destroy(udata.visited, H5G__free_visit_visited, NULL); /* Release the group opened */ if(gid != H5I_INVALID_HID) { diff --git a/src/H5Glink.c b/src/H5Glink.c index cbe5307..8b8377a 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -63,10 +63,10 @@ /* Local Prototypes */ /********************/ -static int H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2); -static int H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2); -static int H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2); -static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2); +static int H5G__link_cmp_name_inc(const void *lnk1, const void *lnk2); +static int H5G__link_cmp_name_dec(const void *lnk1, const void *lnk2); +static int H5G__link_cmp_corder_inc(const void *lnk1, const void *lnk2); +static int H5G__link_cmp_corder_dec(const void *lnk1, const void *lnk2); /*********************/ @@ -86,7 +86,7 @@ static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2); /*------------------------------------------------------------------------- - * Function: H5G_link_cmp_name_inc + * Function: H5G__link_cmp_name_inc * * Purpose: Callback routine for comparing two link names, in * increasing alphabetic order @@ -103,16 +103,16 @@ static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2); *------------------------------------------------------------------------- */ static int -H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2) +H5G__link_cmp_name_inc(const void *lnk1, const void *lnk2) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(HDstrcmp(((const H5O_link_t *)lnk1)->name, ((const H5O_link_t *)lnk2)->name)) -} /* end H5G_link_cmp_name_inc() */ +} /* end H5G__link_cmp_name_inc() */ /*------------------------------------------------------------------------- - * Function: H5G_link_cmp_name_dec + * Function: H5G__link_cmp_name_dec * * Purpose: Callback routine for comparing two link names, in * decreasing alphabetic order @@ -129,16 +129,16 @@ H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2) *------------------------------------------------------------------------- */ static int -H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2) +H5G__link_cmp_name_dec(const void *lnk1, const void *lnk2) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(HDstrcmp(((const H5O_link_t *)lnk2)->name, ((const H5O_link_t *)lnk1)->name)) -} /* end H5G_link_cmp_name_dec() */ +} /* end H5G__link_cmp_name_dec() */ /*------------------------------------------------------------------------- - * Function: H5G_link_cmp_corder_inc + * Function: H5G__link_cmp_corder_inc * * Purpose: Callback routine for comparing two link creation orders, in * increasing order @@ -154,11 +154,11 @@ H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2) *------------------------------------------------------------------------- */ static int -H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2) +H5G__link_cmp_corder_inc(const void *lnk1, const void *lnk2) { int ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(((const H5O_link_t *)lnk1)->corder < ((const H5O_link_t *)lnk2)->corder) ret_value = -1; @@ -168,11 +168,11 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2) ret_value = 0; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_link_cmp_corder_inc() */ +} /* end H5G__link_cmp_corder_inc() */ /*------------------------------------------------------------------------- - * Function: H5G_link_cmp_corder_dec + * Function: H5G__link_cmp_corder_dec * * Purpose: Callback routine for comparing two link creation orders, in * decreasing order @@ -188,11 +188,11 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2) *------------------------------------------------------------------------- */ static int -H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2) +H5G__link_cmp_corder_dec(const void *lnk1, const void *lnk2) { int ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(((const H5O_link_t *)lnk1)->corder < ((const H5O_link_t *)lnk2)->corder) ret_value = 1; @@ -202,7 +202,7 @@ H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2) ret_value = 0; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_link_cmp_corder_dec() */ +} /* end H5G__link_cmp_corder_dec() */ /*------------------------------------------------------------------------- @@ -434,18 +434,18 @@ H5G__link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type, /* Pick appropriate sorting routine */ if(idx_type == H5_INDEX_NAME) { if(order == H5_ITER_INC) - HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_name_inc); + HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_name_inc); else if(order == H5_ITER_DEC) - HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_name_dec); + HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_name_dec); else HDassert(order == H5_ITER_NATIVE); } /* end if */ else { HDassert(idx_type == H5_INDEX_CRT_ORDER); if(order == H5_ITER_INC) - HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_corder_inc); + HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_corder_inc); else if(order == H5_ITER_DEC) - HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_corder_dec); + HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_corder_dec); else HDassert(order == H5_ITER_NATIVE); } /* end else */ diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 2461c51..3109b49 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -621,7 +621,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_loc_exists_cb + * Function: H5G__loc_exists_cb * * Purpose: Callback for checking if an object exists * @@ -633,13 +633,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, +H5G__loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_exists_t *udata = (H5G_loc_exists_t *)_udata; /* User data passed in */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check if the name in this group resolved to a valid object */ if(obj_loc == NULL) @@ -655,7 +655,7 @@ H5G_loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UN *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_loc_exists_cb() */ +} /* end H5G__loc_exists_cb() */ /*------------------------------------------------------------------------- @@ -687,7 +687,7 @@ H5G_loc_exists(const H5G_loc_t *loc, const char *name) udata.exists = FALSE; /* Traverse group hierarchy to locate object */ - if(H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G_loc_exists_cb, &udata) < 0) + if(H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G__loc_exists_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't check if object exists") /* Set return value */ diff --git a/src/H5Gmodule.h b/src/H5Gmodule.h index 19ea982..883aa6d 100644 --- a/src/H5Gmodule.h +++ b/src/H5Gmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Gname.c b/src/H5Gname.c index e1004de..95b85b4 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -81,14 +81,14 @@ typedef struct H5G_gnba_iter_t { /* Local Prototypes */ /********************/ -static htri_t H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r); -static H5RS_str_t *H5G_build_fullpath(const char *prefix, const char *name); +static htri_t H5G__common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r); +static H5RS_str_t *H5G__build_fullpath(const char *prefix, const char *name); #ifdef NOT_YET -static H5RS_str_t *H5G_build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *name_r); +static H5RS_str_t *H5G__build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *name_r); #endif /* NOT_YET */ -static herr_t H5G_name_move_path(H5RS_str_t **path_r_ptr, +static herr_t H5G__name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char *src_path, const char *dst_path); -static int H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key); +static int H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key); /*********************/ @@ -208,7 +208,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_common_path + * Function: H5G__common_path * * Purpose: Determine if one path is a valid prefix of another path * @@ -222,14 +222,14 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) +H5G__common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) { const char *fullpath; /* Pointer to actual fullpath string */ const char *prefix; /* Pointer to actual prefix string */ size_t nchars1,nchars2; /* Number of characters in components */ htri_t ret_value=FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Get component of each name */ fullpath=H5RS_get_str(fullpath_r); @@ -270,11 +270,11 @@ H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_common_path() */ +} /* end H5G__common_path() */ /*------------------------------------------------------------------------- - * Function: H5G_build_fullpath + * Function: H5G__build_fullpath * * Purpose: Build a full path from a prefix & base pair of strings * @@ -287,7 +287,7 @@ done: *------------------------------------------------------------------------- */ static H5RS_str_t * -H5G_build_fullpath(const char *prefix, const char *name) +H5G__build_fullpath(const char *prefix, const char *name) { char *full_path; /* Full user path built */ size_t orig_path_len; /* Original length of the path */ @@ -296,7 +296,7 @@ H5G_build_fullpath(const char *prefix, const char *name) unsigned need_sep; /* Flag to indicate if separator is needed */ H5RS_str_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(prefix); @@ -331,7 +331,7 @@ H5G_build_fullpath(const char *prefix, const char *name) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_build_fullpath() */ +} /* end H5G__build_fullpath() */ /*------------------------------------------------------------------------- @@ -363,7 +363,7 @@ H5G_build_fullpath_refstr_str(H5RS_str_t *prefix_r, const char *name) HDassert(prefix); /* Create reference counted string for path */ - ret_value = H5G_build_fullpath(prefix, name); + ret_value = H5G__build_fullpath(prefix, name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_build_fullpath_refstr_str() */ @@ -385,13 +385,13 @@ H5G_build_fullpath_refstr_str(H5RS_str_t *prefix_r, const char *name) *------------------------------------------------------------------------- */ static H5RS_str_t * -H5G_build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *name_r) +H5G__build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *name_r) { const char *prefix; /* Pointer to raw string of prefix */ const char *name; /* Pointer to raw string of name */ H5RS_str_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Get the pointer to the prefix */ prefix = H5RS_get_str(prefix_r); @@ -400,10 +400,10 @@ H5G_build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *n name = H5RS_get_str(name_r); /* Create reference counted string for path */ - ret_value = H5G_build_fullpath(prefix, name); + ret_value = H5G__build_fullpath(prefix, name); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_build_fullpath_refstr_refstr() */ +} /* end H5G__build_fullpath_refstr_refstr() */ #endif /* NOT_YET */ @@ -663,7 +663,7 @@ H5G_name_free(H5G_name_t *name) /*------------------------------------------------------------------------- - * Function: H5G_name_move_path + * Function: H5G__name_move_path * * Purpose: Update a user or canonical path after an object moves * @@ -676,7 +676,7 @@ H5G_name_free(H5G_name_t *name) *------------------------------------------------------------------------- */ static herr_t -H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char *src_path, +H5G__name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char *src_path, const char *dst_path) { const char *path; /* Path to update */ @@ -684,7 +684,7 @@ H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char size_t full_suffix_len; /* Length of full suffix */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(path_r_ptr && *path_r_ptr); @@ -762,11 +762,11 @@ H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_name_move_path() */ +} /* end H5G__name_move_path() */ /*------------------------------------------------------------------------- - * Function: H5G_name_replace_cb + * Function: H5G__name_replace_cb * * Purpose: H5I_iterate callback function to replace group entry names * @@ -779,7 +779,7 @@ done: *------------------------------------------------------------------------- */ static int -H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) +H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) { const H5G_names_t *names = (const H5G_names_t *)key; /* Get operation's information */ H5O_loc_t *oloc; /* Object location for object that the ID refers to */ @@ -788,7 +788,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) hbool_t obj_in_child = FALSE; /* Flag to indicate that the object is in the child mount hier. */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(obj_ptr); @@ -907,7 +907,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) else { /* Check if the source is along the entry's path */ /* (But not actually the entry itself) */ - if(H5G_common_path(obj_path->full_path_r, names->src_full_path_r) && + if(H5G__common_path(obj_path->full_path_r, names->src_full_path_r) && H5RS_cmp(obj_path->full_path_r, names->src_full_path_r)) { /* Hide the user path */ (obj_path->obj_hidden)++; @@ -957,7 +957,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) } /* end if */ else { /* Check if file being unmounted was hiding the object */ - if(H5G_common_path(obj_path->full_path_r, names->src_full_path_r) && + if(H5G__common_path(obj_path->full_path_r, names->src_full_path_r) && H5RS_cmp(obj_path->full_path_r, names->src_full_path_r)) { /* Un-hide the user path */ (obj_path->obj_hidden)--; @@ -971,7 +971,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) */ case H5G_NAME_DELETE: /* Check if the location being unlinked is in the path for the current object */ - if(H5G_common_path(obj_path->full_path_r, names->src_full_path_r)) { + if(H5G__common_path(obj_path->full_path_r, names->src_full_path_r)) { /* Free paths for object */ H5G_name_free(obj_path); } /* end if */ @@ -983,7 +983,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) */ case H5G_NAME_MOVE: /* Link move case, check for relative names case */ /* Check if the src object moved is in the current object's path */ - if(H5G_common_path(obj_path->full_path_r, names->src_full_path_r)) { + if(H5G__common_path(obj_path->full_path_r, names->src_full_path_r)) { const char *full_path; /* Full path of current object */ const char *full_suffix; /* Suffix of full path, after src_path */ size_t full_suffix_len; /* Length of suffix of full path after src_path*/ @@ -1012,7 +1012,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) /* Update the user path, if one exists */ if(obj_path->user_path_r) - if(H5G_name_move_path(&(obj_path->user_path_r), full_suffix, src_path, dst_path) < 0) + if(H5G__name_move_path(&(obj_path->user_path_r), full_suffix, src_path, dst_path) < 0) HGOTO_ERROR(H5E_SYM, H5E_PATH, FAIL, "can't build user path name") /* Build new full path */ @@ -1040,7 +1040,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) done: FUNC_LEAVE_NOAPI(ret_value); -} /* end H5G_name_replace_cb() */ +} /* end H5G__name_replace_cb() */ /*------------------------------------------------------------------------- @@ -1166,17 +1166,17 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, /* Search through group IDs */ if(search_group) - if(H5I_iterate(H5I_GROUP, H5G_name_replace_cb, &names, FALSE) < 0) + if(H5I_iterate(H5I_GROUP, H5G__name_replace_cb, &names, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over groups") /* Search through dataset IDs */ if(search_dataset) - if(H5I_iterate(H5I_DATASET, H5G_name_replace_cb, &names, FALSE) < 0) + if(H5I_iterate(H5I_DATASET, H5G__name_replace_cb, &names, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over datasets") /* Search through datatype IDs */ if(search_datatype) - if(H5I_iterate(H5I_DATATYPE, H5G_name_replace_cb, &names, FALSE) < 0) + if(H5I_iterate(H5I_DATATYPE, H5G__name_replace_cb, &names, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over datatypes") } /* end if */ } /* end if */ @@ -1187,7 +1187,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_get_name_by_addr_cb + * Function: H5G__get_name_by_addr_cb * * Purpose: Callback for retrieving object's name by address * @@ -1201,7 +1201,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info2_t *linfo, +H5G__get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info2_t *linfo, void *_udata) { H5G_gnba_iter_t *udata = (H5G_gnba_iter_t *)_udata; /* User data for iteration */ @@ -1211,7 +1211,7 @@ H5G_get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info2_t *linfo, hbool_t obj_found = FALSE; /* Object at 'path' found */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(path); @@ -1261,7 +1261,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_get_name_by_addr_cb() */ +} /* end H5G__get_name_by_addr_cb() */ /*------------------------------------------------------------------------- @@ -1310,7 +1310,7 @@ H5G_get_name_by_addr(H5F_t *f, const H5O_loc_t *loc, char *name, size_t size) udata.path = NULL; /* Visit all the links in the file */ - if((status = H5G_visit(&root_loc, "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5G_get_name_by_addr_cb, &udata)) < 0) + if((status = H5G_visit(&root_loc, "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5G__get_name_by_addr_cb, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, (-1), "group traversal failed while looking for object name") else if(status > 0) found_obj = TRUE; diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 2e7b367..5578f83 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -75,21 +75,21 @@ typedef struct H5G_node_key_t { /********************/ /* B-tree callbacks */ -static H5UC_t *H5G_node_get_shared(const H5F_t *f, const void *_udata); +static H5UC_t *H5G__node_get_shared(const H5F_t *f, const void *_udata); static herr_t H5G__node_create(H5F_t *f, H5B_ins_t op, void *_lt_key, void *_udata, void *_rt_key, haddr_t *addr_p/*out*/); -static int H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key); -static int H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key); -static htri_t H5G_node_found(H5F_t *f, haddr_t addr, const void *_lt_key, +static int H5G__node_cmp2(void *_lt_key, void *_udata, void *_rt_key); +static int H5G__node_cmp3(void *_lt_key, void *_udata, void *_rt_key); +static htri_t H5G__node_found(H5F_t *f, haddr_t addr, const void *_lt_key, void *_udata); static H5B_ins_t H5G__node_insert(H5F_t *f, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, void *_md_key, void *_udata, void *_rt_key, hbool_t *rt_key_changed, haddr_t *new_node_p/*out*/); -static H5B_ins_t H5G_node_remove(H5F_t *f, haddr_t addr, void *lt_key, +static H5B_ins_t H5G__node_remove(H5F_t *f, haddr_t addr, void *lt_key, hbool_t *lt_key_changed, void *udata, void *rt_key, hbool_t *rt_key_changed); -static herr_t H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); -static herr_t H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key); -static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, +static herr_t H5G__node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); +static herr_t H5G__node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key); +static herr_t H5G__node_debug_key(FILE *stream, int indent, int fwidth, const void *key, const void *udata); @@ -101,19 +101,19 @@ static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, H5B_class_t H5B_SNODE[1] = {{ H5B_SNODE_ID, /*id */ sizeof(H5G_node_key_t), /*sizeof_nkey */ - H5G_node_get_shared, /*get_shared */ + H5G__node_get_shared, /*get_shared */ H5G__node_create, /*new */ - H5G_node_cmp2, /*cmp2 */ - H5G_node_cmp3, /*cmp3 */ - H5G_node_found, /*found */ + H5G__node_cmp2, /*cmp2 */ + H5G__node_cmp3, /*cmp3 */ + H5G__node_found, /*found */ H5G__node_insert, /*insert */ TRUE, /*follow min branch? */ TRUE, /*follow max branch? */ H5B_RIGHT, /*critical key */ - H5G_node_remove, /*remove */ - H5G_node_decode_key, /*decode */ - H5G_node_encode_key, /*encode */ - H5G_node_debug_key /*debug */ + H5G__node_remove, /*remove */ + H5G__node_decode_key, /*decode */ + H5G__node_encode_key, /*encode */ + H5G__node_debug_key /*debug */ }}; /* Declare a free list to manage the H5G_node_t struct */ @@ -134,7 +134,7 @@ H5FL_SEQ_DEFINE(H5G_entry_t); /*------------------------------------------------------------------------- - * Function: H5G_node_get_shared + * Function: H5G__node_get_shared * * Purpose: Returns the shared B-tree info for the specified UDATA. * @@ -148,19 +148,19 @@ H5FL_SEQ_DEFINE(H5G_entry_t); *------------------------------------------------------------------------- */ static H5UC_t * -H5G_node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata) +H5G__node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(f); /* Return the pointer to the ref-count object */ FUNC_LEAVE_NOAPI(H5F_GRP_BTREE_SHARED(f)) -} /* end H5G_node_get_shared() */ +} /* end H5G__node_get_shared() */ /*------------------------------------------------------------------------- - * Function: H5G_node_decode_key + * Function: H5G__node_decode_key * * Purpose: Decodes a raw key into a native key. * @@ -172,11 +172,11 @@ H5G_node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata) *------------------------------------------------------------------------- */ static herr_t -H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) +H5G__node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) { H5G_node_key_t *key = (H5G_node_key_t *) _key; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(shared); HDassert(raw); @@ -185,11 +185,11 @@ H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) H5F_DECODE_LENGTH_LEN(raw, key->offset, shared->sizeof_len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_node_decode_key() */ +} /* end H5G__node_decode_key() */ /*------------------------------------------------------------------------- - * Function: H5G_node_encode_key + * Function: H5G__node_encode_key * * Purpose: Encodes a native key into a raw key. * @@ -201,11 +201,11 @@ H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) *------------------------------------------------------------------------- */ static herr_t -H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) +H5G__node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) { const H5G_node_key_t *key = (const H5G_node_key_t *) _key; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(shared); HDassert(raw); @@ -214,11 +214,11 @@ H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) H5F_ENCODE_LENGTH_LEN(raw, key->offset, shared->sizeof_len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_node_encode_key() */ +} /* end H5G__node_encode_key() */ /*------------------------------------------------------------------------- - * Function: H5G_node_debug_key + * Function: H5G__node_debug_key * * Purpose: Prints a key. * @@ -230,13 +230,13 @@ H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) *------------------------------------------------------------------------- */ static herr_t -H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, +H5G__node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, const void *_udata) { const H5G_node_key_t *key = (const H5G_node_key_t *) _key; const H5G_bt_common_t *udata = (const H5G_bt_common_t *) _udata; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(key); @@ -255,7 +255,7 @@ H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Cannot get name; heap address not specified\n"); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_node_debug_key() */ +} /* end H5G__node_debug_key() */ /*------------------------------------------------------------------------- @@ -361,7 +361,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_node_cmp2 + * Function: H5G__node_cmp2 * * Purpose: Compares two keys from a B-tree node (LT_KEY and RT_KEY). * The UDATA pointer supplies extra data not contained in the @@ -381,7 +381,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) +H5G__node_cmp2(void *_lt_key, void *_udata, void *_rt_key) { H5G_bt_common_t *udata = (H5G_bt_common_t *) _udata; H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key; @@ -389,7 +389,7 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) const char *s1, *s2; int ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(udata && udata->heap); @@ -407,11 +407,11 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5G_node_cmp2() */ +} /* H5G__node_cmp2() */ /*------------------------------------------------------------------------- - * Function: H5G_node_cmp3 + * Function: H5G__node_cmp3 * * Purpose: Compares two keys from a B-tree node (LT_KEY and RT_KEY) * against another key (not necessarily the same type) @@ -435,7 +435,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) +H5G__node_cmp3(void *_lt_key, void *_udata, void *_rt_key) { H5G_bt_common_t *udata = (H5G_bt_common_t *) _udata; H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key; @@ -443,7 +443,7 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) const char *s; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(udata && udata->heap); @@ -465,11 +465,11 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_cmp3() */ +} /* end H5G__node_cmp3() */ /*------------------------------------------------------------------------- - * Function: H5G_node_found + * Function: H5G__node_found * * Purpose: The B-tree search engine has found the symbol table node * which contains the requested symbol if the symbol exists. @@ -494,7 +494,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5G_node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, +H5G__node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, void *_udata) { H5G_bt_lkp_t *udata = (H5G_bt_lkp_t *)_udata; @@ -504,7 +504,7 @@ H5G_node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, const char *s; htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -548,7 +548,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_found() */ +} /* end H5G__node_found() */ /*------------------------------------------------------------------------- @@ -720,7 +720,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_node_remove + * Function: H5G__node_remove * * Purpose: The B-tree removal engine has found the symbol table node * which should contain the name which is being removed. This @@ -748,7 +748,7 @@ done: *------------------------------------------------------------------------- */ static H5B_ins_t -H5G_node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key/*in,out*/, +H5G__node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key/*in,out*/, hbool_t H5_ATTR_UNUSED *lt_key_changed/*out*/, void *_udata/*in,out*/, void *_rt_key/*in,out*/, hbool_t *rt_key_changed/*out*/) @@ -761,7 +761,7 @@ H5G_node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key/*in, int cmp = 1; H5B_ins_t ret_value = H5B_INS_ERROR; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(f); @@ -926,7 +926,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_remove() */ +} /* end H5G__node_remove() */ /*------------------------------------------------------------------------- diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 1892182..c2d7fe6 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -15,7 +15,7 @@ * * Created: H5Gobj.c * Sep 5 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Functions for abstract handling of objects in groups. * @@ -85,7 +85,7 @@ typedef struct { /********************/ /* Local Prototypes */ /********************/ -static herr_t H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned idx, +static herr_t H5G__obj_compact_to_dense_cb(const void *_mesg, unsigned idx, void *_udata); static herr_t H5G__obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo); @@ -114,7 +114,6 @@ static herr_t H5G__obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *l * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 29 2005 * *------------------------------------------------------------------------- @@ -169,7 +168,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 29 2005 * *------------------------------------------------------------------------- @@ -304,7 +302,6 @@ done: * Failure: FAIL if error occurred * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 11 2007 * *------------------------------------------------------------------------- @@ -360,7 +357,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_obj_compact_to_dense_cb + * Function: H5G__obj_compact_to_dense_cb * * Purpose: Callback routine for converting "compact" to "dense" * link storage form. @@ -368,19 +365,18 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 30 2005 * *------------------------------------------------------------------------- */ static herr_t -H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata) +H5G__obj_compact_to_dense_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata) { const H5O_link_t *lnk = (const H5O_link_t *)_mesg; /* Pointer to link */ H5G_obj_oh_it_ud1_t *udata = (H5G_obj_oh_it_ud1_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(udata->oh_addr) + FUNC_ENTER_STATIC_TAG(udata->oh_addr) /* check arguments */ HDassert(lnk); @@ -392,11 +388,11 @@ H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void done: FUNC_LEAVE_NOAPI_TAG(ret_value) -} /* end H5G_obj_compact_to_dense_cb() */ +} /* end H5G__obj_compact_to_dense_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_obj_stab_to_new_cb + * Function: H5G__obj_stab_to_new_cb * * Purpose: Callback routine for converting "symbol table" link storage to * "new format" storage (either "compact" or "dense" storage). @@ -404,18 +400,17 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sept 16 2006 * *------------------------------------------------------------------------- */ static herr_t -H5G_obj_stab_to_new_cb(const H5O_link_t *lnk, void *_udata) +H5G__obj_stab_to_new_cb(const H5O_link_t *lnk, void *_udata) { H5G_obj_stab_it_ud1_t *udata = (H5G_obj_stab_it_ud1_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ HDassert(lnk); @@ -428,7 +423,7 @@ H5G_obj_stab_to_new_cb(const H5O_link_t *lnk, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_obj_stab_to_new_cb() */ +} /* end H5G__obj_stab_to_new_cb() */ /*------------------------------------------------------------------------- @@ -443,7 +438,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 6 2005 * *------------------------------------------------------------------------- @@ -529,7 +523,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Iterate over the 'link' messages, inserting them into the dense link storage */ op.op_type = H5O_MESG_OP_APP; - op.u.app_op = H5G_obj_compact_to_dense_cb; + op.u.app_op = H5G__obj_compact_to_dense_cb; if(H5O_msg_iterate(grp_oloc, H5O_LINK_ID, &op, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over links") @@ -561,7 +555,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, udata.grp_oloc = grp_oloc; /* Iterate through all links in "old format" group and insert them into new format */ - if(H5G__stab_iterate(grp_oloc, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_obj_stab_to_new_cb, &udata) < 0) + if(H5G__stab_iterate(grp_oloc, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G__obj_stab_to_new_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over old format links") /* Remove the symbol table message from the group */ @@ -710,7 +704,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 27 2006 * *------------------------------------------------------------------------- @@ -1102,7 +1095,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 26 2005 * *------------------------------------------------------------------------- @@ -1155,7 +1147,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 6 2006 * *------------------------------------------------------------------------- diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 8ad03d0..9289ab5 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, September 18, 1997 * * Purpose: This file contains declarations which are visible diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 501c883..96e695d 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -15,7 +15,7 @@ * * Created: H5Gprivate.h * Jul 11 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Library-visible declarations. * diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h index 170b74d..3f74d45 100644 --- a/src/H5Gpublic.h +++ b/src/H5Gpublic.h @@ -15,7 +15,7 @@ * * Created: H5Gpublic.h * Jul 11 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Public declarations for the H5G package * diff --git a/src/H5Groot.c b/src/H5Groot.c index 36aa8f6..79b7075 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -15,7 +15,7 @@ * * Created: H5Groot.c * Apr 8 2009 - * Neil Fortner + * Neil Fortner * * Purpose: Functions for operating on the root group. * @@ -137,7 +137,6 @@ H5G_rootof(H5F_t *f) * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 11 1997 * *------------------------------------------------------------------------- @@ -370,7 +369,6 @@ H5G_root_free(H5G_t *grp) * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 5 2007 * *------------------------------------------------------------------------- diff --git a/src/H5Gstab.c b/src/H5Gstab.c index e8d38b9..1ca28ef 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Friday, September 19, 1997 * */ @@ -127,7 +127,6 @@ typedef struct H5G_bt_it_lbi_t { * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Nov 7 2005 * *------------------------------------------------------------------------- @@ -194,7 +193,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 1 1997 * *------------------------------------------------------------------------- @@ -249,7 +247,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@uiuc.edu * Nov 7 2005 * *------------------------------------------------------------------------- @@ -304,7 +301,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 1 1997 * *------------------------------------------------------------------------- @@ -683,7 +679,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_stab_get_name_by_idx_cb + * Function: H5G__stab_get_name_by_idx_cb * * Purpose: Callback for B-tree iteration 'by index' info query to * retrieve the name of a link @@ -697,14 +693,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) +H5G__stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) { H5G_bt_it_gnbi_t *udata = (H5G_bt_it_gnbi_t *)_udata; size_t name_off; /* Offset of name in heap */ const char *name; /* Pointer to name string in heap */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(ent); @@ -721,7 +717,7 @@ H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_get_name_by_idx_cb */ +} /* end H5G__stab_get_name_by_idx_cb */ /*------------------------------------------------------------------------- @@ -778,7 +774,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t /* Set iteration information */ udata.common.idx = n; udata.common.num_objs = 0; - udata.common.op = H5G_stab_get_name_by_idx_cb; + udata.common.op = H5G__stab_get_name_by_idx_cb; udata.heap = heap; udata.name = NULL; udata_valid = TRUE; @@ -815,7 +811,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_stab_lookup_cb + * Function: H5G__stab_lookup_cb * * Purpose: B-tree 'find' callback to retrieve location for an object * @@ -829,12 +825,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_stab_lookup_cb(const H5G_entry_t *ent, void *_udata) +H5G__stab_lookup_cb(const H5G_entry_t *ent, void *_udata) { H5G_stab_fnd_ud_t *udata = (H5G_stab_fnd_ud_t *)_udata; /* 'User data' passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check for setting link info */ if(udata->lnk) @@ -844,7 +840,7 @@ H5G_stab_lookup_cb(const H5G_entry_t *ent, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_lookup_cb() */ +} /* end H5G__stab_lookup_cb() */ /*------------------------------------------------------------------------- @@ -855,7 +851,6 @@ done: * Return: Non-negative (TRUE/FALSE) on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 20 2005 * *------------------------------------------------------------------------- @@ -892,7 +887,7 @@ H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk) /* Set up the user data for actual B-tree find operation */ bt_udata.common.name = name; bt_udata.common.heap = heap; - bt_udata.op = H5G_stab_lookup_cb; + bt_udata.op = H5G__stab_lookup_cb; bt_udata.op_data = &udata; /* Search the B-tree */ @@ -909,7 +904,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_stab_lookup_by_idx_cb + * Function: H5G__stab_lookup_by_idx_cb * * Purpose: Callback for B-tree iteration 'by index' info query to * retrieve the link @@ -923,13 +918,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) +H5G__stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) { H5G_bt_it_lbi_t *udata = (H5G_bt_it_lbi_t *)_udata; const char *name; /* Pointer to name string in heap */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(ent); @@ -946,7 +941,7 @@ H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_lookup_by_idx_cb */ +} /* end H5G__stab_lookup_by_idx_cb */ /*------------------------------------------------------------------------- @@ -957,7 +952,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 7 2006 * *------------------------------------------------------------------------- @@ -1000,7 +994,7 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_ /* Set iteration information */ udata.common.idx = n; udata.common.num_objs = 0; - udata.common.op = H5G_stab_lookup_by_idx_cb; + udata.common.op = H5G__stab_lookup_by_idx_cb; udata.heap = heap; udata.lnk = lnk; udata.found = FALSE; @@ -1040,7 +1034,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Neil Fortner - * nfortne2@hdfgroup.org * Mar 17, 2009 * *------------------------------------------------------------------------- diff --git a/src/H5Gtest.c b/src/H5Gtest.c index f9ab6f2..03efc7e 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Monday, October 17, 2005 * * Purpose: Group testing functions. @@ -814,7 +814,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Neil Fortner - * nfortne2@hdfgroup.org * April 6 2011 * *------------------------------------------------------------------------- diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index 5a4380d..15088d9 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -15,7 +15,7 @@ * * Created: H5Gtraverse.c * Sep 13 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Functions for traversing group hierarchy * @@ -355,7 +355,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Nov 20 2006 * *------------------------------------------------------------------------- @@ -464,7 +463,6 @@ done: * resolved. * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 11 1997 * *------------------------------------------------------------------------- @@ -811,7 +809,6 @@ done: * traversed. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 13 2005 * *------------------------------------------------------------------------- @@ -835,7 +832,7 @@ H5G_traverse(const H5G_loc_t *loc, const char *name, unsigned target, H5G_traver /* Retrieve the original # of soft / UD links that are able to be traversed * (So that multiple calls to H5G_traverse don't incorrectly look - * like they've traversed too many. Nested calls, like in H5L_move(), + * like they've traversed too many. Nested calls, like in H5L__move(), * may need their own mechanism to set & reset the # of links to traverse) */ if(H5CX_get_nlinks(&orig_nlinks) < 0) diff --git a/src/H5HF.c b/src/H5HF.c index 5d52ca4..2e437ad 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -15,7 +15,7 @@ * * Created: H5HF.c * Feb 24 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implements a "fractal heap" for storing variable- * length objects in a file. @@ -88,53 +88,51 @@ H5FL_DEFINE_STATIC(H5HF_t); /*------------------------------------------------------------------------- - * Function: H5HF_op_read + * Function: H5HF__op_read * * Purpose: Performs a 'read' operation for a heap 'op' callback * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_op_read(const void *obj, size_t obj_len, void *op_data) +H5HF__op_read(const void *obj, size_t obj_len, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Perform "read", using memcpy() */ H5MM_memcpy(op_data, obj, obj_len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_op_read() */ +} /* end H5HF__op_read() */ /*------------------------------------------------------------------------- - * Function: H5HF_op_write + * Function: H5HF__op_write * * Purpose: Performs a 'write' operation for a heap 'op' callback * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_op_write(const void *obj, size_t obj_len, void *op_data) +H5HF__op_write(const void *obj, size_t obj_len, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Perform "write", using memcpy() */ H5MM_memcpy((void *)obj, op_data, obj_len); /* Casting away const OK -QAK */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_op_write() */ +} /* end H5HF__op_write() */ /*------------------------------------------------------------------------- @@ -146,7 +144,6 @@ H5HF_op_write(const void *obj, size_t obj_len, void *op_data) * NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 24 2006 * *------------------------------------------------------------------------- @@ -168,7 +165,7 @@ H5HF_create(H5F_t *f, const H5HF_create_t *cparam) HDassert(cparam); /* Create shared fractal heap header */ - if(HADDR_UNDEF == (fh_addr = H5HF_hdr_create(f, cparam))) + if(HADDR_UNDEF == (fh_addr = H5HF__hdr_create(f, cparam))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create fractal heap header") /* Allocate fractal heap wrapper */ @@ -181,11 +178,11 @@ H5HF_create(H5F_t *f, const H5HF_create_t *cparam) /* Point fractal heap wrapper at header and bump it's ref count */ fh->hdr = hdr; - if(H5HF_hdr_incr(fh->hdr) < 0) + if(H5HF__hdr_incr(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") /* Increment # of files using this heap header */ - if(H5HF_hdr_fuse_incr(fh->hdr) < 0) + if(H5HF__hdr_fuse_incr(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header") /* Set file pointer for this heap open context */ @@ -214,7 +211,6 @@ done: * NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 18 2006 * *------------------------------------------------------------------------- @@ -248,11 +244,11 @@ H5HF_open(H5F_t *f, haddr_t fh_addr) /* Point fractal heap wrapper at header */ fh->hdr = hdr; - if(H5HF_hdr_incr(fh->hdr) < 0) + if(H5HF__hdr_incr(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") /* Increment # of files using this heap header */ - if(H5HF_hdr_fuse_incr(fh->hdr) < 0) + if(H5HF__hdr_fuse_incr(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header") /* Set file pointer for this heap open context */ @@ -280,7 +276,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 17 2006 * *------------------------------------------------------------------------- @@ -311,7 +306,6 @@ H5HF_get_id_len(H5HF_t *fh, size_t *id_len_p) * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 18 2006 * *------------------------------------------------------------------------- @@ -343,7 +337,6 @@ H5HF_get_heap_addr(const H5HF_t *fh, haddr_t *heap_addr_p) * filled in), negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 24 2006 * *------------------------------------------------------------------------- @@ -381,7 +374,7 @@ H5HF_insert(H5HF_t *fh, size_t size, const void *obj, void *id/*out*/) /* Check for 'tiny' object */ else if(size <= hdr->tiny_max_len) { /* Store 'tiny' object in heap */ - if(H5HF_tiny_insert(hdr, size, obj, id) < 0) + if(H5HF__tiny_insert(hdr, size, obj, id) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "can't store 'tiny' object in fractal heap") } /* end if */ else { @@ -409,7 +402,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 9 2006 * *------------------------------------------------------------------------- @@ -442,7 +434,7 @@ H5HF_get_obj_len(H5HF_t *fh, const void *_id, size_t *obj_len_p) /* Check type of object in heap */ if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) { - if(H5HF_man_get_obj_len(fh->hdr, id, obj_len_p) < 0) + if(H5HF__man_get_obj_len(fh->hdr, id, obj_len_p) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'managed' object's length") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { @@ -450,7 +442,7 @@ H5HF_get_obj_len(H5HF_t *fh, const void *_id, size_t *obj_len_p) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'huge' object's length") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { - if(H5HF_tiny_get_obj_len(fh->hdr, id, obj_len_p) < 0) + if(H5HF__tiny_get_obj_len(fh->hdr, id, obj_len_p) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'tiny' object's length") } /* end if */ else { @@ -471,7 +463,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 20 2015 * *------------------------------------------------------------------------- @@ -533,7 +524,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 18 2006 * *------------------------------------------------------------------------- @@ -577,7 +567,7 @@ H5HF_read(H5HF_t *fh, const void *_id, void *obj/*out*/) } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { /* Read 'tiny' object from file */ - if(H5HF_tiny_read(fh->hdr, id, obj) < 0) + if(H5HF__tiny_read(fh->hdr, id, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't read 'tiny' object from fractal heap") } /* end if */ else { @@ -610,7 +600,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2006 * *------------------------------------------------------------------------- @@ -681,7 +670,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sept 11 2006 * *------------------------------------------------------------------------- @@ -725,7 +713,7 @@ H5HF_op(H5HF_t *fh, const void *_id, H5HF_operator_t op, void *op_data) } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { /* Operate on 'tiny' object from file */ - if(H5HF_tiny_op(fh->hdr, id, op, op_data) < 0) + if(H5HF__tiny_op(fh->hdr, id, op, op_data) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "can't operate on 'tiny' object from fractal heap") } /* end if */ else { @@ -746,7 +734,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 15 2006 * *------------------------------------------------------------------------- @@ -790,7 +777,7 @@ H5HF_remove(H5HF_t *fh, const void *_id) } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { /* Remove 'tiny' object from heap statistics */ - if(H5HF_tiny_remove(fh->hdr, id) < 0) + if(H5HF__tiny_remove(fh->hdr, id) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove 'tiny' object from fractal heap") } /* end if */ else { @@ -811,7 +798,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 17 2006 * *------------------------------------------------------------------------- @@ -831,7 +817,7 @@ H5HF_close(H5HF_t *fh) HDassert(fh); /* Decrement file reference & check if this is the last open fractal heap using the shared heap header */ - if(0 == H5HF_hdr_fuse_decr(fh->hdr)) { + if(0 == H5HF__hdr_fuse_decr(fh->hdr)) { /* Set the shared heap header's file context for this operation */ fh->hdr->f = fh->f; @@ -850,8 +836,8 @@ H5HF_close(H5HF_t *fh) * a reference loop and the objects couldn't be removed from * the metadata cache - QAK) */ - if(H5HF_man_iter_ready(&fh->hdr->next_block)) - if(H5HF_man_iter_reset(&fh->hdr->next_block) < 0) + if(H5HF__man_iter_ready(&fh->hdr->next_block)) + if(H5HF__man_iter_reset(&fh->hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") /* Shut down the huge object information */ @@ -873,10 +859,10 @@ H5HF_close(H5HF_t *fh) } /* end if */ /* Decrement the reference count on the heap header */ - /* (don't put in H5HF_hdr_fuse_decr() as the heap header may be evicted + /* (don't put in H5HF__hdr_fuse_decr() as the heap header may be evicted * immediately -QAK) */ - if(H5HF_hdr_decr(fh->hdr) < 0) + if(H5HF__hdr_decr(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") /* Check for pending heap deletion */ @@ -908,7 +894,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 4 2006 * *------------------------------------------------------------------------- diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index 479c2bd..756ddb5 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -15,7 +15,7 @@ * * Created: H5HFbtree2.c * Aug 7 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: v2 B-tree callbacks for "huge" object tracker * diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 8dbdf25..31430f9 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -15,7 +15,7 @@ * * Created: H5HFcache.c * Feb 24 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement fractal heap metadata cache methods. * @@ -255,7 +255,6 @@ done: * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 27 2006 * *------------------------------------------------------------------------- @@ -305,7 +304,6 @@ H5HF__dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable) * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 27 2006 * *------------------------------------------------------------------------- @@ -353,7 +351,7 @@ H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) * * Note also that the value returned by this function presumes that * there is no I/O filtering data in the header. If there is, the - * size reported will be too small, and H5C_load_entry() + * size reported will be too small, and H5C__load_entry() * will have to make two tries to load the fractal heap header. * * Return: Success: SUCCEED @@ -507,7 +505,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, HDassert(dirty); /* Allocate space for the fractal heap data structure */ - if(NULL == (hdr = H5HF_hdr_alloc(udata->f))) + if(NULL == (hdr = H5HF__hdr_alloc(udata->f))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Deserialize the fractal heap header's prefix */ @@ -591,7 +589,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, HDassert((size_t)(image - (const uint8_t *)_image) == hdr->heap_size); /* Finish initialization of heap header */ - if(H5HF_hdr_finish_init(hdr) < 0) + if(H5HF__hdr_finish_init(hdr) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, NULL, "can't finish initializing shared fractal heap header") /* Set return value */ @@ -599,7 +597,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, done: if(!ret_value && hdr) - if(H5HF_hdr_free(hdr) < 0) + if(H5HF__hdr_free(hdr) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) @@ -879,7 +877,7 @@ H5HF__cache_hdr_free_icr(void *_thing) HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); HDassert(hdr->rc == 0); - if(H5HF_hdr_free(hdr) < 0) + if(H5HF__hdr_free(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "unable to release fractal heap header") done: @@ -1009,7 +1007,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED /* Share common heap information */ iblock->hdr = hdr; - if(H5HF_hdr_incr(hdr) < 0) + if(H5HF__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") /* Set block's internal information */ @@ -1049,7 +1047,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED iblock->par_entry = udata->par_info->entry; if(iblock->parent) { /* Share parent block */ - if(H5HF_iblock_incr(iblock->parent) < 0) + if(H5HF__iblock_incr(iblock->parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared indirect block") /* Set max. # of rows in this block */ @@ -1144,7 +1142,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED done: if(!ret_value && iblock) - if(H5HF_man_iblock_dest(iblock) < 0) + if(H5HF__man_iblock_dest(iblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy fractal heap indirect block") FUNC_LEAVE_NOAPI(ret_value) @@ -1280,7 +1278,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, hdr->man_dtable.table_addr = iblock_addr; /* Mark that heap header was modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end if */ else { @@ -1295,7 +1293,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, par_iblock->ents[par_entry].addr = iblock_addr; /* Mark that parent was modified */ - if(H5HF_iblock_dirty(par_iblock) < 0) + if(H5HF__iblock_dirty(par_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end if */ @@ -1559,7 +1557,7 @@ H5HF__cache_iblock_free_icr(void *thing) HDassert(iblock->hdr); /* Destroy fractal heap indirect block */ - if(H5HF_man_iblock_dest(iblock) < 0) + if(H5HF__man_iblock_dest(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") done: @@ -1792,7 +1790,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, /* Share common heap information */ dblock->hdr = hdr; - if(H5HF_hdr_incr(hdr) < 0) + if(H5HF__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header") /* Set block's internal information */ @@ -1885,7 +1883,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, dblock->par_entry = par_info->entry; if(dblock->parent) { /* Share parent block */ - if(H5HF_iblock_incr(dblock->parent) < 0) + if(H5HF__iblock_incr(dblock->parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared indirect block") } /* end if */ @@ -1915,7 +1913,7 @@ done: /* Cleanup on error */ if(!ret_value && dblock) - if(H5HF_man_dblock_dest(dblock) < 0) + if(H5HF__man_dblock_dest(dblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) @@ -2269,7 +2267,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, /* Check if heap header was modified */ if(hdr_changed) - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end if */ else { /* the direct block's parent is an indirect block */ @@ -2321,7 +2319,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, /* Check if parent was modified */ if(par_changed) - if(H5HF_iblock_dirty(par_iblock) < 0) + if(H5HF__iblock_dirty(par_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end else */ } /* end if */ @@ -2357,7 +2355,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, hdr->man_dtable.table_addr = dblock_addr; /* Mark that heap header was modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end if */ else { /* the direct block's parent is an indirect block */ @@ -2371,7 +2369,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, par_iblock->ents[par_entry].addr = dblock_addr; /* Mark that parent was modified */ - if(H5HF_iblock_dirty(par_iblock) < 0) + if(H5HF__iblock_dirty(par_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end else */ } /* end if */ @@ -2574,7 +2572,7 @@ H5HF__cache_dblock_free_icr(void *_thing) HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); /* Destroy fractal heap direct block */ - if(H5HF_man_dblock_dest(dblock) < 0) + if(H5HF__man_dblock_dest(dblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") done: diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 22de0c4..f6c7f0e 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -15,7 +15,7 @@ * * Created: H5HFdbg.c * Feb 24 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Dump debugging information about a fractal heap * @@ -78,7 +78,7 @@ typedef struct { /* Local Prototypes */ /********************/ -static herr_t H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, +static herr_t H5HF__dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwidth); @@ -105,7 +105,6 @@ static herr_t H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 20 2015 * *------------------------------------------------------------------------- @@ -172,22 +171,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_dtable_debug + * Function: H5HF__dtable_debug * * Purpose: Prints debugging info about a doubling table * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 28 2006 * *------------------------------------------------------------------------- */ static herr_t -H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwidth) +H5HF__dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwidth) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -240,7 +238,7 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi dtable->num_id_first_row); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_dtable_debug() */ +} /* end H5HF__dtable_debug() */ /*------------------------------------------------------------------------- @@ -251,7 +249,6 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 23 2012 * *------------------------------------------------------------------------- @@ -328,7 +325,7 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int i hdr->tiny_nobjs); HDfprintf(stream, "%*sManaged Objects Doubling-Table Info...\n", indent, ""); - H5HF_dtable_debug(&hdr->man_dtable, stream, indent + 3, MAX(0, fwidth - 3)); + H5HF__dtable_debug(&hdr->man_dtable, stream, indent + 3, MAX(0, fwidth - 3)); /* Print information about I/O filters */ if(hdr->filter_len > 0) { @@ -371,7 +368,6 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int i * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 24 2006 * *------------------------------------------------------------------------- @@ -416,7 +412,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 13 2006 * *------------------------------------------------------------------------- @@ -500,7 +495,6 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 28 2006 * *------------------------------------------------------------------------- @@ -627,7 +621,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 23 2012 * *------------------------------------------------------------------------- @@ -709,10 +702,10 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, unsigned first_row_bits; /* Number of bits used bit addresses in first row */ unsigned num_indirect_rows; /* Number of rows of blocks in each indirect block */ - first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + - H5VM_log2_of2(hdr->man_dtable.cparam.width); + first_row_bits = H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + + H5VM__log2_of2(hdr->man_dtable.cparam.width); for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++) { - num_indirect_rows = (H5VM_log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; + num_indirect_rows = (H5VM__log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; HDsnprintf(temp_str, sizeof(temp_str), "Row #%u: (# of rows: %u)", (unsigned)u, num_indirect_rows); HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); @@ -759,7 +752,6 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 7 2006 * *------------------------------------------------------------------------- @@ -817,7 +809,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 13 2006 * *------------------------------------------------------------------------- @@ -849,11 +840,6 @@ H5HF_sects_debug_cb(H5FS_section_info_t *_sect, void *_udata) HDfprintf(udata->stream, "%*s%-*s %Hu\n", udata->indent, "", udata->fwidth, "Section size:", sect->sect_info.size); -#ifdef QAK - HDfprintf(udata->stream, "%*s%-*s %s\n", udata->indent, "", udata->fwidth, - "Section state:", - (sect->sect_info.state == H5FS_SECT_LIVE ? "live" : "serialized")); -#endif /* QAK */ /* Dump section-specific debugging information */ if(H5FS_sect_debug(udata->fspace, _sect, udata->stream, udata->indent + 3, MAX(0, udata->fwidth - 3)) < 0) @@ -872,7 +858,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 9 2006 * *------------------------------------------------------------------------- diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index a6560e2..96392c1 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -15,7 +15,7 @@ * * Created: H5HFdblock.c * Apr 10 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Direct block routines for fractal heaps. * @@ -86,7 +86,6 @@ H5FL_DEFINE(H5HF_direct_t); * Return: Pointer to new direct block on success, NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 27 2006 * *------------------------------------------------------------------------- @@ -119,7 +118,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, /* Share common heap information */ dblock->hdr = hdr; - if(H5HF_hdr_incr(hdr) < 0) + if(H5HF__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared heap header") /* Set info for direct block */ @@ -162,7 +161,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, /* Attach to parent indirect block, if there is one */ dblock->parent = par_iblock; if(dblock->parent) { - if(H5HF_man_iblock_attach(dblock->parent, par_entry, dblock_addr) < 0) + if(H5HF__man_iblock_attach(dblock->parent, par_entry, dblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't attach direct block to parent indirect block") dblock->fd_parent = par_iblock; } /* end if */ @@ -171,7 +170,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, dblock->par_entry = par_entry; /* Create a new 'single' section for the free space in the block */ - if(NULL == (sec_node = H5HF_sect_single_new((dblock->block_off + H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)), + if(NULL == (sec_node = H5HF__sect_single_new((dblock->block_off + H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)), free_space, dblock->parent, dblock->par_entry))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create section for new direct block's free space") @@ -190,7 +189,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add fractal heap direct block to cache") /* Increase the allocated heap size */ - if(H5HF_hdr_inc_alloc(hdr, dblock->size) < 0) + if(H5HF__hdr_inc_alloc(hdr, dblock->size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't increase allocated heap size") /* Set the address of of direct block, if requested */ @@ -200,7 +199,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, done: if(ret_value < 0) if(dblock) - if(H5HF_man_dblock_dest(dblock) < 0) + if(H5HF__man_dblock_dest(dblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) @@ -219,7 +218,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 17 2006 * *------------------------------------------------------------------------- @@ -272,7 +270,7 @@ H5HF__man_dblock_destroy(H5HF_hdr_t *hdr, H5HF_direct_t *dblock, HDassert(hdr->man_dtable.cparam.start_block_size == dblock->size); /* Sanity check block iterator */ - HDassert(!H5HF_man_iter_ready(&hdr->next_block)); + HDassert(!H5HF__man_iter_ready(&hdr->next_block)); /* Reset header information back to "empty heap" state */ if(H5HF__hdr_empty(hdr) < 0) @@ -334,7 +332,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 13 2006 * *------------------------------------------------------------------------- @@ -359,7 +356,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, if(request < hdr->man_dtable.cparam.start_block_size) min_dblock_size = hdr->man_dtable.cparam.start_block_size; else { - min_dblock_size = ((size_t)1) << (1 + H5VM_log2_gen((uint64_t)request)); + min_dblock_size = ((size_t)1) << (1 + H5VM__log2_gen((uint64_t)request)); HDassert(min_dblock_size <= hdr->man_dtable.cparam.max_direct_size); } /* end else */ @@ -383,7 +380,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, } /* end if */ /* Extend heap to cover new direct block */ - if(H5HF_hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size, (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0) + if(H5HF__hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size, (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") } /* end if */ /* Root entry already exists, allocate direct block from root indirect block */ @@ -398,7 +395,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, HGOTO_ERROR(H5E_HEAP, H5E_CANTUPDATE, FAIL, "unable to update block iterator") /* Retrieve information about current iterator position */ - if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") HDassert(next_row < iblock->nrows); H5_CHECKED_ASSIGN(next_size, size_t, hdr->man_dtable.row_block_size[next_row], hsize_t); @@ -410,7 +407,7 @@ HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "skipping direct block sizes not su } /* end if */ /* Advance "next block" iterator to next direct block entry */ - if(H5HF_hdr_inc_iter(hdr, (hsize_t)next_size, 1) < 0) + if(H5HF__hdr_inc_iter(hdr, (hsize_t)next_size, 1) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment 'next block' iterator") /* Create new direct block at current location*/ @@ -432,7 +429,6 @@ done: * Return: Pointer to direct block on success, NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 17 2006 * *------------------------------------------------------------------------- @@ -515,7 +511,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 8 2006 * *------------------------------------------------------------------------- @@ -546,7 +541,7 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Look up row & column for object */ - if(H5HF_dtable_lookup(&hdr->man_dtable, obj_off, &row, &col) < 0) + if(H5HF__dtable_lookup(&hdr->man_dtable, obj_off, &row, &col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of object") /* Set initial indirect block info */ @@ -564,7 +559,7 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting parent indirect block */ /* Compute # of rows in child indirect block */ - nrows = (H5VM_log2_gen(hdr->man_dtable.row_block_size[row]) - hdr->man_dtable.first_row_bits) + 1; + nrows = (H5VM__log2_gen(hdr->man_dtable.row_block_size[row]) - hdr->man_dtable.first_row_bits) + 1; HDassert(nrows < iblock->nrows); /* child must be smaller than parent */ /* Compute indirect block's entry */ @@ -595,7 +590,7 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, did_protect = new_did_protect; /* Look up row & column in new indirect block for object */ - if(H5HF_dtable_lookup(&hdr->man_dtable, (obj_off - iblock->block_off), &row, &col) < 0) + if(H5HF__dtable_lookup(&hdr->man_dtable, (obj_off - iblock->block_off), &row, &col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of object") HDassert(row < iblock->nrows); /* child must be smaller than parent */ } /* end while */ @@ -624,7 +619,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 7 2006 * *------------------------------------------------------------------------- @@ -682,24 +676,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_dblock_dest + * Function: H5HF__man_dblock_dest * * Purpose: Destroys a fractal heap direct block in memory. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 27 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_dblock_dest(H5HF_direct_t *dblock) +H5HF__man_dblock_dest(H5HF_direct_t *dblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -708,7 +701,7 @@ H5HF_man_dblock_dest(H5HF_direct_t *dblock) /* Decrement reference count on shared fractal heap info */ HDassert(dblock->hdr != NULL); - if(H5HF_hdr_decr(dblock->hdr) < 0) + if(H5HF__hdr_decr(dblock->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") if(dblock->parent) if(H5HF__iblock_decr(dblock->parent) < 0) @@ -722,5 +715,5 @@ H5HF_man_dblock_dest(H5HF_direct_t *dblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_dblock_dest() */ +} /* end H5HF__man_dblock_dest() */ diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c index 6e9429a..ad317c9 100644 --- a/src/H5HFdtable.c +++ b/src/H5HFdtable.c @@ -15,7 +15,7 @@ * * Created: H5HFdtable.c * Apr 10 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: "Doubling table" routines for fractal heaps. * @@ -75,27 +75,26 @@ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_init + * Function: H5HF__dtable_init * * Purpose: Initialize values for doubling table * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 6 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_dtable_init(H5HF_dtable_t *dtable) +H5HF__dtable_init(H5HF_dtable_t *dtable) { hsize_t tmp_block_size; /* Temporary block size */ hsize_t acc_block_off; /* Accumulated block offset */ size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -103,10 +102,10 @@ H5HF_dtable_init(H5HF_dtable_t *dtable) HDassert(dtable); /* Compute/cache some values */ - dtable->start_bits = H5VM_log2_of2((uint32_t)dtable->cparam.start_block_size); - dtable->first_row_bits = dtable->start_bits + H5VM_log2_of2(dtable->cparam.width); + dtable->start_bits = H5VM__log2_of2((uint32_t)dtable->cparam.start_block_size); + dtable->first_row_bits = dtable->start_bits + H5VM__log2_of2(dtable->cparam.width); dtable->max_root_rows = (dtable->cparam.max_index - dtable->first_row_bits) + 1; - dtable->max_direct_bits = H5VM_log2_of2((uint32_t)dtable->cparam.max_direct_size); + dtable->max_direct_bits = H5VM__log2_of2((uint32_t)dtable->cparam.max_direct_size); dtable->max_direct_rows = (dtable->max_direct_bits - dtable->start_bits) + 2; dtable->num_id_first_row = dtable->cparam.start_block_size * dtable->cparam.width; dtable->max_dir_blk_off_size = H5HF_SIZEOF_OFFSET_LEN(dtable->cparam.max_direct_size); @@ -133,26 +132,25 @@ H5HF_dtable_init(H5HF_dtable_t *dtable) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_dtable_init() */ +} /* end H5HF__dtable_init() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_lookup + * Function: H5HF__dtable_lookup * * Purpose: Compute the row & col of an offset in a doubling-table * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 6 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsigned *col) +H5HF__dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsigned *col) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -160,9 +158,6 @@ H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsi HDassert(dtable); HDassert(row); HDassert(col); -#ifdef QAK -HDfprintf(stderr, "%s: off = %Hu\n", "H5HF_dtable_lookup", off); -#endif /* QAK */ /* Check for offset in first row */ if(off < dtable->num_id_first_row) { @@ -170,37 +165,33 @@ HDfprintf(stderr, "%s: off = %Hu\n", "H5HF_dtable_lookup", off); H5_CHECKED_ASSIGN(*col, unsigned, (off / dtable->cparam.start_block_size), hsize_t); } /* end if */ else { - unsigned high_bit = H5VM_log2_gen(off); /* Determine the high bit in the offset */ + unsigned high_bit = H5VM__log2_gen(off); /* Determine the high bit in the offset */ hsize_t off_mask = ((hsize_t)1) << high_bit; /* Compute mask for determining column */ -#ifdef QAK -HDfprintf(stderr, "%s: high_bit = %u, off_mask = %Hu\n", "H5HF_dtable_lookup", high_bit, off_mask); -#endif /* QAK */ *row = (high_bit - dtable->first_row_bits) + 1; H5_CHECKED_ASSIGN(*col, unsigned, ((off - off_mask) / dtable->row_block_size[*row]), hsize_t); } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_dtable_lookup() */ +} /* end H5HF__dtable_lookup() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_dest + * Function: H5HF__dtable_dest * * Purpose: Release information for doubling table * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 27 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_dtable_dest(H5HF_dtable_t *dtable) +H5HF__dtable_dest(H5HF_dtable_t *dtable) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -220,28 +211,27 @@ H5HF_dtable_dest(H5HF_dtable_t *dtable) H5MM_xfree(dtable->row_max_dblock_free); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_dtable_dest() */ +} /* end H5HF__dtable_dest() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_size_to_row + * Function: H5HF__dtable_size_to_row * * Purpose: Compute row that can hold block of a certain size * * Return: Non-negative on success (can't fail) * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 25 2006 * *------------------------------------------------------------------------- */ unsigned -H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) +H5HF__dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) { unsigned row = 0; /* Row where block will fit */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -251,58 +241,56 @@ H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) if(block_size == dtable->cparam.start_block_size) row = 0; else - row = (H5VM_log2_of2((uint32_t)block_size) - H5VM_log2_of2((uint32_t)dtable->cparam.start_block_size)) + 1; + row = (H5VM__log2_of2((uint32_t)block_size) - H5VM__log2_of2((uint32_t)dtable->cparam.start_block_size)) + 1; FUNC_LEAVE_NOAPI(row) -} /* end H5HF_dtable_size_to_row() */ +} /* end H5HF__dtable_size_to_row() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_size_to_rows + * Function: H5HF__dtable_size_to_rows * * Purpose: Compute # of rows of indirect block of a given size * * Return: Non-negative on success (can't fail) * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- */ unsigned -H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size) +H5HF__dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size) { unsigned rows = 0; /* # of rows required for indirect block */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. */ HDassert(dtable); - rows = (H5VM_log2_gen(size) - dtable->first_row_bits) + 1; + rows = (H5VM__log2_gen(size) - dtable->first_row_bits) + 1; FUNC_LEAVE_NOAPI(rows) -} /* end H5HF_dtable_size_to_rows() */ +} /* end H5HF__dtable_size_to_rows() */ /*------------------------------------------------------------------------- - * Function: H5HF_dtable_span_size + * Function: H5HF__dtable_span_size * * Purpose: Compute the size covered by a span of entries * * Return: Non-zero span size on success/zero on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 25 2006 * *------------------------------------------------------------------------- */ hsize_t -H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, +H5HF__dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned start_col, unsigned num_entries) { unsigned start_entry; /* Entry for first block covered */ @@ -311,7 +299,7 @@ H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned end_entry; /* Entry for last block covered */ hsize_t acc_span_size = 0; /* Accumulated span size */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -326,10 +314,6 @@ H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, end_entry = (start_entry + num_entries) - 1; end_row = end_entry / dtable->cparam.width; end_col = end_entry % dtable->cparam.width; -#ifdef QAK -HDfprintf(stderr, "%s: start_row = %u, start_col = %u, start_entry = %u\n", "H5HF_sect_indirect_span_size", start_row, start_col, start_entry); -HDfprintf(stderr, "%s: end_row = %u, end_col = %u, end_entry = %u\n", "H5HF_sect_indirect_span_size", end_row, end_col, end_entry); -#endif /* QAK */ /* Initialize accumulated span size */ acc_span_size = 0; @@ -362,9 +346,6 @@ HDfprintf(stderr, "%s: end_row = %u, end_col = %u, end_entry = %u\n", "H5HF_sect ((end_col - start_col) + 1); } /* end else */ -#ifdef QAK -HDfprintf(stderr, "%s: acc_span_size = %Hu\n", "H5HF_dtable_span_size", acc_span_size); -#endif /* QAK */ FUNC_LEAVE_NOAPI(acc_span_size) -} /* end H5HF_sect_indirect_span_size() */ +} /* end H5HF__dtable_span_size() */ diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 5750a03..4a645cd 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -15,7 +15,7 @@ * * Created: H5HFhdr.c * Apr 10 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Heap header routines for fractal heaps. * @@ -46,7 +46,7 @@ #ifndef NDEBUG /* Limit on the size of the max. direct block size */ /* (This is limited to 32-bits currently, because I think it's unlikely to - * need to be larger, the 32-bit limit for H5VM_log2_of2(n), and + * need to be larger, the 32-bit limit for H5VM__log2_of2(n), and * some offsets/sizes are encoded with a maximum of 32-bits - QAK) */ #define H5HF_MAX_DIRECT_SIZE_LIMIT ((hsize_t)2 * 1024 * 1024 * 1024) @@ -94,25 +94,24 @@ H5FL_DEFINE_STATIC(H5HF_hdr_t); /*------------------------------------------------------------------------- - * Function: H5HF_hdr_alloc + * Function: H5HF__hdr_alloc * * Purpose: Allocate shared fractal heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- */ H5HF_hdr_t * -H5HF_hdr_alloc(H5F_t *f) +H5HF__hdr_alloc(H5F_t *f) { H5HF_hdr_t *hdr = NULL; /* Shared fractal heap header */ H5HF_hdr_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -133,7 +132,7 @@ H5HF_hdr_alloc(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_alloc() */ +} /* end H5HF__hdr_alloc() */ /*------------------------------------------------------------------------- @@ -145,13 +144,12 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- */ static herr_t -H5HF_hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row) +H5HF__hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row) { hsize_t acc_heap_size; /* Accumumated heap space */ hsize_t iblock_size; /* Size of indirect block to calculate for */ @@ -160,7 +158,7 @@ H5HF_hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row) unsigned curr_row; /* Current row in block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -189,28 +187,27 @@ H5HF_hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row) hdr->man_dtable.row_max_dblock_free[iblock_row] = max_dblock_free; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_compute_free_space() */ +} /* end H5HF__hdr_compute_free_space() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_finish_init_phase1 + * Function: H5HF__hdr_finish_init_phase1 * * Purpose: First phase to finish initializing info in shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 12 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr) +H5HF__hdr_finish_init_phase1(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -219,38 +216,37 @@ H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr) /* Compute/cache some values */ hdr->heap_off_size = (uint8_t)H5HF_SIZEOF_OFFSET_BITS(hdr->man_dtable.cparam.max_index); - if(H5HF_dtable_init(&hdr->man_dtable) < 0) + if(H5HF__dtable_init(&hdr->man_dtable) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize doubling table info") /* Set the size of heap IDs */ hdr->heap_len_size = (uint8_t)MIN(hdr->man_dtable.max_dir_blk_off_size, - H5VM_limit_enc_size((uint64_t)hdr->max_man_size)); + H5VM__limit_enc_size((uint64_t)hdr->max_man_size)); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_finish_init_phase1() */ +} /* end H5HF__hdr_finish_init_phase1() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_finish_init_phase2 + * Function: H5HF__hdr_finish_init_phase2 * * Purpose: Second phase to finish initializing info in shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 12 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr) +H5HF__hdr_finish_init_phase2(H5HF_hdr_t *hdr) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -265,46 +261,45 @@ H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr) H5_CHECKED_ASSIGN(hdr->man_dtable.row_max_dblock_free[u], size_t, hdr->man_dtable.row_tot_dblock_free[u], hsize_t); } /* end if */ else - if(H5HF_hdr_compute_free_space(hdr, u) < 0) + if(H5HF__hdr_compute_free_space(hdr, u) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize direct block free space for indirect block") } /* end for */ /* Initialize the block iterator for searching for free space */ - if(H5HF_man_iter_init(&hdr->next_block) < 0) + if(H5HF__man_iter_init(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize space search block iterator") /* Initialize the information for tracking 'huge' objects */ - if(H5HF_huge_init(hdr) < 0) + if(H5HF__huge_init(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize info for tracking huge objects") /* Initialize the information for tracking 'tiny' objects */ - if(H5HF_tiny_init(hdr) < 0) + if(H5HF__tiny_init(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize info for tracking tiny objects") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_finish_init_phase2() */ +} /* end H5HF__hdr_finish_init_phase2() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_finish_init + * Function: H5HF__hdr_finish_init * * Purpose: Finish initializing info in shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_finish_init(H5HF_hdr_t *hdr) +H5HF__hdr_finish_init(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -312,39 +307,38 @@ H5HF_hdr_finish_init(H5HF_hdr_t *hdr) HDassert(hdr); /* First phase of header final initialization */ - if(H5HF_hdr_finish_init_phase1(hdr) < 0) + if(H5HF__hdr_finish_init_phase1(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #1 of header final initialization") /* Second phase of header final initialization */ - if(H5HF_hdr_finish_init_phase2(hdr) < 0) + if(H5HF__hdr_finish_init_phase2(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #2 of header final initialization") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_finish_init() */ +} /* end H5HF__hdr_finish_init() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_create + * Function: H5HF__hdr_create * * Purpose: Create new fractal heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- */ haddr_t -H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) +H5HF__hdr_create(H5F_t *f, const H5HF_create_t *cparam) { H5HF_hdr_t *hdr = NULL; /* The new fractal heap header information */ size_t dblock_overhead; /* Direct block's overhead */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -377,7 +371,7 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) #endif /* NDEBUG */ /* Allocate & basic initialization for the shared header */ - if(NULL == (hdr = H5HF_hdr_alloc(f))) + if(NULL == (hdr = H5HF__hdr_alloc(f))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "can't allocate space for shared heap info") #ifndef NDEBUG @@ -401,7 +395,7 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) /* First phase of header final initialization */ /* (doesn't need ID length set up) */ - if(H5HF_hdr_finish_init_phase1(hdr) < 0) + if(H5HF__hdr_finish_init_phase1(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "can't finish phase #1 of header final initialization") /* Copy any I/O filter pipeline */ @@ -484,7 +478,7 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) /* Second phase of header final initialization */ /* (needs ID and filter lengths set up) */ - if(H5HF_hdr_finish_init_phase2(hdr) < 0) + if(H5HF__hdr_finish_init_phase2(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "can't finish phase #2 of header final initialization") /* Extra checking for possible gap between max. direct block size minus @@ -506,11 +500,11 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) done: if(!H5F_addr_defined(ret_value) && hdr) - if(H5HF_hdr_free(hdr) < 0) + if(H5HF__hdr_free(hdr) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, HADDR_UNDEF, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_create() */ +} /* end H5HF__hdr_create() */ /*------------------------------------------------------------------------- @@ -521,7 +515,6 @@ done: * Return: Pointer to indirect block on success, NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 5 2010 * *------------------------------------------------------------------------- @@ -564,24 +557,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_hdr_incr + * Function: H5HF__hdr_incr * * Purpose: Increment component reference count on shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 27 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_incr(H5HF_hdr_t *hdr) +H5HF__hdr_incr(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -596,28 +588,27 @@ H5HF_hdr_incr(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_incr() */ +} /* end H5HF__hdr_incr() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_decr + * Function: H5HF__hdr_decr * * Purpose: Decrement component reference count on shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 27 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_decr(H5HF_hdr_t *hdr) +H5HF__hdr_decr(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -635,26 +626,25 @@ H5HF_hdr_decr(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_decr() */ +} /* end H5HF__hdr_decr() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_fuse_incr + * Function: H5HF__hdr_fuse_incr * * Purpose: Increment file reference count on shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Oct 1 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr) +H5HF__hdr_fuse_incr(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ HDassert(hdr); @@ -663,26 +653,25 @@ H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr) hdr->file_rc++; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_hdr_fuse_incr() */ +} /* end H5HF__hdr_fuse_incr() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_fuse_decr + * Function: H5HF__hdr_fuse_decr * * Purpose: Decrement file reference count on shared heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Oct 1 2006 * *------------------------------------------------------------------------- */ size_t -H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr) +H5HF__hdr_fuse_decr(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ HDassert(hdr); @@ -692,37 +681,35 @@ H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr) hdr->file_rc--; FUNC_LEAVE_NOAPI(hdr->file_rc) -} /* end H5HF_hdr_fuse_decr() */ +} /* end H5HF__hdr_fuse_decr() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_dirty + * Function: H5HF__hdr_dirty * * Purpose: Mark heap header as dirty * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 27 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_dirty(H5HF_hdr_t *hdr) +H5HF__hdr_dirty(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); /* Resize pinned header in cache if I/O filter is present. */ - if(hdr->filter_len > 0) { + if(hdr->filter_len > 0) if(H5AC_resize_entry(hdr, (size_t)hdr->heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize fractal heap header") - } /* end if */ /* Mark header as dirty in cache */ if(H5AC_mark_entry_dirty(hdr) < 0) @@ -730,28 +717,27 @@ H5HF_hdr_dirty(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_dirty() */ +} /* end H5HF__hdr_dirty() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_adj_free + * Function: H5HF__hdr_adj_free * * Purpose: Adjust the free space for a heap * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 9 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt) +H5HF__hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -763,33 +749,32 @@ H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt) hdr->total_man_free = (hsize_t)((hssize_t)hdr->total_man_free + amt); /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_adj_free() */ +} /* end H5HF__hdr_adj_free() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_adjust_heap + * Function: H5HF__hdr_adjust_heap * * Purpose: Adjust heap space * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 10 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free) +H5HF__hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -804,31 +789,30 @@ H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free) hdr->total_man_free = (hsize_t)((hssize_t)hdr->total_man_free + extra_free); /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark header as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_adjust_heap() */ +} /* end H5HF__hdr_adjust_heap() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_inc_alloc + * Function: H5HF__hdr_inc_alloc * * Purpose: Increase allocated size of heap * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 23 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size) +H5HF__hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -840,28 +824,27 @@ H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size) hdr->man_alloc_size += alloc_size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_hdr_inc_alloc() */ +} /* end H5HF__hdr_inc_alloc() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_start_iter + * Function: H5HF__hdr_start_iter * * Purpose: Start "next block" iterator at an offset/entry in the heap * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 30 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, unsigned curr_entry) +H5HF__hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, unsigned curr_entry) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -870,7 +853,7 @@ H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, HDassert(iblock); /* Set up "next block" iterator at correct location */ - if(H5HF_man_iter_start_entry(hdr, &hdr->next_block, iblock, curr_entry) < 0) + if(H5HF__man_iter_start_entry(hdr, &hdr->next_block, iblock, curr_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize block iterator") /* Set the offset of the iterator in the heap */ @@ -878,28 +861,27 @@ H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_start_iter() */ +} /* end H5HF__hdr_start_iter() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_reset_iter + * Function: H5HF__hdr_reset_iter * * Purpose: Reset "next block" iterator * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off) +H5HF__hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -907,7 +889,7 @@ H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off) HDassert(hdr); /* Reset "next block" iterator */ - if(H5HF_man_iter_reset(&hdr->next_block) < 0) + if(H5HF__man_iter_reset(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") /* Set the offset of the iterator in the heap */ @@ -915,7 +897,7 @@ H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_reset_iter() */ +} /* end H5HF__hdr_reset_iter() */ /*------------------------------------------------------------------------- @@ -926,7 +908,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 3 2006 * *------------------------------------------------------------------------- @@ -951,11 +932,11 @@ H5HF__hdr_skip_blocks(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, /* Compute the span within the heap to skip */ row = start_entry / hdr->man_dtable.cparam.width; col = start_entry % hdr->man_dtable.cparam.width; - sect_size = H5HF_dtable_span_size(&hdr->man_dtable, row, col, nentries); + sect_size = H5HF__dtable_span_size(&hdr->man_dtable, row, col, nentries); HDassert(sect_size > 0); /* Advance the new block iterator */ - if(H5HF_hdr_inc_iter(hdr, sect_size, nentries) < 0) + if(H5HF__hdr_inc_iter(hdr, sect_size, nentries) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't increase allocated heap size") /* Add 'indirect' section for blocks skipped in this row */ @@ -978,7 +959,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 14 2006 * *------------------------------------------------------------------------- @@ -1009,17 +989,17 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) unsigned min_dblock_row; /* Minimum row for direct block size request */ /* Compute min. row for direct block requested */ - min_dblock_row = H5HF_dtable_size_to_row(&hdr->man_dtable, min_dblock_size); + min_dblock_row = H5HF__dtable_size_to_row(&hdr->man_dtable, min_dblock_size); /* Initialize block iterator, if necessary */ - if(!H5HF_man_iter_ready(&hdr->next_block)) { + if(!H5HF__man_iter_ready(&hdr->next_block)) { /* Start iterator with previous offset of iterator */ if(H5HF__man_iter_start_offset(hdr, &hdr->next_block, hdr->man_iter_off) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to set block iterator location") } /* end if */ /* Get information about current iterator location */ - if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") /* Check for skipping over blocks in the current block */ @@ -1039,7 +1019,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") /* Get information about new iterator location */ - if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") } /* end if */ @@ -1057,16 +1037,16 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) } /* end if */ else { /* Move iterator up one level */ - if(H5HF_man_iter_up(&hdr->next_block) < 0) + if(H5HF__man_iter_up(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to advance current block iterator location") /* Increment location of next block at this level */ - if(H5HF_man_iter_next(hdr, &hdr->next_block, 1) < 0) + if(H5HF__man_iter_next(hdr, &hdr->next_block, 1) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't advance fractal heap block location") } /* end else */ /* Get information about new iterator location */ - if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") /* Indicate that we walked up */ @@ -1081,7 +1061,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) HDassert(!H5F_addr_defined(iblock->ents[next_entry].addr)); /* Compute # of rows in next child indirect block to use */ - child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[next_row]); + child_nrows = H5HF__dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[next_row]); /* Check for skipping over indirect blocks */ /* (that don't have direct blocks large enough to hold direct block size requested) */ @@ -1090,7 +1070,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) unsigned child_entry; /* Entry of child indirect block */ /* Compute # of rows needed in child indirect block */ - child_rows_needed = (H5VM_log2_of2((uint32_t)min_dblock_size) - H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size)) + 2; + child_rows_needed = (H5VM__log2_of2((uint32_t)min_dblock_size) - H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size)) + 2; HDassert(child_rows_needed > child_nrows); child_entry = (next_row + (child_rows_needed - child_nrows)) * hdr->man_dtable.cparam.width; if(child_entry > (iblock->nrows * hdr->man_dtable.cparam.width)) @@ -1114,7 +1094,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Move iterator down one level (pins indirect block) */ - if(H5HF_man_iter_down(&hdr->next_block, new_iblock) < 0) + if(H5HF__man_iter_down(&hdr->next_block, new_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to advance current block iterator location") /* Check for skipping over rows and add free section for skipped rows */ @@ -1135,7 +1115,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) } /* end else */ /* Get information about new iterator location */ - if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") /* Indicate that we walked down */ @@ -1150,24 +1130,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_hdr_inc_iter + * Function: H5HF__hdr_inc_iter * * Purpose: Advance "next block" iterator * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 23 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries) +H5HF__hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1177,7 +1156,7 @@ H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries) /* Advance the iterator for the current location within the indirect block */ if(hdr->next_block.curr) - if(H5HF_man_iter_next(hdr, &hdr->next_block, nentries) < 0) + if(H5HF__man_iter_next(hdr, &hdr->next_block, nentries) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to advance current block iterator location") /* Increment the offset of the iterator in the heap */ @@ -1185,7 +1164,7 @@ H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_inc_iter() */ +} /* end H5HF__hdr_inc_iter() */ /*------------------------------------------------------------------------- @@ -1197,7 +1176,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- @@ -1219,7 +1197,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) HDassert(hdr); /* Initialize block iterator, if necessary */ - if(!H5HF_man_iter_ready(&hdr->next_block)) + if(!H5HF__man_iter_ready(&hdr->next_block)) /* Start iterator with previous offset of iterator */ if(H5HF__man_iter_start_offset(hdr, &hdr->next_block, hdr->man_iter_off) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to set block iterator location") @@ -1227,7 +1205,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) /* Walk backwards through heap, looking for direct block to place iterator after */ /* Get information about current iterator location */ - if(H5HF_man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator information") /* Move current iterator position backwards once */ @@ -1253,11 +1231,11 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) /* Check for parent of current indirect block */ if(iblock->parent) { /* Move iterator to parent of current block */ - if(H5HF_man_iter_up(&hdr->next_block) < 0) + if(H5HF__man_iter_up(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to move current block iterator location up") /* Get information about current iterator location */ - if(H5HF_man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator information") /* Move current iterator position backwards once */ @@ -1271,7 +1249,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) hdr->man_iter_off = 0; /* Reset 'next block' iterator */ - if(H5HF_man_iter_reset(&hdr->next_block) < 0) + if(H5HF__man_iter_reset(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") } /* end else */ } /* end if */ @@ -1287,7 +1265,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) curr_entry++; /* Set the current location of the iterator to next entry after the existing direct block */ - if(H5HF_man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0) + if(H5HF__man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "unable to set current block iterator location") /* Update iterator offset */ @@ -1301,18 +1279,18 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) unsigned child_nrows; /* # of rows in child block */ /* Compute # of rows in next child indirect block to use */ - child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[row]); + child_nrows = H5HF__dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[row]); /* Lock child indirect block */ if(NULL == (child_iblock = H5HF__man_iblock_protect(hdr, iblock->ents[curr_entry].addr, child_nrows, iblock, curr_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Set the current location of the iterator */ - if(H5HF_man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0) + if(H5HF__man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "unable to set current block iterator location") /* Walk down into child indirect block (pins child block) */ - if(H5HF_man_iter_down(&hdr->next_block, child_iblock) < 0) + if(H5HF__man_iter_down(&hdr->next_block, child_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to advance current block iterator location") /* Update iterator location */ @@ -1342,7 +1320,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 17 2006 * *------------------------------------------------------------------------- @@ -1358,10 +1335,9 @@ H5HF__hdr_empty(H5HF_hdr_t *hdr) HDassert(hdr); /* Reset block iterator, if necessary */ - if(H5HF_man_iter_ready(&hdr->next_block)) { - if(H5HF_man_iter_reset(&hdr->next_block) < 0) + if(H5HF__man_iter_ready(&hdr->next_block)) + if(H5HF__man_iter_reset(&hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") - } /* end if */ /* Shrink managed heap size */ hdr->man_size = 0; @@ -1378,7 +1354,7 @@ H5HF__hdr_empty(H5HF_hdr_t *hdr) hdr->total_man_free = 0; /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark header as dirty") done: @@ -1387,24 +1363,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_hdr_free + * Function: H5HF__hdr_free * * Purpose: Free shared fractal heap header * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 27 2009 * *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_free(H5HF_hdr_t *hdr) +H5HF__hdr_free(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1412,7 +1387,7 @@ H5HF_hdr_free(H5HF_hdr_t *hdr) HDassert(hdr); /* Free the block size lookup table for the doubling table */ - if(H5HF_dtable_dest(&hdr->man_dtable) < 0) + if(H5HF__dtable_dest(&hdr->man_dtable) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap doubling table") /* Release any I/O pipeline filter information */ @@ -1425,7 +1400,7 @@ H5HF_hdr_free(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_free() */ +} /* end H5HF__hdr_free() */ /*------------------------------------------------------------------------- @@ -1436,7 +1411,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 5 2007 * *------------------------------------------------------------------------- diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index d496d62..065e7c3 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -15,7 +15,7 @@ * * Created: H5HFhuge.c * Aug 7 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Routines for "huge" objects in fractal heap * @@ -67,7 +67,7 @@ static herr_t H5HF__huge_bt2_create(H5HF_hdr_t *hdr); /* Local 'huge' object support routines */ -static hsize_t H5HF_huge_new_id(H5HF_hdr_t *hdr); +static hsize_t H5HF__huge_new_id(H5HF_hdr_t *hdr); static herr_t H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, hbool_t is_read, H5HF_operator_t op, void *op_data); @@ -95,7 +95,6 @@ static herr_t H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 7 2006 * *------------------------------------------------------------------------- @@ -168,22 +167,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_huge_init + * Function: H5HF__huge_init * * Purpose: Initialize information for tracking 'huge' objects * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 7 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_huge_init(H5HF_hdr_t *hdr) +H5HF__huge_init(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -196,10 +194,6 @@ H5HF_huge_init(H5HF_hdr_t *hdr) * the file in the heap ID (which will speed up accessing it) and we don't * have any I/O pipeline filters. */ -#ifdef QAK -HDfprintf(stderr, "%s: hdr->id_len = %u\n", "H5HF_huge_init", (unsigned)hdr->id_len); -HDfprintf(stderr, "%s: hdr->filter_len = %u\n", "H5HF_huge_init", (unsigned)hdr->filter_len); -#endif /* QAK */ if(hdr->filter_len > 0) { if((hdr->id_len - 1) >= (unsigned)(hdr->sizeof_addr + hdr->sizeof_size + 4 + hdr->sizeof_size)) { /* Indicate that v2 B-tree doesn't have to be used to locate object */ @@ -238,11 +232,11 @@ HDfprintf(stderr, "%s: hdr->filter_len = %u\n", "H5HF_huge_init", (unsigned)hdr- hdr->huge_bt2 = NULL; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_huge_init() */ +} /* end H5HF__huge_init() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_new_id + * Function: H5HF__huge_new_id * * Purpose: Determine a new ID for an indirectly accessed 'huge' object * (either filtered or not) @@ -250,18 +244,17 @@ HDfprintf(stderr, "%s: hdr->filter_len = %u\n", "H5HF_huge_init", (unsigned)hdr- * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 15 2006 * *------------------------------------------------------------------------- */ static hsize_t -H5HF_huge_new_id(H5HF_hdr_t *hdr) +H5HF__huge_new_id(H5HF_hdr_t *hdr) { hsize_t new_id; /* New object's ID */ hsize_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -287,7 +280,7 @@ H5HF_huge_new_id(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_new_id() */ +} /* end H5HF__huge_new_id() */ /*------------------------------------------------------------------------- @@ -298,7 +291,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 7 2006 * *------------------------------------------------------------------------- @@ -314,9 +306,6 @@ H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE -#ifdef QAK -HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); -#endif /* QAK */ /* * Check arguments. @@ -362,10 +351,6 @@ HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); if(H5Z_pipeline(&(hdr->pline), 0, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &write_size, &write_buf) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, FAIL, "output pipeline failed") -#ifdef QAK -HDfprintf(stderr, "%s: nbytes = %Zu, write_size = %Zu, write_buf = %p\n", FUNC, nbytes, write_size, write_buf); -HDfprintf(stderr, "%s: obj_size = %Zu, obj = %p\n", FUNC, obj_size, obj); -#endif /* QAK */ /* Update size of object on disk */ write_size = nbytes; @@ -399,9 +384,6 @@ HDfprintf(stderr, "%s: obj_size = %Zu, obj = %p\n", FUNC, obj_size, obj); obj_rec.len = write_size; obj_rec.filter_mask = filter_mask; obj_rec.obj_size = obj_size; -#ifdef QAK -HDfprintf(stderr, "%s: obj_rec = {%a, %Hu, %x, %Hu}\n", FUNC, obj_rec.addr, obj_rec.len, obj_rec.filter_mask, obj_rec.obj_size); -#endif /* QAK */ /* Insert record for object in v2 B-tree */ if(H5B2_insert(hdr->huge_bt2, &obj_rec) < 0) @@ -420,9 +402,6 @@ HDfprintf(stderr, "%s: obj_rec = {%a, %Hu, %x, %Hu}\n", FUNC, obj_rec.addr, obj_ /* Initialize record for tracking object in v2 B-tree */ obj_rec.addr = obj_addr; obj_rec.len = write_size; -#ifdef QAK -HDfprintf(stderr, "%s: obj_rec = {%a, %Hu}\n", FUNC, obj_rec.addr, obj_rec.len); -#endif /* QAK */ /* Insert record for object in v2 B-tree */ if(H5B2_insert(hdr->huge_bt2, &obj_rec) < 0) @@ -441,7 +420,7 @@ HDfprintf(stderr, "%s: obj_rec = {%a, %Hu}\n", FUNC, obj_rec.addr, obj_rec.len); hsize_t new_id; /* New ID for object */ /* Get new ID for object */ - if(0 == (new_id = H5HF_huge_new_id(hdr))) + if(0 == (new_id = H5HF__huge_new_id(hdr))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't generate new ID for object") if(hdr->filter_len > 0) { @@ -451,9 +430,6 @@ HDfprintf(stderr, "%s: obj_rec = {%a, %Hu}\n", FUNC, obj_rec.addr, obj_rec.len); filt_indir_rec.filter_mask = filter_mask; filt_indir_rec.obj_size = obj_size; filt_indir_rec.id = new_id; -#ifdef QAK -HDfprintf(stderr, "%s: filt_indir_rec = {%a, %Hu, %x, %Hu, %Hu}\n", FUNC, filt_indir_rec.addr, filt_indir_rec.len, filt_indir_rec.filter_mask, filt_indir_rec.obj_size, filt_indir_rec.id); -#endif /* QAK */ /* Set pointer to record to insert */ ins_rec = &filt_indir_rec; @@ -463,9 +439,6 @@ HDfprintf(stderr, "%s: filt_indir_rec = {%a, %Hu, %x, %Hu, %Hu}\n", FUNC, filt_i indir_rec.addr = obj_addr; indir_rec.len = write_size; indir_rec.id = new_id; -#ifdef QAK -HDfprintf(stderr, "%s: indir_rec = {%a, %Hu, %Hu}\n", FUNC, indir_rec.addr, indir_rec.len, indir_rec.id); -#endif /* QAK */ /* Set pointer to record to insert */ ins_rec = &indir_rec; @@ -485,7 +458,7 @@ HDfprintf(stderr, "%s: indir_rec = {%a, %Hu, %Hu}\n", FUNC, indir_rec.addr, indi hdr->huge_nobjs++; /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") done: @@ -501,7 +474,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 8 2006 * *------------------------------------------------------------------------- @@ -592,7 +564,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 8 2006 * *------------------------------------------------------------------------- @@ -678,7 +649,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 8 2006 * *------------------------------------------------------------------------- @@ -829,7 +799,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 21 2007 * *------------------------------------------------------------------------- @@ -907,7 +876,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sept 11 2006 * *------------------------------------------------------------------------- @@ -943,7 +911,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sept 11 2006 * *------------------------------------------------------------------------- @@ -980,7 +947,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 8 2006 * *------------------------------------------------------------------------- @@ -1072,7 +1038,7 @@ H5HF__huge_remove(H5HF_hdr_t *hdr, const uint8_t *id) hdr->huge_nobjs--; /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") done: @@ -1088,7 +1054,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 8 2006 * *------------------------------------------------------------------------- @@ -1134,7 +1099,7 @@ H5HF__huge_term(H5HF_hdr_t *hdr) hdr->huge_ids_wrapped = FALSE; /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end if */ @@ -1152,7 +1117,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 8 2006 * *------------------------------------------------------------------------- diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 07eb9cd..1c40d53 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -15,7 +15,7 @@ * * Created: H5HFiblock.c * Apr 10 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Indirect block routines for fractal heaps. * @@ -99,7 +99,6 @@ H5FL_SEQ_DEFINE(H5HF_indirect_ptr_t); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 17 2006 * *------------------------------------------------------------------------- @@ -166,7 +165,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 17 2006 * *------------------------------------------------------------------------- @@ -191,24 +189,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_iblock_incr + * Function: H5HF__iblock_incr * * Purpose: Increment reference count on shared indirect block * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 27 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_iblock_incr(H5HF_indirect_t *iblock) +H5HF__iblock_incr(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity checks */ HDassert(iblock); @@ -224,7 +221,7 @@ H5HF_iblock_incr(H5HF_indirect_t *iblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_iblock_incr() */ +} /* end H5HF__iblock_incr() */ /*------------------------------------------------------------------------- @@ -235,7 +232,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 27 2006 * *------------------------------------------------------------------------- @@ -299,8 +295,8 @@ H5HF__iblock_decr(H5HF_indirect_t *iblock) } /* end if */ else { /* Destroy the indirect block */ - if(H5HF_man_iblock_dest(iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") + if(H5HF__man_iblock_dest(iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") } /* end else */ } /* end if */ @@ -310,24 +306,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_iblock_dirty + * Function: H5HF__iblock_dirty * * Purpose: Mark indirect block as dirty * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 21 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_iblock_dirty(H5HF_indirect_t *iblock) +H5HF__iblock_dirty(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(iblock); @@ -338,7 +333,7 @@ H5HF_iblock_dirty(H5HF_indirect_t *iblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_iblock_dirty() */ +} /* end H5HF__iblock_dirty() */ /*------------------------------------------------------------------------- @@ -349,7 +344,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2006 * *------------------------------------------------------------------------- @@ -377,7 +371,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) nrows = hdr->man_dtable.cparam.start_root_rows; - block_row_off = H5VM_log2_of2((uint32_t)min_dblock_size) - H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size); + block_row_off = H5VM__log2_of2((uint32_t)min_dblock_size) - H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size); if(block_row_off > 0) block_row_off++; /* Account for the pair of initial rows of the initial block size */ rows_needed = 1 + block_row_off; @@ -418,7 +412,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") dblock->fd_parent = iblock; - if(H5HF_man_iblock_attach(iblock, 0, hdr->man_dtable.table_addr) < 0) + if(H5HF__man_iblock_attach(iblock, 0, hdr->man_dtable.table_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't attach root direct block to parent indirect block") /* Check for I/O filters on this heap */ @@ -443,7 +437,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) } /* end if */ /* Start iterator at correct location */ - if(H5HF_hdr_start_iter(hdr, iblock, (hsize_t)(have_direct_block ? hdr->man_dtable.cparam.start_block_size : 0), have_direct_block) < 0) + if(H5HF__hdr_start_iter(hdr, iblock, (hsize_t)(have_direct_block ? hdr->man_dtable.cparam.start_block_size : 0), have_direct_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize block iterator") /* Check for skipping over direct blocks, in order to get to large enough block */ @@ -454,7 +448,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") /* Mark indirect block as modified */ - if(H5HF_iblock_dirty(iblock) < 0) + if(H5HF__iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") /* Unprotect root indirect block (it's pinned by the iterator though) */ @@ -476,7 +470,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) acc_dblock_free -= hdr->man_dtable.row_tot_dblock_free[0]; /* Extend heap to cover new root indirect block */ - if(H5HF_hdr_adjust_heap(hdr, hdr->man_dtable.row_block_off[nrows], (hssize_t)acc_dblock_free) < 0) + if(H5HF__hdr_adjust_heap(hdr, hdr->man_dtable.row_block_off[nrows], (hssize_t)acc_dblock_free) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") done: @@ -492,7 +486,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 17 2006 * *------------------------------------------------------------------------- @@ -518,7 +511,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) FUNC_ENTER_PACKAGE /* Get "new block" iterator information */ - if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) + if(H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") next_size = hdr->man_dtable.row_block_size[next_row]; @@ -538,7 +531,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) skip_direct_rows = TRUE; /* Make certain we allocate at least the required row for the block requested */ - min_nrows = 1 + H5HF_dtable_size_to_row(&hdr->man_dtable, min_dblock_size); + min_nrows = 1 + H5HF__dtable_size_to_row(&hdr->man_dtable, min_dblock_size); /* Set the information for the next block, of the appropriate size */ new_next_entry = (min_nrows - 1) * hdr->man_dtable.cparam.width; @@ -644,7 +637,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) } /* end if */ /* Mark indirect block as dirty */ - if(H5HF_iblock_dirty(iblock) < 0) + if(H5HF__iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") /* Update other shared header info */ @@ -652,7 +645,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) hdr->man_dtable.table_addr = new_addr; /* Extend heap to cover new root indirect block */ - if(H5HF_hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1], (hssize_t)acc_dblock_free) < 0) + if(H5HF__hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1], (hssize_t)acc_dblock_free) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") done: @@ -668,7 +661,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jun 12 2006 * *------------------------------------------------------------------------- @@ -697,7 +689,7 @@ H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock) max_child_row = iblock->max_child / hdr->man_dtable.cparam.width; /* Compute new # of rows in root indirect block */ - new_nrows = (unsigned)1 << (1 + H5VM_log2_gen((uint64_t)max_child_row)); + new_nrows = (unsigned)1 << (1 + H5VM__log2_gen((uint64_t)max_child_row)); /* Check if the indirect block is NOT currently allocated in temp. file space */ /* (temp. file space does not need to be freed) */ @@ -769,7 +761,7 @@ H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock) } /* end if */ /* Mark indirect block as dirty */ - if(H5HF_iblock_dirty(iblock) < 0) + if(H5HF__iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") /* Update other shared header info */ @@ -777,7 +769,7 @@ H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock) hdr->man_dtable.table_addr = new_addr; /* Shrink heap to only cover new root indirect block */ - if(H5HF_hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1], -(hssize_t)acc_dblock_free) < 0) + if(H5HF__hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1], -(hssize_t)acc_dblock_free) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce space to cover root direct block") done: @@ -796,7 +788,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- @@ -856,11 +847,11 @@ H5HF__man_iblock_root_revert(H5HF_indirect_t *root_iblock) hdr->man_dtable.table_addr = dblock_addr; /* Reset 'next block' iterator */ - if(H5HF_hdr_reset_iter(hdr, (hsize_t)dblock_size) < 0) + if(H5HF__hdr_reset_iter(hdr, (hsize_t)dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") /* Extend heap to just cover first direct block */ - if(H5HF_hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size, (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0) + if(H5HF__hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size, (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") /* Scan free space sections to reset any 'parent' pointers */ @@ -886,7 +877,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- @@ -919,11 +909,11 @@ H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node) HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section") /* Get a pointer to the indirect block covering the section */ - if(NULL == (iblock = H5HF_sect_row_get_iblock(old_sec_node))) + if(NULL == (iblock = H5HF__sect_row_get_iblock(old_sec_node))) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve indirect block for row section") /* Hold indirect block in memory, until direct block can point to it */ - if(H5HF_iblock_incr(iblock) < 0) + if(H5HF__iblock_incr(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") iblock_held = TRUE; @@ -953,7 +943,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 6 2006 * *------------------------------------------------------------------------- @@ -986,7 +975,7 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, /* Share common heap information */ iblock->hdr = hdr; - if(H5HF_hdr_incr(hdr) < 0) + if(H5HF__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared heap header") /* Set info for indirect block */ @@ -1050,7 +1039,7 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, iblock->par_entry = par_entry; if(iblock->parent) { /* Attach new block to parent */ - if(H5HF_man_iblock_attach(iblock->parent, par_entry, *addr_p) < 0) + if(H5HF__man_iblock_attach(iblock->parent, par_entry, *addr_p) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't attach indirect block to parent indirect block") /* Compute the indirect block's offset in the heap's address space */ @@ -1080,7 +1069,7 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, done: if(ret_value < 0) if(iblock) - if(H5HF_man_iblock_dest(iblock) < 0) + if(H5HF__man_iblock_dest(iblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") FUNC_LEAVE_NOAPI(ret_value) @@ -1095,7 +1084,6 @@ done: * Return: Pointer to indirect block on success, NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 17 2006 * *------------------------------------------------------------------------- @@ -1226,7 +1214,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 17 2006 * *------------------------------------------------------------------------- @@ -1273,24 +1260,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_attach + * Function: H5HF__man_iblock_attach * * Purpose: Attach a child block (direct or indirect) to an indirect block * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 30 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_addr) +H5HF__man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_addr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1300,7 +1286,7 @@ H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_ad HDassert(!H5F_addr_defined(iblock->ents[entry].addr)); /* Increment the reference count on this indirect block */ - if(H5HF_iblock_incr(iblock) < 0) + if(H5HF__iblock_incr(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Point at the child block */ @@ -1329,12 +1315,12 @@ H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_ad iblock->nchildren++; /* Mark indirect block as modified */ - if(H5HF_iblock_dirty(iblock) < 0) + if(H5HF__iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_attach() */ +} /* end H5HF__man_iblock_attach() */ /*------------------------------------------------------------------------- @@ -1345,7 +1331,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- @@ -1451,7 +1436,7 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry) /* If the indirect block wasn't removed already (by reverting it) */ if(!iblock->removed_from_cache) { /* Mark indirect block as modified */ - if(H5HF_iblock_dirty(iblock) < 0) + if(H5HF__iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") /* Check for last child being removed from indirect block */ @@ -1551,22 +1536,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_entry_addr + * Function: H5HF__man_iblock_entry_addr * * Purpose: Retrieve the address of an indirect block's child * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr) +H5HF__man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -1578,7 +1562,7 @@ H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *chi *child_addr = iblock->ents[entry].addr; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iblock_entry_addr() */ +} /* end H5HF__man_iblock_entry_addr() */ /*------------------------------------------------------------------------- @@ -1593,7 +1577,6 @@ H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *chi * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 7 2006 * *------------------------------------------------------------------------- @@ -1653,7 +1636,7 @@ H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, row_block_size = (hsize_t)hdr->man_dtable.row_block_size[row]; /* Compute # of rows in next child indirect block to use */ - child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, row_block_size); + child_nrows = H5HF__dtable_size_to_rows(&hdr->man_dtable, row_block_size); /* Delete child indirect block */ if(H5HF__man_iblock_delete(hdr, iblock->ents[entry].addr, child_nrows, iblock, entry) < 0) @@ -1739,10 +1722,10 @@ H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, size_t u; /* Local index variable */ entry = hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width; - first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + - H5VM_log2_of2(hdr->man_dtable.cparam.width); + first_row_bits = H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + + H5VM__log2_of2(hdr->man_dtable.cparam.width); num_indirect_rows = - (H5VM_log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1; + (H5VM__log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1; for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++, num_indirect_rows++) { size_t v; /* Local index variable */ @@ -1774,7 +1757,6 @@ done: * Return: Non-negative on success / Negative on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * Jan 14 2018 * *------------------------------------------------------------------------- @@ -1799,7 +1781,7 @@ H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, HDassert(ret_entry); /* Look up row & column for object */ - if(H5HF_dtable_lookup(&hdr->man_dtable, block_off, &row, &col) < 0) + if(H5HF__dtable_lookup(&hdr->man_dtable, block_off, &row, &col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of block") /* Sanity check - first lookup must be an indirect block */ @@ -1823,7 +1805,7 @@ H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, prev_col = col; /* Look up row & column in new indirect block for object */ - if(H5HF_dtable_lookup(&hdr->man_dtable, (block_off - par_block_off), &row, &col) < 0) + if(H5HF__dtable_lookup(&hdr->man_dtable, (block_off - par_block_off), &row, &col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of block") } /* end while */ @@ -1841,24 +1823,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_dest + * Function: H5HF__man_iblock_dest * * Purpose: Destroys a fractal heap indirect block in memory. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 6 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_dest(H5HF_indirect_t *iblock) +H5HF__man_iblock_dest(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1868,7 +1849,7 @@ H5HF_man_iblock_dest(H5HF_indirect_t *iblock) /* Decrement reference count on shared info */ HDassert(iblock->hdr); - if(H5HF_hdr_decr(iblock->hdr) < 0) + if(H5HF__hdr_decr(iblock->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") if(iblock->parent) if(H5HF__iblock_decr(iblock->parent) < 0) @@ -1887,5 +1868,5 @@ H5HF_man_iblock_dest(H5HF_indirect_t *iblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_dest() */ +} /* end H5HF__man_iblock_dest() */ diff --git a/src/H5HFiter.c b/src/H5HFiter.c index ceebc3b..002ff01 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -15,7 +15,7 @@ * * Created: H5HFiter.c * Apr 24 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Block iteration routines for fractal heaps. * @@ -77,7 +77,7 @@ H5FL_DEFINE(H5HF_block_loc_t); /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_init + * Function: H5HF__man_iter_init * * Purpose: Initialize a block iterator for walking over all the blocks * in a fractal heap. (initialization finishes when iterator is @@ -86,15 +86,14 @@ H5FL_DEFINE(H5HF_block_loc_t); * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_init(H5HF_block_iter_t *biter) +H5HF__man_iter_init(H5HF_block_iter_t *biter) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -105,7 +104,7 @@ H5HF_man_iter_init(H5HF_block_iter_t *biter) HDmemset(biter, 0, sizeof(H5HF_block_iter_t)); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iter_init() */ +} /* end H5HF__man_iter_init() */ /*------------------------------------------------------------------------- @@ -117,7 +116,6 @@ H5HF_man_iter_init(H5HF_block_iter_t *biter) * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- @@ -212,7 +210,7 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, /* Compute # of rows in context indirect block */ child_size = hdr->man_dtable.row_block_size[biter->curr->up->row]; - iblock_nrows = (H5VM_log2_gen(child_size) - hdr->man_dtable.first_row_bits) + 1; + iblock_nrows = (H5VM__log2_gen(child_size) - hdr->man_dtable.first_row_bits) + 1; } /* end else */ /* Load indirect block for this context location */ @@ -223,7 +221,7 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, biter->curr->context = iblock; /* Hold the indirect block with the location */ - if(H5HF_iblock_incr(biter->curr->context) < 0) + if(H5HF__iblock_incr(biter->curr->context) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Release the current indirect block */ @@ -265,22 +263,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_set_entry + * Function: H5HF__man_iter_set_entry * * Purpose: Set the current entry for the iterator * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry) +H5HF__man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -293,11 +290,11 @@ H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigne biter->curr->col = entry % hdr->man_dtable.cparam.width; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iter_set_entry() */ +} /* end H5HF__man_iter_set_entry() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_start_entry + * Function: H5HF__man_iter_start_entry * * Purpose: Initialize a block iterator to a particular location within * an indirect block @@ -305,19 +302,18 @@ H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigne * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, +H5HF__man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock, unsigned start_entry) { H5HF_block_loc_t *new_loc = NULL; /* Pointer to new block location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -339,7 +335,7 @@ H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, new_loc->up = NULL; /* Increment reference count on indirect block */ - if(H5HF_iblock_incr(new_loc->context) < 0) + if(H5HF__iblock_incr(new_loc->context) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Make new location the current location */ @@ -353,11 +349,11 @@ done: new_loc = H5FL_FREE(H5HF_block_loc_t, new_loc); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iter_start_entry() */ +} /* end H5HF__man_iter_start_entry() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_reset + * Function: H5HF__man_iter_reset * * Purpose: Reset a block iterator to it's initial state, freeing any * location context it currently has @@ -365,17 +361,16 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_reset(H5HF_block_iter_t *biter) +H5HF__man_iter_reset(H5HF_block_iter_t *biter) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -414,26 +409,25 @@ H5HF_man_iter_reset(H5HF_block_iter_t *biter) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iter_reset() */ +} /* end H5HF__man_iter_reset() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_next + * Function: H5HF__man_iter_next * * Purpose: Advance to the next block within the current block of the heap * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries) +H5HF__man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -450,29 +444,28 @@ H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries) /* HDassert(biter->curr->row <= biter->curr->context->nrows); */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iter_next() */ +} /* end H5HF__man_iter_next() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_up + * Function: H5HF__man_iter_up * * Purpose: Move iterator up one level * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_up(H5HF_block_iter_t *biter) +H5HF__man_iter_up(H5HF_block_iter_t *biter) { H5HF_block_loc_t *up_loc; /* Pointer to 'up' block location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -498,29 +491,28 @@ H5HF_man_iter_up(H5HF_block_iter_t *biter) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iter_up() */ +} /* end H5HF__man_iter_up() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_down + * Function: H5HF__man_iter_down * * Purpose: Move iterator down one level * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock) +H5HF__man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock) { H5HF_block_loc_t *down_loc = NULL; /* Pointer to new 'down' block location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -542,7 +534,7 @@ H5HF_man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock) down_loc->up = biter->curr; /* Increment reference count on indirect block */ - if(H5HF_iblock_incr(down_loc->context) < 0) + if(H5HF__iblock_incr(down_loc->context) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Make down location the current location */ @@ -553,27 +545,26 @@ done: down_loc = H5FL_FREE(H5HF_block_loc_t, down_loc); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iter_down() */ +} /* end H5HF__man_iter_down() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_curr + * Function: H5HF__man_iter_curr * * Purpose: Retrieve information about the current block iterator location * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, +H5HF__man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsigned *entry, H5HF_indirect_t **block) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -592,66 +583,25 @@ H5HF_man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, *block = biter->curr->context; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iter_curr() */ - - -/*------------------------------------------------------------------------- - * Function: H5HF_man_iter_offset - * - * Purpose: Retrieve offset of iterator in heap - * - * Return: SUCCEED/FAIL - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Apr 25 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5HF_man_iter_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t *offset) -{ - hsize_t curr_offset; /* For computing offset in heap */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* - * Check arguments. - */ - HDassert(biter); - HDassert(biter->ready); - HDassert(biter->curr->context); - HDassert(offset); - - /* Compute the offset in the heap */ - curr_offset = biter->curr->context->block_off; - curr_offset += hdr->man_dtable.row_block_off[biter->curr->row]; - curr_offset += biter->curr->col * hdr->man_dtable.row_block_size[biter->curr->row]; - - /* Assign the return value */ - *offset = curr_offset; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_iter_offset() */ +} /* end H5HF__man_iter_curr() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_ready + * Function: H5HF__man_iter_ready * * Purpose: Query if iterator is ready to use * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Apr 25 2006 * *------------------------------------------------------------------------- */ hbool_t -H5HF_man_iter_ready(H5HF_block_iter_t *biter) +H5HF__man_iter_ready(H5HF_block_iter_t *biter) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -659,5 +609,5 @@ H5HF_man_iter_ready(H5HF_block_iter_t *biter) HDassert(biter); FUNC_LEAVE_NOAPI(biter->ready) -} /* end H5HF_man_iter_ready() */ +} /* end H5HF__man_iter_ready() */ diff --git a/src/H5HFman.c b/src/H5HFman.c index ea00546..7a2f93c 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -15,7 +15,7 @@ * * Created: H5HFman.c * Feb 24 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: "Managed" object routines for fractal heaps. * @@ -97,7 +97,6 @@ static herr_t H5HF__man_op_real(H5HF_hdr_t *hdr, const uint8_t *id, * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 13 2006 * *------------------------------------------------------------------------- @@ -154,7 +153,7 @@ H5HF__man_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) HDassert(sec_node->sect_info.state == H5FS_SECT_LIVE); /* Retrieve direct block address from section */ - if(H5HF_sect_single_dblock_info(hdr, sec_node, &dblock_addr, &dblock_size) < 0) + if(H5HF__sect_single_dblock_info(hdr, sec_node, &dblock_addr, &dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve direct block information") /* Lock direct block */ @@ -197,7 +196,7 @@ H5HF__man_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) hdr->man_nobjs++; /* Reduce space available in heap (marks header dirty) */ - if(H5HF_hdr_adj_free(hdr, -(ssize_t)obj_size) < 0) + if(H5HF__hdr_adj_free(hdr, -(ssize_t)obj_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't adjust free space for heap") done: @@ -215,22 +214,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_get_obj_len + * Function: H5HF__man_get_obj_len * * Purpose: Get the size of a managed heap object * * Return: SUCCEED (Can't fail) * - * Programmer: Dana Robinson (derobins@hdfgroup.org) + * Programmer: Dana Robinson * August 2012 * *------------------------------------------------------------------------- */ herr_t -H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) +H5HF__man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -249,7 +248,7 @@ H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) UINT64DECODE_VAR(id, *obj_len_p, hdr->heap_len_size); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_man_get_obj_len() */ +} /* end H5HF__man_get_obj_len() */ /*------------------------------------------------------------------------- @@ -260,7 +259,6 @@ H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) * Return: SUCCEED (Can't fail) * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 20 2015 * *------------------------------------------------------------------------- @@ -296,7 +294,6 @@ H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 17 2006 * *------------------------------------------------------------------------- @@ -445,7 +442,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 17 2006 * *------------------------------------------------------------------------- @@ -465,7 +461,7 @@ H5HF__man_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) HDassert(obj); /* Call the internal 'op' routine routine */ - if(H5HF__man_op_real(hdr, id, H5HF_op_read, obj, 0) < 0) + if(H5HF__man_op_real(hdr, id, H5HF__op_read, obj, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: @@ -481,7 +477,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2006 * *------------------------------------------------------------------------- @@ -502,7 +497,7 @@ H5HF__man_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj) /* Call the internal 'op' routine routine */ /* (Casting away const OK - QAK) */ - if(H5HF__man_op_real(hdr, id, H5HF_op_write, (void *)obj, H5HF_OP_MODIFY) < 0) + if(H5HF__man_op_real(hdr, id, H5HF__op_write, (void *)obj, H5HF_OP_MODIFY) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: @@ -518,7 +513,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sept 11 2006 * *------------------------------------------------------------------------- @@ -554,7 +548,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 15 2006 * *------------------------------------------------------------------------- @@ -643,7 +636,7 @@ H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id) HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "object overruns end of direct block") /* Create free space section node */ - if(NULL == (sec_node = H5HF_sect_single_new(obj_off, obj_len, iblock, dblock_entry))) + if(NULL == (sec_node = H5HF__sect_single_new(obj_off, obj_len, iblock, dblock_entry))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create section for direct block's free space") /* Unlock indirect block */ @@ -654,7 +647,7 @@ H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id) } /* end if */ /* Increase space available in heap (marks header dirty) */ - if(H5HF_hdr_adj_free(hdr, (ssize_t)obj_len) < 0) + if(H5HF__hdr_adj_free(hdr, (ssize_t)obj_len) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't adjust free space for heap") /* Update statistics about heap */ diff --git a/src/H5HFmodule.h b/src/H5HFmodule.h index dd6576a..0334673 100644 --- a/src/H5HFmodule.h +++ b/src/H5HFmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 83e46fc..ca05798 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 24, 2006 * * Purpose: This file contains declarations which are visible only within @@ -134,7 +134,7 @@ /* Compute the # of bytes required to store an offset into a given buffer size */ #define H5HF_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8) -#define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5VM_log2_of2((unsigned)(l))) +#define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5VM__log2_of2((unsigned)(l))) /* Heap ID bit flags */ /* Heap ID version (2 bits: 6-7) */ @@ -220,9 +220,6 @@ typedef struct H5HF_dtable_t { /* Fractal heap free list info (forward decl - defined in H5HFflist.c) */ typedef struct H5HF_freelist_t H5HF_freelist_t; -/* Forward decl indirect block info */ -typedef struct H5HF_indirect_t H5HF_indirect_t; - /* Fractal heap block location */ typedef struct H5HF_block_loc_t { /* Necessary table fields */ @@ -293,7 +290,7 @@ typedef struct H5HF_free_section_t { /* (Each fractal heap header has certain information that is shared across all * the instances of blocks in that fractal heap) */ -typedef struct H5HF_hdr_t { +struct H5HF_hdr_t { /* Information for H5AC cache functions, _must_ be first field in structure */ H5AC_info_t cache_info; @@ -358,7 +355,7 @@ typedef struct H5HF_hdr_t { uint8_t heap_off_size; /* Size of heap offsets (in bytes) */ uint8_t heap_len_size; /* Size of heap ID lengths (in bytes) */ hbool_t checked_filters; /* TRUE if pipeline passes can_apply checks */ -} H5HF_hdr_t; +}; /* Common indirect block doubling table entry */ /* (common between entries pointing to direct & indirect child blocks) */ @@ -606,46 +603,45 @@ H5FL_BLK_EXTERN(direct_block); /******************************/ /* Doubling table routines */ -H5_DLL herr_t H5HF_dtable_init(H5HF_dtable_t *dtable); -H5_DLL herr_t H5HF_dtable_dest(H5HF_dtable_t *dtable); -H5_DLL herr_t H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, +H5_DLL herr_t H5HF__dtable_init(H5HF_dtable_t *dtable); +H5_DLL herr_t H5HF__dtable_dest(H5HF_dtable_t *dtable); +H5_DLL herr_t H5HF__dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsigned *col); -H5_DLL unsigned H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size); -H5_DLL unsigned H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size); -H5_DLL hsize_t H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, +H5_DLL unsigned H5HF__dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size); +H5_DLL unsigned H5HF__dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size); +H5_DLL hsize_t H5HF__dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned start_col, unsigned num_entries); /* Heap header routines */ -H5_DLL H5HF_hdr_t * H5HF_hdr_alloc(H5F_t *f); -H5_DLL haddr_t H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam); +H5_DLL H5HF_hdr_t * H5HF__hdr_alloc(H5F_t *f); +H5_DLL haddr_t H5HF__hdr_create(H5F_t *f, const H5HF_create_t *cparam); H5_DLL H5HF_hdr_t *H5HF__hdr_protect(H5F_t *f, haddr_t addr, unsigned flags); -H5_DLL herr_t H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_finish_init(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_incr(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_decr(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr); -H5_DLL size_t H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_dirty(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt); -H5_DLL herr_t H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free); -H5_DLL herr_t H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size); -H5_DLL herr_t H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, unsigned curr_entry); +H5_DLL herr_t H5HF__hdr_finish_init_phase1(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_finish_init_phase2(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_finish_init(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_incr(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_decr(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_fuse_incr(H5HF_hdr_t *hdr); +H5_DLL size_t H5HF__hdr_fuse_decr(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_dirty(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt); +H5_DLL herr_t H5HF__hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free); +H5_DLL herr_t H5HF__hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size); +H5_DLL herr_t H5HF__hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, unsigned curr_entry); H5_DLL herr_t H5HF__hdr_skip_blocks(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries); H5_DLL herr_t H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size); -H5_DLL herr_t H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries); +H5_DLL herr_t H5HF__hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries); H5_DLL herr_t H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr); -H5_DLL herr_t H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off); +H5_DLL herr_t H5HF__hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off); H5_DLL herr_t H5HF__hdr_empty(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_free(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_free(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF__hdr_delete(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_dest(H5HF_hdr_t *hdr); /* Indirect block routines */ -H5_DLL herr_t H5HF_iblock_incr(H5HF_indirect_t *iblock); +H5_DLL herr_t H5HF__iblock_incr(H5HF_indirect_t *iblock); H5_DLL herr_t H5HF__iblock_decr(H5HF_indirect_t *iblock); -H5_DLL herr_t H5HF_iblock_dirty(H5HF_indirect_t *iblock); +H5_DLL herr_t H5HF__iblock_dirty(H5HF_indirect_t *iblock); H5_DLL herr_t H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size); H5_DLL herr_t H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, @@ -659,10 +655,10 @@ H5_DLL H5HF_indirect_t *H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock hbool_t must_protect, unsigned flags, hbool_t *did_protect); H5_DLL herr_t H5HF__man_iblock_unprotect(H5HF_indirect_t *iblock, unsigned cache_flags, hbool_t did_protect); -H5_DLL herr_t H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, +H5_DLL herr_t H5HF__man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t dblock_addr); H5_DLL herr_t H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry); -H5_DLL herr_t H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, +H5_DLL herr_t H5HF__man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr); H5_DLL herr_t H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nrows, H5HF_indirect_t *par_iblock, unsigned par_entry); @@ -670,7 +666,7 @@ H5_DLL herr_t H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, hsize_t *heap_size/*out*/); H5_DLL herr_t H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, hsize_t *ret_par_block_off, unsigned *ret_entry); -H5_DLL herr_t H5HF_man_iblock_dest(H5HF_indirect_t *iblock); +H5_DLL herr_t H5HF__man_iblock_dest(H5HF_indirect_t *iblock); /* Direct block routines */ H5_DLL herr_t H5HF__man_dblock_new(H5HF_hdr_t *fh, size_t request, @@ -688,12 +684,12 @@ H5_DLL herr_t H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, unsigned flags); H5_DLL herr_t H5HF__man_dblock_delete(H5F_t *f, haddr_t dblock_addr, hsize_t dblock_size); -H5_DLL herr_t H5HF_man_dblock_dest(H5HF_direct_t *dblock); +H5_DLL herr_t H5HF__man_dblock_dest(H5HF_direct_t *dblock); /* Managed object routines */ H5_DLL herr_t H5HF__man_insert(H5HF_hdr_t *fh, size_t obj_size, const void *obj, void *id); -H5_DLL herr_t H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, +H5_DLL herr_t H5HF__man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p); H5_DLL void H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off_p); @@ -704,7 +700,7 @@ H5_DLL herr_t H5HF__man_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t o H5_DLL herr_t H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id); /* 'Huge' object routines */ -H5_DLL herr_t H5HF_huge_init(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__huge_init(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *id); H5_DLL herr_t H5HF__huge_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, @@ -731,46 +727,32 @@ H5_DLL herr_t H5HF__huge_bt2_filt_dir_found(const void *nrecord, void *op_data); H5_DLL herr_t H5HF__huge_bt2_filt_dir_remove(const void *nrecord, void *op_data); /* 'Tiny' object routines */ -H5_DLL herr_t H5HF_tiny_init(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, +H5_DLL herr_t H5HF__tiny_init(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *id); -H5_DLL herr_t H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, +H5_DLL herr_t H5HF__tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p); -H5_DLL herr_t H5HF_tiny_read(H5HF_hdr_t *fh, const uint8_t *id, void *obj); -H5_DLL herr_t H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, +H5_DLL herr_t H5HF__tiny_read(H5HF_hdr_t *fh, const uint8_t *id, void *obj); +H5_DLL herr_t H5HF__tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data); -H5_DLL herr_t H5HF_tiny_remove(H5HF_hdr_t *fh, const uint8_t *id); - -/* Debugging routines for dumping file structures */ -H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, - FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, haddr_t addr, - FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, haddr_t addr, - FILE *stream, int indent, int fwidth, haddr_t hdr_addr, size_t nrec); -H5_DLL void H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, - FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5HF_iblock_debug(H5F_t *f, haddr_t addr, - FILE *stream, int indent, int fwidth, haddr_t hdr_addr, unsigned nrows); +H5_DLL herr_t H5HF__tiny_remove(H5HF_hdr_t *fh, const uint8_t *id); /* Block iteration routines */ -H5_DLL herr_t H5HF_man_iter_init(H5HF_block_iter_t *biter); +H5_DLL herr_t H5HF__man_iter_init(H5HF_block_iter_t *biter); H5_DLL herr_t H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t offset); -H5_DLL herr_t H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, +H5_DLL herr_t H5HF__man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock, unsigned start_entry); -H5_DLL herr_t H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry); -H5_DLL herr_t H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, +H5_DLL herr_t H5HF__man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries); -H5_DLL herr_t H5HF_man_iter_up(H5HF_block_iter_t *biter); -H5_DLL herr_t H5HF_man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock); -H5_DLL herr_t H5HF_man_iter_reset(H5HF_block_iter_t *biter); -H5_DLL herr_t H5HF_man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, +H5_DLL herr_t H5HF__man_iter_up(H5HF_block_iter_t *biter); +H5_DLL herr_t H5HF__man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock); +H5_DLL herr_t H5HF__man_iter_reset(H5HF_block_iter_t *biter); +H5_DLL herr_t H5HF__man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsigned *entry, H5HF_indirect_t **block); -H5_DLL herr_t H5HF_man_iter_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, - hsize_t *offset); -H5_DLL hbool_t H5HF_man_iter_ready(H5HF_block_iter_t *biter); +H5_DLL hbool_t H5HF__man_iter_ready(H5HF_block_iter_t *biter); /* Free space manipulation routines */ H5_DLL herr_t H5HF__space_start(H5HF_hdr_t *hdr, hbool_t may_create); @@ -789,24 +771,24 @@ H5_DLL herr_t H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, uint16_t new_class); /* Free space section routines */ -H5_DLL H5HF_free_section_t *H5HF_sect_single_new(hsize_t sect_off, +H5_DLL H5HF_free_section_t *H5HF__sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent, unsigned par_entry); H5_DLL herr_t H5HF__sect_single_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); -H5_DLL herr_t H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, haddr_t *dblock_addr, size_t *dblock_size); H5_DLL herr_t H5HF__sect_single_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, size_t amt); H5_DLL herr_t H5HF__sect_row_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); H5_DLL herr_t H5HF__sect_row_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned *entry_p); -H5_DLL H5HF_indirect_t *H5HF_sect_row_get_iblock(H5HF_free_section_t *sect); +H5_DLL H5HF_indirect_t *H5HF__sect_row_get_iblock(H5HF_free_section_t *sect); H5_DLL herr_t H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries); H5_DLL herr_t H5HF__sect_single_free(H5FS_section_info_t *sect); /* Internal operator callbacks */ -H5_DLL herr_t H5HF_op_read(const void *obj, size_t obj_len, void *op_data); -H5_DLL herr_t H5HF_op_write(const void *obj, size_t obj_len, void *op_data); +H5_DLL herr_t H5HF__op_read(const void *obj, size_t obj_len, void *op_data); +H5_DLL herr_t H5HF__op_write(const void *obj, size_t obj_len, void *op_data); /* Testing routines */ #ifdef H5HF_TESTING diff --git a/src/H5HFprivate.h b/src/H5HFprivate.h index 4eec1c1..4919b90 100644 --- a/src/H5HFprivate.h +++ b/src/H5HFprivate.h @@ -15,7 +15,7 @@ * * Created: H5HFprivate.h * Feb 24 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private header for library accessible fractal heap routines. * @@ -86,8 +86,10 @@ typedef struct H5HF_stat_t { hsize_t tiny_nobjs; /* Number of 'tiny' objects in heap */ } H5HF_stat_t; -/* Fractal heap info (forward decl - defined in H5HFpkg.h) */ +/* Fractal heap info (forward decls - defined in H5HFpkg.h) */ typedef struct H5HF_t H5HF_t; +typedef struct H5HF_hdr_t H5HF_hdr_t; +typedef struct H5HF_indirect_t H5HF_indirect_t; /* Typedef for 'op' operations */ typedef herr_t (*H5HF_operator_t)(const void *obj/*in*/, size_t obj_len, @@ -128,5 +130,17 @@ H5_DLL herr_t H5HF_id_print(H5HF_t *fh, const void *id, FILE *stream, int indent H5_DLL herr_t H5HF_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth); #endif /* H5HF_DEBUGGING */ +/* Debugging routines for dumping file structures */ +H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, + FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, haddr_t addr, + FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, haddr_t addr, + FILE *stream, int indent, int fwidth, haddr_t hdr_addr, size_t nrec); +H5_DLL void H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, + FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5HF_iblock_debug(H5F_t *f, haddr_t addr, + FILE *stream, int indent, int fwidth, haddr_t hdr_addr, unsigned nrows); + #endif /* _H5HFprivate_H */ diff --git a/src/H5HFsection.c b/src/H5HFsection.c index a0f984b..b2d1e3c 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 1, 2006 * * Purpose: Free space section routines for fractal heaps @@ -68,12 +68,12 @@ typedef struct { /********************/ /* Shared routines */ -static herr_t H5HF_sect_init_cls(H5FS_section_class_t *cls, +static herr_t H5FS__sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr); -static herr_t H5HF_sect_term_cls(H5FS_section_class_t *cls); -static H5HF_free_section_t *H5HF_sect_node_new(unsigned sect_type, +static herr_t H5FS__sect_term_cls(H5FS_section_class_t *cls); +static H5HF_free_section_t *H5FS__sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, H5FS_section_state_t state); -static herr_t H5HF_sect_node_free(H5HF_free_section_t *sect, +static herr_t H5HF__sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *parent); /* 'single' section routines */ @@ -99,12 +99,12 @@ static herr_t H5HF__sect_single_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t *sect); /* 'row' section routines */ -static H5HF_free_section_t *H5HF_sect_row_create(haddr_t sect_off, +static H5HF_free_section_t *H5HF__sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsigned row, unsigned col, unsigned nentries, H5HF_free_section_t *under_sect); static herr_t H5HF__sect_row_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); static herr_t H5HF__sect_row_parent_removed(H5HF_free_section_t *sect); -static herr_t H5HF_sect_row_from_single(H5HF_hdr_t *hdr, +static herr_t H5HF__sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direct_t *dblock); static herr_t H5HF__sect_row_free_real(H5HF_free_section_t *sect); @@ -131,7 +131,7 @@ static herr_t H5HF__sect_row_debug(const H5FS_section_info_t *sect, FILE *stream, int indent, int fwidth); /* 'indirect' section routines */ -static H5HF_free_section_t *H5HF_sect_indirect_new(H5HF_hdr_t *hdr, +static H5HF_free_section_t *H5HF__sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5HF_indirect_t *iblock, hsize_t iblock_off, unsigned row, unsigned col, unsigned nentries); @@ -139,9 +139,9 @@ static herr_t H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t hbool_t first_child, H5HF_free_section_t **first_row_sect, unsigned space_flags, unsigned start_row, unsigned start_col, unsigned end_row, unsigned end_col); -static H5HF_free_section_t *H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, +static H5HF_free_section_t *H5HF__sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_section_t *row_sect); -static herr_t H5HF_sect_indirect_decr(H5HF_free_section_t *sect); +static herr_t H5HF__sect_indirect_decr(H5HF_free_section_t *sect); static herr_t H5HF__sect_indirect_revive_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); static herr_t H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, @@ -152,28 +152,28 @@ static herr_t H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned child_entry); static herr_t H5HF__sect_indirect_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); -static hbool_t H5HF_sect_indirect_is_first(H5HF_free_section_t *sect); -static H5HF_indirect_t * H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect); -static hsize_t H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect); -static H5HF_free_section_t * H5HF_sect_indirect_top(H5HF_free_section_t *sect); +static hbool_t H5HF__sect_indirect_is_first(H5HF_free_section_t *sect); +static H5HF_indirect_t * H5HF__sect_indirect_get_iblock(H5HF_free_section_t *sect); +static hsize_t H5HF__sect_indirect_iblock_off(const H5HF_free_section_t *sect); +static H5HF_free_section_t *H5HF__sect_indirect_top(H5HF_free_section_t *sect); static herr_t H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect1, H5HF_free_section_t *sect2); static herr_t H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); static herr_t H5HF__sect_indirect_shrink(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, +static herr_t H5HF__sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, uint8_t *buf); static H5FS_section_info_t *H5HF__sect_indirect_deserialize(H5HF_hdr_t *hdr, const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags); -static herr_t H5HF_sect_indirect_free(H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, +static herr_t H5HF__sect_indirect_free(H5HF_free_section_t *sect); +static herr_t H5HF__sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_debug(const H5HF_free_section_t *sect, +static herr_t H5HF__sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int indent, int fwidth); /* 'indirect' section callbacks */ -static herr_t H5HF_sect_indirect_init_cls(H5FS_section_class_t *cls, void *udata); -static herr_t H5HF_sect_indirect_term_cls(H5FS_section_class_t *cls); +static herr_t H5HF__sect_indirect_init_cls(H5FS_section_class_t *cls, void *udata); +static herr_t H5HF__sect_indirect_term_cls(H5FS_section_class_t *cls); /*********************/ @@ -273,8 +273,8 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_INDIRECT[1] = {{ NULL, /* Class private info */ /* Class methods */ - H5HF_sect_indirect_init_cls, /* Initialize section class */ - H5HF_sect_indirect_term_cls, /* Terminate section class */ + H5HF__sect_indirect_init_cls, /* Initialize section class */ + H5HF__sect_indirect_term_cls, /* Terminate section class */ /* Object methods */ NULL, /* Add section */ @@ -306,7 +306,7 @@ H5FL_DEFINE(H5HF_free_section_t); /*------------------------------------------------------------------------- - * Function: H5HF_sect_init_cls + * Function: H5FS__sect_init_cls * * Purpose: Initialize the common class structure * @@ -319,12 +319,12 @@ H5FL_DEFINE(H5HF_free_section_t); *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr) +H5FS__sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr) { H5HF_sect_private_t *cls_prvt; /* Pointer to class private info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); @@ -339,16 +339,16 @@ H5HF_sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr) cls->cls_private = cls_prvt; /* Increment reference count on heap header */ - if(H5HF_hdr_incr(hdr) < 0) + if(H5HF__hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared heap header") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_init_cls() */ +} /* H5FS__sect_init_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_term_cls + * Function: H5FS__sect_term_cls * * Purpose: Terminate the common class structure * @@ -361,12 +361,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_term_cls(H5FS_section_class_t *cls) +H5FS__sect_term_cls(H5FS_section_class_t *cls) { H5HF_sect_private_t *cls_prvt; /* Pointer to class private info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); @@ -375,7 +375,7 @@ H5HF_sect_term_cls(H5FS_section_class_t *cls) cls_prvt = (H5HF_sect_private_t *)cls->cls_private; /* Decrement reference count on heap header */ - if(H5HF_hdr_decr(cls_prvt->hdr) < 0) + if(H5HF__hdr_decr(cls_prvt->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") /* Free the class private information */ @@ -383,11 +383,11 @@ H5HF_sect_term_cls(H5FS_section_class_t *cls) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_term_cls() */ +} /* H5FS__sect_term_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_node_new + * Function: H5FS__sect_node_new * * Purpose: Allocate a free space section node of a particular type * @@ -401,13 +401,13 @@ done: *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF_sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, +H5FS__sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, H5FS_section_state_t sect_state) { H5HF_free_section_t *new_sect; /* New section */ H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(H5F_addr_defined(sect_addr)); @@ -429,11 +429,11 @@ H5HF_sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_node_new() */ +} /* H5FS__sect_node_new() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_node_free + * Function: H5HF__sect_node_free * * Purpose: Free a section node * @@ -447,11 +447,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock) +H5HF__sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(sect); @@ -465,30 +465,29 @@ H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_node_free() */ +} /* H5HF__sect_node_free() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_new + * Function: H5HF__sect_single_new * * Purpose: Create a new 'single' section and return it to the caller * * Return: Pointer to new section on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 30 2006 * *------------------------------------------------------------------------- */ H5HF_free_section_t * -H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, +H5HF__sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent, unsigned par_entry) { H5HF_free_section_t *sect = NULL; /* 'Single' free space section to add */ H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -496,13 +495,13 @@ H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, HDassert(sect_size); /* Create free space section node */ - if(NULL == (sect = H5HF_sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_off, (hsize_t)sect_size, H5FS_SECT_LIVE))) + if(NULL == (sect = H5FS__sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_off, (hsize_t)sect_size, H5FS_SECT_LIVE))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for single section") /* Set the 'single' specific fields */ sect->u.single.parent = parent; if(sect->u.single.parent) { - if(H5HF_iblock_incr(sect->u.single.parent) < 0) + if(H5HF__iblock_incr(sect->u.single.parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared indirect block") } /* end if */ sect->u.single.par_entry = par_entry; @@ -517,7 +516,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_single_new() */ +} /* end H5HF__sect_single_new() */ /*------------------------------------------------------------------------- @@ -528,7 +527,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * October 24 2006 * *------------------------------------------------------------------------- @@ -556,7 +554,7 @@ H5HF__sect_single_locate_parent(H5HF_hdr_t *hdr, hbool_t refresh, HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section") /* Increment reference count on indirect block that free section is in */ - if(H5HF_iblock_incr(sec_iblock) < 0) + if(H5HF__iblock_incr(sec_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Check for refreshing existing parent information */ @@ -590,7 +588,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 8 2006 * *------------------------------------------------------------------------- @@ -631,23 +628,22 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_dblock_info + * Function: H5HF__sect_single_dblock_info * * Purpose: Retrieve the direct block information for a single section * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * October 24 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, +H5HF__sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, haddr_t *dblock_addr, size_t *dblock_size) { - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -673,7 +669,7 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_sect_single_dblock_info() */ +} /* end H5HF__sect_single_dblock_info() */ /*------------------------------------------------------------------------- @@ -686,7 +682,6 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 31 2006 * *------------------------------------------------------------------------- @@ -752,7 +747,7 @@ H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) size_t dblock_overhead; /* Direct block's overhead */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect); @@ -760,7 +755,7 @@ H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) HDassert(hdr); /* Retrieve direct block address from section */ - if(H5HF_sect_single_dblock_info(hdr, sect, &dblock_addr, &dblock_size) < 0) + if(H5HF__sect_single_dblock_info(hdr, sect, &dblock_addr, &dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve direct block information") /* Check for section occupying entire direct block */ @@ -776,7 +771,7 @@ H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) HDassert(H5F_addr_eq(dblock->block_off + dblock_overhead, sect->sect_info.addr)); /* Convert 'single' section into 'row' section */ - if(H5HF_sect_row_from_single(hdr, sect, dblock) < 0) + if(H5HF__sect_row_from_single(hdr, sect, dblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCONVERT, FAIL, "can't convert single section into row section") /* Destroy direct block */ @@ -876,7 +871,7 @@ H5HF__sect_single_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, HDassert(sect_size); /* Create free list section node */ - if(NULL == (new_sect = H5HF_sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_addr, sect_size, H5FS_SECT_SERIALIZED))) + if(NULL == (new_sect = H5FS__sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_addr, sect_size, H5FS_SECT_SERIALIZED))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "allocation failed for direct block free list section") /* Set return value */ @@ -1086,7 +1081,7 @@ H5HF__sect_single_shrink(H5FS_section_info_t **_sect, void *_udata) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't revive single free section") /* Retrieve direct block address from section */ - if(H5HF_sect_single_dblock_info(hdr, (*sect), &dblock_addr, &dblock_size) < 0) + if(H5HF__sect_single_dblock_info(hdr, (*sect), &dblock_addr, &dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve direct block information") /* Protect the direct block for the section */ @@ -1140,14 +1135,13 @@ H5HF__sect_single_free(H5FS_section_info_t *_sect) HDassert(sect); /* Check for live reference to an indirect block */ - if(sect->sect_info.state == H5FS_SECT_LIVE) { + if(sect->sect_info.state == H5FS_SECT_LIVE) /* Get parent indirect block, if there was one */ if(sect->u.single.parent) parent = sect->u.single.parent; - } /* end if */ /* Release the section */ - if(H5HF_sect_node_free(sect, parent) < 0) + if(H5HF__sect_node_free(sect, parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") done: @@ -1194,7 +1188,7 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5 HDassert(H5F_addr_defined(iblock->ents[sect->u.single.par_entry].addr)); /* Retrieve direct block address from section */ - status = H5HF_sect_single_dblock_info(iblock->hdr, (const H5HF_free_section_t *)sect, &dblock_addr, &dblock_size); + status = H5HF__sect_single_dblock_info(iblock->hdr, (const H5HF_free_section_t *)sect, &dblock_addr, &dblock_size); HDassert(status >= 0); HDassert(H5F_addr_eq(iblock->ents[sect->u.single.par_entry].addr, dblock_addr)); HDassert(dblock_size > 0); @@ -1239,7 +1233,7 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5 /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_create + * Function: H5HF__sect_row_create * * Purpose: Create a new 'row' section * @@ -1253,13 +1247,13 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5 *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, +H5HF__sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsigned row, unsigned col, unsigned nentries, H5HF_free_section_t *under_sect) { H5HF_free_section_t *sect = NULL; /* 'Row' section created */ H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect_size); @@ -1268,7 +1262,7 @@ H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, /* Create 'row' free space section node */ /* ("inherits" underlying indirect section's state) */ - if(NULL == (sect = H5HF_sect_node_new((unsigned)(is_first ? H5HF_FSPACE_SECT_FIRST_ROW : H5HF_FSPACE_SECT_NORMAL_ROW), sect_off, sect_size, under_sect->sect_info.state))) + if(NULL == (sect = H5FS__sect_node_new((unsigned)(is_first ? H5HF_FSPACE_SECT_FIRST_ROW : H5HF_FSPACE_SECT_NORMAL_ROW), sect_off, sect_size, under_sect->sect_info.state))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for row section") /* Set the 'row' specific fields */ @@ -1283,29 +1277,28 @@ H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_create() */ +} /* H5HF__sect_row_create() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_from_single + * Function: H5HF__sect_row_from_single * * Purpose: Convert a 'single' section into a 'row' section * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, +H5HF__sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direct_t *dblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -1323,7 +1316,7 @@ H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, sect->u.row.checked_out = FALSE; /* Create indirect section that underlies the row section */ - if(NULL == (sect->u.row.under = H5HF_sect_indirect_for_row(hdr, dblock->parent, sect))) + if(NULL == (sect->u.row.under = H5HF__sect_indirect_for_row(hdr, dblock->parent, sect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "serializing row section not supported yet") /* Release single section's hold on underlying indirect block */ @@ -1332,7 +1325,7 @@ H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_row_from_single() */ +} /* end H5HF__sect_row_from_single() */ /*------------------------------------------------------------------------- @@ -1343,7 +1336,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- @@ -1391,7 +1383,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- @@ -1467,7 +1458,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -1501,24 +1491,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_get_iblock + * Function: H5HF__sect_row_get_iblock * * Purpose: Retrieve the indirect block for a row section * * Return: Pointer to indirect block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 9 2006 * *------------------------------------------------------------------------- */ H5HF_indirect_t * -H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) +H5HF__sect_row_get_iblock(H5HF_free_section_t *sect) { H5HF_indirect_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -1528,10 +1517,10 @@ H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); HDassert(sect->sect_info.state == H5FS_SECT_LIVE); - ret_value = H5HF_sect_indirect_get_iblock(sect->u.row.under); + ret_value = H5HF__sect_indirect_get_iblock(sect->u.row.under); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_row_get_iblock() */ +} /* end H5HF__sect_row_get_iblock() */ /*------------------------------------------------------------------------- @@ -1543,7 +1532,6 @@ H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) * Return: Non-negative on success / Negative on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * February 4 2018 * *------------------------------------------------------------------------- @@ -1617,7 +1605,7 @@ H5HF__sect_row_init_cls(H5FS_section_class_t *cls, void *_udata) HDassert(hdr); /* Call common class initialization */ - if(H5HF_sect_init_cls(cls, hdr) < 0) + if(H5FS__sect_init_cls(cls, hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize common section class") /* First row sections actually are proxies for indirection sections on disk */ @@ -1659,7 +1647,7 @@ H5HF__sect_row_term_cls(H5FS_section_class_t *cls) HDassert(cls); /* Call common class termination */ - if(H5HF_sect_term_cls(cls) < 0) + if(H5FS__sect_term_cls(cls) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't terminate common section class") done: @@ -1700,7 +1688,7 @@ H5HF__sect_row_serialize(const H5FS_section_class_t *cls, /* Forward to indirect routine to serialize underlying section */ hdr = ((H5HF_sect_private_t *)(cls->cls_private))->hdr; - if(H5HF_sect_indirect_serialize(hdr, sect->u.row.under, buf) < 0) + if(H5HF__sect_indirect_serialize(hdr, sect->u.row.under, buf) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSERIALIZE, FAIL, "can't serialize row section's underlying indirect section") done: @@ -1785,22 +1773,20 @@ H5HF__sect_row_can_merge(const H5FS_section_info_t *_sect1, HDassert(H5F_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); /* Get the top indirect section underlying each row */ - top_indir_sect1 = H5HF_sect_indirect_top(sect1->u.row.under); + top_indir_sect1 = H5HF__sect_indirect_top(sect1->u.row.under); HDassert(top_indir_sect1); - top_indir_sect2 = H5HF_sect_indirect_top(sect2->u.row.under); + top_indir_sect2 = H5HF__sect_indirect_top(sect2->u.row.under); HDassert(top_indir_sect2); /* Check if second section shares the same underlying indirect block as * the first section, but doesn't already have same underlying indirect * section. */ - if(top_indir_sect1 != top_indir_sect2) { - if(H5HF_sect_indirect_iblock_off(sect1->u.row.under) == H5HF_sect_indirect_iblock_off(sect2->u.row.under)) { + if(top_indir_sect1 != top_indir_sect2) + if(H5HF__sect_indirect_iblock_off(sect1->u.row.under) == H5HF__sect_indirect_iblock_off(sect2->u.row.under)) /* Check if second section adjoins first section */ if(H5F_addr_eq((top_indir_sect1->sect_info.addr + top_indir_sect1->u.indirect.span_size), top_indir_sect2->sect_info.addr)) HGOTO_DONE(TRUE) - } /* end if */ - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1846,7 +1832,7 @@ H5HF__sect_row_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, H5HF_free_section_t *top_indir_sect; /* Top indirect section for row */ /* Get the top indirect section underlying second row section */ - top_indir_sect = H5HF_sect_indirect_top(sect2->u.row.under); + top_indir_sect = H5HF__sect_indirect_top(sect2->u.row.under); /* Shrink away underlying indirect section */ if(H5HF__sect_indirect_shrink(hdr, top_indir_sect) < 0) @@ -1934,7 +1920,7 @@ H5HF__sect_row_shrink(H5FS_section_info_t **_sect, void *_udata) HDassert((*sect)->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); /* Get the top indirect section underlying each row */ - top_indir_sect = H5HF_sect_indirect_top((*sect)->u.row.under); + top_indir_sect = H5HF__sect_indirect_top((*sect)->u.row.under); /* Shrink away underlying indirect section */ if(H5HF__sect_indirect_shrink(hdr, top_indir_sect) < 0) @@ -1972,7 +1958,7 @@ H5HF__sect_row_free_real(H5HF_free_section_t *sect) HDassert(sect); /* Release the section */ - if(H5HF_sect_node_free(sect, NULL) < 0) + if(H5HF__sect_node_free(sect, NULL) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") done: @@ -2006,7 +1992,7 @@ H5HF__sect_row_free(H5FS_section_info_t *_sect) HDassert(sect->u.row.under); /* Decrement the ref. count on the row section's underlying indirect section */ - if(H5HF_sect_indirect_decr(sect->u.row.under) < 0) + if(H5HF__sect_indirect_decr(sect->u.row.under) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't detach section node") /* Release the section */ @@ -2069,10 +2055,10 @@ H5HF__sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t HDassert(sect->u.row.row == indir_sect->u.indirect.row); /* Get the top indirect section underlying row */ - top_indir_sect = H5HF_sect_indirect_top(sect->u.row.under); + top_indir_sect = H5HF__sect_indirect_top(sect->u.row.under); /* Check that the row's underlying indirect section is valid */ - H5HF_sect_indirect_valid(hdr, top_indir_sect); + H5HF__sect_indirect_valid(hdr, top_indir_sect); } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) @@ -2119,7 +2105,7 @@ H5HF__sect_row_debug(const H5FS_section_info_t *_sect, FILE *stream, int indent, HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, "Underlying indirect section:"); - H5HF_sect_indirect_debug(sect->u.row.under, stream, indent + 3, MAX(0, fwidth - 3)); + H5HF__sect_indirect_debug(sect->u.row.under, stream, indent + 3, MAX(0, fwidth - 3)); } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) @@ -2127,24 +2113,23 @@ H5HF__sect_row_debug(const H5FS_section_info_t *_sect, FILE *stream, int indent, /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_iblock_off + * Function: H5HF__sect_indirect_iblock_off * * Purpose: Get the offset of the indirect block for the section * * Return: Offset of indirect block in "heap space" (can't fail) * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static hsize_t -H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect) +H5HF__sect_indirect_iblock_off(const H5HF_free_section_t *sect) { hsize_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -2154,28 +2139,27 @@ H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect) ret_value = sect->sect_info.state == H5FS_SECT_LIVE ? sect->u.indirect.u.iblock->block_off : sect->u.indirect.u.iblock_off; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_iblock_off() */ +} /* end H5HF__sect_indirect_iblock_off() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_top + * Function: H5HF__sect_indirect_top * * Purpose: Get the "top" indirect section * * Return: Pointer to the top indirect section (can't fail) * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF_sect_indirect_top(H5HF_free_section_t *sect) +H5HF__sect_indirect_top(H5HF_free_section_t *sect) { H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -2183,16 +2167,16 @@ H5HF_sect_indirect_top(H5HF_free_section_t *sect) HDassert(sect); if(sect->u.indirect.parent) - ret_value = H5HF_sect_indirect_top(sect->u.indirect.parent); + ret_value = H5HF__sect_indirect_top(sect->u.indirect.parent); else ret_value = sect; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_top() */ +} /* end H5HF__sect_indirect_top() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_init_cls + * Function: H5HF__sect_indirect_init_cls * * Purpose: Initialize the "indirect" class structure * @@ -2206,19 +2190,19 @@ H5HF_sect_indirect_top(H5HF_free_section_t *sect) *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_init_cls(H5FS_section_class_t *cls, void *_udata) +H5HF__sect_indirect_init_cls(H5FS_section_class_t *cls, void *_udata) { H5HF_hdr_t *hdr = (H5HF_hdr_t *)_udata; /* Fractal heap header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); HDassert(hdr); /* Call to common class initialization */ - if(H5HF_sect_init_cls(cls, hdr) < 0) + if(H5FS__sect_init_cls(cls, hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize common section class") /* Set the size of all serialized objects of this class of sections */ @@ -2226,11 +2210,11 @@ H5HF_sect_indirect_init_cls(H5FS_section_class_t *cls, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_indirect_init_cls() */ +} /* H5HF__sect_indirect_init_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_term_cls + * Function: H5HF__sect_indirect_term_cls * * Purpose: Terminate the "indirect" class structure * @@ -2244,26 +2228,26 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_term_cls(H5FS_section_class_t *cls) +H5HF__sect_indirect_term_cls(H5FS_section_class_t *cls) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); /* Call common class termination */ - if(H5HF_sect_term_cls(cls) < 0) + if(H5FS__sect_term_cls(cls) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't terminate common section class") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_indirect_term_cls() */ +} /* H5HF__sect_indirect_term_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_new + * Function: H5HF__sect_indirect_new * * Purpose: Create a new 'indirect' section for other routines to finish * initializing. @@ -2271,20 +2255,19 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, +H5HF__sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5HF_indirect_t *iblock, hsize_t iblock_off, unsigned row, unsigned col, unsigned nentries) { H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */ H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2293,7 +2276,7 @@ H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, HDassert(nentries); /* Create free space section node */ - if(NULL == (sect = H5HF_sect_node_new(H5HF_FSPACE_SECT_INDIRECT, sect_off, + if(NULL == (sect = H5FS__sect_node_new(H5HF_FSPACE_SECT_INDIRECT, sect_off, sect_size, (iblock ? H5FS_SECT_LIVE : H5FS_SECT_SERIALIZED)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for indirect section") @@ -2302,7 +2285,7 @@ H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, sect->u.indirect.u.iblock = iblock; sect->u.indirect.iblock_entries = hdr->man_dtable.cparam.width * sect->u.indirect.u.iblock->max_rows; - if(H5HF_iblock_incr(sect->u.indirect.u.iblock) < 0) + if(H5HF__iblock_incr(sect->u.indirect.u.iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared indirect block") } /* end if */ else { @@ -2314,7 +2297,7 @@ H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, sect->u.indirect.num_entries = nentries; /* Compute span size of indirect section */ - sect->u.indirect.span_size = H5HF_dtable_span_size(&hdr->man_dtable, + sect->u.indirect.span_size = H5HF__dtable_span_size(&hdr->man_dtable, row, col, nentries); HDassert(sect->u.indirect.span_size > 0); @@ -2332,30 +2315,29 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_new() */ +} /* end H5HF__sect_indirect_new() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_for_row + * Function: H5HF__sect_indirect_for_row * * Purpose: Create the underlying indirect section for a new row section * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static H5HF_free_section_t * -H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, +H5HF__sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_section_t *row_sect) { H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */ H5HF_free_section_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2366,7 +2348,7 @@ H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, HDassert(row_sect->u.row.row < hdr->man_dtable.max_direct_rows); /* Create free space section node */ - if(NULL == (sect = H5HF_sect_indirect_new(hdr, row_sect->sect_info.addr, + if(NULL == (sect = H5HF__sect_indirect_new(hdr, row_sect->sect_info.addr, row_sect->sect_info.size, iblock, iblock->block_off, row_sect->u.row.row, row_sect->u.row.col, row_sect->u.row.num_entries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create indirect section") @@ -2391,11 +2373,11 @@ H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, done: if(!ret_value && sect) - if(H5HF_sect_indirect_free(sect) < 0) + if(H5HF__sect_indirect_free(sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "can't free indirect section node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_for_row() */ +} /* end H5HF__sect_indirect_for_row() */ /*------------------------------------------------------------------------- @@ -2407,7 +2389,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- @@ -2521,7 +2502,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_free_section_t *row_sect = NULL; /* 'Row' free space section to add */ /* Create 'row' free space section node */ - if(NULL == (row_sect = H5HF_sect_row_create(curr_off, + if(NULL == (row_sect = H5HF__sect_row_create(curr_off, (hdr->man_dtable.row_block_size[u] - dblock_overhead), first_child, u, row_col, row_entries, sect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "creation failed for child row section") @@ -2558,7 +2539,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned v; /* Local index variable */ /* Compute info about row's indirect blocks for child section */ - child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[u]); + child_nrows = H5HF__dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[u]); child_nentries = child_nrows * hdr->man_dtable.cparam.width; /* Add an indirect section for each indirect block in the row */ @@ -2570,7 +2551,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, haddr_t child_iblock_addr; /* Child indirect block's address on disk */ /* Get the address of the child indirect block */ - if(H5HF_man_iblock_entry_addr(sect->u.indirect.u.iblock, curr_entry, &child_iblock_addr) < 0) + if(H5HF__man_iblock_entry_addr(sect->u.indirect.u.iblock, curr_entry, &child_iblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve child indirect block's address") /* If the child indirect block's address is defined, protect it */ @@ -2585,7 +2566,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, child_iblock = NULL; /* Create free space section node */ - if(NULL == (child_sect = H5HF_sect_indirect_new(hdr, curr_off, (hsize_t)0, + if(NULL == (child_sect = H5HF__sect_indirect_new(hdr, curr_off, (hsize_t)0, child_iblock, curr_off, 0, 0, child_nentries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") @@ -2658,7 +2639,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 3 2006 * *------------------------------------------------------------------------- @@ -2702,7 +2682,7 @@ H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start sect_off += hdr->man_dtable.row_block_size[start_row] * start_col; /* Create free space section node */ - if(NULL == (sect = H5HF_sect_indirect_new(hdr, sect_off, (hsize_t)0, iblock, + if(NULL == (sect = H5HF__sect_indirect_new(hdr, sect_off, (hsize_t)0, iblock, iblock->block_off, start_row, start_col, nentries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") @@ -2720,7 +2700,7 @@ H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start done: if(ret_value < 0 && sect) - if(H5HF_sect_indirect_free(sect) < 0) + if(H5HF__sect_indirect_free(sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") FUNC_LEAVE_NOAPI(ret_value) @@ -2728,24 +2708,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_decr + * Function: H5HF__sect_indirect_decr * * Purpose: Decrement ref. count on indirect section * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 6 2006 * *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_decr(H5HF_free_section_t *sect) +H5HF__sect_indirect_decr(H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2764,18 +2743,18 @@ H5HF_sect_indirect_decr(H5HF_free_section_t *sect) par_sect = sect->u.indirect.parent; /* Free indirect section */ - if(H5HF_sect_indirect_free(sect) < 0) + if(H5HF__sect_indirect_free(sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") /* Decrement ref. count on indirect section's parent */ if(par_sect) - if(H5HF_sect_indirect_decr(par_sect) < 0) + if(H5HF__sect_indirect_decr(par_sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't decrement ref. count on parent indirect section") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_decr() */ +} /* end H5HF__sect_indirect_decr() */ /*------------------------------------------------------------------------- @@ -2786,7 +2765,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 3 2006 * *------------------------------------------------------------------------- @@ -2832,7 +2810,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -2854,7 +2831,7 @@ H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_indi HDassert(sect_iblock); /* Increment reference count on indirect block that free section is in */ - if(H5HF_iblock_incr(sect_iblock) < 0) + if(H5HF__iblock_incr(sect_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") /* Set the pointer to the section's indirect block */ @@ -2891,7 +2868,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -2954,7 +2930,7 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, hbool_t is_first; /* Flag to indicate that this section is the first section in hierarchy */ /* Check if this section is the first section */ - is_first = H5HF_sect_indirect_is_first(sect); + is_first = H5HF__sect_indirect_is_first(sect); /* Remove this indirect section from parent indirect section */ if(H5HF__sect_indirect_reduce(hdr, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0) @@ -3069,7 +3045,7 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, } /* end else */ /* Create peer indirect section */ - if(NULL == (peer_sect = H5HF_sect_indirect_new(hdr, sect->sect_info.addr, + if(NULL == (peer_sect = H5HF__sect_indirect_new(hdr, sect->sect_info.addr, sect->sect_info.size, iblock, iblock_off, start_row, start_col, peer_nentries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") @@ -3144,7 +3120,7 @@ done: /* Sanity check - we should only be here if an error occurred */ HDassert(ret_value < 0); - if(H5HF_sect_indirect_free(peer_sect) < 0) + if(H5HF__sect_indirect_free(peer_sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") } /* end if */ @@ -3162,7 +3138,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -3203,7 +3178,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_t is_first; /* Flag to indicate that this section is the first section in hierarchy */ /* Check if this section is the first section */ - is_first = H5HF_sect_indirect_is_first(sect); + is_first = H5HF__sect_indirect_is_first(sect); /* Reduce parent indirect section */ if(H5HF__sect_indirect_reduce(hdr, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0) @@ -3298,7 +3273,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, /* Update the number of entries in current section & calculate it's span size */ /* (Will use this to compute the section address for the peer section */ sect->u.indirect.num_entries = new_nentries; - sect->u.indirect.span_size = H5HF_dtable_span_size(&hdr->man_dtable, + sect->u.indirect.span_size = H5HF__dtable_span_size(&hdr->man_dtable, sect->u.indirect.row, sect->u.indirect.col, new_nentries); HDassert(sect->u.indirect.span_size > 0); @@ -3308,7 +3283,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, peer_sect_addr += hdr->man_dtable.row_block_size[child_row]; /* Create peer indirect section */ - if(NULL == (peer_sect = H5HF_sect_indirect_new(hdr, peer_sect_addr, + if(NULL == (peer_sect = H5HF__sect_indirect_new(hdr, peer_sect_addr, sect->sect_info.size, iblock, iblock_off, peer_start_row, peer_start_col, peer_nentries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") @@ -3370,7 +3345,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, /* Decrement # of sections which depend on this row */ /* (Must be last as section can be freed) */ - if(H5HF_sect_indirect_decr(sect) < 0) + if(H5HF__sect_indirect_decr(sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't decrement section's ref. count ") done: @@ -3380,7 +3355,7 @@ done: /* Sanity check - we should only be here if an error occurred */ HDassert(ret_value < 0); - if(H5HF_sect_indirect_free(peer_sect) < 0) + if(H5HF__sect_indirect_free(peer_sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") } /* end if */ @@ -3389,24 +3364,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_is_first + * Function: H5HF__sect_indirect_is_first * * Purpose: Check if indirect section is first in all parents * * Return: Non-negative (TRUE/FALSE) on success/ * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 17 2006 * *------------------------------------------------------------------------- */ static hbool_t -H5HF_sect_indirect_is_first(H5HF_free_section_t *sect) +H5HF__sect_indirect_is_first(H5HF_free_section_t *sect) { hbool_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(sect); @@ -3414,13 +3388,13 @@ H5HF_sect_indirect_is_first(H5HF_free_section_t *sect) /* Recurse to parent */ if(sect->u.indirect.parent) { if(sect->sect_info.addr == sect->u.indirect.parent->sect_info.addr) - ret_value = H5HF_sect_indirect_is_first(sect->u.indirect.parent); + ret_value = H5HF__sect_indirect_is_first(sect->u.indirect.parent); } /* end if */ else ret_value = TRUE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_is_first() */ +} /* end H5HF__sect_indirect_is_first() */ /*------------------------------------------------------------------------- @@ -3431,7 +3405,6 @@ H5HF_sect_indirect_is_first(H5HF_free_section_t *sect) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -3476,22 +3449,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_get_iblock + * Function: H5HF__sect_indirect_get_iblock * * Purpose: Retrieve the indirect block for a indirect section * * Return: Pointer to indirect block on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 9 2006 * *------------------------------------------------------------------------- */ static H5HF_indirect_t * -H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect) +H5HF__sect_indirect_get_iblock(H5HF_free_section_t *sect) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -3501,7 +3473,7 @@ H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect) HDassert(sect->sect_info.state == H5FS_SECT_LIVE); FUNC_LEAVE_NOAPI(sect->u.indirect.u.iblock) -} /* end H5HF_sect_indirect_get_iblock() */ +} /* end H5HF__sect_indirect_get_iblock() */ /*------------------------------------------------------------------------- @@ -3545,9 +3517,9 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, HDassert(row_sect2->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); /* Set up indirect section information */ - sect1 = H5HF_sect_indirect_top(row_sect1->u.row.under); + sect1 = H5HF__sect_indirect_top(row_sect1->u.row.under); HDassert(sect1); - sect2 = H5HF_sect_indirect_top(row_sect2->u.row.under); + sect2 = H5HF__sect_indirect_top(row_sect2->u.row.under); HDassert(sect2); /* Sanity check some assumptions about the indirect sections */ @@ -3722,11 +3694,11 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, /* Decrement ref. count on second indirect section's parent */ HDassert(sect2->u.indirect.rc == 0); if(sect2->u.indirect.parent) - if(H5HF_sect_indirect_decr(sect2->u.indirect.parent) < 0) + if(H5HF__sect_indirect_decr(sect2->u.indirect.parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't decrement ref. count on parent indirect section") /* Free second indirect section */ - if(H5HF_sect_indirect_free(sect2) < 0) + if(H5HF__sect_indirect_free(sect2) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") /* Re-add the second section's first row */ @@ -3806,7 +3778,7 @@ H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) HDassert(par_row >= hdr->man_dtable.max_direct_rows); /* Create parent indirect section */ - if(NULL == (par_sect = H5HF_sect_indirect_new(hdr, sect->sect_info.addr, + if(NULL == (par_sect = H5HF__sect_indirect_new(hdr, sect->sect_info.addr, sect->sect_info.size, par_iblock, par_block_off, par_row, par_col, 1))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") @@ -3828,7 +3800,7 @@ H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) done: if(ret_value < 0) - if(par_sect && H5HF_sect_indirect_free(par_sect) < 0) + if(par_sect && H5HF__sect_indirect_free(par_sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") FUNC_LEAVE_NOAPI(ret_value) @@ -3883,7 +3855,7 @@ H5HF__sect_indirect_shrink(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free child section node") /* Free the indirect section itself */ - if(H5HF_sect_indirect_free(sect) < 0) + if(H5HF__sect_indirect_free(sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") done: @@ -3892,7 +3864,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_serialize + * Function: H5HF__sect_indirect_serialize * * Purpose: Serialize a "live" indirect section into a buffer * @@ -3906,12 +3878,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, +H5HF__sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, uint8_t *buf) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(hdr); @@ -3921,7 +3893,7 @@ H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, /* Check if this indirect section has a parent & forward if this section is first */ if(sect->u.indirect.parent) { if(sect->sect_info.addr == sect->u.indirect.parent->sect_info.addr) - if(H5HF_sect_indirect_serialize(hdr, sect->u.indirect.parent, buf) < 0) + if(H5HF__sect_indirect_serialize(hdr, sect->u.indirect.parent, buf) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSERIALIZE, FAIL, "can't serialize indirect section's parent indirect section") } /* end if */ else { @@ -3945,7 +3917,7 @@ H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_indirect_serialize() */ +} /* H5HF__sect_indirect_serialize() */ /*------------------------------------------------------------------------- @@ -3997,7 +3969,7 @@ H5HF__sect_indirect_deserialize(H5HF_hdr_t *hdr, const uint8_t *buf, UINT16DECODE(buf, nentries); /* Create free space section node */ - if(NULL == (new_sect = H5HF_sect_indirect_new(hdr, sect_addr, sect_size, + if(NULL == (new_sect = H5HF__sect_indirect_new(hdr, sect_addr, sect_size, NULL, iblock_off, start_row, start_col, nentries))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create indirect section") @@ -4027,7 +3999,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_free + * Function: H5HF__sect_indirect_free * * Purpose: Free a 'indirect' section node * @@ -4041,12 +4013,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_free(H5HF_free_section_t *sect) +H5HF__sect_indirect_free(H5HF_free_section_t *sect) { H5HF_indirect_t *iblock = NULL; /* Indirect block for section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(sect); @@ -4057,23 +4029,22 @@ H5HF_sect_indirect_free(H5HF_free_section_t *sect) sect->u.indirect.indir_ents = (H5HF_free_section_t **)H5MM_xfree(sect->u.indirect.indir_ents); /* Check for live reference to an indirect block */ - if(sect->sect_info.state == H5FS_SECT_LIVE) { + if(sect->sect_info.state == H5FS_SECT_LIVE) /* Get indirect block, if there was one */ if(sect->u.indirect.u.iblock) iblock = sect->u.indirect.u.iblock; - } /* end if */ /* Release the sections */ - if(H5HF_sect_node_free(sect, iblock) < 0) + if(H5HF__sect_node_free(sect, iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_indirect_free() */ +} /* H5HF__sect_indirect_free() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_valid + * Function: H5HF__sect_indirect_valid * * Purpose: Check the validity of a section * @@ -4086,7 +4057,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) +H5HF__sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) { unsigned start_row; /* Row for first block covered */ unsigned start_col; /* Column for first block covered */ @@ -4095,7 +4066,7 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) unsigned end_entry; /* Entry for last block covered */ unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check arguments */ HDassert(hdr); @@ -4167,16 +4138,16 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) } /* end if */ /* Recursively check child indirect section */ - H5HF_sect_indirect_valid(hdr, tmp_child_sect); + H5HF__sect_indirect_valid(hdr, tmp_child_sect); } /* end for */ } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_sect_indirect_valid() */ +} /* H5HF__sect_indirect_valid() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_debug + * Function: H5HF__sect_indirect_debug * * Purpose: Dump debugging information about an indirect free space section * @@ -4190,10 +4161,10 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_debug(const H5HF_free_section_t *sect, +H5HF__sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int indent, int fwidth) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(sect); @@ -4210,5 +4181,5 @@ H5HF_sect_indirect_debug(const H5HF_free_section_t *sect, sect->u.indirect.num_entries); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_sect_indirect_debug() */ +} /* H5HF__sect_indirect_debug() */ diff --git a/src/H5HFspace.c b/src/H5HFspace.c index ad5ff0f..b518996 100644 --- a/src/H5HFspace.c +++ b/src/H5HFspace.c @@ -15,7 +15,7 @@ * * Created: H5HFspace.c * May 2 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Space allocation routines for fractal heaps. * @@ -89,7 +89,6 @@ * Failure: negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2006 * *------------------------------------------------------------------------- @@ -153,7 +152,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 15 2006 * *------------------------------------------------------------------------- @@ -198,7 +196,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2006 * *------------------------------------------------------------------------- @@ -237,7 +234,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_space_revert_root_cb + * Function: H5HF__space_revert_root_cb * * Purpose: Callback routine from iterator, to reset 'parent' pointers in * sections, when the heap is changing from having a root indirect @@ -247,18 +244,17 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 24 2012 * *------------------------------------------------------------------------- */ static herr_t -H5HF_space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udata) +H5HF__space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udata) { H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Section to dump info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -279,7 +275,7 @@ H5HF_space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udat done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_revert_root_cb() */ +} /* end H5HF__space_revert_root_cb() */ /*------------------------------------------------------------------------- @@ -292,7 +288,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 23 2012 * *------------------------------------------------------------------------- @@ -312,7 +307,7 @@ H5HF__space_revert_root(const H5HF_hdr_t *hdr) /* Only need to scan the sections if the free space has been initialized */ if(hdr->fspace) /* Iterate over all sections, resetting the parent pointers in 'single' sections */ - if(H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF_space_revert_root_cb, NULL) < 0) + if(H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF__space_revert_root_cb, NULL) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to reset parent pointers") done: @@ -321,7 +316,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_space_create_root_cb + * Function: H5HF__space_create_root_cb * * Purpose: Callback routine from iterator, to set 'parent' pointers in * sections to newly created root indirect block, when the heap @@ -331,19 +326,18 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 24 2012 * *------------------------------------------------------------------------- */ static herr_t -H5HF_space_create_root_cb(H5FS_section_info_t *_sect, void *_udata) +H5HF__space_create_root_cb(H5FS_section_info_t *_sect, void *_udata) { H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Section to dump info */ H5HF_indirect_t *root_iblock = (H5HF_indirect_t *)_udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -357,7 +351,7 @@ H5HF_space_create_root_cb(H5FS_section_info_t *_sect, void *_udata) HDassert(sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE); /* Increment ref. count on new root indirect block */ - if(H5HF_iblock_incr(root_iblock) < 0) + if(H5HF__iblock_incr(root_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on section's indirect block") /* Set parent info ("live" section must _NOT_ have a parent right now) */ @@ -370,7 +364,7 @@ H5HF_space_create_root_cb(H5FS_section_info_t *_sect, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_create_root_cb() */ +} /* end H5HF__space_create_root_cb() */ /*------------------------------------------------------------------------- @@ -384,7 +378,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 24 2012 * *------------------------------------------------------------------------- @@ -405,7 +398,7 @@ H5HF__space_create_root(const H5HF_hdr_t *hdr, H5HF_indirect_t *root_iblock) /* Only need to scan the sections if the free space has been initialized */ if(hdr->fspace) /* Iterate over all sections, seting the parent pointers in 'single' sections to the new indirect block */ - if(H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF_space_create_root_cb, root_iblock) < 0) + if(H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF__space_create_root_cb, root_iblock) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to set parent pointers") done: @@ -422,7 +415,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * August 14 2007 * *------------------------------------------------------------------------- @@ -467,7 +459,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 24 2006 * *------------------------------------------------------------------------- @@ -505,7 +496,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2006 * *------------------------------------------------------------------------- @@ -529,9 +519,6 @@ H5HF__space_close(H5HF_hdr_t *hdr) /* Retrieve the number of sections for this heap */ if(H5FS_sect_stats(hdr->fspace, NULL, &nsects) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOUNT, FAIL, "can't query free space section count") -#ifdef QAK -HDfprintf(stderr, "%s: nsects = %Hu\n", FUNC, nsects); -#endif /* QAK */ /* Close the free space for the heap */ if(H5FS_close(hdr->f, hdr->fspace) < 0) @@ -560,7 +547,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 7 2006 * *------------------------------------------------------------------------- @@ -596,7 +582,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * July 10 2006 * *------------------------------------------------------------------------- @@ -607,9 +592,6 @@ H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, uint16 herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE -#ifdef QAK -HDfprintf(stderr, "%s: Called\n", FUNC); -#endif /* QAK */ /* * Check arguments. diff --git a/src/H5HFstat.c b/src/H5HFstat.c index 7d18ba6..456fd60 100644 --- a/src/H5HFstat.c +++ b/src/H5HFstat.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Monday, March 6, 2006 * * Purpose: Fractal heap metadata statistics functions. diff --git a/src/H5HFtest.c b/src/H5HFtest.c index d6eecd7..14b20eb 100644 --- a/src/H5HFtest.c +++ b/src/H5HFtest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Thursday, February 3, 2006 * * Purpose: Fractal heap testing functions. @@ -189,13 +189,10 @@ H5HF_cmp_cparam_test(const H5HF_create_t *cparam1, const H5HF_create_t *cparam2) /* Don't worry about comparing the filter names right now... */ /* (they are expanded during the encode/decode process, but aren't copied - * during the H5Z_append operation, generating false positive failures) + * during the H5Z_append operation, generating false positive failures -QAK) */ -#ifdef QAK +#if 0 /* Check filter name */ -HDfprintf(stderr, "%s: Check 1.0\n", "H5HF_cmp_cparam_test"); -HDfprintf(stderr, "%s: cparam1->pline.filter[%Zu].name = %s\n", "H5HF_cmp_cparam_test", u, (cparam1->pline.filter[u].name ? cparam1->pline.filter[u].name : "")); -HDfprintf(stderr, "%s: cparam2->pline.filter[%Zu].name = %s\n", "H5HF_cmp_cparam_test", u, (cparam2->pline.filter[u].name ? cparam2->pline.filter[u].name : "")); if(!cparam1->pline.filter[u].name && cparam2->pline.filter[u].name) HGOTO_DONE(-1) else if(cparam1->pline.filter[u].name && !cparam2->pline.filter[u].name) @@ -204,7 +201,7 @@ HDfprintf(stderr, "%s: cparam2->pline.filter[%Zu].name = %s\n", "H5HF_cmp_cparam if((ret_value = HDstrcmp(cparam1->pline.filter[u].name, cparam2->pline.filter[u].name))) HGOTO_DONE(ret_value) } /* end if */ -#endif /* QAK */ +#endif /* Check # of filter parameters */ if(cparam1->pline.filter[u].cd_nelmts < cparam2->pline.filter[u].cd_nelmts) diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c index 113124c..21da6da 100644 --- a/src/H5HFtiny.c +++ b/src/H5HFtiny.c @@ -15,7 +15,7 @@ * * Created: H5HFtiny.c * Aug 14 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Routines for "tiny" objects in fractal heap * @@ -63,7 +63,7 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, +static herr_t H5HF__tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data); @@ -83,22 +83,21 @@ static herr_t H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, /*------------------------------------------------------------------------- - * Function: H5HF_tiny_init + * Function: H5HF__tiny_init * * Purpose: Initialize information for tracking 'tiny' objects * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 14 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_init(H5HF_hdr_t *hdr) +H5HF__tiny_init(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -126,33 +125,29 @@ H5HF_tiny_init(H5HF_hdr_t *hdr) } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_tiny_init() */ +} /* end H5HF__tiny_init() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_insert + * Function: H5HF__tiny_insert * * Purpose: Pack a 'tiny' object in a heap ID * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 14 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) +H5HF__tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) { uint8_t *id = (uint8_t *)_id; /* Pointer to ID buffer */ size_t enc_obj_size; /* Encoded object size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT -#ifdef QAK -HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); -#endif /* QAK */ + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -185,33 +180,32 @@ HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); hdr->tiny_nobjs++; /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_tiny_insert() */ +} /* end H5HF__tiny_insert() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_get_obj_len + * Function: H5HF__tiny_get_obj_len * * Purpose: Get the size of a 'tiny' object in a fractal heap * * Return: SUCCEED (Can't fail) * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 14 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) +H5HF__tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) { size_t enc_obj_size; /* Encoded object size */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -233,30 +227,29 @@ H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) *obj_len_p = enc_obj_size + 1; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5HF_tiny_get_obj_len() */ +} /* end H5HF__tiny_get_obj_len() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_op_real + * Function: H5HF__tiny_op_real * * Purpose: Internal routine to perform operation on 'tiny' object * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 11 2006 * *------------------------------------------------------------------------- */ static herr_t -H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, +H5HF__tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data) { size_t enc_obj_size; /* Encoded object size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -266,8 +259,8 @@ H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, HDassert(op); /* Get the object's encoded length */ - /* H5HF_tiny_obj_len can't fail */ - ret_value = H5HF_tiny_get_obj_len(hdr, id, &enc_obj_size); + /* H5HF__tiny_obj_len can't fail */ + ret_value = H5HF__tiny_get_obj_len(hdr, id, &enc_obj_size); /* Advance past flag byte(s) */ if(!hdr->tiny_len_extended) @@ -285,28 +278,27 @@ H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_tiny_op_real() */ +} /* end H5HF__tiny_op_real() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_read + * Function: H5HF__tiny_read * * Purpose: Read a 'tiny' object from the heap * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 8 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) +H5HF__tiny_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -316,34 +308,33 @@ H5HF_tiny_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) HDassert(obj); /* Call the internal 'op' routine */ - if(H5HF_tiny_op_real(hdr, id, H5HF_op_read, obj) < 0) + if(H5HF__tiny_op_real(hdr, id, H5HF__op_read, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_tiny_read() */ +} /* end H5HF__tiny_read() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_op + * Function: H5HF__tiny_op * * Purpose: Operate directly on a 'tiny' object * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sept 11 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, +H5HF__tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -353,34 +344,33 @@ H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, HDassert(op); /* Call the internal 'op' routine routine */ - if(H5HF_tiny_op_real(hdr, id, op, op_data) < 0) + if(H5HF__tiny_op_real(hdr, id, op, op_data) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_tiny_op() */ +} /* end H5HF__tiny_op() */ /*------------------------------------------------------------------------- - * Function: H5HF_tiny_remove + * Function: H5HF__tiny_remove * * Purpose: Remove a 'tiny' object from the heap statistics * * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Aug 14 2006 * *------------------------------------------------------------------------- */ herr_t -H5HF_tiny_remove(H5HF_hdr_t *hdr, const uint8_t *id) +H5HF__tiny_remove(H5HF_hdr_t *hdr, const uint8_t *id) { size_t enc_obj_size; /* Encoded object size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -389,17 +379,17 @@ H5HF_tiny_remove(H5HF_hdr_t *hdr, const uint8_t *id) HDassert(id); /* Get the object's encoded length */ - /* H5HF_tiny_obj_len can't fail */ - ret_value = H5HF_tiny_get_obj_len(hdr, id, &enc_obj_size); + /* H5HF__tiny_obj_len can't fail */ + ret_value = H5HF__tiny_get_obj_len(hdr, id, &enc_obj_size); /* Update statistics about heap */ hdr->tiny_size -= enc_obj_size; hdr->tiny_nobjs--; /* Mark heap header as modified */ - if(H5HF_hdr_dirty(hdr) < 0) + if(H5HF__hdr_dirty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_tiny_remove() */ +} /* end H5HF__tiny_remove() */ diff --git a/src/H5HG.c b/src/H5HG.c index f9d780c..dc945e0 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, March 27, 1998 * * Purpose: Operations on the global heap. The global heap is the set of @@ -763,7 +763,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HG_remove (H5F_t *f, H5HG_t *hobj) +H5HG_remove(H5F_t *f, H5HG_t *hobj) { H5HG_heap_t *heap = NULL; uint8_t *p = NULL, *obj_start = NULL; diff --git a/src/H5HGcache.c b/src/H5HGcache.c index 7485aad..f85df33 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -15,7 +15,7 @@ * * Created: H5HGcache.c * Feb 5 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement global heap metadata cache methods. * diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c index a5e5363..a0697aa 100644 --- a/src/H5HGdbg.c +++ b/src/H5HGdbg.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Wednesday, July 9, 2003 * * Purpose: Global Heap object debugging functions. @@ -77,7 +77,6 @@ * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Mar 27, 1998 * *------------------------------------------------------------------------- diff --git a/src/H5HGmodule.h b/src/H5HGmodule.h index 1c68206..e661328 100644 --- a/src/H5HGmodule.h +++ b/src/H5HGmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h index 3119de4..735b4fb 100644 --- a/src/H5HGpkg.h +++ b/src/H5HGpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, July 9, 2003 * * Purpose: This file contains declarations which are visible diff --git a/src/H5HGprivate.h b/src/H5HGprivate.h index 573ef39..1a22d56 100644 --- a/src/H5HGprivate.h +++ b/src/H5HGprivate.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, March 27, 1998 */ #ifndef _H5HGprivate_H diff --git a/src/H5HGquery.c b/src/H5HGquery.c index 35abc2e..005235c 100644 --- a/src/H5HGquery.c +++ b/src/H5HGquery.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, July 20, 2011 * * Purpose: Query routines for global heaps. diff --git a/src/H5HL.c b/src/H5HL.c index f290294..f628e93 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -15,7 +15,7 @@ * * Created: H5HL.c * Jul 16 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Heap functions for the local heaps used by symbol * tables to store names (among other things). diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 734ec5c..38cf060 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -15,7 +15,7 @@ * * Created: H5HLcache.c * Feb 5 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implement local heap metadata cache methods. * diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c index edb0261..c0ec68b 100644 --- a/src/H5HLdbg.c +++ b/src/H5HLdbg.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Wednesday, July 9, 2003 * * Purpose: Local Heap object debugging functions. diff --git a/src/H5HLdblk.c b/src/H5HLdblk.c index c3fcffe..88348a0 100644 --- a/src/H5HLdblk.c +++ b/src/H5HLdblk.c @@ -15,7 +15,7 @@ * * Created: H5HLdblk.c * Summer 2012 - * Dana Robinson + * Dana Robinson * * Purpose: Data block routines for local heaps. * diff --git a/src/H5HLint.c b/src/H5HLint.c index cc3e3ea..17527c1 100644 --- a/src/H5HLint.c +++ b/src/H5HLint.c @@ -15,7 +15,7 @@ * * Created: H5HLint.c * Oct 12 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: Local heap internal routines. * diff --git a/src/H5HLprfx.c b/src/H5HLprfx.c index 41c254a..8c4ffad 100644 --- a/src/H5HLprfx.c +++ b/src/H5HLprfx.c @@ -15,7 +15,7 @@ * * Created: H5HLprfx.c * Summer 2012 - * Dana Robinson + * Dana Robinson * * Purpose: Prefix routines for local heaps. * diff --git a/src/H5HP.c b/src/H5HP.c index 4ef5662..340457b 100644 --- a/src/H5HP.c +++ b/src/H5HP.c @@ -46,10 +46,10 @@ struct H5HP_t { }; /* Static functions */ -static herr_t H5HP_swim_max(H5HP_t *heap, size_t loc); -static herr_t H5HP_swim_min(H5HP_t *heap, size_t loc); -static herr_t H5HP_sink_max(H5HP_t *heap, size_t loc); -static herr_t H5HP_sink_min(H5HP_t *heap, size_t loc); +static herr_t H5HP__swim_max(H5HP_t *heap, size_t loc); +static herr_t H5HP__swim_min(H5HP_t *heap, size_t loc); +static herr_t H5HP__sink_max(H5HP_t *heap, size_t loc); +static herr_t H5HP__sink_min(H5HP_t *heap, size_t loc); /* Declare a free list to manage the H5HP_t struct */ H5FL_DEFINE_STATIC(H5HP_t); @@ -60,11 +60,11 @@ H5FL_SEQ_DEFINE_STATIC(H5HP_ent_t); /*-------------------------------------------------------------------------- NAME - H5HP_swim_max + H5HP__swim_max PURPOSE Restore heap condition by moving an object upward USAGE - herr_t H5HP_swim_max(heap, loc) + herr_t H5HP__swim_max(heap, loc) H5HP_t *heap; IN/OUT: Pointer to heap to modify size_t loc; IN: Location to start from @@ -80,13 +80,13 @@ H5FL_SEQ_DEFINE_STATIC(H5HP_ent_t); REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5HP_swim_max(H5HP_t *heap, size_t loc) +H5HP__swim_max(H5HP_t *heap, size_t loc) { int val; /* Temporary copy value of object to move in heap */ H5HP_info_t *obj; /* Temporary pointer to object to move in heap */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Get copies of the information about the object to move in the heap */ val=heap->heap[loc].val; @@ -113,16 +113,16 @@ H5HP_swim_max(H5HP_t *heap, size_t loc) heap->heap[loc].obj->heap_loc=loc; FUNC_LEAVE_NOAPI(ret_value); -} /* end H5HP_swim_max() */ +} /* end H5HP__swim_max() */ /*-------------------------------------------------------------------------- NAME - H5HP_swim_min + H5HP__swim_min PURPOSE Restore heap condition by moving an object upward USAGE - herr_t H5HP_swim_min(heap, loc) + herr_t H5HP__swim_min(heap, loc) H5HP_t *heap; IN/OUT: Pointer to heap to modify size_t loc; IN: Location to start from @@ -138,13 +138,13 @@ H5HP_swim_max(H5HP_t *heap, size_t loc) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5HP_swim_min(H5HP_t *heap, size_t loc) +H5HP__swim_min(H5HP_t *heap, size_t loc) { int val; /* Temporary copy value of object to move in heap */ H5HP_info_t *obj; /* Temporary pointer to object to move in heap */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Get copies of the information about the object to move in the heap */ val=heap->heap[loc].val; @@ -171,16 +171,16 @@ H5HP_swim_min(H5HP_t *heap, size_t loc) heap->heap[loc].obj->heap_loc=loc; FUNC_LEAVE_NOAPI(ret_value); -} /* end H5HP_swim_min() */ +} /* end H5HP__swim_min() */ /*-------------------------------------------------------------------------- NAME - H5HP_sink_max + H5HP__sink_max PURPOSE Restore heap condition by moving an object downward USAGE - herr_t H5HP_sink_max(heap, loc) + herr_t H5HP__sink_max(heap, loc) H5HP_t *heap; IN/OUT: Pointer to heap to modify size_t loc; IN: Location to start from @@ -196,13 +196,13 @@ H5HP_swim_min(H5HP_t *heap, size_t loc) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5HP_sink_max(H5HP_t *heap, size_t loc) +H5HP__sink_max(H5HP_t *heap, size_t loc) { int val; /* Temporary copy value of object to move in heap */ void *obj; /* Temporary pointer to object to move in heap */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Get copies of the information about the object to move in the heap */ val=heap->heap[loc].val; @@ -240,16 +240,16 @@ H5HP_sink_max(H5HP_t *heap, size_t loc) heap->heap[loc].obj->heap_loc = loc; FUNC_LEAVE_NOAPI(ret_value); -} /* end H5HP_sink_max() */ +} /* end H5HP__sink_max() */ /*-------------------------------------------------------------------------- NAME - H5HP_sink_min + H5HP__sink_min PURPOSE Restore heap condition by moving an object downward USAGE - herr_t H5HP_sink_min(heap, loc) + herr_t H5HP__sink_min(heap, loc) H5HP_t *heap; IN/OUT: Pointer to heap to modify size_t loc; IN: Location to start from @@ -265,13 +265,13 @@ H5HP_sink_max(H5HP_t *heap, size_t loc) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5HP_sink_min(H5HP_t *heap, size_t loc) +H5HP__sink_min(H5HP_t *heap, size_t loc) { int val; /* Temporary copy value of object to move in heap */ void *obj; /* Temporary pointer to object to move in heap */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Get copies of the information about the object to move in the heap */ val=heap->heap[loc].val; @@ -309,7 +309,7 @@ H5HP_sink_min(H5HP_t *heap, size_t loc) heap->heap[loc].obj->heap_loc = loc; FUNC_LEAVE_NOAPI(ret_value); -} /* end H5HP_sink_min() */ +} /* end H5HP__sink_min() */ /*-------------------------------------------------------------------------- @@ -493,11 +493,11 @@ H5HP_insert(H5HP_t *heap, int val, void *obj) /* Restore heap condition */ if(heap->type==H5HP_MAX_HEAP) { - if(H5HP_swim_max(heap,heap->nobjs)<0) + if(H5HP__swim_max(heap,heap->nobjs)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "unable to restore heap condition"); } /* end if */ else { - if(H5HP_swim_min(heap,heap->nobjs)<0) + if(H5HP__swim_min(heap,heap->nobjs)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "unable to restore heap condition"); } /* end else */ @@ -619,11 +619,11 @@ H5HP_remove(H5HP_t *heap, int *val, void **obj) /* Restore heap condition, if there are objects on the heap */ if(heap->nobjs>0) { if(heap->type==H5HP_MAX_HEAP) { - if(H5HP_sink_max(heap, (size_t)1) < 0) + if(H5HP__sink_max(heap, (size_t)1) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "unable to restore heap condition"); } /* end if */ else { - if(H5HP_sink_min(heap, (size_t)1) < 0) + if(H5HP__sink_min(heap, (size_t)1) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "unable to restore heap condition"); } /* end else */ } /* end if */ @@ -695,21 +695,21 @@ H5HP_change(H5HP_t *heap, int val, void *_obj) /* Restore heap condition */ if(valtype==H5HP_MAX_HEAP) { - if(H5HP_sink_max(heap,obj_loc)<0) + if(H5HP__sink_max(heap,obj_loc)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition"); } /* end if */ else { - if(H5HP_swim_min(heap,obj_loc)<0) + if(H5HP__swim_min(heap,obj_loc)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition"); } /* end else */ } /* end if */ else { if(heap->type==H5HP_MAX_HEAP) { - if(H5HP_swim_max(heap,obj_loc)<0) + if(H5HP__swim_max(heap,obj_loc)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition"); } /* end if */ else { - if(H5HP_sink_min(heap,obj_loc)<0) + if(H5HP__sink_min(heap,obj_loc)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition"); } /* end else */ } /* end else */ @@ -778,11 +778,11 @@ H5HP_incr(H5HP_t *heap, unsigned amt, void *_obj) /* Restore heap condition */ if(H5HP_MAX_HEAP == heap->type) { - if(H5HP_swim_max(heap, obj_loc) < 0) + if(H5HP__swim_max(heap, obj_loc) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition") } /* end if */ else { - if(H5HP_sink_min(heap, obj_loc) < 0) + if(H5HP__sink_min(heap, obj_loc) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition") } /* end else */ @@ -851,11 +851,11 @@ H5HP_decr(H5HP_t *heap, unsigned amt, void *_obj) /* Restore heap condition */ if(heap->type==H5HP_MAX_HEAP) { - if(H5HP_sink_max(heap,obj_loc)<0) + if(H5HP__sink_max(heap,obj_loc)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition"); } /* end if */ else { - if(H5HP_swim_min(heap,obj_loc)<0) + if(H5HP__swim_min(heap,obj_loc)<0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition"); } /* end else */ diff --git a/src/H5Imodule.h b/src/H5Imodule.h index 60bda5a..9c56842 100644 --- a/src/H5Imodule.h +++ b/src/H5Imodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h index 2c1d81f..54b7b43 100644 --- a/src/H5Ipkg.h +++ b/src/H5Ipkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, May 15, 2003 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5Itest.c b/src/H5Itest.c index 07c1965..a51f860 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Tuesday, July 27, 2010 * * Purpose: ID testing functions. diff --git a/src/H5L.c b/src/H5L.c index 4ef045d..f6b361a 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -98,7 +98,7 @@ typedef struct { /* Local Prototypes */ /********************/ -static int H5L_find_class_idx(H5L_type_t id); +static int H5L__find_class_idx(H5L_type_t id); static herr_t H5L__link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); @@ -1559,7 +1559,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_find_class_idx + * Function: H5L__find_class_idx * * Purpose: Given a link class ID, return the offset in the global array * that holds all the registered link classes. @@ -1574,12 +1574,12 @@ done: *------------------------------------------------------------------------- */ static int -H5L_find_class_idx(H5L_type_t id) +H5L__find_class_idx(H5L_type_t id) { size_t i; /* Local index variable */ int ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR for(i = 0; i < H5L_table_used_g; i++) if(H5L_table_g[i].id == id) @@ -1587,7 +1587,7 @@ H5L_find_class_idx(H5L_type_t id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_find_class_idx */ +} /* end H5L__find_class_idx */ /*------------------------------------------------------------------------- @@ -1613,7 +1613,7 @@ H5L_find_class(H5L_type_t id) FUNC_ENTER_NOAPI(NULL) /* Get the index in the global table */ - if((idx = H5L_find_class_idx(id)) < 0) + if((idx = H5L__find_class_idx(id)) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTREGISTERED, NULL, "unable to find link class") /* Set return value */ @@ -2054,7 +2054,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_create_hard + * Function: H5L__create_hard * * Purpose: Creates a hard link from NEW_NAME to CUR_NAME. * @@ -2066,7 +2066,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, +H5L__create_hard(H5G_loc_t *cur_loc, const char *cur_name, const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id) { char *norm_cur_name = NULL; /* Pointer to normalized current name */ @@ -2078,7 +2078,7 @@ H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, hbool_t loc_valid = FALSE; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(cur_loc); @@ -2123,11 +2123,11 @@ done: H5MM_xfree(norm_cur_name); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_create_hard() */ +} /* end H5L__create_hard() */ /*------------------------------------------------------------------------- - * Function: H5L_create_soft + * Function: H5L__create_soft * * Purpose: Creates a soft link from LINK_NAME to TARGET_PATH. * @@ -2139,14 +2139,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_create_soft(const char *target_path, const H5G_loc_t *link_loc, +H5L__create_soft(const char *target_path, const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id) { char *norm_target = NULL; /* Pointer to normalized current name */ H5O_link_t lnk; /* Link to insert */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(link_loc); @@ -2171,7 +2171,7 @@ done: H5MM_xfree(norm_target); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_create_soft() */ +} /* end H5L__create_soft() */ /*------------------------------------------------------------------------- @@ -2206,7 +2206,7 @@ H5L__create_ud(const H5G_loc_t *link_loc, const char *link_name, lnk.u.ud.udata = NULL; /* Make sure that this link class is registered */ - if(H5L_find_class_idx(type) < 0) + if(H5L__find_class_idx(type) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "link class has not been registered with library") /* Fill in UD link-specific information in the link struct*/ @@ -2327,7 +2327,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_get_val + * Function: H5L__get_val * * Purpose: Returns the value of a symbolic link or the udata for a * user-defined link. @@ -2346,12 +2346,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t size) +H5L__get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t size) { H5L_trav_gv_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(loc); @@ -2367,7 +2367,7 @@ H5L_get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t siz done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5L_get_val() */ +} /* H5L__get_val() */ /*------------------------------------------------------------------------- @@ -2422,7 +2422,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_get_val_by_idx + * Function: H5L__get_val_by_idx * * Purpose: Internal routine to query a link value according to the * index within a group @@ -2435,13 +2435,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_get_val_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, +H5L__get_val_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, void *buf/*out*/, size_t size) { H5L_trav_gvbi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); @@ -2460,7 +2460,7 @@ H5L_get_val_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_val_by_idx() */ +} /* end H5L__get_val_by_idx() */ /*------------------------------------------------------------------------- @@ -2513,7 +2513,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_delete + * Function: H5L__delete * * Purpose: Delete a link from a group. * @@ -2525,12 +2525,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_delete(const H5G_loc_t *loc, const char *name) +H5L__delete(const H5G_loc_t *loc, const char *name) { char *norm_name = NULL; /* Pointer to normalized name */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(loc); @@ -2550,7 +2550,7 @@ done: H5MM_xfree(norm_name); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_delete() */ +} /* end H5L__delete() */ /*------------------------------------------------------------------------- @@ -2593,7 +2593,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_delete_by_idx + * Function: H5L__delete_by_idx * * Purpose: Internal routine to delete a link according to its index * within a group. @@ -2606,13 +2606,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_delete_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, +H5L__delete_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n) { H5L_trav_rmbi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(loc); @@ -2629,7 +2629,7 @@ H5L_delete_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_delete_by_idx() */ +} /* end H5L__delete_by_idx() */ /*------------------------------------------------------------------------- @@ -2859,7 +2859,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_move + * Function: H5L__move * * Purpose: Atomically move or copy a link. * @@ -2879,7 +2879,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_loc, +H5L__move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag, hid_t lcpl_id) { unsigned dst_target_flags = H5G_TARGET_NORMAL; @@ -2888,7 +2888,7 @@ H5L_move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_lo H5L_trav_mv_t udata; /* User data for traversal */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(src_loc); @@ -2935,7 +2935,7 @@ H5L_move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_lo done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_move() */ +} /* end H5L__move() */ /*------------------------------------------------------------------------- @@ -3036,7 +3036,7 @@ done: * * Purpose: Returns whether a link exists in a group * - * Note: Same as H5L_exists, except that missing links are reported + * Note: Same as H5L__exists, except that missing links are reported * as 'FALSE' instead of causing failures * * Return: Non-negative (TRUE/FALSE) on success/Negative on failure @@ -3099,7 +3099,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_exists + * Function: H5L__exists * * Purpose: Returns whether a link exists in a group * @@ -3114,12 +3114,12 @@ done: *------------------------------------------------------------------------- */ htri_t -H5L_exists(const H5G_loc_t *loc, const char *name) +H5L__exists(const H5G_loc_t *loc, const char *name) { H5L_trav_le_t udata; /* User data for traversal */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* A path of "/" will always exist in a file */ if(0 == HDstrcmp(name, "/")) @@ -3135,7 +3135,7 @@ H5L_exists(const H5G_loc_t *loc, const char *name) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5L_exists() */ +} /* H5L__exists() */ /*------------------------------------------------------------------------- @@ -3260,7 +3260,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_get_info_by_idx + * Function: H5L__get_info_by_idx * * Purpose: Internal routine to retrieve link info according to an * index's order. @@ -3270,13 +3270,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, +H5L__get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5L_info2_t *linfo /*out*/) { H5L_trav_gibi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); @@ -3295,7 +3295,7 @@ H5L_get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_info_by_idx() */ +} /* end H5L__get_info_by_idx() */ /*------------------------------------------------------------------------- @@ -3339,7 +3339,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_get_name_by_idx + * Function: H5L__get_name_by_idx * * Purpose: Internal routine to retrieve link name according to an * index's order. @@ -3349,14 +3349,14 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5L_get_name_by_idx(const H5G_loc_t *loc, const char *group_name, +H5L__get_name_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name /*out*/, size_t size) { H5L_trav_gnbi_t udata; /* User data for callback */ ssize_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); @@ -3379,7 +3379,7 @@ H5L_get_name_by_idx(const H5G_loc_t *loc, const char *group_name, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_name_by_idx() */ +} /* end H5L__get_name_by_idx() */ /*------------------------------------------------------------------------- @@ -3391,7 +3391,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sep 29 2006 * *------------------------------------------------------------------------- diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 8a3e3e1..b8c7819 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -291,7 +291,7 @@ H5L__extern_query(const char H5_ATTR_UNUSED * link_name, const void *_udata, siz const uint8_t *udata = (const uint8_t *)_udata; /* Pointer to external link buffer */ ssize_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check external link version & flags */ if(((*udata >> 4) & 0x0F) != H5L_EXT_VERSION) diff --git a/src/H5Lmodule.h b/src/H5Lmodule.h index cba4de4..d80126d 100644 --- a/src/H5Lmodule.h +++ b/src/H5Lmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Lpkg.h b/src/H5Lpkg.h index f0e9cfc..34890a1 100644 --- a/src/H5Lpkg.h +++ b/src/H5Lpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: James Laird + * Programmer: James Laird * Friday, December 1, 2005 * * Purpose: This file contains declarations which are visible @@ -51,9 +51,31 @@ /* Package Private Prototypes */ /******************************/ +H5_DLL herr_t H5L__create_hard(H5G_loc_t *cur_loc, const char *cur_name, + const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id); +H5_DLL herr_t H5L__create_soft(const char *target_path, const H5G_loc_t *cur_loc, + const char *cur_name, hid_t lcpl_id); H5_DLL herr_t H5L__create_ud(const H5G_loc_t *link_loc, const char *link_name, const void * ud_data, size_t ud_data_size, H5L_type_t type, hid_t lcpl_id); +H5_DLL htri_t H5L__exists(const H5G_loc_t *loc, const char *name); +H5_DLL herr_t H5L__get_info_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, + H5L_info2_t *linfo /*out*/); +H5_DLL ssize_t H5L__get_name_by_idx(const H5G_loc_t *loc, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, + char *name /*out*/, size_t size); +H5_DLL herr_t H5L__get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, + size_t size); +H5_DLL herr_t H5L__get_val_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, + void *buf/*out*/, size_t size); +H5_DLL herr_t H5L__move(const H5G_loc_t *src_loc, const char *src_name, + const H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag, + hid_t lcpl_id); +H5_DLL herr_t H5L__delete(const H5G_loc_t *loc, const char *name); +H5_DLL herr_t H5L__delete_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n); H5_DLL herr_t H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t *src_oloc, H5O_link_t *dst_lnk, H5O_copy_t *cpy_info); diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h index 0487557..df842f3 100644 --- a/src/H5Lprivate.h +++ b/src/H5Lprivate.h @@ -113,31 +113,9 @@ H5_DLL herr_t H5L_link(const H5G_loc_t *new_loc, const char *new_name, H5G_loc_t *obj_loc, hid_t lcpl_id); H5_DLL herr_t H5L_link_object(const H5G_loc_t *new_loc, const char *new_name, H5O_obj_create_t *ocrt_info, hid_t lcpl_id); -H5_DLL herr_t H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, - const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id); -H5_DLL herr_t H5L_create_soft(const char *target_path, const H5G_loc_t *cur_loc, - const char *cur_name, hid_t lcpl_id); -H5_DLL herr_t H5L_move(const H5G_loc_t *src_loc, const char *src_name, - const H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag, - hid_t lcpl_id); H5_DLL htri_t H5L_exists_tolerant(const H5G_loc_t *loc, const char *name); -H5_DLL htri_t H5L_exists(const H5G_loc_t *loc, const char *name); H5_DLL herr_t H5L_get_info(const H5G_loc_t *loc, const char *name, H5L_info2_t *linkbuf/*out*/); -H5_DLL herr_t H5L_delete(const H5G_loc_t *loc, const char *name); -H5_DLL herr_t H5L_delete_by_idx(const H5G_loc_t *loc, const char *name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n); -H5_DLL herr_t H5L_get_info_by_idx(const H5G_loc_t *loc, const char *name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, - H5L_info2_t *linfo /*out*/); -H5_DLL ssize_t H5L_get_name_by_idx(const H5G_loc_t *loc, const char *group_name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, - char *name /*out*/, size_t size); -H5_DLL herr_t H5L_get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, - size_t size); -H5_DLL herr_t H5L_get_val_by_idx(const H5G_loc_t *loc, const char *name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, - void *buf/*out*/, size_t size); H5_DLL herr_t H5L_register_external(void); H5_DLL herr_t H5L_iterate(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index 3bac5ac..861fafc 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -57,7 +57,7 @@ extern "C" { * Values 64 to 255 are for "user-defined" link class types; these types are * defined by HDF5 but their behavior can be overridden by users. * Users who want to create new classes of links should contact the HDF5 - * development team at hdfhelp@ncsa.uiuc.edu . + * development team at help@hdfgroup.org. * These values can never change because they appear in HDF5 files. */ typedef enum { diff --git a/src/H5MF.c b/src/H5MF.c index fac6620..7de09cb 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -15,7 +15,7 @@ * * Created: H5MF.c * Jul 11 1997 - * Robb Matzke + * Robb Matzke * * Purpose: File memory management functions. * @@ -51,9 +51,11 @@ #define H5MF_FSPACE_EXPAND 120 /* Percent of "normal" size to expand serialized free space size */ #define H5MF_CHECK_FSM(FSM, CF) \ - HDassert(*CF == FALSE); \ - if(!H5F_addr_defined(FSM->addr) || !H5F_addr_defined(FSM->sect_addr)) \ - *CF = TRUE; + do { \ + HDassert(*CF == FALSE); \ + if(!H5F_addr_defined(FSM->addr) || !H5F_addr_defined(FSM->sect_addr)) \ + *CF = TRUE; \ + } while(0) /* For non-paged aggregation: map allocation request type to tracked free-space type */ /* F_SH -- pointer to H5F_shared_t; T -- H5FD_mem_t */ @@ -300,7 +302,6 @@ H5MF__alloc_to_fs_type(H5F_shared_t *f_sh, H5FD_mem_t alloc_type, hsize_t size, * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 8 2008 * *------------------------------------------------------------------------- @@ -380,7 +381,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 8 2008 * *------------------------------------------------------------------------- @@ -419,7 +419,7 @@ H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type) fs_create.client = H5FS_CLIENT_FILE_ID; fs_create.shrink_percent = H5MF_FSPACE_SHRINK; fs_create.expand_percent = H5MF_FSPACE_EXPAND; - fs_create.max_sect_addr = 1 + H5VM_log2_gen((uint64_t)f->shared->maxaddr); + fs_create.max_sect_addr = 1 + H5VM__log2_gen((uint64_t)f->shared->maxaddr); fs_create.max_sect_size = f->shared->maxaddr; /* Set up alignment and threshold to use depending on TYPE */ @@ -466,7 +466,6 @@ done: * Failure: negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 8 2008 * *------------------------------------------------------------------------- @@ -781,7 +780,6 @@ done: * Failure: HADDR_UNDEF * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 11 1997 * *------------------------------------------------------------------------- @@ -1086,7 +1084,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 17 1997 * *------------------------------------------------------------------------- @@ -1448,7 +1445,6 @@ H5MF__sects_dump(f, stderr); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Feb 14 2008 * *------------------------------------------------------------------------- @@ -2173,7 +2169,7 @@ H5MF__close_shrink_eoa(H5F_t *f) } /* end for */ /* check the two aggregators */ - if((status = H5MF_aggrs_try_shrink_eoa(f)) < 0) + if((status = H5MF__aggrs_try_shrink_eoa(f)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") else if(status > 0) eoa_shrank = TRUE; @@ -2503,7 +2499,7 @@ H5MF__get_free_sects(H5F_t *f, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, hsize_t hnums = 0; /* # of sections */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -3334,35 +3330,31 @@ static herr_t H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_sinfo_fspace, H5FS_t *lg_hdr_fspace, H5FS_t *lg_sinfo_fspace, hbool_t *continue_alloc_fsm) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDassert(f_sh); HDassert(continue_alloc_fsm); /* Check sm_hdr_fspace */ - if(sm_hdr_fspace && sm_hdr_fspace->serial_sect_count > 0 && sm_hdr_fspace->sinfo) { + if(sm_hdr_fspace && sm_hdr_fspace->serial_sect_count > 0 && sm_hdr_fspace->sinfo) H5MF_CHECK_FSM(sm_hdr_fspace, continue_alloc_fsm); - } /* end if */ if(!(*continue_alloc_fsm)) if(sm_sinfo_fspace && sm_sinfo_fspace != sm_hdr_fspace && - sm_sinfo_fspace->serial_sect_count > 0 && sm_sinfo_fspace->sinfo) { + sm_sinfo_fspace->serial_sect_count > 0 && sm_sinfo_fspace->sinfo) H5MF_CHECK_FSM(sm_hdr_fspace, continue_alloc_fsm); - } /* end if */ if(H5F_SHARED_PAGED_AGGR(f_sh) && !(*continue_alloc_fsm)) { /* Check lg_hdr_fspace */ - if(lg_hdr_fspace && lg_hdr_fspace->serial_sect_count > 0 && lg_hdr_fspace->sinfo) { + if(lg_hdr_fspace && lg_hdr_fspace->serial_sect_count > 0 && lg_hdr_fspace->sinfo) H5MF_CHECK_FSM(lg_hdr_fspace, continue_alloc_fsm); - } /* end if */ /* Check lg_sinfo_fspace */ if(!(*continue_alloc_fsm)) if(lg_sinfo_fspace && lg_sinfo_fspace != lg_hdr_fspace && - lg_sinfo_fspace->serial_sect_count > 0 && lg_sinfo_fspace->sinfo) { + lg_sinfo_fspace->serial_sect_count > 0 && lg_sinfo_fspace->sinfo) H5MF_CHECK_FSM(lg_sinfo_fspace, continue_alloc_fsm); - } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index 0124555..ce7db6b 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, January 8, 2008 * * Purpose: Routines for aggregating free space allocations @@ -874,7 +874,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5MF_aggrs_try_shrink_eoa + * Function: H5MF__aggrs_try_shrink_eoa * * Purpose: Check the metadata & small block aggregators to see if * EOA shrink is possible; if so, shrink each aggregator @@ -887,13 +887,13 @@ done: *------------------------------------------------------------------------- */ htri_t -H5MF_aggrs_try_shrink_eoa(H5F_t *f) +H5MF__aggrs_try_shrink_eoa(H5F_t *f) { htri_t ma_status; /* Whether the metadata aggregator can shrink the EOA */ htri_t sda_status; /* Whether the small data aggregator can shrink the EOA */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(f); @@ -915,5 +915,5 @@ H5MF_aggrs_try_shrink_eoa(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5MF_aggrs_try_shrink_eoa() */ +} /* end H5MF__aggrs_try_shrink_eoa() */ diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index 43e2305..abdecce 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -15,7 +15,7 @@ * * Created: H5MFdbg.c * Jan 31 2008 - * Quincey Koziol + * Quincey Koziol * * Purpose: File memory management debugging functions. * @@ -92,7 +92,6 @@ static herr_t H5MF__sects_debug_cb(H5FS_section_info_t *_sect, void *_udata); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * January 31 2008 * *------------------------------------------------------------------------- @@ -148,7 +147,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * January 31 2008 * *------------------------------------------------------------------------- @@ -209,7 +207,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 31 2008 * *------------------------------------------------------------------------- diff --git a/src/H5MFmodule.h b/src/H5MFmodule.h index 53daabf..6b3aba5 100644 --- a/src/H5MFmodule.h +++ b/src/H5MFmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h index fc398db..7d72658 100644 --- a/src/H5MFpkg.h +++ b/src/H5MFpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, January 8, 2008 * * Purpose: This file contains declarations which are visible only within @@ -191,6 +191,7 @@ H5_DLL herr_t H5MF__sect_free(H5FS_section_info_t *sect); /* Block aggregator routines */ H5_DLL htri_t H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, H5FD_mem_t type, haddr_t abs_blk_end, hsize_t extra_requested); +H5_DLL htri_t H5MF__aggrs_try_shrink_eoa(H5F_t *f); H5_DLL htri_t H5MF__aggr_can_absorb(const H5F_t *f, const H5F_blk_aggr_t *aggr, const H5MF_free_section_t *sect, H5MF_shrink_type_t *shrink); H5_DLL herr_t H5MF__aggr_absorb(const H5F_t *f, H5F_blk_aggr_t *aggr, diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h index acd773b..2e9ea99 100644 --- a/src/H5MFprivate.h +++ b/src/H5MFprivate.h @@ -15,7 +15,7 @@ * * Created: H5MFprivate.h * Jul 11 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Private header file for file memory management. * @@ -69,7 +69,6 @@ H5_DLL haddr_t H5MF_alloc_tmp(H5F_t *f, hsize_t size); /* 'block aggregator' routines */ H5_DLL herr_t H5MF_free_aggrs(H5F_t *f); -H5_DLL htri_t H5MF_aggrs_try_shrink_eoa(H5F_t *f); /* Free space manager settling routines */ H5_DLL herr_t H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled); diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 715ece4..f69df41 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, January 8, 2008 * * Purpose: Free space section callbacks for file. @@ -112,7 +112,7 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1] = {{ NULL, /* Add section */ NULL, /* Serialize section */ H5MF__sect_deserialize, /* Deserialize section */ - H5MF__sect_simple_can_merge, /* Can sections merge? */ + H5MF__sect_simple_can_merge, /* Can sections merge? */ H5MF__sect_simple_merge, /* Merge sections */ H5MF__sect_simple_can_shrink, /* Can section shrink container?*/ H5MF__sect_simple_shrink, /* Shrink container w/section */ @@ -136,16 +136,16 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{ /* Object methods */ H5MF__sect_small_add, /* Add section */ - NULL, /* Serialize section */ - H5MF__sect_deserialize, /* Deserialize section */ + NULL, /* Serialize section */ + H5MF__sect_deserialize, /* Deserialize section */ H5MF__sect_small_can_merge, /* Can sections merge? */ H5MF__sect_small_merge, /* Merge sections */ - NULL, /* Can section shrink container?*/ - NULL, /* Shrink container w/section */ + NULL, /* Can section shrink container?*/ + NULL, /* Shrink container w/section */ H5MF__sect_free, /* Free section */ H5MF__sect_valid, /* Check validity of section */ H5MF__sect_split, /* Split section node for alignment */ - NULL, /* Dump debugging for section */ + NULL, /* Dump debugging for section */ }}; /* Class info for "large" free space sections */ @@ -166,7 +166,7 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1] = {{ H5MF__sect_deserialize, /* Deserialize section */ H5MF__sect_large_can_merge, /* Can sections merge? */ H5MF__sect_large_merge, /* Merge sections */ - H5MF__sect_large_can_shrink, /* Can section shrink container?*/ + H5MF__sect_large_can_shrink, /* Can section shrink container?*/ H5MF__sect_large_shrink, /* Shrink container w/section */ H5MF__sect_free, /* Free section */ H5MF__sect_valid, /* Check validity of section */ @@ -199,7 +199,6 @@ H5FL_DEFINE(H5MF_free_section_t); * Return: Pointer to new section on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * January 8 2008 * *------------------------------------------------------------------------- diff --git a/src/H5MM.c b/src/H5MM.c index cceac4f..efe955a 100644 --- a/src/H5MM.c +++ b/src/H5MM.c @@ -15,7 +15,7 @@ * * Created: H5MM.c * Jul 10 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Memory management functions * diff --git a/src/H5MMprivate.h b/src/H5MMprivate.h index 0787eb2..b6c1002 100644 --- a/src/H5MMprivate.h +++ b/src/H5MMprivate.h @@ -15,7 +15,7 @@ * * Created: H5MMprivate.h * Jul 10 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Private header for memory management. * diff --git a/src/H5MMpublic.h b/src/H5MMpublic.h index 4e54c33..faa3032 100644 --- a/src/H5MMpublic.h +++ b/src/H5MMpublic.h @@ -13,15 +13,13 @@ /*------------------------------------------------------------------------- * - * Created: H5MMproto.h + * Created: H5MMpublic.h * Jul 10 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Public declarations for the H5MM (memory management) * package. * - * Modifications: - * *------------------------------------------------------------------------- */ #ifndef _H5MMpublic_H diff --git a/src/H5MP.c b/src/H5MP.c index 7947e7d..e773655 100644 --- a/src/H5MP.c +++ b/src/H5MP.c @@ -15,7 +15,7 @@ * * Created: H5MP.c * May 2 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implements memory pools. (Similar to Apache's APR * memory pools) @@ -82,7 +82,6 @@ H5FL_DEFINE(H5MP_pool_t); * Return: Pointer to the memory pool "header" on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2005 * *------------------------------------------------------------------------- @@ -125,26 +124,25 @@ done: /*------------------------------------------------------------------------- - * Function: H5MP_new_page + * Function: H5MP__new_page * * Purpose: Allocate new page for a memory pool * * Return: Pointer to the page allocated on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 4 2005 * *------------------------------------------------------------------------- */ static H5MP_page_t * -H5MP_new_page(H5MP_pool_t *mp, size_t page_size) +H5MP__new_page(H5MP_pool_t *mp, size_t page_size) { H5MP_page_t *new_page; /* New page created */ H5MP_page_blk_t *first_blk; /* Pointer to first block in page */ H5MP_page_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(mp); @@ -163,9 +161,6 @@ H5MP_new_page(H5MP_pool_t *mp, size_t page_size) new_page->free_size = mp->max_size; new_page->fac_alloc = TRUE; } /* end else */ -#ifdef QAK -HDfprintf(stderr,"%s: Allocating new page = %p\n", FUNC, new_page); -#endif /* QAK */ /* Initialize page information */ first_blk = H5MP_PAGE_FIRST_BLOCK(new_page); @@ -191,7 +186,7 @@ HDfprintf(stderr,"%s: Allocating new page = %p\n", FUNC, new_page); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5MP_new_page() */ +} /* end H5MP__new_page() */ /*------------------------------------------------------------------------- @@ -202,7 +197,6 @@ done: * Return: Pointer to the space allocated on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 2 2005 * *------------------------------------------------------------------------- @@ -223,10 +217,6 @@ H5MP_malloc (H5MP_pool_t *mp, size_t request) /* Compute actual size needed */ needed = H5MP_BLOCK_ALIGN(request) + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_blk_t)); -#ifdef QAK -HDfprintf(stderr,"%s: sizeof(H5MP_page_blk_t) = %Zu\n", FUNC, sizeof(H5MP_page_blk_t)); -HDfprintf(stderr,"%s: request = %Zu, needed = %Zu\n", FUNC, request, needed); -#endif /* QAK */ /* See if the request can be handled by existing free space */ if(needed <= mp->free_size) { @@ -275,7 +265,7 @@ HDfprintf(stderr,"%s: request = %Zu, needed = %Zu\n", FUNC, request, needed); (needed + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_t))) : mp->page_size; /* Allocate new page */ - if(NULL == (alloc_page = H5MP_new_page(mp, page_size))) + if(NULL == (alloc_page = H5MP__new_page(mp, page_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for page") /* Set the block to allocate from */ @@ -323,9 +313,6 @@ found: /* Set new space pointer for the return value */ ret_value = ((unsigned char *)alloc_free) + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_blk_t)); -#ifdef QAK -HDfprintf(stderr,"%s: Allocating space from page, ret_value = %p\n", FUNC, ret_value); -#endif /* QAK */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -340,7 +327,6 @@ done: * Return: NULL on success/NULL on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 3 2005 * * Note: Should we release pages that have no used blocks? @@ -369,9 +355,6 @@ H5MP_free(H5MP_pool_t *mp, void *spc) /* Add it's space to the amount of free space in the page & pool */ spc_page = spc_blk->page; -#ifdef QAK -HDfprintf(stderr,"%s: Freeing from page = %p\n", "H5MP_free", spc_page); -#endif /* QAK */ spc_page->free_size += spc_blk->size; mp->free_size += spc_blk->size; @@ -429,7 +412,6 @@ HDfprintf(stderr,"%s: Freeing from page = %p\n", "H5MP_free", spc_page); * Return: Non-negative on success/negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * May 3 2005 * *------------------------------------------------------------------------- diff --git a/src/H5MPmodule.h b/src/H5MPmodule.h index 27f7706..19b137f 100644 --- a/src/H5MPmodule.h +++ b/src/H5MPmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5MPpkg.h b/src/H5MPpkg.h index 29a25fa..ee2eb34 100644 --- a/src/H5MPpkg.h +++ b/src/H5MPpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 2, 2005 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5MPprivate.h b/src/H5MPprivate.h index 009cb50..be97e5d 100644 --- a/src/H5MPprivate.h +++ b/src/H5MPprivate.h @@ -15,7 +15,7 @@ * * Created: H5MPprivate.h * May 2 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private header for memory pool routines. * diff --git a/src/H5MPtest.c b/src/H5MPtest.c index 0cba847..fa5b165 100644 --- a/src/H5MPtest.c +++ b/src/H5MPtest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Tuesday, May 3, 2005 * * Purpose: Memory pool testing functions. @@ -42,8 +42,6 @@ * Programmer: Quincey Koziol * Tuesday, May 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -74,8 +72,6 @@ H5MP_get_pool_free_size(const H5MP_pool_t *mp, size_t *free_size) * Programmer: Quincey Koziol * Tuesday, May 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -109,8 +105,6 @@ H5MP_get_pool_first_page(const H5MP_pool_t *mp, H5MP_page_t **page) * Programmer: Quincey Koziol * Wednesday, May 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ htri_t @@ -144,9 +138,6 @@ H5MP_pool_is_free_size_correct(const H5MP_pool_t *mp) /* Check that the free space from the blocks on the free list * corresponds to space in page */ -#ifdef QAK -HDfprintf(stderr,"%s: page_free = %Zu, page->free_size = %Zu\n", "H5MP_pool_is_free_size_correct", page_free, page->free_size); -#endif /* QAK */ if(page_free != page->free_size) HGOTO_DONE (FALSE) @@ -159,9 +150,6 @@ HDfprintf(stderr,"%s: page_free = %Zu, page->free_size = %Zu\n", "H5MP_pool_is_f /* Check that the free space from the pages * corresponds to free space in pool */ -#ifdef QAK -HDfprintf(stderr,"%s: pool_free = %Zu, mp->free_size = %Zu\n", "H5MP_pool_is_free_size_correct", pool_free, mp->free_size); -#endif /* QAK */ if(pool_free != mp->free_size) HGOTO_DONE (FALSE) @@ -182,8 +170,6 @@ done: * Programmer: Quincey Koziol * Tuesday, May 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -214,8 +200,6 @@ H5MP_get_page_free_size(const H5MP_page_t *page, size_t *free_size) * Programmer: Quincey Koziol * Tuesday, May 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index 2d95ee9..fb08048 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -15,7 +15,7 @@ * * Created: H5Oainfo.c * Mar 6 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Attribute Information messages. * @@ -36,12 +36,12 @@ /* PRIVATE PROTOTYPES */ static void *H5O__ainfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_ainfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_ainfo_copy(const void *_mesg, void *_dest); -static size_t H5O_ainfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__ainfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__ainfo_copy(const void *_mesg, void *_dest); +static size_t H5O__ainfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__ainfo_free(void *_mesg); static herr_t H5O__ainfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); -static herr_t H5O_ainfo_pre_copy_file(H5F_t *file_src, const void *mesg_src, +static herr_t H5O__ainfo_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); static void *H5O__ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, @@ -59,16 +59,16 @@ const H5O_msg_class_t H5O_MSG_AINFO[1] = {{ sizeof(H5O_ainfo_t), /*native message size */ 0, /* messages are sharable? */ H5O__ainfo_decode, /*decode message */ - H5O_ainfo_encode, /*encode message */ - H5O_ainfo_copy, /*copy the native value */ - H5O_ainfo_size, /*size of symbol table entry */ + H5O__ainfo_encode, /*encode message */ + H5O__ainfo_copy, /*copy the native value */ + H5O__ainfo_size, /*size of symbol table entry */ NULL, /*default reset method */ H5O__ainfo_free, /* free method */ H5O__ainfo_delete, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ - H5O_ainfo_pre_copy_file, /* pre copy native value to file */ + H5O__ainfo_pre_copy_file, /* pre copy native value to file */ H5O__ainfo_copy_file, /* copy native value to file */ H5O__ainfo_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ @@ -97,7 +97,6 @@ H5FL_DEFINE_STATIC(H5O_ainfo_t); * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 6 2007 * *------------------------------------------------------------------------- @@ -165,25 +164,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_ainfo_encode + * Function: H5O__ainfo_encode * * Purpose: Encodes a message. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 6 2007 * *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg; unsigned char flags; /* Flags for encoding attribute info */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -215,11 +213,11 @@ H5O_ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co HDassert(!H5F_addr_defined(ainfo->corder_bt2_addr)); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_ainfo_encode() */ +} /* end H5O__ainfo_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_ainfo_copy + * Function: H5O__ainfo_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -228,19 +226,18 @@ H5O_ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 6 2007 * *------------------------------------------------------------------------- */ static void * -H5O_ainfo_copy(const void *_mesg, void *_dest) +H5O__ainfo_copy(const void *_mesg, void *_dest) { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg; H5O_ainfo_t *dest = (H5O_ainfo_t *) _dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(ainfo); @@ -255,11 +252,11 @@ H5O_ainfo_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_ainfo_copy() */ +} /* end H5O__ainfo_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_ainfo_size + * Function: H5O__ainfo_size * * Purpose: Returns the size of the raw message in bytes not counting * the message type or size fields, but only the data fields. @@ -269,18 +266,17 @@ done: * Failure: zero * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 6 2007 * *------------------------------------------------------------------------- */ static size_t -H5O_ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set return value */ ret_value = (size_t)(1 /* Version */ @@ -291,7 +287,7 @@ H5O_ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void + (ainfo->index_corder ? H5F_SIZEOF_ADDR(f) : 0)); /* Address of v2 B-tree for indexing creation order values of attributes */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_ainfo_size() */ +} /* end H5O__ainfo_size() */ /*------------------------------------------------------------------------- @@ -358,7 +354,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_ainfo_pre_copy_file + * Function: H5O__ainfo_pre_copy_file * * Purpose: Perform any necessary actions before copying message between * files. @@ -372,10 +368,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, +H5O__ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(deleted); @@ -388,7 +384,7 @@ H5O_ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSE *deleted = TRUE; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_ainfo_pre_copy_file() */ +} /* end H5O__ainfo_pre_copy_file() */ /*------------------------------------------------------------------------- @@ -499,7 +495,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 6 2007 * *------------------------------------------------------------------------- diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 8850ef6..3c19cf4 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -15,7 +15,7 @@ * * Created: H5Oalloc.c * Nov 17 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Object header allocation routines. * @@ -105,7 +105,6 @@ H5FL_EXTERN(H5O_cont_t); * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 17 2006 * *------------------------------------------------------------------------- @@ -231,7 +230,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 17 2006 * *------------------------------------------------------------------------- @@ -332,7 +330,6 @@ H5O__eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 22 2006 * *------------------------------------------------------------------------- @@ -440,7 +437,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Nov 21 2005 * *------------------------------------------------------------------------- @@ -729,7 +725,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@lbl.gov * Oct 21 2016 * *------------------------------------------------------------------------- @@ -878,7 +873,6 @@ H5O__alloc_find_best_nonnull(const H5F_t *f, const H5O_t *oh, size_t *size, * Failure: Negative * * Programmer: Quincey Koziol - * koziol@lbl.gov * Oct 21 2016 * *------------------------------------------------------------------------- @@ -1157,7 +1151,6 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 7 1997 * *------------------------------------------------------------------------- @@ -1208,7 +1201,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@lbl.gov * Oct 21 2016 * *------------------------------------------------------------------------- @@ -1283,7 +1275,6 @@ H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx) * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -1369,7 +1360,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 22 2006 * *------------------------------------------------------------------------- @@ -1607,7 +1597,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Oct 17 2005 * *------------------------------------------------------------------------- @@ -1958,7 +1947,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Oct 10 2005 * *------------------------------------------------------------------------- @@ -2101,7 +2089,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Oct 17 2005 * *------------------------------------------------------------------------- @@ -2286,7 +2273,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Oct 4 2005 * *------------------------------------------------------------------------- @@ -2347,7 +2333,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Neil Fortner - * nfortne2@hdfgroup.org * Oct 20 2008 * *------------------------------------------------------------------------- diff --git a/src/H5Oattr.c b/src/H5Oattr.c index e38ef5c..7fa4cad 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -24,13 +24,13 @@ #include "H5Spkg.h" /* Dataspaces */ /* PRIVATE PROTOTYPES */ -static herr_t H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_attr_decode(H5F_t *f, H5O_t *open_oh, +static herr_t H5O__attr_encode(H5F_t *f, uint8_t *p, const void *mesg); +static void *H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static void *H5O_attr_copy(const void *_mesg, void *_dest); -static size_t H5O_attr_size(const H5F_t *f, const void *_mesg); +static void *H5O__attr_copy(const void *_mesg, void *_dest); +static size_t H5O__attr_size(const H5F_t *f, const void *_mesg); static herr_t H5O__attr_free(void *mesg); -static herr_t H5O_attr_pre_copy_file(H5F_t *file_src, const void *mesg_src, +static herr_t H5O__attr_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); static void *H5O__attr_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, @@ -38,29 +38,29 @@ static void *H5O__attr_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_ty static herr_t H5O__attr_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, H5O_copy_t *cpy_info); -static herr_t H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx); -static herr_t H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx); +static herr_t H5O__attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx); +static herr_t H5O__attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx); static herr_t H5O__attr_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_ATTR -#define H5O_SHARED_DECODE H5O_attr_shared_decode -#define H5O_SHARED_DECODE_REAL H5O_attr_decode -#define H5O_SHARED_ENCODE H5O_attr_shared_encode -#define H5O_SHARED_ENCODE_REAL H5O_attr_encode -#define H5O_SHARED_SIZE H5O_attr_shared_size -#define H5O_SHARED_SIZE_REAL H5O_attr_size +#define H5O_SHARED_DECODE H5O__attr_shared_decode +#define H5O_SHARED_DECODE_REAL H5O__attr_decode +#define H5O_SHARED_ENCODE H5O__attr_shared_encode +#define H5O_SHARED_ENCODE_REAL H5O__attr_encode +#define H5O_SHARED_SIZE H5O__attr_shared_size +#define H5O_SHARED_SIZE_REAL H5O__attr_size #define H5O_SHARED_DELETE H5O__attr_shared_delete #define H5O_SHARED_DELETE_REAL H5O__attr_delete #define H5O_SHARED_LINK H5O__attr_shared_link #define H5O_SHARED_LINK_REAL H5O__attr_link #define H5O_SHARED_COPY_FILE H5O__attr_shared_copy_file #define H5O_SHARED_COPY_FILE_REAL H5O__attr_copy_file -#define H5O_SHARED_POST_COPY_FILE H5O_attr_shared_post_copy_file +#define H5O_SHARED_POST_COPY_FILE H5O__attr_shared_post_copy_file #define H5O_SHARED_POST_COPY_FILE_REAL H5O__attr_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_UPD -#define H5O_SHARED_DEBUG H5O_attr_shared_debug +#define H5O_SHARED_DEBUG H5O__attr_shared_debug #define H5O_SHARED_DEBUG_REAL H5O__attr_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ @@ -70,22 +70,22 @@ const H5O_msg_class_t H5O_MSG_ATTR[1] = {{ "attribute", /* message name for debugging */ sizeof(H5A_t), /* native message size */ H5O_SHARE_IS_SHARABLE, /* messages are sharable? */ - H5O_attr_shared_decode, /* decode message */ - H5O_attr_shared_encode, /* encode message */ - H5O_attr_copy, /* copy the native value */ - H5O_attr_shared_size, /* size of raw message */ + H5O__attr_shared_decode, /* decode message */ + H5O__attr_shared_encode, /* encode message */ + H5O__attr_copy, /* copy the native value */ + H5O__attr_shared_size, /* size of raw message */ H5O__attr_reset, /* reset method */ H5O__attr_free, /* free method */ H5O__attr_shared_delete, /* file delete method */ H5O__attr_shared_link, /* link method */ NULL, /* set share method */ NULL, /* can share method */ - H5O_attr_pre_copy_file, /* pre copy native value to file */ + H5O__attr_pre_copy_file, /* pre copy native value to file */ H5O__attr_shared_copy_file, /* copy native value to file */ - H5O_attr_shared_post_copy_file, /* post copy native value to file */ - H5O_attr_get_crt_index, /* get creation index */ - H5O_attr_set_crt_index, /* set creation index */ - H5O_attr_shared_debug /* debug the message */ + H5O__attr_shared_post_copy_file, /* post copy native value to file */ + H5O__attr_get_crt_index, /* get creation index */ + H5O__attr_set_crt_index, /* set creation index */ + H5O__attr_shared_debug /* debug the message */ }}; /* Flags for attribute flag encoding */ @@ -102,12 +102,12 @@ H5FL_EXTERN(H5S_extent_t); /*-------------------------------------------------------------------------- NAME - H5O_attr_decode + H5O__attr_decode PURPOSE Decode a attribute message and return a pointer to a memory struct with the decoded information USAGE - void *H5O_attr_decode(f, mesg_flags, p) + void *H5O__attr_decode(f, mesg_flags, p) H5F_t *f; IN: pointer to the HDF5 file struct unsigned mesg_flags; IN: Message flags to influence decoding const uint8_t *p; IN: the raw information buffer @@ -119,7 +119,7 @@ H5FL_EXTERN(H5S_extent_t); function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, +H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5A_t *attr = NULL; @@ -131,7 +131,7 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned flags = 0; /* Attribute flags */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -267,16 +267,16 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_decode() */ +} /* end H5O__attr_decode() */ /*-------------------------------------------------------------------------- NAME - H5O_attr_encode + H5O__attr_encode PURPOSE Encode a simple attribute message USAGE - herr_t H5O_attr_encode(f, p, mesg) + herr_t H5O__attr_encode(f, p, mesg) H5F_t *f; IN: pointer to the HDF5 file struct const uint8 *p; IN: the raw information buffer const void *mesg; IN: Pointer to the simple datatype struct @@ -287,7 +287,7 @@ done: message in the "raw" disk form. --------------------------------------------------------------------------*/ static herr_t -H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg) +H5O__attr_encode(H5F_t *f, uint8_t *p, const void *mesg) { const H5A_t *attr = (const H5A_t *) mesg; size_t name_len; /* Attribute name length */ @@ -296,7 +296,7 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg) unsigned flags = 0; /* Attribute flags */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -376,16 +376,16 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg) done: FUNC_LEAVE_NOAPI(ret_value); -} /* end H5O_attr_encode() */ +} /* end H5O__attr_encode() */ /*-------------------------------------------------------------------------- NAME - H5O_attr_copy + H5O__attr_copy PURPOSE Copies a message from MESG to DEST, allocating DEST if necessary. USAGE - void *H5O_attr_copy(mesg, dest) + void *H5O__attr_copy(mesg, dest) const void *mesg; IN: Pointer to the source attribute struct const void *dest; IN: Pointer to the destination attribute struct RETURNS @@ -395,11 +395,11 @@ done: allocating the destination structure if necessary. --------------------------------------------------------------------------*/ static void * -H5O_attr_copy(const void *_src, void *_dst) +H5O__attr_copy(const void *_src, void *_dst) { void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(_src); @@ -410,16 +410,16 @@ H5O_attr_copy(const void *_src, void *_dst) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_copy() */ +} /* end H5O__attr_copy() */ /*-------------------------------------------------------------------------- NAME - H5O_attr_size + H5O__attr_size PURPOSE Return the raw message size in bytes USAGE - size_t H5O_attr_size(f, mesg) + size_t H5O__attr_size(f, mesg) H5F_t *f; IN: pointer to the HDF5 file struct const void *mesg; IN: Pointer to the source attribute struct RETURNS @@ -430,13 +430,13 @@ done: portion of the message). It doesn't take into account alignment. --------------------------------------------------------------------------*/ static size_t -H5O_attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg) +H5O__attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg) { const H5A_t *attr = (const H5A_t *)_mesg; size_t name_len; size_t ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(attr); @@ -471,7 +471,7 @@ H5O_attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg) HDassert(0 && "Bad attribute version"); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_size() */ +} /* end H5O__attr_size() */ /*------------------------------------------------------------------------- @@ -605,7 +605,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_pre_copy_file + * Function: H5O__attr_pre_copy_file * * Purpose: Perform any necessary actions before copying message between * files for attribute messages. @@ -618,13 +618,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src, +H5O__attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { const H5A_t *attr_src = (const H5A_t *)native_src; /* Source attribute */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(deleted); @@ -645,7 +645,7 @@ H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_pre_copy_file() */ +} /* end H5O__attr_pre_copy_file() */ /*------------------------------------------------------------------------- @@ -723,7 +723,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_get_crt_index + * Function: H5O__attr_get_crt_index * * Purpose: Get creation index from the message * @@ -735,11 +735,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx /*out*/) +H5O__attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx /*out*/) { const H5A_t *attr = (const H5A_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(attr); HDassert(crt_idx); @@ -748,11 +748,11 @@ H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx /*out*/) *crt_idx = attr->shared->crt_idx; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_attr_get_crt_index() */ +} /* end H5O__attr_get_crt_index() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_set_crt_index + * Function: H5O__attr_set_crt_index * * Purpose: Set creation index from the message * @@ -764,11 +764,11 @@ H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx /*out*/) *------------------------------------------------------------------------- */ static herr_t -H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx) +H5O__attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx) { H5A_t *attr = (H5A_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(attr); @@ -776,7 +776,7 @@ H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx) attr->shared->crt_idx = crt_idx; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_attr_set_crt_index() */ +} /* end H5O__attr_set_crt_index() */ /*-------------------------------------------------------------------------- diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index d498be5..416ee51 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -149,7 +149,6 @@ static herr_t H5O__attr_exists_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg, * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 4 2006 * *------------------------------------------------------------------------- @@ -393,7 +392,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 11 2006 * *------------------------------------------------------------------------- @@ -541,7 +539,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 18 2006 * *------------------------------------------------------------------------- @@ -727,7 +724,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jan 2 2007 * *------------------------------------------------------------------------- @@ -802,7 +798,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 4 2006 * *------------------------------------------------------------------------- @@ -960,7 +955,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 5 2006 * *------------------------------------------------------------------------- @@ -1006,7 +1000,6 @@ H5O__attr_rename_chk_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 5 2006 * *------------------------------------------------------------------------- @@ -1468,7 +1461,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 11 2006 * *------------------------------------------------------------------------- @@ -1745,7 +1737,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 11 2006 * *------------------------------------------------------------------------- @@ -1928,48 +1919,3 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5O__attr_bh_info() */ -#ifndef H5_NO_DEPRECATED_SYMBOLS - -/*------------------------------------------------------------------------- - * Function: H5O__attr_count - * - * Purpose: Determine the # of attributes on an object - * - * Return: SUCCEED/FAIL - * - * Programmer: Quincey Koziol - * Monday, December 11, 2006 - * - *------------------------------------------------------------------------- - */ -int -H5O__attr_count(const H5O_loc_t *loc) -{ - H5O_t *oh = NULL; /* Pointer to actual object header */ - hsize_t nattrs; /* Number of attributes */ - int ret_value = -1; /* Return value */ - - FUNC_ENTER_PACKAGE - - /* Check arguments */ - HDassert(loc); - - /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") - - /* Retrieve # of attributes on object */ - if(H5O__attr_count_real(loc->file, oh, &nattrs) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve attribute count") - - /* Set return value */ - ret_value = (int)nattrs; - -done: - if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O__attr_count */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - diff --git a/src/H5Obogus.c b/src/H5Obogus.c index f3cca0f..08b03b3 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -15,7 +15,7 @@ * * Created: H5Obogus.c * Jan 21 2003 - * Quincey Koziol + * Quincey Koziol * * Purpose: "bogus" message. This message is guaranteed to never * be found in a valid HDF5 file and is only used to @@ -39,8 +39,8 @@ /* PRIVATE PROTOTYPES */ static void *H5O__bogus_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_bogus_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static size_t H5O_bogus_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__bogus_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static size_t H5O__bogus_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__bogus_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -51,9 +51,9 @@ const H5O_msg_class_t H5O_MSG_BOGUS_VALID[1] = {{ 0, /*native message size */ H5O_SHARE_IS_SHARABLE, /* messages are sharable? */ H5O__bogus_decode, /*decode message */ - H5O_bogus_encode, /*encode message */ + H5O__bogus_encode, /*encode message */ NULL, /*copy the native value */ - H5O_bogus_size, /*raw message size */ + H5O__bogus_size, /*raw message size */ NULL, /*free internal memory */ NULL, /*free method */ NULL, /* file delete method */ @@ -75,9 +75,9 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{ 0, /*native message size */ H5O_SHARE_IS_SHARABLE, /* messages are sharable? */ H5O__bogus_decode, /*decode message */ - H5O_bogus_encode, /*encode message */ + H5O__bogus_encode, /*encode message */ NULL, /*copy the native value */ - H5O_bogus_size, /*raw message size */ + H5O__bogus_size, /*raw message size */ NULL, /*free internal memory */ NULL, /*free method */ NULL, /* file delete method */ @@ -104,7 +104,6 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{ * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 21 2003 * *------------------------------------------------------------------------- @@ -146,22 +145,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_bogus_encode + * Function: H5O__bogus_encode * * Purpose: Encodes a "bogus" message. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 21 2003 * *------------------------------------------------------------------------- */ static herr_t -H5O_bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void H5_ATTR_UNUSED *mesg) +H5O__bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void H5_ATTR_UNUSED *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -172,11 +170,11 @@ H5O_bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, UINT32ENCODE(p, H5O_BOGUS_VALUE); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_bogus_encode() */ +} /* end H5O__bogus_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_bogus_size + * Function: H5O__bogus_size * * Purpose: Returns the size of the raw message in bytes not * counting the message typ or size fields, but only the data @@ -188,18 +186,17 @@ H5O_bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 21 2003 * *------------------------------------------------------------------------- */ static size_t -H5O_bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *mesg) +H5O__bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(4) -} /* end H5O_bogus_size() */ +} /* end H5O__bogus_size() */ /*------------------------------------------------------------------------- @@ -210,11 +207,8 @@ H5O_bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 21 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c index 5a98e59..4d3c64e 100644 --- a/src/H5Obtreek.c +++ b/src/H5Obtreek.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Thursday, March 1, 2007 * * Purpose: A message holding non-default v1 B-tree 'K' value @@ -27,11 +27,11 @@ #include "H5Opkg.h" /* Object headers */ #include "H5MMprivate.h" /* Memory management */ -static void *H5O_btreek_decode(H5F_t *f, H5O_t *open_oh, +static void *H5O__btreek_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_btreek_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_btreek_copy(const void *_mesg, void *_dest); -static size_t H5O_btreek_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__btreek_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__btreek_copy(const void *_mesg, void *_dest); +static size_t H5O__btreek_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__btreek_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -40,11 +40,11 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ H5O_BTREEK_ID, /*message id number */ "v1 B-tree 'K' values", /*message name for debugging */ sizeof(H5O_btreek_t), /*native message size */ - 0, /* messages are sharable? */ - H5O_btreek_decode, /*decode message */ - H5O_btreek_encode, /*encode message */ - H5O_btreek_copy, /*copy the native value */ - H5O_btreek_size, /*raw message size */ + 0, /* messages are sharable? */ + H5O__btreek_decode, /*decode message */ + H5O__btreek_encode, /*encode message */ + H5O__btreek_copy, /*copy the native value */ + H5O__btreek_size, /*raw message size */ NULL, /*free internal memory */ NULL, /* free method */ NULL, /* file delete method */ @@ -56,7 +56,7 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O__btreek_debug /*debug the message */ + H5O__btreek_debug /*debug the message */ }}; /* Current version of v1 B-tree 'K' value information */ @@ -64,7 +64,7 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ /*------------------------------------------------------------------------- - * Function: H5O_btreek_decode + * Function: H5O__btreek_decode * * Purpose: Decode a shared message table message and return a pointer * to a newly allocated H5O_btreek_t struct. @@ -78,14 +78,14 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_btreek_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__btreek_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_btreek_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); @@ -109,11 +109,11 @@ H5O_btreek_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_btreek_decode() */ +} /* end H5O__btreek_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_btreek_encode + * Function: H5O__btreek_encode * * Purpose: Encode a v1 B-tree 'K' value message. * @@ -125,11 +125,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_btreek_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__btreek_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_btreek_t *mesg = (const H5O_btreek_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -143,11 +143,11 @@ H5O_btreek_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared UINT16ENCODE(p, mesg->sym_leaf_k); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_btreek_encode() */ +} /* end H5O__btreek_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_btreek_copy + * Function: H5O__btreek_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -161,13 +161,13 @@ H5O_btreek_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared *------------------------------------------------------------------------- */ static void * -H5O_btreek_copy(const void *_mesg, void *_dest) +H5O__btreek_copy(const void *_mesg, void *_dest) { const H5O_btreek_t *mesg = (const H5O_btreek_t *)_mesg; H5O_btreek_t *dest = (H5O_btreek_t *)_dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(mesg); @@ -183,11 +183,11 @@ H5O_btreek_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_btreek_copy() */ +} /* end H5O__btreek_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_btreek_size + * Function: H5O__btreek_size * * Purpose: Returns the size of the raw message in bytes not counting the * message type or size fields, but only the data fields. @@ -201,11 +201,11 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) +H5O__btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -216,7 +216,7 @@ H5O_btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sh 2; /* Symbol table node leaf 'K' value */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_btreek_size() */ +} /* end H5O__btreek_size() */ /*------------------------------------------------------------------------- diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 45c55fd..58db827 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -15,7 +15,7 @@ * * Created: H5Ocache.c * Sep 28 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Object header metadata cache virtual functions. * @@ -84,8 +84,7 @@ static herr_t H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing); static herr_t H5O__cache_chk_free_icr(void *thing); /* Prefix routines */ -static herr_t H5O__prefix_deserialize(const uint8_t *image, - H5O_cache_ud_t *udata); +static herr_t H5O__prefix_deserialize(const uint8_t *image, H5O_cache_ud_t *udata); /* Chunk routines */ static herr_t H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, @@ -294,7 +293,7 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata) * * Note that the object header is read with with a speculative read. * If the initial read is too small, make note of this fact and return - * without error. H5C_load_entry() will note the size discrepency + * without error. H5C__load_entry() will note the size discrepency * and retry the deserialize operation with the correct size read. * * Return: Success: Pointer to in core representation @@ -1081,7 +1080,6 @@ done: * Failure: FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 12, 2008 * *------------------------------------------------------------------------- @@ -1300,7 +1298,6 @@ done: * Failure: FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 12, 2008 * *------------------------------------------------------------------------- @@ -1644,7 +1641,6 @@ done: * Failure: FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * July 12, 2008 * *------------------------------------------------------------------------- diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c index 6ac04c8..ac51aff 100644 --- a/src/H5Ocache_image.c +++ b/src/H5Ocache_image.c @@ -294,39 +294,8 @@ H5O__mdci_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) * from the VFD layer at the end of file. As this was the * last file space allocation before shutdown, the cache image * should still be the last item in the file. - * - * If the hack to work around the self referential free space - * manager issue is in use, file space for the non-empty self - * referential free space managers was also allocated from VFD - * layer at the end of file. Since these allocations directly - * preceeded the cache image allocation they should be directly - * adjacent to the cache image block at the end of file. - * - * In this case, just call H5MF_tidy_self_referential_fsm_hack(). - * - * That routine will float the self referential free space - * managers, and reduce the eoa to its value just prior to - * allocation of space for same. Since the cache image appears - * just after the self referential free space managers, this - * will release the file space for the cache image as well. - * - * Note that in this case, there must not have been any file - * space allocations / deallocations prior to the free of the - * cache image. Verify this to the extent possible. - * - * If the hack to work around the persistent self referential - * free space manager issue is NOT in use, just call H5MF_xfree() - * to release the cache iamge. In principle, we should be able - * to just reduce the EOA to the base address of the cache - * image block, as there shouldn't be any file space allocation - * before the first metadata cache access. However, given - * time constraints, I don't want to go there now. */ - - - if(f->shared->closing) { - /* Get the eoa, and verify that it has the expected value */ if(HADDR_UNDEF == (final_eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT)) ) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "unable to get file size") @@ -335,11 +304,10 @@ H5O__mdci_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) if(H5FD_free(f->shared->lf, H5FD_MEM_SUPER, f, mesg->addr, mesg->size) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't free MDC image") - } else { + } + else if(H5MF_xfree(f, H5FD_MEM_SUPER, mesg->addr, mesg->size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free file space for cache image block") - } - } /* end if */ done: diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 469a9e0..6718501 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -256,7 +256,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_copy + * Function: H5O__copy * * Purpose: Private version of H5Ocopy * @@ -268,7 +268,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, +H5O__copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id) { H5G_loc_t src_loc; /* Source object group location */ @@ -279,7 +279,7 @@ H5O_copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, hbool_t obj_open = FALSE; /* Entry at 'name' found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); @@ -319,7 +319,7 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy() */ +} /* end H5O__copy() */ /*------------------------------------------------------------------------- @@ -1307,10 +1307,10 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_copy_search_comm_dt_attr_cb + * Function: H5O__copy_search_comm_dt_attr_cb * * Purpose: Callback for H5O_attr_iterate_real from - * H5O_copy_search_comm_dt_check. Checks if the attribute's + * H5O__copy_search_comm_dt_check. Checks if the attribute's * datatype is committed. If it is, adds it to the merge * committed dt skiplist present in udata if it does not match * any already present. @@ -1323,7 +1323,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_search_comm_dt_attr_cb(const H5A_t *attr, void *_udata) +H5O__copy_search_comm_dt_attr_cb(const H5A_t *attr, void *_udata) { H5O_copy_search_comm_dt_ud_t *udata = (H5O_copy_search_comm_dt_ud_t *)_udata; H5T_t *dt = NULL; /* Datatype */ @@ -1332,7 +1332,7 @@ H5O_copy_search_comm_dt_attr_cb(const H5A_t *attr, void *_udata) hbool_t obj_inserted = FALSE; /* Object inserted into skip list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(attr); @@ -1385,11 +1385,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_search_comm_dt_attr_cb */ +} /* end H5O__copy_search_comm_dt_attr_cb */ /*------------------------------------------------------------------------- - * Function: H5O_copy_search_comm_dt_check + * Function: H5O__copy_search_comm_dt_check * * Purpose: Check if the object at obj_oloc is or contains a reference * to a committed datatype. If it does, adds it to the merge @@ -1404,7 +1404,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, +H5O__copy_search_comm_dt_check(H5O_loc_t *obj_oloc, H5O_copy_search_comm_dt_ud_t *udata) { H5O_copy_search_comm_dt_key_t *key = NULL; /* Skiplist key */ @@ -1414,7 +1414,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, const H5O_obj_class_t *obj_class = NULL; /* Type of object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(obj_oloc); @@ -1483,7 +1483,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, /* Search within attributes */ attr_op.op_type = H5A_ATTR_OP_LIB; - attr_op.u.lib_op = H5O_copy_search_comm_dt_attr_cb; + attr_op.u.lib_op = H5O__copy_search_comm_dt_attr_cb; udata->obj_oloc.file = obj_oloc->file; udata->obj_oloc.addr = obj_oloc->addr; if(H5O_attr_iterate_real((hid_t)-1, obj_oloc, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, &attr_op, udata) < 0) @@ -1504,7 +1504,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_search_comm_dt_check */ +} /* end H5O__copy_search_comm_dt_check */ /*------------------------------------------------------------------------- @@ -1512,7 +1512,7 @@ done: * * Purpose: H5G_visit callback to add committed datatypes to the merge * committed dt skiplist. Mostly a wrapper for - * H5O_copy_search_comm_dt_check. + * H5O__copy_search_comm_dt_check. * * Return: Non-negative on success/Negative on failure * @@ -1554,7 +1554,7 @@ H5O__copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name, obj_found = TRUE; /* Check object and add to skip list if appropriate */ - if(H5O_copy_search_comm_dt_check(&obj_oloc, udata) < 0) + if(H5O__copy_search_comm_dt_check(&obj_oloc, udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "can't check object") } /* end if */ @@ -1653,7 +1653,7 @@ H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5E_clear_stack(NULL); else /* Check object and add to skip list if appropriate */ - if(H5O_copy_search_comm_dt_check(&obj_oloc, &udata) < 0) { + if(H5O__copy_search_comm_dt_check(&obj_oloc, &udata) < 0) { if(H5G_loc_free(&obj_loc) < 0) HERROR(H5E_OHDR, H5E_CANTRELEASE, "can't free location"); HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't check object") diff --git a/src/H5Ocopy_ref.c b/src/H5Ocopy_ref.c index 0de661f..e03bb69 100644 --- a/src/H5Ocopy_ref.c +++ b/src/H5Ocopy_ref.c @@ -178,30 +178,29 @@ H5O__copy_expand_ref_object1(H5O_loc_t *src_oloc, const void *buf_src, H5O_token_t tmp_token = { 0 }; /* If data is not initialized, copy zeros and skip */ - if(0 == HDmemcmp(src_buf, zeros, buf_size)) { + if(0 == HDmemcmp(src_buf, zeros, buf_size)) HDmemset(dst_buf, 0, buf_size); - continue; - } - - /* Set up for the object copy for the reference */ - if(H5R__decode_token_obj_compat(src_buf, &buf_size, &tmp_token, token_size) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to decode src object address") - if(H5VL_native_token_to_addr(src_oloc->file, H5I_FILE, tmp_token, &src_oloc->addr) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTUNSERIALIZE, FAIL, "can't deserialize object token into address") - - if(!H5F_addr_defined(src_oloc->addr) || src_oloc->addr == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "undefined reference pointer") - dst_oloc->addr = HADDR_UNDEF; - - /* Attempt to copy object from source to destination file */ - if(H5O__copy_obj_by_ref(src_oloc, dst_oloc, dst_root_loc, cpy_info) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") - - /* Set the object reference info for the destination file */ - if(H5VL_native_addr_to_token(dst_oloc->file, H5I_FILE, dst_oloc->addr, &tmp_token) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "can't serialize address into object token") - if(H5R__encode_token_obj_compat((const H5O_token_t *)&tmp_token, token_size, dst_buf, &buf_size) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to encode dst object address") + else { + /* Set up for the object copy for the reference */ + if(H5R__decode_token_obj_compat(src_buf, &buf_size, &tmp_token, token_size) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to decode src object address") + if(H5VL_native_token_to_addr(src_oloc->file, H5I_FILE, tmp_token, &src_oloc->addr) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTUNSERIALIZE, FAIL, "can't deserialize object token into address") + + if(!H5F_addr_defined(src_oloc->addr) || src_oloc->addr == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "undefined reference pointer") + dst_oloc->addr = HADDR_UNDEF; + + /* Attempt to copy object from source to destination file */ + if(H5O__copy_obj_by_ref(src_oloc, dst_oloc, dst_root_loc, cpy_info) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") + + /* Set the object reference info for the destination file */ + if(H5VL_native_addr_to_token(dst_oloc->file, H5I_FILE, dst_oloc->addr, &tmp_token) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "can't serialize address into object token") + if(H5R__encode_token_obj_compat((const H5O_token_t *)&tmp_token, token_size, dst_buf, &buf_size) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to encode dst object address") + } /* end else */ } /* end for */ done: @@ -242,42 +241,41 @@ H5O__copy_expand_ref_region1(H5O_loc_t *src_oloc, const void *buf_src, uint8_t *q; /* If data is not initialized, copy zeros and skip */ - if(0 == HDmemcmp(src_buf, zeros, buf_size)) { + if(0 == HDmemcmp(src_buf, zeros, buf_size)) HDmemset(dst_buf, 0, buf_size); - continue; - } - - /* Read from heap */ - if(H5R__decode_heap(src_oloc->file, src_buf, &buf_size, &data, &data_size) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to decode dataset region information") - - /* Get object address */ - p = (const uint8_t *)data; - H5F_addr_decode(src_oloc->file, &p, &src_oloc->addr); - if(!H5F_addr_defined(src_oloc->addr) || src_oloc->addr == 0) { - H5MM_free(data); - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "undefined reference pointer") - } - dst_oloc->addr = HADDR_UNDEF; - - /* Attempt to copy object from source to destination file */ - if(H5O__copy_obj_by_ref(src_oloc, dst_oloc, dst_root_loc, cpy_info) < 0) { + else { + /* Read from heap */ + if(H5R__decode_heap(src_oloc->file, src_buf, &buf_size, &data, &data_size) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to decode dataset region information") + + /* Get object address */ + p = (const uint8_t *)data; + H5F_addr_decode(src_oloc->file, &p, &src_oloc->addr); + if(!H5F_addr_defined(src_oloc->addr) || src_oloc->addr == 0) { + H5MM_free(data); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "undefined reference pointer") + } + dst_oloc->addr = HADDR_UNDEF; + + /* Attempt to copy object from source to destination file */ + if(H5O__copy_obj_by_ref(src_oloc, dst_oloc, dst_root_loc, cpy_info) < 0) { + H5MM_free(data); + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") + } /* end if */ + + /* Serialize object addr */ + q = (uint8_t *)data; + H5F_addr_encode(dst_oloc->file, &q, dst_oloc->addr); + + /* Write to heap */ + if(H5R__encode_heap(dst_oloc->file, dst_buf, &buf_size, data, (size_t)data_size) < 0) { + H5MM_free(data); + HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to encode dataset region information") + } + + /* Free the buffer allocated in H5R__decode_heap() */ H5MM_free(data); - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") - } /* end if */ - - /* Serialize object addr */ - q = (uint8_t *)data; - H5F_addr_encode(dst_oloc->file, &q, dst_oloc->addr); - - /* Write to heap */ - if(H5R__encode_heap(dst_oloc->file, dst_buf, &buf_size, data, (size_t)data_size) < 0) { - H5MM_free(data); - HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to encode dataset region information") - } - - /* Free the buffer allocated in H5R__decode_heap() */ - H5MM_free(data); + } /* end else */ } /* end for */ done: diff --git a/src/H5Odbg.c b/src/H5Odbg.c index 3c91cae..b476b17 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -15,7 +15,7 @@ * * Created: H5Odbg.c * Nov 17 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Object header debugging routines. * @@ -84,7 +84,6 @@ * Return: SUCCEED (Doesn't fail, just crashes) * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 17 2006 * *------------------------------------------------------------------------- @@ -236,7 +235,6 @@ H5O__assert(const H5O_t *oh) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 13 2003 * *------------------------------------------------------------------------- @@ -277,7 +275,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -544,7 +541,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c index eb678e4..dffacfd 100644 --- a/src/H5Odrvinfo.c +++ b/src/H5Odrvinfo.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Thursday, March 1, 2007 * * Purpose: A message holding driver info settings @@ -27,11 +27,11 @@ #include "H5Opkg.h" /* Object headers */ #include "H5MMprivate.h" /* Memory management */ -static void *H5O_drvinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, +static void *H5O__drvinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_drvinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_drvinfo_copy(const void *_mesg, void *_dest); -static size_t H5O_drvinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__drvinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__drvinfo_copy(const void *_mesg, void *_dest); +static size_t H5O__drvinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__drvinfo_reset(void *_mesg); static herr_t H5O__drvinfo_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -41,23 +41,23 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ H5O_DRVINFO_ID, /*message id number */ "driver info", /*message name for debugging */ sizeof(H5O_drvinfo_t), /*native message size */ - 0, /* messages are sharable? */ - H5O_drvinfo_decode, /*decode message */ - H5O_drvinfo_encode, /*encode message */ - H5O_drvinfo_copy, /*copy the native value */ - H5O_drvinfo_size, /*raw message size */ + 0, /* messages are sharable? */ + H5O__drvinfo_decode, /*decode message */ + H5O__drvinfo_encode, /*encode message */ + H5O__drvinfo_copy, /*copy the native value */ + H5O__drvinfo_size, /*raw message size */ H5O__drvinfo_reset, /*free internal memory */ NULL, /* free method */ NULL, /* file delete method */ NULL, /* link method */ - NULL, /*set share method */ + NULL, /*set share method */ NULL, /*can share method */ NULL, /* pre copy native value to file */ NULL, /* copy native value to file */ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O__drvinfo_debug /*debug the message */ + H5O__drvinfo_debug /*debug the message */ }}; /* Current version of driver info information */ @@ -65,7 +65,7 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ /*------------------------------------------------------------------------- - * Function: H5O_drvinfo_decode + * Function: H5O__drvinfo_decode * * Purpose: Decode a shared message table message and return a pointer * to a newly allocated H5O_drvinfo_t struct. @@ -79,14 +79,14 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5O_drvinfo_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); @@ -123,11 +123,11 @@ H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_drvinfo_decode() */ +} /* end H5O__drvinfo_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_drvinfo_encode + * Function: H5O__drvinfo_encode * * Purpose: Encode a v1 B-tree 'K' value message. * @@ -139,11 +139,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -159,11 +159,11 @@ H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_share H5MM_memcpy(p, mesg->buf, mesg->len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_drvinfo_encode() */ +} /* end H5O__drvinfo_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_drvinfo_copy + * Function: H5O__drvinfo_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -177,13 +177,13 @@ H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_share *------------------------------------------------------------------------- */ static void * -H5O_drvinfo_copy(const void *_mesg, void *_dest) +H5O__drvinfo_copy(const void *_mesg, void *_dest) { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; H5O_drvinfo_t *dest = (H5O_drvinfo_t *)_dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(mesg); @@ -207,11 +207,11 @@ H5O_drvinfo_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_drvinfo_copy() */ +} /* end H5O__drvinfo_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_drvinfo_size + * Function: H5O__drvinfo_size * * Purpose: Returns the size of the raw message in bytes not counting the * message type or size fields, but only the data fields. @@ -225,12 +225,12 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -242,7 +242,7 @@ H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s mesg->len; /* Buffer */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_drvinfo_size() */ +} /* end H5O__drvinfo_size() */ /*------------------------------------------------------------------------- @@ -254,7 +254,6 @@ H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 1 2007 * *------------------------------------------------------------------------- diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 6eaaae9..c7d6c1b 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -28,16 +28,16 @@ /* PRIVATE PROTOTYPES */ -static herr_t H5O_dtype_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_dtype_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, +static herr_t H5O__dtype_encode(H5F_t *f, uint8_t *p, const void *mesg); +static void *H5O__dtype_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static void *H5O_dtype_copy(const void *_mesg, void *_dest); -static size_t H5O_dtype_size(const H5F_t *f, const void *_mesg); +static void *H5O__dtype_copy(const void *_mesg, void *_dest); +static size_t H5O__dtype_size(const H5F_t *f, const void *_mesg); static herr_t H5O__dtype_reset(void *_mesg); static herr_t H5O__dtype_free(void *_mesg); -static herr_t H5O_dtype_set_share(void *_mesg, const H5O_shared_t *sh); -static htri_t H5O_dtype_can_share(const void *_mesg); -static herr_t H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, +static herr_t H5O__dtype_set_share(void *_mesg, const H5O_shared_t *sh); +static htri_t H5O__dtype_can_share(const void *_mesg); +static herr_t H5O__dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *_udata); static void *H5O__dtype_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, @@ -50,22 +50,22 @@ static herr_t H5O__dtype_debug(H5F_t *f, const void *_mesg, FILE * stream, /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_DTYPE -#define H5O_SHARED_DECODE H5O_dtype_shared_decode -#define H5O_SHARED_DECODE_REAL H5O_dtype_decode -#define H5O_SHARED_ENCODE H5O_dtype_shared_encode -#define H5O_SHARED_ENCODE_REAL H5O_dtype_encode -#define H5O_SHARED_SIZE H5O_dtype_shared_size -#define H5O_SHARED_SIZE_REAL H5O_dtype_size +#define H5O_SHARED_DECODE H5O__dtype_shared_decode +#define H5O_SHARED_DECODE_REAL H5O__dtype_decode +#define H5O_SHARED_ENCODE H5O__dtype_shared_encode +#define H5O_SHARED_ENCODE_REAL H5O__dtype_encode +#define H5O_SHARED_SIZE H5O__dtype_shared_size +#define H5O_SHARED_SIZE_REAL H5O__dtype_size #define H5O_SHARED_DELETE H5O__dtype_shared_delete #undef H5O_SHARED_DELETE_REAL #define H5O_SHARED_LINK H5O__dtype_shared_link #undef H5O_SHARED_LINK_REAL #define H5O_SHARED_COPY_FILE H5O__dtype_shared_copy_file #define H5O_SHARED_COPY_FILE_REAL H5O__dtype_copy_file -#define H5O_SHARED_POST_COPY_FILE H5O_dtype_shared_post_copy_file +#define H5O_SHARED_POST_COPY_FILE H5O__dtype_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #define H5O_SHARED_POST_COPY_FILE_UPD H5O__dtype_shared_post_copy_upd -#define H5O_SHARED_DEBUG H5O_dtype_shared_debug +#define H5O_SHARED_DEBUG H5O__dtype_shared_debug #define H5O_SHARED_DEBUG_REAL H5O__dtype_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ @@ -94,27 +94,27 @@ const H5O_msg_class_t H5O_MSG_DTYPE[1] = {{ "datatype", /* message name for debugging */ sizeof(H5T_t), /* native message size */ H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */ - H5O_dtype_shared_decode, /* decode message */ - H5O_dtype_shared_encode, /* encode message */ - H5O_dtype_copy, /* copy the native value */ - H5O_dtype_shared_size, /* size of raw message */ + H5O__dtype_shared_decode, /* decode message */ + H5O__dtype_shared_encode, /* encode message */ + H5O__dtype_copy, /* copy the native value */ + H5O__dtype_shared_size, /* size of raw message */ H5O__dtype_reset, /* reset method */ H5O__dtype_free, /* free method */ H5O__dtype_shared_delete, /* file delete method */ H5O__dtype_shared_link, /* link method */ - H5O_dtype_set_share, /* set share method */ - H5O_dtype_can_share, /* can share method */ - H5O_dtype_pre_copy_file, /* pre copy native value to file */ + H5O__dtype_set_share, /* set share method */ + H5O__dtype_can_share, /* can share method */ + H5O__dtype_pre_copy_file, /* pre copy native value to file */ H5O__dtype_shared_copy_file, /* copy native value to file */ - H5O_dtype_shared_post_copy_file, /* post copy native value to file */ + H5O__dtype_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_dtype_shared_debug /* debug the message */ + H5O__dtype_shared_debug /* debug the message */ }}; /*------------------------------------------------------------------------- - * Function: H5O_dtype_decode_helper + * Function: H5O__dtype_decode_helper * * Purpose: Decodes a datatype * @@ -129,14 +129,14 @@ const H5O_msg_class_t H5O_MSG_DTYPE[1] = {{ *------------------------------------------------------------------------- */ static htri_t -H5O_dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t *dt) +H5O__dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t *dt) { unsigned flags, version; unsigned i; size_t z; htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(pp && *pp); @@ -264,7 +264,7 @@ H5O_dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t * unsigned j; /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM__limit_enc_size((uint64_t)dt->shared->size); /* * Compound datatypes... @@ -331,7 +331,7 @@ H5O_dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t * HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Decode the field's datatype information */ - if((can_upgrade = H5O_dtype_decode_helper(ioflags, pp, temp_type)) < 0) { + if((can_upgrade = H5O__dtype_decode_helper(ioflags, pp, temp_type)) < 0) { for(j = 0; j <= i; j++) H5MM_xfree(dt->shared->u.compnd.memb[j].name); H5MM_xfree(dt->shared->u.compnd.memb); @@ -469,7 +469,7 @@ H5O_dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t * dt->shared->u.enumer.nmembs = dt->shared->u.enumer.nalloc = flags & 0xffff; if(NULL == (dt->shared->parent = H5T__alloc())) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - if(H5O_dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0) + if(H5O__dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "unable to decode parent datatype") /* Check if the parent of this enum has a version greater than the @@ -511,7 +511,7 @@ H5O_dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t * /* Decode base type of VL information */ if(NULL == (dt->shared->parent = H5T__alloc())) HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "memory allocation failed") - if(H5O_dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0) + if(H5O__dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "unable to decode VL parent type") /* Check if the parent of this vlen has a version greater than the @@ -552,7 +552,7 @@ H5O_dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t * /* Decode base type of array */ if(NULL == (dt->shared->parent = H5T__alloc())) HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "memory allocation failed") - if(H5O_dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0) + if(H5O__dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "unable to decode array parent type") /* Check if the parent of this array has a version greater than the @@ -579,20 +579,19 @@ H5O_dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t * } /* end switch */ done: - if(ret_value < 0) { + if(ret_value < 0) if(dt != NULL) { if(dt->shared != NULL) dt->shared = H5FL_FREE(H5T_shared_t, dt->shared); dt = H5FL_FREE(H5T_t, dt); } /* end if */ - } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_decode_helper() */ +} /* end H5O__dtype_decode_helper() */ /*------------------------------------------------------------------------- - * Function: H5O_dtype_encode_helper + * Function: H5O__dtype_encode_helper * * Purpose: Encodes a datatype. * @@ -608,7 +607,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) +H5O__dtype_encode_helper(uint8_t **pp, const H5T_t *dt) { unsigned flags = 0; uint8_t *hdr = (uint8_t *)*pp; @@ -616,7 +615,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) size_t n, z; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(pp && *pp); @@ -906,7 +905,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) unsigned offset_nbytes; /* Size needed to encode member offsets */ /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM__limit_enc_size((uint64_t)dt->shared->size); /* * Compound datatypes... @@ -968,7 +967,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) } /* end if */ /* Subtype */ - if(H5O_dtype_encode_helper(pp, dt->shared->u.compnd.memb[i].type) < 0) + if(H5O__dtype_encode_helper(pp, dt->shared->u.compnd.memb[i].type) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode member type") } /* end for */ } @@ -990,7 +989,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) flags = dt->shared->u.enumer.nmembs & 0xffff; /* Parent type */ - if(H5O_dtype_encode_helper(pp, dt->shared->parent) < 0) + if(H5O__dtype_encode_helper(pp, dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode parent datatype") /* Names, each a multiple of eight bytes */ @@ -1026,7 +1025,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) } /* end if */ /* Encode base type of VL information */ - if(H5O_dtype_encode_helper(pp, dt->shared->parent) < 0) + if(H5O__dtype_encode_helper(pp, dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode VL parent type") break; @@ -1064,7 +1063,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) } /* end if */ /* Encode base type of array's information */ - if(H5O_dtype_encode_helper(pp, dt->shared->parent) < 0) + if(H5O__dtype_encode_helper(pp, dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode VL parent type") break; @@ -1083,17 +1082,17 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_encode_helper() */ +} /* end H5O__dtype_encode_helper() */ /*-------------------------------------------------------------------------- NAME - H5O_dtype_decode + H5O__dtype_decode PURPOSE Decode a message and return a pointer to a memory struct with the decoded information USAGE - void *H5O_dtype_decode(f, mesg_flags, p) + void *H5O__dtype_decode(f, mesg_flags, p) H5F_t *f; IN: pointer to the HDF5 file struct unsigned mesg_flags; IN: Message flags to influence decoding const uint8 *p; IN: the raw information buffer @@ -1105,13 +1104,13 @@ done: function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, +H5O__dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned *ioflags/*in,out*/, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { H5T_t *dt = NULL; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(p); @@ -1121,7 +1120,7 @@ H5O_dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigne HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Perform actual decode of message */ - if(H5O_dtype_decode_helper(ioflags, &p, dt) < 0) + if(H5O__dtype_decode_helper(ioflags, &p, dt) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode type") /* Set return value */ @@ -1129,16 +1128,16 @@ H5O_dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigne done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_decode() */ +} /* end H5O__dtype_decode() */ /*-------------------------------------------------------------------------- NAME - H5O_dtype_encode + H5O__dtype_encode PURPOSE Encode a simple datatype message USAGE - herr_t H5O_dtype_encode(f, raw_size, p, mesg) + herr_t H5O__dtype_encode(f, raw_size, p, mesg) H5F_t *f; IN: pointer to the HDF5 file struct size_t raw_size; IN: size of the raw information buffer const uint8 *p; IN: the raw information buffer @@ -1150,12 +1149,12 @@ done: message in the "raw" disk form. --------------------------------------------------------------------------*/ static herr_t -H5O_dtype_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *mesg) +H5O__dtype_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *mesg) { const H5T_t *dt = (const H5T_t *) mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -1163,21 +1162,21 @@ H5O_dtype_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *mesg) HDassert(dt); /* encode */ - if(H5O_dtype_encode_helper(&p, dt) < 0) + if(H5O__dtype_encode_helper(&p, dt) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode type") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_encode() */ +} /* end H5O__dtype_encode() */ /*-------------------------------------------------------------------------- NAME - H5O_dtype_copy + H5O__dtype_copy PURPOSE Copies a message from MESG to DEST, allocating DEST if necessary. USAGE - void *H5O_dtype_copy(mesg, dest) + void *H5O__dtype_copy(mesg, dest) const void *mesg; IN: Pointer to the source simple datatype struct const void *dest; IN: Pointer to the destination simple @@ -1189,13 +1188,13 @@ done: allocating the destination structure if necessary. --------------------------------------------------------------------------*/ static void * -H5O_dtype_copy(const void *_src, void *_dst) +H5O__dtype_copy(const void *_src, void *_dst) { const H5T_t *src = (const H5T_t *) _src; H5T_t *dst; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(src); @@ -1216,16 +1215,16 @@ H5O_dtype_copy(const void *_src, void *_dst) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_copy() */ +} /* end H5O__dtype_copy() */ /*-------------------------------------------------------------------------- NAME - H5O_dtype_size + H5O__dtype_size PURPOSE Return the raw message size in bytes USAGE - void *H5O_dtype_size(f, mesg) + void *H5O__dtype_size(f, mesg) H5F_t *f; IN: pointer to the HDF5 file struct const void *mesg; IN: Pointer to the source simple datatype struct RETURNS @@ -1236,13 +1235,13 @@ done: portion of the message). It doesn't take into account alignment. --------------------------------------------------------------------------*/ static size_t -H5O_dtype_size(const H5F_t *f, const void *_mesg) +H5O__dtype_size(const H5F_t *f, const void *_mesg) { const H5T_t *dt = (const H5T_t *)_mesg; unsigned u; /* Local index variable */ size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(f); HDassert(dt); @@ -1278,7 +1277,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) unsigned offset_nbytes; /* Size needed to encode member offsets */ /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM__limit_enc_size((uint64_t)dt->shared->size); /* Compute the total size needed to encode compound datatype */ for(u = 0; u < dt->shared->u.compnd.nmembs; u++) { @@ -1306,13 +1305,13 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) 4 + /*permutation*/ 4 + /*reserved*/ 16; /*dimensions*/ - ret_value += H5O_dtype_size(f, dt->shared->u.compnd.memb[u].type); + ret_value += H5O__dtype_size(f, dt->shared->u.compnd.memb[u].type); } /* end for */ } break; case H5T_ENUM: - ret_value += H5O_dtype_size(f, dt->shared->parent); + ret_value += H5O__dtype_size(f, dt->shared->parent); for(u = 0; u < dt->shared->u.enumer.nmembs; u++) { size_t name_len; /* Length of field's name */ @@ -1329,7 +1328,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) break; case H5T_VLEN: - ret_value += H5O_dtype_size(f, dt->shared->parent); + ret_value += H5O__dtype_size(f, dt->shared->parent); break; case H5T_ARRAY: @@ -1339,7 +1338,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) ret_value += 4 * dt->shared->u.array.ndims; /* dimensions */ if(dt->shared->version < H5O_DTYPE_VERSION_3) ret_value += 4 * dt->shared->u.array.ndims; /* dimension permutations */ - ret_value += H5O_dtype_size(f, dt->shared->parent); + ret_value += H5O__dtype_size(f, dt->shared->parent); break; case H5T_NO_CLASS: @@ -1352,7 +1351,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) } /* end switch */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_dtype_size() */ +} /* H5O__dtype_size() */ /*------------------------------------------------------------------------- @@ -1414,7 +1413,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_dtype_set_share + * Function: H5O__dtype_set_share * * Purpose: Copies sharing information from SH into the message. * @@ -1426,12 +1425,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_dtype_set_share(void *_mesg/*in,out*/, const H5O_shared_t *sh) +H5O__dtype_set_share(void *_mesg/*in,out*/, const H5O_shared_t *sh) { H5T_t *dt = (H5T_t *)_mesg; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(dt); HDassert(sh); @@ -1462,11 +1461,11 @@ H5O_dtype_set_share(void *_mesg/*in,out*/, const H5O_shared_t *sh) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_set_share() */ +} /* end H5O__dtype_set_share() */ /*------------------------------------------------------------------------- - * Function: H5O_dtype_can_share + * Function: H5O__dtype_can_share * * Purpose: Determines if this datatype is allowed to be shared or * not. Immutable datatypes or datatypes that are already @@ -1482,13 +1481,13 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5O_dtype_can_share(const void *_mesg) +H5O__dtype_can_share(const void *_mesg) { const H5T_t *mesg = (const H5T_t *)_mesg; htri_t tri_ret; htri_t ret_value = TRUE; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(mesg); @@ -1506,11 +1505,11 @@ H5O_dtype_can_share(const void *_mesg) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_can_share() */ +} /* end H5O__dtype_can_share() */ /*------------------------------------------------------------------------- - * Function: H5O_dtype_pre_copy_file + * Function: H5O__dtype_pre_copy_file * * Purpose: Perform any necessary actions before copying message between * files @@ -1525,7 +1524,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, +H5O__dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata) { @@ -1533,7 +1532,7 @@ H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(file_src); @@ -1565,7 +1564,7 @@ H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_pre_copy_file() */ +} /* end H5O__dtype_pre_copy_file() */ /*------------------------------------------------------------------------- @@ -1592,7 +1591,7 @@ H5O__dtype_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const H5O_msg_class_t *mesg FUNC_ENTER_STATIC /* Perform a normal copy of the object header message */ - if(NULL == (dst_mesg = (H5T_t *)H5O_dtype_copy(native_src, NULL))) + if(NULL == (dst_mesg = (H5T_t *)H5O__dtype_copy(native_src, NULL))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy") /* The datatype will be in the new file; set its location. */ @@ -1639,9 +1638,8 @@ H5O__dtype_shared_post_copy_upd(const H5O_loc_t H5_ATTR_UNUSED *src_oloc, dt_dst->oloc.file = dt_dst->sh_loc.file; dt_dst->oloc.addr = dt_dst->sh_loc.u.loc.oh_addr; } /* end if */ - else { + else HDassert(!H5T_is_named(dt_dst)); - } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Oefl.c b/src/H5Oefl.c index b18d819..83bab09 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, November 25, 1997 */ @@ -27,11 +27,11 @@ #include "H5Opkg.h" /* Object headers */ /* PRIVATE PROTOTYPES */ -static void *H5O_efl_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, +static void *H5O__efl_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_efl_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_efl_copy(const void *_mesg, void *_dest); -static size_t H5O_efl_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__efl_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__efl_copy(const void *_mesg, void *_dest); +static size_t H5O__efl_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__efl_reset(void *_mesg); static void *H5O__efl_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, @@ -45,10 +45,10 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ "external file list", /*message name for debugging */ sizeof(H5O_efl_t), /*native message size */ 0, /* messages are sharable? */ - H5O_efl_decode, /*decode message */ - H5O_efl_encode, /*encode message */ - H5O_efl_copy, /*copy native value */ - H5O_efl_size, /*size of message on disk */ + H5O__efl_decode, /*decode message */ + H5O__efl_encode, /*encode message */ + H5O__efl_copy, /*copy native value */ + H5O__efl_size, /*size of message on disk */ H5O__efl_reset, /*reset method */ NULL, /* free method */ NULL, /* file delete method */ @@ -67,7 +67,7 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ /*------------------------------------------------------------------------- - * Function: H5O_efl_decode + * Function: H5O__efl_decode * * Purpose: Decode an external file list message and return a pointer to * the message (and some other data). @@ -87,7 +87,7 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { @@ -98,7 +98,7 @@ H5O_efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, size_t u; /* Local index variable */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(f); @@ -177,11 +177,11 @@ done: H5MM_xfree(mesg); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_efl_decode() */ +} /* end H5O__efl_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_efl_encode + * Function: H5O__efl_encode * * Purpose: Encodes a message. * @@ -193,12 +193,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_efl_t *mesg = (const H5O_efl_t *)_mesg; size_t u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -236,11 +236,11 @@ H5O_efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, cons } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_efl_encode() */ +} /* end H5O__efl_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_efl_copy + * Function: H5O__efl_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -255,7 +255,7 @@ H5O_efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, cons *------------------------------------------------------------------------- */ static void * -H5O_efl_copy(const void *_mesg, void *_dest) +H5O__efl_copy(const void *_mesg, void *_dest) { const H5O_efl_t *mesg = (const H5O_efl_t *) _mesg; H5O_efl_t *dest = (H5O_efl_t *) _dest; @@ -263,7 +263,7 @@ H5O_efl_copy(const void *_mesg, void *_dest) hbool_t slot_allocated = FALSE; /* Flag to indicate that dynamic allocation has begun */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(mesg); @@ -303,11 +303,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_efl_copy() */ +} /* end H5O__efl_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_efl_size + * Function: H5O__efl_size * * Purpose: Returns the size of the raw message in bytes not counting the * message type or size fields, but only the data fields. This @@ -324,27 +324,27 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_efl_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__efl_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_efl_t *mesg = (const H5O_efl_t *) _mesg; size_t ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); HDassert(mesg); ret_value = (size_t)H5F_SIZEOF_ADDR(f) + /*heap address */ - 2 + /*slots allocated*/ - 2 + /*num slots used*/ - 4 + /*reserved */ + 2 + /*slots allocated*/ + 2 + /*num slots used*/ + 4 + /*reserved */ mesg->nused * ((size_t)H5F_SIZEOF_SIZE(f) + /*name offset */ (size_t)H5F_SIZEOF_SIZE(f) + /*file offset */ (size_t)H5F_SIZEOF_SIZE(f)); /*file size */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_efl_size() */ +} /* end H5O__efl_size() */ /*------------------------------------------------------------------------- @@ -402,11 +402,11 @@ H5O__efl_reset(void *_mesg) *------------------------------------------------------------------------- */ hsize_t -H5O_efl_total_size (H5O_efl_t *efl) +H5O_efl_total_size(H5O_efl_t *efl) { hsize_t ret_value = 0, tmp; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI(0) if(efl->nused > 0 && H5O_EFL_UNLIMITED == efl->slot[efl->nused - 1].size) ret_value = H5O_EFL_UNLIMITED; diff --git a/src/H5Ofill.c b/src/H5Ofill.c index cb75bc3..b9422fb 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Wednesday, September 30, 1998 * * Purpose: The fill message indicates a bit pattern to use for @@ -32,15 +32,15 @@ #include "H5Sprivate.h" /* Dataspaces */ -static void *H5O_fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, +static void *H5O__fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_fill_old_encode(H5F_t *f, uint8_t *p, const void *_mesg); -static size_t H5O_fill_old_size(const H5F_t *f, const void *_mesg); -static void *H5O_fill_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, +static herr_t H5O__fill_old_encode(H5F_t *f, uint8_t *p, const void *_mesg); +static size_t H5O__fill_old_size(const H5F_t *f, const void *_mesg); +static void *H5O__fill_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_fill_new_encode(H5F_t *f, uint8_t *p, const void *_mesg); -static size_t H5O_fill_new_size(const H5F_t *f, const void *_mesg); -static void *H5O_fill_copy(const void *_mesg, void *_dest); +static herr_t H5O__fill_new_encode(H5F_t *f, uint8_t *p, const void *_mesg); +static size_t H5O__fill_new_size(const H5F_t *f, const void *_mesg); +static void *H5O__fill_copy(const void *_mesg, void *_dest); static herr_t H5O__fill_reset(void *_mesg); static herr_t H5O__fill_free(void *_mesg); static herr_t H5O__fill_pre_copy_file(H5F_t *file_src, const void *mesg_src, @@ -49,59 +49,59 @@ static herr_t H5O__fill_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); /* Set up & include shared message "interface" info */ -#define H5O_SHARED_TYPE H5O_MSG_FILL -#define H5O_SHARED_DECODE H5O_fill_shared_decode -#define H5O_SHARED_DECODE_REAL H5O_fill_old_decode -#define H5O_SHARED_ENCODE H5O_fill_shared_encode -#define H5O_SHARED_ENCODE_REAL H5O_fill_old_encode -#define H5O_SHARED_SIZE H5O_fill_shared_size -#define H5O_SHARED_SIZE_REAL H5O_fill_old_size -#define H5O_SHARED_DELETE H5O__fill_shared_delete +#define H5O_SHARED_TYPE H5O_MSG_FILL +#define H5O_SHARED_DECODE H5O__fill_shared_decode +#define H5O_SHARED_DECODE_REAL H5O__fill_old_decode +#define H5O_SHARED_ENCODE H5O__fill_shared_encode +#define H5O_SHARED_ENCODE_REAL H5O__fill_old_encode +#define H5O_SHARED_SIZE H5O__fill_shared_size +#define H5O_SHARED_SIZE_REAL H5O__fill_old_size +#define H5O_SHARED_DELETE H5O__fill_shared_delete #undef H5O_SHARED_DELETE_REAL -#define H5O_SHARED_LINK H5O__fill_shared_link +#define H5O_SHARED_LINK H5O__fill_shared_link #undef H5O_SHARED_LINK_REAL -#define H5O_SHARED_COPY_FILE H5O__fill_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__fill_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL -#define H5O_SHARED_POST_COPY_FILE H5O_fill_shared_post_copy_file +#define H5O_SHARED_POST_COPY_FILE H5O__fill_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD -#define H5O_SHARED_DEBUG H5O_fill_shared_debug -#define H5O_SHARED_DEBUG_REAL H5O__fill_debug -#include "H5Oshared.h" /* Shared Object Header Message Callbacks */ +#define H5O_SHARED_DEBUG H5O__fill_shared_debug +#define H5O_SHARED_DEBUG_REAL H5O__fill_debug +#include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* Set up & include shared message "interface" info */ /* (Kludgy 'undef's in order to re-include the H5Oshared.h header) */ #undef H5O_SHARED_TYPE -#define H5O_SHARED_TYPE H5O_MSG_FILL_NEW +#define H5O_SHARED_TYPE H5O_MSG_FILL_NEW #undef H5O_SHARED_DECODE -#define H5O_SHARED_DECODE H5O_fill_new_shared_decode +#define H5O_SHARED_DECODE H5O__fill_new_shared_decode #undef H5O_SHARED_DECODE_REAL -#define H5O_SHARED_DECODE_REAL H5O_fill_new_decode +#define H5O_SHARED_DECODE_REAL H5O__fill_new_decode #undef H5O_SHARED_ENCODE -#define H5O_SHARED_ENCODE H5O_fill_new_shared_encode +#define H5O_SHARED_ENCODE H5O__fill_new_shared_encode #undef H5O_SHARED_ENCODE_REAL -#define H5O_SHARED_ENCODE_REAL H5O_fill_new_encode +#define H5O_SHARED_ENCODE_REAL H5O__fill_new_encode #undef H5O_SHARED_SIZE -#define H5O_SHARED_SIZE H5O_fill_new_shared_size +#define H5O_SHARED_SIZE H5O__fill_new_shared_size #undef H5O_SHARED_SIZE_REAL -#define H5O_SHARED_SIZE_REAL H5O_fill_new_size +#define H5O_SHARED_SIZE_REAL H5O__fill_new_size #undef H5O_SHARED_DELETE -#define H5O_SHARED_DELETE H5O__fill_new_shared_delete +#define H5O_SHARED_DELETE H5O__fill_new_shared_delete #undef H5O_SHARED_DELETE_REAL #undef H5O_SHARED_LINK -#define H5O_SHARED_LINK H5O__fill_new_shared_link +#define H5O_SHARED_LINK H5O__fill_new_shared_link #undef H5O_SHARED_LINK_REAL #undef H5O_SHARED_COPY_FILE -#define H5O_SHARED_COPY_FILE H5O__fill_new_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__fill_new_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE -#define H5O_SHARED_POST_COPY_FILE H5O_fill_new_shared_post_copy_file +#define H5O_SHARED_POST_COPY_FILE H5O__fill_new_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD #undef H5O_SHARED_DEBUG -#define H5O_SHARED_DEBUG H5O_fill_new_shared_debug +#define H5O_SHARED_DEBUG H5O__fill_new_shared_debug #undef H5O_SHARED_DEBUG_REAL -#define H5O_SHARED_DEBUG_REAL H5O__fill_debug +#define H5O_SHARED_DEBUG_REAL H5O__fill_debug #undef H5Oshared_H #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ @@ -110,11 +110,11 @@ const H5O_msg_class_t H5O_MSG_FILL[1] = {{ H5O_FILL_ID, /*message id number */ "fill", /*message name for debugging */ sizeof(H5O_fill_t), /*native message size */ - H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */ - H5O_fill_shared_decode, /*decode message */ - H5O_fill_shared_encode, /*encode message */ - H5O_fill_copy, /*copy the native value */ - H5O_fill_shared_size, /*raw message size */ + H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */ + H5O__fill_shared_decode, /*decode message */ + H5O__fill_shared_encode, /*encode message */ + H5O__fill_copy, /*copy the native value */ + H5O__fill_shared_size, /*raw message size */ H5O__fill_reset, /*free internal memory */ H5O__fill_free, /* free method */ H5O__fill_shared_delete, /* file delete method */ @@ -123,10 +123,10 @@ const H5O_msg_class_t H5O_MSG_FILL[1] = {{ NULL, /*can share method */ H5O__fill_pre_copy_file, /* pre copy native value to file */ H5O__fill_shared_copy_file, /* copy native value to file */ - H5O_fill_shared_post_copy_file, /* post copy native value to file */ + H5O__fill_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_fill_shared_debug /*debug the message */ + H5O__fill_shared_debug /*debug the message */ }}; /* This message derives from H5O message class, for new fill value after version 1.4 */ @@ -134,11 +134,11 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ H5O_FILL_NEW_ID, /*message id number */ "fill_new", /*message name for debugging */ sizeof(H5O_fill_t), /*native message size */ - H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */ - H5O_fill_new_shared_decode, /*decode message */ - H5O_fill_new_shared_encode, /*encode message */ - H5O_fill_copy, /*copy the native value */ - H5O_fill_new_shared_size, /*raw message size */ + H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */ + H5O__fill_new_shared_decode, /*decode message */ + H5O__fill_new_shared_encode, /*encode message */ + H5O__fill_copy, /*copy the native value */ + H5O__fill_new_shared_size, /*raw message size */ H5O__fill_reset, /*free internal memory */ H5O__fill_free, /* free method */ H5O__fill_new_shared_delete, /* file delete method */ @@ -146,11 +146,11 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ NULL, /* set share method */ NULL, /*can share method */ H5O__fill_pre_copy_file, /* pre copy native value to file */ - H5O__fill_new_shared_copy_file, /* copy native value to file */ - H5O_fill_new_shared_post_copy_file, /* post copy native value to file */ + H5O__fill_new_shared_copy_file, /* copy native value to file */ + H5O__fill_new_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_fill_new_shared_debug /*debug the message */ + H5O__fill_new_shared_debug /*debug the message */ }}; /* Format version bounds for fill value */ @@ -179,7 +179,7 @@ H5FL_BLK_EXTERN(type_conv); /*------------------------------------------------------------------------- - * Function: H5O_fill_new_decode + * Function: H5O__fill_new_decode * * Purpose: Decode a new fill value message. The new fill value * message is fill value plus space allocation time and @@ -194,14 +194,14 @@ H5FL_BLK_EXTERN(type_conv); *------------------------------------------------------------------------- */ static void * -H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p) { H5O_fill_t *fill = NULL; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(f); HDassert(p); @@ -277,10 +277,9 @@ H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, /* Set the "defined" flag */ fill->fill_defined = TRUE; } /* end else */ - else { + else /* Set the "defined" flag */ fill->fill_defined = TRUE; - } /* end else */ } /* end else */ /* Set return value */ @@ -294,11 +293,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_fill_new_decode() */ +} /* end H5O__fill_new_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_old_decode + * Function: H5O__fill_old_decode * * Purpose: Decode an old fill value message. * @@ -311,7 +310,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_fill_old_decode(H5F_t *f, H5O_t *open_oh, +H5O__fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p) { @@ -320,7 +319,7 @@ H5O_fill_old_decode(H5F_t *f, H5O_t *open_oh, H5T_t *dt = NULL; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(f); HDassert(p); @@ -375,11 +374,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_fill_old_decode() */ +} /* end H5O__fill_old_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_new_encode + * Function: H5O__fill_new_encode * * Purpose: Encode a new fill value message. The new fill value * message is fill value plus space allocation time and @@ -393,11 +392,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) +H5O__fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(f); HDassert(p); @@ -473,11 +472,11 @@ H5O_fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fill_new_encode() */ +} /* end H5O__fill_new_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_old_encode + * Function: H5O__fill_old_encode * * Purpose: Encode an old fill value message. * @@ -489,11 +488,11 @@ H5O_fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) *------------------------------------------------------------------------- */ static herr_t -H5O_fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) +H5O__fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(f); HDassert(p); @@ -504,11 +503,11 @@ H5O_fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) H5MM_memcpy(p, fill->buf, (size_t)fill->size); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fill_old_encode() */ +} /* end H5O__fill_old_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_copy + * Function: H5O__fill_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. The new fill value message is fill value plus @@ -524,13 +523,13 @@ H5O_fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) *------------------------------------------------------------------------- */ static void * -H5O_fill_copy(const void *_src, void *_dst) +H5O__fill_copy(const void *_src, void *_dst) { const H5O_fill_t *src = (const H5O_fill_t *)_src; H5O_fill_t *dst = (H5O_fill_t *)_dst; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(src); @@ -621,11 +620,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_fill_copy() */ +} /* end H5O__fill_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_new_size + * Function: H5O__fill_new_size * * Purpose: Returns the size of the raw message in bytes not counting the * message type or size fields, but only the data fields. This @@ -642,40 +641,40 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) +H5O__fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(f); HDassert(fill); /* Determine size for different versions */ if(fill->version < H5O_FILL_VERSION_3) { - ret_value = 1 + /* Version number */ - 1 + /* Space allocation time */ - 1 + /* Fill value write time */ - 1; /* Fill value defined */ + ret_value = 1 + /* Version number */ + 1 + /* Space allocation time */ + 1 + /* Fill value write time */ + 1; /* Fill value defined */ if(fill->fill_defined) - ret_value += 4 + /* Fill value size */ + ret_value += 4 + /* Fill value size */ (fill->size > 0 ? (size_t)fill->size : 0); /* Size of fill value */ } /* end if */ else { - ret_value = 1 + /* Version number */ - 1; /* Status flags */ + ret_value = 1 + /* Version number */ + 1; /* Status flags */ if(fill->size > 0) - ret_value += 4 + /* Fill value size */ - (size_t)fill->size; /* Size of fill value */ + ret_value += 4 + /* Fill value size */ + (size_t)fill->size; /* Size of fill value */ } /* end else */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_fill_new_size() */ +} /* end H5O__fill_new_size() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_old_size + * Function: H5O__fill_old_size * * Purpose: Returns the size of the raw message in bytes not counting the * message type or size fields, but only the data fields. This @@ -690,16 +689,16 @@ H5O_fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) *------------------------------------------------------------------------- */ static size_t -H5O_fill_old_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) +H5O__fill_old_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(fill); FUNC_LEAVE_NOAPI(4 + (size_t)fill->size) -} /* end H5O_fill_old_size() */ +} /* end H5O__fill_old_size() */ /*------------------------------------------------------------------------- @@ -987,7 +986,7 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed) hid_t src_id = -1, dst_id = -1; /* Datatype identifiers */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI(FAIL) HDassert(fill); HDassert(dset_type); diff --git a/src/H5Oflush.c b/src/H5Oflush.c index 898184b..8d6f0b1 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -15,7 +15,7 @@ * * Created: H5Oflush.c * Aug 19, 2010 - * Mike McGreevy + * Mike McGreevy * * Purpose: Object flush/refresh routines. * diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index e2fa4e5..d0f447c 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -15,7 +15,7 @@ * * Created: H5Ofsinfo.c * Feb 2009 - * Vailin Choi + * Vailin Choi * * Purpose: File space info message. * @@ -25,44 +25,44 @@ #include "H5Omodule.h" /* This source code file is part of the H5O module */ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ -#include "H5FLprivate.h" /* Free lists */ -#include "H5Opkg.h" /* Object headers */ +#include "H5FLprivate.h" /* Free lists */ +#include "H5Opkg.h" /* Object headers */ /* PRIVATE PROTOTYPES */ -static void *H5O_fsinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, +static void *H5O__fsinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_fsinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_fsinfo_copy(const void *_mesg, void *_dest); -static size_t H5O_fsinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__fsinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__fsinfo_copy(const void *_mesg, void *_dest); +static size_t H5O__fsinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__fsinfo_free(void *mesg); static herr_t H5O__fsinfo_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_FSINFO[1] = {{ - H5O_FSINFO_ID, /* message id number */ - "fsinfo", /* message name for debugging */ - sizeof(H5O_fsinfo_t), /* native message size */ - 0, /* messages are sharable? */ - H5O_fsinfo_decode, /* decode message */ - H5O_fsinfo_encode, /* encode message */ - H5O_fsinfo_copy, /* copy the native value */ - H5O_fsinfo_size, /* size of free-space manager info message */ - NULL, /* default reset method */ - H5O__fsinfo_free, /* free method */ - NULL, /* file delete method */ - NULL, /* link method */ - NULL, /* set share method */ - NULL, /* can share method */ - NULL, /* pre copy native value to file */ - NULL, /* copy native value to file */ - NULL, /* post copy native value to file */ - NULL, /* get creation index */ - NULL, /* set creation index */ - H5O__fsinfo_debug /* debug the message */ + H5O_FSINFO_ID, /* message id number */ + "fsinfo", /* message name for debugging */ + sizeof(H5O_fsinfo_t), /* native message size */ + 0, /* messages are sharable? */ + H5O__fsinfo_decode, /* decode message */ + H5O__fsinfo_encode, /* encode message */ + H5O__fsinfo_copy, /* copy the native value */ + H5O__fsinfo_size, /* size of free-space manager info message */ + NULL, /* default reset method */ + H5O__fsinfo_free, /* free method */ + NULL, /* file delete method */ + NULL, /* link method */ + NULL, /* set share method */ + NULL, /* can share method */ + NULL, /* pre copy native value to file */ + NULL, /* copy native value to file */ + NULL, /* post copy native value to file */ + NULL, /* get creation index */ + NULL, /* set creation index */ + H5O__fsinfo_debug /* debug the message */ }}; /* Format version bounds for fsinfo message */ @@ -81,7 +81,7 @@ H5FL_DEFINE_STATIC(H5O_fsinfo_t); /*------------------------------------------------------------------------- - * Function: H5O_fsinfo_decode + * Function: H5O__fsinfo_decode * * Purpose: Decode a message and return a pointer to a newly allocated one. * @@ -93,7 +93,7 @@ H5FL_DEFINE_STATIC(H5O_fsinfo_t); *------------------------------------------------------------------------- */ static void * -H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { @@ -102,7 +102,7 @@ H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned vers; /* message version */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -134,7 +134,6 @@ H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, /* Map version 0 (deprecated) to version 1 message */ switch(strategy) { - case H5F_FILE_SPACE_ALL_PERSIST: fsinfo->strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; fsinfo->persist = TRUE; @@ -166,8 +165,8 @@ H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, fsinfo->version = H5O_FSINFO_VERSION_1; fsinfo->mapped = TRUE; - - } else { + } + else { HDassert(vers >= H5O_FSINFO_VERSION_1); fsinfo->version = vers; @@ -180,10 +179,9 @@ H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, H5F_addr_decode(f, &p, &(fsinfo->eoa_pre_fsm_fsalloc)); /* EOA before free-space header and section info */ /* Decode addresses of free space managers, if persisting */ - if(fsinfo->persist) { + if(fsinfo->persist) for(ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++) H5F_addr_decode(f, &p, &(fsinfo->fs_addr[ptype - 1])); - } /* end if */ fsinfo->mapped = FALSE; } @@ -196,11 +194,11 @@ done: fsinfo = H5FL_FREE(H5O_fsinfo_t, fsinfo); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_fsinfo_decode() */ +} /* end H5O__fsinfo_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_fsinfo_encode + * Function: H5O__fsinfo_encode * * Purpose: Encodes a message. * @@ -211,12 +209,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg; H5F_mem_page_t ptype; /* Memory type for iteration */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -233,18 +231,17 @@ H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c H5F_addr_encode(f, &p, fsinfo->eoa_pre_fsm_fsalloc); /* EOA before free-space header and section info */ /* Store addresses of free-space managers, if persisting */ - if(fsinfo->persist) { + if(fsinfo->persist) /* Addresses of free-space managers */ for(ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++) H5F_addr_encode(f, &p, fsinfo->fs_addr[ptype - 1]); - } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fsinfo_encode() */ +} /* end H5O__fsinfo_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_fsinfo_copy + * Function: H5O__fsinfo_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -257,13 +254,13 @@ H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c *------------------------------------------------------------------------- */ static void * -H5O_fsinfo_copy(const void *_mesg, void *_dest) +H5O__fsinfo_copy(const void *_mesg, void *_dest) { const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg; H5O_fsinfo_t *dest = (H5O_fsinfo_t *) _dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(fsinfo); @@ -278,11 +275,11 @@ H5O_fsinfo_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_fsinfo_copy() */ +} /* end H5O__fsinfo_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_fsinfo_size + * Function: H5O__fsinfo_size * * Purpose: Returns the size of the raw message in bytes not counting * the message type or size fields, but only the data fields. @@ -296,12 +293,12 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR ret_value = 3 /* Version, strategy & persist */ + (size_t)H5F_SIZEOF_SIZE(f) /* Free-space section threshold */ @@ -314,7 +311,7 @@ H5O_fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi ret_value += (H5F_MEM_PAGE_NTYPES - 1) * (size_t)H5F_SIZEOF_ADDR(f); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_fsinfo_size() */ +} /* end H5O__fsinfo_size() */ /*------------------------------------------------------------------------- @@ -342,6 +339,79 @@ H5O__fsinfo_free(void *mesg) /*------------------------------------------------------------------------- + * Function: H5O__fsinfo_debug + * + * Purpose: Prints debugging info for a message. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Vailin Choi; Feb 2009 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O__fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, + int indent, int fwidth) +{ + const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *) _mesg; + H5F_mem_page_t ptype; /* Free-space types for iteration */ + + FUNC_ENTER_STATIC_NOERR + + /* check args */ + HDassert(f); + HDassert(fsinfo); + HDassert(stream); + HDassert(indent >= 0); + HDassert(fwidth >= 0); + + HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "File space strategy:"); + switch(fsinfo->strategy) { + case H5F_FSPACE_STRATEGY_FSM_AGGR: + HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_FSM_AGGR"); + break; + + case H5F_FSPACE_STRATEGY_PAGE: + HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_PAGE"); + break; + + case H5F_FSPACE_STRATEGY_AGGR: + HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_AGGR"); + break; + + case H5F_FSPACE_STRATEGY_NONE: + HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_NONE"); + break; + + case H5F_FSPACE_STRATEGY_NTYPES: + default: + HDfprintf(stream, "%s\n", "unknown"); + } /* end switch */ + + HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, + "Free-space persist:", fsinfo->persist); + + HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + "Free-space section threshold:", fsinfo->threshold); + + HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + "File space page size:", fsinfo->page_size); + + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, + "Page end metadata threshold:", fsinfo->pgend_meta_thres); + + HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + "eoa_pre_fsm_fsalloc:", fsinfo->eoa_pre_fsm_fsalloc); + + if(fsinfo->persist) + for(ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++) + HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + "Free space manager address:", fsinfo->fs_addr[ptype-1]); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O__fsinfo_debug() */ + +/*------------------------------------------------------------------------- * Function: H5O_fsinfo_set_version * * Purpose: Set the version to encode the fsinfo message with. @@ -414,77 +484,3 @@ done: } /* end H5O_fsinfo_check_version() */ -/*------------------------------------------------------------------------- - * Function: H5O__fsinfo_debug - * - * Purpose: Prints debugging info for a message. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Vailin Choi; Feb 2009 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5O__fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, - int indent, int fwidth) -{ - const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *) _mesg; - H5F_mem_page_t ptype; /* Free-space types for iteration */ - - FUNC_ENTER_STATIC_NOERR - - /* check args */ - HDassert(f); - HDassert(fsinfo); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); - - HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "File space strategy:"); - switch(fsinfo->strategy) { - case H5F_FSPACE_STRATEGY_FSM_AGGR: - HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_FSM_AGGR"); - break; - - case H5F_FSPACE_STRATEGY_PAGE: - HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_PAGE"); - break; - - case H5F_FSPACE_STRATEGY_AGGR: - HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_AGGR"); - break; - - case H5F_FSPACE_STRATEGY_NONE: - HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_NONE"); - break; - - case H5F_FSPACE_STRATEGY_NTYPES: - default: - HDfprintf(stream, "%s\n", "unknown"); - } /* end switch */ - - HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, - "Free-space persist:", fsinfo->persist); - - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, - "Free-space section threshold:", fsinfo->threshold); - - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, - "File space page size:", fsinfo->page_size); - - HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, - "Page end metadata threshold:", fsinfo->pgend_meta_thres); - - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, - "eoa_pre_fsm_fsalloc:", fsinfo->eoa_pre_fsm_fsalloc); - - if(fsinfo->persist) { - for(ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++) - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, - "Free space manager address:", fsinfo->fs_addr[ptype-1]); - } /* end if */ - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O__fsinfo_debug() */ - diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index d6190c6..75016e5 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -15,7 +15,7 @@ * * Created: H5Oginfo.c * Aug 23 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Group Information messages. * @@ -32,11 +32,11 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_ginfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, +static void *H5O__ginfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_ginfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_ginfo_copy(const void *_mesg, void *_dest); -static size_t H5O_ginfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__ginfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__ginfo_copy(const void *_mesg, void *_dest); +static size_t H5O__ginfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__ginfo_free(void *_mesg); static herr_t H5O__ginfo_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); @@ -47,10 +47,10 @@ const H5O_msg_class_t H5O_MSG_GINFO[1] = {{ "ginfo", /*message name for debugging */ sizeof(H5O_ginfo_t), /*native message size */ 0, /* messages are sharable? */ - H5O_ginfo_decode, /*decode message */ - H5O_ginfo_encode, /*encode message */ - H5O_ginfo_copy, /*copy the native value */ - H5O_ginfo_size, /*size of symbol table entry */ + H5O__ginfo_decode, /*decode message */ + H5O__ginfo_encode, /*encode message */ + H5O__ginfo_copy, /*copy the native value */ + H5O__ginfo_size, /*size of symbol table entry */ NULL, /*default reset method */ H5O__ginfo_free, /* free method */ NULL, /* file delete method */ @@ -78,7 +78,7 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t); /*------------------------------------------------------------------------- - * Function: H5O_ginfo_decode + * Function: H5O__ginfo_decode * * Purpose: Decode a message and return a pointer to * a newly allocated one. @@ -88,13 +88,12 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t); * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 30 2005 * *------------------------------------------------------------------------- */ static void * -H5O_ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) { @@ -102,7 +101,7 @@ H5O_ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned char flags; /* Flags for encoding group info */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(p); @@ -151,29 +150,28 @@ done: ginfo = H5FL_FREE(H5O_ginfo_t, ginfo); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_ginfo_decode() */ +} /* end H5O__ginfo_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_ginfo_encode + * Function: H5O__ginfo_encode * * Purpose: Encodes a message. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 30 2005 * *------------------------------------------------------------------------- */ static herr_t -H5O_ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *) _mesg; unsigned char flags = 0; /* Flags for encoding group info */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(p); @@ -200,11 +198,11 @@ H5O_ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_ginfo_encode() */ +} /* end H5O__ginfo_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_ginfo_copy + * Function: H5O__ginfo_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -214,19 +212,18 @@ H5O_ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 30 2005 * *------------------------------------------------------------------------- */ static void * -H5O_ginfo_copy(const void *_mesg, void *_dest) +H5O__ginfo_copy(const void *_mesg, void *_dest) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg; H5O_ginfo_t *dest = (H5O_ginfo_t *)_dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(ginfo); @@ -241,11 +238,11 @@ H5O_ginfo_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_ginfo_copy() */ +} /* end H5O__ginfo_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_ginfo_size + * Function: H5O__ginfo_size * * Purpose: Returns the size of the raw message in bytes not counting * the message type or size fields, but only the data fields. @@ -256,33 +253,32 @@ done: * Failure: zero * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 30 2005 * *------------------------------------------------------------------------- */ static size_t -H5O_ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set return value */ ret_value = 1 + /* Version */ 1 + /* Flags */ (ginfo->store_link_phase_change ? ( - (size_t)(2 + /* "Max compact" links */ - 2) /* "Min dense" links */ + (size_t)(2 + /* "Max compact" links */ + 2) /* "Min dense" links */ ) : 0) + /* "Min dense" links */ (ginfo->store_est_entry_info ? ( - (size_t)(2 + /* Estimated # of entries in group */ - 2) /* Estimated length of name of entry in group */ + (size_t)(2 + /* Estimated # of entries in group */ + 2) /* Estimated length of name of entry in group */ ) : 0); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_ginfo_size() */ +} /* end H5O__ginfo_size() */ /*------------------------------------------------------------------------- @@ -300,7 +296,7 @@ H5O_ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha static herr_t H5O__ginfo_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); @@ -318,7 +314,6 @@ H5O__ginfo_free(void *mesg) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 30 2005 * *------------------------------------------------------------------------- diff --git a/src/H5Oint.c b/src/H5Oint.c index 04220af..09db25a 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -99,36 +99,36 @@ hbool_t H5_PKG_INIT_VAR = FALSE; * message. */ const H5O_msg_class_t *const H5O_msg_class_g[] = { - H5O_MSG_NULL, /*0x0000 Null */ - H5O_MSG_SDSPACE, /*0x0001 Dataspace */ - H5O_MSG_LINFO, /*0x0002 Link information */ - H5O_MSG_DTYPE, /*0x0003 Datatype */ - H5O_MSG_FILL, /*0x0004 Old data storage -- fill value */ - H5O_MSG_FILL_NEW, /*0x0005 New data storage -- fill value */ - H5O_MSG_LINK, /*0x0006 Link */ - H5O_MSG_EFL, /*0x0007 Data storage -- external data files */ - H5O_MSG_LAYOUT, /*0x0008 Data Layout */ + H5O_MSG_NULL, /*0x0000 Null */ + H5O_MSG_SDSPACE, /*0x0001 Dataspace */ + H5O_MSG_LINFO, /*0x0002 Link information */ + H5O_MSG_DTYPE, /*0x0003 Datatype */ + H5O_MSG_FILL, /*0x0004 Old data storage -- fill value */ + H5O_MSG_FILL_NEW, /*0x0005 New data storage -- fill value */ + H5O_MSG_LINK, /*0x0006 Link */ + H5O_MSG_EFL, /*0x0007 Data storage -- external data files */ + H5O_MSG_LAYOUT, /*0x0008 Data Layout */ #ifdef H5O_ENABLE_BOGUS - H5O_MSG_BOGUS_VALID, /*0x0009 "Bogus valid" (for testing) */ + H5O_MSG_BOGUS_VALID, /*0x0009 "Bogus valid" (for testing) */ #else /* H5O_ENABLE_BOGUS */ - NULL, /*0x0009 "Bogus valid" (for testing) */ + NULL, /*0x0009 "Bogus valid" (for testing) */ #endif /* H5O_ENABLE_BOGUS */ - H5O_MSG_GINFO, /*0x000A Group information */ - H5O_MSG_PLINE, /*0x000B Data storage -- filter pipeline */ - H5O_MSG_ATTR, /*0x000C Attribute */ - H5O_MSG_NAME, /*0x000D Object name */ - H5O_MSG_MTIME, /*0x000E Object modification date and time */ - H5O_MSG_SHMESG, /*0x000F File-wide shared message table */ - H5O_MSG_CONT, /*0x0010 Object header continuation */ - H5O_MSG_STAB, /*0x0011 Symbol table */ - H5O_MSG_MTIME_NEW, /*0x0012 New Object modification date and time */ - H5O_MSG_BTREEK, /*0x0013 Non-default v1 B-tree 'K' values */ - H5O_MSG_DRVINFO, /*0x0014 Driver info settings */ - H5O_MSG_AINFO, /*0x0015 Attribute information */ - H5O_MSG_REFCOUNT, /*0x0016 Object's ref. count */ - H5O_MSG_FSINFO, /*0x0017 Free-space manager info */ - H5O_MSG_MDCI, /*0x0018 Metadata cache image */ - H5O_MSG_UNKNOWN /*0x0019 Placeholder for unknown message */ + H5O_MSG_GINFO, /*0x000A Group information */ + H5O_MSG_PLINE, /*0x000B Data storage -- filter pipeline */ + H5O_MSG_ATTR, /*0x000C Attribute */ + H5O_MSG_NAME, /*0x000D Object name */ + H5O_MSG_MTIME, /*0x000E Object modification date and time */ + H5O_MSG_SHMESG, /*0x000F File-wide shared message table */ + H5O_MSG_CONT, /*0x0010 Object header continuation */ + H5O_MSG_STAB, /*0x0011 Symbol table */ + H5O_MSG_MTIME_NEW, /*0x0012 New Object modification date and time */ + H5O_MSG_BTREEK, /*0x0013 Non-default v1 B-tree 'K' values */ + H5O_MSG_DRVINFO, /*0x0014 Driver info settings */ + H5O_MSG_AINFO, /*0x0015 Attribute information */ + H5O_MSG_REFCOUNT, /*0x0016 Object's ref. count */ + H5O_MSG_FSINFO, /*0x0017 Free-space manager info */ + H5O_MSG_MDCI, /*0x0018 Metadata cache image */ + H5O_MSG_UNKNOWN /*0x0019 Placeholder for unknown message */ }; /* Format version bounds for object header */ @@ -219,7 +219,7 @@ H5O__init_package(void) /*------------------------------------------------------------------------- - * Function: H5O_set_version + * Function: H5O__set_version * * Purpose: Sets the correct version to encode the object header. * Chooses the oldest version possible, unless the file's @@ -233,12 +233,12 @@ H5O__init_package(void) *------------------------------------------------------------------------- */ static herr_t -H5O_set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_idx) +H5O__set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_idx) { uint8_t version; /* Message version */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* check arguments */ HDassert(f); @@ -262,7 +262,7 @@ H5O_set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_idx done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_set_version() */ +} /* end H5O__set_version() */ /*------------------------------------------------------------------------- @@ -280,17 +280,8 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 5 1997 * - * Changes: 2018 August 17 - * Jacob Smith - * Refactor out the operations into two separate steps -- - * preparation and application -- to facilitate overriding the - * library-default size allocated for the object header. This - * function is retained as a wrapper, to minimize changes to - * unaffected calling functions. - * *------------------------------------------------------------------------- */ herr_t @@ -308,13 +299,13 @@ H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, hid_t ocpl_id, H5O_loc /* create object header in freelist * header version is set internally */ - oh = H5O__create_ohdr(f, ocpl_id); + oh = H5O_create_ohdr(f, ocpl_id); if(NULL == oh) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "Can't instantiate object header") /* apply object header information to file */ - if(H5O__apply_ohdr(f, oh, ocpl_id, size_hint, initial_rc, loc) < 0) + if(H5O_apply_ohdr(f, oh, ocpl_id, size_hint, initial_rc, loc) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "Can't apply object header to file") done: @@ -326,7 +317,7 @@ done: /*----------------------------------------------------------------------------- - * Function: H5O__create_ohdr + * Function: H5O_create_ohdr * * Purpose: Create the object header, set version and flags. * @@ -339,7 +330,7 @@ done: *----------------------------------------------------------------------------- */ H5O_t * -H5O__create_ohdr(H5F_t *f, hid_t ocpl_id) +H5O_create_ohdr(H5F_t *f, hid_t ocpl_id) { H5P_genplist_t *oc_plist; H5O_t *oh = NULL; /* Object header in Freelist */ @@ -364,20 +355,18 @@ H5O__create_ohdr(H5F_t *f, hid_t ocpl_id) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, NULL, "not a property list") /* Get any object header status flags set by properties */ - if(H5P_DATASET_CREATE_DEFAULT == ocpl_id) - { + if(H5P_DATASET_CREATE_DEFAULT == ocpl_id) { /* If the OCPL is the default DCPL, we can get the header flags from the * API context. Otherwise we have to call H5P_get */ if(H5CX_get_ohdr_flags(&oh_flags) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get object header flags") } - else - { + else { if(H5P_get(oc_plist, H5O_CRT_OHDR_FLAGS_NAME, &oh_flags) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get object header flags") } - if(H5O_set_version(f, oh, oh_flags, H5F_STORE_MSG_CRT_IDX(f)) < 0) + if(H5O__set_version(f, oh, oh_flags, H5F_STORE_MSG_CRT_IDX(f)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, NULL, "can't set version of object header") oh->flags = oh_flags; @@ -389,11 +378,11 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, NULL, "can't delete object header") FUNC_LEAVE_NOAPI(ret_value) -} /* H5O__create_ohdr() */ +} /* H5O_create_ohdr() */ /*----------------------------------------------------------------------------- - * Function: H5O__apply_ohdr + * Function: H5O_apply_ohdr * * Purpose: Initialize and set the object header in the file. * Record some information at `loc_out`. @@ -407,7 +396,7 @@ done: *----------------------------------------------------------------------------- */ herr_t -H5O__apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, size_t size_hint, size_t initial_rc, H5O_loc_t *loc_out) +H5O_apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, size_t size_hint, size_t initial_rc, H5O_loc_t *loc_out) { haddr_t oh_addr; size_t oh_size; @@ -564,7 +553,7 @@ H5O__apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, size_t size_hint, size_t ini done: FUNC_LEAVE_NOAPI(ret_value); -} /* H5O__apply_ohdr() */ +} /* H5O_apply_ohdr() */ /*------------------------------------------------------------------------- @@ -664,7 +653,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_open_by_idx + * Function: H5O__open_by_idx * * Purpose: Internal routine to open an object by index within group * @@ -677,7 +666,7 @@ done: *------------------------------------------------------------------------- */ void * -H5O_open_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, +H5O__open_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5I_type_t *opened_type) { H5G_loc_t obj_loc; /* Location used to open group */ @@ -686,7 +675,7 @@ H5O_open_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, hbool_t loc_found = FALSE; /* Entry at 'name' found */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); @@ -712,11 +701,11 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, NULL, "can't free location") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_open_by_idx() */ +} /* end H5O__open_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5O_open_by_addr + * Function: H5O__open_by_addr * * Purpose: Internal routine to open an object by its address * @@ -729,14 +718,14 @@ done: *------------------------------------------------------------------------- */ void * -H5O_open_by_addr(const H5G_loc_t *loc, haddr_t addr, H5I_type_t *opened_type) +H5O__open_by_addr(const H5G_loc_t *loc, haddr_t addr, H5I_type_t *opened_type) { H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); @@ -755,7 +744,7 @@ H5O_open_by_addr(const H5G_loc_t *loc, haddr_t addr, H5I_type_t *opened_type) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_open_by_addr() */ +} /* end H5O__open_by_addr() */ /*------------------------------------------------------------------------- @@ -869,7 +858,6 @@ done: * Failure: -1 * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 5 1997 * *------------------------------------------------------------------------- @@ -984,7 +972,6 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 5 1997 * *------------------------------------------------------------------------- @@ -1033,7 +1020,6 @@ done: * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Dec 31 2002 * *------------------------------------------------------------------------- @@ -1219,7 +1205,6 @@ done: * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 13 2008 * *------------------------------------------------------------------------- @@ -1266,7 +1251,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 13 2008 * *------------------------------------------------------------------------- @@ -1302,7 +1286,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Dec 31 2002 * *------------------------------------------------------------------------- @@ -1498,7 +1481,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * * Tuesday, January 21, 2003 * *------------------------------------------------------------------------- @@ -1570,7 +1552,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 19 2003 * *------------------------------------------------------------------------- @@ -1633,7 +1614,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Mar 19 2003 * *------------------------------------------------------------------------- @@ -1696,7 +1676,7 @@ H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type) done: if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_obj_type() */ @@ -1734,10 +1714,9 @@ H5O__obj_type_real(const H5O_t *oh, H5O_type_t *obj_type) /* Set type to "unknown" */ *obj_type = H5O_TYPE_UNKNOWN; } - else { + else /* Set object type */ *obj_type = obj_class->type; - } FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O__obj_type_real() */ @@ -1923,7 +1902,6 @@ H5O_loc_reset(H5O_loc_t *loc) * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Monday, September 19, 2005 * *------------------------------------------------------------------------- @@ -2131,7 +2109,7 @@ H5O_get_hdr_info(const H5O_loc_t *loc, H5O_hdr_info_t *hdr) done: if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") + HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_get_hdr_info() */ @@ -2942,7 +2920,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 13 2008 * *------------------------------------------------------------------------- @@ -2978,7 +2955,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jul 13 2008 * *------------------------------------------------------------------------- @@ -3015,7 +2991,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Oct 08 2010 * *------------------------------------------------------------------------- @@ -3081,7 +3056,6 @@ H5O_get_proxy(const H5O_t *oh) * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 15 2003 * *------------------------------------------------------------------------- diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 8e6e204..671afeb 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Wednesday, October 8, 1997 * * Purpose: Messages related to data layout. @@ -967,7 +967,7 @@ H5O__layout_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, const H5O_layout_t *layout_src = (const H5O_layout_t *)mesg_src; /* Source layout */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(cpy_info); diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index a2f88d9..ebb34dc 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -15,7 +15,7 @@ * * Created: H5Olinfo.c * Aug 23 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Link Information messages. * @@ -38,9 +38,9 @@ /* PRIVATE PROTOTYPES */ static void *H5O__linfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_linfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_linfo_copy(const void *_mesg, void *_dest); -static size_t H5O_linfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__linfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__linfo_copy(const void *_mesg, void *_dest); +static size_t H5O__linfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__linfo_free(void *_mesg); static herr_t H5O__linfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); static void *H5O__linfo_copy_file(H5F_t *file_src, void *native_src, @@ -59,9 +59,9 @@ const H5O_msg_class_t H5O_MSG_LINFO[1] = {{ sizeof(H5O_linfo_t), /*native message size */ 0, /* messages are sharable? */ H5O__linfo_decode, /*decode message */ - H5O_linfo_encode, /*encode message */ - H5O_linfo_copy, /*copy the native value */ - H5O_linfo_size, /*size of symbol table entry */ + H5O__linfo_encode, /*encode message */ + H5O__linfo_copy, /*copy the native value */ + H5O__linfo_size, /*size of symbol table entry */ NULL, /*default reset method */ H5O__linfo_free, /* free method */ H5O__linfo_delete, /* file delete method */ @@ -105,7 +105,6 @@ H5FL_DEFINE_STATIC(H5O_linfo_t); * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 23 2005 * *------------------------------------------------------------------------- @@ -174,25 +173,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_linfo_encode + * Function: H5O__linfo_encode * * Purpose: Encodes a message. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 23 2005 * *------------------------------------------------------------------------- */ static herr_t -H5O_linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg; unsigned char index_flags; /* Flags for encoding link index info */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -224,11 +222,11 @@ H5O_linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co HDassert(!H5F_addr_defined(linfo->corder_bt2_addr)); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_linfo_encode() */ +} /* end H5O__linfo_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_linfo_copy + * Function: H5O__linfo_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -237,19 +235,18 @@ H5O_linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 23 2005 * *------------------------------------------------------------------------- */ static void * -H5O_linfo_copy(const void *_mesg, void *_dest) +H5O__linfo_copy(const void *_mesg, void *_dest) { const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg; H5O_linfo_t *dest = (H5O_linfo_t *) _dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(linfo); @@ -264,11 +261,11 @@ H5O_linfo_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_linfo_copy() */ +} /* end H5O__linfo_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_linfo_size + * Function: H5O__linfo_size * * Purpose: Returns the size of the raw message in bytes not counting * the message type or size fields, but only the data fields. @@ -278,18 +275,17 @@ done: * Failure: zero * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 23 2005 * *------------------------------------------------------------------------- */ static size_t -H5O_linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set return value */ ret_value = 1 /* Version */ @@ -300,7 +296,7 @@ H5O_linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void + (linfo->index_corder ? (size_t)H5F_SIZEOF_ADDR(f) : 0); /* Address of v2 B-tree for indexing creation order values of links */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_linfo_size() */ +} /* end H5O__linfo_size() */ /*------------------------------------------------------------------------- @@ -393,7 +389,7 @@ H5O__linfo_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t *fi HDassert(cpy_info); /* Copy the source message */ - if(NULL == (linfo_dst = (H5O_linfo_t *)H5O_linfo_copy(linfo_src, NULL))) + if(NULL == (linfo_dst = (H5O_linfo_t *)H5O__linfo_copy(linfo_src, NULL))) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "memory allocation failed") /* If we are performing a 'shallow hierarchy' copy, and the links in this @@ -441,7 +437,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Sept 26 2006 * *------------------------------------------------------------------------- @@ -548,7 +543,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 23 2005 * *------------------------------------------------------------------------- diff --git a/src/H5Olink.c b/src/H5Olink.c index c27b51f..70b654f 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -15,7 +15,7 @@ * * Created: H5Olink.c * Aug 29 2005 - * Quincey Koziol + * Quincey Koziol * * Purpose: Link messages. * @@ -40,12 +40,12 @@ /* PRIVATE PROTOTYPES */ static void *H5O__link_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_link_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_link_copy(const void *_mesg, void *_dest); -static size_t H5O_link_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__link_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__link_copy(const void *_mesg, void *_dest); +static size_t H5O__link_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__link_reset(void *_mesg); static herr_t H5O__link_free(void *_mesg); -static herr_t H5O_link_pre_copy_file(H5F_t *file_src, const void *mesg_src, +static herr_t H5O__link_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); static void *H5O__link_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, @@ -63,16 +63,16 @@ const H5O_msg_class_t H5O_MSG_LINK[1] = {{ sizeof(H5O_link_t), /*native message size */ 0, /* messages are sharable? */ H5O__link_decode, /*decode message */ - H5O_link_encode, /*encode message */ - H5O_link_copy, /*copy the native value */ - H5O_link_size, /*size of symbol table entry */ + H5O__link_encode, /*encode message */ + H5O__link_copy, /*copy the native value */ + H5O__link_size, /*size of symbol table entry */ H5O__link_reset, /* reset method */ H5O__link_free, /* free method */ H5O_link_delete, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ - H5O_link_pre_copy_file, /* pre copy native value to file */ + H5O__link_pre_copy_file, /* pre copy native value to file */ H5O__link_copy_file, /* copy native value to file */ H5O__link_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ @@ -111,7 +111,6 @@ H5FL_DEFINE_STATIC(H5O_link_t); * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 29 2005 * *------------------------------------------------------------------------- @@ -284,26 +283,25 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_link_encode + * Function: H5O__link_encode * * Purpose: Encodes a link message. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 29 2005 * *------------------------------------------------------------------------- */ static herr_t -H5O_link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_link_t *lnk = (const H5O_link_t *) _mesg; uint64_t len; /* Length of a string in the message */ unsigned char link_flags; /* Flags for encoding link info */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -404,11 +402,11 @@ H5O_link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con } /* end switch */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_link_encode() */ +} /* end H5O__link_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_link_copy + * Function: H5O__link_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -418,19 +416,18 @@ H5O_link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 29 2005 * *------------------------------------------------------------------------- */ static void * -H5O_link_copy(const void *_mesg, void *_dest) +H5O__link_copy(const void *_mesg, void *_dest) { const H5O_link_t *lnk = (const H5O_link_t *) _mesg; H5O_link_t *dest = (H5O_link_t *) _dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(lnk); @@ -471,11 +468,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_link_copy() */ +} /* end H5O__link_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_link_size + * Function: H5O__link_size * * Purpose: Returns the size of the raw message in bytes not counting * the message type or size fields, but only the data fields. @@ -486,20 +483,19 @@ done: * Failure: zero * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 29 2005 * *------------------------------------------------------------------------- */ static size_t -H5O_link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_link_t *lnk = (const H5O_link_t *)_mesg; uint64_t name_len; /* Length of name */ size_t name_size; /* Size of encoded name length */ size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDcompile_assert(sizeof(uint64_t) >= sizeof(size_t)); @@ -548,7 +544,7 @@ H5O_link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void } /* end switch */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_link_size() */ +} /* end H5O__link_size() */ /*------------------------------------------------------------------------- @@ -683,7 +679,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_link_pre_copy_file + * Function: H5O__link_pre_copy_file * * Purpose: Perform any necessary actions before copying message between * files for link messages. @@ -698,10 +694,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, +H5O__link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(deleted); @@ -716,7 +712,7 @@ H5O_link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *deleted = TRUE; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_link_pre_copy_file() */ +} /* end H5O__link_pre_copy_file() */ /*------------------------------------------------------------------------- @@ -811,7 +807,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Aug 29 2005 * *------------------------------------------------------------------------- @@ -823,7 +818,7 @@ H5O__link_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, const H5O_link_t *lnk = (const H5O_link_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); diff --git a/src/H5Omessage.c b/src/H5Omessage.c index d66ea69..283d913 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -15,7 +15,7 @@ * * Created: H5Omessage.c * Dec 3 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Object header message routines. * @@ -105,7 +105,6 @@ static herr_t H5O__copy_mesg(H5F_t *f, H5O_t *oh, size_t idx, * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 1 2006 * *------------------------------------------------------------------------- @@ -153,7 +152,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Dec 31 2002 * *------------------------------------------------------------------------- @@ -196,7 +194,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 8 2006 * *------------------------------------------------------------------------- @@ -248,7 +245,6 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -304,7 +300,6 @@ done: * Failure: Negative * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Dec 6 2007 * *------------------------------------------------------------------------- @@ -352,7 +347,6 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -453,7 +447,6 @@ done: * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -506,7 +499,6 @@ done: * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -563,7 +555,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * *------------------------------------------------------------------------- @@ -600,7 +591,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * *------------------------------------------------------------------------- @@ -951,7 +941,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 28 1997 * *------------------------------------------------------------------------- @@ -1002,7 +991,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 6 2005 * *------------------------------------------------------------------------- @@ -1052,7 +1040,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 6 2005 * *------------------------------------------------------------------------- @@ -1118,7 +1105,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 28 1997 * *------------------------------------------------------------------------- @@ -1175,7 +1161,6 @@ done: * object headers were processed. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Nov 19 2004 * * Description: @@ -1241,7 +1226,6 @@ done: * object headers were processed. * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 6 2005 * * Description: @@ -1316,7 +1300,7 @@ done: */ if(oh_modified & H5O_MODIFY_CONDENSE) if(H5O__condense_header(f, oh) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't pack object header") + HDONE_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't pack object header") /* Mark object header as changed */ if(H5O_touch_oh(f, oh, FALSE) < 0) @@ -1340,7 +1324,6 @@ done: * Return: Size of message on success, 0 on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Feb 13 2003 * *------------------------------------------------------------------------- @@ -1383,7 +1366,6 @@ done: * Return: Size of message on success, 0 on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 6 2005 * *------------------------------------------------------------------------- @@ -1447,7 +1429,6 @@ done: * Return: Size of message on success, 0 on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 7 2007 * *------------------------------------------------------------------------- @@ -1584,7 +1565,6 @@ H5O_msg_can_share_in_ohdr(unsigned type_id) * Object is not shared: FALSE * * Programmer: James Laird - * jlaird@ncsa.uiuc.edu * April 5 2006 * *------------------------------------------------------------------------- @@ -1629,7 +1609,6 @@ H5O_msg_is_shared(unsigned type_id, const void *mesg) * Failure: Negative * * Programmer: James Laird - * jlaird@hdfgroup.org * November 1 2006 * *------------------------------------------------------------------------- @@ -1680,7 +1659,6 @@ done: * Failure: Negative * * Programmer: James Laird - * jlaird@hdfgroup.org * Oct 17 2006 * *------------------------------------------------------------------------- @@ -1756,7 +1734,6 @@ done: * Failure: Negative * * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu * July 13, 2004 * *------------------------------------------------------------------------- @@ -1796,14 +1773,8 @@ done: * Failure: NULL * * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu * July 14, 2004 * - * Modifications: Neil Fortner - * Feb 4 2009 - * Added open_oh parameter. This parameter is optional and - * contains this message's protected object header - * *------------------------------------------------------------------------- */ void * @@ -2067,7 +2038,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * September 26 2003 * *------------------------------------------------------------------------- @@ -2107,7 +2077,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * May 14 2007 * *------------------------------------------------------------------------- @@ -2208,7 +2177,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Nov 21 2005 * *------------------------------------------------------------------------- diff --git a/src/H5Omodule.h b/src/H5Omodule.h index df3ab56..6f00fcc 100644 --- a/src/H5Omodule.h +++ b/src/H5Omodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Omtime.c b/src/H5Omtime.c index fbf7613..846bbf3 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Friday, July 24, 1998 * * Purpose: The object modification time message. @@ -29,14 +29,14 @@ static void *H5O__mtime_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_mtime_new_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static size_t H5O_mtime_new_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__mtime_new_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static size_t H5O__mtime_new_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static void *H5O__mtime_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_mtime_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_mtime_copy(const void *_mesg, void *_dest); -static size_t H5O_mtime_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__mtime_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__mtime_copy(const void *_mesg, void *_dest); +static size_t H5O__mtime_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__mtime_free(void *_mesg); static herr_t H5O__mtime_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -48,9 +48,9 @@ const H5O_msg_class_t H5O_MSG_MTIME[1] = {{ sizeof(time_t), /*native message size */ 0, /* messages are sharable? */ H5O__mtime_decode, /*decode message */ - H5O_mtime_encode, /*encode message */ - H5O_mtime_copy, /*copy the native value */ - H5O_mtime_size, /*raw message size */ + H5O__mtime_encode, /*encode message */ + H5O__mtime_copy, /*copy the native value */ + H5O__mtime_size, /*raw message size */ NULL, /* reset method */ H5O__mtime_free, /* free method */ NULL, /* file delete method */ @@ -73,9 +73,9 @@ const H5O_msg_class_t H5O_MSG_MTIME_NEW[1] = {{ sizeof(time_t), /*native message size */ 0, /* messages are sharable? */ H5O__mtime_new_decode, /*decode message */ - H5O_mtime_new_encode, /*encode message */ - H5O_mtime_copy, /*copy the native value */ - H5O_mtime_new_size, /*raw message size */ + H5O__mtime_new_encode, /*encode message */ + H5O__mtime_copy, /*copy the native value */ + H5O__mtime_new_size, /*raw message size */ NULL, /* reset method */ H5O__mtime_free, /* free method */ NULL, /* file delete method */ @@ -111,7 +111,6 @@ H5FL_DEFINE(time_t); * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 3 2002 * *------------------------------------------------------------------------- @@ -168,7 +167,6 @@ done: * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 24 1998 * *------------------------------------------------------------------------- @@ -220,24 +218,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_mtime_new_encode + * Function: H5O__mtime_new_encode * * Purpose: Encodes a new modification time message. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 3 2002 * *------------------------------------------------------------------------- */ static herr_t -H5O_mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const time_t *mesg = (const time_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -256,31 +253,28 @@ H5O_mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha UINT32ENCODE(p, *mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_mtime_new_encode() */ +} /* end H5O__mtime_new_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_mtime_encode + * Function: H5O__mtime_encode * * Purpose: Encodes a modification time message. * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 24 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const time_t *mesg = (const time_t *) _mesg; struct tm *tm; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -290,15 +284,15 @@ H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, /* encode */ tm = HDgmtime(mesg); HDsprintf((char*)p, "%04d%02d%02d%02d%02d%02d", - 1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday, - tm->tm_hour, tm->tm_min, tm->tm_sec); + 1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec); FUNC_LEAVE_NOAPI(SUCCEED) -} +} /* end H5O__mtime_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_mtime_copy + * Function: H5O__mtime_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -308,25 +302,22 @@ H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 24 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5O_mtime_copy(const void *_mesg, void *_dest) +H5O__mtime_copy(const void *_mesg, void *_dest) { const time_t *mesg = (const time_t *) _mesg; time_t *dest = (time_t *) _dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(mesg); - if (!dest && NULL==(dest = H5FL_MALLOC(time_t))) + if(!dest && NULL == (dest = H5FL_MALLOC(time_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); /* copy */ @@ -337,11 +328,11 @@ H5O_mtime_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5O__mtime_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_mtime_new_size + * Function: H5O__mtime_new_size * * Purpose: Returns the size of the raw message in bytes not * counting the message type or size fields, but only the data @@ -353,28 +344,25 @@ done: * Failure: 0 * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Jan 3 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t -H5O_mtime_new_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED * mesg) +H5O__mtime_new_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED * mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); HDassert(mesg); FUNC_LEAVE_NOAPI(8) -} /* end H5O_mtime_new_size() */ +} /* end H5O__mtime_new_size() */ /*------------------------------------------------------------------------- - * Function: H5O_mtime_size + * Function: H5O__mtime_size * * Purpose: Returns the size of the raw message in bytes not * counting the message type or size fields, but only the data @@ -386,24 +374,21 @@ H5O_mtime_new_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disabl * Failure: 0 * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 14 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t -H5O_mtime_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED * mesg) +H5O__mtime_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED * mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); HDassert(mesg); FUNC_LEAVE_NOAPI(16) -} +} /* end H5O__mtime_size() */ /*------------------------------------------------------------------------- @@ -439,7 +424,6 @@ H5O__mtime_free(void *mesg) * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 24 1998 * *------------------------------------------------------------------------- diff --git a/src/H5Oname.c b/src/H5Oname.c index 1f20f10..41cd01e 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -15,7 +15,7 @@ * * Created: H5Oname.c * Aug 12 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Object name message. * @@ -34,9 +34,9 @@ /* PRIVATE PROTOTYPES */ static void *H5O__name_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_name_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_name_copy(const void *_mesg, void *_dest); -static size_t H5O_name_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__name_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__name_copy(const void *_mesg, void *_dest); +static size_t H5O__name_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__name_reset(void *_mesg); static herr_t H5O__name_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); @@ -48,9 +48,9 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ sizeof(H5O_name_t), /*native message size */ 0, /* messages are sharable? */ H5O__name_decode, /*decode message */ - H5O_name_encode, /*encode message */ - H5O_name_copy, /*copy the native value */ - H5O_name_size, /*raw message size */ + H5O__name_encode, /*encode message */ + H5O__name_copy, /*copy the native value */ + H5O__name_size, /*raw message size */ H5O__name_reset, /*free internal memory */ NULL, /* free method */ NULL, /* file delete method */ @@ -77,7 +77,6 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * *------------------------------------------------------------------------- @@ -115,26 +114,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_name_encode + * Function: H5O__name_encode * * Purpose: Encodes a name message. * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_name_t *mesg = (const H5O_name_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -145,11 +141,11 @@ H5O_name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, HDstrcpy((char*)p, mesg->s); FUNC_LEAVE_NOAPI(SUCCEED) -} +} /* end H5O__name_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_name_copy + * Function: H5O__name_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -159,21 +155,18 @@ H5O_name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * -H5O_name_copy(const void *_mesg, void *_dest) +H5O__name_copy(const void *_mesg, void *_dest) { const H5O_name_t *mesg = (const H5O_name_t *) _mesg; H5O_name_t *dest = (H5O_name_t *) _dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(mesg); @@ -195,11 +188,11 @@ done: dest = (H5O_name_t *)H5MM_xfree(dest); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_name_copy() */ +} /* end H5O__name_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_name_size + * Function: H5O__name_size * * Purpose: Returns the size of the raw message in bytes not * counting the message typ or size fields, but only the data @@ -211,20 +204,17 @@ done: * Failure: Negative * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t -H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) +H5O__name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg) { const H5O_name_t *mesg = (const H5O_name_t *) _mesg; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -233,7 +223,7 @@ H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar ret_value = mesg->s ? HDstrlen(mesg->s) + 1 : 0; FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5O__name_size() */ /*------------------------------------------------------------------------- @@ -245,7 +235,6 @@ H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * *------------------------------------------------------------------------- @@ -275,11 +264,8 @@ H5O__name_reset(void *_mesg) * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 12 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -288,7 +274,7 @@ H5O__name_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, { const H5O_name_t *mesg = (const H5O_name_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); diff --git a/src/H5Onull.c b/src/H5Onull.c index 5697455..43c555f 100644 --- a/src/H5Onull.c +++ b/src/H5Onull.c @@ -15,7 +15,6 @@ * * Created: H5Onull.c * Aug 6 1997 - * Robb Matzke * * Purpose: The null message. * diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 16ea8e5..07e0e8e 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -554,7 +554,12 @@ H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATASET[1]; H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATATYPE[1]; /* Package-local function prototypes */ +H5_DLL void *H5O__open_by_addr(const H5G_loc_t *loc, haddr_t addr, H5I_type_t *opened_type/*out*/); +H5_DLL void *H5O__open_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5I_type_t *opened_type/*out*/); H5_DLL const H5O_obj_class_t *H5O__obj_class(const H5O_loc_t *loc); +H5_DLL herr_t H5O__copy(const H5G_loc_t *src_loc, const char *src_name, + H5G_loc_t *dst_loc, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id); H5_DLL int H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, hbool_t *deleted); H5_DLL herr_t H5O__visit(H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate2_t op, void *op_data, unsigned fields); diff --git a/src/H5Opline.c b/src/H5Opline.c index a956725..35efed3 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -12,81 +12,81 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Wednesday, April 15, 1998 + * Programmer: Robb Matzke + * Wednesday, April 15, 1998 * - * Purpose: Data filter pipeline message. + * Purpose: Data filter pipeline message. */ #include "H5Omodule.h" /* This source code file is part of the H5O module */ -#define H5Z_FRIEND /*suppress error about including H5Zpkg */ +#define H5Z_FRIEND /*suppress error about including H5Zpkg */ -#include "H5private.h" /* Generic Functions */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Opkg.h" /* Object headers */ -#include "H5Zpkg.h" /* Data filters */ +#include "H5private.h" /* Generic Functions */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Opkg.h" /* Object headers */ +#include "H5Zpkg.h" /* Data filters */ /* PRIVATE PROTOTYPES */ -static herr_t H5O_pline_encode(H5F_t *f, uint8_t *p, const void *mesg); +static herr_t H5O__pline_encode(H5F_t *f, uint8_t *p, const void *mesg); static void *H5O__pline_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static void *H5O_pline_copy(const void *_mesg, void *_dest); -static size_t H5O_pline_size(const H5F_t *f, const void *_mesg); +static void *H5O__pline_copy(const void *_mesg, void *_dest); +static size_t H5O__pline_size(const H5F_t *f, const void *_mesg); static herr_t H5O__pline_reset(void *_mesg); static herr_t H5O__pline_free(void *_mesg); -static herr_t H5O_pline_pre_copy_file(H5F_t *file_src, +static herr_t H5O__pline_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *_udata); static herr_t H5O__pline_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); /* Set up & include shared message "interface" info */ -#define H5O_SHARED_TYPE H5O_MSG_PLINE -#define H5O_SHARED_DECODE H5O_pline_shared_decode -#define H5O_SHARED_DECODE_REAL H5O__pline_decode -#define H5O_SHARED_ENCODE H5O_pline_shared_encode -#define H5O_SHARED_ENCODE_REAL H5O_pline_encode -#define H5O_SHARED_SIZE H5O_pline_shared_size -#define H5O_SHARED_SIZE_REAL H5O_pline_size -#define H5O_SHARED_DELETE H5O__pline_shared_delete +#define H5O_SHARED_TYPE H5O_MSG_PLINE +#define H5O_SHARED_DECODE H5O__pline_shared_decode +#define H5O_SHARED_DECODE_REAL H5O__pline_decode +#define H5O_SHARED_ENCODE H5O__pline_shared_encode +#define H5O_SHARED_ENCODE_REAL H5O__pline_encode +#define H5O_SHARED_SIZE H5O__pline_shared_size +#define H5O_SHARED_SIZE_REAL H5O__pline_size +#define H5O_SHARED_DELETE H5O__pline_shared_delete #undef H5O_SHARED_DELETE_REAL -#define H5O_SHARED_LINK H5O__pline_shared_link +#define H5O_SHARED_LINK H5O__pline_shared_link #undef H5O_SHARED_LINK_REAL -#define H5O_SHARED_COPY_FILE H5O__pline_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__pline_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL -#define H5O_SHARED_POST_COPY_FILE H5O_pline_shared_post_copy_file +#define H5O_SHARED_POST_COPY_FILE H5O__pline_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD -#define H5O_SHARED_DEBUG H5O_pline_shared_debug -#define H5O_SHARED_DEBUG_REAL H5O__pline_debug -#include "H5Oshared.h" /* Shared Object Header Message Callbacks */ +#define H5O_SHARED_DEBUG H5O__pline_shared_debug +#define H5O_SHARED_DEBUG_REAL H5O__pline_debug +#include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_PLINE[1] = {{ - H5O_PLINE_ID, /* message id number */ - "filter pipeline", /* message name for debugging */ - sizeof(H5O_pline_t), /* native message size */ - H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */ - H5O_pline_shared_decode, /* decode message */ - H5O_pline_shared_encode, /* encode message */ - H5O_pline_copy, /* copy the native value */ - H5O_pline_shared_size, /* size of raw message */ - H5O__pline_reset, /* reset method */ - H5O__pline_free, /* free method */ - H5O__pline_shared_delete, /* file delete method */ - H5O__pline_shared_link, /* link method */ - NULL, /* set share method */ - NULL, /*can share method */ - H5O_pline_pre_copy_file, /* pre copy native value to file */ - H5O__pline_shared_copy_file, /* copy native value to file */ - H5O_pline_shared_post_copy_file, /* post copy native value to file */ - NULL, /* get creation index */ - NULL, /* set creation index */ - H5O_pline_shared_debug /* debug the message */ + H5O_PLINE_ID, /* message id number */ + "filter pipeline", /* message name for debugging */ + sizeof(H5O_pline_t), /* native message size */ + H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */ + H5O__pline_shared_decode, /* decode message */ + H5O__pline_shared_encode, /* encode message */ + H5O__pline_copy, /* copy the native value */ + H5O__pline_shared_size, /* size of raw message */ + H5O__pline_reset, /* reset method */ + H5O__pline_free, /* free method */ + H5O__pline_shared_delete, /* file delete method */ + H5O__pline_shared_link, /* link method */ + NULL, /* set share method */ + NULL, /*can share method */ + H5O__pline_pre_copy_file, /* pre copy native value to file */ + H5O__pline_shared_copy_file,/* copy native value to file */ + H5O__pline_shared_post_copy_file, /* post copy native value to file */ + NULL, /* get creation index */ + NULL, /* set creation index */ + H5O__pline_shared_debug /* debug the message */ }}; /* Format version bounds for filter pipleline */ @@ -105,12 +105,12 @@ H5FL_DEFINE(H5O_pline_t); /*------------------------------------------------------------------------- * Function: H5O__pline_decode * - * Purpose: Decodes a filter pipeline message. + * Purpose: Decodes a filter pipeline message. * - * Return: Success: Ptr to the native message. - * Failure: NULL + * Return: Success: Ptr to the native message. + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 15, 1998 * *------------------------------------------------------------------------- @@ -223,7 +223,7 @@ H5O__pline_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, if (p + 4 - 1 <= p_end) UINT32DECODE(p, filter->cd_values[j]) else - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "ran off the end of the buffer: current p = %p, p_size = %zu, p_end = %p", p, p_size, p_end) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "ran off the end of the buffer: current p = %p, p_size = %zu, p_end = %p", (const void *)p, p_size, (const void *)p_end) } if(pline->version == H5O_PLINE_VERSION_1) @@ -246,7 +246,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_pline_encode + * Function: H5O__pline_encode * * Purpose: Encodes message MESG into buffer P. * @@ -258,13 +258,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg) +H5O__pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg) { const H5O_pline_t *pline = (const H5O_pline_t*)mesg; /* Pipeline message to encode */ const H5Z_filter_info_t *filter; /* Filter to encode */ size_t i, j; /* Local index variables */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(p); @@ -288,7 +288,7 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg) size_t name_length; /* Length of filter name */ /* Filter ID */ - UINT16ENCODE(p, filter->id); + UINT16ENCODE(p, filter->id); /* Skip writing the name length & name if the filter is an internal filter */ if(pline->version > H5O_PLINE_VERSION_1 && filter->id < H5Z_FILTER_RESERVED) { @@ -312,26 +312,26 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg) } /* end else */ /* Filter flags */ - UINT16ENCODE(p, filter->flags); + UINT16ENCODE(p, filter->flags); /* # of filter parameters */ - UINT16ENCODE(p, filter->cd_nelmts); + UINT16ENCODE(p, filter->cd_nelmts); /* Encode name, if there is one to encode */ - if(name_length > 0) { + if(name_length > 0) { /* Store name, with null terminator */ - H5MM_memcpy(p, name, name_length); - p += name_length; + H5MM_memcpy(p, name, name_length); + p += name_length; /* Pad out name to alignment, in older versions */ if(pline->version == H5O_PLINE_VERSION_1) while(name_length++ % 8) *p++ = 0; - } /* end if */ + } /* end if */ /* Filter parameters */ - for(j = 0; j < filter->cd_nelmts; j++) - UINT32ENCODE(p, filter->cd_values[j]); + for(j = 0; j < filter->cd_nelmts; j++) + UINT32ENCODE(p, filter->cd_values[j]); /* Align the parameters for older versions of the format */ if(pline->version == H5O_PLINE_VERSION_1) @@ -340,11 +340,11 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg) } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_pline_encode() */ +} /* end H5O__pline_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_pline_copy + * Function: H5O__pline_copy * * Purpose: Copies a filter pipeline message from SRC to DST allocating * DST if necessary. If DST is already allocated then we assume @@ -360,18 +360,18 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p/*out*/, const void *mesg) *------------------------------------------------------------------------- */ static void * -H5O_pline_copy(const void *_src, void *_dst/*out*/) +H5O__pline_copy(const void *_src, void *_dst/*out*/) { const H5O_pline_t *src = (const H5O_pline_t *)_src; /* Source pipeline message */ H5O_pline_t *dst = (H5O_pline_t *)_dst; /* Destination pipeline message */ size_t i; /* Local index variable */ H5O_pline_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Allocate pipeline message, if not provided */ if(!dst && NULL == (dst = H5FL_MALLOC(H5O_pline_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Shallow copy basic fields */ *dst = *src; @@ -428,16 +428,16 @@ H5O_pline_copy(const void *_src, void *_dst/*out*/) done: if(!ret_value && dst) { H5O__pline_reset(dst); - if(!_dst) + if(!_dst) H5O__pline_free(dst); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_pline_copy() */ +} /* end H5O__pline_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_pline_size + * Function: H5O__pline_size * * Purpose: Determines the size of a raw filter pipeline message. * @@ -451,18 +451,18 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg) +H5O__pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg) { const H5O_pline_t *pline = (const H5O_pline_t*)mesg; /* Pipeline message */ size_t i; /* Local index variable */ size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Message header */ ret_value = (size_t)(1 + /*version */ - 1 + /*number of filters */ - (pline->version == H5O_PLINE_VERSION_1 ? 6 : 0)); /*reserved */ + 1 + /*number of filters */ + (pline->version == H5O_PLINE_VERSION_1 ? 6 : 0)); /*reserved */ /* Calculate size of each filter in pipeline */ for(i = 0; i < pline->nused; i++) { @@ -475,26 +475,26 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg) else { H5Z_class2_t *cls; /* Filter class */ - /* Get the name of the filter, same as done with H5O_pline_encode() */ + /* Get the name of the filter, same as done with H5O__pline_encode() */ if(NULL == (name = pline->filter[i].name) && (cls = H5Z_find(pline->filter[i].id))) name = cls->name; name_len = name ? HDstrlen(name) + 1 : 0; } /* end else */ - ret_value += 2 + /*filter identification number */ - (size_t)((pline->version == H5O_PLINE_VERSION_1 || pline->filter[i].id >= H5Z_FILTER_RESERVED) ? 2 : 0) + /*name length */ - 2 + /*flags */ - 2 + /*number of client data values */ - (pline->version == H5O_PLINE_VERSION_1 ? (size_t)H5O_ALIGN_OLD(name_len) : name_len); /*length of the filter name */ + ret_value += 2 + /*filter identification number */ + (size_t)((pline->version == H5O_PLINE_VERSION_1 || pline->filter[i].id >= H5Z_FILTER_RESERVED) ? 2 : 0) + /*name length */ + 2 + /*flags */ + 2 + /*number of client data values */ + (pline->version == H5O_PLINE_VERSION_1 ? (size_t)H5O_ALIGN_OLD(name_len) : name_len); /*length of the filter name */ - ret_value += pline->filter[i].cd_nelmts * 4; + ret_value += pline->filter[i].cd_nelmts * 4; if(pline->version == H5O_PLINE_VERSION_1) if(pline->filter[i].cd_nelmts % 2) ret_value += 4; } /* end for */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_pline_size() */ +} /* end H5O__pline_size() */ /*------------------------------------------------------------------------- @@ -525,8 +525,7 @@ H5O__pline_reset(void *mesg) HDassert(pline); /* Free the filter information and array */ - if (pline->filter) { - + if(pline->filter) { /* Free information for each filter */ for(i = 0; i < pline->nused; i++) { if(pline->filter[i].name && pline->filter[i].name != pline->filter[i]._name) @@ -579,7 +578,7 @@ H5O__pline_free(void *mesg) /*------------------------------------------------------------------------- - * Function: H5O_pline_pre_copy_file + * Function: H5O__pline_pre_copy_file * * Purpose: Perform any necessary actions before copying message between * files @@ -594,14 +593,14 @@ H5O__pline_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, +H5O__pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata) { const H5O_pline_t *pline_src = (const H5O_pline_t *)mesg_src; /* Source pline */ H5O_copy_file_ud_common_t *udata = (H5O_copy_file_ud_common_t *)_udata; /* Object copying user data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(pline_src); @@ -618,12 +617,12 @@ H5O_pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, * the object copying process. */ if(udata) - if(NULL == (udata->src_pline = (H5O_pline_t *)H5O_pline_copy(pline_src, NULL))) + if(NULL == (udata->src_pline = (H5O_pline_t *)H5O__pline_copy(pline_src, NULL))) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to copy") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_pline_pre_copy_file() */ +} /* end H5O__pline_pre_copy_file() */ /*------------------------------------------------------------------------- @@ -663,36 +662,36 @@ H5O__pline_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE *stream, /* Loop over all the filters */ for(i = 0; i < pline->nused; i++) { - char name[32]; - - HDsnprintf(name, sizeof(name), "Filter at position %u", (unsigned)i); - HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, name); - HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3), - "Filter identification:", - (unsigned)(pline->filter[i].id)); - if(pline->filter[i].name) - HDfprintf(stream, "%*s%-*s \"%s\"\n", indent + 3, "", MAX(0, fwidth - 3), - "Filter name:", - pline->filter[i].name); - else - HDfprintf(stream, "%*s%-*s NONE\n", indent + 3, "", MAX(0, fwidth - 3), - "Filter name:"); - HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3), - "Flags:", - pline->filter[i].flags); - HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3), - "Num CD values:", - pline->filter[i].cd_nelmts); + char name[32]; + + HDsnprintf(name, sizeof(name), "Filter at position %u", (unsigned)i); + HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, name); + HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3), + "Filter identification:", + (unsigned)(pline->filter[i].id)); + if(pline->filter[i].name) + HDfprintf(stream, "%*s%-*s \"%s\"\n", indent + 3, "", MAX(0, fwidth - 3), + "Filter name:", + pline->filter[i].name); + else + HDfprintf(stream, "%*s%-*s NONE\n", indent + 3, "", MAX(0, fwidth - 3), + "Filter name:"); + HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3), + "Flags:", + pline->filter[i].flags); + HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3), + "Num CD values:", + pline->filter[i].cd_nelmts); - /* Filter parameters */ - for(j = 0; j < pline->filter[i].cd_nelmts; j++) { - char field_name[32]; + /* Filter parameters */ + for(j = 0; j < pline->filter[i].cd_nelmts; j++) { + char field_name[32]; - HDsnprintf(field_name, sizeof(field_name), "CD value %lu", (unsigned long)j); - HDfprintf(stream, "%*s%-*s %u\n", indent + 6, "", MAX(0, fwidth - 6), - field_name, - pline->filter[i].cd_values[j]); - } /* end for */ + HDsnprintf(field_name, sizeof(field_name), "CD value %lu", (unsigned long)j); + HDfprintf(stream, "%*s%-*s %u\n", indent + 6, "", MAX(0, fwidth - 6), + field_name, + pline->filter[i].cd_values[j]); + } /* end for */ } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 0be6d89..fdbc368 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -15,7 +15,7 @@ * * Created: H5Oprivate.h * Aug 5 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Object header private include file. * @@ -885,13 +885,10 @@ struct H5P_genplist_t; H5_DLL herr_t H5O_init(void); H5_DLL herr_t H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, hid_t ocpl_id, H5O_loc_t *loc/*out*/); -H5_DLL H5O_t *H5O__create_ohdr(H5F_t *f, hid_t ocpl_id); -H5_DLL herr_t H5O__apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, +H5_DLL H5O_t *H5O_create_ohdr(H5F_t *f, hid_t ocpl_id); +H5_DLL herr_t H5O_apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, size_t size_hint, size_t initial_rc, H5O_loc_t *loc_out); H5_DLL herr_t H5O_open(H5O_loc_t *loc); -H5_DLL void *H5O_open_by_idx(const H5G_loc_t *loc, const char *name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5I_type_t *opened_type/*out*/); -H5_DLL void *H5O_open_by_addr(const H5G_loc_t *loc, haddr_t addr, H5I_type_t *opened_type/*out*/); H5_DLL void *H5O_open_by_loc(const H5G_loc_t *obj_loc, H5I_type_t *opened_type/*out*/); H5_DLL herr_t H5O_close(H5O_loc_t *loc, hbool_t *file_closed/*out*/); H5_DLL int H5O_link(const H5O_loc_t *loc, int adjust); @@ -986,8 +983,6 @@ H5_DLL herr_t H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst H5_DLL herr_t H5O_copy_expand_ref(H5F_t *file_src, hid_t tid_src, H5T_t *dt_src, void *buf_src, size_t nbytes_src, H5F_t *file_dst, void *buf_dst, H5O_copy_t *cpy_info); -H5_DLL herr_t H5O_copy(const H5G_loc_t *src_loc, const char *src_name, - H5G_loc_t *dst_loc, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id); /* Debugging routines */ H5_DLL herr_t H5O_debug_id(unsigned type_id, H5F_t *f, const void *mesg, FILE *stream, int indent, int fwidth); diff --git a/src/H5Opublic.h b/src/H5Opublic.h index d0f8ab3..23a6cba 100644 --- a/src/H5Opublic.h +++ b/src/H5Opublic.h @@ -15,7 +15,7 @@ * * Created: H5Opublic.h * Aug 5 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Public declarations for the H5O (object header) * package. diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c index 66b79bb..1ef8486 100644 --- a/src/H5Orefcount.c +++ b/src/H5Orefcount.c @@ -15,7 +15,7 @@ * * Created: H5Orefcount.c * Mar 10 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Object ref. count messages. * @@ -34,11 +34,11 @@ /* PRIVATE PROTOTYPES */ static void *H5O__refcount_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_refcount_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_refcount_copy(const void *_mesg, void *_dest); -static size_t H5O_refcount_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__refcount_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__refcount_copy(const void *_mesg, void *_dest); +static size_t H5O__refcount_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__refcount_free(void *_mesg); -static herr_t H5O_refcount_pre_copy_file(H5F_t *file_src, const void *mesg_src, +static herr_t H5O__refcount_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); static herr_t H5O__refcount_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); @@ -50,16 +50,16 @@ const H5O_msg_class_t H5O_MSG_REFCOUNT[1] = {{ sizeof(H5O_refcount_t), /*native message size */ 0, /* messages are sharable? */ H5O__refcount_decode, /*decode message */ - H5O_refcount_encode, /*encode message */ - H5O_refcount_copy, /*copy the native value */ - H5O_refcount_size, /*size of symbol table entry */ + H5O__refcount_encode, /*encode message */ + H5O__refcount_copy, /*copy the native value */ + H5O__refcount_size, /*size of symbol table entry */ NULL, /*default reset method */ H5O__refcount_free, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ - H5O_refcount_pre_copy_file, /* pre copy native value to file */ + H5O__refcount_pre_copy_file,/* pre copy native value to file */ NULL, /* copy native value to file */ NULL, /* post copy native value to file */ NULL, /* get creation index */ @@ -83,7 +83,6 @@ H5FL_DEFINE_STATIC(H5O_refcount_t); * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 10 2007 * *------------------------------------------------------------------------- @@ -125,24 +124,23 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_refcount_encode + * Function: H5O__refcount_encode * * Purpose: Encodes a message. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 10 2007 * *------------------------------------------------------------------------- */ static herr_t -H5O_refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_refcount_t *refcount = (const H5O_refcount_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -156,11 +154,11 @@ H5O_refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar UINT32ENCODE(p, *refcount); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_refcount_encode() */ +} /* end H5O__refcount_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_refcount_copy + * Function: H5O__refcount_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -169,19 +167,18 @@ H5O_refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar * Failure: NULL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 10 2007 * *------------------------------------------------------------------------- */ static void * -H5O_refcount_copy(const void *_mesg, void *_dest) +H5O__refcount_copy(const void *_mesg, void *_dest) { const H5O_refcount_t *refcount = (const H5O_refcount_t *)_mesg; H5O_refcount_t *dest = (H5O_refcount_t *) _dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(refcount); @@ -196,11 +193,11 @@ H5O_refcount_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_refcount_copy() */ +} /* end H5O__refcount_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_refcount_size + * Function: H5O__refcount_size * * Purpose: Returns the size of the raw message in bytes not counting * the message type or size fields, but only the data fields. @@ -210,25 +207,24 @@ done: * Failure: zero * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 10 2007 * *------------------------------------------------------------------------- */ static size_t -H5O_refcount_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, +H5O__refcount_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { - size_t ret_value; /* Return value */ + size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Set return value */ ret_value = 1 /* Version */ + 4; /* Ref. count */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_refcount_size() */ +} /* end H5O__refcount_size() */ /*------------------------------------------------------------------------- @@ -257,7 +253,7 @@ H5O__refcount_free(void *mesg) /*------------------------------------------------------------------------- - * Function: H5O_refcount_pre_copy_file + * Function: H5O__refcount_pre_copy_file * * Purpose: Perform any necessary actions before copying message between * files. @@ -271,10 +267,10 @@ H5O__refcount_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, +H5O__refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src, hbool_t *deleted, const H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(deleted); @@ -286,7 +282,7 @@ H5O_refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UN *deleted = TRUE; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_refcount_pre_copy_file() */ +} /* end H5O__refcount_pre_copy_file() */ /*------------------------------------------------------------------------- @@ -297,7 +293,6 @@ H5O_refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UN * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Mar 6 2007 * *------------------------------------------------------------------------- diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 33310dc..54ac71f 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -27,34 +27,34 @@ /* PRIVATE PROTOTYPES */ static void *H5O__sdspace_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg); -static void *H5O_sdspace_copy(const void *_mesg, void *_dest); -static size_t H5O_sdspace_size(const H5F_t *f, const void *_mesg); +static herr_t H5O__sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg); +static void *H5O__sdspace_copy(const void *_mesg, void *_dest); +static size_t H5O__sdspace_size(const H5F_t *f, const void *_mesg); static herr_t H5O__sdspace_reset(void *_mesg); static herr_t H5O__sdspace_free(void *_mesg); -static herr_t H5O_sdspace_pre_copy_file(H5F_t *file_src, const void *mesg_src, +static herr_t H5O__sdspace_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *_udata); static herr_t H5O__sdspace_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_SDSPACE -#define H5O_SHARED_DECODE H5O_sdspace_shared_decode +#define H5O_SHARED_DECODE H5O__sdspace_shared_decode #define H5O_SHARED_DECODE_REAL H5O__sdspace_decode -#define H5O_SHARED_ENCODE H5O_sdspace_shared_encode -#define H5O_SHARED_ENCODE_REAL H5O_sdspace_encode -#define H5O_SHARED_SIZE H5O_sdspace_shared_size -#define H5O_SHARED_SIZE_REAL H5O_sdspace_size +#define H5O_SHARED_ENCODE H5O__sdspace_shared_encode +#define H5O_SHARED_ENCODE_REAL H5O__sdspace_encode +#define H5O_SHARED_SIZE H5O__sdspace_shared_size +#define H5O_SHARED_SIZE_REAL H5O__sdspace_size #define H5O_SHARED_DELETE H5O__sdspace_shared_delete #undef H5O_SHARED_DELETE_REAL #define H5O_SHARED_LINK H5O__sdspace_shared_link #undef H5O_SHARED_LINK_REAL #define H5O_SHARED_COPY_FILE H5O__sdspace_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL -#define H5O_SHARED_POST_COPY_FILE H5O_sdspace_shared_post_copy_file +#define H5O_SHARED_POST_COPY_FILE H5O__sdspace_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD -#define H5O_SHARED_DEBUG H5O_sdspace_shared_debug +#define H5O_SHARED_DEBUG H5O__sdspace_shared_debug #define H5O_SHARED_DEBUG_REAL H5O__sdspace_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ @@ -63,23 +63,23 @@ const H5O_msg_class_t H5O_MSG_SDSPACE[1] = {{ H5O_SDSPACE_ID, /* message id number */ "dataspace", /* message name for debugging */ sizeof(H5S_extent_t), /* native message size */ - H5O_SHARE_IS_SHARABLE|H5O_SHARE_IN_OHDR, /* messages are sharable? */ - H5O_sdspace_shared_decode, /* decode message */ - H5O_sdspace_shared_encode, /* encode message */ - H5O_sdspace_copy, /* copy the native value */ - H5O_sdspace_shared_size, /* size of symbol table entry */ + H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */ + H5O__sdspace_shared_decode, /* decode message */ + H5O__sdspace_shared_encode, /* encode message */ + H5O__sdspace_copy, /* copy the native value */ + H5O__sdspace_shared_size, /* size of symbol table entry */ H5O__sdspace_reset, /* default reset method */ H5O__sdspace_free, /* free method */ - H5O__sdspace_shared_delete, /* file delete method */ - H5O__sdspace_shared_link, /* link method */ - NULL, /* set share method */ - NULL, /*can share method */ - H5O_sdspace_pre_copy_file, /* pre copy native value to file */ - H5O__sdspace_shared_copy_file,/* copy native value to file */ - H5O_sdspace_shared_post_copy_file,/* post copy native value to file */ - NULL, /* get creation index */ - NULL, /* set creation index */ - H5O_sdspace_shared_debug /* debug the message */ + H5O__sdspace_shared_delete, /* file delete method */ + H5O__sdspace_shared_link, /* link method */ + NULL, /* set share method */ + NULL, /*can share method */ + H5O__sdspace_pre_copy_file, /* pre copy native value to file */ + H5O__sdspace_shared_copy_file,/* copy native value to file */ + H5O__sdspace_shared_post_copy_file,/* post copy native value to file*/ + NULL, /* get creation index */ + NULL, /* set creation index */ + H5O__sdspace_shared_debug /* debug the message */ }}; /* Declare external the free list for H5S_extent_t's */ @@ -199,11 +199,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5O_sdspace_encode + H5O__sdspace_encode PURPOSE Encode a simple dimensionality message USAGE - herr_t H5O_sdspace_encode(f, raw_size, p, mesg) + herr_t H5O__sdspace_encode(f, raw_size, p, mesg) H5F_t *f; IN: pointer to the HDF5 file struct size_t raw_size; IN: size of the raw information buffer const uint8 *p; IN: the raw information buffer @@ -214,28 +214,15 @@ done: This function encodes the native memory form of the simple dimensionality message in the "raw" disk form. - MODIFICATIONS - Robb Matzke, 1998-04-09 - The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes - instead of just four bytes. - - Robb Matzke, 1998-07-20 - Added a version number and reformatted the message for aligment. - - Raymond Lu - April 8, 2004 - Added the type of dataspace into this header message using a reserved - byte. - --------------------------------------------------------------------------*/ static herr_t -H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg) +H5O__sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg) { const H5S_extent_t *sdim = (const H5S_extent_t *)_mesg; unsigned flags = 0; unsigned u; /* Local counting variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -277,16 +264,16 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg) } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_sdspace_encode() */ +} /* end H5O__sdspace_encode() */ /*-------------------------------------------------------------------------- NAME - H5O_sdspace_copy + H5O__sdspace_copy PURPOSE Copies a message from MESG to DEST, allocating DEST if necessary. USAGE - void *H5O_sdspace_copy(_mesg, _dest) + void *H5O__sdspace_copy(_mesg, _dest) const void *_mesg; IN: Pointer to the source extent dimensionality struct const void *_dest; IN: Pointer to the destination extent dimensionality struct RETURNS @@ -296,13 +283,13 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg) allocating the destination structure if necessary. --------------------------------------------------------------------------*/ static void * -H5O_sdspace_copy(const void *_mesg, void *_dest) +H5O__sdspace_copy(const void *_mesg, void *_dest) { const H5S_extent_t *mesg = (const H5S_extent_t *)_mesg; H5S_extent_t *dest = (H5S_extent_t *)_dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(mesg); @@ -322,16 +309,16 @@ done: dest = H5FL_FREE(H5S_extent_t, dest); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_sdspace_copy() */ +} /* end H5O__sdspace_copy() */ /*-------------------------------------------------------------------------- NAME - H5O_sdspace_size + H5O__sdspace_size PURPOSE Return the raw message size in bytes USAGE - void *H5O_sdspace_size(f, mesg) + void *H5O__sdspace_size(f, mesg) H5F_t *f; IN: pointer to the HDF5 file struct const void *mesg; IN: Pointer to the source extent dimensionality struct RETURNS @@ -341,18 +328,14 @@ done: success. (Not counting the message type or size fields, only the data portion of the message). It doesn't take into account alignment. - MODIFICATIONS - Robb Matzke, 1998-04-09 - The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes - instead of just four bytes. --------------------------------------------------------------------------*/ static size_t -H5O_sdspace_size(const H5F_t *f, const void *_mesg) +H5O__sdspace_size(const H5F_t *f, const void *_mesg) { const H5S_extent_t *space = (const H5S_extent_t *)_mesg; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Basic information for all dataspace messages */ ret_value = (size_t)(1 + /* Version */ @@ -368,7 +351,7 @@ H5O_sdspace_size(const H5F_t *f, const void *_mesg) ret_value += space->max ? (space->rank * H5F_SIZEOF_SIZE(f)) : 0; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_sdspace_size() */ +} /* end H5O__sdspace_size() */ /*------------------------------------------------------------------------- @@ -423,7 +406,7 @@ H5O__sdspace_free(void *mesg) /*------------------------------------------------------------------------- - * Function: H5O_sdspace_pre_copy_file + * Function: H5O__sdspace_pre_copy_file * * Purpose: Perform any necessary actions before copying message between * files @@ -438,14 +421,14 @@ H5O__sdspace_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, +H5O__sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata) { const H5S_extent_t *src_space_extent = (const H5S_extent_t *)mesg_src; /* Source dataspace extent */ H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(file_src); diff --git a/src/H5Oshared.c b/src/H5Oshared.c index b49e501..ca6c873 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 1, 1998 * * Purpose: Functions that operate on a shared message. The shared @@ -103,7 +103,6 @@ static herr_t H5O__shared_link_adj(H5F_t *f, H5O_t *open_oh, * Failure: NULL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 24 2003 * *------------------------------------------------------------------------- @@ -217,7 +216,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 26 2003 * *------------------------------------------------------------------------- @@ -443,7 +441,6 @@ H5O__shared_encode(const H5F_t *f, uint8_t *buf/*out*/, const H5O_shared_t *sh_m * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu * Sep 26 2003 * *------------------------------------------------------------------------- @@ -654,7 +651,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Peter Cao - * xcao@hdfgroup.org * May 24 2007 * *------------------------------------------------------------------------- diff --git a/src/H5Oshared.h b/src/H5Oshared.h index e4ad980..6dbf927 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 19, 2007 * * Purpose: This file contains inline definitions for "generic" routines diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c index 136268a..10181ad 100644 --- a/src/H5Oshmesg.c +++ b/src/H5Oshmesg.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: James Laird +/* Programmer: James Laird * Monday, January 29, 2007 * * Purpose: A message holding "implicitly shared object header message" @@ -29,9 +29,9 @@ static void *H5O__shmesg_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p); -static herr_t H5O_shmesg_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); -static void *H5O_shmesg_copy(const void *_mesg, void *_dest); -static size_t H5O_shmesg_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); +static herr_t H5O__shmesg_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); +static void *H5O__shmesg_copy(const void *_mesg, void *_dest); +static size_t H5O__shmesg_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__shmesg_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -42,9 +42,9 @@ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{ sizeof(H5O_shmesg_table_t), /*native message size */ 0, /* messages are sharable? */ H5O__shmesg_decode, /*decode message */ - H5O_shmesg_encode, /*encode message */ - H5O_shmesg_copy, /*copy the native value */ - H5O_shmesg_size, /*raw message size */ + H5O__shmesg_encode, /*encode message */ + H5O__shmesg_copy, /*copy the native value */ + H5O__shmesg_size, /*raw message size */ NULL, /*free internal memory */ NULL, /* free method */ NULL, /* file delete method */ @@ -105,7 +105,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_shmesg_encode + * Function: H5O__shmesg_encode * * Purpose: Encode a shared message table message. * @@ -117,11 +117,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) +H5O__shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -134,11 +134,11 @@ H5O_shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c *p++ = (uint8_t)mesg->nindexes; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_shmesg_encode() */ +} /* end H5O__shmesg_encode() */ /*------------------------------------------------------------------------- - * Function: H5O_shmesg_copy + * Function: H5O__shmesg_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if * necessary. @@ -152,13 +152,13 @@ H5O_shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c *------------------------------------------------------------------------- */ static void * -H5O_shmesg_copy(const void *_mesg, void *_dest) +H5O__shmesg_copy(const void *_mesg, void *_dest) { const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg; H5O_shmesg_table_t *dest = (H5O_shmesg_table_t *)_dest; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(mesg); @@ -174,11 +174,11 @@ H5O_shmesg_copy(const void *_mesg, void *_dest) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_shmesg_copy() */ +} /* end H5O__shmesg_copy() */ /*------------------------------------------------------------------------- - * Function: H5O_shmesg_size + * Function: H5O__shmesg_size * * Purpose: Returns the size of the raw message in bytes not counting the * message type or size fields, but only the data fields. @@ -192,11 +192,11 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) +H5O__shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -206,7 +206,7 @@ H5O_shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi 1); /* Number of indexes */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_shmesg_size() */ +} /* end H5O__shmesg_size() */ /*------------------------------------------------------------------------- diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 0f14a4b..10501a0 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -15,7 +15,7 @@ * * Created: H5Ostab.c * Aug 6 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Symbol table messages. * @@ -90,7 +90,6 @@ H5FL_DEFINE_STATIC(H5O_stab_t); * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -103,7 +102,7 @@ H5O__stab_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, H5O_stab_t *stab = NULL; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -119,10 +118,9 @@ H5O__stab_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, ret_value = stab; done: - if(ret_value == NULL) { + if(ret_value == NULL) if(stab != NULL) stab = H5FL_FREE(H5O_stab_t, stab); - } /* end if */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__stab_decode() */ @@ -136,7 +134,6 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -172,7 +169,6 @@ H5O__stab_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co * Failure: NULL * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -214,7 +210,6 @@ done: * Failure: zero * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * *------------------------------------------------------------------------- @@ -415,11 +410,8 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke - * matzke@llnl.gov * Aug 6 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t diff --git a/src/H5Otest.c b/src/H5Otest.c index df08ff7..5d242f3 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Monday, December 4, 2006 * * Purpose: Object header testing functions. @@ -789,5 +789,5 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) -} /* H5O__msg_get_chunkno_test() */ +} /* H5O__msg_move_to_new_chunk_test() */ diff --git a/src/H5Ounknown.c b/src/H5Ounknown.c index 89c00ad..a7116c8 100644 --- a/src/H5Ounknown.c +++ b/src/H5Ounknown.c @@ -15,7 +15,7 @@ * * Created: H5Ounknown.c * Apr 19 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Handle unknown message classes in a minimal way. * diff --git a/src/H5P.c b/src/H5P.c index 9bc293b..d490e7b 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * * Purpose: Generic Property Functions */ diff --git a/src/H5PBmodule.h b/src/H5PBmodule.h index c8aabb6..571d2be 100644 --- a/src/H5PBmodule.h +++ b/src/H5PBmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 5ce12b4..7429443 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -15,7 +15,7 @@ * * Created: H5Pdapl.c * October 27, 2008 - * Neil Fortner + * Neil Fortner * * Purpose: Dataset access property list class routines * @@ -322,7 +322,7 @@ H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size) uint64_t enc_value; unsigned enc_size; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); @@ -331,7 +331,7 @@ H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(vds_file_pref); enc_value = (uint64_t)len; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { @@ -374,7 +374,7 @@ H5P__dapl_vds_file_pref_dec(const void **_pp, void *_value) unsigned enc_size; /* Size of encoded property */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(pp); HDassert(*pp); @@ -418,7 +418,7 @@ static herr_t H5P__dapl_vds_file_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); @@ -439,7 +439,7 @@ H5P__dapl_vds_file_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNU static herr_t H5P__dapl_vds_file_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); @@ -466,7 +466,7 @@ H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t H5_AT const char *pref2 = *(const char * const *)value2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(NULL == pref1 && NULL != pref2) HGOTO_DONE(1); @@ -491,7 +491,7 @@ done: static herr_t H5P__dapl_vds_file_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); @@ -570,7 +570,7 @@ H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size) uint64_t enc_value; unsigned enc_size; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); @@ -579,7 +579,7 @@ H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(efile_pref); enc_value = (uint64_t)len; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { @@ -622,7 +622,7 @@ H5P__dapl_efile_pref_dec(const void **_pp, void *_value) unsigned enc_size; /* Size of encoded property */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(pp); HDassert(*pp); @@ -666,7 +666,7 @@ static herr_t H5P__dapl_efile_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); @@ -687,7 +687,7 @@ H5P__dapl_efile_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED static herr_t H5P__dapl_efile_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); @@ -714,7 +714,7 @@ H5P__dapl_efile_pref_cmp(const void *value1, const void *value2, size_t H5_ATTR_ const char *pref2 = *(const char * const *)value2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(NULL == pref1 && NULL != pref2) HGOTO_DONE(1); @@ -739,7 +739,7 @@ done: static herr_t H5P__dapl_efile_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); @@ -885,7 +885,7 @@ H5P__encode_chunk_cache_nslots(const void *value, void **_pp, size_t *size) uint8_t **pp = (uint8_t **)_pp; unsigned enc_size; /* Size of encoded property */ - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); @@ -899,7 +899,7 @@ H5P__encode_chunk_cache_nslots(const void *value, void **_pp, size_t *size) } /* end if */ else { enc_value = (uint64_t)*(const size_t *)value; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size > 0); *size += (1 + enc_size); } /* end else */ @@ -941,7 +941,7 @@ H5P__decode_chunk_cache_nslots(const void **_pp, void *_value) uint64_t enc_value; /* Decoded property value */ unsigned enc_size; /* Size of encoded property */ - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); @@ -987,7 +987,7 @@ H5P__encode_chunk_cache_nbytes(const void *value, void **_pp, size_t *size) uint8_t **pp = (uint8_t **)_pp; unsigned enc_size; /* Size of encoded property */ - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); @@ -1001,7 +1001,7 @@ H5P__encode_chunk_cache_nbytes(const void *value, void **_pp, size_t *size) } /* end if */ else { enc_value = (uint64_t)*(const size_t *)value; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size > 0); *size += (1 + enc_size); } /* end else */ @@ -1043,7 +1043,7 @@ H5P__decode_chunk_cache_nbytes(const void **_pp, void *_value) uint64_t enc_value; /* Decoded property value */ unsigned enc_size; /* Size of encoded property */ - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 064a9b8..d8b0218 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1029,7 +1029,7 @@ H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) /* Encode the size of a size_t */ enc_value = (uint64_t)dt_size; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); /* Encode the size */ @@ -1058,7 +1058,7 @@ H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) if(H5T_encode(fill->type, NULL, &dt_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype") enc_value = (uint64_t)dt_size; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); } *size += (1 + enc_size); *size += dt_size; @@ -1414,7 +1414,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) if(NULL != *pp) { /* Encode number of slots used */ enc_value = (uint64_t)efl->nused; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1424,7 +1424,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) /* Calculate length of slot name and encode it */ len = HDstrlen(efl->slot[u].name) + 1; enc_value = (uint64_t)len; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1435,14 +1435,14 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) /* Encode offset */ enc_value = (uint64_t)efl->slot[u].offset; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); /* encode size */ enc_value = (uint64_t)efl->slot[u].size; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1450,13 +1450,13 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) } /* end if */ /* Calculate size needed for encoding */ - *size += (1 + H5VM_limit_enc_size((uint64_t)efl->nused)); + *size += (1 + H5VM__limit_enc_size((uint64_t)efl->nused)); for(u = 0; u < efl->nused; u++) { len = HDstrlen(efl->slot[u].name) + 1; - *size += (1 + H5VM_limit_enc_size((uint64_t)len)); + *size += (1 + H5VM__limit_enc_size((uint64_t)len)); *size += len; - *size += (1 + H5VM_limit_enc_size((uint64_t)efl->slot[u].offset)); - *size += (1 + H5VM_limit_enc_size((uint64_t)efl->slot[u].size)); + *size += (1 + H5VM__limit_enc_size((uint64_t)efl->slot[u].offset)); + *size += (1 + H5VM__limit_enc_size((uint64_t)efl->slot[u].size)); } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) @@ -1847,13 +1847,6 @@ H5P__init_def_layout(void) * Programmer: Robb Matzke * Tuesday, January 6, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. - * *------------------------------------------------------------------------- */ herr_t @@ -1928,13 +1921,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and get property for - * generic property list. - * *------------------------------------------------------------------------- */ H5D_layout_t @@ -1978,13 +1964,6 @@ done: * Programmer: Robb Matzke * Tuesday, January 6, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. - * *------------------------------------------------------------------------- */ herr_t @@ -2060,13 +2039,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. - * *------------------------------------------------------------------------- */ int @@ -2828,13 +2800,6 @@ done: * Programmer: Robb Matzke * Tuesday, March 3, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. - * *------------------------------------------------------------------------- */ int @@ -2885,13 +2850,6 @@ done: * Programmer: Robb Matzke * Tuesday, March 3, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and get property for - * generic property list. - * *------------------------------------------------------------------------- */ herr_t @@ -3013,8 +2971,6 @@ done: * Programmer: Kent Yang * Wednesday, November 13, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3058,9 +3014,6 @@ done: * Programmer: Xiaowen Wu * Wednesday, December 22, 2004 * - * Modifications: - * - * *------------------------------------------------------------------------- */ herr_t @@ -3120,9 +3073,6 @@ done: * Programmer: Xiaowen Wu * Thursday, April 14, 2005 * - * Modifications: - * - * *------------------------------------------------------------------------- */ herr_t @@ -3526,9 +3476,6 @@ done: * Programmer: Raymond Lu * Wednesday, January 16, 2002 * - * Modifications: - * - * *------------------------------------------------------------------------- */ herr_t @@ -3709,9 +3656,6 @@ done: * Programmer: Raymond Lu * Wednesday, January 16, 2002 * - * Modifications: - * - * *------------------------------------------------------------------------- */ herr_t @@ -3760,8 +3704,6 @@ done: * Programmer: Jacob Smith * 2018 August 14 * - * Modifications: None. - * *----------------------------------------------------------------------------- */ herr_t @@ -3807,8 +3749,6 @@ done: * Programmer: Jacob Smith * 2018 August 14 * - * Modifications: None. - * *----------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c index b9efaee..88ebec1 100644 --- a/src/H5Pdeprec.c +++ b/src/H5Pdeprec.c @@ -15,7 +15,7 @@ * * Created: H5Pdeprec.c * October 11 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Deprecated functions from the H5P interface. These * functions are here for compatibility purposes and may be diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 3f5754e..f416eff 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -15,7 +15,7 @@ * * Created: H5Pdxpl.c * March 16 1998 - * Robb Matzke + * Robb Matzke * * Purpose: Data transfer property list class routines * @@ -685,7 +685,7 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size) /* encode the length of the prefix */ enc_value = (uint64_t)len; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -702,7 +702,7 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size) } /* end if */ /* Size of encoded data transform */ - *size += (1 + H5VM_limit_enc_size((uint64_t)len)); + *size += (1 + H5VM__limit_enc_size((uint64_t)len)); if(NULL != pexp) *size += len; @@ -770,7 +770,7 @@ done: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Leon Arber larber@uiuc.edu + * Programmer: Leon Arber * * Date: April 9, 2004 * @@ -801,7 +801,7 @@ done: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Leon Arber larber@uiuc.edu + * Programmer: Leon Arber * * Date: April 9, 2004 * @@ -887,7 +887,7 @@ done: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Leon Arber larber@uiuc.edu + * Programmer: Leon Arber * * Date: April 9, 2004 * @@ -1297,8 +1297,6 @@ done: * Programmer: Raymond Lu * Jan 14, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -1339,8 +1337,6 @@ done: * Programmer: Raymond Lu * April 15, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -1381,8 +1377,6 @@ done: * Programmer: Raymond Lu * April 15, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index d4b6b5f..32824b7 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * * Purpose: Generic Property Functions */ @@ -94,7 +94,7 @@ H5P__encode_size_t(const void *value, void **_pp, size_t *size) { uint64_t enc_value = (uint64_t)*(const size_t *)value; /* Property value to encode */ uint8_t **pp = (uint8_t **)_pp; - unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */ + unsigned enc_size = H5VM__limit_enc_size(enc_value); /* Size of encoded property */ FUNC_ENTER_PACKAGE_NOERR @@ -135,7 +135,7 @@ herr_t H5P__encode_hsize_t(const void *value, void **_pp, size_t *size) { uint64_t enc_value = (uint64_t)*(const hsize_t *)value; /* Property value to encode */ - unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */ + unsigned enc_size = H5VM__limit_enc_size(enc_value); /* Size of encoded property */ uint8_t **pp = (uint8_t **)_pp; FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 30b590f..baad470 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -204,12 +204,12 @@ /* Definition for 'mdc log location' flag */ #define H5F_ACS_MDC_LOG_LOCATION_SIZE sizeof(char *) #define H5F_ACS_MDC_LOG_LOCATION_DEF NULL /* default is no log location */ -#define H5F_ACS_MDC_LOG_LOCATION_ENC H5P_facc_mdc_log_location_enc -#define H5F_ACS_MDC_LOG_LOCATION_DEC H5P_facc_mdc_log_location_dec -#define H5F_ACS_MDC_LOG_LOCATION_DEL H5P_facc_mdc_log_location_del -#define H5F_ACS_MDC_LOG_LOCATION_COPY H5P_facc_mdc_log_location_copy -#define H5F_ACS_MDC_LOG_LOCATION_CMP H5P_facc_mdc_log_location_cmp -#define H5F_ACS_MDC_LOG_LOCATION_CLOSE H5P_facc_mdc_log_location_close +#define H5F_ACS_MDC_LOG_LOCATION_ENC H5P__facc_mdc_log_location_enc +#define H5F_ACS_MDC_LOG_LOCATION_DEC H5P__facc_mdc_log_location_dec +#define H5F_ACS_MDC_LOG_LOCATION_DEL H5P__facc_mdc_log_location_del +#define H5F_ACS_MDC_LOG_LOCATION_COPY H5P__facc_mdc_log_location_copy +#define H5F_ACS_MDC_LOG_LOCATION_CMP H5P__facc_mdc_log_location_cmp +#define H5F_ACS_MDC_LOG_LOCATION_CLOSE H5P__facc_mdc_log_location_close /* Definition for 'start metadata cache logging on access' flag */ #define H5F_ACS_START_MDC_LOG_ON_ACCESS_SIZE sizeof(hbool_t) #define H5F_ACS_START_MDC_LOG_ON_ACCESS_DEF FALSE @@ -331,12 +331,12 @@ static herr_t H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *s static herr_t H5P__facc_libver_type_dec(const void **_pp, void *value); /* Metadata cache log location property callbacks */ -static herr_t H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size); -static herr_t H5P_facc_mdc_log_location_dec(const void **_pp, void *value); -static herr_t H5P_facc_mdc_log_location_del(hid_t prop_id, const char *name, size_t size, void *value); -static herr_t H5P_facc_mdc_log_location_copy(const char *name, size_t size, void *value); -static int H5P_facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t size); -static herr_t H5P_facc_mdc_log_location_close(const char *name, size_t size, void *value); +static herr_t H5P__facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size); +static herr_t H5P__facc_mdc_log_location_dec(const void **_pp, void *value); +static herr_t H5P__facc_mdc_log_location_del(hid_t prop_id, const char *name, size_t size, void *value); +static herr_t H5P__facc_mdc_log_location_copy(const char *name, size_t size, void *value); +static int H5P__facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t size); +static herr_t H5P__facc_mdc_log_location_close(const char *name, size_t size, void *value); /* Metadata cache image property callbacks */ static int H5P__facc_cache_image_config_cmp(const void *_config1, const void *_config2, size_t H5_ATTR_UNUSED size); @@ -732,12 +732,6 @@ done: * Programmer: Robb Matzke * Tuesday, June 9, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed file access property list mechanism to the new - * generic property list. *------------------------------------------------------------------------- */ herr_t @@ -1894,13 +1888,6 @@ done: * Programmer: Quincey Koziol * June, 1999 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -1936,13 +1923,6 @@ done: * Programmer: Quincey Koziol * June, 1999 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -1978,8 +1958,6 @@ done: * Programmer: Raymond Lu * November, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -2014,8 +1992,6 @@ done: * Programmer: Raymond Lu * November, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -2059,13 +2035,6 @@ done: * Programmer: Quincey Koziol * Friday, August 25, 2000 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -2101,13 +2070,6 @@ done: * Programmer: Quincey Koziol * Friday, August 29, 2000 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -2154,13 +2116,6 @@ done: * Programmer: Quincey Koziol * Thursday, September 21, 2000 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -2196,13 +2151,6 @@ done: * Programmer: Quincey Koziol * Thursday, September 21, 2000 * - * Modifications: - * - * Raymond Lu - * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. - * *------------------------------------------------------------------------- */ herr_t @@ -2248,8 +2196,6 @@ done: * Programmer: Quincey Koziol * Wednesday, June 5, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -2285,8 +2231,6 @@ done: * Programmer: Quincey Koziol * Wednesday, June 5, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3531,7 +3475,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->set_initial_size); enc_value = (uint64_t)config->initial_size; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3539,13 +3483,13 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_DOUBLE(*pp, config->min_clean_fraction); enc_value = (uint64_t)config->max_size; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); enc_value = (uint64_t)config->min_size; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3563,7 +3507,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->apply_max_increment); enc_value = (uint64_t)config->max_increment; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3585,7 +3529,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->apply_max_decrement); enc_value = (uint64_t)config->max_decrement; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3606,15 +3550,15 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) /* Compute encoded size of variably-encoded values */ enc_value = (uint64_t)config->initial_size; - *size += 1 + H5VM_limit_enc_size(enc_value); + *size += 1 + H5VM__limit_enc_size(enc_value); enc_value = (uint64_t)config->max_size; - *size += 1 + H5VM_limit_enc_size(enc_value); + *size += 1 + H5VM__limit_enc_size(enc_value); enc_value = (uint64_t)config->min_size; - *size += 1 + H5VM_limit_enc_size(enc_value); + *size += 1 + H5VM__limit_enc_size(enc_value); enc_value = (uint64_t)config->max_increment; - *size += 1 + H5VM_limit_enc_size(enc_value); + *size += 1 + H5VM__limit_enc_size(enc_value); enc_value = (uint64_t)config->max_decrement; - *size += 1 + H5VM_limit_enc_size(enc_value); + *size += 1 + H5VM__limit_enc_size(enc_value); /* Compute encoded size of fixed-size values */ *size += (5 + (sizeof(unsigned) * 8) + (sizeof(double) * 8) + @@ -4047,13 +3991,13 @@ H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts/*out*/) if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* Get the # of read attempts set */ + /* Get the # of read attempts set */ if(H5P_get(plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, attempts) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get the number of metadata read attempts") - /* If not set, return the default value */ - if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ - *attempts = H5F_METADATA_READ_ATTEMPTS; + /* If not set, return the default value */ + if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ + *attempts = H5F_METADATA_READ_ATTEMPTS; } /* end if */ done: @@ -4137,9 +4081,9 @@ H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func, void **udata) /* Assign return value */ if(func) - *func = flush_info.func; + *func = flush_info.func; if(udata) - *udata = flush_info.udata; + *udata = flush_info.udata; done: FUNC_LEAVE_API(ret_value) @@ -4254,7 +4198,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_enc + * Function: H5P__facc_mdc_log_location_enc * * Purpose: Callback routine which is called whenever the metadata * cache log location property in the file access property @@ -4266,7 +4210,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) +H5P__facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) { const char *log_location = *(const char * const *)value; uint8_t **pp = (uint8_t **)_pp; @@ -4274,7 +4218,7 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) uint64_t enc_value; unsigned enc_size; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); @@ -4283,7 +4227,7 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(log_location); enc_value = (uint64_t)len; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { @@ -4303,11 +4247,11 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) *size += len; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P_facc_mdc_log_location_enc() */ +} /* end H5P__facc_mdc_log_location_enc() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_dec + * Function: H5P__facc_mdc_log_location_dec * * Purpose: Callback routine which is called whenever the metadata * cache log location property in the file access property @@ -4319,7 +4263,7 @@ H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_dec(const void **_pp, void *_value) +H5P__facc_mdc_log_location_dec(const void **_pp, void *_value) { char **log_location = (char **)_value; const uint8_t **pp = (const uint8_t **)_pp; @@ -4328,7 +4272,7 @@ H5P_facc_mdc_log_location_dec(const void **_pp, void *_value) unsigned enc_size; /* Size of encoded property */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(pp); HDassert(*pp); @@ -4357,11 +4301,11 @@ H5P_facc_mdc_log_location_dec(const void **_pp, void *_value) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_facc_mdc_log_location_dec() */ +} /* end H5P__facc_mdc_log_location_dec() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_del + * Function: H5P__facc_mdc_log_location_del * * Purpose: Frees memory used to store the metadata cache log location. * @@ -4370,21 +4314,21 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, +H5P__facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); H5MM_xfree(*(void **)value); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P_facc_mdc_log_location_del() */ +} /* end H5P__facc_mdc_log_location_del() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_copy + * Function: H5P__facc_mdc_log_location_copy * * Purpose: Creates a copy of the metadata cache log location string. * @@ -4393,20 +4337,20 @@ H5P_facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_U *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) +H5P__facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); *(char **)value = H5MM_xstrdup(*(const char **)value); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P_facc_mdc_log_location_copy() */ +} /* end H5P__facc_mdc_log_location_copy() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_cmp + * Function: H5P__facc_mdc_log_location_cmp * * Purpose: Callback routine which is called whenever the metadata * cache log location property in the file creation property @@ -4416,14 +4360,14 @@ H5P_facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_U * *------------------------------------------------------------------------- */ -static int -H5P_facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t H5_ATTR_UNUSED size) +static H5_ATTR_PURE int +H5P__facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t H5_ATTR_UNUSED size) { const char *pref1 = *(const char * const *)value1; const char *pref2 = *(const char * const *)value2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(NULL == pref1 && NULL != pref2) HGOTO_DONE(1); @@ -4434,11 +4378,11 @@ H5P_facc_mdc_log_location_cmp(const void *value1, const void *value2, size_t H5_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_facc_mdc_log_location_cmp() */ +} /* end H5P__facc_mdc_log_location_cmp() */ /*------------------------------------------------------------------------- - * Function: H5P_facc_mdc_log_location_close + * Function: H5P__facc_mdc_log_location_close * * Purpose: Frees memory used to store the metadata cache log location * string @@ -4448,16 +4392,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) +H5P__facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(value); H5MM_xfree(*(void **)value); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5P_facc_mdc_log_location_close() */ +} /* end H5P__facc_mdc_log_location_close() */ /*------------------------------------------------------------------------- diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index 3b0ce66..db80f19 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -15,7 +15,7 @@ * * Created: H5Pfcpl.c * January 6 1998 - * Robb Matzke + * Robb Matzke * * Purpose: File creation property list class routines * @@ -128,7 +128,7 @@ /********************/ /* Property class callbacks */ -static herr_t H5P_fcrt_reg_prop(H5P_genclass_t *pclass); +static herr_t H5P__fcrt_reg_prop(H5P_genclass_t *pclass); /* property callbacks */ static herr_t H5P__fcrt_btree_rank_enc(const void *value, void **_pp, size_t *size); @@ -154,7 +154,7 @@ const H5P_libclass_t H5P_CLS_FCRT[1] = {{ &H5P_CLS_FILE_CREATE_g, /* Pointer to class */ &H5P_CLS_FILE_CREATE_ID_g, /* Pointer to class ID */ &H5P_LST_FILE_CREATE_ID_g, /* Pointer to default property list ID */ - H5P_fcrt_reg_prop, /* Default property registration routine */ + H5P__fcrt_reg_prop, /* Default property registration routine */ NULL, /* Class creation callback */ NULL, /* Class creation callback info */ @@ -194,7 +194,7 @@ static const hsize_t H5F_def_file_space_page_size_g = H5F_CRT_FILE_SPACE_PAGE_SI /*------------------------------------------------------------------------- - * Function: H5P_fcrt_reg_prop + * Function: H5P__fcrt_reg_prop * * Purpose: Register the file creation property list class's properties * @@ -205,11 +205,11 @@ static const hsize_t H5F_def_file_space_page_size_g = H5F_CRT_FILE_SPACE_PAGE_SI *------------------------------------------------------------------------- */ static herr_t -H5P_fcrt_reg_prop(H5P_genclass_t *pclass) +H5P__fcrt_reg_prop(H5P_genclass_t *pclass) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Register the user block size */ if(H5P__register_real(pclass, H5F_CRT_USER_BLOCK_NAME, H5F_CRT_USER_BLOCK_SIZE, &H5F_def_userblock_size_g, @@ -297,7 +297,7 @@ H5P_fcrt_reg_prop(H5P_genclass_t *pclass) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_fcrt_reg_prop() */ +} /* end H5P__fcrt_reg_prop() */ /*------------------------------------------------------------------------- @@ -359,11 +359,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * - * Raymond Lu, Oct 14, 2001 - * Changed to the new generic property list. - * *------------------------------------------------------------------------- */ herr_t @@ -517,11 +512,6 @@ done: * Programmer: Robb Matzke * Tuesday, January 6, 1998 * - * Modifications: - * - * Raymond Lu, Oct 14, 2001 - * Changed to the new generic property list. - * *------------------------------------------------------------------------- */ herr_t @@ -571,11 +561,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * - * Raymond Lu - * Changed to the new generic property list. - * *------------------------------------------------------------------------- */ herr_t @@ -619,11 +604,6 @@ done: * Programmer: Robb Matzke * Tuesday, January 6, 1998 * - * Modifications: - * - * Raymond Lu, Oct 14, 2001 - * Changed to the new generic property list. - * *------------------------------------------------------------------------- */ herr_t @@ -673,11 +653,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * - * Raymond Lu, Oct 14, 2001 - * Changed to the new generic property list. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Pfmpl.c b/src/H5Pfmpl.c index 41ad078..a0a6d35 100644 --- a/src/H5Pfmpl.c +++ b/src/H5Pfmpl.c @@ -15,7 +15,7 @@ * * Created: H5Pmtpl.c * November 1 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: File mount property list class routines * @@ -64,7 +64,7 @@ /********************/ /* Property class callbacks */ -static herr_t H5P_fmnt_reg_prop(H5P_genclass_t *pclass); +static herr_t H5P__fmnt_reg_prop(H5P_genclass_t *pclass); /*********************/ @@ -80,7 +80,7 @@ const H5P_libclass_t H5P_CLS_FMNT[1] = {{ &H5P_CLS_FILE_MOUNT_g, /* Pointer to class */ &H5P_CLS_FILE_MOUNT_ID_g, /* Pointer to class ID */ &H5P_LST_FILE_MOUNT_ID_g, /* Pointer to default property list ID */ - H5P_fmnt_reg_prop, /* Default property registration routine */ + H5P__fmnt_reg_prop, /* Default property registration routine */ NULL, /* Class creation callback */ NULL, /* Class creation callback info */ @@ -106,7 +106,7 @@ static const hbool_t H5F_def_local_g = H5F_MNT_SYM_LOCAL_DEF; /* Whether sy /*------------------------------------------------------------------------- - * Function: H5P_fmnt_reg_prop + * Function: H5P__fmnt_reg_prop * * Purpose: Register the file mount property list class's properties * @@ -117,11 +117,11 @@ static const hbool_t H5F_def_local_g = H5F_MNT_SYM_LOCAL_DEF; /* Whether sy *------------------------------------------------------------------------- */ static herr_t -H5P_fmnt_reg_prop(H5P_genclass_t *pclass) +H5P__fmnt_reg_prop(H5P_genclass_t *pclass) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Register property of whether symlinks is local to file */ if(H5P__register_real(pclass, H5F_MNT_SYM_LOCAL_NAME, H5F_MNT_SYM_LOCAL_SIZE, &H5F_def_local_g, @@ -130,5 +130,5 @@ H5P_fmnt_reg_prop(H5P_genclass_t *pclass) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_fmnt_reg_prop() */ +} /* end H5P__fmnt_reg_prop() */ diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index 03874c8..107ca15 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -15,7 +15,7 @@ * * Created: H5Pgcpl.c * August 29 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Group creation property list class routines * diff --git a/src/H5Pint.c b/src/H5Pint.c index 2e463b2..4d73083 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * * Purpose: Generic Property Functions */ @@ -5604,7 +5604,7 @@ done: * Return: Success: Non-negative ID of property list. * Failure: H5I_INVALID_HID * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * April 22, 2014 * *------------------------------------------------------------------------- @@ -5632,7 +5632,7 @@ H5P_get_plist_id(const H5P_genplist_t *plist) * Return: Success: Non-NULL class of property list. * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * April 22, 2014 * *------------------------------------------------------------------------- diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 8fdcc8b..72c60b4 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -15,7 +15,7 @@ * * Created: H5Plapl.c * July 14 2006 - * James Laird + * James Laird * * Purpose: Link access property list class routines * @@ -373,7 +373,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) /* encode the length of the plist */ enc_value = (uint64_t)fapl_size; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -384,7 +384,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) *pp += fapl_size; } - fapl_size += (1 + H5VM_limit_enc_size((uint64_t)fapl_size)); + fapl_size += (1 + H5VM__limit_enc_size((uint64_t)fapl_size)); } /* end if */ *size += (1 + fapl_size); /* Non-default flag, plus encoded property list size */ @@ -705,7 +705,7 @@ H5P__lacc_elink_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(elink_pref); enc_value = (uint64_t)len; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { diff --git a/src/H5Plcpl.c b/src/H5Plcpl.c index 9c32552..2c8e364 100644 --- a/src/H5Plcpl.c +++ b/src/H5Plcpl.c @@ -64,7 +64,7 @@ /********************/ /* Property class callbacks */ -static herr_t H5P_lcrt_reg_prop(H5P_genclass_t *pclass); +static herr_t H5P__lcrt_reg_prop(H5P_genclass_t *pclass); /*********************/ @@ -80,7 +80,7 @@ const H5P_libclass_t H5P_CLS_LCRT[1] = {{ &H5P_CLS_LINK_CREATE_g, /* Pointer to class */ &H5P_CLS_LINK_CREATE_ID_g, /* Pointer to class ID */ &H5P_LST_LINK_CREATE_ID_g, /* Pointer to default property list ID */ - H5P_lcrt_reg_prop, /* Default property registration routine */ + H5P__lcrt_reg_prop, /* Default property registration routine */ NULL, /* Class creation callback */ NULL, /* Class creation callback info */ @@ -106,7 +106,7 @@ static const unsigned H5L_def_intmd_group_g = H5L_CRT_INTERMEDIATE_GROUP_DEF; /*------------------------------------------------------------------------- - * Function: H5P_lcrt_reg_prop + * Function: H5P__lcrt_reg_prop * * Purpose: Register the dataset creation property list class's properties * @@ -116,12 +116,12 @@ static const unsigned H5L_def_intmd_group_g = H5L_CRT_INTERMEDIATE_GROUP_DEF; * October 31, 2006 *------------------------------------------------------------------------- */ -herr_t -H5P_lcrt_reg_prop(H5P_genclass_t *pclass) +static herr_t +H5P__lcrt_reg_prop(H5P_genclass_t *pclass) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Register create intermediate groups property */ if(H5P__register_real(pclass, H5L_CRT_INTERMEDIATE_GROUP_NAME, H5L_CRT_INTERMEDIATE_GROUP_SIZE, &H5L_def_intmd_group_g, @@ -131,7 +131,7 @@ H5P_lcrt_reg_prop(H5P_genclass_t *pclass) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_lcrt_reg_prop() */ +} /* end H5P__lcrt_reg_prop() */ /*------------------------------------------------------------------------- diff --git a/src/H5Pmodule.h b/src/H5Pmodule.h index d5c471a..11df06d 100644 --- a/src/H5Pmodule.h +++ b/src/H5Pmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index a60c593..b053895 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -15,7 +15,7 @@ * * Created: H5Pocpl.c * Nov 28 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Object creation property list class routines * @@ -581,13 +581,6 @@ done: * Programmer: Quincey Koziol * Friday, April 5, 2003 * - * Modifications: - * - * Neil Fortner - * Thursday, March 26, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ herr_t @@ -652,18 +645,6 @@ done: * Programmer: Robb Matzke * Wednesday, April 15, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. - * - * Neil Fortner - * Wednesday, May 20, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ herr_t @@ -781,13 +762,6 @@ done: * Programmer: Robb Matzke * Tuesday, August 4, 1998 * - * Modifications: - * - * Neil Fortner - * Wednesday, May 20, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ int @@ -838,13 +812,6 @@ done: * Programmer: Robb Matzke * Wednesday, April 15, 1998 * - * Modifications: - * - * Neil Fortner - * Wednesday, May 20, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ H5Z_filter_t @@ -980,13 +947,6 @@ done: * Programmer: Quincey Koziol * Friday, April 5, 2003 * - * Modifications: - * - * Neil Fortner - * Thursday, May 21, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ herr_t @@ -1049,13 +1009,6 @@ done: * Programmer: Quincey Koziol * Tuesday, April 8, 2003 * - * Modifications: - * - * Neil Fortner - * Thursday, May 21, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ htri_t @@ -1132,13 +1085,6 @@ done: * Programmer: Pedro Vicente * January 26, 2004 * - * Modifications: - * - * Neil Fortner - * Thursday, May 21, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ herr_t @@ -1191,18 +1137,6 @@ done: * Programmer: Robb Matzke * Wednesday, April 15, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. - * - * Neil Fortner - * Thursday, March 26, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ herr_t @@ -1251,13 +1185,6 @@ done: * Programmer: Raymond Lu * Dec 19, 2002 * - * Modifications: - * - * Neil Fortner - * Wednesday, May 6, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ herr_t @@ -1480,7 +1407,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* encode nused value */ enc_value = (uint64_t)pline->nused; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1510,7 +1437,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* encode cd_nelmts */ enc_value = (uint64_t)pline->filter[u].cd_nelmts; - enc_size = H5VM_limit_enc_size(enc_value); + enc_size = H5VM__limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1523,12 +1450,12 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* calculate size required for encoding */ *size += 1; - *size += (1 + H5VM_limit_enc_size((uint64_t)pline->nused)); + *size += (1 + H5VM__limit_enc_size((uint64_t)pline->nused)); for(u = 0; u < pline->nused; u++) { *size += (sizeof(int32_t) + sizeof(unsigned) + 1); if(NULL != pline->filter[u].name) *size += H5Z_COMMON_NAME_LEN; - *size += (1 + H5VM_limit_enc_size((uint64_t)pline->filter[u].cd_nelmts)); + *size += (1 + H5VM__limit_enc_size((uint64_t)pline->filter[u].cd_nelmts)); *size += pline->filter[u].cd_nelmts * sizeof(unsigned); } /* end for */ diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index 7390cae..d23585c 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -15,7 +15,7 @@ * * Created: H5Pocpypl.c * Mar 13 2006 - * Peter Cao + * Peter Cao * * Purpose: Object copying property list class routines * diff --git a/src/H5Ppkg.h b/src/H5Ppkg.h index c8e5e98..2a52cc5 100644 --- a/src/H5Ppkg.h +++ b/src/H5Ppkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, November 16, 2001 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5Pstrcpl.c b/src/H5Pstrcpl.c index 97d6119..6371862 100644 --- a/src/H5Pstrcpl.c +++ b/src/H5Pstrcpl.c @@ -15,7 +15,7 @@ * * Created: H5Pstrcpl.c * October 26 2005 - * James Laird + * James Laird * * Purpose: String creation property list class routines * diff --git a/src/H5Ptest.c b/src/H5Ptest.c index 303fbf7..6bec415 100644 --- a/src/H5Ptest.c +++ b/src/H5Ptest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Saturday May 31, 2003 * * Purpose: Generic Property Testing Functions diff --git a/src/H5RS.c b/src/H5RS.c index ae500c5..6459f0d 100644 --- a/src/H5RS.c +++ b/src/H5RS.c @@ -39,11 +39,11 @@ H5FL_BLK_DEFINE(str_buf); /*-------------------------------------------------------------------------- NAME - H5RS_xstrdup + H5RS__xstrdup PURPOSE Duplicate the string being reference counted USAGE - char *H5RS_xstrdup(s) + char *H5RS__xstrdup(s) const char *s; IN: String to duplicate RETURNS @@ -57,11 +57,11 @@ H5FL_BLK_DEFINE(str_buf); REVISION LOG --------------------------------------------------------------------------*/ static char * -H5RS_xstrdup(const char *s) +H5RS__xstrdup(const char *s) { char *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(s) { size_t len = HDstrlen(s) + 1; @@ -74,7 +74,7 @@ H5RS_xstrdup(const char *s) ret_value = NULL; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5RS_xstrdup() */ +} /* end H5RS__xstrdup() */ /*-------------------------------------------------------------------------- @@ -108,7 +108,7 @@ H5RS_create(const char *s) HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") /* Set the internal fields */ - ret_value->s = H5RS_xstrdup(s); + ret_value->s = H5RS__xstrdup(s); ret_value->wrapped = 0; ret_value->n = 1; @@ -270,7 +270,7 @@ H5RS_incr(H5RS_str_t *rs) * scope appropriately. */ if(rs->wrapped) { - rs->s = H5RS_xstrdup(rs->s); + rs->s = H5RS__xstrdup(rs->s); rs->wrapped = 0; } /* end if */ diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index 4e44683..f48af51 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -66,6 +66,8 @@ /********************/ /* Local Prototypes */ /********************/ +static herr_t H5R__encode_token_region_compat(H5F_t *f, const H5O_token_t *obj_token, size_t token_size, H5S_t *space, unsigned char *buf, size_t *nalloc); +static herr_t H5R__decode_token_compat(H5VL_object_t *vol_obj, H5I_type_t type, H5R_type_t ref_type, const unsigned char *buf, H5O_token_t *obj_token); /*********************/ @@ -82,9 +84,157 @@ /* Local Variables */ /*******************/ -#ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- + * Function: H5R__decode_token_compat + * + * Purpose: Decode an object token. (native only) + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +H5R__decode_token_compat(H5VL_object_t *vol_obj, H5I_type_t type, H5R_type_t ref_type, + const unsigned char *buf, H5O_token_t *obj_token) +{ + hid_t file_id = H5I_INVALID_HID; /* File ID for region reference */ + H5VL_object_t *vol_obj_file = NULL; + H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0}; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + +#ifndef NDEBUG + { + hbool_t is_native = FALSE; /* Whether the src file is using the native VOL connector */ + + /* Check if using native VOL connector */ + if(H5VL_object_is_native(vol_obj, &is_native) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't query if file uses native VOL connector") + + /* Must use native VOL connector for this operation */ + HDassert(is_native); + } +#endif /* NDEBUG */ + + /* Get the file for the object */ + if((file_id = H5F_get_file_id(vol_obj, type, FALSE)) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + + /* Retrieve VOL object */ + if(NULL == (vol_obj_file = H5VL_vol_object(file_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + + /* Get container info */ + if(H5VL_file_get((const H5VL_object_t *)vol_obj_file, H5VL_FILE_GET_CONT_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &cont_info) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to get container info") + + if(ref_type == H5R_OBJECT1) { + size_t buf_size = H5R_OBJ_REF_BUF_SIZE; + + /* Get object address */ + if(H5R__decode_token_obj_compat(buf, &buf_size, obj_token, cont_info.token_size) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "unable to get object token") + } /* end if */ + else { + size_t buf_size = H5R_DSET_REG_REF_BUF_SIZE; + H5F_t *f = NULL; + + /* Retrieve file from VOL object */ + if(NULL == (f = (H5F_t *)H5VL_object_data((const H5VL_object_t *)vol_obj_file))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid VOL object") + + /* Get object address */ + if(H5R__decode_token_region_compat(f, buf, &buf_size, obj_token, cont_info.token_size, NULL) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "unable to get object address") + } /* end else */ + +done: + if(file_id != H5I_INVALID_HID && H5I_dec_ref(file_id) < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "unable to decrement refcount on file") + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5R__decode_token_compat() */ + + +/*------------------------------------------------------------------------- + * Function: H5R__encode_token_region_compat + * + * Purpose: Encode dataset selection and insert data into heap + * (native only). + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +H5R__encode_token_region_compat(H5F_t *f, const H5O_token_t *obj_token, + size_t token_size, H5S_t *space, unsigned char *buf, size_t *nalloc) +{ + size_t buf_size; + unsigned char *data = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_STATIC + + HDassert(f); + HDassert(obj_token); + HDassert(token_size); + HDassert(space); + HDassert(nalloc); + + /* Get required buffer size */ + if(H5R__encode_heap(f, NULL, &buf_size, NULL, (size_t)0) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + + if(buf && *nalloc >= buf_size) { + ssize_t data_size; + uint8_t *p; + + /* Pass the correct encoding version for the selection depending on the + * file libver bounds, this is later retrieved in H5S hyper encode */ + H5CX_set_libver_bounds(f); + + /* Zero the heap ID out, may leak heap space if user is re-using + * reference and doesn't have garbage collection turned on + */ + HDmemset(buf, 0, buf_size); + + /* Get the amount of space required to serialize the selection */ + if((data_size = H5S_SELECT_SERIAL_SIZE(space)) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "Invalid amount of space for serializing selection") + + /* Increase buffer size to allow for the dataset token */ + data_size += (hssize_t)token_size; + + /* Allocate the space to store the serialized information */ + H5_CHECK_OVERFLOW(data_size, hssize_t, size_t); + if(NULL == (data = (uint8_t *)H5MM_malloc((size_t)data_size))) + HGOTO_ERROR(H5E_REFERENCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Serialize information for dataset OID into heap buffer */ + p = (uint8_t *)data; + H5MM_memcpy(p, obj_token, token_size); + p += token_size; + + /* Serialize the selection into heap buffer */ + if(H5S_SELECT_SERIALIZE(space, &p) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Unable to serialize selection") + + /* Write to heap */ + if(H5R__encode_heap(f, buf, nalloc, data, (size_t)data_size) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") + } + *nalloc = buf_size; + +done: + H5MM_free(data); + FUNC_LEAVE_NOAPI(ret_value) +} /* H5R__encode_token_region_compat() */ + + +#ifndef H5_NO_DEPRECATED_SYMBOLS +/*------------------------------------------------------------------------- * Function: H5Rget_obj_type1 * * Purpose: Retrieves the type of the object that a reference points to. diff --git a/src/H5Rint.c b/src/H5Rint.c index 0acc887..83177d6 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -1499,123 +1499,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5R__free_heap - * - * Purpose: Remove data previously inserted into heap (native only). - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -herr_t -H5R__free_heap(H5F_t *f, const unsigned char *buf, size_t nbytes) -{ - H5HG_t hobjid; - const uint8_t *p = (const uint8_t *)buf; - size_t buf_size; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_PACKAGE - - HDassert(f); - HDassert(buf); - - buf_size = H5HG_HEAP_ID_SIZE(f); - /* Don't decode if buffer size isn't big enough */ - if(nbytes < buf_size) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small") - - /* Get the heap information */ - H5F_addr_decode(f, &p, &(hobjid.addr)); - if(!H5F_addr_defined(hobjid.addr) || hobjid.addr == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Undefined reference pointer") - UINT32DECODE(p, hobjid.idx); - - /* Free heap object */ - if(hobjid.addr > 0) { - /* Free heap object */ - if(H5HG_remove(f, &hobjid) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_WRITEERROR, FAIL, "Unable to remove heap object") - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R__free_heap() */ - - -/*------------------------------------------------------------------------- - * Function: H5R__decode_token_compat - * - * Purpose: Decode an object token. (native only) - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -herr_t -H5R__decode_token_compat(H5VL_object_t *vol_obj, H5I_type_t type, H5R_type_t ref_type, - const unsigned char *buf, H5O_token_t *obj_token) -{ - hid_t file_id = H5I_INVALID_HID; /* File ID for region reference */ - H5VL_object_t *vol_obj_file = NULL; - H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0}; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_PACKAGE - -#ifndef NDEBUG - { - hbool_t is_native = FALSE; /* Whether the src file is using the native VOL connector */ - - /* Check if using native VOL connector */ - if(H5VL_object_is_native(vol_obj, &is_native) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't query if file uses native VOL connector") - - /* Must use native VOL connector for this operation */ - HDassert(is_native); - } -#endif /* NDEBUG */ - - /* Get the file for the object */ - if((file_id = H5F_get_file_id(vol_obj, type, FALSE)) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") - - /* Retrieve VOL object */ - if(NULL == (vol_obj_file = H5VL_vol_object(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") - - /* Get container info */ - if(H5VL_file_get((const H5VL_object_t *)vol_obj_file, H5VL_FILE_GET_CONT_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &cont_info) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to get container info") - - if(ref_type == H5R_OBJECT1) { - size_t buf_size = H5R_OBJ_REF_BUF_SIZE; - - /* Get object address */ - if(H5R__decode_token_obj_compat(buf, &buf_size, obj_token, cont_info.token_size) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "unable to get object token") - } /* end if */ - else { - size_t buf_size = H5R_DSET_REG_REF_BUF_SIZE; - H5F_t *f = NULL; - - /* Retrieve file from VOL object */ - if(NULL == (f = (H5F_t *)H5VL_object_data((const H5VL_object_t *)vol_obj_file))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid VOL object") - - /* Get object address */ - if(H5R__decode_token_region_compat(f, buf, &buf_size, obj_token, cont_info.token_size, NULL) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "unable to get object address") - } /* end else */ - -done: - if(file_id != H5I_INVALID_HID && H5I_dec_ref(file_id) < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "unable to decrement refcount on file") - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R__decode_token_compat() */ - - -/*------------------------------------------------------------------------- * Function: H5R__encode_token_obj_compat * * Purpose: Encode an object token. (native only) @@ -1682,82 +1565,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5R__encode_token_region_compat - * - * Purpose: Encode dataset selection and insert data into heap - * (native only). - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -herr_t -H5R__encode_token_region_compat(H5F_t *f, const H5O_token_t *obj_token, - size_t token_size, H5S_t *space, unsigned char *buf, size_t *nalloc) -{ - size_t buf_size; - unsigned char *data = NULL; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_PACKAGE - - HDassert(f); - HDassert(obj_token); - HDassert(token_size); - HDassert(space); - HDassert(nalloc); - - /* Get required buffer size */ - if(H5R__encode_heap(f, NULL, &buf_size, NULL, (size_t)0) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") - - if(buf && *nalloc >= buf_size) { - ssize_t data_size; - uint8_t *p; - - /* Pass the correct encoding version for the selection depending on the - * file libver bounds, this is later retrieved in H5S hyper encode */ - H5CX_set_libver_bounds(f); - - /* Zero the heap ID out, may leak heap space if user is re-using - * reference and doesn't have garbage collection turned on - */ - HDmemset(buf, 0, buf_size); - - /* Get the amount of space required to serialize the selection */ - if((data_size = H5S_SELECT_SERIAL_SIZE(space)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "Invalid amount of space for serializing selection") - - /* Increase buffer size to allow for the dataset token */ - data_size += (hssize_t)token_size; - - /* Allocate the space to store the serialized information */ - H5_CHECK_OVERFLOW(data_size, hssize_t, size_t); - if(NULL == (data = (uint8_t *)H5MM_malloc((size_t)data_size))) - HGOTO_ERROR(H5E_REFERENCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Serialize information for dataset OID into heap buffer */ - p = (uint8_t *)data; - H5MM_memcpy(p, obj_token, token_size); - p += token_size; - - /* Serialize the selection into heap buffer */ - if(H5S_SELECT_SERIALIZE(space, &p) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Unable to serialize selection") - - /* Write to heap */ - if(H5R__encode_heap(f, buf, nalloc, data, (size_t)data_size) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") - } - *nalloc = buf_size; - -done: - H5MM_free(data); - FUNC_LEAVE_NOAPI(ret_value) -} /* H5R__encode_token_region_compat() */ - - -/*------------------------------------------------------------------------- * Function: H5R__decode_token_region_compat * * Purpose: Decode dataset selection from data inserted into heap diff --git a/src/H5Rpkg.h b/src/H5Rpkg.h index 36cf805..c475951 100644 --- a/src/H5Rpkg.h +++ b/src/H5Rpkg.h @@ -116,14 +116,10 @@ H5_DLL herr_t H5R__decode(const unsigned char *buf, size_t *nbytes, H5R_ref_pr /* Native HDF5 specific routines */ H5_DLL herr_t H5R__encode_heap(H5F_t *f, unsigned char *buf, size_t *nalloc, const unsigned char *data, size_t data_size); H5_DLL herr_t H5R__decode_heap(H5F_t *f, const unsigned char *buf, size_t *nbytes, unsigned char **data_ptr, size_t *data_size); -H5_DLL herr_t H5R__free_heap(H5F_t *f, const unsigned char *buf, size_t nbytes); - -H5_DLL herr_t H5R__decode_token_compat(H5VL_object_t *vol_obj, H5I_type_t type, H5R_type_t ref_type, const unsigned char *buf, H5O_token_t *obj_token); H5_DLL herr_t H5R__encode_token_obj_compat(const H5O_token_t *obj_token, size_t token_size, unsigned char *buf, size_t *nalloc); H5_DLL herr_t H5R__decode_token_obj_compat(const unsigned char *buf, size_t *nbytes, H5O_token_t *obj_token, size_t token_size); -H5_DLL herr_t H5R__encode_token_region_compat(H5F_t *f, const H5O_token_t *obj_token, size_t token_size, H5S_t *space, unsigned char *buf, size_t *nalloc); H5_DLL herr_t H5R__decode_token_region_compat(H5F_t *f, const unsigned char *buf, size_t *nbytes, H5O_token_t *obj_token, size_t token_size, H5S_t **space_ptr); #endif /* _H5Rpkg_H */ diff --git a/src/H5SL.c b/src/H5SL.c index ff8edb8..4716dc4 100644 --- a/src/H5SL.c +++ b/src/H5SL.c @@ -568,10 +568,10 @@ struct H5SL_t { }; /* Static functions */ -static H5SL_node_t * H5SL_new_node(void *item, const void *key, uint32_t hashval); -static H5SL_node_t *H5SL_insert_common(H5SL_t *slist, void *item, const void *key); -static herr_t H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); -static herr_t H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); +static H5SL_node_t *H5SL__new_node(void *item, const void *key, uint32_t hashval); +static H5SL_node_t *H5SL__insert_common(H5SL_t *slist, void *item, const void *key); +static herr_t H5SL__release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); +static herr_t H5SL__close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data); /* Package initialization variable */ hbool_t H5_PKG_INIT_VAR = FALSE; @@ -642,7 +642,8 @@ H5SL__init_package(void) EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -int H5SL_term_package(void) +int +H5SL_term_package(void) { int n = 0; @@ -682,11 +683,11 @@ int H5SL_term_package(void) /*-------------------------------------------------------------------------- NAME - H5SL_new_node + H5SL__new_node PURPOSE Create a new skip list node of level 0 USAGE - H5SL_node_t *H5SL_new_node(item,key,hasval) + H5SL_node_t *H5SL__new_node(item,key,hasval) void *item; IN: Pointer to item info for node void *key; IN: Pointer to key info for node uint32_t hashval; IN: Hash value for node @@ -703,11 +704,11 @@ int H5SL_term_package(void) REVISION LOG --------------------------------------------------------------------------*/ static H5SL_node_t * -H5SL_new_node(void *item, const void *key, uint32_t hashval) +H5SL__new_node(void *item, const void *key, uint32_t hashval) { H5SL_node_t *ret_value = NULL; /* New skip list node */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Allocate the node */ if(NULL == (ret_value = (H5SL_node_t *)H5FL_MALLOC(H5SL_node_t))) @@ -727,16 +728,16 @@ H5SL_new_node(void *item, const void *key, uint32_t hashval) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SL_new_node() */ +} /* end H5SL__new_node() */ /*-------------------------------------------------------------------------- NAME - H5SL_insert_common + H5SL__insert_common PURPOSE Common code for inserting an object into a skip list USAGE - H5SL_node_t *H5SL_insert_common(slist,item,key) + H5SL_node_t *H5SL__insert_common(slist,item,key) H5SL_t *slist; IN/OUT: Pointer to skip list void *item; IN: Item to insert void *key; IN: Key for item to insert @@ -752,14 +753,14 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static H5SL_node_t * -H5SL_insert_common(H5SL_t *slist, void *item, const void *key) +H5SL__insert_common(H5SL_t *slist, void *item, const void *key) { H5SL_node_t *x; /* Current node to examine */ H5SL_node_t *prev; /* Node before the new node */ uint32_t hashval = 0; /* Hash value for key */ H5SL_node_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(slist); @@ -822,7 +823,7 @@ H5SL_insert_common(H5SL_t *slist, void *item, const void *key) slist->curr_level = 0; /* Create new node of level 0 */ - if(NULL == (x = H5SL_new_node(item, key, hashval))) + if(NULL == (x = H5SL__new_node(item, key, hashval))) HGOTO_ERROR(H5E_SLIST ,H5E_NOSPACE, NULL, "can't create new skip list node") /* Update the links */ @@ -844,16 +845,16 @@ H5SL_insert_common(H5SL_t *slist, void *item, const void *key) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SL_insert_common() */ +} /* end H5SL__insert_common() */ /*-------------------------------------------------------------------------- NAME - H5SL_release_common + H5SL__release_common PURPOSE Release all nodes from a skip list, optionally calling a 'free' operator USAGE - herr_t H5SL_release_common(slist,op,opdata) + herr_t H5SL__release_common(slist,op,opdata) H5SL_t *slist; IN/OUT: Pointer to skip list to release nodes H5SL_operator_t op; IN: Callback function to free item & key void *op_data; IN/OUT: Pointer to application data for callback @@ -872,12 +873,12 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) +H5SL__release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) { H5SL_node_t *node, *next_node; /* Pointers to skip list nodes */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(slist); @@ -917,16 +918,16 @@ H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SL_release_common() */ +} /* end H5SL__release_common() */ /*-------------------------------------------------------------------------- NAME - H5SL_close_common + H5SL__close_common PURPOSE Close a skip list, deallocating it and potentially freeing all its nodes. USAGE - herr_t H5SL_close_common(slist,op,opdata) + herr_t H5SL__close_common(slist,op,opdata) H5SL_t *slist; IN/OUT: Pointer to skip list to close H5SL_operator_t op; IN: Callback function to free item & key void *op_data; IN/OUT: Pointer to application data for callback @@ -944,11 +945,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) +H5SL__close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(slist); @@ -957,7 +958,7 @@ H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) /* (Pre-condition) */ /* Free skip list nodes */ - if(H5SL_release_common(slist, op, op_data) < 0) + if(H5SL__release_common(slist, op, op_data) < 0) HGOTO_ERROR(H5E_SLIST, H5E_CANTFREE, FAIL, "can't release skip list nodes") /* Release header node */ @@ -969,7 +970,7 @@ H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SL_close_common() */ +} /* end H5SL__close_common() */ /*-------------------------------------------------------------------------- @@ -1016,7 +1017,7 @@ H5SL_create(H5SL_type_t type, H5SL_cmp_t cmp) new_slist->safe_iterating = FALSE; /* Allocate the header node */ - if(NULL == (header = H5SL_new_node(NULL, NULL, (uint32_t)ULONG_MAX))) + if(NULL == (header = H5SL__new_node(NULL, NULL, (uint32_t)ULONG_MAX))) HGOTO_ERROR(H5E_SLIST ,H5E_NOSPACE, NULL, "can't create new skip list node") /* Initialize header node's forward pointer */ @@ -1118,8 +1119,8 @@ H5SL_insert(H5SL_t *slist, void *item, const void *key) /* (Pre-condition) */ /* Insert item into skip list */ - if(H5SL_insert_common(slist,item,key)==NULL) - HGOTO_ERROR(H5E_SLIST,H5E_CANTINSERT,FAIL,"can't create new skip list node") + if(NULL == H5SL__insert_common(slist, item, key)) + HGOTO_ERROR(H5E_SLIST, H5E_CANTINSERT, FAIL, "can't create new skip list node") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1168,8 +1169,8 @@ H5SL_add(H5SL_t *slist, void *item, const void *key) /* (Pre-condition) */ /* Insert item into skip list */ - if((ret_value=H5SL_insert_common(slist,item,key))==NULL) - HGOTO_ERROR(H5E_SLIST,H5E_CANTINSERT,NULL,"can't create new skip list node") + if(NULL == (ret_value = H5SL__insert_common(slist, item, key))) + HGOTO_ERROR(H5E_SLIST, H5E_CANTINSERT, NULL, "can't create new skip list node") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2241,7 +2242,9 @@ H5SL_iterate(H5SL_t *slist, H5SL_operator_t op, void *op_data) herr_t H5SL_release(H5SL_t *slist) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(slist); @@ -2253,8 +2256,10 @@ H5SL_release(H5SL_t *slist) /* (Pre-condition) */ /* Free skip list nodes */ - H5SL_release_common(slist,NULL,NULL); /* always succeeds */ + if(H5SL__release_common(slist, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SLIST, H5E_CANTFREE, FAIL, "can't release skip list nodes") +done: FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5SL_release() */ @@ -2290,7 +2295,9 @@ H5SL_release(H5SL_t *slist) herr_t H5SL_free(H5SL_t *slist, H5SL_operator_t op, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(slist); @@ -2302,9 +2309,11 @@ H5SL_free(H5SL_t *slist, H5SL_operator_t op, void *op_data) /* (Pre-condition) */ /* Free skip list nodes */ - H5SL_release_common(slist,op,op_data); /* always succeeds */ + if(H5SL__release_common(slist, op, op_data) < 0) + HGOTO_ERROR(H5E_SLIST, H5E_CANTFREE, FAIL, "can't release skip list nodes") - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_free() */ @@ -2516,9 +2525,9 @@ done: herr_t H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(slist); @@ -2527,8 +2536,10 @@ H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data) /* (Pre-condition) */ /* Close skip list */ - (void)H5SL_close_common(slist,op,op_data); /* always succeeds */ + if(H5SL__close_common(slist, op, op_data) < 0) + HGOTO_ERROR(H5E_SLIST, H5E_CANTCLOSEOBJ, FAIL, "can't close skip list") +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_destroy() */ @@ -2555,7 +2566,9 @@ H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data) herr_t H5SL_close(H5SL_t *slist) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(slist); @@ -2564,8 +2577,10 @@ H5SL_close(H5SL_t *slist) /* (Pre-condition) */ /* Close skip list */ - (void)H5SL_close_common(slist,NULL,NULL); /* always succeeds */ + if(H5SL__close_common(slist, NULL, NULL) < 0) + HGOTO_ERROR(H5E_SLIST, H5E_CANTCLOSEOBJ, FAIL, "can't close skip list") - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_close() */ diff --git a/src/H5SLmodule.h b/src/H5SLmodule.h index 34f08a1..335e35b 100644 --- a/src/H5SLmodule.h +++ b/src/H5SLmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5SM.c b/src/H5SM.c index 6eea80d..420f5df 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -61,6 +61,7 @@ static herr_t H5SM__find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t size_t *empty_pos, size_t *list_pos); static herr_t H5SM__convert_list_to_btree(H5F_t * f, H5SM_index_header_t * header, H5SM_list_t **_list, H5HF_t *fheap, H5O_t *open_oh); +static herr_t H5SM__bt2_convert_to_list_op(const void * record, void *op_data); static herr_t H5SM__convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header); static herr_t H5SM__incr_ref(void *record, void *_op_data, hbool_t *changed); static herr_t H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, @@ -294,7 +295,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5SM_get_index + * Function: H5SM__get_index * * Purpose: Get the index number for a given message type. * @@ -310,13 +311,13 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5SM_get_index(const H5SM_master_table_t *table, unsigned type_id) +H5SM__get_index(const H5SM_master_table_t *table, unsigned type_id) { size_t x; unsigned type_flag; ssize_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Translate the H5O type_id into an H5SM type flag */ if(H5SM__type_to_flag(type_id, &type_flag) < 0) @@ -334,7 +335,7 @@ H5SM_get_index(const H5SM_master_table_t *table, unsigned type_id) */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_get_index() */ +} /* end H5SM__get_index() */ /*------------------------------------------------------------------------- @@ -428,7 +429,7 @@ H5SM_get_fheap_addr(H5F_t *f, unsigned type_id, haddr_t *fheap_addr) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Look up index for message type */ - if((index_num = H5SM_get_index(table, type_id)) < 0) + if((index_num = H5SM__get_index(table, type_id)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to find correct SOHM index") /* Retrieve heap address for index */ @@ -801,6 +802,48 @@ done: /*------------------------------------------------------------------------- + * Function: H5SM__bt2_convert_to_list_op + * + * Purpose: An H5B2_remove_t callback function to convert a SOHM + * B-tree index to a list. + * + * Inserts this record into the list passed through op_data. + * + * Return: Non-negative on success + * Negative on failure + * + * Programmer: James Laird + * Monday, November 6, 2006 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5SM__bt2_convert_to_list_op(const void * record, void *op_data) +{ + const H5SM_sohm_t *message = (const H5SM_sohm_t *)record; + const H5SM_list_t *list = (const H5SM_list_t *)op_data; + size_t mesg_idx; /* Index of message to modify */ + + FUNC_ENTER_STATIC_NOERR + + /* Sanity checks */ + HDassert(record); + HDassert(op_data); + + /* Get the message index, and increment the # of messages in list */ + mesg_idx = list->header->num_messages++; + HDassert(list->header->num_messages <= list->header->list_max); + + /* Insert this message at the end of the list */ + HDassert(list->messages[mesg_idx].location == H5SM_NO_LOC); + HDassert(message->location != H5SM_NO_LOC); + H5MM_memcpy(&(list->messages[mesg_idx]), message, sizeof(H5SM_sohm_t)); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5SM__bt2_convert_to_list_op() */ + + +/*------------------------------------------------------------------------- * Function: H5SM__convert_btree_to_list * * Purpose: Given a B-tree index, turns it into a list index. This is @@ -847,7 +890,7 @@ H5SM__convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header) /* Delete the B-tree and have messages copy themselves to the * list as they're deleted */ - if(H5B2_delete(f, btree_addr, f, H5SM_bt2_convert_to_list_op, list) < 0) + if(H5B2_delete(f, btree_addr, f, H5SM__bt2_convert_to_list_op, list) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete B-tree") done: @@ -860,7 +903,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5SM_can_share_common + * Function: H5SM__can_share_common * * Purpose: "trivial" checks for determining if a message can be shared. * @@ -878,11 +921,11 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5SM_can_share_common(const H5F_t *f, unsigned type_id, const void *mesg) +H5SM__can_share_common(const H5F_t *f, unsigned type_id, const void *mesg) { htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check whether this message ought to be shared or not */ /* If sharing is disabled in this file, don't share the message */ @@ -901,7 +944,7 @@ H5SM_can_share_common(const H5F_t *f, unsigned type_id, const void *mesg) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_can_share_common() */ +} /* end H5SM__can_share_common() */ /*------------------------------------------------------------------------- @@ -934,7 +977,7 @@ H5SM_can_share(H5F_t *f, H5SM_master_table_t *table, FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* "trivial" sharing checks */ - if((tri_ret = H5SM_can_share_common(f, type_id, mesg)) < 0) + if((tri_ret = H5SM__can_share_common(f, type_id, mesg)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_BADTYPE, FAIL, "'trivial' sharing checks returned error") if(tri_ret == FALSE) HGOTO_DONE(FALSE) @@ -956,7 +999,7 @@ H5SM_can_share(H5F_t *f, H5SM_master_table_t *table, /* Find the right index for this message type. If there is no such index * then this type of message isn't shareable */ - if((index_num = H5SM_get_index(my_table, type_id)) < 0) { + if((index_num = H5SM__get_index(my_table, type_id)) < 0) { H5E_clear_stack(NULL); /*ignore error*/ HGOTO_DONE(FALSE) } /* end if */ @@ -1072,7 +1115,7 @@ H5SM_try_share(H5F_t *f, H5O_t *open_oh, unsigned defer_flags, /* "trivial" sharing checks */ if(mesg_flags && (*mesg_flags & H5O_MSG_FLAG_DONTSHARE)) HGOTO_DONE(FALSE) - if((tri_ret = H5SM_can_share_common(f, type_id, mesg)) < 0) + if((tri_ret = H5SM__can_share_common(f, type_id, mesg)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_BADTYPE, FAIL, "'trivial' sharing checks returned error") if(tri_ret == FALSE) HGOTO_DONE(FALSE) @@ -1561,7 +1604,7 @@ H5SM_delete(H5F_t *f, H5O_t *open_oh, H5O_shared_t *sh_mesg) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and try to delete from it */ - if((index_num = H5SM_get_index(table, type_id)) < 0) + if((index_num = H5SM__get_index(table, type_id)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "unable to find correct SOHM index") /* If mesg_buf is not NULL, the message's reference count has reached @@ -1675,34 +1718,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5SM_get_hash_fh_cb - * - * Purpose: Callback for fractal heap operator, to make copy of link when - * when lookup up a link by index - * - * Return: SUCCEED/FAIL - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Nov 7 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5SM_get_hash_fh_cb(const void *obj, size_t obj_len, void *_udata) -{ - H5SM_fh_ud_gh_t *udata = (H5SM_fh_ud_gh_t *)_udata; /* User data for fractal heap 'op' callback */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Compute hash value on raw message */ - udata->hash = H5_checksum_lookup3(obj, obj_len, udata->type_id); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_get_hash_fh_cb() */ - - -/*------------------------------------------------------------------------- * Function: H5SM__decr_ref * * Purpose: Decrement the reference count for a SOHM message. Doesn't @@ -2108,7 +2123,7 @@ H5SM_reconstitute(H5O_shared_t *sh_mesg, H5F_t *f, unsigned msg_type_id, /*------------------------------------------------------------------------- - * Function: H5SM_get_refcount_bt2_cb + * Function: H5SM__get_refcount_bt2_cb * * Purpose: v2 B-tree 'find' callback to retrieve the record for a message * @@ -2120,12 +2135,12 @@ H5SM_reconstitute(H5O_shared_t *sh_mesg, H5F_t *f, unsigned msg_type_id, *------------------------------------------------------------------------- */ static herr_t -H5SM_get_refcount_bt2_cb(const void *_record, void *_op_data) +H5SM__get_refcount_bt2_cb(const void *_record, void *_op_data) { const H5SM_sohm_t *record = (const H5SM_sohm_t *)_record; /* v2 B-tree record for message */ H5SM_sohm_t *op_data = (H5SM_sohm_t *)_op_data; /* "op data" from v2 B-tree find */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * Check arguments. @@ -2137,7 +2152,7 @@ H5SM_get_refcount_bt2_cb(const void *_record, void *_op_data) *op_data = *record; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_get_refcount_bt2_cb() */ +} /* end H5SM__get_refcount_bt2_cb() */ /*------------------------------------------------------------------------- @@ -2184,7 +2199,7 @@ H5SM_get_refcount(H5F_t *f, unsigned type_id, const H5O_shared_t *sh_mesg, HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and find the message in it */ - if((index_num = H5SM_get_index(table, type_id)) < 0) + if((index_num = H5SM__get_index(table, type_id)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "unable to find correct SOHM index") header = &(table->indexes[index_num]); @@ -2241,7 +2256,7 @@ H5SM_get_refcount(H5F_t *f, unsigned type_id, const H5O_shared_t *sh_mesg, HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") /* Look up the message in the v2 B-tree */ - if((msg_exists = H5B2_find(bt2, &key, H5SM_get_refcount_bt2_cb, &message)) < 0) + if((msg_exists = H5B2_find(bt2, &key, H5SM__get_refcount_bt2_cb, &message)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "error finding message in index") if(!msg_exists) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "message not in index") @@ -2466,7 +2481,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5SM_table_free + * Function: H5SM__table_free * * Purpose: Frees memory used by the SOHM table. * @@ -2478,9 +2493,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5SM_table_free(H5SM_master_table_t *table) +H5SM__table_free(H5SM_master_table_t *table) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ HDassert(table); @@ -2491,11 +2506,11 @@ H5SM_table_free(H5SM_master_table_t *table) table = H5FL_FREE(H5SM_master_table_t, table); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_table_free() */ +} /* end H5SM__table_free() */ /*------------------------------------------------------------------------- - * Function: H5SM_list_free + * Function: H5SM__list_free * * Purpose: Frees all memory used by the list. * @@ -2507,9 +2522,9 @@ H5SM_table_free(H5SM_master_table_t *table) *------------------------------------------------------------------------- */ herr_t -H5SM_list_free(H5SM_list_t *list) +H5SM__list_free(H5SM_list_t *list) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(list); HDassert(list->messages); @@ -2519,7 +2534,7 @@ H5SM_list_free(H5SM_list_t *list) list = H5FL_FREE(H5SM_list_t, list); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_list_free() */ +} /* end H5SM__list_free() */ /*------------------------------------------------------------------------- diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c index 7f6c804..644f3dc 100644 --- a/src/H5SMbtree2.c +++ b/src/H5SMbtree2.c @@ -212,45 +212,3 @@ H5SM__bt2_debug(FILE *stream, int indent, int fwidth, FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5SM__bt2_debug */ - -/*------------------------------------------------------------------------- - * Function: H5SM_bt2_convert_to_list_op - * - * Purpose: An H5B2_remove_t callback function to convert a SOHM - * B-tree index to a list. - * - * Inserts this record into the list passed through op_data. - * - * Return: Non-negative on success - * Negative on failure - * - * Programmer: James Laird - * Monday, November 6, 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5SM_bt2_convert_to_list_op(const void * record, void *op_data) -{ - const H5SM_sohm_t *message = (const H5SM_sohm_t *)record; - const H5SM_list_t *list = (const H5SM_list_t *)op_data; - size_t mesg_idx; /* Index of message to modify */ - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - /* Sanity checks */ - HDassert(record); - HDassert(op_data); - - /* Get the message index, and increment the # of messages in list */ - mesg_idx = list->header->num_messages++; - HDassert(list->header->num_messages <= list->header->list_max); - - /* Insert this message at the end of the list */ - HDassert(list->messages[mesg_idx].location == H5SM_NO_LOC); - HDassert(message->location != H5SM_NO_LOC); - H5MM_memcpy(&(list->messages[mesg_idx]), message, sizeof(H5SM_sohm_t)); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_bt2_convert_to_list_op() */ - diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 7f243a6..e7cd29e 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -15,7 +15,7 @@ * * Created: H5SMcache.c * Nov 13 2006 - * James Laird + * James Laird * * Purpose: Implement shared message metadata cache methods. * @@ -308,7 +308,7 @@ H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l done: if(!ret_value && table) - if(H5SM_table_free(table) < 0) + if(H5SM__table_free(table) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTFREE, NULL, "unable to destroy sohm table") FUNC_LEAVE_NOAPI(ret_value) @@ -467,7 +467,7 @@ H5SM__cache_table_free_icr(void *_thing) HDassert(table->cache_info.type == H5AC_SOHM_TABLE); /* Destroy Shared Object Header Message table */ - if(H5SM_table_free(table) < 0) + if(H5SM__table_free(table) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTRELEASE, FAIL, "unable to free shared message table") done: @@ -778,7 +778,7 @@ H5SM__cache_list_free_icr(void *_thing) HDassert(list->cache_info.type == H5AC_SOHM_LIST); /* Destroy Shared Object Header Message list */ - if(H5SM_list_free(list) < 0) + if(H5SM__list_free(list) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTRELEASE, FAIL, "unable to free shared message list") done: diff --git a/src/H5SMmessage.c b/src/H5SMmessage.c index e085204..1787fbe 100644 --- a/src/H5SMmessage.c +++ b/src/H5SMmessage.c @@ -38,7 +38,7 @@ /* Local Typedefs */ /******************/ -/* Udata struct for calls to H5SM_compare_cb and H5SM_compare_iter_op*/ +/* Udata struct for calls to H5SM__compare_cb and H5SM__compare_iter_op*/ typedef struct H5SM_compare_udata_t { const H5SM_mesg_key_t *key; /* Key; compare this against stored message */ H5O_msg_crt_idx_t idx; /* Index of the message in the OH, if applicable */ @@ -49,8 +49,8 @@ typedef struct H5SM_compare_udata_t { /********************/ /* Local Prototypes */ /********************/ -static herr_t H5SM_compare_cb(const void *obj, size_t obj_len, void *udata); -static herr_t H5SM_compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequence, +static herr_t H5SM__compare_cb(const void *obj, size_t obj_len, void *udata); +static herr_t H5SM__compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequence, unsigned *oh_modified, void *udata); @@ -71,7 +71,7 @@ static herr_t H5SM_compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequenc /*------------------------------------------------------------------------- - * Function: H5SM_compare_cb + * Function: H5SM__compare_cb * * Purpose: Callback for H5HF_op, used in H5SM__message_compare below. * Determines whether the search key passed in in _UDATA is @@ -87,11 +87,11 @@ static herr_t H5SM_compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequenc *------------------------------------------------------------------------- */ static herr_t -H5SM_compare_cb(const void *obj, size_t obj_len, void *_udata) +H5SM__compare_cb(const void *obj, size_t obj_len, void *_udata) { H5SM_compare_udata_t *udata = (H5SM_compare_udata_t *)_udata; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* If the encoding sizes are different, it's not the same object */ if(udata->key->encoding_size > obj_len) @@ -103,11 +103,11 @@ H5SM_compare_cb(const void *obj, size_t obj_len, void *_udata) udata->ret = HDmemcmp(udata->key->encoding, obj, obj_len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_compare_cb() */ +} /* end H5SM__compare_cb() */ /*------------------------------------------------------------------------- - * Function: H5SM_compare_iter_op + * Function: H5SM__compare_iter_op * * Purpose: OH iteration callback to compare a key against a message in * an OH @@ -123,13 +123,13 @@ H5SM_compare_cb(const void *obj, size_t obj_len, void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5SM_compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, +H5SM__compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, unsigned H5_ATTR_UNUSED *oh_modified, void *_udata/*in,out*/) { H5SM_compare_udata_t *udata = (H5SM_compare_udata_t *) _udata; herr_t ret_value = H5_ITER_CONT; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -165,7 +165,7 @@ H5SM_compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_compare_iter_op() */ +} /* end H5SM__compare_iter_op() */ /*------------------------------------------------------------------------- @@ -237,7 +237,7 @@ H5SM__message_compare(const void *rec1, const void *rec2, int *result) */ if(mesg->location == H5SM_IN_HEAP) { /* Call heap op routine with comparison callback */ - if(H5HF_op(key->fheap, &(mesg->u.heap_loc.fheap_id), H5SM_compare_cb, &udata) < 0) + if(H5HF_op(key->fheap, &(mesg->u.heap_loc.fheap_id), H5SM__compare_cb, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") } /* end if */ else { @@ -261,7 +261,7 @@ H5SM__message_compare(const void *rec1, const void *rec2, int *result) /* Locate the right message and compare with it */ op.op_type = H5O_MESG_OP_LIB; - op.u.lib_op = H5SM_compare_iter_op; + op.u.lib_op = H5SM__compare_iter_op; if(H5O_msg_iterate(&oloc, mesg->msg_type_id, &op, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over links") } /* end else */ diff --git a/src/H5SMmodule.h b/src/H5SMmodule.h index 656c7dd..ccd7b9f 100644 --- a/src/H5SMmodule.h +++ b/src/H5SMmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h index bb458a7..59be8b7 100644 --- a/src/H5SMpkg.h +++ b/src/H5SMpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: James Laird + * Programmer: James Laird * Thursday, March 30, 2006 * * Purpose: This file contains declarations which are visible only within @@ -259,22 +259,16 @@ H5_DLLVAR const H5B2_class_t H5SM_INDEX[1]; /****************************/ /* General routines */ -H5_DLL ssize_t H5SM_get_index(const H5SM_master_table_t *table, unsigned type_id); +H5_DLL ssize_t H5SM__get_index(const H5SM_master_table_t *table, unsigned type_id); /* Encode and decode routines, used for B-tree and cache encoding/decoding */ H5_DLL herr_t H5SM__message_compare(const void *rec1, const void *rec2, int *result); H5_DLL herr_t H5SM__message_encode(uint8_t *raw, const void *native, void *ctx); H5_DLL herr_t H5SM__message_decode(const uint8_t *raw, void *native, void *ctx); -/* H5B2_remove_t callback to add messages to a list index */ -H5_DLL herr_t H5SM_bt2_convert_to_list_op(const void * record, void *op_data); - -/* Fractal heap 'op' callback to compute hash value for message "in place" */ -H5_DLL herr_t H5SM_get_hash_fh_cb(const void *obj, size_t obj_len, void *_udata); - /* Routines to release data structures */ -herr_t H5SM_table_free(H5SM_master_table_t *table); -herr_t H5SM_list_free(H5SM_list_t *list); +H5_DLL herr_t H5SM__table_free(H5SM_master_table_t *table); +H5_DLL herr_t H5SM__list_free(H5SM_list_t *list); /* Testing functions */ #ifdef H5SM_TESTING diff --git a/src/H5SMprivate.h b/src/H5SMprivate.h index e6776f3..80d3692 100644 --- a/src/H5SMprivate.h +++ b/src/H5SMprivate.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: James Laird + * Programmer: James Laird * Thursday, March 2, 2006 * * Purpose: This file contains private declarations for the H5SM diff --git a/src/H5SMtest.c b/src/H5SMtest.c index 0a6149d..a4a43e6 100644 --- a/src/H5SMtest.c +++ b/src/H5SMtest.c @@ -99,7 +99,7 @@ H5SM__get_mesg_count_test(H5F_t *f, unsigned type_id, size_t *mesg_count) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index for this message type */ - if((index_num = H5SM_get_index(table, type_id)) < 0) + if((index_num = H5SM__get_index(table, type_id)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "unable to find correct SOHM index") header = &(table->indexes[index_num]); diff --git a/src/H5ST.c b/src/H5ST.c index 3a1020b..2570f72 100644 --- a/src/H5ST.c +++ b/src/H5ST.c @@ -70,7 +70,7 @@ done: /*-------------------------------------------------------------------------- NAME - H5ST_close_internal + H5ST__close_internal PURPOSE Close a TST, deallocating it. USAGE @@ -87,21 +87,21 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5ST_close_internal(H5ST_ptr_t p) +H5ST__close_internal(H5ST_ptr_t p) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Recursively free TST */ if(p) { - H5ST_close_internal(p->lokid); + H5ST__close_internal(p->lokid); if(p->splitchar) - H5ST_close_internal(p->eqkid); - H5ST_close_internal(p->hikid); + H5ST__close_internal(p->eqkid); + H5ST__close_internal(p->hikid); p = H5FL_FREE(H5ST_node_t, p); } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5ST_close_internal() */ +} /* end H5ST__close_internal() */ /*-------------------------------------------------------------------------- @@ -134,7 +134,7 @@ H5ST_close(H5ST_tree_t *tree) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid TST") /* Free the TST itself */ - if(H5ST_close_internal(tree->root) < 0) + if(H5ST__close_internal(tree->root) < 0) HGOTO_ERROR(H5E_TST, H5E_CANTFREE, FAIL, "can't free TST") /* Free root node itself */ @@ -270,7 +270,7 @@ done: /*-------------------------------------------------------------------------- NAME - H5ST_find_internal + H5ST__find_internal PURPOSE Find the node matching a particular key string USAGE @@ -289,11 +289,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static H5ST_ptr_t -H5ST_find_internal(H5ST_ptr_t p, const char *s) +H5ST__find_internal(H5ST_ptr_t p, const char *s) { H5ST_ptr_t ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR while (p) { if (*s < p->splitchar) @@ -308,7 +308,7 @@ H5ST_find_internal(H5ST_ptr_t p, const char *s) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5ST_find_internal() */ +} /* end H5ST__find_internal() */ /*-------------------------------------------------------------------------- @@ -338,7 +338,7 @@ H5ST_find(H5ST_tree_t *tree, const char *s) FUNC_ENTER_NOAPI(NULL) - if(NULL == (ret_value = H5ST_find_internal(tree->root, s))) + if(NULL == (ret_value = H5ST__find_internal(tree->root, s))) HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST") done: @@ -374,7 +374,7 @@ H5ST_locate(H5ST_tree_t *tree, const char *s) FUNC_ENTER_NOAPI(NULL) /* Locate the node to remove */ - if(NULL == (node = H5ST_find_internal(tree->root, s))) + if(NULL == (node = H5ST__find_internal(tree->root, s))) HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST") /* Get the pointer to the object to return */ @@ -387,11 +387,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5ST_findfirst_internal + H5ST__findfirst_internal PURPOSE Find the first node in a TST USAGE - H5ST_ptr_t H5ST_findfirst_internal(p) + H5ST_ptr_t H5ST__findfirst_internal(p) H5ST_ptr_t p; IN: TST to locate first node within RETURNS Success: Non-NULL @@ -404,11 +404,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static H5ST_ptr_t -H5ST_findfirst_internal(H5ST_ptr_t p) +H5ST__findfirst_internal(H5ST_ptr_t p) { H5ST_ptr_t ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR while(p) { /* Find least node in current tree */ @@ -428,7 +428,7 @@ H5ST_findfirst_internal(H5ST_ptr_t p) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5ST_findfirst_internal() */ +} /* end H5ST__findfirst_internal() */ /*-------------------------------------------------------------------------- @@ -456,7 +456,7 @@ H5ST_findfirst(H5ST_tree_t *tree) FUNC_ENTER_NOAPI(NULL) - if(NULL == (ret_value = H5ST_findfirst_internal(tree->root))) + if(NULL == (ret_value = H5ST__findfirst_internal(tree->root))) HGOTO_ERROR(H5E_TST,H5E_NOTFOUND,NULL,"no nodes in TST"); done: @@ -466,11 +466,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5ST_getnext + H5ST__getnext PURPOSE Internal routine to find the next node in a given level of a TST USAGE - H5ST_ptr_t H5ST_getnext(p) + H5ST_ptr_t H5ST__getnext(p) H5ST_ptr_t *p; IN: Pointer to node to find next node from RETURNS Success: Non-NULL @@ -483,11 +483,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static H5ST_ptr_t -H5ST_getnext(H5ST_ptr_t p) +H5ST__getnext(H5ST_ptr_t p) { H5ST_ptr_t ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* If the node to continue from has higher-valued nodes attached */ if(p->hikid) { @@ -519,7 +519,7 @@ H5ST_getnext(H5ST_ptr_t p) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5ST_getnext() */ +} /* end H5ST__getnext() */ /*-------------------------------------------------------------------------- @@ -550,9 +550,9 @@ H5ST_findnext(H5ST_ptr_t p) /* Find the next node at the current level, or go back up the tree */ do { - q = H5ST_getnext(p); + q = H5ST__getnext(p); if(q) { - HGOTO_DONE(H5ST_findfirst_internal(q->eqkid)); + HGOTO_DONE(H5ST__findfirst_internal(q->eqkid)); } /* end if */ else p = p->up; @@ -565,11 +565,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5ST_delete_internal + H5ST__delete_internal PURPOSE Delete a node from a TST USAGE - herr_t H5ST_delete_internal(root,p) + herr_t H5ST__delete_internal(root,p) H5ST_ptr_t *root; IN/OUT: Root of TST to delete node from H5ST_ptr_t p; IN: Node to delete RETURNS @@ -584,12 +584,12 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5ST_delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p) +H5ST__delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p) { H5ST_ptr_t q, /* Temporary pointer to TST node */ newp; /* Pointer to node which will replace deleted node in tree */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Find node to replace one being deleted */ if(p->lokid) { @@ -628,7 +628,7 @@ H5ST_delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p) /* If we deleted the last node in the TST, delete the upper node also */ if(NULL == newp) - H5ST_delete_internal(root, p->up); + H5ST__delete_internal(root, p->up); } /* end if */ else /* Deleted last node at top level of tree */ *root = newp; @@ -637,7 +637,7 @@ H5ST_delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p) p = H5FL_FREE(H5ST_node_t, p); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5ST_delete_internal() */ +} /* end H5ST__delete_internal() */ /*-------------------------------------------------------------------------- @@ -667,7 +667,7 @@ H5ST_delete(H5ST_tree_t *tree, H5ST_ptr_t p) FUNC_ENTER_NOAPI(FAIL) - if(H5ST_delete_internal(&tree->root, p) < 0) + if(H5ST__delete_internal(&tree->root, p) < 0) HGOTO_ERROR(H5E_TST, H5E_CANTDELETE, FAIL, "can't delete node from TST") done: @@ -703,14 +703,14 @@ H5ST_remove(H5ST_tree_t *tree, const char *s) FUNC_ENTER_NOAPI(NULL) /* Locate the node to remove */ - if(NULL == (node = H5ST_find_internal(tree->root, s))) + if(NULL == (node = H5ST__find_internal(tree->root, s))) HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST") /* Get the pointer to the object to return */ ret_value = node->eqkid; /* Remove the node from the TST */ - if(H5ST_delete_internal(&tree->root, node) < 0) + if(H5ST__delete_internal(&tree->root, node) < 0) HGOTO_ERROR(H5E_TST, H5E_CANTDELETE, NULL, "can't delete node from TST") done: diff --git a/src/H5Sall.c b/src/H5Sall.c index 9026e7c..f342279 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 16, 1998 * * Purpose: "All" selection dataspace I/O functions. diff --git a/src/H5Sdbg.c b/src/H5Sdbg.c index 32f5295..a870c92 100644 --- a/src/H5Sdbg.c +++ b/src/H5Sdbg.c @@ -16,7 +16,6 @@ * Created: H5Sdbg.c * Quincey Koziol * Jul 24 2007 - * * * Purpose: Dump debugging information about a dataspace * diff --git a/src/H5Sdeprec.c b/src/H5Sdeprec.c index e4ec1b0..e37694c 100644 --- a/src/H5Sdeprec.c +++ b/src/H5Sdeprec.c @@ -87,7 +87,6 @@ * Failure: negative * * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu * July 14, 2004 * *------------------------------------------------------------------------- diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 9f75785..95bce29 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -5405,7 +5405,7 @@ H5S__hyper_spans_shape_same_helper(const H5S_hyper_span_info_t *span_info1, { hbool_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDassert(span_info1); @@ -7017,9 +7017,8 @@ H5S__hyper_adjust_s(H5S_t *space, const hssize_t *offset) { hbool_t non_zero_offset = FALSE; /* Whether any offset is non-zero */ unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDassert(space); @@ -7062,8 +7061,7 @@ H5S__hyper_adjust_s(H5S_t *space, const hssize_t *offset) } /* end if */ } -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__hyper_adjust_s() */ @@ -9613,7 +9611,7 @@ H5S__hyper_regular_and_single_block(H5S_t *space, const hsize_t start[], unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Check args */ HDassert(space); diff --git a/src/H5Smodule.h b/src/H5Smodule.h index 962f0a2..67ac785 100644 --- a/src/H5Smodule.h +++ b/src/H5Smodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Snone.c b/src/H5Snone.c index 672302d..67c07d0 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 10, 1998 * * Purpose: "None" selection dataspace I/O functions. diff --git a/src/H5Spkg.h b/src/H5Spkg.h index e08fedf..b1a46f2 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, September 28, 2000 * * Purpose: This file contains declarations which are visible only within diff --git a/src/H5Sselect.c b/src/H5Sselect.c index c9d7fc0..eb5cf1c 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Friday, May 29, 1998 * * Purpose: Dataspace selection functions. @@ -56,9 +56,9 @@ /********************/ #ifdef LATER -static herr_t H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); -static htri_t H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter); -static herr_t H5S_select_iter_next_block(H5S_sel_iter_t *iter); +static herr_t H5S__select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); +static htri_t H5S__select_iter_has_next_block(const H5S_sel_iter_t *iter); +static herr_t H5S__select_iter_next_block(H5S_sel_iter_t *iter); #endif /* LATER */ @@ -1233,11 +1233,11 @@ H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords) /*-------------------------------------------------------------------------- NAME - H5S_select_iter_block + H5S__select_iter_block PURPOSE Get the block of the current iterator position USAGE - herr_t H5S_select_iter_block(sel_iter,start,end) + herr_t H5S__select_iter_block(sel_iter,start,end) const H5S_sel_iter_t *sel_iter; IN: Selection iterator to query hsize_t *start; OUT: Array to place iterator start block coordinates hsize_t *end; OUT: Array to place iterator end block coordinates @@ -1255,11 +1255,11 @@ H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) +H5S__select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(iter); @@ -1270,7 +1270,7 @@ H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) ret_value = (*iter->type->iter_block)(iter, start, end); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5S_select_iter_block() */ +} /* end H5S__select_iter_block() */ #endif /* LATER */ @@ -1314,11 +1314,11 @@ H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter) /*-------------------------------------------------------------------------- NAME - H5S_select_iter_has_next_block + H5S__select_iter_has_next_block PURPOSE Check if there is another block available in the selection iterator USAGE - htri_t H5S_select_iter_has_next_block(sel_iter) + htri_t H5S__select_iter_has_next_block(sel_iter) const H5S_sel_iter_t *sel_iter; IN: Selection iterator to query RETURNS Non-negative on success, negative on failure. @@ -1334,11 +1334,11 @@ H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter) +H5S__select_iter_has_next_block(const H5S_sel_iter_t *iter) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(iter); @@ -1347,7 +1347,7 @@ H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter) ret_value = (*iter->type->iter_has_next_block)(iter); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5S_select_iter_has_next_block() */ +} /* end H5S__select_iter_has_next_block() */ #endif /* LATER */ @@ -1397,11 +1397,11 @@ H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem) /*-------------------------------------------------------------------------- NAME - H5S_select_iter_next_block + H5S__select_iter_next_block PURPOSE Advance selection iterator to next block USAGE - herr_t H5S_select_iter_next_block(iter) + herr_t H5S__select_iter_next_block(iter) H5S_sel_iter_t *iter; IN/OUT: Selection iterator to change RETURNS Non-negative on success, negative on failure. @@ -1419,11 +1419,11 @@ H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_select_iter_next_block(H5S_sel_iter_t *iter) +H5S__select_iter_next_block(H5S_sel_iter_t *iter) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(iter); @@ -1432,7 +1432,7 @@ H5S_select_iter_next_block(H5S_sel_iter_t *iter) ret_value = (*iter->type->iter_next_block)(iter); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5S_select_iter_next_block() */ +} /* end H5S__select_iter_next_block() */ #endif /* LATER */ diff --git a/src/H5Stest.c b/src/H5Stest.c index b61b6bf..1bc5b9f 100644 --- a/src/H5Stest.c +++ b/src/H5Stest.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Saturday, May 31, 2003 * * Purpose: Dataspace selection testing functions. diff --git a/src/H5T.c b/src/H5T.c index 991095d..d59aaff 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1912,12 +1912,6 @@ done: * Programmer: Robb Matzke * Friday, January 9, 1998 * - * Modifications: - * - * Robb Matzke, 1 Jun 1998 - * It is illegal to lock a named datatype since we must allow named - * types to be closed (to release file resources) but locking a type - * prevents that. *------------------------------------------------------------------------- */ herr_t @@ -1990,9 +1984,6 @@ done: * Programmer: Robb Matzke * Monday, December 8, 1997 * - * Modifications: - * Broke out from H5Tget_class - QAK - 6/4/99 - * *------------------------------------------------------------------------- */ H5T_class_t @@ -3029,10 +3020,6 @@ done: * Programmer: Raymond Lu * July 14, 2004 * - * Modification:Raymond Lu - * 17 February 2011 - * I changed the value for the APP_REF parameter of H5I_register - * from FALSE to TRUE. *------------------------------------------------------------------------- */ hid_t @@ -3195,10 +3182,6 @@ done: * Programmer: Robb Matzke * Friday, December 5, 1997 * - * Modifications: - * Raymond Lu - * 19 May 2011 - * We support fixed size or variable-length string now. *------------------------------------------------------------------------- */ H5T_t * @@ -5173,11 +5156,6 @@ H5T_path_noop(const H5T_path_t *p) * Programmer: Raymond Lu * 8 June 2007 * - * Modifications: Neil Fortner - * 19 September 2008 - * Changed return value to H5T_subset_info_t - * (to allow it to return copy_size) - * *------------------------------------------------------------------------- */ H5T_subset_info_t * @@ -5905,7 +5883,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_upgrade_version_cb + * Function: H5T__upgrade_version_cb * * Purpose: H5T__visit callback to Upgrade the version of a datatype * (if there's any benefit to doing so) @@ -5922,9 +5900,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_upgrade_version_cb(H5T_t *dt, void *op_value) +H5T__upgrade_version_cb(H5T_t *dt, void *op_value) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(dt); @@ -5959,7 +5937,7 @@ H5T_upgrade_version_cb(H5T_t *dt, void *op_value) } /* end switch */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5T_upgrade_version_cb() */ +} /* end H5T__upgrade_version_cb() */ /*------------------------------------------------------------------------- @@ -5987,7 +5965,7 @@ H5T__upgrade_version(H5T_t *dt, unsigned new_version) HDassert(dt); /* Iterate over entire datatype, upgrading the version of components, if it's useful */ - if(H5T__visit(dt, (H5T_VISIT_SIMPLE | H5T_VISIT_COMPLEX_LAST), H5T_upgrade_version_cb, &new_version) < 0) + if(H5T__visit(dt, (H5T_VISIT_SIMPLE | H5T_VISIT_COMPLEX_LAST), H5T__upgrade_version_cb, &new_version) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_BADITER, FAIL, "iteration to upgrade datatype encoding version failed") done: diff --git a/src/H5TSprivate.h b/src/H5TSprivate.h index 887f001..effda55 100644 --- a/src/H5TSprivate.h +++ b/src/H5TSprivate.h @@ -19,8 +19,6 @@ * * Purpose: Private non-prototype header. * - * Modifications: - * *------------------------------------------------------------------------- */ #ifndef H5TSprivate_H_ diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index f4a9e04..caf81cb 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -93,8 +93,6 @@ static H5T_t *H5T__reopen_member_type(const H5T_t *dt, unsigned membno); * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ size_t @@ -163,8 +161,6 @@ H5T_get_member_offset(const H5T_t *dt, unsigned membno) * Programmer: Quincey Koziol * Thursday, November 9, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ H5T_class_t @@ -361,8 +357,6 @@ H5T__get_member_size(const H5T_t *dt, unsigned membno) * Programmer: Robb Matzke * Monday, December 8, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -407,8 +401,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -616,8 +608,6 @@ done: * Programmer: Quincey Koziol * Thursday, September 11, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static htri_t @@ -654,8 +644,6 @@ H5T__is_packed(const H5T_t *dt) * Programmer: Neil Fortner * Monday, October 19, 2009 * - * Modifications: - * *------------------------------------------------------------------------- */ void diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 15658cc..5d4829e 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -990,7 +990,7 @@ typedef struct H5T_conv_hw_t { /* Local Prototypes */ /********************/ -static herr_t H5T_reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order); +static herr_t H5T__reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order); /*********************/ @@ -1725,7 +1725,7 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(src->shared->u.atomic.prec > dst->shared->u.atomic.prec) { /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ - H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } /* end if */ @@ -1824,7 +1824,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_conv_struct_free + * Function: H5T__conv_struct_free * * Purpose: Free the private data structure used by the compound * conversion functions. @@ -1837,14 +1837,14 @@ done: *------------------------------------------------------------------------- */ static H5T_conv_struct_t * -H5T_conv_struct_free(H5T_conv_struct_t *priv) +H5T__conv_struct_free(H5T_conv_struct_t *priv) { int *src2dst = priv->src2dst; hid_t *src_memb_id = priv->src_memb_id, *dst_memb_id = priv->dst_memb_id; unsigned i; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR for(i = 0; i < priv->src_nmembs; i++) if(src2dst[i] >= 0) { @@ -1862,11 +1862,11 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv) H5MM_xfree(priv->memb_path); FUNC_LEAVE_NOAPI((H5T_conv_struct_t *)H5MM_xfree(priv)) -} /* end H5T_conv_struct_free() */ +} /* end H5T__conv_struct_free() */ /*------------------------------------------------------------------------- - * Function: H5T_conv_struct_init + * Function: H5T__conv_struct_init * * Purpose: Initialize the `priv' field of `cdata' with conversion * information that is relatively constant. If `priv' is @@ -1912,7 +1912,7 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv) *------------------------------------------------------------------------- */ static herr_t -H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) +H5T__conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) { H5T_conv_struct_t *priv = (H5T_conv_struct_t*)(cdata->priv); int *src2dst = NULL; @@ -1920,7 +1920,7 @@ H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) unsigned i, j; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC src_nmembs = src->shared->u.compnd.nmembs; dst_nmembs = dst->shared->u.compnd.nmembs; @@ -2000,7 +2000,7 @@ H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) H5T_path_t *tpath = H5T_path_find(src->shared->u.compnd.memb[i].type, dst->shared->u.compnd.memb[src2dst[i]].type); if(NULL == (priv->memb_path[i] = tpath)) { - cdata->priv = H5T_conv_struct_free(priv); + cdata->priv = H5T__conv_struct_free(priv); HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unable to convert member datatype") } /* end if */ } /* end if */ @@ -2053,7 +2053,7 @@ H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_struct_init() */ +} /* end H5T__conv_struct_init() */ /*------------------------------------------------------------------------- @@ -2160,7 +2160,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(H5T_COMPOUND != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") - if(H5T_conv_struct_init(src, dst, cdata) < 0) + if(H5T__conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") break; @@ -2168,7 +2168,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* * Free the private conversion data. */ - cdata->priv = H5T_conv_struct_free(priv); + cdata->priv = H5T__conv_struct_free(priv); break; case H5T_CONV_CONV: @@ -2180,7 +2180,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HDassert(priv); HDassert(bkg && cdata->need_bkg); - if(cdata->recalc && H5T_conv_struct_init(src, dst, cdata) < 0) + if(cdata->recalc && H5T__conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") /* @@ -2389,7 +2389,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") /* Initialize data which is relatively constant */ - if(H5T_conv_struct_init(src, dst, cdata) < 0) + if(H5T__conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") priv = (H5T_conv_struct_t *)(cdata->priv); src2dst = priv->src2dst; @@ -2422,7 +2422,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, if(dst_memb->size > src_memb->size) { offset -= src_memb->size; if(dst_memb->size > src->shared->size-offset) { - cdata->priv = H5T_conv_struct_free(priv); + cdata->priv = H5T__conv_struct_free(priv); HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion is unsupported by this function") } /* end if */ } /* end if */ @@ -2434,7 +2434,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /* * Free the private conversion data. */ - cdata->priv = H5T_conv_struct_free((H5T_conv_struct_t *)(cdata->priv)); + cdata->priv = H5T__conv_struct_free((H5T_conv_struct_t *)(cdata->priv)); break; case H5T_CONV_CONV: @@ -2445,7 +2445,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Update cached data if necessary */ - if(cdata->recalc && H5T_conv_struct_init(src, dst, cdata) < 0) + if(cdata->recalc && H5T__conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") priv = (H5T_conv_struct_t *)(cdata->priv); HDassert(priv); @@ -2579,7 +2579,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_conv_enum_init + * Function: H5T__conv_enum_init * * Purpose: Initialize information for H5T__conv_enum(). * @@ -2593,7 +2593,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) +H5T__conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) { H5T_enum_struct_t *priv = NULL; /*private conversion data */ int n; /*src value cast as native int */ @@ -2603,7 +2603,7 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) unsigned i, j; /*counters */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC cdata->need_bkg = H5T_BKG_NO; if(NULL == (priv = (H5T_enum_struct_t *)(cdata->priv = H5MM_calloc(sizeof(*priv))))) @@ -2766,7 +2766,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(H5T_ENUM != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype") - if(H5T_conv_enum_init(src, dst, cdata) < 0) + if(H5T__conv_enum_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize private data") break; @@ -2794,7 +2794,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype") /* priv->src2dst map was computed for certain sort keys. Make sure those same - * sort keys are used here during conversion. See H5T_conv_enum_init(). But + * sort keys are used here during conversion. See H5T__conv_enum_init(). But * we actually don't care about the source type's order when doing the O(1) * conversion algorithm, which is turned on by non-zero priv->length */ H5T__sort_name(dst, NULL); @@ -2831,7 +2831,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* (The casting won't work when the byte orders are different. i.g. if the source value * is big-endian 0x0000000f, the direct casting "n = *((int*)s);" will make it a big * number 0x0f000000 on little-endian machine. But we won't fix it because it's an - * optimization code. Please also see the comment in the H5T_conv_enum_init() function. + * optimization code. Please also see the comment in the H5T__conv_enum_init() function. * SLU - 2011/5/24) */ if(1 == src->shared->size) @@ -3869,7 +3869,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (first>=dst->shared->u.atomic.prec) { /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ - H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -3898,7 +3898,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (first+1 == src->shared->u.atomic.prec) { /*overflow - source is negative*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ - H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -3918,7 +3918,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (first>=dst->shared->u.atomic.prec) { /*overflow - source is positive*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ - H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -3945,7 +3945,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (first+1 >= dst->shared->u.atomic.prec) { /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ - H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -3982,7 +3982,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (sfz>=0 && fz+1>=dst->shared->u.atomic.prec) { /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ - H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -4012,7 +4012,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (first+1>=dst->shared->u.atomic.prec) { /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ - H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -4293,7 +4293,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* +Inf or -Inf */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); if(sign) except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, src_id, dst_id, src_rev, d, cb_struct.user_data); @@ -4332,7 +4332,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* +Inf or -Inf */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); if(sign) except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, src_id, dst_id, src_rev, d, cb_struct.user_data); @@ -4371,7 +4371,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* NaN */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NAN, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -4490,7 +4490,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -4583,7 +4583,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8696,7 +8696,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(sign) { /* -Infinity */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8713,7 +8713,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else { /* +Infinity */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PINF, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8742,7 +8742,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(sign) { /* -Infinity */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8759,7 +8759,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else { /* +Infinity */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PINF, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8782,7 +8782,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* NaN */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NAN, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8878,7 +8878,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(sign) { /*source is negative*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); if(except_ret == H5T_CONV_ABORT) @@ -8894,7 +8894,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8910,7 +8910,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (first shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8931,7 +8931,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(first < dst.prec-1) { if(truncated && cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8957,7 +8957,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8977,7 +8977,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -8994,7 +8994,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if(first < dst.prec-1) { if(truncated && cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -9316,7 +9316,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * precision loss. Let user's handler deal with the case if it's present */ if(cb_struct.func) { - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PRECISION, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -9384,7 +9384,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(expo > expo_max) { /*overflows*/ if(cb_struct.func) { /*user's exception handler. Reverse back source order*/ - H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); /*reverse order first*/ + H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); /*reverse order first*/ except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); @@ -9486,7 +9486,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_reverse_order + * Function: H5T__reverse_order * * Purpose: Internal assisting function to reverse the order of * a sequence of byte when it's big endian or VAX order. @@ -9502,11 +9502,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order) +H5T__reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order) { size_t i; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(s); HDassert(size); @@ -9595,7 +9595,7 @@ H5T_reclaim_cb(void *elem, const H5T_t *dt, unsigned H5_ATTR_UNUSED ndim, HDassert(dt); if(dt->shared->type == H5T_REFERENCE) { - if(H5T_ref_reclaim(elem, dt) < 0) + if(H5T__ref_reclaim(elem, dt) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't reclaim ref elements") } else { HDassert(op_data); diff --git a/src/H5Tcset.c b/src/H5Tcset.c index 186e598..5ac2a62 100644 --- a/src/H5Tcset.c +++ b/src/H5Tcset.c @@ -39,10 +39,6 @@ * Programmer: Robb Matzke * Friday, January 9, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works for derived data types. - * *------------------------------------------------------------------------- */ H5T_cset_t @@ -85,10 +81,6 @@ done: * Programmer: Robb Matzke * Friday, January 9, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived data types. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index 2c98dc0..3823e47 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -15,7 +15,7 @@ * * Created: H5Tdeprec.c * April 5 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Deprecated functions from the H5T interface. These * functions are here for compatibility purposes and may be diff --git a/src/H5Tenum.c b/src/H5Tenum.c index 6daa497..ffdab5b 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -26,9 +26,9 @@ #include "H5Tpkg.h" /*data-type functions */ /* Static local functions */ -static char *H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, +static char *H5T__enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t size); -static herr_t H5T_enum_valueof(const H5T_t *dt, const char *name, +static herr_t H5T__enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/); @@ -89,8 +89,6 @@ done: * Programmer: Raymond Lu * October 9, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ H5T_t * @@ -132,8 +130,6 @@ done: * Programmer: Robb Matzke * Wednesday, December 23, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -179,8 +175,6 @@ done: * Programmer: Robb Matzke * Wednesday, December 23, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -243,8 +237,6 @@ done: * Programmer: Robb Matzke * Wednesday, December 23, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -286,8 +278,6 @@ done: * Programmer: Raymond Lu * October 9, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -323,8 +313,6 @@ H5T__get_member_value(const H5T_t *dt, unsigned membno, void *value/*out*/) * Programmer: Robb Matzke * Monday, January 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -346,7 +334,7 @@ H5Tenum_nameof(hid_t type, const void *value, char *name/*out*/, size_t size) if (!name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name buffer supplied") - if (NULL==H5T_enum_nameof(dt, value, name, size)) + if (NULL==H5T__enum_nameof(dt, value, name, size)) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "nameof query failed") done: @@ -355,7 +343,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_enum_nameof + * Function: H5T__enum_nameof * * Purpose: Finds the symbol name that corresponds the the specified * VALUE of an enumeration data type DT. At most SIZE characters @@ -375,15 +363,10 @@ done: * Programmer: Robb Matzke * Monday, January 4, 1999 * - * Modifications: - * Raymond Lu - * Wednesday, Febuary 9, 2005 - * Made a copy of original datatype and do sorting and search - * on that copy, to protect the original order of members. *------------------------------------------------------------------------- */ static char * -H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t size) +H5T__enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t size) { H5T_t *copied_dt = NULL; /* Do sorting in copied datatype */ unsigned lt, md = 0, rt; /* Indices for binary search */ @@ -391,7 +374,7 @@ H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t si hbool_t alloc_name = FALSE; /* Whether name has been allocated */ char *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(dt && H5T_ENUM == dt->shared->type); @@ -451,7 +434,7 @@ done: H5MM_free(name); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_enum_nameof() */ +} /* end H5T__enum_nameof() */ /*------------------------------------------------------------------------- @@ -469,11 +452,6 @@ done: * Programmer: Robb Matzke * Monday, January 4, 1999 * - * Modifications: - * Raymond Lu - * Wednesday, Febuary 9, 2005 - * Made a copy of original datatype and do sorting and search - * on that copy, to protect the original order of members. *------------------------------------------------------------------------- */ herr_t @@ -495,7 +473,7 @@ H5Tenum_valueof(hid_t type, const char *name, void *value/*out*/) if(!value) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no value buffer") - if(H5T_enum_valueof(dt, name, value) < 0) + if(H5T__enum_valueof(dt, name, value) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "valueof query failed") done: @@ -504,7 +482,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_enum_valueof + * Function: H5T__enum_valueof * * Purpose: Finds the value that corresponds the the specified symbol * NAME of an enumeration data type DT and copy it to the VALUE @@ -518,22 +496,17 @@ done: * Programmer: Robb Matzke * Monday, January 4, 1999 * - * Modifications: - * Raymond Lu - * Wednesday, Febuary 9, 2005 - * Made a copy of original datatype and do sorting and search - * on that copy, to protect the original order of members. *------------------------------------------------------------------------- */ static herr_t -H5T_enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/) +H5T__enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/) { unsigned lt, md=0, rt; /*indices for binary search */ int cmp=(-1); /*comparison result */ H5T_t *copied_dt = NULL; /*do sorting in copied datatype */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(dt && H5T_ENUM==dt->shared->type); diff --git a/src/H5Tfields.c b/src/H5Tfields.c index be0b5f2..8f5e202 100644 --- a/src/H5Tfields.c +++ b/src/H5Tfields.c @@ -41,9 +41,6 @@ * Programmer: Robb Matzke * Monday, December 8, 1997 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with enumeration datatypes. *------------------------------------------------------------------------- */ int @@ -83,8 +80,6 @@ done: * Programmer: Raymond Lu * October 8, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -124,9 +119,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with enumeration datatypes. *------------------------------------------------------------------------- */ char * @@ -166,7 +158,6 @@ done: * Programmer: Raymond Lu * October 9, 2002 * - * Modifications: *------------------------------------------------------------------------- */ char * @@ -225,8 +216,6 @@ done: * Programmer: Raymond Lu * Thursday, April 4, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -394,8 +383,6 @@ H5T__sort_value(const H5T_t *dt, int *map) * Programmer: Robb Matzke * Monday, January 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Tfixed.c b/src/H5Tfixed.c index bc1d84d..5270a9a 100644 --- a/src/H5Tfixed.c +++ b/src/H5Tfixed.c @@ -37,9 +37,6 @@ * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived datatypes. *------------------------------------------------------------------------- */ H5T_sign_t @@ -75,8 +72,6 @@ done: * Programmer: Raymond Lu * October 8, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ H5T_sign_t @@ -115,10 +110,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived datatypes. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Tfloat.c b/src/H5Tfloat.c index 85e8f30..0d224db 100644 --- a/src/H5Tfloat.c +++ b/src/H5Tfloat.c @@ -194,10 +194,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived datatypes. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Tmodule.h b/src/H5Tmodule.h index d2ab08c..f8f57ac 100644 --- a/src/H5Tmodule.h +++ b/src/H5Tmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Toffset.c b/src/H5Toffset.c index c0e94fc..38c7e53 100644 --- a/src/H5Toffset.c +++ b/src/H5Toffset.c @@ -25,7 +25,7 @@ #include "H5Tpkg.h" /* Datatypes */ /* Static local functions */ -static herr_t H5T_set_offset(const H5T_t *dt, size_t offset); +static herr_t H5T__set_offset(const H5T_t *dt, size_t offset); @@ -163,10 +163,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Moved real work to a private function. - * *------------------------------------------------------------------------- */ herr_t @@ -191,7 +187,7 @@ H5Tset_offset(hid_t type_id, size_t offset) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for this datatype") /* Do the real work */ - if (H5T_set_offset(dt, offset)<0) + if (H5T__set_offset(dt, offset)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set offset") done: @@ -200,7 +196,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_set_offset + * Function: H5T__set_offset * * Purpose: Sets the bit offset of the first significant bit. The * significant bits of an atomic datum can be offset from the @@ -232,18 +228,14 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works for derived data types. - * *------------------------------------------------------------------------- */ static herr_t -H5T_set_offset(const H5T_t *dt, size_t offset) +H5T__set_offset(const H5T_t *dt, size_t offset) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Check args */ HDassert(dt); @@ -254,7 +246,7 @@ H5T_set_offset(const H5T_t *dt, size_t offset) HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); if (dt->shared->parent) { - if (H5T_set_offset(dt->shared->parent, offset)<0) + if (H5T__set_offset(dt->shared->parent, offset)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set offset for base type") /* Adjust size of datatype appropriately */ diff --git a/src/H5Topaque.c b/src/H5Topaque.c index 4e8f1d4..f7ce977 100644 --- a/src/H5Topaque.c +++ b/src/H5Topaque.c @@ -37,8 +37,6 @@ * Programmer: Robb Matzke * Thursday, May 20, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -84,8 +82,6 @@ done: * Programmer: Robb Matzke * Thursday, May 20, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ char * diff --git a/src/H5Torder.c b/src/H5Torder.c index b4babfa..7784c1d 100644 --- a/src/H5Torder.c +++ b/src/H5Torder.c @@ -50,7 +50,7 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5T_set_order(H5T_t *dtype, H5T_order_t order); +static herr_t H5T__set_order(H5T_t *dtype, H5T_order_t order); /*********************/ @@ -216,7 +216,7 @@ H5Tset_order(hid_t type_id, H5T_order_t order) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype is read-only") /* Call internal routine to set the order */ - if(H5T_set_order(dt, order) < 0) + if(H5T__set_order(dt, order) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "can't set order") done: @@ -225,7 +225,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_set_order + * Function: H5T__set_order * * Purpose: Private function to set the byte order for a datatype. * @@ -237,11 +237,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_set_order(H5T_t *dtype, H5T_order_t order) +H5T__set_order(H5T_t *dtype, H5T_order_t order) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC if(H5T_ENUM == dtype->shared->type && dtype->shared->u.enumer.nmembs > 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "operation not allowed after enum members are defined") @@ -274,12 +274,12 @@ H5T_set_order(H5T_t *dtype, H5T_order_t order) /* Loop through all fields of compound type, setting the order */ for(i = 0; i < nmemb; i++) - if(H5T_set_order(dtype->shared->u.compnd.memb[i].type, order) < 0) + if(H5T__set_order(dtype->shared->u.compnd.memb[i].type, order) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set order for compound member") } /* end if */ } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_set_order() */ +} /* end H5T__set_order() */ diff --git a/src/H5Tpad.c b/src/H5Tpad.c index c96f42a..450c567 100644 --- a/src/H5Tpad.c +++ b/src/H5Tpad.c @@ -38,10 +38,6 @@ * Programmer: Robb Matzke * Friday, January 9, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived data types. - * *------------------------------------------------------------------------- */ herr_t @@ -82,10 +78,6 @@ done: * Programmer: Robb Matzke * Friday, January 9, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived data types. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 3eaec8c..28521a6 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, December 8, 1997 * * Purpose: This file contains declarations which are visible only within @@ -1187,6 +1187,7 @@ H5_DLL int H5T__get_array_ndims(const H5T_t *dt); H5_DLL int H5T__get_array_dims(const H5T_t *dt, hsize_t dims[]); /* Reference functions */ +H5_DLL herr_t H5T__ref_reclaim(void *elem, const H5T_t *dt); H5_DLL htri_t H5T__ref_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc); /* Compound functions */ diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c index bd28fc2..9366332 100644 --- a/src/H5Tprecis.c +++ b/src/H5Tprecis.c @@ -25,7 +25,7 @@ #include "H5Tpkg.h" /* Datatypes */ /* Static local functions */ -static herr_t H5T_set_precision(const H5T_t *dt, size_t prec); +static herr_t H5T__set_precision(const H5T_t *dt, size_t prec); @@ -45,10 +45,6 @@ static herr_t H5T_set_precision(const H5T_t *dt, size_t prec); * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works for derived datatypes. - * *------------------------------------------------------------------------- */ size_t @@ -134,10 +130,6 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Moved real work to a private function. - * *------------------------------------------------------------------------- */ herr_t @@ -166,7 +158,7 @@ H5Tset_precision(hid_t type_id, size_t prec) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified datatype") /* Do the work */ - if (H5T_set_precision(dt, prec)<0) + if (H5T__set_precision(dt, prec)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "unable to set precision") done: @@ -175,7 +167,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_set_precision + * Function: H5T__set_precision * * Purpose: Sets the precision of a datatype. The precision is * the number of significant bits which, unless padding is @@ -197,19 +189,15 @@ done: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works for derived datatypes. - * *------------------------------------------------------------------------- */ static herr_t -H5T_set_precision(const H5T_t *dt, size_t prec) +H5T__set_precision(const H5T_t *dt, size_t prec) { size_t offset, size; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Check args */ HDassert(dt); @@ -220,7 +208,7 @@ H5T_set_precision(const H5T_t *dt, size_t prec) HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); if (dt->shared->parent) { - if (H5T_set_precision(dt->shared->parent, prec)<0) + if (H5T__set_precision(dt->shared->parent, prec)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "unable to set precision for base type") /* Adjust size of datatype appropriately */ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index e05bb4e..f7ca281 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -135,7 +135,6 @@ H5_DLL herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T_reclaim(hid_t type_id, struct H5S_t *space, void *buf); H5_DLL herr_t H5T_reclaim_cb(void *elem, const H5T_t *dt, unsigned ndim, const hsize_t *point, void *op_data); -H5_DLL herr_t H5T_ref_reclaim(void *elem, const H5T_t *dt); H5_DLL herr_t H5T_vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info); H5_DLL herr_t H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt); H5_DLL htri_t H5T_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc); diff --git a/src/H5Tref.c b/src/H5Tref.c index 42e3da2..44f61c0 100644 --- a/src/H5Tref.c +++ b/src/H5Tref.c @@ -1237,7 +1237,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_ref_reclaim + * Function: H5T__ref_reclaim * * Purpose: Internal routine to free reference datatypes * @@ -1246,11 +1246,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_ref_reclaim(void *elem, const H5T_t *dt) +H5T__ref_reclaim(void *elem, const H5T_t *dt) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE H5T_REF_LOG_DEBUG(""); /* Sanity checks */ @@ -1262,5 +1262,5 @@ H5T_ref_reclaim(void *elem, const H5T_t *dt) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_ref_reclaim() */ +} /* end H5T__ref_reclaim() */ diff --git a/src/H5Tstrpad.c b/src/H5Tstrpad.c index fa084f1..35de30b 100644 --- a/src/H5Tstrpad.c +++ b/src/H5Tstrpad.c @@ -41,10 +41,6 @@ * Programmer: Robb Matzke * Friday, January 9, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works for derived datatypes. - * *------------------------------------------------------------------------- */ H5T_str_t @@ -98,10 +94,6 @@ done: * Programmer: Robb Matzke * Friday, January 9, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works for derived datatypes. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Tvisit.c b/src/H5Tvisit.c index c706dee..00c7d8f 100644 --- a/src/H5Tvisit.c +++ b/src/H5Tvisit.c @@ -22,7 +22,7 @@ * * Created: H5Tvisit.c * Jul 19 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Visit all the components of a datatype * diff --git a/src/H5VLnative_link.c b/src/H5VLnative_link.c index ceb8d61..48bd2d8 100644 --- a/src/H5VLnative_link.c +++ b/src/H5VLnative_link.c @@ -75,7 +75,7 @@ H5VL__native_link_create(H5VL_link_create_type_t create_type, void *obj, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should be in the same file.") /* Create the link */ - if((ret_value = H5L_create_hard(cur_loc_p, cur_params->loc_data.loc_by_name.name, + if((ret_value = H5L__create_hard(cur_loc_p, cur_params->loc_data.loc_by_name.name, link_loc_p, loc_params->loc_data.loc_by_name.name, lcpl_id)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") } /* end if */ @@ -96,7 +96,7 @@ H5VL__native_link_create(H5VL_link_create_type_t create_type, void *obj, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Create the link */ - if((ret_value = H5L_create_soft(target_name, &link_loc, loc_params->loc_data.loc_by_name.name, lcpl_id)) < 0) + if((ret_value = H5L__create_soft(target_name, &link_loc, loc_params->loc_data.loc_by_name.name, lcpl_id)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") break; } @@ -161,7 +161,7 @@ H5VL__native_link_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, dst_loc_p = src_loc_p; /* Copy the link */ - if(H5L_move(src_loc_p, loc_params1->loc_data.loc_by_name.name, + if(H5L__move(src_loc_p, loc_params1->loc_data.loc_by_name.name, dst_loc_p, loc_params2->loc_data.loc_by_name.name, TRUE, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy link") @@ -206,7 +206,7 @@ H5VL__native_link_move(void *src_obj, const H5VL_loc_params_t *loc_params1, dst_loc_p = src_loc_p; /* Move the link */ - if(H5L_move(src_loc_p, loc_params1->loc_data.loc_by_name.name, + if(H5L__move(src_loc_p, loc_params1->loc_data.loc_by_name.name, dst_loc_p, loc_params2->loc_data.loc_by_name.name, FALSE, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") @@ -249,7 +249,7 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_ HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info") } /* end if */ else if(loc_params->type == H5VL_OBJECT_BY_IDX) { /* H5Lget_info_by_idx */ - if(H5L_get_info_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, + if(H5L__get_info_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n, linfo2) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info") } /* end else-if */ @@ -267,7 +267,7 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_ ssize_t *ret = HDva_arg(arguments, ssize_t *); /* Get the link name */ - if((*ret = H5L_get_name_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, + if((*ret = H5L__get_name_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n, name, size)) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info") @@ -282,12 +282,12 @@ H5VL__native_link_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_link_ /* Get the link information */ if(loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Lget_val */ - if(H5L_get_val(&loc, loc_params->loc_data.loc_by_name.name, buf, size) < 0) + if(H5L__get_val(&loc, loc_params->loc_data.loc_by_name.name, buf, size) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link value") } else if(loc_params->type == H5VL_OBJECT_BY_IDX) { /* H5Lget_val_by_idx */ - if(H5L_get_val_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, + if(H5L__get_val_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n, buf, size) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link val") } @@ -333,7 +333,7 @@ H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Check for the existence of the link */ - if((*ret = H5L_exists(&loc, loc_params->loc_data.loc_by_name.name)) < 0) + if((*ret = H5L__exists(&loc, loc_params->loc_data.loc_by_name.name)) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to specific link info") break; } @@ -392,11 +392,11 @@ H5VL__native_link_specific(void *obj, const H5VL_loc_params_t *loc_params, H5VL_ /* Unlink */ if(loc_params->type == H5VL_OBJECT_BY_NAME) { /* H5Ldelete */ - if(H5L_delete(&loc, loc_params->loc_data.loc_by_name.name) < 0) + if(H5L__delete(&loc, loc_params->loc_data.loc_by_name.name) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") } /* end if */ else if(loc_params->type == H5VL_OBJECT_BY_IDX) { /* H5Ldelete_by_idx */ - if(H5L_delete_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, + if(H5L__delete_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") } /* end else-if */ diff --git a/src/H5VLnative_object.c b/src/H5VLnative_object.c index 8f60ac4..bfbbee0 100644 --- a/src/H5VLnative_object.c +++ b/src/H5VLnative_object.c @@ -64,7 +64,7 @@ H5VL__native_object_open(void *obj, const H5VL_loc_params_t *loc_params, H5I_typ case H5VL_OBJECT_BY_IDX: { /* Open the object */ - if(NULL == (ret_value = H5O_open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, + if(NULL == (ret_value = H5O__open_by_idx(&loc, loc_params->loc_data.loc_by_idx.name, loc_params->loc_data.loc_by_idx.idx_type, loc_params->loc_data.loc_by_idx.order, loc_params->loc_data.loc_by_idx.n, opened_type))) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open object by index") break; @@ -80,7 +80,7 @@ H5VL__native_object_open(void *obj, const H5VL_loc_params_t *loc_params, H5I_typ HGOTO_ERROR(H5E_OHDR, H5E_CANTUNSERIALIZE, NULL, "can't deserialize object token into address") /* Open the object */ - if(NULL == (ret_value = H5O_open_by_addr(&loc, addr, opened_type))) + if(NULL == (ret_value = H5O__open_by_addr(&loc, addr, opened_type))) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open object by address") break; } @@ -122,8 +122,8 @@ H5VL__native_object_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, co HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Copy the object */ - if((ret_value = H5O_copy(&src_loc, src_name, &dst_loc, dst_name, ocpypl_id, lcpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "unable to copy object") + if((ret_value = H5O__copy(&src_loc, src_name, &dst_loc, dst_name, ocpypl_id, lcpl_id)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5VM.c b/src/H5VM.c index d12bea6..403cc45 100644 --- a/src/H5VM.c +++ b/src/H5VM.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, October 10, 1997 */ @@ -34,21 +34,21 @@ typedef struct H5VM_memcpy_ud_t { /* Local prototypes */ static void -H5VM_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, +H5VM__stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, const hsize_t *size, hsize_t *stride1); static void -H5VM_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, +H5VM__stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, const hsize_t *size, hsize_t *stride1, hsize_t *stride2); #ifdef LATER static void -H5VM_stride_copy2(hsize_t nelmts, hsize_t elmt_size, +H5VM__stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n, const hsize_t *dst_size, const ssize_t *dst_stride, void *_dst, unsigned src_n, const hsize_t *src_size, const ssize_t *src_stride, const void *_src); #endif /* LATER */ /*------------------------------------------------------------------------- - * Function: H5VM_stride_optimize1 + * Function: H5VM__stride_optimize1 * * Purpose: Given a stride vector which references elements of the * specified size, optimize the dimensionality, the stride @@ -63,21 +63,19 @@ H5VM_stride_copy2(hsize_t nelmts, hsize_t elmt_size, * Programmer: Robb Matzke * Saturday, October 11, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static void -H5VM_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, +H5VM__stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, const hsize_t *size, hsize_t *stride1) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - HDassert(1 == H5VM_vector_reduce_product(0, NULL)); + HDassert(1 == H5VM__vector_reduce_product(0, NULL)); /* * Combine adjacent memory accesses @@ -94,7 +92,7 @@ H5VM_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, /*------------------------------------------------------------------------- - * Function: H5VM_stride_optimize2 + * Function: H5VM__stride_optimize2 * * Purpose: Given two stride vectors which reference elements of the * specified size, optimize the dimensionality, the stride @@ -109,24 +107,19 @@ H5VM_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * Programmer: Robb Matzke * Saturday, October 11, 1997 * - * Modifications: - * Unrolled loops for common cases - * Quincey Koziol - * ?, ? ?, 2001? - * *------------------------------------------------------------------------- */ static void -H5VM_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, +H5VM__stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, const hsize_t *size, hsize_t *stride1, hsize_t *stride2) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - HDassert(1 == H5VM_vector_reduce_product(0, NULL)); + HDassert(1 == H5VM__vector_reduce_product(0, NULL)); HDassert(*elmt_size>0); /* @@ -247,11 +240,6 @@ H5VM_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * Programmer: Robb Matzke * Saturday, October 11, 1997 * - * Modifications: - * Unrolled loops for common cases - * Quincey Koziol - * ?, ? ?, 2001? - * *------------------------------------------------------------------------- */ hsize_t @@ -350,8 +338,6 @@ H5VM_hyper_stride(unsigned n, const hsize_t *size, * Programmer: Robb Matzke * Friday, October 17, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ htri_t @@ -401,8 +387,6 @@ done: * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -439,7 +423,7 @@ H5VM_hyper_fill(unsigned n, const hsize_t *_size, /* Compute an optimal destination stride vector */ dst_start = H5VM_hyper_stride(n, size, total_size, offset, dst_stride); - H5VM_stride_optimize1(&n, &elmt_size, size, dst_stride); + H5VM__stride_optimize1(&n, &elmt_size, size, dst_stride); /* Copy */ ret_value = H5VM_stride_fill(n, elmt_size, size, dst_stride, dst+dst_start, @@ -476,11 +460,6 @@ H5VM_hyper_fill(unsigned n, const hsize_t *_size, * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * Unrolled loops for common cases - * Quincey Koziol - * ?, ? ?, 2001? - * *------------------------------------------------------------------------- */ herr_t @@ -624,7 +603,7 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, #endif /* NO_INLINED_CODE */ /* Optimize the strides as a pair */ - H5VM_stride_optimize2(&n, &elmt_size, size, dst_stride, src_stride); + H5VM__stride_optimize2(&n, &elmt_size, size, dst_stride, src_stride); /* Perform the copy in terms of stride */ ret_value = H5VM_stride_copy(n, elmt_size, size, @@ -645,8 +624,6 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, * Programmer: Robb Matzke * Saturday, October 11, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -665,7 +642,7 @@ H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, HDassert(elmt_size < SIZET_MAX); H5VM_vector_cpy(n, idx, size); - nelmts = H5VM_vector_reduce_product(n, size); + nelmts = H5VM__vector_reduce_product(n, size); for (i=0; i0); @@ -918,8 +889,6 @@ H5VM_stride_copy2(hsize_t nelmts, hsize_t elmt_size, * Programmer: Quincey Koziol * Thursday, June 18, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -975,8 +944,6 @@ H5VM_array_fill(void *_dst, const void *src, size_t size, size_t count) * Programmer: Quincey Koziol * Monday, April 28, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -1056,8 +1023,6 @@ H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset) * Programmer: Quincey Koziol * Tuesday, June 22, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ hsize_t @@ -1140,8 +1105,6 @@ H5VM_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, * Programmer: Quincey Koziol * Wednesday, April 16, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index 26f59e2..eaa9657 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, October 10, 1997 */ #ifndef H5VMprivate_H @@ -28,16 +28,16 @@ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off, size_t len, void *udata); /* Vector comparison functions like Fortran66 comparison operators */ -#define H5VM_vector_eq_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)==0) -#define H5VM_vector_lt_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)<0) -#define H5VM_vector_gt_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)>0) -#define H5VM_vector_le_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)<=0) -#define H5VM_vector_ge_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)>=0) -#define H5VM_vector_eq_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)==0) -#define H5VM_vector_lt_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)<0) -#define H5VM_vector_gt_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)>0) -#define H5VM_vector_le_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)<=0) -#define H5VM_vector_ge_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)>=0) +#define H5VM_vector_eq_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) == 0) +#define H5VM_vector_lt_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) < 0) +#define H5VM_vector_gt_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) > 0) +#define H5VM_vector_le_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) <= 0) +#define H5VM_vector_ge_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) >= 0) +#define H5VM_vector_eq_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) == 0) +#define H5VM_vector_lt_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) < 0) +#define H5VM_vector_gt_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) > 0) +#define H5VM_vector_le_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) <= 0) +#define H5VM_vector_ge_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) >= 0) /* Other functions */ #define H5VM_vector_cpy(N,DST,SRC) { \ @@ -139,7 +139,7 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, /*------------------------------------------------------------------------- - * Function: H5VM_vector_reduce_product + * Function: H5VM__vector_reduce_product * * Purpose: Product reduction of a vector. Vector elements and return * value are size_t because we usually want the number of @@ -153,17 +153,15 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5_INLINE hsize_t H5_ATTR_UNUSED -H5VM_vector_reduce_product(unsigned n, const hsize_t *v) +H5VM__vector_reduce_product(unsigned n, const hsize_t *v) { hsize_t ret_value = 1; - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ + FUNC_ENTER_STATIC_NOERR if (n && !v) HGOTO_DONE(0) while (n--) ret_value *= *v++; @@ -173,7 +171,7 @@ done: } /*------------------------------------------------------------------------- - * Function: H5VM_vector_zerop_u + * Function: H5VM__vector_zerop_u * * Purpose: Determines if all elements of a vector are zero. * @@ -185,17 +183,15 @@ done: * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5_INLINE htri_t H5_ATTR_UNUSED -H5VM_vector_zerop_u(int n, const hsize_t *v) +H5VM__vector_zerop_u(int n, const hsize_t *v) { htri_t ret_value=TRUE; /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ + FUNC_ENTER_STATIC_NOERR if (!v) HGOTO_DONE(TRUE) @@ -220,8 +216,6 @@ done: * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5_INLINE htri_t H5_ATTR_UNUSED @@ -229,8 +223,8 @@ H5VM_vector_zerop_s(int n, const hssize_t *v) { htri_t ret_value=TRUE; /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ + FUNC_ENTER_STATIC_NOERR if (!v) HGOTO_DONE(TRUE) @@ -243,7 +237,7 @@ done: } /*------------------------------------------------------------------------- - * Function: H5VM_vector_cmp_u + * Function: H5VM__vector_cmp_u * * Purpose: Compares two vectors of the same size and determines if V1 is * lexicographically less than, equal, or greater than V2. @@ -257,17 +251,15 @@ done: * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5_INLINE int H5_ATTR_UNUSED -H5VM_vector_cmp_u (unsigned n, const hsize_t *v1, const hsize_t *v2) +H5VM__vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2) { int ret_value=0; /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ + FUNC_ENTER_STATIC_NOERR if (v1 == v2) HGOTO_DONE(0) if (v1 == NULL) HGOTO_DONE(-1) @@ -285,7 +277,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5VM_vector_cmp_s + * Function: H5VM__vector_cmp_s * * Purpose: Compares two vectors of the same size and determines if V1 is * lexicographically less than, equal, or greater than V2. @@ -299,17 +291,15 @@ done: * Programmer: Robb Matzke * Wednesday, April 8, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5_INLINE int H5_ATTR_UNUSED -H5VM_vector_cmp_s (unsigned n, const hssize_t *v1, const hssize_t *v2) +H5VM__vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2) { int ret_value=0; /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ + FUNC_ENTER_STATIC_NOERR if (v1 == v2) HGOTO_DONE(0) if (v1 == NULL) HGOTO_DONE(-1) @@ -327,7 +317,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5VM_vector_inc + * Function: H5VM__vector_inc * * Purpose: Increments V1 by V2 * @@ -336,12 +326,10 @@ done: * Programmer: Robb Matzke * Monday, October 13, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5_INLINE void H5_ATTR_UNUSED -H5VM_vector_inc(int n, hsize_t *v1, const hsize_t *v2) +H5VM__vector_inc(int n, hsize_t *v1, const hsize_t *v2) { while (n--) *v1++ += *v2++; } @@ -369,7 +357,7 @@ static const unsigned char LogTable256[] = /*------------------------------------------------------------------------- - * Function: H5VM_log2_gen + * Function: H5VM__log2_gen * * Purpose: Determines the log base two of a number (i.e. log2(n)). * (i.e. the highest bit set in a number) @@ -388,7 +376,7 @@ static const unsigned char LogTable256[] = *------------------------------------------------------------------------- */ static H5_INLINE unsigned H5_ATTR_UNUSED -H5VM_log2_gen(uint64_t n) +H5VM__log2_gen(uint64_t n) { unsigned r; /* r will be log2(n) */ register unsigned int t, tt, ttt; /* temporaries */ @@ -406,7 +394,7 @@ H5VM_log2_gen(uint64_t n) r = (t = (unsigned)(n >> 8)) ? 8 + (unsigned)LogTable256[t] : (unsigned)LogTable256[(uint8_t)n]; return(r); -} /* H5VM_log2_gen() */ +} /* H5VM__log2_gen() */ /* Lookup table for specialized log2(n) of power of two routine */ @@ -418,7 +406,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = /*------------------------------------------------------------------------- - * Function: H5VM_log2_of2 + * Function: H5VM__log2_of2 * * Purpose: Determines the log base two of a number (i.e. log2(n)). * (i.e. the highest bit set in a number) @@ -436,17 +424,17 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = *------------------------------------------------------------------------- */ static H5_INLINE H5_ATTR_PURE unsigned -H5VM_log2_of2(uint32_t n) +H5VM__log2_of2(uint32_t n) { #ifndef NDEBUG HDassert(POWER_OF_TWO(n)); #endif /* NDEBUG */ return(MultiplyDeBruijnBitPosition[(n * (uint32_t)0x077CB531UL) >> 27]); -} /* H5VM_log2_of2() */ +} /* H5VM__log2_of2() */ /*------------------------------------------------------------------------- - * Function: H5VM_power2up + * Function: H5VM__power2up * * Purpose: Round up a number to the next power of 2 * @@ -457,7 +445,7 @@ H5VM_log2_of2(uint32_t n) *------------------------------------------------------------------------- */ static H5_INLINE H5_ATTR_CONST hsize_t -H5VM_power2up(hsize_t n) +H5VM__power2up(hsize_t n) { hsize_t ret_value = 1; /* Return value */ @@ -469,11 +457,11 @@ H5VM_power2up(hsize_t n) ret_value <<= 1; return(ret_value); -} /* H5VM_power2up */ +} /* H5VM__power2up */ /*------------------------------------------------------------------------- - * Function: H5VM_limit_enc_size + * Function: H5VM__limit_enc_size * * Purpose: Determine the # of bytes needed to encode values within a * range from 0 to a given limit @@ -486,17 +474,17 @@ H5VM_power2up(hsize_t n) *------------------------------------------------------------------------- */ static H5_INLINE unsigned H5_ATTR_UNUSED -H5VM_limit_enc_size(uint64_t limit) +H5VM__limit_enc_size(uint64_t limit) { - return (H5VM_log2_gen(limit) / 8) + 1; -} /* end H5VM_limit_enc_size() */ + return (H5VM__log2_gen(limit) / 8) + 1; +} /* end H5VM__limit_enc_size() */ static const unsigned char H5VM_bit_set_g[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE}; /*------------------------------------------------------------------------- - * Function: H5VM_bit_get + * Function: H5VM__bit_get * * Purpose: Determine the value of the n'th bit in a buffer. * @@ -515,15 +503,15 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, *------------------------------------------------------------------------- */ static H5_INLINE hbool_t H5_ATTR_UNUSED -H5VM_bit_get(const unsigned char *buf, size_t offset) +H5VM__bit_get(const unsigned char *buf, size_t offset) { /* Test the appropriate bit in the buffer */ return (hbool_t)((buf[offset / 8] & (H5VM_bit_set_g[offset % 8])) ? TRUE : FALSE); -} /* end H5VM_bit_get() */ +} /* end H5VM__bit_get() */ /*------------------------------------------------------------------------- - * Function: H5VM_bit_set + * Function: H5VM__bit_set * * Purpose: Set/reset the n'th bit in a buffer. * @@ -542,14 +530,14 @@ H5VM_bit_get(const unsigned char *buf, size_t offset) *------------------------------------------------------------------------- */ static H5_INLINE void H5_ATTR_UNUSED -H5VM_bit_set(unsigned char *buf, size_t offset, hbool_t val) +H5VM__bit_set(unsigned char *buf, size_t offset, hbool_t val) { /* Set/reset the appropriate bit in the buffer */ if(val) buf[offset / 8] |= H5VM_bit_set_g[offset % 8]; else buf[offset / 8] &= H5VM_bit_clear_g[offset % 8]; -} /* end H5VM_bit_set() */ +} /* end H5VM__bit_set() */ #endif /* H5VMprivate_H */ diff --git a/src/H5WB.c b/src/H5WB.c index 8a85a3a..abeaf63 100644 --- a/src/H5WB.c +++ b/src/H5WB.c @@ -15,7 +15,7 @@ * * Created: H5WB.c * Jun 26 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Implements the "wrapped buffer" code for wrapping * an existing [staticly sized] buffer, in order to @@ -97,7 +97,6 @@ H5FL_BLK_DEFINE_STATIC(extra_buf); * NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 26 2007 * *------------------------------------------------------------------------- @@ -151,7 +150,6 @@ done: * NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 26 2007 * *------------------------------------------------------------------------- @@ -219,7 +217,6 @@ done: * NULL on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 26 2007 * *------------------------------------------------------------------------- @@ -257,7 +254,6 @@ done: * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol - * koziol@hdfgroup.org * Jun 26 2007 * *------------------------------------------------------------------------- diff --git a/src/H5WBprivate.h b/src/H5WBprivate.h index 4460808..3ec9261 100644 --- a/src/H5WBprivate.h +++ b/src/H5WBprivate.h @@ -15,7 +15,7 @@ * * Created: H5WBprivate.h * Jun 26 2007 - * Quincey Koziol + * Quincey Koziol * * Purpose: Private header for library accessible wrapped buffer routines. * diff --git a/src/H5Z.c b/src/H5Z.c index 3bd4bcb..616db1f 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -68,7 +68,7 @@ static H5Z_stats_t *H5Z_stat_table_g = NULL; #endif /* H5Z_DEBUG */ /* Local functions */ -static int H5Z_find_idx(H5Z_filter_t id); +static int H5Z__find_idx(H5Z_filter_t id); static int H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t obj_id, void *key); static int H5Z__check_unregister_group_cb(void *obj_ptr, hid_t obj_id, void *key); static int H5Z__flush_file_cb(void *obj_ptr, hid_t obj_id, void *key); @@ -713,7 +713,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_prelude_callback + * Function: H5Z__prelude_callback * * Purpose: Makes a dataset creation "prelude" callback for the "can_apply" * or "set_local" routines. @@ -726,14 +726,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, +H5Z__prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, hid_t space_id, H5Z_prelude_type_t prelude_type) { H5Z_class2_t *fclass; /* Individual filter information */ size_t u; /* Local index variable */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(pline->nused > 0); @@ -791,11 +791,11 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_prelude_callback() */ +} /* end H5Z__prelude_callback() */ /*------------------------------------------------------------------------- - * Function: H5Z_prepare_prelude_callback_dcpl + * Function: H5Z__prepare_prelude_callback_dcpl * * Purpose: Prepares to make a dataset creation "prelude" callback * for the "can_apply" or "set_local" routines. @@ -808,13 +808,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type) +H5Z__prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type) { hid_t space_id = -1; /* ID for dataspace describing chunk */ H5O_layout_t *dcpl_layout = NULL; /* Dataset's layout information */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); HDassert(H5I_DATATYPE == H5I_get_type(type_id)); @@ -862,7 +862,7 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type } /* Make the callbacks */ - if (H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) + if (H5Z__prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") } } @@ -876,7 +876,7 @@ done: dcpl_layout = (H5O_layout_t *)H5MM_xfree(dcpl_layout); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_prepare_prelude_callback_dcpl() */ +} /* end H5Z__prepare_prelude_callback_dcpl() */ /*------------------------------------------------------------------------- @@ -902,7 +902,7 @@ H5Z_can_apply(hid_t dcpl_id, hid_t type_id) FUNC_ENTER_NOAPI(FAIL) /* Make "can apply" callbacks for filters in pipeline */ - if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) + if (H5Z__prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: @@ -933,7 +933,7 @@ H5Z_set_local(hid_t dcpl_id, hid_t type_id) FUNC_ENTER_NOAPI(FAIL) /* Make "set local" callbacks for filters in pipeline */ - if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) + if (H5Z__prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: @@ -962,7 +962,7 @@ H5Z_can_apply_direct(const H5O_pline_t *pline) HDassert(pline->nused > 0); /* Make "can apply" callbacks for filters in pipeline */ - if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) + if (H5Z__prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: @@ -995,7 +995,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline) HDassert(pline->nused > 0); /* Make "set local" callbacks for filters in pipeline */ - if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) + if (H5Z__prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: @@ -1168,7 +1168,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_find_idx + * Function: H5Z__find_idx * * Purpose: Given a filter ID return the offset in the global array * that holds all the registered filters. @@ -1178,20 +1178,20 @@ done: *------------------------------------------------------------------------- */ static int -H5Z_find_idx(H5Z_filter_t id) +H5Z__find_idx(H5Z_filter_t id) { size_t i; /* Local index variable */ int ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - for (i = 0; i < H5Z_table_used_g; i++) - if (H5Z_table_g[i].id == id) + for(i = 0; i < H5Z_table_used_g; i++) + if(H5Z_table_g[i].id == id) HGOTO_DONE((int)i) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_find_idx() */ +} /* end H5Z__find_idx() */ /*------------------------------------------------------------------------- @@ -1213,7 +1213,7 @@ H5Z_find(H5Z_filter_t id) FUNC_ENTER_NOAPI(NULL) /* Get the index in the global table */ - if ((idx = H5Z_find_idx(id)) < 0) + if ((idx = H5Z__find_idx(id)) < 0) HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "required filter %d is not registered", id) /* Set return value */ @@ -1290,7 +1290,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, * indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"), * try to load it dynamically and register it. Otherwise, return failure */ - if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { H5PL_key_t key; const H5Z_class2_t *filter_info; hbool_t issue_error = FALSE; @@ -1303,7 +1303,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) + if((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) issue_error = TRUE; } else @@ -1365,7 +1365,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, failed |= (unsigned)1 << idx; continue; /* filter excluded */ } - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + if((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) { /* Check if filter is optional -- If it isn't, then error */ if((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered") diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index 6d7b87e..09cca14 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, August 27, 1999 */ @@ -34,26 +34,26 @@ #endif /* Local function prototypes */ -static size_t H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, +static size_t H5Z__filter_deflate (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ const H5Z_class2_t H5Z_DEFLATE[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_DEFLATE, /* Filter id number */ - 1, /* encoder_present flag (set to true) */ - 1, /* decoder_present flag (set to true) */ + 1, /* encoder_present flag (set to true) */ + 1, /* decoder_present flag (set to true) */ "deflate", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - H5Z_filter_deflate, /* The actual filter function */ + H5Z__filter_deflate, /* The actual filter function */ }}; #define H5Z_DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s)) * (double)1.001f) + 12) /*------------------------------------------------------------------------- - * Function: H5Z_filter_deflate + * Function: H5Z__filter_deflate * * Purpose: Implement an I/O filter around the 'deflate' algorithm in * libz @@ -64,12 +64,10 @@ const H5Z_class2_t H5Z_DEFLATE[1] = {{ * Programmer: Robb Matzke * Thursday, April 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t -H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, +H5Z__filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { @@ -77,7 +75,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, int status; /* Status from zlib operation */ size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI(0) + FUNC_ENTER_STATIC /* Sanity check */ HDassert(*buf_size > 0); diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index c40e9b4..07e2f79 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -26,26 +26,26 @@ #include "H5Zpkg.h" /* Data filters */ /* Local function prototypes */ -static size_t H5Z_filter_fletcher32 (unsigned flags, size_t cd_nelmts, +static size_t H5Z__filter_fletcher32(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ const H5Z_class2_t H5Z_FLETCHER32[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_FLETCHER32, /* Filter id number */ - 1, /* encoder_present flag (set to true) */ - 1, /* decoder_present flag (set to true) */ + 1, /* encoder_present flag (set to true) */ + 1, /* decoder_present flag (set to true) */ "fletcher32", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ - H5Z_filter_fletcher32, /* The actual filter function */ + H5Z__filter_fletcher32, /* The actual filter function */ }}; #define FLETCHER_LEN 4 /*------------------------------------------------------------------------- - * Function: H5Z_filter_fletcher32 + * Function: H5Z__filter_fletcher32 * * Purpose: Implement an I/O filter of Fletcher32 Checksum * @@ -55,21 +55,10 @@ const H5Z_class2_t H5Z_FLETCHER32[1] = {{ * Programmer: Raymond Lu * Jan 3, 2003 * - * Modifications: - * Raymond Lu - * July 8, 2005 - * There was a bug in the calculating code of the Fletcher32 - * checksum in the library before v1.6.3. The checksum - * value wasn't consistent between big-endian and little-endian - * systems. This bug was fixed in Release 1.6.3. However, - * after fixing the bug, the checksum value is no longer the - * same as before on little-endian system. We'll check both - * the correct checksum and the wrong checksum to be consistent - * with Release 1.6.2 and before. *------------------------------------------------------------------------- */ static size_t -H5Z_filter_fletcher32 (unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts, const unsigned H5_ATTR_UNUSED cd_values[], +H5Z__filter_fletcher32(unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts, const unsigned H5_ATTR_UNUSED cd_values[], size_t nbytes, size_t *buf_size, void **buf) { void *outbuf = NULL; /* Pointer to new buffer */ @@ -80,7 +69,7 @@ H5Z_filter_fletcher32 (unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts, const un uint8_t tmp; size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI(0) + FUNC_ENTER_STATIC HDassert(sizeof(uint32_t)>=4); diff --git a/src/H5Zmodule.h b/src/H5Zmodule.h index 97e158c..e4fd90c 100644 --- a/src/H5Zmodule.h +++ b/src/H5Zmodule.h @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, September 12, 2015 * * Purpose: This file contains declarations which define macros for the diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 8c0e876..d29343b 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -34,34 +34,34 @@ typedef struct { } parms_atomic; /* Local function prototypes */ -static htri_t H5Z_can_apply_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static herr_t H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static size_t H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +static htri_t H5Z__can_apply_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static herr_t H5Z__set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static size_t H5Z__filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); -static void H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms); -static void H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms); -static herr_t H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms); -static herr_t H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms); +static void H5Z__calc_parms_nooptype(size_t *cd_values_actual_nparms); +static void H5Z__calc_parms_atomic(size_t *cd_values_actual_nparms); +static herr_t H5Z__calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms); +static herr_t H5Z__calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms); -static herr_t H5Z_set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, +static herr_t H5Z__set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[]); -static herr_t H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, +static herr_t H5Z__set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], hbool_t *need_not_compress); -static herr_t H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, +static herr_t H5Z__set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], hbool_t *need_not_compress); -static herr_t H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, +static herr_t H5Z__set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], hbool_t *need_not_compress); -static void H5Z_nbit_next_byte(size_t *j, size_t *buf_len); -static void H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, +static void H5Z__nbit_next_byte(size_t *j, size_t *buf_len); +static void H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p, size_t datatype_len); -static void H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, +static void H5Z__nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p, size_t datatype_len); -static void H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, +static void H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, unsigned size); -static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, +static void H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p); static herr_t H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const unsigned parms[], @@ -71,29 +71,27 @@ static herr_t H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data unsigned *parms_index); static herr_t H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, const unsigned parms[]); -static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, +static void H5Z__nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, unsigned size); -static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p); -static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, +static void H5Z__nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const unsigned parms[], unsigned *parms_index); -static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, +static void H5Z__nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const unsigned parms[], unsigned *parms_index); -static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, +static void H5Z__nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t *buffer_size, const unsigned parms[]); /* This message derives from H5Z */ H5Z_class2_t H5Z_NBIT[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_NBIT, /* Filter id number */ - 1, /* Assume encoder present: check before registering */ - 1, /* decoder_present flag (set to true) */ - "nbit", /* Filter name for debugging */ - H5Z_can_apply_nbit, /* The "can apply" callback */ - H5Z_set_local_nbit, /* The "set local" callback */ - H5Z_filter_nbit, /* The actual filter function */ + 1, /* Assume encoder present: check before registering */ + 1, /* decoder_present flag (set to true) */ + "nbit", /* Filter name for debugging */ + H5Z__can_apply_nbit, /* The "can apply" callback */ + H5Z__set_local_nbit, /* The "set local" callback */ + H5Z__filter_nbit, /* The actual filter function */ }}; /* Local macros */ @@ -109,7 +107,7 @@ H5Z_class2_t H5Z_NBIT[1] = {{ /*------------------------------------------------------------------------- - * Function: H5Z_can_apply_nbit + * Function: H5Z__can_apply_nbit * * Purpose: Check the parameters for nbit compression for validity and * whether they fit a particular dataset. @@ -120,17 +118,15 @@ H5Z_class2_t H5Z_NBIT[1] = {{ * Programmer: Xiaowen Wu * Tuesday, December 21, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static htri_t -H5Z_can_apply_nbit(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) +H5Z__can_apply_nbit(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { const H5T_t *type; /* Datatype */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -146,11 +142,11 @@ H5Z_can_apply_nbit(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UN done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_can_apply_nbit() */ +} /* end H5Z__can_apply_nbit() */ /*------------------------------------------------------------------------- - * Function: H5Z_calc_parms_nooptype + * Function: H5Z__calc_parms_nooptype * * Purpose: Calculate the number of parameters of array cd_values[] * of datatype that is not integer, nor floating-point, nor @@ -159,12 +155,10 @@ done: * Programmer: Xiaowen Wu * Thursday, March 3, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static void -H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms) +H5Z__calc_parms_nooptype(size_t *cd_values_actual_nparms) { /* Store datatype class code */ *cd_values_actual_nparms += 1; @@ -175,7 +169,7 @@ H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms) /*------------------------------------------------------------------------- - * Function: H5Z_calc_parms_atomic + * Function: H5Z__calc_parms_atomic * * Purpose: Calculate the number of parameters of array cd_values[] * of atomic datatype whose datatype class is integer @@ -184,12 +178,10 @@ H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms) * Programmer: Xiaowen Wu * Saturday, January 29, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static void -H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms) +H5Z__calc_parms_atomic(size_t *cd_values_actual_nparms) { /* Store datatype class code */ *cd_values_actual_nparms += 1; @@ -209,7 +201,7 @@ H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms) /*------------------------------------------------------------------------- - * Function: H5Z_calc_parms_array + * Function: H5Z__calc_parms_array * * Purpose: Calculate the number of parameters of array cd_values[] * for a given datatype identifier type_id @@ -221,18 +213,16 @@ H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms) * Programmer: Xiaowen Wu * Wednesday, January 19, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms) +H5Z__calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms) { H5T_t *dtype_base = NULL; /* Array datatype's base datatype */ H5T_class_t dtype_base_class; /* Array datatype's base datatype's class */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Store datatype class code */ *cd_values_actual_nparms += 1; @@ -252,16 +242,16 @@ H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms) switch(dtype_base_class) { case H5T_INTEGER: case H5T_FLOAT: - H5Z_calc_parms_atomic(cd_values_actual_nparms); + H5Z__calc_parms_atomic(cd_values_actual_nparms); break; case H5T_ARRAY: - if(H5Z_calc_parms_array(dtype_base, cd_values_actual_nparms) == FAIL) + if(H5Z__calc_parms_array(dtype_base, cd_values_actual_nparms) == FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; case H5T_COMPOUND: - if(H5Z_calc_parms_compound(dtype_base, cd_values_actual_nparms) == FAIL) + if(H5Z__calc_parms_compound(dtype_base, cd_values_actual_nparms) == FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; @@ -273,7 +263,7 @@ H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms) case H5T_ENUM: case H5T_VLEN: /* Other datatype classes: nbit does no compression */ - H5Z_calc_parms_nooptype(cd_values_actual_nparms); + H5Z__calc_parms_nooptype(cd_values_actual_nparms); break; case H5T_NO_CLASS: @@ -290,11 +280,11 @@ done: HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close base datatype") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_calc_parms_array() */ +} /* end H5Z__calc_parms_array() */ /*------------------------------------------------------------------------- - * Function: H5Z_calc_parms_compound + * Function: H5Z__calc_parms_compound * * Purpose: Calculate the number of parameters of array cd_values[] * for a given datatype identifier type_id @@ -306,19 +296,17 @@ done: * Programmer: Xiaowen Wu * Wednesday, January 19, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms) +H5Z__calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms) { int nmembers; /* Compound datatype's number of members */ H5T_t *dtype_member = NULL; /* Compound datatype's member datatype */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Store compound datatype class code */ *cd_values_actual_nparms += 1; @@ -352,16 +340,16 @@ H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms) switch(dtype_member_class) { case H5T_INTEGER: case H5T_FLOAT: - H5Z_calc_parms_atomic(cd_values_actual_nparms); + H5Z__calc_parms_atomic(cd_values_actual_nparms); break; case H5T_ARRAY: - if(H5Z_calc_parms_array(dtype_member, cd_values_actual_nparms) == FAIL) + if(H5Z__calc_parms_array(dtype_member, cd_values_actual_nparms) == FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; case H5T_COMPOUND: - if(H5Z_calc_parms_compound(dtype_member, cd_values_actual_nparms) == FAIL) + if(H5Z__calc_parms_compound(dtype_member, cd_values_actual_nparms) == FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; @@ -373,7 +361,7 @@ H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms) case H5T_ENUM: case H5T_VLEN: /* Other datatype classes: nbit does no compression */ - H5Z_calc_parms_nooptype(cd_values_actual_nparms); + H5Z__calc_parms_nooptype(cd_values_actual_nparms); break; case H5T_NO_CLASS: @@ -400,7 +388,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_set_parms_nooptype + * Function: H5Z__set_parms_nooptype * * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is not integer, nor @@ -413,17 +401,15 @@ done: * Programmer: Xiaowen Wu * Tuesday, April 5, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[]) +H5Z__set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[]) { size_t dtype_size; /* No-op datatype's size (in bytes) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set datatype class code */ cd_values[(*cd_values_index)++] = H5Z_NBIT_NOOPTYPE; @@ -438,11 +424,11 @@ H5Z_set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_parms_nooptype() */ +} /* end H5Z__set_parms_nooptype() */ /*------------------------------------------------------------------------- - * Function: H5Z_set_parms_atomic + * Function: H5Z__set_parms_atomic * * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is integer or floating point @@ -453,12 +439,10 @@ done: * Programmer: Xiaowen Wu * Tuesday, January 11, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, +H5Z__set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], hbool_t *need_not_compress) { H5T_order_t dtype_order; /* Atomic datatype's endianness order */ @@ -468,7 +452,7 @@ H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned dtype_offset; /* Atomic datatype's offset (in bits) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set datatype class code */ cd_values[(*cd_values_index)++] = H5Z_NBIT_ATOMIC; @@ -532,11 +516,11 @@ H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, *need_not_compress = FALSE; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_parms_atomic() */ +} /* end H5Z__set_parms_atomic() */ /*------------------------------------------------------------------------- - * Function: H5Z_set_parms_array + * Function: H5Z__set_parms_array * * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is array datatype @@ -547,12 +531,10 @@ done: * Programmer: Xiaowen Wu * Tuesday, April 5, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, +H5Z__set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], hbool_t *need_not_compress) { H5T_t *dtype_base = NULL; /* Array datatype's base datatype */ @@ -561,7 +543,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, htri_t is_vlstring; /* flag indicating if datatype is variable-length string */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set datatype class code */ cd_values[(*cd_values_index)++] = H5Z_NBIT_ARRAY; @@ -586,17 +568,17 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, switch(dtype_base_class) { case H5T_INTEGER: case H5T_FLOAT: - if(H5Z_set_parms_atomic(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) + if(H5Z__set_parms_atomic(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_ARRAY: - if(H5Z_set_parms_array(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) + if(H5Z__set_parms_array(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_COMPOUND: - if(H5Z_set_parms_compound(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) + if(H5Z__set_parms_compound(dtype_base, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -609,7 +591,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, if(dtype_base_class == H5T_VLEN || is_vlstring) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "datatype not supported by nbit") - if(H5Z_set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0) + if(H5Z__set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -619,7 +601,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, case H5T_OPAQUE: case H5T_REFERENCE: case H5T_ENUM: - if(H5Z_set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0) + if(H5Z__set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -637,11 +619,11 @@ done: HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close base datatype") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_parms_array() */ +} /* end H5Z__set_parms_array() */ /*------------------------------------------------------------------------- - * Function: H5Z_set_parms_compound + * Function: H5Z__set_parms_compound * * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is compound datatype @@ -652,12 +634,10 @@ done: * Programmer: Xiaowen Wu * Tuesday, April 5, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, +H5Z__set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], hbool_t *need_not_compress) { int snmembers; /* Compound datatype's number of members */ @@ -671,7 +651,7 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set "local" parameter for compound datatype class code */ cd_values[(*cd_values_index)++] = H5Z_NBIT_COMPOUND; @@ -713,17 +693,17 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, switch(dtype_member_class) { case H5T_INTEGER: case H5T_FLOAT: - if(H5Z_set_parms_atomic(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) + if(H5Z__set_parms_atomic(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_ARRAY: - if(H5Z_set_parms_array(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) + if(H5Z__set_parms_array(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_COMPOUND: - if(H5Z_set_parms_compound(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) + if(H5Z__set_parms_compound(dtype_member, cd_values_index, cd_values, need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -761,7 +741,7 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, case H5T_REFERENCE: case H5T_ENUM: /* other datatype that nbit does no compression */ - if(H5Z_set_parms_nooptype(dtype_member, cd_values_index, cd_values) < 0) + if(H5Z__set_parms_nooptype(dtype_member, cd_values_index, cd_values) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -789,7 +769,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_set_local_nbit + * Function: H5Z__set_local_nbit * * Purpose: Set the "local" dataset parameters for nbit compression. * @@ -799,12 +779,10 @@ done: * Programmer: Xiaowen Wu * Tuesday, January 11, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) +H5Z__set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) { H5P_genplist_t *dcpl_plist; /* Property list pointer */ const H5T_t *type; /* Datatype */ @@ -819,7 +797,7 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) hbool_t need_not_compress; /* Flag if TRUE indicating no need to do nbit compression */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -839,16 +817,16 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) switch(dtype_class) { case H5T_INTEGER: case H5T_FLOAT: - H5Z_calc_parms_atomic(&cd_values_actual_nparms); + H5Z__calc_parms_atomic(&cd_values_actual_nparms); break; case H5T_ARRAY: - if(H5Z_calc_parms_array(type, &cd_values_actual_nparms) < 0) + if(H5Z__calc_parms_array(type, &cd_values_actual_nparms) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; case H5T_COMPOUND: - if(H5Z_calc_parms_compound(type, &cd_values_actual_nparms) < 0) + if(H5Z__calc_parms_compound(type, &cd_values_actual_nparms) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype") break; @@ -909,17 +887,17 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) switch(dtype_class) { case H5T_INTEGER: case H5T_FLOAT: - if(H5Z_set_parms_atomic(type, &cd_values_index, cd_values, &need_not_compress) < 0) + if(H5Z__set_parms_atomic(type, &cd_values_index, cd_values, &need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_ARRAY: - if(H5Z_set_parms_array(type, &cd_values_index, cd_values, &need_not_compress) < 0) + if(H5Z__set_parms_array(type, &cd_values_index, cd_values, &need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; case H5T_COMPOUND: - if(H5Z_set_parms_compound(type, &cd_values_index, cd_values, &need_not_compress) < 0) + if(H5Z__set_parms_compound(type, &cd_values_index, cd_values, &need_not_compress) < 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype") break; @@ -958,11 +936,11 @@ done: H5MM_xfree(cd_values); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_local_nbit() */ +} /* end H5Z__set_local_nbit() */ /*------------------------------------------------------------------------- - * Function: H5Z_filter_nbit + * Function: H5Z__filter_nbit * * Purpose: Implement an I/O filter for storing packed nbit data * @@ -975,7 +953,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +H5Z__filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { unsigned char *outbuf; /* pointer to new output buffer */ @@ -983,7 +961,7 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], unsigned d_nelmts = 0; /* number of elements in the chunk */ size_t ret_value = 0; /* return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments * cd_values[0] stores actual number of parameters in cd_values[] @@ -1023,7 +1001,7 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for nbit compression") /* compress the buffer, size_out will be changed */ - H5Z_nbit_compress((unsigned char *)*buf, d_nelmts, outbuf, &size_out, cd_values); + H5Z__nbit_compress((unsigned char *)*buf, d_nelmts, outbuf, &size_out, cd_values); } /* end else */ /* free the input buffer */ @@ -1036,7 +1014,7 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_filter_nbit() */ +} /* end H5Z__filter_nbit() */ /* ======== Nbit Algorithm =============================================== * assume one byte has 8 bit @@ -1047,14 +1025,14 @@ done: */ static void -H5Z_nbit_next_byte(size_t *j, size_t *buf_len) +H5Z__nbit_next_byte(size_t *j, size_t *buf_len) { ++(*j); *buf_len = 8 * sizeof(unsigned char); } static void -H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, +H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p, size_t datatype_len) { @@ -1088,7 +1066,7 @@ H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k data[data_offset + k] = (unsigned char)( ((val & ~((unsigned)(~0) << *buf_len)) << (dat_len - *buf_len)) << dat_offset); dat_len -= *buf_len; - H5Z_nbit_next_byte(j, buf_len); + H5Z__nbit_next_byte(j, buf_len); if(dat_len == 0) return; @@ -1100,7 +1078,7 @@ H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k } static void -H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, +H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, unsigned size) { unsigned i; /* index */ @@ -1114,7 +1092,7 @@ H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, data[data_offset + i] = (unsigned char)(((val & ~((unsigned)(~0) << *buf_len)) << (dat_len - *buf_len))); dat_len -= *buf_len; - H5Z_nbit_next_byte(j, buf_len); + H5Z__nbit_next_byte(j, buf_len); if(dat_len == 0) continue; @@ -1125,7 +1103,7 @@ H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, } static void -H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, +H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p) { /* begin_i: the index of byte having first significant bit @@ -1145,7 +1123,7 @@ H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, end_i = p->offset / 8; for(k = (int)begin_i; k >= (int)end_i; k--) - H5Z_nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, + H5Z__nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); } else { /* big endian */ @@ -1160,7 +1138,7 @@ H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, end_i = ((unsigned)datatype_len - p->offset) / 8 - 1; for(k = (int)begin_i; k <= (int)end_i; k++) - H5Z_nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, + H5Z__nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); } } @@ -1192,7 +1170,7 @@ H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, n = total_size / p.size; for(i = 0; i < n; i++) - H5Z_nbit_decompress_one_atomic(data, data_offset + i * p.size, + H5Z__nbit_decompress_one_atomic(data, data_offset + i * p.size, buffer, j, buf_len, &p); break; @@ -1222,7 +1200,7 @@ H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, case H5Z_NBIT_NOOPTYPE: (*parms_index)++; /* skip size of no-op type */ - H5Z_nbit_decompress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); + H5Z__nbit_decompress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); break; default: @@ -1269,7 +1247,7 @@ H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, if(p.precision > p.size * 8 || (p.precision + p.offset) > p.size * 8) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset") - H5Z_nbit_decompress_one_atomic(data, data_offset + member_offset, + H5Z__nbit_decompress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, &p); break; @@ -1288,7 +1266,7 @@ H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, case H5Z_NBIT_NOOPTYPE: /* Advance past member size */ (*parms_index)++; - H5Z_nbit_decompress_one_nooptype(data, data_offset+member_offset, + H5Z__nbit_decompress_one_nooptype(data, data_offset+member_offset, buffer, j, buf_len, member_size); break; @@ -1335,7 +1313,7 @@ H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buff HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset") for(i = 0; i < d_nelmts; i++) - H5Z_nbit_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, &p); + H5Z__nbit_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, &p); break; case H5Z_NBIT_ARRAY: @@ -1367,7 +1345,7 @@ done: } static void -H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, +H5Z__nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p, size_t datatype_len) { @@ -1396,7 +1374,7 @@ H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, } else { buffer[*j] |= (unsigned char)((unsigned)(val >> (dat_len - *buf_len)) & ~((unsigned)(~0) << *buf_len)); dat_len -= *buf_len; - H5Z_nbit_next_byte(j, buf_len); + H5Z__nbit_next_byte(j, buf_len); if(dat_len == 0) return; @@ -1406,7 +1384,7 @@ H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, } static void -H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, +H5Z__nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, unsigned size) { unsigned i; /* index */ @@ -1420,7 +1398,7 @@ H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, buffer[*j] |= (unsigned char)((unsigned)(val >> (dat_len - *buf_len)) & ~((unsigned)(~0) << *buf_len)); dat_len -= *buf_len; - H5Z_nbit_next_byte(j, buf_len); + H5Z__nbit_next_byte(j, buf_len); if(dat_len == 0) continue; @@ -1430,7 +1408,7 @@ H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, } static void -H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, +H5Z__nbit_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p) { /* begin_i: the index of byte having first significant bit @@ -1450,7 +1428,7 @@ H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, end_i = p->offset / 8; for(k = (int)begin_i; k >= (int)end_i; k--) - H5Z_nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, + H5Z__nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); } else { /* big endian */ @@ -1465,13 +1443,13 @@ H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, end_i = ((unsigned)datatype_len - p->offset) / 8 - 1; for(k = (int)begin_i; k <= (int)end_i; k++) - H5Z_nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, + H5Z__nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); } } static void -H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, +H5Z__nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const unsigned parms[], unsigned *parms_index) { @@ -1489,7 +1467,7 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, p.offset = parms[(*parms_index)++]; n = total_size / p.size; for(i = 0; i < n; i++) - H5Z_nbit_compress_one_atomic(data, data_offset + i * p.size, + H5Z__nbit_compress_one_atomic(data, data_offset + i * p.size, buffer, j, buf_len, &p); break; @@ -1498,7 +1476,7 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, n = total_size / base_size; /* number of base_type elements inside the array datatype */ begin_index = *parms_index; for(i = 0; i < n; i++) { - H5Z_nbit_compress_one_array(data, data_offset + i * base_size, + H5Z__nbit_compress_one_array(data, data_offset + i * base_size, buffer, j, buf_len, parms, parms_index); *parms_index = begin_index; } @@ -1509,7 +1487,7 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, n = total_size / base_size; /* number of base_type elements inside the array datatype */ begin_index = *parms_index; for(i = 0; i < n; i++) { - H5Z_nbit_compress_one_compound(data, data_offset + i * base_size, + H5Z__nbit_compress_one_compound(data, data_offset + i * base_size, buffer, j, buf_len, parms, parms_index); *parms_index = begin_index; } @@ -1517,7 +1495,7 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, case H5Z_NBIT_NOOPTYPE: (*parms_index)++; /* skip size of no-op type */ - H5Z_nbit_compress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); + H5Z__nbit_compress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); break; default: @@ -1526,7 +1504,7 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, } static void -H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, +H5Z__nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const unsigned parms[], unsigned *parms_index) { @@ -1546,23 +1524,23 @@ H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, p.order = parms[(*parms_index)++]; p.precision = parms[(*parms_index)++]; p.offset = parms[(*parms_index)++]; - H5Z_nbit_compress_one_atomic(data, data_offset + member_offset, + H5Z__nbit_compress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, &p); break; case H5Z_NBIT_ARRAY: - H5Z_nbit_compress_one_array(data, data_offset + member_offset, + H5Z__nbit_compress_one_array(data, data_offset + member_offset, buffer, j, buf_len, parms, parms_index); break; case H5Z_NBIT_COMPOUND: - H5Z_nbit_compress_one_compound(data, data_offset+member_offset, + H5Z__nbit_compress_one_compound(data, data_offset+member_offset, buffer, j, buf_len, parms, parms_index); break; case H5Z_NBIT_NOOPTYPE: size = parms[(*parms_index)++]; - H5Z_nbit_compress_one_nooptype(data, data_offset+member_offset, + H5Z__nbit_compress_one_nooptype(data, data_offset+member_offset, buffer, j, buf_len, size); break; @@ -1573,7 +1551,7 @@ H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, } static void -H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, +H5Z__nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t *buffer_size, const unsigned parms[]) { /* i: index of data, new_size: index of buffer, @@ -1599,14 +1577,14 @@ H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, p.offset = parms[7]; for(i = 0; i < d_nelmts; i++) - H5Z_nbit_compress_one_atomic(data, i * p.size, buffer, &new_size, &buf_len, &p); + H5Z__nbit_compress_one_atomic(data, i * p.size, buffer, &new_size, &buf_len, &p); break; case H5Z_NBIT_ARRAY: size = parms[4]; parms_index = 4; for(i = 0; i < d_nelmts; i++) { - H5Z_nbit_compress_one_array(data, i * size, buffer, &new_size, &buf_len, parms, &parms_index); + H5Z__nbit_compress_one_array(data, i * size, buffer, &new_size, &buf_len, parms, &parms_index); parms_index = 4; } break; @@ -1615,7 +1593,7 @@ H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size = parms[4]; parms_index = 4; for(i = 0; i < d_nelmts; i++) { - H5Z_nbit_compress_one_compound(data, i * size, buffer, &new_size, &buf_len, parms, &parms_index); + H5Z__nbit_compress_one_compound(data, i * size, buffer, &new_size, &buf_len, parms, &parms_index); parms_index = 4; } break; diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index fbc6fc4..6868da6 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Thursday, April 16, 1998 */ diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index a2a44fa..b37dcf3 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Thursday, April 16, 1998 */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 7bdc283..83f170e 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -36,55 +36,55 @@ enum H5Z_scaleoffset_t {t_bad=0, t_uchar=1, t_ushort, t_uint, t_ulong, t_ulong_l t_float, t_double}; /* Local function prototypes */ -static htri_t H5Z_can_apply_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static enum H5Z_scaleoffset_t H5Z_scaleoffset_get_type(unsigned dtype_class, +static htri_t H5Z__can_apply_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static enum H5Z_scaleoffset_t H5Z__scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign); -static herr_t H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, +static herr_t H5Z__scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum H5Z_scaleoffset_t scale_type, unsigned cd_values[], int need_convert); -static herr_t H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static size_t H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, +static herr_t H5Z__set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static size_t H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); -static void H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size); -static H5_ATTR_CONST unsigned H5Z_scaleoffset_log2(unsigned long long num); -static void H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, +static void H5Z__scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size); +static H5_ATTR_CONST unsigned H5Z__scaleoffset_log2(unsigned long long num); +static void H5Z__scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval); -static void H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, +static void H5Z__scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t minbits, unsigned long long minval); -static herr_t H5Z_scaleoffset_precompress_fd(void *data, unsigned d_nelmts, +static herr_t H5Z__scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval, double D_val); -static herr_t H5Z_scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, +static herr_t H5Z__scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t minbits, unsigned long long minval, double D_val); -static void H5Z_scaleoffset_next_byte(size_t *j, unsigned *buf_len); -static void H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, +static void H5Z__scaleoffset_next_byte(size_t *j, unsigned *buf_len); +static void H5Z__scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p, unsigned dtype_len); -static void H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, +static void H5Z__scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p, unsigned dtype_len); -static void H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, +static void H5Z__scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p); -static void H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, +static void H5Z__scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p); -static void H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, +static void H5Z__scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, parms_atomic p); -static void H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, +static void H5Z__scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t buffer_size, parms_atomic p); /* This message derives from H5Z */ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_SCALEOFFSET, /* Filter id number */ - 1, /* Assume encoder present: check before registering */ - 1, /* decoder_present flag (set to true) */ - "scaleoffset", /* Filter name for debugging */ - H5Z_can_apply_scaleoffset, /* The "can apply" callback */ - H5Z_set_local_scaleoffset, /* The "set local" callback */ - H5Z_filter_scaleoffset, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_SCALEOFFSET, /* Filter id number */ + 1, /* Assume encoder present: check before registering */ + 1, /* decoder_present flag (set to true) */ + "scaleoffset", /* Filter name for debugging */ + H5Z__can_apply_scaleoffset, /* The "can apply" callback */ + H5Z__set_local_scaleoffset, /* The "set local" callback */ + H5Z__filter_scaleoffset, /* The actual filter function */ }}; /* Local macros */ @@ -192,7 +192,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ if(need_convert) \ - H5Z_scaleoffset_convert(&fill_val, 1, sizeof(type)); \ + H5Z__scaleoffset_convert(&fill_val, 1, sizeof(type)); \ \ H5Z_scaleoffset_save_filval(type, cd_values, fill_val) \ } @@ -207,7 +207,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ if(need_convert) \ - H5Z_scaleoffset_convert(&fill_val, 1, sizeof(type)); \ + H5Z__scaleoffset_convert(&fill_val, 1, sizeof(type)); \ \ H5Z_scaleoffset_save_filval(unsigned type, cd_values, fill_val) \ } @@ -235,7 +235,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ if(need_convert) \ - H5Z_scaleoffset_convert(&fill_val, 1, sizeof(type)); \ + H5Z__scaleoffset_convert(&fill_val, 1, sizeof(type)); \ \ H5Z_scaleoffset_save_filval(type, cd_values, fill_val) \ } @@ -422,7 +422,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max, min) \ H5Z_scaleoffset_check_1(type, max, min, minbits) \ span = (type)(max - min + 1); \ - *minbits = H5Z_scaleoffset_log2((unsigned long long)(span+1)); \ + *minbits = H5Z__scaleoffset_log2((unsigned long long)(span+1)); \ } else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval, min) \ if(*minbits != sizeof(type)*8) /* change values if minbits != full precision */ \ @@ -433,7 +433,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) \ H5Z_scaleoffset_check_1(type, max, min, minbits) \ span = (type)(max - min + 1); \ - *minbits = H5Z_scaleoffset_log2((unsigned long long)span); \ + *minbits = H5Z__scaleoffset_log2((unsigned long long)span); \ } else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_2(i, d_nelmts, buf, min) \ if(*minbits != sizeof(type)*8) /* change values if minbits != full precision */ \ @@ -455,7 +455,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max, min) \ H5Z_scaleoffset_check_2(type, max, min, minbits) \ span = (unsigned type)(max - min + 1); \ - *minbits = H5Z_scaleoffset_log2((unsigned long long)(span + 1)); \ + *minbits = H5Z__scaleoffset_log2((unsigned long long)(span + 1)); \ } else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval, min) \ if(*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \ @@ -466,7 +466,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) \ H5Z_scaleoffset_check_2(type, max, min, minbits) \ span = (unsigned type)(max - min + 1); \ - *minbits = H5Z_scaleoffset_log2((unsigned long long)span); \ + *minbits = H5Z__scaleoffset_log2((unsigned long long)span); \ } else /* minbits already set, only calculate min */ \ H5Z_scaleoffset_min_2(i, d_nelmts, buf, min) \ if(*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \ @@ -553,14 +553,14 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_max_min_3(i, d_nelmts, buf, filval, max, min, D_val) \ H5Z_scaleoffset_check_3(i, type, pow_fun, round_fun, max, min, minbits, D_val) \ span = (unsigned long long)(llround_fun(max * pow_fun(10.0f, (type)D_val) - min * pow_fun(10.0f, (type)D_val)) + 1); \ - *minbits = H5Z_scaleoffset_log2(span + 1); \ + *minbits = H5Z__scaleoffset_log2(span + 1); \ if(*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \ H5Z_scaleoffset_modify_1(i, type, pow_fun, abs_fun, lround_fun, llround_fun, buf, d_nelmts, filval, minbits, min, D_val) \ } else { /* fill value undefined */ \ H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) \ H5Z_scaleoffset_check_3(i, type, pow_fun, round_fun, max, min, minbits, D_val) \ span = (unsigned long long)(llround_fun(max * pow_fun(10.0f, (type)D_val) - min * pow_fun(10.0f, (type)D_val)) + 1); \ - *minbits = H5Z_scaleoffset_log2(span); \ + *minbits = H5Z__scaleoffset_log2(span); \ if(*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \ H5Z_scaleoffset_modify_2(i, type, pow_fun, lround_fun, llround_fun, buf, d_nelmts, min, D_val) \ } \ @@ -667,7 +667,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ /*------------------------------------------------------------------------- - * Function: H5Z_can_apply_scaleoffset + * Function: H5Z__can_apply_scaleoffset * * Purpose: Check the parameters for scaleoffset compression for * validity and whether they fit a particular dataset. @@ -678,19 +678,17 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ * Programmer: Xiaowen Wu * Friday, February 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static htri_t -H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) +H5Z__can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { const H5T_t *type; /* Datatype */ H5T_class_t dtype_class; /* Datatype's class */ H5T_order_t dtype_order; /* Datatype's endianness order */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -717,11 +715,11 @@ H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_can_apply_scaleoffset() */ +} /* end H5Z__can_apply_scaleoffset() */ /*------------------------------------------------------------------------- - * Function: H5Z_scaleoffset_get_type + * Function: H5Z__scaleoffset_get_type * * Purpose: Get the specific integer type based on datatype size and sign * or floating-point type based on size @@ -732,17 +730,15 @@ done: * Programmer: Xiaowen Wu * Wednesday, April 13, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static enum H5Z_scaleoffset_t -H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign) +H5Z__scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign) { enum H5Z_scaleoffset_t type = t_bad; /* integer type */ enum H5Z_scaleoffset_t ret_value = t_bad; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) { if(dtype_sign==H5Z_SCALEOFFSET_SGN_NONE) { /* unsigned integer */ @@ -786,7 +782,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_scaleoffset_set_parms_fillval + * Function: H5Z__scaleoffset_set_parms_fillval * * Purpose: Get the fill value of the dataset and store in cd_values[] * @@ -799,13 +795,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, +H5Z__scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum H5Z_scaleoffset_t scale_type, unsigned cd_values[], int need_convert) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(scale_type == t_uchar) H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_plist, type, cd_values, need_convert) @@ -834,11 +830,11 @@ H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_scaleoffset_set_parms_fillval() */ +} /* end H5Z__scaleoffset_set_parms_fillval() */ /*------------------------------------------------------------------------- - * Function: H5Z_set_local_scaleoffset + * Function: H5Z__set_local_scaleoffset * * Purpose: Set the "local" dataset parameters for scaleoffset * compression. @@ -849,12 +845,10 @@ done: * Programmer: Xiaowen Wu * Friday, February 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) +H5Z__set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) { H5P_genplist_t *dcpl_plist; /* Property list pointer */ H5T_t *type; /* Datatype */ @@ -871,7 +865,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) H5D_fill_value_t status; /* Status of fill value in property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the plist structure */ if(NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -997,12 +991,12 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) need_convert = TRUE; /* Before getting fill value, get its type */ - if((scale_type = H5Z_scaleoffset_get_type(cd_values[H5Z_SCALEOFFSET_PARM_CLASS], + if((scale_type = H5Z__scaleoffset_get_type(cd_values[H5Z_SCALEOFFSET_PARM_CLASS], cd_values[H5Z_SCALEOFFSET_PARM_SIZE], cd_values[H5Z_SCALEOFFSET_PARM_SIGN])) == 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot use C integer datatype for cast") /* Get dataset fill value and store in cd_values[] */ - if(H5Z_scaleoffset_set_parms_fillval(dcpl_plist, type, scale_type, cd_values, need_convert) < 0) + if(H5Z__scaleoffset_set_parms_fillval(dcpl_plist, type, scale_type, cd_values, need_convert) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "unable to set fill value") } /* end else */ @@ -1012,11 +1006,11 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_local_scaleoffset() */ +} /* end H5Z__set_local_scaleoffset() */ /*------------------------------------------------------------------------- - * Function: H5Z_filter_scaleoffset + * Function: H5Z__filter_scaleoffset * * Purpose: Implement an I/O filter for storing packed integer * data using scale and offset method. @@ -1027,12 +1021,10 @@ done: * Programmer: Xiaowen Wu * Monday, February 7, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t -H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { size_t ret_value = 0; /* return value */ @@ -1053,7 +1045,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value unsigned i; /* index */ parms_atomic p; /* parameters needed for compress/decompress functions */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ if(cd_nelmts != H5Z_SCALEOFFSET_TOTAL_NPARMS) @@ -1179,7 +1171,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* convert to dataset datatype endianness order if needed */ if(need_convert) - H5Z_scaleoffset_convert(outbuf, d_nelmts, p.size); + H5Z__scaleoffset_convert(outbuf, d_nelmts, p.size); *buf = outbuf; outbuf = NULL; @@ -1190,31 +1182,31 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* decompress the buffer if minbits not equal to zero */ if(minbits != 0) - H5Z_scaleoffset_decompress(outbuf, d_nelmts, (unsigned char*)(*buf)+buf_offset, p); + H5Z__scaleoffset_decompress(outbuf, d_nelmts, (unsigned char*)(*buf)+buf_offset, p); else { /* fill value is not defined and all data elements have the same value */ for(i = 0; i < size_out; i++) outbuf[i] = 0; } /* before postprocess, get memory type */ - if((type = H5Z_scaleoffset_get_type(dtype_class, p.size, dtype_sign)) == 0) + if((type = H5Z__scaleoffset_get_type(dtype_class, p.size, dtype_sign)) == 0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "cannot use C integer datatype for cast") /* postprocess after decompression */ if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) - H5Z_scaleoffset_postdecompress_i(outbuf, d_nelmts, type, filavail, + H5Z__scaleoffset_postdecompress_i(outbuf, d_nelmts, type, filavail, cd_values, minbits, minval); if(dtype_class==H5Z_SCALEOFFSET_CLS_FLOAT) if(scale_type==0) { /* variable-minimum-bits method */ - if(H5Z_scaleoffset_postdecompress_fd(outbuf, d_nelmts, type, filavail, + if(H5Z__scaleoffset_postdecompress_fd(outbuf, d_nelmts, type, filavail, cd_values, minbits, minval, D_val)==FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "post-decompression failed") } /* after postprocess, convert to dataset datatype endianness order if needed */ if(need_convert) - H5Z_scaleoffset_convert(outbuf, d_nelmts, p.size); + H5Z__scaleoffset_convert(outbuf, d_nelmts, p.size); } /* output; compress */ else { @@ -1222,20 +1214,20 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* before preprocess, convert to memory endianness order if needed */ if(need_convert) - H5Z_scaleoffset_convert(*buf, d_nelmts, p.size); + H5Z__scaleoffset_convert(*buf, d_nelmts, p.size); /* before preprocess, get memory type */ - if((type = H5Z_scaleoffset_get_type(dtype_class, p.size, dtype_sign))==0) + if((type = H5Z__scaleoffset_get_type(dtype_class, p.size, dtype_sign))==0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "cannot use C integer datatype for cast") /* preprocess before compression */ if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) - H5Z_scaleoffset_precompress_i(*buf, d_nelmts, type, filavail, + H5Z__scaleoffset_precompress_i(*buf, d_nelmts, type, filavail, cd_values, &minbits, &minval); if(dtype_class==H5Z_SCALEOFFSET_CLS_FLOAT) if(scale_type==0) { /* variable-minimum-bits method */ - if(H5Z_scaleoffset_precompress_fd(*buf, d_nelmts, type, filavail, + if(H5Z__scaleoffset_precompress_fd(*buf, d_nelmts, type, filavail, cd_values, &minbits, &minval, D_val)==FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "pre-compression failed") } @@ -1289,7 +1281,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value * all data elements have the same value */ if(minbits != 0) - H5Z_scaleoffset_compress((unsigned char *)*buf, d_nelmts, outbuf + buf_offset, size_out - buf_offset, p); + H5Z__scaleoffset_compress((unsigned char *)*buf, d_nelmts, outbuf + buf_offset, size_out - buf_offset, p); } /* free the input buffer */ @@ -1320,7 +1312,7 @@ done: * or from big-endian to little-endian 2/21/2005 */ static void -H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size) +H5Z__scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size) { if(dtype_size > 1) { size_t i, j; @@ -1335,13 +1327,13 @@ H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size) buffer[i + dtype_size - 1 - j] = temp; } /* end for */ } /* end if */ -} /* end H5Z_scaleoffset_convert() */ +} /* end H5Z__scaleoffset_convert() */ /* return ceiling of floating-point log2 function * receive unsigned integer as argument 3/10/2005 */ static unsigned -H5Z_scaleoffset_log2(unsigned long long num) +H5Z__scaleoffset_log2(unsigned long long num) { unsigned v = 0; unsigned long long lower_bound = 1; /* is power of 2, largest value <= num */ @@ -1360,7 +1352,7 @@ H5Z_scaleoffset_log2(unsigned long long num) /* precompress for integer type */ static void -H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, +H5Z__scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval) { if(type == t_uchar) @@ -1392,7 +1384,7 @@ H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffse return; } span = (unsigned char)(max - min + 1); - *minbits = H5Z_scaleoffset_log2((unsigned long long)(span+1)); + *minbits = H5Z__scaleoffset_log2((unsigned long long)(span+1)); } else /* minbits already set, only calculate min */ H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval, min) if(*minbits != sizeof(signed char)*8) /* change values if minbits != full precision */ @@ -1407,7 +1399,7 @@ H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffse return; } span = (unsigned char)(max - min + 1); - *minbits = H5Z_scaleoffset_log2((unsigned long long)span); + *minbits = H5Z__scaleoffset_log2((unsigned long long)span); } else /* minbits already set, only calculate min */ H5Z_scaleoffset_min_2(i, d_nelmts, buf, min) if(*minbits != sizeof(signed char) * 8) /* change values if minbits != full precision */ @@ -1432,7 +1424,7 @@ H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffse /* postdecompress for integer type */ static void -H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, +H5Z__scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t minbits, unsigned long long minval) { long long sminval = *(long long*)&minval; /* for signed integer types */ @@ -1481,13 +1473,13 @@ H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleof /* precompress for floating-point type, variable-minimum-bits method success: non-negative, failure: negative 4/15/05 */ static herr_t -H5Z_scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, +H5Z__scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval, double D_val) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(type == t_float) H5Z_scaleoffset_precompress_3(float, HDpowf, HDfabsf, HDroundf, HDlroundf, HDllroundf, data, d_nelmts, @@ -1503,14 +1495,14 @@ done: /* postdecompress for floating-point type, variable-minimum-bits method success: non-negative, failure: negative 4/15/05 */ static herr_t -H5Z_scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, +H5Z__scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[], uint32_t minbits, unsigned long long minval, double D_val) { long long sminval = (long long)minval; /* for signed integer types */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(type == t_float) H5Z_scaleoffset_postdecompress_3(float, HDpowf, data, d_nelmts, filavail, @@ -1524,14 +1516,14 @@ done: } static void -H5Z_scaleoffset_next_byte(size_t *j, unsigned *buf_len) +H5Z__scaleoffset_next_byte(size_t *j, unsigned *buf_len) { ++(*j); *buf_len = 8 * sizeof(unsigned char); } static void -H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, +H5Z__scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p, unsigned dtype_len) { @@ -1552,7 +1544,7 @@ H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, else { data[data_offset + k] = (unsigned char)((val & ~((unsigned)(~0) << *buf_len)) << (dat_len - *buf_len)); dat_len -= *buf_len; - H5Z_scaleoffset_next_byte(j, buf_len); + H5Z__scaleoffset_next_byte(j, buf_len); if(dat_len == 0) return; @@ -1563,7 +1555,7 @@ H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, } static void -H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, +H5Z__scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p) { /* begin_i: the index of byte having first significant bit */ @@ -1579,7 +1571,7 @@ H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, begin_i = p.size - 1 - (dtype_len - p.minbits) / 8; for(k = (int)begin_i; k >= 0; k--) - H5Z_scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, + H5Z__scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p, dtype_len); } else { /* big endian */ @@ -1588,13 +1580,13 @@ H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, begin_i = (dtype_len - p.minbits) / 8; for(k = (int)begin_i; k <= (int)(p.size - 1); k++) - H5Z_scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, + H5Z__scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p, dtype_len); } } static void -H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, +H5Z__scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, parms_atomic p) { /* i: index of data, j: index of buffer, @@ -1612,11 +1604,11 @@ H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, /* decompress */ for(i = 0; i < d_nelmts; i++) - H5Z_scaleoffset_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p); + H5Z__scaleoffset_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p); } static void -H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, +H5Z__scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p, unsigned dtype_len) { @@ -1636,7 +1628,7 @@ H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, } else { buffer[*j] |= (unsigned char)((unsigned)(val >> (dat_len - *buf_len)) & ~((unsigned)(~0) << *buf_len)); dat_len -= *buf_len; - H5Z_scaleoffset_next_byte(j, buf_len); + H5Z__scaleoffset_next_byte(j, buf_len); if(dat_len == 0) return; @@ -1646,7 +1638,7 @@ H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, } static void -H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, +H5Z__scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p) { /* begin_i: the index of byte having first significant bit */ @@ -1662,7 +1654,7 @@ H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, begin_i = p.size - 1 - (dtype_len - p.minbits) / 8; for(k = (int)begin_i; k >= 0; k--) - H5Z_scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, + H5Z__scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p, dtype_len); } else { /* big endian */ @@ -1670,13 +1662,13 @@ H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, begin_i = (dtype_len - p.minbits) / 8; for(k = (int)begin_i; k <= (int)(p.size - 1); k++) - H5Z_scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, + H5Z__scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p, dtype_len); } } static void -H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, +H5Z__scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t buffer_size, parms_atomic p) { /* i: index of data, j: index of buffer, @@ -1694,6 +1686,6 @@ H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, /* compress */ for(i = 0; i < d_nelmts; i++) - H5Z_scaleoffset_compress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p); + H5Z__scaleoffset_compress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p); } diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index b1d0722..224c78e 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -23,20 +23,20 @@ #include "H5Zpkg.h" /* Data filters */ /* Local function prototypes */ -static herr_t H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static size_t H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, +static herr_t H5Z__set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static size_t H5Z__filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ const H5Z_class2_t H5Z_SHUFFLE[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_SHUFFLE, /* Filter id number */ - 1, /* encoder_present flag (set to true) */ - 1, /* decoder_present flag (set to true) */ + 1, /* encoder_present flag (set to true) */ + 1, /* decoder_present flag (set to true) */ "shuffle", /* Filter name for debugging */ NULL, /* The "can apply" callback */ - H5Z_set_local_shuffle, /* The "set local" callback */ - H5Z_filter_shuffle, /* The actual filter function */ + H5Z__set_local_shuffle, /* The "set local" callback */ + H5Z__filter_shuffle, /* The actual filter function */ }}; /* Local macros */ @@ -44,7 +44,7 @@ const H5Z_class2_t H5Z_SHUFFLE[1] = {{ /*------------------------------------------------------------------------- - * Function: H5Z_set_local_shuffle + * Function: H5Z__set_local_shuffle * * Purpose: Set the "local" dataset parameter for data shuffling to be * the size of the datatype. @@ -55,12 +55,10 @@ const H5Z_class2_t H5Z_SHUFFLE[1] = {{ * Programmer: Quincey Koziol * Monday, April 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) +H5Z__set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { H5P_genplist_t *dcpl_plist; /* Property list pointer */ const H5T_t *type; /* Datatype */ @@ -69,7 +67,7 @@ H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_i unsigned cd_values[H5Z_SHUFFLE_TOTAL_NPARMS]; /* Filter parameters */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Get the plist structure */ if(NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -93,11 +91,11 @@ H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_i done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_local_shuffle() */ +} /* end H5Z__set_local_shuffle() */ /*------------------------------------------------------------------------- - * Function: H5Z_filter_shuffle + * Function: H5Z__filter_shuffle * * Purpose: Implement an I/O filter which "de-interlaces" a block of data * by putting all the bytes in a byte-position for each element @@ -112,14 +110,10 @@ done: * Programmer: Kent Yang * Wednesday, November 13, 2002 * - * Modifications: - * Quincey Koziol, November 13, 2002 - * Cleaned up code. - * *------------------------------------------------------------------------- */ static size_t -H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +H5Z__filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { void *dest = NULL; /* Buffer to deposit [un]shuffled bytes into */ @@ -134,7 +128,7 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t leftover; /* Extra bytes at end of buffer */ size_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI(0) + FUNC_ENTER_STATIC /* Check arguments */ if (cd_nelmts!=H5Z_SHUFFLE_TOTAL_NPARMS || cd_values[H5Z_SHUFFLE_PARM_SIZE]==0) diff --git a/src/H5Zszip.c b/src/H5Zszip.c index 8ed173e..c72c499 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -32,27 +32,27 @@ #endif /* Local function prototypes */ -static htri_t H5Z_can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static herr_t H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static size_t H5Z_filter_szip (unsigned flags, size_t cd_nelmts, +static htri_t H5Z__can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static herr_t H5Z__set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id); +static size_t H5Z__filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ H5Z_class2_t H5Z_SZIP[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ H5Z_FILTER_SZIP, /* Filter id number */ - 1, /* Assume encoder present: check before registering */ - 1, /* decoder_present flag (set to true) */ - "szip", /* Filter name for debugging */ - H5Z_can_apply_szip, /* The "can apply" callback */ - H5Z_set_local_szip, /* The "set local" callback */ - H5Z_filter_szip, /* The actual filter function */ + 1, /* Assume encoder present: check before registering */ + 1, /* decoder_present flag (set to true) */ + "szip", /* Filter name for debugging */ + H5Z__can_apply_szip, /* The "can apply" callback */ + H5Z__set_local_szip, /* The "set local" callback */ + H5Z__filter_szip, /* The actual filter function */ }}; /*------------------------------------------------------------------------- - * Function: H5Z_can_apply_szip + * Function: H5Z__can_apply_szip * * Purpose: Check the parameters for szip compression for validity and * whether they fit a particular dataset. @@ -73,14 +73,14 @@ H5Z_class2_t H5Z_SZIP[1] = {{ *------------------------------------------------------------------------- */ static htri_t -H5Z_can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) +H5Z__can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { const H5T_t *type; /* Datatype */ unsigned dtype_size; /* Datatype's size (in bits) */ H5T_order_t dtype_order; /* Datatype's endianness order */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -105,11 +105,11 @@ H5Z_can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UN done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_can_apply_szip() */ +} /* end H5Z__can_apply_szip() */ /*------------------------------------------------------------------------- - * Function: H5Z_set_local_szip + * Function: H5Z__set_local_szip * * Purpose: Set the "local" dataset parameters for szip compression. * @@ -119,18 +119,10 @@ done: * Programmer: Quincey Koziol * Monday, April 7, 2003 * - * Modifications: Used new logic to set the size of the scanline parameter. - * Now SZIP compression can be applied to the chunk - * of any shape and size with only one restriction: the number - * of elements in the chunk has to be not less than number - * of elements (pixels) in the block (cd_values[H5Z_SZIP_PARM_PPB] - * parameter). - * Elena Pourmal, July 20, 2004 - * *------------------------------------------------------------------------- */ static herr_t -H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) +H5Z__set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) { H5P_genplist_t *dcpl_plist; /* Property list pointer */ const H5T_t *type; /* Datatype */ @@ -147,7 +139,7 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) hsize_t scanline; /* Size of dataspace's fastest changing dimension */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Get the plist structure */ if(NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -253,11 +245,11 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_local_szip() */ +} /* end H5Z__set_local_szip() */ /*------------------------------------------------------------------------- - * Function: H5Z_filter_szip + * Function: H5Z__filter_szip * * Purpose: Implement an I/O filter around the 'rice' algorithm in * libsz @@ -271,7 +263,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +H5Z__filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { size_t ret_value = 0; /* Return value */ @@ -280,7 +272,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], unsigned char *newbuf = NULL; /* Pointer to input buffer */ SZ_com_t sz_param; /* szip parameter block */ - FUNC_ENTER_NOAPI(0) + FUNC_ENTER_STATIC /* Sanity check to make certain that we haven't drifted out of date with * the mask options from the szlib.h header */ diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 1c8d415..6f53ae0 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -86,24 +86,20 @@ typedef struct { } H5Z_token; /* Local function prototypes */ -static H5Z_token *H5Z_get_token(H5Z_token *current); -static H5Z_node *H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers); -static H5Z_node *H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers); -static H5Z_node *H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers); -static H5Z_node *H5Z_new_node(H5Z_token_type type); -static void H5Z_do_op(H5Z_node* tree); -static hbool_t H5Z_op_is_numbs(H5Z_node* _tree); -static hbool_t H5Z_op_is_numbs2(H5Z_node* _tree); -static hid_t H5Z_xform_find_type(const H5T_t* type); -static herr_t H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, H5Z_result* res); -static void H5Z_xform_destroy_parse_tree(H5Z_node *tree); -static void* H5Z_xform_parse(const char *expression, H5Z_datval_ptrs* dat_val_pointers); -static void* H5Z_xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datval_ptrs* new_dat_val_pointers); -static void H5Z_xform_reduce_tree(H5Z_node* tree); -#ifdef H5Z_XFORM_DEBUG -static void H5Z_XFORM_DEBUG(H5Z_node *tree); -static void H5Z_print(H5Z_node *tree, FILE *stream); -#endif /* H5Z_XFORM_DEBUG */ +static H5Z_token *H5Z__get_token(H5Z_token *current); +static H5Z_node *H5Z__parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers); +static H5Z_node *H5Z__parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers); +static H5Z_node *H5Z__parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers); +static H5Z_node *H5Z__new_node(H5Z_token_type type); +static void H5Z__do_op(H5Z_node* tree); +static hbool_t H5Z__op_is_numbs(H5Z_node* _tree); +static hbool_t H5Z__op_is_numbs2(H5Z_node* _tree); +static hid_t H5Z__xform_find_type(const H5T_t* type); +static herr_t H5Z__xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, H5Z_result* res); +static void H5Z__xform_destroy_parse_tree(H5Z_node *tree); +static void* H5Z__xform_parse(const char *expression, H5Z_datval_ptrs* dat_val_pointers); +static void* H5Z__xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datval_ptrs* new_dat_val_pointers); +static void H5Z__xform_reduce_tree(H5Z_node* tree); /* PGCC (11.8-0) has trouble with the command *p++ = *p OP tree_val. It increments P first before * doing the operation. So I break down the command into two lines: @@ -312,11 +308,11 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); { \ ret_value->type = (TYPE); \ if(tree->lchild) \ - ret_value->lchild = (H5Z_node*) H5Z_xform_copy_tree(tree->lchild, dat_val_pointers, new_dat_val_pointers); \ + ret_value->lchild = (H5Z_node*) H5Z__xform_copy_tree(tree->lchild, dat_val_pointers, new_dat_val_pointers); \ else \ ret_value->lchild = NULL; \ if(tree->rchild) \ - ret_value->rchild = (H5Z_node*) H5Z_xform_copy_tree(tree->rchild, dat_val_pointers, new_dat_val_pointers); \ + ret_value->rchild = (H5Z_node*) H5Z__xform_copy_tree(tree->rchild, dat_val_pointers, new_dat_val_pointers); \ else \ ret_value->rchild = NULL; \ } \ @@ -329,7 +325,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); } /* The difference of this macro from H5Z_XFORM_DO_OP3 is that it handles the operations when the left operand is empty, like -x or +x. - * The reason that it's separated from H5Z_XFORM_DO_OP3 is because compilers don't accept operations like *x or /x. So in H5Z_do_op, + * The reason that it's separated from H5Z_XFORM_DO_OP3 is because compilers don't accept operations like *x or /x. So in H5Z__do_op, * these two macros are called in different ways. (SLU 2012/3/20) */ #define H5Z_XFORM_DO_OP6(OP) \ @@ -371,7 +367,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); } /* - * Programmer: Bill Wendling + * Programmer: Bill Wendling * 25. August 2003 */ @@ -393,20 +389,23 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); /*------------------------------------------------------------------------- - * Function: H5Z_unget_token + * Function: H5Z__unget_token + * * Purpose: Rollback the H5Z_token to the previous H5Z_token retrieved. There * should only need to be one level of rollback necessary * for our grammar. + * * Return: Always succeeds. + * * Programmer: Bill Wendling * 26. August 2003 -* + * *------------------------------------------------------------------------- */ static void -H5Z_unget_token(H5Z_token *current) +H5Z__unget_token(H5Z_token *current) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(current); @@ -420,7 +419,7 @@ H5Z_unget_token(H5Z_token *current) /*------------------------------------------------------------------------- - * Function: H5Z_get_token + * Function: H5Z__get_token * * Purpose: Determine what the next valid H5Z_token is in the expression * string. The current position within the H5Z_token string is @@ -438,11 +437,11 @@ H5Z_unget_token(H5Z_token *current) *------------------------------------------------------------------------- */ static H5Z_token * -H5Z_get_token(H5Z_token *current) +H5Z__get_token(H5Z_token *current) { H5Z_token *ret_value = current; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(current); @@ -558,7 +557,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_xform_destroy_parse_tree + * Function: H5Z__xform_destroy_parse_tree * Purpose: Recursively destroys the expression tree. * Return: Nothing * Programmer: Bill Wendling @@ -567,14 +566,13 @@ done: *------------------------------------------------------------------------- */ static void -H5Z_xform_destroy_parse_tree(H5Z_node *tree) +H5Z__xform_destroy_parse_tree(H5Z_node *tree) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR - if (tree) - { - H5Z_xform_destroy_parse_tree(tree->lchild); - H5Z_xform_destroy_parse_tree(tree->rchild); + if(tree) { + H5Z__xform_destroy_parse_tree(tree->lchild); + H5Z__xform_destroy_parse_tree(tree->rchild); H5MM_xfree(tree); tree = NULL; } @@ -589,7 +587,7 @@ H5Z_xform_destroy_parse_tree(H5Z_node *tree) * Purpose: Entry function for parsing the expression string. * * Return: Success: Valid H5Z_node ptr to an expression tree. - * NULLure: NULL + * Failure: NULL * * Programmer: Bill Wendling * 26. August 2003 @@ -597,12 +595,12 @@ H5Z_xform_destroy_parse_tree(H5Z_node *tree) *------------------------------------------------------------------------- */ static void * -H5Z_xform_parse(const char *expression, H5Z_datval_ptrs* dat_val_pointers) +H5Z__xform_parse(const char *expression, H5Z_datval_ptrs* dat_val_pointers) { H5Z_token tok; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC if(!expression) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "No expression provided?") @@ -610,9 +608,9 @@ H5Z_xform_parse(const char *expression, H5Z_datval_ptrs* dat_val_pointers) /* Set up the initial H5Z_token for parsing */ tok.tok_expr = tok.tok_begin = tok.tok_end = expression; - ret_value = (void*)H5Z_parse_expression(&tok, dat_val_pointers); + ret_value = (void*)H5Z__parse_expression(&tok, dat_val_pointers); - H5Z_xform_reduce_tree((H5Z_node*)ret_value); + H5Z__xform_reduce_tree((H5Z_node*)ret_value); done: FUNC_LEAVE_NOAPI(ret_value) @@ -620,48 +618,49 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_parse_expression + * Function: H5Z__parse_expression * Purpose: Beginning of the recursive descent parser to parse the * expression. An expression is: * * expr := term | term '+' term | term '-' term * * Return: Success: Valid H5Z_node ptr to expression tree - * NULLure: NULL + * Failure: NULL + * * Programmer: Bill Wendling * 26. August 2003 * *------------------------------------------------------------------------- */ static H5Z_node * -H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) +H5Z__parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) { H5Z_node *expr; H5Z_node *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - expr = H5Z_parse_term(current, dat_val_pointers); + expr = H5Z__parse_term(current, dat_val_pointers); for (;;) { H5Z_node *new_node; - current = H5Z_get_token(current); + current = H5Z__get_token(current); switch(current->tok_type) { case H5Z_XFORM_PLUS: - new_node = H5Z_new_node(H5Z_XFORM_PLUS); + new_node = H5Z__new_node(H5Z_XFORM_PLUS); if (!new_node) { - H5Z_xform_destroy_parse_tree(expr); + H5Z__xform_destroy_parse_tree(expr); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") } new_node->lchild = expr; - new_node->rchild = H5Z_parse_term(current, dat_val_pointers); + new_node->rchild = H5Z__parse_term(current, dat_val_pointers); if (!new_node->rchild) { - H5Z_xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(new_node); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } @@ -669,18 +668,18 @@ H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) break; case H5Z_XFORM_MINUS: - new_node = H5Z_new_node(H5Z_XFORM_MINUS); + new_node = H5Z__new_node(H5Z_XFORM_MINUS); if (!new_node) { - H5Z_xform_destroy_parse_tree(expr); + H5Z__xform_destroy_parse_tree(expr); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") } new_node->lchild = expr; - new_node->rchild = H5Z_parse_term(current, dat_val_pointers); + new_node->rchild = H5Z__parse_term(current, dat_val_pointers); if (!new_node->rchild) { - H5Z_xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(new_node); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } @@ -688,7 +687,7 @@ H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) break; case H5Z_XFORM_RPAREN: - H5Z_unget_token(current); + H5Z__unget_token(current); HGOTO_DONE(expr) case H5Z_XFORM_END: @@ -702,7 +701,7 @@ H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) case H5Z_XFORM_DIVIDE: case H5Z_XFORM_LPAREN: default: - H5Z_xform_destroy_parse_tree(expr); + H5Z__xform_destroy_parse_tree(expr); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } } @@ -713,47 +712,48 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_parse_term + * Function: H5Z__parse_term * Purpose: Parses a term in our expression language. A term is: * * term := factor | factor '*' factor | factor '/' factor * * Return: Success: Valid H5Z_node ptr to expression tree - * NULLure: NULL + * Failure: NULL + * * Programmer: Bill Wendling * 26. August 2003 -* + * *------------------------------------------------------------------------- */ static H5Z_node * -H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) +H5Z__parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) { H5Z_node *term = NULL; H5Z_node *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - term = H5Z_parse_factor(current, dat_val_pointers); + term = H5Z__parse_factor(current, dat_val_pointers); for (;;) { H5Z_node *new_node; - current = H5Z_get_token(current); + current = H5Z__get_token(current); switch (current->tok_type) { case H5Z_XFORM_MULT: - new_node = H5Z_new_node(H5Z_XFORM_MULT); + new_node = H5Z__new_node(H5Z_XFORM_MULT); if (!new_node) { - H5Z_xform_destroy_parse_tree(term); + H5Z__xform_destroy_parse_tree(term); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") } new_node->lchild = term; - new_node->rchild = H5Z_parse_factor(current, dat_val_pointers); + new_node->rchild = H5Z__parse_factor(current, dat_val_pointers); if (!new_node->rchild) { - H5Z_xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(new_node); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } @@ -761,25 +761,25 @@ H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) break; case H5Z_XFORM_DIVIDE: - new_node = H5Z_new_node(H5Z_XFORM_DIVIDE); + new_node = H5Z__new_node(H5Z_XFORM_DIVIDE); if (!new_node) { - H5Z_xform_destroy_parse_tree(term); + H5Z__xform_destroy_parse_tree(term); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") } new_node->lchild = term; - new_node->rchild = H5Z_parse_factor(current, dat_val_pointers); + new_node->rchild = H5Z__parse_factor(current, dat_val_pointers); term = new_node; if (!new_node->rchild) { - H5Z_xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(new_node); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } break; case H5Z_XFORM_RPAREN: - H5Z_unget_token(current); + H5Z__unget_token(current); HGOTO_DONE(term) case H5Z_XFORM_END: @@ -791,12 +791,12 @@ H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) case H5Z_XFORM_PLUS: case H5Z_XFORM_MINUS: case H5Z_XFORM_LPAREN: - H5Z_unget_token(current); + H5Z__unget_token(current); HGOTO_DONE(term) case H5Z_XFORM_ERROR: default: - H5Z_xform_destroy_parse_tree(term); + H5Z__xform_destroy_parse_tree(term); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "bad transform type passed to data transform expression") } /* end switch */ } /* end for */ @@ -807,7 +807,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_parse_factor + * Function: H5Z__parse_factor * Purpose: Parses a factor in our expression language. A factor is: * * factor := number | // C long or double @@ -817,26 +817,27 @@ done: * '(' expr ')' * * Return: Success: Valid H5Z_node ptr to expression tree - * NULLure: NULL + * Failure: NULL + * * Programmer: Bill Wendling * 26. August 2003 * *------------------------------------------------------------------------- */ static H5Z_node * -H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) +H5Z__parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) { H5Z_node *factor=NULL; H5Z_node *new_node; H5Z_node *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC - current = H5Z_get_token(current); + current = H5Z__get_token(current); switch (current->tok_type) { case H5Z_XFORM_INTEGER: - factor = H5Z_new_node(H5Z_XFORM_INTEGER); + factor = H5Z__new_node(H5Z_XFORM_INTEGER); if (!factor) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") @@ -844,7 +845,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) break; case H5Z_XFORM_FLOAT: - factor = H5Z_new_node(H5Z_XFORM_FLOAT); + factor = H5Z__new_node(H5Z_XFORM_FLOAT); if (!factor) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") @@ -852,7 +853,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) break; case H5Z_XFORM_SYMBOL: - factor = H5Z_new_node(H5Z_XFORM_SYMBOL); + factor = H5Z__new_node(H5Z_XFORM_SYMBOL); if (!factor) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") @@ -862,76 +863,76 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) break; case H5Z_XFORM_LPAREN: - factor = H5Z_parse_expression(current, dat_val_pointers); + factor = H5Z__parse_expression(current, dat_val_pointers); if (!factor) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node") - current = H5Z_get_token(current); + current = H5Z__get_token(current); if (current->tok_type != H5Z_XFORM_RPAREN) { - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Syntax error in data transform expression") } break; case H5Z_XFORM_RPAREN: /* We shouldn't see a ) right now */ - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Syntax error: unexpected ')' ") case H5Z_XFORM_PLUS: /* unary + */ - new_node = H5Z_parse_factor(current, dat_val_pointers); + new_node = H5Z__parse_factor(current, dat_val_pointers); if (new_node) { if (new_node->type != H5Z_XFORM_INTEGER && new_node->type != H5Z_XFORM_FLOAT && new_node->type != H5Z_XFORM_SYMBOL) { - H5Z_xform_destroy_parse_tree(new_node); - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } factor = new_node; - new_node = H5Z_new_node(H5Z_XFORM_PLUS); + new_node = H5Z__new_node(H5Z_XFORM_PLUS); if (!new_node) { - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } new_node->rchild = factor; factor = new_node; } else { - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } break; case H5Z_XFORM_MINUS: /* unary - */ - new_node = H5Z_parse_factor(current, dat_val_pointers); + new_node = H5Z__parse_factor(current, dat_val_pointers); if (new_node) { if (new_node->type != H5Z_XFORM_INTEGER && new_node->type != H5Z_XFORM_FLOAT && new_node->type != H5Z_XFORM_SYMBOL) { - H5Z_xform_destroy_parse_tree(new_node); - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(new_node); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } factor = new_node; - new_node = H5Z_new_node(H5Z_XFORM_MINUS); + new_node = H5Z__new_node(H5Z_XFORM_MINUS); if (!new_node) { - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } new_node->rchild = factor; factor = new_node; } else { - H5Z_xform_destroy_parse_tree(factor); + H5Z__xform_destroy_parse_tree(factor); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression") } break; @@ -956,21 +957,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_new_node + * Function: H5Z__new_node + * * Purpose: Create and initialize a new H5Z_node structure. + * * Return: Success: Valid H5Z_node ptr - * NULLure: NULL + * Failure: NULL + * * Programmer: Bill Wendling * 26. August 2003 * *------------------------------------------------------------------------- */ static H5Z_node * -H5Z_new_node(H5Z_token_type type) +H5Z__new_node(H5Z_token_type type) { H5Z_node *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(NULL == (ret_value = (H5Z_node *)H5MM_calloc(sizeof(H5Z_node)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Ran out of memory trying to allocate space for nodes in the parse tree") @@ -985,7 +989,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_xform_eval * Purpose: If the transform is trivial, this function applies it. - * Otherwise, it calls H5Z_xform_eval_full to do the full + * Otherwise, it calls H5Z__xform_eval_full to do the full * transform. * Return: SUCCEED if transform applied successfully, FAIL otherwise * Programmer: Leon Arber @@ -1009,7 +1013,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size tree = data_xform_prop->parse_root; /* Get the datatype ID for the buffer's type */ - if((array_type = H5Z_xform_find_type(buf_type)) < 0) + if((array_type = H5Z__xform_find_type(buf_type)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Cannot perform data transform on this type.") /* After this point, we're assured that the type of the array is handled by the eval code, @@ -1069,7 +1073,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size } /* end for */ } /* end else */ - if(H5Z_xform_eval_full(tree, array_size, array_type, &res) < 0) + if(H5Z__xform_eval_full(tree, array_size, array_type, &res) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") if(data_xform_prop->dat_val_pointers->num_ptrs > 1) @@ -1096,25 +1100,30 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_xform_eval_full + * Function: H5Z__xform_eval_full + * * Purpose: Does a full evaluation of the parse tree contained in tree * and applies this transform to array. + * + * Notes: In the case of a polynomial data transform (ie, the left and right + * subtree are both of type H5Z_XFORM_SYMBOL), the convention is + * that the left hand side will accumulate changes and, at the end, + * the new data will be copied from the lhs. + * * Return: Nothing + * * Programmer: Leon Arber * 5/1/04 * - * Notes: In the case of a polynomial data transform (ie, the left and right subtree - * are both of type H5Z_XFORM_SYMBOL), the convention is that the left hand side - * will accumulate changes and, at the end, the new data will be copied from the lhs. *------------------------------------------------------------------------- */ static herr_t -H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, H5Z_result *res) +H5Z__xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, H5Z_result *res) { H5Z_result resl, resr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(tree); @@ -1139,9 +1148,9 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ res->value.dat_val = *((void**)(tree->value.dat_val)); } /* end if */ else { - if(tree->lchild && H5Z_xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0) + if(tree->lchild && H5Z__xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") - if(H5Z_xform_eval_full(tree->rchild, array_size, array_type, &resr) < 0) + if(H5Z__xform_eval_full(tree->rchild, array_size, array_type, &resr) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") res->type = H5Z_XFORM_SYMBOL; @@ -1191,23 +1200,25 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_xform_eval_full() */ +} /* end H5Z__xform_eval_full() */ /*------------------------------------------------------------------------- * Function: H5Z_find_type + * * Return: Native type of datatype that is passed in + * * Programmer: Leon Arber, 4/20/04 * *------------------------------------------------------------------------- */ static hid_t -H5Z_xform_find_type(const H5T_t* type) +H5Z__xform_find_type(const H5T_t* type) { H5T_t *tmp; /* Temporary datatype */ hid_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(type); @@ -1274,25 +1285,28 @@ H5Z_xform_find_type(const H5T_t* type) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_xform_find_type() */ +} /* end H5Z__xform_find_type() */ /*------------------------------------------------------------------------- - * Function: H5Z_xform_copy_tree + * Function: H5Z__xform_copy_tree + * * Purpose: Makes a copy of the parse tree passed in. + * * Return: A pointer to a root for a new parse tree which is a copy * of the one passed in. + * * Programmer: Leon Arber * April 1, 2004. * *------------------------------------------------------------------------- */ static void * -H5Z_xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datval_ptrs* new_dat_val_pointers) +H5Z__xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datval_ptrs* new_dat_val_pointers) { H5Z_node* ret_value=NULL; - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC HDassert(tree); @@ -1351,21 +1365,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_op_is_numbs + * Function: H5Z__op_is_numbs + * * Purpose: Internal function to facilitate the condition check in - * H5Z_xform_reduce_tree to reduce the bulkiness of the code. + * H5Z__xform_reduce_tree to reduce the bulkiness of the code. + * * Return: TRUE or FALSE + * * Programmer: Raymond Lu * 15 March 2012 * *------------------------------------------------------------------------- */ static hbool_t -H5Z_op_is_numbs(H5Z_node* _tree) +H5Z__op_is_numbs(H5Z_node* _tree) { hbool_t ret_value = FALSE; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(_tree); @@ -1377,23 +1394,26 @@ H5Z_op_is_numbs(H5Z_node* _tree) /*------------------------------------------------------------------------- - * Function: H5Z_op_is_numbs2 + * Function: H5Z__op_is_numbs2 + * * Purpose: Internal function to facilitate the condition check in - * H5Z_xform_reduce_tree to reduce the bulkiness of the code. - * The difference from H5Z_op_is_numbs is that the left child + * H5Z__xform_reduce_tree to reduce the bulkiness of the code. + * The difference from H5Z__op_is_numbs is that the left child * can be empty, like -x or +x. + * * Return: TRUE or FALSE + * * Programmer: Raymond Lu * 15 March 2012 * *------------------------------------------------------------------------- */ static hbool_t -H5Z_op_is_numbs2(H5Z_node* _tree) +H5Z__op_is_numbs2(H5Z_node* _tree) { hbool_t ret_value = FALSE; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(_tree); @@ -1406,50 +1426,51 @@ H5Z_op_is_numbs2(H5Z_node* _tree) /*------------------------------------------------------------------------- - * Function: H5Z_xform_reduce_tree + * Function: H5Z__xform_reduce_tree + * * Purpose: Simplifies parse tree passed in by performing any obvious * and trivial arithemtic calculations. * * Return: None. + * * Programmer: Leon Arber * April 1, 2004. - * Modifications: * *------------------------------------------------------------------------- */ static void -H5Z_xform_reduce_tree(H5Z_node* tree) +H5Z__xform_reduce_tree(H5Z_node* tree) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(tree) { if((tree->type == H5Z_XFORM_DIVIDE) || (tree->type == H5Z_XFORM_MULT)) { - if(H5Z_op_is_numbs(tree)) - H5Z_do_op(tree); + if(H5Z__op_is_numbs(tree)) + H5Z__do_op(tree); else { - H5Z_xform_reduce_tree(tree->lchild); - if(H5Z_op_is_numbs(tree)) - H5Z_do_op(tree); + H5Z__xform_reduce_tree(tree->lchild); + if(H5Z__op_is_numbs(tree)) + H5Z__do_op(tree); else { - H5Z_xform_reduce_tree(tree->rchild); - if(H5Z_op_is_numbs(tree)) - H5Z_do_op(tree); + H5Z__xform_reduce_tree(tree->rchild); + if(H5Z__op_is_numbs(tree)) + H5Z__do_op(tree); } } } else if((tree->type == H5Z_XFORM_PLUS) || (tree->type == H5Z_XFORM_MINUS)) { - if(H5Z_op_is_numbs2(tree)) - H5Z_do_op(tree); + if(H5Z__op_is_numbs2(tree)) + H5Z__do_op(tree); else { - H5Z_xform_reduce_tree(tree->lchild); - if(H5Z_op_is_numbs2(tree)) - H5Z_do_op(tree); + H5Z__xform_reduce_tree(tree->lchild); + if(H5Z__op_is_numbs2(tree)) + H5Z__do_op(tree); else { - H5Z_xform_reduce_tree(tree->rchild); - if(H5Z_op_is_numbs2(tree)) - H5Z_do_op(tree); + H5Z__xform_reduce_tree(tree->rchild); + if(H5Z__op_is_numbs2(tree)) + H5Z__do_op(tree); } } } @@ -1461,22 +1482,25 @@ H5Z_xform_reduce_tree(H5Z_node* tree) /*------------------------------------------------------------------------- - * Function: H5Z_do_op + * Function: H5Z__do_op + * * Purpose: If the root of the tree passed in points to a simple * arithmetic operation and the left and right subtrees are both * integer or floating point values, this function does that * operation, free the left and right subtrees, and replaces * the root with the result of the operation. + * * Return: None. + * * Programmer: Leon Arber * April 1, 2004. * *------------------------------------------------------------------------- */ static void -H5Z_do_op(H5Z_node* tree) +H5Z__do_op(H5Z_node* tree) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(tree->type == H5Z_XFORM_DIVIDE) H5Z_XFORM_DO_OP3(/) @@ -1492,7 +1516,7 @@ H5Z_do_op(H5Z_node* tree) /*------------------------------------------------------------------------- - * Function: H5D_xform_create + * Function: H5Z_xform_create * * Purpose: Create a new data transform object from a string. * @@ -1546,7 +1570,7 @@ H5Z_xform_create(const char *expr) data_xform_prop->dat_val_pointers->num_ptrs = 0; /* we generate the parse tree right here and store a pointer to its root in the property. */ - if((data_xform_prop->parse_root = (H5Z_node *)H5Z_xform_parse(expr, data_xform_prop->dat_val_pointers))==NULL) + if((data_xform_prop->parse_root = (H5Z_node *)H5Z__xform_parse(expr, data_xform_prop->dat_val_pointers))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to generate parse tree from expression") /* Sanity check @@ -1563,7 +1587,7 @@ done: if(ret_value==NULL) { if(data_xform_prop) { if(data_xform_prop->parse_root) - H5Z_xform_destroy_parse_tree(data_xform_prop->parse_root); + H5Z__xform_destroy_parse_tree(data_xform_prop->parse_root); if(data_xform_prop->xform_exp) H5MM_xfree(data_xform_prop->xform_exp); if(count > 0 && data_xform_prop->dat_val_pointers->ptr_dat_val) @@ -1600,7 +1624,7 @@ H5Z_xform_destroy(H5Z_data_xform_t *data_xform_prop) if(data_xform_prop) { /* Destroy the parse tree */ - H5Z_xform_destroy_parse_tree(data_xform_prop->parse_root); + H5Z__xform_destroy_parse_tree(data_xform_prop->parse_root); /* Free the expression */ H5MM_xfree(data_xform_prop->xform_exp); @@ -1674,7 +1698,7 @@ H5Z_xform_copy(H5Z_data_xform_t **data_xform_prop) new_data_xform_prop->dat_val_pointers->num_ptrs = 0; /* Copy parse tree */ - if((new_data_xform_prop->parse_root = (H5Z_node*)H5Z_xform_copy_tree((*data_xform_prop)->parse_root, (*data_xform_prop)->dat_val_pointers, new_data_xform_prop->dat_val_pointers)) == NULL) + if((new_data_xform_prop->parse_root = (H5Z_node*)H5Z__xform_copy_tree((*data_xform_prop)->parse_root, (*data_xform_prop)->dat_val_pointers, new_data_xform_prop->dat_val_pointers)) == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "error copying the parse tree") /* Sanity check @@ -1691,7 +1715,7 @@ done: if(ret_value<0) { if(new_data_xform_prop) { if(new_data_xform_prop->parse_root) - H5Z_xform_destroy_parse_tree(new_data_xform_prop->parse_root); + H5Z__xform_destroy_parse_tree(new_data_xform_prop->parse_root); if(new_data_xform_prop->xform_exp) H5MM_xfree(new_data_xform_prop->xform_exp); H5MM_xfree(new_data_xform_prop); diff --git a/src/H5checksum.c b/src/H5checksum.c index 4e98976..a9d2b4e 100644 --- a/src/H5checksum.c +++ b/src/H5checksum.c @@ -15,7 +15,7 @@ * * Created: H5checksum.c * Aug 21 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Internal code for computing fletcher32 checksums * @@ -152,7 +152,7 @@ H5_checksum_fletcher32(const void *_data, size_t _len) /*------------------------------------------------------------------------- - * Function: H5_checksum_crc_make_table + * Function: H5__checksum_crc_make_table * * Purpose: Compute the CRC table for the CRC checksum algorithm * @@ -164,12 +164,12 @@ H5_checksum_fletcher32(const void *_data, size_t _len) *------------------------------------------------------------------------- */ static void -H5_checksum_crc_make_table(void) +H5__checksum_crc_make_table(void) { uint32_t c; /* Checksum for each byte value */ unsigned n, k; /* Local index variables */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Compute the checksum for each possible byte value */ for(n = 0; n < 256; n++) { @@ -184,11 +184,11 @@ H5_checksum_crc_make_table(void) H5_crc_table_computed = TRUE; FUNC_LEAVE_NOAPI_VOID -} /* end H5_checksum_crc_make_table() */ +} /* end H5__checksum_crc_make_table() */ /*------------------------------------------------------------------------- - * Function: H5_checksum_crc_make_table + * Function: H5__checksum_crc_update * * Purpose: Update a running CRC with the bytes buf[0..len-1]--the CRC * should be initialized to all 1's, and the transmitted value @@ -203,22 +203,22 @@ H5_checksum_crc_make_table(void) *------------------------------------------------------------------------- */ static uint32_t -H5_checksum_crc_update(uint32_t crc, const uint8_t *buf, size_t len) +H5__checksum_crc_update(uint32_t crc, const uint8_t *buf, size_t len) { size_t n; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Initialize the CRC table if necessary */ if(!H5_crc_table_computed) - H5_checksum_crc_make_table(); + H5__checksum_crc_make_table(); /* Update the CRC with the results from this buffer */ for(n = 0; n < len; n++) crc = H5_crc_table[(crc ^ buf[n]) & 0xff] ^ (crc >> 8); FUNC_LEAVE_NOAPI(crc) -} /* end H5_checksum_crc_update() */ +} /* end H5__checksum_crc_update() */ /*------------------------------------------------------------------------- @@ -247,7 +247,7 @@ H5_checksum_crc(const void *_data, size_t len) HDassert(_data); HDassert(len > 0); - FUNC_LEAVE_NOAPI(H5_checksum_crc_update((uint32_t)0xffffffffL, (const uint8_t *)_data, len) ^ 0xffffffffL) + FUNC_LEAVE_NOAPI(H5__checksum_crc_update((uint32_t)0xffffffffL, (const uint8_t *)_data, len) ^ 0xffffffffL) } /* end H5_checksum_crc() */ /* diff --git a/src/H5detect.c b/src/H5detect.c index 655b05c..138695b 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -221,25 +221,6 @@ precision (detected_t *d) * * Return: void * - * Modifications: - * - * Robb Matzke, 4 Nov 1996 - * The INFO.perm now contains `-1' for bytes that aren't used and - * are always zero. This happens on the Cray for `short' where - * sizeof(short) is 8, but only the low-order 4 bytes are ever used. - * - * Robb Matzke, 4 Nov 1996 - * Added a `padding' field to indicate how many zero bytes appear to - * the left (N) or right (-N) of the value. - * - * Robb Matzke, 5 Nov 1996 - * Removed HFILE and CFILE arguments. - * - * Neil Fortner, 6 Sep 2013 - * Split macro into DETECT_I and DETECT_BYTE macros, extracted - * common code into DETECT_I_BYTE_CORE. This was done to remove - * "will never be executed" warnings. - * *------------------------------------------------------------------------- */ #define DETECT_I_BYTE_CORE(TYPE,VAR,INFO,DETECT_TYPE) { \ @@ -1617,12 +1598,6 @@ static int verify_signal_handlers(int signum, void (*handler)(int)) * * Return: Success: EXIT_SUCCESS * - * Modifications: - * Some compilers, e.g., Intel C v7.0, took a long time to compile - * with optimization when a module routine contains many code lines. - * Divide up all those types detections macros into subroutines, both - * to avoid the compiler optimization error and cleaner codes. - * *------------------------------------------------------------------------- */ int HDF_NO_UBSAN diff --git a/src/H5private.h b/src/H5private.h index 836d7d5..f8df821 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Friday, October 30, 1998 * * Purpose: This file is included by all HDF5 library source files to @@ -1515,6 +1515,9 @@ typedef off_t h5_stat_size_t; #ifndef HDstrtoull #define HDstrtoull(S,R,N) strtoull(S,R,N) #endif /* HDstrtoul */ +#ifndef HDstrtoumax + #define HDstrtoumax(S,R,N) strtoumax(S,R,N) +#endif /* HDstrtoul */ #ifndef HDstrxfrm #define HDstrxfrm(X,Y,Z) strxfrm(X,Y,Z) #endif /* HDstrxfrm */ diff --git a/src/H5system.c b/src/H5system.c index 24935fd..b0b2fad 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -516,8 +516,6 @@ H5_GCC_DIAG_ON(format-nonliteral) * Programmer: Robb Matzke * Thursday, April 9, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ #ifndef HDstrtoll diff --git a/src/H5timer.c b/src/H5timer.c index cef7bf9..61d6f0f 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -14,7 +14,7 @@ /*------------------------------------------------------------------------- * Created: H5timer.c * Aug 21 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Internal, platform-independent 'timer' support routines. * diff --git a/src/H5trace.c b/src/H5trace.c index db33673..40967ee 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -15,7 +15,7 @@ * * Created: H5trace.c * Aug 21 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Internal code for tracing API calls * diff --git a/src/hdf5.lnt b/src/hdf5.lnt index 995e3f6..61c4a61 100644 --- a/src/hdf5.lnt +++ b/src/hdf5.lnt @@ -1,9 +1,9 @@ // Lint options shared by both PC-Lint for Windows and Flexelint for Linux // Turn off warnings about not using the inlined H5V* functions: --esym(528, H5VM_vector_reduce_product, H5VM_vector_inc) --esym(528, H5VM_vector_cmp, H5VM_vector_cmp_s, H5VM_vector_cmp_u) --esym(528, H5VM_vector_zerop_s, H5VM_vector_zerop_u) +-esym(528, H5VM_vector_reduce_product, H5VM__vector_inc) +-esym(528, H5VM__vector_cmp_s) +-esym(528, H5VM__vector_zerop_s, H5VM__vector_zerop_u) // Suppress message about using 'goto' in a few functions -efunc(801,H5_term_library,H5_trace) diff --git a/test/accum.c b/test/accum.c index 548a04d..3947aff 100644 --- a/test/accum.c +++ b/test/accum.c @@ -1708,10 +1708,10 @@ test_random_write(H5F_t *f) /* Choose random # seed */ seed = (unsigned)HDtime(NULL); -#ifdef QAK +#if 0 /* seed = (unsigned)1155438845; */ HDfprintf(stderr, "Random # seed was: %u\n", seed); -#endif /* QAK */ +#endif HDsrandom(seed); /* Allocate space for the segment length buffer */ diff --git a/test/big.c b/test/big.c index a2f07af..5c1dcda 100644 --- a/test/big.c +++ b/test/big.c @@ -803,10 +803,10 @@ main (int ac, char **av) /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); -#ifdef QAK +#if 0 /* seed = (unsigned long)1155438845; */ HDfprintf(stderr, "Random # seed was: %lu\n", seed); -#endif /* QAK */ +#endif HDsrandom((unsigned)seed); /* run VFD-specific test */ diff --git a/test/btree2.c b/test/btree2.c index c4c5530..e209d22 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -2982,10 +2982,10 @@ test_insert_lots(hid_t fapl, const H5B2_create_t *cparam, /* Initialize random number seed */ curr_time=HDtime(NULL); -#ifdef QAK +#if 0 curr_time=1109170019; HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); -#endif /* QAK */ +#endif HDsrandom((unsigned)curr_time); /* @@ -4975,10 +4975,10 @@ test_update_lots(hid_t fapl, const H5B2_create_t *cparam, /* Initialize random number seed */ curr_time = HDtime(NULL); -#ifdef QAK +#if 0 curr_time = 1451342093; HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); -#endif /* QAK */ +#endif HDsrandom((unsigned)curr_time); /* @@ -8652,10 +8652,10 @@ test_remove_lots(const char *env_h5_drvr, hid_t fapl, const H5B2_create_t *cpara /* Initialize random number seed */ curr_time = HDtime(NULL); -#ifdef QAK +#if 0 curr_time = 1163537969; HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); -#endif /* QAK */ +#endif HDsrandom((unsigned)curr_time); /* diff --git a/test/dsets.c b/test/dsets.c index 4ab3efa..3547554 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -11723,9 +11723,9 @@ error: /*------------------------------------------------------------------------- * Function: test_power2up * - * Purpose: Tests that the H5VM_power2up(n) function does not result in an + * Purpose: Tests that the H5VM__power2up(n) function does not result in an * infinite loop when input n exceeds 2^63. (HDFFV-10217) - * H5VM_power2up() is used to calculate the next power of 2 for + * H5VM__power2up() is used to calculate the next power of 2 for * a dataset's scaled dimension sizes. * * Return: Success: 0 diff --git a/test/earray.c b/test/earray.c index 6597afd..a8ae9f0 100644 --- a/test/earray.c +++ b/test/earray.c @@ -232,7 +232,7 @@ init_tparam(earray_test_param_t *tparam, const H5EA_create_t *cparam) HDmemset(tparam, 0, sizeof(*tparam)); /* Compute general information */ - tparam->nsblks = 1 + (cparam->max_nelmts_bits - H5VM_log2_of2(cparam->data_blk_min_elmts)); + tparam->nsblks = 1 + (cparam->max_nelmts_bits - H5VM__log2_of2(cparam->data_blk_min_elmts)); /* Allocate information for each super block */ tparam->sblk_info = (H5EA_sblk_info_t *)HDmalloc(sizeof(H5EA_sblk_info_t) * tparam->nsblks); @@ -381,10 +381,6 @@ check_stats(const H5EA_t *ea, const earray_state_t *state) TEST_ERROR } /* end if */ #endif /* NOT_YET */ -#ifdef QAK -HDfprintf(stderr, "nelmts = %Hu, total EA size = %Hu\n", earray_stats.stored.nelmts, - (earray_stats.computed.hdr_size + earray_stats.computed.index_blk_size + earray_stats.stored.super_blk_size + earray_stats.stored.data_blk_size)); -#endif /* QAK */ /* All tests passed */ return(0); @@ -560,12 +556,6 @@ finish(hid_t file, hid_t fapl, H5F_t *f, H5EA_t *ea, haddr_t ea_addr) if(H5EA_close(ea) < 0) FAIL_STACK_ERROR -#ifdef QAK -HDfprintf(stderr, "ea_addr = %a\n", ea_addr); -H5Fflush(file, H5F_SCOPE_GLOBAL); -HDsystem("cp earray.h5 earray.h5.save"); -#endif /* QAK */ - /* Delete array */ if(H5EA_delete(f, ea_addr, NULL) < 0) FAIL_STACK_ERROR @@ -728,7 +718,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE /* Set invalid max. # of elements per data block page bits */ if(test_cparam.idx_blk_elmts > 0) { HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); - test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(H5VM_log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1); + test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(H5VM__log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1); H5E_BEGIN_TRY { ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; @@ -1383,20 +1373,9 @@ eiter_fw_state(void *_eiter, const H5EA_create_t *cparam, /* Compute super block index for element index */ /* (same eqn. as in H5EA__dblock_sblk_idx()) */ - sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); -#ifdef QAK -HDfprintf(stderr, "idx = %Hu, tparam->sblk_info[%u] = {%Zu, %Zu, %Hu, %Hu}\n", idx, sblk_idx, tparam->sblk_info[sblk_idx].ndblks, tparam->sblk_info[sblk_idx].dblk_nelmts, tparam->sblk_info[sblk_idx].start_idx, tparam->sblk_info[sblk_idx].start_dblk); -#endif /* QAK */ - + sblk_idx = H5VM__log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); state->nelmts = EA_NELMTS(cparam, tparam, idx, sblk_idx); -#ifdef QAK -HDfprintf(stderr, "state->nelmts = %Hu\n", state->nelmts); -#endif /* QAK */ - state->ndata_blks = EA_NDATA_BLKS(cparam, tparam, idx, sblk_idx); -#ifdef QAK -HDfprintf(stderr, "state->ndata_blks = %Hu\n", state->ndata_blks); -#endif /* QAK */ /* Check if we have any super blocks yet */ if(tparam->sblk_info[sblk_idx].ndblks >= cparam->sup_blk_min_data_ptrs) { @@ -1405,9 +1384,6 @@ HDfprintf(stderr, "state->ndata_blks = %Hu\n", state->ndata_blks); eiter->base_sblk_idx = sblk_idx; state->nsuper_blks = (sblk_idx - eiter->base_sblk_idx) + 1; -#ifdef QAK -HDfprintf(stderr, "state->nsuper_blks = %Hu\n", state->nsuper_blks); -#endif /* QAK */ } /* end if */ else state->nsuper_blks = 0; @@ -1489,10 +1465,10 @@ eiter_rv_init(const H5EA_create_t *cparam, const earray_test_param_t *tparam, eiter->idx = cnt - 1; eiter->max = cnt - 1; if(cnt > cparam->idx_blk_elmts) { - eiter->max_sblk_idx = H5VM_log2_gen((uint64_t)(((eiter->max - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + eiter->max_sblk_idx = H5VM__log2_gen((uint64_t)(((eiter->max - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); eiter->max_nelmts = EA_NELMTS(cparam, tparam, eiter->max, eiter->max_sblk_idx); eiter->max_ndata_blks = EA_NDATA_BLKS(cparam, tparam, eiter->max, eiter->max_sblk_idx); - eiter->idx_blk_nsblks = 2 * H5VM_log2_of2((uint32_t)cparam->sup_blk_min_data_ptrs); + eiter->idx_blk_nsblks = 2 * H5VM__log2_of2((uint32_t)cparam->sup_blk_min_data_ptrs); } /* end if */ else { eiter->max_sblk_idx = (hsize_t)0; @@ -1610,38 +1586,27 @@ eiter_rv_state(void *_eiter, const H5EA_create_t *cparam, hsize_t tmp_idx; /* Temporary index in superblock */ hsize_t dblk_idx; /* Index of data block within superblock */ - idx_sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + idx_sblk_idx = H5VM__log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); tmp_idx = idx - (cparam->idx_blk_elmts + tparam->sblk_info[idx_sblk_idx].start_idx); dblk_idx = tmp_idx / tparam->sblk_info[idx_sblk_idx].dblk_nelmts; if(dblk_idx > 0) loc_idx = idx - tparam->sblk_info[idx_sblk_idx].dblk_nelmts; else loc_idx = cparam->idx_blk_elmts + tparam->sblk_info[idx_sblk_idx].start_idx - 1; - loc_sblk_idx = H5VM_log2_gen((uint64_t)(((loc_idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + loc_sblk_idx = H5VM__log2_gen((uint64_t)(((loc_idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); } /* end else */ -#ifdef QAK -HDfprintf(stderr, "idx = %Hu, loc_idx = %Hu, eiter->max_sblk_idx = %u, idx_sblk_idx = %u, loc_sblk_idx = %u\n", idx, loc_idx, eiter->max_sblk_idx, idx_sblk_idx, loc_sblk_idx); -HDfprintf(stderr, "tparam->sblk_info[%u] = {%Zu, %Zu, %Hu, %Hu}\n", idx_sblk_idx, tparam->sblk_info[idx_sblk_idx].ndblks, tparam->sblk_info[idx_sblk_idx].dblk_nelmts, tparam->sblk_info[idx_sblk_idx].start_idx, tparam->sblk_info[idx_sblk_idx].start_dblk); -HDfprintf(stderr, "tparam->sblk_info[%u] = {%Zu, %Zu, %Hu, %Hu}\n", eiter->max_sblk_idx, tparam->sblk_info[eiter->max_sblk_idx].ndblks, tparam->sblk_info[eiter->max_sblk_idx].dblk_nelmts, tparam->sblk_info[eiter->max_sblk_idx].start_idx, tparam->sblk_info[eiter->max_sblk_idx].start_dblk); -#endif /* QAK */ if(idx < cparam->idx_blk_elmts + cparam->data_blk_min_elmts) idx_nelmts = (hsize_t)cparam->idx_blk_elmts; else idx_nelmts = EA_NELMTS(cparam, tparam, loc_idx, loc_sblk_idx); state->nelmts = (eiter->max_nelmts - idx_nelmts) + cparam->idx_blk_elmts; -#ifdef QAK -HDfprintf(stderr, "eiter->max_nelmts = %Hu, idx_nelmts = %Hu, state->nelmts = %Hu\n", eiter->max_nelmts, idx_nelmts, state->nelmts); -#endif /* QAK */ if(idx < cparam->idx_blk_elmts + cparam->data_blk_min_elmts) idx_ndata_blks = 0; else idx_ndata_blks = EA_NDATA_BLKS(cparam, tparam, loc_idx, loc_sblk_idx); state->ndata_blks = eiter->max_ndata_blks - idx_ndata_blks; -#ifdef QAK -HDfprintf(stderr, "eiter->max_ndata_blks = %Hu, idx_ndata_blks = %Hu, state->ndata_blks = %Hu\n", eiter->max_ndata_blks, idx_ndata_blks, state->ndata_blks); -#endif /* QAK */ /* Check if we have any super blocks yet */ if(tparam->sblk_info[eiter->max_sblk_idx].ndblks >= cparam->sup_blk_min_data_ptrs) { @@ -1649,9 +1614,6 @@ HDfprintf(stderr, "eiter->max_ndata_blks = %Hu, idx_ndata_blks = %Hu, state->nda state->nsuper_blks = (eiter->max_sblk_idx - idx_sblk_idx) + 1; else state->nsuper_blks = (eiter->max_sblk_idx - eiter->idx_blk_nsblks) + 1; -#ifdef QAK -HDfprintf(stderr, "eiter->idx_blk_nsblks = %Hu, state->nsuper_blks = %Hu\n", eiter->idx_blk_nsblks, state->nsuper_blks); -#endif /* QAK */ } /* end if */ } /* end else */ @@ -2355,7 +2317,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Compute super block index for element index */ /* (same eqn. as in H5EA__dblock_sblk_idx()) */ - sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + sblk_idx = H5VM__log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); state.nelmts = (hsize_t)cparam->idx_blk_elmts + tparam->sblk_info[sblk_idx].dblk_nelmts; state.ndata_blks = (hsize_t)1; state.nsuper_blks = (hsize_t)1; diff --git a/test/fheap.c b/test/fheap.c index b1a0db0..55af7d6 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -1592,7 +1592,7 @@ fill_all_2nd_indirect_rows(H5HF_t *fh, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 2nd level deep indirect blocks */ - for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) + for(u = 0; u < (H5VM__log2_of2(width) + 1); u++) if(fill_2nd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR @@ -1710,7 +1710,7 @@ fill_all_3rd_indirect_rows(H5HF_t *fh, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 3rd level deep indirect blocks */ - for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) + for(u = 0; u < (H5VM__log2_of2(width) + 1); u++) /* Fill row of 3rd level indirect blocks */ if(fill_3rd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR @@ -1800,7 +1800,7 @@ fill_all_4th_indirect_rows(H5HF_t *fh, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 4th level deep indirect blocks */ - for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) { + for(u = 0; u < (H5VM__log2_of2(width) + 1); u++) { /* Fill row of 4th level indirect blocks */ if(fill_4th_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR @@ -3195,7 +3195,6 @@ error: return(1); } /* test_reopen_hdr() */ -#ifndef QAK2 /*------------------------------------------------------------------------- * Function: test_man_insert_weird @@ -6237,7 +6236,6 @@ error: } /* test_man_fill_all_4th_recursive_indirect() */ #endif /* ALL_INSERT_TESTS */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_man_start_5th_recursive_indirect @@ -6369,9 +6367,7 @@ error: } H5E_END_TRY; return(1); } /* test_man_start_5th_recursive_indirect() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_man_remove_bogus @@ -6448,10 +6444,10 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); -#ifdef QAK +#if 0 /* seed = (unsigned long)1155438845; */ HDfprintf(stderr, "Random # seed was: %lu\n", seed); -#endif /* QAK */ +#endif HDsrandom((unsigned)seed); /* Set heap ID to random (non-null) value */ @@ -7270,10 +7266,6 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Verify the file is correct size */ -#ifdef QAK -HDfprintf(stderr, "empty_size = %lu\n", (unsigned long)empty_size); -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ if(file_size != empty_size) TEST_ERROR @@ -7573,10 +7565,6 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param TEST_ERROR /* Verify the file is correct size */ -#ifdef QAK -HDfprintf(stderr, "empty_size = %lu\n", (unsigned long)empty_size); -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ if(file_size != empty_size) TEST_ERROR @@ -7720,9 +7708,7 @@ error: return 1; } /* test_man_incr_insert_remove() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_man_remove_root_direct @@ -8323,9 +8309,7 @@ error: } H5E_END_TRY; return(1); } /* test_man_remove_3rd_indirect() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_man_skip_start_block @@ -9589,9 +9573,6 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -9725,9 +9706,6 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -9747,9 +9725,6 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Insert object too large for initial block size in skipped indirect blocks */ obj_size = (size_t)DBLOCK_SIZE(fh, 3) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, 4); if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR @@ -9760,9 +9735,6 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Insert object to fill space in (medium) block just created */ obj_size = (size_t)DBLOCK_FREE(fh, 4) - obj_size; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10506,9 +10478,6 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10627,9 +10596,6 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped( /* Retrieve info about heap */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); -#ifdef QAK -HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); -#endif /* QAK */ /* Fill direct blocks in root indirect block */ if(fill_root_direct(fh, fill_size, &state, &keep_ids)) @@ -10660,9 +10626,6 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows + 1); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10673,9 +10636,6 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows + 1) - obj_size; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10829,9 +10789,6 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10998,9 +10955,6 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -11155,9 +11109,6 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -11332,9 +11283,6 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -11544,9 +11492,6 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -11740,9 +11685,6 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -11972,9 +11914,6 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ * object */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; -#ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); -#endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -12043,9 +11982,7 @@ error: } H5E_END_TRY; return(1); } /* test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_man_frag_simple @@ -12396,9 +12333,6 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * /* Compute # of bits used in first row */ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); -#ifdef QAK -HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); -#endif /* QAK */ /* Fill direct blocks in root indirect block */ if(fill_root_direct(fh, fill_size, &state, &keep_ids)) @@ -12576,9 +12510,7 @@ error: } H5E_END_TRY; return(1); } /* test_man_frag_3rd_direct() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_huge_insert_one @@ -12699,9 +12631,6 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -12929,9 +12858,6 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -13234,9 +13160,6 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -13657,9 +13580,6 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -13879,9 +13799,6 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size, (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -13911,9 +13828,7 @@ error: } H5E_END_TRY; return(1); } /* test_filtered_huge() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_tiny_insert_one @@ -14034,9 +13949,6 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -14264,9 +14176,6 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -14864,9 +14773,6 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -14907,10 +14813,7 @@ error: } H5E_END_TRY; return(1); } /* test_tiny_insert_mix() */ -#endif /* QAK */ -#endif /* QAK2 */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_filtered_man_root_direct @@ -15060,9 +14963,6 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size, (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -15388,9 +15288,6 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size, (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -15413,9 +15310,7 @@ error: } H5E_END_TRY; return(1); } /* test_filtered_man_root_indirect() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_random @@ -15498,10 +15393,10 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); -#ifdef QAK +#if 0 /* seed = (unsigned long)1156158635; */ HDfprintf(stderr, "Random # seed was: %lu\n", seed); -#endif /* QAK */ +#endif HDsrandom((unsigned)seed); /* Loop over adding objects to the heap, until the size limit is reached */ @@ -15522,9 +15417,6 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); /* Increment the amount of objects added */ total_obj_added += obj_size; } /* end while */ -#ifdef QAK -HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %Hu\n", keep_ids.num_ids, total_obj_added, size_limit); -#endif /* QAK */ /* Randomize the order of the IDs kept */ for(u = 0; u < keep_ids.num_ids; u++) { @@ -15583,9 +15475,6 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -15704,10 +15593,10 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); -#ifdef QAK +#if 0 /* seed = (unsigned long)1155181717; */ HDfprintf(stderr, "Random # seed was: %lu\n", seed); -#endif /* QAK */ +#endif HDsrandom((unsigned)seed); /* Loop over adding objects to the heap, until the size limit is reached */ @@ -15740,9 +15629,6 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); /* Increment the amount of objects added */ total_obj_added += obj_size; } /* end while */ -#ifdef QAK -HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %Hu\n", keep_ids.num_ids, total_obj_added, size_limit); -#endif /* QAK */ /* Randomize the order of the IDs kept */ for(u = 0; u < keep_ids.num_ids; u++) { @@ -15801,10 +15687,6 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % /* Get the size of the file */ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR -#ifdef QAK -HDfprintf(stderr, "empty_size = %lu\n", (unsigned long)empty_size); -HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); -#endif /* QAK */ /* Verify the file is correct size */ if(file_size != empty_size) @@ -15838,9 +15720,7 @@ error: } H5E_END_TRY; return(1); } /* test_random_pow2() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_write @@ -16124,9 +16004,7 @@ error: } H5E_END_TRY; return(1); } /* test_write() */ -#endif /* QAK */ -#ifndef QAK /*------------------------------------------------------------------------- * Function: test_bug1 @@ -16301,7 +16179,6 @@ error: } H5E_END_TRY; return(1); } /* test_bug1() */ -#endif /* QAK */ /*------------------------------------------------------------------------- diff --git a/test/hdfs.c b/test/hdfs.c index ab39da6..1e4f26c 100644 --- a/test/hdfs.c +++ b/test/hdfs.c @@ -30,7 +30,6 @@ #ifdef H5_HAVE_LIBHDFS #define HDFS_TEST_DEBUG 0 #define HDFS_TEST_MAX_BUF_SIZE 256 -#endif /* H5_HAVE_LIBHDFS */ /***************************************************************************** * @@ -372,11 +371,8 @@ if (strcmp((actual), (expected)) != 0) { \ * OTHER MACROS AND DEFINITIONS * ********************************/ -/* copied from src/hdfs.c - */ -#ifdef H5_HAVE_LIBHDFS +/* copied from src/hdfs.c */ #define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1) -#endif /* H5_HAVE_LIBHDFS */ #define HDFS_NAMENODE_NAME_MAX_SIZE 128 @@ -384,12 +380,10 @@ if (strcmp((actual), (expected)) != 0) { \ * FILE-LOCAL GLOBAL VARIABLES * *******************************/ -#ifdef H5_HAVE_LIBHDFS static const char filename_missing[] = "/tmp/missing.txt"; static const char filename_bard[] = "/tmp/t8.shakespeare.txt"; static const char filename_raven[] = "/tmp/Poe_Raven.txt"; static const char filename_example_h5[] = "/tmp/t.h5"; -#endif /* H5_HAVE_LIBHDFS */ static H5FD_hdfs_fapl_t default_fa = { 1, /* fa version */ @@ -399,6 +393,7 @@ static H5FD_hdfs_fapl_t default_fa = { "", /* kerberos path */ 1024, /* buffer size */ }; +#endif /* H5_HAVE_LIBHDFS */ /****************** * TEST FUNCTIONS * @@ -429,6 +424,14 @@ static H5FD_hdfs_fapl_t default_fa = { static int test_fapl_config_validation(void) { +#ifndef H5_HAVE_LIBHDFS + TESTING("HDFS fapl configuration validation"); + SKIPPED(); + puts(" HDFS VFD is not enabled"); + fflush(stdout); + return 0; + +#else /********************* * test-local macros * *********************/ @@ -604,6 +607,7 @@ error: } H5E_END_TRY; } return 1; +#endif /* H5_HAVE_LIBHDFS */ } /* end test_fapl_config_validation() */ @@ -630,6 +634,14 @@ error: static int test_hdfs_fapl(void) { +#ifndef H5_HAVE_LIBHDFS + TESTING("HDFS fapl "); + SKIPPED(); + puts(" HDFS VFD is not enabled"); + fflush(stdout); + return 0; + +#else /************************ * test-local variables * ************************/ @@ -681,6 +693,7 @@ error: } H5E_END_TRY; return 1; +#endif /* H5_HAVE_LIBHDFS */ } /* end test_hdfs_fapl() */ @@ -1723,6 +1736,7 @@ main(void) * commence tests * ******************/ +#ifdef H5_HAVE_LIBHDFS static char hdfs_namenode_name[HDFS_NAMENODE_NAME_MAX_SIZE] = ""; const char *hdfs_namenode_name_env = NULL; @@ -1736,6 +1750,7 @@ main(void) hdfs_namenode_name_env, HDFS_NAMENODE_NAME_MAX_SIZE); } +#endif /* H5_HAVE_LIBHDFS */ h5_reset(); diff --git a/test/mirror_vfd.c b/test/mirror_vfd.c index 4da742f..35c3f90 100644 --- a/test/mirror_vfd.c +++ b/test/mirror_vfd.c @@ -28,6 +28,8 @@ #ifdef H5_HAVE_MIRROR_VFD +#include "H5FDmirror_priv.h" /* Private header for the mirror VFD */ + /* For future consideration, IP address and port number might be * environment variables? */ diff --git a/test/pool.c b/test/pool.c index 1851d6e..591413d 100644 --- a/test/pool.c +++ b/test/pool.c @@ -636,10 +636,10 @@ test_allocate_random(void) /* Initialize random number seed */ curr_time = HDtime(NULL); -#ifdef QAK +#if 0 curr_time=1115412944; HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); -#endif /* QAK */ +#endif HDsrandom((unsigned)curr_time); /* Create a memory pool */ diff --git a/test/swmr_addrem_writer.c b/test/swmr_addrem_writer.c index 71e4929..7ad74ed 100644 --- a/test/swmr_addrem_writer.c +++ b/test/swmr_addrem_writer.c @@ -88,26 +88,6 @@ open_skeleton(const char *filename, unsigned verbose) if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) return -1; -#ifdef QAK - /* Increase the initial size of the metadata cache */ - { - H5AC_cache_config_t mdc_config; - - mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION; - H5Pget_mdc_config(fapl, &mdc_config); - HDfprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size); - HDfprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length); - mdc_config.set_initial_size = 1; - mdc_config.initial_size = 16 * 1024 * 1024; - /* mdc_config.epoch_length = 5000; */ - H5Pset_mdc_config(fapl, &mdc_config); - } -#endif /* QAK */ - -#ifdef QAK - H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024)); -#endif /* QAK */ - /* Open the file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0) return -1; diff --git a/test/swmr_generator.c b/test/swmr_generator.c index f6a4fe2..7fb08df 100644 --- a/test/swmr_generator.c +++ b/test/swmr_generator.c @@ -121,38 +121,10 @@ gen_skeleton(const char *filename, hbool_t verbose, hbool_t swmr_write, if(!HDstrcmp(index_type, "b2")) max_dims[0] = H5S_UNLIMITED; -#ifdef QAK - /* Increase the initial size of the metadata cache */ - { - H5AC_cache_config_t mdc_config; - - mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION; - H5Pget_mdc_config(fapl, &mdc_config); - HDfprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size); - HDfprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length); - mdc_config.set_initial_size = 1; - mdc_config.initial_size = 16 * 1024 * 1024; - /* mdc_config.epoch_length = 5000; */ - H5Pset_mdc_config(fapl, &mdc_config); - } -#endif /* QAK */ - -#ifdef QAK - H5Pset_small_data_block_size(fapl, (hsize_t)(50 * CHUNK_SIZE * DTYPE_SIZE)); -#endif /* QAK */ - -#ifdef QAK - H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024)); -#endif /* QAK */ - /* Create file creation property list */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) return -1; -#ifdef QAK - H5Pset_link_phase_change(fcpl, 0, 0); -#endif /* QAK */ - /* Emit informational message */ if(verbose) HDfprintf(stderr, "Creating file\n"); diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c index 2bebab9..504ea8a 100644 --- a/test/swmr_remove_writer.c +++ b/test/swmr_remove_writer.c @@ -90,26 +90,6 @@ open_skeleton(const char *filename, unsigned verbose, unsigned old) return -1; } -#ifdef QAK -/* Increase the initial size of the metadata cache */ - { - H5AC_cache_config_t mdc_config; - - mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION; - H5Pget_mdc_config(fapl, &mdc_config); - HDfprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size); - HDfprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length); - mdc_config.set_initial_size = 1; - mdc_config.initial_size = 16 * 1024 * 1024; - /* mdc_config.epoch_length = 5000; */ - H5Pset_mdc_config(fapl, &mdc_config); - } -#endif /* QAK */ - -#ifdef QAK - H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024)); -#endif /* QAK */ - /* Open the file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0) return -1; diff --git a/test/swmr_sparse_writer.c b/test/swmr_sparse_writer.c index 5173c71..1892fe2 100644 --- a/test/swmr_sparse_writer.c +++ b/test/swmr_sparse_writer.c @@ -87,26 +87,6 @@ open_skeleton(const char *filename, unsigned verbose) if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) return -1; -#ifdef QAK - /* Increase the initial size of the metadata cache */ - { - H5AC_cache_config_t mdc_config; - - mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION; - H5Pget_mdc_config(fapl, &mdc_config); - HDfprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size); - HDfprintf(stderr,"mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length); - mdc_config.set_initial_size = 1; - mdc_config.initial_size = 16 * 1024 * 1024; - /* mdc_config.epoch_length = 5000; */ - H5Pset_mdc_config(fapl, &mdc_config); - } -#endif /* QAK */ - -#ifdef QAK - H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024)); -#endif /* QAK */ - /* Open the file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0) return -1; diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c index fc7e7a5..0527229 100644 --- a/test/swmr_start_write.c +++ b/test/swmr_start_write.c @@ -85,16 +85,6 @@ create_file(const char *filename, hbool_t verbose, FILE *verbose_file, if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) return -1; -#ifdef QAK - if(verbose) { - char verbose_name[1024]; - - HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_start_write.log.%u", random_seed); - - H5Pset_fapl_log(fapl, verbose_name, H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024)); - } /* end if */ -#endif /* QAK */ - /* Create file creation property list */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) return -1; diff --git a/test/swmr_writer.c b/test/swmr_writer.c index d4387aa..656a5b2 100644 --- a/test/swmr_writer.c +++ b/test/swmr_writer.c @@ -90,22 +90,6 @@ open_skeleton(const char *filename, hbool_t verbose, FILE *verbose_file, return -1; } -#ifdef QAK - /* Increase the initial size of the metadata cache */ - { - H5AC_cache_config_t mdc_config; - - mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION; - H5Pget_mdc_config(fapl, &mdc_config); - HDfprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size); - HDfprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length); - mdc_config.set_initial_size = 1; - mdc_config.initial_size = 16 * 1024 * 1024; - /* mdc_config.epoch_length = 5000; */ - H5Pset_mdc_config(fapl, &mdc_config); - } -#endif /* QAK */ - if(use_log_vfd) { char verbose_name[1024]; diff --git a/test/tattr.c b/test/tattr.c index dab03a7..496dd6c 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -542,7 +542,7 @@ test_attr_flush(hid_t fapl) ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata); CHECK(ret, FAIL, "H5Awrite"); - if(!H5_DBL_ABS_EQUAL(rdata, 0.0)) + if(!H5_DBL_ABS_EQUAL(rdata, (double)0.0f)) TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,(double)0.0F); ret=H5Fflush(fil, H5F_SCOPE_GLOBAL); @@ -551,7 +551,7 @@ test_attr_flush(hid_t fapl) ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata); CHECK(ret, FAIL, "H5Awrite"); - if(!H5_DBL_ABS_EQUAL(rdata, 0.0)) + if(!H5_DBL_ABS_EQUAL(rdata, (double)0.0f)) TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,(double)0.0F); ret=H5Awrite(att, H5T_NATIVE_DOUBLE, &wdata); @@ -6773,13 +6773,6 @@ attr_iterate2_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *info, char attrname[NAME_BUF_SIZE]; /* Object name */ H5A_info_t my_info; /* Local attribute info */ -#ifdef QAK -HDfprintf(stderr, "attr_name = '%s'\n", attr_name); -if(info) - HDfprintf(stderr, "info->corder = %u\n", (unsigned)info->corder); -HDfprintf(stderr, "op_data->curr = %Hd\n", op_data->curr); -#endif /* QAK */ - /* Increment # of times the callback was called */ op_data->ncalled++; diff --git a/utils/mirror_vfd/mirror_remote.h b/utils/mirror_vfd/mirror_remote.h index 9132d51..67e95a5 100644 --- a/utils/mirror_vfd/mirror_remote.h +++ b/utils/mirror_vfd/mirror_remote.h @@ -20,6 +20,8 @@ #ifdef H5_HAVE_MIRROR_VFD +#include "H5FDmirror_priv.h" /* Private header for the mirror VFD */ + #define V_NONE 0 #define V_ERR 1 #define V_WARN 2 -- cgit v0.12 From 47ad0ac7237b464e939fe54dd129a151944d9706 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 6 Aug 2020 15:09:59 -0700 Subject: Renames BEST-EFFORT to BEST_EFFORT for file locking env var --- release_docs/RELEASE.txt | 6 +++--- src/H5FDcore.c | 2 +- src/H5FDdirect.c | 2 +- src/H5FDlog.c | 2 +- src/H5FDsec2.c | 2 +- src/H5FDstdio.c | 2 +- src/H5Fint.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6013603..7ccdbe9 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -556,15 +556,15 @@ New Features (DER - 2020/03/18, HDFFV-11057) - - Add BEST-EFFORT value to HDF5_USE_FILE_LOCKING environment variable + - Add BEST_EFFORT value to HDF5_USE_FILE_LOCKING environment variable - This change adds a BEST-EFFORT to the TRUE/FALSE, 1/0 settings that + This change adds a BEST_EFFORT to the TRUE/FALSE, 1/0 settings that were previously accepted. This option turns on file locking but ignores locking errors when the library detects that file locking has been disabled on a file system (useful on some HPC Lustre installations). - The capitalization of BEST-EFFORT is mandatory. + The capitalization of BEST_EFFORT is mandatory. See the configure option discussion for HDFFV-11092 (above) for more information on the file locking feature and how it's controlled. diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 7a31fdf..9a82e2b 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -423,7 +423,7 @@ H5FD__init_package(void) /* Check the use disabled file locks environment variable */ lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); - if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST_EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 6494fff..9839269 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -204,7 +204,7 @@ H5FD__init_package(void) /* Check the use disabled file locks environment variable */ lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); - if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST_EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 045662a..c0506e9 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -245,7 +245,7 @@ H5FD__init_package(void) /* Check the use disabled file locks environment variable */ lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); - if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST_EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index eee554a..12e107f 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -201,7 +201,7 @@ H5FD__init_package(void) /* Check the use disabled file locks environment variable */ lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); - if(lock_env_var && !HDstrcmp(lock_env_var, "BEST-EFFORT")) + if(lock_env_var && !HDstrcmp(lock_env_var, "BEST_EFFORT")) ignore_disabled_file_locks_s = TRUE; /* Override: Ignore disabled locks */ else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = FALSE; /* Override: Don't ignore disabled locks */ diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 574cd9d..a769e86 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -242,7 +242,7 @@ H5FD_stdio_init(void) /* Check the use disabled file locks environment variable */ lock_env_var = getenv("HDF5_USE_FILE_LOCKING"); - if(lock_env_var && !strcmp(lock_env_var, "BEST-EFFORT")) + if(lock_env_var && !strcmp(lock_env_var, "BEST_EFFORT")) ignore_disabled_file_locks_s = 1; /* Override: Ignore disabled locks */ else if(lock_env_var && (!strcmp(lock_env_var, "TRUE") || !strcmp(lock_env_var, "1"))) ignore_disabled_file_locks_s = 0; /* Override: Don't ignore disabled locks */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 8b2d18f..7b1ea40 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -291,7 +291,7 @@ H5F__parse_file_lock_env_var(htri_t *use_locks) lock_env_var = HDgetenv("HDF5_USE_FILE_LOCKING"); if(lock_env_var && (!HDstrcmp(lock_env_var, "FALSE") || !HDstrcmp(lock_env_var, "0"))) *use_locks = FALSE; /* Override: Never use locks */ - else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "BEST-EFFORT") || !HDstrcmp(lock_env_var, "1"))) + else if(lock_env_var && (!HDstrcmp(lock_env_var, "TRUE") || !HDstrcmp(lock_env_var, "BEST_EFFORT") || !HDstrcmp(lock_env_var, "1"))) *use_locks = TRUE; /* Override: Always use locks */ else *use_locks = FAIL; /* Environment variable not set, or not set correctly */ -- cgit v0.12 From 8fe3cece3c671453e4c49f22fde9d7635c08f031 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 6 Aug 2020 17:46:40 -0500 Subject: Switch H5VM inline routines back to single underscope and put a comment in their header about this naming --- src/H5B2hdr.c | 4 +- src/H5B2int.c | 2 +- src/H5Dbtree.c | 2 +- src/H5Dbtree2.c | 6 +-- src/H5Dchunk.c | 10 ++--- src/H5Dearray.c | 4 +- src/H5Dfarray.c | 4 +- src/H5Dint.c | 6 +-- src/H5EA.c | 4 +- src/H5EAdblock.c | 2 +- src/H5EAhdr.c | 6 +-- src/H5EApkg.h | 2 +- src/H5FA.c | 6 +-- src/H5FAdbg.c | 2 +- src/H5FScache.c | 4 +- src/H5FSsection.c | 14 +++--- src/H5Faccum.c | 10 ++--- src/H5Fprivate.h | 2 +- src/H5HFdbg.c | 6 +-- src/H5HFdblock.c | 4 +- src/H5HFdtable.c | 12 +++--- src/H5HFhdr.c | 6 +-- src/H5HFiblock.c | 10 ++--- src/H5HFiter.c | 2 +- src/H5HFpkg.h | 2 +- src/H5MF.c | 2 +- src/H5Odtype.c | 6 +-- src/H5Pdapl.c | 8 ++-- src/H5Pdcpl.c | 20 ++++----- src/H5Pdxpl.c | 4 +- src/H5Pencdec.c | 4 +- src/H5Pfapl.c | 22 +++++----- src/H5Plapl.c | 6 +-- src/H5Pocpl.c | 8 ++-- src/H5VM.c | 10 ++--- src/H5VMprivate.h | 126 +++++++++++++++++++++++++++++++++++++----------------- src/hdf5.lnt | 6 +-- test/dsets.c | 4 +- test/earray.c | 16 +++---- test/fheap.c | 6 +-- 40 files changed, 214 insertions(+), 166 deletions(-) diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index fc5e7f8..7b8b564 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -174,7 +174,7 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, /* Compute size to store # of records in each node */ /* (uses leaf # of records because its the largest) */ - u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[0].max_nrec); + u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[0].max_nrec); H5_CHECKED_ASSIGN(hdr->max_nrec_size, uint8_t, u_max_nrec_size, unsigned) HDassert(hdr->max_nrec_size <= H5B2_SIZEOF_RECORDS_PER_NODE); @@ -190,7 +190,7 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, hdr->node_info[u].cum_max_nrec = ((hdr->node_info[u].max_nrec + 1) * hdr->node_info[u - 1].cum_max_nrec) + hdr->node_info[u].max_nrec; - u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec); + u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec); H5_CHECKED_ASSIGN(hdr->node_info[u].cum_max_nrec_size, uint8_t, u_max_nrec_size, unsigned) if(NULL == (hdr->node_info[u].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[u].max_nrec))) diff --git a/src/H5B2int.c b/src/H5B2int.c index 3f9ae74..816d8f8 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -367,7 +367,7 @@ H5B2__split_root(H5B2_hdr_t *hdr) hdr->node_info[hdr->depth].merge_nrec = (hdr->node_info[hdr->depth].max_nrec * hdr->merge_percent) / 100; hdr->node_info[hdr->depth].cum_max_nrec = ((hdr->node_info[hdr->depth].max_nrec + 1) * hdr->node_info[hdr->depth - 1].cum_max_nrec) + hdr->node_info[hdr->depth].max_nrec; - u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec); + u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec); H5_CHECKED_ASSIGN(hdr->node_info[hdr->depth].cum_max_nrec_size, uint8_t, u_max_nrec_size, unsigned) if(NULL == (hdr->node_info[hdr->depth].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[hdr->depth].max_nrec))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create node native key block factory") diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index c80f90a..5b5ff4a 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -338,7 +338,7 @@ H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key) HDassert(udata->layout->ndims > 0 && udata->layout->ndims <= H5O_LAYOUT_NDIMS); /* Compare the offsets but ignore the other fields */ - ret_value = H5VM__vector_cmp_u(udata->layout->ndims, lt_key->scaled, rt_key->scaled); + ret_value = H5VM_vector_cmp_u(udata->layout->ndims, lt_key->scaled, rt_key->scaled); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__btree_cmp2() */ diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index b9cf6cd..d233ce5 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -256,7 +256,7 @@ H5D__bt2_crt_context(void *_udata) * Compute the size required for encoding the size of a chunk, * allowing for an extra byte, in case the filter makes the chunk larger. */ - ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8); + ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8); if(ctx->chunk_size_len > 8) ctx->chunk_size_len = 8; @@ -355,7 +355,7 @@ H5D__bt2_compare(const void *_udata, const void *_rec2, int *result) HDassert(rec2); /* Compare the offsets but ignore the other fields */ - *result = H5VM__vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled); + *result = H5VM_vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled); FUNC_LEAVE_NOAPI(ret_value) } /* H5D__bt2_compare() */ @@ -773,7 +773,7 @@ H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info) * Compute the size required for encoding the size of a chunk, * allowing for an extra byte, in case the filter makes the chunk larger. */ - chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); + chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); if(chunk_size_len > 8) chunk_size_len = 8; diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 4d351dd..8962348 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -833,7 +833,7 @@ H5D__chunk_set_sizes(H5D_t *dset) unsigned enc_bytes_per_dim; /* Number of bytes required to encode this dimension */ /* Get encoded size of dim, in bytes */ - enc_bytes_per_dim = (H5VM__log2_gen(dset->shared->layout.u.chunk.dim[u]) + 8) / 8; + enc_bytes_per_dim = (H5VM_log2_gen(dset->shared->layout.u.chunk.dim[u]) + 8) / 8; /* Check if this is the largest value so far */ if(enc_bytes_per_dim > max_enc_bytes_per_dim) @@ -997,14 +997,14 @@ H5D__chunk_init(H5F_t *f, const H5D_t * const dset, hid_t dapl_id) rdcc->scaled_dims[u] = (dset->shared->curr_dims[u] + dset->shared->layout.u.chunk.dim[u] - 1) / dset->shared->layout.u.chunk.dim[u]; - if(!(scaled_power2up = H5VM__power2up(rdcc->scaled_dims[u]))) + if(!(scaled_power2up = H5VM_power2up(rdcc->scaled_dims[u]))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") /* Inital 'power2up' values for scaled dimensions */ rdcc->scaled_power2up[u] = scaled_power2up; /* Number of bits required to encode scaled dimension size */ - rdcc->scaled_encode_bits[u] = H5VM__log2_gen(rdcc->scaled_power2up[u]); + rdcc->scaled_encode_bits[u] = H5VM_log2_gen(rdcc->scaled_power2up[u]); } /* end for */ } /* end if */ @@ -6887,12 +6887,12 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - allow_chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)(idx_info->layout->size)) + 8) / 8); + allow_chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)(idx_info->layout->size)) + 8) / 8); if(allow_chunk_size_len > 8) allow_chunk_size_len = 8; /* Compute encoded size of chunk */ - new_chunk_size_len = (H5VM__log2_gen((uint64_t)(new_chunk->length)) + 8) / 8; + new_chunk_size_len = (H5VM_log2_gen((uint64_t)(new_chunk->length)) + 8) / 8; if(new_chunk_size_len > 8) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "encoded chunk size is more than 8 bytes?!?") diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 56be6a7..a53489e 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -252,7 +252,7 @@ H5D__earray_crt_context(void *_udata) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8); + ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8); if(ctx->chunk_size_len > 8) ctx->chunk_size_len = 8; @@ -937,7 +937,7 @@ H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); + chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); if(chunk_size_len > 8) chunk_size_len = 8; diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index a79471a..a9202c2 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -248,7 +248,7 @@ H5D__farray_crt_context(void *_udata) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8); + ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8); if(ctx->chunk_size_len > 8) ctx->chunk_size_len = 8; @@ -892,7 +892,7 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info) /* Compute the size required for encoding the size of a chunk, allowing * for an extra byte, in case the filter makes the chunk larger. */ - chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); + chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8); if(chunk_size_len > 8) chunk_size_len = 8; diff --git a/src/H5Dint.c b/src/H5Dint.c index d662cec..079fef7 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -672,7 +672,7 @@ H5D__cache_dataspace_info(const H5D_t *dset) for(u = 0; u < dset->shared->ndims; u++) { hsize_t scaled_power2up; /* Scaled value, rounded to next power of 2 */ - if(!(scaled_power2up = H5VM__power2up(dset->shared->curr_dims[u]))) + if(!(scaled_power2up = H5VM_power2up(dset->shared->curr_dims[u]))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") dset->shared->curr_power2up[u] = scaled_power2up; } @@ -3088,14 +3088,14 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size) dset->shared->cache.chunk.scaled_dims[dim_idx] > dset->shared->cache.chunk.nslots)) update_chunks = TRUE; - if(!(scaled_power2up = H5VM__power2up(scaled))) + if(!(scaled_power2up = H5VM_power2up(scaled))) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") /* Check if the number of bits required to encode the scaled size value changed */ if(dset->shared->cache.chunk.scaled_power2up[dim_idx] != scaled_power2up) { /* Update the 'power2up' & 'encode_bits' values for the current dimension */ dset->shared->cache.chunk.scaled_power2up[dim_idx] = scaled_power2up; - dset->shared->cache.chunk.scaled_encode_bits[dim_idx] = H5VM__log2_gen(scaled_power2up); + dset->shared->cache.chunk.scaled_encode_bits[dim_idx] = H5VM_log2_gen(scaled_power2up); /* Indicate that the cached chunk indices need to be updated */ update_chunks = TRUE; diff --git a/src/H5EA.c b/src/H5EA.c index a027792..bf50452 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -553,7 +553,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, (page_idx * sblock->dblk_page_size); /* Check if page has been initialized yet */ - if(!H5VM__bit_get(sblock->page_init, page_init_idx)) { + if(!H5VM_bit_get(sblock->page_init, page_init_idx)) { /* Check if we are allowed to create the thing */ if(0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */ /* Create the data block page */ @@ -561,7 +561,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in super block */ - H5VM__bit_set(sblock->page_init, page_init_idx, TRUE); + H5VM_bit_set(sblock->page_init, page_init_idx, TRUE); sblock_cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ else diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c index c72dc7c..d540a3c 100644 --- a/src/H5EAdblock.c +++ b/src/H5EAdblock.c @@ -266,7 +266,7 @@ H5EA__dblock_sblk_idx(const H5EA_hdr_t *hdr, hsize_t idx)) /* Determine the superblock information for the index */ H5_CHECK_OVERFLOW(idx, /*From:*/hsize_t, /*To:*/uint64_t); - sblk_idx = H5VM__log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1)); + sblk_idx = H5VM_log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1)); /* Set return value */ ret_value = sblk_idx; diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index 07330c1..8b4d5f7 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -199,7 +199,7 @@ H5EA__hdr_init(H5EA_hdr_t *hdr, void *ctx_udata)) HDassert(hdr->cparam.sup_blk_min_data_ptrs); /* Compute general information */ - hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM__log2_of2(hdr->cparam.data_blk_min_elmts)); + hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM_log2_of2(hdr->cparam.data_blk_min_elmts)); hdr->dblk_page_nelmts = (size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits; hdr->arr_off_size = (unsigned char)H5EA_SIZEOF_OFFSET_BITS(hdr->cparam.max_nelmts_bits); @@ -261,7 +261,7 @@ H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts)) /* Compute the index of the element buffer factory */ H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t); - idx = H5VM__log2_of2((uint32_t)nelmts) - H5VM__log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); + idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); /* Check for needing to increase size of array of factories */ if(idx >= hdr->elmt_fac.nalloc) { @@ -327,7 +327,7 @@ H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts)) /* Compute the index of the element buffer factory */ H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t); - idx = H5VM__log2_of2((uint32_t)nelmts) - H5VM__log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); + idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); /* Free buffer for elements in index block */ HDassert(idx < hdr->elmt_fac.nalloc); diff --git a/src/H5EApkg.h b/src/H5EApkg.h index ad1fdfc..b70231d 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -146,7 +146,7 @@ #define H5EA_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8) /* Compute the first super block index that will hold a certain # of data block pointers */ -#define H5EA_SBLK_FIRST_IDX(m) (2 * H5VM__log2_of2((uint32_t)m)) +#define H5EA_SBLK_FIRST_IDX(m) (2 * H5VM_log2_of2((uint32_t)m)) /****************************/ /* Package Private Typedefs */ diff --git a/src/H5FA.c b/src/H5FA.c index 871793e..ee99bb2 100644 --- a/src/H5FA.c +++ b/src/H5FA.c @@ -395,13 +395,13 @@ H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt)) dblk_page_nelmts = dblock->dblk_page_nelmts; /* Check if the page has been created yet */ - if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { /* Create the data block page */ if(H5FA__dblk_page_create(hdr, dblk_page_addr, dblk_page_nelmts) < 0) H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in data block */ - H5VM__bit_set(dblock->dblk_page_init, page_idx, TRUE); + H5VM_bit_set(dblock->dblk_page_init, page_idx, TRUE); dblock_cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ @@ -482,7 +482,7 @@ H5FA_get(const H5FA_t *fa, hsize_t idx, void *elmt)) page_idx = (size_t)(idx / dblock->dblk_page_nelmts); /* Check if the page is defined yet */ - if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { /* Call the class's 'fill' callback */ if((hdr->cparam.cls->fill)(elmt, (size_t)1) < 0) H5E_THROW(H5E_CANTSET, "can't set element to class's fill value") diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index 431e6fa..b578cf2 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -229,7 +229,7 @@ H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Read and print each page's elements in the data block */ for(page_idx = 0; page_idx < dblock->npages; page_idx++) { - if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { HDfprintf(stream, "%*s%-*s %Hu %s\n", indent, "", fwidth, "Page %Zu:", page_idx, "empty"); diff --git a/src/H5FScache.c b/src/H5FScache.c index ed468b4..4c75fb1 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -1027,7 +1027,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l unsigned sect_cnt_size; /* The size of the section size counts */ /* Compute the size of the section counts */ - sect_cnt_size = H5VM__limit_enc_size((uint64_t)fspace->serial_sect_count); + sect_cnt_size = H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); /* Reset the section count, the "add" routine will update it */ old_tot_sect_count = fspace->tot_sect_count; @@ -1294,7 +1294,7 @@ H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len, /* Set up user data for iterator */ udata.sinfo = sinfo; udata.image = ℑ - udata.sect_cnt_size = H5VM__limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); + udata.sect_cnt_size = H5VM_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); /* Iterate over all the bins */ for(bin = 0; bin < sinfo->nbins; bin++) diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 269f63c..51233a0 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -144,10 +144,10 @@ HDfprintf(stderr, "%s: fspace->addr = %a\n", FUNC, fspace->addr); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Set non-zero values */ - sinfo->nbins = H5VM__log2_gen(fspace->max_sect_size); + sinfo->nbins = H5VM_log2_gen(fspace->max_sect_size); sinfo->sect_prefix_size = H5FS_SINFO_PREFIX_SIZE(f); sinfo->sect_off_size = (fspace->max_sect_addr + 7) / 8; - sinfo->sect_len_size = H5VM__limit_enc_size((uint64_t)fspace->max_sect_size); + sinfo->sect_len_size = H5VM_limit_enc_size((uint64_t)fspace->max_sect_size); #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: fspace->max_sect_size = %Hu\n", FUNC, fspace->max_sect_size); HDfprintf(stderr, "%s: fspace->max_sect_addr = %u\n", FUNC, fspace->max_sect_addr); @@ -527,7 +527,7 @@ H5FS__sect_serialize_size(H5FS_t *fspace) sect_buf_size = fspace->sinfo->sect_prefix_size; /* Count for each differently sized serializable section */ - sect_buf_size += fspace->sinfo->serial_size_count * H5VM__limit_enc_size((uint64_t)fspace->serial_sect_count); + sect_buf_size += fspace->sinfo->serial_size_count * H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); /* Size for each differently sized serializable section */ sect_buf_size += fspace->sinfo->serial_size_count * fspace->sinfo->sect_len_size; @@ -777,7 +777,7 @@ H5FS__sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, HDassert(cls); /* Determine correct bin which holds items of at least the section's size */ - bin = H5VM__log2_gen(sect->size); + bin = H5VM_log2_gen(sect->size); HDassert(bin < sinfo->nbins); if(sinfo->bins[bin].bin_list == NULL) HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "node's bin is empty?") @@ -963,7 +963,7 @@ H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, HDassert(sect->size); /* Determine correct bin which holds items of the section's size */ - bin = H5VM__log2_gen(sect->size); + bin = H5VM_log2_gen(sect->size); HDassert(bin < sinfo->nbins); if(sinfo->bins[bin].bin_list == NULL) { if(NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL))) @@ -1640,7 +1640,7 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node HDassert(node); /* Determine correct bin which holds items of at least the section's size */ - bin = H5VM__log2_gen(request); + bin = H5VM_log2_gen(request); HDassert(bin < fspace->sinfo->nbins); alignment = fspace->alignment; if(!((alignment > 1) && (request >= fspace->align_thres))) @@ -2028,7 +2028,7 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, HDassert(fspace->sinfo->bins); /* Determine correct bin which holds items of at least the section's size */ - bin = H5VM__log2_gen(sect->size); + bin = H5VM_log2_gen(sect->size); HDassert(bin < fspace->sinfo->nbins); HDassert(fspace->sinfo->bins[bin].bin_list); diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 5ad7634..02f475d 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -153,7 +153,7 @@ H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t new_alloc_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_alloc_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(new_size - 1))); + new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(new_size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_alloc_size))) @@ -296,7 +296,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, H5FD_t *file, size_t new_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)((size + accum->size) - 1))); + new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)((size + accum->size) - 1))); /* Check for accumulator getting too big */ if(new_size > H5F_ACCUM_MAX_SIZE) { @@ -609,7 +609,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t new_alloc_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_alloc_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1))); + new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_alloc_size))) @@ -653,7 +653,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t clear_size; /* Size of memory that needs clearing */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1))); + new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); /* Grow the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_size))) @@ -701,7 +701,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t new_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1))); + new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_size))) diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 1cfd103..9deba8c 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -117,7 +117,7 @@ typedef struct H5F_t H5F_t; /* (Assumes that the high bits of the integer are zero) */ # define UINT64ENCODE_VARLEN(p, n) { \ uint64_t __n = (uint64_t)(n); \ - unsigned _s = H5VM__limit_enc_size(__n); \ + unsigned _s = H5VM_limit_enc_size(__n); \ \ *(p)++ = (uint8_t)_s; \ UINT64ENCODE_VAR(p, __n, _s); \ diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index f6c7f0e..e841d78 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -702,10 +702,10 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, unsigned first_row_bits; /* Number of bits used bit addresses in first row */ unsigned num_indirect_rows; /* Number of rows of blocks in each indirect block */ - first_row_bits = H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + - H5VM__log2_of2(hdr->man_dtable.cparam.width); + first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + + H5VM_log2_of2(hdr->man_dtable.cparam.width); for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++) { - num_indirect_rows = (H5VM__log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; + num_indirect_rows = (H5VM_log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; HDsnprintf(temp_str, sizeof(temp_str), "Row #%u: (# of rows: %u)", (unsigned)u, num_indirect_rows); HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 96392c1..1e0813c 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -356,7 +356,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, if(request < hdr->man_dtable.cparam.start_block_size) min_dblock_size = hdr->man_dtable.cparam.start_block_size; else { - min_dblock_size = ((size_t)1) << (1 + H5VM__log2_gen((uint64_t)request)); + min_dblock_size = ((size_t)1) << (1 + H5VM_log2_gen((uint64_t)request)); HDassert(min_dblock_size <= hdr->man_dtable.cparam.max_direct_size); } /* end else */ @@ -559,7 +559,7 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting parent indirect block */ /* Compute # of rows in child indirect block */ - nrows = (H5VM__log2_gen(hdr->man_dtable.row_block_size[row]) - hdr->man_dtable.first_row_bits) + 1; + nrows = (H5VM_log2_gen(hdr->man_dtable.row_block_size[row]) - hdr->man_dtable.first_row_bits) + 1; HDassert(nrows < iblock->nrows); /* child must be smaller than parent */ /* Compute indirect block's entry */ diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c index ad317c9..4fff348 100644 --- a/src/H5HFdtable.c +++ b/src/H5HFdtable.c @@ -102,10 +102,10 @@ H5HF__dtable_init(H5HF_dtable_t *dtable) HDassert(dtable); /* Compute/cache some values */ - dtable->start_bits = H5VM__log2_of2((uint32_t)dtable->cparam.start_block_size); - dtable->first_row_bits = dtable->start_bits + H5VM__log2_of2(dtable->cparam.width); + dtable->start_bits = H5VM_log2_of2((uint32_t)dtable->cparam.start_block_size); + dtable->first_row_bits = dtable->start_bits + H5VM_log2_of2(dtable->cparam.width); dtable->max_root_rows = (dtable->cparam.max_index - dtable->first_row_bits) + 1; - dtable->max_direct_bits = H5VM__log2_of2((uint32_t)dtable->cparam.max_direct_size); + dtable->max_direct_bits = H5VM_log2_of2((uint32_t)dtable->cparam.max_direct_size); dtable->max_direct_rows = (dtable->max_direct_bits - dtable->start_bits) + 2; dtable->num_id_first_row = dtable->cparam.start_block_size * dtable->cparam.width; dtable->max_dir_blk_off_size = H5HF_SIZEOF_OFFSET_LEN(dtable->cparam.max_direct_size); @@ -165,7 +165,7 @@ H5HF__dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, uns H5_CHECKED_ASSIGN(*col, unsigned, (off / dtable->cparam.start_block_size), hsize_t); } /* end if */ else { - unsigned high_bit = H5VM__log2_gen(off); /* Determine the high bit in the offset */ + unsigned high_bit = H5VM_log2_gen(off); /* Determine the high bit in the offset */ hsize_t off_mask = ((hsize_t)1) << high_bit; /* Compute mask for determining column */ *row = (high_bit - dtable->first_row_bits) + 1; @@ -241,7 +241,7 @@ H5HF__dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) if(block_size == dtable->cparam.start_block_size) row = 0; else - row = (H5VM__log2_of2((uint32_t)block_size) - H5VM__log2_of2((uint32_t)dtable->cparam.start_block_size)) + 1; + row = (H5VM_log2_of2((uint32_t)block_size) - H5VM_log2_of2((uint32_t)dtable->cparam.start_block_size)) + 1; FUNC_LEAVE_NOAPI(row) } /* end H5HF__dtable_size_to_row() */ @@ -271,7 +271,7 @@ H5HF__dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size) */ HDassert(dtable); - rows = (H5VM__log2_gen(size) - dtable->first_row_bits) + 1; + rows = (H5VM_log2_gen(size) - dtable->first_row_bits) + 1; FUNC_LEAVE_NOAPI(rows) } /* end H5HF__dtable_size_to_rows() */ diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 4a645cd..043ab87 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -46,7 +46,7 @@ #ifndef NDEBUG /* Limit on the size of the max. direct block size */ /* (This is limited to 32-bits currently, because I think it's unlikely to - * need to be larger, the 32-bit limit for H5VM__log2_of2(n), and + * need to be larger, the 32-bit limit for H5VM_log2_of2(n), and * some offsets/sizes are encoded with a maximum of 32-bits - QAK) */ #define H5HF_MAX_DIRECT_SIZE_LIMIT ((hsize_t)2 * 1024 * 1024 * 1024) @@ -221,7 +221,7 @@ H5HF__hdr_finish_init_phase1(H5HF_hdr_t *hdr) /* Set the size of heap IDs */ hdr->heap_len_size = (uint8_t)MIN(hdr->man_dtable.max_dir_blk_off_size, - H5VM__limit_enc_size((uint64_t)hdr->max_man_size)); + H5VM_limit_enc_size((uint64_t)hdr->max_man_size)); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1070,7 +1070,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) unsigned child_entry; /* Entry of child indirect block */ /* Compute # of rows needed in child indirect block */ - child_rows_needed = (H5VM__log2_of2((uint32_t)min_dblock_size) - H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size)) + 2; + child_rows_needed = (H5VM_log2_of2((uint32_t)min_dblock_size) - H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size)) + 2; HDassert(child_rows_needed > child_nrows); child_entry = (next_row + (child_rows_needed - child_nrows)) * hdr->man_dtable.cparam.width; if(child_entry > (iblock->nrows * hdr->man_dtable.cparam.width)) diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 1c40d53..2714ac7 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -371,7 +371,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) nrows = hdr->man_dtable.cparam.start_root_rows; - block_row_off = H5VM__log2_of2((uint32_t)min_dblock_size) - H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size); + block_row_off = H5VM_log2_of2((uint32_t)min_dblock_size) - H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size); if(block_row_off > 0) block_row_off++; /* Account for the pair of initial rows of the initial block size */ rows_needed = 1 + block_row_off; @@ -689,7 +689,7 @@ H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock) max_child_row = iblock->max_child / hdr->man_dtable.cparam.width; /* Compute new # of rows in root indirect block */ - new_nrows = (unsigned)1 << (1 + H5VM__log2_gen((uint64_t)max_child_row)); + new_nrows = (unsigned)1 << (1 + H5VM_log2_gen((uint64_t)max_child_row)); /* Check if the indirect block is NOT currently allocated in temp. file space */ /* (temp. file space does not need to be freed) */ @@ -1722,10 +1722,10 @@ H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, size_t u; /* Local index variable */ entry = hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width; - first_row_bits = H5VM__log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + - H5VM__log2_of2(hdr->man_dtable.cparam.width); + first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + + H5VM_log2_of2(hdr->man_dtable.cparam.width); num_indirect_rows = - (H5VM__log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1; + (H5VM_log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1; for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++, num_indirect_rows++) { size_t v; /* Local index variable */ diff --git a/src/H5HFiter.c b/src/H5HFiter.c index 002ff01..43cb76a 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -210,7 +210,7 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, /* Compute # of rows in context indirect block */ child_size = hdr->man_dtable.row_block_size[biter->curr->up->row]; - iblock_nrows = (H5VM__log2_gen(child_size) - hdr->man_dtable.first_row_bits) + 1; + iblock_nrows = (H5VM_log2_gen(child_size) - hdr->man_dtable.first_row_bits) + 1; } /* end else */ /* Load indirect block for this context location */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index ca05798..5324bc4 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -134,7 +134,7 @@ /* Compute the # of bytes required to store an offset into a given buffer size */ #define H5HF_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8) -#define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5VM__log2_of2((unsigned)(l))) +#define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5VM_log2_of2((unsigned)(l))) /* Heap ID bit flags */ /* Heap ID version (2 bits: 6-7) */ diff --git a/src/H5MF.c b/src/H5MF.c index 7de09cb..42ad3fb 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -419,7 +419,7 @@ H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type) fs_create.client = H5FS_CLIENT_FILE_ID; fs_create.shrink_percent = H5MF_FSPACE_SHRINK; fs_create.expand_percent = H5MF_FSPACE_EXPAND; - fs_create.max_sect_addr = 1 + H5VM__log2_gen((uint64_t)f->shared->maxaddr); + fs_create.max_sect_addr = 1 + H5VM_log2_gen((uint64_t)f->shared->maxaddr); fs_create.max_sect_size = f->shared->maxaddr; /* Set up alignment and threshold to use depending on TYPE */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index c7d6c1b..cbadfd0 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -264,7 +264,7 @@ H5O__dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t unsigned j; /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5VM__limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); /* * Compound datatypes... @@ -905,7 +905,7 @@ H5O__dtype_encode_helper(uint8_t **pp, const H5T_t *dt) unsigned offset_nbytes; /* Size needed to encode member offsets */ /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5VM__limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); /* * Compound datatypes... @@ -1277,7 +1277,7 @@ H5O__dtype_size(const H5F_t *f, const void *_mesg) unsigned offset_nbytes; /* Size needed to encode member offsets */ /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5VM__limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); /* Compute the total size needed to encode compound datatype */ for(u = 0; u < dt->shared->u.compnd.nmembs; u++) { diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 7429443..6dae5ed 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -331,7 +331,7 @@ H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(vds_file_pref); enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { @@ -579,7 +579,7 @@ H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(efile_pref); enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { @@ -899,7 +899,7 @@ H5P__encode_chunk_cache_nslots(const void *value, void **_pp, size_t *size) } /* end if */ else { enc_value = (uint64_t)*(const size_t *)value; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size > 0); *size += (1 + enc_size); } /* end else */ @@ -1001,7 +1001,7 @@ H5P__encode_chunk_cache_nbytes(const void *value, void **_pp, size_t *size) } /* end if */ else { enc_value = (uint64_t)*(const size_t *)value; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size > 0); *size += (1 + enc_size); } /* end else */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index d8b0218..11ab7b1 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1029,7 +1029,7 @@ H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) /* Encode the size of a size_t */ enc_value = (uint64_t)dt_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); /* Encode the size */ @@ -1058,7 +1058,7 @@ H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) if(H5T_encode(fill->type, NULL, &dt_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype") enc_value = (uint64_t)dt_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); } *size += (1 + enc_size); *size += dt_size; @@ -1414,7 +1414,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) if(NULL != *pp) { /* Encode number of slots used */ enc_value = (uint64_t)efl->nused; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1424,7 +1424,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) /* Calculate length of slot name and encode it */ len = HDstrlen(efl->slot[u].name) + 1; enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1435,14 +1435,14 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) /* Encode offset */ enc_value = (uint64_t)efl->slot[u].offset; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); /* encode size */ enc_value = (uint64_t)efl->slot[u].size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1450,13 +1450,13 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) } /* end if */ /* Calculate size needed for encoding */ - *size += (1 + H5VM__limit_enc_size((uint64_t)efl->nused)); + *size += (1 + H5VM_limit_enc_size((uint64_t)efl->nused)); for(u = 0; u < efl->nused; u++) { len = HDstrlen(efl->slot[u].name) + 1; - *size += (1 + H5VM__limit_enc_size((uint64_t)len)); + *size += (1 + H5VM_limit_enc_size((uint64_t)len)); *size += len; - *size += (1 + H5VM__limit_enc_size((uint64_t)efl->slot[u].offset)); - *size += (1 + H5VM__limit_enc_size((uint64_t)efl->slot[u].size)); + *size += (1 + H5VM_limit_enc_size((uint64_t)efl->slot[u].offset)); + *size += (1 + H5VM_limit_enc_size((uint64_t)efl->slot[u].size)); } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index f416eff..e6db02f 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -685,7 +685,7 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size) /* encode the length of the prefix */ enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -702,7 +702,7 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size) } /* end if */ /* Size of encoded data transform */ - *size += (1 + H5VM__limit_enc_size((uint64_t)len)); + *size += (1 + H5VM_limit_enc_size((uint64_t)len)); if(NULL != pexp) *size += len; diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index 32824b7..8b10971 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -94,7 +94,7 @@ H5P__encode_size_t(const void *value, void **_pp, size_t *size) { uint64_t enc_value = (uint64_t)*(const size_t *)value; /* Property value to encode */ uint8_t **pp = (uint8_t **)_pp; - unsigned enc_size = H5VM__limit_enc_size(enc_value); /* Size of encoded property */ + unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */ FUNC_ENTER_PACKAGE_NOERR @@ -135,7 +135,7 @@ herr_t H5P__encode_hsize_t(const void *value, void **_pp, size_t *size) { uint64_t enc_value = (uint64_t)*(const hsize_t *)value; /* Property value to encode */ - unsigned enc_size = H5VM__limit_enc_size(enc_value); /* Size of encoded property */ + unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */ uint8_t **pp = (uint8_t **)_pp; FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index baad470..7f962ef 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -3475,7 +3475,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->set_initial_size); enc_value = (uint64_t)config->initial_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3483,13 +3483,13 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_DOUBLE(*pp, config->min_clean_fraction); enc_value = (uint64_t)config->max_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); enc_value = (uint64_t)config->min_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3507,7 +3507,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->apply_max_increment); enc_value = (uint64_t)config->max_increment; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3529,7 +3529,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->apply_max_decrement); enc_value = (uint64_t)config->max_decrement; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -3550,15 +3550,15 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) /* Compute encoded size of variably-encoded values */ enc_value = (uint64_t)config->initial_size; - *size += 1 + H5VM__limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->max_size; - *size += 1 + H5VM__limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->min_size; - *size += 1 + H5VM__limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->max_increment; - *size += 1 + H5VM__limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->max_decrement; - *size += 1 + H5VM__limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); /* Compute encoded size of fixed-size values */ *size += (5 + (sizeof(unsigned) * 8) + (sizeof(double) * 8) + @@ -4227,7 +4227,7 @@ H5P__facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(log_location); enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 72c60b4..8a0848c 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -373,7 +373,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) /* encode the length of the plist */ enc_value = (uint64_t)fapl_size; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -384,7 +384,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) *pp += fapl_size; } - fapl_size += (1 + H5VM__limit_enc_size((uint64_t)fapl_size)); + fapl_size += (1 + H5VM_limit_enc_size((uint64_t)fapl_size)); } /* end if */ *size += (1 + fapl_size); /* Non-default flag, plus encoded property list size */ @@ -705,7 +705,7 @@ H5P__lacc_elink_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(elink_pref); enc_value = (uint64_t)len; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index b053895..b576aec 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -1407,7 +1407,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* encode nused value */ enc_value = (uint64_t)pline->nused; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1437,7 +1437,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* encode cd_nelmts */ enc_value = (uint64_t)pline->filter[u].cd_nelmts; - enc_size = H5VM__limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1450,12 +1450,12 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* calculate size required for encoding */ *size += 1; - *size += (1 + H5VM__limit_enc_size((uint64_t)pline->nused)); + *size += (1 + H5VM_limit_enc_size((uint64_t)pline->nused)); for(u = 0; u < pline->nused; u++) { *size += (sizeof(int32_t) + sizeof(unsigned) + 1); if(NULL != pline->filter[u].name) *size += H5Z_COMMON_NAME_LEN; - *size += (1 + H5VM__limit_enc_size((uint64_t)pline->filter[u].cd_nelmts)); + *size += (1 + H5VM_limit_enc_size((uint64_t)pline->filter[u].cd_nelmts)); *size += pline->filter[u].cd_nelmts * sizeof(unsigned); } /* end for */ diff --git a/src/H5VM.c b/src/H5VM.c index 403cc45..7be8eab 100644 --- a/src/H5VM.c +++ b/src/H5VM.c @@ -75,7 +75,7 @@ H5VM__stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - HDassert(1 == H5VM__vector_reduce_product(0, NULL)); + HDassert(1 == H5VM_vector_reduce_product(0, NULL)); /* * Combine adjacent memory accesses @@ -119,7 +119,7 @@ H5VM__stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - HDassert(1 == H5VM__vector_reduce_product(0, NULL)); + HDassert(1 == H5VM_vector_reduce_product(0, NULL)); HDassert(*elmt_size>0); /* @@ -642,7 +642,7 @@ H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, HDassert(elmt_size < SIZET_MAX); H5VM_vector_cpy(n, idx, size); - nelmts = H5VM__vector_reduce_product(n, size); + nelmts = H5VM_vector_reduce_product(n, size); for (i=0; i 0) -#define H5VM_vector_le_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) <= 0) -#define H5VM_vector_ge_s(N,V1,V2) (H5VM__vector_cmp_s(N, V1, V2) >= 0) -#define H5VM_vector_eq_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) == 0) -#define H5VM_vector_lt_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) < 0) -#define H5VM_vector_gt_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) > 0) -#define H5VM_vector_le_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) <= 0) -#define H5VM_vector_ge_u(N,V1,V2) (H5VM__vector_cmp_u(N, V1, V2) >= 0) +#define H5VM_vector_eq_s(N,V1,V2) (H5VM_vector_cmp_s(N, V1, V2) == 0) +#define H5VM_vector_lt_s(N,V1,V2) (H5VM_vector_cmp_s(N, V1, V2) < 0) +#define H5VM_vector_gt_s(N,V1,V2) (H5VM_vector_cmp_s(N, V1, V2) > 0) +#define H5VM_vector_le_s(N,V1,V2) (H5VM_vector_cmp_s(N, V1, V2) <= 0) +#define H5VM_vector_ge_s(N,V1,V2) (H5VM_vector_cmp_s(N, V1, V2) >= 0) +#define H5VM_vector_eq_u(N,V1,V2) (H5VM_vector_cmp_u(N, V1, V2) == 0) +#define H5VM_vector_lt_u(N,V1,V2) (H5VM_vector_cmp_u(N, V1, V2) < 0) +#define H5VM_vector_gt_u(N,V1,V2) (H5VM_vector_cmp_u(N, V1, V2) > 0) +#define H5VM_vector_le_u(N,V1,V2) (H5VM_vector_cmp_u(N, V1, V2) <= 0) +#define H5VM_vector_ge_u(N,V1,V2) (H5VM_vector_cmp_u(N, V1, V2) >= 0) /* Other functions */ #define H5VM_vector_cpy(N,DST,SRC) { \ @@ -139,13 +139,17 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, /*------------------------------------------------------------------------- - * Function: H5VM__vector_reduce_product + * Function: H5VM_vector_reduce_product * * Purpose: Product reduction of a vector. Vector elements and return * value are size_t because we usually want the number of * elements in an array and array dimensions are always of type * size_t. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: Product of elements * * Failure: 1 if N is zero @@ -156,7 +160,7 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, *------------------------------------------------------------------------- */ static H5_INLINE hsize_t H5_ATTR_UNUSED -H5VM__vector_reduce_product(unsigned n, const hsize_t *v) +H5VM_vector_reduce_product(unsigned n, const hsize_t *v) { hsize_t ret_value = 1; @@ -171,10 +175,14 @@ done: } /*------------------------------------------------------------------------- - * Function: H5VM__vector_zerop_u + * Function: H5VM_vector_zerop_u * * Purpose: Determines if all elements of a vector are zero. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: TRUE if all elements are zero, * FALSE otherwise * @@ -186,7 +194,7 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE htri_t H5_ATTR_UNUSED -H5VM__vector_zerop_u(int n, const hsize_t *v) +H5VM_vector_zerop_u(int n, const hsize_t *v) { htri_t ret_value=TRUE; /* Return value */ @@ -208,6 +216,10 @@ done: * * Purpose: Determines if all elements of a vector are zero. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: TRUE if all elements are zero, * FALSE otherwise * @@ -237,11 +249,15 @@ done: } /*------------------------------------------------------------------------- - * Function: H5VM__vector_cmp_u + * Function: H5VM_vector_cmp_u * * Purpose: Compares two vectors of the same size and determines if V1 is * lexicographically less than, equal, or greater than V2. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: -1 if V1 is less than V2 * 0 if they are equal * 1 if V1 is greater than V2 @@ -254,7 +270,7 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE int H5_ATTR_UNUSED -H5VM__vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2) +H5VM_vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2) { int ret_value=0; /* Return value */ @@ -277,11 +293,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5VM__vector_cmp_s + * Function: H5VM_vector_cmp_s * * Purpose: Compares two vectors of the same size and determines if V1 is * lexicographically less than, equal, or greater than V2. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Success: -1 if V1 is less than V2 * 0 if they are equal * 1 if V1 is greater than V2 @@ -294,7 +314,7 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE int H5_ATTR_UNUSED -H5VM__vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2) +H5VM_vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2) { int ret_value=0; /* Return value */ @@ -317,10 +337,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5VM__vector_inc + * Function: H5VM_vector_inc * * Purpose: Increments V1 by V2 * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: void * * Programmer: Robb Matzke @@ -329,7 +353,7 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE void H5_ATTR_UNUSED -H5VM__vector_inc(int n, hsize_t *v1, const hsize_t *v2) +H5VM_vector_inc(int n, hsize_t *v1, const hsize_t *v2) { while (n--) *v1++ += *v2++; } @@ -357,7 +381,7 @@ static const unsigned char LogTable256[] = /*------------------------------------------------------------------------- - * Function: H5VM__log2_gen + * Function: H5VM_log2_gen * * Purpose: Determines the log base two of a number (i.e. log2(n)). * (i.e. the highest bit set in a number) @@ -368,6 +392,10 @@ static const unsigned char LogTable256[] = * The version on the web-site is for 32-bit quantities and this * version has been extended for 64-bit quantities. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: log2(n) (always - no failure condition) * * Programmer: Quincey Koziol @@ -376,7 +404,7 @@ static const unsigned char LogTable256[] = *------------------------------------------------------------------------- */ static H5_INLINE unsigned H5_ATTR_UNUSED -H5VM__log2_gen(uint64_t n) +H5VM_log2_gen(uint64_t n) { unsigned r; /* r will be log2(n) */ register unsigned int t, tt, ttt; /* temporaries */ @@ -394,7 +422,7 @@ H5VM__log2_gen(uint64_t n) r = (t = (unsigned)(n >> 8)) ? 8 + (unsigned)LogTable256[t] : (unsigned)LogTable256[(uint8_t)n]; return(r); -} /* H5VM__log2_gen() */ +} /* H5VM_log2_gen() */ /* Lookup table for specialized log2(n) of power of two routine */ @@ -406,7 +434,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = /*------------------------------------------------------------------------- - * Function: H5VM__log2_of2 + * Function: H5VM_log2_of2 * * Purpose: Determines the log base two of a number (i.e. log2(n)). * (i.e. the highest bit set in a number) @@ -416,6 +444,10 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = * This is from the "Bit Twiddling Hacks" at: * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogDeBruijn * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: log2(n) (always - no failure condition) * * Programmer: Quincey Koziol @@ -424,20 +456,24 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = *------------------------------------------------------------------------- */ static H5_INLINE H5_ATTR_PURE unsigned -H5VM__log2_of2(uint32_t n) +H5VM_log2_of2(uint32_t n) { #ifndef NDEBUG HDassert(POWER_OF_TWO(n)); #endif /* NDEBUG */ return(MultiplyDeBruijnBitPosition[(n * (uint32_t)0x077CB531UL) >> 27]); -} /* H5VM__log2_of2() */ +} /* H5VM_log2_of2() */ /*------------------------------------------------------------------------- - * Function: H5VM__power2up + * Function: H5VM_power2up * * Purpose: Round up a number to the next power of 2 * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Return the number which is a power of 2 * * Programmer: Vailin Choi; Nov 2014 @@ -445,7 +481,7 @@ H5VM__log2_of2(uint32_t n) *------------------------------------------------------------------------- */ static H5_INLINE H5_ATTR_CONST hsize_t -H5VM__power2up(hsize_t n) +H5VM_power2up(hsize_t n) { hsize_t ret_value = 1; /* Return value */ @@ -457,15 +493,19 @@ H5VM__power2up(hsize_t n) ret_value <<= 1; return(ret_value); -} /* H5VM__power2up */ +} /* H5VM_power2up */ /*------------------------------------------------------------------------- - * Function: H5VM__limit_enc_size + * Function: H5VM_limit_enc_size * * Purpose: Determine the # of bytes needed to encode values within a * range from 0 to a given limit * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: Number of bytes needed * * Programmer: Quincey Koziol @@ -474,17 +514,17 @@ H5VM__power2up(hsize_t n) *------------------------------------------------------------------------- */ static H5_INLINE unsigned H5_ATTR_UNUSED -H5VM__limit_enc_size(uint64_t limit) +H5VM_limit_enc_size(uint64_t limit) { - return (H5VM__log2_gen(limit) / 8) + 1; -} /* end H5VM__limit_enc_size() */ + return (H5VM_log2_gen(limit) / 8) + 1; +} /* end H5VM_limit_enc_size() */ static const unsigned char H5VM_bit_set_g[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE}; /*------------------------------------------------------------------------- - * Function: H5VM__bit_get + * Function: H5VM_bit_get * * Purpose: Determine the value of the n'th bit in a buffer. * @@ -495,6 +535,10 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, * to bit offset 7 in the first byte's low-bit position, then to * bit offset 8 in the second byte's high-bit position, etc. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: TRUE/FALSE * * Programmer: Quincey Koziol @@ -503,15 +547,15 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, *------------------------------------------------------------------------- */ static H5_INLINE hbool_t H5_ATTR_UNUSED -H5VM__bit_get(const unsigned char *buf, size_t offset) +H5VM_bit_get(const unsigned char *buf, size_t offset) { /* Test the appropriate bit in the buffer */ return (hbool_t)((buf[offset / 8] & (H5VM_bit_set_g[offset % 8])) ? TRUE : FALSE); -} /* end H5VM__bit_get() */ +} /* end H5VM_bit_get() */ /*------------------------------------------------------------------------- - * Function: H5VM__bit_set + * Function: H5VM_bit_set * * Purpose: Set/reset the n'th bit in a buffer. * @@ -522,6 +566,10 @@ H5VM__bit_get(const unsigned char *buf, size_t offset) * to bit offset 7 in the first byte's low-bit position, then to * bit offset 8 in the second byte's high-bit position, etc. * + * Note: Although this routine is 'static' in this file, that's intended + * only as an optimization and the naming (with a single underscore) + * reflects its inclusion in a "private" header file. + * * Return: None * * Programmer: Quincey Koziol @@ -530,14 +578,14 @@ H5VM__bit_get(const unsigned char *buf, size_t offset) *------------------------------------------------------------------------- */ static H5_INLINE void H5_ATTR_UNUSED -H5VM__bit_set(unsigned char *buf, size_t offset, hbool_t val) +H5VM_bit_set(unsigned char *buf, size_t offset, hbool_t val) { /* Set/reset the appropriate bit in the buffer */ if(val) buf[offset / 8] |= H5VM_bit_set_g[offset % 8]; else buf[offset / 8] &= H5VM_bit_clear_g[offset % 8]; -} /* end H5VM__bit_set() */ +} /* end H5VM_bit_set() */ #endif /* H5VMprivate_H */ diff --git a/src/hdf5.lnt b/src/hdf5.lnt index 61c4a61..7b0f384 100644 --- a/src/hdf5.lnt +++ b/src/hdf5.lnt @@ -1,9 +1,9 @@ // Lint options shared by both PC-Lint for Windows and Flexelint for Linux // Turn off warnings about not using the inlined H5V* functions: --esym(528, H5VM_vector_reduce_product, H5VM__vector_inc) --esym(528, H5VM__vector_cmp_s) --esym(528, H5VM__vector_zerop_s, H5VM__vector_zerop_u) +-esym(528, H5VM_vector_reduce_product, H5VM_vector_inc) +-esym(528, H5VM_vector_cmp_s) +-esym(528, H5VM_vector_zerop_s, H5VM_vector_zerop_u) // Suppress message about using 'goto' in a few functions -efunc(801,H5_term_library,H5_trace) diff --git a/test/dsets.c b/test/dsets.c index 3547554..4ab3efa 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -11723,9 +11723,9 @@ error: /*------------------------------------------------------------------------- * Function: test_power2up * - * Purpose: Tests that the H5VM__power2up(n) function does not result in an + * Purpose: Tests that the H5VM_power2up(n) function does not result in an * infinite loop when input n exceeds 2^63. (HDFFV-10217) - * H5VM__power2up() is used to calculate the next power of 2 for + * H5VM_power2up() is used to calculate the next power of 2 for * a dataset's scaled dimension sizes. * * Return: Success: 0 diff --git a/test/earray.c b/test/earray.c index a8ae9f0..7d91bdc 100644 --- a/test/earray.c +++ b/test/earray.c @@ -232,7 +232,7 @@ init_tparam(earray_test_param_t *tparam, const H5EA_create_t *cparam) HDmemset(tparam, 0, sizeof(*tparam)); /* Compute general information */ - tparam->nsblks = 1 + (cparam->max_nelmts_bits - H5VM__log2_of2(cparam->data_blk_min_elmts)); + tparam->nsblks = 1 + (cparam->max_nelmts_bits - H5VM_log2_of2(cparam->data_blk_min_elmts)); /* Allocate information for each super block */ tparam->sblk_info = (H5EA_sblk_info_t *)HDmalloc(sizeof(H5EA_sblk_info_t) * tparam->nsblks); @@ -718,7 +718,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE /* Set invalid max. # of elements per data block page bits */ if(test_cparam.idx_blk_elmts > 0) { HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); - test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(H5VM__log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1); + test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(H5VM_log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1); H5E_BEGIN_TRY { ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; @@ -1373,7 +1373,7 @@ eiter_fw_state(void *_eiter, const H5EA_create_t *cparam, /* Compute super block index for element index */ /* (same eqn. as in H5EA__dblock_sblk_idx()) */ - sblk_idx = H5VM__log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); state->nelmts = EA_NELMTS(cparam, tparam, idx, sblk_idx); state->ndata_blks = EA_NDATA_BLKS(cparam, tparam, idx, sblk_idx); @@ -1465,10 +1465,10 @@ eiter_rv_init(const H5EA_create_t *cparam, const earray_test_param_t *tparam, eiter->idx = cnt - 1; eiter->max = cnt - 1; if(cnt > cparam->idx_blk_elmts) { - eiter->max_sblk_idx = H5VM__log2_gen((uint64_t)(((eiter->max - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + eiter->max_sblk_idx = H5VM_log2_gen((uint64_t)(((eiter->max - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); eiter->max_nelmts = EA_NELMTS(cparam, tparam, eiter->max, eiter->max_sblk_idx); eiter->max_ndata_blks = EA_NDATA_BLKS(cparam, tparam, eiter->max, eiter->max_sblk_idx); - eiter->idx_blk_nsblks = 2 * H5VM__log2_of2((uint32_t)cparam->sup_blk_min_data_ptrs); + eiter->idx_blk_nsblks = 2 * H5VM_log2_of2((uint32_t)cparam->sup_blk_min_data_ptrs); } /* end if */ else { eiter->max_sblk_idx = (hsize_t)0; @@ -1586,14 +1586,14 @@ eiter_rv_state(void *_eiter, const H5EA_create_t *cparam, hsize_t tmp_idx; /* Temporary index in superblock */ hsize_t dblk_idx; /* Index of data block within superblock */ - idx_sblk_idx = H5VM__log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + idx_sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); tmp_idx = idx - (cparam->idx_blk_elmts + tparam->sblk_info[idx_sblk_idx].start_idx); dblk_idx = tmp_idx / tparam->sblk_info[idx_sblk_idx].dblk_nelmts; if(dblk_idx > 0) loc_idx = idx - tparam->sblk_info[idx_sblk_idx].dblk_nelmts; else loc_idx = cparam->idx_blk_elmts + tparam->sblk_info[idx_sblk_idx].start_idx - 1; - loc_sblk_idx = H5VM__log2_gen((uint64_t)(((loc_idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + loc_sblk_idx = H5VM_log2_gen((uint64_t)(((loc_idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); } /* end else */ if(idx < cparam->idx_blk_elmts + cparam->data_blk_min_elmts) @@ -2317,7 +2317,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Compute super block index for element index */ /* (same eqn. as in H5EA__dblock_sblk_idx()) */ - sblk_idx = H5VM__log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); state.nelmts = (hsize_t)cparam->idx_blk_elmts + tparam->sblk_info[sblk_idx].dblk_nelmts; state.ndata_blks = (hsize_t)1; state.nsuper_blks = (hsize_t)1; diff --git a/test/fheap.c b/test/fheap.c index 55af7d6..1ce7398 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -1592,7 +1592,7 @@ fill_all_2nd_indirect_rows(H5HF_t *fh, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 2nd level deep indirect blocks */ - for(u = 0; u < (H5VM__log2_of2(width) + 1); u++) + for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) if(fill_2nd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR @@ -1710,7 +1710,7 @@ fill_all_3rd_indirect_rows(H5HF_t *fh, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 3rd level deep indirect blocks */ - for(u = 0; u < (H5VM__log2_of2(width) + 1); u++) + for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) /* Fill row of 3rd level indirect blocks */ if(fill_3rd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR @@ -1800,7 +1800,7 @@ fill_all_4th_indirect_rows(H5HF_t *fh, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 4th level deep indirect blocks */ - for(u = 0; u < (H5VM__log2_of2(width) + 1); u++) { + for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) { /* Fill row of 4th level indirect blocks */ if(fill_4th_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR -- cgit v0.12 From 5ce2a178043d9749d30076a2e62249d9998c40ec Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 6 Aug 2020 17:58:07 -0700 Subject: Removes staff email addresses from the repository Removes redundant C library headers from hl library --- bin/errors | 2 +- bin/h5vers | 2 +- bin/warnhist | 2 +- hl/fortran/src/H5IMcc.c | 12 +- hl/fortran/src/H5IMfc.c | 24 +- hl/fortran/src/H5IMff.F90 | 24 +- hl/fortran/src/H5LTfc.c | 24 +- hl/fortran/src/H5LTff.F90 | 40 +-- hl/fortran/src/H5TBfc.c | 18 +- hl/fortran/src/H5TBff.F90 | 18 +- hl/src/H5DS.c | 543 ++++++++++++++++-------------------- hl/src/H5IM.c | 30 +- hl/src/H5LD.c | 4 - hl/src/H5LT.c | 127 ++++----- hl/src/H5PT.c | 58 ++-- hl/src/H5TB.c | 55 ++-- hl/test/gen_test_ds.c | 2 - hl/test/h5hltest.h | 2 +- hl/test/test_ds.c | 2 - hl/test/test_dset_append.c | 4 - hl/test/test_image.c | 4 - hl/test/test_ld.c | 5 - hl/test/test_lite.c | 2 - hl/test/test_packet.c | 2 - hl/test/test_table.c | 2 - hl/tools/gif2h5/h52gifgentst.c | 2 +- test/SWMR_UseCase_UG.txt | 4 +- test/app_ref.c | 2 +- test/big.c | 4 +- test/bittests.c | 2 +- test/btree2.c | 2 +- test/cache.c | 1 - test/cmpd_dset.c | 2 +- test/cross_read.c | 2 +- test/dangle.c | 2 +- test/dsets.c | 2 +- test/dt_arith.c | 2 +- test/dtypes.c | 2 +- test/earray.c | 2 +- test/enum.c | 2 +- test/extend.c | 2 +- test/external.c | 2 +- test/external_common.c | 2 +- test/external_common.h | 2 +- test/external_fname.h | 2 +- test/fheap.c | 2 +- test/filter_fail.c | 2 +- test/flush1.c | 2 +- test/flush2.c | 2 +- test/gen_bad_compound.c | 2 +- test/gen_bad_ohdr.c | 2 +- test/gen_cross.c | 2 +- test/gen_filters.c | 2 +- test/gen_mergemsg.c | 2 +- test/gen_new_array.c | 2 +- test/gen_new_fill.c | 2 +- test/gen_new_group.c | 2 +- test/gen_new_mtime.c | 2 +- test/gen_new_super.c | 2 +- test/gen_old_array.c | 2 +- test/gen_old_group.c | 2 +- test/gen_old_layout.c | 2 +- test/gen_old_mtime.c | 2 +- test/gen_sizes_lheap.c | 2 +- test/gen_specmetaread.c | 2 +- test/gen_udlinks.c | 2 +- test/getname.c | 2 +- test/gheap.c | 2 +- test/h5test.c | 2 +- test/h5test.h | 2 +- test/hdfs.c | 2 +- test/hyperslab.c | 2 +- test/istore.c | 2 +- test/lheap.c | 2 +- test/mount.c | 2 +- test/mtime.c | 2 +- test/ntypes.c | 2 +- test/ohdr.c | 2 +- test/pool.c | 2 +- test/ros3.c | 2 +- test/s3comms.c | 2 +- test/set_extent.c | 2 +- test/space_overflow.c | 2 +- test/stab.c | 4 +- test/tchecksum.c | 2 +- test/testframe.c | 2 +- test/tfile.c | 3 - test/unlink.c | 2 +- test/vds.c | 2 +- test/vds_env.c | 2 +- test/vfd.c | 2 +- tools/lib/h5tools.h | 2 +- tools/lib/h5tools_str.h | 2 +- tools/lib/h5tools_utils.h | 2 +- tools/src/h5diff/h5diff_main.c | 2 +- tools/src/h5diff/ph5diff_main.c | 2 +- tools/src/h5ls/h5ls.c | 2 +- tools/src/h5repack/h5repack_parse.c | 2 +- tools/src/misc/h5debug.c | 3 +- tools/src/misc/h5repart.c | 2 +- tools/test/h5copy/testh5copy.sh.in | 2 +- tools/test/h5diff/h5diffgentest.c | 2 +- tools/test/h5dump/h5dumpgentest.c | 10 +- tools/test/h5repack/h5repacktst.c | 10 +- tools/test/misc/h5perf_gentest.c | 4 +- tools/test/misc/h5repart_gentest.c | 2 +- tools/test/misc/testh5mkgrp.sh.in | 2 +- tools/test/perform/iopipe.c | 2 +- tools/test/perform/overhead.c | 2 +- tools/test/perform/perf_meta.c | 2 +- 110 files changed, 546 insertions(+), 657 deletions(-) diff --git a/bin/errors b/bin/errors index 107bb9c..a5bad3a 100755 --- a/bin/errors +++ b/bin/errors @@ -17,7 +17,7 @@ use Text::Tabs; # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# Robb Matzke, matzke@llnl.gov +# Robb Matzke # 30 Aug 1997 # # Purpose: This script will read standard input which should be a diff --git a/bin/h5vers b/bin/h5vers index 659a081..6093eb0 100755 --- a/bin/h5vers +++ b/bin/h5vers @@ -17,7 +17,7 @@ use strict; # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# Robb Matzke +# Robb Matzke # 17 July 1998 ### Purpose diff --git a/bin/warnhist b/bin/warnhist index a88474b..3b2cec6 100755 --- a/bin/warnhist +++ b/bin/warnhist @@ -15,7 +15,7 @@ use warnings; # http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have # access to either file, you may request a copy from help@hdfgroup.org. # -# Quincey Koziol, koziol@hdfgroup.org +# Quincey Koziol # 9 Aug 2013 # # Purpose: Given an input file containing the output from a build of the diff --git a/hl/fortran/src/H5IMcc.c b/hl/fortran/src/H5IMcc.c index c6e4b1b..1d12f56 100644 --- a/hl/fortran/src/H5IMcc.c +++ b/hl/fortran/src/H5IMcc.c @@ -34,7 +34,7 @@ herr_t H5IM_get_palette(hid_t loc_id, * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * @@ -127,7 +127,7 @@ herr_t H5IMmake_image_8bitf(hid_t loc_id, * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * @@ -244,7 +244,7 @@ herr_t H5IMmake_image_24bitf(hid_t loc_id, * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * @@ -302,7 +302,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * @@ -395,7 +395,7 @@ herr_t H5IMmake_palettef(hid_t loc_id, * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * @@ -434,7 +434,7 @@ herr_t H5IMget_palettef(hid_t loc_id, * * Return: Success: 0, Failure: -1 * - * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente Nunes * * Date: May 10, 2005 * diff --git a/hl/fortran/src/H5IMfc.c b/hl/fortran/src/H5IMfc.c index cafd623..638cea4 100644 --- a/hl/fortran/src/H5IMfc.c +++ b/hl/fortran/src/H5IMfc.c @@ -24,7 +24,7 @@ * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -85,7 +85,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -138,7 +138,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -207,7 +207,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -292,7 +292,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06, 2004 * @@ -341,7 +341,7 @@ h5imis_image_c(hid_t_f *loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06, 2004 * @@ -396,7 +396,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06, 2004 * @@ -461,7 +461,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06, 2004 * @@ -527,7 +527,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06 2004 * @@ -588,7 +588,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06 2004 * @@ -655,7 +655,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06 2004 * @@ -714,7 +714,7 @@ done: * * Return: true, false, fail * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06, 2004 * diff --git a/hl/fortran/src/H5IMff.F90 b/hl/fortran/src/H5IMff.F90 index ffa18aa..3438e7f 100644 --- a/hl/fortran/src/H5IMff.F90 +++ b/hl/fortran/src/H5IMff.F90 @@ -41,7 +41,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -95,7 +95,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -142,7 +142,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -204,7 +204,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -267,7 +267,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -313,7 +313,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -364,7 +364,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -416,7 +416,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -467,7 +467,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -516,7 +516,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -567,7 +567,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -619,7 +619,7 @@ CONTAINS ! ! Return: true, false, fail ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index 3597c3a..2c4f274 100644 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -24,7 +24,7 @@ * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -94,7 +94,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -153,7 +153,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -218,7 +218,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -274,7 +274,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -373,7 +373,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -460,7 +460,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -535,7 +535,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -595,7 +595,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -643,7 +643,7 @@ h5ltfind_dataset_c(hid_t_f *loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * @@ -722,7 +722,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -791,7 +791,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 09, 2004 * diff --git a/hl/fortran/src/H5LTff.F90 b/hl/fortran/src/H5LTff.F90 index bc8734f..5cd255c 100644 --- a/hl/fortran/src/H5LTff.F90 +++ b/hl/fortran/src/H5LTff.F90 @@ -164,7 +164,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 1, 2004 ! @@ -385,7 +385,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -426,7 +426,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -595,7 +595,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -770,7 +770,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -933,7 +933,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -983,7 +983,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 22, 2004 ! @@ -1092,7 +1092,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1143,7 +1143,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1193,7 +1193,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1245,7 +1245,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1350,7 +1350,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1397,7 +1397,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1443,7 +1443,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1490,7 +1490,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1551,7 +1551,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 30, 2004 ! @@ -1600,7 +1600,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1644,7 +1644,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 30, 2004 ! @@ -1703,7 +1703,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: October 05, 2004 ! @@ -1757,7 +1757,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! - ! Programmer: pvn@ncsa.uiuc.edu + ! Programmer: Pedro Vicente ! ! Date: September 30, 2004 ! diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c index 285cd84..bd582e4 100644 --- a/hl/fortran/src/H5TBfc.c +++ b/hl/fortran/src/H5TBfc.c @@ -26,7 +26,7 @@ * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 06, 2004 * @@ -301,7 +301,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 12, 2004 * @@ -350,7 +350,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 12, 2004 * @@ -398,7 +398,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 12, 2004 * @@ -443,7 +443,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 12, 2004 * @@ -487,7 +487,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 13, 2004 * @@ -534,7 +534,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 13, 2004 * @@ -580,7 +580,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 12, 2004 * @@ -627,7 +627,7 @@ done: * * Return: Success: 0, Failure: -1 * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 13, 2004 * diff --git a/hl/fortran/src/H5TBff.F90 b/hl/fortran/src/H5TBff.F90 index c3db01e..e39af97 100644 --- a/hl/fortran/src/H5TBff.F90 +++ b/hl/fortran/src/H5TBff.F90 @@ -172,7 +172,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 06, 2004 ! @@ -424,7 +424,7 @@ CONTAINS ! ! Purpose: Writes one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 12, 2004 ! @@ -505,7 +505,7 @@ CONTAINS ! ! Purpose: Reads one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 12, 2004 ! @@ -586,7 +586,7 @@ CONTAINS ! ! Purpose: Writes one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 12, 2004 ! @@ -661,7 +661,7 @@ CONTAINS ! ! Purpose: Reads one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 12, 2004 ! @@ -734,7 +734,7 @@ CONTAINS ! ! Purpose: Inserts one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 13, 2004 ! @@ -807,7 +807,7 @@ CONTAINS ! ! Purpose: Inserts one field ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 13, 2004 ! @@ -858,7 +858,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 13, 2004 ! @@ -909,7 +909,7 @@ CONTAINS ! ! Return: Success: 0, Failure: -1 ! -! Programmer: pvn@ncsa.uiuc.edu +! Programmer: Pedro Vicente ! ! Date: October 13, 2004 ! diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 82dc129..12bcc93 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -11,9 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include #include "H5DSprivate.h" #include "H5LTprivate.h" #include "H5IMprivate.h" @@ -25,29 +22,24 @@ static herr_t H5DS_is_reserved(hid_t did); static hid_t H5DS_get_REFLIST_type(void); /*------------------------------------------------------------------------- -* Function: H5DSset_scale -* -* Purpose: The dataset DSID is converted to a Dimension Scale dataset. -* Creates the CLASS attribute, set to the value "DIMENSION_SCALE" -* and an empty REFERENCE_LIST attribute. -* If DIMNAME is specified, then an attribute called NAME is created, -* with the value DIMNAME. -* -* Return: Success: SUCCEED, Failure: FAIL -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: January 04, 2005 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -herr_t H5DSset_scale(hid_t dsid, - const char *dimname) + * Function: H5DSset_scale + * + * Purpose: The dataset DSID is converted to a Dimension Scale dataset. + * Creates the CLASS attribute, set to the value "DIMENSION_SCALE" + * and an empty REFERENCE_LIST attribute. + * If DIMNAME is specified, then an attribute called NAME is created, + * with the value DIMNAME. + * + * Return: Success: SUCCEED, Failure: FAIL + * + * Programmer: Pedro Vicente + * + * Date: January 04, 2005 + * + *------------------------------------------------------------------------- + */ +herr_t +H5DSset_scale(hid_t dsid, const char *dimname) { int has_dimlist; H5I_type_t it; @@ -95,34 +87,28 @@ herr_t H5DSset_scale(hid_t dsid, /*------------------------------------------------------------------------- -* Function: H5DSattach_scale -* -* Purpose: Define Dimension Scale DSID to be associated with dimension IDX -* of Dataset DID. Entries are created in the DIMENSION_LIST and -* REFERENCE_LIST attributes. -* -* Return: -* Success: SUCCEED -* Failure: FAIL -* -* Fails if: Bad arguments -* If DSID is not a Dimension Scale -* If DID is a Dimension Scale (A Dimension Scale cannot have scales) -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: December 20, 2004 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -herr_t H5DSattach_scale(hid_t did, - hid_t dsid, - unsigned int idx) + * Function: H5DSattach_scale + * + * Purpose: Define Dimension Scale DSID to be associated with dimension IDX + * of Dataset DID. Entries are created in the DIMENSION_LIST and + * REFERENCE_LIST attributes. + * + * Return: + * Success: SUCCEED + * Failure: FAIL + * + * Fails if: Bad arguments + * If DSID is not a Dimension Scale + * If DID is a Dimension Scale (A Dimension Scale cannot have scales) + * + * Programmer: Pedro Vicente + * + * Date: December 20, 2004 + * + *------------------------------------------------------------------------- + */ +herr_t +H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx) { int has_dimlist; int has_reflist; @@ -547,39 +533,31 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSdetach_scale -* -* Purpose: If possible, deletes association of Dimension Scale DSID with -* dimension IDX of Dataset DID. This deletes the entries in the -* DIMENSION_LIST and REFERENCE_LIST attributes. -* -* Return: -* Success: SUCCEED -* Failure: FAIL -* -* Fails if: Bad arguments -* The dataset DID or DSID do not exist. -* The DSID is not a Dimension Scale -* DSID is not attached to DID. -* Note that a scale may be associated with more than dimension of the same dataset. -* If so, the detach operation only deletes one of the associations, for DID. -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: December 20, 2004 -* -* Comments: -* -* Modifications: Function didn't delete DIMENSION_LIST attribute, when -* all dimension scales were detached from a dataset; added. -* 2010/05/13 EIP -* -*------------------------------------------------------------------------- -*/ - -herr_t H5DSdetach_scale(hid_t did, - hid_t dsid, - unsigned int idx) + * Function: H5DSdetach_scale + * + * Purpose: If possible, deletes association of Dimension Scale DSID with + * dimension IDX of Dataset DID. This deletes the entries in the + * DIMENSION_LIST and REFERENCE_LIST attributes. + * + * Return: + * Success: SUCCEED + * Failure: FAIL + * + * Fails if: Bad arguments + * The dataset DID or DSID do not exist. + * The DSID is not a Dimension Scale + * DSID is not attached to DID. + * Note that a scale may be associated with more than dimension of the same dataset. + * If so, the detach operation only deletes one of the associations, for DID. + * + * Programmer: Pedro Vicente + * + * Date: December 20, 2004 + * + *------------------------------------------------------------------------- + */ +herr_t +H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx) { int has_dimlist; int has_reflist; @@ -940,35 +918,29 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSis_attached -* -* Purpose: Report if dimension scale DSID is currently attached to -* dimension IDX of dataset DID by checking if DID has a pointer in the REFERENCE_LIST -* attribute and DSID (scale ) has a pointer in the DIMENSION_LIST attribute -* -* Return: -* 1: both the DS and the dataset pointers match -* 0: one of them or both do not match -* FAIL (-1): error -* -* Fails if: Bad arguments -* If DSID is not a Dimension Scale -* If DID is a Dimension Scale (A Dimension Scale cannot have scales) -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: February 18, 2005 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -htri_t H5DSis_attached(hid_t did, - hid_t dsid, - unsigned int idx) + * Function: H5DSis_attached + * + * Purpose: Report if dimension scale DSID is currently attached to + * dimension IDX of dataset DID by checking if DID has a pointer in the REFERENCE_LIST + * attribute and DSID (scale ) has a pointer in the DIMENSION_LIST attribute + * + * Return: + * 1: both the DS and the dataset pointers match + * 0: one of them or both do not match + * FAIL (-1): error + * + * Fails if: Bad arguments + * If DSID is not a Dimension Scale + * If DID is a Dimension Scale (A Dimension Scale cannot have scales) + * + * Programmer: Pedro Vicente + * + * Date: February 18, 2005 + * + *------------------------------------------------------------------------- + */ +htri_t +H5DSis_attached(hid_t did, hid_t dsid, unsigned int idx) { int has_dimlist; int has_reflist; @@ -1249,54 +1221,47 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSiterate_scales -* -* Purpose: H5DSiterate_scales iterates over the scales attached to dimension DIM -* of dataset DID. For each scale in the list, the visitor_data and some -* additional information, specified below, are passed to the visitor function. -* The iteration begins with the IDX object in the group and the next element -* to be processed by the operator is returned in IDX. If IDX is NULL, then the -* iterator starts at zero. -* -* Parameters: -* -* hid_t DID; IN: the dataset -* unsigned int DIM; IN: the dimension of the dataset -* int *DS_IDX; IN/OUT: on input the dimension scale index to start iterating, -* on output the next index to visit. If NULL, start at -* the first position. -* H5DS_iterate_t VISITOR; IN: the visitor function -* void *VISITOR_DATA; IN: arbitrary data to pass to the visitor function. -* -* Iterate over all scales of DIM, calling an application callback -* with the item, key and any operator data. -* -* The operator callback receives a pointer to the item , -* and the pointer to the operator data passed -* in to H5SL_iterate ('op_data'). The return values from an operator are: -* A. Zero causes the iterator to continue, returning zero when all -* nodes of that type have been processed. -* B. Positive causes the iterator to immediately return that positive -* value, indicating short-circuit success. -* C. Negative causes the iterator to immediately return that value, -* indicating failure. -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: January 31, 2005 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -herr_t H5DSiterate_scales(hid_t did, - unsigned int dim, - int *ds_idx, - H5DS_iterate_t visitor, - void *visitor_data ) + * Function: H5DSiterate_scales + * + * Purpose: H5DSiterate_scales iterates over the scales attached to dimension DIM + * of dataset DID. For each scale in the list, the visitor_data and some + * additional information, specified below, are passed to the visitor function. + * The iteration begins with the IDX object in the group and the next element + * to be processed by the operator is returned in IDX. If IDX is NULL, then the + * iterator starts at zero. + * + * Parameters: + * + * hid_t DID; IN: the dataset + * unsigned int DIM; IN: the dimension of the dataset + * int *DS_IDX; IN/OUT: on input the dimension scale index to start iterating, + * on output the next index to visit. If NULL, start at + * the first position. + * H5DS_iterate_t VISITOR; IN: the visitor function + * void *VISITOR_DATA; IN: arbitrary data to pass to the visitor function. + * + * Iterate over all scales of DIM, calling an application callback + * with the item, key and any operator data. + * + * The operator callback receives a pointer to the item , + * and the pointer to the operator data passed + * in to H5SL_iterate ('op_data'). The return values from an operator are: + * A. Zero causes the iterator to continue, returning zero when all + * nodes of that type have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. + * + * Programmer: Pedro Vicente + * + * Date: January 31, 2005 + * + *------------------------------------------------------------------------- + */ +herr_t +H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, + H5DS_iterate_t visitor, void *visitor_data ) { hid_t scale_id; int rank; @@ -1450,20 +1415,20 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSset_label -* -* Purpose: Set label for the dimension IDX of dataset DID to the value LABEL -* -* Return: Success: SUCCEED, Failure: FAIL -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: January 11, 2005 -* -*------------------------------------------------------------------------- -*/ - -herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) + * Function: H5DSset_label + * + * Purpose: Set label for the dimension IDX of dataset DID to the value LABEL + * + * Return: Success: SUCCEED, Failure: FAIL + * + * Programmer: Pedro Vicente + * + * Date: January 11, 2005 + * + *------------------------------------------------------------------------- + */ +herr_t +H5DSset_label(hid_t did, unsigned int idx, const char *label) { int has_labels; hid_t sid = -1; /* space ID */ @@ -1655,29 +1620,24 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSget_label -* -* Purpose: Read the label LABEL for dimension IDX of dataset DID -* Up to 'size' characters are stored in 'label' followed by a '\0' string -* terminator. If the label is longer than 'size'-1, -* the string terminator is stored in the last position of the buffer to -* properly terminate the string. -* -* Return: 0 if no label found, size of label if found, Failure: FAIL -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: January 11, 2005 -* -* Comments: -* -* Modifications: -* JIRA HDFFV-7673: Added a check to see if the label name exists, -* if not then returns zero. July 30, 2011. MSB -* -*------------------------------------------------------------------------- -*/ -ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) + * Function: H5DSget_label + * + * Purpose: Read the label LABEL for dimension IDX of dataset DID + * Up to 'size' characters are stored in 'label' followed by a '\0' string + * terminator. If the label is longer than 'size'-1, + * the string terminator is stored in the last position of the buffer to + * properly terminate the string. + * + * Return: 0 if no label found, size of label if found, Failure: FAIL + * + * Programmer: Pedro Vicente + * + * Date: January 11, 2005 + * + *------------------------------------------------------------------------- + */ +ssize_t +H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) { int has_labels; hid_t sid = -1; /* space ID */ @@ -1817,32 +1777,24 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSget_scale_name -* -* Purpose: Read the name of dataset scale DID into buffer NAME -* Up to 'size' characters are stored in 'name' followed by a '\0' string -* terminator. If the name is longer than 'size'-1, -* the string terminator is stored in the last position of the buffer to -* properly terminate the string. -* -* Return: size of name if found, zero if not found, Failure: FAIL -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: January 04, 2005 -* -* Comments: -* -* Modifications: -* The size of the name returned should not include the NULL termination -* in its value so as to be consistent with other HDF5 APIs. -* -*------------------------------------------------------------------------- -*/ - -ssize_t H5DSget_scale_name(hid_t did, - char *name, - size_t size) + * Function: H5DSget_scale_name + * + * Purpose: Read the name of dataset scale DID into buffer NAME + * Up to 'size' characters are stored in 'name' followed by a '\0' string + * terminator. If the name is longer than 'size'-1, + * the string terminator is stored in the last position of the buffer to + * properly terminate the string. + * + * Return: size of name if found, zero if not found, Failure: FAIL + * + * Programmer: Pedro Vicente + * + * Date: January 04, 2005 + * + *------------------------------------------------------------------------- + */ +ssize_t +H5DSget_scale_name(hid_t did, char *name, size_t size) { hid_t aid; /* attribute ID */ hid_t tid = -1; /* attribute type ID */ @@ -1944,24 +1896,20 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSis_scale -* -* Purpose: check if the dataset DID is a dimension scale -* -* Return: 1, is, 0, not, FAIL, error -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: January 04, 2005 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -htri_t H5DSis_scale(hid_t did) + * Function: H5DSis_scale + * + * Purpose: check if the dataset DID is a dimension scale + * + * Return: 1, is, 0, not, FAIL, error + * + * Programmer: Pedro Vicente + * + * Date: January 04, 2005 + * + *------------------------------------------------------------------------- + */ +htri_t +H5DSis_scale(hid_t did) { hid_t tid = -1; /* attribute type ID */ hid_t aid = -1; /* attribute ID */ @@ -2047,27 +1995,22 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSget_num_scales -* -* Purpose: get the number of scales linked to the IDX dimension of dataset DID -* -* Return: -* Success: number of scales -* Failure: FAIL -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: January 13, 2005 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -int H5DSget_num_scales(hid_t did, - unsigned int idx) + * Function: H5DSget_num_scales + * + * Purpose: get the number of scales linked to the IDX dimension of dataset DID + * + * Return: + * Success: number of scales + * Failure: FAIL + * + * Programmer: Pedro Vicente + * + * Date: January 13, 2005 + * + *------------------------------------------------------------------------- + */ +int +H5DSget_num_scales(hid_t did, unsigned int idx) { int has_dimlist; hid_t sid; /* space ID */ @@ -2170,25 +2113,20 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DS_is_reserved -* -* Purpose: Verify that a dataset's CLASS is either an image, palette or table -* -* Return: true, false, fail -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: March 19, 2005 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -static -herr_t H5DS_is_reserved(hid_t did) + * Function: H5DS_is_reserved + * + * Purpose: Verify that a dataset's CLASS is either an image, palette or table + * + * Return: true, false, fail + * + * Programmer: Pedro Vicente + * + * Date: March 19, 2005 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5DS_is_reserved(hid_t did) { int has_class; hid_t tid = -1; @@ -2261,26 +2199,21 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DS_get_REFLIST_type -* -* Purpose: This is a helper function to return a native type for -* the REFERENCE_LIST attribute. -* -* Return: Type identifier on success and negative on failure -* -* Programmer: epourmal@hdfgroup.org -* -* Date: May 22, 2010 -* -* Comments: -* -* Modifications: -* -*------------------------------------------------------------------------- -*/ - -static -hid_t H5DS_get_REFLIST_type(void) + * Function: H5DS_get_REFLIST_type + * + * Purpose: This is a helper function to return a native type for + * the REFERENCE_LIST attribute. + * + * Return: Type identifier on success and negative on failure + * + * Programmer: Elena Pourmal + * + * Date: May 22, 2010 + * + *------------------------------------------------------------------------- + */ +static hid_t +H5DS_get_REFLIST_type(void) { hid_t ntid_t = -1; diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 6f7414b..2b292dc 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -13,8 +13,6 @@ #include "H5IMprivate.h" #include "H5LTprivate.h" -#include -#include /*------------------------------------------------------------------------- * Function: H5IMmake_image_8bit @@ -23,7 +21,7 @@ * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: June 13, 2001 * @@ -77,7 +75,7 @@ herr_t H5IMmake_image_8bit( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: June 13, 2001 * @@ -162,7 +160,7 @@ herr_t H5IMmake_image_24bit( hid_t loc_id, * * Return: * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: May 28, 2001 * @@ -204,7 +202,7 @@ static herr_t find_palette(hid_t loc_id, * * Return: Success: 1, Failure: 0 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: May 11, 2001 * @@ -230,7 +228,7 @@ herr_t H5IM_find_palette( hid_t loc_id ) * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: July 25, 2001 * @@ -412,7 +410,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: June 13, 2001 * @@ -462,7 +460,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: May 01, 2001 * @@ -518,7 +516,7 @@ herr_t H5IMmake_palette( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: May 01, 2001 * @@ -695,7 +693,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: September 10, 2001 * @@ -796,7 +794,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: July 22, 2001 * @@ -887,7 +885,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: July 22, 2001 * @@ -1003,7 +1001,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: August 30, 2001 * @@ -1110,7 +1108,7 @@ out: * * Return: true, false, fail * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: August 30, 2001 * @@ -1214,7 +1212,7 @@ out: * * Return: true, false, fail * -* Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente Nunes * * Date: August 30, 2001 * diff --git a/hl/src/H5LD.c b/hl/src/H5LD.c index 3106ea8..21975d1 100644 --- a/hl/src/H5LD.c +++ b/hl/src/H5LD.c @@ -11,10 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include -#include #include "H5LDprivate.h" /*------------------------------------------------------------------------- diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index a631533..939f6aa 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -11,11 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include -#include - #include "H5LTprivate.h" /* For Lex and Yacc */ @@ -504,7 +499,7 @@ static herr_t H5LT_get_attribute_mem(hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Quincey Koziol, koziol@hdfgroup.org +* Programmer: Quincey Koziol * * Date: October 10, 2007 * @@ -570,7 +565,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 19, 2001 * @@ -599,7 +594,7 @@ herr_t H5LTmake_dataset( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 14, 2001 * @@ -628,7 +623,7 @@ herr_t H5LTmake_dataset_char( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 14, 2001 * @@ -657,7 +652,7 @@ herr_t H5LTmake_dataset_short( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 14, 2001 * @@ -688,7 +683,7 @@ herr_t H5LTmake_dataset_int( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 14, 2001 * @@ -717,7 +712,7 @@ herr_t H5LTmake_dataset_long( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 14, 2001 * @@ -748,7 +743,7 @@ herr_t H5LTmake_dataset_float( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 14, 2001 * @@ -778,7 +773,7 @@ herr_t H5LTmake_dataset_double( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -970,7 +965,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Quincey Koziol, koziol@hdfgroup.org +* Programmer: Quincey Koziol * * Date: October 8, 2007 * @@ -1012,7 +1007,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: June 13, 2001 * @@ -1035,7 +1030,7 @@ herr_t H5LTread_dataset(hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 5, 2001 * @@ -1056,7 +1051,7 @@ herr_t H5LTread_dataset_char( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 5, 2001 * @@ -1077,7 +1072,7 @@ herr_t H5LTread_dataset_short( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 5, 2001 * @@ -1098,7 +1093,7 @@ herr_t H5LTread_dataset_int( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 5, 2001 * @@ -1119,7 +1114,7 @@ herr_t H5LTread_dataset_long( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 5, 2001 * @@ -1141,7 +1136,7 @@ herr_t H5LTread_dataset_float( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 5, 2001 * @@ -1163,7 +1158,7 @@ herr_t H5LTread_dataset_double( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: October 05, 2004 * @@ -1216,7 +1211,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 4, 2001 * @@ -1272,7 +1267,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 4, 2001 * Modified: February 28, 2006: checked for NULL parameters @@ -1348,7 +1343,7 @@ out: * * Purpose: operator function used by H5LTfind_dataset * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: June 21, 2001 * @@ -1392,7 +1387,7 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *op_ * Purpose: Inquires if a dataset named dset_name exists attached * to the object loc_id. * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: July 15, 2001 * @@ -1436,7 +1431,7 @@ H5_GCC_DIAG_ON(cast-qual) * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: July 23, 2001 * @@ -1534,7 +1529,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: July 25, 2001 * @@ -1613,7 +1608,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 7, 2001 * @@ -1643,7 +1638,7 @@ herr_t H5LTset_attribute_char( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -1674,7 +1669,7 @@ herr_t H5LTset_attribute_uchar( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 7, 2001 * @@ -1705,7 +1700,7 @@ herr_t H5LTset_attribute_short( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -1736,7 +1731,7 @@ herr_t H5LTset_attribute_ushort( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 7, 2001 * @@ -1767,7 +1762,7 @@ herr_t H5LTset_attribute_int( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -1799,7 +1794,7 @@ herr_t H5LTset_attribute_uint( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 7, 2001 * @@ -1829,7 +1824,7 @@ herr_t H5LTset_attribute_long( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Elena Pourmal, epourmal@ncsa.uiuc.edu +* Programmer: Elena Pourmal * * Date: June 17, 2005 * @@ -1861,7 +1856,7 @@ herr_t H5LTset_attribute_long_long( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -1893,7 +1888,7 @@ herr_t H5LTset_attribute_ulong( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: July 25, 2001 * @@ -1926,7 +1921,7 @@ herr_t H5LTset_attribute_float( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 7, 2001 * @@ -1957,7 +1952,7 @@ herr_t H5LTset_attribute_double( hid_t loc_id, * * Purpose: operator function used by H5LT_find_attribute * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: June 21, 2001 * @@ -1998,7 +1993,7 @@ find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo, * Purpose: Inquires if an attribute named attr_name exists attached to * the object loc_id. * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: May 17, 2006 * @@ -2020,7 +2015,7 @@ herr_t H5LTfind_attribute( hid_t loc_id, const char* attr_name ) * * Purpose: Inquires if an attribute named attr_name exists attached to the object loc_id. * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: June 21, 2001 * @@ -2059,7 +2054,7 @@ H5_GCC_DIAG_ON(cast-qual) * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 4, 2001 * @@ -2129,7 +2124,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 4, 2001 * @@ -2215,7 +2210,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Raymond Lu, slu@ncsa.uiuc.edu +* Programmer: Raymond Lu * * Date: October 6, 2004 * @@ -2265,7 +2260,7 @@ out: * * Return: void * -* Programmer: Raymond Lu, songyulu@hdfgroup.org +* Programmer: Raymond Lu * * Date: 29 September 2011 * @@ -2325,7 +2320,7 @@ out: * * Return: void * -* Programmer: Raymond Lu, slu@ncsa.uiuc.edu +* Programmer: Raymond Lu * * Date: December 6, 2005 * @@ -2489,7 +2484,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Raymond Lu, slu@ncsa.uiuc.edu +* Programmer: Raymond Lu * * Date: December 6, 2005 * @@ -2536,7 +2531,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Raymond Lu, slu@ncsa.uiuc.edu +* Programmer: Raymond Lu * * Date: December 20, 2005 * @@ -3101,7 +3096,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3153,7 +3148,7 @@ herr_t H5LTget_attribute_string( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3182,7 +3177,7 @@ herr_t H5LTget_attribute_char( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -3213,7 +3208,7 @@ herr_t H5LTget_attribute_uchar( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3242,7 +3237,7 @@ herr_t H5LTget_attribute_short( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -3273,7 +3268,7 @@ herr_t H5LTget_attribute_ushort( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3302,7 +3297,7 @@ herr_t H5LTget_attribute_int( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -3333,7 +3328,7 @@ herr_t H5LTget_attribute_uint( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3362,7 +3357,7 @@ herr_t H5LTget_attribute_long( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Elena Pourmal, epourmal@ncsa.uiuc.edu +* Programmer: Elena Pourmal * * Date: June 17, 2005 * @@ -3392,7 +3387,7 @@ herr_t H5LTget_attribute_long_long( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 8, 2004 * @@ -3422,7 +3417,7 @@ herr_t H5LTget_attribute_ulong( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3454,7 +3449,7 @@ herr_t H5LTget_attribute_float( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3486,7 +3481,7 @@ herr_t H5LTget_attribute_double( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3525,7 +3520,7 @@ herr_t H5LTget_attribute( hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3589,7 +3584,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: September 19, 2002 * @@ -3639,7 +3634,7 @@ out: * * Return: FAIL on error, SUCCESS on success * -* Programmer: pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: January 04, 2005 * diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index f413bea..fa77ae1 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include - #include "H5PTprivate.h" #include "H5TBprivate.h" @@ -53,8 +51,8 @@ static herr_t H5PT_get_index(htbl_t *table_id, hsize_t *pt_index); * * Return: Success: table ID, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu (Author of H5PTcreate_fl) - * James Laird, jlaird@ncsa.uiuc.edu (Author of H5PTcreate_fl) + * Programmer: Nat Furrer (Author of H5PTcreate_fl) + * James Laird (Author of H5PTcreate_fl) * * Date: March 12, 2004 * @@ -182,8 +180,8 @@ error: * * Return: Success: table ID, Failure: Negative * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -301,8 +299,8 @@ error: * * Return: Success: table ID, Failure: Negative * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 10, 2004 * @@ -426,8 +424,8 @@ H5PT_free_id(void *id) * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 10, 2004 * @@ -475,8 +473,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: April 21, 2004 * @@ -530,8 +528,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -583,8 +581,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 10, 2004 * @@ -628,8 +626,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -680,8 +678,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -737,8 +735,8 @@ H5PT_get_index(htbl_t *table, hsize_t *pt_index) * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: April 23, 2004 * @@ -795,8 +793,8 @@ herr_t H5PTget_index(hid_t table_id, hsize_t *pt_index) * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -832,8 +830,8 @@ error: * * Return: Success: SUCCEED, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: March 12, 2004 * @@ -861,8 +859,8 @@ herr_t H5PTis_valid(hid_t table_id) * * Return: True: 1, False: 0, Failure: FAIL * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: April 14, 2004 * @@ -910,8 +908,8 @@ error: * Return: Success: SUCCEED, Failure: FAIL * -2 if memory was reclaimed but another error occurred * - * Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu - * James Laird, jlaird@ncsa.uiuc.edu + * Programmer: Nat Furrer + * James Laird * * Date: April 12, 2004 * diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index c54c41f..79d5cef 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -11,9 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include - #include "H5LTprivate.h" #include "H5TBprivate.h" @@ -55,7 +52,7 @@ static hid_t H5TB_create_type(hid_t loc_id, * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * Quincey Koziol * * Date: January 17, 2001 @@ -275,7 +272,7 @@ out: * Return: Success: 0, Failure: -1 * * Programmers: -* Pedro Vicente, pvn@ncsa.uiuc.edu +* Pedro Vicente * Quincey Koziol * * Date: November 19, 2001 @@ -345,7 +342,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -442,7 +439,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 21, 2001 * @@ -605,7 +602,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 21, 2001 * @@ -778,7 +775,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 20, 2001 * @@ -853,7 +850,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -923,7 +920,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -1086,7 +1083,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -1251,7 +1248,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 26, 2001 * @@ -1413,7 +1410,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 26, 2001 * @@ -1569,7 +1566,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: December 5, 2001 * @@ -1701,7 +1698,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: December 10, 2001 * @@ -2059,7 +2056,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: January 30, 2002 * @@ -2480,7 +2477,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: January 30, 2002 * @@ -2934,7 +2931,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: January 30, 2001 * @@ -2960,7 +2957,7 @@ herr_t H5TBAget_title(hid_t loc_id, * * Return: Success: TRUE/FALSE, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: January 30, 2002 * @@ -3033,7 +3030,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -3120,7 +3117,7 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -3240,7 +3237,7 @@ out: * * Return: Success: TRUE/FALSE, Failure: N/A * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 19, 2001 * @@ -3281,7 +3278,7 @@ hbool_t H5TB_find_field(const char *field, const char *field_list) * * Return: Success: 0, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: December 6, 2001 * @@ -3345,7 +3342,7 @@ out: * * Return: Success: the memory type ID, Failure: -1 * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: March 31, 2004 * @@ -3445,8 +3442,8 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu -* James Laird, jlaird@ncsa.uiuc.edu +* Programmer: Nat Furrer +* James Laird * * Date: March 8, 2004 * @@ -3512,8 +3509,8 @@ out: * * Return: Success: 0, Failure: -1 * -* Programmer: Nat Furrer, nfurrer@ncsa.uiuc.edu -* James Laird, jlaird@ncsa.uiuc.edu +* Programmer: Nat Furrer +* James Laird * * Date: March 8, 2004 * diff --git a/hl/test/gen_test_ds.c b/hl/test/gen_test_ds.c index 285ab77..a43af77 100644 --- a/hl/test/gen_test_ds.c +++ b/hl/test/gen_test_ds.c @@ -23,8 +23,6 @@ * in test_ds.c will read them. */ -#include -#include #include "h5hltest.h" #include "H5DSpublic.h" #include "H5LTpublic.h" diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h index 85f47bd..6cf5062 100644 --- a/hl/test/h5hltest.h +++ b/hl/test/h5hltest.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, April 28, 2006 * * Purpose: Test support stuff. diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 79e6f45..5550dd1 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5srcdir.h" #include "H5DSpublic.h" diff --git a/hl/test/test_dset_append.c b/hl/test/test_dset_append.c index 1914a08..455c0e8 100644 --- a/hl/test/test_dset_append.c +++ b/hl/test/test_dset_append.c @@ -11,10 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include - #include "h5hltest.h" #include "H5DOpublic.h" diff --git a/hl/test/test_image.c b/hl/test/test_image.c index 6d13419..06a0ff3 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -11,10 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include - #include "h5hltest.h" #include "H5srcdir.h" #include "H5LTpublic.h" diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c index e3cde5d..7de409f 100644 --- a/hl/test/test_ld.c +++ b/hl/test/test_ld.c @@ -11,11 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include -#include -#include #include "h5hltest.h" #include "H5srcdir.h" #include "H5LDpublic.h" diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index e6b4668..f3e6e97 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5srcdir.h" #include "H5LTpublic.h" diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 61aebc7..eb28e3d 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5PTpublic.h" #include "H5TBpublic.h" diff --git a/hl/test/test_table.c b/hl/test/test_table.c index 1d6bcec..cd2e2a4 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5srcdir.h" #include "H5TBpublic.h" diff --git a/hl/tools/gif2h5/h52gifgentst.c b/hl/tools/gif2h5/h52gifgentst.c index 655563c..c0ad151 100644 --- a/hl/tools/gif2h5/h52gifgentst.c +++ b/hl/tools/gif2h5/h52gifgentst.c @@ -22,7 +22,7 @@ * * Purpose: generate files for h52gif testing * - * Programmer: Pedro Vicente, pvn@hdfgroup.org + * Programmer: Pedro Vicente * * Date: March 15, 2007 * diff --git a/test/SWMR_UseCase_UG.txt b/test/SWMR_UseCase_UG.txt index 18d4927..1e3d1e6 100644 --- a/test/SWMR_UseCase_UG.txt +++ b/test/SWMR_UseCase_UG.txt @@ -6,8 +6,8 @@ case program and explain how to run them. 2.1. Author and Dates: - Version 2: By Albert Cheng (acheng@hdfgroup.org), 2013/06/18. - Version 1: By Albert Cheng (acheng@hdfgroup.org), 2013/06/01. + Version 2: By Albert Cheng, 2013/06/18. + Version 1: By Albert Cheng, 2013/06/01. %%%%Use Case 1.7%%%% diff --git a/test/app_ref.c b/test/app_ref.c index a4853fa..c1735fa 100644 --- a/test/app_ref.c +++ b/test/app_ref.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Thursday, August 14, 2008 * * Purpose: Tests closing the library after reference counts have been diff --git a/test/big.c b/test/big.c index a2f07af..c4f8e88 100644 --- a/test/big.c +++ b/test/big.c @@ -12,9 +12,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 8, 1998 - * Modified: Albert Cheng + * Modified: Albert Cheng * September 11, 2010 */ /* diff --git a/test/bittests.c b/test/bittests.c index 046528a..6f236d6 100644 --- a/test/bittests.c +++ b/test/bittests.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, June 16, 1998 * * Purpose: Tests functions in H5Tbit.c diff --git a/test/btree2.c b/test/btree2.c index c4c5530..e91808d 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Tuesday, February 1, 2005 */ #include "h5test.h" diff --git a/test/cache.c b/test/cache.c index bb18728..fdfba00 100644 --- a/test/cache.c +++ b/test/cache.c @@ -28146,7 +28146,6 @@ check_auto_cache_resize_aux_fcns(unsigned paged) * Return: void * * Programmer: Mike McGreevy - * * 12/16/08 * * Modifications: diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index ff3767c..c8ef1e4 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, January 23, 1998 */ diff --git a/test/cross_read.c b/test/cross_read.c index c16ddbc..dabd3ab 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Thursday, March 23, 2006 * * Purpose: Check if floating-point data created on big-endian and diff --git a/test/dangle.c b/test/dangle.c index 9f30f10..8300792 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * * Purpose: Test dangling IDs diff --git a/test/dsets.c b/test/dsets.c index 4ab3efa..e4cf2a4 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 9, 1997 * * Purpose: Tests the dataset interface (H5D) diff --git a/test/dt_arith.c b/test/dt_arith.c index 8d04770..775f4ee 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 9, 1997 * * Purpose: Tests the data type interface (H5T) diff --git a/test/dtypes.c b/test/dtypes.c index 6dfc47d..e96e826 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 9, 1997 * * Purpose: Tests the datatype interface (H5T) diff --git a/test/earray.c b/test/earray.c index 6597afd..f9bb56e 100644 --- a/test/earray.c +++ b/test/earray.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Tuesday, June 17, 2008 */ #include "h5test.h" diff --git a/test/enum.c b/test/enum.c index 109f7c3..1933ce1 100644 --- a/test/enum.c +++ b/test/enum.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, December 22, 1998 */ #include "h5test.h" diff --git a/test/extend.c b/test/extend.c index 1e2b5b5..369ad32 100644 --- a/test/extend.c +++ b/test/extend.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, January 30, 1998 * * Purpose: Tests extendible datasets. diff --git a/test/external.c b/test/external.c index d29fb6b..c98c228 100644 --- a/test/external.c +++ b/test/external.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 3, 1998 * * Purpose: Tests datasets stored in external raw files. diff --git a/test/external_common.c b/test/external_common.c index a9e600b..85fdfa0 100644 --- a/test/external_common.c +++ b/test/external_common.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * April, 2019 * * Purpose: Private function for external.c and external_env.c diff --git a/test/external_common.h b/test/external_common.h index f02652b..3633ea3 100644 --- a/test/external_common.h +++ b/test/external_common.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * April, 2019 * * Purpose: Private function for external.c and external_env.c diff --git a/test/external_fname.h b/test/external_fname.h index c5111b6..f5aca6d 100644 --- a/test/external_fname.h +++ b/test/external_fname.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * July, 2019 * * Purpose: Private declaration for external.c and external_env.c diff --git a/test/fheap.c b/test/fheap.c index b1a0db0..ef459d3 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Friday, February 24, 2006 */ #include "h5test.h" diff --git a/test/filter_fail.c b/test/filter_fail.c index e5187be..b3e5c8a 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 7 September 2010 * * Purpose: Make sure dataset, file, and library can close properly when a diff --git a/test/flush1.c b/test/flush1.c index 04f24f7..e01f4a5 100644 --- a/test/flush1.c +++ b/test/flush1.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, October 23, 1998 * * Purpose: This is the first half of a two-part test that makes sure diff --git a/test/flush2.c b/test/flush2.c index 5fc716b..c3103d9 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, October 23, 1998 * * Purpose: This is the second half of a two-part test that makes sure diff --git a/test/gen_bad_compound.c b/test/gen_bad_compound.c index 292659c..bd857b4 100644 --- a/test/gen_bad_compound.c +++ b/test/gen_bad_compound.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * April 14, 2011 * * Purpose: This program is run to generate an HDF5 data file with objects diff --git a/test/gen_bad_ohdr.c b/test/gen_bad_ohdr.c index 36ba64a..0f85cfe 100644 --- a/test/gen_bad_ohdr.c +++ b/test/gen_bad_ohdr.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Jan 5, 2008 * * Purpose: This program is run to generate an HDF5 data file with a diff --git a/test/gen_cross.c b/test/gen_cross.c index 105895d..2c1ff4d 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Thursday, March 23, 2006 * * This program writes floating-point data to the HDF5 file. It generates diff --git a/test/gen_filters.c b/test/gen_filters.c index 9764830..ace86ba 100644 --- a/test/gen_filters.c +++ b/test/gen_filters.c @@ -38,7 +38,7 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, * * Failure: -1 * - * Programmer: Pedro Vicente + * Programmer: Pedro Vicente * Thursday, March 25, 2004 * *------------------------------------------------------------------------- diff --git a/test/gen_mergemsg.c b/test/gen_mergemsg.c index f158d57..6633eb0 100644 --- a/test/gen_mergemsg.c +++ b/test/gen_mergemsg.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, June 30, 2006 * * This program creates an object with fragmented object header messages diff --git a/test/gen_new_array.c b/test/gen_new_array.c index 27f162c..041b691 100644 --- a/test/gen_new_array.c +++ b/test/gen_new_array.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 09, 2000 * * Purpose: Create a two datasets, one with a compound datatypes with array diff --git a/test/gen_new_fill.c b/test/gen_new_fill.c index 5bdbf73..c012d8b 100644 --- a/test/gen_new_fill.c +++ b/test/gen_new_fill.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Feb 27, 2002 * * Purpose: This program is run to generate a HDF5 data file with fill diff --git a/test/gen_new_group.c b/test/gen_new_group.c index 6924291..42a751f 100644 --- a/test/gen_new_group.c +++ b/test/gen_new_group.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Oct 24, 2005 * * Purpose: This program is run to generate an HDF5 data file with both diff --git a/test/gen_new_mtime.c b/test/gen_new_mtime.c index b44d567..90259c7 100644 --- a/test/gen_new_mtime.c +++ b/test/gen_new_mtime.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 3, 2003 * * Purpose: Create a dataset, which should have the newer mtime information diff --git a/test/gen_new_super.c b/test/gen_new_super.c index d371f5f..36f2187 100644 --- a/test/gen_new_super.c +++ b/test/gen_new_super.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 15, 2003 * * Purpose: Create a file which will have the newer superblock format. diff --git a/test/gen_old_array.c b/test/gen_old_array.c index 3fab657..402fd40 100644 --- a/test/gen_old_array.c +++ b/test/gen_old_array.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, November 09, 2000 * * Purpose: Create a two datasets with compound datatypes, one with no array diff --git a/test/gen_old_group.c b/test/gen_old_group.c index d109329..55dbde3 100644 --- a/test/gen_old_group.c +++ b/test/gen_old_group.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Oct 24, 2005 * * Purpose: This program is run to generate an HDF5 data file with an diff --git a/test/gen_old_layout.c b/test/gen_old_layout.c index 56c3e4e..0210786 100644 --- a/test/gen_old_layout.c +++ b/test/gen_old_layout.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, May 27, 2004 * * Purpose: Create two datasets (one for version 1 and one for version 2 of diff --git a/test/gen_old_mtime.c b/test/gen_old_mtime.c index cbe3bdc..e72c9b1 100644 --- a/test/gen_old_mtime.c +++ b/test/gen_old_mtime.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 3, 2003 * * Purpose: Create a dataset, which should have the older mtime information diff --git a/test/gen_sizes_lheap.c b/test/gen_sizes_lheap.c index 81742df..0e62019 100644 --- a/test/gen_sizes_lheap.c +++ b/test/gen_sizes_lheap.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Thursday, July 15, 2010 * * Purpose: Creates a file with non-default sizes of lengths and addresses. diff --git a/test/gen_specmetaread.c b/test/gen_specmetaread.c index f2625a7..ca44f9a 100644 --- a/test/gen_specmetaread.c +++ b/test/gen_specmetaread.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, October 8, 2009 * * Purpose: Create a file with a dataset who's raw data immediately follows diff --git a/test/gen_udlinks.c b/test/gen_udlinks.c index e48d0e8..456cb5c 100644 --- a/test/gen_udlinks.c +++ b/test/gen_udlinks.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: James Laird + * Programmer: James Laird * Tuesday, June 6, 2006 * * This program creates HDF5 files with user-defined links. These files diff --git a/test/getname.c b/test/getname.c index a6f2f5a..ef0d5ea 100644 --- a/test/getname.c +++ b/test/getname.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Pedro Vicente + * Programmer: Pedro Vicente * April 12, 2002 * * Purpose: Tests the "ID to name" functionality diff --git a/test/gheap.c b/test/gheap.c index 09ba1cf..077f921 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Purpose: Tests the global heap. The global heap is the set of all diff --git a/test/h5test.c b/test/h5test.c index 55141ea..255932a 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, November 19, 1998 * * Purpose: Provides support functions for most of the hdf5 tests cases. diff --git a/test/h5test.h b/test/h5test.h index 697bde6..22047e1 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, November 20, 1998 * * Purpose: Test support stuff. diff --git a/test/hdfs.c b/test/hdfs.c index ab39da6..3112dcc 100644 --- a/test/hdfs.c +++ b/test/hdfs.c @@ -19,7 +19,7 @@ * * Demonstrates basic use cases and fapl interaction. * - * Programmer: Jacob Smith + * Programmer: Jacob Smith * 2018-04-23 */ diff --git a/test/hyperslab.c b/test/hyperslab.c index e702023..8168eed 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Friday, October 10, 1997 * * Purpose: Hyperslab operations are rather complex, so this file diff --git a/test/istore.c b/test/istore.c index c8fe866..e80f260 100644 --- a/test/istore.c +++ b/test/istore.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Wednesday, October 15, 1997 * * Purpose: Tests various aspects of indexed raw data storage. diff --git a/test/lheap.c b/test/lheap.c index 5f60dca..dd430a3 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, November 24, 1998 * * Purpose: Test local heaps used by symbol tables (groups). diff --git a/test/mount.c b/test/mount.c index 3abe084..4cc02e4 100644 --- a/test/mount.c +++ b/test/mount.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, October 7, 1998 * * Purpose: Tests file mounting. diff --git a/test/mtime.c b/test/mtime.c index 81a20db..8294e80 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 30, 1998 * * Purpose: Determines if the modification time message is working diff --git a/test/ntypes.c b/test/ntypes.c index f1d2449..e371b93 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -2675,7 +2675,7 @@ error: * Return: Success: 0 * Failure: -1 * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * September 3, 2004 * * Modifications: diff --git a/test/ohdr.c b/test/ohdr.c index ad76576..f00a4f8 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Tuesday, November 24, 1998 */ #include "h5test.h" diff --git a/test/pool.c b/test/pool.c index 1851d6e..648a501 100644 --- a/test/pool.c +++ b/test/pool.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol +/* Programmer: Quincey Koziol * Tuesday, May 3, 2005 */ #include "h5test.h" diff --git a/test/ros3.c b/test/ros3.c index 73b6ac2..fb7aa2b 100644 --- a/test/ros3.c +++ b/test/ros3.c @@ -20,7 +20,7 @@ * * Demonstrates basic use cases and fapl/dxpl interaction. * - * Programmer: Jacob Smith + * Programmer: Jacob Smith * 2017-10-11 */ diff --git a/test/s3comms.c b/test/s3comms.c index 9453b75..9a7d7d6 100644 --- a/test/s3comms.c +++ b/test/s3comms.c @@ -15,7 +15,7 @@ * * Purpose: Unit tests for the S3 Communications (s3comms) module. * - * Programmer: Jacob Smith + * Programmer: Jacob Smith * 2017-10-11 */ diff --git a/test/set_extent.c b/test/set_extent.c index 171fd05..17bdb1b 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Pedro Vicente + * Programmer: Pedro Vicente * April 12, 2002 * * Purpose: Tests the H5Dset_extent call diff --git a/test/space_overflow.c b/test/space_overflow.c index 15be9ba..82ddb3b 100644 --- a/test/space_overflow.c +++ b/test/space_overflow.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, October 26, 1998 * * Purpose: Create a dataset with a simple data space that has the diff --git a/test/stab.c b/test/stab.c index 215d748..ed4b5a0 100644 --- a/test/stab.c +++ b/test/stab.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, November 24, 1998 */ @@ -171,7 +171,7 @@ test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format) * * Failure: number of errors * - * Programmer: Robb Matzke 2002-03-28 + * Programmer: Robb Matzke 2002-03-28 * * Modifications: *------------------------------------------------------------------------- diff --git a/test/tchecksum.c b/test/tchecksum.c index 6e509fb..82dc135 100644 --- a/test/tchecksum.c +++ b/test/tchecksum.c @@ -15,7 +15,7 @@ * * Created: tchecksum.c * Aug 21 2006 - * Quincey Koziol + * Quincey Koziol * * Purpose: Test internal checksum routine(s) * diff --git a/test/testframe.c b/test/testframe.c index 3c2a335..cfb62ec 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, January 6, 2004 * * Purpose: Provides support functions for the testing framework. diff --git a/test/tfile.c b/test/tfile.c index d6047dc..e7dfcbe 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -3097,7 +3097,6 @@ test_rw_noupdate(void) ** test_userblock_alignment() test, to handle common testing ** ** Programmer: Quincey Koziol -** koziol@hdfgroup.org ** Septmber 10, 2009 ** *****************************************************************/ @@ -3159,7 +3158,6 @@ test_userblock_alignment_helper1(hid_t fcpl, hid_t fapl) ** test_userblock_alignment() test, to handle common testing ** ** Programmer: Quincey Koziol -** koziol@hdfgroup.org ** Septmber 10, 2009 ** *****************************************************************/ @@ -3229,7 +3227,6 @@ test_userblock_alignment_helper2(hid_t fapl, hbool_t open_rw) ** object [allocation] alignment size set interact properly. ** ** Programmer: Quincey Koziol -** koziol@hdfgroup.org ** Septmber 8, 2009 ** *****************************************************************/ diff --git a/test/unlink.c b/test/unlink.c index 48dd79d..f45d7d7 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, September 25, 1998 * * Purpose: Test unlinking operations. diff --git a/test/vds.c b/test/vds.c index c4d1391..816acf9 100644 --- a/test/vds.c +++ b/test/vds.c @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Monday, February 16, 2015 * * Purpose: Tests datasets with virtual layout. diff --git a/test/vds_env.c b/test/vds_env.c index 3d5b5dd..0d0891f 100644 --- a/test/vds_env.c +++ b/test/vds_env.c @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Monday, February 16, 2015 * * Purpose: Tests datasets with virtual layout. diff --git a/test/vfd.c b/test/vfd.c index 09ef106..f1443c5 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Tuesday, Sept 24, 2002 * * Purpose: Tests the basic features of Virtual File Drivers diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 152ec1a..7d3f40a 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 23, 1998 * * Purpose: Support functions for the various tools. diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h index 074e86d..65446ee 100644 --- a/tools/lib/h5tools_str.h +++ b/tools/lib/h5tools_str.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Bill Wendling + * Programmer: Bill Wendling * Monday, 19. February 2001 */ #ifndef H5TOOLS_STR_H__ diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index 42144cc..07069cc 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Bill Wendling + * Programmer: Bill Wendling * Tuesday, 6. March 2001 * * Purpose: Support functions for the various tools. diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c index 33d6570..e14447d 100644 --- a/tools/src/h5diff/h5diff_main.c +++ b/tools/src/h5diff/h5diff_main.c @@ -26,7 +26,7 @@ * Return: An exit status of 0 means no differences were found, 1 means some * differences were found. * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 9, 2003 * diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c index c473c8b..2336378 100644 --- a/tools/src/h5diff/ph5diff_main.c +++ b/tools/src/h5diff/ph5diff_main.c @@ -31,7 +31,7 @@ static void ph5diff_worker(int ); * Return: An exit status of 0 means no differences were found, 1 means some * differences were found. * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 9, 2003 * diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index e239cbc..8cf9b3c 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, March 23, 1998 */ diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index 95cacc1..50ccd7a 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -478,7 +478,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, * Example: * "AA,B,CDE:CHUNK=10X10" * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: December 30, 2003 * diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index e9a783b..7242ed3 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -15,7 +15,7 @@ * * Created: debug.c * Jul 18 1997 - * Robb Matzke + * Robb Matzke * * Purpose: Debugs an existing HDF5 file at a low level. * @@ -237,7 +237,6 @@ get_H5FA_class(const uint8_t *sig) * Failure: exit (non-zero) * * Programmer: Robb Matzke - * matzke@llnl.gov * Jul 18 1997 * *------------------------------------------------------------------------- diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c index d516fa0..371cf2c 100644 --- a/tools/src/misc/h5repart.c +++ b/tools/src/misc/h5repart.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, May 13, 1998 * * Purpose: Repartitions a file family. This program can be used to diff --git a/tools/test/h5copy/testh5copy.sh.in b/tools/test/h5copy/testh5copy.sh.in index 84e3b65..ebbcb6c 100644 --- a/tools/test/h5copy/testh5copy.sh.in +++ b/tools/test/h5copy/testh5copy.sh.in @@ -13,7 +13,7 @@ # # Tests for the h5copy tool # -# Pedro Vicente Nunes (pvn@hdfgroup.org), Albert Cheng (acheng@hdfgroup.org) +# Pedro Vicente Nunes, Albert Cheng # Thursday, July 20, 2006 # diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index bdc2ddc..afdf46c 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -31,7 +31,7 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); * * Purpose: generate files for h5diff testing * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 12, 2003 * diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 731e233..3bb6604 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -3964,7 +3964,7 @@ static void gent_char(void) * * Return: void * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 28, 2003 * @@ -4404,7 +4404,7 @@ static void write_attr_in(hid_t loc_id, * * Return: void * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 28, 2003 * @@ -4854,7 +4854,7 @@ static void write_dset_in(hid_t loc_id, * * Return: void * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 19, 2003 * @@ -4923,7 +4923,7 @@ static void gent_attr_all(void) * * Purpose: utility function to write an attribute * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 19, 2003 * @@ -4962,7 +4962,7 @@ int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *attr_name, * * Return: * - * Programmer: pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 27, 2003 * diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index ab0dbb7..2666e95 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -3872,7 +3872,7 @@ out: * * Purpose: write datasets in LOC_ID * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 12, 2003 * @@ -4736,7 +4736,7 @@ out: * * Purpose: write attributes in LOC_ID (dataset, group, named datatype) * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 12, 2003 * @@ -5927,7 +5927,7 @@ out: * * Purpose: utility function to create and write a dataset in LOC_ID * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 12, 2003 * @@ -5963,7 +5963,7 @@ out: * * Purpose: utility function to create and write a dataset in LOC_ID * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 12, 2003 * @@ -6011,7 +6011,7 @@ out: * * Purpose: utility function to write an attribute in LOC_ID * -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu +* Programmer: Pedro Vicente * * Date: November 12, 2003 * diff --git a/tools/test/misc/h5perf_gentest.c b/tools/test/misc/h5perf_gentest.c index f50e5fb..511a9e2 100644 --- a/tools/test/misc/h5perf_gentest.c +++ b/tools/test/misc/h5perf_gentest.c @@ -14,7 +14,7 @@ creates a large number of attributes, groups, and datasets by specifying -a, -g, -d options respectively. Using "-h" option to see details. - Programmer: Peter Cao , Jan. 2013 + Programmer: Peter Cao, Jan. 2013 ****************************************************************************/ #include "hdf5.h" @@ -128,7 +128,7 @@ int main (int argc, char *argv[]) Return: Non-negative on success/Negative on failure - Programmer: Peter Cao , Jan. 2013 + Programmer: Peter Cao, Jan. 2013 ****************************************************************************/ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen, diff --git a/tools/test/misc/h5repart_gentest.c b/tools/test/misc/h5repart_gentest.c index bd94104..520069f 100644 --- a/tools/test/misc/h5repart_gentest.c +++ b/tools/test/misc/h5repart_gentest.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * June 1, 2005 * * Purpose: Generate a family file of 1024 bytes for each member diff --git a/tools/test/misc/testh5mkgrp.sh.in b/tools/test/misc/testh5mkgrp.sh.in index b08cce1..7dc8155 100644 --- a/tools/test/misc/testh5mkgrp.sh.in +++ b/tools/test/misc/testh5mkgrp.sh.in @@ -13,7 +13,7 @@ # # Tests for the h5mkgrp tool # -# Quincey Koziol (koziol@hdfgroup.org) +# Quincey Koziol # Tuesday, February 13, 2007 # diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c index de56281..bb74a1b 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, March 12, 1998 */ diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c index 58558a5..bb3aff5 100644 --- a/tools/test/perform/overhead.c +++ b/tools/test/perform/overhead.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, September 28, 1998 * * Purpose: Creates a chunked dataset and measures the storage overhead. diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c index b56f074..77248cc 100644 --- a/tools/test/perform/perf_meta.c +++ b/tools/test/perform/perf_meta.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Friday, Oct 3, 2004 * * Purpose: Tests performance of metadata -- cgit v0.12 From 5f6eec0b20ce325fbd4cbc7913cd972fbd070a22 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 7 Aug 2020 11:08:19 -0500 Subject: Move H5T_vlen_reclaim to package scope --- src/H5Tconv.c | 2 +- src/H5Tpkg.h | 1 + src/H5Tprivate.h | 1 - src/H5Tvlen.c | 8 ++++---- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 5d4829e..95c83f9 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -9601,7 +9601,7 @@ H5T_reclaim_cb(void *elem, const H5T_t *dt, unsigned H5_ATTR_UNUSED ndim, HDassert(op_data); /* Allow vlen reclaim to recurse into that routine */ - if(H5T_vlen_reclaim(elem, dt, (H5T_vlen_alloc_info_t *)op_data) < 0) + if(H5T__vlen_reclaim(elem, dt, (H5T_vlen_alloc_info_t *)op_data) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't reclaim vlen elements") } diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 28521a6..1766c3f 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -1179,6 +1179,7 @@ H5_DLL void H5T__bit_neg(uint8_t *buf, size_t start, size_t size); /* VL functions */ H5_DLL H5T_t * H5T__vlen_create(const H5T_t *base); +H5_DLL herr_t H5T__vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info); H5_DLL htri_t H5T__vlen_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc); /* Array functions */ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index f7ca281..490ffb5 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -135,7 +135,6 @@ H5_DLL herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T_reclaim(hid_t type_id, struct H5S_t *space, void *buf); H5_DLL herr_t H5T_reclaim_cb(void *elem, const H5T_t *dt, unsigned ndim, const hsize_t *point, void *op_data); -H5_DLL herr_t H5T_vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info); H5_DLL herr_t H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt); H5_DLL htri_t H5T_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc); H5_DLL htri_t H5T_is_sensible(const H5T_t *dt); diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 9d098c6..f185c2f 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -1037,7 +1037,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_vlen_reclaim + * Function: H5T__vlen_reclaim * * Purpose: Internal recursive routine to free VL datatypes * @@ -1049,7 +1049,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info) +H5T__vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info) { unsigned u; /* Local index variable */ H5MM_free_t free_func; /* Free function */ @@ -1156,7 +1156,7 @@ H5T_vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_vlen_reclaim() */ +} /* end H5T__vlen_reclaim() */ /*------------------------------------------------------------------------- @@ -1191,7 +1191,7 @@ H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info") /* Recurse on buffer to free dynamic fields */ - if(H5T_vlen_reclaim(elem, dt, &vl_alloc_info) < 0) + if(H5T__vlen_reclaim(elem, dt, &vl_alloc_info) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't reclaim vlen elements") done: -- cgit v0.12 From a975a8d0eb3244d1a08afc80133a12279d1f90e5 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 7 Aug 2020 11:50:22 -0700 Subject: Removes unsuffixed float warnings These warnings can only be addressed with gnu extensions. --- config/gnu-warnings/4.8 | 3 +++ config/gnu-warnings/developer-4.8 | 1 - config/gnu-warnings/no-developer-4.8 | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/gnu-warnings/4.8 b/config/gnu-warnings/4.8 index c7e3dd1..05f4d92 100644 --- a/config/gnu-warnings/4.8 +++ b/config/gnu-warnings/4.8 @@ -9,6 +9,9 @@ # warning flag added for GCC >= 4.5 -Wstrict-overflow=5 +# This warning can only be truly addressed using the gcc extension of +# using D to indicate doubles (e.g., 1.23D). +-Wno-unsuffixed-float-constants # warning flags added for GCC >= 4.6 -Wdouble-promotion diff --git a/config/gnu-warnings/developer-4.8 b/config/gnu-warnings/developer-4.8 index fd76f6c..bfd15a1 100644 --- a/config/gnu-warnings/developer-4.8 +++ b/config/gnu-warnings/developer-4.8 @@ -5,7 +5,6 @@ # the variable is never *used* before it has been initialized? # -Wjump-misses-init --Wunsuffixed-float-constants # developer warning flag added for GCC >= 4.6 -Wsuggest-attribute=const diff --git a/config/gnu-warnings/no-developer-4.8 b/config/gnu-warnings/no-developer-4.8 index 1e29c78..09a9a96 100644 --- a/config/gnu-warnings/no-developer-4.8 +++ b/config/gnu-warnings/no-developer-4.8 @@ -1,6 +1,5 @@ # no-developer warning flag added for GCC >= 4.5 -Wno-jump-misses-init --Wno-unsuffixed-float-constants # no-developer warning flag added for GCC >= 4.6 -Wno-suggest-attribute=const -- cgit v0.12 From 0ed65346033e7fbc71634d4911f9761e2ec145b2 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 7 Aug 2020 12:40:04 -0700 Subject: Fixes flock Windows failure --- test/h5test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/h5test.c b/test/h5test.c index 255932a..497a5f2 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -2255,15 +2255,15 @@ done: *------------------------------------------------------------------------- */ herr_t -h5_check_if_file_locking_enabled(hbool_t *are_enabled) +h5_check_if_file_locking_enabled(hbool_t *is_enabled) { const char *filename = "locking_test_file"; - mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; + int pmode = O_RDWR | O_CREAT | O_TRUNC; int fd = -1; - *are_enabled = TRUE; + *is_enabled = TRUE; - if((fd = HDcreat(filename, mode)) < 0) + if((fd = HDopen(filename, pmode, H5_POSIX_CREATE_MODE_RW)) < 0) goto error; /* Test HDflock() to see if it works */ @@ -2277,7 +2277,7 @@ h5_check_if_file_locking_enabled(hbool_t *are_enabled) * error condition. */ errno = 0; - *are_enabled = FALSE; + *is_enabled = FALSE; } else goto error; @@ -2293,7 +2293,7 @@ h5_check_if_file_locking_enabled(hbool_t *are_enabled) return SUCCEED; error: - *are_enabled = FALSE; + *is_enabled = FALSE; if (fd > -1) { HDclose(fd); HDremove(filename); -- cgit v0.12 From e1a7a1acbecea906951b9351577355cf93b192a8 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 8 Aug 2020 08:44:34 -0500 Subject: Remove redundant calls to set the metadata cache tag --- src/H5Gobj.c | 8 ++++---- src/H5Goh.c | 4 ++-- src/H5Gstab.c | 8 ++++---- src/H5HG.c | 4 ++-- src/H5MF.c | 44 ++++++++++++++++++++++---------------------- src/H5Oattribute.c | 4 ++-- src/H5SM.c | 20 ++++++++++---------- test/mf.c | 8 ++++++++ 8 files changed, 54 insertions(+), 46 deletions(-) diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 1892182..0a139f9 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -380,7 +380,7 @@ H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void H5G_obj_oh_it_ud1_t *udata = (H5G_obj_oh_it_ud1_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(udata->oh_addr) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(lnk); @@ -391,7 +391,7 @@ H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into dense storage") done: - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_obj_compact_to_dense_cb() */ @@ -1040,7 +1040,7 @@ H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, hbool_t use_old_format; /* Whether to use 'old format' (symbol table) for deletion or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(grp_oloc->addr, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(grp_oloc && grp_oloc->file); @@ -1090,7 +1090,7 @@ H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, HGOTO_ERROR(H5E_SYM, H5E_CANTUPDATE, FAIL, "unable to update link info") done: - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_obj_remove() */ diff --git a/src/H5Goh.c b/src/H5Goh.c index f29529b..cba6e80 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -338,7 +338,7 @@ H5O__group_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(oh->cache_info.addr) + FUNC_ENTER_STATIC /* Sanity check */ HDassert(loc); @@ -411,6 +411,6 @@ done: if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__group_bh_info() */ diff --git a/src/H5Gstab.c b/src/H5Gstab.c index e8d38b9..674d84d 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -316,7 +316,7 @@ H5G__stab_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_stab_t stab; /* Symbol table message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(grp_oloc && grp_oloc->file); @@ -331,7 +331,7 @@ H5G__stab_insert(const H5O_loc_t *grp_oloc, const char *name, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "unable to insert the name") done: - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5G__stab_insert() */ @@ -526,7 +526,7 @@ H5G__stab_iterate(const H5O_loc_t *oloc, H5_iter_order_t order, H5G_link_table_t ltable = {0, NULL}; /* Link table */ herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(oloc->addr) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(oloc); @@ -593,7 +593,7 @@ done: if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5G__stab_iterate() */ diff --git a/src/H5HG.c b/src/H5HG.c index f9d780c..8caf551 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -141,7 +141,7 @@ H5HG__create(H5F_t *f, size_t size) size_t n; haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__GLOBALHEAP_TAG) + FUNC_ENTER_STATIC /* Check args */ HDassert(f); @@ -228,7 +228,7 @@ done: } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5HG__create() */ diff --git a/src/H5MF.c b/src/H5MF.c index fac6620..946961d 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -399,7 +399,7 @@ H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type) H5AC_ring_t fsm_ring; /* Ring of FSM */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC /* * Check arguments. @@ -452,7 +452,7 @@ done: if(orig_ring != H5AC_RING_INV) H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__create_fstype() */ @@ -476,7 +476,7 @@ H5MF__start_fstype(H5F_t *f, H5F_mem_page_t type) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -503,7 +503,7 @@ H5MF__start_fstype(H5F_t *f, H5F_mem_page_t type) } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__start_fstype() */ @@ -528,7 +528,7 @@ H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type) haddr_t tmp_fs_addr; /* Temporary holder for free space manager address */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -575,7 +575,7 @@ done: if(orig_ring != H5AC_RING_INV) H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__delete_fstype() */ @@ -597,7 +597,7 @@ H5MF__close_fstype(H5F_t *f, H5F_mem_page_t type) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC /* * Check arguments. @@ -622,7 +622,7 @@ HDfprintf(stderr, "%s: Before closing free space manager\n", FUNC); f->shared->fs_state[type] = H5F_FS_STATE_CLOSED; done: - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__close_fstype() */ @@ -647,7 +647,7 @@ H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_sectio H5F_mem_page_t fs_type; /* Free space type (mapped from allocation type) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_PACKAGE HDassert(f); HDassert(fspace); @@ -680,7 +680,7 @@ done: if(orig_ring != H5AC_RING_INV) H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__add_sect() */ @@ -706,7 +706,7 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, H5MF_free_section_t *node; /* Free space section pointer */ htri_t ret_value = FAIL; /* Whether an existing free list node was found */ - FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_PACKAGE HDassert(f); HDassert(fspace); @@ -765,7 +765,7 @@ done: if(orig_ring != H5AC_RING_INV) H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__find_sect() */ @@ -905,7 +905,7 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) H5MF_free_section_t *node = NULL; /* Free space section pointer */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_type, size); @@ -1013,7 +1013,7 @@ H5MF__sects_dump(f, stderr); if(H5MF__sect_free((H5FS_section_info_t *)node) < 0) HDONE_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, HADDR_UNDEF, "can't free section node") - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__alloc_pagefs() */ @@ -1590,7 +1590,7 @@ H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -1625,7 +1625,7 @@ done: #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* H5MF__close_delete() */ @@ -1759,7 +1759,7 @@ H5MF__close_aggrfs(H5F_t *f) H5FD_mem_t type; /* Memory type for iteration */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -1901,7 +1901,7 @@ done: #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__close_aggrfs() */ @@ -1926,7 +1926,7 @@ H5MF__close_pagefs(H5F_t *f) H5O_fsinfo_t fsinfo; /* File space info message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -2076,7 +2076,7 @@ done: #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__close_pagefs() */ @@ -2105,7 +2105,7 @@ H5MF__close_shrink_eoa(H5F_t *f) H5MF_sect_ud_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -2185,7 +2185,7 @@ done: if(orig_ring != H5AC_RING_INV) H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF__close_shrink_eoa() */ diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index d498be5..75b23dd 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -1699,7 +1699,7 @@ H5O__attr_count_real(H5F_t *f, H5O_t *oh, hsize_t *nattrs) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(f); @@ -1732,7 +1732,7 @@ H5O__attr_count_real(H5F_t *f, H5O_t *oh, hsize_t *nattrs) } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__attr_count_real */ diff --git a/src/H5SM.c b/src/H5SM.c index 6eea80d..066224e 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -640,7 +640,7 @@ H5SM__create_list(H5F_t *f, H5SM_index_header_t *header) haddr_t addr = HADDR_UNDEF; /* Address of the list on disk */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) + FUNC_ENTER_STATIC HDassert(f); HDassert(header); @@ -682,7 +682,7 @@ done: H5MF_xfree(f, H5FD_MEM_SOHM_INDEX, addr, (hsize_t)header->list_size); } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SM__create_list */ @@ -822,7 +822,7 @@ H5SM__convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header) haddr_t btree_addr; herr_t ret_value = SUCCEED; - FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) + FUNC_ENTER_STATIC /* Remember the address of the old B-tree, but change the header over to be * a list.. @@ -855,7 +855,7 @@ done: if(list && H5AC_unprotect(f, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to unprotect SOHM index") - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SM__convert_btree_to_list() */ @@ -1246,7 +1246,7 @@ H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, size_t empty_pos = UFAIL; /* Empty entry in list */ herr_t ret_value = SUCCEED; - FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) + FUNC_ENTER_STATIC /* Sanity check */ HDassert(header); @@ -1509,7 +1509,7 @@ done: if(encoding_buf) encoding_buf = H5MM_xfree(encoding_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SM__write_mesg() */ @@ -1781,7 +1781,7 @@ H5SM__delete_from_index(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, unsigned type_id; /* Message type to operate on */ herr_t ret_value = SUCCEED; - FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); @@ -1946,7 +1946,7 @@ done: *mesg_size = 0; } - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SM__delete_from_index() */ @@ -2387,7 +2387,7 @@ H5SM__read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, H5O_t *oh = NULL; /* Object header for message in object header */ herr_t ret_value = SUCCEED; - FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) + FUNC_ENTER_STATIC HDassert(f); HDassert(mesg); @@ -2461,7 +2461,7 @@ done: if(ret_value < 0 && udata.encoding_buf) udata.encoding_buf = H5MM_xfree(udata.encoding_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SM__read_mesg */ diff --git a/test/mf.c b/test/mf.c index 7cfc954..8e2f75c 100644 --- a/test/mf.c +++ b/test/mf.c @@ -7696,6 +7696,8 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) TEST_ERROR if(fs_persist) { + haddr_t prv_tag = HADDR_UNDEF; + /* Re-open the file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl_new)) < 0) TEST_ERROR @@ -7704,6 +7706,9 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) if(NULL == (f = (H5F_t *)H5VL_object(fid))) TEST_ERROR + /* Set the freespace tag for the metadata cache */ + H5AC_tag(H5AC__FREESPACE_TAG, &prv_tag); \ + /* Verify that the large generic manager is there */ H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); if(!H5F_addr_defined(f->shared->fs_addr[fs_type])) @@ -7754,6 +7759,9 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) if(found_addr != gaddr1) TEST_ERROR + /* Reset the previous tag */ + H5AC_tag(prv_tag, NULL); \ + /* Close file */ if(H5Fclose(fid) < 0) TEST_ERROR -- cgit v0.12 From f863d4f970c2f54298a69f95bb6a15e710e1ed75 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sun, 9 Aug 2020 18:13:42 -0500 Subject: Addition to HDFFV-10591 Description Added missing parameter description and improved format. Platforms tested: Linux/64 (jelly) --- src/H5Oattr.c | 29 ++++++++++++++++------------- src/H5Odtype.c | 7 +++++-- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/H5Oattr.c b/src/H5Oattr.c index e38ef5c..6123949 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -108,8 +108,11 @@ H5FL_EXTERN(H5S_extent_t); with the decoded information USAGE void *H5O_attr_decode(f, mesg_flags, p) - H5F_t *f; IN: pointer to the HDF5 file struct - unsigned mesg_flags; IN: Message flags to influence decoding + H5F_t *f; IN: pointer to the HDF5 file struct + H5O_t *open_oh; IN: pointer to the object header + unsigned mesg_flags; IN: message flags to influence decoding + unsigned *ioflags; IN/OUT: flags for decoding + size_t p_size; IN: size of buffer *p const uint8_t *p; IN: the raw information buffer RETURNS Pointer to the new message in native order on success, NULL on failure @@ -120,16 +123,16 @@ H5FL_EXTERN(H5S_extent_t); --------------------------------------------------------------------------*/ static void * H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, - unsigned *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) + unsigned *ioflags, size_t p_size, const uint8_t *p) { - H5A_t *attr = NULL; - H5S_extent_t *extent; /*extent dimensionality information */ - size_t name_len; /*attribute name length */ - size_t dt_size; /* Datatype size */ - hssize_t sds_size; /* Signed Dataspace size */ - hsize_t ds_size; /* Dataspace size */ - unsigned flags = 0; /* Attribute flags */ - H5A_t *ret_value = NULL; /* Return value */ + H5A_t *attr = NULL; + H5S_extent_t *extent; /*extent dimensionality information */ + size_t name_len; /*attribute name length */ + size_t dt_size; /* Datatype size */ + hssize_t sds_size; /* Signed Dataspace size */ + hsize_t ds_size; /* Dataspace size */ + unsigned flags = 0; /* Attribute flags */ + H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -138,7 +141,7 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, HDassert(p); if(NULL == (attr = H5FL_CALLOC(H5A_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") if(NULL == (attr->shared = H5FL_CALLOC(H5A_shared_t))) HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate shared attr structure") @@ -146,7 +149,7 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, /* Version number */ attr->shared->version = *p++; if(attr->shared->version < H5O_ATTR_VERSION_1 || attr->shared->version > H5O_ATTR_VERSION_LATEST) - HGOTO_ERROR(H5E_ATTR, H5E_CANTLOAD, NULL, "bad version number for attribute message") + HGOTO_ERROR(H5E_ATTR, H5E_CANTLOAD, NULL, "bad version number for attribute message") /* Get the flags byte if we have a later version of the attribute */ if(attr->shared->version >= H5O_ATTR_VERSION_2) { diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 6eaaae9..92a8ee3 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -1094,9 +1094,12 @@ done: with the decoded information USAGE void *H5O_dtype_decode(f, mesg_flags, p) - H5F_t *f; IN: pointer to the HDF5 file struct + H5F_t *f; IN: pointer to the HDF5 file struct + H5O_t *open_oh; IN: pointer to the object header unsigned mesg_flags; IN: Message flags to influence decoding - const uint8 *p; IN: the raw information buffer + unsigned *ioflags; IN/OUT: flags for decoding + size_t p_size; IN: size of buffer *p + const uint8_t *p; IN: the raw information buffer RETURNS Pointer to the new message in native order on success, NULL on failure DESCRIPTION -- cgit v0.12 From 79a2e34f88af7c7290401607f1dd1fed822dc414 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 10 Aug 2020 12:58:20 -0500 Subject: Correct typos w/HGOTO_DONE & HGOTO_ERROR --- src/H5FDros3.c | 40 ++++++++++++++++++++-------------------- src/H5FDs3comms.c | 30 +++++++++++++++--------------- src/H5HLcache.c | 6 +++--- src/H5I.c | 6 ++---- src/H5Odtype.c | 10 +++++----- src/H5Ostab.c | 2 +- src/H5Tenum.c | 3 +-- 7 files changed, 47 insertions(+), 50 deletions(-) diff --git a/src/H5FDros3.c b/src/H5FDros3.c index 38e34a0..c024716 100644 --- a/src/H5FDros3.c +++ b/src/H5FDros3.c @@ -1202,71 +1202,71 @@ H5FD__ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2) /* URL: SCHEME */ if(HDstrcmp(purl1->scheme, purl2->scheme)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) /* URL: HOST */ if(HDstrcmp(purl1->host, purl2->host)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) /* URL: PORT */ if(purl1->port && purl2->port) { if(HDstrcmp(purl1->port, purl2->port)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) } else if(purl1->port) - HGOTO_DONE(-1); + HGOTO_DONE(-1) else if(purl2->port) - HGOTO_DONE(-1); + HGOTO_DONE(-1) /* URL: PATH */ if(purl1->path && purl2->path) { if(HDstrcmp(purl1->path, purl2->path)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) } else if(purl1->path && !purl2->path) - HGOTO_DONE(-1); + HGOTO_DONE(-1) else if(purl2->path && !purl1->path) - HGOTO_DONE(-1); + HGOTO_DONE(-1) /* URL: QUERY */ if(purl1->query && purl2->query) { if(HDstrcmp(purl1->query, purl2->query)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) } else if(purl1->query && !purl2->query) - HGOTO_DONE(-1); + HGOTO_DONE(-1) else if(purl2->query && !purl1->query) - HGOTO_DONE(-1); + HGOTO_DONE(-1) /* FAPL: AWS_REGION */ if(f1->fa.aws_region[0] != '\0' && f2->fa.aws_region[0] != '\0') { if(HDstrcmp(f1->fa.aws_region, f2->fa.aws_region)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) } else if(f1->fa.aws_region[0] != '\0') - HGOTO_DONE(-1); + HGOTO_DONE(-1) else if(f2->fa.aws_region[0] != '\0') - HGOTO_DONE(-1); + HGOTO_DONE(-1) /* FAPL: SECRET_ID */ if(f1->fa.secret_id[0] != '\0' && f2->fa.secret_id[0] != '\0') { if(HDstrcmp(f1->fa.secret_id, f2->fa.secret_id)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) } else if(f1->fa.secret_id[0] != '\0') - HGOTO_DONE(-1); + HGOTO_DONE(-1) else if(f2->fa.secret_id[0] != '\0') - HGOTO_DONE(-1); + HGOTO_DONE(-1) /* FAPL: SECRET_KEY */ if(f1->fa.secret_key[0] != '\0' && f2->fa.secret_key[0] != '\0') { if(HDstrcmp(f1->fa.secret_key, f2->fa.secret_key)) - HGOTO_DONE(-1); + HGOTO_DONE(-1) } else if(f1->fa.secret_key[0] != '\0') - HGOTO_DONE(-1); + HGOTO_DONE(-1) else if(f2->fa.secret_key[0] != '\0') - HGOTO_DONE(-1); + HGOTO_DONE(-1) done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c index e79ee0d..4c762d1 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -311,7 +311,7 @@ H5FD_s3comms_hrb_node_set( if(*L == NULL) { if(value == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove node from empty list"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove node from empty list") else { #if S3COMMS_DEBUG HDprintf("CREATE NEW\n"); HDfflush(stdout); @@ -414,7 +414,7 @@ HDprintf("MODIFY HEAD\n"); HDfflush(stdout); is_looking = FALSE; if(value == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove a node 'before' head"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove a node 'before' head") else { #if S3COMMS_DEBUG HDprintf("PREPEND NEW HEAD\n"); HDfflush(stdout); @@ -442,7 +442,7 @@ HDprintf("PREPEND NEW HEAD\n"); HDfflush(stdout); is_looking = FALSE; if(value == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node") else { #if S3COMMS_DEBUG HDprintf("APPEND A NODE\n"); HDfflush(stdout); @@ -465,7 +465,7 @@ HDprintf("APPEND A NODE\n"); HDfflush(stdout); is_looking = FALSE; if(value == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node") else { #if S3COMMS_DEBUG HDprintf("INSERT A NODE\n"); HDfflush(stdout); @@ -944,9 +944,9 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem in reading during getsize."); if(sds.size > CURL_MAX_HTTP_HEADER) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HTTP metadata buffer overrun"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HTTP metadata buffer overrun") else if (sds.size == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "No HTTP metadata"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "No HTTP metadata") #if S3COMMS_DEBUG else HDfprintf(stderr, "GETSIZE: OK\n"); @@ -2305,7 +2305,7 @@ H5FD_s3comms_parse_url( purl->scheme = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); if(purl->scheme == NULL) HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for SCHEME"); - (void)HDstrncpy(purl->scheme, curstr, (size_t)len); + HDstrncpy(purl->scheme, curstr, (size_t)len); purl->scheme[len] = '\0'; for(i = 0; i < len; i++ ) purl->scheme[i] = (char)HDtolower(purl->scheme[i]); @@ -2337,7 +2337,7 @@ H5FD_s3comms_parse_url( } /* end else (IPv4) */ len = tmpstr - curstr; if(len == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HOST substring cannot be empty"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HOST substring cannot be empty") else if(len > urllen) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of HOST substring"); @@ -2345,7 +2345,7 @@ H5FD_s3comms_parse_url( purl->host = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); if(purl->host == NULL) HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for HOST"); - (void)HDstrncpy(purl->host, curstr, (size_t)len); + HDstrncpy(purl->host, curstr, (size_t)len); purl->host[len] = 0; /************* @@ -2359,7 +2359,7 @@ H5FD_s3comms_parse_url( tmpstr++; len = tmpstr - curstr; if(len == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT element cannot be empty"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT element cannot be empty") else if(len > urllen) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of PORT substring"); for(i = 0; i < len; i ++) @@ -2370,7 +2370,7 @@ H5FD_s3comms_parse_url( purl->port = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); if(purl->port == NULL) HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PORT"); - (void)HDstrncpy(purl->port, curstr, (size_t)len); + HDstrncpy(purl->port, curstr, (size_t)len); purl->port[len] = 0; } /* end if PORT element */ @@ -2392,8 +2392,8 @@ H5FD_s3comms_parse_url( if(len > 0) { purl->path = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); if(purl->path == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PATH"); - (void)HDstrncpy(purl->path, curstr, (size_t)len); + HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PATH"); + HDstrncpy(purl->path, curstr, (size_t)len); purl->path[len] = 0; } } /* end if PATH element */ @@ -2409,13 +2409,13 @@ H5FD_s3comms_parse_url( tmpstr++; len = tmpstr - curstr; if(len == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "QUERY cannot be empty"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "QUERY cannot be empty") else if(len > urllen) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of QUERY substring"); purl->query = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1)); if(purl->query == NULL) HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for QUERY"); - (void)HDstrncpy(purl->query, curstr, (size_t)len); + HDstrncpy(purl->query, curstr, (size_t)len); purl->query[len] = 0; } /* end if QUERY exists */ diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 38cf060..006ddc0 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -486,11 +486,11 @@ done: if(!ret_value) { if(prfx) { if(FAIL == H5HL__prfx_dest(prfx)) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap prefix"); + HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap prefix"); } /* end if */ else { if(heap && FAIL == H5HL__dest(heap)) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap"); + HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap"); } /* end else */ } /* end if */ @@ -771,7 +771,7 @@ done: /* Release the [possibly partially initialized] local heap on errors */ if(!ret_value && dblk) if(FAIL == H5HL__dblk_dest(dblk)) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap data block"); + HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap data block"); FUNC_LEAVE_NOAPI(ret_value) } /* end H5HL__cache_datablock_deserialize() */ diff --git a/src/H5I.c b/src/H5I.c index a739c4e..c1d966c 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -1124,9 +1124,8 @@ H5I_is_file_object(hid_t id) /* Return TRUE if the ID is a file object (dataset, group, map, or committed * datatype), FALSE otherwise. */ - if (H5I_DATASET == id_type || H5I_GROUP == id_type || H5I_MAP == id_type) { + if (H5I_DATASET == id_type || H5I_GROUP == id_type || H5I_MAP == id_type) ret_value = TRUE; - } else if (H5I_DATATYPE == id_type) { H5T_t *dt = NULL; @@ -1136,9 +1135,8 @@ H5I_is_file_object(hid_t id) ret_value = H5T_is_named(dt); } - else { + else ret_value = FALSE; - } done: FUNC_LEAVE_NOAPI(ret_value); diff --git a/src/H5Odtype.c b/src/H5Odtype.c index cbadfd0..3ad53a4 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -439,15 +439,15 @@ H5O__dtype_decode_helper(unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t /* Set reference type */ dt->shared->u.atomic.u.r.rtype = (H5R_type_t)(flags & 0x0f); if(dt->shared->u.atomic.u.r.rtype <= H5R_BADTYPE - || dt->shared->u.atomic.u.r.rtype >= H5R_MAXTYPE) + || dt->shared->u.atomic.u.r.rtype >= H5R_MAXTYPE) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "invalid reference type"); /* Set generic flag */ if(dt->shared->u.atomic.u.r.rtype == H5R_OBJECT2 - || dt->shared->u.atomic.u.r.rtype == H5R_DATASET_REGION2 - || dt->shared->u.atomic.u.r.rtype == H5R_ATTR) { - dt->shared->u.atomic.u.r.opaque = TRUE; - dt->shared->u.atomic.u.r.version = (unsigned)((flags >> 4) & 0x0f); + || dt->shared->u.atomic.u.r.rtype == H5R_DATASET_REGION2 + || dt->shared->u.atomic.u.r.rtype == H5R_ATTR) { + dt->shared->u.atomic.u.r.opaque = TRUE; + dt->shared->u.atomic.u.r.version = (unsigned)((flags >> 4) & 0x0f); if(dt->shared->u.atomic.u.r.version != H5R_ENCODE_VERSION) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "reference version does not match"); } else diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 10501a0..18f32b3 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -185,7 +185,7 @@ H5O__stab_copy(const void *_mesg, void *_dest) /* check args */ HDassert(stab); if(!dest && NULL == (dest = H5FL_MALLOC(H5O_stab_t))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); /* copy */ *dest = *stab; diff --git a/src/H5Tenum.c b/src/H5Tenum.c index ffdab5b..cd41a23 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -414,8 +414,7 @@ H5T__enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t s /* Save result name */ if(!name) { - if(NULL == (name = (char *)H5MM_malloc( - HDstrlen(copied_dt->shared->u.enumer.name[md]) + 1))) + if(NULL == (name = (char *)H5MM_malloc(HDstrlen(copied_dt->shared->u.enumer.name[md]) + 1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); alloc_name = TRUE; } /* end if */ -- cgit v0.12 From 78c6be05a84f854074a4df2e10c15a56444e4015 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 11 Aug 2020 17:46:54 -0700 Subject: Fixes the splitter VFD test on Windows. --- test/h5test.c | 10 +++++----- test/vfd.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/h5test.c b/test/h5test.c index 255932a..817e98c 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -2067,13 +2067,13 @@ h5_compare_file_bytes(char *f1name, char *f2name) int ret_value = 0; /* for error handling */ /* Open files for reading */ - f1ptr = HDfopen(f1name, "r"); + f1ptr = HDfopen(f1name, "rb"); if (f1ptr == NULL) { HDfprintf(stderr, "Unable to fopen() %s\n", f1name); ret_value = -1; goto done; } - f2ptr = HDfopen(f2name, "r"); + f2ptr = HDfopen(f2name, "rb"); if (f2ptr == NULL) { HDfprintf(stderr, "Unable to fopen() %s\n", f2name); ret_value = -1; @@ -2200,7 +2200,7 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest) max_buf = 4096 * sizeof(char); - orig_ptr = HDfopen(orig, "r"); + orig_ptr = HDfopen(orig, "rb"); if (NULL == orig_ptr) { ret_value = -1; goto done; @@ -2210,7 +2210,7 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest) fsize = (hsize_t)HDftell(orig_ptr); HDrewind(orig_ptr); - dest_ptr = HDfopen(dest, "w"); + dest_ptr = HDfopen(dest, "wb"); if (NULL == dest_ptr) { ret_value = -1; goto done; @@ -2224,7 +2224,7 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest) } while (read_size > 0) { - if(HDfread(dup_buf, read_size, 1, orig_ptr) != 1) { + if (HDfread(dup_buf, read_size, 1, orig_ptr) != 1) { ret_value = -1; goto done; } diff --git a/test/vfd.c b/test/vfd.c index f1443c5..d849d96 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -2453,7 +2453,7 @@ run_splitter_test(const struct splitter_dataset_def *data, SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n"); } - /* Verify existence of logfile iff appropriate */ + /* Verify existence of logfile if appropriate */ logfile = fopen(vfd_config->log_file_path, "r"); if ( (TRUE == provide_logfile_path && NULL == logfile) || (FALSE == provide_logfile_path && NULL != logfile) ) -- cgit v0.12 From 768f8abb18a0b7d7233cfc1ea3da32efe83f56f1 Mon Sep 17 00:00:00 2001 From: Elena Date: Wed, 12 Aug 2020 08:40:11 -0500 Subject: The H5DSis_scale function was updated to return "not a dimension scale" (0) instead of failing (-1), when CLASS or DIMENSION_SCALE attributes are not written according to Dimension Scales Specification (HDFFV-10436). --- hl/src/H5DS.c | 89 ++++++++++++++++++++++++++---------------------- release_docs/RELEASE.txt | 8 +++-- 2 files changed, 55 insertions(+), 42 deletions(-) diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 12bcc93..31cbe13 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -1896,30 +1896,32 @@ out: } /*------------------------------------------------------------------------- - * Function: H5DSis_scale - * - * Purpose: check if the dataset DID is a dimension scale - * - * Return: 1, is, 0, not, FAIL, error - * - * Programmer: Pedro Vicente - * - * Date: January 04, 2005 - * - *------------------------------------------------------------------------- - */ -htri_t -H5DSis_scale(hid_t did) +* Function: H5DSis_scale +* +* Purpose: check if the dataset DID is a dimension scale +* +* Return: 1, is, 0, not, FAIL, error +* +* Programmer: pvn@ncsa.uiuc.edu +* +* Date: January 04, 2005 +* +*------------------------------------------------------------------------- +*/ + +htri_t H5DSis_scale(hid_t did) { - hid_t tid = -1; /* attribute type ID */ - hid_t aid = -1; /* attribute ID */ - herr_t has_class; /* has the "CLASS" attribute */ - htri_t is_ds; /* boolean return value */ - H5I_type_t it; /* ID type */ - char *buf; /* Name of attribute */ - hsize_t storage_size; /* Size of storage for attribute */ - - /*------------------------------------------------------------------------- + hid_t tid = -1; /* attribute type ID */ + hid_t aid = -1; /* attribute ID */ + herr_t attr_class; /* has the "CLASS" attribute */ + htri_t is_ds = 0; /* set to "not a dimension scale" */ + H5I_type_t it; /* type of identofier */ + char *buf; /* buffer to read a name of attribute */ + size_t string_size; /* Size of storage for the attribute */ + H5T_class_t type_class; + H5T_str_t strpad; + + /*------------------------------------------------------------------------ * parameter checking *------------------------------------------------------------------------- */ @@ -1931,11 +1933,11 @@ H5DSis_scale(hid_t did) return FAIL; /* try to find the attribute "CLASS" on the dataset */ - if((has_class = H5LT_find_attribute(did, "CLASS")) < 0) + if((attr_class = H5LT_find_attribute(did, "CLASS")) < 0) return FAIL; - if(has_class == 0) - is_ds = 0; + if(attr_class == 0) + return is_ds; else { @@ -1945,19 +1947,27 @@ H5DSis_scale(hid_t did) if((tid = H5Aget_type(aid)) < 0) goto out; - /* check to make sure attribute is a string */ - if(H5T_STRING != H5Tget_class(tid)) + /* check to make sure attribute is a string; + if not, then it is not dimension scale */ + if((type_class = H5Tget_class(tid)) < 0) goto out; + if(H5T_STRING != type_class) + goto out_success; - /* check to make sure string is null-terminated */ - if(H5T_STR_NULLTERM != H5Tget_strpad(tid)) + /* check to make sure string is null-terminated; + if not, then it is not dimension scale */ + if((strpad = H5Tget_strpad(tid)) < 0 ) goto out; + if(H5T_STR_NULLTERM != strpad) + goto out_success; - /* allocate buffer large enough to hold string */ - if((storage_size = H5Aget_storage_size(aid)) == 0) - goto out; + /* get string size should be 16 to hold "DIMENSION_SCALE" string */ + if((string_size = H5Tget_size(tid)) == 0) + return FAIL; + if(string_size != 16) + goto out_success; - buf = (char*)HDmalloc( (size_t)storage_size * sizeof(char) + 1); + buf = (char*)HDmalloc((size_t)string_size * sizeof(char)); if(buf == NULL) goto out; @@ -1966,10 +1976,9 @@ H5DSis_scale(hid_t did) goto out; /* compare strings */ - if(HDstrncmp(buf, DIMENSION_SCALE_CLASS, MIN(HDstrlen(DIMENSION_SCALE_CLASS),HDstrlen(buf)))==0) + if(HDstrncmp(buf, DIMENSION_SCALE_CLASS, + MIN(HDstrlen(DIMENSION_SCALE_CLASS),HDstrlen(buf)))==0) is_ds = 1; - else - is_ds = 0; HDfree(buf); @@ -1979,11 +1988,11 @@ H5DSis_scale(hid_t did) if (H5Aclose(aid) < 0) goto out; + goto out_success; } - - return is_ds; - +out_success: + return is_ds; /* error zone */ out: H5E_BEGIN_TRY { diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7ccdbe9..5720c17 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -742,7 +742,7 @@ New Features High-Level APIs: --------------- - - + - C Packet Table API ------------------ @@ -1203,7 +1203,11 @@ Bug Fixes since HDF5-1.10.3 release High-Level APIs: ------ - - + - The H5DSis_scale function was updated to return "not a dimension scale" (0) + instead of failing (-1), when CLASS or DIMENSION_SCALE attributes are + not written according to Dimension Scales Specification. + + (EIP - 2020/08/12, HDFFV-10436) Fortran High-Level APIs: ------ -- cgit v0.12 From ed51c0e302e1d422dcdd730448a8e9e06326985a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 12 Aug 2020 09:52:10 -0700 Subject: Fixes memory leads in trefer.c --- test/trefer.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/test/trefer.c b/test/trefer.c index b90ec45..8ce75e9 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -1135,11 +1135,11 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) hsize_t *coords; /* Coordinate buffer */ hsize_t low[SPACE2_RANK]; /* Selection bounds */ hsize_t high[SPACE2_RANK]; /* Selection bounds */ - H5R_ref_t *wbuf, /* buffer to write to disk */ - *rbuf; /* buffer read from disk */ + H5R_ref_t *wbuf = NULL, /* buffer to write to disk */ + *rbuf = NULL; /* buffer read from disk */ H5R_ref_t nvrbuf[3]={{{{0}}},{{{101}}},{{{255}}}}; /* buffer with non-valid refs */ - uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ - *drbuf; /* Buffer for reading numeric data from disk */ + uint8_t *dwbuf = NULL, /* Buffer for writing numeric data to disk */ + *drbuf = NULL; /* Buffer for reading numeric data from disk */ uint8_t *tu8; /* Temporary pointer to uint8 data */ H5O_type_t obj_type; /* Type of object */ int i, j; /* Counters */ @@ -1537,13 +1537,14 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) CHECK(ret, FAIL, "H5Rdestroy"); } - /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); - } + + /* Free memory buffers */ + HDfree(wbuf); + HDfree(rbuf); + HDfree(dwbuf); + HDfree(drbuf); + } /* test_reference_region() */ /**************************************************************** @@ -1576,10 +1577,10 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) hsize_t *coords; /* Coordinate buffer */ hsize_t low[SPACE3_RANK]; /* Selection bounds */ hsize_t high[SPACE3_RANK]; /* Selection bounds */ - H5R_ref_t *wbuf, /* buffer to write to disk */ - *rbuf; /* buffer read from disk */ - uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ - *drbuf; /* Buffer for reading numeric data from disk */ + H5R_ref_t *wbuf = NULL, /* buffer to write to disk */ + *rbuf = NULL; /* buffer read from disk */ + uint8_t *dwbuf = NULL, /* Buffer for writing numeric data to disk */ + *drbuf = NULL; /* Buffer for reading numeric data from disk */ uint8_t *tu8; /* Temporary pointer to uint8 data */ H5O_type_t obj_type; /* Object type */ int i; /* Counter */ @@ -1876,13 +1877,14 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) CHECK(ret, FAIL, "H5Rdestroy"); } - /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); - } + + /* Free memory buffers */ + HDfree(wbuf); + HDfree(rbuf); + HDfree(dwbuf); + HDfree(drbuf); + } /* test_reference_region_1D() */ /**************************************************************** -- cgit v0.12 From 4f0283db788fc1a0db94e7825567210021b3b594 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 12 Aug 2020 11:38:04 -0700 Subject: Fixes a size mismatch when copying old-style to new-style references --- src/H5Rint.c | 2 +- src/H5Tconv.c | 2 +- test/trefer.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/H5Rint.c b/src/H5Rint.c index 0acc887..ae72b47 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -822,7 +822,7 @@ H5R__set_obj_token(H5R_ref_priv_t *ref, const H5O_token_t *obj_token, HDassert(token_size); HDassert(token_size <= H5O_MAX_TOKEN_SIZE); - H5MM_memcpy(&ref->info.obj.token, obj_token, sizeof(H5O_token_t)); + H5MM_memcpy(&ref->info.obj.token, obj_token, token_size); HDassert(token_size <= 255); ref->token_size = (uint8_t)token_size; diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 15658cc..8bf36f0 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -3641,7 +3641,7 @@ H5T__conv_ref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(0 == (buf_size = src->shared->u.atomic.u.r.cls->getsize( src->shared->u.atomic.u.r.file, s, src->shared->size, dst->shared->u.atomic.u.r.file, &dst_copy))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "incorrect size") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unable to obtain size of reference") /* Check if conversion buffer is large enough, resize if necessary. */ if(conv_buf_size < buf_size) { diff --git a/test/trefer.c b/test/trefer.c index 8ce75e9..4bf5c17 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -2720,10 +2720,10 @@ test_reference_compat_conv(void) hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hobj_ref_t *wbuf_obj; /* Buffer to write to disk */ - H5R_ref_t *rbuf_obj; /* Buffer read from disk */ - hdset_reg_ref_t *wbuf_reg; /* Buffer to write to disk */ - H5R_ref_t *rbuf_reg; /* Buffer read from disk */ + hobj_ref_t *wbuf_obj = NULL; /* Buffer to write to disk */ + H5R_ref_t *rbuf_obj = NULL; /* Buffer read from disk */ + hdset_reg_ref_t *wbuf_reg = NULL; /* Buffer to write to disk */ + H5R_ref_t *rbuf_reg = NULL; /* Buffer read from disk */ H5O_type_t obj_type; /* Object type */ herr_t ret; /* Generic return value */ unsigned int i; /* Counter */ -- cgit v0.12 From 752411bfda95b6a143708994554a56cc8a5345c0 Mon Sep 17 00:00:00 2001 From: Elena Date: Wed, 12 Aug 2020 15:19:41 -0500 Subject: Fixed several typos in the comments found by Larry during the review. --- hl/src/H5DS.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 31cbe13..c129e43 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -1915,9 +1915,9 @@ htri_t H5DSis_scale(hid_t did) hid_t aid = -1; /* attribute ID */ herr_t attr_class; /* has the "CLASS" attribute */ htri_t is_ds = 0; /* set to "not a dimension scale" */ - H5I_type_t it; /* type of identofier */ - char *buf; /* buffer to read a name of attribute */ - size_t string_size; /* Size of storage for the attribute */ + H5I_type_t it; /* type of identifier */ + char *buf; /* buffer to read name of attribute */ + size_t string_size; /* size of storage for the attribute */ H5T_class_t type_class; H5T_str_t strpad; -- cgit v0.12 From cecaed97f7987266d74dff90448d02c586d14052 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 12 Aug 2020 16:14:44 -0500 Subject: HDFFV-11127 - force RTLD_LOCAL in dlopen --- release_docs/RELEASE.txt | 15 ++++++++++++--- src/H5PLpkg.h | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7ccdbe9..2217b5a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -349,9 +349,9 @@ New Features added to the libhdf5.settings file. Autotools: - + An --enable-file-locking=(yes|no|best-effort) option has been added. - + yes: Use file locking. no: Do not use file locking. best-effort: Use file locking and ignore "disabled" errors. @@ -765,6 +765,15 @@ Bug Fixes since HDF5-1.10.3 release Library ------- + - Explicitly declared dlopen to use RTLD_LOCAL + + dlopen documentation states that f neither RTLD_GLOBAL nor + RTLD_LOCAL are specified, then the default behavior is unspecified. + The default on linux is usually RTLD_LOCAL while macos will default + to RTLD_GLOBAL. + + (ADB - 2020/08/12, HDFFV-11127) + - Fixed issues CVE-2018-13870 and CVE-2018-13869 When a buffer overflow occurred because a name length was corrupted @@ -774,7 +783,7 @@ Bug Fixes since HDF5-1.10.3 release locations to prevent the crashes and h5dump now simply fails with an error message when this error condition occurs. - (BMR - 2020/7/22, HDFFV-11120 and HDFFV-11121) + (BMR - 2020/07/22, HDFFV-11120 and HDFFV-11121) - Fixed the segmentation fault when reading attributes with multiple threads diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h index 8c2367f..a086a2c 100644 --- a/src/H5PLpkg.h +++ b/src/H5PLpkg.h @@ -95,7 +95,7 @@ # define H5PL_HANDLE void * /* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */ -# define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY) +# define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY | RTLD_LOCAL) /* Get the address of a symbol in dynamic library */ # define H5PL_GET_LIB_FUNC(H,N) dlsym(H,N) -- cgit v0.12 From 037bad4f7220b88de5ff3b74c205ea1d790290d5 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 12 Aug 2020 15:07:15 -0700 Subject: Fixes Windows issues due to exposed pthread code --- test/ttsafe_attr_vlen.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/ttsafe_attr_vlen.c b/test/ttsafe_attr_vlen.c index b07e362..2b94167 100644 --- a/test/ttsafe_attr_vlen.c +++ b/test/ttsafe_attr_vlen.c @@ -54,7 +54,7 @@ void *tts_attr_vlen_thread(void *); void tts_attr_vlen(void) { - pthread_t threads[NUM_THREADS] = {0}; /* Thread declaration */ + H5TS_thread_t threads[NUM_THREADS] = {0}; /* Thread declaration */ hid_t fid = H5I_INVALID_HID; /* File ID */ hid_t gid = H5I_INVALID_HID; /* Group ID */ hid_t atid = H5I_INVALID_HID; /* Datatype ID for attribute */ @@ -106,12 +106,15 @@ tts_attr_vlen(void) CHECK(ret, H5I_INVALID_HID, "H5Tclose"); /* Start multiple threads and execute tts_attr_vlen_thread() for each thread */ - for(i = 0; i < NUM_THREADS; i++) - pthread_create(&threads[i], NULL, tts_attr_vlen_thread, NULL); + for(i = 0; i < NUM_THREADS; i++) { + threads[i] = H5TS_create_thread(tts_attr_vlen_thread, NULL, NULL); + } + //pthread_create(&threads[i], NULL, tts_attr_vlen_thread, NULL); /* Wait for the threads to end */ for(i = 0; i < NUM_THREADS; i++) - pthread_join(threads[i], NULL); + H5TS_wait_for_thread(threads[i]); + //pthread_join(threads[i], NULL); } /* end tts_attr_vlen() */ -- cgit v0.12 From 04b24163f7f08248a58d256371e088c8cc7816c8 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 12 Aug 2020 15:21:38 -0700 Subject: Cleans warnings and cruft from ttsafe_attr_vlen.c --- test/ttsafe_attr_vlen.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/test/ttsafe_attr_vlen.c b/test/ttsafe_attr_vlen.c index 2b94167..43a5e9a 100644 --- a/test/ttsafe_attr_vlen.c +++ b/test/ttsafe_attr_vlen.c @@ -60,7 +60,7 @@ tts_attr_vlen(void) hid_t atid = H5I_INVALID_HID; /* Datatype ID for attribute */ hid_t asid = H5I_INVALID_HID; /* Dataspace ID for attribute */ hid_t aid = H5I_INVALID_HID; /* The attribute ID */ - char *string_attr = "2.0"; /* The attribute data */ + const char *string_attr = "2.0"; /* The attribute data */ int ret; /* Return value */ int i; /* Local index variable */ @@ -109,26 +109,24 @@ tts_attr_vlen(void) for(i = 0; i < NUM_THREADS; i++) { threads[i] = H5TS_create_thread(tts_attr_vlen_thread, NULL, NULL); } - //pthread_create(&threads[i], NULL, tts_attr_vlen_thread, NULL); /* Wait for the threads to end */ for(i = 0; i < NUM_THREADS; i++) H5TS_wait_for_thread(threads[i]); - //pthread_join(threads[i], NULL); } /* end tts_attr_vlen() */ /* Start execution for each thread */ void * -tts_attr_vlen_thread(void *client_data) +tts_attr_vlen_thread(void H5_ATTR_UNUSED *client_data) { - hid_t fid = H5I_INVALID_HID; /* File ID */ - hid_t gid = H5I_INVALID_HID; /* Group ID */ - hid_t aid = H5I_INVALID_HID; /* Attribute ID */ - hid_t atid = H5I_INVALID_HID; /* Datatype ID for the attribute */ - char *string_attr_check; /* The attribute data being read */ - char *string_attr = "2.0"; /* The expected attribute data */ - herr_t ret; /* Return value */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t gid = H5I_INVALID_HID; /* Group ID */ + hid_t aid = H5I_INVALID_HID; /* Attribute ID */ + hid_t atid = H5I_INVALID_HID; /* Datatype ID for the attribute */ + char *string_attr_check; /* The attribute data being read */ + const char *string_attr = "2.0"; /* The expected attribute data */ + herr_t ret; /* Return value */ /* Open the test file */ fid = H5Fopen(FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT); -- cgit v0.12 From 747fde00fef0280352f596c8c35e7a49fe38f83f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 13 Aug 2020 06:22:50 -0500 Subject: spelling --- release_docs/RELEASE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 2217b5a..07c61e5 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -767,7 +767,7 @@ Bug Fixes since HDF5-1.10.3 release ------- - Explicitly declared dlopen to use RTLD_LOCAL - dlopen documentation states that f neither RTLD_GLOBAL nor + dlopen documentation states that if neither RTLD_GLOBAL nor RTLD_LOCAL are specified, then the default behavior is unspecified. The default on linux is usually RTLD_LOCAL while macos will default to RTLD_GLOBAL. -- cgit v0.12 From b806f3e9acad6261438dacecbb11a87bcd644e72 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 13 Aug 2020 10:13:18 -0700 Subject: Tweak to hide unused threadsafe callback in non-threadsafe builds --- test/thread_id.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/thread_id.c b/test/thread_id.c index 24aef80..0c804ed 100644 --- a/test/thread_id.c +++ b/test/thread_id.c @@ -25,6 +25,8 @@ */ #include "testhdf5.h" +#if defined(H5_HAVE_THREADSAFE) && !defined(H5_HAVE_WIN_THREADS) + static void my_errx(int, const char *, ...) H5_ATTR_FORMAT(printf, 2, 3); static void @@ -40,8 +42,6 @@ my_errx(int code, const char *fmt, ...) HDexit(code); } -#if defined(H5_HAVE_THREADSAFE) && !defined(H5_HAVE_WIN_THREADS) - #if defined(H5_HAVE_DARWIN) typedef struct _pthread_barrierattr { -- cgit v0.12 From c6248cfb6975a6ecadf0259390247ce05dc13c4b Mon Sep 17 00:00:00 2001 From: Elena Date: Thu, 13 Aug 2020 19:33:51 -0500 Subject: Addresseda Dana's comments from the pull request. --- hl/src/H5DS.c | 61 +++++++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index c129e43..bd4c196 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -1914,9 +1914,9 @@ htri_t H5DSis_scale(hid_t did) hid_t tid = -1; /* attribute type ID */ hid_t aid = -1; /* attribute ID */ herr_t attr_class; /* has the "CLASS" attribute */ - htri_t is_ds = 0; /* set to "not a dimension scale" */ + htri_t is_ds = -1; /* set to "not a dimension scale" */ H5I_type_t it; /* type of identifier */ - char *buf; /* buffer to read name of attribute */ + char *buf = NULL; /* buffer to read name of attribute */ size_t string_size; /* size of storage for the attribute */ H5T_class_t type_class; H5T_str_t strpad; @@ -1927,18 +1927,19 @@ htri_t H5DSis_scale(hid_t did) */ /* get ID type */ if ((it = H5Iget_type(did)) < 0) - return FAIL; + goto out; if(H5I_DATASET != it) - return FAIL; + goto out; /* try to find the attribute "CLASS" on the dataset */ if((attr_class = H5LT_find_attribute(did, "CLASS")) < 0) - return FAIL; - - if(attr_class == 0) - return is_ds; + goto out; + if(attr_class == 0) { + is_ds = 0; + goto out; + } else { if((aid = H5Aopen(did, "CLASS", H5P_DEFAULT)) < 0) @@ -1951,21 +1952,27 @@ htri_t H5DSis_scale(hid_t did) if not, then it is not dimension scale */ if((type_class = H5Tget_class(tid)) < 0) goto out; - if(H5T_STRING != type_class) - goto out_success; - + if(H5T_STRING != type_class) { + is_ds = 0; + goto out; + } /* check to make sure string is null-terminated; if not, then it is not dimension scale */ if((strpad = H5Tget_strpad(tid)) < 0 ) goto out; - if(H5T_STR_NULLTERM != strpad) - goto out_success; + if(H5T_STR_NULLTERM != strpad) { + is_ds = 0; + goto out; + } - /* get string size should be 16 to hold "DIMENSION_SCALE" string */ + /* According to Spec string is ASCII and its size should be 16 to hold + "DIMENSION_SCALE" string */ if((string_size = H5Tget_size(tid)) == 0) - return FAIL; - if(string_size != 16) - goto out_success; + goto out; + if(string_size != 16) { + is_ds = 0; + goto out; + } buf = (char*)HDmalloc((size_t)string_size * sizeof(char)); if(buf == NULL) @@ -1987,20 +1994,16 @@ htri_t H5DSis_scale(hid_t did) if (H5Aclose(aid) < 0) goto out; - - goto out_success; - } -out_success: - return is_ds; - /* error zone */ out: - H5E_BEGIN_TRY { - H5Aclose(aid); - H5Tclose(tid); - } H5E_END_TRY; - return FAIL; - + if(is_ds < 0) { + HDfree(buf); + H5E_BEGIN_TRY { + H5Aclose(aid); + H5Tclose(tid); + } H5E_END_TRY; + } + return is_ds; } /*------------------------------------------------------------------------- -- cgit v0.12 From 3feeb8ec20a7b08acdcd77f3e10c8c93818d890e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 14 Aug 2020 06:32:58 -0700 Subject: Fixes naming issues in H5VM inline functions --- src/H5VMprivate.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index e784847..5c975f6 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -164,8 +164,8 @@ H5VM_vector_reduce_product(unsigned n, const hsize_t *v) { hsize_t ret_value = 1; - /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ - FUNC_ENTER_STATIC_NOERR + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (n && !v) HGOTO_DONE(0) while (n--) ret_value *= *v++; @@ -198,8 +198,8 @@ H5VM_vector_zerop_u(int n, const hsize_t *v) { htri_t ret_value=TRUE; /* Return value */ - /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ - FUNC_ENTER_STATIC_NOERR + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (!v) HGOTO_DONE(TRUE) @@ -235,8 +235,8 @@ H5VM_vector_zerop_s(int n, const hssize_t *v) { htri_t ret_value=TRUE; /* Return value */ - /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ - FUNC_ENTER_STATIC_NOERR + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (!v) HGOTO_DONE(TRUE) @@ -274,8 +274,8 @@ H5VM_vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2) { int ret_value=0; /* Return value */ - /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ - FUNC_ENTER_STATIC_NOERR + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (v1 == v2) HGOTO_DONE(0) if (v1 == NULL) HGOTO_DONE(-1) @@ -318,8 +318,8 @@ H5VM_vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2) { int ret_value=0; /* Return value */ - /* Use FUNC_ENTER_STATIC_NOERR here to avoid performance issues */ - FUNC_ENTER_STATIC_NOERR + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (v1 == v2) HGOTO_DONE(0) if (v1 == NULL) HGOTO_DONE(-1) -- cgit v0.12 From 12bb6d7665b484854042db5da026a9910d711e32 Mon Sep 17 00:00:00 2001 From: mainzer Date: Fri, 14 Aug 2020 12:16:47 -0500 Subject: Tab to space conversions. Re-applied tab to space conversions accidentally reverted in the commit of the metadata cache skip list optimization, and performed some additional tab to space conversions in passing. Tested parallel / debug on Jelly. --- src/H5AC.c | 280 ++++++++++++++++++++++++++++----------------------------- src/H5C.c | 204 +++++++++++++++++++++-------------------- src/H5Cdbg.c | 4 +- src/H5Cimage.c | 158 ++++++++++++++++---------------- src/H5Cmpio.c | 238 ++++++++++++++++++++++++------------------------ src/H5Cpkg.h | 36 ++++---- test/cache.c | 8 +- 7 files changed, 463 insertions(+), 465 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index 52f45c3..964ed4d 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -136,14 +136,14 @@ static const H5AC_class_t *const H5AC_class_s[] = { /*------------------------------------------------------------------------- - * Function: H5AC_init + * Function: H5AC_init * * Purpose: Initialize the interface from some other layer. * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, January 18, 2003 * *------------------------------------------------------------------------- @@ -162,13 +162,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5AC__init_package + * Function: H5AC__init_package * - * Purpose: Initialize interface-specific information + * Purpose: Initialize interface-specific information * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 18, 2002 * *------------------------------------------------------------------------- @@ -198,15 +198,15 @@ H5AC__init_package(void) /*------------------------------------------------------------------------- - * Function: H5AC_term_package + * Function: H5AC_term_package * - * Purpose: Terminate this interface. + * Purpose: Terminate this interface. * - * Return: Success: Positive if anything was done that might - * affect other interfaces; zero otherwise. - * Failure: Negative. + * Return: Success: Positive if anything was done that might + * affect other interfaces; zero otherwise. + * Failure: Negative. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 18, 2002 * *------------------------------------------------------------------------- @@ -284,7 +284,7 @@ herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_config_t * image_config_ptr) { #ifdef H5_HAVE_PARALLEL - char prefix[H5C__PREFIX_LEN] = ""; + char prefix[H5C__PREFIX_LEN] = ""; H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ struct H5C_cache_image_ctl_t int_ci_config = H5C__DEFAULT_CACHE_IMAGE_CTL; @@ -309,9 +309,9 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co #ifdef H5_HAVE_PARALLEL if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { - MPI_Comm mpi_comm; - int mpi_rank; - int mpi_size; + MPI_Comm mpi_comm; + int mpi_rank; + int mpi_size; if(MPI_COMM_NULL == (mpi_comm = H5F_mpi_get_comm(f))) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI communicator") @@ -400,7 +400,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co #endif /* H5_HAVE_PARALLEL */ if(NULL == f->shared->cache) - HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") #ifdef H5_HAVE_PARALLEL if(aux_ptr != NULL) @@ -626,12 +626,12 @@ done: * Function: H5AC_evict * * Purpose: Evict all entries except the pinned entries - * in the cache. + * in the cache. * * Return: Non-negative on success/Negative on failure * * Programmer: Vailin Choi - * Dec 2013 + * Dec 2013 * *------------------------------------------------------------------------- */ @@ -665,9 +665,9 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_expunge_entry * - * Purpose: Expunge the target entry from the cache without writing it - * to disk even if it is dirty. The entry must not be either - * pinned or protected. + * Purpose: Expunge the target entry from the cache without writing it + * to disk even if it is dirty. The entry must not be either + * pinned or protected. * * Return: Non-negative on success/Negative on failure * @@ -708,13 +708,13 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_flush * - * Purpose: Flush (and possibly destroy) the metadata cache associated - * with the specified file. + * Purpose: Flush (and possibly destroy) the metadata cache associated + * with the specified file. * - * If the cache contains protected entries, the function will - * fail, as protected entries cannot be flushed. However - * all unprotected entries should be flushed before the - * function returns failure. + * If the cache contains protected entries, the function will + * fail, as protected entries cannot be flushed. However + * all unprotected entries should be flushed before the + * function returns failure. * * Return: Non-negative on success/Negative on failure if there was a * request to flush all items and something was protected. @@ -766,15 +766,15 @@ done: * Function: H5AC_get_entry_status * * Purpose: Given a file address, determine whether the metadata - * cache contains an entry at that location. If it does, - * also determine whether the entry is dirty, protected, - * pinned, etc. and return that information to the caller - * in *status. + * cache contains an entry at that location. If it does, + * also determine whether the entry is dirty, protected, + * pinned, etc. and return that information to the caller + * in *status. * - * If the specified entry doesn't exist, set *status_ptr - * to zero. + * If the specified entry doesn't exist, set *status_ptr + * to zero. * - * On error, the value of *status is undefined. + * On error, the value of *status is undefined. * * Return: Non-negative on success/Negative on failure * @@ -786,14 +786,14 @@ done: herr_t H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status) { - hbool_t in_cache; /* Entry @ addr is in the cache */ - hbool_t is_dirty; /* Entry @ addr is in the cache and dirty */ - hbool_t is_protected; /* Entry @ addr is in the cache and protected */ - hbool_t is_pinned; /* Entry @ addr is in the cache and pinned */ - hbool_t is_corked; - hbool_t is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */ - hbool_t is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */ - hbool_t image_is_up_to_date; /* Entry @ addr is in the cache and has an up to date image */ + hbool_t in_cache; /* Entry @ addr is in the cache */ + hbool_t is_dirty; /* Entry @ addr is in the cache and dirty */ + hbool_t is_protected; /* Entry @ addr is in the cache and protected */ + hbool_t is_pinned; /* Entry @ addr is in the cache and pinned */ + hbool_t is_corked; + hbool_t is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */ + hbool_t is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */ + hbool_t image_is_up_to_date; /* Entry @ addr is in the cache and has an up to date image */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -806,21 +806,21 @@ H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_status() failed") if(in_cache) { - *status |= H5AC_ES__IN_CACHE; - if(is_dirty) - *status |= H5AC_ES__IS_DIRTY; - if(is_protected) - *status |= H5AC_ES__IS_PROTECTED; - if(is_pinned) - *status |= H5AC_ES__IS_PINNED; - if(is_corked) - *status |= H5AC_ES__IS_CORKED; - if(is_flush_dep_parent) - *status |= H5AC_ES__IS_FLUSH_DEP_PARENT; - if(is_flush_dep_child) - *status |= H5AC_ES__IS_FLUSH_DEP_CHILD; - if(image_is_up_to_date) - *status |= H5AC_ES__IMAGE_IS_UP_TO_DATE; + *status |= H5AC_ES__IN_CACHE; + if(is_dirty) + *status |= H5AC_ES__IS_DIRTY; + if(is_protected) + *status |= H5AC_ES__IS_PROTECTED; + if(is_pinned) + *status |= H5AC_ES__IS_PINNED; + if(is_corked) + *status |= H5AC_ES__IS_CORKED; + if(is_flush_dep_parent) + *status |= H5AC_ES__IS_FLUSH_DEP_PARENT; + if(is_flush_dep_child) + *status |= H5AC_ES__IS_FLUSH_DEP_CHILD; + if(image_is_up_to_date) + *status |= H5AC_ES__IMAGE_IS_UP_TO_DATE; } /* end if */ else *status = 0; @@ -940,8 +940,8 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_mark_entry_dirty * - * Purpose: Mark a pinned or protected entry as dirty. The target - * entry MUST be either pinned, protected, or both. + * Purpose: Mark a pinned or protected entry as dirty. The target + * entry MUST be either pinned, protected, or both. * * Return: Non-negative on success/Negative on failure * @@ -995,8 +995,8 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_mark_entry_clean * - * Purpose: Mark a pinned entry as clean. The target - * entry MUST be pinned. + * Purpose: Mark a pinned entry as clean. The target + * entry MUST be pinned. * * Return: Non-negative on success/Negative on failure * @@ -1049,8 +1049,8 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_mark_entry_unserialized * - * Purpose: Mark a pinned or protected entry as unserialized. The target - * entry MUST be either pinned, protected, or both. + * Purpose: Mark a pinned or protected entry as unserialized. The target + * entry MUST be either pinned, protected, or both. * * Return: Non-negative on success/Negative on failure * @@ -1092,8 +1092,8 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_mark_entry_serialized * - * Purpose: Mark a pinned entry as serialized. The target - * entry MUST be pinned. + * Purpose: Mark a pinned entry as serialized. The target + * entry MUST be pinned. * * Return: Non-negative on success/Negative on failure * @@ -1193,7 +1193,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_pin_protected_entry() * - * Purpose: Pin a protected cache entry. The entry must be protected + * Purpose: Pin a protected cache entry. The entry must be protected * at the time of call, and must be unpinned. * * Return: Non-negative on success/Negative on failure @@ -1378,7 +1378,7 @@ done: * * Function: H5AC_create_flush_dependency() * - * Purpose: Create a flush dependency between two entries in the metadata + * Purpose: Create a flush dependency between two entries in the metadata * cache. * * Return: Non-negative on success/Negative on failure @@ -1424,16 +1424,16 @@ done: * Function: H5AC_protect * * Purpose: If the target entry is not in the cache, load it. If - * necessary, attempt to evict one or more entries to keep - * the cache within its maximum size. + * necessary, attempt to evict one or more entries to keep + * the cache within its maximum size. * - * Mark the target entry as protected, and return its address - * to the caller. The caller must call H5AC_unprotect() when - * finished with the entry. + * Mark the target entry as protected, and return its address + * to the caller. The caller must call H5AC_unprotect() when + * finished with the entry. * - * While it is protected, the entry may not be either evicted - * or flushed -- nor may it be accessed by another call to - * H5AC_protect. Any attempt to do so will result in a failure. + * While it is protected, the entry may not be either evicted + * or flushed -- nor may it be accessed by another call to + * H5AC_protect. Any attempt to do so will result in a failure. * * Return: Success: Ptr to the object. * Failure: NULL @@ -1475,7 +1475,7 @@ H5AC_protect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *udata, /* Check for invalid access request */ if((0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) && (0 == (flags & H5C__READ_ONLY_FLAG))) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "no write intent on file") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "no write intent on file") #if H5AC_DO_TAGGING_SANITY_CHECKS if(!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(type) < 0) @@ -1505,7 +1505,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_resize_entry * - * Purpose: Resize a pinned or protected entry. + * Purpose: Resize a pinned or protected entry. * * Return: Non-negative on success/Negative on failure * @@ -1559,8 +1559,8 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_unpin_entry() * - * Purpose: Unpin a cache entry. The entry must be unprotected at - * the time of call, and must be pinned. + * Purpose: Unpin a cache entry. The entry must be unprotected at + * the time of call, and must be pinned. * * Return: Non-negative on success/Negative on failure * @@ -1603,7 +1603,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_destroy_flush_dependency() * - * Purpose: Destroy a flush dependency between two entries. + * Purpose: Destroy a flush dependency between two entries. * * Return: Non-negative on success/Negative on failure * @@ -1647,27 +1647,27 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_unprotect * - * Purpose: Undo an H5AC_protect() call -- specifically, mark the - * entry as unprotected, remove it from the protected list, - * and give it back to the replacement policy. + * Purpose: Undo an H5AC_protect() call -- specifically, mark the + * entry as unprotected, remove it from the protected list, + * and give it back to the replacement policy. * - * The TYPE and ADDR arguments must be the same as those in - * the corresponding call to H5AC_protect() and the THING - * argument must be the value returned by that call to - * H5AC_protect(). + * The TYPE and ADDR arguments must be the same as those in + * the corresponding call to H5AC_protect() and the THING + * argument must be the value returned by that call to + * H5AC_protect(). * - * If the deleted flag is TRUE, simply remove the target entry - * from the cache, clear it, and free it without writing it to - * disk. + * If the deleted flag is TRUE, simply remove the target entry + * from the cache, clear it, and free it without writing it to + * disk. * - * This version of the function is a complete re-write to - * use the new metadata cache. While there isn't all that - * much difference between the old and new Purpose sections, - * the original version is given below. + * This version of the function is a complete re-write to + * use the new metadata cache. While there isn't all that + * much difference between the old and new Purpose sections, + * the original version is given below. * - * Original purpose section: + * Original purpose section: * - * This function should be called to undo the effect of + * This function should be called to undo the effect of * H5AC_protect(). The TYPE and ADDR arguments should be the * same as the corresponding call to H5AC_protect() and the * THING argument should be the value returned by H5AC_protect(). @@ -1686,8 +1686,8 @@ herr_t H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned flags) { - hbool_t dirtied; - hbool_t deleted; + hbool_t dirtied; + hbool_t deleted; #ifdef H5_HAVE_PARALLEL H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ @@ -1708,14 +1708,14 @@ H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, HDassert( ((H5AC_info_t *)thing)->type == type ); dirtied = (hbool_t)(((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG) || - (((H5AC_info_t *)thing)->dirtied)); + (((H5AC_info_t *)thing)->dirtied)); deleted = (hbool_t)((flags & H5C__DELETED_FLAG) == H5C__DELETED_FLAG); /* Check if the size changed out from underneath us, if we're not deleting * the entry. */ if(dirtied && !deleted) { - size_t curr_size = 0; + size_t curr_size = 0; if((type->image_len)(thing, &curr_size) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing") @@ -1802,7 +1802,7 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, if(internal_config.rpt_fcn == NULL) config_ptr->rpt_fcn_enabled = FALSE; else - config_ptr->rpt_fcn_enabled = TRUE; + config_ptr->rpt_fcn_enabled = TRUE; config_ptr->open_trace_file = FALSE; config_ptr->close_trace_file = FALSE; config_ptr->trace_file_name[0] = '\0'; @@ -1835,12 +1835,12 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr, if(NULL != (aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr))) { config_ptr->dirty_bytes_threshold = aux_ptr->dirty_bytes_threshold; - config_ptr->metadata_write_strategy = aux_ptr->metadata_write_strategy; + config_ptr->metadata_write_strategy = aux_ptr->metadata_write_strategy; } /* end if */ else { #endif /* H5_HAVE_PARALLEL */ config_ptr->dirty_bytes_threshold = H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD; - config_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY; + config_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY; #ifdef H5_HAVE_PARALLEL } /* end else */ } @@ -1977,7 +1977,7 @@ herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr) { H5C_auto_size_ctl_t internal_config; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2057,16 +2057,16 @@ done: * Function: H5AC_validate_config() * * Purpose: Run a sanity check on the contents of the supplied - * instance of H5AC_cache_config_t. + * instance of H5AC_cache_config_t. * * Do nothing and return SUCCEED if no errors are detected, * and flag an error and return FAIL otherwise. * - * At present, this function operates by packing the data - * from the instance of H5AC_cache_config_t into an instance - * of H5C_auto_size_ctl_t, and then calling - * H5C_validate_resize_config(). As H5AC_cache_config_t and - * H5C_auto_size_ctl_t diverge, we may have to change this. + * At present, this function operates by packing the data + * from the instance of H5AC_cache_config_t into an instance + * of H5C_auto_size_ctl_t, and then calling + * H5C_validate_resize_config(). As H5AC_cache_config_t and + * H5C_auto_size_ctl_t diverge, we may have to change this. * * Return: Non-negative on success/Negative on failure * @@ -2091,7 +2091,7 @@ H5AC_validate_config(H5AC_cache_config_t *config_ptr) /* don't bother to test trace_file_name unless open_trace_file is TRUE */ if(config_ptr->open_trace_file) { - size_t name_len; + size_t name_len; /* Can't really test the trace_file_name field without trying to * open the file, so we will content ourselves with a couple of @@ -2134,17 +2134,17 @@ done: * Function: H5AC_validate_cache_image_config() * * Purpose: Run a sanity check on the contents of the supplied - * instance of H5AC_cache_image_config_t. + * instance of H5AC_cache_image_config_t. * * Do nothing and return SUCCEED if no errors are detected, * and flag an error and return FAIL otherwise. * - * At present, this function operates by packing the data - * from the instance of H5AC_cache_image_config_t into an - * instance of H5C_cache_image_ctl_t, and then calling - * H5C_validate_cache_image_config(). If and when + * At present, this function operates by packing the data + * from the instance of H5AC_cache_image_config_t into an + * instance of H5C_cache_image_ctl_t, and then calling + * H5C_validate_cache_image_config(). If and when * H5AC_cache_image_config_t and H5C_cache_image_ctl_t - * diverge, we may have to change this. + * diverge, we may have to change this. * * Return: Non-negative on success/Negative on failure * @@ -2190,13 +2190,13 @@ done: * Function: H5AC__check_if_write_permitted * * Purpose: Determine if a write is permitted under the current - * circumstances, and set *write_permitted_ptr accordingly. - * As a general rule it is, but when we are running in parallel - * mode with collective I/O, we must ensure that a read cannot - * cause a write. + * circumstances, and set *write_permitted_ptr accordingly. + * As a general rule it is, but when we are running in parallel + * mode with collective I/O, we must ensure that a read cannot + * cause a write. * - * In the event of failure, the value of *write_permitted_ptr - * is undefined. + * In the event of failure, the value of *write_permitted_ptr + * is undefined. * * Return: Non-negative on success/Negative on failure. * @@ -2212,9 +2212,9 @@ H5_ATTR_UNUSED *f, hbool_t *write_permitted_ptr) { #ifdef H5_HAVE_PARALLEL - H5AC_aux_t * aux_ptr = NULL; + H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ - hbool_t write_permitted = TRUE; + hbool_t write_permitted = TRUE; FUNC_ENTER_STATIC_NOERR @@ -2228,9 +2228,9 @@ H5_ATTR_UNUSED HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); if((aux_ptr->mpi_rank == 0) || (aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED)) - write_permitted = aux_ptr->write_permitted; + write_permitted = aux_ptr->write_permitted; else - write_permitted = FALSE; + write_permitted = FALSE; } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -2244,12 +2244,12 @@ H5_ATTR_UNUSED * Function: H5AC__ext_config_2_int_config() * * Purpose: Utility function to translate an instance of - * H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t. + * H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t. * - * Places translation in *int_conf_ptr and returns SUCCEED - * if successful. Returns FAIL on failure. + * Places translation in *int_conf_ptr and returns SUCCEED + * if successful. Returns FAIL on failure. * - * Does only minimal sanity checking. + * Does only minimal sanity checking. * * Return: Non-negative on success/Negative on failure * @@ -2630,7 +2630,7 @@ done: * Purpose: Given a file address, retrieve the ring for an entry at that * address. * - * On error, the value of *ring is not modified. + * On error, the value of *ring is not modified. * * Return: Non-negative on success/Negative on failure * @@ -2708,11 +2708,11 @@ H5AC_set_ring(H5AC_ring_t ring, H5AC_ring_t *orig_ring) * are in the process of a file shutdown, post an error * message, and return FAIL. * - * Note that this function simply passes the call on to - * the metadata cache proper, and returns the result. + * Note that this function simply passes the call on to + * the metadata cache proper, and returns the result. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * September 17, 2016 @@ -2785,7 +2785,7 @@ done: * Function: H5AC_remove_entry() * * Purpose: Remove an entry from the cache. Must be not protected, pinned, - * dirty, involved in flush dependencies, etc. + * dirty, involved in flush dependencies, etc. * * Return: Non-negative on success/Negative on failure * diff --git a/src/H5C.c b/src/H5C.c index b70c6dc..17dc1d2 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -387,32 +387,32 @@ H5C_create(size_t max_cache_size, cache_ptr->dirty_index_size = (size_t)0; for(i = 0; i < H5C_RING_NTYPES; i++) { - cache_ptr->index_ring_len[i] = 0; - cache_ptr->index_ring_size[i] = (size_t)0; - cache_ptr->clean_index_ring_size[i] = (size_t)0; - cache_ptr->dirty_index_ring_size[i] = (size_t)0; + cache_ptr->index_ring_len[i] = 0; + cache_ptr->index_ring_size[i] = (size_t)0; + cache_ptr->clean_index_ring_size[i] = (size_t)0; + cache_ptr->dirty_index_ring_size[i] = (size_t)0; - cache_ptr->slist_ring_len[i] = 0; - cache_ptr->slist_ring_size[i] = (size_t)0; + cache_ptr->slist_ring_len[i] = 0; + cache_ptr->slist_ring_size[i] = (size_t)0; } /* end for */ for(i = 0; i < H5C__HASH_TABLE_LEN; i++) (cache_ptr->index)[i] = NULL; - cache_ptr->il_len = 0; - cache_ptr->il_size = (size_t)0; - cache_ptr->il_head = NULL; - cache_ptr->il_tail = NULL; + cache_ptr->il_len = 0; + cache_ptr->il_size = (size_t)0; + cache_ptr->il_head = NULL; + cache_ptr->il_tail = NULL; /* Tagging Field Initializations */ cache_ptr->ignore_tags = FALSE; cache_ptr->num_objs_corked = 0; /* slist field initializations */ - cache_ptr->slist_enabled = ! H5C__SLIST_OPT_ENABLED; - cache_ptr->slist_changed = FALSE; - cache_ptr->slist_len = 0; - cache_ptr->slist_size = (size_t)0; + cache_ptr->slist_enabled = ! H5C__SLIST_OPT_ENABLED; + cache_ptr->slist_changed = FALSE; + cache_ptr->slist_len = 0; + cache_ptr->slist_size = (size_t)0; /* slist_ring_len, slist_ring_size, and * slist_ptr initializaed above. @@ -1056,7 +1056,6 @@ H5C_evict(H5F_t * f) if ( H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist enabled failed") - /* Flush and invalidate all cache entries except the pinned entries */ if ( H5C__flush_invalidate_cache(f, H5C__EVICT_ALLOW_LAST_PINS_FLAG) < 0 ) @@ -3219,8 +3218,8 @@ done: * Programmer: John Mainzer * 3/22/06 * - * Changes: Added extreme sanity checks on entry and exit. - * JRM -- 4/26/14 + * Changes: Added extreme sanity checks on entry and exit. + * JRM -- 4/26/14 * *------------------------------------------------------------------------- */ @@ -3438,16 +3437,16 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) if ( entry_ptr->ro_ref_count > 1 ) { /* Sanity check */ - HDassert(entry_ptr->is_protected); + HDassert(entry_ptr->is_protected); HDassert(entry_ptr->is_read_only); - if ( dirtied ) + if ( dirtied ) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ "Read only entry modified??") /* Reduce the RO ref count */ - (entry_ptr->ro_ref_count)--; + (entry_ptr->ro_ref_count)--; /* Pin or unpin the entry as requested. */ if ( pin_entry ) { @@ -3469,20 +3468,20 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) } /* end if */ } else { - if ( entry_ptr->is_read_only ) { + if ( entry_ptr->is_read_only ) { /* Sanity check */ - HDassert(entry_ptr->ro_ref_count == 1); + HDassert(entry_ptr->ro_ref_count == 1); - if ( dirtied ) + if ( dirtied ) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ "Read only entry modified??") - entry_ptr->is_read_only = FALSE; - entry_ptr->ro_ref_count = 0; + entry_ptr->is_read_only = FALSE; + entry_ptr->ro_ref_count = 0; - } /* end if */ + } /* end if */ #ifdef H5_HAVE_PARALLEL /* When the H5C code is used to implement the metadata cache in the @@ -3518,15 +3517,15 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) /* Mark the entry as dirty if appropriate */ entry_ptr->is_dirty = (entry_ptr->is_dirty || dirtied); - if ( dirtied ) { + if ( dirtied ) { - if ( entry_ptr->image_up_to_date ) { + if ( entry_ptr->image_up_to_date ) { - entry_ptr->image_up_to_date = FALSE; + entry_ptr->image_up_to_date = FALSE; - if ( entry_ptr->flush_dep_nparents > 0 ) { + if ( entry_ptr->flush_dep_nparents > 0 ) { - if ( H5C__mark_flush_dep_unserialized(entry_ptr) < 0 ) + if ( H5C__mark_flush_dep_unserialized(entry_ptr) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ "Can't propagate serialization status to fd parents") @@ -3700,7 +3699,6 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) if ( H5C__flush_single_entry(f, entry_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0 ) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ "Can't clear entry") @@ -5753,36 +5751,36 @@ done: /*------------------------------------------------------------------------- * Function: H5C_flush_invalidate_ring * - * Purpose: Flush and destroy the entries contained in the target - * cache and ring. + * Purpose: Flush and destroy the entries contained in the target + * cache and ring. * - * If the ring contains protected entries, the function will - * fail, as protected entries cannot be either flushed or - * destroyed. However all unprotected entries should be - * flushed and destroyed before the function returns failure. + * If the ring contains protected entries, the function will + * fail, as protected entries cannot be either flushed or + * destroyed. However all unprotected entries should be + * flushed and destroyed before the function returns failure. * - * While pinned entries can usually be flushed, they cannot - * be destroyed. However, they should be unpinned when all - * the entries that reference them have been destroyed (thus - * reduding the pinned entry's reference count to 0, allowing - * it to be unpinned). + * While pinned entries can usually be flushed, they cannot + * be destroyed. However, they should be unpinned when all + * the entries that reference them have been destroyed (thus + * reduding the pinned entry's reference count to 0, allowing + * it to be unpinned). * - * If pinned entries are present, the function makes repeated - * passes through the cache, flushing all dirty entries - * (including the pinned dirty entries where permitted) and - * destroying all unpinned entries. This process is repeated - * until either the cache is empty, or the number of pinned - * entries stops decreasing on each pass. + * If pinned entries are present, the function makes repeated + * passes through the cache, flushing all dirty entries + * (including the pinned dirty entries where permitted) and + * destroying all unpinned entries. This process is repeated + * until either the cache is empty, or the number of pinned + * entries stops decreasing on each pass. * - * If flush dependencies appear in the target ring, the - * function makes repeated passes through the cache flushing - * entries in flush dependency order. + * If flush dependencies appear in the target ring, the + * function makes repeated passes through the cache flushing + * entries in flush dependency order. * * Return: Non-negative on success/Negative on failure or if there was - * a request to flush all items and something was protected. + * a request to flush all items and something was protected. * * Programmer: John Mainzer - * 9/1/15 + * 9/1/15 * * Changes: Added support for the H5C__EVICT_ALLOW_LAST_PINS_FLAG. * This flag is used to flush and evict all entries in @@ -6317,24 +6315,24 @@ done: * * Function: H5C__flush_ring * - * Purpose: Flush the entries contained in the specified cache and - * ring. All entries in rings outside the specified ring - * must have been flushed on entry. + * Purpose: Flush the entries contained in the specified cache and + * ring. All entries in rings outside the specified ring + * must have been flushed on entry. * - * If the cache contains protected entries in the specified - * ring, the function will fail, as protected entries cannot - * be flushed. However all unprotected entries in the target - * ring should be flushed before the function returns failure. + * If the cache contains protected entries in the specified + * ring, the function will fail, as protected entries cannot + * be flushed. However all unprotected entries in the target + * ring should be flushed before the function returns failure. * - * If flush dependencies appear in the target ring, the - * function makes repeated passes through the slist flushing - * entries in flush dependency order. + * If flush dependencies appear in the target ring, the + * function makes repeated passes through the slist flushing + * entries in flush dependency order. * * Return: Non-negative on success/Negative on failure or if there was - * a request to flush all items and something was protected. + * a request to flush all items and something was protected. * * Programmer: John Mainzer - * 9/1/15 + * 9/1/15 * * Changes: A recent optimization turns off the slist unless a flush * is in progress. This should not effect this function, as @@ -6392,7 +6390,7 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) for ( i = (int)H5C_RING_UNDEFINED; i < (int)ring; i++ ) { - HDassert(cache_ptr->slist_ring_len[i] == 0); + HDassert(cache_ptr->slist_ring_len[i] == 0); } } @@ -6416,8 +6414,8 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) cache_ptr->slist_changed = FALSE; while ( ( cache_ptr->slist_ring_len[ring] > 0 ) && - ( protected_entries == 0 ) && - ( flushed_entries_last_pass ) ) { + ( protected_entries == 0 ) && + ( flushed_entries_last_pass ) ) { flushed_entries_last_pass = FALSE; @@ -6641,23 +6639,23 @@ done: * Function: H5C__flush_single_entry * * Purpose: Flush or clear (and evict if requested) the cache entry - * with the specified address and type. If the type is NULL, - * any unprotected entry at the specified address will be - * flushed (and possibly evicted). + * with the specified address and type. If the type is NULL, + * any unprotected entry at the specified address will be + * flushed (and possibly evicted). * - * Attempts to flush a protected entry will result in an - * error. + * Attempts to flush a protected entry will result in an + * error. * - * If the H5C__FLUSH_INVALIDATE_FLAG flag is set, the entry will - * be cleared and not flushed, and the call can't be part of a + * If the H5C__FLUSH_INVALIDATE_FLAG flag is set, the entry will + * be cleared and not flushed, and the call can't be part of a * sequence of flushes. * - * The function does nothing silently if there is no entry - * at the supplied address, or if the entry found has the - * wrong type. + * The function does nothing silently if there is no entry + * at the supplied address, or if the entry found has the + * wrong type. * * Return: Non-negative on success/Negative on failure or if there was - * an attempt to flush a protected item. + * an attempt to flush a protected item. * * Programmer: John Mainzer, 5/5/04 * @@ -6729,22 +6727,22 @@ done: herr_t H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) { - H5C_t * cache_ptr; /* Cache for file */ - hbool_t destroy; /* external flag */ - hbool_t clear_only; /* external flag */ - hbool_t free_file_space; /* external flag */ - hbool_t take_ownership; /* external flag */ - hbool_t del_from_slist_on_destroy; /* external flag */ - hbool_t during_flush; /* external flag */ - hbool_t write_entry; /* internal flag */ - hbool_t destroy_entry; /* internal flag */ - hbool_t generate_image; /* internal flag */ - hbool_t update_page_buffer; /* internal flag */ - hbool_t was_dirty; - hbool_t suppress_image_entry_writes = FALSE; - hbool_t suppress_image_entry_frees = FALSE; - haddr_t entry_addr = HADDR_UNDEF; - herr_t ret_value = SUCCEED; /* Return value */ + H5C_t * cache_ptr; /* Cache for file */ + hbool_t destroy; /* external flag */ + hbool_t clear_only; /* external flag */ + hbool_t free_file_space; /* external flag */ + hbool_t take_ownership; /* external flag */ + hbool_t del_from_slist_on_destroy; /* external flag */ + hbool_t during_flush; /* external flag */ + hbool_t write_entry; /* internal flag */ + hbool_t destroy_entry; /* internal flag */ + hbool_t generate_image; /* internal flag */ + hbool_t update_page_buffer; /* internal flag */ + hbool_t was_dirty; + hbool_t suppress_image_entry_writes = FALSE; + hbool_t suppress_image_entry_frees = FALSE; + haddr_t entry_addr = HADDR_UNDEF; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -7101,9 +7099,9 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, \ "can't remove entry from tag list") - /* verify that the entry is no longer part of any flush dependencies */ + /* verify that the entry is no longer part of any flush dependencies */ HDassert(entry_ptr->flush_dep_nparents == 0); - HDassert(entry_ptr->flush_dep_nchildren == 0); + HDassert(entry_ptr->flush_dep_nchildren == 0); } /* end if */ else { @@ -7118,7 +7116,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * view of the replacement policy and the slist. * Hence no differentiation between them. * - * JRM -- 7/7/07 + * JRM -- 7/7/07 */ H5C__UPDATE_RP_FOR_FLUSH(cache_ptr, entry_ptr, FAIL) @@ -9482,7 +9480,7 @@ done: * * Purpose: Serialize an entry and generate its image. * - * Note: This may cause the entry to be re-sized and/or moved in + * Note: This may cause the entry to be re-sized and/or moved in * the cache. * * As we will not update the metadata cache's data structures @@ -9505,9 +9503,9 @@ done: herr_t H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) { - haddr_t new_addr = HADDR_UNDEF; - haddr_t old_addr = HADDR_UNDEF; - size_t new_len = 0; + haddr_t new_addr = HADDR_UNDEF; + haddr_t old_addr = HADDR_UNDEF; + size_t new_len = 0; unsigned serialize_flags = H5C__SERIALIZE_NO_FLAGS_SET; herr_t ret_value = SUCCEED; diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index 085ac77..810c1e3 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -264,8 +264,8 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name) * Function: H5C_dump_cache_skip_list * * Purpose: Debugging routine that prints a summary of the contents of - * the skip list used by the metadata cache metadata cache to - * maintain an address sorted list of dirty entries. + * the skip list used by the metadata cache metadata cache to + * maintain an address sorted list of dirty entries. * * Return: Non-negative on success/Negative on failure * diff --git a/src/H5Cimage.c b/src/H5Cimage.c index 9dd2ac6..0373098 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -431,33 +431,33 @@ done: * Function: H5C__deserialize_prefetched_entry() * * Purpose: Deserialize the supplied prefetched entry entry, and return - * a pointer to the deserialized entry in *entry_ptr_ptr. - * If successful, remove the prefetched entry from the cache, - * and free it. Insert the deserialized entry into the cache. - * - * Note that the on disk image of the entry is not freed -- - * a pointer to it is stored in the deserialized entries' - * image_ptr field, and its image_up_to_date field is set to - * TRUE unless the entry is dirtied by the deserialize call. - * - * If the prefetched entry is a flush dependency child, - * destroy that flush dependency prior to calling the - * deserialize callback. If appropriate, the flush dependency - * relationship will be recreated by the cache client. - * - * If the prefetched entry is a flush dependency parent, - * destroy the flush dependency relationship with all its - * children. As all these children must be prefetched entries, - * recreate these flush dependency relationships with - * deserialized entry after it is inserted in the cache. - * - * Since deserializing a prefetched entry is semantically - * equivalent to a load, issue an entry loaded nofification - * if the notify callback is defined. + * a pointer to the deserialized entry in *entry_ptr_ptr. + * If successful, remove the prefetched entry from the cache, + * and free it. Insert the deserialized entry into the cache. + * + * Note that the on disk image of the entry is not freed -- + * a pointer to it is stored in the deserialized entries' + * image_ptr field, and its image_up_to_date field is set to + * TRUE unless the entry is dirtied by the deserialize call. + * + * If the prefetched entry is a flush dependency child, + * destroy that flush dependency prior to calling the + * deserialize callback. If appropriate, the flush dependency + * relationship will be recreated by the cache client. + * + * If the prefetched entry is a flush dependency parent, + * destroy the flush dependency relationship with all its + * children. As all these children must be prefetched entries, + * recreate these flush dependency relationships with + * deserialized entry after it is inserted in the cache. + * + * Since deserializing a prefetched entry is semantically + * equivalent to a load, issue an entry loaded nofification + * if the notify callback is defined. * * Return: SUCCEED on success, and FAIL on failure. * - * Note that *entry_ptr_ptr is undefined on failure. + * Note that *entry_ptr_ptr is undefined on failure. * * Programmer: John Mainzer, 8/10/15 * @@ -472,11 +472,11 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t **entry_ptr_ptr, const H5C_class_t *type, haddr_t addr, void *udata) { - hbool_t dirty = FALSE; /* Flag indicating whether thing was + hbool_t dirty = FALSE; /* Flag indicating whether thing was * dirtied during deserialize */ size_t len; /* Size of image in file */ - void * thing = NULL; /* Pointer to thing loaded */ + void * thing = NULL; /* Pointer to thing loaded */ H5C_cache_entry_t * pf_entry_ptr; /* pointer to the prefetched entry */ /* supplied in *entry_ptr_ptr. */ H5C_cache_entry_t * ds_entry_ptr; /* Alias for thing loaded, as cache @@ -488,8 +488,8 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, /* the prefetched entry, or NULL if */ /* that array does not exist. */ unsigned flush_flags = (H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG); - int i; + H5C__FLUSH_CLEAR_ONLY_FLAG); + int i; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -608,73 +608,73 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, HDassert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6) ); - ds_entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; - ds_entry_ptr->cache_ptr = f->shared->cache; - ds_entry_ptr->addr = addr; - ds_entry_ptr->size = len; + ds_entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; + ds_entry_ptr->cache_ptr = f->shared->cache; + ds_entry_ptr->addr = addr; + ds_entry_ptr->size = len; HDassert(ds_entry_ptr->size < H5C_MAX_ENTRY_SIZE); - ds_entry_ptr->image_ptr = pf_entry_ptr->image_ptr; - ds_entry_ptr->image_up_to_date = !dirty; - ds_entry_ptr->type = type; - ds_entry_ptr->is_dirty = dirty | pf_entry_ptr->is_dirty; - ds_entry_ptr->dirtied = FALSE; - ds_entry_ptr->is_protected = FALSE; - ds_entry_ptr->is_read_only = FALSE; - ds_entry_ptr->ro_ref_count = 0; - ds_entry_ptr->is_pinned = FALSE; - ds_entry_ptr->in_slist = FALSE; - ds_entry_ptr->flush_marker = FALSE; + ds_entry_ptr->image_ptr = pf_entry_ptr->image_ptr; + ds_entry_ptr->image_up_to_date = !dirty; + ds_entry_ptr->type = type; + ds_entry_ptr->is_dirty = dirty | pf_entry_ptr->is_dirty; + ds_entry_ptr->dirtied = FALSE; + ds_entry_ptr->is_protected = FALSE; + ds_entry_ptr->is_read_only = FALSE; + ds_entry_ptr->ro_ref_count = 0; + ds_entry_ptr->is_pinned = FALSE; + ds_entry_ptr->in_slist = FALSE; + ds_entry_ptr->flush_marker = FALSE; #ifdef H5_HAVE_PARALLEL - ds_entry_ptr->clear_on_unprotect = FALSE; - ds_entry_ptr->flush_immediately = FALSE; - ds_entry_ptr->coll_access = FALSE; + ds_entry_ptr->clear_on_unprotect = FALSE; + ds_entry_ptr->flush_immediately = FALSE; + ds_entry_ptr->coll_access = FALSE; #endif /* H5_HAVE_PARALLEL */ - ds_entry_ptr->flush_in_progress = FALSE; - ds_entry_ptr->destroy_in_progress = FALSE; + ds_entry_ptr->flush_in_progress = FALSE; + ds_entry_ptr->destroy_in_progress = FALSE; - ds_entry_ptr->ring = pf_entry_ptr->ring; + ds_entry_ptr->ring = pf_entry_ptr->ring; /* Initialize flush dependency height fields */ - ds_entry_ptr->flush_dep_parent = NULL; - ds_entry_ptr->flush_dep_nparents = 0; - ds_entry_ptr->flush_dep_parent_nalloc = 0; - ds_entry_ptr->flush_dep_nchildren = 0; - ds_entry_ptr->flush_dep_ndirty_children = 0; - ds_entry_ptr->flush_dep_nunser_children = 0; + ds_entry_ptr->flush_dep_parent = NULL; + ds_entry_ptr->flush_dep_nparents = 0; + ds_entry_ptr->flush_dep_parent_nalloc = 0; + ds_entry_ptr->flush_dep_nchildren = 0; + ds_entry_ptr->flush_dep_ndirty_children = 0; + ds_entry_ptr->flush_dep_nunser_children = 0; /* Initialize fields supporting the hash table: */ - ds_entry_ptr->ht_next = NULL; - ds_entry_ptr->ht_prev = NULL; - ds_entry_ptr->il_next = NULL; - ds_entry_ptr->il_prev = NULL; + ds_entry_ptr->ht_next = NULL; + ds_entry_ptr->ht_prev = NULL; + ds_entry_ptr->il_next = NULL; + ds_entry_ptr->il_prev = NULL; /* Initialize fields supporting replacement policies: */ - ds_entry_ptr->next = NULL; - ds_entry_ptr->prev = NULL; + ds_entry_ptr->next = NULL; + ds_entry_ptr->prev = NULL; #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - ds_entry_ptr->aux_next = NULL; - ds_entry_ptr->aux_prev = NULL; + ds_entry_ptr->aux_next = NULL; + ds_entry_ptr->aux_prev = NULL; #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ #ifdef H5_HAVE_PARALLEL - pf_entry_ptr->coll_next = NULL; - pf_entry_ptr->coll_prev = NULL; + pf_entry_ptr->coll_next = NULL; + pf_entry_ptr->coll_prev = NULL; #endif /* H5_HAVE_PARALLEL */ /* Initialize cache image related fields */ - ds_entry_ptr->include_in_image = FALSE; - ds_entry_ptr->lru_rank = 0; - ds_entry_ptr->image_dirty = FALSE; - ds_entry_ptr->fd_parent_count = 0; - ds_entry_ptr->fd_parent_addrs = NULL; - ds_entry_ptr->fd_child_count = pf_entry_ptr->fd_child_count; - ds_entry_ptr->fd_dirty_child_count = 0; - ds_entry_ptr->image_fd_height = 0; - ds_entry_ptr->prefetched = FALSE; - ds_entry_ptr->prefetch_type_id = 0; - ds_entry_ptr->age = 0; - ds_entry_ptr->prefetched_dirty = pf_entry_ptr->prefetched_dirty; + ds_entry_ptr->include_in_image = FALSE; + ds_entry_ptr->lru_rank = 0; + ds_entry_ptr->image_dirty = FALSE; + ds_entry_ptr->fd_parent_count = 0; + ds_entry_ptr->fd_parent_addrs = NULL; + ds_entry_ptr->fd_child_count = pf_entry_ptr->fd_child_count; + ds_entry_ptr->fd_dirty_child_count = 0; + ds_entry_ptr->image_fd_height = 0; + ds_entry_ptr->prefetched = FALSE; + ds_entry_ptr->prefetch_type_id = 0; + ds_entry_ptr->age = 0; + ds_entry_ptr->prefetched_dirty = pf_entry_ptr->prefetched_dirty; #ifndef NDEBUG /* debugging field */ - ds_entry_ptr->serialization_count = 0; + ds_entry_ptr->serialization_count = 0; #endif /* NDEBUG */ H5C__RESET_CACHE_ENTRY_STATS(ds_entry_ptr); @@ -698,7 +698,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, * * 1) Set pf_entry_ptr->image_ptr to NULL. Since we have already * transferred the buffer containing the image to *ds_entry_ptr, - * this is not a memory leak. + * this is not a memory leak. * * 2) Call H5C__flush_single_entry() with the H5C__FLUSH_INVALIDATE_FLAG * and H5C__FLUSH_CLEAR_ONLY_FLAG flags set. diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 31dc647..6ec0513 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -34,14 +34,14 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ +#include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ -#include "H5Cpkg.h" /* Cache */ +#include "H5Cpkg.h" /* Cache */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* Files */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* Files */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5MMprivate.h" /* Memory management */ #ifdef H5_HAVE_PARALLEL @@ -87,74 +87,74 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, * * Purpose: Apply the supplied candidate list. * - * We used to do this by simply having each process write - * every mpi_size-th entry in the candidate list, starting - * at index mpi_rank, and mark all the others clean. + * We used to do this by simply having each process write + * every mpi_size-th entry in the candidate list, starting + * at index mpi_rank, and mark all the others clean. * - * However, this can cause unnecessary contention in a file - * system by increasing the number of processes writing to - * adjacent locations in the HDF5 file. + * However, this can cause unnecessary contention in a file + * system by increasing the number of processes writing to + * adjacent locations in the HDF5 file. * - * To attempt to minimize this, we now arange matters such - * that each process writes n adjacent entries in the - * candidate list, and marks all others clean. We must do - * this in such a fashion as to guarantee that each entry - * on the candidate list is written by exactly one process, - * and marked clean by all others. + * To attempt to minimize this, we now arange matters such + * that each process writes n adjacent entries in the + * candidate list, and marks all others clean. We must do + * this in such a fashion as to guarantee that each entry + * on the candidate list is written by exactly one process, + * and marked clean by all others. * - * To do this, first construct a table mapping mpi_rank - * to the index of the first entry in the candidate list to - * be written by the process of that mpi_rank, and then use - * the table to control which entries are written and which - * are marked as clean as a function of the mpi_rank. + * To do this, first construct a table mapping mpi_rank + * to the index of the first entry in the candidate list to + * be written by the process of that mpi_rank, and then use + * the table to control which entries are written and which + * are marked as clean as a function of the mpi_rank. * - * Note that the table must be identical on all processes, as - * all see the same candidate list, mpi_size, and mpi_rank -- - * the inputs used to construct the table. + * Note that the table must be identical on all processes, as + * all see the same candidate list, mpi_size, and mpi_rank -- + * the inputs used to construct the table. * - * We construct the table as follows. Let: + * We construct the table as follows. Let: * - * n = num_candidates / mpi_size; + * n = num_candidates / mpi_size; * - * m = num_candidates % mpi_size; + * m = num_candidates % mpi_size; * - * Now allocate an array of integers of length mpi_size + 1, - * and call this array candidate_assignment_table. + * Now allocate an array of integers of length mpi_size + 1, + * and call this array candidate_assignment_table. * - * Conceptually, if the number of candidates is a multiple - * of the mpi_size, we simply pass through the candidate list - * and assign n entries to each process to flush, with the - * index of the first entry to flush in the location in - * the candidate_assignment_table indicated by the mpi_rank - * of the process. + * Conceptually, if the number of candidates is a multiple + * of the mpi_size, we simply pass through the candidate list + * and assign n entries to each process to flush, with the + * index of the first entry to flush in the location in + * the candidate_assignment_table indicated by the mpi_rank + * of the process. * - * In the more common case in which the candidate list isn't - * isn't a multiple of the mpi_size, we pretend it is, and - * give num_candidates % mpi_size processes one extra entry - * each to make things work out. + * In the more common case in which the candidate list isn't + * isn't a multiple of the mpi_size, we pretend it is, and + * give num_candidates % mpi_size processes one extra entry + * each to make things work out. * - * Once the table is constructed, we determine the first and - * last entry this process is to flush as follows: + * Once the table is constructed, we determine the first and + * last entry this process is to flush as follows: * - * first_entry_to_flush = candidate_assignment_table[mpi_rank] + * first_entry_to_flush = candidate_assignment_table[mpi_rank] * - * last_entry_to_flush = - * candidate_assignment_table[mpi_rank + 1] - 1; + * last_entry_to_flush = + * candidate_assignment_table[mpi_rank + 1] - 1; * - * With these values determined, we simply scan through the - * candidate list, marking all entries in the range - * [first_entry_to_flush, last_entry_to_flush] for flush, - * and all others to be cleaned. + * With these values determined, we simply scan through the + * candidate list, marking all entries in the range + * [first_entry_to_flush, last_entry_to_flush] for flush, + * and all others to be cleaned. * - * Finally, we scan the LRU from tail to head, flushing - * or marking clean the candidate entries as indicated. - * If necessary, we scan the pinned list as well. + * Finally, we scan the LRU from tail to head, flushing + * or marking clean the candidate entries as indicated. + * If necessary, we scan the pinned list as well. * - * Note that this function will fail if any protected or - * clean entries appear on the candidate list. + * Note that this function will fail if any protected or + * clean entries appear on the candidate list. * - * This function is used in managing sync points, and - * shouldn't be used elsewhere. + * This function is used in managing sync points, and + * shouldn't be used elsewhere. * * Return: Success: SUCCEED * @@ -187,15 +187,15 @@ H5C_apply_candidate_list(H5F_t * f, unsigned * candidate_assignment_table = NULL; unsigned entries_to_flush[H5C_RING_NTYPES]; unsigned entries_to_clear[H5C_RING_NTYPES]; - haddr_t addr; - H5C_cache_entry_t * entry_ptr = NULL; + haddr_t addr; + H5C_cache_entry_t * entry_ptr = NULL; #if H5C_DO_SANITY_CHECKS - haddr_t last_addr; + haddr_t last_addr; #endif /* H5C_DO_SANITY_CHECKS */ #if H5C_APPLY_CANDIDATE_LIST__DEBUG - char tbl_buf[1024]; + char tbl_buf[1024]; #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ unsigned u; /* Local index variable */ @@ -422,10 +422,10 @@ done: * Function: H5C_construct_candidate_list__clean_cache * * Purpose: Construct the list of entries that should be flushed to - * clean all entries in the cache. + * clean all entries in the cache. * - * This function is used in managing sync points, and - * shouldn't be used elsewhere. + * This function is used in managing sync points, and + * shouldn't be used elsewhere. * * Return: Success: SUCCEED * @@ -572,10 +572,10 @@ done: * Function: H5C_construct_candidate_list__min_clean * * Purpose: Construct the list of entries that should be flushed to - * get the cache back within its min clean constraints. + * get the cache back within its min clean constraints. * - * This function is used in managing sync points, and - * shouldn't be used elsewhere. + * This function is used in managing sync points, and + * shouldn't be used elsewhere. * * Return: Success: SUCCEED * @@ -691,24 +691,24 @@ done: * Function: H5C_mark_entries_as_clean * * Purpose: When the H5C code is used to implement the metadata caches - * in PHDF5, only the cache with MPI_rank 0 is allowed to - * actually write entries to disk -- all other caches must - * retain dirty entries until they are advised that the - * entries are clean. + * in PHDF5, only the cache with MPI_rank 0 is allowed to + * actually write entries to disk -- all other caches must + * retain dirty entries until they are advised that the + * entries are clean. * - * This function exists to allow the H5C code to receive these - * notifications. + * This function exists to allow the H5C code to receive these + * notifications. * - * The function receives a list of entry base addresses - * which must refer to dirty entries in the cache. If any - * of the entries are either clean or don't exist, the - * function flags an error. + * The function receives a list of entry base addresses + * which must refer to dirty entries in the cache. If any + * of the entries are either clean or don't exist, the + * function flags an error. * - * The function scans the list of entries and flushes all - * those that are currently unprotected with the - * H5C__FLUSH_CLEAR_ONLY_FLAG. Those that are currently - * protected are flagged for clearing when they are - * unprotected. + * The function scans the list of entries and flushes all + * those that are currently unprotected with the + * H5C__FLUSH_CLEAR_ONLY_FLAG. Those that are currently + * protected are flagged for clearing when they are + * unprotected. * * Return: Non-negative on success/Negative on failure * @@ -723,22 +723,22 @@ H5C_mark_entries_as_clean(H5F_t * f, haddr_t * ce_array_ptr) { H5C_t * cache_ptr; - unsigned entries_cleared; + unsigned entries_cleared; unsigned pinned_entries_cleared; hbool_t progress; - unsigned entries_examined; - unsigned initial_list_len; - haddr_t addr; - unsigned pinned_entries_marked = 0; + unsigned entries_examined; + unsigned initial_list_len; + haddr_t addr; + unsigned pinned_entries_marked = 0; #if H5C_DO_SANITY_CHECKS - unsigned protected_entries_marked = 0; - unsigned other_entries_marked = 0; - haddr_t last_addr; + unsigned protected_entries_marked = 0; + unsigned other_entries_marked = 0; + haddr_t last_addr; #endif /* H5C_DO_SANITY_CHECKS */ - H5C_cache_entry_t * clear_ptr = NULL; - H5C_cache_entry_t * entry_ptr = NULL; + H5C_cache_entry_t * clear_ptr = NULL; + H5C_cache_entry_t * entry_ptr = NULL; unsigned u; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -785,7 +785,7 @@ H5C_mark_entries_as_clean(H5F_t * f, if(entry_ptr == NULL) { #if H5C_DO_SANITY_CHECKS - HDfprintf(stdout, + HDfprintf(stdout, "H5C_mark_entries_as_clean: entry[%u] = %a not in cache.\n", u, addr); @@ -794,7 +794,7 @@ H5C_mark_entries_as_clean(H5F_t * f, } /* end if */ else if(!entry_ptr->is_dirty) { #if H5C_DO_SANITY_CHECKS - HDfprintf(stdout, + HDfprintf(stdout, "H5C_mark_entries_as_clean: entry %a is not dirty!?!\n", addr); #endif /* H5C_DO_SANITY_CHECKS */ @@ -814,13 +814,13 @@ H5C_mark_entries_as_clean(H5F_t * f, } /* end if */ entry_ptr->clear_on_unprotect = TRUE; - if(entry_ptr->is_pinned) - pinned_entries_marked++; + if(entry_ptr->is_pinned) + pinned_entries_marked++; #if H5C_DO_SANITY_CHECKS - else if(entry_ptr->is_protected) - protected_entries_marked++; - else - other_entries_marked++; + else if(entry_ptr->is_protected) + protected_entries_marked++; + else + other_entries_marked++; #endif /* H5C_DO_SANITY_CHECKS */ } } @@ -848,7 +848,7 @@ H5C_mark_entries_as_clean(H5F_t * f, * of the pre_serialize / serialize routines, this may * cease to be the case -- requiring a review of this * point. - * JRM -- 4/7/15 + * JRM -- 4/7/15 */ entries_cleared = 0; entries_examined = 0; @@ -952,8 +952,8 @@ done: herr_t H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial) { - uint32_t clear_cnt; - H5C_cache_entry_t * entry_ptr = NULL; + uint32_t clear_cnt; + H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -1163,7 +1163,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C__flush_candidate_entries * - * Purpose: Flush or clear (as indicated) the candidate entries that + * Purpose: Flush or clear (as indicated) the candidate entries that * have been marked in the metadata cache. In so doing, * observe rings and flush dependencies. * @@ -1192,9 +1192,9 @@ done: * Return: Non-negative on success/Negative on failure. * * Programmer: John Mainzer - * 2/10/17 + * 2/10/17 * - * Changes: None. + * Changes: None. * *------------------------------------------------------------------------- */ @@ -1203,17 +1203,17 @@ H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES unsigned entries_to_clear[H5C_RING_NTYPES]) { #if H5C_DO_SANITY_CHECKS - int i; - uint32_t index_len = 0; - size_t index_size = (size_t)0; - size_t clean_index_size = (size_t)0; - size_t dirty_index_size = (size_t)0; - size_t slist_size = (size_t)0; - uint32_t slist_len = 0; + int i; + uint32_t index_len = 0; + size_t index_size = (size_t)0; + size_t clean_index_size = (size_t)0; + size_t dirty_index_size = (size_t)0; + size_t slist_size = (size_t)0; + uint32_t slist_len = 0; #endif /* H5C_DO_SANITY_CHECKS */ - H5C_ring_t ring; + H5C_ring_t ring; H5C_t * cache_ptr; - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -1243,7 +1243,7 @@ H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES clean_index_size += cache_ptr->clean_index_ring_size[i]; dirty_index_size += cache_ptr->dirty_index_ring_size[i]; - slist_len += cache_ptr->slist_ring_len[i]; + slist_len += cache_ptr->slist_ring_len[i]; slist_size += cache_ptr->slist_ring_size[i]; } /* end for */ @@ -1285,7 +1285,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C__flush_candidates_in_ring * - * Purpose: Flush or clear (as indicated) the candidate entries + * Purpose: Flush or clear (as indicated) the candidate entries * contained in the specified cache and ring. All candidate * entries in rings outside the specified ring must have been * flushed (or cleared) on entry. @@ -1314,7 +1314,7 @@ done: * Return: Non-negative on success/Negative on failure. * * Programmer: John Mainzer - * 2/10/17 + * 2/10/17 * *------------------------------------------------------------------------- */ diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index ac761f6..445801d 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -1707,8 +1707,8 @@ if ( ( (cache_ptr)->index_size != \ * Function: H5C__REMOVE_ENTRY_FROM_SLIST * * Purpose: Remove the specified instance of H5C_cache_entry_t from the - * index skip list in the specified instance of H5C_t. Update - * the associated length and size fields. + * index skip list in the specified instance of H5C_t. Update + * the associated length and size fields. * * Return: N/A * @@ -1845,7 +1845,7 @@ if ( ( (cache_ptr)->index_size != \ * Function: H5C__UPDATE_SLIST_FOR_SIZE_CHANGE * * Purpose: Update cache_ptr->slist_size for a change in the size of - * and entry in the slist. + * and entry in the slist. * * Return: N/A * @@ -1853,24 +1853,24 @@ if ( ( (cache_ptr)->index_size != \ * * Modifications: * - * JRM -- 8/27/06 - * Added the H5C_DO_SANITY_CHECKS version of the macro. + * JRM -- 8/27/06 + * Added the H5C_DO_SANITY_CHECKS version of the macro. * - * This version maintains the slist_size_increase field - * that are used in sanity checks in the flush routines. + * This version maintains the slist_size_increase field + * that are used in sanity checks in the flush routines. * - * All this is needed as the fractal heap needs to be - * able to dirty, resize and/or move entries during the - * flush. + * All this is needed as the fractal heap needs to be + * able to dirty, resize and/or move entries during the + * flush. * - * JRM -- 12/13/14 - * Note that we do not set cache_ptr->slist_changed to TRUE - * in this case, as the structure of the slist is not - * modified. + * JRM -- 12/13/14 + * Note that we do not set cache_ptr->slist_changed to TRUE + * in this case, as the structure of the slist is not + * modified. * - * JRM -- 9/1/15 - * Added code to maintain the cache_ptr->slist_ring_len - * and cache_ptr->slist_ring_size arrays. + * JRM -- 9/1/15 + * Added code to maintain the cache_ptr->slist_ring_len + * and cache_ptr->slist_ring_size arrays. * * JRM -- 4/29/20 * Reworked macro to support the slist_enabled field @@ -3852,7 +3852,7 @@ typedef struct H5C_tag_info_t { * one. * * entry_watched_for_removal: Pointer to an instance of H5C_cache_entry_t - * which contains the 'next' entry for an iteration. Removing + * which contains the 'next' entry for an iteration. Removing * this entry must trigger a rescan of the iteration, so each * entry removed from the cache is compared against this pointer * and the pointer is reset to NULL if the watched entry is diff --git a/test/cache.c b/test/cache.c index f728ce1..46d8481 100644 --- a/test/cache.c +++ b/test/cache.c @@ -3067,15 +3067,15 @@ check_insert_entry(unsigned paged) /* Verify that the flush marker got set correctly */ if((i == 1) || (i == 3)) { - if(!((entry_ptr->header).flush_marker)) { + if(!((entry_ptr->header).flush_marker)) { pass = FALSE; failure_mssg = "Unexpected insert results 5."; - } + } } else if((entry_ptr->header).flush_marker) { - pass = FALSE; - failure_mssg = "Unexpected insert results 6."; + pass = FALSE; + failure_mssg = "Unexpected insert results 6."; } } -- cgit v0.12 From 500d87fd1f5d6068feeb71119bc5d22843203fef Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 14 Aug 2020 12:16:58 -0500 Subject: HDFFV-9984 Add options to merge/prune external links during repack --- MANIFEST | 19 ++ release_docs/RELEASE.txt | 11 + tools/lib/h5tools_utils.c | 2 +- tools/src/h5copy/h5copy.c | 4 +- tools/src/h5repack/h5repack.h | 38 +-- tools/src/h5repack/h5repack_copy.c | 84 +++++- tools/src/h5repack/h5repack_main.c | 53 ++-- tools/test/h5diff/h5diffgentest.c | 1 - tools/test/h5repack/CMakeTests.cmake | 113 +++++++- tools/test/h5repack/h5repack.sh.in | 300 ++++++++++++++++----- ...y_extlinks_src-merge.h5copy_extlinks_src.h5.tst | 26 ++ ...links_src-mergeprune.h5copy_extlinks_src.h5.ddl | 28 ++ ...y_extlinks_src-prune.h5copy_extlinks_src.h5.ddl | 6 + .../test/h5repack/testfiles/h5copy_extlinks_src.h5 | Bin 0 -> 2184 bytes .../test/h5repack/testfiles/h5copy_extlinks_trg.h5 | Bin 0 -> 2168 bytes tools/test/h5repack/testfiles/h5repack-help.txt | 3 + .../testfiles/textlink-merge.textlink.h5.tst | 13 + .../testfiles/textlink-mergeprune.textlink.h5.ddl | 4 + .../testfiles/textlink-prune.textlink.h5.ddl | 4 + .../testfiles/textlinkfar-merge.textlinkfar.h5.tst | 20 ++ .../textlinkfar-mergeprune.textlinkfar.h5.ddl | 152 +++++++++++ .../testfiles/textlinkfar-prune.textlinkfar.h5.ddl | 4 + .../testfiles/textlinksrc-merge.textlinksrc.h5.tst | 32 +++ .../textlinksrc-mergeprune.textlinksrc.h5.ddl | 187 +++++++++++++ .../testfiles/textlinksrc-prune.textlinksrc.h5.ddl | 4 + .../testfiles/textlinktar-merge.textlinktar.h5.tst | 44 +++ .../textlinktar-mergeprune.textlinktar.h5.ddl | 200 ++++++++++++++ .../testfiles/textlinktar-prune.textlinktar.h5.ddl | 52 ++++ .../testfiles/tsoftlinks-merge.tsoftlinks.h5.tst | 53 ++++ .../tsoftlinks-mergeprune.tsoftlinks.h5.ddl | 127 +++++++++ .../testfiles/tsoftlinks-prune.tsoftlinks.h5.ddl | 47 ++++ 31 files changed, 1511 insertions(+), 120 deletions(-) create mode 100644 tools/test/h5repack/testfiles/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst create mode 100644 tools/test/h5repack/testfiles/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5.ddl create mode 100644 tools/test/h5repack/testfiles/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5.ddl create mode 100644 tools/test/h5repack/testfiles/h5copy_extlinks_src.h5 create mode 100644 tools/test/h5repack/testfiles/h5copy_extlinks_trg.h5 create mode 100644 tools/test/h5repack/testfiles/textlink-merge.textlink.h5.tst create mode 100644 tools/test/h5repack/testfiles/textlink-mergeprune.textlink.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlink-prune.textlink.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinkfar-merge.textlinkfar.h5.tst create mode 100644 tools/test/h5repack/testfiles/textlinkfar-mergeprune.textlinkfar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinkfar-prune.textlinkfar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinksrc-merge.textlinksrc.h5.tst create mode 100644 tools/test/h5repack/testfiles/textlinksrc-mergeprune.textlinksrc.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinksrc-prune.textlinksrc.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinktar-merge.textlinktar.h5.tst create mode 100644 tools/test/h5repack/testfiles/textlinktar-mergeprune.textlinktar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinktar-prune.textlinktar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/tsoftlinks-merge.tsoftlinks.h5.tst create mode 100644 tools/test/h5repack/testfiles/tsoftlinks-mergeprune.tsoftlinks.h5.ddl create mode 100644 tools/test/h5repack/testfiles/tsoftlinks-prune.tsoftlinks.h5.ddl diff --git a/MANIFEST b/MANIFEST index 6aaf772..826c0d5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2663,6 +2663,7 @@ #test files for h5repack ./tools/test/h5repack/testfiles/README ./tools/test/h5repack/testfiles/bounds_latest_latest.h5 +./tools/test/h5repack/testfiles/h5copy_extlinks_src.h5 ./tools/test/h5repack/testfiles/h5repack_aggr.h5 ./tools/test/h5repack/testfiles/h5repack_attr.h5 ./tools/test/h5repack/testfiles/h5repack_attr_refs.h5 @@ -2741,6 +2742,24 @@ ./tools/test/h5repack/testfiles/4_vds.h5-vds_compa-v.ddl ./tools/test/h5repack/testfiles/attrregion.tattrreg.h5.ddl ./tools/test/h5repack/testfiles/dataregion.tdatareg.h5.ddl +./tools/test/h5repack/testfiles/textlink-merge.textlink.h5.tst +./tools/test/h5repack/testfiles/textlink-mergeprune.textlink.h5.ddl +./tools/test/h5repack/testfiles/textlink-prune.textlink.h5.ddl +./tools/test/h5repack/testfiles/textlinkfar-merge.textlinkfar.h5.tst +./tools/test/h5repack/testfiles/textlinkfar-mergeprune.textlinkfar.h5.ddl +./tools/test/h5repack/testfiles/textlinkfar-prune.textlinkfar.h5.ddl +./tools/test/h5repack/testfiles/textlinksrc-merge.textlinksrc.h5.tst +./tools/test/h5repack/testfiles/textlinksrc-mergeprune.textlinksrc.h5.ddl +./tools/test/h5repack/testfiles/textlinksrc-prune.textlinksrc.h5.ddl +./tools/test/h5repack/testfiles/textlinktar-merge.textlinktar.h5.tst +./tools/test/h5repack/testfiles/textlinktar-mergeprune.textlinktar.h5.ddl +./tools/test/h5repack/testfiles/textlinktar-prune.textlinktar.h5.ddl +./tools/test/h5repack/testfiles/tsoftlinks-merge.tsoftlinks.h5.tst +./tools/test/h5repack/testfiles/tsoftlinks-mergeprune.tsoftlinks.h5.ddl +./tools/test/h5repack/testfiles/tsoftlinks-prune.tsoftlinks.h5.ddl +./tools/test/h5repack/testfiles/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst +./tools/test/h5repack/testfiles/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5.ddl +./tools/test/h5repack/testfiles/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5.ddl # jam utility and tests ./tools/src/h5jam/Makefile.am diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9cb9d53..45dee05 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -699,6 +699,17 @@ New Features Tools: ------ + - h5repack added options to control how external links are handled. + + Currently h5repack preserves external links and cannot copy and merge + data from the external files. Two options, merge and prune, were added to + control how to merge data from an external link into the resulting file. + --merge Follow external soft link recursively and merge data. + --prune Do not follow external soft links and remove link. + --merge --prune Follow external link, merge data and remove dangling link. + + (ADB - 2020/08/05, HDFFV-9984) + - h5repack was fixed to repack the reference attributes properly. The code line that checks if the update of reference inside a compound datatype is misplaced outside the code block loop that carries out the diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 1a1c2db..6167dd9 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -901,7 +901,7 @@ tmpfile(void) * link_info->trg_path must be freed out of this function *-------------------------------------------------------------------------*/ int -H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_t *link_info, hbool_t get_obj_type) +H5tools_get_symlink_info(hid_t file_id, const char *linkpath, h5tool_link_info_t *link_info, hbool_t get_obj_type) { htri_t l_ret; H5O_info2_t trg_oinfo; diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index 5b19ae7..a6e4d4e 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -212,8 +212,8 @@ main (int argc, const char *argv[]) unsigned flag = 0; unsigned verbose = 0; unsigned parents = 0; - hid_t ocpl_id = (-1); /* Object copy property list */ - hid_t lcpl_id = (-1); /* Link creation property list */ + hid_t ocpl_id = H5I_INVALID_HID; /* Object copy property list */ + hid_t lcpl_id = H5I_INVALID_HID; /* Link creation property list */ int opt; int li_ret; h5tool_link_info_t linkinfo; diff --git a/tools/src/h5repack/h5repack.h b/tools/src/h5repack/h5repack.h index caa1166..b124fdb 100644 --- a/tools/src/h5repack/h5repack.h +++ b/tools/src/h5repack/h5repack.h @@ -101,25 +101,27 @@ typedef struct { /* all the above, ready to go to the hrepack call */ typedef struct { - pack_opttbl_t *op_tbl; /*table with all -c and -f options */ - int all_layout; /*apply the layout to all objects */ - int all_filter; /*apply the filter to all objects */ + pack_opttbl_t *op_tbl; /* table with all -c and -f options */ + int all_layout; /* apply the layout to all objects */ + int all_filter; /* apply the filter to all objects */ filter_info_t filter_g[H5_REPACK_MAX_NFILTERS]; /*global filter array for the ALL case */ - int n_filter_g; /*number of global filters */ - chunk_info_t chunk_g; /*global chunk INFO for the ALL case */ - H5D_layout_t layout_g; /*global layout information for the ALL case */ - int verbose; /*verbose mode */ - hsize_t min_comp; /*minimum size to compress, in bytes */ - int use_native; /*use a native type in write */ - hbool_t latest; /*pack file with the latest file format */ - H5F_libver_t low_bound; /* The file's low bound as in H5Fset_libver_bounds() */ - H5F_libver_t high_bound; /* The file's high bound as in H5Fset_libver_bounds() */ - hid_t fin_fapl; /* FAPL to use for opening the input file */ - hid_t fout_fapl; /* FAPL to use for opening/creating the output file */ - int grp_compact; /* Set the maximum number of links to store as header messages in the group */ - int grp_indexed; /* Set the minimum number of links to store in the indexed format */ - int msg_size[8]; /* Minimum size of shared messages: dataspace, - datatype, fill value, filter pipleline, attribute */ + int n_filter_g; /* number of global filters */ + chunk_info_t chunk_g; /* global chunk INFO for the ALL case */ + H5D_layout_t layout_g; /* global layout information for the ALL case */ + int verbose; /* verbose mode */ + hbool_t merge; /* Merge external file. */ + hbool_t prune; /* Don't follow external file. */ + hsize_t min_comp; /* minimum size to compress, in bytes */ + int use_native; /* use a native type in write */ + hbool_t latest; /* pack file with the latest file format */ + H5F_libver_t low_bound; /* The file's low bound as in H5Fset_libver_bounds() */ + H5F_libver_t high_bound; /* The file's high bound as in H5Fset_libver_bounds() */ + hid_t fin_fapl; /* FAPL to use for opening the input file */ + hid_t fout_fapl; /* FAPL to use for opening/creating the output file */ + int grp_compact; /* Set the maximum number of links to store as header messages in the group */ + int grp_indexed; /* Set the minimum number of links to store in the indexed format */ + int msg_size[8]; /* Minimum size of shared messages: dataspace, + datatype, fill value, filter pipleline, attribute */ const char *ublock_filename; /* user block file name */ hsize_t ublock_size; /* user block size */ hsize_t meta_block_size; /* metadata aggregation block size (for H5Pset_meta_block_size) */ diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index b1d6ab4..8f3496f 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -594,6 +594,8 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, hid_t f_space_id = H5I_INVALID_HID; /* file space ID */ hid_t ftype_id = H5I_INVALID_HID; /* file type ID */ hid_t wtype_id = H5I_INVALID_HID; /* read/write type ID */ + hid_t ocpl_id = H5I_INVALID_HID; /* property to pass copy options */ + hid_t lcpl_id = H5I_INVALID_HID; /* link creation property list */ named_dt_t *named_dt_head = NULL; /* Pointer to the stack of named datatypes copied */ size_t msize; /* size of type */ hsize_t nelmts; /* number of elements in dataset */ @@ -610,6 +612,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, int req_filter; /* there was a request for a filter */ int req_obj_layout = 0; /* request layout to current object */ unsigned crt_order_flags; /* group creation order flag */ + h5tool_link_info_t linkinfo; unsigned i; unsigned u; int ifil; @@ -619,6 +622,9 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, hsize_t size_dset; int ret_value = 0; + /* init linkinfo struct */ + HDmemset(&linkinfo, 0, sizeof(h5tool_link_info_t)); + /*------------------------------------------------------------------------- * copy the supplied object list *------------------------------------------------------------------------- @@ -1137,26 +1143,25 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, *------------------------------------------------------------------------- */ else { - hid_t pid = H5I_INVALID_HID; - /* create property to pass copy options */ - if ((pid = H5Pcreate(H5P_OBJECT_COPY)) < 0) + if ((ocpl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pcreate failed"); /* set options for object copy */ - if (H5Pset_copy_object(pid, H5O_COPY_WITHOUT_ATTR_FLAG) < 0) + if (H5Pset_copy_object(ocpl_id, H5O_COPY_WITHOUT_ATTR_FLAG) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pset_copy_object failed"); if (H5Ocopy(fidin, /* Source file or group identifier */ travt->objs[i].name, /* Name of the source object to be copied */ fidout, /* Destination file or group identifier */ travt->objs[i].name, /* Name of the destination object */ - pid, /* Properties which apply to the copy */ + ocpl_id, /* Properties which apply to the copy */ H5P_DEFAULT) < 0) /* Properties which apply to the new hard link */ H5TOOLS_GOTO_ERROR((-1), "H5Ocopy failed"); - if (H5Pclose(pid) < 0) + if (H5Pclose(ocpl_id) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed"); + ocpl_id = H5I_INVALID_HID; /*------------------------------------------------------------------------- * Copy attrs manually @@ -1228,11 +1233,61 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, if (options->verbose) HDprintf(FORMAT_OBJ, "link", travt->objs[i].name); - if (H5Lcopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, H5P_DEFAULT, H5P_DEFAULT) < 0) - H5TOOLS_GOTO_ERROR((-1), "H5Lcopy failed"); + /* Check -X option. */ + if (options->merge) { + if (H5tools_get_symlink_info(fidin, travt->objs[i].name, &linkinfo, 1) == 0) { + /* dangling link */ + if (options->prune) { + HDprintf("Pruned %s.\n", travt->objs[i].name); + } + else { + if (H5Lcopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, H5P_DEFAULT, H5P_DEFAULT) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Lcopy failed"); + } + } + else { + /* valid link */ + /* create property to pass copy options */ + if ((ocpl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pcreate create property failed"); - if (options->verbose) - HDprintf(FORMAT_OBJ, "link", travt->objs[i].name); + /* set options for object copy */ + if (H5Pset_copy_object(ocpl_id, H5O_COPY_EXPAND_EXT_LINK_FLAG) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pset_copy_object failed"); + + /* Create link creation property list */ + if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) { + H5TOOLS_GOTO_ERROR((-1), "H5Pcreate link creation property failed"); + } + + /* Set flag for intermediate group creation */ + if (H5Pset_create_intermediate_group(lcpl_id, TRUE) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pset_create_intermediate_group failed"); + + if (H5Ocopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, ocpl_id, lcpl_id) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Ocopy failed"); + + if (H5Pclose(lcpl_id) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed"); + + if (H5Pclose(ocpl_id) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed"); + } + + /* free link info path */ + if (linkinfo.trg_path) + HDfree(linkinfo.trg_path); + linkinfo.trg_path = NULL; + } /* options->merge */ + else { + if (options->prune) { + HDprintf("Pruned %s.\n", travt->objs[i].name); + } + else { + if (H5Lcopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, H5P_DEFAULT, H5P_DEFAULT) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Lcopy failed"); + } + } break; default: @@ -1249,15 +1304,22 @@ done: if (named_datatype_free(&named_dt_head, 0) < 0) H5TOOLS_ERROR((-1), "named_datatype_free failed"); } - else + else { H5E_BEGIN_TRY { named_datatype_free(&named_dt_head, 1); } H5E_END_TRY; + } + + /* free link info path */ + if (linkinfo.trg_path) + HDfree(linkinfo.trg_path); H5E_BEGIN_TRY { H5Gclose(grp_in); H5Gclose(grp_out); + H5Pclose(lcpl_id); + H5Pclose(ocpl_id); H5Pclose(dcpl_in); H5Pclose(gcpl_in); H5Pclose(gcpl_out); diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 0ad61c0..cf0c611 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -32,36 +32,38 @@ const char *outfile = NULL; * Command-line options: The user can specify short or long-named * parameters. */ -static const char *s_opts = "hVvf:l:m:e:nLj:k:c:d:s:u:b:M:t:a:i:o:S:P:T:G:q:z:E"; +static const char *s_opts = "a:b:c:d:e:f:hi:j:k:l:m:no:q:s:t:u:vz:EG:LM:P:S:T:VXW1:2:3:4:5:6:"; static struct long_options l_opts[] = { - { "help", no_arg, 'h' }, - { "version", no_arg, 'V' }, - { "verbose", no_arg, 'v' }, + { "alignment", require_arg, 'a' }, + { "block", require_arg, 'b' }, + { "compact", require_arg, 'c' }, + { "indexed", require_arg, 'd' }, + { "file", require_arg, 'e' }, { "filter", require_arg, 'f' }, + { "help", no_arg, 'h' }, + { "infile", require_arg, 'i' }, /* for backward compability */ + { "low", require_arg, 'j' }, + { "high", require_arg, 'k' }, { "layout", require_arg, 'l' }, { "minimum", require_arg, 'm' }, - { "file", require_arg, 'e' }, { "native", no_arg, 'n' }, - { "latest", no_arg, 'L' }, - { "low", require_arg, 'j' }, - { "high", require_arg, 'k' }, - { "compact", require_arg, 'c' }, - { "indexed", require_arg, 'd' }, + { "outfile", require_arg, 'o' }, /* for backward compability */ + { "sort_by", require_arg, 'q' }, { "ssize", require_arg, 's' }, + { "threshold", require_arg, 't' }, { "ublock", require_arg, 'u' }, - { "block", require_arg, 'b' }, + { "verbose", no_arg, 'v' }, + { "sort_order", require_arg, 'z' }, + { "enable-error-stack", no_arg, 'E' }, + { "fs_pagesize", require_arg, 'G' }, + { "latest", no_arg, 'L' }, { "metadata_block_size", require_arg, 'M' }, - { "threshold", require_arg, 't' }, - { "alignment", require_arg, 'a' }, - { "infile", require_arg, 'i' }, /* for backward compability */ - { "outfile", require_arg, 'o' }, /* for backward compability */ - { "fs_strategy", require_arg, 'S' }, { "fs_persist", require_arg, 'P' }, + { "fs_strategy", require_arg, 'S' }, { "fs_threshold", require_arg, 'T' }, - { "fs_pagesize", require_arg, 'G' }, - { "sort_by", require_arg, 'q' }, - { "sort_order", require_arg, 'z' }, - { "enable-error-stack", no_arg, 'E' }, + { "version", no_arg, 'V' }, + { "merge", no_arg, 'X' }, + { "prune", no_arg, 'W' }, { "src-vol-value", require_arg, '1' }, { "src-vol-name", require_arg, '2' }, { "src-vol-info", require_arg, '3' }, @@ -113,6 +115,9 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " --high=BOUND The high bound for library release versions to use\n"); PRINTVALSTREAM(rawoutstream, " when creating objects in the file\n"); PRINTVALSTREAM(rawoutstream, " (default is H5F_LIBVER_LATEST)\n"); + PRINTVALSTREAM(rawoutstream, " --merge Follow external soft link recursively and merge data\n"); + PRINTVALSTREAM(rawoutstream, " --prune Do not follow external soft links and remove link\n"); + PRINTVALSTREAM(rawoutstream, " --merge --prune Follow external link, merge data and remove dangling link\n"); PRINTVALSTREAM(rawoutstream, " -c L1, --compact=L1 Maximum number of links in header messages\n"); PRINTVALSTREAM(rawoutstream, " -d L2, --indexed=L2 Minimum number of links in the indexed format\n"); PRINTVALSTREAM(rawoutstream, " -s S[:F], --ssize=S[:F] Shared object header message minimum size\n"); @@ -545,6 +550,14 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) options->high_bound = bound; break; + case 'X': + options->merge = TRUE; + break; + + case 'W': + options->prune = TRUE; + break; + case 'c': options->grp_compact = HDatoi( opt_arg ); if (options->grp_compact > 0) diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index afdf46c..173a5ce 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -8035,7 +8035,6 @@ void test_double_epsilon(const char *fname1, const char *fname2) { hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; hsize_t dims1[2] = { 4, 7 }; - hsize_t dims2[2] = { 4, 7 }; double wdata[4][7]; int i, j; diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 4823d07..2a34438 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -72,6 +72,14 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_paged_persist.h5 # h5diff/testfile ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr1.h5 + # tools/testfiles for external links + ${HDF5_TOOLS_DIR}/testfiles/tsoftlinks.h5 + ${HDF5_TOOLS_DIR}/testfiles/textlinkfar.h5 + ${HDF5_TOOLS_DIR}/testfiles/textlinksrc.h5 + ${HDF5_TOOLS_DIR}/testfiles/textlinktar.h5 + ${HDF5_TOOLS_DIR}/testfiles/textlink.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5copy_extlinks_src.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5copy_extlinks_trg.h5 # tools/testfiles ${HDF5_TOOLS_DIR}/testfiles/tfamily00000.h5 ${HDF5_TOOLS_DIR}/testfiles/tfamily00001.h5 @@ -128,6 +136,13 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_version_test.h5repack_layout.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_zero.h5repack_layout.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/plugin_none.h5repack_layout.UD.h5 + # tools/testfiles for external links + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/tsoftlinks-merge.tsoftlinks.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinkfar-merge.textlinkfar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinksrc-merge.textlinksrc.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinktar-merge.textlinktar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlink-merge.textlink.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5 ) set (LIST_DDL_TEST_FILES @@ -154,6 +169,19 @@ # refs ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/attrregion.tattrreg.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/dataregion.tdatareg.h5 + # tools/testfiles for external links + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinkfar-prune.textlinkfar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinksrc-prune.textlinksrc.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinktar-prune.textlinktar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlink-prune.textlink.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/tsoftlinks-prune.tsoftlinks.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinkfar-mergeprune.textlinkfar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinksrc-mergeprune.textlinksrc.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinktar-mergeprune.textlinktar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlink-mergeprune.textlink.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/tsoftlinks-mergeprune.tsoftlinks.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5 ) foreach (h5_file ${LIST_HDF5_TEST_FILES}) @@ -276,7 +304,7 @@ endif () endmacro () - macro (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) + macro (ADD_H5_FILTER_TEST testname testfilter testtype resultcode resultfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -410,6 +438,48 @@ endif () endmacro () + macro (ADD_H5_DIFF_TEST testname testtype resultcode testfile) + if ("${testtype}" STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_DIFF-${testname} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" + ) + set_property(TEST H5REPACK_DIFF-${testname} PROPERTY DISABLED) + endif () + else () + add_test ( + NAME H5REPACK_DIFF-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_DIFF-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED clear_h5repack + ) + add_test ( + NAME H5REPACK_DIFF-${testname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_DIFF-${testname} PROPERTIES + DEPENDS H5REPACK_DIFF-${testname}-clear-objects + ) + add_test ( + NAME H5REPACK_DIFF-${testname}_DFF + COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;--enable-error-stack;${testfile};out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=out-${testname}.${testfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${testname}.${testfile}.tst" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5REPACK_DIFF-${testname}_DFF PROPERTIES + DEPENDS H5REPACK_DIFF-${testname} + ) + endif () + endmacro () + macro (ADD_H5_STAT_TEST testname testtype resultcode statarg resultfile) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -1148,7 +1218,7 @@ if (NOT USE_FILTER_DEFLATE) set (TESTTYPE "SKIP") endif () - ADD_H5_CMP_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) + ADD_H5_FILTER_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) ########################################################### # the following tests assume the input files have filters @@ -1540,6 +1610,45 @@ ADD_H5_EXTERNAL_TEST (ext_int32le_3d "TEST" int32le_3d -l CONTI) ADD_H5_EXTERNAL_TEST (ext_uint8be "TEST" uint8be -l CONTI) ############################################################################## +### E X T E R N A L L I N K T E S T S +############################################################################## +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DMP_TEST (h5copy_extlinks_src-base "TEST" 0 h5copy_extlinks_src.h5 --enable-error-stack) +ADD_H5_DMP_TEST (tsoftlinks-base "TEST" 0 tsoftlinks.h5 --enable-error-stack) +ADD_H5_DMP_TEST (textlink-base "TEST" 0 textlink.h5 --enable-error-stack) +ADD_H5_DMP_TEST (textlinkfar-base "TEST" 0 textlinkfar.h5 --enable-error-stack) +ADD_H5_DMP_TEST (textlinksrc-base "TEST" 0 textlinksrc.h5 --enable-error-stack) +ADD_H5_DMP_TEST (textlinktar-base "TEST" 0 textlinktar.h5 --enable-error-stack) + +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DIFF_TEST (textlinksrc-merge "TEST" 1 textlinksrc.h5 --merge) +ADD_H5_DIFF_TEST (tsoftlinks-merge "TEST" 1 tsoftlinks.h5 --merge) +ADD_H5_DIFF_TEST (textlink-merge "TEST" 0 textlink.h5 --merge) +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DIFF_TEST (textlinkfar-merge "TEST" 1 textlinkfar.h5 --merge) +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DIFF_TEST (textlinktar-merge "TEST" 1 textlinktar.h5 --merge) +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DIFF_TEST (h5copy_extlinks_src-merge "TEST" 0 h5copy_extlinks_src.h5 --merge) + +ADD_H5_DMP_TEST (h5copy_extlinks_src-prune "TEST" 0 h5copy_extlinks_src.h5 --prune --enable-error-stack) +ADD_H5_DMP_TEST (tsoftlinks-prune "TEST" 0 tsoftlinks.h5 --prune --enable-error-stack) +ADD_H5_DMP_TEST (textlink-prune "TEST" 0 textlink.h5 --prune --enable-error-stack) +ADD_H5_DMP_TEST (textlinkfar-prune "TEST" 0 textlinkfar.h5 --prune --enable-error-stack) +ADD_H5_DMP_TEST (textlinksrc-prune "TEST" 0 textlinksrc.h5 --prune --enable-error-stack) +ADD_H5_DMP_TEST (textlinktar-prune "TEST" 0 textlinktar.h5 --prune --enable-error-stack) + +ADD_H5_DMP_TEST (h5copy_extlinks_src-mergeprune "TEST" 0 h5copy_extlinks_src.h5 --merge --prune --enable-error-stack) +ADD_H5_DMP_TEST (tsoftlinks-mergeprune "TEST" 0 tsoftlinks.h5 --merge --prune --enable-error-stack) +ADD_H5_DMP_TEST (textlink-mergeprune "TEST" 0 textlink.h5 --merge --prune --enable-error-stack) +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DMP_TEST (textlinkfar-mergeprune "TEST" 0 textlinkfar.h5 --merge --prune --enable-error-stack) +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DMP_TEST (textlinksrc-mergeprune "TEST" 0 textlinksrc.h5 --merge --prune --enable-error-stack) +### HDFFV-11128 needs fixed to enable the following test +#ADD_H5_DMP_TEST (textlinktar-mergeprune "TEST" 0 textlinktar.h5 --merge --prune --enable-error-stack) + +############################################################################## ### P L U G I N T E S T S ############################################################################## if (BUILD_SHARED_LIBS) diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index ad6fef8..3d4e0ea 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -92,10 +92,18 @@ $SRC_H5REPACK_TESTFILES/h5repack_attr_refs.h5 $SRC_H5REPACK_TESTFILES/h5repack_deflate.h5 $SRC_H5REPACK_TESTFILES/h5repack_early.h5 $SRC_H5REPACK_TESTFILES/h5repack_ext.h5 +$SRC_H5REPACK_TESTFILES/h5repack_f32le.h5 +$SRC_H5REPACK_TESTFILES/h5repack_f32le_ex.h5 $SRC_H5REPACK_TESTFILES/h5repack_fill.h5 $SRC_H5REPACK_TESTFILES/h5repack_filters.h5 $SRC_H5REPACK_TESTFILES/h5repack_fletcher.h5 $SRC_H5REPACK_TESTFILES/h5repack_hlink.h5 +$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d.h5 +$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d_ex.h5 +$SRC_H5REPACK_TESTFILES/h5repack_int32le_2d.h5 +$SRC_H5REPACK_TESTFILES/h5repack_int32le_2d_ex.h5 +$SRC_H5REPACK_TESTFILES/h5repack_int32le_3d.h5 +$SRC_H5REPACK_TESTFILES/h5repack_int32le_3d_ex.h5 $SRC_H5REPACK_TESTFILES/h5repack_layout.h5 $SRC_H5REPACK_TESTFILES/h5repack_layouto.h5 $SRC_H5REPACK_TESTFILES/h5repack_layout2.h5 @@ -109,23 +117,26 @@ $SRC_H5REPACK_TESTFILES/h5repack_refs.h5 $SRC_H5REPACK_TESTFILES/h5repack_shuffle.h5 $SRC_H5REPACK_TESTFILES/h5repack_soffset.h5 $SRC_H5REPACK_TESTFILES/h5repack_szip.h5 +$SRC_H5REPACK_TESTFILES/h5repack_uint8be.h5 +$SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex.h5 +########fsm#files######## $SRC_H5REPACK_TESTFILES/h5repack_aggr.h5 $SRC_H5REPACK_TESTFILES/h5repack_fsm_aggr_nopersist.h5 $SRC_H5REPACK_TESTFILES/h5repack_fsm_aggr_persist.h5 $SRC_H5REPACK_TESTFILES/h5repack_none.h5 $SRC_H5REPACK_TESTFILES/h5repack_paged_nopersist.h5 $SRC_H5REPACK_TESTFILES/h5repack_paged_persist.h5 -$SRC_H5REPACK_TESTFILES/h5repack_f32le.h5 -$SRC_H5REPACK_TESTFILES/h5repack_f32le_ex.h5 -$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d.h5 -$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d_ex.h5 -$SRC_H5REPACK_TESTFILES/h5repack_int32le_2d.h5 -$SRC_H5REPACK_TESTFILES/h5repack_int32le_2d_ex.h5 -$SRC_H5REPACK_TESTFILES/h5repack_int32le_3d.h5 -$SRC_H5REPACK_TESTFILES/h5repack_int32le_3d_ex.h5 -$SRC_H5REPACK_TESTFILES/h5repack_uint8be.h5 -$SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex.h5 +########h5diff/testfile######## $SRC_H5DIFF_TESTFILES/h5diff_attr1.h5 +########tools/testfiles#for#external#links######## +$SRC_TOOLS_TESTFILES/tsoftlinks.h5 +$SRC_TOOLS_TESTFILES/textlinkfar.h5 +$SRC_TOOLS_TESTFILES/textlinksrc.h5 +$SRC_TOOLS_TESTFILES/textlinktar.h5 +$SRC_TOOLS_TESTFILES/textlink.h5 +$SRC_H5REPACK_TESTFILES/h5copy_extlinks_src.h5 +$SRC_H5REPACK_TESTFILES/h5copy_extlinks_trg.h5 +########tools/testfiles######## $SRC_TOOLS_TESTFILES/tfamily00000.h5 $SRC_TOOLS_TESTFILES/tfamily00001.h5 $SRC_TOOLS_TESTFILES/tfamily00002.h5 @@ -138,6 +149,8 @@ $SRC_TOOLS_TESTFILES/tfamily00008.h5 $SRC_TOOLS_TESTFILES/tfamily00009.h5 $SRC_TOOLS_TESTFILES/tfamily00010.h5 $SRC_TOOLS_TESTFILES/tordergr.h5 +########reference#conversion#files######## +########tools/testfiles/vds######## $SRC_TOOLS_TESTFILES/vds/1_a.h5 $SRC_TOOLS_TESTFILES/vds/1_b.h5 $SRC_TOOLS_TESTFILES/vds/1_c.h5 @@ -168,33 +181,61 @@ $SRC_H5REPACK_TESTFILES/h5repack-help.txt $SRC_H5REPACK_TESTFILES/h5repack_ext.bin $SRC_H5REPACK_TESTFILES/ublock.bin $SRC_H5REPACK_TESTFILES/h5repack.info -$SRC_H5REPACK_TESTFILES/crtorder.tordergr.h5.ddl -$SRC_H5REPACK_TESTFILES/deflate_limit.h5repack_layout.h5.ddl +########dat#files######## $SRC_H5REPACK_TESTFILES/h5repack_f32le_ex-0.dat $SRC_H5REPACK_TESTFILES/h5repack_int32le_1d_ex-0.dat $SRC_H5REPACK_TESTFILES/h5repack_int32le_1d_ex-1.dat $SRC_H5REPACK_TESTFILES/h5repack_int32le_2d_ex-0.dat $SRC_H5REPACK_TESTFILES/h5repack_int32le_3d_ex-0.dat -$SRC_H5REPACK_TESTFILES/h5repack_layout.h5.ddl -$SRC_H5REPACK_TESTFILES/h5repack_filters.h5-gzip_verbose_filters.tst -$SRC_H5REPACK_TESTFILES/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst -$SRC_H5REPACK_TESTFILES/h5repack_layout.h5-plugin_test.ddl $SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-0.dat $SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-1.dat $SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-2.dat $SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-3.dat -$SRC_H5REPACK_TESTFILES/plugin_test.h5repack_layout.h5.tst -$SRC_H5REPACK_TESTFILES/1_vds.h5-vds_dset_chunk20x10x5-v.ddl -$SRC_H5REPACK_TESTFILES/2_vds.h5-vds_chunk3x6x9-v.ddl -$SRC_H5REPACK_TESTFILES/3_1_vds.h5-vds_chunk2x5x8-v.ddl -$SRC_H5REPACK_TESTFILES/4_vds.h5-vds_compa-v.ddl -$SRC_H5REPACK_TESTFILES/4_vds.h5-vds_conti-v.ddl +############### +$SRC_H5REPACK_TESTFILES/crtorder.tordergr.h5.ddl +$SRC_H5REPACK_TESTFILES/deflate_limit.h5repack_layout.h5.ddl +$SRC_H5REPACK_TESTFILES/h5repack_layout.h5.ddl +$SRC_H5REPACK_TESTFILES/h5repack_layout.h5-plugin_test.ddl +########fsm#files######## $SRC_H5REPACK_TESTFILES/SP.h5repack_fsm_aggr_nopersist.h5.ddl $SRC_H5REPACK_TESTFILES/S.h5repack_fsm_aggr_persist.h5.ddl $SRC_H5REPACK_TESTFILES/STG.h5repack_none.h5.ddl $SRC_H5REPACK_TESTFILES/GS.h5repack_paged_nopersist.h5.ddl $SRC_H5REPACK_TESTFILES/SP.h5repack_paged_persist.h5.ddl $SRC_H5REPACK_TESTFILES/SPT.h5repack_aggr.h5.ddl +########vds#files######## +$SRC_H5REPACK_TESTFILES/1_vds.h5-vds_dset_chunk20x10x5-v.ddl +$SRC_H5REPACK_TESTFILES/2_vds.h5-vds_chunk3x6x9-v.ddl +$SRC_H5REPACK_TESTFILES/3_1_vds.h5-vds_chunk2x5x8-v.ddl +$SRC_H5REPACK_TESTFILES/4_vds.h5-vds_compa-v.ddl +$SRC_H5REPACK_TESTFILES/4_vds.h5-vds_conti-v.ddl +########refs#files######## +$SRC_H5REPACK_TESTFILES/attrregion.tattrreg.h5.ddl +$SRC_H5REPACK_TESTFILES/dataregion.tdatareg.h5.ddl +########external#links#files######## +$SRC_H5REPACK_TESTFILES/textlinkfar-prune.textlinkfar.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinksrc-prune.textlinksrc.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinktar-prune.textlinktar.h5.ddl +$SRC_H5REPACK_TESTFILES/textlink-prune.textlink.h5.ddl +$SRC_H5REPACK_TESTFILES/tsoftlinks-prune.tsoftlinks.h5.ddl +$SRC_H5REPACK_TESTFILES/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinkfar-mergeprune.textlinkfar.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinksrc-mergeprune.textlinksrc.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinktar-mergeprune.textlinktar.h5.ddl +$SRC_H5REPACK_TESTFILES/textlink-mergeprune.textlink.h5.ddl +$SRC_H5REPACK_TESTFILES/tsoftlinks-mergeprune.tsoftlinks.h5.ddl +$SRC_H5REPACK_TESTFILES/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5.ddl +########tst#files######## +$SRC_H5REPACK_TESTFILES/h5repack_filters.h5-gzip_verbose_filters.tst +$SRC_H5REPACK_TESTFILES/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst +$SRC_H5REPACK_TESTFILES/plugin_test.h5repack_layout.h5.tst +########external#links#tst#files######## +$SRC_H5REPACK_TESTFILES/tsoftlinks-merge.tsoftlinks.h5.tst +$SRC_H5REPACK_TESTFILES/textlinkfar-merge.textlinkfar.h5.tst +$SRC_H5REPACK_TESTFILES/textlinksrc-merge.textlinksrc.h5.tst +$SRC_H5REPACK_TESTFILES/textlinktar-merge.textlinktar.h5.tst +$SRC_H5REPACK_TESTFILES/textlink-merge.textlink.h5.tst +$SRC_H5REPACK_TESTFILES/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst " # @@ -271,6 +312,12 @@ SKIP() { echo " -SKIP-" } +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + # Call the h5diff tool # DIFFTEST() @@ -619,25 +666,6 @@ VERIFY_INVALIDBOUNDS() } # end of VERIFY_INVALIDBOUNDS # ----------------------------------------------------------------------------- -# Expect h5diff to fail -# ----------------------------------------------------------------------------- -DIFFFAIL() -{ - VERIFY h5diff unequal $@ - ( - cd $TESTDIR - $RUNSERIAL $H5DIFF_BIN -q "$@" - ) - RET=$? - if [ $RET == 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - else - echo " PASSED" - fi -} - -# ----------------------------------------------------------------------------- # Catchall test for repacking with external files # Loops over all (internally-listed) cases and applies the given arguments # to h5repack. @@ -805,6 +833,121 @@ TOOLTESTV() rm -f $outfile } +# This is same as TOOLTESTV() with comparing display output +# with actual filename swapped +# +TOOLTESTSV() +{ + expect="$TESTDIR/$1.$2.tst" + actual="$TESTDIR/`basename $2 .ddl`.out" + actual_err="$TESTDIR/`basename $2 .ddl`.err" + + infile=$2 + outfile=out-$1.$2 + shift + shift + + # Run test. + TESTING $H5REPACK $@ + ( + cd $TESTDIR + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) >$actual 2>$actual_err + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + VERIFY h5diff unequal $@ + ( + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN -v $infile $outfile + ) >$actual 2>$actual_err + RET=$? + if [ $RET == 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + fi + fi + + # display output compare + STDOUT_FILTER $actual + cat $actual_err >> $actual + + VERIFY output from $H5REPACK $@ + if cmp -s $expect $actual; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.tst) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && diff -c $expect $actual |sed 's/^/ /' + fi + + rm -f $actual $actual_err + rm -f $outfile +} + +# This is same as TOOLTESTSV() but expects a diff fail +# +TOOLFAILSV() +{ + expect="$TESTDIR/$1.$2.tst" + actual="$TESTDIR/`basename $2 .ddl`.out" + actual_err="$TESTDIR/`basename $2 .ddl`.err" + + infile=$2 + outfile=out-$1.$2 + shift + shift + + # Run test. + TESTING $H5REPACK $@ + ( + cd $TESTDIR + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) >$actual 2>$actual_err + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + VERIFY h5diff unequal $@ + ( + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN -v $infile $outfile + ) >$actual 2>$actual_err + RET=$? + if [ $RET == 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + fi + fi + + # display output compare + STDOUT_FILTER $actual + cat $actual_err >> $actual + + VERIFY output from $H5REPACK $@ + if cmp -s $expect $actual; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.tst) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && diff -c $expect $actual |sed 's/^/ /' + fi + + rm -f $actual $actual_err + rm -f $outfile +} + # same as TOOLTESTV but filters error stack output and compares to an error file # Extract file name, line number, version and thread IDs because they may be different # ADD_H5ERR_MASK_TEST @@ -1356,44 +1499,28 @@ TOOLTEST_STAT SPT $arg # layout options (these files have no filters) ######################################################### VERIFY_LAYOUT_DSET dset2_chunk_20x10 h5repack_layout.h5 dset2 CHUNKED --layout dset2:CHUNK=20x10 - VERIFY_LAYOUT_ALL chunk_20x10 h5repack_layout.h5 CHUNKED -l CHUNK=20x10 - VERIFY_LAYOUT_DSET dset2_conti h5repack_layout.h5 dset2 CONTIGUOUS -l dset2:CONTI - VERIFY_LAYOUT_ALL conti h5repack_layout.h5 CONTIGUOUS -l CONTI - VERIFY_LAYOUT_DSET dset2_compa h5repack_layout.h5 dset2 COMPACT -l dset2:COMPA - VERIFY_LAYOUT_ALL compa h5repack_layout.h5 COMPACT -l COMPA - TOOLTESTM dset2_chunk_20x10-errstk h5repack_layout.h5 --layout=dset2:CHUNK=20x10x5 --enable-error-stack ################################################################ # layout conversions (file has no filters) ############################################################### - VERIFY_LAYOUT_DSET dset_compa_conti h5repack_layout.h5 dset_compact CONTIGUOUS -l dset_compact:CONTI - VERIFY_LAYOUT_DSET dset_compa_chunk h5repack_layout.h5 dset_compact CHUNKED -l dset_compact:CHUNK=2x5 - VERIFY_LAYOUT_DSET dset_compa_compa h5repack_layout.h5 dset_compact COMPACT -l dset_compact:COMPA - VERIFY_LAYOUT_DSET dset_conti_compa h5repack_layout.h5 dset_contiguous COMPACT -l dset_contiguous:COMPA - VERIFY_LAYOUT_DSET dset_conti_chunk h5repack_layout.h5 dset_contiguous CHUNKED -l dset_contiguous:CHUNK=3x6 - VERIFY_LAYOUT_DSET dset_conti_conti h5repack_layout.h5 dset_contiguous CONTIGUOUS -l dset_contiguous:CONTI - VERIFY_LAYOUT_DSET chunk_compa h5repack_layout.h5 dset_chunk COMPACT -l dset_chunk:COMPA - VERIFY_LAYOUT_DSET chunk_conti h5repack_layout.h5 dset_chunk CONTIGUOUS -l dset_chunk:CONTI - VERIFY_LAYOUT_DSET chunk_18x13 h5repack_layout.h5 dset_chunk CHUNKED -l dset_chunk:CHUNK=18x13 # test convert small size dataset ( < 1k) to compact layout without -m VERIFY_LAYOUT_DSET contig_small_compa h5repack_layout2.h5 contig_small COMPACT -l contig_small:COMPA - VERIFY_LAYOUT_DSET contig_small_fixed_compa h5repack_layout2.h5 chunked_small_fixed COMPACT -l chunked_small_fixed:COMPA #--------------------------------------------------------------------------- @@ -1421,6 +1548,7 @@ VERIFY_LAYOUT_DSET chunk2compa h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk # chunk dim is bigger than dataset dim. ( dset size < 64k ) VERIFY_LAYOUT_DSET error1 h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED -f chunk_unlimit1:NONE # chunk dim is bigger than dataset dim. ( dset size > 64k ) + VERIFY_LAYOUT_DSET error2 h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED -f chunk_unlimit2:NONE # chunk dims are smaller than dataset dims. ( dset size < 64k ) @@ -1435,7 +1563,6 @@ TOOLTEST error4 h5repack_layout3.h5 -f NONE # (dset size < 64K) and with unlimited max dims on a condition as follow. # (HDFFV-8214) #-------------------------------------------------------------------------- - # chunk dim is bigger than dataset dim. should succeed. VERIFY_LAYOUT_DSET ckdim_biger h5repack_layout3.h5 chunk_unlimit2 CONTI -l chunk_unlimit2:CONTI # chunk dim is smaller than dataset dim. should succeed. @@ -1466,7 +1593,6 @@ else fi # several global filters - arg="h5repack_layout.h5 --filter GZIP=1 --filter SHUF" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg @@ -1562,9 +1688,15 @@ else VERIFY_LAYOUT_VDS vds_conti 4_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI fi -######################################################### -# Testing version bounds -######################################################### +################################################################ +# reference new api conversions +############################################################### +#TOOLTEST_DUMP attrregion tattrreg.h5 +#TOOLTEST_DUMP dataregion tdatareg.h5 + +############################################################################## +### V E R S I O N B O U N D S T E S T S +############################################################################## # -j 0 -k 2, superblock will be 0 VERIFY_SUPERBLOCK 0 2 0 h5repack_layout.h5 -j 0 -k 2 h5repack_layout.h5 # -j 1 -k 2, superblock will be 2 @@ -1574,11 +1706,49 @@ VERIFY_SUPERBLOCK 2 2 3 h5repack_layout.h5 -j 2 -k 2 h5repack_layout.h5 # -j 0 -k 1, file cannot be opened VERIFY_INVALIDBOUNDS 0 1 bounds_latest_latest.h5 -######################################## -# Testing external storage -######################################## +############################################################################## +### E X T E R N A L S T O R A G E T E S T S +############################################################################## VERIFY_EXTERNAL_CONSOLIDATION -l CONTI +############################################################################## +### E X T E R N A L L I N K T E S T S +############################################################################## +### HDFFV-11128 needs fixed to enable the following test +#TOOLTEST_DUMP h5copy_extlinks_src-base h5copy_extlinks_src.h5 --enable-error-stack +TOOLTEST_DUMP tsoftlinks-base tsoftlinks.h5 --enable-error-stack +TOOLTEST_DUMP textlink-base textlink.h5 --enable-error-stack +TOOLTEST_DUMP textlinkfar-base textlinkfar.h5 --enable-error-stack +TOOLTEST_DUMP textlinksrc-base textlinksrc.h5 --enable-error-stack +TOOLTEST_DUMP textlinktar-base textlinktar.h5 --enable-error-stack + +TOOLTESTSV h5copy_extlinks_src-merge h5copy_extlinks_src.h5 --merge +TOOLFAILSV tsoftlinks-merge tsoftlinks.h5 --merge +TOOLTESTSV textlink-merge textlink.h5 --merge +### HDFFV-11128 needs fixed to enable the following test +#TOOLFAILSV textlinkfar-merge textlinkfar.h5 --merge +### HDFFV-11128 needs fixed to enable the following test +#TOOLFAILSV textlinksrc-merge textlinksrc.h5 --merge +### HDFFV-11128 needs fixed to enable the following test +#TOOLFAILSV textlinktar-merge textlinktar.h5 --merge + +TOOLTEST_DUMP h5copy_extlinks_src-prune h5copy_extlinks_src.h5 --prune --enable-error-stack +TOOLTEST_DUMP tsoftlinks-prune tsoftlinks.h5 --prune --enable-error-stack +TOOLTEST_DUMP textlink-prune textlink.h5 --prune --enable-error-stack +TOOLTEST_DUMP textlinkfar-prune textlinkfar.h5 --prune --enable-error-stack +TOOLTEST_DUMP textlinksrc-prune textlinksrc.h5 --prune --enable-error-stack +TOOLTEST_DUMP textlinktar-prune textlinktar.h5 --prune --enable-error-stack + +TOOLTEST_DUMP h5copy_extlinks_src-mergeprune h5copy_extlinks_src.h5 --merge --prune --enable-error-stack +TOOLTEST_DUMP tsoftlinks-mergeprune tsoftlinks.h5 --merge --prune --enable-error-stack +TOOLTEST_DUMP textlink-mergeprune textlink.h5 --merge --prune --enable-error-stack +### HDFFV-11128 needs fixed to enable the following test +#TOOLTEST_DUMP textlinkfar-mergeprune textlinkfar.h5 --merge --prune --enable-error-stack +### HDFFV-11128 needs fixed to enable the following test +#TOOLTEST_DUMP textlinksrc-mergeprune textlinksrc.h5 --merge --prune --enable-error-stack +### HDFFV-11128 needs fixed to enable the following test +#TOOLTEST_DUMP textlinktar-mergeprune textlinktar.h5 --merge --prune --enable-error-stack + # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR diff --git a/tools/test/h5repack/testfiles/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst b/tools/test/h5repack/testfiles/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst new file mode 100644 index 0000000..52f215d --- /dev/null +++ b/tools/test/h5repack/testfiles/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst @@ -0,0 +1,26 @@ + +file1 file2 +--------------------------------------- + x x / + x x /group_ext + x x /group_ext/extlink_datatype + x x /group_ext/extlink_dset + x x /group_ext/extlink_grp + x x /group_ext/extlink_notyet1 + x x /group_ext/extlink_notyet2 + +group : and +0 differences found +group : and +0 differences found +Not comparable: is of type H5G_UDLINK and is of type H5G_TYPE +Not comparable: is of type H5G_UDLINK and is of type H5G_DATASET +Not comparable: is of type H5G_UDLINK and is of type H5G_GROUP +external link: and +0 differences found +external link: and +0 differences found +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. diff --git a/tools/test/h5repack/testfiles/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5.ddl b/tools/test/h5repack/testfiles/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5.ddl new file mode 100644 index 0000000..ad8a320 --- /dev/null +++ b/tools/test/h5repack/testfiles/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5.ddl @@ -0,0 +1,28 @@ +HDF5 "out-h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5" { +GROUP "/" { + GROUP "group_ext" { + DATATYPE "extlink_datatype" H5T_STD_I32LE; + DATASET "extlink_dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2200 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "extlink_grp" { + } + } +} +} diff --git a/tools/test/h5repack/testfiles/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5.ddl b/tools/test/h5repack/testfiles/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5.ddl new file mode 100644 index 0000000..b7d7bca --- /dev/null +++ b/tools/test/h5repack/testfiles/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5.ddl @@ -0,0 +1,6 @@ +HDF5 "out-h5copy_extlinks_src-prune.h5copy_extlinks_src.h5" { +GROUP "/" { + GROUP "group_ext" { + } +} +} diff --git a/tools/test/h5repack/testfiles/h5copy_extlinks_src.h5 b/tools/test/h5repack/testfiles/h5copy_extlinks_src.h5 new file mode 100644 index 0000000..7b8621e Binary files /dev/null and b/tools/test/h5repack/testfiles/h5copy_extlinks_src.h5 differ diff --git a/tools/test/h5repack/testfiles/h5copy_extlinks_trg.h5 b/tools/test/h5repack/testfiles/h5copy_extlinks_trg.h5 new file mode 100644 index 0000000..3a0242d Binary files /dev/null and b/tools/test/h5repack/testfiles/h5copy_extlinks_trg.h5 differ diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt index 00fae24..e12838d 100644 --- a/tools/test/h5repack/testfiles/h5repack-help.txt +++ b/tools/test/h5repack/testfiles/h5repack-help.txt @@ -29,6 +29,9 @@ usage: h5repack [OPTIONS] file1 file2 --high=BOUND The high bound for library release versions to use when creating objects in the file (default is H5F_LIBVER_LATEST) + --merge Follow external soft link recursively and merge data + --prune Do not follow external soft links and remove link + --merge --prune Follow external link, merge data and remove dangling link -c L1, --compact=L1 Maximum number of links in header messages -d L2, --indexed=L2 Minimum number of links in the indexed format -s S[:F], --ssize=S[:F] Shared object header message minimum size diff --git a/tools/test/h5repack/testfiles/textlink-merge.textlink.h5.tst b/tools/test/h5repack/testfiles/textlink-merge.textlink.h5.tst new file mode 100644 index 0000000..a7ff71d --- /dev/null +++ b/tools/test/h5repack/testfiles/textlink-merge.textlink.h5.tst @@ -0,0 +1,13 @@ + +file1 file2 +--------------------------------------- + x x / + x x /extlink1 + x x /extlink2 + +group : and +0 differences found +external link: and +0 differences found +external link: and +0 differences found diff --git a/tools/test/h5repack/testfiles/textlink-mergeprune.textlink.h5.ddl b/tools/test/h5repack/testfiles/textlink-mergeprune.textlink.h5.ddl new file mode 100644 index 0000000..7206ae9 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlink-mergeprune.textlink.h5.ddl @@ -0,0 +1,4 @@ +HDF5 "out-textlink-mergeprune.textlink.h5" { +GROUP "/" { +} +} diff --git a/tools/test/h5repack/testfiles/textlink-prune.textlink.h5.ddl b/tools/test/h5repack/testfiles/textlink-prune.textlink.h5.ddl new file mode 100644 index 0000000..83db344 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlink-prune.textlink.h5.ddl @@ -0,0 +1,4 @@ +HDF5 "out-textlink-prune.textlink.h5" { +GROUP "/" { +} +} diff --git a/tools/test/h5repack/testfiles/textlinkfar-merge.textlinkfar.h5.tst b/tools/test/h5repack/testfiles/textlinkfar-merge.textlinkfar.h5.tst new file mode 100644 index 0000000..6673d39 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinkfar-merge.textlinkfar.h5.tst @@ -0,0 +1,20 @@ + +file1 file2 +--------------------------------------- + x x / + x x /src_file + x /src_file/ext2soft_link1 + x /src_file/ext2softdangle_link1 + x /src_file/ext_link1 + x /src_file/ext_link2 + x /src_file/ext_link3 + x /src_file/ext_link4 + x /src_file/ext_link5 + +group : and +0 differences found +Not comparable: is of type H5G_UDLINK and is of type H5G_GROUP +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. diff --git a/tools/test/h5repack/testfiles/textlinkfar-mergeprune.textlinkfar.h5.ddl b/tools/test/h5repack/testfiles/textlinkfar-mergeprune.textlinkfar.h5.ddl new file mode 100644 index 0000000..7ba3308 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinkfar-mergeprune.textlinkfar.h5.ddl @@ -0,0 +1,152 @@ +HDF5 "out-textlinkfar-mergeprune.textlinkfar.h5" { +GROUP "/" { + GROUP "src_file" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + HARDLINK "/dset1" + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + HARDLINK "/group" + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + HARDLINK "/dset" + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" HARDLINK "/type" + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + HARDLINK "/empty_group" + } + } + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinkfar-prune.textlinkfar.h5.ddl b/tools/test/h5repack/testfiles/textlinkfar-prune.textlinkfar.h5.ddl new file mode 100644 index 0000000..30f8f1b --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinkfar-prune.textlinkfar.h5.ddl @@ -0,0 +1,4 @@ +HDF5 "out-textlinkfar-prune.textlinkfar.h5" { +GROUP "/" { +} +} diff --git a/tools/test/h5repack/testfiles/textlinksrc-merge.textlinksrc.h5.tst b/tools/test/h5repack/testfiles/textlinksrc-merge.textlinksrc.h5.tst new file mode 100644 index 0000000..d5a5902 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinksrc-merge.textlinksrc.h5.tst @@ -0,0 +1,32 @@ + +file1 file2 +--------------------------------------- + x x / + x x /ext2soft_link1 + x x /ext2softdangle_link1 + x x /ext_link1 + x /ext_link1/dset + x /ext_link1/elink_t1 + x /ext_link1/elink_t2 + x /ext_link1/subgroup + x /ext_link1/subgroup/link_to_group + x x /ext_link2 + x x /ext_link3 + x x /ext_link4 + x x /ext_link5 + +group : and +0 differences found +Not comparable: is of type H5G_UDLINK and is of type H5G_DATASET +external link: and +0 differences found +Not comparable: is of type H5G_UDLINK and is of type H5G_GROUP +Not comparable: is of type H5G_UDLINK and is of type H5G_DATASET +Not comparable: is of type H5G_UDLINK and is of type H5G_TYPE +external link: and +0 differences found +Not comparable: is of type H5G_UDLINK and is of type H5G_GROUP +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. diff --git a/tools/test/h5repack/testfiles/textlinksrc-mergeprune.textlinksrc.h5.ddl b/tools/test/h5repack/testfiles/textlinksrc-mergeprune.textlinksrc.h5.ddl new file mode 100644 index 0000000..5b3c740 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinksrc-mergeprune.textlinksrc.h5.ddl @@ -0,0 +1,187 @@ +HDF5 "out-textlinksrc-mergeprune.textlinksrc.h5" { +GROUP "/" { + DATASET "ext2soft_link1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "ext_link1" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2080 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + HARDLINK "/" + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/ext_link1" + } + } + } + DATASET "ext_link2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2104 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATATYPE "ext_link3" H5T_STD_I32LE; + GROUP "ext_link5" { + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinksrc-prune.textlinksrc.h5.ddl b/tools/test/h5repack/testfiles/textlinksrc-prune.textlinksrc.h5.ddl new file mode 100644 index 0000000..65d35ef --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinksrc-prune.textlinksrc.h5.ddl @@ -0,0 +1,4 @@ +HDF5 "out-textlinksrc-prune.textlinksrc.h5" { +GROUP "/" { +} +} diff --git a/tools/test/h5repack/testfiles/textlinktar-merge.textlinktar.h5.tst b/tools/test/h5repack/testfiles/textlinktar-merge.textlinktar.h5.tst new file mode 100644 index 0000000..ccf4f7b --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinktar-merge.textlinktar.h5.tst @@ -0,0 +1,44 @@ + +file1 file2 +--------------------------------------- + x x / + x x /dset + x x /empty_group + x x /group + x x /group/dset + x x /group/elink_t1 + x /group/elink_t1/ext2soft_link1 + x /group/elink_t1/ext2softdangle_link1 + x /group/elink_t1/ext_link1 + x /group/elink_t1/ext_link2 + x /group/elink_t1/ext_link3 + x /group/elink_t1/ext_link4 + x /group/elink_t1/ext_link5 + x x /group/elink_t2 + x x /group/subgroup + x x /group/subgroup/link_to_group + x x /type + +group : and +0 differences found +dataset: and +0 differences found +group : and +0 differences found +group : and +0 differences found +dataset: and +0 differences found +Not comparable: is of type H5G_UDLINK and is of type H5G_GROUP +external link: and +0 differences found +group : and +0 differences found +group : and +0 differences found +datatype: and +0 differences found +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. diff --git a/tools/test/h5repack/testfiles/textlinktar-mergeprune.textlinktar.h5.ddl b/tools/test/h5repack/testfiles/textlinktar-mergeprune.textlinktar.h5.ddl new file mode 100644 index 0000000..c52e34d --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinktar-mergeprune.textlinktar.h5.ddl @@ -0,0 +1,200 @@ +HDF5 "out-textlinktar-mergeprune.textlinktar.h5" { +GROUP "/" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "empty_group" { + } + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2072 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "elink_t1" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + HARDLINK "/dset1" + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + HARDLINK "/group" + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + HARDLINK "/dset" + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" HARDLINK "/type" + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + HARDLINK "/empty_group" + } + } + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + DATATYPE "type" H5T_STD_I32LE; +} +} diff --git a/tools/test/h5repack/testfiles/textlinktar-prune.textlinktar.h5.ddl b/tools/test/h5repack/testfiles/textlinktar-prune.textlinktar.h5.ddl new file mode 100644 index 0000000..6787784 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinktar-prune.textlinktar.h5.ddl @@ -0,0 +1,52 @@ +HDF5 "out-textlinktar-prune.textlinktar.h5" { +GROUP "/" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "empty_group" { + } + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2072 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + DATATYPE "type" H5T_STD_I32LE; +} +} diff --git a/tools/test/h5repack/testfiles/tsoftlinks-merge.tsoftlinks.h5.tst b/tools/test/h5repack/testfiles/tsoftlinks-merge.tsoftlinks.h5.tst new file mode 100644 index 0000000..27c33d7 --- /dev/null +++ b/tools/test/h5repack/testfiles/tsoftlinks-merge.tsoftlinks.h5.tst @@ -0,0 +1,53 @@ + +file1 file2 +--------------------------------------- + x x / + x x /dset1 + x x /dset2 + x x /dtype + x x /group1 + x x /group1/soft_dangle + x x /group1/soft_dset1 + x x /group1/soft_dset2 + x x /group1/soft_dtype + x x /group1/soft_empty_grp + x x /group_empty + x x /soft_dangle + x x /soft_dset1 + x x /soft_dtype + x x /soft_empty_grp + x x /soft_group1 + x /soft_group1/soft_dangle + x /soft_group1/soft_dset1 + x /soft_group1/soft_dset2 + x /soft_group1/soft_dtype + x /soft_group1/soft_empty_grp + +group : and +0 differences found +dataset: and +0 differences found +dataset: and +0 differences found +datatype: and +0 differences found +group : and +0 differences found +link : and +0 differences found +Not comparable: is of type H5G_LINK and is of type H5G_DATASET +Not comparable: is of type H5G_LINK and is of type H5G_DATASET +Not comparable: is of type H5G_LINK and is of type H5G_TYPE +Not comparable: is of type H5G_LINK and is of type H5G_GROUP +group : and +0 differences found +link : and +0 differences found +Not comparable: is of type H5G_LINK and is of type H5G_DATASET +Not comparable: is of type H5G_LINK and is of type H5G_TYPE +Not comparable: is of type H5G_LINK and is of type H5G_GROUP +Not comparable: is of type H5G_LINK and is of type H5G_GROUP +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. diff --git a/tools/test/h5repack/testfiles/tsoftlinks-mergeprune.tsoftlinks.h5.ddl b/tools/test/h5repack/testfiles/tsoftlinks-mergeprune.tsoftlinks.h5.ddl new file mode 100644 index 0000000..fa4e12d --- /dev/null +++ b/tools/test/h5repack/testfiles/tsoftlinks-mergeprune.tsoftlinks.h5.ddl @@ -0,0 +1,127 @@ +HDF5 "out-tsoftlinks-mergeprune.tsoftlinks.h5" { +GROUP "/" { + DATASET "dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset2" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2080 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATATYPE "dtype" H5T_STD_I32BE; + GROUP "group1" { + DATASET "soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2112 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "soft_dset2" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2144 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATATYPE "soft_dtype" H5T_STD_I32BE; + GROUP "soft_empty_grp" { + } + } + GROUP "group_empty" { + } + DATASET "soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2176 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATATYPE "soft_dtype" H5T_STD_I32BE; + GROUP "soft_empty_grp" { + } + GROUP "soft_group1" { + SOFTLINK "soft_dangle" { + LINKTARGET "not_yet" + } + SOFTLINK "soft_dset1" { + LINKTARGET "/dset1" + } + SOFTLINK "soft_dset2" { + LINKTARGET "/dset2" + } + SOFTLINK "soft_dtype" { + LINKTARGET "/dtype" + } + SOFTLINK "soft_empty_grp" { + LINKTARGET "/group_empty" + } + } +} +} diff --git a/tools/test/h5repack/testfiles/tsoftlinks-prune.tsoftlinks.h5.ddl b/tools/test/h5repack/testfiles/tsoftlinks-prune.tsoftlinks.h5.ddl new file mode 100644 index 0000000..de58ef2 --- /dev/null +++ b/tools/test/h5repack/testfiles/tsoftlinks-prune.tsoftlinks.h5.ddl @@ -0,0 +1,47 @@ +HDF5 "out-tsoftlinks-prune.tsoftlinks.h5" { +GROUP "/" { + DATASET "dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset2" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2080 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATATYPE "dtype" H5T_STD_I32BE; + GROUP "group1" { + } + GROUP "group_empty" { + } +} +} -- cgit v0.12 From 646872cb8e3d2f4d53ae0709067ee523bc3a8145 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 14 Aug 2020 13:45:31 -0500 Subject: HDFFV-9984 - add missing ref files --- tools/test/h5repack/CMakeTests.cmake | 6 + tools/test/h5repack/h5repack.sh.in | 12 ++ .../testfiles/textlink-base-textlink.h5.ddl | 12 ++ .../testfiles/textlinkfar-base-textlinkfar.h5.ddl | 116 ++++++++++++++ .../testfiles/textlinksrc-base-textlinksrc.h5.ddl | 150 ++++++++++++++++++ .../testfiles/textlinktar-base-textlinktar.h5.ddl | 168 +++++++++++++++++++++ .../testfiles/tsoftlinks-base-tsoftlinks.h5.ddl | 77 ++++++++++ 7 files changed, 541 insertions(+) create mode 100644 tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 2a34438..1bf3fa2 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -170,6 +170,12 @@ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/attrregion.tattrreg.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/dataregion.tdatareg.h5 # tools/testfiles for external links + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinkfar-base.textlinkfar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinksrc-base.textlinksrc.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinktar-base.textlinktar.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlink-base.textlink.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/tsoftlinks-base.tsoftlinks.h5 + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5copy_extlinks_src-base.h5copy_extlinks_src.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinkfar-prune.textlinkfar.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinksrc-prune.textlinksrc.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/textlinktar-prune.textlinktar.h5 diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index 3d4e0ea..e4ae008 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -213,6 +213,18 @@ $SRC_H5REPACK_TESTFILES/4_vds.h5-vds_conti-v.ddl $SRC_H5REPACK_TESTFILES/attrregion.tattrreg.h5.ddl $SRC_H5REPACK_TESTFILES/dataregion.tdatareg.h5.ddl ########external#links#files######## +$SRC_H5REPACK_TESTFILES/textlinkfar-base.textlinkfar.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinksrc-base.textlinksrc.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinktar-base.textlinktar.h5.ddl +$SRC_H5REPACK_TESTFILES/textlink-base.textlink.h5.ddl +$SRC_H5REPACK_TESTFILES/tsoftlinks-base.tsoftlinks.h5.ddl +$SRC_H5REPACK_TESTFILES/h5copy_extlinks_src-base.h5copy_extlinks_src.h5.ddl +$SRC_H5REPACK_TESTFILES/textlinkfar-merge.textlinkfar.h5.tst +$SRC_H5REPACK_TESTFILES/textlinksrc-merge.textlinksrc.h5.tst +$SRC_H5REPACK_TESTFILES/textlinktar-merge.textlinktar.h5.tst +$SRC_H5REPACK_TESTFILES/textlink-merge.textlink.h5.tst +$SRC_H5REPACK_TESTFILES/tsoftlinks-merge.tsoftlinks.h5.tst +$SRC_H5REPACK_TESTFILES/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst $SRC_H5REPACK_TESTFILES/textlinkfar-prune.textlinkfar.h5.ddl $SRC_H5REPACK_TESTFILES/textlinksrc-prune.textlinksrc.h5.ddl $SRC_H5REPACK_TESTFILES/textlinktar-prune.textlinktar.h5.ddl diff --git a/tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl b/tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl new file mode 100644 index 0000000..b87a17d --- /dev/null +++ b/tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl @@ -0,0 +1,12 @@ +HDF5 "out-textlink-base.textlink.h5" { +GROUP "/" { + EXTERNAL_LINK "extlink1" { + TARGETFILE "filename" + TARGETPATH "objname" + } + EXTERNAL_LINK "extlink2" { + TARGETFILE "anotherfile" + TARGETPATH "anotherobj" + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl b/tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl new file mode 100644 index 0000000..a5eb497 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl @@ -0,0 +1,116 @@ +HDF5 "out-textlinkfar-base.textlinkfar.h5" { +GROUP "/" { + EXTERNAL_LINK "src_file" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + HARDLINK "/" + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl b/tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl new file mode 100644 index 0000000..9a9a9aa --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl @@ -0,0 +1,150 @@ +HDF5 "out-textlinksrc-base.textlinksrc.h5" { +GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + HARDLINK "/dset1" + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + HARDLINK "/group" + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + HARDLINK "/dset" + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" HARDLINK "/type" + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + HARDLINK "/empty_group" + } + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl b/tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl new file mode 100644 index 0000000..3f02ff2 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl @@ -0,0 +1,168 @@ +HDF5 "out-textlinktar-base.textlinktar.h5" { +GROUP "/" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "empty_group" { + } + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2072 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + HARDLINK "/" + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + DATATYPE "type" H5T_STD_I32LE; +} +} diff --git a/tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl b/tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl new file mode 100644 index 0000000..b0cd32d --- /dev/null +++ b/tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl @@ -0,0 +1,77 @@ +HDF5 "out-tsoftlinks-base.tsoftlinks.h5" { +GROUP "/" { + DATASET "dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset2" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2080 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATATYPE "dtype" H5T_STD_I32BE; + GROUP "group1" { + SOFTLINK "soft_dangle" { + LINKTARGET "not_yet" + } + SOFTLINK "soft_dset1" { + LINKTARGET "/dset1" + } + SOFTLINK "soft_dset2" { + LINKTARGET "/dset2" + } + SOFTLINK "soft_dtype" { + LINKTARGET "/dtype" + } + SOFTLINK "soft_empty_grp" { + LINKTARGET "/group_empty" + } + } + GROUP "group_empty" { + } + SOFTLINK "soft_dangle" { + LINKTARGET "not_yet" + } + SOFTLINK "soft_dset1" { + LINKTARGET "/dset1" + } + SOFTLINK "soft_dtype" { + LINKTARGET "/dtype" + } + SOFTLINK "soft_empty_grp" { + LINKTARGET "/group_empty" + } + SOFTLINK "soft_group1" { + LINKTARGET "/group1" + } +} +} -- cgit v0.12 From a21ae8e56b0f5d693aef000088e542f5dadf10c9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 14 Aug 2020 13:45:57 -0500 Subject: HDFFV-9984 add missing ref file --- ...py_extlinks_src-base.h5copy_extlinks_src.h5.ddl | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tools/test/h5repack/testfiles/h5copy_extlinks_src-base.h5copy_extlinks_src.h5.ddl diff --git a/tools/test/h5repack/testfiles/h5copy_extlinks_src-base.h5copy_extlinks_src.h5.ddl b/tools/test/h5repack/testfiles/h5copy_extlinks_src-base.h5copy_extlinks_src.h5.ddl new file mode 100644 index 0000000..ad8a320 --- /dev/null +++ b/tools/test/h5repack/testfiles/h5copy_extlinks_src-base.h5copy_extlinks_src.h5.ddl @@ -0,0 +1,28 @@ +HDF5 "out-h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5" { +GROUP "/" { + GROUP "group_ext" { + DATATYPE "extlink_datatype" H5T_STD_I32LE; + DATASET "extlink_dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2200 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "extlink_grp" { + } + } +} +} -- cgit v0.12 From 16349c5fddce8a74644e18d01d7ea8186aaaa255 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 14 Aug 2020 14:49:42 -0500 Subject: Fixed HDFFV-10933 Description: Updated the original fix by Kent Y. in commit 200a77d8c3e51663c375aafffff607ae9b438f4e - used internal functions instead of public API - moved some code into the subroutine for a cleaner look. - added test to dsets.c Platforms tested: Linux/64 (jelly) --- release_docs/RELEASE.txt | 10 +++++ src/H5Dint.c | 34 ++++++++++------- src/H5Z.c | 67 +++++++++++++++++++++++++++++++++ src/H5Zprivate.h | 4 +- test/dsets.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 199 insertions(+), 14 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9cb9d53..3102430 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -765,6 +765,16 @@ Bug Fixes since HDF5-1.10.3 release Library ------- + - Creation of dataset with optional filter + + When the combination of type, space, etc doesn't work for filter + and the filter is optional, it was supposed to be skipped but it was + not skipped and the creation failed. + + Allowed the creation of the dataset in such situation. + + (BMR - 2020/8/13, HDFFV-10933) + - Explicitly declared dlopen to use RTLD_LOCAL dlopen documentation states that if neither RTLD_GLOBAL nor diff --git a/src/H5Dint.c b/src/H5Dint.c index 079fef7..f99aabb 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1299,18 +1299,24 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, /* Check if the dataset has a non-default DCPL & get important values, if so */ if(new_dset->shared->dcpl_id != H5P_DATASET_CREATE_DEFAULT) { - H5O_layout_t *layout; /* Dataset's layout information */ - H5O_pline_t *pline; /* Dataset's I/O pipeline information */ - H5O_fill_t *fill; /* Dataset's fill value info */ - H5O_efl_t *efl; /* Dataset's external file list info */ + H5O_layout_t *layout; /* Dataset's layout information */ + H5O_pline_t *pline; /* Dataset's I/O pipeline information */ + H5O_fill_t *fill; /* Dataset's fill value info */ + H5O_efl_t *efl; /* Dataset's external file list info */ + htri_t ignore_filters = FALSE; /* Ignore optional filters or not */ - /* Check if the filters in the DCPL can be applied to this dataset */ - if(H5Z_can_apply(new_dset->shared->dcpl_id, new_dset->shared->type_id) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, NULL, "I/O filters can't operate on this dataset") + if((ignore_filters = H5Z_ignore_filters(new_dset->shared->dcpl_id, dt, space))<0) + HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, NULL, "H5Z_has_optional_filter() failed") - /* Make the "set local" filter callbacks for this dataset */ - if(H5Z_set_local(new_dset->shared->dcpl_id, new_dset->shared->type_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set local filter parameters") + if(FALSE == ignore_filters) { + /* Check if the filters in the DCPL can be applied to this dataset */ + if(H5Z_can_apply(new_dset->shared->dcpl_id, new_dset->shared->type_id) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, NULL, "I/O filters can't operate on this dataset") + + /* Make the "set local" filter callbacks for this dataset */ + if(H5Z_set_local(new_dset->shared->dcpl_id, new_dset->shared->type_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set local filter parameters") + } /* ignore_filters */ /* Get new dataset's property list object */ if(NULL == (dc_plist = (H5P_genplist_t *)H5I_object(new_dset->shared->dcpl_id))) @@ -1334,9 +1340,11 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't retrieve external file list") efl_copied = TRUE; - /* Check that chunked layout is used if filters are enabled */ - if(pline->nused > 0 && H5D_CHUNKED != layout->type) - HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "filters can only be used with chunked layout") + if(FALSE == ignore_filters) { + /* Check that chunked layout is used if filters are enabled */ + if(pline->nused > 0 && H5D_CHUNKED != layout->type) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "filters can only be used with chunked layout") + } /* Check if the alloc_time is the default and error out */ if(fill->alloc_time == H5D_ALLOC_TIME_DEFAULT) diff --git a/src/H5Z.c b/src/H5Z.c index 616db1f..66acfff 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1004,6 +1004,73 @@ done: /*------------------------------------------------------------------------- + * Function: H5Z_ignore_filters + * + * Purpose: Determine whether filters can be ignored. + * + * Description: + * When the filters are optional (i.e., H5Z_FLAG_OPTIONAL is provided,) + * if any of the following conditions is met, the filters will be ignored: + * - dataspace is either H5S_NULL or H5S_SCALAR + * - datatype is variable-length (string or non-string) + * However, if any of these conditions exists and a filter is not + * optional, the function will produce an error. + * + * Return: Non-negative(TRUE/FALSE) on success + * Negative on failure + * + *------------------------------------------------------------------------- + */ +htri_t +H5Z_ignore_filters(hid_t dcpl_id, const H5T_t *type, const H5S_t *space) +{ + H5P_genplist_t *dc_plist; /* Dataset creation property list object */ + H5O_pline_t pline; /* Object's I/O pipeline information */ + H5S_class_t space_class; /* To check class of space */ + H5T_class_t type_class; /* To check if type is VL */ + bool bad_for_filters = FALSE;/* Suitable to have filters */ + htri_t ret_value = FALSE; /* TRUE for ignoring filters */ + + FUNC_ENTER_NOAPI(FAIL) + + if (NULL == (dc_plist = (H5P_genplist_t *)H5I_object(dcpl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") + + /* Get pipeline information */ + if (H5P_peek(dc_plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't retrieve pipeline filter") + + /* Get datatype and dataspace classes for quick access */ + space_class = H5S_GET_EXTENT_TYPE(space); + type_class = H5T_get_class(type, FALSE); + + /* These conditions are not suitable for filters */ + bad_for_filters = (H5S_NULL == space_class || H5S_SCALAR == space_class + || H5T_VLEN == type_class + || (H5T_STRING == type_class && TRUE == H5T_is_variable_str(type))); + + /* When these conditions occur, if there are required filters in pline, + then report a failure, otherwise, set flag that they can be ignored */ + if (bad_for_filters) { + size_t ii; + if (pline.nused > 0) { + for (ii = 0; ii < pline.nused; ii++) + { + if (!(pline.filter[ii].flags & H5Z_FLAG_OPTIONAL)) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "not suitable for filters") + } + + /* All filters are optional, we can ignore them */ + ret_value = TRUE; + } + } /* bad for filters */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5Z_ignore_filters() */ + + +/*------------------------------------------------------------------------- * Function: H5Z_modify * * Purpose: Modify filter parameters for specified pipeline. diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index 6868da6..186c168 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -25,7 +25,8 @@ typedef struct H5Z_filter_info_t H5Z_filter_info_t; #include "H5Zpublic.h" /* Private headers needed by this file */ -#include "H5Tprivate.h" /* Datatypes */ +#include "H5Tprivate.h" /* Datatypes */ +#include "H5Sprivate.h" /* Dataspace */ /**************************/ /* Library Private Macros */ @@ -89,6 +90,7 @@ H5_DLL herr_t H5Z_can_apply(hid_t dcpl_id, hid_t type_id); H5_DLL herr_t H5Z_set_local(hid_t dcpl_id, hid_t type_id); H5_DLL herr_t H5Z_can_apply_direct(const struct H5O_pline_t *pline); H5_DLL herr_t H5Z_set_local_direct(const struct H5O_pline_t *pline); +H5_DLL htri_t H5Z_ignore_filters(hid_t dcpl_id, const H5T_t *type, const H5S_t *space); H5_DLL H5Z_filter_info_t *H5Z_filter_info(const struct H5O_pline_t *pline, H5Z_filter_t filter); H5_DLL htri_t H5Z_filter_in_pline(const struct H5O_pline_t *pline, H5Z_filter_t filter); diff --git a/test/dsets.c b/test/dsets.c index e4cf2a4..200cbd1 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -112,6 +112,8 @@ const char *FILENAME[] = { #define DSET_FLETCHER32_NAME_3 "fletcher32_3" #define DSET_SHUF_DEF_FLET_NAME "shuffle+deflate+fletcher32" #define DSET_SHUF_DEF_FLET_NAME_2 "shuffle+deflate+fletcher32_2" +#define DSET_OPTIONAL_SCALAR "dataset_with_scalar_space" +#define DSET_OPTIONAL_VLEN "dataset_with_vlen_type" #ifdef H5_HAVE_FILTER_SZIP #define DSET_SZIP_NAME "szip" #define DSET_SHUF_SZIP_FLET_NAME "shuffle+szip+fletcher32" @@ -5770,6 +5772,101 @@ error: } /* end test_can_apply2() */ +/*------------------------------------------------------------------------- + * Function: test_optional_filters + * + * Purpose: Tests that H5Dcreate2 will not fail when a combination of + * type, space, etc... doesn't work for a filter and filter is + * optional. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Binh-Minh Ribler + * 24 July 2020 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_optional_filters(hid_t file) +{ + unsigned int level = 9; + unsigned int cd_values[1] = {level}; + size_t cd_nelmts = 1; + hsize_t dim1d[1]; /* Dataspace dimensions */ + hid_t dsid = H5I_INVALID_HID; /* Dataset ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t strtid = H5I_INVALID_HID; /* Datatype ID for string */ + hid_t vlentid = H5I_INVALID_HID; /* Datatype ID for vlen */ + hid_t dcplid = H5I_INVALID_HID; /* Dataspace creation property list ID */ + + TESTING("dataset with optional filters"); + + /* Create dcpl with special filter */ + if((dcplid = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR; + + /* Create the datatype */ + if((strtid = H5Tcreate(H5T_STRING, H5T_VARIABLE)) < 0) TEST_ERROR; + + /* Create the data space */ + if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR; + + /* The filter is optional. */ + if(H5Pset_filter(dcplid, H5Z_FILTER_DEFLATE, H5Z_FLAG_OPTIONAL, cd_nelmts, cd_values) < 0) + TEST_ERROR; + + /* Create dataset with optional filter */ + if((dsid = H5Dcreate2(file, DSET_OPTIONAL_SCALAR, strtid, sid, H5P_DEFAULT, dcplid, H5P_DEFAULT)) < 0) + TEST_ERROR; + + /* Close dataset */ + if(H5Dclose(dsid) < 0) TEST_ERROR; + + /* Close dataspace */ + if(H5Sclose(sid) < 0) TEST_ERROR; + + /* Close datatype */ + if(H5Tclose(strtid) < 0) TEST_ERROR; + + /* Set dataspace dimensions */ + dim1d[0]=DIM1; + + /* Create a non-scalar dataspace */ + if((sid = H5Screate_simple(1, dim1d, NULL)) < 0) TEST_ERROR; + + /* Create a vlen datatype */ + if((vlentid = H5Tvlen_create(H5T_NATIVE_INT)) < 0) TEST_ERROR; + + /* Create dataset with optional filter */ + if((dsid = H5Dcreate2(file, DSET_OPTIONAL_VLEN, vlentid, sid, H5P_DEFAULT, dcplid, H5P_DEFAULT)) < 0) + TEST_ERROR; + + /* Close dataset */ + if(H5Dclose(dsid) < 0) TEST_ERROR; + + /* Close dataspace */ + if(H5Sclose(sid) < 0) TEST_ERROR; + + /* Close datatype */ + if(H5Tclose(vlentid) < 0) TEST_ERROR; + + /* Close dataset creation property list */ + if(H5Pclose(dcplid) < 0) TEST_ERROR; + + PASSED(); + return SUCCEED; + +error: + H5E_BEGIN_TRY { + H5Dclose(dsid); + H5Sclose(sid); + H5Pclose(dcplid); + H5Tclose(strtid); + H5Tclose(vlentid); + } H5E_END_TRY; + return FAIL; +} /* end test_optional_filters() */ + /*------------------------------------------------------------------------- * Function: test_can_apply_szip @@ -13862,6 +13959,7 @@ main(void) nerrors += (test_missing_filter(file) < 0 ? 1 : 0); nerrors += (test_can_apply(file) < 0 ? 1 : 0); nerrors += (test_can_apply2(file) < 0 ? 1 : 0); + nerrors += (test_optional_filters(file) < 0 ? 1 : 0); nerrors += (test_set_local(my_fapl) < 0 ? 1 : 0); nerrors += (test_can_apply_szip(file) < 0 ? 1 : 0); nerrors += (test_compare_dcpl(file) < 0 ? 1 : 0); -- cgit v0.12 From b196ddb4a89b36a3200e0ba9e7b8c2b2f4b52774 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 14 Aug 2020 15:21:56 -0500 Subject: HDFFV-9984 - correct name of ref files --- .../testfiles/textlink-base-textlink.h5.ddl | 12 -- .../testfiles/textlink-base.textlink.h5.ddl | 12 ++ .../testfiles/textlinkfar-base-textlinkfar.h5.ddl | 116 -------------- .../testfiles/textlinkfar-base.textlinkfar.h5.ddl | 116 ++++++++++++++ .../testfiles/textlinksrc-base-textlinksrc.h5.ddl | 150 ------------------ .../testfiles/textlinksrc-base.textlinksrc.h5.ddl | 150 ++++++++++++++++++ .../testfiles/textlinktar-base-textlinktar.h5.ddl | 168 --------------------- .../testfiles/textlinktar-base.textlinktar.h5.ddl | 168 +++++++++++++++++++++ .../testfiles/tsoftlinks-base-tsoftlinks.h5.ddl | 77 ---------- .../testfiles/tsoftlinks-base.tsoftlinks.h5.ddl | 77 ++++++++++ 10 files changed, 523 insertions(+), 523 deletions(-) delete mode 100644 tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlink-base.textlink.h5.ddl delete mode 100644 tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinkfar-base.textlinkfar.h5.ddl delete mode 100644 tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinksrc-base.textlinksrc.h5.ddl delete mode 100644 tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl create mode 100644 tools/test/h5repack/testfiles/textlinktar-base.textlinktar.h5.ddl delete mode 100644 tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl create mode 100644 tools/test/h5repack/testfiles/tsoftlinks-base.tsoftlinks.h5.ddl diff --git a/tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl b/tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl deleted file mode 100644 index b87a17d..0000000 --- a/tools/test/h5repack/testfiles/textlink-base-textlink.h5.ddl +++ /dev/null @@ -1,12 +0,0 @@ -HDF5 "out-textlink-base.textlink.h5" { -GROUP "/" { - EXTERNAL_LINK "extlink1" { - TARGETFILE "filename" - TARGETPATH "objname" - } - EXTERNAL_LINK "extlink2" { - TARGETFILE "anotherfile" - TARGETPATH "anotherobj" - } -} -} diff --git a/tools/test/h5repack/testfiles/textlink-base.textlink.h5.ddl b/tools/test/h5repack/testfiles/textlink-base.textlink.h5.ddl new file mode 100644 index 0000000..b87a17d --- /dev/null +++ b/tools/test/h5repack/testfiles/textlink-base.textlink.h5.ddl @@ -0,0 +1,12 @@ +HDF5 "out-textlink-base.textlink.h5" { +GROUP "/" { + EXTERNAL_LINK "extlink1" { + TARGETFILE "filename" + TARGETPATH "objname" + } + EXTERNAL_LINK "extlink2" { + TARGETFILE "anotherfile" + TARGETPATH "anotherobj" + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl b/tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl deleted file mode 100644 index a5eb497..0000000 --- a/tools/test/h5repack/testfiles/textlinkfar-base-textlinkfar.h5.ddl +++ /dev/null @@ -1,116 +0,0 @@ -HDF5 "out-textlinkfar-base.textlinkfar.h5" { -GROUP "/" { - EXTERNAL_LINK "src_file" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/" - GROUP "/" { - EXTERNAL_LINK "ext2soft_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dset1" - DATASET "/soft_dset1" { - DATATYPE H5T_STD_I32BE - DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 32 - OFFSET 2848 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - } - EXTERNAL_LINK "ext2softdangle_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dangle" - } - EXTERNAL_LINK "ext_link1" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group" - GROUP "group" { - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 3136 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - EXTERNAL_LINK "elink_t1" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/" - GROUP "/" { - HARDLINK "/" - } - } - EXTERNAL_LINK "elink_t2" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/ext_link4" - } - GROUP "subgroup" { - GROUP "link_to_group" { - HARDLINK "/group" - } - } - } - } - EXTERNAL_LINK "ext_link2" { - TARGETFILE "textlinktar.h5" - TARGETPATH "dset" - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 3160 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - } - EXTERNAL_LINK "ext_link3" { - TARGETFILE "textlinktar.h5" - TARGETPATH "type" - DATATYPE "type" H5T_STD_I32LE; - } - EXTERNAL_LINK "ext_link4" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group/elink_t2" - } - EXTERNAL_LINK "ext_link5" { - TARGETFILE "textlinktar.h5" - TARGETPATH "empty_group" - GROUP "empty_group" { - } - } - } - } -} -} diff --git a/tools/test/h5repack/testfiles/textlinkfar-base.textlinkfar.h5.ddl b/tools/test/h5repack/testfiles/textlinkfar-base.textlinkfar.h5.ddl new file mode 100644 index 0000000..a5eb497 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinkfar-base.textlinkfar.h5.ddl @@ -0,0 +1,116 @@ +HDF5 "out-textlinkfar-base.textlinkfar.h5" { +GROUP "/" { + EXTERNAL_LINK "src_file" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + HARDLINK "/" + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl b/tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl deleted file mode 100644 index 9a9a9aa..0000000 --- a/tools/test/h5repack/testfiles/textlinksrc-base-textlinksrc.h5.ddl +++ /dev/null @@ -1,150 +0,0 @@ -HDF5 "out-textlinksrc-base.textlinksrc.h5" { -GROUP "/" { - EXTERNAL_LINK "ext2soft_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dset1" - DATASET "/soft_dset1" { - DATATYPE H5T_STD_I32BE - DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 32 - OFFSET 2848 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - } - EXTERNAL_LINK "ext2softdangle_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dangle" - } - EXTERNAL_LINK "ext_link1" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group" - GROUP "group" { - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 3136 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - EXTERNAL_LINK "elink_t1" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/" - GROUP "/" { - EXTERNAL_LINK "ext2soft_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dset1" - DATASET "/soft_dset1" { - HARDLINK "/dset1" - } - } - EXTERNAL_LINK "ext2softdangle_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dangle" - } - EXTERNAL_LINK "ext_link1" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group" - GROUP "group" { - HARDLINK "/group" - } - } - EXTERNAL_LINK "ext_link2" { - TARGETFILE "textlinktar.h5" - TARGETPATH "dset" - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 3160 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - } - EXTERNAL_LINK "ext_link3" { - TARGETFILE "textlinktar.h5" - TARGETPATH "type" - DATATYPE "type" H5T_STD_I32LE; - } - EXTERNAL_LINK "ext_link4" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group/elink_t2" - } - EXTERNAL_LINK "ext_link5" { - TARGETFILE "textlinktar.h5" - TARGETPATH "empty_group" - GROUP "empty_group" { - } - } - } - } - EXTERNAL_LINK "elink_t2" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/ext_link4" - } - GROUP "subgroup" { - GROUP "link_to_group" { - HARDLINK "/group" - } - } - } - } - EXTERNAL_LINK "ext_link2" { - TARGETFILE "textlinktar.h5" - TARGETPATH "dset" - DATASET "dset" { - HARDLINK "/dset" - } - } - EXTERNAL_LINK "ext_link3" { - TARGETFILE "textlinktar.h5" - TARGETPATH "type" - DATATYPE "type" HARDLINK "/type" - } - EXTERNAL_LINK "ext_link4" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group/elink_t2" - } - EXTERNAL_LINK "ext_link5" { - TARGETFILE "textlinktar.h5" - TARGETPATH "empty_group" - GROUP "empty_group" { - HARDLINK "/empty_group" - } - } -} -} diff --git a/tools/test/h5repack/testfiles/textlinksrc-base.textlinksrc.h5.ddl b/tools/test/h5repack/testfiles/textlinksrc-base.textlinksrc.h5.ddl new file mode 100644 index 0000000..9a9a9aa --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinksrc-base.textlinksrc.h5.ddl @@ -0,0 +1,150 @@ +HDF5 "out-textlinksrc-base.textlinksrc.h5" { +GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + HARDLINK "/dset1" + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + HARDLINK "/group" + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + HARDLINK "/dset" + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" HARDLINK "/type" + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + HARDLINK "/empty_group" + } + } +} +} diff --git a/tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl b/tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl deleted file mode 100644 index 3f02ff2..0000000 --- a/tools/test/h5repack/testfiles/textlinktar-base-textlinktar.h5.ddl +++ /dev/null @@ -1,168 +0,0 @@ -HDF5 "out-textlinktar-base.textlinktar.h5" { -GROUP "/" { - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 2048 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - GROUP "empty_group" { - } - GROUP "group" { - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 2072 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - EXTERNAL_LINK "elink_t1" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/" - GROUP "/" { - EXTERNAL_LINK "ext2soft_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dset1" - DATASET "/soft_dset1" { - DATATYPE H5T_STD_I32BE - DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 32 - OFFSET 2848 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - } - EXTERNAL_LINK "ext2softdangle_link1" { - TARGETFILE "tsoftlinks.h5" - TARGETPATH "/soft_dangle" - } - EXTERNAL_LINK "ext_link1" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group" - GROUP "group" { - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 3136 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - EXTERNAL_LINK "elink_t1" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/" - GROUP "/" { - HARDLINK "/" - } - } - EXTERNAL_LINK "elink_t2" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/ext_link4" - } - GROUP "subgroup" { - GROUP "link_to_group" { - HARDLINK "/group" - } - } - } - } - EXTERNAL_LINK "ext_link2" { - TARGETFILE "textlinktar.h5" - TARGETPATH "dset" - DATASET "dset" { - DATATYPE H5T_STD_I32LE - DATASPACE SIMPLE { ( 6 ) / ( 6 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 24 - OFFSET 3160 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - } - EXTERNAL_LINK "ext_link3" { - TARGETFILE "textlinktar.h5" - TARGETPATH "type" - DATATYPE "type" H5T_STD_I32LE; - } - EXTERNAL_LINK "ext_link4" { - TARGETFILE "textlinktar.h5" - TARGETPATH "group/elink_t2" - } - EXTERNAL_LINK "ext_link5" { - TARGETFILE "textlinktar.h5" - TARGETPATH "empty_group" - GROUP "empty_group" { - } - } - } - } - EXTERNAL_LINK "elink_t2" { - TARGETFILE "textlinksrc.h5" - TARGETPATH "/ext_link4" - } - GROUP "subgroup" { - GROUP "link_to_group" { - HARDLINK "/group" - } - } - } - DATATYPE "type" H5T_STD_I32LE; -} -} diff --git a/tools/test/h5repack/testfiles/textlinktar-base.textlinktar.h5.ddl b/tools/test/h5repack/testfiles/textlinktar-base.textlinktar.h5.ddl new file mode 100644 index 0000000..3f02ff2 --- /dev/null +++ b/tools/test/h5repack/testfiles/textlinktar-base.textlinktar.h5.ddl @@ -0,0 +1,168 @@ +HDF5 "out-textlinktar-base.textlinktar.h5" { +GROUP "/" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + GROUP "empty_group" { + } + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2072 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2848 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } + EXTERNAL_LINK "ext_link1" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group" + GROUP "group" { + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3136 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + EXTERNAL_LINK "elink_t1" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/" + GROUP "/" { + HARDLINK "/" + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + } + EXTERNAL_LINK "ext_link2" { + TARGETFILE "textlinktar.h5" + TARGETPATH "dset" + DATASET "dset" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 6 ) / ( 6 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3160 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + } + EXTERNAL_LINK "ext_link3" { + TARGETFILE "textlinktar.h5" + TARGETPATH "type" + DATATYPE "type" H5T_STD_I32LE; + } + EXTERNAL_LINK "ext_link4" { + TARGETFILE "textlinktar.h5" + TARGETPATH "group/elink_t2" + } + EXTERNAL_LINK "ext_link5" { + TARGETFILE "textlinktar.h5" + TARGETPATH "empty_group" + GROUP "empty_group" { + } + } + } + } + EXTERNAL_LINK "elink_t2" { + TARGETFILE "textlinksrc.h5" + TARGETPATH "/ext_link4" + } + GROUP "subgroup" { + GROUP "link_to_group" { + HARDLINK "/group" + } + } + } + DATATYPE "type" H5T_STD_I32LE; +} +} diff --git a/tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl b/tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl deleted file mode 100644 index b0cd32d..0000000 --- a/tools/test/h5repack/testfiles/tsoftlinks-base-tsoftlinks.h5.ddl +++ /dev/null @@ -1,77 +0,0 @@ -HDF5 "out-tsoftlinks-base.tsoftlinks.h5" { -GROUP "/" { - DATASET "dset1" { - DATATYPE H5T_STD_I32BE - DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 32 - OFFSET 2048 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - DATASET "dset2" { - DATATYPE H5T_STD_I32BE - DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } - STORAGE_LAYOUT { - CONTIGUOUS - SIZE 32 - OFFSET 2080 - } - FILTERS { - NONE - } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE H5D_FILL_VALUE_DEFAULT - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_LATE - } - } - DATATYPE "dtype" H5T_STD_I32BE; - GROUP "group1" { - SOFTLINK "soft_dangle" { - LINKTARGET "not_yet" - } - SOFTLINK "soft_dset1" { - LINKTARGET "/dset1" - } - SOFTLINK "soft_dset2" { - LINKTARGET "/dset2" - } - SOFTLINK "soft_dtype" { - LINKTARGET "/dtype" - } - SOFTLINK "soft_empty_grp" { - LINKTARGET "/group_empty" - } - } - GROUP "group_empty" { - } - SOFTLINK "soft_dangle" { - LINKTARGET "not_yet" - } - SOFTLINK "soft_dset1" { - LINKTARGET "/dset1" - } - SOFTLINK "soft_dtype" { - LINKTARGET "/dtype" - } - SOFTLINK "soft_empty_grp" { - LINKTARGET "/group_empty" - } - SOFTLINK "soft_group1" { - LINKTARGET "/group1" - } -} -} diff --git a/tools/test/h5repack/testfiles/tsoftlinks-base.tsoftlinks.h5.ddl b/tools/test/h5repack/testfiles/tsoftlinks-base.tsoftlinks.h5.ddl new file mode 100644 index 0000000..b0cd32d --- /dev/null +++ b/tools/test/h5repack/testfiles/tsoftlinks-base.tsoftlinks.h5.ddl @@ -0,0 +1,77 @@ +HDF5 "out-tsoftlinks-base.tsoftlinks.h5" { +GROUP "/" { + DATASET "dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset2" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 32 + OFFSET 2080 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATATYPE "dtype" H5T_STD_I32BE; + GROUP "group1" { + SOFTLINK "soft_dangle" { + LINKTARGET "not_yet" + } + SOFTLINK "soft_dset1" { + LINKTARGET "/dset1" + } + SOFTLINK "soft_dset2" { + LINKTARGET "/dset2" + } + SOFTLINK "soft_dtype" { + LINKTARGET "/dtype" + } + SOFTLINK "soft_empty_grp" { + LINKTARGET "/group_empty" + } + } + GROUP "group_empty" { + } + SOFTLINK "soft_dangle" { + LINKTARGET "not_yet" + } + SOFTLINK "soft_dset1" { + LINKTARGET "/dset1" + } + SOFTLINK "soft_dtype" { + LINKTARGET "/dtype" + } + SOFTLINK "soft_empty_grp" { + LINKTARGET "/group_empty" + } + SOFTLINK "soft_group1" { + LINKTARGET "/group1" + } +} +} -- cgit v0.12 From 7603d2c8be5418370467f14e8c180a0280c0d557 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 14 Aug 2020 16:39:40 -0500 Subject: HDFFV-9984 fix test logic --- tools/test/h5repack/CMakeTests.cmake | 7 +++---- tools/test/h5repack/h5repack.sh.in | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 1bf3fa2..af73b75 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -1626,16 +1626,15 @@ ADD_H5_DMP_TEST (textlinkfar-base "TEST" 0 textlinkfar.h5 --enable-error-stack) ADD_H5_DMP_TEST (textlinksrc-base "TEST" 0 textlinksrc.h5 --enable-error-stack) ADD_H5_DMP_TEST (textlinktar-base "TEST" 0 textlinktar.h5 --enable-error-stack) -### HDFFV-11128 needs fixed to enable the following test -#ADD_H5_DIFF_TEST (textlinksrc-merge "TEST" 1 textlinksrc.h5 --merge) +ADD_H5_DIFF_TEST (h5copy_extlinks_src-merge "TEST" 0 h5copy_extlinks_src.h5 --merge) ADD_H5_DIFF_TEST (tsoftlinks-merge "TEST" 1 tsoftlinks.h5 --merge) ADD_H5_DIFF_TEST (textlink-merge "TEST" 0 textlink.h5 --merge) ### HDFFV-11128 needs fixed to enable the following test #ADD_H5_DIFF_TEST (textlinkfar-merge "TEST" 1 textlinkfar.h5 --merge) ### HDFFV-11128 needs fixed to enable the following test -#ADD_H5_DIFF_TEST (textlinktar-merge "TEST" 1 textlinktar.h5 --merge) +#ADD_H5_DIFF_TEST (textlinksrc-merge "TEST" 1 textlinksrc.h5 --merge) ### HDFFV-11128 needs fixed to enable the following test -#ADD_H5_DIFF_TEST (h5copy_extlinks_src-merge "TEST" 0 h5copy_extlinks_src.h5 --merge) +#ADD_H5_DIFF_TEST (textlinktar-merge "TEST" 1 textlinktar.h5 --merge) ADD_H5_DMP_TEST (h5copy_extlinks_src-prune "TEST" 0 h5copy_extlinks_src.h5 --prune --enable-error-stack) ADD_H5_DMP_TEST (tsoftlinks-prune "TEST" 0 tsoftlinks.h5 --prune --enable-error-stack) diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index e4ae008..02f515c 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -871,13 +871,13 @@ TOOLTESTSV() nerrors="`expr $nerrors + 1`" else echo " PASSED" - VERIFY h5diff unequal $@ + VERIFY h5diff equal $@ ( cd $TESTDIR $RUNSERIAL $H5DIFF_BIN -v $infile $outfile ) >$actual 2>$actual_err RET=$? - if [ $RET == 0 ] ; then + if [ $RET != 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" else -- cgit v0.12 From c5b176594082f6e5a8b6d9140f9db1f13530e087 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sat, 15 Aug 2020 07:32:50 -0700 Subject: Trivialities noticed while merging things to 1.10 --- Makefile.am | 8 ++++---- src/H5Z.c | 6 +++--- src/H5Zdeflate.c | 2 +- src/H5private.h | 2 +- src/H5public.h | 42 +++++++++++++++++++------------------- src/Makefile.am | 4 ++-- test/cache_image.c | 2 +- test/cache_tagging.c | 16 +++++++-------- test/dsets.c | 14 ++++++------- test/dt_arith.c | 34 +++++++++++++++--------------- tools/src/h5repack/h5repack_refs.c | 1 - 11 files changed, 65 insertions(+), 66 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8565788..9cb5d02 100644 --- a/Makefile.am +++ b/Makefile.am @@ -190,10 +190,10 @@ trace: # Run tests with different Virtual File Drivers. # Currently, only invoke check-vfd in the test directory. check-vfd: - for d in src utils test; do \ - if test $$d != .; then \ - (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ - fi; \ + for d in src utils test; do \ + if test $$d != .; then \ + (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ + fi; \ done # Run tests with different passthrough Virtual Object Layer Connectors. diff --git a/src/H5Z.c b/src/H5Z.c index 616db1f..0b70731 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -346,8 +346,8 @@ done: * * Purpose: This function unregisters a filter. * - * Return: SUCCEED/FAIL - * + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1340,7 +1340,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, fstats->stats[1].times.system += times.system; fstats->stats[1].times.user += times.user; - fstats->stats[1].total += MAX(*nbytes, new_nbytes); + fstats->stats[1].total += MAX(*nbytes, new_nbytes); if(0 == new_nbytes) fstats->stats[1].errors += *nbytes; #endif diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index 09cca14..d46108f 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -43,7 +43,7 @@ const H5Z_class2_t H5Z_DEFLATE[1] = {{ H5Z_FILTER_DEFLATE, /* Filter id number */ 1, /* encoder_present flag (set to true) */ 1, /* decoder_present flag (set to true) */ - "deflate", /* Filter name for debugging */ + "deflate", /* Filter name for debugging */ NULL, /* The "can apply" callback */ NULL, /* The "set local" callback */ H5Z__filter_deflate, /* The actual filter function */ diff --git a/src/H5private.h b/src/H5private.h index 0c3dcd1..9c5b450 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1517,7 +1517,7 @@ typedef off_t h5_stat_size_t; #endif /* HDstrtoul */ #ifndef HDstrtoumax #define HDstrtoumax(S,R,N) strtoumax(S,R,N) -#endif /* HDstrtoul */ +#endif /* HDstrtoumax */ #ifndef HDstrxfrm #define HDstrxfrm(X,Y,Z) strxfrm(X,Y,Z) #endif /* HDstrxfrm */ diff --git a/src/H5public.h b/src/H5public.h index d3edd23..ba2505a 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -26,28 +26,28 @@ * it via H5public.h. The #ifndef _H5public_H guard above would * prevent repeated include. */ -#include "H5pubconf.h" /*from configure */ +#include "H5pubconf.h" /* From configure */ /* API Version macro wrapper definitions */ #include "H5version.h" #ifdef H5_HAVE_FEATURES_H -#include /*for setting POSIX, BSD, etc. compatibility */ +#include /* For setting POSIX, BSD, etc. compatibility */ #endif #ifdef H5_HAVE_SYS_TYPES_H #include #endif #ifdef H5_STDC_HEADERS -# include /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */ -# include /*for variadic functions in H5VLpublic.h */ +# include /* For H5T_NATIVE_CHAR defn in H5Tpublic.h */ +# include /* For variadic functions in H5VLpublic.h */ #endif #ifndef __cplusplus # ifdef H5_HAVE_STDINT_H -# include /*for C9x types */ +# include /* For C9x types */ # endif #else # ifdef H5_HAVE_STDINT_H_CXX -# include /*for C9x types when include from C++ */ +# include /* For C9x types (when included from C++) */ # endif #endif #ifdef H5_HAVE_INTTYPES_H @@ -61,7 +61,7 @@ # define MPICH_SKIP_MPICXX 1 # define OMPI_SKIP_MPICXX 1 # include -#ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */ +#ifndef MPI_FILE_NULL /* MPIO may be defined in mpi.h already */ # include #endif #endif @@ -94,14 +94,14 @@ extern "C" { #endif /* Version numbers */ -#define H5_VERS_MAJOR 1 /* For major interface/format changes */ -#define H5_VERS_MINOR 13 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 0 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ +#define H5_VERS_MAJOR 1 /* For major interface/format changes */ +#define H5_VERS_MINOR 13 /* For minor interface/format changes */ +#define H5_VERS_RELEASE 0 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ #define H5_VERS_INFO "HDF5 library version: 1.13.0" /* Full version string */ -#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ +#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) /* macros for comparing the version */ @@ -122,8 +122,8 @@ extern "C" { * The negative failure value is most commonly -1, but don't bet on it. The * proper way to detect failure is something like: * - * if((dset = H5Dopen2(file, name)) < 0) - * fprintf(stderr, "unable to open the requested dataset\n"); + * if((dset = H5Dopen2(file, name)) < 0) + * fprintf(stderr, "unable to open the requested dataset\n"); */ typedef int herr_t; @@ -135,13 +135,13 @@ typedef int herr_t; * (false), positive (true), or negative (failure). The proper way to test * for truth from a htri_t function is: * - * if ((retval = H5Tcommitted(type))>0) { - * printf("data type is committed\n"); - * } else if (!retval) { - * printf("data type is not committed\n"); - * } else { - * printf("error determining whether data type is committed\n"); - * } + * if ((retval = H5Tcommitted(type)) > 0) { + * printf("data type is committed\n"); + * } else if (!retval) { + * printf("data type is not committed\n"); + * } else { + * printf("error determining whether data type is committed\n"); + * } */ #ifdef H5_HAVE_STDBOOL_H #include diff --git a/src/Makefile.am b/src/Makefile.am index 787b502..cbecccd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -141,8 +141,8 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers H5Apublic.h H5ACpublic.h \ H5Cpublic.h H5Dpublic.h \ H5Epubgen.h H5Epublic.h H5ESpublic.h H5Fpublic.h \ - H5FDpublic.h H5FDcore.h H5FDdirect.h H5FDfamily.h H5FDhdfs.h \ - H5FDlog.h H5FDmirror.h H5FDmpi.h H5FDmpio.h H5FDmulti.h H5FDros3.h \ + H5FDpublic.h H5FDcore.h H5FDdirect.h H5FDfamily.h H5FDhdfs.h \ + H5FDlog.h H5FDmirror.h H5FDmpi.h H5FDmpio.h H5FDmulti.h H5FDros3.h \ H5FDsec2.h H5FDsplitter.h H5FDstdio.h H5FDwindows.h \ H5Gpublic.h H5Ipublic.h H5Lpublic.h \ H5Mpublic.h H5MMpublic.h H5Opublic.h H5Ppublic.h \ diff --git a/test/cache_image.c b/test/cache_image.c index 59689a9..9f8c4c5 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -15,7 +15,7 @@ * 7/13/15 * * This file contains tests specific to the cache image - * feature implemented in H5C.c + * feature implemented in H5C.c */ #include "cache_common.h" #include "genall5.h" diff --git a/test/cache_tagging.c b/test/cache_tagging.c index cf0cd8d..531138c 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -30,16 +30,16 @@ /* Test Defines */ /* ============ */ -#define FILENAME "tagging_test.h5" -#define FILENAME2 "tagging_ext_test.h5" -#define GROUPNAME "Group" +#define FILENAME "tagging_test.h5" +#define FILENAME2 "tagging_ext_test.h5" +#define GROUPNAME "Group" #define GROUPNAMEPATH "/Group" #define GROUPNAMECOPY "GroupCopy" -#define ATTRNAME "Attribute 1" -#define ATTRNAME3 "Attribute 3" -#define DATASETNAME "Dataset" -#define DATASETNAME2 "Dataset2" -#define LINKNAME "Link" +#define ATTRNAME "Attribute 1" +#define ATTRNAME3 "Attribute 3" +#define DATASETNAME "Dataset" +#define DATASETNAME2 "Dataset2" +#define LINKNAME "Link" #define RANK 2 #define DIMS 32 diff --git a/test/dsets.c b/test/dsets.c index e4cf2a4..eb2ffa6 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -1888,7 +1888,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR; /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { - status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); + status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } H5E_END_TRY; if(status>=0) TEST_ERROR; } @@ -1934,7 +1934,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, /* Default behavior is failure when data is corrupted. */ /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { - status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); + status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } H5E_END_TRY; if(status>=0) TEST_ERROR; @@ -1947,7 +1947,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR; /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { - status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); + status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } H5E_END_TRY; if(status>=0) TEST_ERROR; } @@ -2048,7 +2048,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, /* Default behavior is failure when data is corrupted. */ /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { - status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); + status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } H5E_END_TRY; if(status>=0) TEST_ERROR; @@ -2061,12 +2061,12 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR; /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { - status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); + status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data); } H5E_END_TRY; if(status>=0) TEST_ERROR; } else { - if(H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check_data) < 0) + if(H5Dread(dataset, H5T_NATIVE_INT, sid, sid, dxpl, check_data) < 0) TEST_ERROR; /* Check that the values read are the same as the values written */ @@ -13366,7 +13366,7 @@ test_versionbounds(void) return FAIL; } /* end test_versionbounds() */ - + /*----------------------------------------------------------------------------- * Function: test_object_header_minimization_dcpl * diff --git a/test/dt_arith.c b/test/dt_arith.c index 775f4ee..9b89225 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -770,7 +770,7 @@ static int test_particular_fp_integer(void) /* Print errors */ if(dst_c != SCHAR_MAX) { - double x = 0.; + double x = 0.0; signed char y; if(0 == fails_this_test++) @@ -814,7 +814,7 @@ static int test_particular_fp_integer(void) /* Print errors */ if(dst_i != fill_value) { - float x = 0.; + float x = 0.0; int y; if(0 == fails_this_test++) @@ -2723,16 +2723,16 @@ my_isnan(dtype_t type, void *val) char s[256]; if (FLT_FLOAT==type) { - float x = 0.; + float x = 0.0; HDmemcpy(&x, val, sizeof(float)); retval = (x!=x); } else if (FLT_DOUBLE==type) { - double x = 0.; + double x = 0.0; HDmemcpy(&x, val, sizeof(double)); retval = (x!=x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } else if (FLT_LDOUBLE==type) { - long double x = 0.; + long double x = 0.0; HDmemcpy(&x, val, sizeof(long double)); retval = (x!=x); #endif @@ -2746,18 +2746,18 @@ my_isnan(dtype_t type, void *val) */ if (!retval) { if (FLT_FLOAT==type) { - float x = 0.; + float x = 0.0; HDmemcpy(&x, val, sizeof(float)); HDsnprintf(s, sizeof(s), "%g", (double)x); } else if (FLT_DOUBLE==type) { - double x = 0.; + double x = 0.0; HDmemcpy(&x, val, sizeof(double)); HDsnprintf(s, sizeof(s), "%g", x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } else if (FLT_LDOUBLE==type) { - long double x = 0.; + long double x = 0.0; HDmemcpy(&x, val, sizeof(long double)); HDsnprintf(s, sizeof(s), "%Lg", x); @@ -3197,7 +3197,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) int check_expo[2]; if (FLT_FLOAT==dst_type) { - float x = 0.; + float x = 0.0; HDmemcpy(&x, &buf[j*dst_size], sizeof(float)); if (underflow && HDfabsf(x) <= FLT_MIN && HDfabsf(hw_f) <= FLT_MIN) @@ -3208,7 +3208,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) check_mant[0] = HDfrexpf(x, check_expo+0); check_mant[1] = HDfrexpf(hw_f, check_expo+1); } else if (FLT_DOUBLE==dst_type) { - double x = 0.; + double x = 0.0; HDmemcpy(&x, &buf[j*dst_size], sizeof(double)); if (underflow && HDfabs(x) <= DBL_MIN && HDfabs(hw_d) <= DBL_MIN) @@ -3220,7 +3220,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) check_mant[1] = HDfrexp(hw_d, check_expo+1); #if H5_SIZEOF_LONG_DOUBLE !=0 && (H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE) } else { - long double x = 0.; + long double x = 0.0; HDmemcpy(&x, &buf[j*dst_size], sizeof(long double)); /* dst is largest float, no need to check underflow. */ check_mant[0] = (double)HDfrexpl(x, check_expo+0); @@ -3265,16 +3265,16 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) HDprintf(" %02x", saved[j*src_size+ENDIAN(src_size,k,sendian)]); HDprintf("%*s", (int)(3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size)), ""); if (FLT_FLOAT==src_type) { - float x = 0.; + float x = 0.0; HDmemcpy(&x, &saved[j*src_size], sizeof(float)); HDprintf(" %29.20e\n", (double)x); } else if (FLT_DOUBLE==src_type) { - double x = 0.; + double x = 0.0; HDmemcpy(&x, &saved[j*src_size], sizeof(double)); HDprintf(" %29.20e\n", x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE } else { - long double x = 0.; + long double x = 0.0; HDmemcpy(&x, &saved[j*src_size], sizeof(long double)); HDfprintf(stdout," %29.20Le\n", x); #endif @@ -3285,16 +3285,16 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) HDprintf(" %02x", buf[j*dst_size+ENDIAN(dst_size,k,dendian)]); HDprintf("%*s", (int)(3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size)), ""); if (FLT_FLOAT==dst_type) { - float x = 0.; + float x = 0.0; HDmemcpy(&x, &buf[j*dst_size], sizeof(float)); HDprintf(" %29.20e\n", (double)x); } else if (FLT_DOUBLE==dst_type) { - double x = 0.; + double x = 0.0; HDmemcpy(&x, &buf[j*dst_size], sizeof(double)); HDprintf(" %29.20e\n", x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE } else { - long double x = 0.; + long double x = 0.0; HDmemcpy(&x, &buf[j*dst_size], sizeof(long double)); HDfprintf(stdout," %29.20Le\n", x); #endif diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index 2685823..5baabb6 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -537,7 +537,6 @@ static int copy_refs_attr(hid_t loc_in, KY 2020-02-07 */ is_ref_comp = (ref_comp_field_n > 0); - } -- cgit v0.12 From 57c4aeb0cc0d1f2aca2be85895dd3ecef92f36dd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Sat, 15 Aug 2020 17:25:22 -0500 Subject: TRILABS-277 Use JIRA number as #ifdef --- MANIFEST | 1 + tools/src/h5diff/h5diff_common.c | 9 +++++---- tools/test/h5diff/CMakeTests.cmake | 8 ++++++++ tools/test/h5diff/testfiles/h5diff_830.txt | 30 ++++++++++++++++++++++++++++++ tools/test/h5diff/testh5diff.sh.in | 6 ++++++ 5 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 tools/test/h5diff/testfiles/h5diff_830.txt diff --git a/MANIFEST b/MANIFEST index 826c0d5..f26d0b8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2493,6 +2493,7 @@ ./tools/test/h5diff/testfiles/h5diff_80.txt ./tools/test/h5diff/testfiles/h5diff_800.txt ./tools/test/h5diff/testfiles/h5diff_801.txt +./tools/test/h5diff/testfiles/h5diff_830.txt ./tools/test/h5diff/testfiles/h5diff_90.txt ./tools/test/h5diff/testfiles/h5diff_100.txt ./tools/test/h5diff/testfiles/h5diff_101.txt diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index a4fe3bb..8ed2d37 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -75,6 +75,7 @@ static void check_options(diff_opt_t* opts) } } +#if TRILABS-227 /*------------------------------------------------------------------------- * Function: parse_hsize_list * @@ -90,7 +91,6 @@ static void check_options(diff_opt_t* opts) * Return: *------------------------------------------------------------------------- */ -#if 0 static void parse_hsize_list(const char *h_list, subset_d *d) { @@ -140,7 +140,6 @@ parse_hsize_list(const char *h_list, subset_d *d) d->len = size_count; H5TOOLS_ENDDEBUG(""); } -#endif /*------------------------------------------------------------------------- * Function: parse_subset_params @@ -151,7 +150,6 @@ parse_hsize_list(const char *h_list, subset_d *d) * Failure: NULL *------------------------------------------------------------------------- */ -#if 0 static struct subset_t * parse_subset_params(const char *dset) { @@ -482,10 +480,13 @@ void parse_command_line(int argc, const char* argv[], const char** fname1, const /* * TRILABS-227 is complete except for an issue with printing indices * the following calls will enable subsetting + */ +#if TRILABS-227 opts->sset[0] = parse_subset_params(*objname1); opts->sset[1] = parse_subset_params(*objname2); - */ +#endif + H5TOOLS_ENDDEBUG(""); } diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 5aa1d1a..4e8e8d1 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -293,6 +293,7 @@ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_80.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_800.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_801.txt + ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_830.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_8625.txt ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_8639.txt @@ -919,6 +920,8 @@ h5diff_800.out.err h5diff_801.out h5diff_801.out.err + h5diff_830.out + h5diff_830.out.err h5diff_8625.out h5diff_8625.out.err h5diff_8639.out @@ -1544,6 +1547,11 @@ ADD_H5_TEST (h5diff_800 1 -v ${FILE7} ${FILE8} /g1/array /g1/array) ADD_H5_TEST (h5diff_801 1 -v ${FILE7} ${FILE8A} /g1/array /g1/array) # ############################################################################## +# # dataset subsets +# ############################################################################## +#TRILABS-227 ADD_H5_TEST (h5diff_830 1 --enable-error-stack -v ${FILE7} ${FILE8} /g1/array3D[0,0,0;2,2,1;2,2,2;] /g1/array3D[0,0,0;2,2,1;2,2,2;]) + +# ############################################################################## # # VDS tests # ############################################################################## ADD_H5_TEST (h5diff_v1 0 -v ${FILEV1} ${FILEV2}) diff --git a/tools/test/h5diff/testfiles/h5diff_830.txt b/tools/test/h5diff/testfiles/h5diff_830.txt new file mode 100644 index 0000000..8f00d8b --- /dev/null +++ b/tools/test/h5diff/testfiles/h5diff_830.txt @@ -0,0 +1,30 @@ +dataset: and +size: [4x3x2] [4x3x2] +position array3D array3D difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 0 ] 2 0 2 +[ 0 0 0 ] 3 0 3 +[ 0 0 1 ] 4 0 4 +[ 0 0 1 ] 5 0 5 +[ 0 0 1 ] 6 0 6 +[ 0 2 0 ] 13 0 13 +[ 0 2 0 ] 14 0 14 +[ 0 2 0 ] 15 0 15 +[ 0 2 1 ] 16 0 16 +[ 0 2 1 ] 17 0 17 +[ 0 2 1 ] 18 0 18 +[ 2 0 0 ] 37 0 37 +[ 2 0 0 ] 38 0 38 +[ 2 0 0 ] 39 0 39 +[ 2 0 1 ] 40 0 40 +[ 2 0 1 ] 41 0 41 +[ 2 0 1 ] 42 0 42 +[ 2 2 0 ] 49 0 49 +[ 2 2 0 ] 50 0 50 +[ 2 2 0 ] 51 0 51 +[ 2 2 1 ] 52 0 52 +[ 2 2 1 ] 53 0 53 +[ 2 2 1 ] 54 0 54 +24 differences found +EXIT CODE: 1 diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in index 9f88ee1..587c340 100644 --- a/tools/test/h5diff/testh5diff.sh.in +++ b/tools/test/h5diff/testh5diff.sh.in @@ -354,6 +354,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_710.txt $SRC_H5DIFF_TESTFILES/h5diff_80.txt $SRC_H5DIFF_TESTFILES/h5diff_800.txt $SRC_H5DIFF_TESTFILES/h5diff_801.txt +$SRC_H5DIFF_TESTFILES/h5diff_830.txt $SRC_H5DIFF_TESTFILES/h5diff_90.txt $SRC_H5DIFF_TESTFILES/h5diff_8625.txt $SRC_H5DIFF_TESTFILES/h5diff_8639.txt @@ -1202,6 +1203,11 @@ TOOLTEST h5diff_800.txt -v h5diff_dset1.h5 h5diff_dset2.h5 /g1/array /g1/array TOOLTEST h5diff_801.txt -v h5diff_dset1.h5 h5diff_dset3.h5 /g1/array /g1/array # ############################################################################## +# # dataset subsets +# ############################################################################## +#TRILABS-227 TOOLTEST h5diff_830.txt --enable-error-stack -v h5diff_dset1.h5 h5diff_dset2.h5 /g1/array3D[0,0,0;2,2,1;2,2,2;] /g1/array3D[0,0,0;2,2,1;2,2,2;] + +# ############################################################################## # VDS tests # ############################################################################## TOOLTEST h5diff_v1.txt -v 1_vds.h5 2_vds.h5 -- cgit v0.12 From 6a344232f641135e6bc5f89d66a01c68d29bfa00 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Sat, 15 Aug 2020 18:10:57 -0500 Subject: Add testfiles --- MANIFEST | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MANIFEST b/MANIFEST index f26d0b8..b53e4e7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2743,24 +2743,31 @@ ./tools/test/h5repack/testfiles/4_vds.h5-vds_compa-v.ddl ./tools/test/h5repack/testfiles/attrregion.tattrreg.h5.ddl ./tools/test/h5repack/testfiles/dataregion.tdatareg.h5.ddl +./tools/test/h5repack/testfiles/textlink-base.textlink.h5.ddl ./tools/test/h5repack/testfiles/textlink-merge.textlink.h5.tst ./tools/test/h5repack/testfiles/textlink-mergeprune.textlink.h5.ddl ./tools/test/h5repack/testfiles/textlink-prune.textlink.h5.ddl +./tools/test/h5repack/testfiles/textlinkfar-base.textlinkfar.h5.ddl ./tools/test/h5repack/testfiles/textlinkfar-merge.textlinkfar.h5.tst ./tools/test/h5repack/testfiles/textlinkfar-mergeprune.textlinkfar.h5.ddl ./tools/test/h5repack/testfiles/textlinkfar-prune.textlinkfar.h5.ddl +./tools/test/h5repack/testfiles/textlinksrc-base.textlinksrc.h5.ddl ./tools/test/h5repack/testfiles/textlinksrc-merge.textlinksrc.h5.tst ./tools/test/h5repack/testfiles/textlinksrc-mergeprune.textlinksrc.h5.ddl ./tools/test/h5repack/testfiles/textlinksrc-prune.textlinksrc.h5.ddl +./tools/test/h5repack/testfiles/textlinktar-base.textlinktar.h5.ddl ./tools/test/h5repack/testfiles/textlinktar-merge.textlinktar.h5.tst ./tools/test/h5repack/testfiles/textlinktar-mergeprune.textlinktar.h5.ddl ./tools/test/h5repack/testfiles/textlinktar-prune.textlinktar.h5.ddl +./tools/test/h5repack/testfiles/tsoftlinks-base.tsoftlinks.h5.ddl ./tools/test/h5repack/testfiles/tsoftlinks-merge.tsoftlinks.h5.tst ./tools/test/h5repack/testfiles/tsoftlinks-mergeprune.tsoftlinks.h5.ddl ./tools/test/h5repack/testfiles/tsoftlinks-prune.tsoftlinks.h5.ddl +./tools/test/h5repack/testfiles/h5copy_extlinks_src-base.h5copy_extlinks_src.h5.ddl ./tools/test/h5repack/testfiles/h5copy_extlinks_src-merge.h5copy_extlinks_src.h5.tst ./tools/test/h5repack/testfiles/h5copy_extlinks_src-mergeprune.h5copy_extlinks_src.h5.ddl ./tools/test/h5repack/testfiles/h5copy_extlinks_src-prune.h5copy_extlinks_src.h5.ddl +./tools/test/h5repack/testfiles/h5copy_extlinks_trg.h5 # jam utility and tests ./tools/src/h5jam/Makefile.am -- cgit v0.12 From 31673041d8342002d11ced2a7def938438dd912d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Sun, 16 Aug 2020 11:07:59 -0500 Subject: Fix javadoc warning --- java/src/hdf/hdf5lib/H5.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index ae1eb3d..1147e6c 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -6693,6 +6693,8 @@ public class H5 implements java.io.Serializable { * @param fapl_id * IN: File access property list identifier * + * @return indication if file locking is used. + * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @@ -6706,6 +6708,8 @@ public class H5 implements java.io.Serializable { * @param fapl_id * IN: File access property list identifier * + * @return indication if file locking is ignored. + * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * -- cgit v0.12 From 0d14414ddd860f24f1386771ed3ba8d2f5e2710d Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Sun, 16 Aug 2020 18:41:13 -0500 Subject: 1. HDFFV-10830 part 2, move AC_CHECK_HEADERS([szlib.h] after AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress] to avoid compiling H5Z.c with szlib.h after its path is removed from AM_CPPFLAGS. 2. Remove unnecessary links to ${HDF5_TOOLS_LIB_TARGET} in utils/mirror_vfd/CMakeLists.txt that prevent building HDF5 with tools disabled. --- configure.ac | 12 ++++++------ utils/mirror_vfd/CMakeLists.txt | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 6e0b4c7..75b94f0 100644 --- a/configure.ac +++ b/configure.ac @@ -1594,19 +1594,19 @@ case "X-$withval" in AM_CPPFLAGS="$AM_CPPFLAGS -I$szlib_inc" fi - AC_CHECK_HEADERS([szlib.h], - [HAVE_SZLIB_H="yes"], - [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_SZLIB]) - if test -n "$szlib_lib"; then LDFLAGS="$LDFLAGS -L$szlib_lib" AM_LDFLAGS="$AM_LDFLAGS -L$szlib_lib" fi - if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then + if test "x$HAVE_SZLIB" = "xyes"; then AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_SZLIB]) - if test -z "$HAVE_SZLIB"; then + if test -n "$HAVE_SZLIB"; then + AC_CHECK_HEADERS([szlib.h], + [HAVE_SZLIB_H="yes"], + [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_SZLIB]) + else AC_MSG_RESULT([Using SZ_BufftoBuffCompress from libsz in $szlib_lib failed. Szip not enabled.]) fi fi diff --git a/utils/mirror_vfd/CMakeLists.txt b/utils/mirror_vfd/CMakeLists.txt index 1926352..6137e82 100644 --- a/utils/mirror_vfd/CMakeLists.txt +++ b/utils/mirror_vfd/CMakeLists.txt @@ -13,10 +13,10 @@ add_executable (mirror_server ${mirror_server_SOURCES}) target_include_directories (mirror_server PRIVATE "${HDF5_UITLS_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (mirror_server STATIC) - target_link_libraries (mirror_server PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + target_link_libraries (mirror_server PRIVATE ${HDF5_LIB_TARGET}) else () TARGET_C_PROPERTIES (mirror_server SHARED) - target_link_libraries (mirror_server PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (mirror_server PRIVATE ${HDF5_LIBSH_TARGET}) endif () set_target_properties (mirror_server PROPERTIES FOLDER utils) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};mirror_server") @@ -31,10 +31,10 @@ add_executable (mirror_server_stop ${mirror_server_stop_SOURCES}) target_include_directories (mirror_server_stop PRIVATE "${HDF5_UITLS_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (mirror_server_stop STATIC) - target_link_libraries (mirror_server_stop PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + target_link_libraries (mirror_server_stop PRIVATE ${HDF5_LIB_TARGET}) else () TARGET_C_PROPERTIES (mirror_server_stop SHARED) - target_link_libraries (mirror_server_stop PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (mirror_server_stop PRIVATE ${HDF5_LIBSH_TARGET}) endif () set_target_properties (mirror_server_stop PROPERTIES FOLDER utils) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};mirror_server_stop") -- cgit v0.12 From 578740480455c982777140bb66ee236f90ac6ff0 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 16 Aug 2020 18:10:48 -0700 Subject: Trivialities noticed while normalizing 1.10 --- src/H5Oattribute.c | 2 +- src/H5Odeprec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index a795957..d6b9f7a 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -13,7 +13,7 @@ /*------------------------------------------------------------------------- * - * Created: H5Oattribute.c + * Created: H5Oattribute.c * * Purpose: Object header attribute routines. * diff --git a/src/H5Odeprec.c b/src/H5Odeprec.c index aca0d59..b37fde5 100644 --- a/src/H5Odeprec.c +++ b/src/H5Odeprec.c @@ -13,7 +13,7 @@ /*------------------------------------------------------------------------- * - * Purpose: Deprecated functions from the H5O interface. These + * Purpose: Deprecated functions from the H5O interface. These * functions are here for compatibility purposes and may be * removed in the future. Applications should switch to the * newer APIs. -- cgit v0.12 From d00bab96fb4da12a18b5de528c96469978c4c927 Mon Sep 17 00:00:00 2001 From: mainzer Date: Mon, 17 Aug 2020 08:19:33 -0500 Subject: Minor copy edits to comments -- no code changes. --- src/H5C.c | 2 +- src/H5Cdbg.c | 2 +- src/H5Cmpio.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/H5C.c b/src/H5C.c index 192a3c8..2cc417a 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -5590,7 +5590,7 @@ done: * happens. The code I have added should allow us to * handle the situation under all but the worst conditions, * but one can argue that we should just scream and die if - * we ever detect the condidtion. + * we ever detect the condition. * * -- JRM 10/13/07 * diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index 2585eae..ea27858 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -272,7 +272,7 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name) * Programmer: John Mainzer * 11/15/14 * - * Changes: Updated function for the slist_enabled field in H6C_t. + * Changes: Updated function for the slist_enabled field in H5C_t. * Recall that to minimize slist overhead, the slist is * empty and not maintained if cache_ptr->slist_enabled is * false. diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 6ec0513..6e33eb1 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -458,7 +458,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); /* As a sanity check, set space needed to the dirty_index_size. This - * should be the sum total of the sizes of all the dirty entries in + * should be the sum total of the sizes of all the dirty entries * in the metadata cache. Note that if the slist is enabled, * cache_ptr->slist_size should equal cache_ptr->dirty_index_size. */ -- cgit v0.12 From b2d917437dde37938ce27753b9bf22899bf1f6a9 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 17 Aug 2020 09:12:59 -0700 Subject: Minor refactoring based on 1.10 normalization work --- hl/src/H5DS.c | 25 ++++++------ src/H5A.c | 37 +++++++++--------- src/H5B.c | 30 +++++++------- src/H5Ddeprec.c | 4 +- src/H5E.c | 39 +++++++++---------- src/H5Edeprec.c | 13 +++---- src/H5FSsection.c | 2 +- src/H5MF.c | 7 ++-- src/H5Oflush.c | 22 +++++------ src/H5Oint.c | 16 ++++---- src/H5Olayout.c | 4 +- src/H5Omtime.c | 6 +-- src/H5Oname.c | 6 +-- src/H5Opline.c | 4 +- src/H5PLprivate.h | 4 +- src/H5Pdapl.c | 2 +- src/H5Tcommit.c | 23 +++++++++-- src/H5Tcompound.c | 8 ++-- src/H5Tenum.c | 10 ++--- src/H5Tprecis.c | 28 ++++++------- src/H5Tprivate.h | 2 +- src/H5Tvlen.c | 1 + src/H5Ztrans.c | 8 ++-- src/H5dbg.c | 91 ++++++++++++++++++++++--------------------- src/H5detect.c | 3 ++ test/fillval.c | 2 +- test/page_buffer.c | 1 - tools/src/h5import/h5import.c | 2 +- tools/test/perform/chunk.c | 2 +- 29 files changed, 210 insertions(+), 192 deletions(-) diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index bd4c196..9847cae 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -1896,19 +1896,18 @@ out: } /*------------------------------------------------------------------------- -* Function: H5DSis_scale -* -* Purpose: check if the dataset DID is a dimension scale -* -* Return: 1, is, 0, not, FAIL, error -* -* Programmer: pvn@ncsa.uiuc.edu -* -* Date: January 04, 2005 -* -*------------------------------------------------------------------------- -*/ - + * Function: H5DSis_scale + * + * Purpose: check if the dataset DID is a dimension scale + * + * Return: 1, is, 0, not, FAIL, error + * + * Programmer: Pedro Vicente + * + * Date: January 04, 2005 + * + *------------------------------------------------------------------------- + */ htri_t H5DSis_scale(hid_t did) { hid_t tid = -1; /* attribute type ID */ diff --git a/src/H5A.c b/src/H5A.c index 2986466..19c2e77 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -313,7 +313,7 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, /* Register the new attribute and get an ID for it */ if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle") + HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register attribute for ID") done: /* Cleanup on failure */ @@ -403,7 +403,7 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, /* Register the new attribute and get an ID for it */ if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle") + HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register attribute for ID") done: /* Cleanup on failure */ @@ -471,7 +471,7 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) /* Register the attribute and get an ID for it */ if((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle") + HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register attribute for ID") done: /* Cleanup on failure */ @@ -1028,7 +1028,7 @@ H5Aget_info(hid_t attr_id, H5A_info_t *ainfo) FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", attr_id, ainfo); - /* Check arguments */ + /* Check args */ if(NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") if(!ainfo) @@ -1170,7 +1170,8 @@ done: * * Purpose: Rename an attribute * - * Return: SUCCEED/FAIL + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Raymond Lu * October 23, 2002 @@ -1185,7 +1186,7 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name) FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*s*s", loc_id, old_name, new_name); - /* check arguments */ + /* Check arguments */ if(H5I_ATTR == H5I_get_type(loc_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") if(!old_name) @@ -1205,7 +1206,6 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name) loc_params.type = H5VL_OBJECT_BY_SELF; loc_params.obj_type = H5I_get_type(loc_id); - /* Get the location object */ if(NULL == (vol_obj = H5VL_vol_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier") @@ -1228,7 +1228,8 @@ done: * * Purpose: Rename an attribute * - * Return: SUCCEED/FAIL + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * February 20, 2007 @@ -1330,7 +1331,7 @@ H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, { H5VL_object_t *vol_obj = NULL; /* object of loc_id */ H5VL_loc_params_t loc_params; - herr_t ret_value; /* Return value */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "iIiIo*hx*x", loc_id, idx_type, order, idx, op, op_data); @@ -1407,15 +1408,15 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, void *op_data, hid_t lapl_id) { - H5VL_object_t *vol_obj = NULL; /* object of loc_id */ + H5VL_object_t *vol_obj = NULL; /* Object location */ H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE8("e", "i*sIiIo*hx*xi", loc_id, obj_name, idx_type, order, idx, op, op_data, lapl_id); - /* check arguments */ + /* Check arguments */ if(H5I_ATTR == H5I_get_type(loc_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") if(!obj_name || !*obj_name) @@ -1466,7 +1467,7 @@ H5Adelete(hid_t loc_id, const char *name) { H5VL_object_t *vol_obj = NULL; H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*s", loc_id, name); @@ -1522,7 +1523,7 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, { H5VL_object_t *vol_obj; H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*s*si", loc_id, obj_name, attr_name, lapl_id); @@ -1588,7 +1589,7 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5VL_object_t *vol_obj; H5VL_loc_params_t loc_params; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "i*sIiIohi", loc_id, obj_name, idx_type, order, n, lapl_id); @@ -1619,7 +1620,7 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, if(NULL == (vol_obj = H5VL_vol_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") - /* Delete the attribute through the VOL */ + /* Delete the attribute */ if(H5VL_attr_specific(vol_obj, &loc_params, H5VL_ATTR_DELETE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") @@ -1679,7 +1680,7 @@ H5Aexists(hid_t obj_id, const char *attr_name) { H5VL_object_t *vol_obj; H5VL_loc_params_t loc_params; - htri_t ret_value; /* Return value */ + htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("t", "i*s", obj_id, attr_name); @@ -1725,7 +1726,7 @@ H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, { H5VL_object_t *vol_obj; H5VL_loc_params_t loc_params; - htri_t ret_value; /* Return value */ + htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("t", "i*s*si", loc_id, obj_name, attr_name, lapl_id); diff --git a/src/H5B.c b/src/H5B.c index 2ab5198..1c6ab21 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -13,9 +13,9 @@ /*------------------------------------------------------------------------- * - * Created: H5B.c - * Jul 10 1997 - * Robb Matzke + * Created: H5B.c + * Jul 10 1997 + * Robb Matzke * * Purpose: Implements balanced, sibling-linked, N-ary trees * capable of storing any type of data with unique key @@ -592,7 +592,7 @@ H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) if((int)(my_ins = H5B__insert_helper(f, &bt_ud, type, lt_key, <_key_changed, md_key, udata, rt_key, &rt_key_changed, &split_bt_ud/*out*/)) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to insert key") + HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to insert key") /* Check if the root node split */ if(H5B_INS_NOOP == my_ins) { @@ -609,9 +609,9 @@ H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) /* update left and right keys */ if(!lt_key_changed) - H5MM_memcpy(lt_key, H5B_NKEY(bt_ud.bt,shared,0), type->sizeof_nkey); + H5MM_memcpy(lt_key, H5B_NKEY(bt_ud.bt,shared,0), type->sizeof_nkey); if(!rt_key_changed) - H5MM_memcpy(rt_key, H5B_NKEY(split_bt_ud.bt,shared,split_bt_ud.bt->nchildren), type->sizeof_nkey); + H5MM_memcpy(rt_key, H5B_NKEY(split_bt_ud.bt,shared,split_bt_ud.bt->nchildren), type->sizeof_nkey); /* * Copy the old root node to some other file location and make the new root @@ -620,7 +620,7 @@ H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) */ H5_CHECK_OVERFLOW(shared->sizeof_rnode,size_t,hsize_t); if(HADDR_UNDEF == (old_root_addr = H5MF_alloc(f, H5FD_MEM_BTREE, (hsize_t)shared->sizeof_rnode))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "unable to allocate file space to move root") + HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "unable to allocate file space to move root") /* * Move the node to the new location @@ -633,12 +633,12 @@ H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) /* Unprotect the old root so we can move it. Also force it to be marked * dirty so it is written to the new location. */ if(H5AC_unprotect(f, H5AC_BT, bt_ud.addr, bt_ud.bt, H5AC__DIRTIED_FLAG) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release old root") + HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release old root") bt_ud.bt = NULL; /* Make certain future references will be caught */ /* Move the location of the old root on the disk */ if(H5AC_move_entry(f, H5AC_BT, bt_ud.addr, old_root_addr) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to move B-tree root node") + HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to move B-tree root node") bt_ud.addr = old_root_addr; /* Update the split b-tree's left pointer to point to the new location */ @@ -833,7 +833,7 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, /* Get shared info for B-tree */ if(NULL == (rc_shared = (type->get_shared)(f, udata))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, H5B_INS_ERROR, "can't retrieve B-tree's shared ref. count object") + HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, H5B_INS_ERROR, "can't retrieve B-tree's shared ref. count object") shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared); HDassert(shared); @@ -1258,7 +1258,7 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, /* Get shared info for B-tree */ if(NULL == (rc_shared = (type->get_shared)(f, udata))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, H5B_INS_ERROR, "can't retrieve B-tree's shared ref. count object") + HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, H5B_INS_ERROR, "can't retrieve B-tree's shared ref. count object") shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared); HDassert(shared); @@ -1270,7 +1270,7 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, cache_udata.type = type; cache_udata.rc_shared = rc_shared; if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load B-tree node") + HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load B-tree node") rt = bt->nchildren; while(lt < rt && cmp) { @@ -1409,7 +1409,7 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, bt->nchildren = 0; /* Delete the node from disk (via the metadata cache) */ - bt_flags |= H5AC__DIRTIED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; + bt_flags |= H5AC__DIRTIED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; H5_CHECK_OVERFLOW(shared->sizeof_rnode, size_t, hsize_t); if(H5AC_unprotect(f, H5AC_BT, addr, bt, bt_flags | H5AC__DELETED_FLAG) < 0) { bt = NULL; @@ -1874,7 +1874,7 @@ H5B__get_info_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr, /* Get shared info for B-tree */ if(NULL == (rc_shared = (type->get_shared)(f, info_udata->udata))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object") + HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object") shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared); HDassert(shared); @@ -1886,7 +1886,7 @@ H5B__get_info_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr, cache_udata.type = type; cache_udata.rc_shared = rc_shared; if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node") + HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node") /* Cache information from this node */ left_child = bt->child[0]; diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index 7668389..312bd4b 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -148,12 +148,12 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if(NULL == (vol_obj = H5VL_vol_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier") - /* Create the dataset through the VOL */ + /* Create the dataset */ if(NULL == (dset = H5VL_dataset_create(vol_obj, &loc_params, name, H5P_LINK_CREATE_DEFAULT, type_id, space_id, dcpl_id, H5P_DATASET_ACCESS_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to create dataset") - /* Get an atom for the dataset */ + /* Register the new dataset to get an ID for it */ if((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, TRUE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataset") diff --git a/src/H5E.c b/src/H5E.c index 0f7a031..a56181d 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -50,7 +50,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5CXprivate.h" /* API Contexts */ #include "H5Epkg.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ #include "H5Iprivate.h" /* IDs */ @@ -514,9 +513,9 @@ done: * * Purpose: Closes an error class. * - * Return: SUCCEED/FAIL + * Return: Non-negative value on success/Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Friday, July 11, 2003 * *------------------------------------------------------------------------- @@ -1041,9 +1040,9 @@ done: * Purpose: Replaces current stack with specified stack. This closes the * stack ID also. * - * Return: SUCCEED/FAIL + * Return: Non-negative value on success/Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Friday, July 15, 2003 * *------------------------------------------------------------------------- @@ -1147,9 +1146,9 @@ done: * * Purpose: Closes an error stack. * - * Return: SUCCEED/FAIL + * Return: Non-negative value on success/Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Friday, July 14, 2003 * *------------------------------------------------------------------------- @@ -1285,9 +1284,9 @@ H5E__get_num(const H5E_t *estack) * * Purpose: Deletes some error messages from the top of error stack. * - * Return: SUCCEED/FAIL + * Return: Non-negative value on success/Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Friday, July 16, 2003 * *------------------------------------------------------------------------- @@ -1340,9 +1339,9 @@ done: * function name, file name, and error description strings must * be statically allocated. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, October 18, 1999 * * Notes: Basically a new public API wrapper around the H5E__push_stack @@ -1442,9 +1441,9 @@ done: * * Purpose: Clears the error stack for the specified error stack. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, July 16, 2003 * *------------------------------------------------------------------------- @@ -1487,9 +1486,9 @@ done: * prints error messages. Users are encouraged to write their * own more specific error handlers. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, February 27, 1998 * *------------------------------------------------------------------------- @@ -1532,9 +1531,9 @@ done: * Purpose: Walks the error stack for the current thread and calls some * function for each error along the way. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, February 27, 1998 * *------------------------------------------------------------------------- @@ -1582,7 +1581,7 @@ done: * Either (or both) arguments may be null in which case the * value is not returned. * - * Return: SUCCEED/FAIL + * Return: Non-negative value on success/Negative on failure * * Programmer: Robb Matzke * Saturday, February 28, 1998 @@ -1640,7 +1639,7 @@ done: * Automatic stack traversal is always in the H5E_WALK_DOWNWARD * direction. * - * Return: SUCCEED/FAIL + * Return: Non-negative value on success/Negative on failure * * Programmer: Robb Matzke * Friday, February 27, 1998 @@ -1699,7 +1698,7 @@ done: * or the H5E_auto_t typedef. The IS_STACK parameter is set * to 1 for the first case and 0 for the latter case. * - * Return: SUCCEED/FAIL + * Return: Non-negative value on success/Negative on failure * * Programmer: Quincey Koziol * Wednesday, September 8, 2004 diff --git a/src/H5Edeprec.c b/src/H5Edeprec.c index 437c431..046830f 100644 --- a/src/H5Edeprec.c +++ b/src/H5Edeprec.c @@ -36,7 +36,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5CXprivate.h" /* API Contexts */ #include "H5Epkg.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ @@ -198,7 +197,7 @@ done: * same parameter as the old function, in contrary to * H5Epush2. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Tuesday, Sep 16, 2003 @@ -230,7 +229,7 @@ done: * Purpose: This function is for backward compatibility. * Clears the error stack for the specified error stack. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Wednesday, July 16, 2003 @@ -264,7 +263,7 @@ done: * prints error messages. Users are encouraged to write there * own more specific error handlers. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Sep 16, 2003 @@ -300,7 +299,7 @@ done: * Walks the error stack for the current thread and calls some * function for each error along the way. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Sep 16, 2003 @@ -341,7 +340,7 @@ done: * Either (or both) arguments may be null in which case the * value is not returned. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Sep 16, 2003 @@ -394,7 +393,7 @@ done: * Automatic stack traversal is always in the H5E_WALK_DOWNWARD * direction. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Sep 16, 2003 diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 51233a0..62263f2 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -2277,7 +2277,7 @@ H5FS__sect_assert(const H5FS_t *fspace) * * Return: TRUE/FALSE/FAIL * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * *------------------------------------------------------------------------- */ diff --git a/src/H5MF.c b/src/H5MF.c index aa65db2..48e7936 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -1553,11 +1553,11 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); if(H5F_PAGED_AGGR(f)) { if((ret_value = H5MF__close_pagefs(f)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't close free-space managers for 'page' file space") - } /* end if */ + } else { if((ret_value = H5MF__close_aggrfs(f)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't close free-space managers for 'aggr' file space") - } /* end else */ + } done: #ifdef H5MF_ALLOC_DEBUG @@ -2987,7 +2987,6 @@ done: FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF_settle_raw_data_fsm() */ - /*------------------------------------------------------------------------- * Function: H5MF_settle_meta_data_fsm() @@ -3047,7 +3046,7 @@ done: * 3) Reduce the EOA to the extent possible, and make note * of the resulting value. This value will be stored * in the fsinfo superblock extension message and be used - * in the subsequent file open. + * in the subsequent file open. * * 4) Re-allocate space for any free space manager(s) that: * diff --git a/src/H5Oflush.c b/src/H5Oflush.c index 8d6f0b1..703fbbe 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -62,7 +62,7 @@ static herr_t H5O__refresh_metadata_close(hid_t oid, H5O_loc_t oloc, * * Purpose: Flushes all buffers associated with an object to disk. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success, negative on failure * * Programmer: Mike McGreevy * May 19, 2010 @@ -85,7 +85,7 @@ H5Oflush(hid_t obj_id) /* Set up collective metadata if appropriate */ if(H5CX_set_loc(obj_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Set location parameters */ loc_params.type = H5VL_OBJECT_BY_SELF; @@ -169,7 +169,7 @@ H5O_flush_common(H5O_loc_t *oloc, hid_t obj_id) /* Flush metadata based on tag value of the object */ if(H5F_flush_tagged_metadata(oloc->file, tag) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") + HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") /* Check to invoke callback */ if(H5F_object_flush_cb(oloc->file, obj_id) < 0) @@ -226,7 +226,7 @@ done: * * Purpose: Refreshes all buffers associated with an object. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success, negative on failure * * Programmer: Mike McGreevy * July 28, 2010 @@ -395,32 +395,32 @@ H5O__refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc) /* Handle close for multiple dataset opens */ if(H5I_get_type(oid) == H5I_DATASET) if(H5D_mult_refresh_close(oid) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to prepare refresh for dataset") + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to prepare refresh for dataset") /* Retrieve tag for object */ if(H5O__oh_tag(&oloc, &tag) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to get object header address") + HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to get object header address") /* Get cork status of the object with tag */ if(H5AC_cork(oloc.file, tag, H5AC__GET_CORKED, &corked) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_SYSTEM, FAIL, "unable to retrieve an object's cork status") + HGOTO_ERROR(H5E_OHDR, H5E_SYSTEM, FAIL, "unable to retrieve an object's cork status") /* Close the object */ if(H5I_dec_ref(oid) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to close object") + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to close object") /* Flush metadata based on tag value of the object */ if(H5F_flush_tagged_metadata(oloc.file, tag) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") + HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") /* Evict the object's tagged metadata */ if(H5F_evict_tagged_metadata(oloc.file, tag) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to evict metadata") + HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to evict metadata") /* Re-cork object with tag */ if(corked) if(H5AC_cork(oloc.file, tag, H5AC__SET_CORK, &corked) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_SYSTEM, FAIL, "unable to cork the object") + HGOTO_ERROR(H5E_OHDR, H5E_SYSTEM, FAIL, "unable to cork the object") done: FUNC_LEAVE_NOAPI(ret_value); diff --git a/src/H5Oint.c b/src/H5Oint.c index 09db25a..e41f0fe 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -2248,7 +2248,7 @@ H5O_get_info(const H5O_loc_t *loc, H5O_info2_t *oinfo, unsigned fields) /* Set the object's reference count */ oinfo->rc = oh->nlink; - } /* end if */ + } /* Get time information, if requested */ if(fields & H5O_INFO_TIME) { @@ -2544,8 +2544,8 @@ H5O_get_oh_addr(const H5O_t *oh) /*------------------------------------------------------------------------- * Function: H5O_get_oh_flags * - * Programmer: Jacob Smith - * 2018 August 17 + * Programmer: Jacob Smith + * 2018 August 17 * *------------------------------------------------------------------------- */ @@ -2561,12 +2561,12 @@ H5O_get_oh_flags(const H5O_t *oh) /*------------------------------------------------------------------------- * Function: H5O_get_oh_mtime * - * Purpose: Retrieve an object's modification time. Assumes that the + * Purpose: Retrieve an object's modification time. Assumes that the * caller has verified that accessing this variable is appropriate * to the header in question. * - * Programmer: Jacob Smith - * 2018 August 17 + * Programmer: Jacob Smith + * 2018 August 17 * *------------------------------------------------------------------------- */ @@ -2583,8 +2583,8 @@ H5O_get_oh_mtime(const H5O_t *oh) /*------------------------------------------------------------------------- * Function: H5O_get_oh_version * - * Programmer: Jacob Smith - * 2018 August 17 + * Programmer: Jacob Smith + * 2018 August 17 * *------------------------------------------------------------------------- */ diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 671afeb..99e646d 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -425,14 +425,14 @@ H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, tmp_size = HDstrlen((const char *)heap_block_p) + 1; if(NULL == (mesg->storage.u.virt.list[i].source_file_name = (char *)H5MM_malloc(tmp_size))) HGOTO_ERROR(H5E_OHDR, H5E_RESOURCE, NULL, "unable to allocate memory for source file name") - (void)H5MM_memcpy(mesg->storage.u.virt.list[i].source_file_name, heap_block_p, tmp_size); + H5MM_memcpy(mesg->storage.u.virt.list[i].source_file_name, heap_block_p, tmp_size); heap_block_p += tmp_size; /* Source dataset name */ tmp_size = HDstrlen((const char *)heap_block_p) + 1; if(NULL == (mesg->storage.u.virt.list[i].source_dset_name = (char *)H5MM_malloc(tmp_size))) HGOTO_ERROR(H5E_OHDR, H5E_RESOURCE, NULL, "unable to allocate memory for source dataset name") - (void)H5MM_memcpy(mesg->storage.u.virt.list[i].source_dset_name, heap_block_p, tmp_size); + H5MM_memcpy(mesg->storage.u.virt.list[i].source_dset_name, heap_block_p, tmp_size); heap_block_p += tmp_size; /* Source selection */ diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 846bbf3..09a8210 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -11,10 +11,10 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke - * Friday, July 24, 1998 +/* Programmer: Robb Matzke + * Friday, July 24, 1998 * - * Purpose: The object modification time message. + * Purpose: The object modification time message. */ #include "H5Omodule.h" /* This source code file is part of the H5O module */ diff --git a/src/H5Oname.c b/src/H5Oname.c index 41cd01e..0e1fc62 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -97,9 +97,9 @@ H5O__name_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, /* decode */ if(NULL == (mesg = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") if(NULL == (mesg->s = (char *)H5MM_strdup((const char *)p))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Set return value */ ret_value = mesg; @@ -172,7 +172,7 @@ H5O__name_copy(const void *_mesg, void *_dest) HDassert(mesg); if(!dest && NULL == (dest = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* copy */ *dest = *mesg; diff --git a/src/H5Opline.c b/src/H5Opline.c index 35efed3..6ee0735 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -12,8 +12,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Wednesday, April 15, 1998 + * Programmer: Robb Matzke + * Wednesday, April 15, 1998 * * Purpose: Data filter pipeline message. */ diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h index 5ce9b87..623e19a 100644 --- a/src/H5PLprivate.h +++ b/src/H5PLprivate.h @@ -21,8 +21,8 @@ #include "H5PLpublic.h" /* Private headers needed by this file */ -#include "H5private.h" /* Generic Functions */ -#include "H5VLprivate.h" /* Virtual Object Layer */ +#include "H5private.h" /* Generic Functions */ +#include "H5VLprivate.h" /* Virtual Object Layer */ /**************************/ diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 6dae5ed..c3cb81d 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -37,7 +37,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ #include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Ppkg.h" /* Property lists */ diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index bb660c2..789f20c 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -95,7 +95,10 @@ H5FL_EXTERN(H5VL_object_t); * Purpose: Save a transient datatype to a file and turn the type handle * into a "named", immutable type. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * April 5, 2007 * *------------------------------------------------------------------------- */ @@ -263,7 +266,10 @@ done: * Note: The datatype access property list is unused currently, but * is checked for sanity anyway. * - * Return: SUCCEED/FAIL + * Return: Non-negative on success/Negative on failure + * + * Programmer: Peter Cao + * May 17, 2005 * *------------------------------------------------------------------------- */ @@ -495,7 +501,10 @@ done: * * Purpose: Determines if a datatype is committed or not. * - * Return: TRUE/FALSE/FAIL + * Return: TRUE/FALSE/Negative + * + * Programmer: Robb Matzke + * Thursday, June 4, 1998 * *------------------------------------------------------------------------- */ @@ -527,7 +536,7 @@ done: * ADJUST to the link count. * * Return: Success: New link count - * Failure: Negative + * Failure: -1 * * Programmer: Quincey Koziol * Friday, September 26, 2003 @@ -563,6 +572,9 @@ done: * * Failure: H5I_INVALID_HID * + * Programmer: James Laird + * Thursday July 27, 2006 + * *------------------------------------------------------------------------- */ hid_t @@ -626,6 +638,9 @@ done: * * Failure: H5I_INVALID_HID * + * Programmer: Quincey Koziol + * Tuesday, November 28, 2006 + * *------------------------------------------------------------------------- */ hid_t diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index caf81cb..5d2d872 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -242,7 +242,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_member_type * - * Purpose: Returns a copy of the data type of the specified member. + * Purpose: Returns a copy of the data type of the specified member. * * Return: Success: A copy of the member datatype; * modifying the returned datatype does not @@ -268,7 +268,7 @@ H5T_get_member_type(const H5T_t *dt, unsigned membno) /* Copy datatype */ if(NULL == (ret_value = H5T_copy(dt->shared->u.compnd.memb[membno].type, H5T_COPY_TRANSIENT))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "unable to copy member datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "unable to copy member datatype") done: FUNC_LEAVE_NOAPI(ret_value) @@ -305,7 +305,7 @@ H5T__reopen_member_type(const H5T_t *dt, unsigned membno) /* Copy datatype, possibly re-opening it */ if(NULL == (ret_value = H5T_copy_reopen(dt->shared->u.compnd.memb[membno].type))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "unable to reopen member datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "unable to reopen member datatype") done: FUNC_LEAVE_NOAPI(ret_value) @@ -582,7 +582,7 @@ H5T__pack(const H5T_t *dt) for(i = 0, offset = 0; i < dt->shared->u.compnd.nmembs; i++) { dt->shared->u.compnd.memb[i].offset = offset; offset += dt->shared->u.compnd.memb[i].size; - } /* end for */ + } /* Change total size */ dt->shared->size = MAX(1, offset); diff --git a/src/H5Tenum.c b/src/H5Tenum.c index cd41a23..e1d8246 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -191,17 +191,17 @@ H5T__enum_insert(const H5T_t *dt, const char *name, const void *value) /* The name and value had better not already exist */ for(i = 0; i < dt->shared->u.enumer.nmembs; i++) { - if(!HDstrcmp(dt->shared->u.enumer.name[i], name)) + if(!HDstrcmp(dt->shared->u.enumer.name[i], name)) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "name redefinition") - if(!HDmemcmp((uint8_t *)dt->shared->u.enumer.value + (i * dt->shared->size), value, dt->shared->size)) + if(!HDmemcmp((uint8_t *)dt->shared->u.enumer.value + (i * dt->shared->size), value, dt->shared->size)) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "value redefinition") - } /* end for */ + } /* Increase table sizes */ if(dt->shared->u.enumer.nmembs >= dt->shared->u.enumer.nalloc) { char **names; uint8_t *values; - unsigned n = MAX(32, 2*dt->shared->u.enumer.nalloc); + unsigned n = MAX(32, 2*dt->shared->u.enumer.nalloc); if(NULL == (names = (char **)H5MM_realloc(dt->shared->u.enumer.name, n * sizeof(char *)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") @@ -211,7 +211,7 @@ H5T__enum_insert(const H5T_t *dt, const char *name, const void *value) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") dt->shared->u.enumer.value = values; dt->shared->u.enumer.nalloc = n; - } /* end for */ + } /* Insert new member at end of member arrays */ dt->shared->u.enumer.sorted = H5T_SORT_NONE; diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c index 9366332..fae2c69 100644 --- a/src/H5Tprecis.c +++ b/src/H5Tprecis.c @@ -97,7 +97,7 @@ H5T_get_precision(const H5T_t *dt) while(dt->shared->parent) dt = dt->shared->parent; if(!H5T_IS_ATOMIC(dt->shared)) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, 0, "operation not defined for specified datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, 0, "operation not defined for specified datatype") /* Precision */ ret_value = dt->shared->u.atomic.prec; @@ -208,8 +208,8 @@ H5T__set_precision(const H5T_t *dt, size_t prec) HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); if (dt->shared->parent) { - if (H5T__set_precision(dt->shared->parent, prec)<0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "unable to set precision for base type") + if (H5T__set_precision(dt->shared->parent, prec)<0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "unable to set precision for base type") /* Adjust size of datatype appropriately */ if(dt->shared->type==H5T_ARRAY) @@ -218,18 +218,18 @@ H5T__set_precision(const H5T_t *dt, size_t prec) dt->shared->size = dt->shared->parent->shared->size; } else { if (H5T_IS_ATOMIC(dt->shared)) { - /* Adjust the offset and size */ - offset = dt->shared->u.atomic.offset; - size = dt->shared->size; - if (prec > 8*size) + /* Adjust the offset and size */ + offset = dt->shared->u.atomic.offset; + size = dt->shared->size; + if (prec > 8*size) offset = 0; - else if (offset+prec > 8 * size) + else if (offset+prec > 8 * size) offset = 8 * size - prec; - if (prec > 8*size) + if (prec > 8*size) size = (prec+7) / 8; - /* Check that things are still kosher */ - switch (dt->shared->type) { + /* Check that things are still kosher */ + switch (dt->shared->type) { case H5T_INTEGER: case H5T_TIME: case H5T_BITFIELD: @@ -261,11 +261,11 @@ H5T__set_precision(const H5T_t *dt, size_t prec) HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "operation not defined for datatype class") } /* end switch */ - /* Commit */ - dt->shared->size = size; + /* Commit */ + dt->shared->size = size; dt->shared->u.atomic.offset = offset; dt->shared->u.atomic.prec = prec; - } /* end if */ + } /* end if */ else HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for specified datatype") } /* end else */ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index 490ffb5..0d6be6d 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -58,7 +58,7 @@ struct H5S_t; /* How to copy a datatype */ typedef enum H5T_copy_t { H5T_COPY_TRANSIENT, - H5T_COPY_ALL, + H5T_COPY_ALL } H5T_copy_t; /* Location of datatype information */ diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index f185c2f..f280069 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -1197,3 +1197,4 @@ H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt) done: FUNC_LEAVE_NOAPI(ret_value) } /* H5T_vlen_reclaim_elmt() */ + diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 6f53ae0..83e9c38 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -571,10 +571,10 @@ H5Z__xform_destroy_parse_tree(H5Z_node *tree) FUNC_ENTER_STATIC_NOERR if(tree) { - H5Z__xform_destroy_parse_tree(tree->lchild); - H5Z__xform_destroy_parse_tree(tree->rchild); - H5MM_xfree(tree); - tree = NULL; + H5Z__xform_destroy_parse_tree(tree->lchild); + H5Z__xform_destroy_parse_tree(tree->rchild); + H5MM_xfree(tree); + tree = NULL; } FUNC_LEAVE_NOAPI_VOID diff --git a/src/H5dbg.c b/src/H5dbg.c index c01ad88..819653d 100644 --- a/src/H5dbg.c +++ b/src/H5dbg.c @@ -13,11 +13,11 @@ /*------------------------------------------------------------------------- * - * Created: H5dbg.c - * Mar 4 2006 - * Quincey Koziol + * Created: H5dbg.c + * Mar 4 2006 + * Quincey Koziol * - * Purpose: Generic debugging routines + * Purpose: Generic debugging routines * *------------------------------------------------------------------------- */ @@ -29,7 +29,7 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ +#include "H5private.h" /* Generic Functions */ /****************/ /* Local Macros */ @@ -63,14 +63,14 @@ /*------------------------------------------------------------------------- - * Function: H5_buffer_dump + * Function: H5_buffer_dump * - * Purpose: Dumps a buffer of memory in an octal dump form + * Purpose: Dumps a buffer of memory in an octal dump form * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Mar 4 2006 + * Programmer: Quincey Koziol + * Mar 4 2006 * *------------------------------------------------------------------------- */ @@ -78,7 +78,7 @@ herr_t H5_buffer_dump(FILE *stream, int indent, const uint8_t *buf, const uint8_t *marker, size_t buf_offset, size_t buf_size) { - size_t u, v; /* Local index variable */ + size_t u, v; /* Local index variable */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -95,47 +95,50 @@ H5_buffer_dump(FILE *stream, int indent, const uint8_t *buf, * Print the buffer in a VMS-style octal dump. */ HDfprintf(stream, "%*sData follows (`__' indicates free region)...\n", - indent, ""); + indent, ""); for(u = 0; u < buf_size; u += 16) { - uint8_t c; + uint8_t c; - HDfprintf(stream, "%*s %8d: ", indent, "", u + buf_offset); + HDfprintf(stream, "%*s %8d: ", indent, "", u + buf_offset); /* Print the hex values */ - for(v = 0; v < 16; v++) { - if(u + v < buf_size) { - if(marker[u + v]) - HDfprintf(stream, "__ "); - else { - c = buf[buf_offset + u + v]; - HDfprintf(stream, "%02x ", c); - } /* end else */ - } /* end if */ + for(v = 0; v < 16; v++) { + if(u + v < buf_size) { + if(marker[u + v]) + HDfprintf(stream, "__ "); + else { + c = buf[buf_offset + u + v]; + HDfprintf(stream, "%02x ", c); + } /* end else */ + } /* end if */ else - HDfprintf(stream, " "); - if(7 == v) - HDfputc(' ', stream); - } /* end for */ + HDfprintf(stream, " "); + + if(7 == v) + HDfputc(' ', stream); + } /* end for */ HDfputc(' ', stream); /* Print the character values */ - for(v = 0; v < 16; v++) { - if(u + v < buf_size) { - if(marker[u + v]) - HDfputc(' ', stream); - else { - c = buf[buf_offset + u + v]; - if(HDisprint(c)) - HDfputc(c, stream); - else - HDfputc('.', stream); - } /* end else */ - } /* end if */ - if(7 == v) - HDfputc(' ', stream); - } /* end for */ - - HDfputc('\n', stream); + for(v = 0; v < 16; v++) { + if(u + v < buf_size) { + if(marker[u + v]) + HDfputc(' ', stream); + else { + c = buf[buf_offset + u + v]; + + if(HDisprint(c)) + HDfputc(c, stream); + else + HDfputc('.', stream); + } /* end else */ + } /* end if */ + + if(7 == v) + HDfputc(' ', stream); + } /* end for */ + + HDfputc('\n', stream); } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5detect.c b/src/H5detect.c index 138695b..ac416aa 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -43,6 +43,9 @@ static const char *FileHeader = "\n\ */ #undef NDEBUG #include "H5private.h" +/* Do NOT use HDfprintf in this file as it is not linked with the library, + * which contains the H5system.c file in which the function is defined. + */ #include "H5Tpublic.h" #include "H5Rpublic.h" diff --git a/test/fillval.c b/test/fillval.c index 72b8dcb..3fbbbbb 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, October 1, 1998 * * Purpose: Tests dataset fill values. diff --git a/test/page_buffer.c b/test/page_buffer.c index a508dc9..773b863 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -384,7 +384,6 @@ error: * *------------------------------------------------------------------------- */ - static unsigned test_args(hid_t orig_fapl, const char *env_h5_drvr) { diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 4a642e0..4221eec 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -941,7 +941,7 @@ static int readFloatData(FILE *strm, struct Input *in) * * Return: 0, ok, -1 no * - * Programmer: Pedro Vicente, pvn@hdfgroup.org + * Programmer: Pedro Vicente * * Date: July, 26, 2007 * diff --git a/tools/test/perform/chunk.c b/tools/test/perform/chunk.c index 3603c9b..bd16e1d 100644 --- a/tools/test/perform/chunk.c +++ b/tools/test/perform/chunk.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, May 14, 1998 * * Purpose: Checks the effect of various I/O request sizes and raw data -- cgit v0.12 From 32a1188bbd648e981615a388a8ca011df76fa1e0 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 17 Aug 2020 10:54:07 -0700 Subject: Adds fix for H5Fstart_swmr_write lock issue --- src/H5Fint.c | 19 +++++++++++++++---- src/H5Fpkg.h | 1 + 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/H5Fint.c b/src/H5Fint.c index 46508fe..a29d20b 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1872,6 +1872,9 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) set_flag = TRUE; } /* end else */ + /* Set the file locking flag */ + file->use_file_locking = use_file_locking; + /* Check to see if both SWMR and cache image are requested. Fail if so */ if(H5C_cache_image_status(file, &ci_load, &ci_write) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get MDC cache image status") @@ -3571,6 +3574,7 @@ H5F__start_swmr_write(H5F_t *f) size_t u; /* Local index variable */ hbool_t setup = FALSE; /* Boolean flag to indicate whether SWMR setting is enabled */ H5VL_t *vol_connector = NULL; /* VOL connector for the file */ + hbool_t use_file_locking = TRUE;/* Using file locks? */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -3695,6 +3699,12 @@ H5F__start_swmr_write(H5F_t *f) setup = TRUE; + /* Place an advisory lock on the file */ + if(f->use_file_locking) + if(H5FD_lock(f->shared->lf, TRUE) < 0) { + HGOTO_ERROR(H5E_FILE, H5E_CANTLOCKFILE, FAIL, "unable to lock the file") + } + /* Mark superblock as dirty */ if(H5F_super_dirty(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") @@ -3712,10 +3722,6 @@ H5F__start_swmr_write(H5F_t *f) if(H5O_refresh_metadata_reopen(obj_ids[u], &obj_glocs[u], vol_connector, TRUE) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CLOSEERROR, FAIL, "can't refresh-close object") - /* Unlock the file */ - if(H5FD_unlock(f->shared->lf) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to unlock the file") - done: if(ret_value < 0 && setup) { @@ -3744,6 +3750,11 @@ done: HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock") } /* end if */ + /* Unlock the file */ + if(f->use_file_locking) + if(H5FD_unlock(f->shared->lf) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock the file") + /* Free memory */ if(obj_ids) H5MM_xfree(obj_ids); diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index ff44536..294687c 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -382,6 +382,7 @@ struct H5F_t { hbool_t closing; /* File is in the process of being closed */ struct H5F_t *parent; /* Parent file that this file is mounted to */ unsigned nmounts; /* Number of children mounted to this file */ + hbool_t use_file_locking; /* Whether or not to use file locking */ }; -- cgit v0.12 From f02ced7e7443563581930a6c2d58d1628608bbdd Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 17 Aug 2020 14:25:04 -0700 Subject: Moves lock flag to H5F_shared_t and adds test. --- src/H5Fint.c | 17 +++++++---- src/H5Fpkg.h | 2 +- src/H5Fprivate.h | 3 ++ src/H5Fquery.c | 21 +++++++++++++ test/swmr.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 5 files changed, 118 insertions(+), 15 deletions(-) diff --git a/src/H5Fint.c b/src/H5Fint.c index a29d20b..7e3876f 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1872,9 +1872,6 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) set_flag = TRUE; } /* end else */ - /* Set the file locking flag */ - file->use_file_locking = use_file_locking; - /* Check to see if both SWMR and cache image are requested. Fail if so */ if(H5C_cache_image_status(file, &ci_load, &ci_write) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get MDC cache image status") @@ -1888,6 +1885,15 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) shared = file->shared; lf = shared->lf; + /* Set the file locking flag. If the file is already open, the file + * requested file locking flag must match that of the open file. + */ + if(shared->nrefs == 1) + file->shared->use_file_locking = use_file_locking; + else if(shared->nrefs > 1) + if(file->shared->use_file_locking != use_file_locking) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "file locking flag values don't match") + /* Check if page buffering is enabled */ if(H5P_get(a_plist, H5F_ACS_PAGE_BUFFER_SIZE_NAME, &page_buf_size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get page buffer size") @@ -3574,7 +3580,6 @@ H5F__start_swmr_write(H5F_t *f) size_t u; /* Local index variable */ hbool_t setup = FALSE; /* Boolean flag to indicate whether SWMR setting is enabled */ H5VL_t *vol_connector = NULL; /* VOL connector for the file */ - hbool_t use_file_locking = TRUE;/* Using file locks? */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -3700,7 +3705,7 @@ H5F__start_swmr_write(H5F_t *f) setup = TRUE; /* Place an advisory lock on the file */ - if(f->use_file_locking) + if(H5F_USE_FILE_LOCKING(f)) if(H5FD_lock(f->shared->lf, TRUE) < 0) { HGOTO_ERROR(H5E_FILE, H5E_CANTLOCKFILE, FAIL, "unable to lock the file") } @@ -3751,7 +3756,7 @@ done: } /* end if */ /* Unlock the file */ - if(f->use_file_locking) + if(H5F_USE_FILE_LOCKING(f)) if(H5FD_unlock(f->shared->lf) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock the file") diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 294687c..30306d8 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -306,6 +306,7 @@ struct H5F_shared_t { struct H5G_t *root_grp; /* Open root group */ H5FO_t *open_objs; /* Open objects in file */ H5UC_t *grp_btree_shared; /* Ref-counted group B-tree node info */ + hbool_t use_file_locking; /* Whether or not to use file locking */ hbool_t closing; /* File is in the process of being closed */ /* Cached VOL connector ID & info */ @@ -382,7 +383,6 @@ struct H5F_t { hbool_t closing; /* File is in the process of being closed */ struct H5F_t *parent; /* Parent file that this file is mounted to */ unsigned nmounts; /* Number of children mounted to this file */ - hbool_t use_file_locking; /* Whether or not to use file locking */ }; diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 384a781..552855b 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -338,6 +338,7 @@ typedef struct H5F_t H5F_t; #define H5F_SET_MIN_DSET_OHDR(F, V) ((F)->shared->crt_dset_min_ohdr_flag = (V)) #define H5F_VOL_CLS(F) ((F)->shared->vol_cls) #define H5F_VOL_OBJ(F) ((F)->vol_obj) +#define H5F_USE_FILE_LOCKING(F) ((F)->shared->use_file_locking) #else /* H5F_MODULE */ #define H5F_LOW_BOUND(F) (H5F_get_low_bound(F)) #define H5F_HIGH_BOUND(F) (H5F_get_high_bound(F)) @@ -400,6 +401,7 @@ typedef struct H5F_t H5F_t; #define H5F_SET_MIN_DSET_OHDR(F, V) (H5F_set_min_dset_ohdr((F), (V))) #define H5F_VOL_CLS(F) (H5F_get_vol_cls(F)) #define H5F_VOL_OBJ(F) (H5F_get_vol_obj(F)) +#define H5F_USE_FILE_LOCKING(F) (H5F_get_use_file_locking(F)) #endif /* H5F_MODULE */ @@ -765,6 +767,7 @@ H5_DLL hbool_t H5F_get_min_dset_ohdr(const H5F_t *f); H5_DLL herr_t H5F_set_min_dset_ohdr(H5F_t *f, hbool_t minimize); H5_DLL const H5VL_class_t *H5F_get_vol_cls(const H5F_t *f); H5_DLL H5VL_object_t *H5F_get_vol_obj(const H5F_t *f); +H5_DLL hbool_t H5F_get_file_locking(const H5F_t *f); /* Functions than retrieve values set/cached from the superblock/FCPL */ H5_DLL haddr_t H5F_get_base_addr(const H5F_t *f); diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 565f492..51f2194 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -1363,3 +1363,24 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_cont_info */ + +/*------------------------------------------------------------------------- + * Function: H5F_get_file_locking + * + * Purpose: Get the file locking flag for the file + * + * Return: TRUE/FALSE + * + *------------------------------------------------------------------------- + */ +hbool_t +H5F_get_file_locking(const H5F_t *f) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f); + HDassert(f->shared); + + FUNC_LEAVE_NOAPI(f->shared->use_file_locking) +} /* end H5F_get_file_locking */ + diff --git a/test/swmr.c b/test/swmr.c index a839a74..67fb41b 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -6057,16 +6057,13 @@ error: } /* end test_file_lock_swmr_concur() */ - - #endif /* !(defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID)) */ /**************************************************************** ** -** test_file_lock_swmr_concur(): low-level file test routine. -** With the implementation of file locking, this test checks file -** open with different combinations of flags + SWMR flags. -** This is for concurrent access. +** test_file_locking(): +** Tests various combinations of file locking flags and +** and environment variables. ** *****************************************************************/ static int @@ -6244,6 +6241,79 @@ error: } /* end test_file_locking() */ +/**************************************************************** +** +** test_different_lock_flags(): +** Tests opening a file multiple times with different lock +** flags. +** +*****************************************************************/ +static int +test_different_lock_flags(hid_t in_fapl) +{ + hid_t fid1 = H5I_INVALID_HID; /* File ID */ + hid_t fid2 = H5I_INVALID_HID; /* File ID */ + hid_t fid3 = H5I_INVALID_HID; /* File ID */ + hid_t fapl_id = H5I_INVALID_HID; /* File access property list */ + char filename[NAME_BUF_SIZE]; /* File name */ + + TESTING("Using different lock flags") + + /* Copy the incoming fapl */ + if((fapl_id = H5Pcopy(in_fapl)) < 0) + TEST_ERROR + + /* Set locking in the fapl */ + if(H5Pset_file_locking(fapl_id, TRUE, TRUE) < 0) + TEST_ERROR + + /* Set the filename to use for this test (dependent on fapl) */ + h5_fixname(FILENAME[1], fapl_id, filename, sizeof(filename)); + + /* Create the test file */ + if((fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) + TEST_ERROR + + /* Open the test file with the same flags (should pass) */ + if((fid2 = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0) + TEST_ERROR + + /* Unset locking in the fapl */ + if(H5Pset_file_locking(fapl_id, FALSE, FALSE) < 0) + TEST_ERROR + + /* Open the test file with different flags (should FAIL) */ + H5E_BEGIN_TRY { + fid3 = H5Fopen(filename, H5F_ACC_RDWR, fapl_id); + } H5E_END_TRY; + if(H5I_INVALID_HID != fid3) + FAIL_PUTS_ERROR("Should not have been able to open a file with different locking flags") + + /* Close the files */ + if(H5Fclose(fid1) < 0) + TEST_ERROR + if(H5Fclose(fid2) < 0) + TEST_ERROR + + /* Close the copied property list */ + if(H5Pclose(fapl_id) < 0) + TEST_ERROR + + PASSED(); + + return 0; + +error: + H5E_BEGIN_TRY { + H5Pclose(fapl_id); + H5Fclose(fid1); + H5Fclose(fid2); + H5Fclose(fid3); + } H5E_END_TRY; + + return -1; +} /* end test_different_lock_flags() */ + static int test_swmr_vfd_flag(void) { @@ -7181,8 +7251,12 @@ main(void) if(NULL == driver || !HDstrcmp(driver, "") || !HDstrcmp(driver, "sec2")) nerrors += test_swmr_vfd_flag(); - /* This test changes the HDF5_USE_FILE_LOCKING environment variable - * so it should be run last. + /* Test multiple opens via different locking flags */ + if (use_file_locking && file_locking_enabled) + nerrors += test_different_lock_flags(fapl); + + /* These tests change the HDF5_USE_FILE_LOCKING environment variable + * so they should be run last. */ if (use_file_locking && file_locking_enabled) { nerrors += test_file_locking(fapl, TRUE, TRUE); -- cgit v0.12 From 5bb893a2c2bcba6e8bebc99ee1a506599111b716 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 17 Aug 2020 17:51:15 -0500 Subject: Fix HDFFV-11101 Description Added initialization to local structs in the src function H5MF_settle_raw_data_fsm() and the test function test_bt2_hdr_fd() to prevent the following error in two different occurrences: MemorySanitizer: use-of-uninitialized-value Platforms tested: Linux/64 (jelly) Linux/64 (platypus) --- src/H5MF.c | 4 ++++ test/dsets.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/H5MF.c b/src/H5MF.c index aa65db2..5e61751 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -2645,6 +2645,10 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) HDassert(f->shared); HDassert(fsm_settled); + /* Initialize structs */ + HDmemset(&fsinfo, 0, sizeof(fsinfo)); + HDmemset(&fs_stat, 0, sizeof(fs_stat)); + /* * Only need to settle things if we are persisting free space and * the private property in f->shared->null_fsm_addr is not enabled. diff --git a/test/dsets.c b/test/dsets.c index d5c11be..ae917cc 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -11334,6 +11334,9 @@ test_bt2_hdr_fd(const char *env_h5_driver, hid_t fapl) TESTING("Version 2 B-tree chunk index header flush dependencies handled correctly"); + /* Initialize struct */ + HDmemset(&info, 0, sizeof(info)); + /* Skip this test if SWMR I/O is not supported for the VFD specified * by the environment variable. */ -- cgit v0.12 From ad9a2ceabe2dd9045111f8b57774948a124607b9 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 17 Aug 2020 18:29:55 -0500 Subject: Only initialize the contiguous or compact I/O info struct when needed. --- src/H5Dchunk.c | 54 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 8962348..bdfa3f3 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -2651,6 +2651,8 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ H5D_io_info_t cpt_io_info; /* Compact I/O info object */ H5D_storage_t cpt_store; /* Chunk storage information as compact dataset */ + hbool_t ctg_init = FALSE; /* Whether the contiguous I/O info is initialized */ + hbool_t cpt_init = FALSE; /* Whether the compact I/O info is initialized */ hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ uint32_t dst_accessed_bytes = 0; /* Total accessed size in a chunk */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2663,27 +2665,11 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HDassert(type_info); HDassert(fm); - /* Set up contiguous I/O info object */ - H5MM_memcpy(&ctg_io_info, io_info, sizeof(ctg_io_info)); - ctg_io_info.store = &ctg_store; - ctg_io_info.layout_ops = *H5D_LOPS_CONTIG; - - /* Initialize temporary contiguous storage info */ - H5_CHECKED_ASSIGN(ctg_store.contig.dset_size, hsize_t, io_info->dset->shared->layout.u.chunk.size, uint32_t); - - /* Set up compact I/O info object */ - H5MM_memcpy(&cpt_io_info, io_info, sizeof(cpt_io_info)); - cpt_io_info.store = &cpt_store; - cpt_io_info.layout_ops = *H5D_LOPS_COMPACT; - - /* Initialize temporary compact storage info */ - cpt_store.compact.dirty = &cpt_dirty; - /* Iterate through nodes in chunk skip list */ chunk_node = H5D_CHUNK_GET_FIRST_NODE(fm); while(chunk_node) { H5D_chunk_info_t *chunk_info; /* Chunk information */ - H5D_chk_idx_info_t idx_info; /* Chunked index info */ + H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */ void *chunk; /* Pointer to locked chunk buffer */ H5D_chunk_ud_t udata; /* Index pass-through */ @@ -2701,8 +2687,8 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || (!H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); - /* Set chunk's [scaled] coordinates */ - io_info->store->chunk.scaled = chunk_info->scaled; + /* Set chunk's [scaled] coordinates */ + io_info->store->chunk.scaled = chunk_info->scaled; /* Determine if we should use the chunk cache */ if((cacheable = H5D__chunk_cacheable(io_info, udata.chunk_block.offset, TRUE)) < 0) @@ -2719,7 +2705,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* Determine if we will access all the data in the chunk */ if(dst_accessed_bytes != ctg_store.contig.dset_size || (chunk_info->chunk_points * type_info->src_type_size) != ctg_store.contig.dset_size || - fm->fsel_type == H5S_SEL_POINTS) + fm->fsel_type == H5S_SEL_POINTS) entire_chunk = FALSE; /* Lock the chunk into the cache */ @@ -2729,6 +2715,20 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* Set up the storage buffer information for this chunk */ cpt_store.compact.buf = chunk; + /* Initialize the compact I/O info, if it isn't already */ + if(!cpt_init) { + /* Set up compact I/O info object */ + H5MM_memcpy(&cpt_io_info, io_info, sizeof(cpt_io_info)); + cpt_io_info.store = &cpt_store; + cpt_io_info.layout_ops = *H5D_LOPS_COMPACT; + + /* Initialize temporary compact storage info */ + cpt_store.compact.dirty = &cpt_dirty; + + /* Indicate compact I/O info ready */ + cpt_init = TRUE; + } /* end if */ + /* Point I/O info at main I/O info for this chunk */ chk_io_info = &cpt_io_info; } /* end if */ @@ -2762,6 +2762,20 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* No chunk cached */ chunk = NULL; + /* Initialize the contigous I/O info, if it isn't already */ + if(!ctg_init) { + /* Set up contiguous I/O info object */ + H5MM_memcpy(&ctg_io_info, io_info, sizeof(ctg_io_info)); + ctg_io_info.store = &ctg_store; + ctg_io_info.layout_ops = *H5D_LOPS_CONTIG; + + /* Initialize temporary contiguous storage info */ + H5_CHECKED_ASSIGN(ctg_store.contig.dset_size, hsize_t, io_info->dset->shared->layout.u.chunk.size, uint32_t); + + /* Indicate contigous I/O info ready */ + ctg_init = TRUE; + } /* end if */ + /* Point I/O info at temporary I/O info for this chunk */ chk_io_info = &ctg_io_info; } /* end else */ -- cgit v0.12 From e9ee2d99062978faa63c1125b156ce20bd986f8f Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 17 Aug 2020 16:37:53 -0700 Subject: Trivial whitespace change to H5Pencdec.c --- src/H5Pencdec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index 8b10971..5f35a7e 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -49,9 +49,9 @@ /* Typedef for iterator when encoding a property list */ typedef struct { - hbool_t encode; /* Whether the property list should be encoded */ - size_t *enc_size_ptr; /* Pointer to size of encoded buffer */ - void **pp; /* Pointer to encoding buffer pointer */ + hbool_t encode; /* Whether the property list should be encoded */ + size_t *enc_size_ptr; /* Pointer to size of encoded buffer */ + void **pp; /* Pointer to encoding buffer pointer */ } H5P_enc_iter_ud_t; @@ -332,7 +332,7 @@ static int H5P__encode_cb(H5P_genprop_t *prop, void *_udata) { H5P_enc_iter_ud_t *udata = (H5P_enc_iter_ud_t *)_udata; /* Pointer to user data */ - int ret_value = H5_ITER_CONT; /* Return value */ + int ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_STATIC -- cgit v0.12 From 5352b1dbc92313d91d3502dd8352352abe8749a7 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 17 Aug 2020 22:37:26 -0500 Subject: Fixed typo --- examples/h5_cmprss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/h5_cmprss.c b/examples/h5_cmprss.c index 5feadd3..97f6567 100644 --- a/examples/h5_cmprss.c +++ b/examples/h5_cmprss.c @@ -98,7 +98,7 @@ int main () { for (i=0; i Date: Tue, 18 Aug 2020 05:53:33 -0700 Subject: Removes inappropriate file locking call --- test/swmr.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/swmr.c b/test/swmr.c index a839a74..09ea66e 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -4422,8 +4422,6 @@ test_file_lock_swmr_same(hid_t in_fapl) /* Set locking in the fapl */ if((fapl = H5Pcopy(in_fapl)) < 0) FAIL_STACK_ERROR - if(H5Pset_file_locking(fapl, TRUE, TRUE) < 0) - FAIL_STACK_ERROR /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[1], fapl, filename, sizeof(filename)); -- cgit v0.12 From 857e0f4404cb5a754d799110b89f0f16b503b4ce Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 18 Aug 2020 06:18:23 -0700 Subject: Fixes CMake issue with file locking variable --- config/cmake/H5pubconf.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index fdf4c7d..600b046 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -733,7 +733,7 @@ #cmakedefine H5_USE_114_API_DEFAULT @H5_USE_114_API_DEFAULT@ /* Define if the library will use file locking */ -#cmakedefine H5_FILE_LOCKING @H5_USE_FILE_LOCKING@ +#cmakedefine H5_USE_FILE_LOCKING @H5_USE_FILE_LOCKING@ /* Define if a memory checking tool will be used on the library, to cause library to be very picky about memory operations and also disable the -- cgit v0.12 From 98754591b8dcf2be70957d67ec7172c53cbaa827 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Tue, 18 Aug 2020 12:51:13 -0500 Subject: Revert "Merge pull request #2477 in HDFFV/hdf5 from pio_update to develop" This reverts commit ba80bcaff24113f438da0f40cb5b5479d4a21cc6, reversing changes made to 522ef0dd5ca1daa2b26c3fe4459ddbb1eaf6ec20. --- src/H5FDcore.c | 4 ---- src/H5FDlog.c | 21 --------------------- src/H5FDprivate.h | 2 -- src/H5FDsec2.c | 21 --------------------- 4 files changed, 48 deletions(-) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 66c08ad..97437de 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -386,9 +386,7 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) int myerrno = errno; time_t mytime = HDtime(NULL); -#ifndef H5_HAVE_PREADWRITE offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); -#endif /* H5_HAVE_PREADWRITE */ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write to backing store failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', ptr = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), ptr, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ @@ -912,9 +910,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr int myerrno = errno; time_t mytime = HDtime(NULL); -#ifndef H5_HAVE_PREADWRITE offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); -#endif /* H5_HAVE_PREADWRITE */ HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', file->mem = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), file->mem, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset); } /* end if */ diff --git a/src/H5FDlog.c b/src/H5FDlog.c index cbd475f..5d1b536 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -81,10 +81,8 @@ typedef struct H5FD_log_t { int fd; /* the unix file */ haddr_t eoa; /* end of allocated region */ haddr_t eof; /* end of file; current file size */ -#ifndef H5_HAVE_PREADWRITE haddr_t pos; /* current file I/O position */ H5FD_file_op_t op; /* last operation */ -#endif /* H5_HAVE_PREADWRITE */ hbool_t ignore_disabled_file_locks; char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */ #ifndef H5_HAVE_WIN32_API @@ -573,10 +571,8 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) file->fd = fd; H5_CHECKED_ASSIGN(file->eof, haddr_t, sb.st_size, h5_stat_size_t); -#ifndef H5_HAVE_PREADWRITE file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; -#endif /* H5_HAVE_PREADWRITE */ #ifdef H5_HAVE_WIN32_API file->hFile = (HANDLE)_get_osfhandle(fd); if(INVALID_HANDLE_VALUE == file->hFile) @@ -1284,9 +1280,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had int myerrno = errno; time_t mytime = HDtime(NULL); -#ifndef H5_HAVE_PREADWRITE offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); -#endif /* H5_HAVE_PREADWRITE */ if(file->fa.flags & H5FD_LOG_LOC_READ) HDfprintf(file->logfp, "Error! Reading: %10a-%10a (%10Zu bytes)\n", orig_addr, (orig_addr + orig_size) - 1, orig_size); @@ -1343,19 +1337,15 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had HDfprintf(file->logfp, "\n"); } /* end if */ -#ifndef H5_HAVE_PREADWRITE /* Update current position */ file->pos = addr; file->op = OP_READ; -#endif /* H5_HAVE_PREADWRITE */ done: if(ret_value < 0) { -#ifndef H5_HAVE_PREADWRITE /* Reset last file I/O information */ file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; -#endif /* H5_HAVE_PREADWRITE */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -1499,9 +1489,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha int myerrno = errno; time_t mytime = HDtime(NULL); -#ifndef H5_HAVE_PREADWRITE offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); -#endif /* H5_HAVE_PREADWRITE */ if(file->fa.flags & H5FD_LOG_LOC_WRITE) HDfprintf(file->logfp, "Error! Writing: %10a-%10a (%10Zu bytes)\n", orig_addr, (orig_addr + orig_size) - 1, orig_size); @@ -1553,24 +1541,17 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha HDfprintf(file->logfp, "\n"); } /* end if */ -#ifndef H5_HAVE_PREADWRITE /* Update current position and eof */ file->pos = addr; file->op = OP_WRITE; if(file->pos > file->eof) file->eof = file->pos; -#else /* H5_HAVE_PREADWRITE */ - if(addr > file->eof) - file->eof = addr; -#endif /* H5_HAVE_PREADWRITE */ done: if(ret_value < 0) { -#ifndef H5_HAVE_PREADWRITE /* Reset last file I/O information */ file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; -#endif /* H5_HAVE_PREADWRITE */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -1675,11 +1656,9 @@ H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_ /* Update the eof value */ file->eof = file->eoa; -#ifndef H5_HAVE_PREADWRITE /* Reset last file I/O information */ file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; -#endif /* H5_HAVE_PREADWRITE */ } /* end if */ done: diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 7ac63b7..7d5b66d 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -59,14 +59,12 @@ typedef struct H5FD_class_mpi_t { /* Library Private Typedefs */ /****************************/ -#ifndef H5_HAVE_PREADWRITE /* File operations */ typedef enum { OP_UNKNOWN = 0, /* Unknown last file operation */ OP_READ = 1, /* Last file I/O operation was a read */ OP_WRITE = 2 /* Last file I/O operation was a write */ } H5FD_file_op_t; -#endif /* H5_HAVE_PREADWRITE */ /* Define structure to hold initial file image and other relevant information */ diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 6a16838..147d08f 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -58,10 +58,8 @@ typedef struct H5FD_sec2_t { int fd; /* the filesystem file descriptor */ haddr_t eoa; /* end of allocated region */ haddr_t eof; /* end of file; current file size */ -#ifndef H5_HAVE_PREADWRITE haddr_t pos; /* current file I/O position */ H5FD_file_op_t op; /* last operation */ -#endif /* H5_HAVE_PREADWRITE */ hbool_t ignore_disabled_file_locks; char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */ #ifndef H5_HAVE_WIN32_API @@ -371,10 +369,8 @@ H5FD__sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr file->fd = fd; H5_CHECKED_ASSIGN(file->eof, haddr_t, sb.st_size, h5_stat_size_t); -#ifndef H5_HAVE_PREADWRITE file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; -#endif /* H5_HAVE_PREADWRITE */ #ifdef H5_HAVE_WIN32_API file->hFile = (HANDLE)_get_osfhandle(fd); if(INVALID_HANDLE_VALUE == file->hFile) @@ -752,9 +748,7 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU int myerrno = errno; time_t mytime = HDtime(NULL); -#ifndef H5_HAVE_PREADWRITE offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); -#endif /* H5_HAVE_PREADWRITE */ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset); } /* end if */ @@ -773,19 +767,15 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU buf = (char *)buf + bytes_read; } /* end while */ -#ifndef H5_HAVE_PREADWRITE /* Update current position */ file->pos = addr; file->op = OP_READ; -#endif /* H5_HAVE_PREADWRITE */ done: if(ret_value < 0) { -#ifndef H5_HAVE_PREADWRITE /* Reset last file I/O information */ file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; -#endif /* H5_HAVE_PREADWRITE */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -861,9 +851,7 @@ H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN int myerrno = errno; time_t mytime = HDtime(NULL); -#ifndef H5_HAVE_PREADWRITE offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); -#endif /* H5_HAVE_PREADWRITE */ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ @@ -876,24 +864,17 @@ H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN buf = (const char *)buf + bytes_wrote; } /* end while */ -#ifndef H5_HAVE_PREADWRITE /* Update current position and eof */ file->pos = addr; file->op = OP_WRITE; if(file->pos > file->eof) file->eof = file->pos; -#else /* H5_HAVE_PREADWRITE */ - if(addr > file->eof) - file->eof = addr; -#endif /* H5_HAVE_PREADWRITE */ done: if(ret_value < 0) { -#ifndef H5_HAVE_PREADWRITE /* Reset last file I/O information */ file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; -#endif /* H5_HAVE_PREADWRITE */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -959,11 +940,9 @@ H5FD__sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR /* Update the eof value */ file->eof = file->eoa; -#ifndef H5_HAVE_PREADWRITE /* Reset last file I/O information */ file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; -#endif /* H5_HAVE_PREADWRITE */ } /* end if */ done: -- cgit v0.12 From 76d93a78fe583b99efa295cd44359092310172a3 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Thu, 20 Aug 2020 10:57:29 -0500 Subject: Revert "Merge pull request #2796 in HDFFV/hdf5 from small_chunk_io_opt to develop" This reverts commit a7a8e6451a37d1bd072c7281b432f1436795daef, reversing changes made to 30422a6b55a135ec406d484a6c66f995057e0a50. --- src/H5Dchunk.c | 54 ++++++++++++++++++++---------------------------------- 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index bdfa3f3..8962348 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -2651,8 +2651,6 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ H5D_io_info_t cpt_io_info; /* Compact I/O info object */ H5D_storage_t cpt_store; /* Chunk storage information as compact dataset */ - hbool_t ctg_init = FALSE; /* Whether the contiguous I/O info is initialized */ - hbool_t cpt_init = FALSE; /* Whether the compact I/O info is initialized */ hbool_t cpt_dirty; /* Temporary placeholder for compact storage "dirty" flag */ uint32_t dst_accessed_bytes = 0; /* Total accessed size in a chunk */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2665,11 +2663,27 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HDassert(type_info); HDassert(fm); + /* Set up contiguous I/O info object */ + H5MM_memcpy(&ctg_io_info, io_info, sizeof(ctg_io_info)); + ctg_io_info.store = &ctg_store; + ctg_io_info.layout_ops = *H5D_LOPS_CONTIG; + + /* Initialize temporary contiguous storage info */ + H5_CHECKED_ASSIGN(ctg_store.contig.dset_size, hsize_t, io_info->dset->shared->layout.u.chunk.size, uint32_t); + + /* Set up compact I/O info object */ + H5MM_memcpy(&cpt_io_info, io_info, sizeof(cpt_io_info)); + cpt_io_info.store = &cpt_store; + cpt_io_info.layout_ops = *H5D_LOPS_COMPACT; + + /* Initialize temporary compact storage info */ + cpt_store.compact.dirty = &cpt_dirty; + /* Iterate through nodes in chunk skip list */ chunk_node = H5D_CHUNK_GET_FIRST_NODE(fm); while(chunk_node) { H5D_chunk_info_t *chunk_info; /* Chunk information */ - H5D_chk_idx_info_t idx_info; /* Chunked index info */ + H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */ void *chunk; /* Pointer to locked chunk buffer */ H5D_chunk_ud_t udata; /* Index pass-through */ @@ -2687,8 +2701,8 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HDassert((H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || (!H5F_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); - /* Set chunk's [scaled] coordinates */ - io_info->store->chunk.scaled = chunk_info->scaled; + /* Set chunk's [scaled] coordinates */ + io_info->store->chunk.scaled = chunk_info->scaled; /* Determine if we should use the chunk cache */ if((cacheable = H5D__chunk_cacheable(io_info, udata.chunk_block.offset, TRUE)) < 0) @@ -2705,7 +2719,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* Determine if we will access all the data in the chunk */ if(dst_accessed_bytes != ctg_store.contig.dset_size || (chunk_info->chunk_points * type_info->src_type_size) != ctg_store.contig.dset_size || - fm->fsel_type == H5S_SEL_POINTS) + fm->fsel_type == H5S_SEL_POINTS) entire_chunk = FALSE; /* Lock the chunk into the cache */ @@ -2715,20 +2729,6 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* Set up the storage buffer information for this chunk */ cpt_store.compact.buf = chunk; - /* Initialize the compact I/O info, if it isn't already */ - if(!cpt_init) { - /* Set up compact I/O info object */ - H5MM_memcpy(&cpt_io_info, io_info, sizeof(cpt_io_info)); - cpt_io_info.store = &cpt_store; - cpt_io_info.layout_ops = *H5D_LOPS_COMPACT; - - /* Initialize temporary compact storage info */ - cpt_store.compact.dirty = &cpt_dirty; - - /* Indicate compact I/O info ready */ - cpt_init = TRUE; - } /* end if */ - /* Point I/O info at main I/O info for this chunk */ chk_io_info = &cpt_io_info; } /* end if */ @@ -2762,20 +2762,6 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* No chunk cached */ chunk = NULL; - /* Initialize the contigous I/O info, if it isn't already */ - if(!ctg_init) { - /* Set up contiguous I/O info object */ - H5MM_memcpy(&ctg_io_info, io_info, sizeof(ctg_io_info)); - ctg_io_info.store = &ctg_store; - ctg_io_info.layout_ops = *H5D_LOPS_CONTIG; - - /* Initialize temporary contiguous storage info */ - H5_CHECKED_ASSIGN(ctg_store.contig.dset_size, hsize_t, io_info->dset->shared->layout.u.chunk.size, uint32_t); - - /* Indicate contigous I/O info ready */ - ctg_init = TRUE; - } /* end if */ - /* Point I/O info at temporary I/O info for this chunk */ chk_io_info = &ctg_io_info; } /* end else */ -- cgit v0.12 From 91bd6f9a63352a700075aea1ed80b72aeaa91d09 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 20 Aug 2020 14:31:35 -0500 Subject: Avoid creating MPI datatypes on ranks with 0 chunks to write' --- src/H5Dchunk.c | 121 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 68 insertions(+), 53 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 8962348..92cdfda 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -4958,6 +4958,7 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info, H5FD_mpio_xfer_t prev_xfer_mode; /* Previous data xfer mode */ hbool_t have_xfer_mode = FALSE; /* Whether the previous xffer mode has been retrieved */ hbool_t need_addr_sort = FALSE; + hbool_t created_mpi_datatypes = FALSE; /* Whether MPI datatypes were created */ int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -4980,9 +4981,9 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info, HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "Resulted in division by zero") num_blocks = (size_t)(chunk_info->num_io / (size_t)mpi_size); /* value should be the same on all procs */ - /* after evenly distributing the blocks between processes, are - there any leftover blocks for each individual process - (round-robin) */ + /* After evenly distributing the blocks between processes, are there any + * leftover blocks for each individual process (round-robin)? + */ leftover_blocks = (size_t)(chunk_info->num_io % (size_t)mpi_size); /* Cast values to types needed by MPI */ @@ -4990,58 +4991,70 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info, H5_CHECKED_ASSIGN(leftover, int, leftover_blocks, size_t); H5_CHECKED_ASSIGN(block_len, int, chunk_size, size_t); - /* Allocate buffers */ - /* (MSC - should not need block_lens if MPI_type_create_hindexed_block is working) */ - if(NULL == (block_lens = (int *)H5MM_malloc((size_t)(blocks + 1) * sizeof(int)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk lengths buffer") - if(NULL == (chunk_disp_array = (MPI_Aint *)H5MM_malloc((size_t)(blocks + 1) * sizeof(MPI_Aint)))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk file displacement buffer") + /* Check if we have any chunks to write on this rank */ + if(num_blocks > 0 || (leftover && leftover > mpi_rank)) { + /* Allocate buffers */ + /* (MSC - should not need block_lens if MPI_type_create_hindexed_block is working) */ + if(NULL == (block_lens = (int *)H5MM_malloc((size_t)(blocks + 1) * sizeof(int)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk lengths buffer") + if(NULL == (chunk_disp_array = (MPI_Aint *)H5MM_malloc((size_t)(blocks + 1) * sizeof(MPI_Aint)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk file displacement buffer") - for(i = 0 ; i < blocks ; i++) { - /* store the chunk address as an MPI_Aint */ - chunk_disp_array[i] = (MPI_Aint)(chunk_info->addr[i + mpi_rank*blocks]); + for(i = 0 ; i < blocks ; i++) { + /* store the chunk address as an MPI_Aint */ + chunk_disp_array[i] = (MPI_Aint)(chunk_info->addr[i + (mpi_rank * blocks)]); - /* MSC - should not need this if MPI_type_create_hindexed_block is working */ - block_lens[i] = block_len; + /* MSC - should not need this if MPI_type_create_hindexed_block is working */ + block_lens[i] = block_len; - /* make sure that the addresses in the datatype are - monotonically non decreasing */ - if(i && (chunk_disp_array[i] < chunk_disp_array[i - 1])) - need_addr_sort = TRUE; - } /* end for */ + /* Make sure that the addresses in the datatype are + * monotonically non-decreasing + */ + if(i && (chunk_disp_array[i] < chunk_disp_array[i - 1])) + need_addr_sort = TRUE; + } /* end for */ - /* calculate if there are any leftover blocks after evenly - distributing. If there are, then round robin the distribution - to processes 0 -> leftover. */ - if(leftover && leftover > mpi_rank) { - chunk_disp_array[blocks] = (MPI_Aint)chunk_info->addr[blocks*mpi_size + mpi_rank]; - if(blocks && (chunk_disp_array[blocks] < chunk_disp_array[blocks - 1])) - need_addr_sort = TRUE; - block_lens[blocks] = block_len; - blocks++; - } + /* Calculate if there are any leftover blocks after evenly + * distributing. If there are, then round-robin the distribution + * to processes 0 -> leftover. + */ + if(leftover && leftover > mpi_rank) { + chunk_disp_array[blocks] = (MPI_Aint)chunk_info->addr[(blocks * mpi_size) + mpi_rank]; + if(blocks && (chunk_disp_array[blocks] < chunk_disp_array[blocks - 1])) + need_addr_sort = TRUE; + block_lens[blocks] = block_len; + blocks++; + } - /* - * Ensure that the blocks are sorted in monotonically non-decreasing - * order of offset in the file. - */ - if(need_addr_sort) - HDqsort(chunk_disp_array, blocks, sizeof(MPI_Aint), H5D__chunk_cmp_addr); + /* Ensure that the blocks are sorted in monotonically non-decreasing + * order of offset in the file. + */ + if(need_addr_sort) + HDqsort(chunk_disp_array, blocks, sizeof(MPI_Aint), H5D__chunk_cmp_addr); - /* MSC - should use this if MPI_type_create_hindexed block is working: - * mpi_code = MPI_Type_create_hindexed_block(blocks, block_len, chunk_disp_array, MPI_BYTE, &file_type); - */ - mpi_code = MPI_Type_create_hindexed(blocks, block_lens, chunk_disp_array, MPI_BYTE, &file_type); - if(mpi_code != MPI_SUCCESS) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) - if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&file_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) - - mpi_code = MPI_Type_create_hvector(blocks, block_len, 0, MPI_BYTE, &mem_type); - if(mpi_code != MPI_SUCCESS) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code) - if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&mem_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) + /* MSC - should use this if MPI_type_create_hindexed block is working: + * mpi_code = MPI_Type_create_hindexed_block(blocks, block_len, chunk_disp_array, MPI_BYTE, &file_type); + */ + mpi_code = MPI_Type_create_hindexed(blocks, block_lens, chunk_disp_array, MPI_BYTE, &file_type); + if(mpi_code != MPI_SUCCESS) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&file_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) + + mpi_code = MPI_Type_create_hvector(blocks, block_len, 0, MPI_BYTE, &mem_type); + if(mpi_code != MPI_SUCCESS) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code) + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&mem_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) + + /* Indicate that the MPI types were created */ + created_mpi_datatypes = TRUE; + } /* end if */ + else { + /* Set up file & memory MPI types, to participate in collective write */ + file_type = MPI_BYTE; + mem_type = MPI_BYTE; + } /* end else */ /* Set MPI-IO VFD properties */ @@ -5073,10 +5086,12 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set transfer mode") /* free things */ - if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) - HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) - HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + if(created_mpi_datatypes) { + if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) + HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + } /* end if */ H5MM_xfree(chunk_disp_array); H5MM_xfree(block_lens); -- cgit v0.12 From d67de87ecd15b531718b4e5642b264a5f9b6bbc4 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 20 Aug 2020 17:08:24 -0500 Subject: Simplify code to avoid using a boolean to free MPI types --- src/H5Dchunk.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 92cdfda..52a921f 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -4954,11 +4954,10 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info, int blocks, leftover, block_len; /* converted to int for MPI */ MPI_Aint *chunk_disp_array = NULL; int *block_lens = NULL; - MPI_Datatype mem_type, file_type; + MPI_Datatype mem_type = MPI_DATATYPE_NULL, file_type = MPI_DATATYPE_NULL; H5FD_mpio_xfer_t prev_xfer_mode; /* Previous data xfer mode */ hbool_t have_xfer_mode = FALSE; /* Whether the previous xffer mode has been retrieved */ hbool_t need_addr_sort = FALSE; - hbool_t created_mpi_datatypes = FALSE; /* Whether MPI datatypes were created */ int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -5046,9 +5045,6 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info, HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code) if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&mem_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) - - /* Indicate that the MPI types were created */ - created_mpi_datatypes = TRUE; } /* end if */ else { /* Set up file & memory MPI types, to participate in collective write */ @@ -5086,12 +5082,12 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set transfer mode") /* free things */ - if(created_mpi_datatypes) { + if(MPI_DATATYPE_NULL != file_type) if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) + if(MPI_DATATYPE_NULL != mem_type) if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - } /* end if */ H5MM_xfree(chunk_disp_array); H5MM_xfree(block_lens); -- cgit v0.12 From fa0d395370daa7337ed2676d30198937145ad6e9 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 20 Aug 2020 18:22:39 -0500 Subject: Don't free builtin MPI_BYTE MPI type --- src/H5Dchunk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 52a921f..b57a608 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -5082,10 +5082,10 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set transfer mode") /* free things */ - if(MPI_DATATYPE_NULL != file_type) + if(MPI_DATATYPE_NULL != file_type && MPI_BYTE != file_type) if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - if(MPI_DATATYPE_NULL != mem_type) + if(MPI_DATATYPE_NULL != mem_type && MPI_BYTE != mem_type) if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) H5MM_xfree(chunk_disp_array); -- cgit v0.12 From 4c43ff0b8b015ccfc1f4aeab18f189d629a5beb9 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 20 Aug 2020 18:24:07 -0500 Subject: Simplify default use of MPI_BYTE --- src/H5Dchunk.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index b57a608..b2a9eb6 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -4954,7 +4954,7 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info, int blocks, leftover, block_len; /* converted to int for MPI */ MPI_Aint *chunk_disp_array = NULL; int *block_lens = NULL; - MPI_Datatype mem_type = MPI_DATATYPE_NULL, file_type = MPI_DATATYPE_NULL; + MPI_Datatype mem_type = MPI_BYTE, file_type = MPI_BYTE; H5FD_mpio_xfer_t prev_xfer_mode; /* Previous data xfer mode */ hbool_t have_xfer_mode = FALSE; /* Whether the previous xffer mode has been retrieved */ hbool_t need_addr_sort = FALSE; @@ -5046,11 +5046,6 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info, if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&mem_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) } /* end if */ - else { - /* Set up file & memory MPI types, to participate in collective write */ - file_type = MPI_BYTE; - mem_type = MPI_BYTE; - } /* end else */ /* Set MPI-IO VFD properties */ @@ -5082,10 +5077,10 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set transfer mode") /* free things */ - if(MPI_DATATYPE_NULL != file_type && MPI_BYTE != file_type) + if(MPI_BYTE != file_type) if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - if(MPI_DATATYPE_NULL != mem_type && MPI_BYTE != mem_type) + if(MPI_BYTE != mem_type) if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) H5MM_xfree(chunk_disp_array); -- cgit v0.12 From 2ac49e2fec3a5cc39a2037b80d49ceb3a1e4df5e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Sun, 23 Aug 2020 14:05:19 -0500 Subject: Fix S3/HDFS test --- tools/libtest/h5tools_test_utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c index 12360a7..244fd43 100644 --- a/tools/libtest/h5tools_test_utils.c +++ b/tools/libtest/h5tools_test_utils.c @@ -1003,6 +1003,7 @@ test_set_configured_fapl(void) hid_t fapl_id = H5I_INVALID_HID; other_fa_t wrong_fa = {0x432, 0xf82, 0x9093}; +#ifdef H5_HAVE_ROS3_VFD H5FD_ros3_fapl_t ros3_anon_fa = {1, FALSE, "", "", ""}; H5FD_ros3_fapl_t ros3_auth_fa = { 1, /* fapl version */ @@ -1011,6 +1012,8 @@ test_set_configured_fapl(void) "12345677890abcdef", /* simulate access key ID */ "oiwnerwe9u0234nJw0-aoj+dsf", /* simulate secret key */ }; +#endif /* H5_HAVE_ROS3_VFD */ +#ifdef H5_HAVE_LIBHDFS H5FD_hdfs_fapl_t hdfs_fa = { 1, /* fapl version */ "", /* namenode name */ @@ -1019,6 +1022,7 @@ test_set_configured_fapl(void) "", /* user name */ 2048, /* stream buffer size */ }; +#endif /* H5_HAVE_LIBHDFS */ unsigned n_cases = 7; /* number of common testcases */ testcase cases[] = { { "(common) should fail: no fapl id", -- cgit v0.12 From 4d5354afcddf4e8858dfb496a5b1c113ee960cb6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Sun, 23 Aug 2020 14:58:09 -0500 Subject: Add hypen to subrelease regex --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac291fa..6c52c50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -236,7 +236,7 @@ string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$" "\\1" H5_VERS_MINOR ${_h5public_h_contents}) string (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$" "\\1" H5_VERS_RELEASE ${_h5public_h_contents}) -string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._]*)\".*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._\-]*)\".*$" "\\1" H5_VERS_SUBRELEASE ${_h5public_h_contents}) #message (STATUS "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") -- cgit v0.12 From 9b63dcb5c88442311fef59299c207638268b4738 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Mon, 24 Aug 2020 00:32:48 -0500 Subject: Condition if (H5_VERS_SUBRELEASE) is incorrectly false when H5_VERS_SUBRELEASE is 0, a valid value for H5_VERS_SUBRELEASE. Updated to if (${H5_VERS_SUBRELEASE} STREQUAL "") with corresponding reversal of action statements to avoid NOT. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c52c50..13b96e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -338,10 +338,10 @@ set (HDF5_PACKAGE_NAME "HDF5") set (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") set (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") set (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") -if (H5_VERS_SUBRELEASE) - set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") -else () +if (${H5_VERS_SUBRELEASE} STREQUAL "") set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") +else () + set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") endif () set (HDF5_LIB_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") set (HDF5_LIB_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}") -- cgit v0.12 From 9765b7ff3020ecd0981e84cdb2bcfe1e6d3b9803 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Aug 2020 06:55:00 -0500 Subject: Add special case when H5_VERS_SUBRELEASE is 0 --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 13b96e9..bc94f73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -338,10 +338,14 @@ set (HDF5_PACKAGE_NAME "HDF5") set (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") set (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") set (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") -if (${H5_VERS_SUBRELEASE} STREQUAL "") - set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") -else () +if (H5_VERS_SUBRELEASE) set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") +else () + if (${H5_VERS_SUBRELEASE} STREQUAL "") + set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") + else () + set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") + endif () endif () set (HDF5_LIB_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") set (HDF5_LIB_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}") -- cgit v0.12 From ec1c324a0d184d2778e9155140367a7d3a307fa1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Aug 2020 08:01:01 -0500 Subject: Revert H5_VERS_SUBRELEASE check --- CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc94f73..6c52c50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -341,11 +341,7 @@ set (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") if (H5_VERS_SUBRELEASE) set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") else () - if (${H5_VERS_SUBRELEASE} STREQUAL "") - set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") - else () - set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") - endif () + set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") endif () set (HDF5_LIB_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") set (HDF5_LIB_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}") -- cgit v0.12 From 336b30024216b142eb096bf85986786ecf65e993 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 25 Aug 2020 11:19:12 -0500 Subject: Add back function for VERIFY_EXTERNAL_CONSOLIDATION --- tools/test/h5repack/h5repack.sh.in | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index 02f515c..18e6d86 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -678,6 +678,26 @@ VERIFY_INVALIDBOUNDS() } # end of VERIFY_INVALIDBOUNDS # ----------------------------------------------------------------------------- +# Expect h5diff to fail +# Use only by VERIFY_EXTERNAL_CONSOLIDATION +# ----------------------------------------------------------------------------- +DIFFFAIL() +{ + VERIFY h5diff unequal $@ + ( + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN -q "$@" + ) + RET=$? + if [ $RET == 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + fi +} + +# ----------------------------------------------------------------------------- # Catchall test for repacking with external files # Loops over all (internally-listed) cases and applies the given arguments # to h5repack. -- cgit v0.12 From 4b69577e10ed58bf6536599092390f02a49ff3f9 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 25 Aug 2020 18:20:27 -0500 Subject: Bug fix to allow pass-through VOL connectors to set DXPL properties (like requesting collective operations) on dataset I/O --- src/H5Dio.c | 12 ------------ src/H5VLnative_dataset.c | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/H5Dio.c b/src/H5Dio.c index a972e00..63ae221 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -184,9 +184,6 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") - /* Set DXPL for operation */ - H5CX_set_dxpl(dxpl_id); - /* Read the data */ if ((ret_value = H5VL_dataset_read(vol_obj, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") @@ -235,9 +232,6 @@ H5Dread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *fil if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dxpl_id is not a dataset transfer property list ID") - /* Set DXPL for operation */ - H5CX_set_dxpl(dxpl_id); - /* Read the raw chunk */ if(H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_CHUNK_READ, dxpl_id, H5_REQUEST_NULL, offset, filters, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read unprocessed chunk data") @@ -306,9 +300,6 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") - /* Set DXPL for operation */ - H5CX_set_dxpl(dxpl_id); - /* Write the data */ if ((ret_value = H5VL_dataset_write(vol_obj, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data") @@ -363,9 +354,6 @@ H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *of if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dxpl_id is not a dataset transfer property list ID") - /* Set DXPL for operation */ - H5CX_set_dxpl(dxpl_id); - /* Write chunk */ if(H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_CHUNK_WRITE, dxpl_id, H5_REQUEST_NULL, filters, offset, data_size_32, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write unprocessed chunk data") diff --git a/src/H5VLnative_dataset.c b/src/H5VLnative_dataset.c index 3f62e00..c3cfdcd 100644 --- a/src/H5VLnative_dataset.c +++ b/src/H5VLnative_dataset.c @@ -18,6 +18,7 @@ #define H5D_FRIEND /* Suppress error about including H5Dpkg */ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ @@ -142,7 +143,7 @@ done: */ herr_t H5VL__native_dataset_read(void *obj, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t H5_ATTR_UNUSED dxpl_id, void *buf, + hid_t file_space_id, hid_t dxpl_id, void *buf, void H5_ATTR_UNUSED **req) { H5D_t *dset = (H5D_t *)obj; @@ -162,6 +163,9 @@ H5VL__native_dataset_read(void *obj, hid_t mem_type_id, hid_t mem_space_id, if(H5S_get_validated_dataspace(file_space_id, &file_space) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not get a validated dataspace from file_space_id") + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); + /* Read raw data */ if(H5D__read(dset, mem_type_id, mem_space, file_space, buf/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") @@ -182,7 +186,7 @@ done: */ herr_t H5VL__native_dataset_write(void *obj, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t H5_ATTR_UNUSED dxpl_id, const void *buf, + hid_t file_space_id, hid_t dxpl_id, const void *buf, void H5_ATTR_UNUSED **req) { H5D_t *dset = (H5D_t *)obj; @@ -202,6 +206,9 @@ H5VL__native_dataset_write(void *obj, hid_t mem_type_id, hid_t mem_space_id, if(H5S_get_validated_dataspace(file_space_id, &file_space) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not get a validated dataspace from file_space_id") + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); + /* Write the data */ if(H5D__write(dset, mem_type_id, mem_space, file_space, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data") @@ -377,7 +384,7 @@ done: */ herr_t H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type, - hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) + hid_t dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5D_t *dset = (H5D_t *)obj; /* Dataset */ herr_t ret_value = SUCCEED; /* Return value */ @@ -387,6 +394,9 @@ H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type, /* Sanity checks */ HDassert(dset); + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); + switch(optional_type) { case H5VL_NATIVE_DATASET_FORMAT_CONVERT: { /* H5Dformat_convert */ -- cgit v0.12 From 3f65adefd90bbefc446c42801fe5a502ef70d43a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 26 Aug 2020 09:03:43 -0500 Subject: The version string has a second use for packaging --- CMakeLists.txt | 4 +++- tools/test/misc/testfiles/h5mkgrp_version.txt.in | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c52c50..e4b87a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -339,9 +339,11 @@ set (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}" set (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") set (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") if (H5_VERS_SUBRELEASE) - set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") + set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}.${H5_VERS_SUBRELEASE}") + set (HDF5_RELEASE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") else () set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") + set (HDF5_RELEASE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") endif () set (HDF5_LIB_PACKAGE_SOVERSION "${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") set (HDF5_LIB_PACKAGE_SOVERSION_MAJOR "${H5_LIB_SOVERS_MAJOR}") diff --git a/tools/test/misc/testfiles/h5mkgrp_version.txt.in b/tools/test/misc/testfiles/h5mkgrp_version.txt.in index 75c13a5..37dbabd 100644 --- a/tools/test/misc/testfiles/h5mkgrp_version.txt.in +++ b/tools/test/misc/testfiles/h5mkgrp_version.txt.in @@ -1 +1 @@ -h5mkgrp: Version @HDF5_PACKAGE_VERSION_STRING@ +h5mkgrp: Version @HDF5_RELEASE_VERSION_STRING@ -- cgit v0.12 From 0932c46e3d5b09d32cbe29335e8054302ab122c5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 26 Aug 2020 10:17:21 -0500 Subject: MinGW uses "MinGW Makefiles" --- config/cmake/scripts/HDF5config.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 7b7560f..3a8d5b7 100644 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -21,6 +21,7 @@ cmake_minimum_required (VERSION 3.12) # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log # where valid options for OPTION are: # BUILD_GENERATOR - The cmake build generator: +# MinGW * MinGW Makefiles # Unix * Unix Makefiles # VS2019 * Visual Studio 16 2019 # VS201964 * Visual Studio 16 2019 @@ -167,7 +168,11 @@ if (NOT DEFINED HPC) ## Set the following to unique id your computer ## set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") else () - set (CTEST_CMAKE_GENERATOR "Unix Makefiles") + if (MINGW) + set (CTEST_CMAKE_GENERATOR "MinGW Makefiles") + else () + set (CTEST_CMAKE_GENERATOR "Unix Makefiles") + endif () ## Set the following to unique id your computer ## if (APPLE) set (CTEST_SITE "MAC.XXXX") -- cgit v0.12 From 49e01e594eb2d0c25455e7ff71eed3de074fd15b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 27 Aug 2020 10:54:14 -0700 Subject: Adds RELEASE.txt note about HDFS VFD stubs being removed --- release_docs/RELEASE.txt | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4f443fd..dbf55a9 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -382,6 +382,40 @@ New Features Library: -------- + - Remove HDFS VFD stubs + + The original implementation of the HDFS VFD included non-functional + versions of the following public API calls when the HDFS VFD is + not built as a part of the HDF5 library: + + * H5FD_hdfs_init() + * H5Pget_fapl_hdfs() + * H5Pset_fapl_hdfs() + + They will remain present in HDF5 1.10 and HDF5 1.12 releases + for binary compatibility purposes but have been removed as of 1.14.0. + + Note that this has nothing to do with the real HDFS VFD API calls + that are fully functional when the HDFS VFD is configured and built. + + We simply changed: + + #ifdef LIBHDFS + + #else + + #endif + + to: + + #ifdef LIBHDFS + + #endif + + Which is how the other optional VFDs are handled. + + (DER - 2020/08/27) + - Add Mirror VFD Use TCP/IP sockets to perform write-only (W/O) file I/O on a remote -- cgit v0.12 From c9f15824fe01c93cd8defbfed2563fd33829d730 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 27 Aug 2020 18:01:11 -0500 Subject: Revert "Removed commeted out code from H5C_dump_coll_write_list()" This reverts commit eb75dc1bb02e13902d73a36caafe763eea585d02. --- src/H5Cdbg.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index ea27858..e0e3158 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -444,6 +444,11 @@ H5C_dump_coll_write_list(H5C_t * cache_ptr, char * calling_fcn) (int)(entry_ptr->is_dirty), entry_ptr->type->name); + /* HDfprintf(stdout, " node_ptr = 0x%llx, item = %p\n", + (unsigned long long)node_ptr, + H5SL_item(node_ptr)); + */ + node_ptr = H5SL_next(node_ptr); if ( node_ptr != NULL ) -- cgit v0.12 From 72b9b8ca7535ddce25fe03e6a3b3ae774c88f85b Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 27 Aug 2020 18:11:19 -0500 Subject: Revert " Checkin of fix for CGNS bug" This reverts commit 94c34773ceae5b30c4afb227d0385ebf4ab6ce28. --- src/H5Cdbg.c | 112 +----------------------------------------------------- src/H5Cmpio.c | 27 +++---------- src/H5Cprivate.h | 5 +-- src/H5FDmpi.c | 36 ------------------ src/H5FDmpio.c | 4 +- src/H5FDprivate.h | 2 - src/H5Fmpi.c | 28 -------------- src/H5Fprivate.h | 1 - 8 files changed, 8 insertions(+), 207 deletions(-) diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index e0e3158..47370f8 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -28,16 +28,12 @@ #include "H5Cmodule.h" /* This source code file is part of the H5C module */ -#define H5AC_FRIEND - - - /***********/ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACpkg.h" /* Metadata Cache */ +#include "H5ACprivate.h" /* Metadata Cache */ #include "H5Cpkg.h" /* Cache */ #include "H5Eprivate.h" /* Error Handling */ @@ -368,112 +364,6 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) /*------------------------------------------------------------------------- - * Function: H5C_dump_coll_write_list - * - * Purpose: Debugging routine that prints a summary of the contents of - * the collective write skip list used by the metadata cache - * in the parallel case to maintain a list of entries to write - * collectively at a sync point. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: John Mainzer - * 4/1/17 - * - *------------------------------------------------------------------------- - */ -#ifdef H5_HAVE_PARALLEL -#ifndef NDEBUG -herr_t -H5C_dump_coll_write_list(H5C_t * cache_ptr, char * calling_fcn) -{ - herr_t ret_value = SUCCEED; /* Return value */ - int i; - int list_len; - H5AC_aux_t * aux_ptr = NULL; - H5C_cache_entry_t * entry_ptr = NULL; - H5SL_node_t * node_ptr = NULL; - - FUNC_ENTER_NOAPI_NOERR - - HDassert(cache_ptr != NULL); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(cache_ptr->aux_ptr); - - aux_ptr = (H5AC_aux_t *)cache_ptr->aux_ptr; - - HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); - - HDassert(calling_fcn != NULL); - - list_len = (int)H5SL_count(cache_ptr->coll_write_list); - - HDfprintf(stdout, "\n\nDumping MDC coll write list from %d:%s.\n", - aux_ptr->mpi_rank, calling_fcn); - HDfprintf(stdout, " slist len = %u.\n", cache_ptr->slist_len); - - if ( list_len > 0 ) { - - /* scan the collective write list generating the desired output */ - HDfprintf(stdout, - "Num: Addr: Len: Prot/Pind: Dirty: Type:\n"); - - i = 0; - - node_ptr = H5SL_first(cache_ptr->coll_write_list); - - if ( node_ptr != NULL ) - - entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - - else - - entry_ptr = NULL; - - while ( entry_ptr != NULL ) { - - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - - HDfprintf(stdout, - "%s%d 0x%016llx %4lld %d/%d %d %s\n", - cache_ptr->prefix, i, - (long long)(entry_ptr->addr), - (long long)(entry_ptr->size), - (int)(entry_ptr->is_protected), - (int)(entry_ptr->is_pinned), - (int)(entry_ptr->is_dirty), - entry_ptr->type->name); - - /* HDfprintf(stdout, " node_ptr = 0x%llx, item = %p\n", - (unsigned long long)node_ptr, - H5SL_item(node_ptr)); - */ - - node_ptr = H5SL_next(node_ptr); - - if ( node_ptr != NULL ) - - entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - - else - - entry_ptr = NULL; - - i++; - - } /* end while */ - } /* end if */ - - HDfprintf(stdout, "\n\n"); - - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5C_dump_coll_write_list() */ -#endif /* NDEBUG */ -#endif /* H5_HAVE_PARALLEL */ - - -/*------------------------------------------------------------------------- * Function: H5C_set_prefix * * Purpose: Set the values of the prefix field of H5C_t. This diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 6e33eb1..5297a96 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -1025,7 +1025,6 @@ H5C__collective_write(H5F_t *f) /* Get number of entries in collective write list */ count = (int)H5SL_count(cache_ptr->coll_write_list); - if(count > 0) { H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_COLLECTIVE; H5SL_node_t *node; @@ -1060,7 +1059,6 @@ H5C__collective_write(H5F_t *f) node = H5SL_next(node); i = 1; while(node) { - if(NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node))) HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item") @@ -1077,18 +1075,14 @@ H5C__collective_write(H5F_t *f) /* Create memory MPI type */ if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed(count, length_array, buf_array, MPI_BYTE, &btype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) - btype_created = TRUE; - if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&btype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) /* Create file MPI type */ if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed(count, length_array, offset_array, MPI_BYTE, &ftype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) - ftype_created = TRUE; - if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&ftype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) @@ -1103,10 +1097,8 @@ H5C__collective_write(H5F_t *f) } /* end if */ else { MPI_Status mpi_stat; - MPI_File *mpi_fh_p; + MPI_File mpi_fh_p; MPI_File mpi_fh; - MPI_Info *info_p; - MPI_Info info; /* This should be rewritten to call H5F_block_write, with the correct * buffer and file datatypes (null ones). -QAK, 2018/02/21 @@ -1116,15 +1108,8 @@ H5C__collective_write(H5F_t *f) mpi_fh = *(MPI_File*)mpi_fh_p; - if(H5F_get_mpi_info(f, &info_p) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get mpi file info") - - info = *info_p; - - /* just to match up with the 1st MPI_File_set_view from - * H5FD_mpio_write() - */ - if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", info))) + /* just to match up with the 1st MPI_File_set_view from H5FD_mpio_write() */ + if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", MPI_INFO_NULL))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) /* just to match up with MPI_File_write_at_all from H5FD_mpio_write() */ @@ -1132,10 +1117,8 @@ H5C__collective_write(H5F_t *f) if(MPI_SUCCESS != (mpi_code = MPI_File_write_at_all(mpi_fh, (MPI_Offset)0, NULL, 0, MPI_BYTE, &mpi_stat))) HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mpi_code) - /* just to match up with the 2nd MPI_File_set_view (reset) in - * H5FD_mpio_write() - */ - if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", info))) + /* just to match up with the 2nd MPI_File_set_view (reset) in H5FD_mpio_write() */ + if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", MPI_INFO_NULL))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) } /* end else */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 8934b95..059e6dc 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -2336,12 +2336,9 @@ H5_DLL herr_t H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name); H5_DLL hbool_t H5C_get_serialization_in_progress(const H5C_t *cache_ptr); H5_DLL hbool_t H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring); H5_DLL herr_t H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn); -#ifdef H5_HAVE_PARALLEL -H5_DLL herr_t H5C_dump_coll_write_list(H5C_t * cache_ptr, char * calling_fcn); -#endif /* H5_HAVE_PARALLEL */ H5_DLL herr_t H5C_get_entry_ptr_from_addr(H5C_t *cache_ptr, haddr_t addr, void **entry_ptr_ptr); -H5_DLL herr_t H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, +H5_DLL herr_t H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, haddr_t child_addr, hbool_t *fd_exists_ptr); H5_DLL herr_t H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, const H5C_class_t *expected_type, hbool_t *in_cache_ptr, diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 43fa340..3cdbc32 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -141,42 +141,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_get_mpi_info - * - * Purpose: Retrieves the file's mpi info - * - * Return: Success: SUCCEED - * - * Failure: FAIL - * - * Programmer: John Mainzer - * 4/4/17 - * - *------------------------------------------------------------------------- - */ -herr_t -H5FD_get_mpi_info(H5FD_t *file, void** mpi_info) -{ - const H5FD_class_mpi_t *cls; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - HDassert(file); - cls = (const H5FD_class_mpi_t *)(file->cls); - HDassert(cls); - HDassert(cls->get_mpi_info); /* All MPI drivers must implement this */ - - /* Dispatch to driver */ - if((ret_value = (cls->get_mpi_info)(file, mpi_info)) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_mpi_info request failed") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_get_mpi_info() */ - - -/*------------------------------------------------------------------------- * Function: H5FD_mpi_MPIOff_to_haddr * * Purpose: Convert an MPI_Offset value to haddr_t. diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 9475093..319e528 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -91,7 +91,6 @@ static herr_t H5FD__mpio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) static int H5FD__mpio_mpi_rank(const H5FD_t *_file); static int H5FD__mpio_mpi_size(const H5FD_t *_file); static MPI_Comm H5FD__mpio_communicator(const H5FD_t *_file); -static herr_t H5FD__mpio_get_info(H5FD_t *_file, void** mpi_info); /* The MPIO file driver information */ static const H5FD_class_mpi_t H5FD_mpio_g = { @@ -131,8 +130,7 @@ static const H5FD_class_mpi_t H5FD_mpio_g = { }, /* End of superclass information */ H5FD__mpio_mpi_rank, /*get_rank */ H5FD__mpio_mpi_size, /*get_size */ - H5FD__mpio_communicator, /*get_comm */ - H5FD__mpio_get_info /*get_info */ + H5FD__mpio_communicator /*get_comm */ }; #ifdef H5FDmpio_DEBUG diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 7d5b66d..c5d1be1 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -51,7 +51,6 @@ typedef struct H5FD_class_mpi_t { int (*get_rank)(const H5FD_t *file); /* Get the MPI rank of a process */ int (*get_size)(const H5FD_t *file); /* Get the MPI size of a communicator */ MPI_Comm (*get_comm)(const H5FD_t *file); /* Get the communicator for a file */ - herr_t (*get_mpi_info)(H5FD_t *file, void** mpi_info); /* get MPI_Info for a file */ } H5FD_class_mpi_t; #endif @@ -163,7 +162,6 @@ H5_DLL herr_t H5FD_get_mpio_atomicity(H5FD_t *file, hbool_t *flag); H5_DLL int H5FD_mpi_get_rank(const H5FD_t *file); H5_DLL int H5FD_mpi_get_size(const H5FD_t *file); H5_DLL MPI_Comm H5FD_mpi_get_comm(const H5FD_t *_file); -H5_DLL herr_t H5FD_get_mpi_info(H5FD_t *file, void** file_info); #endif /* H5_HAVE_PARALLEL */ #endif /* !_H5FDprivate_H */ diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 8189821..02f93f7 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -434,33 +434,5 @@ H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm) done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_mpi_retrieve_comm */ - - -/*------------------------------------------------------------------------- - * Function: H5F_get_mpi_info - * - * Purpose: Retrieves MPI File info. - * - * Return: Success: The size (positive) - * Failure: Negative - * - *------------------------------------------------------------------------- - */ -herr_t -H5F_get_mpi_info(const H5F_t *f, MPI_Info **f_info) -{ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI(FAIL) - - HDassert(f && f->shared); - - /* Dispatch to driver */ - if ((ret_value = H5FD_get_mpi_info(f->shared->lf, (void **)f_info)) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get mpi file info") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_get_mpi_info() */ #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 552855b..395f482 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -866,7 +866,6 @@ H5_DLL MPI_Comm H5F_mpi_get_comm(const H5F_t *f); H5_DLL int H5F_shared_mpi_get_size(const H5F_shared_t *f_sh); H5_DLL int H5F_mpi_get_size(const H5F_t *f); H5_DLL herr_t H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm); -H5_DLL herr_t H5F_get_mpi_info(const H5F_t *f, MPI_Info **f_info); H5_DLL herr_t H5F_get_mpi_atomicity(H5F_t *file, hbool_t *flag); H5_DLL herr_t H5F_set_mpi_atomicity(H5F_t *file, hbool_t flag); #endif /* H5_HAVE_PARALLEL */ -- cgit v0.12 From 165c454aa739477fda6837a14b7cdaa3a7f0b7aa Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 27 Aug 2020 18:18:44 -0500 Subject: Revert PR 405 (https://bitbucket.hdfgroup.org/projects/HDFFV/repos/hdf5/pull-requests/405/overview) and reimplement with correct and simpler code. --- src/H5Cmpio.c | 55 ++++++++++++++++++------------------------------------- 1 file changed, 18 insertions(+), 37 deletions(-) diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 5297a96..f451671 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -1000,6 +1000,7 @@ H5C__collective_write(H5F_t *f) { H5AC_t *cache_ptr; H5FD_mpio_xfer_t orig_xfer_mode = H5FD_MPIO_COLLECTIVE; + void *base_buf; int count; int *length_array = NULL; MPI_Aint *buf_array = NULL; @@ -1009,6 +1010,7 @@ H5C__collective_write(H5F_t *f) MPI_Datatype ftype; hbool_t ftype_created = FALSE; int mpi_code; + char unused = 0; /* Unused, except for non-NULL pointer value */ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -1023,19 +1025,17 @@ H5C__collective_write(H5F_t *f) if(H5CX_get_io_xfer_mode(&orig_xfer_mode) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") + /* Set transfer mode */ + if(H5CX_set_io_xfer_mode(H5FD_MPIO_COLLECTIVE) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set MPI-I/O transfer mode") + /* Get number of entries in collective write list */ count = (int)H5SL_count(cache_ptr->coll_write_list); if(count > 0) { - H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_COLLECTIVE; H5SL_node_t *node; H5C_cache_entry_t *entry_ptr; - void *base_buf; int i; - /* Set new transfer mode */ - if(H5CX_set_io_xfer_mode(xfer_mode) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set MPI-I/O transfer mode") - /* Allocate arrays */ if(NULL == (length_array = (int *)H5MM_malloc((size_t)count * sizeof(int))) ) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective write table length array") @@ -1085,42 +1085,23 @@ H5C__collective_write(H5F_t *f) ftype_created = TRUE; if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&ftype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) - - /* Pass buf type, file type to the file driver */ - if(H5CX_set_mpi_coll_datatypes(btype, ftype) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set MPI-I/O properties") - - /* Write data */ - if(H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)0, (size_t)1, base_buf) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to write entries collectively") - } /* end if */ else { - MPI_Status mpi_stat; - MPI_File mpi_fh_p; - MPI_File mpi_fh; + /* Pass trivial buf type, file type to the file driver */ + btype = MPI_BYTE; + ftype = MPI_BYTE; -/* This should be rewritten to call H5F_block_write, with the correct - * buffer and file datatypes (null ones). -QAK, 2018/02/21 - */ - if(H5F_get_mpi_handle(f, (MPI_File **)&mpi_fh_p) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't get mpi file handle") - - mpi_fh = *(MPI_File*)mpi_fh_p; - - /* just to match up with the 1st MPI_File_set_view from H5FD_mpio_write() */ - if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", MPI_INFO_NULL))) - HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) + /* Set non-NULL pointer for I/O operation */ + base_buf = &unused; + } /* end else */ - /* just to match up with MPI_File_write_at_all from H5FD_mpio_write() */ - HDmemset(&mpi_stat, 0, sizeof(MPI_Status)); - if(MPI_SUCCESS != (mpi_code = MPI_File_write_at_all(mpi_fh, (MPI_Offset)0, NULL, 0, MPI_BYTE, &mpi_stat))) - HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mpi_code) + /* Pass buf type, file type to the file driver */ + if(H5CX_set_mpi_coll_datatypes(btype, ftype) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set MPI-I/O properties") - /* just to match up with the 2nd MPI_File_set_view (reset) in H5FD_mpio_write() */ - if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", MPI_INFO_NULL))) - HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) - } /* end else */ + /* Write data */ + if(H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)0, (size_t)1, base_buf) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_WRITEERROR, FAIL, "unable to write entries collectively") done: /* Free arrays */ -- cgit v0.12 From 45021f1826f3710a3008430ddf7216bffb7068f7 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 28 Aug 2020 18:03:08 -0500 Subject: Update buffer count --- src/H5Cmpio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index f451671..a4c295b 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -1011,6 +1011,7 @@ H5C__collective_write(H5F_t *f) hbool_t ftype_created = FALSE; int mpi_code; char unused = 0; /* Unused, except for non-NULL pointer value */ + size_t buf_count; herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -1085,6 +1086,9 @@ H5C__collective_write(H5F_t *f) ftype_created = TRUE; if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&ftype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) + + /* MPI count to write */ + buf_count = 1; } /* end if */ else { /* Pass trivial buf type, file type to the file driver */ @@ -1093,6 +1097,9 @@ H5C__collective_write(H5F_t *f) /* Set non-NULL pointer for I/O operation */ base_buf = &unused; + + /* MPI count to write */ + buf_count = 0; } /* end else */ /* Pass buf type, file type to the file driver */ @@ -1100,7 +1107,7 @@ H5C__collective_write(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set MPI-I/O properties") /* Write data */ - if(H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)0, (size_t)1, base_buf) < 0) + if(H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)0, buf_count, base_buf) < 0) HGOTO_ERROR(H5E_CACHE, H5E_WRITEERROR, FAIL, "unable to write entries collectively") done: -- cgit v0.12