diff options
-rw-r--r-- | tools/h5dump/h5dump.c | 3 | ||||
-rw-r--r-- | tools/lib/h5tools.h | 3 | ||||
-rw-r--r-- | tools/lib/h5tools_str.c | 8 |
3 files changed, 10 insertions, 4 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 97644bf..fbe7c75 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -96,6 +96,7 @@ static int xml_name_to_XID(const char *, char *, int , int ); static void init_prefix(char **prfx, size_t prfx_len); static void add_prefix(char **prfx, size_t *prfx_len, const char *name); + static h5tool_format_t dataformat = { 0, /*raw */ @@ -2116,7 +2117,7 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index) outputformat->pindex=display_index; if (outputformat->pindex) { outputformat->idx_fmt = "(%s): "; - outputformat->idx_n_fmt = "%lu"; + outputformat->idx_n_fmt = HSIZE_T_FORMAT; outputformat->idx_sep = ","; outputformat->line_pre = "%s"; } diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 70d8734..a86b9cd 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -46,6 +46,9 @@ */ #define H5TOOLS_MALLOCSIZE ((size_t)1024 * 1024 * 1024) +/* format for hsize_t */ +#define HSIZE_T_FORMAT "%"H5_PRINTF_LL_WIDTH"u" + /* * Information about how to format output. */ diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 76bb81f..a1cfc83 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -28,6 +28,7 @@ #include "h5tools_ref.h" #include "h5tools_str.h" /*function prototypes */ + /* * If REPEAT_VERBOSE is defined then character strings will be printed so * that repeated character sequences like "AAAAAAAAAA" are displayed as @@ -335,12 +336,13 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, if (i) h5tools_str_append(str, "%s", OPT(info->idx_sep, ",")); - h5tools_str_append(str, OPT(info->idx_n_fmt, "%lu"), - (unsigned long)ctx->pos[i]); + h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), + (hsize_t)ctx->pos[i]); + } } else { /* Scalar */ - h5tools_str_append(str, OPT(info->idx_n_fmt, "%lu"), (unsigned long)0); + h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t)0); } /* Add prefix and suffix to the index */ |