diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2002-05-28 18:17:12 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2002-05-28 18:17:12 (GMT) |
commit | ca912c389e4e641cfbae6facced950ad05578d65 (patch) | |
tree | 6bd8604f6a587ee07013ad40daa3c0c7f4b31c26 /src/H5Eprivate.h | |
parent | 893cf5899c2b724aa438b66a275967b1f5ad0342 (diff) | |
download | hdf5-ca912c389e4e641cfbae6facced950ad05578d65.zip hdf5-ca912c389e4e641cfbae6facced950ad05578d65.tar.gz hdf5-ca912c389e4e641cfbae6facced950ad05578d65.tar.bz2 |
[svn-r5467] Purpose:
Code cleanup.
Description:
Took Robb's recent ideas for improving the FUNC_ENTER/FUNC_LEAVE macros
equivalents in the SAF library and adapted them to our library. I added
an additional macro which is equivalent to FUNC_ENTER:
FUNC_ENTER_NOINIT - Has the API tracing code, etc. from FUNC_ENTER but
none of the library or interface initialization code. This is to
be used _only_ for static functions and those which explicitly
cannot have the library or interface initialization code enabled
(like the API termination routines, etc.).
This allowed many more of the functions in the library [but not all yet :-(]
to be wrapped with FUNC_ENTER[_NOINIT]/FUNC_LEAVE pairs.
It also reduced the size of the library and executables (by cutting out a
bunch of code which was never executed), I'll e-mail the exact results when
I've finished editing it.
Platforms tested:
IRIX64 6.5 (modi4)
Diffstat (limited to 'src/H5Eprivate.h')
-rw-r--r-- | src/H5Eprivate.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index c0f6fd2..d6466b7 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -31,16 +31,22 @@ #define HERROR(maj, min, str) H5E_push(maj, min, FUNC, __FILE__, __LINE__, str) /* + * HCOMMON_ERROR macro, used by HRETURN_ERROR and HGOTO_ERROR + * (Shouldn't need to be used outside this header file) + */ +#define HCOMMON_ERROR(maj, min, str) \ + HERROR (maj, min, str); \ + if (H5_IS_API(FUNC) && H5E_auto_g) \ + (H5E_auto_g)(H5E_auto_data_g) + +/* * HRETURN_ERROR macro, used to facilitate error reporting between a * FUNC_ENTER() and a FUNC_LEAVE() within a function body. The arguments are * the major error number, the minor error number, a return value, and a * description of the error. */ #define HRETURN_ERROR(maj, min, ret_val, str) { \ - HERROR (maj, min, str); \ - if (H5_IS_API(FUNC) && H5E_auto_g) { \ - (H5E_auto_g)(H5E_auto_data_g); \ - } \ + HCOMMON_ERROR (maj, min, str); \ HRETURN(ret_val); \ } @@ -52,8 +58,7 @@ #define HRETURN(ret_val) { \ PABLO_TRACE_OFF (PABLO_MASK, pablo_func_id); \ H5TRACE_RETURN(ret_val); \ - H5_API_UNLOCK_BEGIN \ - H5_API_UNLOCK_END \ + H5_API_UNLOCK \ H5_API_SET_CANCEL \ return (ret_val); \ } @@ -66,12 +71,8 @@ * control branches to the `done' label. */ #define HGOTO_ERROR(maj, min, ret_val, str) { \ - HERROR (maj, min, str); \ - if (H5_IS_API(FUNC) && H5E_auto_g) { \ - (H5E_auto_g)(H5E_auto_data_g); \ - } \ - ret_value = ret_val; \ - goto done; \ + HCOMMON_ERROR (maj, min, str); \ + HGOTO_DONE (ret_val); \ } /* |