diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-10-28 22:34:51 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2020-10-29 06:50:37 (GMT) |
commit | 2266ee56c38685910e9cb7517307448bc8f68a23 (patch) | |
tree | ea61d7367f8ef92a493af2874f843453e6bbc858 /src/H5FDdirect.c | |
parent | 313a8c8546b3b975fba722b015c8c8269dd240cb (diff) | |
download | hdf5-2266ee56c38685910e9cb7517307448bc8f68a23.zip hdf5-2266ee56c38685910e9cb7517307448bc8f68a23.tar.gz hdf5-2266ee56c38685910e9cb7517307448bc8f68a23.tar.bz2 |
Fixes minor issues in various virtual file drivers
- HDFS VFD files now ignored in the Autotools when the HDFS VFD is not
being built.
- All VFD init code uses idiomatic H5I_INVALID_HID instead of -1
or FAIL.
- The HDFS VFD now includes H5FDdrvr_module.h in the right place.
- The HDFS tests in test/hdfs.c no longer pass NULL to VERIFY macros, which
raised warnings.
- Minor tweaks to fix const, unused variables, etc. warnings in
several VFDs.
Diffstat (limited to 'src/H5FDdirect.c')
-rw-r--r-- | src/H5FDdirect.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index ac7720f..4c2d251 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -384,14 +384,13 @@ static void * H5FD__direct_fapl_get(H5FD_t *_file) { H5FD_direct_t *file = (H5FD_direct_t *)_file; - void * ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ - FUNC_ENTER_STATIC + FUNC_ENTER_STATIC_NOERR /* Set return value */ ret_value = H5FD__direct_fapl_copy(&(file->fa)); -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD__direct_fapl_get() */ @@ -447,7 +446,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad int o_flags; int fd = (-1); H5FD_direct_t * file = NULL; - H5FD_direct_fapl_t *fa; + const H5FD_direct_fapl_t *fa; #ifdef H5_HAVE_WIN32_API HFILE filehandle; struct _BY_HANDLE_FILE_INFORMATION fileinfo; @@ -496,7 +495,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad /* Get the driver specific information */ if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") - if (NULL == (fa = (H5FD_direct_fapl_t *)H5P_peek_driver_info(plist))) + if (NULL == (fa = (const H5FD_direct_fapl_t *)H5P_peek_driver_info(plist))) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "bad VFL driver info") file->fd = fd; @@ -546,7 +545,8 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad } else { file->fa.must_align = FALSE; - HDftruncate(file->fd, (HDoff_t)0); + if (-1 == HDftruncate(file->fd, (HDoff_t)0)) + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to truncate file") } } else { @@ -793,7 +793,7 @@ 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_STATIC + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eof) } |