summaryrefslogtreecommitdiffstats
path: root/tools/h5ls/h5ls.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5ls/h5ls.c')
-rw-r--r--tools/h5ls/h5ls.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index 06445fb..44ad6ad 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -759,6 +759,7 @@ display_enum_type(hid_t type, int ind)
{
char **name=NULL; /* member names */
unsigned char *value=NULL; /* value array */
+ unsigned char *copy = NULL; /* a pointer to value array */
unsigned nmembs; /* number of members */
int nchars; /* number of output characters */
hid_t super; /* enum base integer type */
@@ -816,11 +817,17 @@ display_enum_type(hid_t type, int ind)
for (j=0; j<dst_size; j++)
printf("%02x", value[i*dst_size+j]);
} else if (H5T_SGN_NONE==H5Tget_sign(native)) {
+ /*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;
HDfprintf(stdout,"%"H5_PRINTF_LL_WIDTH"u",
- *((unsigned long_long*)((void*)(value+i*dst_size))));
+ *((unsigned long_long*)((void*)copy)));
} else {
+ /*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;
HDfprintf(stdout,"%"H5_PRINTF_LL_WIDTH"d",
- *((long_long*)((void*)(value+i*dst_size))));
+ *((long_long*)((void*)copy)));
}
}