summaryrefslogtreecommitdiffstats
path: root/src/H5FD.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-02-09 03:13:27 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-02-09 03:13:27 (GMT)
commit9c9ee2008c10801c11bce8563894d9a30ba9a959 (patch)
treec2b89df08fa3895d3fae1a4ad87353f9aabee598 /src/H5FD.c
parenteb0e5f8c4ea29e674c97a8be048814e26379d4c1 (diff)
downloadhdf5-9c9ee2008c10801c11bce8563894d9a30ba9a959.zip
hdf5-9c9ee2008c10801c11bce8563894d9a30ba9a959.tar.gz
hdf5-9c9ee2008c10801c11bce8563894d9a30ba9a959.tar.bz2
[svn-r21919] Description:
Refactor function name macros and simplify the FUNC_ENTER macros, to clear away the cruft and prepare for further cleanups. Tested on: Mac OSX/64 10.7.3 (amazon) w/debug, production & parallel
Diffstat (limited to 'src/H5FD.c')
-rw-r--r--src/H5FD.c111
1 files changed, 50 insertions, 61 deletions
diff --git a/src/H5FD.c b/src/H5FD.c
index 6c2a024..66fa3b9 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -118,7 +118,7 @@ H5FD_init(void)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_init, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/* FUNC_ENTER() does all the work */
done:
@@ -147,7 +147,7 @@ H5FD_init_interface(void)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5FD_init_interface)
+ FUNC_ENTER_NOAPI_NOINIT
if(H5I_register_type(H5I_VFL, (size_t)H5I_VFL_HASHSIZE, 0, (H5I_free_t)H5FD_free_cls)<H5I_FILE)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize interface")
@@ -185,7 +185,7 @@ H5FD_term_interface(void)
{
int n = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_term_interface)
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
if(H5_interface_initialize_g) {
if((n=H5I_nmembers(H5I_VFL))!=0) {
@@ -223,7 +223,7 @@ H5FD_free_cls(H5FD_class_t *cls)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT(H5FD_free_cls)
+ FUNC_ENTER_NOAPI_NOINIT
/* Sanity check */
HDassert(cls);
@@ -272,7 +272,7 @@ H5FDregister(const H5FD_class_t *cls)
hid_t ret_value;
H5FD_mem_t type;
- FUNC_ENTER_API(H5FDregister, FAIL)
+ FUNC_ENTER_API(FAIL)
H5TRACE1("i", "*x", cls);
/* Check arguments */
@@ -334,7 +334,7 @@ H5FD_register(const void *_cls, size_t size, hbool_t app_ref)
H5FD_mem_t type;
hid_t ret_value;
- FUNC_ENTER_NOAPI(H5FD_register, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/* Check arguments */
HDassert(cls);
@@ -385,7 +385,7 @@ H5FDunregister(hid_t driver_id)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_API(H5FDunregister, FAIL)
+ FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", driver_id);
/* Check arguments */
@@ -426,7 +426,7 @@ H5FD_get_class(hid_t id)
{
H5FD_class_t *ret_value = NULL;
- FUNC_ENTER_NOAPI(H5FD_get_class, NULL)
+ FUNC_ENTER_NOAPI(NULL)
if(H5I_VFL == H5I_get_type(id))
ret_value = (H5FD_class_t *)H5I_object(id);
@@ -479,7 +479,7 @@ H5FD_sb_size(H5FD_t *file)
{
hsize_t ret_value=0;
- FUNC_ENTER_NOAPI(H5FD_sb_size, 0)
+ FUNC_ENTER_NOAPI(0)
assert(file && file->cls);
@@ -517,7 +517,7 @@ H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf)
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_sb_encode, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
assert(file && file->cls);
if(file->cls->sb_encode &&
@@ -547,7 +547,7 @@ H5FD_sb_decode(H5FD_t *file, const char *name, const uint8_t *buf)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_sb_decode, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(file && file->cls);
if(file->cls->sb_decode && (file->cls->sb_decode)(file, name, buf) < 0)
@@ -584,7 +584,7 @@ H5FD_pl_copy(void *(*copy_func)(const void *), size_t pl_size, const void *old_p
void *new_pl = NULL; /* Copy of property list */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5FD_pl_copy)
+ FUNC_ENTER_NOAPI_NOINIT
/* Copy old pl, if one exists */
if(old_pl) {
@@ -629,7 +629,7 @@ H5FD_pl_close(hid_t driver_id, herr_t (*free_func)(void *), void *pl)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5FD_pl_close)
+ FUNC_ENTER_NOAPI_NOINIT
/* Allow driver to free or do it ourselves */
if(pl && free_func) {
@@ -679,7 +679,7 @@ H5FD_fapl_get(H5FD_t *file)
{
void *ret_value=NULL;
- FUNC_ENTER_NOAPI(H5FD_fapl_get, NULL)
+ FUNC_ENTER_NOAPI(NULL)
assert(file);
@@ -713,7 +713,7 @@ H5FD_fapl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info)
void *copied_driver_info = NULL; /* Temporary VFL driver info */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_fapl_open, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/* Increment the reference count on driver and copy driver info */
if(H5I_inc_ref(driver_id, FALSE) < 0)
@@ -760,7 +760,7 @@ H5FD_fapl_copy(hid_t driver_id, const void *old_fapl, void **copied_fapl)
H5FD_class_t *driver;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_fapl_copy, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/* Check args */
if(NULL == (driver = (H5FD_class_t *)H5I_object(driver_id)))
@@ -796,7 +796,7 @@ H5FD_fapl_close(hid_t driver_id, void *fapl)
H5FD_class_t *driver = NULL;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_fapl_close, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/* Check args */
if(driver_id > 0) {
@@ -835,7 +835,7 @@ H5FD_dxpl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info)
void *copied_driver_info = NULL; /* Temporary VFL driver info */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_dxpl_open, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/* Increment the reference count on the driver and copy the driver info */
if(H5I_inc_ref(driver_id, FALSE) < 0)
@@ -881,7 +881,7 @@ H5FD_dxpl_copy(hid_t driver_id, const void *old_dxpl, void **copied_dxpl)
H5FD_class_t *driver;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_dxpl_copy, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/* Check args */
if(NULL == (driver = (H5FD_class_t *)H5I_object(driver_id)))
@@ -917,7 +917,7 @@ H5FD_dxpl_close(hid_t driver_id, void *dxpl)
H5FD_class_t *driver;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_dxpl_close, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/* Check args */
if(driver_id > 0) {
@@ -994,7 +994,7 @@ H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
H5FD_t *ret_value=NULL;
- FUNC_ENTER_API(H5FDopen, NULL)
+ FUNC_ENTER_API(NULL)
/* Check arguments */
if(H5P_DEFAULT == fapl_id)
@@ -1041,7 +1041,7 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
H5P_genplist_t *plist; /* Property list pointer */
H5FD_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_open, NULL)
+ FUNC_ENTER_NOAPI(NULL)
/* Sanity check */
if(0 == maxaddr)
@@ -1127,7 +1127,7 @@ H5FDclose(H5FD_t *file)
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5FDclose, FAIL)
+ FUNC_ENTER_API(FAIL)
H5TRACE1("e", "*x", file);
if(!file || !file->cls)
@@ -1160,7 +1160,7 @@ H5FD_close(H5FD_t *file)
const H5FD_class_t *driver;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_close, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/* check args */
HDassert(file && file->cls);
@@ -1212,7 +1212,7 @@ H5FDcmp(const H5FD_t *f1, const H5FD_t *f2)
{
int ret_value;
- FUNC_ENTER_API(H5FDcmp, -1) /*return value is arbitrary*/
+ FUNC_ENTER_API(-1) /*return value is arbitrary*/
H5TRACE2("Is", "*x*x", f1, f2);
ret_value = H5FD_cmp(f1, f2);
@@ -1243,7 +1243,7 @@ H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2)
{
int ret_value;
- FUNC_ENTER_NOAPI(H5FD_cmp, -1) /*return value is arbitrary*/
+ FUNC_ENTER_NOAPI(-1) /*return value is arbitrary*/
if((!f1 || !f1->cls) && (!f2 || !f2->cls))
HGOTO_DONE(0)
@@ -1293,7 +1293,7 @@ H5FDquery(const H5FD_t *f, unsigned long *flags/*out*/)
{
int ret_value;
- FUNC_ENTER_API(H5FDquery, FAIL)
+ FUNC_ENTER_API(FAIL)
H5TRACE2("Is", "*xx", f, flags);
assert(f);
@@ -1327,7 +1327,7 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/)
{
int ret_value=0;
- FUNC_ENTER_NOAPI(H5FD_query, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
assert(f);
assert(flags);
@@ -1387,7 +1387,7 @@ H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
{
haddr_t ret_value = HADDR_UNDEF;
- FUNC_ENTER_API(H5FDalloc, HADDR_UNDEF)
+ FUNC_ENTER_API(HADDR_UNDEF)
H5TRACE4("a", "*xMtih", file, type, dxpl_id, size);
/* Check args */
@@ -1441,7 +1441,7 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5FDfree, FAIL)
+ FUNC_ENTER_API(FAIL)
H5TRACE5("e", "*xMtiah", file, type, dxpl_id, addr, size);
/* Check args */
@@ -1484,7 +1484,7 @@ H5FDget_eoa(H5FD_t *file, H5FD_mem_t type)
{
haddr_t ret_value;
- FUNC_ENTER_API(H5FDget_eoa, HADDR_UNDEF)
+ FUNC_ENTER_API(HADDR_UNDEF)
H5TRACE2("a", "*xMt", file, type);
/* Check args */
@@ -1534,7 +1534,7 @@ H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_API(H5FDset_eoa, FAIL)
+ FUNC_ENTER_API(FAIL)
H5TRACE3("e", "*xMta", file, type, addr);
/* Check args */
@@ -1586,7 +1586,7 @@ H5FDget_eof(H5FD_t *file)
{
haddr_t ret_value;
- FUNC_ENTER_API(H5FDget_eof, HADDR_UNDEF)
+ FUNC_ENTER_API(HADDR_UNDEF)
H5TRACE1("a", "*x", file);
/* Check arguments */
@@ -1623,7 +1623,7 @@ H5FD_get_maxaddr(const H5FD_t *file)
{
haddr_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_get_maxaddr, HADDR_UNDEF)
+ FUNC_ENTER_NOAPI(HADDR_UNDEF)
HDassert(file);
@@ -1651,7 +1651,7 @@ done:
herr_t
H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_get_feature_flags)
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
HDassert(file);
HDassert(feature_flags);
@@ -1681,7 +1681,7 @@ H5FD_get_fs_type_map(const H5FD_t *file, H5FD_mem_t *type_map)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_get_fs_type_map, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(file && file->cls);
@@ -1729,7 +1729,7 @@ H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_API(H5FDread, FAIL)
+ FUNC_ENTER_API(FAIL)
H5TRACE6("e", "*xMtiazx", file, type, dxpl_id, addr, size, buf);
/* Check args */
@@ -1780,7 +1780,7 @@ H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_API(H5FDwrite, FAIL)
+ FUNC_ENTER_API(FAIL)
H5TRACE6("e", "*xMtiaz*x", file, type, dxpl_id, addr, size, buf);
/* Check args */
@@ -1829,7 +1829,7 @@ H5FDflush(H5FD_t *file, hid_t dxpl_id, unsigned closing)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_API(H5FDflush, FAIL)
+ FUNC_ENTER_API(FAIL)
H5TRACE3("e", "*xiIu", file, dxpl_id, closing);
/* Check args */
@@ -1868,7 +1868,7 @@ H5FD_flush(H5FD_t *file, hid_t dxpl_id, unsigned closing)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_flush, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(file && file->cls);
@@ -1898,7 +1898,7 @@ H5FDtruncate(H5FD_t *file, hid_t dxpl_id, unsigned closing)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_API(H5FDtruncate, FAIL)
+ FUNC_ENTER_API(FAIL)
H5TRACE3("e", "*xiIu", file, dxpl_id, closing);
/* Check args */
@@ -1937,7 +1937,7 @@ H5FD_truncate(H5FD_t *file, hid_t dxpl_id, unsigned closing)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_truncate, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(file && file->cls);
@@ -1966,9 +1966,7 @@ done:
herr_t
H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum)
{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5FD_get_fileno, FAIL)
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
HDassert(file);
HDassert(filenum);
@@ -1976,8 +1974,7 @@ H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum)
/* Retrieve the file's serial number */
*filenum = file->fileno;
-done:
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_get_fileno() */
@@ -2001,7 +1998,7 @@ H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void **file_handle)
{
herr_t ret_value;
- FUNC_ENTER_API(H5FDget_vfd_handle, FAIL)
+ FUNC_ENTER_API(FAIL)
H5TRACE3("e", "*xi**x", file, fapl, file_handle);
/* Check arguments */
@@ -2032,7 +2029,7 @@ H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void **file_handle)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_get_vfd_handle, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(file);
@@ -2063,9 +2060,7 @@ done:
herr_t
H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr)
{
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI(H5FD_set_base_addr, FAIL)
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
HDassert(file);
HDassert(H5F_addr_defined(base_addr));
@@ -2073,8 +2068,7 @@ H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr)
/* Set the file's base address */
file->base_addr = base_addr;
-done:
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_set_base_addr() */
@@ -2094,16 +2088,11 @@ done:
haddr_t
H5FD_get_base_addr(const H5FD_t *file)
{
- haddr_t ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(H5FD_get_base_addr, HADDR_UNDEF)
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
HDassert(file);
/* Return the file's base address */
- ret_value = file->base_addr;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(file->base_addr)
} /* end H5FD_get_base_addr() */