diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2016-03-07 16:09:42 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2016-03-07 16:09:42 (GMT) |
commit | 22eaae599991804716cfe226859c3679e4494213 (patch) | |
tree | 6b77b2793dd9ffde4464541fc0e6346269d5c2e4 /tools | |
parent | 8f5530e3be3e3c53951a0fa64a13d89d674b22d1 (diff) | |
download | hdf5-22eaae599991804716cfe226859c3679e4494213.zip hdf5-22eaae599991804716cfe226859c3679e4494213.tar.gz hdf5-22eaae599991804716cfe226859c3679e4494213.tar.bz2 |
[svn-r29309] HDFFV-9698, HDFFV-9241, HDFFV-9570: Merge fixes from trunk for subsetting index, default fill value display, and optional arg crash. Also some minor compiler warnings fixes.
Diffstat (limited to 'tools')
40 files changed, 561 insertions, 416 deletions
diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index 55bfc19..cc39f73 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -102,6 +102,12 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicessub3.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicessub4.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicesyes.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tints4dims.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tints4dimsBlock2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tints4dimsBlockEq.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tints4dimsCount2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tints4dimsCountEq.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tints4dimsStride2.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tintsattrs.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tlarge_objname.ddl #${HDF5_TOOLS_SRC_DIR}/testfiles/tldouble.ddl @@ -242,6 +248,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/thyperslab.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tints4dims.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tintsattrs.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tlarge_objname.h5 #${HDF5_TOOLS_SRC_DIR}/testfiles/tldouble.h5 @@ -911,6 +918,18 @@ texceedsubblock.out.err tindicesyes.out tindicesyes.out.err + tints4dims.out + tints4dims.out.err + tints4dimsBlock2.out + tints4dimsBlock2.out.err + tints4dimsBlockEq.out + tints4dimsBlockEq.out.err + tints4dimsCount2.out + tints4dimsCount2.out.err + tints4dimsCountEq.out + tints4dimsCountEq.out.err + tints4dimsStride2.out + tints4dimsStride2.out.err tintsattrs.out tintsattrs.out.err tlarge_objname.out @@ -1232,6 +1251,12 @@ ADD_H5_TEST (tdset-3s 0 --enable-error-stack -d "/dset1[1,1;;;]" tdset.h5) ADD_H5_TEST (tno-subset 0 --enable-error-stack --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" tno-subset.h5) + ADD_H5_TEST (tints4dimsCount2 0 --enable-error-stack -d FourDimInts -s 0,0,0,0 -c 2,2,2,2 tints4dims.h5) + ADD_H5_TEST (tints4dimsBlock2 0 --enable-error-stack -d FourDimInts -s 0,0,0,0 -c 1,1,1,1 -k 2,2,2,2 tints4dims.h5) + ADD_H5_TEST (tints4dimsStride2 0 --enable-error-stack -d FourDimInts -s 0,0,0,0 -S 2,2,2,2 -c 2,2,2,2 tints4dims.h5) + ADD_H5_TEST (tints4dimsCountEq 0 --enable-error-stack -d FourDimInts -s 0,0,0,0 -S 2,2,1,1 -k 1,2,1,1 -c 2,2,4,4 tints4dims.h5) + ADD_H5_TEST (tints4dimsBlockEq 0 --enable-error-stack -d FourDimInts -s 0,0,0,0 -S 2,2,1,1 -c 2,2,1,1 -k 1,2,4,4 tints4dims.h5) + # test printing characters in ASCII instead of decimal ADD_H5_TEST (tchar1 0 --enable-error-stack -r tchar.h5) diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 2c5fa6d..5b953cb 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -242,7 +242,7 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, " -o F, --output=F Output raw data into file F\n"); PRINTVALSTREAM(rawoutstream, " -b B, --binary=B Binary file output, of form B\n"); PRINTVALSTREAM(rawoutstream, " -O F, --ddl=F Output ddl text into file F\n"); - PRINTVALSTREAM(rawoutstream, " Do not use filename F to suppress ddl display\n"); + PRINTVALSTREAM(rawoutstream, " Use blank(empty) filename F to suppress ddl display\n"); PRINTVALSTREAM(rawoutstream, "--------------- Object Options ---------------\n"); PRINTVALSTREAM(rawoutstream, " -a P, --attribute=P Print the specified attribute\n"); PRINTVALSTREAM(rawoutstream, " If an attribute name contains a slash (/), escape the\n"); @@ -389,10 +389,10 @@ table_list_add(hid_t oid, unsigned long file_no) /* Allocate space if necessary */ if(table_list.nused == table_list.nalloc) { - void *tmp_ptr; + h5dump_table_items_t *tmp_ptr; table_list.nalloc = MAX(1, table_list.nalloc * 2); - if(NULL == (tmp_ptr = HDrealloc(table_list.tables, table_list.nalloc * sizeof(table_list.tables[0])))) + if(NULL == (tmp_ptr = (h5dump_table_items_t *)HDrealloc(table_list.tables, table_list.nalloc * sizeof(table_list.tables[0])))) return -1; table_list.tables = tmp_ptr; } /* end if */ diff --git a/tools/h5dump/h5dump.h b/tools/h5dump/h5dump.h index 7bfead7..a1f5b22 100644 --- a/tools/h5dump/h5dump.h +++ b/tools/h5dump/h5dump.h @@ -38,16 +38,17 @@ typedef struct dump_functions_t { } dump_functions; /* List of table structures. There is one table structure for each file */ -typedef struct h5dump_table_list_t { - size_t nalloc; - size_t nused; - struct { +typedef struct h5dump_table_items_t { unsigned long fileno; /* File number that these tables refer to */ hid_t oid; /* ID of an object in this file, held open so fileno is consistent */ table_t *group_table; /* Table of groups */ table_t *dset_table; /* Table of datasets */ table_t *type_table; /* Table of datatypes */ - } *tables; +} h5dump_table_items_t; +typedef struct h5dump_table_list_t { + size_t nalloc; + size_t nused; + h5dump_table_items_t *tables; } h5dump_table_list_t; h5dump_table_list_t table_list = {0, 0, NULL}; diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index 43d397c..0324a52 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -377,6 +377,8 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR } break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: default: error_msg("unknown object \"%s\"\n", name); h5tools_setstatus(EXIT_FAILURE); @@ -509,6 +511,11 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR HDfree(targbuf); break; + case H5L_TYPE_ERROR: + case H5L_TYPE_MAX: + HDassert(0); + /* fall through */ + case H5L_TYPE_HARD: default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -1054,7 +1061,10 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) } break; + case H5T_NO_CLASS: + case H5T_NCLASSES: default: + HDassert(0); break; } /* end switch */ } /* for(i=0;i<data_loop;i++) */ @@ -1497,8 +1507,8 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED * data, int H { hid_t oid = -1; hid_t attr_id = -1; - char *obj_name; - char *attr_name; + char *obj_name = NULL; + char *attr_name = NULL; int j; h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ @@ -1915,6 +1925,11 @@ handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED * data, int H5_AT end_obj(h5tools_dump_header_format->extlinkend, h5tools_dump_header_format->extlinkblockend); break; + case H5L_TYPE_ERROR: + case H5L_TYPE_MAX: + HDassert(0); + /* fall through */ + case H5L_TYPE_HARD: default: begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin); PRINTVALSTREAM(rawoutstream, "\n"); @@ -2082,6 +2097,8 @@ dump_extlink(hid_t group, const char *linkname, const char *objname) case H5O_TYPE_NAMED_DATATYPE: handle_datatypes(group, linkname, NULL, 0, objname); break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: default: h5tools_setstatus(EXIT_FAILURE); } diff --git a/tools/h5dump/h5dump_ddl.h b/tools/h5dump/h5dump_ddl.h index 6cd9181..2b3f61e 100644 --- a/tools/h5dump/h5dump_ddl.h +++ b/tools/h5dump/h5dump_ddl.h @@ -34,6 +34,10 @@ void dump_fcontents(hid_t fid); /* callback function used by H5Aiterate2() */ herr_t dump_attr_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *info, void *_op_data); +/* other iteration functions */ +void link_iteration(hid_t gid, unsigned crt_order_flags); +void attr_iteration(hid_t gid, unsigned attr_crt_order_flags); + void handle_paths(hid_t fid, const char *path_name, void *data, int pe, const char *display_name); void handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *display_name); void handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED * data, int H5_ATTR_UNUSED pe, const char H5_ATTR_UNUSED *display_name); diff --git a/tools/h5dump/h5dump_defines.h b/tools/h5dump/h5dump_defines.h index f1c4451..3493de1 100644 --- a/tools/h5dump/h5dump_defines.h +++ b/tools/h5dump/h5dump_defines.h @@ -27,7 +27,8 @@ do { \ if ((name)) { \ PRINTSTREAM(rawoutstream, "%s \"%s\" %s", (obj), (name), (begin)); \ - } else { \ + } \ + else { \ PRINTSTREAM(rawoutstream, "%s %s", (obj), (begin)); \ } \ } while(0); @@ -36,13 +37,11 @@ do { \ if(HDstrlen(end)) { \ PRINTSTREAM(rawoutstream, "%s", end); \ - if(HDstrlen(obj)) { \ + if(HDstrlen(obj)) \ PRINTVALSTREAM(rawoutstream, " "); \ } \ - } \ - if(HDstrlen(obj)) { \ + if(HDstrlen(obj)) \ PRINTSTREAM(rawoutstream, "%s", obj); \ - } \ } while(0); diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 353a0c3..8ad76e6 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -359,6 +359,8 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ } break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: default: error_msg("unknown object \"%s\"\n", name); h5tools_setstatus(EXIT_FAILURE); @@ -521,6 +523,11 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ HDfree(targbuf); break; + case H5L_TYPE_ERROR: + case H5L_TYPE_MAX: + HDassert(0); + /* fall through */ + case H5L_TYPE_HARD: default: { char linkxid[100]; @@ -976,9 +983,13 @@ xml_print_datatype(hid_t type, unsigned in_group) h5tools_str_append(&buffer, "BE"); break; case H5T_ORDER_VAX: + case H5T_ORDER_MIXED: + case H5T_ORDER_NONE: + case H5T_ORDER_ERROR: default: h5tools_str_append(&buffer, "ERROR_UNKNOWN"); - } + break; + } /* end switch */ h5tools_str_append(&buffer, "\" Sign=\""); @@ -989,9 +1000,12 @@ xml_print_datatype(hid_t type, unsigned in_group) case H5T_SGN_2: h5tools_str_append(&buffer, "true"); break; + case H5T_SGN_ERROR: + case H5T_NSGN: default: h5tools_str_append(&buffer, "ERROR_UNKNOWN"); - } + break; + } /* end switch */ h5tools_str_append(&buffer, "\" Size=\""); sz = H5Tget_size(type); @@ -1042,9 +1056,12 @@ xml_print_datatype(hid_t type, unsigned in_group) case H5T_ORDER_VAX: h5tools_str_append(&buffer, "VAX"); break; + case H5T_ORDER_MIXED: + case H5T_ORDER_NONE: + case H5T_ORDER_ERROR: default: h5tools_str_append(&buffer, "ERROR_UNKNOWN"); - } + } /* end switch */ h5tools_str_append(&buffer, "\" Size=\""); sz = H5Tget_size(type); @@ -1179,9 +1196,12 @@ xml_print_datatype(hid_t type, unsigned in_group) h5tools_str_append(&buffer, "BE"); break; case H5T_ORDER_VAX: + case H5T_ORDER_MIXED: + case H5T_ORDER_NONE: + case H5T_ORDER_ERROR: default: h5tools_str_append(&buffer, "ERROR_UNKNOWN"); - } + } /* end switch */ size = H5Tget_size(type); h5tools_str_append(&buffer, "\" Size=\"%lu\"/>", (unsigned long)size); @@ -1516,6 +1536,10 @@ xml_print_datatype(hid_t type, unsigned in_group) H5Tclose(super); break; + case H5T_NO_CLASS: + case H5T_NCLASSES: + HDassert(0); + /* fall through */ default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -1813,6 +1837,7 @@ xml_dump_dataspace(hid_t space) break; #endif /* TMP */ + case H5S_NULL: case H5S_NO_CLASS: default: ctx.need_prefix = TRUE; @@ -2246,6 +2271,10 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED dump_function_table->dump_data_function(attr_id, ATTRIBUTE_DATA, NULL, 0); break; + case H5T_NO_CLASS: + case H5T_NCLASSES: + HDassert(0); + /* fall through */ default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -2938,9 +2967,9 @@ static int xml_print_refs(hid_t did, int source) { herr_t e; - hid_t type; - hid_t space; - hssize_t ssiz; + hid_t type = -1; + hid_t space = -1; + hssize_t ssiz = -1; hsize_t i; size_t tsiz; hobj_ref_t *refbuf = NULL; @@ -3095,11 +3124,11 @@ static int xml_print_strs(hid_t did, int source) { herr_t e; - hid_t type; - hid_t space; - hssize_t ssiz; + hid_t type = -1; + hid_t space = -1; + hssize_t ssiz = -1; htri_t is_vlstr = FALSE; - size_t tsiz; + size_t tsiz = 0; size_t i; size_t str_size = 0; char *bp = NULL; @@ -3563,7 +3592,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) /* Render the element */ h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "\"%f\"", *(float *) buf); + h5tools_str_append(&buffer, "\"%f\"", (double)*(float *)buf); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; @@ -3701,6 +3730,12 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); break; + case H5T_NO_CLASS: + case H5T_NCLASSES: + HDassert(0); + /* fall through */ + case H5T_STRING: + case H5T_REFERENCE: default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -4013,10 +4048,13 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s case H5D_FILL_TIME_IFSET: h5tools_str_append(&buffer, "FillIfSet"); break; + case H5D_FILL_TIME_ERROR: + HDassert(0); + /* fall through */ default: h5tools_str_append(&buffer, "?"); break; - } + } /* end switch */ h5tools_str_append(&buffer, "\" "); H5Pget_alloc_time(dcpl, &at); h5tools_str_append(&buffer, "AllocationTime=\""); @@ -4031,10 +4069,13 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s h5tools_str_append(&buffer, "Late"); break; case H5D_ALLOC_TIME_DEFAULT: + case H5D_ALLOC_TIME_ERROR: + HDassert(0); + /* fall through */ default: h5tools_str_append(&buffer, "?"); break; - } + } /* end switch */ h5tools_str_append(&buffer, "\""); h5tools_str_append(&buffer, ">"); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); @@ -4255,6 +4296,11 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s ctx.indent_level--; dump_indent -= COL; break; + case H5T_NO_CLASS: + case H5T_NCLASSES: + HDassert(0); + /* fall through */ + default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 785b1e6..10b59f9 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -110,6 +110,7 @@ #define FILE78 "tscalarintattrsize.h5" #define FILE79 "tintsattrs.h5" #define FILE80 "tbitnopaque.h5" +#define FILE81 "tints4dims.h5" /*------------------------------------------------------------------------- * prototypes @@ -343,6 +344,13 @@ typedef struct s1_t { #define F80_DIM32 32 +#define F81_DATASETNAME "FourDimInts" +#define F81_RANK 4 +#define F81_WDIM 10 +#define F81_XDIM 8 +#define F81_YDIM 6 +#define F81_ZDIM 4 + static void gent_group(void) { @@ -9682,6 +9690,41 @@ static void gent_bitnopaquefields(void) H5Fclose(file); } +/*------------------------------------------------------------------------- + * Function: gent_intsfourdims + * + * Purpose: Generate a file to be used in the h5dump subsetting tests. + * One datasets of unsigned int types are created in four dimensions 2,4,6,10. + *------------------------------------------------------------------------- + */ +static void +gent_intsfourdims(void) +{ + hid_t fid, dataset, space, tid; + hsize_t dims[F81_RANK]; + uint32_t dset1[F81_ZDIM][F81_YDIM][F81_XDIM][F81_WDIM]; + unsigned int i, j, k, l; + + fid = H5Fcreate(FILE81, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + /* Dataset of 32 bits unsigned int */ + dims[0] = F81_ZDIM; dims[1] = F81_YDIM; dims[2] = F81_XDIM; dims[3] = F81_WDIM; + space = H5Screate_simple(F81_RANK, dims, NULL); + dataset = H5Dcreate2(fid, F81_DATASETNAME, H5T_STD_U32LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0; i < F81_ZDIM; i++) + for(j = 0; j < F81_YDIM; j++) + for(k = 0; k < F81_XDIM; k++) + for(l = 0; l < F81_WDIM; l++) + dset1[i][j][k][l] = i*F81_YDIM*F81_XDIM*F81_WDIM + j*F81_XDIM*F81_WDIM + k*F81_WDIM + l; + + H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); + H5Sclose(space); + H5Dclose(dataset); + + H5Fclose(fid); +} + /*------------------------------------------------------------------------- * Function: main @@ -9773,6 +9816,8 @@ int main(void) gent_intsattrs(); gent_bitnopaquefields(); + gent_intsfourdims(); + return 0; } diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index a0e61a7..7641de4 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -132,6 +132,7 @@ $SRC_H5DUMP_TESTFILES/tgrp_comments.h5 $SRC_H5DUMP_TESTFILES/thlink.h5 $SRC_H5DUMP_TESTFILES/thyperslab.h5 $SRC_H5DUMP_TESTFILES/tintsattrs.h5 +$SRC_H5DUMP_TESTFILES/tints4dims.h5 $SRC_H5DUMP_TESTFILES/tlarge_objname.h5 #$SRC_H5DUMP_TESTFILES/tldouble.h5 $SRC_H5DUMP_TESTFILES/tlonglinks.h5 @@ -263,6 +264,12 @@ $SRC_H5DUMP_TESTFILES/tindicessub2.ddl $SRC_H5DUMP_TESTFILES/tindicessub3.ddl $SRC_H5DUMP_TESTFILES/tindicessub4.ddl $SRC_H5DUMP_TESTFILES/tindicesyes.ddl +$SRC_H5DUMP_TESTFILES/tints4dims.ddl +$SRC_H5DUMP_TESTFILES/tints4dimsBlock2.ddl +$SRC_H5DUMP_TESTFILES/tints4dimsBlockEq.ddl +$SRC_H5DUMP_TESTFILES/tints4dimsCount2.ddl +$SRC_H5DUMP_TESTFILES/tints4dimsCountEq.ddl +$SRC_H5DUMP_TESTFILES/tints4dimsStride2.ddl $SRC_H5DUMP_TESTFILES/tintsattrs.ddl $SRC_H5DUMP_TESTFILES/tlarge_objname.ddl #$SRC_H5DUMP_TESTFILES/tldouble.ddl @@ -1104,6 +1111,12 @@ TOOLTEST tall-5s.ddl --enable-error-stack -d "/g1/g1.1/dset1.1.2[0;2;10;]" tall. TOOLTEST tdset-3s.ddl --enable-error-stack -d "/dset1[1,1;;;]" tdset.h5 TOOLTEST tno-subset.ddl --enable-error-stack --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" tno-subset.h5 +TOOLTEST tints4dimsCount2.ddl --enable-error-stack -d FourDimInts -s 0,0,0,0 -c 2,2,2,2 tints4dims.h5 +TOOLTEST tints4dimsBlock2.ddl --enable-error-stack -d FourDimInts -s 0,0,0,0 -c 1,1,1,1 -k 2,2,2,2 tints4dims.h5 +TOOLTEST tints4dimsStride2.ddl --enable-error-stack -d FourDimInts -s 0,0,0,0 -S 2,2,2,2 -c 2,2,2,2 tints4dims.h5 +TOOLTEST tints4dimsCountEq.ddl --enable-error-stack -d FourDimInts -s 0,0,0,0 -S 2,2,1,1 -k 1,2,1,1 -c 2,2,4,4 tints4dims.h5 +TOOLTEST tints4dimsBlockEq.ddl --enable-error-stack -d FourDimInts -s 0,0,0,0 -S 2,2,1,1 -c 2,2,1,1 -k 1,2,4,4 tints4dims.h5 + # test printing characters in ASCII instead of decimal TOOLTEST tchar1.ddl --enable-error-stack -r tchar.h5 diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index 96fb6f9..9617df3 100644 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -265,7 +265,7 @@ err: static int gtoken(char *s) { size_t len; - int token; + int token = ERR; const char *err1 = "Illegal argument: %s.\n"; @@ -995,16 +995,16 @@ out: */ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) { - hid_t group_id; - hid_t dset_id; - hid_t space_id; - hid_t mspace_id; - hid_t type_id; - hid_t handle; - char *str1 = NULL; - char *str2 = NULL; - char *str3 = NULL; - char str[1024] = ""; + hid_t group_id = -1; + hid_t dset_id = -1; + hid_t space_id = -1; + hid_t mspace_id = -1; + hid_t type_id = -1; + hid_t handle = -1; + char *str1 = NULL; + char *str2 = NULL; + char *str3 = NULL; + char str[1024] = ""; int j; hsize_t line; diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 708e9de..4ab4f22 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -973,7 +973,7 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind) /* Release resources */ for(i = 0; i < (unsigned)nmembs; i++) - HDfree(name[i]); + H5free_memory(name[i]); HDfree(name); HDfree(value); } @@ -1848,6 +1848,7 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) } /* end if */ break; default: + HDassert(0); break; } /* Print total raw storage size */ diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index a195f6c..8a9090a 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -333,7 +333,7 @@ done: */ int named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err) { named_dt_t *dt = *named_dt_head_p; - hid_t ret_value = -1; + int ret_value = -1; while (dt) { /* Pop the datatype off the stack and free it */ diff --git a/tools/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl b/tools/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl index b8e7e68..80b8a19 100644 --- a/tools/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl +++ b/tools/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl @@ -12,7 +12,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -30,7 +30,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -48,7 +48,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -66,7 +66,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -84,7 +84,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -102,7 +102,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -120,7 +120,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/h5repack/testfiles/h5repack_layout.UD.h5-plugin_none.ddl b/tools/h5repack/testfiles/h5repack_layout.UD.h5-plugin_none.ddl index fb94c21..66c4c69 100644 --- a/tools/h5repack/testfiles/h5repack_layout.UD.h5-plugin_none.ddl +++ b/tools/h5repack/testfiles/h5repack_layout.UD.h5-plugin_none.ddl @@ -12,7 +12,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -30,7 +30,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -48,7 +48,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -66,7 +66,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -84,7 +84,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -102,7 +102,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -120,7 +120,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl index 7a3a01e..87b133d 100644 --- a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl +++ b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl @@ -16,7 +16,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -38,7 +38,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -60,7 +60,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -82,7 +82,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -104,7 +104,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -126,7 +126,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR @@ -148,7 +148,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 1284924..a21dea7 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -1498,14 +1498,24 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t } } break; - default: + + case H5T_TIME: + case H5T_BITFIELD: + case H5T_OPAQUE: for (block_index = 0; block_index < block_nelmts; block_index++) { mem = ((unsigned char*)_mem) + block_index * size; if (size != HDfwrite(mem, sizeof(char), size, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); - } + } /* end for */ break; - } + + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + /* Badness */ + H5E_THROW(FAIL, H5E_tools_min_id_g, "bad type class"); + break; + } /* end switch */ CATCH return ret_value; @@ -1631,8 +1641,8 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, hsize_t alloc_size; hsize_t *ptdata; int ndims; - hid_t dtype; - hid_t type_id; + hid_t dtype = -1; + hid_t type_id = -1; if((snblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0) H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed"); @@ -1662,10 +1672,10 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, done: HDfree(ptdata); - if(H5Tclose(type_id) < 0) + if(type_id > 0 && H5Tclose(type_id) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - if(H5Tclose(dtype) < 0) + if(dtype > 0 && H5Tclose(dtype) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); H5_LEAVE(TRUE) @@ -1755,8 +1765,8 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id, HERR_INIT(hbool_t, TRUE) hssize_t npoints; int ndims; - hid_t dtype; - hid_t type_id; + hid_t dtype = -1; + hid_t type_id = -1; if((npoints = H5Sget_select_elem_npoints(region_space)) <= 0) H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_select_elem_npoints failed"); @@ -1775,10 +1785,10 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id, stream, container, ndims, type_id, npoints); done: - if(H5Tclose(type_id) < 0) + if(type_id > 0 && H5Tclose(type_id) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - if(H5Tclose(dtype) < 0) + if(dtype > 0 && H5Tclose(dtype) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); H5_LEAVE(ret_value) diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index a05d5ce..2c2a06f 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -368,7 +368,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai } ctx->need_prefix = TRUE; - + if(FALSE == dimension_break) elmt_counter = 0; } /* end for (i = 0; i < nelmts... */ @@ -803,14 +803,15 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, HDassert(cur_ctx); HDassert(buffer); HDassert(ptdata); + HDassert(ndims > 0); HDmemset(&ctx, 0, sizeof(ctx)); /* Allocate space for the dimension array */ - if((dims1 = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if((dims1 = (hsize_t *) HDmalloc(sizeof(hsize_t) * (size_t)ndims)) == NULL) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for dims"); dims1[0] = npoints; - + /* Create dataspace for reading buffer */ if((mem_space = H5Screate_simple(1, dims1, NULL)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed"); @@ -926,8 +927,8 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, hsize_t *ptdata; int ndims; hssize_t indx; - hid_t dtype; - hid_t type_id; + hid_t dtype = -1; + hid_t type_id = -1; HDassert(info); HDassert(ctx); @@ -1048,10 +1049,10 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, done: HDfree(ptdata); - if(H5Tclose(type_id) < 0) + if(type_id > 0 && H5Tclose(type_id) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - if(H5Tclose(dtype) < 0) + if(dtype > 0 && H5Tclose(dtype) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); ctx->need_prefix = TRUE; @@ -1342,7 +1343,7 @@ h5tools_display_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools if (ctx->ndims > 2) { for (i = 0; i < (size_t) ctx->ndims - 2; i++) { - max_start[i] = temp_start[i] + sset->count.data[i]; + max_start[i] = temp_start[i] + sset->count.data[i] * sset->stride.data[i]; temp_count[i] = 1; } } @@ -1384,14 +1385,10 @@ h5tools_display_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools /* increment start dimension */ do { reset_dim = 0; - temp_start[current_outer_dim]++; + temp_start[current_outer_dim] += sset->stride.data[current_outer_dim]; if (temp_start[current_outer_dim] >= max_start[current_outer_dim]) { temp_start[current_outer_dim] = sset->start.data[current_outer_dim]; - /* consider block */ - if (sset->block.data[current_outer_dim] > 1) - temp_start[current_outer_dim]++; - current_outer_dim--; reset_dim = 1; } @@ -1457,7 +1454,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_co if((f_space = H5Dget_space(dset)) < 0) H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); - + if((sndims = H5Sget_simple_extent_ndims(f_space)) < 0) H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); ctx->ndims = (unsigned)sndims; @@ -1743,7 +1740,7 @@ CATCH *------------------------------------------------------------------------- */ int -h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, +h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t dset, struct subset_t *sset) { hid_t f_space = -1; @@ -1819,7 +1816,7 @@ done: *------------------------------------------------------------------------- */ int -h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, +h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t obj_id, hid_t type, hid_t space, void *mem) { HERR_INIT(int, SUCCEED) @@ -1898,18 +1895,18 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ } else h5tools_str_append(buffer, "\"%s\"", obj->objname); - } + } else { error_msg("unknown committed type.\n"); h5tools_setstatus(EXIT_FAILURE); } return ret_value; - } - + } + if (info->line_ncols > 0) ncols = info->line_ncols; - + switch (type_class) { case H5T_INTEGER: if (H5Tequal(type, H5T_STD_I8BE) == TRUE) { @@ -2231,7 +2228,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); } /* end if */ else if(order == H5T_ORDER_BE) { - if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) + if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); } /* end if */ @@ -2262,7 +2259,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); } /* end if */ else if(order == H5T_ORDER_BE) { - if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) + if(H5Tset_order(str_type, H5T_ORDER_BE) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tset_order failed"); } /* end if */ @@ -2336,9 +2333,9 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_str_reset(buffer); h5tools_str_append(buffer, "OPAQUE_TAG \"%s\";", ttag); h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - + H5free_memory(ttag); - } + } ctx->indent_level--; ctx->need_prefix = TRUE; @@ -2352,7 +2349,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ if((snmembers = H5Tget_nmembers(type)) < 0) H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); nmembers = (unsigned)snmembers; - + h5tools_str_append(buffer, "H5T_COMPOUND %s", h5tools_dump_header_format->structblockbegin); h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -2407,7 +2404,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_str_reset(buffer); h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE); - + if(H5Tclose(super) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); @@ -2468,7 +2465,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ /* Close array base type */ if(H5Tclose(super) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - } + } else HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tget_super failed"); @@ -2476,6 +2473,8 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ break; + case H5T_NO_CLASS: + case H5T_NCLASSES: default: h5tools_str_append(buffer, "unknown datatype"); break; @@ -2595,7 +2594,7 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i if (info->line_ncols > 0) ncols = info->line_ncols; - + if((snmembs = H5Tget_nmembers(type)) < 0) H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); nmembs = (unsigned)snmembs; @@ -2735,7 +2734,7 @@ h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, ncols = info->line_ncols; ctx->need_prefix = TRUE; - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->datatypebegin, @@ -2757,7 +2756,7 @@ h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, /*------------------------------------------------------------------------- * Function: dump_dataspace * - * Purpose: Dump the dataspace. + * Purpose: Dump the dataspace. * * Return: void * @@ -2783,7 +2782,7 @@ h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info, ncols = info->line_ncols; ctx->need_prefix = TRUE; - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s ", h5tools_dump_header_format->dataspacebegin); @@ -2833,7 +2832,7 @@ h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s %d %s", OBJID, BEGIN, oid, END); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -2848,11 +2847,6 @@ h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, * Purpose: prints the fill value * * Return: void - * - * Programmer: pvn - * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -2883,15 +2877,11 @@ h5tools_print_fill_value(h5tools_str_t *buffer/*in,out*/, const h5tool_format_t * Purpose: prints several dataset create property list properties * * Return: void - * - * Modifications: pvn, March 28, 2008 - * Add a COMPRESSION ratio information for cases when filters are present - * *------------------------------------------------------------------------- */ void h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, hid_t dcpl_id,hid_t type_id, hid_t obj_id) + h5tools_context_t *ctx, hid_t dcpl_id, hid_t type_id, hid_t obj_id) { int nfilters; /* number of filters */ int rank; /* rank */ @@ -2905,7 +2895,8 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, H5D_fill_value_t fvstatus; H5D_alloc_time_t at; H5D_fill_time_t ft; - size_t ncols = 80; /* available output width */ + H5D_layout_t stl; + size_t ncols = 80; /* available output width */ size_t cd_nelmts; /* filter client number of values */ off_t offset; /* offset of external file */ char f_name[256]; /* filter name */ @@ -2913,8 +2904,8 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, hsize_t chsize[64]; /* chunk size in elements */ hsize_t size; /* size of external file */ hsize_t storage_size; - hsize_t curr_pos = 0; /* total data element position */ - h5tools_str_t buffer; /* string into which to render */ + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -2931,228 +2922,200 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, */ ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", STORAGE_LAYOUT, BEGIN); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - if(H5D_CHUNKED == H5Pget_layout(dcpl_id)) { - ctx->indent_level++; - - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s ", CHUNKED); + stl = H5Pget_layout(dcpl_id); + switch (stl) { + case H5D_CHUNKED: + ctx->indent_level++; + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - rank = H5Pget_chunk(dcpl_id,(int)NELMTS(chsize),chsize); - 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, ", " HSIZE_T_FORMAT, chsize[i]); - h5tools_str_append(&buffer, " %s", h5tools_dump_header_format->dataspacedimend); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s ", CHUNKED); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); + rank = H5Pget_chunk(dcpl_id, (int) NELMTS(chsize), chsize); + 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, ", " HSIZE_T_FORMAT, chsize[i]); + h5tools_str_append(&buffer, " %s", h5tools_dump_header_format->dataspacedimend); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - /* if there are filters, print a compression ratio */ - if(nfilters) { - hsize_t dims[H5S_MAX_RANK]; - hsize_t nelmts = 1; - double ratio = 0; - int ok = 0; - - hid_t tid = H5Dget_type(obj_id); - hid_t sid = H5Dget_space(obj_id); - size_t datum_size = H5Tget_size(tid); - int ndims = H5Sget_simple_extent_dims(sid, dims, NULL); - - /* only print the compression ratio for these filters */ - for(i = 0; i < nfilters && !ok; i++) { - cd_nelmts = NELMTS(cd_values); - filtn = H5Pget_filter2(dcpl_id, (unsigned)i, &filt_flags, &cd_nelmts, - cd_values, sizeof(f_name), f_name, NULL); - ok = (filtn>=0); - - /* this following code will not show compression ratio for - user defined filter. For example, see HDFFV-8344 --xcao@hdfgroup.org - switch(filtn) { - case H5Z_FILTER_DEFLATE: - case H5Z_FILTER_SZIP: - case H5Z_FILTER_NBIT: - case H5Z_FILTER_SCALEOFFSET: - ok = 1; - break; - } - */ - } + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - if(ndims && ok) { - hsize_t uncomp_size; + h5tools_str_reset(&buffer); - for(i = 0; i < ndims; i++) { - nelmts *= dims[i]; + /* if there are filters, print a compression ratio */ + if (nfilters) { + hsize_t dims[H5S_MAX_RANK]; + hsize_t nelmts = 1; + double ratio = 0; + int ok = 0; + + hid_t tid = H5Dget_type(obj_id); + hid_t sid = H5Dget_space(obj_id); + size_t datum_size = H5Tget_size(tid); + int ndims = H5Sget_simple_extent_dims(sid, dims, NULL); + + /* only print the compression ratio for these filters */ + for (i = 0; i < nfilters && !ok; i++) { + cd_nelmts = NELMTS(cd_values); + filtn = H5Pget_filter2(dcpl_id, (unsigned) i, &filt_flags, &cd_nelmts, cd_values, sizeof(f_name), + f_name, NULL); + ok = (filtn >= 0); } - uncomp_size = nelmts * datum_size; - - /* compression ratio = uncompressed size / compressed size */ - - if(storage_size != 0) - ratio = (double) uncomp_size / (double) storage_size; - - h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT" (%.3f:1 COMPRESSION)", storage_size, ratio); - } - else - h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); - - H5Sclose(sid); - H5Tclose(tid); + if(ndims && ok) { + hsize_t uncomp_size; - } - else { - h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); - } - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - - ctx->indent_level--; + for(i = 0; i < ndims; i++) { + nelmts *= dims[i]; + } + uncomp_size = nelmts * datum_size; - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s",END); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - } - else if(H5D_COMPACT == H5Pget_layout(dcpl_id)) { - ctx->indent_level++; + /* compression ratio = uncompressed size / compressed size */ - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s", COMPACT); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + if(storage_size != 0) + ratio = (double) uncomp_size / (double) storage_size; - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT" (%.3f:1 COMPRESSION)", storage_size, ratio); - ctx->indent_level--; + } + else + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s",END); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - } - else if(H5D_CONTIGUOUS == H5Pget_layout(dcpl_id)) { - int next; + H5Sclose(sid); + H5Tclose(tid); - next = H5Pget_external_count(dcpl_id); + } + else { + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); + } + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - /*------------------------------------------------------------------------- - * EXTERNAL_FILE - *------------------------------------------------------------------------- - */ - if(next) { + ctx->indent_level--; + break; + case H5D_COMPACT: ctx->indent_level++; - ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s", CONTIGUOUS); + h5tools_str_append(&buffer, "%s", COMPACT); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s %s", EXTERNAL, BEGIN); + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->indent_level++; - for(j = 0; j < (unsigned)next; j++) { - H5Pget_external(dcpl_id, j, sizeof(name), name, &offset, &size); - - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - 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, (size_t)ncols, (hsize_t)0, (hsize_t)0); - } ctx->indent_level--; + break; + case H5D_CONTIGUOUS: + { + int next; + + next = H5Pget_external_count(dcpl_id); + + /*------------------------------------------------------------------------- + * EXTERNAL_FILE + *------------------------------------------------------------------------- + */ + ctx->indent_level++; + if (next) { + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s",END); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", CONTIGUOUS); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->indent_level--; + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s",END); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - } - else { - haddr_t ioffset; + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s %s", EXTERNAL, BEGIN); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->indent_level++; + ctx->indent_level++; + for (j = 0; j < (unsigned) next; j++) { + H5Pget_external(dcpl_id, j, sizeof(name), name, &offset, &size); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s", CONTIGUOUS); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer,"SIZE " HSIZE_T_FORMAT, storage_size); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + h5tools_str_reset(&buffer); + 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, (size_t)ncols, (hsize_t)0, (hsize_t)0); + } + ctx->indent_level--; - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - ioffset = H5Dget_offset(obj_id); - h5tools_str_append(&buffer,"OFFSET "H5_PRINTF_HADDR_FMT, ioffset); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - ctx->indent_level--; + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); + } + else { + haddr_t ioffset; - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", CONTIGUOUS); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer,"SIZE " HSIZE_T_FORMAT, storage_size); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + ioffset = H5Dget_offset(obj_id); + h5tools_str_append(&buffer, "OFFSET "H5_PRINTF_HADDR_FMT, ioffset); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); + } + ctx->indent_level--; + } + break; + + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: + default: h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s",END); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - } - } - /*------------------------------------------------------------------------- + h5tools_str_append(&buffer, "%s", "Unknown layout"); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); + }/*switch*/ + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + + /*------------------------------------------------------------------------- * FILTERS *------------------------------------------------------------------------- */ ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", FILTERS, BEGIN); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3164,13 +3127,13 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, cd_nelmts = NELMTS(cd_values); filtn = H5Pget_filter2(dcpl_id, (unsigned)i, &filt_flags, &cd_nelmts, cd_values, sizeof(f_name), f_name, NULL); - - if (filtn<0) - continue; /* nothing to print for invalid filter */ + + if (filtn<0) + continue; /* nothing to print for invalid filter */ ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); switch(filtn) { case H5Z_FILTER_DEFLATE: @@ -3197,14 +3160,14 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "PIXELS_PER_BLOCK %d", szip_pixels_per_block); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); if(szip_options_mask & H5_SZIP_CHIP_OPTION_MASK) h5tools_str_append(&buffer, "MODE %s", "HARDWARE"); @@ -3214,7 +3177,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); if(szip_options_mask & H5_SZIP_EC_OPTION_MASK) h5tools_str_append(&buffer, "CODING %s", "ENTROPY"); @@ -3224,7 +3187,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); if(szip_options_mask & H5_SZIP_LSB_OPTION_MASK) h5tools_str_append(&buffer, "BYTE_ORDER %s", "LSB"); @@ -3235,7 +3198,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, if(szip_options_mask & H5_SZIP_RAW_OPTION_MASK) { ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "HEADER %s", "RAW"); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3245,9 +3208,9 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s",END); + h5tools_str_append(&buffer, "%s", END); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); } break; @@ -3260,12 +3223,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); break; default: - /* filter do not have to be avaiable for showing registered filter info. - see HDFFV-8346 for details. --xcao@hdfgroup.org - if(H5Zfilter_avail(filtn)) - h5tools_str_append(&buffer, "%s %s", "USER_REGISTERED_FILTER", BEGIN); - else - */ h5tools_str_append(&buffer, "%s %s", "USER_DEFINED_FILTER", BEGIN); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3273,15 +3230,15 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "FILTER_ID %d", filtn); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - + if(f_name[0] != '\0') { ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "COMMENT %s", f_name); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3289,7 +3246,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, if (cd_nelmts) { ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ","PARAMS", BEGIN); for (j=0; j<cd_nelmts; j++) @@ -3301,7 +3258,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s",END); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3313,7 +3270,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "NONE"); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3322,7 +3279,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s",END); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3333,7 +3290,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, */ ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", FILLVALUE, BEGIN); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3342,10 +3299,10 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "FILL_TIME "); - + H5Pget_fill_time(dcpl_id, &ft); switch(ft) { case H5D_FILL_TIME_ALLOC: @@ -3357,6 +3314,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, case H5D_FILL_TIME_IFSET: h5tools_str_append(&buffer, "%s", "H5D_FILL_TIME_IFSET"); break; + case H5D_FILL_TIME_ERROR: default: HDassert(0); break; @@ -3365,23 +3323,33 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s ", "VALUE "); H5Pfill_value_defined(dcpl_id, &fvstatus); - if(fvstatus == H5D_FILL_VALUE_UNDEFINED) - h5tools_str_append(&buffer, "%s", "H5D_FILL_VALUE_UNDEFINED"); - else { - ctx->indent_level--; - h5tools_print_fill_value(&buffer, info, ctx, dcpl_id, type_id, obj_id); - ctx->indent_level++; + switch (fvstatus) { + case H5D_FILL_VALUE_UNDEFINED: + h5tools_str_append(&buffer, "%s", "H5D_FILL_VALUE_UNDEFINED"); + break; + case H5D_FILL_VALUE_DEFAULT: + h5tools_str_append(&buffer, "%s", "H5D_FILL_VALUE_DEFAULT"); + break; + case H5D_FILL_VALUE_USER_DEFINED: + ctx->indent_level--; + h5tools_print_fill_value(&buffer, info, ctx, dcpl_id, type_id, obj_id); + ctx->indent_level++; + break; + case H5D_FILL_VALUE_ERROR: + default: + HDassert(0); + break; } h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->indent_level--; ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3392,7 +3360,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, */ ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "ALLOCATION_TIME %s", BEGIN); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3401,7 +3369,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); H5Pget_alloc_time(dcpl_id, &at); switch(at) { @@ -3424,7 +3392,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3474,7 +3442,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, comment[cmt_bufsize] = '\0'; /* necessary because null char is not returned */ ctx->need_prefix = TRUE; - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "COMMENT \"%s\"", comment); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3489,7 +3457,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, /*------------------------------------------------------------------------- * Function: dump_attribute * - * Purpose: Dump the attribute. + * Purpose: Dump the attribute. * * Return: void * @@ -3498,7 +3466,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, */ void h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, const char *attr_name, hid_t attr_id, + h5tools_context_t *ctx, const char *attr_name, hid_t attr_id, int display_index, int display_char) { h5tools_str_t buffer; /* string into which to render */ @@ -3517,7 +3485,7 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s \"%s\" %s", h5tools_dump_header_format->attributebegin, attr_name, @@ -3526,7 +3494,7 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, if(attr_id < 0) { error_msg("unable to open attribute \"%s\"\n", attr_name); - } + } else { hid_t type, space; @@ -3553,7 +3521,7 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); - + h5tools_str_reset(&buffer); if (HDstrlen(h5tools_dump_header_format->attributeblockend)) { @@ -3609,36 +3577,36 @@ void h5tools_print_packed_bits(h5tools_str_t *buffer, hid_t type) { int packed_bits_size = 0; - + hid_t n_type = h5tools_get_native_type(type); if(H5Tget_class(n_type)==H5T_INTEGER) { if(H5Tequal(n_type, H5T_NATIVE_SCHAR) == TRUE) { packed_bits_size = 8 * sizeof(char); - } + } else if(H5Tequal(n_type, H5T_NATIVE_UCHAR) == TRUE) { packed_bits_size = 8 * sizeof(unsigned char); - } + } else if(H5Tequal(n_type, H5T_NATIVE_SHORT) == TRUE) { packed_bits_size = 8 * sizeof(short); - } + } else if(H5Tequal(n_type, H5T_NATIVE_USHORT) == TRUE) { packed_bits_size = 8 * sizeof(unsigned short); - } + } else if(H5Tequal(n_type, H5T_NATIVE_INT) == TRUE) { packed_bits_size = 8 * sizeof(int); - } + } else if(H5Tequal(n_type, H5T_NATIVE_UINT) == TRUE) { packed_bits_size = 8 * sizeof(unsigned int); - } + } else if(H5Tequal(n_type, H5T_NATIVE_LONG) == TRUE) { packed_bits_size = 8 * sizeof(long); - } + } else if(H5Tequal(n_type, H5T_NATIVE_ULONG) == TRUE) { packed_bits_size = 8 * sizeof(unsigned long); - } + } else if(H5Tequal(n_type, H5T_NATIVE_LLONG) == TRUE) { packed_bits_size = 8 * sizeof(long long); - } + } else if(H5Tequal(n_type, H5T_NATIVE_ULLONG) == TRUE) { packed_bits_size = 8 * sizeof(unsigned long long); } @@ -3679,25 +3647,25 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, HDmemset(&buffer, 0, sizeof(h5tools_str_t)); if (info->line_ncols > 0) ncols = info->line_ncols; - + ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->subsettingbegin, h5tools_dump_header_format->subsettingblockbegin); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->indent_level++; - + ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); - + h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->startbegin, h5tools_dump_header_format->startblockbegin); h5tools_print_dims(&buffer, sset->start.data, dims); h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->startend, h5tools_dump_header_format->startblockend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - + ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); @@ -3706,7 +3674,7 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tools_print_dims(&buffer, sset->stride.data, dims); h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->strideend, h5tools_dump_header_format->strideblockend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - + ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); @@ -3720,7 +3688,7 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->countend, h5tools_dump_header_format->countblockend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - + ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, (hsize_t)0, 0); @@ -3734,7 +3702,7 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->blockend, h5tools_dump_header_format->blockblockend); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - + ctx->indent_level--; h5tools_str_close(&buffer); @@ -3751,7 +3719,7 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, */ void h5tools_dump_data(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, hid_t obj_id, int obj_data, struct subset_t *sset, + h5tools_context_t *ctx, hid_t obj_id, int obj_data, struct subset_t *sset, int display_index, int display_char) { H5S_class_t space_type; @@ -3814,10 +3782,10 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_dump_subsetting_header(stream, &outputformat, ctx, sset, H5Sget_simple_extent_ndims(f_space)); H5Sclose(f_space); - + ctx->indent_level++; } - + ctx->need_prefix = TRUE; h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->databegin, h5tools_dump_header_format->datablockbegin); @@ -3843,7 +3811,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, datactx.indent_level++; datactx.need_prefix = TRUE; h5tools_simple_prefix(stream, info, &datactx, (hsize_t)0, 0); - + string_dataformat = *info; string_dataformat.idx_fmt = "\""; string_dataformat.line_multi_new = 1; @@ -3911,7 +3879,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, datactx.indent_level++; datactx.need_prefix = TRUE; h5tools_simple_prefix(stream, info, &datactx, (hsize_t)0, 0); - + string_dataformat = *info; string_dataformat.idx_fmt = "\""; string_dataformat.line_multi_new = 1; @@ -3938,7 +3906,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); HDfree(buf); - } + } else status = SUCCEED; @@ -3968,10 +3936,10 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, if (sset && obj_data) { ctx->indent_level--; - + ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, &outputformat, ctx, (hsize_t)0, 0); - + h5tools_str_reset(&buffer); if(HDstrlen(h5tools_dump_header_format->subsettingblockend)) { h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->subsettingblockend); diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 1142424..a92568a 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -1058,6 +1058,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, H5_TOOLS_DATATYPE); break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: default: h5tools_str_append(str, "%u-", (unsigned) oi.type); break; @@ -1187,7 +1189,9 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } break; - default: + case H5T_TIME: + case H5T_BITFIELD: + case H5T_OPAQUE: { /* All other types get printed as hexadecimal */ size_t i; @@ -1200,6 +1204,12 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } } break; + + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + h5tools_str_append(str, "invalid datatype"); + break; } /* end switch */ } return h5tools_str_fmt(str, start, OPT(info->elmt_fmt, "%s")); @@ -1388,13 +1398,12 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac char *head = NULL; if ( substr == NULL || replacement == NULL ) - return HDstrdup (string); - + return HDstrdup (string); newstr = HDstrdup (string); head = newstr; while ( (tok = HDstrstr ( head, substr ))){ oldstr = newstr; - newstr = HDmalloc ( HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) + 1 ); + newstr = (char *)HDmalloc( HDstrlen( oldstr ) - HDstrlen( substr ) + HDstrlen( replacement ) + 1 ); if ( newstr == NULL ){ HDfree (oldstr); diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 572090b..b87abf6 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -177,7 +177,7 @@ warn_msg(const char *fmt, ...) /*------------------------------------------------------------------------- * Function: help_ref_msg * - * Purpose: Print a message to refer help page + * Purpose: Print a message to refer help page * * Return: Nothing * @@ -224,7 +224,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti /* check for more flag-like tokens */ if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') { return EOF; - } + } else if (HDstrcmp(argv[opt_ind], "--") == 0) { opt_ind++; return EOF; @@ -248,10 +248,10 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti opt_arg = &arg[len + 1]; } else if (l_opts[i].has_arg != optional_arg) { - if (opt_ind < (argc - 1)) + if (opt_ind < (argc - 1)) if (argv[opt_ind + 1][0] != '-') opt_arg = argv[++opt_ind]; - } + } else if (l_opts[i].has_arg == require_arg) { if (opt_err) HDfprintf(rawerrorstream, @@ -262,7 +262,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti } else opt_arg = NULL; - } + } else { if (arg[len] == '=') { if (opt_err) @@ -288,7 +288,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti opt_ind++; sp = 1; - } + } else { register char *cp; /* pointer into current token */ @@ -313,7 +313,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (argv[opt_ind][sp + 1] != '\0') { /* flag value is rest of current token */ opt_arg = &argv[opt_ind++][sp + 1]; - } + } else if (++opt_ind >= argc) { if (opt_err) HDfprintf(rawerrorstream, @@ -321,7 +321,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti argv[0], opt_opt); opt_opt = '?'; - } + } else { /* flag value is next token */ opt_arg = argv[opt_ind++]; @@ -334,8 +334,13 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti /* check the next argument */ opt_ind++; /* we do have an extra argument, check if not last */ - if ( argv[opt_ind][0] != '-' && (opt_ind+1) < argc ) { - opt_arg = argv[opt_ind++]; + if ( (opt_ind+1) < argc ) { + if ( argv[opt_ind][0] != '-' ) { + opt_arg = argv[opt_ind++]; + } + else { + opt_arg = NULL; + } } else { opt_arg = NULL; @@ -376,7 +381,7 @@ indentation(int x) if (x < h5tools_nCols) { while (x-- > 0) PRINTVALSTREAM(rawoutstream, " "); - } + } else { HDfprintf(rawerrorstream, "error: the indentation exceeds the number of cols.\n"); HDexit(1); @@ -482,11 +487,10 @@ dump_table(char* tablename, table_t *table) unsigned u; PRINTSTREAM(rawoutstream,"%s: # of entries = %d\n", tablename,table->nobjs); - for (u = 0; u < table->nobjs; u++) { + for (u = 0; u < table->nobjs; u++) PRINTSTREAM(rawoutstream,"%a %s %d %d\n", table->objs[u].objno, table->objs[u].objname, table->objs[u].displayed, table->objs[u].recorded); - } } @@ -613,7 +617,10 @@ find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen } /* end if */ break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: default: + HDassert(0); break; } /* end switch */ @@ -719,7 +726,7 @@ tmpfile(void) /*------------------------------------------------------------------------- * Function: H5tools_get_symlink_info * - * Purpose: Get symbolic link (soft, external) info and its target object type + * Purpose: Get symbolic link (soft, external) info and its target object type (dataset, group, named datatype) and path, if exist * * Patameters: @@ -727,9 +734,9 @@ tmpfile(void) * - [IN] linkpath : link path * - [OUT] link_info: returning target object info (h5tool_link_info_t) * - * Return: - * 2 : given pathname is object - * 1 : Succed to get link info. + * Return: + * 2 : given pathname is object + * 1 : Succed to get link info. * 0 : Detected as a dangling link * -1 : H5 API failed. * @@ -793,7 +800,7 @@ H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_ } /* end if */ /*----------------------------------------------------- - * if link type is external link use different lapl to + * if link type is external link use different lapl to * follow object in other file */ if(link_info->linfo.type == H5L_TYPE_EXTERNAL) { @@ -814,7 +821,7 @@ H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_ */ /* check if target object exist */ l_ret = H5Oexists_by_name(file_id, linkpath, lapl); - + /* detect dangling link */ if(l_ret == FALSE) { ret = 0; @@ -822,7 +829,7 @@ H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_ } /* end if */ /* function failed */ else if(l_ret < 0) - goto out; + goto out; /* get target object info */ if(H5Oget_info_by_name(file_id, linkpath, &trg_oinfo, lapl) < 0) { @@ -887,8 +894,8 @@ int h5tools_getstatus(void) } /*----------------------------------------------------------- - * PURPOSE : - * if environment variable H5TOOLS_BUFSIZE is set, + * PURPOSE : + * if environment variable H5TOOLS_BUFSIZE is set, * update H5TOOLS_BUFSIZE and H5TOOLS_MALLOCSIZE from the env * This can be called from each tools main() as part of initial act. * Note: this is more of debugging purpose for now. @@ -905,11 +912,11 @@ int h5tools_getenv_update_hyperslab_bufsize(void) hyperslab_bufsize_mb = HDstrtol(env_str, (char**)NULL, 10); if (errno != 0 || hyperslab_bufsize_mb <= 0) { - - /* TODO: later when pubilshed + + /* TODO: later when pubilshed HDfprintf(rawerrorstream,"Error: Invalid environment variable \"H5TOOLS_BUFSIZE\" : %s\n", env_str); */ - + goto error; } diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt index 444dd97..c80999e 100644 --- a/tools/testfiles/h5dump-help.txt +++ b/tools/testfiles/h5dump-help.txt @@ -11,7 +11,7 @@ usage: h5dump [OPTIONS] files -o F, --output=F Output raw data into file F -b B, --binary=B Binary file output, of form B -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display + Use blank(empty) filename F to suppress ddl display --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl index 64a2880..c16fdf9 100644 --- a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl +++ b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl @@ -11,7 +11,7 @@ usage: h5dump [OPTIONS] files -o F, --output=F Output raw data into file F -b B, --binary=B Binary file output, of form B -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display + Use blank(empty) filename F to suppress ddl display --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/pbits/tpbitsIncomplete.ddl b/tools/testfiles/pbits/tpbitsIncomplete.ddl index cdb1f91..0a9d38c 100644 --- a/tools/testfiles/pbits/tpbitsIncomplete.ddl +++ b/tools/testfiles/pbits/tpbitsIncomplete.ddl @@ -11,7 +11,7 @@ usage: h5dump [OPTIONS] files -o F, --output=F Output raw data into file F -b B, --binary=B Binary file output, of form B -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display + Use blank(empty) filename F to suppress ddl display --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl index 6d2492a..796f0f9 100644 --- a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl @@ -11,7 +11,7 @@ usage: h5dump [OPTIONS] files -o F, --output=F Output raw data into file F -b B, --binary=B Binary file output, of form B -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display + Use blank(empty) filename F to suppress ddl display --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/pbits/tpbitsLengthPositive.ddl b/tools/testfiles/pbits/tpbitsLengthPositive.ddl index 4f56619..55a0e76 100644 --- a/tools/testfiles/pbits/tpbitsLengthPositive.ddl +++ b/tools/testfiles/pbits/tpbitsLengthPositive.ddl @@ -11,7 +11,7 @@ usage: h5dump [OPTIONS] files -o F, --output=F Output raw data into file F -b B, --binary=B Binary file output, of form B -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display + Use blank(empty) filename F to suppress ddl display --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl index 3432433..89901c6 100644 --- a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl @@ -11,7 +11,7 @@ usage: h5dump [OPTIONS] files -o F, --output=F Output raw data into file F -b B, --binary=B Binary file output, of form B -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display + Use blank(empty) filename F to suppress ddl display --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl index e51a09e..51777d8 100644 --- a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl +++ b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl @@ -11,7 +11,7 @@ usage: h5dump [OPTIONS] files -o F, --output=F Output raw data into file F -b B, --binary=B Binary file output, of form B -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display + Use blank(empty) filename F to suppress ddl display --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl index ba6e46d..e76ff7f 100644 --- a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl +++ b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl @@ -11,7 +11,7 @@ usage: h5dump [OPTIONS] files -o F, --output=F Output raw data into file F -b B, --binary=B Binary file output, of form B -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display + Use blank(empty) filename F to suppress ddl display --------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the diff --git a/tools/testfiles/tallfilters.ddl b/tools/testfiles/tallfilters.ddl index ac6762a..ff2454c 100644 --- a/tools/testfiles/tallfilters.ddl +++ b/tools/testfiles/tallfilters.ddl @@ -21,7 +21,7 @@ DATASET "all" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tchunked.ddl b/tools/testfiles/tchunked.ddl index b68b233..bf620fe 100644 --- a/tools/testfiles/tchunked.ddl +++ b/tools/testfiles/tchunked.ddl @@ -12,7 +12,7 @@ COMMENT "This is a dataset with chunked storage" } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tcompact.ddl b/tools/testfiles/tcompact.ddl index 918e2eb..977f959 100644 --- a/tools/testfiles/tcompact.ddl +++ b/tools/testfiles/tcompact.ddl @@ -12,7 +12,7 @@ COMMENT "This is a dataset with compact storage" } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_EARLY diff --git a/tools/testfiles/tcontiguos.ddl b/tools/testfiles/tcontiguos.ddl index 8e0158e..3f045e5 100644 --- a/tools/testfiles/tcontiguos.ddl +++ b/tools/testfiles/tcontiguos.ddl @@ -13,7 +13,7 @@ COMMENT "This is a dataset with contiguous storage" } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_LATE diff --git a/tools/testfiles/tdeflate.ddl b/tools/testfiles/tdeflate.ddl index 5603911..9b92d0e 100644 --- a/tools/testfiles/tdeflate.ddl +++ b/tools/testfiles/tdeflate.ddl @@ -11,7 +11,7 @@ DATASET "deflate" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/texternal.ddl b/tools/testfiles/texternal.ddl index 279831a..59cd22c 100644 --- a/tools/testfiles/texternal.ddl +++ b/tools/testfiles/texternal.ddl @@ -14,7 +14,7 @@ DATASET "external" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_LATE diff --git a/tools/testfiles/tfill.ddl b/tools/testfiles/tfill.ddl index 45497fd..556f4f2 100644 --- a/tools/testfiles/tfill.ddl +++ b/tools/testfiles/tfill.ddl @@ -13,7 +13,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE [ 0, 0, 0 ] + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_LATE @@ -136,7 +136,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_ALLOC - VALUE () + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_LATE @@ -158,7 +158,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_LATE diff --git a/tools/testfiles/tfletcher32.ddl b/tools/testfiles/tfletcher32.ddl index c341ded..01460e2 100644 --- a/tools/testfiles/tfletcher32.ddl +++ b/tools/testfiles/tfletcher32.ddl @@ -11,7 +11,7 @@ DATASET "fletcher32" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tnbit.ddl b/tools/testfiles/tnbit.ddl index bd32eaa..fd5d1cf 100644 --- a/tools/testfiles/tnbit.ddl +++ b/tools/testfiles/tnbit.ddl @@ -11,7 +11,7 @@ DATASET "nbit" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tscaleoffset.ddl b/tools/testfiles/tscaleoffset.ddl index ba49c70..a039736 100644 --- a/tools/testfiles/tscaleoffset.ddl +++ b/tools/testfiles/tscaleoffset.ddl @@ -11,7 +11,7 @@ DATASET "scaleoffset" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tshuffle.ddl b/tools/testfiles/tshuffle.ddl index 5c183fe..b0477db 100644 --- a/tools/testfiles/tshuffle.ddl +++ b/tools/testfiles/tshuffle.ddl @@ -11,7 +11,7 @@ DATASET "shuffle" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tszip.ddl b/tools/testfiles/tszip.ddl index 6fdd92f..06e2259 100644 --- a/tools/testfiles/tszip.ddl +++ b/tools/testfiles/tszip.ddl @@ -17,7 +17,7 @@ DATASET "szip" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tuserfilter.ddl b/tools/testfiles/tuserfilter.ddl index 24745b9..f77fb17 100644 --- a/tools/testfiles/tuserfilter.ddl +++ b/tools/testfiles/tuserfilter.ddl @@ -15,7 +15,7 @@ DATASET "myfilter" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE H5D_FILL_VALUE_DEFAULT } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR |