summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5dump/h5dump.c')
-rw-r--r--tools/h5dump/h5dump.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index e370478..eabbd61 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -1948,8 +1948,15 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int pindex)
if(space_type == H5S_NULL || space_type == H5S_NO_CLASS || space_type == H5S_COMPLEX) {
status = SUCCEED;
} else {
+ H5T_class_t type_class;
+
type = H5Aget_type(obj_id);
- p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT);
+ type_class = H5Tget_class(type);
+ if(type_class==H5T_BITFIELD)
+ p_type=H5Tcopy(type);
+ else
+ p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT);
+
ndims = H5Sget_simple_extent_dims(space, size, NULL);
for (i = 0; i < ndims; i++)
@@ -2061,10 +2068,17 @@ static void dump_fill_value(hid_t dcpl,hid_t type_id, hid_t obj_id)
int nelmts=1;
h5dump_t *outputformat = &dataformat;
hid_t n_type;
+ H5T_class_t type_class;
memset(&ctx, 0, sizeof(ctx));
ctx.indent_level=2;
- n_type = H5Tget_native_type(type_id,H5T_DIR_DEFAULT);
+
+ type_class = H5Tget_class(type_id);
+ if(type_class==H5T_BITFIELD)
+ n_type=H5Tcopy(type_id);
+ else
+ n_type = H5Tget_native_type(type_id,H5T_DIR_DEFAULT);
+
size = H5Tget_size(n_type);
buf = malloc(size);
@@ -4835,7 +4849,14 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU
status = xml_print_strs(obj_id, ATTRIBUTE_DATA);
} else {
/* all other data */
- p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT);
+ H5T_class_t type_class;
+
+ type_class = H5Tget_class(type);
+ if(type_class==H5T_BITFIELD)
+ p_type=H5Tcopy(type);
+ else
+ p_type = H5Tget_native_type(type,H5T_DIR_DEFAULT);
+
H5Tclose(type);
space = H5Aget_space(obj_id);