diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-08-21 20:30:19 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-08-21 20:30:19 (GMT) |
commit | f8a796ebfc24c8f5f2c2c4f592234deb2b225c09 (patch) | |
tree | b68f1de29b43ba1d654d9b8c7c05e23db9a1b15d /src/H5Oname.c | |
parent | 5f7de916882208cd9f3b3490c59e0f3ab92cdc40 (diff) | |
download | hdf5-f8a796ebfc24c8f5f2c2c4f592234deb2b225c09.zip hdf5-f8a796ebfc24c8f5f2c2c4f592234deb2b225c09.tar.gz hdf5-f8a796ebfc24c8f5f2c2c4f592234deb2b225c09.tar.bz2 |
[svn-r15510] Description:
Clean up warnings & formatting
Tested on:
Mac OS X/32 10.5.4 (amazon)
More tests forthcoming
Diffstat (limited to 'src/H5Oname.c')
-rw-r--r-- | src/H5Oname.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/src/H5Oname.c b/src/H5Oname.c index 3b84f75..915546b 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -90,29 +90,29 @@ H5O_name_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flag H5O_name_t *mesg; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_name_decode); + FUNC_ENTER_NOAPI_NOINIT(H5O_name_decode) /* check args */ - assert(f); - assert(p); + HDassert(f); + HDassert(p); /* decode */ - if (NULL==(mesg = H5MM_calloc(sizeof(H5O_name_t))) || - NULL==(mesg->s = H5MM_malloc (HDstrlen((const char*)p)+1))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - HDstrcpy(mesg->s, (const char*)p); + if(NULL == (mesg = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t))) || + NULL == (mesg->s = (char *)H5MM_malloc(HDstrlen((const char *)p) + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HDstrcpy(mesg->s, (const char *)p); /* Set return value */ - ret_value=mesg; + ret_value = mesg; done: - if(ret_value==NULL) { + if(NULL == ret_value) { if(mesg) - H5MM_xfree (mesg); + H5MM_xfree(mesg); } /* end if */ - FUNC_LEAVE_NOAPI(ret_value); -} + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_name_decode() */ /*------------------------------------------------------------------------- @@ -174,24 +174,25 @@ H5O_name_copy(const void *_mesg, void *_dest) H5O_name_t *dest = (H5O_name_t *) _dest; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_name_copy); + FUNC_ENTER_NOAPI_NOINIT(H5O_name_copy) /* check args */ - assert(mesg); - if (!dest && NULL==(dest = H5MM_calloc(sizeof(H5O_name_t)))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); + HDassert(mesg); + + if(!dest && NULL == (dest = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* copy */ *dest = *mesg; - if((dest->s = H5MM_xstrdup(mesg->s))==NULL) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); + if(NULL == (dest->s = H5MM_xstrdup(mesg->s))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Set return value */ - ret_value=dest; + ret_value = dest; done: - FUNC_LEAVE_NOAPI(ret_value); -} + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_name_copy() */ /*------------------------------------------------------------------------- @@ -253,16 +254,16 @@ H5O_name_reset(void *_mesg) { H5O_name_t *mesg = (H5O_name_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_name_reset); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_name_reset) /* check args */ - assert(mesg); + HDassert(mesg); /* reset */ - mesg->s = H5MM_xfree(mesg->s); + mesg->s = (char *)H5MM_xfree(mesg->s); - FUNC_LEAVE_NOAPI(SUCCEED); -} + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O_name_reset() */ /*------------------------------------------------------------------------- |