diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2002-08-08 16:52:55 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2002-08-08 16:52:55 (GMT) |
commit | d8397a6f426227d09d20e647ce8b12b8c6295b2d (patch) | |
tree | 2943fbfd2bfb66cf167eb642835fdb4deb3afd3c /src/H5Eprivate.h | |
parent | 573307786a1f5f7ce597e5191ea08c3bbd95b66c (diff) | |
download | hdf5-d8397a6f426227d09d20e647ce8b12b8c6295b2d.zip hdf5-d8397a6f426227d09d20e647ce8b12b8c6295b2d.tar.gz hdf5-d8397a6f426227d09d20e647ce8b12b8c6295b2d.tar.bz2 |
[svn-r5842] Purpose:
Code cleanup
Description:
Change most (all?) HRETURN_ERROR macros to HGOTO_ERROR macros, along with
HRETURN macros to HGOTO_DONE macros. This unifies the error return path
from functions and reduces the size of the library by up to 10% on some
platforms.
Additionally, I improved a lot of the error cleanup code in many routines.
Platforms tested:
FreeBSD 4.6 (sleipnir) serial & parallel and IRIX64 6.5 (modi4) serial &
parallel.
Diffstat (limited to 'src/H5Eprivate.h')
-rw-r--r-- | src/H5Eprivate.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index d6466b7..424456e 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -51,6 +51,18 @@ } /* + * HDONE_ERROR macro, used to facilitate error reporting between a + * FUNC_ENTER() and a FUNC_LEAVE() within a function body, but _AFTER_ the + * "done:" label. The arguments are + * the major error number, the minor error number, a return value, and a + * description of the error. + */ +#define HDONE_ERROR(maj, min, ret_val, str) { \ + HCOMMON_ERROR (maj, min, str); \ + ret_value = ret_val; \ +} + +/* * HRETURN macro, used to facilitate returning from a function between a * FUNC_ENTER() and a FUNC_LEAVE() within a function body. The argument is * the return value. @@ -128,6 +140,10 @@ extern int H5E_mpi_error_str_len; MPI_Error_string(mpierr, H5E_mpi_error_str, &H5E_mpi_error_str_len); \ HERROR(H5E_INTERNAL, H5E_MPIERRSTR, H5E_mpi_error_str); \ } +#define HMPI_DONE_ERROR(retcode, str, mpierr){ \ + HMPI_ERROR(mpierr); \ + HDONE_ERROR(H5E_INTERNAL, H5E_MPI, retcode, str); \ +} #define HMPI_GOTO_ERROR(retcode, str, mpierr){ \ HMPI_ERROR(mpierr); \ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, retcode, str); \ |