summaryrefslogtreecommitdiffstats
path: root/src/H5E.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-08-08 16:52:55 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-08-08 16:52:55 (GMT)
commitd8397a6f426227d09d20e647ce8b12b8c6295b2d (patch)
tree2943fbfd2bfb66cf167eb642835fdb4deb3afd3c /src/H5E.c
parent573307786a1f5f7ce597e5191ea08c3bbd95b66c (diff)
downloadhdf5-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/H5E.c')
-rw-r--r--src/H5E.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/H5E.c b/src/H5E.c
index aa3201e..4067b40 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -533,6 +533,7 @@ const char *
H5Eget_major (H5E_major_t n)
{
unsigned i;
+ const char *ret_value="Invalid major error number";
/*
* WARNING: Do not call the FUNC_ENTER() or FUNC_LEAVE() macros since
@@ -545,10 +546,11 @@ H5Eget_major (H5E_major_t n)
for (i=0; i<NELMTS (H5E_major_mesg_g); i++) {
if (H5E_major_mesg_g[i].error_code==n)
- HRETURN(H5E_major_mesg_g[i].str);
+ HGOTO_DONE(H5E_major_mesg_g[i].str);
}
- FUNC_LEAVE("Invalid major error number");
+done:
+ FUNC_LEAVE(ret_value);
}
@@ -573,6 +575,7 @@ const char *
H5Eget_minor (H5E_minor_t n)
{
unsigned i;
+ const char *ret_value="Invalid minor error number";
/*
* WARNING: Do not call the FUNC_ENTER() or FUNC_LEAVE() macros since
@@ -585,10 +588,11 @@ H5Eget_minor (H5E_minor_t n)
for (i=0; i<NELMTS (H5E_minor_mesg_g); i++) {
if (H5E_minor_mesg_g[i].error_code==n)
- HRETURN(H5E_minor_mesg_g[i].str);
+ HGOTO_DONE(H5E_minor_mesg_g[i].str);
}
- FUNC_LEAVE("Invalid minor error number");
+done:
+ FUNC_LEAVE(ret_value);
}