diff options
Diffstat (limited to 'hl/src')
-rw-r--r-- | hl/src/H5DO.c | 41 | ||||
-rw-r--r-- | hl/src/H5LT.c | 4 |
2 files changed, 23 insertions, 22 deletions
diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c index bfadfaa..e2b436a 100644 --- a/hl/src/H5DO.c +++ b/hl/src/H5DO.c @@ -165,7 +165,7 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, created_dxpl = TRUE; } /* end if */ else if(TRUE != H5Pisa_class(dxpl_id, H5P_DATASET_XFER)) - goto done; + goto done; /* Get the dataspace of the dataset */ if(FAIL == (space_id = H5Dget_space(dset_id))) @@ -219,7 +219,8 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, nelmts = (hsize_t)snelmts; /* create a memory space */ - mem_space_id = H5Screate_simple(1, &nelmts, NULL); + if(FAIL == (mem_space_id = H5Screate_simple(1, &nelmts, NULL))) + goto done; /* Write the data */ if(H5Dwrite(dset_id, memtype, mem_space_id, new_space_id, dxpl_id, buf) < 0) @@ -237,24 +238,24 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, goto done; /* No boundary for this axis */ - if(boundary[axis] == 0) - goto done; - - /* Determine whether a boundary is hit or not */ - for(k = start[axis]; k < size[axis]; k++) - if(!((k + 1) % boundary[axis])) { - hit = TRUE; - break; - } - - if(hit) { /* Hit the boundary */ - /* Invoke callback if there is one */ - if(append_cb && append_cb(dset_id, size, udata) < 0) - goto done; - - /* Do a dataset flush */ - if(H5Dflush(dset_id) < 0) - goto done; + if(boundary[axis] != 0) { + + /* Determine whether a boundary is hit or not */ + for(k = start[axis]; k < size[axis]; k++) + if(!((k + 1) % boundary[axis])) { + hit = TRUE; + break; + } + + if(hit) { /* Hit the boundary */ + /* Invoke callback if there is one */ + if(append_cb && append_cb(dset_id, size, udata) < 0) + goto done; + + /* Do a dataset flush */ + if(H5Dflush(dset_id) < 0) + goto done; + } /* end if */ } /* end if */ /* Indicate success */ diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 107e238..b7e0b4a 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -894,8 +894,8 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) /* set allocation increment to a percentage of the supplied buffer size, or * a pre-defined minimum increment value, whichever is larger */ - if ((buf_prcnt * buf_size) > min_incr) - alloc_incr = (size_t)(buf_prcnt * buf_size); + if ((size_t)(buf_prcnt * (double)buf_size) > min_incr) + alloc_incr = (size_t)(buf_prcnt * (double)buf_size); else alloc_incr = min_incr; |