summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/gnu-flags2
-rw-r--r--configure.ac38
-rw-r--r--java/src/jni/h5Constants.c1
-rw-r--r--m4/aclocal_fc.f902
-rw-r--r--m4/aclocal_fc.m41
-rw-r--r--release_docs/RELEASE.txt51
-rw-r--r--src/H5FD.c279
-rw-r--r--src/H5Ipublic.h34
-rw-r--r--test/h5test.c100
-rw-r--r--test/h5test.h1
-rw-r--r--test/tmisc.c69
11 files changed, 290 insertions, 288 deletions
diff --git a/config/gnu-flags b/config/gnu-flags
index b4d5e8d..2f2e428 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -142,7 +142,7 @@ case "$cc_vendor-$cc_version" in
# Symbols
NO_SYMBOLS_CFLAGS="-s"
- SYMBOLS_CFLAGS="-g"
+ SYMBOLS_CFLAGS="-g -fno-omit-frame-pointer"
# Profile
PROFILE_CFLAGS="-pg"
diff --git a/configure.ac b/configure.ac
index e941ae7..6ddf294 100644
--- a/configure.ac
+++ b/configure.ac
@@ -585,11 +585,11 @@ if test "X$HDF_FORTRAN" = "Xyes"; then
AC_DEFINE([FORTRAN_HAVE_STORAGE_SIZE], [1], [Define if we have Fortran intrinsic STORAGE_SIZE])
fi
- if test "X$HAVE_C_SIZEOF_FORTRAN" = "Xyes"; then
+ if test "X$HAVE_C_SIZEOF_FORTRAN" = "Xyes"; then
AC_DEFINE([FORTRAN_HAVE_C_SIZEOF], [1], [Define if we have Fortran intrinsic C_SIZEOF])
fi
- if test "X$HAVE_SIZEOF_FORTRAN" = "Xyes"; then
+ if test "X$HAVE_SIZEOF_FORTRAN" = "Xyes"; then
AC_DEFINE([FORTRAN_HAVE_SIZEOF], [1], [Define if we have Fortran intrinsic SIZEOF])
fi
@@ -604,7 +604,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then
## Is C_LONG_DOUBLE different from C_DOUBLE
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="0"
- if test "X$FORTRAN_HAVE_C_LONG_DOUBLE"; then
+ if test "$FORTRAN_HAVE_C_LONG_DOUBLE" = "1"; then
PAC_PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE
if test "X$C_LONG_DOUBLE_IS_UNIQUE_FORTRAN" = "Xyes"; then
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="1"
@@ -1252,10 +1252,11 @@ AC_ARG_WITH([fnord],
])
## ----------------------------------------------------------------------
-## Is the dmalloc present? It has a header file `dmalloc.h' and a library
-## `-ldmalloc' and their locations might be specified with the `--with-dmalloc'
-## command-line switch. The value is an include path and/or a library path.
-## If the library path is specified then it must be preceded by a comma.
+## Is dmalloc (debug malloc library) requested? It has a header file
+## `dmalloc.h' and a library `-ldmalloc' and their locations might be
+## specified with the `--with-dmalloc' command-line switch. The value
+## is an include path and/or a library path. If the library path is
+## specified then it must be preceded by a comma.
##
AC_SUBST([HAVE_DMALLOC])
@@ -1941,26 +1942,17 @@ AC_DEFINE_UNQUOTED([PRINTF_LL_WIDTH], ["$hdf5_cv_printf_ll"],
[Width for printf() for type `long long' or `__int64', use `ll'])
## ----------------------------------------------------------------------
-## Deprecate old ways of determining debug/production build
-## These can probably be removed in the future (1.10.1?)
+## Remove old ways of determining debug/production build.
+## These were used in 1.8.x and earlier. We should probably keep these checks
+## around to help people migrate to 1.10.x and newer versions.
##
AC_ARG_ENABLE([debug],
- [AS_HELP_STRING([--enable-debug],
- [DEPRECATED: use --enable-build-mode=debug])],
- [DEPRECATED_DEBUG=$enableval])
-
-if test "X-$DEPRECATED_DEBUG" != "X-" ; then
- AC_MSG_ERROR([--enable-debug is deprecated, use --enable-build-mode=debug instead.])
-fi
+ [AS_HELP_STRING([--enable-debug], [DEPRECATED: use --enable-build-mode=debug])],
+ [AC_MSG_ERROR([--enable-debug is deprecated, use --enable-build-mode=debug instead.])])
AC_ARG_ENABLE([production],
- [AS_HELP_STRING([--enable-production],
- [DEPRECATED: use --enable-build-mode=production])],
- [DEPRECATED_PRODUCTION=$enableval])
-
-if test "X-$DEPRECATED_PRODUCTION" != "X-" ; then
- AC_MSG_ERROR([--enable-production is deprecated, use --enable-build-mode=production instead.])
-fi
+ [AS_HELP_STRING([--enable-production], [DEPRECATED: use --enable-build-mode=production])],
+ [AC_MSG_ERROR([--enable-production is deprecated, use --enable-build-mode=production instead.])])
## ----------------------------------------------------------------------
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c
index d4511e1..f6f8bfa 100644
--- a/java/src/jni/h5Constants.c
+++ b/java/src/jni/h5Constants.c
@@ -26,6 +26,7 @@ extern "C" {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+#pragma GCC diagnostic ignored "-Wunused-parameter"
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5_1QUARTER_1HADDR_1MAX(JNIEnv *env, jclass cls) { return (hsize_t)HADDR_MAX/4; }
diff --git a/m4/aclocal_fc.f90 b/m4/aclocal_fc.f90
index 4c58e4e..664a3c6 100644
--- a/m4/aclocal_fc.f90
+++ b/m4/aclocal_fc.f90
@@ -58,7 +58,7 @@ END PROGRAM PROG_FC_HAVE_F2003_REQUIREMENTS
!---- START ----- Check to see C_LONG_DOUBLE is different from C_DOUBLE
MODULE type_mod
USE ISO_C_BINDING
- INTERFACE h5t
+ INTERFACE h5t
MODULE PROCEDURE h5t_c_double
MODULE PROCEDURE h5t_c_long_double
END INTERFACE
diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4
index 0bf3cb1..ab45bbc 100644
--- a/m4/aclocal_fc.m4
+++ b/m4/aclocal_fc.m4
@@ -476,4 +476,3 @@ rm -f pac_Cconftest.out
],[])
])
-
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 695f771..7df405d 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -55,7 +55,7 @@ New Features
Configuration:
-------------
- Removed version-specific gcc/gfortran flags for version 4.0 (inclusive)
- and earlier
+ and earlier.
The config/gnu-flags file, which is sourced as a part of the configure
process, adds version-specific flags for use when building HDF5. Most of
@@ -70,12 +70,53 @@ New Features
to remove the flags not understood by that version of the compiler.
Nothing should change when building with gcc >= 4.1.
- Also, as a part of this work, the string 'gfortran40' was changed to
- 'gfortran' in the config/gnu-fflags file.
-
(HDFFV-9937, DER, 2017/05/31)
- -
+ - Corrected FORTRAN_HAVE_C_LONG_DOUBLE processing in the autotools.
+
+ A bug in the autotools Fortran processing code always set the
+ FORTRAN_HAVE_C_LONG_DOUBLE variable to be true regardless of
+ whether or not a C long double type was present.
+
+ This would cause compilation failures on platforms where a C
+ long double type was not available and the Fortran wrappers
+ were being built.
+
+ (HDFFV-10247, DER, 2017/07/05)
+
+ - The deprecated --enable-production and --enable-debug configure options
+ failed to emit errors when passed an empty string
+ (e.g.: --enable-debug="").
+
+ Due to the way we checked for these options being set, it was possible
+ to avoid the error message and continue configuration if an empty string
+ was passed to the option.
+
+ Any use of --enable-production or --enable-debug will now halt the
+ configuration step and emit a helpful error message
+ (use --enable-build-mode=debug|production instead).
+
+ (HDFFV-10248, DER, 2017/07/05)
+
+ - FC_BASENAME was set to 'gfortran40' instead 'gfortran' in the autotools
+ processing on gcc (any platform) and freebsd.
+
+ This was probably a historical artifact and so was changed to
+ 'gfortran'. We don't use FC_BASENAME in our processing, so this
+ had no effect on building the library normally.
+
+ (HDFFV-10249, DER, 2017/05/31)
+
+ - -fno-omit-frame-pointer was added when building with debugging symbols
+ enabled.
+
+ Debugging symbols can be enabled independently of the overall build
+ mode in both the autotools and CMake. This allows (limited) debugging
+ of optimized code. Since many debuggers rely on the frame pointer,
+ we've disabled this optimization when debugging symbols are requested
+ (e.g.: via building with --enable-symbols).
+
+ (HDFFV-10250, DER, 2017/05/31)
Library:
--------
diff --git a/src/H5FD.c b/src/H5FD.c
index 67cf963..9f62065 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -12,14 +12,11 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
- * Monday, July 26, 1999
- *
- * Purpose: The Virtual File Layer as described in documentation.
- * This is the greatest common denominator for all types of
- * storage access whether a file, memory, network, etc. This
- * layer usually just dispatches the request to an actual
- * file driver layer.
+ * Purpose: The Virtual File Layer as described in documentation.
+ * This is the greatest common denominator for all types of
+ * storage access whether a file, memory, network, etc. This
+ * layer usually just dispatches the request to an actual
+ * file driver layer.
*/
/****************/
@@ -112,9 +109,6 @@ static const H5I_class_t H5I_VFL_CLS[1] = {{
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Robb Matzke
- * Monday, July 26, 1999
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -147,9 +141,6 @@ done:
* otherwise.
* Failure: Never fails.
*
- * Programmer: Robb Matzke
- * Friday, February 19, 1999
- *
*-------------------------------------------------------------------------
*/
int
@@ -189,11 +180,6 @@ H5FD_term_package(void)
*
* Failure: Negative
*
- * Programmer: Robb Matzke
- * Monday, July 26, 1999
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -221,26 +207,18 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FDregister
- *
- * Purpose: Registers a new file driver as a member of the virtual file
- * driver class. Certain fields of the class struct are
- * required and that is checked here so it doesn't have to be
- * checked every time the field is accessed.
- *
- * Return: Success: A file driver ID which is good until the
- * library is closed or the driver is
- * unregistered.
+ * Function: H5FDregister
*
- * Failure: A negative value.
+ * Purpose: Registers a new file driver as a member of the virtual file
+ * driver class. Certain fields of the class struct are
+ * required and that is checked here so it doesn't have to be
+ * checked every time the field is accessed.
*
- * Programmer: Robb Matzke
- * Monday, July 26, 1999
+ * Return: Success: A file driver ID which is good until the
+ * library is closed or the driver is
+ * unregistered.
*
- * Modifications:
- * Copied guts of function into H5FD_register
- * Quincey Koziol
- * Friday, January 30, 2004
+ * Failure: A negative value.
*
*-------------------------------------------------------------------------
*/
@@ -255,18 +233,18 @@ H5FDregister(const H5FD_class_t *cls)
/* Check arguments */
if(!cls)
- HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "null class pointer is disallowed")
+ HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "null class pointer is disallowed")
if(!cls->open || !cls->close)
- HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`open' and/or `close' methods are not defined")
+ HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`open' and/or `close' methods are not defined")
if(!cls->get_eoa || !cls->set_eoa)
- HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eoa' and/or `set_eoa' methods are not defined")
+ HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eoa' and/or `set_eoa' methods are not defined")
if(!cls->get_eof)
- HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eof' method is not defined")
+ HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eof' method is not defined")
if(!cls->read || !cls->write)
- HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`read' and/or `write' method is not defined")
- for (type=H5FD_MEM_DEFAULT; type<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,type))
- if(cls->fl_map[type]<H5FD_MEM_NOLIST || cls->fl_map[type]>=H5FD_MEM_NTYPES)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid free-list mapping")
+ HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`read' and/or `write' method is not defined")
+ for (type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,type))
+ if(cls->fl_map[type] < H5FD_MEM_NOLIST || cls->fl_map[type] >= H5FD_MEM_NTYPES)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid free-list mapping")
/* Create the new class ID */
if((ret_value=H5FD_register(cls, sizeof(H5FD_class_t), TRUE)) < 0)
@@ -278,29 +256,18 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_register
- *
- * Purpose: Registers a new file driver as a member of the virtual file
- * driver class. Certain fields of the class struct are
- * required and that is checked here so it doesn't have to be
- * checked every time the field is accessed.
- *
- * Return: Success: A file driver ID which is good until the
- * library is closed or the driver is
- * unregistered.
+ * Function: H5FD_register
*
- * Failure: A negative value.
+ * Purpose: Registers a new file driver as a member of the virtual file
+ * driver class. Certain fields of the class struct are
+ * required and that is checked here so it doesn't have to be
+ * checked every time the field is accessed.
*
- * Programmer: Robb Matzke
- * Monday, July 26, 1999
+ * Return: Success: A file driver ID which is good until the
+ * library is closed or the driver is
+ * unregistered.
*
- * Modifications:
- * Broke into public and internal routines & added 'size'
- * parameter to internal routine, which allows us to create
- * sub-classes of H5FD_class_t for internal support (see the
- * MPI drivers, etc.)
- * Quincey Koziol
- * January 30, 2004
+ * Failure: A negative value.
*
*-------------------------------------------------------------------------
*/
@@ -325,7 +292,7 @@ H5FD_register(const void *_cls, size_t size, hbool_t app_ref)
/* Copy the class structure so the caller can reuse or free it */
if(NULL == (saved = (H5FD_class_t *)H5MM_malloc(size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for file driver class struct")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for file driver class struct")
HDmemcpy(saved, cls, size);
/* Create the new class ID */
@@ -342,19 +309,16 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FDunregister
- *
- * Purpose: Removes a driver ID from the library. This in no way affects
- * file access property lists which have been defined to use
- * this driver or files which are already opened under this
- * driver.
+ * Function: H5FDunregister
*
- * Return: Success: Non-negative
+ * Purpose: Removes a driver ID from the library. This in no way affects
+ * file access property lists which have been defined to use
+ * this driver or files which are already opened under this
+ * driver.
*
- * Failure: Negative
+ * Return: Success: Non-negative
*
- * Programmer: Robb Matzke
- * Monday, July 26, 1999
+ * Failure: Negative
*
*-------------------------------------------------------------------------
*/
@@ -394,9 +358,6 @@ done:
*
* Failure: NULL
*
- * Programmer: Robb Matzke
- * Friday, August 20, 1999
- *
*-------------------------------------------------------------------------
*/
H5FD_class_t *
@@ -442,11 +403,6 @@ done:
* Failure: 0 if an error occurs or if the driver has no
* data to store in the superblock.
*
- * Programmer: Robb Matzke
- * Monday, August 16, 1999
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
hsize_t
@@ -480,11 +436,6 @@ done:
*
* Failure: Negative
*
- * Programmer: Robb Matzke
- * Monday, August 16, 1999
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -511,9 +462,6 @@ done:
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Robb Matzke
- * Monday, August 16, 1999
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -542,9 +490,6 @@ done:
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Quincey Koziol
- * Friday, July 19, 2013
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -592,9 +537,6 @@ done:
* Failure: NULL, including when the file has no
* properties.
*
- * Programmer: Robb Matzke
- * Friday, August 13, 1999
- *
*-------------------------------------------------------------------------
*/
void *
@@ -622,9 +564,6 @@ done:
* Return: Success: non-negative
* Failure: negative
*
- * Programmer: Robb Matzke
- * Tuesday, August 3, 1999
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -706,11 +645,6 @@ done:
*
* Failure: NULL
*
- * Programmer: Robb Matzke
- * Tuesday, July 27, 1999
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
H5FD_t *
@@ -745,16 +679,6 @@ done:
*
* Failure: NULL
*
- * Programmer: Robb Matzke
- * Wednesday, August 4, 1999
- *
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
- *
*-------------------------------------------------------------------------
*/
H5FD_t *
@@ -861,9 +785,6 @@ done:
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Robb Matzke
- * Tuesday, July 27, 1999
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -893,9 +814,6 @@ done:
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Robb Matzke
- * Wednesday, August 4, 1999
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -944,11 +862,6 @@ done:
* comparison callback then the file pointers
* themselves are compared.
*
- * Programmer: Robb Matzke
- * Tuesday, July 27, 1999
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -975,11 +888,6 @@ done:
*
* Failure: Must never fail.
*
- * Programmer: Robb Matzke
- * Wednesday, August 4, 1999
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -1025,11 +933,6 @@ done:
*
* Failure: negative
*
- * Programmer: Quincey Koziol
- * Friday, August 25, 2000
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -1059,9 +962,6 @@ done:
*
* Failure: negative
*
- * Programmer: Quincey Koziol
- * Friday, August 25, 2000
- *
*-------------------------------------------------------------------------
*/
static int
@@ -1118,9 +1018,6 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/)
*
* Failure: The undefined address HADDR_UNDEF
*
- * Programmer: Robb Matzke
- * Tuesday, July 27, 1999
- *
*-------------------------------------------------------------------------
*/
haddr_t
@@ -1170,11 +1067,6 @@ done:
*
* Failure: Negative
*
- * Programmer: Robb Matzke
- * Wednesday, July 28, 1999
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1207,16 +1099,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FDget_eoa
- *
- * Purpose: Returns the address of the first byte after the last
- * allocated memory in the file.
+ * Function: H5FDget_eoa
*
- * Return: Success: First byte after allocated memory.
- * Failure: HADDR_UNDEF
+ * Purpose: Returns the address of the first byte after the last
+ * allocated memory in the file.
*
- * Programmer: Robb Matzke
- * Friday, July 30, 1999
+ * Return: Success: First byte after allocated memory.
+ * Failure: HADDR_UNDEF
*
*-------------------------------------------------------------------------
*/
@@ -1230,13 +1119,13 @@ H5FDget_eoa(H5FD_t *file, H5FD_mem_t type)
/* Check args */
if(!file || !file->cls)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer")
if(type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file type")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file type")
/* The real work */
if(HADDR_UNDEF == (ret_value = H5FD_get_eoa(file, type)))
- HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eoa request failed")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eoa request failed")
/* (Note compensating for base address subtraction in internal routine) */
ret_value += file->base_addr;
@@ -1265,9 +1154,6 @@ done:
* Return: Success: Non-negative
* Failure: Negative, no side effect
*
- * Programmer: Robb Matzke
- * Friday, July 30, 1999
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1280,16 +1166,16 @@ H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr)
/* Check args */
if(!file || !file->cls)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer")
if(type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file type")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file type")
if(!H5F_addr_defined(addr) || addr > file->maxaddr)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid end-of-address value")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid end-of-address value")
/* The real work */
/* (Note compensating for base address addition in internal routine) */
if(H5FD_set_eoa(file, type, addr - file->base_addr) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file set eoa request failed")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file set eoa request failed")
done:
FUNC_LEAVE_API(ret_value)
@@ -1315,11 +1201,6 @@ done:
*
* Failure: HADDR_UNDEF
*
- * Programmer: Robb Matzke
- * Thursday, July 29, 1999
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
haddr_t
@@ -1332,11 +1213,11 @@ H5FDget_eof(H5FD_t *file, H5FD_mem_t type)
/* Check arguments */
if(!file || !file->cls)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer")
/* The real work */
if(HADDR_UNDEF == (ret_value = H5FD_get_eof(file, type)))
- HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eof request failed")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eof request failed")
/* (Note compensating for base address subtraction in internal routine) */
ret_value += file->base_addr;
@@ -1354,9 +1235,6 @@ done:
* Return: Success: The maximum address allowed in the file.
* Failure: HADDR_UNDEF
*
- * Programmer: Quincey Koziol
- * Thursday, January 3, 2008
- *
*-------------------------------------------------------------------------
*/
haddr_t
@@ -1384,9 +1262,6 @@ done:
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Quincey Koziol
- * Tuesday, January 8, 2008
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1412,8 +1287,6 @@ H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags)
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Vailin Choi; Oct 2013
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1438,9 +1311,6 @@ H5FD_set_feature_flags(H5FD_t *file, unsigned long feature_flags)
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Quincey Koziol
- * Thursday, January 17, 2008
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1483,9 +1353,6 @@ done:
*
* Failure: Negative. The contents of BUF is undefined.
*
- * Programmer: Robb Matzke
- * Thursday, July 29, 1999
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1548,9 +1415,6 @@ done:
*
* Failure: Negative
*
- * Programmer: Robb Matzke
- * Thursday, July 29, 1999
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1613,10 +1477,6 @@ done:
* Programmer: Robb Matzke
* Thursday, July 29, 1999
*
- * Modifications:
- * Quincey Koziol, May 20, 2002
- * Added 'closing' parameter
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1653,9 +1513,6 @@ done:
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Robb Matzke
- * Wednesday, August 4, 1999
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1683,9 +1540,6 @@ done:
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Quincey Koziol
- * Thursday, January 31, 2008
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1722,9 +1576,6 @@ done:
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Quincey Koziol
- * Thursday, January 31, 2008
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1752,8 +1603,6 @@ done:
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Vailin Choi; March 2015
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1786,8 +1635,6 @@ done:
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Vailin Choi; May 2013
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1815,8 +1662,6 @@ done:
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Vailin Choi; March 2015
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1848,8 +1693,6 @@ done:
* Return: Success: Non-negative
* Failure: Negative
*
- * Programmer: Vailin Choi; May 2013
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1878,9 +1721,6 @@ done:
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
- * March 27, 2002
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1909,8 +1749,6 @@ H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum)
* Programmer: Raymond Lu
* Sep. 16, 2002
*
- * Modifications:
- *
*--------------------------------------------------------------------------
*/
herr_t
@@ -1972,9 +1810,6 @@ done:
*
* Return: Non-negative if succeed; negative if fails.
*
- * Programmer: Quincey Koziol
- * Jan. 17, 2008
- *
*--------------------------------------------------------------------------
*/
herr_t
@@ -2000,9 +1835,6 @@ H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr)
* Return: Success: The absolute base address of the file
* Failure: The undefined address (HADDR_UNDEF)
*
- * Programmer: Quincey Koziol
- * Sept. 10, 2009
- *
*--------------------------------------------------------------------------
*/
haddr_t
@@ -2024,8 +1856,6 @@ H5FD_get_base_addr(const H5FD_t *file)
*
* Return: Non-negative if succeed; negative if fails.
*
- * Programmer: Vailin Choi; April 2013
- *
*--------------------------------------------------------------------------
*/
herr_t
@@ -2052,9 +1882,6 @@ H5FD_set_paged_aggr(H5FD_t *file, hbool_t paged)
*
* Return: SUCCEED/FAIL
*
-* Programmer: Jacob Gruber
-* Wednesday, August 17, 2011
-*
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h
index 896f82f..831874b 100644
--- a/src/H5Ipublic.h
+++ b/src/H5Ipublic.h
@@ -28,26 +28,26 @@
* fail otherwise).
*
* When adding types here, add a section to the 'misc19' test in test/tmisc.c
- * to verify that the H5I{inc|dec|get}_ref() routines work correctly with in.
+ * to verify that the H5I{inc|dec|get}_ref() routines work correctly with it.
*
*/
typedef enum H5I_type_t {
- H5I_UNINIT = (-2), /*uninitialized type */
- H5I_BADID = (-1), /*invalid Type */
- H5I_FILE = 1, /*type ID for File objects */
- H5I_GROUP, /*type ID for Group objects */
- H5I_DATATYPE, /*type ID for Datatype objects */
- H5I_DATASPACE, /*type ID for Dataspace objects */
- H5I_DATASET, /*type ID for Dataset objects */
- H5I_ATTR, /*type ID for Attribute objects */
- H5I_REFERENCE, /*type ID for Reference objects */
- H5I_VFL, /*type ID for virtual file layer */
- H5I_GENPROP_CLS, /*type ID for generic property list classes */
- H5I_GENPROP_LST, /*type ID for generic property lists */
- H5I_ERROR_CLASS, /*type ID for error classes */
- H5I_ERROR_MSG, /*type ID for error messages */
- H5I_ERROR_STACK, /*type ID for error stacks */
- H5I_NTYPES /*number of library types, MUST BE LAST! */
+ H5I_UNINIT = (-2), /* uninitialized type */
+ H5I_BADID = (-1), /* invalid Type */
+ H5I_FILE = 1, /* type ID for File objects */
+ H5I_GROUP, /* type ID for Group objects */
+ H5I_DATATYPE, /* type ID for Datatype objects */
+ H5I_DATASPACE, /* type ID for Dataspace objects */
+ H5I_DATASET, /* type ID for Dataset objects */
+ H5I_ATTR, /* type ID for Attribute objects */
+ H5I_REFERENCE, /* type ID for Reference objects */
+ H5I_VFL, /* type ID for virtual file layer */
+ H5I_GENPROP_CLS, /* type ID for generic property list classes */
+ H5I_GENPROP_LST, /* type ID for generic property lists */
+ H5I_ERROR_CLASS, /* type ID for error classes */
+ H5I_ERROR_MSG, /* type ID for error messages */
+ H5I_ERROR_STACK, /* type ID for error stacks */
+ H5I_NTYPES /* number of library types, MUST BE LAST! */
} H5I_type_t;
/* Type of atoms to return to users */
diff --git a/test/h5test.c b/test/h5test.c
index 2d77dc8..1e1e290 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -104,6 +104,68 @@ static herr_t h5_errors(hid_t estack, void *client_data);
static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix,
char *fullname, size_t size, hbool_t nest_printf);
+
+
+/* A non-usable VFD class and its functions.
+ *
+ * Usable for testing things like ID handling where we shouldn't mess with the real VFDs.
+ */
+static H5FD_t *dummy_vfd_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
+static H5FD_t *dummy_vfd_open(const char H5_ATTR_UNUSED *name, unsigned H5_ATTR_UNUSED flags, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED maxaddr) { return NULL; }
+
+static herr_t dummy_vfd_close(H5FD_t *_file);
+static herr_t dummy_vfd_close(H5FD_t H5_ATTR_UNUSED *_file) { return FAIL; }
+
+static haddr_t dummy_vfd_get_eoa(const H5FD_t *file, H5FD_mem_t type);
+static haddr_t dummy_vfd_get_eoa(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; }
+
+static herr_t dummy_vfd_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static herr_t dummy_vfd_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t H5_ATTR_UNUSED addr) { return FAIL; }
+
+static haddr_t dummy_vfd_get_eof(const H5FD_t *file, H5FD_mem_t type);
+static haddr_t dummy_vfd_get_eof(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; }
+
+static herr_t dummy_vfd_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf);
+static herr_t dummy_vfd_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf) { return FAIL; }
+
+static herr_t dummy_vfd_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf);
+static herr_t dummy_vfd_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf) { return FAIL; }
+
+static H5FD_class_t dummy_vfd_class_g = {
+ "fake", /* name */
+ 1, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ NULL, /* terminate */
+ NULL, /* sb_size */
+ NULL, /* sb_encode */
+ NULL, /* sb_decode */
+ 0, /* fapl_size */
+ NULL, /* fapl_get */
+ NULL, /* fapl_copy */
+ NULL, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ dummy_vfd_open, /* open */
+ dummy_vfd_close, /* close */
+ NULL, /* cmp */
+ NULL, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ dummy_vfd_get_eoa, /* get_eoa */
+ dummy_vfd_set_eoa, /* set_eoa */
+ dummy_vfd_get_eof, /* get_eof */
+ NULL, /* get_handle */
+ dummy_vfd_read, /* read */
+ dummy_vfd_write, /* write */
+ NULL, /* flush */
+ NULL, /* truncate */
+ NULL, /* lock */
+ NULL, /* unlock */
+ H5FD_FLMAP_DEFAULT /* fl_map */
+};
+
/*-------------------------------------------------------------------------
* Function: h5_errors
@@ -1828,3 +1890,41 @@ error:
return FAIL;
} /* h5_wait_message() */
+/*-------------------------------------------------------------------------
+ * Function: h5_get_dummy_vfd_class()
+ *
+ * Purpose: Returns a disposable, generally non-functional,
+ * VFD class struct.
+ *
+ * In some of the test code, we need a disposable VFD but
+ * we don't want to mess with the real VFDs and we also
+ * don't have access to the internals of the real VFDs (which
+ * use static globals and functions) to easily duplicate
+ * them (e.g.: for testing VFD ID handling).
+ *
+ * This API call will return a pointer to a VFD class that
+ * can be used to construct a test VFD using H5FDregister().
+ *
+ * Return: Success: A pointer to a VFD class struct
+ * Failure: NULL
+ *
+ *-------------------------------------------------------------------------
+ */
+H5FD_class_t *
+h5_get_dummy_vfd_class(void)
+{
+ H5FD_class_t *vfd_class = NULL;
+
+ if(NULL == (vfd_class = (H5FD_class_t *)HDmalloc(sizeof(H5FD_class_t))))
+ TEST_ERROR;
+
+ HDmemcpy(vfd_class, &dummy_vfd_class_g, sizeof(H5FD_class_t));
+
+ return vfd_class;
+
+error:
+ if(vfd_class)
+ HDfree(vfd_class);
+ return NULL;
+} /* h5_get_dummy_vfd_class */
+
diff --git a/test/h5test.h b/test/h5test.h
index 0e23255..ce5c64d 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -136,6 +136,7 @@ H5TEST_DLL h5_stat_size_t h5_get_file_size(const char *filename, hid_t fapl);
H5TEST_DLL int print_func(const char *format, ...);
H5TEST_DLL int h5_make_local_copy(const char *origfilename, const char *local_copy_name);
H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl);
+H5TEST_DLL H5FD_class_t *h5_get_dummy_vfd_class(void);
/* Functions that will replace VFD-dependent functions that violate
* the single responsibility principle. Unlike their predecessors,
diff --git a/test/tmisc.c b/test/tmisc.c
index dc69e18..bec80b2 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -29,7 +29,7 @@
#include "hdf5.h"
#include "testhdf5.h"
#include "H5srcdir.h"
-#include "H5Dpkg.h" /* Datasets */
+#include "H5Dpkg.h" /* Datasets */
/* Definitions for misc. test #1 */
#define MISC1_FILE "tmisc1.h5"
@@ -2984,19 +2984,21 @@ test_misc18(void)
static void
test_misc19(void)
{
- hid_t fid; /* File ID */
- hid_t sid; /* 'Space ID */
- hid_t did; /* Dataset ID */
- hid_t tid; /* 'Type ID */
- hid_t aid; /* Attribute ID */
- hid_t plid; /* Property List ID */
- hid_t pcid; /* Property Class ID */
- hid_t gid; /* Group ID */
- hid_t ecid; /* Error Class ID */
- hid_t emid; /* Error Message ID */
- hid_t esid; /* Error Stack ID */
- int rc; /* Reference count */
- herr_t ret; /* Generic return value */
+ hid_t fid = -1; /* File ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t did = -1; /* Dataset ID */
+ hid_t tid = -1; /* Datatype ID */
+ hid_t aid = -1; /* Attribute ID */
+ hid_t plid = -1; /* Property List ID */
+ hid_t pcid = -1; /* Property Class ID */
+ hid_t gid = -1; /* Group ID */
+ hid_t ecid = -1; /* Error Class ID */
+ hid_t emid = -1; /* Error Message ID */
+ hid_t esid = -1; /* Error Stack ID */
+ hid_t vfdid = -1; /* Virtual File Driver ID */
+ H5FD_class_t *vfd_cls = NULL; /* VFD class */
+ int rc; /* Reference count */
+ herr_t ret; /* Generic return value */
/* Check H5I operations on files */
@@ -3406,6 +3408,45 @@ test_misc19(void)
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Eclose_stack");
+
+/* Check H5I operations on virtual file drivers */
+
+ /* Get a VFD class to register */
+ vfd_cls = h5_get_dummy_vfd_class();
+ CHECK(vfd_cls, NULL, "h5_get_dummy_vfd_class");
+
+ /* Register a virtual file driver */
+ vfdid = H5FDregister(vfd_cls);
+ CHECK(vfdid, FAIL, "H5FDregister");
+
+ /* Check the reference count */
+ rc = H5Iget_ref(vfdid);
+ VERIFY(rc, 1, "H5Iget_ref");
+
+ /* Increment the reference count */
+ rc = H5Iinc_ref(vfdid);
+ VERIFY(rc, 2, "H5Iinc_ref");
+
+ /* Unregister the VFD normally */
+ ret = H5FDunregister(vfdid);
+ CHECK(ret, FAIL, "H5FDunregister");
+
+ /* Check the reference count */
+ rc = H5Iget_ref(vfdid);
+ VERIFY(rc, 1, "H5Iget_ref");
+
+ /* Unregister the VFD by decrementing the reference count */
+ rc = H5Idec_ref(vfdid);
+ VERIFY(rc, 0, "H5Idec_ref");
+
+ /* Try unregistering the VFD again (should fail) */
+ H5E_BEGIN_TRY {
+ ret = H5FDunregister(vfdid);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5FDunregister");
+
+ HDfree(vfd_cls);
+
} /* end test_misc19() */
/****************************************************************