summaryrefslogtreecommitdiffstats
path: root/src/H5Vprivate.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Vprivate.h')
-rw-r--r--src/H5Vprivate.h64
1 files changed, 42 insertions, 22 deletions
diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h
index 156e6bd..ffc17dc 100644
--- a/src/H5Vprivate.h
+++ b/src/H5Vprivate.h
@@ -98,14 +98,16 @@ __DLL__ hsize_t H5V_array_offset(unsigned n, const hsize_t *total_size,
static H5_inline hsize_t
H5V_vector_reduce_product(unsigned n, const hsize_t *v)
{
- hsize_t ans = 1;
+ hsize_t ret_value = 1;
/* Use FUNC_ENTER_NOINIT here to avoid performance issues */
FUNC_ENTER_NOINIT(H5V_vector_reduce_product);
- if (n && !v) HRETURN(0);
- while (n--) ans *= *v++;
- FUNC_LEAVE(ans);
+ if (n && !v) HGOTO_DONE(0);
+ while (n--) ret_value *= *v++;
+
+done:
+ FUNC_LEAVE(ret_value);
}
/*-------------------------------------------------------------------------
@@ -128,14 +130,19 @@ H5V_vector_reduce_product(unsigned n, const hsize_t *v)
static H5_inline htri_t UNUSED
H5V_vector_zerop_u(int n, const hsize_t *v)
{
+ htri_t ret_value=TRUE; /* Return value */
+
/* Use FUNC_ENTER_NOINIT here to avoid performance issues */
FUNC_ENTER_NOINIT(H5V_vector_zerop_u);
- if (!v) HRETURN(TRUE);
- while (n--) {
- if (*v++) HRETURN(FALSE);
- }
- FUNC_LEAVE(TRUE);
+ if (!v)
+ HGOTO_DONE(TRUE);
+ while (n--)
+ if (*v++)
+ HGOTO_DONE(FALSE);
+
+done:
+ FUNC_LEAVE(ret_value);
}
/*-------------------------------------------------------------------------
@@ -158,14 +165,19 @@ H5V_vector_zerop_u(int n, const hsize_t *v)
static H5_inline htri_t UNUSED
H5V_vector_zerop_s(int n, const hssize_t *v)
{
+ htri_t ret_value=TRUE; /* Return value */
+
/* Use FUNC_ENTER_NOINIT here to avoid performance issues */
FUNC_ENTER_NOINIT(H5V_vector_zerop_s);
- if (!v) HRETURN(TRUE);
- while (n--) {
- if (*v++) HRETURN(FALSE);
- }
- FUNC_LEAVE(TRUE);
+ if (!v)
+ HGOTO_DONE(TRUE);
+ while (n--)
+ if (*v++)
+ HGOTO_DONE(FALSE);
+
+done:
+ FUNC_LEAVE(ret_value);
}
/*-------------------------------------------------------------------------
@@ -190,17 +202,21 @@ H5V_vector_zerop_s(int n, const hssize_t *v)
static H5_inline int UNUSED
H5V_vector_cmp_u (int n, const hsize_t *v1, const hsize_t *v2)
{
+ int ret_value=0; /* Return value */
+
/* Use FUNC_ENTER_NOINIT here to avoid performance issues */
FUNC_ENTER_NOINIT(H5V_vector_cmp_u);
- if (v1 == v2) HRETURN(0);
+ if (v1 == v2) HGOTO_DONE(0);
while (n--) {
- if ((v1 ? *v1 : 0) < (v2 ? *v2 : 0)) HRETURN(-1);
- if ((v1 ? *v1 : 0) > (v2 ? *v2 : 0)) HRETURN(1);
+ if ((v1 ? *v1 : 0) < (v2 ? *v2 : 0)) HGOTO_DONE(-1);
+ if ((v1 ? *v1 : 0) > (v2 ? *v2 : 0)) HGOTO_DONE(1);
if (v1) v1++;
if (v2) v2++;
}
- FUNC_LEAVE(0);
+
+done:
+ FUNC_LEAVE(ret_value);
}
@@ -226,17 +242,21 @@ H5V_vector_cmp_u (int n, const hsize_t *v1, const hsize_t *v2)
static H5_inline int UNUSED
H5V_vector_cmp_s (unsigned n, const hssize_t *v1, const hssize_t *v2)
{
+ int ret_value=0; /* Return value */
+
/* Use FUNC_ENTER_NOINIT here to avoid performance issues */
FUNC_ENTER_NOINIT(H5V_vector_cmp_s);
- if (v1 == v2) HRETURN(0);
+ if (v1 == v2) HGOTO_DONE(0);
while (n--) {
- if ((v1 ? *v1 : 0) < (v2 ? *v2 : 0)) HRETURN(-1);
- if ((v1 ? *v1 : 0) > (v2 ? *v2 : 0)) HRETURN(1);
+ if ((v1 ? *v1 : 0) < (v2 ? *v2 : 0)) HGOTO_DONE(-1);
+ if ((v1 ? *v1 : 0) > (v2 ? *v2 : 0)) HGOTO_DONE(1);
if (v1) v1++;
if (v2) v2++;
}
- FUNC_LEAVE(0);
+
+done:
+ FUNC_LEAVE(ret_value);
}