summaryrefslogtreecommitdiffstats
path: root/src/H5FDdirect.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-05-28 19:54:36 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-05-28 19:54:36 (GMT)
commita67f73add8e9d8d40b71ad59434c00a606f9bec8 (patch)
tree941e98fffa2333c573978e1d740775314ae9981a /src/H5FDdirect.c
parent7deefc4211612d2f9753f5c8678f2c413ef0715e (diff)
downloadhdf5-a67f73add8e9d8d40b71ad59434c00a606f9bec8.zip
hdf5-a67f73add8e9d8d40b71ad59434c00a606f9bec8.tar.gz
hdf5-a67f73add8e9d8d40b71ad59434c00a606f9bec8.tar.bz2
Normalization with develop of the VFDs and H5F package.
Diffstat (limited to 'src/H5FDdirect.c')
-rw-r--r--src/H5FDdirect.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index ca1a11d..34c4346 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -206,30 +206,27 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_init
+ * Function: H5FD_direct_init
*
- * Purpose: Initialize this driver by registering the driver with the
- * library.
+ * Purpose: Initialize this driver by registering the driver with the
+ * library.
*
- * Return: Success: The driver ID for the direct driver.
- *
- * Failure: Negative.
+ * Return: Success: The driver ID for the direct driver
+ * Failure: H5I_INVALID_HID
*
* Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
hid_t
H5FD_direct_init(void)
{
- hid_t ret_value; /* Return value */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI(H5I_INVALID_HID)
- if (H5I_VFL!=H5I_get_type(H5FD_DIRECT_g))
+ if (H5I_VFL != H5I_get_type(H5FD_DIRECT_g))
H5FD_DIRECT_g = H5FD_register(&H5FD_direct_g,sizeof(H5FD_class_t),FALSE);
/* Set return value */
@@ -237,7 +234,7 @@ H5FD_direct_init(void)
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5FD_direct_init() */
/*---------------------------------------------------------------------------
@@ -291,6 +288,7 @@ H5Pset_fapl_direct(hid_t fapl_id, size_t boundary, size_t block_size, size_t cbu
if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
+ HDmemset(&fa, 0, sizeof(H5FD_direct_fapl_t));
if(boundary != 0)
fa.mboundary = boundary;
else
@@ -417,7 +415,7 @@ static void *
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_malloc(sizeof(H5FD_direct_fapl_t));
+ H5FD_direct_fapl_t *new_fa = H5MM_calloc(sizeof(H5FD_direct_fapl_t));
FUNC_ENTER_NOAPI_NOINIT_NOERR