summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-08-25 20:27:07 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-08-25 20:27:07 (GMT)
commit52839cdf69f02c99a4a25f65ec9c21f698ad81a6 (patch)
treef0a55b3d0865894532eb34d3927a43e38cfd58d2 /src
parentd9e64dce7fefd8ff746a2ea9aa03607b67f62e12 (diff)
downloadhdf5-52839cdf69f02c99a4a25f65ec9c21f698ad81a6.zip
hdf5-52839cdf69f02c99a4a25f65ec9c21f698ad81a6.tar.gz
hdf5-52839cdf69f02c99a4a25f65ec9c21f698ad81a6.tar.bz2
[svn-r19297] Description:
Whack a few more memory errors exposed by valgrind. Make the debugging dump output a little bit prettier. Tested on: Mac OS X/32 10.6.4 (amazon) w/debug (h5committest forthcoming)
Diffstat (limited to 'src')
-rw-r--r--src/H5Dfill.c6
-rw-r--r--src/H5dbg.c9
-rw-r--r--src/H5private.h4
3 files changed, 12 insertions, 7 deletions
diff --git a/src/H5Dfill.c b/src/H5Dfill.c
index 4474661..1999dda 100644
--- a/src/H5Dfill.c
+++ b/src/H5Dfill.c
@@ -609,12 +609,14 @@ H5D_fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id)
done:
if(buf) {
/* Free dynamically allocated VL elements in fill buffer */
- if(fb_info->fill->type)
+ if(fb_info->fill->type) {
if(H5T_vlen_reclaim_elmt(buf, fb_info->fill->type, dxpl_id) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't reclaim vlen element")
- else
+ } /* end if */
+ else {
if(H5T_vlen_reclaim_elmt(buf, fb_info->mem_type, dxpl_id) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't reclaim vlen element")
+ } /* end else */
/* Free temporary fill buffer */
if(fb_info->fill_free_func)
diff --git a/src/H5dbg.c b/src/H5dbg.c
index 196ed5b..632ac08 100644
--- a/src/H5dbg.c
+++ b/src/H5dbg.c
@@ -78,8 +78,8 @@
*-------------------------------------------------------------------------
*/
herr_t
-H5_buffer_dump(FILE *stream, int indent, uint8_t *buf,
- uint8_t *marker, size_t buf_offset, size_t buf_size)
+H5_buffer_dump(FILE *stream, int indent, const uint8_t *buf,
+ const uint8_t *marker, size_t buf_offset, size_t buf_size)
{
size_t u, v; /* Local index variable */
@@ -102,7 +102,7 @@ H5_buffer_dump(FILE *stream, int indent, uint8_t *buf,
for(u = 0; u < buf_size; u += 16) {
uint8_t c;
- HDfprintf(stream, "%*s %8d: ", indent, "", u);
+ HDfprintf(stream, "%*s %8d: ", indent, "", u + buf_offset);
/* Print the hex values */
for(v = 0; v < 16; v++) {
@@ -119,6 +119,7 @@ H5_buffer_dump(FILE *stream, int indent, uint8_t *buf,
if(7 == v)
HDfputc(' ', stream);
} /* end for */
+ HDfputc(' ', stream);
/* Print the character values */
for(v = 0; v < 16; v++) {
@@ -133,6 +134,8 @@ H5_buffer_dump(FILE *stream, int indent, uint8_t *buf,
HDfputc('.', stream);
} /* end else */
} /* end if */
+ if(7 == v)
+ HDfputc(' ', stream);
} /* end for */
HDfputc('\n', stream);
diff --git a/src/H5private.h b/src/H5private.h
index e8e87e2..3875fb3 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -2342,8 +2342,8 @@ H5_DLL uint32_t H5_hash_string(const char *str);
H5_DLL herr_t H5_build_extpath(const char *, char ** /*out*/ );
/* Functions for debugging */
-H5_DLL herr_t H5_buffer_dump(FILE *stream, int indent, uint8_t *buf,
- uint8_t *marker, size_t buf_offset, size_t buf_size);
+H5_DLL herr_t H5_buffer_dump(FILE *stream, int indent, const uint8_t *buf,
+ const uint8_t *marker, size_t buf_offset, size_t buf_size);
#endif /* _H5private_H */