diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-12-29 14:26:20 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-12-29 14:26:20 (GMT) |
commit | 427ff7da2848042f68ecfadf5a321b1d8077e9db (patch) | |
tree | 73024b1954031fbb724c2d96a485590348e5cc22 /src/H5Tvlen.c | |
parent | 9b96fd2003ae74cca389cc4c2216b4371d6eb173 (diff) | |
download | hdf5-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/H5Tvlen.c')
-rw-r--r-- | src/H5Tvlen.c | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 467327e..186b14f 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -38,21 +38,21 @@ /* Local functions */ static herr_t H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, void *free_info); -static ssize_t H5T_vlen_seq_mem_getlen(void *_vl); +static ssize_t H5T_vlen_seq_mem_getlen(const void *_vl); static void * H5T_vlen_seq_mem_getptr(void *_vl); -static htri_t H5T_vlen_seq_mem_isnull(H5F_t *f, void *_vl); +static htri_t H5T_vlen_seq_mem_isnull(const H5F_t *f, void *_vl); static herr_t H5T_vlen_seq_mem_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *_buf, size_t len); static herr_t H5T_vlen_seq_mem_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size); static herr_t H5T_vlen_seq_mem_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg); -static ssize_t H5T_vlen_str_mem_getlen(void *_vl); +static ssize_t H5T_vlen_str_mem_getlen(const void *_vl); static void * H5T_vlen_str_mem_getptr(void *_vl); -static htri_t H5T_vlen_str_mem_isnull(H5F_t *f, void *_vl); +static htri_t H5T_vlen_str_mem_isnull(const H5F_t *f, void *_vl); static herr_t H5T_vlen_str_mem_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *_buf, size_t len); static herr_t H5T_vlen_str_mem_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size); static herr_t H5T_vlen_str_mem_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg); -static ssize_t H5T_vlen_disk_getlen(void *_vl); +static ssize_t H5T_vlen_disk_getlen(const void *_vl); static void * H5T_vlen_disk_getptr(void *_vl); -static htri_t H5T_vlen_disk_isnull(H5F_t *f, void *_vl); +static htri_t H5T_vlen_disk_isnull(const H5F_t *f, void *_vl); static herr_t H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *_buf, size_t len); static herr_t H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size); static herr_t H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg); @@ -217,7 +217,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5T_vlen_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) +H5T_vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc) { htri_t ret_value = 0; /* Indicate that success, but no location change */ @@ -297,7 +297,7 @@ H5T_vlen_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) default: HGOTO_ERROR (H5E_DATATYPE, H5E_BADRANGE, FAIL, "invalid VL datatype location") - } /* end switch */ + } /* end switch */ /*lint !e788 All appropriate cases are covered */ } /* end if */ done: @@ -320,9 +320,9 @@ done: *------------------------------------------------------------------------- */ static ssize_t -H5T_vlen_seq_mem_getlen(void *_vl) +H5T_vlen_seq_mem_getlen(const void *_vl) { - hvl_t *vl=(hvl_t *)_vl; /* Pointer to the user's hvl_t information */ + const hvl_t *vl=(const hvl_t *)_vl; /* Pointer to the user's hvl_t information */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_seq_mem_getlen) @@ -377,7 +377,7 @@ H5T_vlen_seq_mem_getptr(void *_vl) */ /* ARGSUSED */ static htri_t -H5T_vlen_seq_mem_isnull(H5F_t UNUSED *f, void *_vl) +H5T_vlen_seq_mem_isnull(const H5F_t UNUSED *f, void *_vl) { hvl_t *vl=(hvl_t *)_vl; /* Pointer to the user's hvl_t information */ @@ -532,9 +532,9 @@ H5T_vlen_seq_mem_setnull(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_vl, void *------------------------------------------------------------------------- */ static ssize_t -H5T_vlen_str_mem_getlen(void *_vl) +H5T_vlen_str_mem_getlen(const void *_vl) { - char *s=*(char **)_vl; /* Pointer to the user's string information */ + const char *s=*(const char * const *)_vl; /* Pointer to the user's string information */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_str_mem_getlen) @@ -589,13 +589,13 @@ H5T_vlen_str_mem_getptr(void *_vl) */ /* ARGSUSED */ static htri_t -H5T_vlen_str_mem_isnull(H5F_t UNUSED *f, void *_vl) +H5T_vlen_str_mem_isnull(const H5F_t UNUSED *f, void *_vl) { char *s=*(char **)_vl; /* Pointer to the user's string information */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_str_mem_isnull) - FUNC_LEAVE_NOAPI(s==NULL ? TRUE : FALSE); + FUNC_LEAVE_NOAPI(s==NULL ? TRUE : FALSE) } /* end H5T_vlen_str_mem_isnull() */ @@ -726,9 +726,9 @@ H5T_vlen_str_mem_setnull(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_vl, void *------------------------------------------------------------------------- */ static ssize_t -H5T_vlen_disk_getlen(void *_vl) +H5T_vlen_disk_getlen(const void *_vl) { - uint8_t *vl=(uint8_t *)_vl; /* Pointer to the disk VL information */ + const uint8_t *vl=(const uint8_t *)_vl; /* Pointer to the disk VL information */ size_t seq_len; /* Sequence length */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_disk_getlen) @@ -756,6 +756,7 @@ H5T_vlen_disk_getlen(void *_vl) * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static void * H5T_vlen_disk_getptr(void UNUSED *vl) { @@ -783,7 +784,7 @@ H5T_vlen_disk_getptr(void UNUSED *vl) *------------------------------------------------------------------------- */ static htri_t -H5T_vlen_disk_isnull(H5F_t *f, void *_vl) +H5T_vlen_disk_isnull(const H5F_t *f, void *_vl) { uint8_t *vl=(uint8_t *)_vl; /* Pointer to the disk VL information */ haddr_t addr; /* Sequence's heap address */ @@ -823,7 +824,6 @@ H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t UNUSED { uint8_t *vl=(uint8_t *)_vl; /* Pointer to the user's hvl_t information */ H5HG_t hobjid; - uint32_t seq_len; herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5T_vlen_disk_read) @@ -833,8 +833,8 @@ H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t UNUSED assert(buf); assert(f); - /* Get the length of the sequence */ - UINT32DECODE(vl, seq_len); /* Not used */ + /* Skip the length of the sequence */ + vl += 4; /* Get the heap information */ H5F_addr_decode(f,(const uint8_t **)&vl,&(hobjid.addr)); @@ -870,6 +870,7 @@ done: * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static herr_t H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED *vl_alloc_info, void *_vl, void *buf, void *_bg, size_t seq_len, size_t base_size) { @@ -888,11 +889,10 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED /* Free heap object for old data. */ if(bg!=NULL) { - size_t bg_seq_len; /* "Background" VL info sequence's length */ H5HG_t bg_hobjid; /* "Background" VL info sequence's ID info */ - /* Get the length of the sequence and heap object ID from background data. */ - UINT32DECODE(bg, bg_seq_len); + /* Skip the length of the sequence and heap object ID from background data. */ + bg += 4; /* Get heap information */ H5F_addr_decode(f, (const uint8_t **)&bg, &(bg_hobjid.addr)); @@ -953,11 +953,10 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg) /* Free heap object for old data. */ if(bg!=NULL) { - hsize_t bg_seq_len=0; /* "Background" VL info sequence's length */ H5HG_t bg_hobjid; /* "Background" VL info sequence's ID info */ - /* Get the length of the sequence and heap object ID from background data. */ - UINT32DECODE(bg, bg_seq_len); + /* Skip the length of the sequence and heap object ID from background data. */ + bg += 4; /* Get heap information */ H5F_addr_decode(f, (const uint8_t **)&bg, &(bg_hobjid.addr)); @@ -1085,7 +1084,7 @@ H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, voi default: break; - } /* end switch */ + } /* end switch */ /*lint !e788 All appropriate cases are covered */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1101,8 +1100,8 @@ done: herr_t H5T_vlen_reclaim(elem,type_id,ndim,point,op_data) void *elem; IN/OUT: Pointer to the dataset element hid_t type_id; IN: Datatype of dataset element - hsize_t ndim; IN: Number of dimensions in dataspace - hssize_t *point; IN: Coordinate location of element in dataspace + unsigned ndim; IN: Number of dimensions in dataspace + hsize_t *point; IN: Coordinate location of element in dataspace void *op_data IN: Operator data RETURNS @@ -1118,7 +1117,7 @@ done: --------------------------------------------------------------------------*/ /* ARGSUSED */ herr_t -H5T_vlen_reclaim(void *elem, hid_t type_id, hsize_t UNUSED ndim, hssize_t UNUSED *point, void *op_data) +H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *op_data) { H5T_vlen_alloc_info_t *vl_alloc_info = (H5T_vlen_alloc_info_t *)op_data; /* VL allocation info from iterator */ H5T_t *dt; |