diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-08-21 21:15:00 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-08-21 21:15:00 (GMT) |
commit | 7a2756e7ae8164ac6601957f3a9617a00456f918 (patch) | |
tree | 07de6d5fe4151080e2da9375156ee5a62c2c627b /src/H5B.c | |
parent | 428715468b9ddbe7077a191939fde535588afe3a (diff) | |
download | hdf5-7a2756e7ae8164ac6601957f3a9617a00456f918.zip hdf5-7a2756e7ae8164ac6601957f3a9617a00456f918.tar.gz hdf5-7a2756e7ae8164ac6601957f3a9617a00456f918.tar.bz2 |
[svn-r15513] Description:
Bring back r15510 & r15512 from trunk:
Fix compiler warnings and formatting.
Tested on:
Mac OS X/32 10.5.4 (amazon)
More tests upcoming
Diffstat (limited to 'src/H5B.c')
-rw-r--r-- | src/H5B.c | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -1903,42 +1903,42 @@ H5B_copy(const H5B_t *old_bt) /* * Check arguments. */ - assert(old_bt); - shared=(H5B_shared_t *)H5RC_GET_OBJ(old_bt->rc_shared); + HDassert(old_bt); + shared = (H5B_shared_t *)H5RC_GET_OBJ(old_bt->rc_shared); HDassert(shared); /* Allocate memory for the new H5B_t object */ - if (NULL==(new_node = H5FL_MALLOC(H5B_t))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree root node") + if(NULL == (new_node = H5FL_MALLOC(H5B_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree root node") /* Copy the main structure */ - HDmemcpy(new_node,old_bt,sizeof(H5B_t)); + 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))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree root node") + 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))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree root node") /* Copy the other structures */ - HDmemcpy(new_node->native,old_bt->native,shared->sizeof_keys); - HDmemcpy(new_node->child,old_bt->child,(sizeof(haddr_t)*shared->two_k)); + HDmemcpy(new_node->native, old_bt->native, shared->sizeof_keys); + HDmemcpy(new_node->child, old_bt->child, (sizeof(haddr_t) * shared->two_k)); /* Increment the ref-count on the raw page */ H5RC_INC(new_node->rc_shared); /* Set return value */ - ret_value=new_node; + ret_value = new_node; done: - if(ret_value==NULL) { + if(NULL == ret_value) { if(new_node) { - H5FL_BLK_FREE (native_block,new_node->native); - H5FL_SEQ_FREE (haddr_t,new_node->child); - H5FL_FREE (H5B_t,new_node); + (void)H5FL_BLK_FREE(native_block, new_node->native); + H5FL_SEQ_FREE(haddr_t, new_node->child); + (void)H5FL_FREE(H5B_t, new_node); } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5B_copy */ +} /* end H5B_copy() */ /*------------------------------------------------------------------------- |