summaryrefslogtreecommitdiffstats
path: root/src/H5Dint.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2017-06-09 22:09:08 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2017-06-09 22:09:08 (GMT)
commit005bf26ff83fcd28255a77fb9bbb4a64495cb4a2 (patch)
treecbaf52a8a57f0fb6ad45c74b3193e6ee55ecbc78 /src/H5Dint.c
parenteaedb70001536ae6c2a7f753c3a358f0e8ce5011 (diff)
downloadhdf5-005bf26ff83fcd28255a77fb9bbb4a64495cb4a2.zip
hdf5-005bf26ff83fcd28255a77fb9bbb4a64495cb4a2.tar.gz
hdf5-005bf26ff83fcd28255a77fb9bbb4a64495cb4a2.tar.bz2
Revert "Merge pull request #567 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:develop to develop"
This reverts commit 4242753848c44ab3b5d226e66225eac2f64db314, reversing changes made to b0e79fe6dd20ec7aa1b3e5f0f8b370639a4ef5bd.
Diffstat (limited to 'src/H5Dint.c')
-rw-r--r--src/H5Dint.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c
index c13a7a1..08b3eb8 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -104,9 +104,6 @@ H5FL_EXTERN(H5D_chunk_info_t);
/* Declare extern the free list to manage blocks of type conversion data */
H5FL_BLK_EXTERN(type_conv);
-/* Declare a free list to manage the H5O_layout_t struct */
-H5FL_EXTERN(H5O_layout_t);
-
/* Define a static "default" dataset structure to use to initialize new datasets */
static H5D_shared_t H5D_def_dset;
@@ -3305,7 +3302,7 @@ H5D_get_create_plist(H5D_t *dset)
{
H5P_genplist_t *dcpl_plist; /* Dataset's DCPL */
H5P_genplist_t *new_plist; /* Copy of dataset's DCPL */
- H5O_layout_t *copied_layout = NULL; /* Layout to tweak */
+ H5O_layout_t copied_layout; /* Layout to tweak */
H5O_fill_t copied_fill; /* Fill value to tweak */
H5O_efl_t copied_efl; /* External file list to tweak */
hid_t new_dcpl_id = FAIL;
@@ -3328,41 +3325,39 @@ H5D_get_create_plist(H5D_t *dset)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object creation info")
/* Get the layout property */
- if(NULL == (copied_layout = H5FL_CALLOC(H5O_layout_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout")
- if(H5P_peek(new_plist, H5D_CRT_LAYOUT_NAME, copied_layout) < 0)
+ if(H5P_peek(new_plist, H5D_CRT_LAYOUT_NAME, &copied_layout) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout")
/* Reset layout values set when dataset is created */
- copied_layout->ops = NULL;
- switch(copied_layout->type) {
+ copied_layout.ops = NULL;
+ switch(copied_layout.type) {
case H5D_COMPACT:
- copied_layout->storage.u.compact.buf = H5MM_xfree(copied_layout->storage.u.compact.buf);
- HDmemset(&copied_layout->storage.u.compact, 0, sizeof(copied_layout->storage.u.compact));
+ copied_layout.storage.u.compact.buf = H5MM_xfree(copied_layout.storage.u.compact.buf);
+ HDmemset(&copied_layout.storage.u.compact, 0, sizeof(copied_layout.storage.u.compact));
break;
case H5D_CONTIGUOUS:
- copied_layout->storage.u.contig.addr = HADDR_UNDEF;
- copied_layout->storage.u.contig.size = 0;
+ copied_layout.storage.u.contig.addr = HADDR_UNDEF;
+ copied_layout.storage.u.contig.size = 0;
break;
case H5D_CHUNKED:
/* Reset chunk size */
- copied_layout->u.chunk.size = 0;
+ copied_layout.u.chunk.size = 0;
/* Reset index info, if the chunk ops are set */
- if(copied_layout->storage.u.chunk.ops)
- /* Reset address and pointer of the array struct for the chunked storage index */
- if(H5D_chunk_idx_reset(&copied_layout->storage.u.chunk, TRUE) < 0)
+ if(copied_layout.storage.u.chunk.ops)
+ /* Reset address and pointer of the array struct for the chunked storage index */
+ if(H5D_chunk_idx_reset(&copied_layout.storage.u.chunk, TRUE) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to reset chunked storage index in dest")
/* Reset chunk index ops */
- copied_layout->storage.u.chunk.ops = NULL;
+ copied_layout.storage.u.chunk.ops = NULL;
break;
case H5D_VIRTUAL:
- copied_layout->storage.u.virt.serial_list_hobjid.addr = HADDR_UNDEF;
- copied_layout->storage.u.virt.serial_list_hobjid.idx = 0;
+ copied_layout.storage.u.virt.serial_list_hobjid.addr = HADDR_UNDEF;
+ copied_layout.storage.u.virt.serial_list_hobjid.idx = 0;
break;
case H5D_LAYOUT_ERROR:
@@ -3372,7 +3367,7 @@ H5D_get_create_plist(H5D_t *dset)
} /* end switch */
/* Set back the (possibly modified) layout property to property list */
- if(H5P_poke(new_plist, H5D_CRT_LAYOUT_NAME, copied_layout) < 0)
+ if(H5P_poke(new_plist, H5D_CRT_LAYOUT_NAME, &copied_layout) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set layout")
/* Get the fill value property */
@@ -3464,9 +3459,6 @@ done:
if(H5I_dec_app_ref(new_dcpl_id) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to close temporary object")
- if(copied_layout)
- copied_layout = H5FL_FREE(H5O_layout_t, copied_layout);
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_get_create_plist() */