diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5D.c | 6 | ||||
-rw-r--r-- | src/H5Distore.c | 8 | ||||
-rw-r--r-- | src/H5Fistore.c | 8 | ||||
-rw-r--r-- | src/H5Fprivate.h | 3 | ||||
-rw-r--r-- | src/H5Ofill.c | 11 |
5 files changed, 21 insertions, 15 deletions
@@ -960,7 +960,8 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to convert fill value to dataset type"); } - if (H5O_modify(&(new_dset->ent), H5O_FILL, 0, H5O_FLAG_CONSTANT, + if (new_dset->create_parms->fill.buf && + H5O_modify(&(new_dset->ent), H5O_FILL, 0, H5O_FLAG_CONSTANT, &(new_dset->create_parms->fill))<0) { HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to update fill value header message"); @@ -2224,7 +2225,8 @@ H5D_allocate (H5D_t *dataset, const H5D_xfer_t *xfer) if (H5F_istore_allocate(dataset->ent.file, (layout), space_dim, xfer->split_ratios, - &(dataset->create_parms->pline))<0) { + &(dataset->create_parms->pline), + &(dataset->create_parms->fill))<0) { HRETURN(FAIL); } break; diff --git a/src/H5Distore.c b/src/H5Distore.c index ebfb004..8c9dd1b 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -1625,7 +1625,7 @@ H5F_istore_read(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout, l.dim[i] = layout->dim[i]; l.addr = udata.addr; tmp_xfer.xfer_mode = H5D_XFER_DFLT; - if (H5F_arr_read(f, &tmp_xfer, &l, pline, NULL/*no efl*/, + if (H5F_arr_read(f, &tmp_xfer, &l, pline, fill, NULL/*no efl*/, sub_size, size_m, sub_offset_m, offset_wrt_chunk, buf)==FAIL){ HRETURN_ERROR (H5E_IO, H5E_READERROR, FAIL, @@ -1802,7 +1802,7 @@ H5F_istore_write(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout, l.dim[i] = layout->dim[i]; l.addr = udata.addr; tmp_xfer.xfer_mode = H5D_XFER_DFLT; - if (H5F_arr_write(f, &tmp_xfer, &l, pline, NULL/*no efl*/, + if (H5F_arr_write(f, &tmp_xfer, &l, pline, fill, NULL/*no efl*/, sub_size, size_m, sub_offset_m, offset_wrt_chunk, buf)==FAIL){ HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, @@ -2080,7 +2080,7 @@ H5F_istore_get_addr (H5F_t *f, const H5O_layout_t *layout, herr_t H5F_istore_allocate (H5F_t *f, const H5O_layout_t *layout, const hsize_t *space_dim, const double split_ratios[], - const H5O_pline_t *pline) + const H5O_pline_t *pline, const H5O_fill_t *fill) { intn i, carry; @@ -2140,7 +2140,7 @@ H5F_istore_allocate (H5F_t *f, const H5O_layout_t *layout, * chunk. */ if (NULL==(chunk=H5F_istore_lock (f, layout, split_ratios, pline, - chunk_offset, FALSE, + fill, chunk_offset, FALSE, &idx_hint))) { HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to read raw data chunk"); diff --git a/src/H5Fistore.c b/src/H5Fistore.c index ebfb004..8c9dd1b 100644 --- a/src/H5Fistore.c +++ b/src/H5Fistore.c @@ -1625,7 +1625,7 @@ H5F_istore_read(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout, l.dim[i] = layout->dim[i]; l.addr = udata.addr; tmp_xfer.xfer_mode = H5D_XFER_DFLT; - if (H5F_arr_read(f, &tmp_xfer, &l, pline, NULL/*no efl*/, + if (H5F_arr_read(f, &tmp_xfer, &l, pline, fill, NULL/*no efl*/, sub_size, size_m, sub_offset_m, offset_wrt_chunk, buf)==FAIL){ HRETURN_ERROR (H5E_IO, H5E_READERROR, FAIL, @@ -1802,7 +1802,7 @@ H5F_istore_write(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout, l.dim[i] = layout->dim[i]; l.addr = udata.addr; tmp_xfer.xfer_mode = H5D_XFER_DFLT; - if (H5F_arr_write(f, &tmp_xfer, &l, pline, NULL/*no efl*/, + if (H5F_arr_write(f, &tmp_xfer, &l, pline, fill, NULL/*no efl*/, sub_size, size_m, sub_offset_m, offset_wrt_chunk, buf)==FAIL){ HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, @@ -2080,7 +2080,7 @@ H5F_istore_get_addr (H5F_t *f, const H5O_layout_t *layout, herr_t H5F_istore_allocate (H5F_t *f, const H5O_layout_t *layout, const hsize_t *space_dim, const double split_ratios[], - const H5O_pline_t *pline) + const H5O_pline_t *pline, const H5O_fill_t *fill) { intn i, carry; @@ -2140,7 +2140,7 @@ H5F_istore_allocate (H5F_t *f, const H5O_layout_t *layout, * chunk. */ if (NULL==(chunk=H5F_istore_lock (f, layout, split_ratios, pline, - chunk_offset, FALSE, + fill, chunk_offset, FALSE, &idx_hint))) { HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to read raw data chunk"); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index ca787f7..7f25090 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -569,7 +569,8 @@ herr_t H5F_istore_allocate (H5F_t *f, const struct H5O_layout_t *layout, const hsize_t *space_dim, const double split_ratios[], - const struct H5O_pline_t *pline); + const struct H5O_pline_t *pline, + const struct H5O_fill_t *fill); /* Functions that operate on contiguous storage wrt boot block */ herr_t H5F_block_read(H5F_t *f, const haddr_t *addr, hsize_t size, diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 1328307..29e5914 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -75,11 +75,14 @@ H5O_fill_decode(H5F_t *f, const uint8 *p, H5O_shared_t *sh) "memory allocation failed for fill value message"); } UINT32DECODE(p, mesg->size); - if (NULL==(mesg->buf=H5MM_malloc(mesg->size))) { - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, - "memory allocation failed for fill value"); + if (mesg->size>0) { + if (NULL==(mesg->buf=H5MM_malloc(mesg->size))) { + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, + "memory allocation failed for fill value"); + } + HDmemcpy(mesg->buf, p, mesg->size); } - HDmemcpy(mesg->buf, p, mesg->size); + ret_value = (void*)mesg; done: |