diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-01-02 19:59:27 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-01-02 19:59:27 (GMT) |
commit | 5aa7685ae3efefa3bbc71fccf473598580af3ede (patch) | |
tree | b05542fe12f3bf363c17751b04312f14acfd47c8 /src | |
parent | ca68ba491423bb74810e5218d98877fface13417 (diff) | |
download | hdf5-5aa7685ae3efefa3bbc71fccf473598580af3ede.zip hdf5-5aa7685ae3efefa3bbc71fccf473598580af3ede.tar.gz hdf5-5aa7685ae3efefa3bbc71fccf473598580af3ede.tar.bz2 |
[svn-r11853] Purpose:
Code cleanup/update
Description:
Update compiler flags for gcc 4.1.x & start cleaning up some of the C++
compatibility
Platforms tested:
FreeBSD 4.11 (sleipnir) w/gcc 4.1 and/or g++
Diffstat (limited to 'src')
-rw-r--r-- | src/H5A.c | 32 | ||||
-rw-r--r-- | src/H5B.c | 66 | ||||
-rw-r--r-- | src/H5Bcache.c | 8 | ||||
-rw-r--r-- | src/H5D.c | 85 | ||||
-rw-r--r-- | src/H5Dcontig.c | 2 | ||||
-rw-r--r-- | src/H5FLprivate.h | 36 |
6 files changed, 116 insertions, 113 deletions
@@ -175,9 +175,9 @@ H5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - if(NULL == (type = H5I_object_verify(type_id, H5I_DATATYPE))) + if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a type") - if(NULL == (space = H5I_object_verify(space_id, H5I_DATASPACE))) + if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") /* Go do the real work for attaching the attribute to the dataset */ @@ -237,7 +237,7 @@ H5A_create(const H5G_entry_t *ent, const char *name, const H5T_t *type, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspace extent has not been set") /* Build the attribute information */ - if((attr = H5FL_CALLOC(H5A_t)) == NULL) + if((attr = (H5A_t *)H5FL_CALLOC(H5A_t)) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for attribute info") /* Copy the attribute name */ @@ -519,7 +519,7 @@ H5A_open(H5G_entry_t *ent, unsigned idx, hid_t dxpl_id) /* Read in attribute with H5O_read() */ H5_CHECK_OVERFLOW(idx,unsigned,int); - if(NULL==(attr=H5O_read(ent, H5O_ATTR_ID, (int)idx, NULL, dxpl_id))) + if(NULL==(attr=(H5A_t *)H5O_read(ent, H5O_ATTR_ID, (int)idx, NULL, dxpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to load attribute info from dataset header") attr->initialized = TRUE; @@ -579,9 +579,9 @@ H5Awrite(hid_t attr_id, hid_t type_id, const void *buf) H5TRACE3("e","iix",attr_id,type_id,buf); /* check arguments */ - if(NULL == (attr = H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") - if(NULL == (mem_type = H5I_object_verify(type_id, H5I_DATATYPE))) + if(NULL == (mem_type = (const H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(NULL == buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") @@ -655,7 +655,7 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) /* Get the maximum buffer size needed and allocate it */ buf_size = nelmts * MAX(src_type_size, dst_type_size); - if(NULL == (tconv_buf = H5FL_BLK_MALLOC (attr_buf, buf_size)) || NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size))) + if(NULL == (tconv_buf = (uint8_t *)H5FL_BLK_MALLOC (attr_buf, buf_size)) || NULL == (bkg_buf = (uint8_t *)H5FL_BLK_CALLOC(attr_buf, buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Copy the user's data into the buffer for conversion */ @@ -737,9 +737,9 @@ H5Aread(hid_t attr_id, hid_t type_id, void *buf) H5TRACE3("e","iix",attr_id,type_id,buf); /* check arguments */ - if(NULL == (attr = H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") - if(NULL == (mem_type = H5I_object_verify(type_id, H5I_DATATYPE))) + if(NULL == (mem_type = (const H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(NULL == buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") @@ -817,7 +817,7 @@ H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) /* Get the maximum buffer size needed and allocate it */ buf_size = nelmts*MAX(src_type_size,dst_type_size); - if(NULL == (tconv_buf = H5FL_BLK_MALLOC(attr_buf, buf_size)) || NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size))) + if(NULL == (tconv_buf = (uint8_t *)H5FL_BLK_MALLOC(attr_buf, buf_size)) || NULL == (bkg_buf = (uint8_t *)H5FL_BLK_CALLOC(attr_buf, buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Copy the attribute data into the buffer for conversion */ @@ -882,7 +882,7 @@ H5Aget_space(hid_t attr_id) H5TRACE1("i","i",attr_id); /* check arguments */ - if(NULL == (attr = H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") /* Copy the attribute's dataspace */ @@ -925,7 +925,7 @@ H5Aget_type(hid_t attr_id) H5TRACE1("i","i",attr_id); /* check arguments */ - if(NULL == (attr = H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") /* @@ -988,7 +988,7 @@ H5Aget_name(hid_t attr_id, size_t buf_size, char *buf) H5TRACE3("Zs","izs",attr_id,buf_size,buf); /* check arguments */ - if(NULL == (attr = H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") if(!buf && buf_size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid buffer") @@ -1045,7 +1045,7 @@ H5Aget_storage_size(hid_t attr_id) H5TRACE1("h","i",attr_id); /* Check args */ - if(NULL == (attr = H5I_object_verify(attr_id, H5I_ATTR))) + if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not an attribute") /* Set return value */ @@ -1456,7 +1456,7 @@ H5A_copy(H5A_t *_new_attr, const H5A_t *old_attr, unsigned update_flags) /* Sanity check - We should not be only updating data if we don'y have anything */ HDassert(!(update_flags&H5O_UPDATE_DATA_ONLY)); - if(NULL == (new_attr = H5FL_MALLOC(H5A_t))) + if(NULL == (new_attr = (H5A_t *)H5FL_MALLOC(H5A_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") allocated_attr = TRUE; } /* end if */ @@ -1562,7 +1562,7 @@ H5A_close(H5A_t *attr) /* Check if the attribute has any data yet, if not, fill with zeroes */ if(attr->ent_opened && !attr->initialized) { - uint8_t *tmp_buf = H5FL_BLK_CALLOC(attr_buf, attr->data_size); + uint8_t *tmp_buf = (uint8_t *)H5FL_BLK_CALLOC(attr_buf, attr->data_size); if(NULL == tmp_buf) HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "memory allocation failed for attribute fill-value") @@ -227,7 +227,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata, bt->nchildren = 0; if((bt->rc_shared=(type->get_shared)(f, udata))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't retrieve B-tree node buffer") - shared=H5RC_GET_OBJ(bt->rc_shared); + shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); if (NULL==(bt->native=H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)) || NULL==(bt->child=H5FL_SEQ_MALLOC(haddr_t,(size_t)shared->two_k))) @@ -309,9 +309,9 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u * Perform a binary search to locate the child which contains * the thing for which we're searching. */ - if (NULL == (bt = H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_READ))) + if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree node") - shared=H5RC_GET_OBJ(bt->rc_shared); + shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); rt = bt->nchildren; @@ -422,12 +422,12 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, haddr_t old_addr, /* * Initialize variables. */ - shared=H5RC_GET_OBJ(old_bt->rc_shared); + shared=(H5B_shared_t *)H5RC_GET_OBJ(old_bt->rc_shared); HDassert(shared); assert(old_bt->nchildren == shared->two_k); /* Get the dataset transfer property list */ - if (NULL == (dx_plist = H5I_object(dxpl_id))) + if (NULL == (dx_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") /* Get B-tree split ratios */ @@ -485,7 +485,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, haddr_t old_addr, */ if (H5B_create(f, dxpl_id, shared->type, udata, new_addr_p/*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create B-tree") - if (NULL==(new_bt=H5AC_protect(f, dxpl_id, H5AC_BT, *new_addr_p, shared->type, udata, H5AC_WRITE))) + if (NULL==(new_bt=(H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, *new_addr_p, shared->type, udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to protect B-tree") new_bt->level = old_bt->level; @@ -514,7 +514,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, haddr_t old_addr, new_bt->right = old_bt->right; if (H5F_addr_defined(old_bt->right)) { - if (NULL == (tmp_bt = H5AC_protect(f, dxpl_id, H5AC_BT, old_bt->right, shared->type, udata, H5AC_WRITE))) + if (NULL == (tmp_bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, old_bt->right, shared->type, udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load right sibling") tmp_bt->cache_info.is_dirty = TRUE; @@ -599,9 +599,9 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, assert(H5B_INS_RIGHT == my_ins); /* the current root */ - if (NULL == (bt = H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_READ))) + if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to locate root of B-tree") - shared=H5RC_GET_OBJ(bt->rc_shared); + shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); level = bt->level; @@ -615,7 +615,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, bt = NULL; /* the new node */ - if (NULL == (bt = H5AC_protect(f, dxpl_id, H5AC_BT, child, type, udata, H5AC_READ))) + if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child, type, udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load new node") if (!rt_key_changed) @@ -636,7 +636,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate file space to move root") /* update the new child's left pointer */ - if (NULL == (bt = H5AC_protect(f, dxpl_id, H5AC_BT, child, type, udata, H5AC_WRITE))) + if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child, type, udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load new child") bt->cache_info.is_dirty = TRUE; @@ -652,7 +652,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, * at the new location -QAK */ /* Bring the old root into the cache if it's not already */ - if (NULL == (bt = H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_WRITE))) + if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load new child") /* Make certain the old root info is marked as dirty before moving it, */ @@ -736,7 +736,7 @@ H5B_insert_child(H5B_t *bt, unsigned idx, haddr_t child, FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B_insert_child) assert(bt); - shared=H5RC_GET_OBJ(bt->rc_shared); + shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); assert(bt->nchildren<shared->two_k); @@ -867,9 +867,9 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type * data. When the search completes IDX points to the child that * should get the new data. */ - if (NULL == (bt = H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_WRITE))) + if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to load node") - shared=H5RC_GET_OBJ(bt->rc_shared); + shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); rt = bt->nchildren; @@ -1037,7 +1037,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type if (bt->nchildren == shared->two_k) { if (H5B_split(f, dxpl_id, bt, addr, idx, udata, new_node_p/*out*/)<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, H5B_INS_ERROR, "unable to split node") - if (NULL == (twin = H5AC_protect(f, dxpl_id, H5AC_BT, *new_node_p, type, udata, H5AC_WRITE))) + if (NULL == (twin = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, *new_node_p, type, udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to load node") if (idx<bt->nchildren) { tmp_bt = bt; @@ -1135,9 +1135,9 @@ H5B_iterate (H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_operator_t op assert(H5F_addr_defined(addr)); assert(udata); - if (NULL == (bt = H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_READ))) + if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree node") - shared=H5RC_GET_OBJ(bt->rc_shared); + shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); level = bt->level; @@ -1167,7 +1167,7 @@ H5B_iterate (H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_operator_t op * leave the B-tree node protected during an application * callback. */ - if (NULL == (bt = H5AC_protect(f, dxpl_id, H5AC_BT, cur_addr, type, udata, H5AC_READ))) + if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, cur_addr, type, udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "B-tree node") HDmemcpy(child, bt->child, bt->nchildren*sizeof(haddr_t)); @@ -1257,9 +1257,9 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type * Perform a binary search to locate the child which contains the thing * for which we're searching. */ - if (NULL==(bt=H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_WRITE))) + if (NULL==(bt=(H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to load B-tree node") - shared=H5RC_GET_OBJ(bt->rc_shared); + shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); rt = bt->nchildren; @@ -1338,7 +1338,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type */ if (ret_value!=H5B_INS_REMOVE && level>0) { if (H5F_addr_defined(bt->right)) { - if (NULL == (sibling = H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, type, udata, H5AC_WRITE))) + if (NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, type, udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to unlink node from tree") /* Make certain the native key for the right sibling is set up */ @@ -1368,7 +1368,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type bt->nchildren = 0; if (level>0) { if (H5F_addr_defined(bt->left)) { - if (NULL == (sibling = H5AC_protect(f, dxpl_id, H5AC_BT, bt->left, type, udata, H5AC_WRITE))) + if (NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->left, type, udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to load node from tree") sibling->right = bt->right; @@ -1380,7 +1380,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type sibling=NULL; /* Make certain future references will be caught */ } if (H5F_addr_defined(bt->right)) { - if (NULL == (sibling = H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, type, udata, H5AC_WRITE))) + if (NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, type, udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to unlink node from tree") /* Copy left-most key from deleted node to left-most key in it's right neighbor */ @@ -1444,7 +1444,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type */ if (level>0) { if (H5F_addr_defined(bt->right)) { - if (NULL == (sibling = H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, type, udata, H5AC_WRITE))) + if (NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, type, udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, H5B_INS_ERROR, "unable to unlink node from tree") HDmemcpy(H5B_NKEY(sibling,shared,0), H5B_NKEY(bt,shared,bt->nchildren), type->sizeof_nkey); @@ -1538,7 +1538,7 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void * If the B-tree is now empty then make sure we mark the root node as * being at level zero */ - if (NULL == (bt = H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_WRITE))) + if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree root node") if (0==bt->nchildren && 0!=bt->level) { @@ -1590,9 +1590,9 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void assert(H5F_addr_defined(addr)); /* Lock this B-tree node into memory for now */ - if (NULL == (bt = H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_WRITE))) + if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_WRITE))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree node") - shared=H5RC_GET_OBJ(bt->rc_shared); + shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); /* Iterate over all children in tree, deleting them */ @@ -1716,7 +1716,7 @@ H5B_copy(const H5B_t *old_bt) * Check arguments. */ assert(old_bt); - shared=H5RC_GET_OBJ(old_bt->rc_shared); + shared=(H5B_shared_t *)H5RC_GET_OBJ(old_bt->rc_shared); HDassert(shared); /* Allocate memory for the new H5B_t object */ @@ -1726,8 +1726,8 @@ H5B_copy(const H5B_t *old_bt) /* Copy the main structure */ HDmemcpy(new_node,old_bt,sizeof(H5B_t)); - if ( NULL==(new_node->native=H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)) || - NULL==(new_node->child=H5FL_SEQ_MALLOC(haddr_t,(size_t)shared->two_k))) + if ( NULL==(new_node->native=(uint8_t *)H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)) || + NULL==(new_node->child=(haddr_t *)H5FL_SEQ_MALLOC(haddr_t,(size_t)shared->two_k))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree root node") /* Copy the other structures */ @@ -1793,9 +1793,9 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f /* * Load the tree node. */ - if (NULL == (bt = H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_READ))) + if (NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree node") - shared=H5RC_GET_OBJ(bt->rc_shared); + shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); /* diff --git a/src/H5Bcache.c b/src/H5Bcache.c index 443b482..fb3401d 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -107,7 +107,7 @@ H5B_serialize(const H5F_t *f, const H5B_t *bt) HDassert(f); HDassert(bt); HDassert(bt->rc_shared); - shared=H5RC_GET_OBJ(bt->rc_shared); + shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); p = shared->page; @@ -190,7 +190,7 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata) HDmemset(&bt->cache_info,0,sizeof(H5AC_info_t)); if((bt->rc_shared=(type->get_shared)(f, udata))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "can't retrieve B-tree node buffer") - shared=H5RC_GET_OBJ(bt->rc_shared); + shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); if (NULL==(bt->native=H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)) || NULL==(bt->child=H5FL_SEQ_MALLOC(haddr_t,(size_t)shared->two_k))) @@ -273,7 +273,7 @@ H5B_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *bt) HDassert(f); HDassert(H5F_addr_defined(addr)); HDassert(bt); - shared=H5RC_GET_OBJ(bt->rc_shared); + shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); HDassert(shared->type); HDassert(shared->type->encode); @@ -400,7 +400,7 @@ H5B_compute_size(const H5F_t *f, const H5B_t *bt, size_t *size_ptr) HDassert(f); HDassert(bt); HDassert(bt->rc_shared); - shared=H5RC_GET_OBJ(bt->rc_shared); + shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); HDassert(shared->type); HDassert(size_ptr); @@ -234,7 +234,7 @@ H5D_init_interface(void) assert(H5P_CLS_DATASET_XFER_g!=(-1)); /* Get the pointer to the dataset transfer class */ - if (NULL == (xfer_pclass = H5I_object(H5P_CLS_DATASET_XFER_g))) + if (NULL == (xfer_pclass = (H5P_genclass_t *)H5I_object(H5P_CLS_DATASET_XFER_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class") /* Get the number of properties in the class */ @@ -328,7 +328,7 @@ H5D_init_interface(void) assert(H5P_CLS_DATASET_CREATE_g != -1); /* Get the pointer to the dataset creation class */ - if(NULL == (crt_pclass = H5I_object(H5P_CLS_DATASET_CREATE_g))) + if(NULL == (crt_pclass = (H5P_genclass_t *)H5I_object(H5P_CLS_DATASET_CREATE_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class") /* Get the number of properties in the class */ @@ -387,7 +387,7 @@ H5D_init_interface(void) /* Get the default dataset cretion property list values and initialize the * default dataset with them. */ - if (NULL == (def_dcpl = H5I_object(H5P_LST_DATASET_CREATE_g))) + if (NULL == (def_dcpl = (H5P_genplist_t *)H5I_object(H5P_LST_DATASET_CREATE_g))) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "can't get default dataset creation property list") /* Set up the default allocation time information */ @@ -509,9 +509,9 @@ H5D_crt_copy(hid_t new_plist_id, hid_t old_plist_id, void UNUSED *copy_data) FUNC_ENTER_NOAPI(H5D_crt_copy, FAIL) /* Verify property list ID */ - if (NULL == (new_plist = H5I_object(new_plist_id))) + if (NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_plist_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list") - if (NULL == (old_plist = H5I_object(old_plist_id))) + if (NULL == (old_plist = (H5P_genplist_t *)H5I_object(old_plist_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list") /* Get the fill value, external file list, and data pipeline properties @@ -529,7 +529,8 @@ H5D_crt_copy(hid_t new_plist_id, hid_t old_plist_id, void UNUSED *copy_data) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't copy fill value") } /* end if */ else { - dst_fill.type = dst_fill.buf = NULL; + dst_fill.type = NULL; + dst_fill.buf = NULL; dst_fill.size = src_fill.size; } HDmemset(&dst_efl,0,sizeof(H5O_efl_t)); @@ -581,7 +582,7 @@ H5D_crt_close(hid_t dcpl_id, void UNUSED *close_data) FUNC_ENTER_NOAPI(H5D_crt_close, FAIL) /* Check arguments */ - if (NULL == (plist = H5I_object(dcpl_id))) + if (NULL == (plist = (H5P_genplist_t *)H5I_object(dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list") /* Get the fill value, external file list, and data pipeline properties @@ -860,7 +861,7 @@ H5D_xfer_create(hid_t dxpl_id, void UNUSED *create_data) FUNC_ENTER_NOAPI(H5D_xfer_create, FAIL) /* Check arguments */ - if (NULL == (plist = H5I_object(dxpl_id))) + if (NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") /* Get the driver information */ @@ -909,9 +910,9 @@ H5D_xfer_copy(hid_t new_dxpl_id, hid_t old_dxpl_id, void UNUSED *copy_data) FUNC_ENTER_NOAPI(H5D_xfer_copy, FAIL) - if(NULL == (new_plist = H5I_object(new_dxpl_id))) + if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (old_plist = H5I_object(old_dxpl_id))) + if(NULL == (old_plist = (H5P_genplist_t *)H5I_object(old_dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") /* Get values from old property list */ @@ -961,7 +962,7 @@ H5D_xfer_close(hid_t dxpl_id, void UNUSED *close_data) FUNC_ENTER_NOAPI(H5D_xfer_close, FAIL) /* Check arguments */ - if (NULL == (plist = H5I_object(dxpl_id))) + if (NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id)<0) @@ -1010,7 +1011,7 @@ H5D_get_dcpl_cache(hid_t dcpl_id, H5D_dcpl_cache_t *cache) assert(cache); /* Get the dataset transfer property list */ - if (NULL == (dc_plist = H5I_object(dcpl_id))) + if (NULL == (dc_plist = (H5P_genplist_t *)H5I_object(dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list") /* Get I/O pipeline info */ @@ -1078,7 +1079,7 @@ H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") if(H5I_DATATYPE != H5I_get_type(type_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype ID") - if(NULL == (space = H5I_object_verify(space_id,H5I_DATASPACE))) + if(NULL == (space = (H5S_t *)H5I_object_verify(space_id,H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace ID") if(H5P_DEFAULT == dcpl_id) dcpl_id = H5P_DATASET_CREATE_DEFAULT; @@ -1197,7 +1198,7 @@ H5Dclose(hid_t dset_id) H5TRACE1("e","i",dset_id); /* Check args */ - if(NULL == (dset = H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") /* @@ -1239,7 +1240,7 @@ H5Dget_space(hid_t dset_id) H5TRACE1("i","i",dset_id); /* Check args */ - if (NULL==(dset=H5I_object_verify(dset_id, H5I_DATASET))) + if (NULL==(dset=(H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") /* Read the data space message and return a data space object */ @@ -1286,7 +1287,7 @@ H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation) H5TRACE2("e","i*Ds",dset_id,allocation); /* Check arguments */ - if(NULL==(dset=H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL==(dset=(H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") /* Read data space address and return */ @@ -1390,7 +1391,7 @@ H5Dget_type(hid_t dset_id) H5TRACE1("i","i",dset_id); /* Check args */ - if (NULL==(dset=H5I_object_verify(dset_id, H5I_DATASET))) + if (NULL==(dset=(H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") /* Copy the datatype and mark it read-only */ @@ -1451,15 +1452,15 @@ H5Dget_create_plist(hid_t dset_id) H5TRACE1("i","i",dset_id); /* Check args */ - if (NULL==(dset=H5I_object_verify(dset_id, H5I_DATASET))) + if (NULL==(dset=(H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") - if (NULL == (dcpl_plist = H5I_object(dset->shared->dcpl_id))) + if (NULL == (dcpl_plist = (H5P_genplist_t *)H5I_object(dset->shared->dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") /* Copy the creation property list */ if((new_dcpl_id = H5P_copy_plist(dcpl_plist)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to copy the creation property list") - if (NULL == (new_plist = H5I_object(new_dcpl_id))) + if (NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") /* Get the fill value property */ @@ -1512,7 +1513,7 @@ H5Dextend(hid_t dset_id, const hsize_t *size) H5TRACE2("e","i*h",dset_id,size); /* Check args */ - if (NULL==(dset=H5I_object_verify(dset_id, H5I_DATASET))) + if (NULL==(dset=(H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") if (!size) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified") @@ -1568,7 +1569,7 @@ H5D_new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type) HDmemset(new_dset,0,sizeof(H5D_shared_t)); /* Get the property list */ - if (NULL == (plist = H5I_object(dcpl_id))) + if (NULL == (plist = (H5P_genplist_t *)H5I_object(dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list") new_dset->dcpl_id = H5P_copy_plist(plist); @@ -1769,7 +1770,8 @@ H5D_update_entry_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, H5P_genplist_t *p fill.fill_defined = TRUE; } else if (fill_status == H5D_FILL_VALUE_UNDEFINED) { fill.size = -1; - fill.type = fill.buf = NULL; + fill.type = NULL; + fill.buf = NULL; fill.fill_defined = FALSE; } else HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to determine if fill value is defined") @@ -1934,7 +1936,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space HDassert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); /* Get the dataset's datatype */ - if (NULL == (type = H5I_object(type_id))) + if (NULL == (type = (H5T_t *)H5I_object(type_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a datatype") /* Check if the datatype is "sensible" for use in a dataset */ @@ -1993,7 +1995,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space H5D_alloc_time_t alloc_time; /* Dataset's allocation time */ /* Get new dataset's property list object */ - if (NULL == (dc_plist = H5I_object(new_dset->shared->dcpl_id))) + if (NULL == (dc_plist = (H5P_genplist_t *)H5I_object(new_dset->shared->dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "can't get dataset creation property list") if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &dcpl_pline) < 0) @@ -2325,7 +2327,7 @@ H5D_open(const H5G_entry_t *ent, hid_t dxpl_id) HGOTO_ERROR (H5E_DATASET, H5E_CANTCOPY, NULL, "can't copy group entry") /* Check if dataset was already open */ - if((shared_fo = H5FO_opened(dataset->ent.file, dataset->ent.header))==NULL) { + if((shared_fo = (H5D_shared_t *)H5FO_opened(dataset->ent.file, dataset->ent.header))==NULL) { /* Clear any errors from H5FO_opened() */ H5E_clear(); @@ -2416,7 +2418,7 @@ H5D_open_oid(H5D_t *dataset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open") /* Get the type and space */ - if (NULL==(dataset->shared->type=H5O_read(&(dataset->ent), H5O_DTYPE_ID, 0, NULL, dxpl_id))) + if (NULL==(dataset->shared->type=(H5T_t *)H5O_read(&(dataset->ent), H5O_DTYPE_ID, 0, NULL, dxpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load type info from dataset header") /* Get a datatype ID for the dataset's datatype */ if((dataset->shared->type_id = H5I_register(H5I_DATATYPE, dataset->shared->type))<0) @@ -2426,7 +2428,7 @@ H5D_open_oid(H5D_t *dataset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load space info from dataset header") /* Get dataset creation property list object */ - if(NULL == (plist = H5I_object(dataset->shared->dcpl_id))) + if(NULL == (plist = (H5P_genplist_t *)H5I_object(dataset->shared->dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") /* Get the optional filters message */ @@ -2551,7 +2553,8 @@ H5D_open_oid(H5D_t *dataset, hid_t dxpl_id) HDmemset(fill_prop, 0, sizeof(H5O_fill_t)); } /* end if */ if(fill_prop->size == 0) { - fill_prop->type = fill_prop->buf = NULL; + fill_prop->type = NULL; + fill_prop->buf = NULL; fill_prop->size = (size_t)-1; } /* end if */ } /* end else */ @@ -3175,7 +3178,7 @@ H5Dget_storage_size(hid_t dset_id) H5TRACE1("h","i",dset_id); /* Check args */ - if (NULL==(dset=H5I_object_verify(dset_id, H5I_DATASET))) + if (NULL==(dset=(H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataset") /* Set return value */ @@ -3261,7 +3264,7 @@ H5Dget_offset(hid_t dset_id) H5TRACE1("a","i",dset_id); /* Check args */ - if (NULL==(dset=H5I_object_verify(dset_id, H5I_DATASET))) + if (NULL==(dset=(H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "not a dataset") /* Set return value */ @@ -3405,7 +3408,7 @@ H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid buffer") if(H5I_DATATYPE != H5I_get_type(type_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid datatype") - if(NULL == (space = H5I_object_verify(space_id, H5I_DATASPACE))) + if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataspace") if(!(H5S_has_extent(space)) ) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspace does not have extent set") @@ -3479,7 +3482,7 @@ H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf) /* Check args */ if (H5I_DATATYPE != H5I_get_type(type_id) || buf == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument") - if(NULL == (space = H5I_object_verify(space_id, H5I_DATASPACE))) + if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataspace") if(!(H5S_has_extent(space))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspace does not have extent set") @@ -3615,7 +3618,7 @@ H5D_vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, co HDassert(H5I_DATATYPE == H5I_get_type(type_id)); /* Check args */ - if(NULL == (dt = H5I_object(type_id))) + if(NULL == (dt = (H5T_t *)H5I_object(type_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Make certain there is enough fixed-length buffer available */ @@ -3677,7 +3680,7 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, if(H5I_DATASET!=H5I_get_type(dataset_id) || H5I_DATATYPE!=H5I_get_type(type_id) || size==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument") - if(NULL == (space = H5I_object_verify(space_id, H5I_DATASPACE))) + if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataspace") if(!(H5S_has_extent(space))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspace does not have extent set") @@ -3700,7 +3703,7 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "no temporary buffers available") /* Get the pointer to the dataset transfer class */ - if (NULL == (pclass = H5I_object(H5P_CLS_DATASET_XFER_g))) + if (NULL == (pclass = (H5P_genclass_t *)H5I_object(H5P_CLS_DATASET_XFER_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class") /* Change to the custom memory allocation routines for reading VL data */ @@ -3708,7 +3711,7 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "no dataset xfer plists available") /* Get the property list struct */ - if (NULL == (plist = H5I_object(vlen_bufsize.xfer_pid))) + if (NULL == (plist = (H5P_genplist_t *)H5I_object(vlen_bufsize.xfer_pid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") /* Set the memory manager to the special allocation routine */ @@ -3771,7 +3774,7 @@ H5Dset_extent(hid_t dset_id, const hsize_t *size) H5TRACE2("e","i*h",dset_id,size); /* Check args */ - if(NULL == (dset = H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") if(!size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified") @@ -3933,12 +3936,12 @@ H5D_flush(const H5F_t *f, hid_t dxpl_id, unsigned flags) /* Check for something to do */ if(num_dsets>0) { H5_CHECK_OVERFLOW(num_dsets,unsigned,size_t); - if(NULL==(id_list=H5MM_malloc((size_t)num_dsets*sizeof(hid_t)))) + if(NULL==(id_list=(hid_t *)H5MM_malloc((size_t)num_dsets*sizeof(hid_t)))) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to allocate memory for ID list") if(H5F_get_obj_ids(f, H5F_OBJ_DATASET, -1, id_list) != num_dsets) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to get dataset ID list") for(u = 0; u < num_dsets; u++) { - if(NULL==(dataset=H5I_object_verify(id_list[u], H5I_DATASET))) + if(NULL==(dataset=(H5D_t *)H5I_object_verify(id_list[u], H5I_DATASET))) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to get dataset object") /* Flush the raw data buffer, if we have a dirty one */ @@ -4015,7 +4018,7 @@ H5Ddebug(hid_t dset_id) H5TRACE1("e","i",dset_id); /* Check args */ - if(NULL == (dset = H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") /* Print B-tree information */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index b492548..46ed877 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -689,7 +689,7 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, H5F_t *file=io_info->dset->ent.file; /* File for dataset */ H5D_rdcdc_t *dset_contig=&(io_info->dset->shared->cache.contig); /* Cached information about contiguous data */ const H5D_contig_storage_t *store_contig=&(io_info->store->contig); /* Contiguous storage info for this I/O operation */ - const unsigned char *buf=_buf; /* Pointer to buffer to fill */ + const unsigned char *buf=(const unsigned char *)_buf; /* Pointer to buffer to fill */ haddr_t addr; /* Actual address to read */ size_t total_size=0; /* Size of sequence in bytes */ size_t size; /* Size of sequence in bytes */ diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h index 0f22c8a..bb2a174 100644 --- a/src/H5FLprivate.h +++ b/src/H5FLprivate.h @@ -81,10 +81,10 @@ typedef struct H5FL_reg_head_t { #define H5FL_DEFINE_STATIC(t) static H5FL_DEFINE_COMMON(t) /* Allocate an object of type 't' */ -#define H5FL_MALLOC(t) H5FL_reg_malloc(&(H5FL_REG_NAME(t))) +#define H5FL_MALLOC(t) (t *)H5FL_reg_malloc(&(H5FL_REG_NAME(t))) /* Allocate an object of type 't' and clear it to all zeros */ -#define H5FL_CALLOC(t) H5FL_reg_calloc(&(H5FL_REG_NAME(t))) +#define H5FL_CALLOC(t) (t *)H5FL_reg_calloc(&(H5FL_REG_NAME(t))) /* Free an object of type 't' */ #define H5FL_FREE(t,obj) H5FL_reg_free(&(H5FL_REG_NAME(t)),obj) @@ -101,8 +101,8 @@ typedef struct H5FL_reg_head_t { #define H5FL_DEFINE(t) H5_DLL H5FL_DEFINE_COMMON(t) #define H5FL_EXTERN(t) extern H5_DLL int H5FL_REG_NAME(t) #define H5FL_DEFINE_STATIC(t) static H5FL_DEFINE_COMMON(t) -#define H5FL_MALLOC(t) H5MM_malloc(sizeof(t)) -#define H5FL_CALLOC(t) H5MM_calloc(sizeof(t)) +#define H5FL_MALLOC(t) (t *)H5MM_malloc(sizeof(t)) +#define H5FL_CALLOC(t) (t *)H5MM_calloc(sizeof(t)) #define H5FL_FREE(t,obj) H5MM_xfree(obj) #endif /* H5_NO_REG_FREE_LISTS */ @@ -150,16 +150,16 @@ typedef struct H5FL_blk_head_t { #define H5FL_BLK_DEFINE_STATIC(t) static H5FL_BLK_DEFINE_COMMON(t) /* Allocate an block of type 't' */ -#define H5FL_BLK_MALLOC(t,size) H5FL_blk_malloc(&(H5FL_BLK_NAME(t)),size) +#define H5FL_BLK_MALLOC(t,size) (uint8_t *)H5FL_blk_malloc(&(H5FL_BLK_NAME(t)),size) /* Allocate an block of type 't' and clear it to zeros */ -#define H5FL_BLK_CALLOC(t,size) H5FL_blk_calloc(&(H5FL_BLK_NAME(t)),size) +#define H5FL_BLK_CALLOC(t,size) (uint8_t *)H5FL_blk_calloc(&(H5FL_BLK_NAME(t)),size) /* Free a block of type 't' */ -#define H5FL_BLK_FREE(t,blk) H5FL_blk_free(&(H5FL_BLK_NAME(t)),blk) +#define H5FL_BLK_FREE(t,blk) (uint8_t *)H5FL_blk_free(&(H5FL_BLK_NAME(t)),blk) /* Re-allocate a block of type 't' */ -#define H5FL_BLK_REALLOC(t,blk,new_size) H5FL_blk_realloc(&(H5FL_BLK_NAME(t)),blk,new_size) +#define H5FL_BLK_REALLOC(t,blk,new_size) (uint8_t *)H5FL_blk_realloc(&(H5FL_BLK_NAME(t)),blk,new_size) /* Check if there is a free block available to re-use */ #define H5FL_BLK_AVAIL(t,size) H5FL_blk_free_block_avail(&(H5FL_BLK_NAME(t)),size) @@ -171,10 +171,10 @@ typedef struct H5FL_blk_head_t { #define H5FL_BLK_DEFINE(t) H5_DLL H5FL_BLK_DEFINE_COMMON(t) #define H5FL_BLK_EXTERN(t) extern H5_DLL int H5FL_BLK_NAME(t) #define H5FL_BLK_DEFINE_STATIC(t) static H5FL_BLK_DEFINE_COMMON(t) -#define H5FL_BLK_MALLOC(t,size) H5MM_malloc(size) -#define H5FL_BLK_CALLOC(t,size) H5MM_calloc(size) -#define H5FL_BLK_FREE(t,blk) H5MM_xfree(blk) -#define H5FL_BLK_REALLOC(t,blk,new_size) H5MM_realloc(blk,new_size) +#define H5FL_BLK_MALLOC(t,size) (uint8_t *)H5MM_malloc(size) +#define H5FL_BLK_CALLOC(t,size) (uint8_t *)H5MM_calloc(size) +#define H5FL_BLK_FREE(t,blk) (uint8_t *)H5MM_xfree(blk) +#define H5FL_BLK_REALLOC(t,blk,new_size) (uint8_t *)H5MM_realloc(blk,new_size) #define H5FL_BLK_AVAIL(t,size) (FALSE) #endif /* H5_NO_BLK_FREE_LISTS */ @@ -282,16 +282,16 @@ typedef struct H5FL_seq_head_t { #define H5FL_SEQ_DEFINE_STATIC(t) static H5FL_SEQ_DEFINE_COMMON(t) /* Allocate a sequence of type 't' */ -#define H5FL_SEQ_MALLOC(t,elem) H5FL_seq_malloc(&(H5FL_SEQ_NAME(t)),elem) +#define H5FL_SEQ_MALLOC(t,elem) (t *)H5FL_seq_malloc(&(H5FL_SEQ_NAME(t)),elem) /* Allocate a sequence of type 't' and clear it to all zeros */ -#define H5FL_SEQ_CALLOC(t,elem) H5FL_seq_calloc(&(H5FL_SEQ_NAME(t)),elem) +#define H5FL_SEQ_CALLOC(t,elem) (t *)H5FL_seq_calloc(&(H5FL_SEQ_NAME(t)),elem) /* Free a sequence of type 't' */ #define H5FL_SEQ_FREE(t,obj) H5FL_seq_free(&(H5FL_SEQ_NAME(t)),obj) /* Re-allocate a sequence of type 't' */ -#define H5FL_SEQ_REALLOC(t,obj,new_elem) H5FL_seq_realloc(&(H5FL_SEQ_NAME(t)),obj,new_elem) +#define H5FL_SEQ_REALLOC(t,obj,new_elem) (t *)H5FL_seq_realloc(&(H5FL_SEQ_NAME(t)),obj,new_elem) #else /* H5_NO_SEQ_FREE_LISTS */ /* Common macro for H5FL_BLK_DEFINE & H5FL_BLK_DEFINE_STATIC */ @@ -300,10 +300,10 @@ typedef struct H5FL_seq_head_t { #define H5FL_SEQ_DEFINE(t) H5_DLL H5FL_SEQ_DEFINE_COMMON(t) #define H5FL_SEQ_EXTERN(t) extern H5_DLL int H5FL_SEQ_NAME(t) #define H5FL_SEQ_DEFINE_STATIC(t) static H5FL_SEQ_DEFINE_COMMON(t) -#define H5FL_SEQ_MALLOC(t,elem) H5MM_malloc((elem)*sizeof(t)) -#define H5FL_SEQ_CALLOC(t,elem) H5MM_calloc((elem)*sizeof(t)) +#define H5FL_SEQ_MALLOC(t,elem) (t *)H5MM_malloc((elem)*sizeof(t)) +#define H5FL_SEQ_CALLOC(t,elem) (t *)H5MM_calloc((elem)*sizeof(t)) #define H5FL_SEQ_FREE(t,obj) H5MM_xfree(obj) -#define H5FL_SEQ_REALLOC(t,obj,new_elem) H5MM_realloc(obj,(new_elem)*sizeof(t)) +#define H5FL_SEQ_REALLOC(t,obj,new_elem) (t *)H5MM_realloc(obj,(new_elem)*sizeof(t)) #endif /* H5_NO_SEQ_FREE_LISTS */ /* |