summaryrefslogtreecommitdiffstats
path: root/src/H5V.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-05-28 18:17:12 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-05-28 18:17:12 (GMT)
commitca912c389e4e641cfbae6facced950ad05578d65 (patch)
tree6bd8604f6a587ee07013ad40daa3c0c7f4b31c26 /src/H5V.c
parent893cf5899c2b724aa438b66a275967b1f5ad0342 (diff)
downloadhdf5-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/H5V.c')
-rw-r--r--src/H5V.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/H5V.c b/src/H5V.c
index 50b937f..1199545 100644
--- a/src/H5V.c
+++ b/src/H5V.c
@@ -344,19 +344,22 @@ H5V_hyper_eq(int n,
hsize_t nelmts1 = 1, nelmts2 = 1;
int i;
- if (n <= 0) return TRUE;
+ /* Use FUNC_ENTER_NOINIT here to avoid performance issues */
+ FUNC_ENTER_NOINIT(H5V_hyper_eq);
+
+ if (n <= 0) HRETURN(TRUE);
for (i=0; i<n; i++) {
if ((offset1 ? offset1[i] : 0) != (offset2 ? offset2[i] : 0)) {
- return FALSE;
+ HRETURN(FALSE);
}
if ((size1 ? size1[i] : 0) != (size2 ? size2[i] : 0)) {
- return FALSE;
+ HRETURN(FALSE);
}
- if (0 == (nelmts1 *= (size1 ? size1[i] : 0))) return FALSE;
- if (0 == (nelmts2 *= (size2 ? size2[i] : 0))) return FALSE;
+ if (0 == (nelmts1 *= (size1 ? size1[i] : 0))) HRETURN(FALSE);
+ if (0 == (nelmts2 *= (size2 ? size2[i] : 0))) HRETURN(FALSE);
}
- return TRUE;
+ FUNC_LEAVE(TRUE);
}
/*-------------------------------------------------------------------------
@@ -384,24 +387,27 @@ H5V_hyper_disjointp(unsigned n,
{
unsigned u;
- if (!n || !size1 || !size2) return TRUE;
+ /* Use FUNC_ENTER_NOINIT here to avoid performance issues */
+ FUNC_ENTER_NOINIT(H5V_hyper_disjointp);
+
+ if (!n || !size1 || !size2) HRETURN(TRUE);
for (u=0; u<n; u++) {
assert (size1[u]<HSSIZET_MAX);
assert (size2[u]<HSSIZET_MAX);
if (0==size1[u] || 0==size2[u])
- return TRUE;
+ HRETURN(TRUE);
if (((offset1?offset1[u]:0) < (offset2?offset2[u]:0) &&
((offset1?offset1[u]:0) + (hssize_t)size1[u] <=
(offset2?offset2[u]:0))) ||
((offset2?offset2[u]:0) < (offset1?offset1[u]:0) &&
((offset2?offset2[u]:0) + (hssize_t)size2[u] <=
(offset1?offset1[u]:0)))) {
- return TRUE;
+ HRETURN(TRUE);
}
}
- return FALSE;
+ FUNC_LEAVE(FALSE);
}
/*-------------------------------------------------------------------------