summaryrefslogtreecommitdiffstats
path: root/src/H5RS.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-06-23 15:36:35 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-06-23 15:36:35 (GMT)
commit7c3df64cc4742c0316ca81aeef67bd95a5737c70 (patch)
treef6aa023c661a881b2495ea0be4e745b43eea091f /src/H5RS.c
parent19644d75931aaa79951830d85eda28de08f17180 (diff)
downloadhdf5-7c3df64cc4742c0316ca81aeef67bd95a5737c70.zip
hdf5-7c3df64cc4742c0316ca81aeef67bd95a5737c70.tar.gz
hdf5-7c3df64cc4742c0316ca81aeef67bd95a5737c70.tar.bz2
[svn-r8731] Purpose:
Code cleanup & minor optimization Description: Re-work the way interface initialization routines are specified in the library to avoid the overhead of checking for them in routines where there is no interface initialization routine. This cleans up warnings with gcc 3.4, reduces the library binary size a bit (about 2-3%) and should speedup the library's execution slightly. Platforms tested: FreeBSD 4.10 (sleipnir) w/gcc34 h5committest
Diffstat (limited to 'src/H5RS.c')
-rw-r--r--src/H5RS.c55
1 files changed, 15 insertions, 40 deletions
diff --git a/src/H5RS.c b/src/H5RS.c
index d55d725..1a7b332 100644
--- a/src/H5RS.c
+++ b/src/H5RS.c
@@ -19,16 +19,13 @@
*
*/
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free lists */
-#include "H5RSprivate.h" /* Reference-counted strings */
-
/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5RS_mask
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free lists */
+#include "H5RSprivate.h" /* Reference-counted strings */
/* Private typedefs & structs */
struct H5RS_str_t {
@@ -226,9 +223,7 @@ done:
herr_t
H5RS_decr(H5RS_str_t *rs)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5RS_decr,FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_decr);
/* Sanity check */
assert(rs);
@@ -241,8 +236,7 @@ H5RS_decr(H5RS_str_t *rs)
H5FL_FREE(H5RS_str_t,rs);
} /* end if */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* end H5RS_decr() */
@@ -267,9 +261,7 @@ done:
herr_t
H5RS_incr(H5RS_str_t *rs)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5RS_incr,FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_incr);
/* Sanity check */
assert(rs);
@@ -287,8 +279,7 @@ H5RS_incr(H5RS_str_t *rs)
/* Increment reference count for string */
rs->n++;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* end H5RS_incr() */
@@ -314,14 +305,13 @@ done:
H5RS_str_t *
H5RS_dup(H5RS_str_t *ret_value)
{
- FUNC_ENTER_NOAPI(H5RS_dup,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_dup);
/* Check for valid reference counted string */
if(ret_value!=NULL)
/* Increment reference count for string */
ret_value->n++;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5RS_dup() */
@@ -384,18 +374,13 @@ H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2)
ssize_t
H5RS_len(const H5RS_str_t *rs)
{
- ssize_t ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(H5RS_len,FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_len);
/* Sanity check */
assert(rs);
assert(rs->s);
- ret_value=(ssize_t)HDstrlen(rs->s);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI((ssize_t)HDstrlen(rs->s));
} /* end H5RS_len() */
@@ -423,18 +408,13 @@ done:
char *
H5RS_get_str(const H5RS_str_t *rs)
{
- char *ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(H5RS_get_str,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_str);
/* Sanity check */
assert(rs);
assert(rs->s);
- ret_value=rs->s;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(rs->s);
} /* end H5RS_get_str() */
@@ -460,17 +440,12 @@ done:
unsigned
H5RS_get_count(const H5RS_str_t *rs)
{
- unsigned ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(H5RS_get_count,0);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_count);
/* Sanity check */
assert(rs);
assert(rs->n>0);
- ret_value=rs->n;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(rs->n);
} /* end H5RS_get_count() */