summaryrefslogtreecommitdiffstats
path: root/src/H5Ofill.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-04-17 18:49:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-04-17 18:49:49 (GMT)
commit4433c857661d50e748788afcbd862a12133ce756 (patch)
tree29b6d55263e14006c1471e174fc1e79f5a2680b6 /src/H5Ofill.c
parent67d22cb484f9d81cdef578deceb4a8ee5046a88b (diff)
downloadhdf5-4433c857661d50e748788afcbd862a12133ce756.zip
hdf5-4433c857661d50e748788afcbd862a12133ce756.tar.gz
hdf5-4433c857661d50e748788afcbd862a12133ce756.tar.bz2
[svn-r5195] Purpose:
Code cleanup Description: Got rid of the "H5T_BKG_TEMP" setting that was used internally to the library, since temporary background buffers are now handled by the individual conversion routines instead of in a global background buffer. No APIs were changed or affected by this. Platforms tested: FreeBSD 4.5 (sleipnir)
Diffstat (limited to 'src/H5Ofill.c')
-rw-r--r--src/H5Ofill.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/H5Ofill.c b/src/H5Ofill.c
index 567b7ca..4342f13 100644
--- a/src/H5Ofill.c
+++ b/src/H5Ofill.c
@@ -698,17 +698,12 @@ H5O_fill_convert(void *_fill, H5T_t *dset_type)
}
HDmemcpy(buf, fill->buf, H5T_get_size(fill->type));
}
- if (tpath->cdata.need_bkg>=H5T_BKG_TEMP &&
- NULL==(bkg=H5MM_malloc(H5T_get_size(dset_type)))) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
- "memory allocation failed for type conversion");
- }
+ if (tpath->cdata.need_bkg && NULL==(bkg=H5MM_malloc(H5T_get_size(dset_type))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion");
/* Do the conversion */
- if (H5T_convert(tpath, src_id, dst_id, (hsize_t)1, 0, 0, buf, bkg, H5P_DEFAULT)<0) {
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL,
- "data type conversion failed");
- }
+ if (H5T_convert(tpath, src_id, dst_id, (hsize_t)1, 0, 0, buf, bkg, H5P_DEFAULT)<0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed");
/* Update the fill message */
if (buf!=fill->buf) {
@@ -724,6 +719,6 @@ H5O_fill_convert(void *_fill, H5T_t *dset_type)
if (src_id>=0) H5I_dec_ref(src_id);
if (dst_id>=0) H5I_dec_ref(dst_id);
if (buf!=fill->buf) H5MM_xfree(buf);
- H5MM_xfree(bkg);
+ if (bkg) H5MM_xfree(bkg);
FUNC_LEAVE(ret_value);
}