diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-22 21:07:54 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-22 21:07:54 (GMT) |
commit | dc41c7371153fc4cf7bba6cf09868a03f19e445a (patch) | |
tree | 252c829a898c1bb379301baf9dc1771bd6901e81 /src/H5Oefl.c | |
parent | 681d9231cf2fb1f01ef84c14285195c059d64a16 (diff) | |
download | hdf5-dc41c7371153fc4cf7bba6cf09868a03f19e445a.zip hdf5-dc41c7371153fc4cf7bba6cf09868a03f19e445a.tar.gz hdf5-dc41c7371153fc4cf7bba6cf09868a03f19e445a.tar.bz2 |
[svn-r13167] Description:
Get rid of two different types of fill value struct (merge H5O_fill_t
and H5O_fill_new_t) and clean up & simplify dataset initialization code.
(In preparation for shared object header message method call
refactoring).
Tested on:
FreeBSD/32 6.2 (duty)
Mac OS X/32 10.4.8 (amazon)
Diffstat (limited to 'src/H5Oefl.c')
-rw-r--r-- | src/H5Oefl.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 14a8c7a..5035e17 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -269,36 +269,34 @@ H5O_efl_copy(const void *_mesg, void *_dest) size_t u; /* Local index variable */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_efl_copy); + FUNC_ENTER_NOAPI_NOINIT(H5O_efl_copy) /* check args */ - assert(mesg); - if (!dest) { - if (NULL==(dest = H5MM_calloc(sizeof(H5O_efl_t))) || - NULL==(dest->slot=H5MM_malloc(mesg->nalloc* sizeof(H5O_efl_entry_t)))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - - } else if (dest->nalloc<mesg->nalloc) { + HDassert(mesg); + if(!dest) { + if(NULL == (dest = H5MM_calloc(sizeof(H5O_efl_t))) || + NULL == (dest->slot = H5MM_malloc(mesg->nalloc * sizeof(H5O_efl_entry_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + } else if(dest->nalloc < mesg->nalloc) { H5MM_xfree(dest->slot); - if (NULL==(dest->slot = H5MM_malloc(mesg->nalloc* - sizeof(H5O_efl_entry_t)))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); + if(NULL == (dest->slot = H5MM_malloc(mesg->nalloc * sizeof(H5O_efl_entry_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") } dest->heap_addr = mesg->heap_addr; dest->nalloc = mesg->nalloc; dest->nused = mesg->nused; - for (u = 0; u < mesg->nused; u++) { + for(u = 0; u < mesg->nused; u++) { dest->slot[u] = mesg->slot[u]; - dest->slot[u].name = H5MM_xstrdup (mesg->slot[u].name); - } + dest->slot[u].name = H5MM_xstrdup(mesg->slot[u].name); + } /* end for */ /* Set return value */ - ret_value=dest; + ret_value = dest; done: - FUNC_LEAVE_NOAPI(ret_value); -} + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_efl_copy() */ /*------------------------------------------------------------------------- |