Merge pull request #1422 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:vfd_init_cleanup to develop

* commit '07b76068a4517f874fc5584049178ed5f61e3cea':
  Cleaned up and normalized VFD init calls.
This commit is contained in:
Dana Robinson 2019-01-01 12:50:00 -06:00
commit d5f642b559
7 changed files with 52 additions and 62 deletions

View File

@ -420,8 +420,8 @@ done:
* Purpose: Initialize this driver by registering the driver with the
* library.
*
* Return: Success: The driver ID for the core driver.
* Failure: Negative.
* Return: Success: The driver ID for the core driver
* Failure: H5I_INVALID_HID
*
* Programmer: Robb Matzke
* Thursday, July 29, 1999
@ -433,7 +433,7 @@ H5FD_core_init(void)
{
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_CORE_g))
H5FD_CORE_g = H5FD_register(&H5FD_core_g, sizeof(H5FD_class_t), FALSE);

View File

@ -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() */
/*---------------------------------------------------------------------------

View File

@ -171,28 +171,25 @@ done:
/*-------------------------------------------------------------------------
* Function: H5FD_family_init
* Function: H5FD_family_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 family driver.
* Return: Success: The driver ID for the family driver
* Failure: H5I_INVALID_HID
*
* Failure: Negative
*
* Programmer: Robb Matzke
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
hid_t
H5FD_family_init(void)
{
hid_t ret_value = H5FD_FAMILY_g; /* 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_FAMILY_g))
H5FD_FAMILY_g = H5FD_register(&H5FD_family_g, sizeof(H5FD_class_t), FALSE);

View File

@ -252,8 +252,8 @@ done:
* Purpose: Initialize this driver by registering the driver with the
* library.
*
* Return: Success: The driver ID for the log driver.
* Failure: Negative.
* Return: Success: The driver ID for the log driver
* Failure: H5I_INVALID_HID
*
* Programmer: Robb Matzke
* Thursday, July 29, 1999
@ -265,7 +265,7 @@ H5FD_log_init(void)
{
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_LOG_g))
H5FD_LOG_g = H5FD_register(&H5FD_log_g, sizeof(H5FD_class_t), FALSE);

View File

@ -187,15 +187,15 @@ done:
/*-------------------------------------------------------------------------
* Function: H5FD_mpio_init
* Function: H5FD_mpio_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 mpio driver.
* Failure: Negative.
* Return: Success: The driver ID for the mpio driver
* Failure: H5I_INVALID_HID
*
* Programmer: Robb Matzke
* Programmer: Robb Matzke
* Thursday, August 5, 1999
*
*-------------------------------------------------------------------------
@ -206,10 +206,10 @@ H5FD_mpio_init(void)
#ifdef H5FDmpio_DEBUG
static int H5FD_mpio_Debug_inited = 0;
#endif /* H5FDmpio_DEBUG */
const char *s; /* String for environment variables */
hid_t ret_value; /* Return value */
const char *s; /* String for environment variables */
hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
FUNC_ENTER_NOAPI(H5I_INVALID_HID)
/* Register the MPI-IO VFD, if it isn't already */
if(H5I_VFL != H5I_get_type(H5FD_MPIO_g))
@ -217,8 +217,10 @@ H5FD_mpio_init(void)
/* Allow MPI buf-and-file-type optimizations? */
s = HDgetenv("HDF5_MPI_OPT_TYPES");
if(s && HDisdigit(*s))
H5FD_mpi_opt_types_g = (hbool_t)HDstrtol(s, NULL, 0);
if(s && HDisdigit(*s)) {
long env_val = HDstrtol(s, NULL, 0);
H5FD_mpi_opt_types_g = (0 == env_val) ? FALSE : TRUE;
}
#ifdef H5FDmpio_DEBUG
if(!H5FD_mpio_Debug_inited) {
@ -226,12 +228,12 @@ H5FD_mpio_init(void)
s = HDgetenv("H5FD_mpio_Debug");
if(s) {
/* Set debug mask */
while(*s) {
H5FD_mpio_Debug[(int)*s]++;
s++;
} /* end while */
while(*s) {
H5FD_mpio_Debug[(int)*s]++;
s++;
} /* end while */
} /* end if */
H5FD_mpio_Debug_inited++;
H5FD_mpio_Debug_inited++;
} /* end if */
#endif /* H5FDmpio_DEBUG */

View File

@ -26,11 +26,6 @@
#include <stdlib.h>
#include <string.h>
/* Disable certain warnings in PC-Lint: */
/*lint --emacro( {534, 830}, H5P_DEFAULT, H5P_FILE_ACCESS, H5P_DATASET_XFER) */
/*lint --emacro( {534, 830}, H5FD_MULTI) */
/*lint -esym( 534, H5Eclear2, H5Epush2) */
#include "hdf5.h"
@ -211,16 +206,15 @@ my_strdup(const char *s)
/*-------------------------------------------------------------------------
* Function: H5FD_multi_init
* Function: H5FD_multi_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 multi driver.
* Return: Success: The driver ID for the multi driver
* Failure: H5I_INVALID_HID
*
* Failure: Negative
*
* Programmer: Robb Matzke
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@ -231,11 +225,11 @@ H5FD_multi_init(void)
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
if(H5I_VFL!=H5Iget_type(H5FD_MULTI_g))
if(H5I_VFL != H5Iget_type(H5FD_MULTI_g))
H5FD_MULTI_g = H5FDregister(&H5FD_multi_g);
return H5FD_MULTI_g;
}
} /* end H5FD_multi_init() */
/*---------------------------------------------------------------------------

View File

@ -208,8 +208,8 @@ done:
* Purpose: Initialize this driver by registering the driver with the
* library.
*
* Return: Success: The driver ID for the sec2 driver.
* Failure: Negative
* Return: Success: The driver ID for the sec2 driver
* Failure: H5I_INVALID_HID
*
* Programmer: Robb Matzke
* Thursday, July 29, 1999
@ -221,7 +221,7 @@ H5FD_sec2_init(void)
{
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_SEC2_g))
H5FD_SEC2_g = H5FD_register(&H5FD_sec2_g, sizeof(H5FD_class_t), FALSE);