summaryrefslogtreecommitdiffstats
path: root/src/H5Ocopy.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2013-06-27 15:44:50 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2013-06-27 15:44:50 (GMT)
commit0fe43fbf2cd56f142ec322daca2a669fac8243ed (patch)
treef01427e9de3133b822475e1aeb3c73ad21a4ec1f /src/H5Ocopy.c
parent7320a66aa7224549c308132a796cef325d377116 (diff)
parenta4dc3ff34d2dec4db339851df381b67970853f2a (diff)
downloadhdf5-0fe43fbf2cd56f142ec322daca2a669fac8243ed.zip
hdf5-0fe43fbf2cd56f142ec322daca2a669fac8243ed.tar.gz
hdf5-0fe43fbf2cd56f142ec322daca2a669fac8243ed.tar.bz2
[svn-r23834] merge from trunk up to r23833.
Fixed several conflicts, mostly because calling API routines internally was removed from several places in the trunk.
Diffstat (limited to 'src/H5Ocopy.c')
-rw-r--r--src/H5Ocopy.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index 85346eb..543a9c1 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -326,9 +326,9 @@ herr_t H5O_copy(H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, const
done:
if(loc_found && H5G_loc_free(&src_loc) < 0)
- HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location")
- if(obj_open)
- H5O_close(&src_oloc);
+ HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location")
+ if(obj_open && H5O_close(&src_oloc) < 0)
+ HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, FAIL, "unable to release object header")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_copy() */
@@ -709,7 +709,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
} /* end if */
/* Add in destination's object header size now */
- dst_oh_size += H5O_SIZEOF_HDR(oh_dst);
+ dst_oh_size += (uint64_t)H5O_SIZEOF_HDR(oh_dst);
/* Allocate space for chunk in destination file */
if(HADDR_UNDEF == (oh_dst->chunk[0].addr = H5MF_alloc(oloc_dst->file, H5FD_MEM_OHDR, dxpl_id, (hsize_t)dst_oh_size)))
@@ -1324,7 +1324,8 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
H5O_loc_t dst_oloc; /* Copied object object location */
H5O_loc_t src_oloc; /* Temporary object location for source object */
H5G_loc_t dst_root_loc; /* The location of root group of the destination file */
- uint8_t *p; /* Pointer to OID to store */
+ const uint8_t *q; /* Pointer to source OID to store */
+ uint8_t *p; /* Pointer to destination OID to store */
size_t i; /* Local index variable */
herr_t ret_value = SUCCEED;
@@ -1358,8 +1359,8 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
/* Making equivalent references in the destination file */
for(i = 0; i < ref_count; i++) {
/* Set up for the object copy for the reference */
- p = (uint8_t *)(&src_ref[i]);
- H5F_addr_decode(src_oloc.file, (const uint8_t **)&p, &(src_oloc.addr));
+ q = (uint8_t *)(&src_ref[i]);
+ H5F_addr_decode(src_oloc.file, (const uint8_t **)&q, &(src_oloc.addr));
dst_oloc.addr = HADDR_UNDEF;
/* Attempt to copy object from source to destination file */
@@ -1387,9 +1388,9 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
/* Making equivalent references in the destination file */
for(i = 0; i < ref_count; i++) {
/* Get the heap ID for the dataset region */
- p = (uint8_t *)(&src_ref[i]);
- H5F_addr_decode(src_oloc.file, (const uint8_t **)&p, &(hobjid.addr));
- INT32DECODE(p, hobjid.idx);
+ q = (const uint8_t *)(&src_ref[i]);
+ H5F_addr_decode(src_oloc.file, (const uint8_t **)&q, &(hobjid.addr));
+ UINT32DECODE(q, hobjid.idx);
if(hobjid.addr != (haddr_t)0) {
/* Get the dataset region from the heap (allocate inside routine) */
@@ -1397,8 +1398,8 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information")
/* Get the object oid for the dataset */
- p = (uint8_t *)buf;
- H5F_addr_decode(src_oloc.file, (const uint8_t **)&p, &(src_oloc.addr));
+ q = (const uint8_t *)buf;
+ H5F_addr_decode(src_oloc.file, (const uint8_t **)&q, &(src_oloc.addr));
dst_oloc.addr = HADDR_UNDEF;
/* copy the object pointed by the ref to the destination */
@@ -1424,7 +1425,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id,
/* Set the dataset region reference info for the destination file */
p = (uint8_t *)(&dst_ref[i]);
H5F_addr_encode(dst_oloc.file, &p, hobjid.addr);
- INT32ENCODE(p, hobjid.idx);
+ UINT32ENCODE(p, hobjid.idx);
/* Free the buffer allocated in H5HG_read() */
H5MM_xfree(buf);