Skip to content

Commit

Permalink
H5FDquery return value (#4530)
Browse files Browse the repository at this point in the history
* Switch H5FDquery() return values to use library's FAIL / SUCCEED macros

* Update return value also
  • Loading branch information
qkoziol authored May 31, 2024
1 parent 421f935 commit fd6d4cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions src/H5FD.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,33 +955,32 @@ H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2)
*
* Purpose: Query a VFL driver for its feature flags. (listed in H5FDpublic.h)
*
* Return: Success: 0
* Failure: -1
* Return: Non-negative on success/Negative on failure
*
*-------------------------------------------------------------------------
*/
int
herr_t
H5FDquery(const H5FD_t *file, unsigned long *flags /*out*/)
{
int ret_value = 0;
herr_t ret_value = SUCCEED; /* Return value */

FUNC_ENTER_API((-1))
FUNC_ENTER_API(FAIL)

/* Check arguments */
if (!file)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "file pointer cannot be NULL");
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file pointer cannot be NULL");
if (!file->cls)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "file class pointer cannot be NULL");
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file class pointer cannot be NULL");
if (!flags)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "flags parameter cannot be NULL");
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "flags parameter cannot be NULL");

/* Call private function */
if (H5FD__query(file, flags) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, (-1), "unable to query feature flags");
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "unable to query feature flags");

done:
FUNC_LEAVE_API(ret_value)
}
} /* end H5FDquery() */

/*-------------------------------------------------------------------------
* Function: H5FD_query
Expand Down
2 changes: 1 addition & 1 deletion src/H5FDdevelop.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ H5_DLL herr_t H5FDunregister(hid_t driver_id);
H5_DLL H5FD_t *H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
H5_DLL herr_t H5FDclose(H5FD_t *file);
H5_DLL int H5FDcmp(const H5FD_t *f1, const H5FD_t *f2);
H5_DLL int H5FDquery(const H5FD_t *f, unsigned long *flags);
H5_DLL herr_t H5FDquery(const H5FD_t *f, unsigned long *flags);
H5_DLL haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
H5_DLL herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size);
H5_DLL haddr_t H5FDget_eoa(H5FD_t *file, H5FD_mem_t type);
Expand Down

0 comments on commit fd6d4cd

Please sign in to comment.