diff options
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; |