summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-01-08 20:01:16 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-01-08 20:01:16 (GMT)
commitdf60e8a5233cf6adbd786b80442f6c35f54a4e15 (patch)
tree4ddb125317b6f9f859b65a2a96dbc30f981ddd9b /src
parent322b981c37ae88de5f1ca73825abdcde6bcf0d4b (diff)
downloadhdf5-df60e8a5233cf6adbd786b80442f6c35f54a4e15.zip
hdf5-df60e8a5233cf6adbd786b80442f6c35f54a4e15.tar.gz
hdf5-df60e8a5233cf6adbd786b80442f6c35f54a4e15.tar.bz2
[svn-r18090] Description:
Correct Coverity issue #11 by removing impossible to reach code. Also clean up some minor style issues. Tested on: Mac OS X/32 10.6.3 (amazon) w/debug
Diffstat (limited to 'src')
-rw-r--r--src/H5Oainfo.c8
-rw-r--r--src/H5Oattr.c2
-rw-r--r--src/H5Olayout.c2
-rw-r--r--src/H5Olink.c10
4 files changed, 7 insertions, 15 deletions
diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c
index e61d899..0984cd4 100644
--- a/src/H5Oainfo.c
+++ b/src/H5Oainfo.c
@@ -431,17 +431,17 @@ H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst,
if(H5A_dense_create(file_dst, dxpl_id, ainfo_dst) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to create dense storage for attributes")
- if ( (H5A_dense_copy_file_all(file_src, ainfo_src, file_dst, ainfo_dst, recompute_size, cpy_info, dxpl_id)) <0)
+ if((H5A_dense_copy_file_all(file_src, ainfo_src, file_dst, ainfo_dst, recompute_size, cpy_info, dxpl_id)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to create dense storage for attributes")
- }
+ } /* end if */
/* Set return value */
ret_value = ainfo_dst;
done:
/* Release destination attribute information on failure */
- if(ret_value == NULL && ainfo_dst != NULL)
- (void)H5FL_FREE(H5O_ainfo_t, ainfo_dst);
+ if(!ret_value && ainfo_dst)
+ ainfo_dst = H5FL_FREE(H5O_ainfo_t, ainfo_dst);
FUNC_LEAVE_NOAPI(ret_value)
} /* H5O_ainfo_copy_file() */
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index ad068ad..4d8b17a 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -668,7 +668,7 @@ H5O_attr_copy_file(H5F_t *file_src, const H5O_msg_class_t UNUSED *mesg_type,
if(H5T_set_loc(((H5A_t *)native_src)->shared->dt, file_src, H5T_LOC_DISK) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "invalid datatype location")
- if ( NULL == (ret_value=H5A_attr_copy_file((H5A_t *)native_src, file_dst, recompute_size, cpy_info, dxpl_id)))
+ if(NULL == (ret_value = H5A_attr_copy_file((H5A_t *)native_src, file_dst, recompute_size, cpy_info, dxpl_id)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy attribute")
done:
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index ebae1fb..6d20ca9 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -646,7 +646,7 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst,
done:
if(!ret_value)
if(layout_dst)
- (void)H5FL_FREE(H5O_layout_t, layout_dst);
+ layout_dst = H5FL_FREE(H5O_layout_t, layout_dst);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_layout_copy_file() */
diff --git a/src/H5Olink.c b/src/H5Olink.c
index ffe80e7..4ddfbf6 100644
--- a/src/H5Olink.c
+++ b/src/H5Olink.c
@@ -705,7 +705,6 @@ H5O_link_copy_file(H5F_t UNUSED *file_src, void *native_src, H5F_t UNUSED *file_
hid_t UNUSED dxpl_id)
{
H5O_link_t *link_src = (H5O_link_t *)native_src;
- H5O_link_t *link_dst = NULL;
void *ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5O_link_copy_file)
@@ -721,17 +720,10 @@ H5O_link_copy_file(H5F_t UNUSED *file_src, void *native_src, H5F_t UNUSED *file_
/* Allocate "blank" link for destination */
/* (values will be filled in during 'post copy' operation) */
- if(NULL == (link_dst = H5FL_CALLOC(H5O_link_t)))
+ if(NULL == (ret_value = H5FL_CALLOC(H5O_link_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
- /* Set return value */
- ret_value = link_dst;
-
done:
- if(!ret_value)
- if(link_dst)
- H5O_link_free(link_dst);
-
FUNC_LEAVE_NOAPI(ret_value)
} /* H5O_link_copy_file() */