summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2014-07-30 20:56:40 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2014-07-30 20:56:40 (GMT)
commite8c162613b75fb3b269830defa769728f439db72 (patch)
tree7c02108c8d1012fb7e8a2b54c5503a5c2f5c019c /tools
parentff1a9ae0e74ded0274729313ba24df578ffaf678 (diff)
downloadhdf5-e8c162613b75fb3b269830defa769728f439db72.zip
hdf5-e8c162613b75fb3b269830defa769728f439db72.tar.gz
hdf5-e8c162613b75fb3b269830defa769728f439db72.tar.bz2
[svn-r25497] Description:
Merge changes that correspond to the 64-bit ID changes (without the actual switch to 64-bit IDs) to the 1.8 release branch. (Plus a few minor cleanups and alignments with the trunk that aren't on the branch) Tested on: Mac OSX/64 10.9.4 (amazon) w/C++ & FORTRAN (h5committested on branch already for a week)
Diffstat (limited to 'tools')
-rw-r--r--tools/h5copy/h5copygentest.c20
-rw-r--r--tools/h5diff/h5diffgentest.c26
-rw-r--r--tools/h5dump/h5dump_xml.c2
-rw-r--r--tools/h5dump/h5dumpgentest.c28
-rw-r--r--tools/h5jam/getub.c4
-rw-r--r--tools/h5ls/h5ls.c2
-rw-r--r--tools/h5repack/h5repack_copy.c2
-rw-r--r--tools/h5repack/h5repack_main.c3
-rw-r--r--tools/h5repack/h5repack_refs.c2
-rw-r--r--tools/h5repack/h5repacktst.c72
-rw-r--r--tools/h5stat/h5stat.c16
-rw-r--r--tools/lib/h5tools.c24
-rw-r--r--tools/lib/h5tools_dump.c49
-rw-r--r--tools/lib/h5tools_dump.h2
-rw-r--r--tools/lib/h5tools_str.c4
-rw-r--r--tools/misc/h5debug.c54
-rw-r--r--tools/misc/h5repart.c4
-rw-r--r--tools/misc/talign.c4
18 files changed, 159 insertions, 159 deletions
diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c
index e45d24a..49204f5 100644
--- a/tools/h5copy/h5copygentest.c
+++ b/tools/h5copy/h5copygentest.c
@@ -237,10 +237,10 @@ static void gent_named_vl(hid_t loc_id)
/* allocate and initialize VL dataset to write */
buf[0].len = 1;
- buf[0].p = malloc( 1 * sizeof(int));
+ buf[0].p = HDmalloc( 1 * sizeof(int));
((int *)buf[0].p)[0]=1;
buf[1].len = 2;
- buf[1].p = malloc( 2 * sizeof(int));
+ buf[1].p = HDmalloc( 2 * sizeof(int));
((int *)buf[1].p)[0]=2;
((int *)buf[1].p)[1]=3;
@@ -283,16 +283,16 @@ static void gent_nested_vl(hid_t loc_id)
/* allocate and initialize VL dataset to write */
buf[0].len = 1;
- buf[0].p = malloc( 1 * sizeof(hvl_t));
+ buf[0].p = HDmalloc( 1 * sizeof(hvl_t));
tvl = (hvl_t *)buf[0].p;
- tvl->p = malloc( 1 * sizeof(int) );
+ tvl->p = HDmalloc( 1 * sizeof(int) );
tvl->len = 1;
((int *)tvl->p)[0]=1;
buf[1].len = 1;
- buf[1].p = malloc( 1 * sizeof(hvl_t));
+ buf[1].p = HDmalloc( 1 * sizeof(hvl_t));
tvl = (hvl_t *)buf[1].p;
- tvl->p = malloc( 2 * sizeof(int) );
+ tvl->p = HDmalloc( 2 * sizeof(int) );
tvl->len = 2;
((int *)tvl->p)[0]=2;
((int *)tvl->p)[1]=3;
@@ -454,23 +454,23 @@ static herr_t gen_obj_ref(hid_t loc_id)
/*--------------
* add group */
- oid = H5Gcreate2 (loc_id, OBJ_REF_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ oid = H5Gcreate2 (loc_id, OBJ_REF_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid < 0)
{
fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
- H5Gclose(oid);
+ H5Gclose(oid);
- status = H5Rcreate (&or_data[0], loc_id, OBJ_REF_DS, H5R_OBJECT, -1);
+ status = H5Rcreate (&or_data[0], loc_id, OBJ_REF_DS, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
- status = H5Rcreate (&or_data[1], loc_id, OBJ_REF_GRP, H5R_OBJECT, -1);
+ status = H5Rcreate (&or_data[1], loc_id, OBJ_REF_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index d554abd..80405e9 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -978,8 +978,8 @@ int test_attributes(const char *file,
*/
write_attr_in(did,"dset",fid,make_diffs);
- write_attr_in(gid,NULL,0,make_diffs);
- write_attr_in(root_id,NULL,0,make_diffs);
+ write_attr_in(gid,NULL,(hid_t)0,make_diffs);
+ write_attr_in(root_id,NULL,(hid_t)0,make_diffs);
/* Close */
@@ -4127,9 +4127,9 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset9", tid9_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* obj references */
- status=H5Rcreate(&(comp9_buf.objref1),gid,"Compound_dset2",H5R_OBJECT,-1);
- status=H5Rcreate(&(comp9_buf.objref2),gid,"Compound_dset3",H5R_OBJECT,-1);
- status=H5Rcreate(&(comp9_buf.objref3),gid,"Compound_dset4",H5R_OBJECT,-1);
+ status=H5Rcreate(&(comp9_buf.objref1),gid,"Compound_dset2",H5R_OBJECT,(hid_t)-1);
+ status=H5Rcreate(&(comp9_buf.objref2),gid,"Compound_dset3",H5R_OBJECT,(hid_t)-1);
+ status=H5Rcreate(&(comp9_buf.objref3),gid,"Compound_dset4",H5R_OBJECT,(hid_t)-1);
status = H5Dwrite(did_comp, tid9_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp9_buf);
if (status < 0)
@@ -5416,8 +5416,8 @@ void write_attr_in(hid_t loc_id,
/* Create references to dataset */
if (dset_name)
{
- status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1);
- status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1);
+ status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,(hid_t)-1);
+ status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,(hid_t)-1);
write_attr(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4);
}
@@ -5698,7 +5698,7 @@ void write_attr_in(hid_t loc_id,
{
for (i = 0; i < 3; i++) {
for (j = 0; j < 2; j++) {
- status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1);
+ status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,(hid_t)-1);
}
}
write_attr(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42);
@@ -6094,7 +6094,7 @@ void write_attr_in(hid_t loc_id,
for (i = 0; i < 4; i++) {
for (j = 0; j < 3; j++) {
for (k = 0; k < 2; k++)
- status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1);
+ status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,(hid_t)-1);
}
}
write_attr(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43);
@@ -6460,8 +6460,8 @@ void write_dset_in(hid_t loc_id,
/* Create references to dataset */
if (dset_name)
{
- status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1);
- status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1);
+ status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,(hid_t)-1);
+ status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,(hid_t)-1);
write_dset(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4);
}
@@ -6675,7 +6675,7 @@ void write_dset_in(hid_t loc_id,
{
for (i = 0; i < 3; i++) {
for (j = 0; j < 2; j++) {
- status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1);
+ status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,(hid_t)-1);
}
}
write_dset(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42);
@@ -6886,7 +6886,7 @@ void write_dset_in(hid_t loc_id,
for (i = 0; i < 4; i++) {
for (j = 0; j < 3; j++) {
for (k = 0; k < 2; k++)
- status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1);
+ status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,(hid_t)-1);
}
}
write_dset(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43);
diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c
index c081ee0..64667cb 100644
--- a/tools/h5dump/h5dump_xml.c
+++ b/tools/h5dump/h5dump_xml.c
@@ -1937,7 +1937,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU
datactx.need_prefix = TRUE;
datactx.indent_level = ctx.indent_level;
datactx.cur_column = ctx.cur_column;
- status = h5tools_dump_dset(rawoutstream, outputformat, &datactx, obj_id, -1, NULL);
+ status = h5tools_dump_dset(rawoutstream, outputformat, &datactx, obj_id, NULL);
}
}
else {
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index 884670e..046c5e1 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -2043,16 +2043,16 @@ static void gent_objref(void)
dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Create reference to dataset */
- H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, -1);
+ H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1);
/* Create reference to dataset */
- H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, -1);
+ H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1);
/* Create reference to group */
- H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, -1);
+ H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1);
/* Create reference to named datatype */
- H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, -1);
+ H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1);
/* Write selection to disk */
H5Dwrite(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
@@ -3913,8 +3913,8 @@ static void write_attr_in(hid_t loc_id,
/* Create references to dataset */
if(dset_name)
{
- status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1);
- status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1);
+ status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,(hid_t)-1);
+ status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,(hid_t)-1);
write_attr(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4);
}
@@ -4020,7 +4020,7 @@ static void write_attr_in(hid_t loc_id,
{
for(i = 0; i < 3; i++) {
for(j = 0; j < 2; j++) {
- status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1);
+ status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,(hid_t)-1);
}
}
write_attr(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42);
@@ -4151,7 +4151,7 @@ static void write_attr_in(hid_t loc_id,
for(i = 0; i < 4; i++) {
for(j = 0; j < 3; j++) {
for(k = 0; k < 2; k++)
- status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1);
+ status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,(hid_t)-1);
}
}
write_attr(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43);
@@ -4355,8 +4355,8 @@ static void write_dset_in(hid_t loc_id,
/* Create references to dataset */
if(dset_name)
{
- status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1);
- status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1);
+ status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,(hid_t)-1);
+ status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,(hid_t)-1);
write_dset(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4);
}
@@ -4462,7 +4462,7 @@ static void write_dset_in(hid_t loc_id,
{
for(i = 0; i < 3; i++) {
for(j = 0; j < 2; j++) {
- status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1);
+ status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,(hid_t)-1);
}
}
write_dset(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42);
@@ -4605,7 +4605,7 @@ static void write_dset_in(hid_t loc_id,
for(i = 0; i < 4; i++) {
for(j = 0; j < 3; j++) {
for(k = 0; k < 2; k++)
- status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1);
+ status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,(hid_t)-1);
}
}
write_dset(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43);
@@ -4730,8 +4730,8 @@ static void gent_attr_all(void)
*/
write_attr_in(did,"dset",fid);
- write_attr_in(group_id,NULL,0);
- write_attr_in(root_id,NULL,0);
+ write_attr_in(group_id,NULL,(hid_t)0);
+ write_attr_in(root_id,NULL,(hid_t)0);
/*-------------------------------------------------------------------------
* write a series of datasets on group 2
diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c
index afb0da6..776eaeb 100644
--- a/tools/h5jam/getub.c
+++ b/tools/h5jam/getub.c
@@ -162,7 +162,7 @@ main (int argc, const char *argv[])
if (res < (long)size)
{
if (buf)
- free (buf);
+ HDfree (buf);
HDclose (fd);
exit (EXIT_FAILURE);
}
@@ -170,7 +170,7 @@ main (int argc, const char *argv[])
HDwrite (1, buf, (unsigned)size);
if (buf)
- free (buf);
+ HDfree (buf);
HDclose (fd);
return (EXIT_SUCCESS);
}
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index d8768fb..4b8a50b 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -1464,7 +1464,7 @@ dump_dataset_values(hid_t dset)
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
ctx.need_prefix = TRUE;
ctx.cur_column = (size_t)curr_pos;
- if (h5tools_dump_dset(rawoutstream, info, &ctx, dset, -1, NULL) < 0) {
+ if (h5tools_dump_dset(rawoutstream, info, &ctx, dset, NULL) < 0) {
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, " Unable to print data.");
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0);
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index 63b5373..a25e789 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -39,7 +39,7 @@
#define CHECK_H5DRW_ERROR(_fun, _did, _mtid, _msid, _fsid, _pid, _buf) { \
H5E_BEGIN_TRY { \
if(_fun(_did, _mtid, _msid, _fsid, _pid, _buf) < 0) { \
- int _err_num = 0; \
+ hid_t _err_num = 0; \
char _msg[80]; \
H5Ewalk2(H5E_DEFAULT, H5E_WALK_DOWNWARD, walk_error_callback, &_err_num); \
H5Eget_msg(_err_num, NULL, _msg, (size_t)80); \
diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c
index c25b7ea..3d4de6f 100644
--- a/tools/h5repack/h5repack_main.c
+++ b/tools/h5repack/h5repack_main.c
@@ -21,6 +21,8 @@
#define PROGRAMNAME "h5repack"
static int parse_command_line(int argc, const char **argv, pack_opt_t* options);
+static void leave(int ret);
+
/* module-scoped variables */
static int has_i_o = 0;
@@ -520,7 +522,6 @@ done:
int main(int argc, const char **argv) {
pack_opt_t options; /*the global options */
- int ret = -1;
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c
index b844280..2b39249 100644
--- a/tools/h5repack/h5repack_refs.c
+++ b/tools/h5repack/h5repack_refs.c
@@ -189,7 +189,7 @@ int do_copy_refobjs(hid_t fidin,
*/
if((refname = MapIdToName(refobj_id, travt)) != NULL) {
/* create the reference, -1 parameter for objects */
- if(H5Rcreate(&refbuf[u], fidout, refname, H5R_OBJECT, -1) < 0)
+ if(H5Rcreate(&refbuf[u], fidout, refname, H5R_OBJECT, (hid_t)-1) < 0)
goto error;
if(options->verbose)
{
diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c
index 4510bd5..a32f33a 100644
--- a/tools/h5repack/h5repacktst.c
+++ b/tools/h5repack/h5repacktst.c
@@ -2271,7 +2271,7 @@ int make_deflate(hid_t loc_id)
/* create a reference to the dataset, test second seeep of file for references */
- if (H5Rcreate(&bufref[0],loc_id,"dset_deflate",H5R_OBJECT,-1) < 0)
+ if (H5Rcreate(&bufref[0],loc_id,"dset_deflate",H5R_OBJECT,(hid_t)-1) < 0)
goto out;
if (write_dset(loc_id,1,dims1r,"ref",H5T_STD_REF_OBJ,bufref) < 0)
goto out;
@@ -3322,7 +3322,7 @@ int make_big(hid_t loc_id)
goto out;
/* initialize buffer to 0 */
- buf=(signed char *) calloc( nelmts, size);
+ buf=(signed char *) HDcalloc( nelmts, size);
if (H5Sselect_hyperslab (f_sid,H5S_SELECT_SET,hs_start,NULL,hs_size, NULL) < 0)
goto out;
@@ -3769,7 +3769,7 @@ int write_dset_in(hid_t loc_id,
buf4[1]=0;
if (dset_name)
{
- if (H5Rcreate(&buf4[0],file_id,dset_name,H5R_OBJECT,-1) < 0)
+ if (H5Rcreate(&buf4[0],file_id,dset_name,H5R_OBJECT,(hid_t)-1) < 0)
goto out;
if (write_dset(loc_id,1,dims1r,"refobj",H5T_STD_REF_OBJ,buf4) < 0)
goto out;
@@ -3803,10 +3803,10 @@ int write_dset_in(hid_t loc_id,
/* Allocate and initialize VL dataset to write */
buf5[0].len = 1;
- buf5[0].p = malloc( 1 * sizeof(int));
+ buf5[0].p = HDmalloc( 1 * sizeof(int));
((int *)buf5[0].p)[0]=1;
buf5[1].len = 2;
- buf5[1].p = malloc( 2 * sizeof(int));
+ buf5[1].p = HDmalloc( 2 * sizeof(int));
((int *)buf5[1].p)[0] = 2;
((int *)buf5[1].p)[1] = 3;
@@ -3865,7 +3865,7 @@ int write_dset_in(hid_t loc_id,
/* allocate and initialize array data to write */
size = ( TEST_BUFSIZE / sizeof(double) + 1 ) * sizeof(double);
- dbuf = (double*)malloc( size );
+ dbuf = (double*)HDmalloc( size );
if (NULL == dbuf)
{
printf ("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", (int) size / 1000000 );
@@ -4004,7 +4004,7 @@ int write_dset_in(hid_t loc_id,
/* Create references to dataset */
if (dset_name)
{
- if (H5Rcreate(&buf42[0][0], file_id, dset_name, H5R_OBJECT, -1) < 0)
+ if (H5Rcreate(&buf42[0][0], file_id, dset_name, H5R_OBJECT, (hid_t)-1) < 0)
goto out;
if (write_dset(loc_id, 2, dims2r, "refobj2D", H5T_STD_REF_OBJ, buf42) < 0)
goto out;
@@ -4039,7 +4039,7 @@ int write_dset_in(hid_t loc_id,
{
int l;
- buf52[i][j].p = malloc((i + 1) * sizeof(int));
+ buf52[i][j].p = HDmalloc((i + 1) * sizeof(int));
buf52[i][j].len = (size_t)(i + 1);
for(l = 0; l < i + 1; l++)
{
@@ -4223,7 +4223,7 @@ int write_dset_in(hid_t loc_id,
/* Create references to dataset */
if (dset_name)
{
- if (H5Rcreate(&buf43[0][0][0], file_id, dset_name, H5R_OBJECT, -1) < 0)
+ if (H5Rcreate(&buf43[0][0][0], file_id, dset_name, H5R_OBJECT, (hid_t)-1) < 0)
goto out;
if (write_dset(loc_id, 3, dims3r, "refobj3D", H5T_STD_REF_OBJ, buf43) < 0)
goto out;
@@ -4260,7 +4260,7 @@ int write_dset_in(hid_t loc_id,
{
int l;
- buf53[i][j][k].p = malloc((i + 1) * sizeof(int));
+ buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int));
buf53[i][j][k].len = (size_t)(i + 1);
for(l = 0; l < i + 1; l++)
{
@@ -4390,8 +4390,8 @@ int make_dset_reg_ref(hid_t loc_id)
int retval = -1; /* return value */
/* Allocate write & read buffers */
- wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1);
- dwbuf = (int *)malloc(sizeof(int) * SPACE2_DIM1 * SPACE2_DIM2);
+ wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1);
+ dwbuf = (int *)HDmalloc(sizeof(int) * SPACE2_DIM1 * SPACE2_DIM2);
/* Create dataspace for datasets */
if ((sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL)) < 0)
@@ -4681,9 +4681,9 @@ int write_attr_in(hid_t loc_id,
/* object references ( H5R_OBJECT */
if (dset_name)
{
- if (H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1) < 0)
+ if (H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,(hid_t)-1) < 0)
goto out;
- if (H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1) < 0)
+ if (H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,(hid_t)-1) < 0)
goto out;
if (make_attr(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4) < 0)
goto out;
@@ -4731,10 +4731,10 @@ int write_attr_in(hid_t loc_id,
/* Allocate and initialize VL dataset to write */
buf5[0].len = 1;
- buf5[0].p = malloc( 1 * sizeof(int));
+ buf5[0].p = HDmalloc( 1 * sizeof(int));
((int *)buf5[0].p)[0]=1;
buf5[1].len = 2;
- buf5[1].p = malloc(2 * sizeof(int));
+ buf5[1].p = HDmalloc(2 * sizeof(int));
((int *)buf5[1].p)[0] = 2;
((int *)buf5[1].p)[1] = 3;
@@ -4995,7 +4995,7 @@ int write_attr_in(hid_t loc_id,
{
for (j = 0; j < 2; j++)
{
- if (H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1) < 0)
+ if (H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,(hid_t)-1) < 0)
goto out;
}
}
@@ -5051,7 +5051,7 @@ int write_attr_in(hid_t loc_id,
for (j = 0; j < 2; j++)
{
int l;
- buf52[i][j].p = malloc((i + 1) * sizeof(int));
+ buf52[i][j].p = HDmalloc((i + 1) * sizeof(int));
buf52[i][j].len = (size_t)(i + 1);
for (l = 0; l < i + 1; l++)
if (make_diffs)((int *)buf52[i][j].p)[l] = 0;
@@ -5430,7 +5430,7 @@ int write_attr_in(hid_t loc_id,
for (j = 0; j < 3; j++)
{
for (k = 0; k < 2; k++)
- if (H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1) < 0)
+ if (H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,(hid_t)-1) < 0)
goto out;
}
}
@@ -5517,7 +5517,7 @@ int write_attr_in(hid_t loc_id,
for (k = 0; k < 2; k++)
{
int l;
- buf53[i][j][k].p = malloc((i + 1) * sizeof(int));
+ buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int));
buf53[i][j][k].len = (size_t)i + 1;
for (l = 0; l < i + 1; l++)
if (make_diffs)
@@ -5939,7 +5939,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id)
* add attribute with obj ref type
*/
/* ref to dset */
- status = H5Rcreate(&data_attr_objref[0],file_id,NAME_OBJ_DS1,H5R_OBJECT,-1);
+ status = H5Rcreate(&data_attr_objref[0],file_id,NAME_OBJ_DS1,H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
@@ -5948,7 +5948,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id)
}
/* ref to group */
- status = H5Rcreate(&data_attr_objref[1],file_id,NAME_OBJ_GRP,H5R_OBJECT,-1);
+ status = H5Rcreate(&data_attr_objref[1],file_id,NAME_OBJ_GRP,H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
@@ -5957,7 +5957,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id)
}
/* ref to datatype */
- status = H5Rcreate(&data_attr_objref[2],file_id,NAME_OBJ_NDTYPE,H5R_OBJECT,-1);
+ status = H5Rcreate(&data_attr_objref[2],file_id,NAME_OBJ_NDTYPE,H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
@@ -6210,7 +6210,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
* Passing -1 as reference is an object.*/
/* obj ref to dataset */
- status = H5Rcreate (&objref_buf[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, -1);
+ status = H5Rcreate (&objref_buf[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
@@ -6219,7 +6219,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
}
/* obj ref to group */
- status = H5Rcreate (&objref_buf[1], loc_id, NAME_OBJ_GRP, H5R_OBJECT, -1);
+ status = H5Rcreate (&objref_buf[1], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
@@ -6228,7 +6228,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
}
/* obj ref to named-datatype */
- status = H5Rcreate (&objref_buf[2], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, -1);
+ status = H5Rcreate (&objref_buf[2], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
@@ -6650,7 +6650,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
* Create the object references into compound type
*/
/* references to dataset */
- status = H5Rcreate (&(comp_objref_data[0].val_objref), loc_id, NAME_OBJ_DS1, H5R_OBJECT,-1);
+ status = H5Rcreate (&(comp_objref_data[0].val_objref), loc_id, NAME_OBJ_DS1, H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
@@ -6660,7 +6660,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
comp_objref_data[0].val_int = 0;
/* references to group */
- status = H5Rcreate (&(comp_objref_data[1].val_objref), loc_id, NAME_OBJ_GRP, H5R_OBJECT,-1);
+ status = H5Rcreate (&(comp_objref_data[1].val_objref), loc_id, NAME_OBJ_GRP, H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
@@ -6670,7 +6670,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
comp_objref_data[1].val_int = 10;
/* references to datatype */
- status = H5Rcreate (&(comp_objref_data[2].val_objref), loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT,-1);
+ status = H5Rcreate (&(comp_objref_data[2].val_objref), loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
@@ -6743,17 +6743,17 @@ static herr_t make_complex_attr_references(hid_t loc_id)
* prepare vlen data
*/
vlen_objref_data[0].len = LEN0_VLEN_OBJREF;
- vlen_objref_data[0].p = malloc (vlen_objref_data[0].len * sizeof(hobj_ref_t));
+ vlen_objref_data[0].p = HDmalloc (vlen_objref_data[0].len * sizeof(hobj_ref_t));
vlen_objref_data[1].len = LEN1_VLEN_OBJREF;
- vlen_objref_data[1].p = malloc (vlen_objref_data[1].len * sizeof(hobj_ref_t));
+ vlen_objref_data[1].p = HDmalloc (vlen_objref_data[1].len * sizeof(hobj_ref_t));
vlen_objref_data[2].len = LEN2_VLEN_OBJREF;
- vlen_objref_data[2].p = malloc (vlen_objref_data[2].len * sizeof(hobj_ref_t));
+ vlen_objref_data[2].p = HDmalloc (vlen_objref_data[2].len * sizeof(hobj_ref_t));
/*
* create obj references
*/
/* reference to dataset */
- status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, -1);
+ status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
@@ -6761,7 +6761,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
goto out;
}
/* reference to group */
- status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[1].p)[0], loc_id, NAME_OBJ_GRP, H5R_OBJECT, -1);
+ status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[1].p)[0], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
@@ -6769,7 +6769,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
goto out;
}
/* reference to datatype */
- status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[2].p)[0], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, -1);
+ status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[2].p)[0], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
@@ -6812,7 +6812,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
* prepare vlen data
*/
vlen_regref_data[0].len = LEN0_VLEN_REGREF;
- vlen_regref_data[0].p = malloc (vlen_regref_data[0].len * sizeof(hdset_reg_ref_t));
+ vlen_regref_data[0].p = HDmalloc (vlen_regref_data[0].len * sizeof(hdset_reg_ref_t));
/*
* create region reference
diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c
index de36c19..a3a0d13 100644
--- a/tools/h5stat/h5stat.c
+++ b/tools/h5stat/h5stat.c
@@ -32,9 +32,9 @@
#define DEF_SIZE_SMALL_DSETS 10
#define DEF_SIZE_SMALL_ATTRS 10
-#define H5_NFILTERS_IMPL 8 /* Number of currently implemented filters + one to
- accommodate for user-define filters + one
- to accomodate datasets whithout any filters */
+#define H5_NFILTERS_IMPL 8 /* Number of currently implemented filters + one to
+ accommodate for user-define filters + one
+ to accomodate datasets whithout any filters */
@@ -855,7 +855,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
error_msg("Invalid threshold for small datasets\n");
goto error;
}
- } else
+ } else
error_msg("Missing threshold for small datasets\n");
break;
@@ -878,7 +878,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
goto error;
}
} else
- error_msg("Missing threshold for small # of attributes\n");
+ error_msg("Missing threshold for small # of attributes\n");
break;
@@ -1592,9 +1592,9 @@ main(int argc, const char *argv[])
iter.SM_heap_storage_size = finfo.sohm.msgs_info.heap_size;
} /* end else */
- iter.num_small_groups = (unsigned long *)calloc((size_t)sgroups_threshold, sizeof(unsigned long));
- iter.num_small_attrs = (unsigned long *)calloc((size_t)(sattrs_threshold+1), sizeof(unsigned long));
- iter.small_dset_dims = (unsigned long *)calloc((size_t)sdsets_threshold, sizeof(unsigned long));
+ iter.num_small_groups = (unsigned long *)HDcalloc((size_t)sgroups_threshold, sizeof(unsigned long));
+ iter.num_small_attrs = (unsigned long *)HDcalloc((size_t)(sattrs_threshold+1), sizeof(unsigned long));
+ iter.small_dset_dims = (unsigned long *)HDcalloc((size_t)sdsets_threshold, sizeof(unsigned long));
if(iter.num_small_groups == NULL || iter.num_small_attrs == NULL || iter.small_dset_dims == NULL) {
error_msg("Unable to allocate memory for tracking small groups/datasets/attributes\n");
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index fb12408..a7b0e5e 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -844,18 +844,18 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info,
the prefix is printed one indentation level before */
if (info->pindex) {
for (i = 0; i < indentlevel - 1; i++) {
- PUTSTREAM(h5tools_str_fmt(&str, 0, info->line_indent), stream);
+ PUTSTREAM(h5tools_str_fmt(&str, (size_t)0, info->line_indent), stream);
}
}
if (elmtno == 0 && secnum == 0 && info->line_1st) {
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_1st), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_1st), stream);
}
else if (secnum && info->line_cont) {
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_cont), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_cont), stream);
}
else {
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_pre), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_pre), stream);
}
templength = h5tools_str_len(&prefix);
@@ -863,7 +863,7 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info,
for (i = 0; i < indentlevel; i++) {
/*we already made the indent for the array indices case */
if (!info->pindex) {
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_indent), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_indent), stream);
templength += h5tools_str_len(&prefix);
}
else {
@@ -937,22 +937,22 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info,
the prefix is printed one indentation level before */
if (info->pindex)
for (i = 0; i < indentlevel - 1; i++) {
- PUTSTREAM(h5tools_str_fmt(&str, 0, info->line_indent), stream);
+ PUTSTREAM(h5tools_str_fmt(&str, (size_t)0, info->line_indent), stream);
}
if (elmtno == 0 && secnum == 0 && info->line_1st) {
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_1st), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_1st), stream);
} else if (secnum && info->line_cont) {
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_cont), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_cont), stream);
} else
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_pre), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_pre), stream);
templength = h5tools_str_len(&prefix);
for (i = 0; i < indentlevel; i++) {
/*we already made the indent for the array indices case */
if (!info->pindex) {
- PUTSTREAM(h5tools_str_fmt(&prefix, 0, info->line_indent), stream);
+ PUTSTREAM(h5tools_str_fmt(&prefix, (size_t)0, info->line_indent), stream);
templength += h5tools_str_len(&prefix);
}
else {
@@ -1009,7 +1009,7 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info,
if (stream == NULL)
return dimension_break;
- s = h5tools_str_fmt(buffer, 0, "%s");
+ s = h5tools_str_fmt(buffer, (size_t)0, "%s");
/*
* If the element would split on multiple lines if printed at our
@@ -1163,7 +1163,7 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info,
int secnum; /*section sequence number */
int multiline; /*datum was multiline */
- s = h5tools_str_fmt(buffer, 0, "%s");
+ s = h5tools_str_fmt(buffer, (size_t)0, "%s");
/*
* If the element would split on multiple lines if printed at our
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index f11065c..5ab066e 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -1748,11 +1748,11 @@ CATCH
*/
int
h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx,
- hid_t dset, hid_t _p_type, struct subset_t *sset)
+ hid_t dset, struct subset_t *sset)
{
- hid_t f_space;
- hid_t p_type = _p_type;
- hid_t f_type;
+ hid_t f_space = -1;
+ hid_t p_type = -1;
+ hid_t f_type = -1;
H5S_class_t space_type;
int status = FAIL;
h5tool_format_t info_dflt;
@@ -1765,26 +1765,26 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
info = &info_dflt;
}
- if (p_type < 0) {
- f_type = H5Dget_type(dset);
-
- if (info->raw || bin_form == 1)
- p_type = H5Tcopy(f_type);
- else if (bin_form == 2)
- p_type = h5tools_get_little_endian_type(f_type);
- else if (bin_form == 3)
- p_type = h5tools_get_big_endian_type(f_type);
- else
- p_type = h5tools_get_native_type(f_type);
+ f_type = H5Dget_type(dset);
+ if (f_type < 0)
+ goto done;
- H5Tclose(f_type);
+ if (info->raw || bin_form == 1)
+ p_type = H5Tcopy(f_type);
+ else if (bin_form == 2)
+ p_type = h5tools_get_little_endian_type(f_type);
+ else if (bin_form == 3)
+ p_type = h5tools_get_big_endian_type(f_type);
+ else
+ p_type = h5tools_get_native_type(f_type);
- if (p_type < 0)
- goto done;
- }
+ if (p_type < 0)
+ goto done;
/* Check the data space */
f_space = H5Dget_space(dset);
+ if (f_space < 0)
+ goto done;
space_type = H5Sget_simple_extent_type(f_space);
@@ -1799,12 +1799,13 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
/* space is H5S_NULL */
status = SUCCEED;
- /* Close the dataspace */
- H5Sclose(f_space);
-
done:
- if (p_type != _p_type)
+ if (f_type > 0)
+ H5Tclose(f_type);
+ if (p_type > 0)
H5Tclose(p_type);
+ if (f_space > 0)
+ H5Sclose(f_space);
return status;
}
@@ -3859,7 +3860,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info,
}
else
datactx.need_prefix = TRUE;
- status = h5tools_dump_dset(stream, info, &datactx, obj_id, -1, sset);
+ status = h5tools_dump_dset(stream, info, &datactx, obj_id, sset);
if((display_char && H5Tget_size(f_type) == 1) && (H5Tget_class(f_type) == H5T_INTEGER)) {
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "\"");
diff --git a/tools/lib/h5tools_dump.h b/tools/lib/h5tools_dump.h
index 061a3db..b05f226 100644
--- a/tools/lib/h5tools_dump.h
+++ b/tools/lib/h5tools_dump.h
@@ -40,7 +40,7 @@ H5TOOLS_DLL void h5tools_dump_init(void);
H5TOOLS_DLL int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info,
h5tools_context_t *ctx/*in,out*/, hid_t dset,
- hid_t p_typ, struct subset_t *sset);
+ struct subset_t *sset);
H5TOOLS_DLL int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info,
h5tools_context_t *ctx/*in,out*/, hid_t obj_id,
hid_t type, hid_t space, void *mem);
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index d43fc33..ac191d6 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -352,7 +352,7 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info,
}
/* Add prefix and suffix to the index */
- return h5tools_str_fmt(str, 0, OPT(info->idx_fmt, "%s: "));
+ return h5tools_str_fmt(str, (size_t)0, OPT(info->idx_fmt, "%s: "));
}
/*-------------------------------------------------------------------------
@@ -412,7 +412,7 @@ h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info,
}
/* Add prefix and suffix to the index */
- return h5tools_str_fmt(str, 0, OPT(info->idx_fmt, "%s: "));
+ return h5tools_str_fmt(str, (size_t)0, OPT(info->idx_fmt, "%s: "));
}
/*-------------------------------------------------------------------------
diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c
index 6b043ba..9c9153a 100644
--- a/tools/misc/h5debug.c
+++ b/tools/misc/h5debug.c
@@ -21,33 +21,31 @@
*
* Purpose: Debugs an existing HDF5 file at a low level.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
-#define H5A_PACKAGE /*suppress error about including H5Apkg */
-#define H5B2_PACKAGE /*suppress error about including H5B2pkg */
-#define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/
+#define H5A_PACKAGE /*suppress error about including H5Apkg */
+#define H5B2_PACKAGE /*suppress error about including H5B2pkg */
+#define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/
#define H5D_PACKAGE /*suppress error about including H5Dpkg */
-#define H5F_PACKAGE /*suppress error about including H5Fpkg */
-#define H5G_PACKAGE /*suppress error about including H5Gpkg */
-#define H5HF_PACKAGE /*suppress error about including H5HFpkg */
-#define H5O_PACKAGE /*suppress error about including H5Opkg */
-#define H5SM_PACKAGE /*suppress error about including H5SMpkg */
-
-#include "H5private.h" /* Generic Functions */
-#include "H5Apkg.h" /* Attributes */
-#include "H5B2pkg.h" /* v2 B-trees */
-#include "H5Dpkg.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fpkg.h" /* File access */
-#include "H5FSprivate.h" /* Free space manager */
-#include "H5Gpkg.h" /* Groups */
-#include "H5HFpkg.h" /* Fractal heaps */
-#include "H5HGprivate.h" /* Global Heaps */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Opkg.h" /* Object headers */
-#include "H5SMpkg.h" /* Implicitly shared messages */
+#define H5F_PACKAGE /*suppress error about including H5Fpkg */
+#define H5G_PACKAGE /*suppress error about including H5Gpkg */
+#define H5HF_PACKAGE /*suppress error about including H5HFpkg */
+#define H5O_PACKAGE /*suppress error about including H5Opkg */
+#define H5SM_PACKAGE /*suppress error about including H5SMpkg */
+
+#include "H5private.h" /* Generic Functions */
+#include "H5Apkg.h" /* Attributes */
+#include "H5B2pkg.h" /* v2 B-trees */
+#include "H5Dpkg.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fpkg.h" /* File access */
+#include "H5FSprivate.h" /* Free space manager */
+#include "H5Gpkg.h" /* Groups */
+#include "H5HFpkg.h" /* Fractal heaps */
+#include "H5HGprivate.h" /* Global Heaps */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Opkg.h" /* Object headers */
+#include "H5SMpkg.h" /* Implicitly shared messages */
/* File drivers */
#include "H5FDfamily.h"
@@ -192,13 +190,13 @@ main(int argc, char *argv[])
* Parse command arguments.
*/
if(argc > 2)
- addr = HDstrtoll(argv[2], NULL, 0);
+ addr = (haddr_t)HDstrtoll(argv[2], NULL, 0);
if(argc > 3)
- extra = HDstrtoll(argv[3], NULL, 0);
+ extra = (haddr_t)HDstrtoll(argv[3], NULL, 0);
if(argc > 4)
- extra2 = HDstrtoll(argv[4], NULL, 0);
+ extra2 = (haddr_t)HDstrtoll(argv[4], NULL, 0);
if(argc > 5)
- extra3 = HDstrtoll(argv[5], NULL, 0);
+ extra3 = (haddr_t)HDstrtoll(argv[5], NULL, 0);
if(argc > 6)
extra4 = (haddr_t)HDstrtoll(argv[6], NULL, 0);
diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c
index 07f6bfd..ffd52e8 100644
--- a/tools/misc/h5repart.c
+++ b/tools/misc/h5repart.c
@@ -290,7 +290,7 @@ main (int argc, char *argv[])
if (argno<argc) usage (prog_name);
/* Now the real work, split the file */
- buf = malloc (blk_size);
+ buf = HDmalloc (blk_size);
while (src_offset<src_size) {
/* Read a block. The amount to read is the minimum of:
@@ -498,6 +498,6 @@ main (int argc, char *argv[])
}
/* Free resources and return */
- free (buf);
+ HDfree (buf);
return EXIT_SUCCESS;
}
diff --git a/tools/misc/talign.c b/tools/misc/talign.c
index 3fd1694..2d0a9d1 100644
--- a/tools/misc/talign.c
+++ b/tools/misc/talign.c
@@ -126,7 +126,7 @@ int main(void)
H5Dclose(set);
/* Now open the set, and read it back in */
- data = (char *)malloc(H5Tget_size(fix));
+ data = (char *)HDmalloc(H5Tget_size(fix));
if(!data) {
perror("malloc() failed");
@@ -192,7 +192,7 @@ out:
}
if(data)
- free(data);
+ HDfree(data);
H5Sclose(spc);
H5Tclose(cmp);
H5Tclose(cmp1);