summaryrefslogtreecommitdiffstats
path: root/src/H5Tcompound.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
commit427ff7da2848042f68ecfadf5a321b1d8077e9db (patch)
tree73024b1954031fbb724c2d96a485590348e5cc22 /src/H5Tcompound.c
parent9b96fd2003ae74cca389cc4c2216b4371d6eb173 (diff)
downloadhdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.zip
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.gz
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.bz2
[svn-r9727] Purpose:
Bug Fix/Code Cleanup/Doc Cleanup/Optimization/Branch Sync :-) Description: Generally speaking, this is the "signed->unsigned" change to selections. However, in the process of merging code back, things got stickier and stickier until I ended up doing a big "sync the two branches up" operation. So... I brought back all the "infrastructure" fixes from the development branch to the release branch (which I think were actually making some improvement in performance) as well as fixed several bugs which had been fixed in one branch, but not the other. I've also tagged the repository before making this checkin with the label "before_signed_unsigned_changes". Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel & fphdf5 FreeBSD 4.10 (sleipnir) w/threadsafe FreeBSD 4.10 (sleipnir) w/backward compatibility Solaris 2.7 (arabica) w/"purify options" Solaris 2.8 (sol) w/FORTRAN & C++ AIX 5.x (copper) w/parallel & FORTRAN IRIX64 6.5 (modi4) w/FORTRAN Linux 2.4 (heping) w/FORTRAN & C++ Misc. update:
Diffstat (limited to 'src/H5Tcompound.c')
-rw-r--r--src/H5Tcompound.c52
1 files changed, 12 insertions, 40 deletions
diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c
index 48feb6c..467798f 100644
--- a/src/H5Tcompound.c
+++ b/src/H5Tcompound.c
@@ -36,7 +36,7 @@
#define H5T_COMPND_INC 64 /*typical max numb of members per struct */
/* Static local functions */
-static herr_t H5T_pack(H5T_t *dt);
+static herr_t H5T_pack(const H5T_t *dt);
/*--------------------------------------------------------------------------
@@ -81,17 +81,9 @@ H5T_init_compound_interface(void)
*
*-------------------------------------------------------------------------
*/
-#ifdef H5_WANT_H5_V1_6_COMPAT
-size_t
-H5Tget_member_offset(hid_t type_id, int _membno)
-#else /* H5_WANT_H5_V1_6_COMPAT */
size_t
H5Tget_member_offset(hid_t type_id, unsigned membno)
-#endif /* H5_WANT_H5_V1_6_COMPAT */
{
-#ifdef H5_WANT_H5_V1_6_COMPAT
- unsigned membno = (unsigned)_membno;
-#endif /* H5_WANT_H5_V1_6_COMPAT */
H5T_t *dt = NULL;
size_t ret_value;
@@ -138,7 +130,7 @@ H5T_get_member_offset(const H5T_t *dt, unsigned membno)
{
size_t ret_value;
- FUNC_ENTER_NOAPI(H5T_get_member_offset, 0)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_get_member_offset)
assert(dt);
assert(membno < dt->shared->u.compnd.nmembs);
@@ -146,7 +138,6 @@ H5T_get_member_offset(const H5T_t *dt, unsigned membno)
/* Value */
ret_value = dt->shared->u.compnd.memb[membno].offset;
-done:
FUNC_LEAVE_NOAPI(ret_value)
}
@@ -167,17 +158,9 @@ done:
*
*-------------------------------------------------------------------------
*/
-#ifdef H5_WANT_H5_V1_6_COMPAT
-H5T_class_t
-H5Tget_member_class(hid_t type_id, int _membno)
-#else /* H5_WANT_H5_V1_6_COMPAT */
H5T_class_t
H5Tget_member_class(hid_t type_id, unsigned membno)
-#endif /* H5_WANT_H5_V1_6_COMPAT */
{
-#ifdef H5_WANT_H5_V1_6_COMPAT
- unsigned membno = (unsigned)_membno;
-#endif /* H5_WANT_H5_V1_6_COMPAT */
H5T_t *dt = NULL;
H5T_class_t ret_value;
@@ -222,22 +205,14 @@ done:
*
*-------------------------------------------------------------------------
*/
-#ifdef H5_WANT_H5_V1_6_COMPAT
-hid_t
-H5Tget_member_type(hid_t type_id, int _membno)
-#else /* H5_WANT_H5_V1_6_COMPAT */
hid_t
H5Tget_member_type(hid_t type_id, unsigned membno)
-#endif /* H5_WANT_H5_V1_6_COMPAT */
{
-#ifdef H5_WANT_H5_V1_6_COMPAT
- unsigned membno = (unsigned)_membno;
-#endif /* H5_WANT_H5_V1_6_COMPAT */
H5T_t *dt = NULL, *memb_dt = NULL;
hid_t ret_value;
FUNC_ENTER_API(H5Tget_member_type, FAIL)
- H5TRACE2("i","iIs",type_id,membno);
+ H5TRACE2("i","iIu",type_id,membno);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)) || H5T_COMPOUND != dt->shared->type)
@@ -250,8 +225,7 @@ H5Tget_member_type(hid_t type_id, unsigned membno)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable register datatype atom")
done:
- if(ret_value<0)
-{
+ if(ret_value<0) {
if(memb_dt!=NULL)
if(H5T_close(memb_dt)<0)
HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close datatype")
@@ -316,11 +290,11 @@ done:
*-------------------------------------------------------------------------
*/
size_t
-H5T_get_member_size(H5T_t *dt, unsigned membno)
+H5T_get_member_size(const H5T_t *dt, unsigned membno)
{
size_t ret_value = 0;
- FUNC_ENTER_NOAPI(H5T_get_member_size, 0);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_get_member_size)
assert(dt);
assert(membno < dt->shared->u.compnd.nmembs);
@@ -328,8 +302,7 @@ H5T_get_member_size(H5T_t *dt, unsigned membno)
/* Value */
ret_value = dt->shared->u.compnd.memb[membno].type->shared->size;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -444,7 +417,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5T_insert(H5T_t *parent, const char *name, size_t offset, const H5T_t *member)
+H5T_insert(const H5T_t *parent, const char *name, size_t offset, const H5T_t *member)
{
unsigned idx, i;
size_t total_size;
@@ -481,7 +454,7 @@ H5T_insert(H5T_t *parent, const char *name, size_t offset, const H5T_t *member)
/* Increase member array if necessary */
if (parent->shared->u.compnd.nmembs >= parent->shared->u.compnd.nalloc) {
- size_t na = parent->shared->u.compnd.nalloc + H5T_COMPND_INC;
+ unsigned na = parent->shared->u.compnd.nalloc + H5T_COMPND_INC;
H5T_cmemb_t *x = H5MM_realloc (parent->shared->u.compnd.memb,
na * sizeof(H5T_cmemb_t));
@@ -551,7 +524,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5T_pack(H5T_t *dt)
+H5T_pack(const H5T_t *dt)
{
unsigned i;
size_t offset;
@@ -564,7 +537,7 @@ H5T_pack(H5T_t *dt)
if(H5T_detect_class(dt,H5T_COMPOUND)>0) {
/* If datatype has been packed, skip packing it and indicate success */
if(H5T_is_packed(dt)== TRUE)
- HGOTO_DONE(SUCCEED);
+ HGOTO_DONE(SUCCEED)
/* Check for packing unmodifiable datatype */
if (H5T_STATE_TRANSIENT!=dt->shared->state)
@@ -627,7 +600,7 @@ H5T_is_packed(const H5T_t *dt)
{
htri_t ret_value=TRUE; /* Return value */
- FUNC_ENTER_NOAPI(H5T_is_packed,FAIL)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_is_packed)
assert(dt);
@@ -639,7 +612,6 @@ H5T_is_packed(const H5T_t *dt)
if(dt->shared->type==H5T_COMPOUND)
ret_value=(htri_t)dt->shared->u.compnd.packed;
-done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_is_packed() */