mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-17 16:10:24 +08:00
[svn-r21974] Update HSIZE_T print statements to use correct macro.
Fix some more HD prefix issues in tools. Tested: local linux
This commit is contained in:
parent
9974e02bc0
commit
0b4463911f
@ -2829,7 +2829,7 @@ static int test_group_recurse2(void)
|
||||
* datatype and default dataset creation properties.
|
||||
*/
|
||||
dset1 = H5Dcreate2(fileid1, GRP_R_DSETNAME1, datatype, dataspace,
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Write the data to the dataset using default transfer properties.
|
||||
@ -2845,7 +2845,7 @@ static int test_group_recurse2(void)
|
||||
* datatype and default dataset creation properties.
|
||||
*/
|
||||
dset1 = H5Dcreate2(grp3, GRP_R_DSETNAME1, datatype, dataspace,
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Write the data to the dataset using default transfer properties.
|
||||
@ -2860,7 +2860,7 @@ static int test_group_recurse2(void)
|
||||
* datatype and default dataset creation properties.
|
||||
*/
|
||||
dset2 = H5Dcreate2(grp4, GRP_R_DSETNAME2, datatype, dataspace,
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Write the data to the dataset using default transfer properties.
|
||||
@ -2915,7 +2915,7 @@ static int test_group_recurse2(void)
|
||||
* datatype and default dataset creation properties.
|
||||
*/
|
||||
dset2 = H5Dcreate2(grp4, GRP_R_DSETNAME2, datatype, dataspace,
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Write the data to the dataset using default transfer properties.
|
||||
@ -2960,7 +2960,7 @@ static int test_group_recurse2(void)
|
||||
* datatype and default dataset creation properties.
|
||||
*/
|
||||
dset1 = H5Dcreate2(grp3, GRP_R_DSETNAME1, datatype, dataspace,
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Write the data to the dataset using default transfer properties.
|
||||
@ -3004,7 +3004,7 @@ static int test_group_recurse2(void)
|
||||
* dset1
|
||||
*/
|
||||
dset1 = H5Dcreate2(fileid2, GRP_R_DSETNAME1, datatype, dataspace,
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Write the data to the dataset using default transfer properties.
|
||||
@ -6192,9 +6192,9 @@ void write_dset_in(hid_t loc_id,
|
||||
tid = H5Tvlen_create(H5T_NATIVE_INT);
|
||||
did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5);
|
||||
assert(status >= 0);
|
||||
HDassert(status >= 0);
|
||||
status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5);
|
||||
assert(status >= 0);
|
||||
HDassert(status >= 0);
|
||||
status = H5Dclose(did);
|
||||
status = H5Tclose(tid);
|
||||
status = H5Sclose(sid);
|
||||
@ -6230,7 +6230,7 @@ void write_dset_in(hid_t loc_id,
|
||||
|
||||
/* allocate and initialize array data to write */
|
||||
size = ( H5TOOLS_MALLOCSIZE / sizeof(double) + 1 ) * sizeof(double);
|
||||
dbuf = malloc( size );
|
||||
dbuf = HDmalloc( size );
|
||||
|
||||
for( j = 0; j < H5TOOLS_MALLOCSIZE / sizeof(double) + 1; j++)
|
||||
dbuf[j] = j;
|
||||
@ -6254,7 +6254,7 @@ void write_dset_in(hid_t loc_id,
|
||||
H5Dclose(did);
|
||||
H5Tclose(tid);
|
||||
H5Sclose(sid);
|
||||
free( dbuf );
|
||||
HDfree( dbuf );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -6697,10 +6697,10 @@ void gen_datareg(hid_t fid,
|
||||
int i;
|
||||
|
||||
/* allocate the buffer for write the references */
|
||||
rbuf = calloc((size_t)2, sizeof(hdset_reg_ref_t));
|
||||
rbuf = HDcalloc((size_t)2, sizeof(hdset_reg_ref_t));
|
||||
|
||||
/* allocate the buffer for write the data dataset */
|
||||
buf = malloc(10 * 10 * sizeof(int));
|
||||
buf = HDmalloc(10 * 10 * sizeof(int));
|
||||
|
||||
for(i = 0; i < 10 * 10; i++)
|
||||
buf[i] = i;
|
||||
@ -6709,7 +6709,7 @@ void gen_datareg(hid_t fid,
|
||||
sid1 = H5Screate_simple(2, dims1, NULL);
|
||||
did1 = H5Dcreate2(fid, "dsetref", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
||||
status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
|
||||
assert(status >= 0);
|
||||
HDassert(status >= 0);
|
||||
|
||||
/* create the reference dataset */
|
||||
sid2 = H5Screate_simple(1, dims2, NULL);
|
||||
@ -6726,12 +6726,12 @@ void gen_datareg(hid_t fid,
|
||||
}
|
||||
|
||||
status = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL);
|
||||
assert(status >= 0);
|
||||
HDassert(status >= 0);
|
||||
H5Sget_select_npoints(sid1);
|
||||
|
||||
/* store first dataset region */
|
||||
status = H5Rcreate(&rbuf[0], fid, "dsetref", H5R_DATASET_REGION, sid1);
|
||||
assert(status >= 0);
|
||||
HDassert(status >= 0);
|
||||
|
||||
/* select sequence of five points for second reference */
|
||||
coord[0][0]=6; coord[0][1]=9;
|
||||
@ -6753,20 +6753,20 @@ void gen_datareg(hid_t fid,
|
||||
|
||||
/* write */
|
||||
status = H5Dwrite(did2,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,rbuf);
|
||||
assert(status >= 0);
|
||||
HDassert(status >= 0);
|
||||
|
||||
/* close, free memory buffers */
|
||||
status = H5Dclose(did1);
|
||||
assert(status >= 0);
|
||||
HDassert(status >= 0);
|
||||
status = H5Sclose(sid1);
|
||||
assert(status >= 0);
|
||||
HDassert(status >= 0);
|
||||
status = H5Dclose(did2);
|
||||
assert(status >= 0);
|
||||
HDassert(status >= 0);
|
||||
status = H5Sclose(sid2);
|
||||
assert(status >= 0);
|
||||
HDassert(status >= 0);
|
||||
|
||||
free(rbuf);
|
||||
free(buf);
|
||||
HDfree(rbuf);
|
||||
HDfree(buf);
|
||||
}
|
||||
|
||||
|
||||
@ -6846,7 +6846,7 @@ int test_hyperslab(const char *fname,
|
||||
}
|
||||
|
||||
}
|
||||
free(buf);
|
||||
HDfree(buf);
|
||||
buf=NULL;
|
||||
|
||||
/* close */
|
||||
|
@ -847,26 +847,26 @@ free_handler(struct handler_t *hand, int len)
|
||||
if(hand) {
|
||||
for (i = 0; i < len; i++) {
|
||||
if(hand[i].obj) {
|
||||
free(hand[i].obj);
|
||||
HDfree(hand[i].obj);
|
||||
hand[i].obj=NULL;
|
||||
}
|
||||
|
||||
if (hand[i].subset_info) {
|
||||
if(hand[i].subset_info->start.data)
|
||||
free(hand[i].subset_info->start.data);
|
||||
HDfree(hand[i].subset_info->start.data);
|
||||
if(hand[i].subset_info->stride.data)
|
||||
free(hand[i].subset_info->stride.data);
|
||||
HDfree(hand[i].subset_info->stride.data);
|
||||
if(hand[i].subset_info->count.data)
|
||||
free(hand[i].subset_info->count.data);
|
||||
HDfree(hand[i].subset_info->count.data);
|
||||
if(hand[i].subset_info->block.data)
|
||||
free(hand[i].subset_info->block.data);
|
||||
HDfree(hand[i].subset_info->block.data);
|
||||
|
||||
free(hand[i].subset_info);
|
||||
HDfree(hand[i].subset_info);
|
||||
hand[i].subset_info=NULL;
|
||||
}
|
||||
}
|
||||
|
||||
free(hand);
|
||||
HDfree(hand);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1181,28 +1181,28 @@ parse_start:
|
||||
switch ((char)opt) {
|
||||
case 's':
|
||||
if (s->start.data) {
|
||||
free(s->start.data);
|
||||
HDfree(s->start.data);
|
||||
s->start.data = NULL;
|
||||
}
|
||||
parse_hsize_list(opt_arg, &s->start);
|
||||
break;
|
||||
case 'S':
|
||||
if (s->stride.data) {
|
||||
free(s->stride.data);
|
||||
HDfree(s->stride.data);
|
||||
s->stride.data = NULL;
|
||||
}
|
||||
parse_hsize_list(opt_arg, &s->stride);
|
||||
break;
|
||||
case 'c':
|
||||
if (s->count.data) {
|
||||
free(s->count.data);
|
||||
HDfree(s->count.data);
|
||||
s->count.data = NULL;
|
||||
}
|
||||
parse_hsize_list(opt_arg, &s->count);
|
||||
break;
|
||||
case 'k':
|
||||
if (s->block.data) {
|
||||
free(s->block.data);
|
||||
HDfree(s->block.data);
|
||||
s->block.data = NULL;
|
||||
}
|
||||
parse_hsize_list(opt_arg, &s->block);
|
||||
@ -1629,7 +1629,7 @@ h5_fileaccess(void)
|
||||
HDmemset(memb_name, 0, sizeof memb_name);
|
||||
HDmemset(memb_addr, 0, sizeof memb_addr);
|
||||
|
||||
assert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
|
||||
HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
|
||||
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
|
||||
memb_fapl[mt] = H5P_DEFAULT;
|
||||
memb_map[mt] = mt;
|
||||
|
@ -181,7 +181,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -574,7 +574,7 @@ dump_named_datatype(hid_t tid, const char *name)
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -751,7 +751,7 @@ dump_group(hid_t gid, const char *name)
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -1351,7 +1351,7 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe
|
||||
} /* end else */
|
||||
|
||||
dump_indent += COL;
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
|
@ -73,7 +73,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -787,7 +787,7 @@ xml_print_datatype(hid_t type, unsigned in_group)
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -820,7 +820,7 @@ xml_print_datatype(hid_t type, unsigned in_group)
|
||||
/* This should be defined somewhere else */
|
||||
/* These 2 cases are handled the same right now, but
|
||||
probably will have something different eventually */
|
||||
char * dtxid = (char *)malloc(100);
|
||||
char * dtxid = (char *)HDmalloc(100);
|
||||
|
||||
xml_name_to_XID(found_obj->objname, dtxid, 100, 1);
|
||||
if (!found_obj->recorded) {
|
||||
@ -848,9 +848,9 @@ xml_print_datatype(hid_t type, unsigned in_group)
|
||||
h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"%s\" H5Path=\"%s\"/>",
|
||||
xmlnsprefix, dtxid, t_objname);
|
||||
h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
|
||||
free(t_objname);
|
||||
HDfree(t_objname);
|
||||
}
|
||||
free(dtxid);
|
||||
HDfree(dtxid);
|
||||
}
|
||||
else {
|
||||
ctx.need_prefix = TRUE;
|
||||
@ -1134,7 +1134,7 @@ xml_print_datatype(hid_t type, unsigned in_group)
|
||||
/* Render the element */
|
||||
h5tools_str_reset(&buffer);
|
||||
h5tools_str_append(&buffer, "<%sOpaqueType Tag=\"%s\" ",xmlnsprefix, mname);
|
||||
free(mname);
|
||||
HDfree(mname);
|
||||
size = H5Tget_size(type);
|
||||
h5tools_str_append(&buffer, "Size=\"%lu\"/>", (unsigned long)size);
|
||||
h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
|
||||
@ -1183,8 +1183,8 @@ xml_print_datatype(hid_t type, unsigned in_group)
|
||||
h5tools_str_append(&buffer, "<%sField FieldName=\"%s\">",xmlnsprefix, t_fname);
|
||||
h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
|
||||
|
||||
free(mname);
|
||||
free(t_fname);
|
||||
HDfree(mname);
|
||||
HDfree(t_fname);
|
||||
dump_indent += COL;
|
||||
ctx.indent_level++;
|
||||
|
||||
@ -1475,7 +1475,7 @@ xml_dump_datatype(hid_t type)
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -1510,7 +1510,7 @@ xml_dump_datatype(hid_t type)
|
||||
if(found_obj) {
|
||||
/* Shared datatype, must be entered as an object */
|
||||
/* These 2 cases are the same now, but may change */
|
||||
char *dtxid = (char *)malloc(100);
|
||||
char *dtxid = (char *)HDmalloc(100);
|
||||
|
||||
xml_name_to_XID(found_obj->objname, dtxid, 100, 1);
|
||||
if (!found_obj->recorded) {
|
||||
@ -1541,9 +1541,9 @@ xml_dump_datatype(hid_t type)
|
||||
h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"%s\" H5Path=\"%s\" />",
|
||||
xmlnsprefix, dtxid, t_objname);
|
||||
h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
|
||||
free(t_objname);
|
||||
HDfree(t_objname);
|
||||
}
|
||||
free(dtxid);
|
||||
HDfree(dtxid);
|
||||
}
|
||||
else {
|
||||
ctx.need_prefix = TRUE;
|
||||
@ -1614,7 +1614,7 @@ xml_dump_dataspace(hid_t space)
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -1853,7 +1853,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU
|
||||
}
|
||||
else {
|
||||
h5tools_context_t datactx;
|
||||
memset(&datactx, 0, sizeof(datactx));
|
||||
HDmemset(&datactx, 0, sizeof(datactx));
|
||||
datactx.need_prefix = TRUE;
|
||||
datactx.indent_level = ctx.indent_level;
|
||||
datactx.cur_column = ctx.cur_column;
|
||||
@ -1897,12 +1897,12 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU
|
||||
for (i = 0; i < ndims; i++)
|
||||
nelmts *= size[i];
|
||||
|
||||
buf = malloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type))));
|
||||
assert(buf);
|
||||
buf = HDmalloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type))));
|
||||
HDassert(buf);
|
||||
|
||||
if (H5Aread(obj_id, p_type, buf) >= 0) {
|
||||
h5tools_context_t datactx;
|
||||
memset(&datactx, 0, sizeof(datactx));
|
||||
HDmemset(&datactx, 0, sizeof(datactx));
|
||||
datactx.need_prefix = TRUE;
|
||||
datactx.indent_level = ctx.indent_level;
|
||||
datactx.cur_column = ctx.cur_column;
|
||||
@ -1912,7 +1912,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU
|
||||
if (vl_data)
|
||||
H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf);
|
||||
|
||||
free(buf);
|
||||
HDfree(buf);
|
||||
H5Tclose(p_type);
|
||||
H5Sclose(space);
|
||||
H5Tclose(type);
|
||||
@ -1991,7 +1991,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info,
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -2019,7 +2019,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info,
|
||||
h5tools_str_reset(&buffer);
|
||||
h5tools_str_append(&buffer, "<%sAttribute Name=\"%s\">", xmlnsprefix, t_aname);
|
||||
h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
|
||||
free(t_aname);
|
||||
HDfree(t_aname);
|
||||
|
||||
if ((attr_id = H5Aopen(attr, attr_name, H5P_DEFAULT)) >= 0) {
|
||||
type = H5Aget_type(attr_id);
|
||||
@ -2317,7 +2317,7 @@ xml_dump_named_datatype(hid_t type, const char *name)
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -2542,7 +2542,7 @@ xml_dump_group(hid_t gid, const char *name)
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -2595,11 +2595,11 @@ xml_dump_group(hid_t gid, const char *name)
|
||||
}
|
||||
else {
|
||||
char *t_name = xml_escape_the_name(name);
|
||||
char *grpxid = (char *)malloc(100);
|
||||
char *parentxid = (char *)malloc(100);
|
||||
char *grpxid = (char *)HDmalloc(100);
|
||||
char *parentxid = (char *)HDmalloc(100);
|
||||
|
||||
if(found_obj->displayed) {
|
||||
char *ptrstr = (char *)malloc(100);
|
||||
char *ptrstr = (char *)HDmalloc(100);
|
||||
|
||||
/* already seen: enter a groupptr */
|
||||
if(isRoot) {
|
||||
@ -2631,8 +2631,8 @@ xml_dump_group(hid_t gid, const char *name)
|
||||
xmlnsprefix,t_name, grpxid, get_next_xid(),
|
||||
t_objname, parentxid, par_name);
|
||||
h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
|
||||
free(t_objname);
|
||||
free(par_name);
|
||||
HDfree(t_objname);
|
||||
HDfree(par_name);
|
||||
|
||||
ctx.indent_level++;
|
||||
|
||||
@ -2654,10 +2654,10 @@ xml_dump_group(hid_t gid, const char *name)
|
||||
|
||||
ctx.indent_level--;
|
||||
|
||||
free(t_objname);
|
||||
free(par_name);
|
||||
HDfree(t_objname);
|
||||
HDfree(par_name);
|
||||
}
|
||||
free(ptrstr);
|
||||
HDfree(ptrstr);
|
||||
}
|
||||
else {
|
||||
|
||||
@ -2691,8 +2691,8 @@ xml_dump_group(hid_t gid, const char *name)
|
||||
xmlnsprefix,t_name, grpxid, t_tmp, parentxid, par_name);
|
||||
h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
|
||||
|
||||
free(t_tmp);
|
||||
free(par_name);
|
||||
HDfree(t_tmp);
|
||||
HDfree(par_name);
|
||||
}
|
||||
found_obj->displayed = TRUE;
|
||||
|
||||
@ -2740,16 +2740,16 @@ xml_dump_group(hid_t gid, const char *name)
|
||||
dump_indent -= COL;
|
||||
ctx.indent_level--;
|
||||
}
|
||||
free(t_name);
|
||||
free(grpxid);
|
||||
free(parentxid);
|
||||
HDfree(t_name);
|
||||
HDfree(grpxid);
|
||||
HDfree(parentxid);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* only link -- must be first time! */
|
||||
char *t_name = xml_escape_the_name(name);
|
||||
char *grpxid = (char *)malloc(100);
|
||||
char *parentxid = (char *)malloc(100);
|
||||
char *grpxid = (char *)HDmalloc(100);
|
||||
char *parentxid = (char *)HDmalloc(100);
|
||||
|
||||
ctx.need_prefix = TRUE;
|
||||
h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
|
||||
@ -2770,14 +2770,14 @@ xml_dump_group(hid_t gid, const char *name)
|
||||
h5tools_str_append(&buffer, "<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" "
|
||||
"Parents=\"%s\" H5ParentPaths=\"%s\" >",
|
||||
xmlnsprefix, t_name, grpxid, t_tmp, parentxid, par_name);
|
||||
free(t_tmp);
|
||||
free(par_name);
|
||||
HDfree(t_tmp);
|
||||
HDfree(par_name);
|
||||
}
|
||||
h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
|
||||
|
||||
free(t_name);
|
||||
free(grpxid);
|
||||
free(parentxid);
|
||||
HDfree(t_name);
|
||||
HDfree(grpxid);
|
||||
HDfree(parentxid);
|
||||
|
||||
/* 1. do all the attributes of the group */
|
||||
|
||||
@ -2838,9 +2838,9 @@ xml_dump_group(hid_t gid, const char *name)
|
||||
h5tools_str_close(&buffer);
|
||||
|
||||
if(par)
|
||||
free(par);
|
||||
HDfree(par);
|
||||
if(tmp)
|
||||
free(tmp);
|
||||
HDfree(tmp);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -2931,7 +2931,7 @@ xml_print_refs(hid_t did, int source)
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -2975,7 +2975,7 @@ xml_print_refs(hid_t did, int source)
|
||||
h5tools_str_reset(&buffer);
|
||||
h5tools_str_append(&buffer, "\"%s\"", t_path);
|
||||
h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
|
||||
free(t_path);
|
||||
HDfree(t_path);
|
||||
}
|
||||
ctx.indent_level--;
|
||||
|
||||
@ -2984,14 +2984,14 @@ xml_print_refs(hid_t did, int source)
|
||||
|
||||
h5tools_str_close(&buffer);
|
||||
|
||||
free(buf);
|
||||
HDfree(buf);
|
||||
H5Tclose(type);
|
||||
H5Sclose(space);
|
||||
return SUCCEED;
|
||||
|
||||
error:
|
||||
if(buf)
|
||||
free(buf);
|
||||
HDfree(buf);
|
||||
|
||||
H5E_BEGIN_TRY {
|
||||
H5Tclose(type);
|
||||
@ -3057,7 +3057,7 @@ xml_print_strs(hid_t did, int source)
|
||||
if((tsiz = H5Tget_size(type)) == 0)
|
||||
goto error;
|
||||
|
||||
buf = malloc((size_t)(ssiz * tsiz));
|
||||
buf = HDmalloc((size_t)(ssiz * tsiz));
|
||||
if (buf == NULL)
|
||||
goto error;
|
||||
|
||||
@ -3073,7 +3073,7 @@ xml_print_strs(hid_t did, int source)
|
||||
if((tsiz = H5Tget_size(type)) == 0)
|
||||
goto error;
|
||||
|
||||
buf = malloc((size_t)(ssiz * tsiz));
|
||||
buf = HDmalloc((size_t)(ssiz * tsiz));
|
||||
if (buf == NULL)
|
||||
goto error;
|
||||
|
||||
@ -3090,7 +3090,7 @@ xml_print_strs(hid_t did, int source)
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -3141,7 +3141,7 @@ xml_print_strs(hid_t did, int source)
|
||||
h5tools_str_reset(&buffer);
|
||||
h5tools_str_append(&buffer, "\"%s\"", t_onestring);
|
||||
h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
|
||||
free(t_onestring);
|
||||
HDfree(t_onestring);
|
||||
}
|
||||
}
|
||||
bp += tsiz;
|
||||
@ -3152,11 +3152,11 @@ xml_print_strs(hid_t did, int source)
|
||||
/* Reclaim any VL memory, if necessary */
|
||||
if (!is_vlstr)
|
||||
if (onestring)
|
||||
free(onestring);
|
||||
HDfree(onestring);
|
||||
if (buf) {
|
||||
if (is_vlstr)
|
||||
H5Dvlen_reclaim(type, space, H5P_DEFAULT, buf);
|
||||
free(buf);
|
||||
HDfree(buf);
|
||||
}
|
||||
H5Tclose(type);
|
||||
H5Sclose(space);
|
||||
@ -3164,7 +3164,7 @@ xml_print_strs(hid_t did, int source)
|
||||
|
||||
error:
|
||||
if(buf)
|
||||
free(buf);
|
||||
HDfree(buf);
|
||||
|
||||
H5E_BEGIN_TRY {
|
||||
H5Tclose(type);
|
||||
@ -3206,7 +3206,7 @@ check_filters(hid_t dcpl)
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -3346,7 +3346,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -3381,7 +3381,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
|
||||
dump_indent += COL;
|
||||
|
||||
space = H5Tget_size(type);
|
||||
buf = malloc((size_t) space);
|
||||
buf = HDmalloc((size_t) space);
|
||||
|
||||
H5Pget_fill_value(dcpl, type, buf);
|
||||
|
||||
@ -3414,7 +3414,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
|
||||
h5tools_str_reset(&buffer);
|
||||
h5tools_str_append(&buffer, "\"%s\"", t_path);
|
||||
h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
|
||||
free(t_path);
|
||||
HDfree(t_path);
|
||||
}
|
||||
|
||||
ctx.need_prefix = TRUE;
|
||||
@ -3641,7 +3641,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(buf);
|
||||
HDfree(buf);
|
||||
ctx.indent_level--;
|
||||
dump_indent -= COL;
|
||||
|
||||
@ -3709,7 +3709,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -3764,7 +3764,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
|
||||
/* Print information about storage layout */
|
||||
if (H5D_CHUNKED == H5Pget_layout(dcpl)) {
|
||||
maxdims = H5Sget_simple_extent_ndims(space);
|
||||
chsize = (hsize_t *) malloc(maxdims * sizeof(hsize_t));
|
||||
chsize = (hsize_t *) HDmalloc(maxdims * sizeof(hsize_t));
|
||||
ctx.indent_level++;
|
||||
dump_indent += COL;
|
||||
|
||||
@ -3846,7 +3846,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
|
||||
h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
|
||||
ctx.indent_level--;
|
||||
dump_indent -= COL;
|
||||
free(chsize);
|
||||
HDfree(chsize);
|
||||
}
|
||||
else if (H5D_CONTIGUOUS == H5Pget_layout(dcpl)) {
|
||||
ctx.indent_level++;
|
||||
@ -4291,7 +4291,7 @@ xml_print_enum(hid_t type)
|
||||
/* setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
ctx.indent_level = dump_indent/COL;
|
||||
ctx.cur_column = dump_indent;
|
||||
|
||||
@ -4391,7 +4391,7 @@ xml_print_enum(hid_t type)
|
||||
h5tools_str_reset(&buffer);
|
||||
h5tools_str_append(&buffer, "%s", t_name);
|
||||
h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
|
||||
free(t_name);
|
||||
HDfree(t_name);
|
||||
ctx.indent_level--;
|
||||
|
||||
ctx.need_prefix = TRUE;
|
||||
@ -4447,10 +4447,10 @@ xml_print_enum(hid_t type)
|
||||
|
||||
/* Release resources */
|
||||
for (i = 0; i < nmembs; i++)
|
||||
free(name[i]);
|
||||
HDfree(name[i]);
|
||||
|
||||
free(name);
|
||||
free(value);
|
||||
HDfree(name);
|
||||
HDfree(value);
|
||||
H5Tclose(super);
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -310,18 +310,18 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
|
||||
{
|
||||
HDassert(ub_size <= BUF_SIZE);
|
||||
|
||||
fd = HDopen(filename, O_RDWR, 0);
|
||||
fd = HDopen(filename, O_RDWR, 0);
|
||||
HDassert(fd >= 0);
|
||||
|
||||
/* fill buf with pattern */
|
||||
HDmemset(buf, '\0', ub_size);
|
||||
bp = buf;
|
||||
for (u = 0; u < ub_fill; u++)
|
||||
/* fill buf with pattern */
|
||||
HDmemset(buf, '\0', ub_size);
|
||||
bp = buf;
|
||||
for (u = 0; u < ub_fill; u++)
|
||||
*bp++ = pattern[u % 10];
|
||||
|
||||
HDwrite(fd, buf, ub_size);
|
||||
HDwrite(fd, buf, ub_size);
|
||||
|
||||
HDclose(fd);
|
||||
HDclose(fd);
|
||||
}
|
||||
}
|
||||
|
||||
@ -334,9 +334,9 @@ create_textfile(const char *name, size_t size)
|
||||
char *bp;
|
||||
|
||||
fd = HDcreat(name,0777);
|
||||
assert(fd >= 0);
|
||||
HDassert(fd >= 0);
|
||||
buf = calloc(size, (size_t)1);
|
||||
assert(buf);
|
||||
HDassert(buf);
|
||||
|
||||
/* fill buf with pattern */
|
||||
bp = buf;
|
||||
@ -345,7 +345,7 @@ create_textfile(const char *name, size_t size)
|
||||
|
||||
HDwrite(fd, buf, size);
|
||||
|
||||
free(buf);
|
||||
HDfree(buf);
|
||||
|
||||
HDclose(fd);
|
||||
}
|
||||
|
@ -828,7 +828,7 @@ display_cmpd_type(hid_t type, int ind)
|
||||
n = display_string(stdout, name, FALSE);
|
||||
printf("\"%*s +%-4lu ", MAX(0, 16-n), "",
|
||||
(unsigned long)H5Tget_member_offset(type, i));
|
||||
free(name);
|
||||
HDfree(name);
|
||||
|
||||
/* Member's type */
|
||||
subtype = H5Tget_member_type(type, i);
|
||||
@ -874,7 +874,7 @@ display_enum_type(hid_t type, int ind)
|
||||
|
||||
if (H5T_ENUM!=H5Tget_class(type)) return FALSE;
|
||||
nmembs = H5Tget_nmembers(type);
|
||||
assert(nmembs>0);
|
||||
HDassert(nmembs>0);
|
||||
super = H5Tget_super(type);
|
||||
printf("enum ");
|
||||
display_type(super, ind+4);
|
||||
@ -936,9 +936,9 @@ display_enum_type(hid_t type, int ind)
|
||||
}
|
||||
|
||||
/* Release resources */
|
||||
for (i=0; i<nmembs; i++) free(name[i]);
|
||||
free(name);
|
||||
free(value);
|
||||
for (i=0; i<nmembs; i++) HDfree(name[i]);
|
||||
HDfree(name);
|
||||
HDfree(value);
|
||||
H5Tclose(super);
|
||||
|
||||
if (0==nmembs) printf("\n%*s <empty>", ind+4, "");
|
||||
@ -1113,7 +1113,7 @@ display_opaque_type(hid_t type, int ind)
|
||||
printf("\n%*s(tag = \"", ind, "");
|
||||
display_string(stdout, tag, FALSE);
|
||||
printf("\")");
|
||||
free(tag);
|
||||
HDfree(tag);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -1172,7 +1172,7 @@ display_array_type(hid_t type, int ind)
|
||||
if (H5T_ARRAY!=H5Tget_class(type)) return FALSE;
|
||||
ndims = H5Tget_array_ndims(type);
|
||||
if (ndims) {
|
||||
dims = (hsize_t *)malloc(ndims*sizeof(dims[0]));
|
||||
dims = (hsize_t *)HDmalloc(ndims*sizeof(dims[0]));
|
||||
H5Tget_array_dims2(type, dims);
|
||||
|
||||
/* Print dimensions */
|
||||
@ -1180,7 +1180,7 @@ display_array_type(hid_t type, int ind)
|
||||
HDfprintf(stdout, "%s%Hu" , i?",":"[", dims[i]);
|
||||
putchar(']');
|
||||
|
||||
free(dims);
|
||||
HDfree(dims);
|
||||
} else {
|
||||
fputs(" [SCALAR]", stdout);
|
||||
}
|
||||
@ -1908,7 +1908,7 @@ print_cmpd_type(h5tools_str_t *buffer, hid_t type, int ind)
|
||||
n = print_string(buffer, name, FALSE);
|
||||
h5tools_str_append(buffer, "\"%*s +%-4lu ", MAX(0, 16-n), "",
|
||||
(unsigned long)H5Tget_member_offset(type, i));
|
||||
free(name);
|
||||
HDfree(name);
|
||||
|
||||
/* Member's type */
|
||||
subtype = H5Tget_member_type(type, i);
|
||||
@ -1954,7 +1954,7 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
|
||||
|
||||
if (H5T_ENUM!=H5Tget_class(type)) return FALSE;
|
||||
nmembs = H5Tget_nmembers(type);
|
||||
assert(nmembs>0);
|
||||
HDassert(nmembs>0);
|
||||
super = H5Tget_super(type);
|
||||
h5tools_str_append(buffer, "enum ");
|
||||
print_type(buffer, super, ind+4);
|
||||
@ -2017,9 +2017,9 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
|
||||
}
|
||||
|
||||
/* Release resources */
|
||||
for (i=0; i<nmembs; i++) free(name[i]);
|
||||
free(name);
|
||||
free(value);
|
||||
for (i=0; i<nmembs; i++) HDfree(name[i]);
|
||||
HDfree(name);
|
||||
HDfree(value);
|
||||
H5Tclose(super);
|
||||
|
||||
if (0==nmembs) h5tools_str_append(buffer, "\n%*s <empty>", ind+4, "");
|
||||
@ -2197,7 +2197,7 @@ print_opaque_type(h5tools_str_t *buffer, hid_t type, int ind)
|
||||
h5tools_str_append(buffer, "\n%*s(tag = \"", ind, "");
|
||||
print_string(buffer, tag, FALSE);
|
||||
h5tools_str_append(buffer, "\")");
|
||||
free(tag);
|
||||
HDfree(tag);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -2256,15 +2256,15 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind)
|
||||
if (H5T_ARRAY!=H5Tget_class(type)) return FALSE;
|
||||
ndims = H5Tget_array_ndims(type);
|
||||
if (ndims) {
|
||||
dims = (hsize_t *)malloc(ndims*sizeof(dims[0]));
|
||||
dims = (hsize_t *)HDmalloc(ndims*sizeof(dims[0]));
|
||||
H5Tget_array_dims2(type, dims);
|
||||
|
||||
/* Print dimensions */
|
||||
for (i=0; i<ndims; i++)
|
||||
h5tools_str_append(buffer, "%s%"H5_PRINTF_LL_WIDTH"u" , i?",":"[", dims[i]);
|
||||
h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT , i?",":"[", dims[i]);
|
||||
h5tools_str_append(buffer, "]");
|
||||
|
||||
free(dims);
|
||||
HDfree(dims);
|
||||
}
|
||||
else {
|
||||
h5tools_str_append(buffer, " [SCALAR]\n", stdout);
|
||||
@ -2586,7 +2586,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo,
|
||||
/* simple dataspace */
|
||||
h5tools_str_append(&buffer, " {");
|
||||
for (i=0; i<ndims; i++) {
|
||||
h5tools_str_append(&buffer, "%s%"H5_PRINTF_LL_WIDTH"u", i?", ":"", size[i]);
|
||||
h5tools_str_append(&buffer, "%s" HSIZE_T_FORMAT, i?", ":"", size[i]);
|
||||
nelmts *= size[i];
|
||||
}
|
||||
h5tools_str_append(&buffer, "}\n");
|
||||
@ -2676,10 +2676,10 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo,
|
||||
vl_data = TRUE;
|
||||
|
||||
temp_need= nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type));
|
||||
assert(temp_need == (hsize_t)((size_t)temp_need));
|
||||
HDassert(temp_need == (hsize_t)((size_t)temp_need));
|
||||
need = (size_t)temp_need;
|
||||
buf = malloc(need);
|
||||
assert(buf);
|
||||
buf = HDmalloc(need);
|
||||
HDassert(buf);
|
||||
if(H5Aread(attr, p_type, buf) >= 0) {
|
||||
ctx.need_prefix = TRUE;
|
||||
ctx.indent_level = 2;
|
||||
@ -2691,7 +2691,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo,
|
||||
if (vl_data)
|
||||
H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf);
|
||||
|
||||
free(buf);
|
||||
HDfree(buf);
|
||||
H5Tclose(p_type);
|
||||
} /* end if */
|
||||
fprintf(stdout, "\n");
|
||||
@ -3115,7 +3115,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
|
||||
h5tool_link_info_t lnk_info;
|
||||
|
||||
/* init linkinfo struct */
|
||||
memset(&lnk_info, 0, sizeof(h5tool_link_info_t));
|
||||
HDmemset(&lnk_info, 0, sizeof(h5tool_link_info_t));
|
||||
|
||||
/* if verbose, make H5tools_get_symlink_info() display more */
|
||||
if (verbose_g)
|
||||
|
@ -90,7 +90,7 @@ int
|
||||
h5repack_init(pack_opt_t *options, int verbose, H5F_file_space_type_t strategy, hsize_t threshold)
|
||||
{
|
||||
int k, n;
|
||||
memset(options,0,sizeof(pack_opt_t));
|
||||
HDmemset(options,0,sizeof(pack_opt_t));
|
||||
options->min_comp = 1024;
|
||||
options->verbose = verbose;
|
||||
|
||||
@ -157,7 +157,7 @@ int h5repack_addfilter(const char* str,
|
||||
if(options->n_filter_g > H5_REPACK_MAX_NFILTERS)
|
||||
{
|
||||
error_msg("maximum number of filters exceeded for <%s>\n", str);
|
||||
free(obj_list);
|
||||
HDfree(obj_list);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ int h5repack_addfilter(const char* str,
|
||||
else
|
||||
options_add_filter(obj_list, n_objs, filter, options->op_tbl);
|
||||
|
||||
free(obj_list);
|
||||
HDfree(obj_list);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -232,7 +232,7 @@ int h5repack_addlayout(const char* str,
|
||||
&pack,
|
||||
options->op_tbl);
|
||||
|
||||
free(obj_list);
|
||||
HDfree(obj_list);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -493,24 +493,24 @@ int copy_attr(hid_t loc_in,
|
||||
type_class = H5Tget_class(wtype_id);
|
||||
is_ref = (type_class == H5T_REFERENCE);
|
||||
if (type_class == H5T_VLEN ||type_class == H5T_ARRAY ) {
|
||||
hid_t base_type = -1;
|
||||
base_type = H5Tget_super(ftype_id);
|
||||
is_ref = (is_ref || (H5Tget_class(base_type)==H5T_REFERENCE));
|
||||
H5Tclose(base_type);
|
||||
hid_t base_type = -1;
|
||||
base_type = H5Tget_super(ftype_id);
|
||||
is_ref = (is_ref || (H5Tget_class(base_type)==H5T_REFERENCE));
|
||||
H5Tclose(base_type);
|
||||
}
|
||||
|
||||
if (type_class == H5T_COMPOUND) {
|
||||
int nmembers = H5Tget_nmembers(wtype_id) ;
|
||||
for (j=0; j<nmembers; j++) {
|
||||
hid_t mtid = H5Tget_member_type( wtype_id, j );
|
||||
H5T_class_t mtclass = H5Tget_class(mtid);
|
||||
H5Tclose(mtid);
|
||||
int nmembers = H5Tget_nmembers(wtype_id) ;
|
||||
for (j=0; j<nmembers; j++) {
|
||||
hid_t mtid = H5Tget_member_type( wtype_id, j );
|
||||
H5T_class_t mtclass = H5Tget_class(mtid);
|
||||
H5Tclose(mtid);
|
||||
|
||||
if (mtclass==H5T_REFERENCE) {
|
||||
is_ref = 1;
|
||||
break;
|
||||
}
|
||||
} /* for (j=0; i<nmembers; j++) */
|
||||
if (mtclass==H5T_REFERENCE) {
|
||||
is_ref = 1;
|
||||
break;
|
||||
}
|
||||
} /* for (j=0; i<nmembers; j++) */
|
||||
} /* if (type_class == H5T_COMPOUND) */
|
||||
|
||||
if(is_ref) {
|
||||
|
@ -131,23 +131,23 @@ int copy_objects(const char* fnamein,
|
||||
goto out;
|
||||
}
|
||||
|
||||
if(!options->fs_strategy)
|
||||
{
|
||||
if(H5Pget_file_space(fcpl_in, &options->fs_strategy, NULL) < 0)
|
||||
{
|
||||
error_msg("failed to retrieve file space strategy\n");
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
if(!options->fs_strategy)
|
||||
{
|
||||
if(H5Pget_file_space(fcpl_in, &options->fs_strategy, NULL) < 0)
|
||||
{
|
||||
error_msg("failed to retrieve file space strategy\n");
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if(!options->fs_threshold)
|
||||
{
|
||||
if(H5Pget_file_space(fcpl_in, NULL, &options->fs_threshold) < 0)
|
||||
{
|
||||
error_msg("failed to retrieve file space threshold\n");
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
if(!options->fs_threshold)
|
||||
{
|
||||
if(H5Pget_file_space(fcpl_in, NULL, &options->fs_threshold) < 0)
|
||||
{
|
||||
error_msg("failed to retrieve file space threshold\n");
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if(H5Pclose(fcpl_in) < 0)
|
||||
{
|
||||
@ -348,28 +348,28 @@ int copy_objects(const char* fnamein,
|
||||
/* either use the FCPL already created or create a new one */
|
||||
if(fcpl != H5P_DEFAULT)
|
||||
{
|
||||
/* set file space strategy and free space threshold */
|
||||
if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0)
|
||||
{
|
||||
error_msg("failed to set file space strategy & threshold\n");
|
||||
goto out;
|
||||
}
|
||||
/* set file space strategy and free space threshold */
|
||||
if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0)
|
||||
{
|
||||
error_msg("failed to set file space strategy & threshold\n");
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* create a file creation property list */
|
||||
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
|
||||
{
|
||||
error_msg("fail to create a file creation property list\n");
|
||||
goto out;
|
||||
}
|
||||
/* create a file creation property list */
|
||||
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
|
||||
{
|
||||
error_msg("fail to create a file creation property list\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* set file space strategy and free space threshold */
|
||||
if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0)
|
||||
{
|
||||
error_msg("failed to set file space strategy & threshold \n");
|
||||
goto out;
|
||||
}
|
||||
/* set file space strategy and free space threshold */
|
||||
if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0)
|
||||
{
|
||||
error_msg("failed to set file space strategy & threshold \n");
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -618,7 +618,7 @@ int do_copy_objects(hid_t fidin,
|
||||
{
|
||||
|
||||
case H5TRAV_TYPE_UNKNOWN:
|
||||
assert(0);
|
||||
HDassert(0);
|
||||
break;
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5TRAV_TYPE_GROUP
|
||||
@ -921,7 +921,7 @@ int do_copy_objects(hid_t fidin,
|
||||
size = 1;
|
||||
sm_size[k - 1] = MIN(dims[k - 1], size);
|
||||
sm_nbytes *= sm_size[k - 1];
|
||||
assert(sm_nbytes > 0);
|
||||
HDassert(sm_nbytes > 0);
|
||||
}
|
||||
sm_buf = HDmalloc((size_t)sm_nbytes);
|
||||
|
||||
@ -929,8 +929,8 @@ int do_copy_objects(hid_t fidin,
|
||||
sm_space = H5Screate_simple(1, &sm_nelmts, NULL);
|
||||
|
||||
/* the stripmine loop */
|
||||
memset(hs_offset, 0, sizeof hs_offset);
|
||||
memset(zero, 0, sizeof zero);
|
||||
HDmemset(hs_offset, 0, sizeof hs_offset);
|
||||
HDmemset(zero, 0, sizeof zero);
|
||||
|
||||
for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts)
|
||||
{
|
||||
@ -1345,7 +1345,7 @@ copy_user_block(const char *infile, const char *outfile, hsize_t size)
|
||||
int status = 0; /* Return value */
|
||||
|
||||
/* User block must be any power of 2 equal to 512 or greater (512, 1024, 2048, etc.) */
|
||||
assert(size > 0);
|
||||
HDassert(size > 0);
|
||||
|
||||
/* Open files */
|
||||
if((infid = HDopen(infile, O_RDONLY, 0)) < 0) {
|
||||
@ -1387,13 +1387,13 @@ copy_user_block(const char *infile, const char *outfile, hsize_t size)
|
||||
status = -1;
|
||||
goto done;
|
||||
} /* end if */
|
||||
assert(nwritten > 0);
|
||||
assert(nwritten <= nbytes);
|
||||
HDassert(nwritten > 0);
|
||||
HDassert(nwritten <= nbytes);
|
||||
|
||||
/* Update # of bytes left & offset in buffer */
|
||||
nbytes -= nwritten;
|
||||
wbuf += nwritten;
|
||||
assert(nbytes == 0 || wbuf < (rbuf + USERBLOCK_XFER_SIZE));
|
||||
HDassert(nbytes == 0 || wbuf < (rbuf + USERBLOCK_XFER_SIZE));
|
||||
} /* end while */
|
||||
|
||||
/* Update size of userblock left to transfer */
|
||||
|
@ -19,12 +19,12 @@
|
||||
|
||||
/* number of members in an array */
|
||||
#ifndef NELMTS
|
||||
# define NELMTS(X) (sizeof(X)/sizeof(X[0]))
|
||||
# define NELMTS(X) (sizeof(X)/sizeof(X[0]))
|
||||
#endif
|
||||
|
||||
/* minimum of two values */
|
||||
#undef MIN
|
||||
#define MIN(a,b) (((a)<(b)) ? (a) : (b))
|
||||
#define MIN(a,b) (((a)<(b)) ? (a) : (b))
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: aux_find_obj
|
||||
@ -330,7 +330,7 @@ int apply_filters(const char* name, /* object name from traverse list */
|
||||
size = 1;
|
||||
sm_size[i - 1] = MIN(dims[i - 1], size);
|
||||
sm_nbytes *= sm_size[i - 1];
|
||||
assert(sm_nbytes > 0);
|
||||
HDassert(sm_nbytes > 0);
|
||||
|
||||
}
|
||||
|
||||
|
@ -158,7 +158,7 @@ int options_table_init( pack_opttbl_t **tbl )
|
||||
if(NULL == (table->objs = (pack_info_t*)malloc(table->size * sizeof(pack_info_t))))
|
||||
{
|
||||
error_msg("not enough memory for options table\n");
|
||||
free(table);
|
||||
HDfree(table);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -182,8 +182,8 @@ int options_table_init( pack_opttbl_t **tbl )
|
||||
|
||||
int options_table_free( pack_opttbl_t *table )
|
||||
{
|
||||
free(table->objs);
|
||||
free(table);
|
||||
HDfree(table->objs);
|
||||
HDfree(table);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ obj_list_t* parse_filter(const char *str,
|
||||
|
||||
|
||||
/* initialize compression info */
|
||||
memset(filt,0,sizeof(filter_info_t));
|
||||
HDmemset(filt,0,sizeof(filter_info_t));
|
||||
*is_glb = 0;
|
||||
|
||||
/* check for the end of object list and number of objects */
|
||||
@ -105,7 +105,7 @@ obj_list_t* parse_filter(const char *str,
|
||||
{
|
||||
if ( c==',') sobj[k]='\0'; else sobj[k+1]='\0';
|
||||
HDstrcpy(obj_list[n].obj,sobj);
|
||||
memset(sobj,0,sizeof(sobj));
|
||||
HDmemset(sobj,0,sizeof(sobj));
|
||||
n++;
|
||||
k=-1;
|
||||
}
|
||||
@ -113,7 +113,7 @@ obj_list_t* parse_filter(const char *str,
|
||||
/* nothing after : */
|
||||
if (end_obj+1==(int)len)
|
||||
{
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("input Error: Invalid compression type in <%s>\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -151,7 +151,7 @@ obj_list_t* parse_filter(const char *str,
|
||||
}
|
||||
c = str[u];
|
||||
if (!isdigit(c) && l==-1){
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("compression parameter not digit in <%s>\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -211,7 +211,7 @@ obj_list_t* parse_filter(const char *str,
|
||||
}
|
||||
c = str[u];
|
||||
if (!isdigit(c) && l==-1){
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("compression parameter is not a digit in <%s>\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -255,7 +255,7 @@ obj_list_t* parse_filter(const char *str,
|
||||
{
|
||||
c = str[u];
|
||||
if (!isdigit(c)){
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("compression parameter is not a digit in <%s>\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -301,7 +301,7 @@ obj_list_t* parse_filter(const char *str,
|
||||
filt->cd_nelmts = 1;
|
||||
if (no_param)
|
||||
{ /*no more parameters, GZIP must have parameter */
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("missing compression parameter in <%s>\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -317,7 +317,7 @@ obj_list_t* parse_filter(const char *str,
|
||||
filt->cd_nelmts = 2;
|
||||
if (no_param)
|
||||
{ /*no more parameters, SZIP must have parameter */
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("missing compression parameter in <%s>\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -333,7 +333,7 @@ obj_list_t* parse_filter(const char *str,
|
||||
filt->cd_nelmts = 0;
|
||||
if (m>0)
|
||||
{ /*shuffle does not have parameter */
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("extra parameter in SHUF <%s>\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -348,7 +348,7 @@ obj_list_t* parse_filter(const char *str,
|
||||
filt->cd_nelmts = 0;
|
||||
if (m>0)
|
||||
{ /*shuffle does not have parameter */
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("extra parameter in FLET <%s>\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -363,7 +363,7 @@ obj_list_t* parse_filter(const char *str,
|
||||
filt->cd_nelmts = 0;
|
||||
if (m>0)
|
||||
{ /*nbit does not have parameter */
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("extra parameter in NBIT <%s>\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -378,13 +378,13 @@ obj_list_t* parse_filter(const char *str,
|
||||
filt->cd_nelmts = 2;
|
||||
if (no_param)
|
||||
{ /*no more parameters, SOFF must have parameter */
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("missing compression parameter in <%s>\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("invalid filter type in <%s>\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -407,7 +407,7 @@ obj_list_t* parse_filter(const char *str,
|
||||
case H5Z_FILTER_DEFLATE:
|
||||
if (filt->cd_values[0]>9 )
|
||||
{
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("invalid compression parameter in <%s>\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -422,19 +422,19 @@ obj_list_t* parse_filter(const char *str,
|
||||
pixels_per_block=filt->cd_values[0];
|
||||
if ((pixels_per_block%2)==1)
|
||||
{
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("pixels_per_block is not even in <%s>\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK)
|
||||
{
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("pixels_per_block is too large in <%s>\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if ( (HDstrcmp(smask,"NN")!=0) && (HDstrcmp(smask,"EC")!=0) )
|
||||
{
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("szip mask must be 'NN' or 'EC' \n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -486,9 +486,9 @@ obj_list_t* parse_layout(const char *str,
|
||||
char slayout[10];
|
||||
|
||||
|
||||
memset(sdim, '\0', sizeof(sdim));
|
||||
memset(sobj, '\0', sizeof(sobj));
|
||||
memset(slayout, '\0', sizeof(slayout));
|
||||
HDmemset(sdim, '\0', sizeof(sdim));
|
||||
HDmemset(sobj, '\0', sizeof(sobj));
|
||||
HDmemset(slayout, '\0', sizeof(slayout));
|
||||
|
||||
/* check for the end of object list and number of objects */
|
||||
for ( i=0, n=0; i<len; i++)
|
||||
@ -526,7 +526,7 @@ obj_list_t* parse_layout(const char *str,
|
||||
{
|
||||
if ( c==',') sobj[k]='\0'; else sobj[k+1]='\0';
|
||||
HDstrcpy(obj_list[n].obj,sobj);
|
||||
memset(sobj,0,sizeof(sobj));
|
||||
HDmemset(sobj,0,sizeof(sobj));
|
||||
n++;
|
||||
k=-1;
|
||||
}
|
||||
@ -535,7 +535,7 @@ obj_list_t* parse_layout(const char *str,
|
||||
/* nothing after : */
|
||||
if (end_obj+1==(int)len)
|
||||
{
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("in parse layout, no characters after : in <%s>\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -576,7 +576,7 @@ obj_list_t* parse_layout(const char *str,
|
||||
|
||||
if (j>(int)len)
|
||||
{
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("in parse layout, <%s> Chunk dimensions missing\n",str);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -590,7 +590,7 @@ obj_list_t* parse_layout(const char *str,
|
||||
if (!isdigit(c) && c!='x'
|
||||
&& c!='N' && c!='O' && c!='N' && c!='E'
|
||||
){
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("in parse layout, <%s> Not a valid character in <%s>\n",
|
||||
sdim,str);
|
||||
exit(EXIT_FAILURE);
|
||||
@ -603,7 +603,7 @@ obj_list_t* parse_layout(const char *str,
|
||||
k=0;
|
||||
pack->chunk.chunk_lengths[c_index]=atoi(sdim);
|
||||
if (pack->chunk.chunk_lengths[c_index]==0) {
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("in parse layout, <%s> conversion to number in <%s>\n",
|
||||
sdim,str);
|
||||
exit(EXIT_FAILURE);
|
||||
@ -621,7 +621,7 @@ obj_list_t* parse_layout(const char *str,
|
||||
{
|
||||
pack->chunk.chunk_lengths[c_index]=atoi(sdim);
|
||||
if (pack->chunk.chunk_lengths[c_index]==0){
|
||||
if (obj_list) free(obj_list);
|
||||
if (obj_list) HDfree(obj_list);
|
||||
error_msg("in parse layout, <%s> conversion to number in <%s>\n",
|
||||
sdim,str);
|
||||
exit(EXIT_FAILURE);
|
||||
|
@ -28,7 +28,7 @@ static const char* MapIdToName(hid_t refobj_id,trav_table_t *travt);
|
||||
static int copy_refs_attr(hid_t loc_in, hid_t loc_out, pack_opt_t *options,
|
||||
trav_table_t *travt, hid_t fidout);
|
||||
static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in,
|
||||
hid_t fid_out, void *ref_out, trav_table_t *travt);
|
||||
hid_t fid_out, void *ref_out, trav_table_t *travt);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: do_copy_refobjs
|
||||
@ -327,7 +327,7 @@ int do_copy_refobjs(hid_t fidin,
|
||||
goto error;
|
||||
} /* end else */
|
||||
|
||||
assert(dset_out != FAIL);
|
||||
HDassert(dset_out != FAIL);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* copy referenced objects in attributes
|
||||
@ -432,13 +432,13 @@ error:
|
||||
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
||||
*
|
||||
* Modifier: xcao@hdfgroup.org, 9/12/2011
|
||||
* Update values of references(object and region) for the following types:
|
||||
* Update values of references(object and region) for the following types:
|
||||
* 1) References,
|
||||
* 2) ARRAY of reference,
|
||||
* 3) VLEN of references.
|
||||
* 4) COMPOUND of references.
|
||||
* This function does not handle references in other complicated structures,
|
||||
* such as references in nested compound datatypes.
|
||||
* such as references in nested compound datatypes.
|
||||
*
|
||||
* Date: October, 28, 2003
|
||||
*
|
||||
@ -479,7 +479,7 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
|
||||
for(u = 0; u < (unsigned)oinfo.num_attrs; u++)
|
||||
{
|
||||
is_ref = is_ref_vlen = is_ref_array = is_ref_comp = 0;
|
||||
is_ref = is_ref_vlen = is_ref_array = is_ref_comp = 0;
|
||||
|
||||
/* open attribute */
|
||||
if((attr_id = H5Aopen_by_idx(loc_in, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
||||
@ -500,39 +500,39 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
is_ref = (type_class == H5T_REFERENCE);
|
||||
|
||||
if (type_class == H5T_VLEN ) {
|
||||
hid_t base_type = -1;
|
||||
base_type = H5Tget_super(ftype_id);
|
||||
is_ref_vlen = (H5Tget_class(base_type)==H5T_REFERENCE);
|
||||
msize = H5Tget_size(base_type);
|
||||
H5Tclose(base_type);
|
||||
hid_t base_type = -1;
|
||||
base_type = H5Tget_super(ftype_id);
|
||||
is_ref_vlen = (H5Tget_class(base_type)==H5T_REFERENCE);
|
||||
msize = H5Tget_size(base_type);
|
||||
H5Tclose(base_type);
|
||||
}
|
||||
|
||||
if (type_class == H5T_ARRAY ) {
|
||||
hid_t base_type = -1;
|
||||
base_type = H5Tget_super(ftype_id);
|
||||
is_ref_array = (H5Tget_class(base_type)==H5T_REFERENCE);
|
||||
msize = H5Tget_size(base_type);
|
||||
H5Tclose(base_type);
|
||||
hid_t base_type = -1;
|
||||
base_type = H5Tget_super(ftype_id);
|
||||
is_ref_array = (H5Tget_class(base_type)==H5T_REFERENCE);
|
||||
msize = H5Tget_size(base_type);
|
||||
H5Tclose(base_type);
|
||||
}
|
||||
|
||||
if (type_class == H5T_COMPOUND) {
|
||||
int nmembers = H5Tget_nmembers(ftype_id) ;
|
||||
if (nmembers < 1)
|
||||
goto error;
|
||||
int nmembers = H5Tget_nmembers(ftype_id) ;
|
||||
if (nmembers < 1)
|
||||
goto error;
|
||||
|
||||
ref_comp_index = (int *)HDmalloc(nmembers*sizeof (int));
|
||||
ref_comp_size = (size_t *)HDmalloc(nmembers*sizeof(ref_comp_size));
|
||||
ref_comp_field_n = 0;
|
||||
|
||||
for (i=0; i<(unsigned)nmembers; i++) {
|
||||
hid_t mtid = H5Tget_member_type( ftype_id, i );
|
||||
if ((H5Tget_class(mtid)==H5T_REFERENCE)) {
|
||||
ref_comp_index[ref_comp_field_n] = i;
|
||||
ref_comp_size[ref_comp_field_n] = H5Tget_size(mtid);
|
||||
ref_comp_field_n++;
|
||||
}
|
||||
H5Tclose(mtid);
|
||||
}
|
||||
for (i=0; i<(unsigned)nmembers; i++) {
|
||||
hid_t mtid = H5Tget_member_type( ftype_id, i );
|
||||
if ((H5Tget_class(mtid)==H5T_REFERENCE)) {
|
||||
ref_comp_index[ref_comp_field_n] = i;
|
||||
ref_comp_size[ref_comp_field_n] = H5Tget_size(mtid);
|
||||
ref_comp_field_n++;
|
||||
}
|
||||
H5Tclose(mtid);
|
||||
}
|
||||
|
||||
/* if compound don't contain reference type member, free the above
|
||||
* mallocs. Otherwise there can be memory leaks by the 'continue'
|
||||
@ -541,14 +541,14 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
{
|
||||
if (ref_comp_index)
|
||||
{
|
||||
HDfree(ref_comp_index);
|
||||
ref_comp_index = NULL;
|
||||
HDfree(ref_comp_index);
|
||||
ref_comp_index = NULL;
|
||||
}
|
||||
|
||||
if (ref_comp_size)
|
||||
{
|
||||
HDfree(ref_comp_size);
|
||||
ref_comp_size = NULL;
|
||||
HDfree(ref_comp_size);
|
||||
ref_comp_size = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -556,10 +556,10 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
is_ref_comp = (ref_comp_field_n > 0);
|
||||
|
||||
if (!(is_ref || is_ref_vlen || is_ref_array || is_ref_comp)) {
|
||||
H5Tclose(mtype_id);
|
||||
H5Tclose(ftype_id);
|
||||
H5Aclose(attr_id);
|
||||
continue;
|
||||
H5Tclose(mtype_id);
|
||||
H5Tclose(ftype_id);
|
||||
H5Aclose(attr_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* get name */
|
||||
@ -584,18 +584,18 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
nelmts *= dims[j];
|
||||
|
||||
if (is_ref_array) {
|
||||
unsigned array_rank = 0;
|
||||
hsize_t array_size = 1;
|
||||
hsize_t array_dims[H5S_MAX_RANK];
|
||||
hid_t base_type = -1;
|
||||
base_type = H5Tget_super(ftype_id);
|
||||
msize = H5Tget_size(base_type);
|
||||
H5Tclose(base_type);
|
||||
unsigned array_rank = 0;
|
||||
hsize_t array_size = 1;
|
||||
hsize_t array_dims[H5S_MAX_RANK];
|
||||
hid_t base_type = -1;
|
||||
base_type = H5Tget_super(ftype_id);
|
||||
msize = H5Tget_size(base_type);
|
||||
H5Tclose(base_type);
|
||||
|
||||
array_rank = H5Tget_array_ndims(mtype_id);
|
||||
H5Tget_array_dims2(mtype_id, array_dims);
|
||||
array_rank = H5Tget_array_ndims(mtype_id);
|
||||
H5Tget_array_dims2(mtype_id, array_dims);
|
||||
for(j = 0; j <array_rank; j++)
|
||||
array_size *= array_dims[j];
|
||||
array_size *= array_dims[j];
|
||||
nelmts *= array_size;
|
||||
}
|
||||
|
||||
@ -626,7 +626,7 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
for(i = 0; i < (unsigned)nelmts; i++)
|
||||
{
|
||||
if (update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout, &((hobj_ref_t *)refbuf)[i], travt)<0)
|
||||
continue;
|
||||
continue;
|
||||
if(options->verbose)
|
||||
printf("object <%s> reference created to <%s>\n", name, refname);
|
||||
} /* k */
|
||||
@ -657,13 +657,13 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
for(i = 0; i < (unsigned)nelmts; i++)
|
||||
{
|
||||
if (update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, &((hdset_reg_ref_t *)refbuf)[i], travt)<0)
|
||||
continue;
|
||||
continue;
|
||||
if(options->verbose)
|
||||
printf("object <%s> region reference created to <%s>\n", name, refname);
|
||||
}
|
||||
} /* H5T_STD_REF_DSETREG */
|
||||
else if (is_ref_vlen) {
|
||||
/* handle VLEN of references */
|
||||
/* handle VLEN of references */
|
||||
|
||||
buf = (hvl_t *)HDmalloc((unsigned)(nelmts * sizeof(hvl_t)));
|
||||
refbuf = buf; /* reuse the read buffer for write */
|
||||
@ -677,31 +677,31 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
if(H5Aread(attr_id, mtype_id, buf) < 0)
|
||||
goto error;
|
||||
|
||||
if (H5R_OBJ_REF_BUF_SIZE==msize) {
|
||||
hobj_ref_t ref_out;
|
||||
for (i=0; i<(unsigned)nelmts; i++) {
|
||||
hobj_ref_t *ptr = (hobj_ref_t *)((hvl_t *)buf)[i].p;
|
||||
for (j=0; j<((hvl_t *)buf)[i].len; j++ ) {
|
||||
if (update_ref_value(attr_id, H5R_OBJECT, &(ptr[j]), fidout, &ref_out, travt)<0)
|
||||
continue;
|
||||
HDmemcpy(&(ptr[j]), &ref_out, msize);
|
||||
}
|
||||
} /* for (i=0; i<nelems; i++) */
|
||||
} else if (H5R_DSET_REG_REF_BUF_SIZE == msize) {
|
||||
if (H5R_OBJ_REF_BUF_SIZE==msize) {
|
||||
hobj_ref_t ref_out;
|
||||
for (i=0; i<(unsigned)nelmts; i++) {
|
||||
hobj_ref_t *ptr = (hobj_ref_t *)((hvl_t *)buf)[i].p;
|
||||
for (j=0; j<((hvl_t *)buf)[i].len; j++ ) {
|
||||
if (update_ref_value(attr_id, H5R_OBJECT, &(ptr[j]), fidout, &ref_out, travt)<0)
|
||||
continue;
|
||||
HDmemcpy(&(ptr[j]), &ref_out, msize);
|
||||
}
|
||||
} /* for (i=0; i<nelems; i++) */
|
||||
} else if (H5R_DSET_REG_REF_BUF_SIZE == msize) {
|
||||
|
||||
hdset_reg_ref_t ref_out;
|
||||
for (i=0; i<(unsigned)nelmts; i++) {
|
||||
hdset_reg_ref_t *ptr = (hdset_reg_ref_t *)((hvl_t *)buf)[i].p;
|
||||
for (j=0; j<((hvl_t *)buf)[i].len; j++ ) {
|
||||
if (update_ref_value(attr_id, H5R_DATASET_REGION, &(ptr[j]), fidout, &ref_out, travt)<0)
|
||||
continue;
|
||||
HDmemcpy(&(ptr[j]), &ref_out, msize);
|
||||
}
|
||||
} /* for (i=0; i<nelems; i++) */
|
||||
}
|
||||
hdset_reg_ref_t ref_out;
|
||||
for (i=0; i<(unsigned)nelmts; i++) {
|
||||
hdset_reg_ref_t *ptr = (hdset_reg_ref_t *)((hvl_t *)buf)[i].p;
|
||||
for (j=0; j<((hvl_t *)buf)[i].len; j++ ) {
|
||||
if (update_ref_value(attr_id, H5R_DATASET_REGION, &(ptr[j]), fidout, &ref_out, travt)<0)
|
||||
continue;
|
||||
HDmemcpy(&(ptr[j]), &ref_out, msize);
|
||||
}
|
||||
} /* for (i=0; i<nelems; i++) */
|
||||
}
|
||||
} /* else if (is_ref_vlen) */
|
||||
else if (is_ref_comp) {
|
||||
/* handle ref fields in a compound */
|
||||
/* handle ref fields in a compound */
|
||||
|
||||
buf = HDmalloc((unsigned)(nelmts * msize));
|
||||
refbuf = buf; /* reuse the read buffer for write */
|
||||
@ -716,22 +716,22 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
goto error;
|
||||
|
||||
for (i=0; i<(unsigned)nelmts; i++) {
|
||||
for (j=0; j<(unsigned)ref_comp_field_n; j++) {
|
||||
if (ref_comp_size[j] == H5R_OBJ_REF_BUF_SIZE) {
|
||||
int idx = i*msize+H5Tget_member_offset( mtype_id, (unsigned)ref_comp_index[j]);
|
||||
hobj_ref_t ref_out;
|
||||
if (update_ref_value(attr_id, H5R_OBJECT, (hobj_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0)
|
||||
continue;
|
||||
HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]);
|
||||
} /* if */
|
||||
else if (ref_comp_size[j] == H5R_DSET_REG_REF_BUF_SIZE) {
|
||||
int idx = i*msize+H5Tget_member_offset( mtype_id, (unsigned)ref_comp_index[j]);
|
||||
hdset_reg_ref_t ref_out;
|
||||
if (update_ref_value(attr_id, H5R_DATASET_REGION, (hdset_reg_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0)
|
||||
continue;
|
||||
HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]);
|
||||
} /* else if */
|
||||
} /* j */
|
||||
for (j=0; j<(unsigned)ref_comp_field_n; j++) {
|
||||
if (ref_comp_size[j] == H5R_OBJ_REF_BUF_SIZE) {
|
||||
int idx = i*msize+H5Tget_member_offset( mtype_id, (unsigned)ref_comp_index[j]);
|
||||
hobj_ref_t ref_out;
|
||||
if (update_ref_value(attr_id, H5R_OBJECT, (hobj_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0)
|
||||
continue;
|
||||
HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]);
|
||||
} /* if */
|
||||
else if (ref_comp_size[j] == H5R_DSET_REG_REF_BUF_SIZE) {
|
||||
int idx = i*msize+H5Tget_member_offset( mtype_id, (unsigned)ref_comp_index[j]);
|
||||
hdset_reg_ref_t ref_out;
|
||||
if (update_ref_value(attr_id, H5R_DATASET_REGION, (hdset_reg_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0)
|
||||
continue;
|
||||
HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]);
|
||||
} /* else if */
|
||||
} /* j */
|
||||
} /* i */
|
||||
} /* else if (is_ref_comp) */
|
||||
|
||||
@ -739,11 +739,11 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
goto error;
|
||||
|
||||
if (is_ref_vlen && buf)
|
||||
H5Dvlen_reclaim (mtype_id, space_id, H5P_DEFAULT, buf);
|
||||
H5Dvlen_reclaim (mtype_id, space_id, H5P_DEFAULT, buf);
|
||||
} /* if (nelmts) */
|
||||
|
||||
if (refbuf == buf)
|
||||
refbuf = NULL; /* set it to NULL to avoid double free since buf and refbuf are the same. */
|
||||
refbuf = NULL; /* set it to NULL to avoid double free since buf and refbuf are the same. */
|
||||
|
||||
if(buf) {
|
||||
HDfree(buf);
|
||||
@ -756,13 +756,13 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
}
|
||||
|
||||
if (ref_comp_index) {
|
||||
HDfree(ref_comp_index);
|
||||
ref_comp_index = NULL;
|
||||
HDfree(ref_comp_index);
|
||||
ref_comp_index = NULL;
|
||||
}
|
||||
|
||||
if (ref_comp_size) {
|
||||
HDfree(ref_comp_size);
|
||||
ref_comp_size = NULL;
|
||||
HDfree(ref_comp_size);
|
||||
ref_comp_size = NULL;
|
||||
}
|
||||
|
||||
if(H5Aclose(attr_out) < 0)
|
||||
@ -785,16 +785,16 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
return 0;
|
||||
|
||||
error:
|
||||
if(refbuf)
|
||||
HDfree(refbuf);
|
||||
if(buf)
|
||||
HDfree(buf);
|
||||
if(refbuf)
|
||||
HDfree(refbuf);
|
||||
if(buf)
|
||||
HDfree(buf);
|
||||
|
||||
if (ref_comp_index)
|
||||
HDfree(ref_comp_index);
|
||||
HDfree(ref_comp_index);
|
||||
|
||||
if (ref_comp_size)
|
||||
HDfree(ref_comp_size);
|
||||
HDfree(ref_comp_size);
|
||||
|
||||
H5E_BEGIN_TRY {
|
||||
H5Tclose(ftype_id);
|
||||
@ -808,9 +808,9 @@ error:
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: MapIdToName
|
||||
* Function: MapIdToName
|
||||
*
|
||||
* Purpose: map a ID from a reference to a dataset name
|
||||
* Purpose: map a ID from a reference to a dataset name
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -843,48 +843,48 @@ out:
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: Update_Ref_value
|
||||
* Function: Update_Ref_value
|
||||
*
|
||||
* Purpose: Update a reference value
|
||||
* Purpose: Update a reference value
|
||||
*
|
||||
* Programmer: xcao@hdfgroup.org 9/12/2011
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in,
|
||||
hid_t fid_out, void *ref_out, trav_table_t *travt)
|
||||
hid_t fid_out, void *ref_out, trav_table_t *travt)
|
||||
{
|
||||
herr_t ret = -1;
|
||||
const char* ref_obj_name;
|
||||
hid_t space_id=-1, ref_obj_id=-1;
|
||||
herr_t ret = -1;
|
||||
const char* ref_obj_name;
|
||||
hid_t space_id=-1, ref_obj_id=-1;
|
||||
|
||||
ref_obj_id = H5Rdereference2(obj_id, H5P_DEFAULT, ref_type, ref_in);
|
||||
if (ref_obj_id<0)
|
||||
goto done;
|
||||
ref_obj_id = H5Rdereference2(obj_id, H5P_DEFAULT, ref_type, ref_in);
|
||||
if (ref_obj_id<0)
|
||||
goto done;
|
||||
|
||||
ref_obj_name = MapIdToName(ref_obj_id, travt);
|
||||
if (ref_obj_name == NULL)
|
||||
goto done;
|
||||
ref_obj_name = MapIdToName(ref_obj_id, travt);
|
||||
if (ref_obj_name == NULL)
|
||||
goto done;
|
||||
|
||||
if (ref_type == H5R_DATASET_REGION) {
|
||||
space_id = H5Rget_region(obj_id, H5R_DATASET_REGION, ref_in);
|
||||
if (space_id < 0)
|
||||
goto done;
|
||||
}
|
||||
if (ref_type == H5R_DATASET_REGION) {
|
||||
space_id = H5Rget_region(obj_id, H5R_DATASET_REGION, ref_in);
|
||||
if (space_id < 0)
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = H5Rcreate(ref_out, fid_out, ref_obj_name, ref_type, space_id);
|
||||
|
||||
if (ret < 0)
|
||||
goto done;
|
||||
goto done;
|
||||
|
||||
ret = 0;
|
||||
ret = 0;
|
||||
|
||||
done:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Sclose(space_id);
|
||||
H5Oclose(ref_obj_id);
|
||||
H5Sclose(space_id);
|
||||
H5Oclose(ref_obj_id);
|
||||
} H5E_END_TRY;
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -170,15 +170,15 @@ int main (void)
|
||||
{
|
||||
pack_opt_t pack_options;
|
||||
diff_opt_t diff_options;
|
||||
hsize_t fs_size = 0; /* free space section threshold */
|
||||
H5F_file_space_type_t fs_type = H5F_FILE_SPACE_DEFAULT; /* file space handling strategy */
|
||||
hsize_t fs_size = 0; /* free space section threshold */
|
||||
H5F_file_space_type_t fs_type = H5F_FILE_SPACE_DEFAULT; /* file space handling strategy */
|
||||
#if defined (H5_HAVE_FILTER_SZIP)
|
||||
int szip_can_encode = 0;
|
||||
#endif
|
||||
|
||||
/* initialize */
|
||||
memset(&diff_options, 0, sizeof (diff_opt_t));
|
||||
memset(&pack_options, 0, sizeof (pack_opt_t));
|
||||
HDmemset(&diff_options, 0, sizeof (diff_opt_t));
|
||||
HDmemset(&pack_options, 0, sizeof (pack_opt_t));
|
||||
|
||||
/* run tests */
|
||||
puts("Testing h5repack:");
|
||||
@ -938,7 +938,7 @@ int main (void)
|
||||
|
||||
#if defined (H5_HAVE_FILTER_SZIP)
|
||||
if (szip_can_encode) {
|
||||
/* fs_type = H5F_FILE_SPACE_AGGR_VFD; fs_size = 3 */
|
||||
/* fs_type = H5F_FILE_SPACE_AGGR_VFD; fs_size = 3 */
|
||||
if (h5repack_init (&pack_options, 0, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0)
|
||||
GOERROR;
|
||||
if (h5repack(FNAME7,FNAME7OUT,&pack_options) < 0)
|
||||
@ -1255,7 +1255,7 @@ int main (void)
|
||||
&& defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE)
|
||||
|
||||
if (szip_can_encode) {
|
||||
/* fs_type = H5F_FILE_SPACE_VFD; fs_size = 4 */
|
||||
/* fs_type = H5F_FILE_SPACE_VFD; fs_size = 4 */
|
||||
if (h5repack_init (&pack_options, 0, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0)
|
||||
GOERROR;
|
||||
if (h5repack_addfilter("dset_deflate:SZIP=8,NN",&pack_options) < 0)
|
||||
@ -2956,31 +2956,31 @@ out:
|
||||
*
|
||||
* Purpose: create datasets with contiguous and chunked layouts:
|
||||
*
|
||||
* contig_small: < 1k, fixed dims datspace
|
||||
* chunked_small_fixed: < 1k, fixed dims dataspace
|
||||
* contig_small: < 1k, fixed dims datspace
|
||||
* chunked_small_fixed: < 1k, fixed dims dataspace
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#define S_DIM1 4
|
||||
#define S_DIM2 10
|
||||
#define CONTIG_S "contig_small"
|
||||
#define CHUNKED_S_FIX "chunked_small_fixed"
|
||||
#define S_DIM1 4
|
||||
#define S_DIM2 10
|
||||
#define CONTIG_S "contig_small"
|
||||
#define CHUNKED_S_FIX "chunked_small_fixed"
|
||||
|
||||
static
|
||||
int make_layout2(hid_t loc_id)
|
||||
{
|
||||
|
||||
hid_t contig_dcpl = -1; /* dataset creation property list */
|
||||
hid_t contig_dcpl = -1; /* dataset creation property list */
|
||||
hid_t chunked_dcpl = -1; /* dataset creation property list */
|
||||
|
||||
int i, j, n; /* Local index variables */
|
||||
int ret_value = -1; /* Return value */
|
||||
hid_t s_sid = -1; /* dataspace ID */
|
||||
int i, j, n; /* Local index variables */
|
||||
int ret_value = -1; /* Return value */
|
||||
hid_t s_sid = -1; /* dataspace ID */
|
||||
|
||||
hsize_t s_dims[RANK] = {S_DIM1,S_DIM2}; /* Dataspace (< 1 k) */
|
||||
hsize_t chunk_dims[RANK] = {S_DIM1/2, S_DIM2/2}; /* Dimension sizes for chunks */
|
||||
hsize_t s_dims[RANK] = {S_DIM1,S_DIM2}; /* Dataspace (< 1 k) */
|
||||
hsize_t chunk_dims[RANK] = {S_DIM1/2, S_DIM2/2}; /* Dimension sizes for chunks */
|
||||
|
||||
int s_buf[S_DIM1][S_DIM2]; /* Temporary buffer */
|
||||
int s_buf[S_DIM1][S_DIM2]; /* Temporary buffer */
|
||||
|
||||
for(i = n = 0; i < S_DIM1; i++) {
|
||||
for (j = 0; j < S_DIM2; j++) {
|
||||
@ -3130,7 +3130,7 @@ int make_big(hid_t loc_id)
|
||||
if (H5Dwrite (did,H5T_NATIVE_SCHAR,m_sid,f_sid,H5P_DEFAULT,buf) < 0)
|
||||
goto out;
|
||||
|
||||
free(buf);
|
||||
HDfree(buf);
|
||||
buf=NULL;
|
||||
|
||||
/* close */
|
||||
@ -3171,8 +3171,8 @@ int make_external(hid_t loc_id)
|
||||
hid_t sid=-1;
|
||||
hid_t dcpl;
|
||||
int buf[2]={1,2};
|
||||
hsize_t cur_size[1]; /* data space current size */
|
||||
hsize_t max_size[1]; /* data space maximum size */
|
||||
hsize_t cur_size[1]; /* data space current size */
|
||||
hsize_t max_size[1]; /* data space maximum size */
|
||||
hsize_t size;
|
||||
|
||||
cur_size[0] = max_size[0] = 2;
|
||||
@ -3255,7 +3255,7 @@ make_userblock(void)
|
||||
|
||||
/* Write userblock data */
|
||||
nwritten = HDwrite(fd, ub, (size_t)USERBLOCK_SIZE);
|
||||
assert(nwritten == USERBLOCK_SIZE);
|
||||
HDassert(nwritten == USERBLOCK_SIZE);
|
||||
|
||||
/* Close file */
|
||||
HDclose(fd);
|
||||
@ -3319,7 +3319,7 @@ verify_userblock( const char* filename)
|
||||
|
||||
/* Read userblock data */
|
||||
nread = HDread(fd, ub, (size_t)USERBLOCK_SIZE);
|
||||
assert(nread == USERBLOCK_SIZE);
|
||||
HDassert(nread == USERBLOCK_SIZE);
|
||||
|
||||
/* Verify userblock data */
|
||||
for(u = 0; u < USERBLOCK_SIZE; u++)
|
||||
@ -3368,7 +3368,7 @@ make_userblock_file(void)
|
||||
|
||||
/* write userblock data */
|
||||
nwritten = HDwrite(fd, ub, (size_t)USERBLOCK_SIZE);
|
||||
assert(nwritten == USERBLOCK_SIZE);
|
||||
HDassert(nwritten == USERBLOCK_SIZE);
|
||||
|
||||
/* close file */
|
||||
HDclose(fd);
|
||||
@ -3693,7 +3693,7 @@ int write_dset_in(hid_t loc_id,
|
||||
H5Dclose(did);
|
||||
H5Tclose(tid);
|
||||
H5Sclose(sid);
|
||||
free( dbuf );
|
||||
HDfree( dbuf );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -3728,7 +3728,7 @@ int write_dset_in(hid_t loc_id,
|
||||
|
||||
if (make_diffs)
|
||||
{
|
||||
memset(buf12, 'z', sizeof buf12);
|
||||
HDmemset(buf12, 'z', sizeof buf12);
|
||||
}
|
||||
|
||||
|
||||
@ -3749,7 +3749,7 @@ int write_dset_in(hid_t loc_id,
|
||||
|
||||
if (make_diffs)
|
||||
{
|
||||
memset(buf22,0,sizeof buf22);
|
||||
HDmemset(buf22,0,sizeof buf22);
|
||||
}
|
||||
|
||||
if ((tid = H5Tcopy(H5T_STD_B8LE)) < 0)
|
||||
@ -3779,7 +3779,7 @@ int write_dset_in(hid_t loc_id,
|
||||
|
||||
if (make_diffs)
|
||||
{
|
||||
memset(buf32,0,sizeof buf32);
|
||||
HDmemset(buf32,0,sizeof buf32);
|
||||
}
|
||||
|
||||
if ((tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t))) < 0)
|
||||
@ -3871,7 +3871,7 @@ int write_dset_in(hid_t loc_id,
|
||||
|
||||
if (make_diffs)
|
||||
{
|
||||
memset(buf62,0,sizeof buf62);
|
||||
HDmemset(buf62,0,sizeof buf62);
|
||||
}
|
||||
|
||||
|
||||
@ -3889,8 +3889,8 @@ int write_dset_in(hid_t loc_id,
|
||||
|
||||
|
||||
if(make_diffs) {
|
||||
memset(buf72, 0, sizeof buf72);
|
||||
memset(buf82, 0, sizeof buf82);
|
||||
HDmemset(buf72, 0, sizeof buf72);
|
||||
HDmemset(buf82, 0, sizeof buf82);
|
||||
}
|
||||
|
||||
|
||||
@ -3930,7 +3930,7 @@ int write_dset_in(hid_t loc_id,
|
||||
|
||||
if (make_diffs)
|
||||
{
|
||||
memset(buf13,'z',sizeof buf13);
|
||||
HDmemset(buf13,'z',sizeof buf13);
|
||||
}
|
||||
|
||||
if ((tid = H5Tcopy(H5T_C_S1)) < 0)
|
||||
@ -4243,9 +4243,9 @@ int make_dset_reg_ref(hid_t loc_id)
|
||||
|
||||
out:
|
||||
if(wbuf)
|
||||
free(wbuf);
|
||||
HDfree(wbuf);
|
||||
if(dwbuf)
|
||||
free(dwbuf);
|
||||
HDfree(dwbuf);
|
||||
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
@ -4650,7 +4650,7 @@ int write_attr_in(hid_t loc_id,
|
||||
*/
|
||||
if (make_diffs)
|
||||
{
|
||||
memset(buf12, 'z', sizeof buf12);
|
||||
HDmemset(buf12, 'z', sizeof buf12);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -4690,7 +4690,7 @@ int write_attr_in(hid_t loc_id,
|
||||
|
||||
if (make_diffs)
|
||||
{
|
||||
memset(buf22,0,sizeof buf22);
|
||||
HDmemset(buf22,0,sizeof buf22);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -4750,7 +4750,7 @@ int write_attr_in(hid_t loc_id,
|
||||
*/
|
||||
if (make_diffs)
|
||||
{
|
||||
memset(buf32,0,sizeof buf32);
|
||||
HDmemset(buf32,0,sizeof buf32);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -4898,7 +4898,7 @@ int write_attr_in(hid_t loc_id,
|
||||
|
||||
if (make_diffs)
|
||||
{
|
||||
memset(buf62,0,sizeof buf62);
|
||||
HDmemset(buf62,0,sizeof buf62);
|
||||
}
|
||||
/*
|
||||
buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}};
|
||||
@ -4984,7 +4984,7 @@ int write_attr_in(hid_t loc_id,
|
||||
|
||||
if (make_diffs)
|
||||
{
|
||||
memset(buf13,'z',sizeof buf13);
|
||||
HDmemset(buf13,'z',sizeof buf13);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -319,7 +319,7 @@ attribute_stats(iter_t *iter, const H5O_info_t *oi)
|
||||
bin = ceil_log10((unsigned long)oi->num_attrs);
|
||||
if((bin + 1) > iter->attr_nbins) {
|
||||
iter->attr_bins = (unsigned long *)realloc(iter->attr_bins, (bin + 1) * sizeof(unsigned long));
|
||||
assert(iter->attr_bins);
|
||||
HDassert(iter->attr_bins);
|
||||
|
||||
/* Initialize counts for intermediate bins */
|
||||
while(iter->attr_nbins < bin)
|
||||
@ -378,7 +378,7 @@ group_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
|
||||
|
||||
/* Get group information */
|
||||
ret = H5Gget_info_by_name(iter->fid, name, &ginfo, H5P_DEFAULT);
|
||||
assert(ret >= 0);
|
||||
HDassert(ret >= 0);
|
||||
|
||||
/* Update link stats */
|
||||
if(ginfo.nlinks < SIZE_SMALL_GROUPS)
|
||||
@ -391,7 +391,7 @@ group_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
|
||||
if((bin + 1) > iter->group_nbins) {
|
||||
/* Allocate more storage for info about dataset's datatype */
|
||||
iter->group_bins = (unsigned long *)realloc(iter->group_bins, (bin + 1) * sizeof(unsigned long));
|
||||
assert(iter->group_bins);
|
||||
HDassert(iter->group_bins);
|
||||
|
||||
/* Initialize counts for intermediate bins */
|
||||
while(iter->group_nbins < bin)
|
||||
@ -410,7 +410,7 @@ group_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
|
||||
|
||||
/* Update attribute metadata info */
|
||||
ret = attribute_stats(iter, oi);
|
||||
assert(ret >= 0);
|
||||
HDassert(ret >= 0);
|
||||
|
||||
return 0;
|
||||
} /* end group_stats() */
|
||||
@ -458,7 +458,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
|
||||
iter->dset_ohdr_info.free_size += oi->hdr.space.free;
|
||||
|
||||
did = H5Dopen2(iter->fid, name, H5P_DEFAULT);
|
||||
assert(did > 0);
|
||||
HDassert(did > 0);
|
||||
|
||||
/* Update dataset metadata info */
|
||||
iter->datasets_index_storage_size += oi->meta_size.obj.index_size;
|
||||
@ -466,17 +466,17 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
|
||||
|
||||
/* Update attribute metadata info */
|
||||
ret = attribute_stats(iter, oi);
|
||||
assert(ret >= 0);
|
||||
HDassert(ret >= 0);
|
||||
|
||||
/* Get storage info */
|
||||
storage = H5Dget_storage_size(did);
|
||||
|
||||
/* Gather layout statistics */
|
||||
dcpl = H5Dget_create_plist(did);
|
||||
assert(dcpl > 0);
|
||||
HDassert(dcpl > 0);
|
||||
|
||||
lout = H5Pget_layout(dcpl);
|
||||
assert(lout >= 0);
|
||||
HDassert(lout >= 0);
|
||||
|
||||
/* Object header's total size for H5D_COMPACT layout includes raw data size */
|
||||
/* "storage" also includes H5D_COMPACT raw data size */
|
||||
@ -499,10 +499,10 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
|
||||
|
||||
/* Gather dataspace statistics */
|
||||
sid = H5Dget_space(did);
|
||||
assert(sid > 0);
|
||||
HDassert(sid > 0);
|
||||
|
||||
ndims = H5Sget_simple_extent_dims(sid, dims, NULL);
|
||||
assert(ndims >= 0);
|
||||
HDassert(ndims >= 0);
|
||||
|
||||
/* Check for larger rank of dataset */
|
||||
if((unsigned)ndims > iter->max_dset_rank)
|
||||
@ -522,7 +522,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
|
||||
if((bin + 1) > iter->dset_dim_nbins) {
|
||||
/* Allocate more storage for info about dataset's datatype */
|
||||
iter->dset_dim_bins = (unsigned long *)realloc(iter->dset_dim_bins, (bin + 1) * sizeof(unsigned long));
|
||||
assert(iter->dset_dim_bins);
|
||||
HDassert(iter->dset_dim_bins);
|
||||
|
||||
/* Initialize counts for intermediate bins */
|
||||
while(iter->dset_dim_nbins < bin)
|
||||
@ -537,11 +537,11 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
|
||||
} /* end if */
|
||||
|
||||
ret = H5Sclose(sid);
|
||||
assert(ret >= 0);
|
||||
HDassert(ret >= 0);
|
||||
|
||||
/* Gather datatype statistics */
|
||||
tid = H5Dget_type(did);
|
||||
assert(tid > 0);
|
||||
HDassert(tid > 0);
|
||||
|
||||
type_found = FALSE;
|
||||
for(u = 0; u < iter->dset_ntypes; u++)
|
||||
@ -559,11 +559,11 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
|
||||
|
||||
/* Allocate more storage for info about dataset's datatype */
|
||||
iter->dset_type_info = (dtype_info_t *)realloc(iter->dset_type_info, iter->dset_ntypes * sizeof(dtype_info_t));
|
||||
assert(iter->dset_type_info);
|
||||
HDassert(iter->dset_type_info);
|
||||
|
||||
/* Initialize information about datatype */
|
||||
iter->dset_type_info[curr_ntype].tid = H5Tcopy(tid);
|
||||
assert(iter->dset_type_info[curr_ntype].tid > 0);
|
||||
HDassert(iter->dset_type_info[curr_ntype].tid > 0);
|
||||
iter->dset_type_info[curr_ntype].count = 1;
|
||||
iter->dset_type_info[curr_ntype].named = 0;
|
||||
|
||||
@ -576,7 +576,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
|
||||
(iter->dset_type_info[u].named)++;
|
||||
|
||||
ret = H5Tclose(tid);
|
||||
assert(ret >= 0);
|
||||
HDassert(ret >= 0);
|
||||
|
||||
/* Track different filters */
|
||||
if((nfltr = H5Pget_nfilters(dcpl)) >= 0) {
|
||||
@ -594,10 +594,10 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
|
||||
} /* endif nfltr */
|
||||
|
||||
ret = H5Pclose(dcpl);
|
||||
assert(ret >= 0);
|
||||
HDassert(ret >= 0);
|
||||
|
||||
ret = H5Dclose(did);
|
||||
assert(ret >= 0);
|
||||
HDassert(ret >= 0);
|
||||
|
||||
return 0;
|
||||
} /* end dataset_stats() */
|
||||
@ -628,7 +628,7 @@ datatype_stats(iter_t *iter, const H5O_info_t *oi)
|
||||
|
||||
/* Update attribute metadata info */
|
||||
ret = attribute_stats(iter, oi);
|
||||
assert(ret >= 0);
|
||||
HDassert(ret >= 0);
|
||||
|
||||
return 0;
|
||||
} /* end datatype_stats() */
|
||||
@ -744,7 +744,7 @@ freespace_stats(hid_t fid, iter_t *iter)
|
||||
if(NULL == (sect_info = (H5F_sect_info_t *)calloc((size_t)nsects, sizeof(H5F_sect_info_t))))
|
||||
return(FAIL);
|
||||
nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info);
|
||||
assert(nsects);
|
||||
HDassert(nsects);
|
||||
} /* end else-if */
|
||||
|
||||
for(u = 0; u < (size_t)nsects; u++) {
|
||||
@ -758,7 +758,7 @@ freespace_stats(hid_t fid, iter_t *iter)
|
||||
if(bin >= iter->sect_nbins) {
|
||||
/* Allocate more storage for section info */
|
||||
iter->sect_bins = (unsigned long *)realloc(iter->sect_bins, (bin + 1) * sizeof(unsigned long));
|
||||
assert(iter->sect_bins);
|
||||
HDassert(iter->sect_bins);
|
||||
|
||||
/* Initialize counts for intermediate bins */
|
||||
while(iter->sect_nbins < bin)
|
||||
@ -1651,7 +1651,7 @@ main(int argc, const char *argv[])
|
||||
|
||||
if(H5Fget_filesize(fid, &iter.filesize) < 0)
|
||||
warn_msg("Unable to retrieve file size\n");
|
||||
assert(iter.filesize != 0);
|
||||
HDassert(iter.filesize != 0);
|
||||
|
||||
/* Get storge info for file-level structures */
|
||||
if(H5Fget_info2(fid, &finfo) < 0)
|
||||
@ -1674,7 +1674,7 @@ main(int argc, const char *argv[])
|
||||
|
||||
if(H5Pget_file_space(fcpl, &iter.fs_strategy, &iter.fs_threshold) < 0)
|
||||
warn_msg("Unable to retrieve file space information\n");
|
||||
assert(iter.fs_strategy != 0 && iter.fs_strategy < H5F_FILE_SPACE_NTYPES);
|
||||
HDassert(iter.fs_strategy != 0 && iter.fs_strategy < H5F_FILE_SPACE_NTYPES);
|
||||
|
||||
/* get information for free-space sections */
|
||||
if(freespace_stats(fid, &iter) < 0)
|
||||
|
@ -26,12 +26,12 @@
|
||||
#include <assert.h>
|
||||
#include "hdf5.h"
|
||||
|
||||
#define FILE "h5stat_newgrat.h5"
|
||||
#define DATASET_NAME "DATASET_NAME"
|
||||
#define GROUP_NAME "GROUP"
|
||||
#define ATTR_NAME "ATTR"
|
||||
#define NUM_GRPS 35000
|
||||
#define NUM_ATTRS 100
|
||||
#define FILE "h5stat_newgrat.h5"
|
||||
#define DATASET_NAME "DATASET_NAME"
|
||||
#define GROUP_NAME "GROUP"
|
||||
#define ATTR_NAME "ATTR"
|
||||
#define NUM_GRPS 35000
|
||||
#define NUM_ATTRS 100
|
||||
|
||||
/*
|
||||
* Generate 1.8 HDF5 file
|
||||
@ -40,27 +40,27 @@
|
||||
*/
|
||||
static void gen_file(void)
|
||||
{
|
||||
hid_t fcpl; /* File creation property */
|
||||
hid_t fapl; /* File access property */
|
||||
hid_t file; /* File id */
|
||||
hid_t gid; /* Group id */
|
||||
hid_t type_id; /* Datatype id */
|
||||
hid_t space_id; /* Dataspace id */
|
||||
hid_t attr_id; /* Attribute id */
|
||||
hid_t dset_id; /* Dataset id */
|
||||
char name[30]; /* Group name */
|
||||
char attrname[30]; /* Attribute name */
|
||||
int ret; /* Return value */
|
||||
int i; /* Local index variable */
|
||||
hid_t fcpl; /* File creation property */
|
||||
hid_t fapl; /* File access property */
|
||||
hid_t file; /* File id */
|
||||
hid_t gid; /* Group id */
|
||||
hid_t type_id; /* Datatype id */
|
||||
hid_t space_id; /* Dataspace id */
|
||||
hid_t attr_id; /* Attribute id */
|
||||
hid_t dset_id; /* Dataset id */
|
||||
char name[30]; /* Group name */
|
||||
char attrname[30]; /* Attribute name */
|
||||
int ret; /* Return value */
|
||||
int i; /* Local index variable */
|
||||
|
||||
fapl = H5Pcreate(H5P_FILE_ACCESS);
|
||||
ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
|
||||
assert(ret >= 0);
|
||||
HDassert(ret >= 0);
|
||||
|
||||
/* Set file space handling strategy */
|
||||
fcpl = H5Pcreate(H5P_FILE_CREATE);
|
||||
ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0);
|
||||
assert(ret >= 0);
|
||||
HDassert(ret >= 0);
|
||||
|
||||
/* Create dataset */
|
||||
file = H5Fcreate(FILE, H5F_ACC_TRUNC, fcpl, fapl);
|
||||
@ -82,17 +82,17 @@ static void gen_file(void)
|
||||
sprintf(attrname, "%s%d", ATTR_NAME,i);
|
||||
attr_id = H5Acreate2(dset_id, attrname, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT);
|
||||
ret = H5Aclose(attr_id);
|
||||
assert(ret >= 0);
|
||||
HDassert(ret >= 0);
|
||||
} /* end for */
|
||||
|
||||
ret = H5Dclose(dset_id);
|
||||
assert(ret >= 0);
|
||||
HDassert(ret >= 0);
|
||||
ret = H5Sclose(space_id);
|
||||
assert(ret >= 0);
|
||||
HDassert(ret >= 0);
|
||||
ret = H5Tclose(type_id);
|
||||
assert(ret >= 0);
|
||||
HDassert(ret >= 0);
|
||||
ret = H5Fclose(file);
|
||||
assert(ret >= 0);
|
||||
HDassert(ret >= 0);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
|
@ -154,7 +154,7 @@ void print_manager_output(void)
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
memset(outBuff, 0, OUTBUFF_SIZE);
|
||||
HDmemset(outBuff, 0, OUTBUFF_SIZE);
|
||||
outBuffOffset = 0;
|
||||
}
|
||||
else if( (outBuffOffset>0) && !g_Parallel)
|
||||
@ -189,7 +189,7 @@ static void print_incoming_data(void)
|
||||
MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &incomingMessage, &Status);
|
||||
if(incomingMessage)
|
||||
{
|
||||
memset(data, 0, PRINT_DATA_MAX_SIZE+1);
|
||||
HDmemset(data, 0, PRINT_DATA_MAX_SIZE+1);
|
||||
MPI_Recv(data, PRINT_DATA_MAX_SIZE, MPI_CHAR, Status.MPI_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &Status);
|
||||
|
||||
printf("%s", data);
|
||||
@ -531,7 +531,7 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo,
|
||||
const char *ext_path;
|
||||
|
||||
/* init linkinfo struct */
|
||||
memset(&lnk_info, 0, sizeof(h5tool_link_info_t));
|
||||
HDmemset(&lnk_info, 0, sizeof(h5tool_link_info_t));
|
||||
|
||||
if (!opts->follow_links)
|
||||
{
|
||||
@ -1474,7 +1474,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
|
||||
} /* end if */
|
||||
h5diffdebug("done with if block\n");
|
||||
|
||||
free(workerTasks);
|
||||
HDfree(workerTasks);
|
||||
}
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
@ -1938,7 +1938,7 @@ hsize_t diff(hid_t file1_id,
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
case H5TRAV_TYPE_DATASET:
|
||||
/* verbose (-v) and report (-r) mode */
|
||||
/* verbose (-v) and report (-r) mode */
|
||||
if(options->m_verbose || options->m_report)
|
||||
{
|
||||
do_print_objname("dataset", path1, path2, options);
|
||||
@ -1950,7 +1950,7 @@ hsize_t diff(hid_t file1_id,
|
||||
{
|
||||
nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
|
||||
}
|
||||
/* the rest (-c, none, ...) */
|
||||
/* the rest (-c, none, ...) */
|
||||
else
|
||||
{
|
||||
nfound = diff_dataset(file1_id, file2_id, path1, path2, options);
|
||||
@ -1958,7 +1958,7 @@ hsize_t diff(hid_t file1_id,
|
||||
if (nfound)
|
||||
{
|
||||
do_print_objname("dataset", path1, path2, options);
|
||||
print_found(nfound);
|
||||
print_found(nfound);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -137,7 +137,7 @@ static int not_comparable;
|
||||
is_zero=1; \
|
||||
}
|
||||
|
||||
# define PDIFF(a,b) ( (b>a) ? (b-a) : (a-b))
|
||||
# define PDIFF(a,b) ( (b>a) ? (b-a) : (a-b))
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* local prototypes
|
||||
@ -260,7 +260,7 @@ hsize_t diff_array( void *_mem1,
|
||||
switch (type_class)
|
||||
{
|
||||
default:
|
||||
assert(0);
|
||||
HDassert(0);
|
||||
break;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -440,10 +440,10 @@ hsize_t diff_datum(void *_mem1,
|
||||
switch (H5Tget_class(m_type))
|
||||
{
|
||||
default:
|
||||
assert(0);
|
||||
HDassert(0);
|
||||
break;
|
||||
case H5T_TIME:
|
||||
assert(0);
|
||||
HDassert(0);
|
||||
break;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -705,7 +705,7 @@ hsize_t diff_datum(void *_mem1,
|
||||
size = H5Tget_size(memb_type);
|
||||
ndims = H5Tget_array_ndims(m_type);
|
||||
H5Tget_array_dims2(m_type, adims);
|
||||
assert(ndims >= 1 && ndims <= H5S_MAX_RANK);
|
||||
HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK);
|
||||
|
||||
/* calculate the number of array elements */
|
||||
for (u = 0, nelmts = 1; u <ndims; u++)
|
||||
@ -897,7 +897,7 @@ hsize_t diff_datum(void *_mem1,
|
||||
{
|
||||
char temp1_char;
|
||||
char temp2_char;
|
||||
assert(type_size==sizeof(char));
|
||||
HDassert(type_size==sizeof(char));
|
||||
memcpy(&temp1_char, mem1, sizeof(char));
|
||||
memcpy(&temp2_char, mem2, sizeof(char));
|
||||
/* -d and !-p */
|
||||
@ -993,7 +993,7 @@ hsize_t diff_datum(void *_mem1,
|
||||
{
|
||||
unsigned char temp1_uchar;
|
||||
unsigned char temp2_uchar;
|
||||
assert(type_size==sizeof(unsigned char));
|
||||
HDassert(type_size==sizeof(unsigned char));
|
||||
|
||||
memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
|
||||
memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
|
||||
@ -1092,7 +1092,7 @@ hsize_t diff_datum(void *_mem1,
|
||||
{
|
||||
short temp1_short;
|
||||
short temp2_short;
|
||||
assert(type_size==sizeof(short));
|
||||
HDassert(type_size==sizeof(short));
|
||||
|
||||
memcpy(&temp1_short, mem1, sizeof(short));
|
||||
memcpy(&temp2_short, mem2, sizeof(short));
|
||||
@ -1191,7 +1191,7 @@ hsize_t diff_datum(void *_mem1,
|
||||
{
|
||||
unsigned short temp1_ushort;
|
||||
unsigned short temp2_ushort;
|
||||
assert(type_size==sizeof(short));
|
||||
HDassert(type_size==sizeof(short));
|
||||
|
||||
memcpy(&temp1_ushort, mem1, sizeof(unsigned short));
|
||||
memcpy(&temp2_ushort, mem2, sizeof(unsigned short));
|
||||
@ -1291,7 +1291,7 @@ hsize_t diff_datum(void *_mem1,
|
||||
{
|
||||
int temp1_int;
|
||||
int temp2_int;
|
||||
assert(type_size==sizeof(int));
|
||||
HDassert(type_size==sizeof(int));
|
||||
|
||||
memcpy(&temp1_int, mem1, sizeof(int));
|
||||
memcpy(&temp2_int, mem2, sizeof(int));
|
||||
@ -1389,7 +1389,7 @@ hsize_t diff_datum(void *_mem1,
|
||||
{
|
||||
unsigned int temp1_uint;
|
||||
unsigned int temp2_uint;
|
||||
assert(type_size==sizeof(int));
|
||||
HDassert(type_size==sizeof(int));
|
||||
|
||||
memcpy(&temp1_uint, mem1, sizeof(unsigned int));
|
||||
memcpy(&temp2_uint, mem2, sizeof(unsigned int));
|
||||
@ -1487,7 +1487,7 @@ hsize_t diff_datum(void *_mem1,
|
||||
{
|
||||
long temp1_long;
|
||||
long temp2_long;
|
||||
assert(type_size==sizeof(long));
|
||||
HDassert(type_size==sizeof(long));
|
||||
|
||||
memcpy(&temp1_long, mem1, sizeof(long));
|
||||
memcpy(&temp2_long, mem2, sizeof(long));
|
||||
@ -1587,7 +1587,7 @@ hsize_t diff_datum(void *_mem1,
|
||||
{
|
||||
unsigned long temp1_ulong;
|
||||
unsigned long temp2_ulong;
|
||||
assert(type_size==sizeof(unsigned long));
|
||||
HDassert(type_size==sizeof(unsigned long));
|
||||
|
||||
memcpy(&temp1_ulong, mem1, sizeof(unsigned long));
|
||||
memcpy(&temp2_ulong, mem2, sizeof(unsigned long));
|
||||
@ -1686,7 +1686,7 @@ hsize_t diff_datum(void *_mem1,
|
||||
{
|
||||
long long temp1_llong;
|
||||
long long temp2_llong;
|
||||
assert(type_size==sizeof(long long));
|
||||
HDassert(type_size==sizeof(long long));
|
||||
|
||||
memcpy(&temp1_llong, mem1, sizeof(long long));
|
||||
memcpy(&temp2_llong, mem2, sizeof(long long));
|
||||
@ -1784,7 +1784,7 @@ hsize_t diff_datum(void *_mem1,
|
||||
{
|
||||
unsigned long long temp1_ullong;
|
||||
unsigned long long temp2_ullong;
|
||||
assert(type_size==sizeof(unsigned long long));
|
||||
HDassert(type_size==sizeof(unsigned long long));
|
||||
|
||||
memcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
|
||||
memcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
|
||||
@ -1904,7 +1904,7 @@ hsize_t diff_datum(void *_mem1,
|
||||
int isnan1=0;
|
||||
int isnan2=0;
|
||||
|
||||
assert(type_size==sizeof(float));
|
||||
HDassert(type_size==sizeof(float));
|
||||
|
||||
memcpy(&temp1_float, mem1, sizeof(float));
|
||||
memcpy(&temp2_float, mem2, sizeof(float));
|
||||
@ -2117,7 +2117,7 @@ hsize_t diff_datum(void *_mem1,
|
||||
int isnan1=0;
|
||||
int isnan2=0;
|
||||
|
||||
assert(type_size==sizeof(double));
|
||||
HDassert(type_size==sizeof(double));
|
||||
|
||||
memcpy(&temp1_double, mem1, sizeof(double));
|
||||
memcpy(&temp2_double, mem2, sizeof(double));
|
||||
@ -2332,7 +2332,7 @@ hsize_t diff_datum(void *_mem1,
|
||||
int isnan2=0;
|
||||
|
||||
|
||||
assert(type_size==sizeof(long double));
|
||||
HDassert(type_size==sizeof(long double));
|
||||
|
||||
memcpy(&temp1_double, mem1, sizeof(long double));
|
||||
memcpy(&temp2_double, mem2, sizeof(long double));
|
||||
@ -2668,13 +2668,13 @@ hsize_t diff_region(hid_t obj1_id,
|
||||
*/
|
||||
if(nblocks1 > 0) {
|
||||
alloc_size = nblocks1 * ndims1 * 2 * sizeof(ptdata1[0]);
|
||||
assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
|
||||
HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
|
||||
|
||||
ptdata1 = malloc((size_t)alloc_size);
|
||||
ptdata1 = HDmalloc((size_t)alloc_size);
|
||||
H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t);
|
||||
H5Sget_select_hyper_blocklist(region1_id, (hsize_t)0, (hsize_t)nblocks1, ptdata1);
|
||||
|
||||
ptdata2 = malloc((size_t)alloc_size);
|
||||
ptdata2 = HDmalloc((size_t)alloc_size);
|
||||
H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t);
|
||||
H5Sget_select_hyper_blocklist(region2_id, (hsize_t)0, (hsize_t)nblocks2, ptdata2);
|
||||
|
||||
@ -2723,13 +2723,13 @@ hsize_t diff_region(hid_t obj1_id,
|
||||
*/
|
||||
if(npoints1 > 0) {
|
||||
alloc_size = npoints1 * ndims1 * sizeof(ptdata1[0]);
|
||||
assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
|
||||
HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
|
||||
|
||||
ptdata1 = malloc((size_t)alloc_size);
|
||||
ptdata1 = HDmalloc((size_t)alloc_size);
|
||||
H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t);
|
||||
H5Sget_select_elem_pointlist(region1_id, (hsize_t)0, (hsize_t)npoints1, ptdata1);
|
||||
|
||||
ptdata2 = malloc((size_t)alloc_size);
|
||||
ptdata2 = HDmalloc((size_t)alloc_size);
|
||||
H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t);
|
||||
H5Sget_select_elem_pointlist(region2_id, (hsize_t)0, (hsize_t)npoints2, ptdata2);
|
||||
|
||||
@ -5591,7 +5591,7 @@ int ull2float(unsigned long long ull_value, float *f_value)
|
||||
memcpy(f_value, buf, dst_size);
|
||||
|
||||
if(buf)
|
||||
free(buf);
|
||||
HDfree(buf);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -5600,7 +5600,7 @@ error:
|
||||
H5Pclose(dxpl_id);
|
||||
} H5E_END_TRY;
|
||||
if(buf)
|
||||
free(buf);
|
||||
HDfree(buf);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -5774,13 +5774,13 @@ hbool_t equal_float(float value, float expected, diff_opt_t *options)
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: my_isnan
|
||||
* Function: my_isnan
|
||||
*
|
||||
* Purpose: Determines whether VAL points to NaN.
|
||||
* Purpose: Determines whether VAL points to NaN.
|
||||
*
|
||||
* Return: TRUE or FALSE
|
||||
* Return: TRUE or FALSE
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Programmer: Robb Matzke
|
||||
* Monday, July 6, 1998
|
||||
*
|
||||
* Modifications:
|
||||
@ -5995,7 +5995,7 @@ void print_pos( int *ph, /* print header */
|
||||
pos[i] = curr_pos/acc[i];
|
||||
curr_pos -= acc[i]*pos[i];
|
||||
}
|
||||
assert( curr_pos == 0 );
|
||||
HDassert( curr_pos == 0 );
|
||||
|
||||
if ( rank > 0 )
|
||||
{
|
||||
@ -6048,7 +6048,7 @@ void print_char_pos( int *ph, /* print header */
|
||||
pos[i] = curr_pos/acc[i];
|
||||
curr_pos -= acc[i]*pos[i];
|
||||
}
|
||||
assert( curr_pos == 0 );
|
||||
HDassert( curr_pos == 0 );
|
||||
|
||||
parallel_print("[ " );
|
||||
if ( rank > 0 )
|
||||
|
@ -409,7 +409,7 @@ hsize_t diff_datasetid( hid_t did1,
|
||||
options, name1, name2, m_tid1, did1, did2);
|
||||
|
||||
/* reclaim any VL memory, if necessary */
|
||||
if(vl_data) {
|
||||
if(vl_data) {
|
||||
H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1);
|
||||
H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2);
|
||||
} /* end if */
|
||||
@ -445,27 +445,27 @@ hsize_t diff_datasetid( hid_t did1,
|
||||
size = 1;
|
||||
sm_size[i - 1] = MIN(dims1[i - 1], size);
|
||||
sm_nbytes *= sm_size[i - 1];
|
||||
assert(sm_nbytes > 0);
|
||||
HDassert(sm_nbytes > 0);
|
||||
} /* end for */
|
||||
|
||||
/* malloc return code should be verified.
|
||||
/* malloc return code should be verified.
|
||||
* If fail, need to handle the error.
|
||||
* This else branch should be recoded as a separate function.
|
||||
* Note that there are many "goto error" within this branch
|
||||
* that fails to address freeing other objects created here.
|
||||
* E.g., sm_space.
|
||||
*/
|
||||
sm_buf1 = malloc((size_t)sm_nbytes);
|
||||
assert(sm_buf1);
|
||||
sm_buf2 = malloc((size_t)sm_nbytes);
|
||||
assert(sm_buf2);
|
||||
* E.g., sm_space.
|
||||
*/
|
||||
sm_buf1 = HDmalloc((size_t)sm_nbytes);
|
||||
HDassert(sm_buf1);
|
||||
sm_buf2 = HDmalloc((size_t)sm_nbytes);
|
||||
HDassert(sm_buf2);
|
||||
|
||||
sm_nelmts = sm_nbytes / p_type_nbytes;
|
||||
sm_space = H5Screate_simple(1, &sm_nelmts, NULL);
|
||||
|
||||
/* the stripmine loop */
|
||||
memset(hs_offset, 0, sizeof hs_offset);
|
||||
memset(zero, 0, sizeof zero);
|
||||
HDmemset(hs_offset, 0, sizeof hs_offset);
|
||||
HDmemset(zero, 0, sizeof zero);
|
||||
|
||||
for(elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) {
|
||||
/* calculate the hyperslab size */
|
||||
@ -529,19 +529,19 @@ hsize_t diff_datasetid( hid_t did1,
|
||||
|
||||
/* free */
|
||||
if(buf1 != NULL) {
|
||||
free(buf1);
|
||||
HDfree(buf1);
|
||||
buf1 = NULL;
|
||||
} /* end if */
|
||||
if(buf2 != NULL) {
|
||||
free(buf2);
|
||||
HDfree(buf2);
|
||||
buf2 = NULL;
|
||||
} /* end if */
|
||||
if(sm_buf1 != NULL) {
|
||||
free(sm_buf1);
|
||||
HDfree(sm_buf1);
|
||||
sm_buf1 = NULL;
|
||||
} /* end if */
|
||||
if(sm_buf2 != NULL) {
|
||||
free(sm_buf2);
|
||||
HDfree(sm_buf2);
|
||||
sm_buf2 = NULL;
|
||||
} /* end if */
|
||||
|
||||
@ -565,7 +565,7 @@ error:
|
||||
/* reclaim any VL memory, if necessary */
|
||||
if(vl_data)
|
||||
H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1);
|
||||
free(buf1);
|
||||
HDfree(buf1);
|
||||
buf1=NULL;
|
||||
}
|
||||
if (buf2!=NULL)
|
||||
@ -573,7 +573,7 @@ error:
|
||||
/* reclaim any VL memory, if necessary */
|
||||
if(vl_data)
|
||||
H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2);
|
||||
free(buf2);
|
||||
HDfree(buf2);
|
||||
buf2=NULL;
|
||||
}
|
||||
if (sm_buf1!=NULL)
|
||||
@ -581,7 +581,7 @@ error:
|
||||
/* reclaim any VL memory, if necessary */
|
||||
if(vl_data)
|
||||
H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1);
|
||||
free(sm_buf1);
|
||||
HDfree(sm_buf1);
|
||||
sm_buf1=NULL;
|
||||
}
|
||||
if (sm_buf2!=NULL)
|
||||
@ -589,7 +589,7 @@ error:
|
||||
/* reclaim any VL memory, if necessary */
|
||||
if(vl_data)
|
||||
H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf2);
|
||||
free(sm_buf2);
|
||||
HDfree(sm_buf2);
|
||||
sm_buf2=NULL;
|
||||
}
|
||||
|
||||
@ -695,7 +695,7 @@ int diff_can_type( hid_t f_tid1, /* file data type */
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
assert(tclass1==tclass2);
|
||||
HDassert(tclass1==tclass2);
|
||||
switch (tclass1)
|
||||
{
|
||||
case H5T_INTEGER:
|
||||
@ -784,7 +784,7 @@ int diff_can_type( hid_t f_tid1, /* file data type */
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
assert(rank1==rank2);
|
||||
HDassert(rank1==rank2);
|
||||
for ( i=0; i<rank1; i++)
|
||||
{
|
||||
if (maxdim1 && maxdim2)
|
||||
|
@ -1027,7 +1027,7 @@ init_acc_pos(h5tools_context_t *ctx, hsize_t *dims)
|
||||
{
|
||||
int i;
|
||||
|
||||
assert(ctx->ndims);
|
||||
HDassert(ctx->ndims);
|
||||
|
||||
ctx->acc[ctx->ndims - 1] = 1;
|
||||
for (i = (ctx->ndims - 2); i >= 0; i--) {
|
||||
@ -1362,7 +1362,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem)
|
||||
size = H5Tget_size(memb);
|
||||
ndims = H5Tget_array_ndims(tid);
|
||||
H5Tget_array_dims2(tid, dims);
|
||||
assert(ndims >= 1 && ndims <= H5S_MAX_RANK);
|
||||
HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK);
|
||||
|
||||
/* calculate the number of array elements */
|
||||
for (k = 0, nelmts = 1; k < ndims; k++) {
|
||||
@ -1581,7 +1581,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id,
|
||||
H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
|
||||
|
||||
alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]);
|
||||
assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/
|
||||
HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/
|
||||
if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL)
|
||||
HGOTO_ERROR(FALSE, H5E_tools_min_id_g, "Could not allocate buffer for ptdata");
|
||||
|
||||
@ -1708,7 +1708,7 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id,
|
||||
H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
|
||||
|
||||
alloc_size = npoints * ndims * sizeof(ptdata[0]);
|
||||
assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/
|
||||
HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/
|
||||
if(NULL == (ptdata = (hsize_t *)HDmalloc((size_t) alloc_size)))
|
||||
HGOTO_ERROR(FALSE, H5E_tools_min_id_g, "Could not allocate buffer for ptdata");
|
||||
|
||||
@ -1726,7 +1726,7 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id,
|
||||
stream, container, ndims, type_id, npoints, ptdata);
|
||||
|
||||
done:
|
||||
free(ptdata);
|
||||
HDfree(ptdata);
|
||||
|
||||
if(H5Tclose(type_id) < 0)
|
||||
HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed");
|
||||
|
@ -448,10 +448,10 @@ h5tools_print_region_data_blocks(hid_t region_id,
|
||||
h5tools_context_t ctx;
|
||||
void *region_buf = NULL;
|
||||
|
||||
assert(info);
|
||||
assert(cur_ctx);
|
||||
assert(buffer);
|
||||
assert(ptdata);
|
||||
HDassert(info);
|
||||
HDassert(cur_ctx);
|
||||
HDassert(buffer);
|
||||
HDassert(ptdata);
|
||||
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
/* Get the dataspace of the dataset */
|
||||
@ -608,9 +608,9 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
|
||||
hid_t type_id = -1;
|
||||
int i;
|
||||
|
||||
assert(info);
|
||||
assert(ctx);
|
||||
assert(buffer);
|
||||
HDassert(info);
|
||||
HDassert(ctx);
|
||||
HDassert(buffer);
|
||||
|
||||
if((nblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0)
|
||||
H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed");
|
||||
@ -634,7 +634,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
|
||||
h5tools_str_append(buffer, "REGION_TYPE BLOCK ");
|
||||
|
||||
alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]);
|
||||
assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/
|
||||
HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/
|
||||
if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL)
|
||||
HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata");
|
||||
|
||||
@ -650,12 +650,12 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
|
||||
|
||||
/* Start coordinates and opposite corner */
|
||||
for (j = 0; j < ndims; j++)
|
||||
h5tools_str_append(buffer, "%s%lu", j ? "," : "(",
|
||||
(unsigned long) ptdata[i * 2 * ndims + j]);
|
||||
h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, j ? "," : "(",
|
||||
ptdata[i * 2 * ndims + j]);
|
||||
|
||||
for (j = 0; j < ndims; j++)
|
||||
h5tools_str_append(buffer, "%s%lu", j ? "," : ")-(",
|
||||
(unsigned long) ptdata[i * 2 * ndims + j + ndims]);
|
||||
h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, j ? "," : ")-(",
|
||||
ptdata[i * 2 * ndims + j + ndims]);
|
||||
|
||||
h5tools_str_append(buffer, ")");
|
||||
} /* end for (i = 0; i < nblocks; i++) */
|
||||
@ -799,10 +799,10 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id,
|
||||
void *region_buf = NULL;
|
||||
h5tools_context_t ctx;
|
||||
|
||||
assert(info);
|
||||
assert(cur_ctx);
|
||||
assert(buffer);
|
||||
assert(ptdata);
|
||||
HDassert(info);
|
||||
HDassert(cur_ctx);
|
||||
HDassert(buffer);
|
||||
HDassert(ptdata);
|
||||
|
||||
HDmemset(&ctx, 0, sizeof(ctx));
|
||||
/* Allocate space for the dimension array */
|
||||
@ -929,9 +929,9 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
|
||||
hid_t dtype;
|
||||
hid_t type_id;
|
||||
|
||||
assert(info);
|
||||
assert(ctx);
|
||||
assert(buffer);
|
||||
HDassert(info);
|
||||
HDassert(ctx);
|
||||
HDassert(buffer);
|
||||
|
||||
if((npoints = H5Sget_select_elem_npoints(region_space)) <= 0)
|
||||
H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_elem_npoints failed");
|
||||
@ -955,7 +955,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
|
||||
h5tools_str_append(buffer, "REGION_TYPE POINT ");
|
||||
|
||||
alloc_size = npoints * ndims * sizeof(ptdata[0]);
|
||||
assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/
|
||||
HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/
|
||||
if(NULL == (ptdata = (hsize_t *)HDmalloc((size_t) alloc_size)))
|
||||
HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata");
|
||||
|
||||
@ -970,8 +970,8 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
|
||||
indx ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long) indx);
|
||||
|
||||
for (loop_indx = 0; loop_indx < ndims; loop_indx++)
|
||||
h5tools_str_append(buffer, "%s%lu", loop_indx ? "," : "(",
|
||||
(unsigned long) (ptdata[indx * ndims + loop_indx]));
|
||||
h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, loop_indx ? "," : "(",
|
||||
ptdata[indx * ndims + loop_indx]);
|
||||
|
||||
h5tools_str_append(buffer, ")");
|
||||
} /* end for (indx = 0; indx < npoints; indx++) */
|
||||
@ -1196,10 +1196,10 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
|
||||
size = 1;
|
||||
sm_size[i - 1] = MIN(total_size[i - 1], size);
|
||||
sm_nbytes *= sm_size[i - 1];
|
||||
assert(sm_nbytes > 0);
|
||||
HDassert(sm_nbytes > 0);
|
||||
}
|
||||
|
||||
assert(sm_nbytes == (hsize_t) ((size_t) sm_nbytes)); /*check for overflow*/
|
||||
HDassert(sm_nbytes == (hsize_t) ((size_t) sm_nbytes)); /*check for overflow*/
|
||||
if(NULL == (sm_buf = (unsigned char *)HDmalloc((size_t) sm_nelmts * p_type_nbytes)))
|
||||
H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for strip-mine");
|
||||
|
||||
@ -1582,14 +1582,14 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
|
||||
size = 1;
|
||||
sm_size[i - 1] = MIN(total_size[i - 1], size);
|
||||
sm_nbytes *= sm_size[i - 1];
|
||||
assert(sm_nbytes > 0);
|
||||
HDassert(sm_nbytes > 0);
|
||||
}
|
||||
}
|
||||
|
||||
if(!sm_nbytes)
|
||||
goto done;
|
||||
|
||||
assert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/
|
||||
HDassert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/
|
||||
sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes);
|
||||
|
||||
sm_nelmts = sm_nbytes / p_type_nbytes;
|
||||
@ -1700,7 +1700,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte
|
||||
if (nelmts == 0)
|
||||
return SUCCEED; /*nothing to print*/
|
||||
if (ctx->ndims > 0) {
|
||||
assert(ctx->p_max_idx[ctx->ndims - 1] == (hsize_t) ((int) ctx->p_max_idx[ctx->ndims - 1]));
|
||||
HDassert(ctx->p_max_idx[ctx->ndims - 1] == (hsize_t) ((int) ctx->p_max_idx[ctx->ndims - 1]));
|
||||
ctx->size_last_dim = (int) (ctx->p_max_idx[ctx->ndims - 1]);
|
||||
} /* end if */
|
||||
else
|
||||
@ -2390,7 +2390,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
|
||||
if(H5Tget_array_dims2(type, dims) >= 0) {
|
||||
/* Print array dimensions */
|
||||
for (i = 0; i < ndims; i++)
|
||||
h5tools_str_append(buffer, "[%d]", (int) dims[i]);
|
||||
h5tools_str_append(buffer, "[" HSIZE_T_FORMAT "]", dims[i]);
|
||||
|
||||
h5tools_str_append(buffer, " ");
|
||||
}
|
||||
@ -2461,12 +2461,12 @@ h5tools_print_dataspace(FILE *stream, h5tools_str_t *buffer, const h5tool_format
|
||||
|
||||
case H5S_SIMPLE:
|
||||
/* simple dataspace */
|
||||
h5tools_str_append(buffer, "%s %s { %s %" H5_PRINTF_LL_WIDTH "u",
|
||||
h5tools_str_append(buffer, "%s %s { %s " HSIZE_T_FORMAT,
|
||||
h5tools_dump_header_format->dataspacedescriptionbegin, S_SIMPLE,
|
||||
h5tools_dump_header_format->dataspacedimbegin, size[0]);
|
||||
|
||||
for(i = 1; i < ndims; i++)
|
||||
h5tools_str_append(buffer, ", %" H5_PRINTF_LL_WIDTH "u", size[i]);
|
||||
h5tools_str_append(buffer, ", " HSIZE_T_FORMAT, size[i]);
|
||||
|
||||
h5tools_str_append(buffer, " %s / ", h5tools_dump_header_format->dataspacedimend);
|
||||
|
||||
@ -2474,14 +2474,14 @@ h5tools_print_dataspace(FILE *stream, h5tools_str_t *buffer, const h5tool_format
|
||||
h5tools_str_append(buffer, "%s %s",
|
||||
h5tools_dump_header_format->dataspacedimbegin, "H5S_UNLIMITED");
|
||||
else
|
||||
h5tools_str_append(buffer, "%s %" H5_PRINTF_LL_WIDTH "u",
|
||||
h5tools_str_append(buffer, "%s " HSIZE_T_FORMAT,
|
||||
h5tools_dump_header_format->dataspacedimbegin, maxsize[0]);
|
||||
|
||||
for(i = 1; i < ndims; i++)
|
||||
if(maxsize[i] == H5S_UNLIMITED)
|
||||
h5tools_str_append(buffer, ", %s", "H5S_UNLIMITED");
|
||||
else
|
||||
h5tools_str_append(buffer, ", %" H5_PRINTF_LL_WIDTH "u", maxsize[i]);
|
||||
h5tools_str_append(buffer, ", " HSIZE_T_FORMAT, maxsize[i]);
|
||||
|
||||
h5tools_str_append(buffer, " %s }", h5tools_dump_header_format->dataspacedimend);
|
||||
break;
|
||||
@ -2539,7 +2539,7 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
|
||||
if((snmembs = H5Tget_nmembers(type)) < 0)
|
||||
H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed");
|
||||
nmembs = (unsigned)snmembs;
|
||||
assert(nmembs > 0);
|
||||
HDassert(nmembs > 0);
|
||||
|
||||
if((super = H5Tget_super(type)) < 0)
|
||||
H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_super failed");
|
||||
@ -2611,7 +2611,7 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
|
||||
/*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size"
|
||||
*strangely, unless use another pointer "copy".*/
|
||||
copy = value + i * dst_size;
|
||||
h5tools_str_append(buffer, "%" H5_PRINTF_LL_WIDTH "u", *((unsigned long long *) ((void *) copy)));
|
||||
h5tools_str_append(buffer, HSIZE_T_FORMAT, *((unsigned long long *) ((void *) copy)));
|
||||
}
|
||||
else {
|
||||
/*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size"
|
||||
@ -2890,9 +2890,9 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
|
||||
h5tools_str_append(&buffer, "%s ", CHUNKED);
|
||||
|
||||
rank = H5Pget_chunk(dcpl_id,NELMTS(chsize),chsize);
|
||||
h5tools_str_append(&buffer, "%s %" H5_PRINTF_LL_WIDTH "u", h5tools_dump_header_format->dataspacedimbegin, chsize[0]);
|
||||
h5tools_str_append(&buffer, "%s " HSIZE_T_FORMAT, h5tools_dump_header_format->dataspacedimbegin, chsize[0]);
|
||||
for(i = 1; i < rank; i++)
|
||||
h5tools_str_append(&buffer, ", %" H5_PRINTF_LL_WIDTH "u", chsize[i]);
|
||||
h5tools_str_append(&buffer, ", " HSIZE_T_FORMAT, chsize[i]);
|
||||
h5tools_str_append(&buffer, " %s", h5tools_dump_header_format->dataspacedimend);
|
||||
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0);
|
||||
|
||||
@ -2942,18 +2942,18 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
|
||||
if(storage_size != 0)
|
||||
ratio = (double) uncomp_size / (double) storage_size;
|
||||
|
||||
h5tools_str_append(&buffer, "SIZE %" H5_PRINTF_LL_WIDTH "u (%.3f:1 COMPRESSION)", storage_size, ratio);
|
||||
h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT" (%.3f:1 COMPRESSION)", storage_size, ratio);
|
||||
|
||||
}
|
||||
else
|
||||
h5tools_str_append(&buffer, "SIZE %" H5_PRINTF_LL_WIDTH "u", storage_size);
|
||||
h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size);
|
||||
|
||||
H5Sclose(sid);
|
||||
H5Tclose(tid);
|
||||
|
||||
}
|
||||
else {
|
||||
h5tools_str_append(&buffer, "SIZE %" H5_PRINTF_LL_WIDTH "u", storage_size);
|
||||
h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size);
|
||||
}
|
||||
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0);
|
||||
|
||||
@ -2980,7 +2980,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
|
||||
h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
|
||||
|
||||
h5tools_str_reset(&buffer);
|
||||
h5tools_str_append(&buffer, "SIZE %" H5_PRINTF_LL_WIDTH "u", storage_size);
|
||||
h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size);
|
||||
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0);
|
||||
|
||||
ctx->indent_level--;
|
||||
@ -3026,7 +3026,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
|
||||
h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
|
||||
|
||||
h5tools_str_reset(&buffer);
|
||||
h5tools_str_append(&buffer, "FILENAME %s SIZE %" H5_PRINTF_LL_WIDTH "u", name, size);
|
||||
h5tools_str_append(&buffer, "FILENAME %s SIZE " HSIZE_T_FORMAT, name, size);
|
||||
h5tools_str_append(&buffer, " OFFSET %ld", offset);
|
||||
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0);
|
||||
}
|
||||
@ -3062,7 +3062,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
|
||||
h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
|
||||
|
||||
h5tools_str_reset(&buffer);
|
||||
h5tools_str_append(&buffer,"SIZE %" H5_PRINTF_LL_WIDTH "u", storage_size);
|
||||
h5tools_str_append(&buffer,"SIZE " HSIZE_T_FORMAT, storage_size);
|
||||
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0);
|
||||
|
||||
ctx->need_prefix = TRUE;
|
||||
@ -3289,7 +3289,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
|
||||
h5tools_str_append(&buffer, "%s", "H5D_FILL_TIME_IFSET");
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
HDassert(0);
|
||||
break;
|
||||
}
|
||||
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0);
|
||||
@ -3346,7 +3346,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
|
||||
h5tools_str_append(&buffer, "%s", "H5D_ALLOC_TIME_LATE");
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
HDassert(0);
|
||||
break;
|
||||
}
|
||||
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0);
|
||||
@ -3823,11 +3823,11 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info,
|
||||
nelmts *= size[i];
|
||||
|
||||
alloc_size = nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type));
|
||||
assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
|
||||
HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
|
||||
|
||||
if(alloc_size) {
|
||||
buf = HDmalloc((size_t)alloc_size);
|
||||
assert(buf);
|
||||
HDassert(buf);
|
||||
|
||||
if (H5Aread(obj_id, p_type, buf) >= 0)
|
||||
if (display_char && H5Tget_size(type) == 1 && H5Tget_class(type) == H5T_INTEGER) {
|
||||
|
@ -334,7 +334,7 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info,
|
||||
ctx->pos[i] = curr_pos / ctx->acc[i];
|
||||
curr_pos -= ctx->acc[i] * ctx->pos[i];
|
||||
}
|
||||
assert(curr_pos == 0);
|
||||
HDassert(curr_pos == 0);
|
||||
|
||||
/* Print the index values */
|
||||
for (i = 0; i < (size_t) ndims; i++) {
|
||||
@ -462,12 +462,12 @@ h5tools_str_dump_region_blocks(h5tools_str_t *str, hid_t region,
|
||||
|
||||
/* Start coordinates and opposite corner */
|
||||
for (j = 0; j < ndims; j++)
|
||||
h5tools_str_append(str, "%s%lu", j ? "," : "(",
|
||||
(unsigned long) ptdata[i * 2 * ndims + j]);
|
||||
h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(",
|
||||
ptdata[i * 2 * ndims + j]);
|
||||
|
||||
for (j = 0; j < ndims; j++)
|
||||
h5tools_str_append(str, "%s%lu", j ? "," : ")-(",
|
||||
(unsigned long) ptdata[i * 2 * ndims + j + ndims]);
|
||||
h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : ")-(",
|
||||
ptdata[i * 2 * ndims + j + ndims]);
|
||||
|
||||
h5tools_str_append(str, ")");
|
||||
}
|
||||
@ -522,8 +522,8 @@ h5tools_str_dump_region_points(h5tools_str_t *str, hid_t region,
|
||||
(unsigned long)i);
|
||||
|
||||
for (j = 0; j < ndims; j++)
|
||||
h5tools_str_append(str, "%s%lu", j ? "," : "(",
|
||||
(unsigned long) (ptdata[i * ndims + j]));
|
||||
h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(",
|
||||
(ptdata[i * ndims + j]));
|
||||
|
||||
h5tools_str_append(str, ")");
|
||||
}
|
||||
|
@ -900,7 +900,7 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata)
|
||||
|
||||
H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT);
|
||||
printf(" %-10s %s -> %s\n", "link", path, targbuf);
|
||||
free(targbuf);
|
||||
HDfree(targbuf);
|
||||
} /* end if */
|
||||
else
|
||||
printf(" %-10s %s ->\n", "link", path);
|
||||
@ -913,12 +913,12 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata)
|
||||
const char *objname;
|
||||
|
||||
targbuf = HDmalloc(linfo->u.val_size + 1);
|
||||
assert(targbuf);
|
||||
HDassert(targbuf);
|
||||
|
||||
H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT);
|
||||
H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname);
|
||||
printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname);
|
||||
free(targbuf);
|
||||
HDfree(targbuf);
|
||||
} /* end if */
|
||||
else
|
||||
printf(" %-10s %s ->\n", "ext link", path);
|
||||
|
Loading…
Reference in New Issue
Block a user