From 307cb5da4863b3d29fc5d1b97bc01034fc5161dd Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 27 Nov 2019 13:58:43 -0600 Subject: Squash my changes on branch `fprintf-experiment` into one commit for reapplication to my new warnings branch, `warnings-again`. These changes are included: commit 915551b7bf64e777dd2007386ec77b1d117770da Merge: 63858c2 a8892bb Author: David Young Date: Mon Nov 25 17:39:49 2019 -0600 Merge remote-tracking branch 'hdf5/develop' into fprintf-experiment commit a8892bb42d6f6e4fbc30fae0eb2b957f81c938b9 Merge: 5c911d8 f907b51 Author: David Young Date: Mon Nov 25 17:33:54 2019 -0600 Merge pull request #2055 in HDFFV/hdf5 from ~DYOUNG/vchoi_fork:add-werror-and-squash-some to develop * commit 'f907b511d06612dafc7814a7c30f2f3d2b76d52b': Oops, remove more C99 designated initializers for VS 2010 compatibility. commit 63858c22e168acaec0af8ced6641f26102cc6bb0 Merge: 20ae787 5c911d8 Author: David Young Date: Mon Nov 25 17:04:42 2019 -0600 Merge remote-tracking branch 'hdf5/develop' into fprintf-experiment commit 5c911d8baf3ee7fe654269088eebdf07f59a8192 Merge: b8a5671 62208b0 Author: David Young Date: Mon Nov 25 16:58:27 2019 -0600 Merge pull request #2030 in HDFFV/hdf5 from ~DYOUNG/vchoi_fork:add-werror-and-squash-some to develop * commit '62208b056a09c01855fbac7f75146be58ad6bfe5': (44 commits) Add an #include to get a function declaration. Don't use C99 designated initializers, they're not compatible with Visual Studio 2010. Quiet some more maybe-uninitialized warnings---each is a false positive, *sigh*. This is more code that may not compile with VS2010, *sigh sigh*. Always warn on maybe-uninitialized. -Wincompatible-pointer-types was not available until GCC 5, so enable it only if that's the GCC version we're using. Only promote maybe-uninitialized warnings to errors on GCC 8. Even on GCC 8, there may be false positives at low optimization levels? I need to check. Only use -Werror=cast-function-type with GCC 8 and later. Put all of the -W options back into the order I found them in so that it's easier to compare old and new config/gnu-flags. Add new source files to CMakeLists.txt. Mention the -Werror= flags in libhdf5.settings.in. free -> HDfree Promote decleration-after-statement warnings to errors. Quiet decleration-after-statement warnings. Move a statement under some declarations since some vintages of Visual Studio don't like declarations after statements. Document H5D__chunk_mem_xfree_wrapper(). Undo accidental test deletion. Oops, delete a debug printf that snuck in here. Undo my changes to the HD macros, hadn't really intended those to be on this branch.... Make errors of some more warnings. Move disabled warnings to DEVELOPER_WARNING_CFLAGS. Put just one warning option on a line, and sort some of the options. Cast to the parameter type, H5VL_token_t *, instead of to unsigned char *. Change hdset_reg_ref_t and H5R_ref_t from arrays of unsigned char to structs containing those arrays. Encapsulating the arrays in this way makes it easier to write and think about pointers to these types, casts to/from these types, etc. ... commit 20ae7877e33931b95e8c3502b027d6c3fe94a11f Merge: 46f8c61 edd5297 Author: David Young Date: Fri Nov 22 15:34:09 2019 -0600 Merge remote-tracking branch 'origin/add-werror-and-squash-some' into fprintf-experiment commit 46f8c613d5117a8be5bc8385a072daa0b4262f06 Author: David Young Date: Fri Nov 22 15:29:00 2019 -0600 GCC really wants us to use `ll` to format `long long`, so try to make that work before any other format modifier. Seems like we're not compiling the autoconf test program with -Werror=format ? Probably should. commit eee35b8ef3759c391327cd48a9b3c56b6f8abc99 Author: David Young Date: Fri Nov 22 15:28:05 2019 -0600 It's hard to know just how wide an HDoff_t will be, and I don't think POSIX or C standards provide a PRI macro for it, so cast to intmax_t and format using PRIdMAX. commit 86eab12df7a89b546a38e99f8178dd2adbcb3433 Author: David Young Date: Fri Nov 22 15:26:25 2019 -0600 URemove some casts.se the right format string for the argument. Here and there stop casting a printf argument. commit f722f7cbecbaa99449941484b014426f62f1bed5 Merge: 58e3743 6d5ec83 Author: David Young Date: Fri Nov 22 14:44:16 2019 -0600 Merge branch 'add-werror-and-squash-some' into fprintf-experiment commit 58e3743b7faa9836606ee91798fe80dfc0040da7 Author: David Young Date: Wed Nov 20 21:07:21 2019 -0600 Remove custom HDfprintf implementation, using the standard library's, instead. Take a swipe at repairing fprintf format strings, mainly replacing "%Hu" with "%" PRIuHSIZE, "%a" with "%" PRIuHADDR, "%Zu" with "%zu". Here and there remove an awkward cast of a printf argument to `long long` and use PRI[doux]8, PRI[doux]32, or PRI[doux]64, instead. Change occurrences of "%t" to "%s" and perform a suitable change of argument, `cond` -> `cond ? "TRUE" : "FALSE"`. Some occurrences of %Hu, %a, and %t remain, they just weren't flagged by the compiler because of #ifdef'age. commit d4366909293fa970c23512ac80e5d865d76cddbf Author: David Young Date: Wed Nov 20 20:54:32 2019 -0600 Promote format-string warnigns to errors. --- configure.ac | 2 +- hl/tools/h5watch/h5watch.c | 4 +- src/H5Abtree2.c | 8 +- src/H5B2dbg.c | 8 +- src/H5B2test.c | 4 +- src/H5Bdbg.c | 10 +- src/H5C.c | 10 +- src/H5Cdbg.c | 12 +- src/H5Dbtree.c | 4 +- src/H5Dbtree2.c | 10 +- src/H5Dchunk.c | 4 +- src/H5Ddbg.c | 2 +- src/H5Dearray.c | 10 +- src/H5Dfarray.c | 10 +- src/H5Dnone.c | 2 +- src/H5Dsingle.c | 2 +- src/H5E.c | 31 --- src/H5EAdbg.c | 36 ++-- src/H5Eint.c | 31 --- src/H5FAdbg.c | 24 +-- src/H5FDlog.c | 34 ++-- src/H5FDs3comms.c | 4 +- src/H5FSdbg.c | 16 +- src/H5Fdbg.c | 10 +- src/H5Gent.c | 6 +- src/H5HFbtree2.c | 8 +- src/H5HFdbg.c | 78 ++++---- src/H5HFdblock.c | 2 +- src/H5HLdbg.c | 6 +- src/H5MFdbg.c | 14 +- src/H5Oainfo.c | 16 +- src/H5Oattr.c | 6 +- src/H5Ocache_image.c | 4 +- src/H5Ocont.c | 2 +- src/H5Odbg.c | 20 +- src/H5Odrvinfo.c | 2 +- src/H5Oefl.c | 18 +- src/H5Ofill.c | 2 +- src/H5Ofsinfo.c | 14 +- src/H5Oint.c | 6 +- src/H5Olayout.c | 14 +- src/H5Olinfo.c | 18 +- src/H5Olink.c | 9 +- src/H5Opline.c | 4 +- src/H5Osdspace.c | 4 +- src/H5Oshared.c | 2 +- src/H5Oshmesg.c | 2 +- src/H5Ostab.c | 4 +- src/H5SM.c | 22 +-- src/H5SMbtree2.c | 6 +- src/H5Tconv.c | 8 +- src/H5Tdbg.c | 48 +++-- src/H5Z.c | 97 +++++---- src/H5dbg.c | 2 +- src/H5private.h | 14 +- src/H5public.h | 124 ++++++------ src/H5system.c | 413 ++------------------------------------- src/H5trace.c | 20 +- test/accum.c | 13 +- test/big.c | 6 +- test/cache_common.c | 16 +- test/chunk_info.c | 2 +- test/dsets.c | 4 +- test/earray.c | 42 ++-- test/farray.c | 6 +- test/fheap.c | 48 ++--- test/fillval.c | 12 +- test/filter_plugin.c | 2 +- test/freespace.c | 8 +- test/hdfs.c | 5 +- test/hyperslab.c | 2 +- test/mf.c | 8 +- tools/lib/h5diff_util.c | 4 +- tools/lib/h5tools_dump.c | 4 +- tools/src/h5dump/h5dump_ddl.c | 6 +- tools/src/h5dump/h5dump_xml.c | 2 +- tools/src/h5ls/h5ls.c | 6 +- tools/src/h5stat/h5stat.c | 72 +++---- tools/src/misc/h5clear.c | 2 +- tools/src/misc/h5debug.c | 2 +- tools/test/perform/chunk_cache.c | 8 +- tools/test/perform/sio_engine.c | 2 +- tools/test/perform/sio_perf.c | 4 +- 83 files changed, 593 insertions(+), 996 deletions(-) diff --git a/configure.ac b/configure.ac index d7e3cb5..77ce698 100644 --- a/configure.ac +++ b/configure.ac @@ -2033,7 +2033,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ AC_MSG_CHECKING([how to print long long]) AC_CACHE_VAL([hdf5_cv_printf_ll], [ -for hdf5_cv_printf_ll in l ll L q unknown; do +for hdf5_cv_printf_ll in ll l L q unknown; do AC_RUN_IFELSE( [AC_LANG_PROGRAM([ #include diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index ff9a078..7ad737c 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -206,7 +206,7 @@ doprint(hid_t did, hsize_t *start, hsize_t *block, int rank) info.dset_format = "DSET-%s "; info.dset_hidefileno = 0; - info.obj_format = "-%lu:"H5_PRINTF_HADDR_FMT; + info.obj_format = "-%lu:%" PRIuHADDR; info.obj_hidefileno = 0; info.dset_blockformat_pre = "%sBlk%lu: "; @@ -364,7 +364,7 @@ monitor_dataset(hid_t fid, char *dsetname) if(i != ndims) { /* Printing changes in dimension sizes */ for(u = 0; u < ndims; u++) { - HDfprintf(stdout, "dimension %u: %Hu->%Hu", (unsigned)u, prev_dims[u], cur_dims[u]); + HDfprintf(stdout, "dimension %d: %" PRIuHSIZE "->%" PRIuHSIZE "", u, prev_dims[u], cur_dims[u]); if(cur_dims[u] > prev_dims[u]) HDfprintf(stdout, " (increases)\n"); else if(cur_dims[u] < prev_dims[u]) diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index 3377aa2..01f9058 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -381,9 +381,9 @@ H5A__dense_btree2_name_debug(FILE *stream, int indent, int fwidth, FUNC_ENTER_STATIC_NOERR - HDfprintf(stream, "%*s%-*s {%016Hx, %02x, %u, %08lx}\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s {%016" PRIx64 ", %02" PRIx8 ", %u, %08" PRIx32 "}\n", indent, "", fwidth, "Record:", - (hsize_t)nrecord->id.val, (unsigned)nrecord->flags, (unsigned)nrecord->corder, (unsigned long)nrecord->hash); + nrecord->id.val, nrecord->flags, (unsigned)nrecord->corder, nrecord->hash); FUNC_LEAVE_NOAPI(SUCCEED) } /* H5A__dense_btree2_name_debug() */ @@ -538,9 +538,9 @@ H5A__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, FUNC_ENTER_STATIC_NOERR - HDfprintf(stream, "%*s%-*s {%016Hx, %02x, %u}\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s {%016" PRIx64 ", %02" PRIx8 ", %u}\n", indent, "", fwidth, "Record:", - (hsize_t)nrecord->id.val, (unsigned)nrecord->flags, (unsigned)nrecord->corder); + nrecord->id.val, nrecord->flags, (unsigned)nrecord->corder); FUNC_LEAVE_NOAPI(SUCCEED) } /* H5A__dense_btree2_corder_debug() */ diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index b5b1c03..40f9006 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -134,13 +134,13 @@ H5B2__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Depth:", hdr->depth); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Number of records in tree:", hdr->root.all_nrec); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Number of records in root node:", hdr->root.node_nrec); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Address of root node:", hdr->root.addr); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, @@ -247,7 +247,7 @@ H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, for(u = 0; u < internal->nrec; u++) { /* Print node pointer */ HDsnprintf(temp_str, sizeof(temp_str), "Node pointer #%u: (all/node/addr)", u); - HDfprintf(stream, "%*s%-*s (%Hu/%u/%a)\n", indent + 3, "", MAX(0, fwidth - 3), + HDfprintf(stream, "%*s%-*s (%" PRIuHSIZE "/%u/%" PRIuHADDR ")\n", indent + 3, "", MAX(0, fwidth - 3), temp_str, internal->node_ptrs[u].all_nrec, internal->node_ptrs[u].node_nrec, @@ -263,7 +263,7 @@ H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, /* Print final node pointer */ HDsnprintf(temp_str, sizeof(temp_str), "Node pointer #%u: (all/node/addr)", u); - HDfprintf(stream, "%*s%-*s (%Hu/%u/%a)\n", indent + 3, "", MAX(0, fwidth - 3), + HDfprintf(stream, "%*s%-*s (%" PRIuHSIZE "/%u/%" PRIuHADDR ")\n", indent + 3, "", MAX(0, fwidth - 3), temp_str, internal->node_ptrs[u].all_nrec, internal->node_ptrs[u].node_nrec, diff --git a/src/H5B2test.c b/src/H5B2test.c index 7affd49..0f1b4e3 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -323,7 +323,7 @@ H5B2__test_debug(FILE *stream, int indent, int fwidth, const void *record, HDassert(record); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "Record:", + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Record:", *(const hsize_t *)record); FUNC_LEAVE_NOAPI(SUCCEED) @@ -460,7 +460,7 @@ H5B2__test2_debug(FILE *stream, int indent, int fwidth, const void *record, HDassert(record); - HDfprintf(stream, "%*s%-*s (%Hu, %Hu)\n", indent, "", fwidth, "Record:", + HDfprintf(stream, "%*s%-*s (%" PRIuHSIZE ", %" PRIuHSIZE ")\n", indent, "", fwidth, "Record:", ((const H5B2_test_rec_t *)record)->key, ((const H5B2_test_rec_t *)record)->val); diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c index 665e826..37a94f4 100644 --- a/src/H5Bdbg.c +++ b/src/H5Bdbg.c @@ -100,10 +100,10 @@ H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, "Tree type ID:", ((shared->type->id) == H5B_SNODE_ID ? "H5B_SNODE_ID" : ((shared->type->id) == H5B_CHUNK_ID ? "H5B_CHUNK_ID" : "Unknown!"))); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Size of node:", shared->sizeof_rnode); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Size of raw (disk) key:", shared->sizeof_rkey); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, @@ -112,10 +112,10 @@ H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Level:", bt->level); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Address of left sibling:", bt->left); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Address of right sibling:", bt->right); HDfprintf(stream, "%*s%-*s %u (%u)\n", indent, "", fwidth, @@ -127,7 +127,7 @@ H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, */ for(u = 0; u < bt->nchildren; u++) { HDfprintf(stream, "%*sChild %d...\n", indent, "", u); - HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3), + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent + 3, "", MAX(0, fwidth - 3), "Address:", bt->child[u]); /* If there is a key debugging routine, use it to display the left & right keys */ diff --git a/src/H5C.c b/src/H5C.c index 91e4158..11b10f6 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -555,7 +555,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, (cache_ptr->resize_ctl).lower_hr_threshold); HDfprintf(stdout, - "%s cache size increased from (%Zu/%Zu) to (%Zu/%Zu).\n", + "%s cache size increased from (%zu/%zu) to (%zu/%zu).\n", cache_ptr->prefix, old_max_cache_size, old_min_clean_size, @@ -567,13 +567,13 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, HDassert( old_max_cache_size < new_max_cache_size ); HDfprintf(stdout, - "%sflash cache resize(%d) -- size threshold = %Zu.\n", + "%sflash cache resize(%d) -- size threshold = %zu.\n", cache_ptr->prefix, (int)((cache_ptr->resize_ctl).flash_incr_mode), cache_ptr->flash_size_increase_threshold); HDfprintf(stdout, - "%s cache size increased from (%Zu/%Zu) to (%Zu/%Zu).\n", + "%s cache size increased from (%zu/%zu) to (%zu/%zu).\n", cache_ptr->prefix, old_max_cache_size, old_min_clean_size, @@ -629,7 +629,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, } HDfprintf(stdout, - "%s cache size decreased from (%Zu/%Zu) to (%Zu/%Zu).\n", + "%s cache size decreased from (%zu/%zu) to (%zu/%zu).\n", cache_ptr->prefix, old_max_cache_size, old_min_clean_size, @@ -873,7 +873,7 @@ H5C_dest(H5F_t * f) #ifndef NDEBUG #if H5C_DO_SANITY_CHECKS if(cache_ptr->get_entry_ptr_from_addr_counter > 0) - HDfprintf(stdout, "*** %ld calls to H5C_get_entry_ptr_from_add(). ***\n", + HDfprintf(stdout, "*** %" PRId64 " calls to H5C_get_entry_ptr_from_add(). ***\n", cache_ptr->get_entry_ptr_from_addr_counter); #endif /* H5C_DO_SANITY_CHECKS */ diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index d5599f2..55220a5 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -310,17 +310,17 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); HDfprintf(stdout, - "%s%d 0x%016llx %4lld %d/%d %d %s\n", + "%s%d 0x%016" PRIxHADDR " %4zu %d/%d %d %s\n", cache_ptr->prefix, i, - (long long)(entry_ptr->addr), - (long long)(entry_ptr->size), + entry_ptr->addr, + entry_ptr->size, (int)(entry_ptr->is_protected), (int)(entry_ptr->is_pinned), (int)(entry_ptr->is_dirty), entry_ptr->type->name); HDfprintf(stdout, " node_ptr = %p, item = %p\n", - node_ptr, H5SL_item(node_ptr)); + (void *)node_ptr, H5SL_item(node_ptr)); /* increment node_ptr before we delete its target */ node_ptr = H5SL_next(node_ptr); @@ -806,7 +806,7 @@ H5C_stats(H5C_t * cache_ptr, (long long)(cache_ptr->index_scan_restarts)); HDfprintf(stdout, - "%s cache image creations/reads/loads/size = %d / %d /%d / %Hu\n", + "%s cache image creations/reads/loads/size = %d / %d /%d / %" PRIuHSIZE "\n", cache_ptr->prefix, cache_ptr->images_created, cache_ptr->images_read, @@ -1147,7 +1147,7 @@ H5C__dump_entry(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr, HDassert(cache_ptr); HDassert(entry_ptr); - HDfprintf(stderr, "%*s%s: entry_ptr = (%a, '%s', %a, %t, %u, %u/%u)\n", indent, "", prefix, entry_ptr->addr, entry_ptr->type->name, entry_ptr->tag_info ? entry_ptr->tag_info->tag : HADDR_UNDEF, entry_ptr->is_dirty, entry_ptr->flush_dep_nparents, entry_ptr->flush_dep_nchildren, entry_ptr->flush_dep_ndirty_children); + HDfprintf(stderr, "%*s%s: entry_ptr = (%" PRIuHADDR ", '%s', %" PRIuHADDR ", %s, %u, %u/%u)\n", indent, "", prefix, entry_ptr->addr, entry_ptr->type->name, entry_ptr->tag_info ? entry_ptr->tag_info->tag : HADDR_UNDEF, (entry_ptr->is_dirty) ? "TRUE" : "FALSE", entry_ptr->flush_dep_nparents, entry_ptr->flush_dep_nchildren, entry_ptr->flush_dep_ndirty_children); if(dump_parents && entry_ptr->flush_dep_nparents) H5C__dump_parents(cache_ptr, entry_ptr, "Parent", indent); if(entry_ptr->flush_dep_nchildren) diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index 098e01b..f23538a 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -774,7 +774,7 @@ H5D__btree_debug_key(FILE *stream, int indent, int fwidth, const void *_key, HDfprintf(stream, "%*s%-*s 0x%08x\n", indent, "", fwidth, "Filter mask:", key->filter_mask); HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Logical offset:"); for(u = 0; u < udata->ndims; u++) - HDfprintf(stream, "%s%Hd", u?", ":"", (key->scaled[u] * udata->common.layout->dim[u])); + HDfprintf(stream, "%s%" PRIuHSIZE, u?", ":"", (key->scaled[u] * udata->common.layout->dim[u])); HDfputs("}\n", stream); FUNC_LEAVE_NOAPI(SUCCEED) @@ -1421,7 +1421,7 @@ H5D__btree_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) HDassert(storage); HDassert(stream); - HDfprintf(stream, " Address: %a\n", storage->idx_addr); + HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__btree_idx_dump() */ diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index ae98654..11bde2d 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -459,11 +459,11 @@ H5D__bt2_unfilt_debug(FILE *stream, int indent, int fwidth, HDassert(ctx->chunk_size == record->nbytes); HDassert(0 == record->filter_mask); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Chunk address:", record->chunk_addr); + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Chunk address:", record->chunk_addr); HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Logical offset:"); for(u = 0; u < ctx->ndims; u++) - HDfprintf(stream, "%s%Hd", u?", ":"", record->scaled[u] * ctx->dim[u]); + HDfprintf(stream, "%s%" PRIuHSIZE, u?", ":"", record->scaled[u] * ctx->dim[u]); HDfputs("}\n", stream); FUNC_LEAVE_NOAPI(SUCCEED) @@ -577,13 +577,13 @@ H5D__bt2_filt_debug(FILE *stream, int indent, int fwidth, HDassert(H5F_addr_defined(record->chunk_addr)); HDassert(0 != record->nbytes); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Chunk address:", record->chunk_addr); + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Chunk address:", record->chunk_addr); HDfprintf(stream, "%*s%-*s %u bytes\n", indent, "", fwidth, "Chunk size:", (unsigned)record->nbytes); HDfprintf(stream, "%*s%-*s 0x%08x\n", indent, "", fwidth, "Filter mask:", record->filter_mask); HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Logical offset:"); for(u = 0; u < ctx->ndims; u++) - HDfprintf(stream, "%s%Hd", u?", ":"", record->scaled[u] * ctx->dim[u]); + HDfprintf(stream, "%s%" PRIuHSIZE, u?", ":"", record->scaled[u] * ctx->dim[u]); HDfputs("}\n", stream); FUNC_LEAVE_NOAPI(SUCCEED) @@ -1511,7 +1511,7 @@ H5D__bt2_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) HDassert(storage); HDassert(stream); - HDfprintf(stream, " Address: %a\n", storage->idx_addr); + HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__bt2_idx_dump() */ diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 5fda3c0..21b114e 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -6571,9 +6571,9 @@ H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) } /* end if */ /* Print information about this chunk */ - HDfprintf(udata->stream, " 0x%08x %8Zu %10a [", chunk_rec->filter_mask, chunk_rec->nbytes, chunk_rec->chunk_addr); + HDfprintf(udata->stream, " 0x%08x %8" PRIu32 " %10" PRIuHADDR " [", chunk_rec->filter_mask, chunk_rec->nbytes, chunk_rec->chunk_addr); for(u = 0; u < udata->ndims; u++) - HDfprintf(udata->stream, "%s%Hu", (u ? ", " : ""), (chunk_rec->scaled[u] * udata->chunk_dim[u])); + HDfprintf(udata->stream, "%s%" PRIuHSIZE, (u ? ", " : ""), (chunk_rec->scaled[u] * udata->chunk_dim[u])); HDfputs("]\n", udata->stream); } /* end if */ diff --git a/src/H5Ddbg.c b/src/H5Ddbg.c index d11a5d8..8725bd3 100644 --- a/src/H5Ddbg.c +++ b/src/H5Ddbg.c @@ -87,7 +87,7 @@ H5Ddebug(hid_t dset_id) if(H5D_CHUNKED == dset->shared->layout.type) (void)H5D__chunk_dump_index(dset, stdout); else if(H5D_CONTIGUOUS == dset->shared->layout.type) - HDfprintf(stdout, " %-10s %a\n", "Address:", dset->shared->layout.storage.u.contig.addr); + HDfprintf(stdout, " %-10s %" PRIuHADDR "\n", "Address:", dset->shared->layout.storage.u.contig.addr); done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5Dearray.c b/src/H5Dearray.c index eaa8c46..fbd3b04 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -438,8 +438,8 @@ H5D__earray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, HDassert(elmt); /* Print element */ - HDsprintf(temp_str, "Element #%llu:", (unsigned long long)idx); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, temp_str, + HDsprintf(temp_str, "Element #%" PRIuHSIZE ":", idx); + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, temp_str, *(const haddr_t *)elmt); FUNC_LEAVE_NOAPI(SUCCEED) @@ -597,8 +597,8 @@ H5D__earray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, HDassert(elmt); /* Print element */ - HDsprintf(temp_str, "Element #%llu:", (unsigned long long)idx); - HDfprintf(stream, "%*s%-*s {%a, %u, %0x}\n", indent, "", fwidth, temp_str, + HDsprintf(temp_str, "Element #%" PRIuHSIZE ":", idx); + HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %u, %0x}\n", indent, "", fwidth, temp_str, elmt->addr, elmt->nbytes, elmt->filter_mask); FUNC_LEAVE_NOAPI(SUCCEED) @@ -1773,7 +1773,7 @@ H5D__earray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) HDassert(storage); HDassert(stream); - HDfprintf(stream, " Address: %a\n", storage->idx_addr); + HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__earray_idx_dump() */ diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index 4eedf04..348aeb3 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -434,8 +434,8 @@ H5D__farray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, HDassert(elmt); /* Print element */ - HDsprintf(temp_str, "Element #%llu:", (unsigned long long)idx); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, temp_str, + HDsprintf(temp_str, "Element #%" PRIuHSIZE ":", idx); + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, temp_str, *(const haddr_t *)elmt); FUNC_LEAVE_NOAPI(SUCCEED) @@ -699,8 +699,8 @@ H5D__farray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, HDassert(elmt); /* Print element */ - HDsprintf(temp_str, "Element #%llu:", (unsigned long long)idx); - HDfprintf(stream, "%*s%-*s {%a, %u, %0x}\n", indent, "", fwidth, temp_str, + HDsprintf(temp_str, "Element #%" PRIuHSIZE ":", idx); + HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %u, %0x}\n", indent, "", fwidth, temp_str, elmt->addr, elmt->nbytes, elmt->filter_mask); FUNC_LEAVE_NOAPI(SUCCEED) @@ -1624,7 +1624,7 @@ H5D__farray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) HDassert(storage); HDassert(stream); - HDfprintf(stream, " Address: %a\n", storage->idx_addr); + HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__farray_idx_dump() */ diff --git a/src/H5Dnone.c b/src/H5Dnone.c index 40ddcb8..93265c4 100644 --- a/src/H5Dnone.c +++ b/src/H5Dnone.c @@ -489,7 +489,7 @@ H5D__none_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) HDassert(storage); HDassert(stream); - HDfprintf(stream, " Address: %a\n", storage->idx_addr); + HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__none_idx_dump() */ diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c index 33274bb..cd0ed16 100644 --- a/src/H5Dsingle.c +++ b/src/H5Dsingle.c @@ -546,7 +546,7 @@ H5D__single_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) HDassert(storage); HDassert(stream); - HDfprintf(stream, " Address: %a\n", storage->idx_addr); + HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__single_idx_dump() */ diff --git a/src/H5E.c b/src/H5E.c index f204864..30f303f 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -1356,10 +1356,6 @@ H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, { va_list ap; /* Varargs info */ H5E_t *estack; /* Pointer to error stack to modify */ -#ifndef H5_HAVE_VASPRINTF - int tmp_len; /* Current size of description buffer */ - int desc_len; /* Actual length of description when formatted */ -#endif /* H5_HAVE_VASPRINTF */ char *tmp = NULL; /* Buffer to place formatted description in */ hbool_t va_started = FALSE; /* Whether the variable argument list is open */ herr_t ret_value=SUCCEED; /* Return value */ @@ -1389,31 +1385,9 @@ H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, HDva_start(ap, fmt); va_started = TRUE; -#ifdef H5_HAVE_VASPRINTF /* Use the vasprintf() routine, since it does what we're trying to do below */ if(HDvasprintf(&tmp, fmt, ap) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") -#else /* H5_HAVE_VASPRINTF */ - /* Allocate space for the formatted description buffer */ - tmp_len = 128; - if(NULL == (tmp = H5MM_malloc((size_t)tmp_len))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* If the description doesn't fit into the initial buffer size, allocate more space and try again */ - while((desc_len = HDvsnprintf(tmp, (size_t)tmp_len, fmt, ap)) > (tmp_len - 1)) { - /* shutdown & restart the va_list */ - HDva_end(ap); - HDva_start(ap, fmt); - - /* Release the previous description, it's too small */ - H5MM_xfree(tmp); - - /* Allocate a description of the appropriate length */ - tmp_len = desc_len + 1; - if(NULL == (tmp = H5MM_malloc((size_t)tmp_len))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - } /* end while */ -#endif /* H5_HAVE_VASPRINTF */ /* Push the error on the stack */ if(H5E__push_stack(estack, file, func, line, cls_id, maj_id, min_id, tmp) < 0) @@ -1422,16 +1396,11 @@ H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, done: if(va_started) HDva_end(ap); -#ifdef H5_HAVE_VASPRINTF /* Memory was allocated with HDvasprintf so it needs to be freed * with HDfree */ if(tmp) HDfree(tmp); -#else /* H5_HAVE_VASPRINTF */ - if(tmp) - H5MM_xfree(tmp); -#endif /* H5_HAVE_VASPRINTF */ FUNC_LEAVE_API(ret_value) } /* end H5Epush2() */ diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index 3d6c2ed..49bb447 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -125,13 +125,13 @@ H5EA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Print the values */ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Array class ID:", hdr->cparam.cls->name); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Header size:", hdr->size); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Raw Element Size:", (unsigned)hdr->cparam.raw_elmt_size); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Native Element Size (on this platform):", hdr->cparam.cls->nat_elmt_size); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, @@ -149,19 +149,19 @@ H5EA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Log2(Max. # of elements in data block page):", (unsigned)hdr->cparam.max_dblk_page_nelmts_bits); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Highest element index stored (+1):", hdr->stats.stored.max_idx_set); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Number of super blocks created:", hdr->stats.stored.nsuper_blks); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Number of data blocks created:", hdr->stats.stored.ndata_blks); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Number of elements 'realized':", hdr->stats.stored.nelmts); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Index Block Address:", hdr->idx_blk_addr); @@ -230,13 +230,13 @@ H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int inde /* Print the values */ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Array class ID:", hdr->cparam.cls->name); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Index Block size:", iblock->size); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "# of data block addresses in index block:", iblock->ndblk_addrs); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "# of super block addresses in index block:", iblock->nsblk_addrs); @@ -265,7 +265,7 @@ H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int inde for(u = 0; u < iblock->ndblk_addrs; u++) { /* Print address */ HDsprintf(temp_str, "Address #%u:", u); - HDfprintf(stream, "%*s%-*s %a\n", (indent + 3), "", MAX(0, (fwidth - 3)), + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", (indent + 3), "", MAX(0, (fwidth - 3)), temp_str, iblock->dblk_addrs[u]); } /* end for */ @@ -281,7 +281,7 @@ H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int inde for(u = 0; u < iblock->nsblk_addrs; u++) { /* Print address */ HDsprintf(temp_str, "Address #%u:", u); - HDfprintf(stream, "%*s%-*s %a\n", (indent + 3), "", MAX(0, (fwidth - 3)), + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", (indent + 3), "", MAX(0, (fwidth - 3)), temp_str, iblock->sblk_addrs[u]); } /* end for */ @@ -352,13 +352,13 @@ H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Print the values */ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Array class ID:", hdr->cparam.cls->name); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Super Block size:", sblock->size); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "# of data block addresses in super block:", sblock->ndblks); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "# of elements in data blocks from this super block:", sblock->dblk_nelmts); @@ -372,7 +372,7 @@ H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, for(u = 0; u < sblock->ndblks; u++) { /* Print address */ HDsprintf(temp_str, "Address #%u:", u); - HDfprintf(stream, "%*s%-*s %a\n", (indent + 3), "", MAX(0, (fwidth - 3)), + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", (indent + 3), "", MAX(0, (fwidth - 3)), temp_str, sblock->dblk_addrs[u]); } /* end for */ @@ -437,7 +437,7 @@ H5EA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Protect data block */ /* (Note: setting parent of data block to 'hdr' for this operation should be OK -QAK) */ if(NULL == (dblock = H5EA__dblock_protect(hdr, hdr, addr, dblk_nelmts, H5AC__READ_ONLY_FLAG))) - H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)addr) + H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %" PRIuHADDR, addr) /* Print opening message */ HDfprintf(stream, "%*sExtensible Array data Block...\n", indent, ""); @@ -445,7 +445,7 @@ H5EA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Print the values */ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Array class ID:", hdr->cparam.cls->name); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Data Block size:", dblock->size); diff --git a/src/H5Eint.c b/src/H5Eint.c index fe72449..52fe3c9 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -672,10 +672,6 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin hid_t cls_id, hid_t maj_id, hid_t min_id, const char *fmt, ...) { va_list ap; /* Varargs info */ -#ifndef H5_HAVE_VASPRINTF - int tmp_len; /* Current size of description buffer */ - int desc_len; /* Actual length of description when formatted */ -#endif /* H5_HAVE_VASPRINTF */ char *tmp = NULL; /* Buffer to place formatted description in */ hbool_t va_started = FALSE; /* Whether the variable argument list is open */ herr_t ret_value = SUCCEED; /* Return value */ @@ -704,31 +700,9 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin HDva_start(ap, fmt); va_started = TRUE; -#ifdef H5_HAVE_VASPRINTF /* Use the vasprintf() routine, since it does what we're trying to do below */ if(HDvasprintf(&tmp, fmt, ap) < 0) HGOTO_DONE(FAIL) -#else /* H5_HAVE_VASPRINTF */ - /* Allocate space for the formatted description buffer */ - tmp_len = 128; - if(NULL == (tmp = H5MM_malloc((size_t)tmp_len))) - HGOTO_DONE(FAIL) - - /* If the description doesn't fit into the initial buffer size, allocate more space and try again */ - while((desc_len = HDvsnprintf(tmp, (size_t)tmp_len, fmt, ap)) > (tmp_len - 1)) { - /* shutdown & restart the va_list */ - HDva_end(ap); - HDva_start(ap, fmt); - - /* Release the previous description, it's too small */ - H5MM_xfree(tmp); - - /* Allocate a description of the appropriate length */ - tmp_len = desc_len + 1; - if(NULL == (tmp = H5MM_malloc((size_t)tmp_len))) - HGOTO_DONE(FAIL) - } /* end while */ -#endif /* H5_HAVE_VASPRINTF */ /* Push the error on the stack */ if(H5E__push_stack(estack, file, func, line, cls_id, maj_id, min_id, tmp) < 0) @@ -737,16 +711,11 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin done: if(va_started) HDva_end(ap); -#ifdef H5_HAVE_VASPRINTF /* Memory was allocated with HDvasprintf so it needs to be freed * with HDfree */ if(tmp) HDfree(tmp); -#else /* H5_HAVE_VASPRINTF */ - if(tmp) - H5MM_xfree(tmp); -#endif /* H5_HAVE_VASPRINTF */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5E_printf_stack() */ diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index b578cf2..af4616c 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -123,13 +123,13 @@ H5FA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Print the values */ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Array class ID:", hdr->cparam.cls->name); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Header size:", hdr->size); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Raw Element Size:", (unsigned)hdr->cparam.raw_elmt_size); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Native Element Size (on this platform):", hdr->cparam.cls->nat_elmt_size); @@ -138,10 +138,10 @@ H5FA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, "Max. # of elements in data block page:", (unsigned)((size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits)); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Number of elements in Fixed Array:", hdr->stats.nelmts); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Fixed Array Data Block Address:", hdr->dblk_addr); CATCH @@ -207,13 +207,13 @@ H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Print the values */ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Array class ID:", hdr->cparam.cls->name); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Address of Data Block:", dblock->addr); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Data Block size:", dblock->size); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Address of Data Block:", dblock->addr); + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Data Block size:", dblock->size); + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Number of elements in Data Block:", hdr->cparam.nelmts); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Number of pages in Data Block:", dblock->npages); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Number of elements per Data Block page:", dblock->dblk_page_nelmts); if(dblock->npages) { /* paging */ @@ -230,8 +230,8 @@ H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, /* Read and print each page's elements in the data block */ for(page_idx = 0; page_idx < dblock->npages; page_idx++) { if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { - HDfprintf(stream, "%*s%-*s %Hu %s\n", indent, "", fwidth, - "Page %Zu:", page_idx, "empty"); + HDfprintf(stream, "%*s%-*s %zu %s\n", indent, "", fwidth, + "Page %zu:", page_idx, "empty"); } /* end if */ else { /* get the page */ @@ -245,7 +245,7 @@ H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dblk_page_addr, dblk_page_nelmts, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu", (unsigned long long)dblk_page_addr) - HDfprintf(stream, "%*sElements in page %Zu:\n", indent, "", page_idx); + HDfprintf(stream, "%*sElements in page %zu:\n", indent, "", page_idx); for(u = 0; u < dblk_page_nelmts; u++) { /* Call the class's 'debug' callback */ if((hdr->cparam.cls->debug)(stream, (indent + 3), MAX(0, (fwidth - 3)), (hsize_t)u, ((uint8_t *)dblk_page->elmts) + (hdr->cparam.cls->nat_elmt_size * u)) < 0) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 78b7742..80a5d03 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -732,13 +732,13 @@ H5FD_log_close(H5FD_t *_file) addr = 1; while(addr < file->eoa) { if(file->nwrite[addr] != last_val) { - HDfprintf(file->logfp, "\tAddr %10a-%10a (%10lu bytes) written to %3d times\n", last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val); + HDfprintf(file->logfp, "\tAddr %10" PRIuHADDR "-%10" PRIuHADDR " (%10lu bytes) written to %3d times\n", last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val); last_val = file->nwrite[addr]; last_addr = addr; } /* end if */ addr++; } /* end while */ - HDfprintf(file->logfp, "\tAddr %10a-%10a (%10lu bytes) written to %3d times\n", last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val); + HDfprintf(file->logfp, "\tAddr %10" PRIuHADDR "-%10" PRIuHADDR " (%10lu bytes) written to %3d times\n", last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val); } /* end if */ /* Dump the read I/O information */ @@ -749,13 +749,13 @@ H5FD_log_close(H5FD_t *_file) addr = 1; while(addr < file->eoa) { if(file->nread[addr] != last_val) { - HDfprintf(file->logfp, "\tAddr %10a-%10a (%10lu bytes) read from %3d times\n", last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val); + HDfprintf(file->logfp, "\tAddr %10" PRIuHADDR "-%10" PRIuHADDR " (%10lu bytes) read from %3d times\n", last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val); last_val = file->nread[addr]; last_addr = addr; } /* end if */ addr++; } /* end while */ - HDfprintf(file->logfp, "\tAddr %10a-%10a (%10lu bytes) read from %3d times\n", last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val); + HDfprintf(file->logfp, "\tAddr %10" PRIuHADDR "-%10" PRIuHADDR " (%10lu bytes) read from %3d times\n", last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val); } /* end if */ /* Dump the I/O flavor information */ @@ -766,13 +766,13 @@ H5FD_log_close(H5FD_t *_file) addr = 1; while(addr < file->eoa) { if(file->flavor[addr] != last_val) { - HDfprintf(file->logfp, "\tAddr %10a-%10a (%10lu bytes) flavor is %s\n", last_addr, (addr - 1), (unsigned long)(addr - last_addr), flavors[last_val]); + HDfprintf(file->logfp, "\tAddr %10" PRIuHADDR "-%10" PRIuHADDR " (%10lu bytes) flavor is %s\n", last_addr, (addr - 1), (unsigned long)(addr - last_addr), flavors[last_val]); last_val = file->flavor[addr]; last_addr = addr; } /* end if */ addr++; } /* end while */ - HDfprintf(file->logfp, "\tAddr %10a-%10a (%10lu bytes) flavor is %s\n", last_addr, (addr - 1), (unsigned long)(addr - last_addr), flavors[last_val]); + HDfprintf(file->logfp, "\tAddr %10" PRIuHADDR "-%10" PRIuHADDR " (%10lu bytes) flavor is %s\n", last_addr, (addr - 1), (unsigned long)(addr - last_addr), flavors[last_val]); } /* end if */ /* Free the logging information */ @@ -930,7 +930,7 @@ H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hsi } /* end if */ if(file->fa.flags & H5FD_LOG_ALLOC) - HDfprintf(file->logfp, "%10a-%10a (%10Hu bytes) (%s) Allocated\n", addr, (addr + size) - 1, size, flavors[type]); + HDfprintf(file->logfp, "%10" PRIuHADDR "-%10" PRIuHADDR " (%10" PRIuHSIZE " bytes) (%s) Allocated\n", addr, (addr + size) - 1, size, flavors[type]); } /* end if */ /* Set return value */ @@ -970,7 +970,7 @@ H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, /* Log the file memory freed */ if(file->fa.flags & H5FD_LOG_FREE) - HDfprintf(file->logfp, "%10a-%10a (%10Hu bytes) (%s) Freed\n", addr, (addr + size) - 1, size, flavors[type]); + HDfprintf(file->logfp, "%10" PRIuHADDR "-%10" PRIuHADDR " (%10" PRIuHSIZE " bytes) (%s) Freed\n", addr, (addr + size) - 1, size, flavors[type]); } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) @@ -1038,7 +1038,7 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) /* Log the extension like an allocation */ if(file->fa.flags & H5FD_LOG_ALLOC) - HDfprintf(file->logfp, "%10a-%10a (%10Hu bytes) (%s) Allocated\n", file->eoa, addr, size, flavors[type]); + HDfprintf(file->logfp, "%10" PRIuHADDR "-%10" PRIuHADDR " (%10" PRIuHSIZE " bytes) (%s) Allocated\n", file->eoa, addr, size, flavors[type]); } /* end if */ /* Check for decreasing file size */ @@ -1054,7 +1054,7 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) /* Log the shrink like a free */ if(file->fa.flags & H5FD_LOG_FREE) - HDfprintf(file->logfp, "%10a-%10a (%10Hu bytes) (%s) Freed\n", file->eoa, addr, size, flavors[type]); + HDfprintf(file->logfp, "%10" PRIuHADDR "-%10" PRIuHADDR " (%10" PRIuHSIZE " bytes) (%s) Freed\n", file->eoa, addr, size, flavors[type]); } /* end if */ } /* end if */ @@ -1206,7 +1206,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd /* Emit log string if we're tracking individual seek events. */ if(file->fa.flags & H5FD_LOG_LOC_SEEK) { - HDfprintf(file->logfp, "Seek: From %10a To %10a", file->pos, addr); + HDfprintf(file->logfp, "Seek: From %10" PRIuHADDR " To %10" PRIuHADDR, file->pos, addr); /* Add the seek time, if we're tracking that. * Note that the seek time is NOT emitted for when just H5FD_LOG_TIME_SEEK @@ -1259,7 +1259,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); if(file->fa.flags & H5FD_LOG_LOC_READ) - HDfprintf(file->logfp, "Error! Reading: %10a-%10a (%10Zu bytes)\n", orig_addr, (orig_addr + orig_size) - 1, orig_size); + HDfprintf(file->logfp, "Error! Reading: %10" PRIuHADDR "-%10" PRIuHADDR " (%10zu bytes)\n", orig_addr, (orig_addr + orig_size) - 1, orig_size); HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset); } /* end if */ @@ -1295,7 +1295,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd /* Log information about the read */ if(file->fa.flags & H5FD_LOG_LOC_READ) { - HDfprintf(file->logfp, "%10a-%10a (%10Zu bytes) (%s) Read", orig_addr, (orig_addr + orig_size) - 1, orig_size, flavors[type]); + HDfprintf(file->logfp, "%10" PRIuHADDR "-%10" PRIuHADDR " (%10zu bytes) (%s) Read", orig_addr, (orig_addr + orig_size) - 1, orig_size, flavors[type]); /* Verify that we are reading in the type of data we allocated in this location */ if(file->flavor) { @@ -1415,7 +1415,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had /* Emit log string if we're tracking individual seek events. */ if(file->fa.flags & H5FD_LOG_LOC_SEEK) { - HDfprintf(file->logfp, "Seek: From %10a To %10a", file->pos, addr); + HDfprintf(file->logfp, "Seek: From %10" PRIuHADDR " To %10" PRIuHADDR, file->pos, addr); /* Add the seek time, if we're tracking that. * Note that the seek time is NOT emitted for when just H5FD_LOG_TIME_SEEK @@ -1468,7 +1468,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); if(file->fa.flags & H5FD_LOG_LOC_WRITE) - HDfprintf(file->logfp, "Error! Writing: %10a-%10a (%10Zu bytes)\n", orig_addr, (orig_addr + orig_size) - 1, orig_size); + HDfprintf(file->logfp, "Error! Writing: %10" PRIuHADDR "-%10" PRIuHADDR " (%10zu bytes)\n", orig_addr, (orig_addr + orig_size) - 1, orig_size); HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ @@ -1497,7 +1497,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had /* Log information about the write */ if(file->fa.flags & H5FD_LOG_LOC_WRITE) { - HDfprintf(file->logfp, "%10a-%10a (%10Zu bytes) (%s) Written", orig_addr, (orig_addr + orig_size) - 1, orig_size, flavors[type]); + HDfprintf(file->logfp, "%10" PRIuHADDR "-%10" PRIuHADDR " (%10zu bytes) (%s) Written", orig_addr, (orig_addr + orig_size) - 1, orig_size, flavors[type]); /* Check if this is the first write into a "default" section, grabbed by the metadata agregation algorithm */ if(file->fa.flags & H5FD_LOG_FLAVOR) { @@ -1617,7 +1617,7 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U /* Emit log string if we're tracking individual truncate events. */ if(file->fa.flags & H5FD_LOG_TRUNCATE) { - HDfprintf(file->logfp, "Truncate: To %10a", file->eoa); + HDfprintf(file->logfp, "Truncate: To %10" PRIuHADDR, file->eoa); /* Add the truncate time, if we're tracking that. * Note that the truncate time is NOT emitted for when just H5FD_LOG_TIME_TRUNCATE diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c index d9d4c88..6ecc007 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -1496,7 +1496,7 @@ H5FD_s3comms_s3r_read(s3r_t *handle, } ret = HDsnprintf(rangebytesstr, (S3COMMS_MAX_RANGE_STRING_SIZE), - "bytes="H5_PRINTF_HADDR_FMT"-"H5_PRINTF_HADDR_FMT, + "bytes=%" PRIuHADDR "-%" PRIuHADDR, offset, offset + len - 1); if (ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE) @@ -1511,7 +1511,7 @@ H5FD_s3comms_s3r_read(s3r_t *handle, } ret = HDsnprintf(rangebytesstr, (S3COMMS_MAX_RANGE_STRING_SIZE), - "bytes="H5_PRINTF_HADDR_FMT"-", + "bytes=%" PRIuHADDR "-", offset); if (ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c index c615b68..dada9b1 100644 --- a/src/H5FSdbg.c +++ b/src/H5FSdbg.c @@ -129,16 +129,16 @@ H5FS_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) "Free space client:", (fspace->client == H5FS_CLIENT_FHEAP_ID ? "Fractal heap" : (fspace->client == H5FS_CLIENT_FILE_ID ? "File" : "Unknown"))); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Total free space tracked:", fspace->tot_space); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Total number of free space sections tracked:", fspace->tot_sect_count); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Number of serializable free space sections tracked:", fspace->serial_sect_count); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Number of ghost free space sections tracked:", fspace->ghost_sect_count); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, @@ -153,16 +153,16 @@ H5FS_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "# of bits for section address space:", fspace->max_sect_addr); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Maximum section size:", fspace->max_sect_size); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Serialized sections address:", fspace->sect_addr); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Serialized sections size used:", fspace->sect_size); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Serialized sections size allocated:", fspace->alloc_sect_size); diff --git a/src/H5Fdbg.c b/src/H5Fdbg.c index 535b43d..7b61e33 100644 --- a/src/H5Fdbg.c +++ b/src/H5Fdbg.c @@ -78,9 +78,9 @@ H5F_debug(H5F_t *f, FILE *stream, int indent, int fwidth) "File access flags", f->shared->flags); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "File open reference count:", f->shared->nrefs); - HDfprintf(stream, "%*s%-*s %a (abs)\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR " (abs)\n", indent, "", fwidth, "Address of super block:", f->shared->sblock->base_addr); - HDfprintf(stream, "%*s%-*s %Hu bytes\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE " bytes\n", indent, "", fwidth, "Size of userblock:", userblock_size); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, @@ -106,16 +106,16 @@ H5F_debug(H5F_t *f, FILE *stream, int indent, int fwidth) "Indexed storage internal node 1/2 rank:", f->shared->sblock->btree_k[H5B_CHUNK_ID]); HDfprintf(stream, "%*s%-*s 0x%02x\n", indent, "", fwidth, "File status flags:", (unsigned)(f->shared->sblock->status_flags)); - HDfprintf(stream, "%*s%-*s %a (rel)\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR " (rel)\n", indent, "", fwidth, "Superblock extension address:", f->shared->sblock->ext_addr); - HDfprintf(stream, "%*s%-*s %a (rel)\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR " (rel)\n", indent, "", fwidth, "Shared object header message table address:", f->shared->sohm_addr); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Shared object header message version number:", (unsigned) f->shared->sohm_vers); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Number of shared object header message indexes:", (unsigned) f->shared->sohm_nindexes); - HDfprintf(stream, "%*s%-*s %a (rel)\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR " (rel)\n", indent, "", fwidth, "Address of driver information block:", f->shared->sblock->driver_addr); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, diff --git a/src/H5Gent.c b/src/H5Gent.c index 19aef10..4852dde 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -552,7 +552,7 @@ H5G__ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth, "Name offset into private heap:", (unsigned long) (ent->name_off)); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Object header address:", ent->header); HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, @@ -567,10 +567,10 @@ H5G__ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth, HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, "Cached entry information:"); - HDfprintf(stream, "%*s%-*s %a\n", nested_indent, "", nested_fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", nested_indent, "", nested_fwidth, "B-tree address:", ent->cache.stab.btree_addr); - HDfprintf(stream, "%*s%-*s %a\n", nested_indent, "", nested_fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", nested_indent, "", nested_fwidth, "Heap address:", ent->cache.stab.heap_addr); break; diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index 479c2bd..5485b75 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -454,7 +454,7 @@ H5HF__huge_bt2_indir_debug(FILE *stream, int indent, int fwidth, FUNC_ENTER_STATIC_NOERR - HDfprintf(stream, "%*s%-*s {%a, %Hu, %Hu}\n", indent, "", fwidth, "Record:", + HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %" PRIuHSIZE ", %" PRIuHSIZE "}\n", indent, "", fwidth, "Record:", nrecord->addr, nrecord->len, nrecord->id); FUNC_LEAVE_NOAPI(SUCCEED) @@ -661,7 +661,7 @@ H5HF__huge_bt2_filt_indir_debug(FILE *stream, int indent, int fwidth, FUNC_ENTER_STATIC_NOERR - HDfprintf(stream, "%*s%-*s {%a, %Hu, %x, %Hu, %Hu}\n", indent, "", fwidth, "Record:", + HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %" PRIuHSIZE ", %x, %" PRIuHSIZE ", %" PRIuHSIZE "}\n", indent, "", fwidth, "Record:", nrecord->addr, nrecord->len, nrecord->filter_mask, nrecord->obj_size, nrecord->id); FUNC_LEAVE_NOAPI(SUCCEED) @@ -848,7 +848,7 @@ H5HF__huge_bt2_dir_debug(FILE *stream, int indent, int fwidth, FUNC_ENTER_STATIC_NOERR - HDfprintf(stream, "%*s%-*s {%a, %Hu}\n", indent, "", fwidth, "Record:", + HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %" PRIuHSIZE "}\n", indent, "", fwidth, "Record:", nrecord->addr, nrecord->len); FUNC_LEAVE_NOAPI(SUCCEED) @@ -1064,7 +1064,7 @@ H5HF__huge_bt2_filt_dir_debug(FILE *stream, int indent, int fwidth, FUNC_ENTER_STATIC_NOERR - HDfprintf(stream, "%*s%-*s {%a, %Hu, %x, %Hu}\n", indent, "", fwidth, "Record:", + HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %" PRIuHSIZE ", %x, %" PRIuHSIZE "}\n", indent, "", fwidth, "Record:", nrecord->addr, nrecord->len, nrecord->filter_mask, nrecord->obj_size); FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 22de0c4..dd544f0 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -162,7 +162,7 @@ HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve heap ID length") /* Display the heap ID */ - HDfprintf(stream, "%*s%-*s (%c, %Hu, %Zu)\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s (%c, %" PRIuHSIZE" , %zu)\n", indent, "", fwidth, "Heap ID info: (type, offset, length)", id_type, obj_off, obj_len); @@ -204,10 +204,10 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Doubling table width:", dtable->cparam.width); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Starting block size:", dtable->cparam.start_block_size); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Max. direct block size:", dtable->cparam.max_direct_size); HDfprintf(stream, "%*s%-*s %u (bits)\n", indent, "", fwidth, @@ -218,7 +218,7 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi dtable->cparam.start_root_rows); /* Run-time varying parameter values */ - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Table's root address:", dtable->table_addr); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, @@ -235,7 +235,7 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "# of bits for IDs in first row:", dtable->first_row_bits); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE" \n", indent, "", fwidth, "# of IDs in first row:", dtable->num_id_first_row); @@ -278,52 +278,52 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int i HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Heap is:", hdr->man_dtable.curr_root_rows > 0 ? "Indirect" : "Direct"); - HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Objects stored in 'debugging' format:", - hdr->debug_objs); - HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, + hdr->debug_objs ? "TRUE" : "FALSE"); + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "'Write once' flag:", - hdr->write_once); - HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, + hdr->write_once ? "TRUE" : "FALSE"); + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "'Huge' object IDs have wrapped:", - hdr->huge_ids_wrapped); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + hdr->huge_ids_wrapped ? "TRUE" : "FALSE"); + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE" \n", indent, "", fwidth, "Free space in managed blocks:", hdr->total_man_free); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE" \n", indent, "", fwidth, "Managed space data block size:", hdr->man_size); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE" \n", indent, "", fwidth, "Total managed space allocated:", hdr->man_alloc_size); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE" \n", indent, "", fwidth, "Offset of managed space iterator:", hdr->man_iter_off); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE" \n", indent, "", fwidth, "Number of managed objects in heap:", hdr->man_nobjs); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Address of free space manager for managed blocks:", hdr->fs_addr); HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, "Max. size of managed object:", (unsigned long)hdr->max_man_size); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE" \n", indent, "", fwidth, "'Huge' object space used:", hdr->huge_size); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE" \n", indent, "", fwidth, "Number of 'huge' objects in heap:", hdr->huge_nobjs); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE" \n", indent, "", fwidth, "ID of next 'huge' object:", hdr->huge_next_id); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Address of v2 B-tree for 'huge' objects:", hdr->huge_bt2_addr); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE" \n", indent, "", fwidth, "'Tiny' object space used:", hdr->tiny_size); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE" \n", indent, "", fwidth, "Number of 'tiny' objects in heap:", hdr->tiny_nobjs); @@ -334,7 +334,7 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int i if(hdr->filter_len > 0) { HDfprintf(stream, "%*sI/O filter Info...\n", indent, ""); if(hdr->man_dtable.curr_root_rows == 0) { - HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3), + HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", MAX(0, fwidth - 3), "Compressed size of root direct block:", hdr->pline_root_direct_size); HDfprintf(stream, "%*s%-*s %x\n", indent + 3, "", MAX(0, fwidth - 3), @@ -354,7 +354,7 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int i hdr->root_iblock_flags); HDfprintf(stream, "%*s%-*s %p\n", indent + 3, "", MAX(0, fwidth - 3), "Root indirect block pointer:", - hdr->root_iblock); + (void *)hdr->root_iblock); if(hdr->root_iblock) H5HF_iblock_print(hdr->root_iblock, dump_internal, stream, indent + 3, fwidth); } /* end if */ @@ -468,7 +468,7 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata) len = end - start; HDsnprintf(temp_str, sizeof(temp_str), "Section #%u:", (unsigned)udata->sect_count); - HDfprintf(udata->stream, "%*s%-*s %8Zu, %8Zu\n", udata->indent + 3, "", MAX(0, udata->fwidth - 9), + HDfprintf(udata->stream, "%*s%-*s %8zu, %8zu\n", udata->indent + 3, "", MAX(0, udata->fwidth - 9), temp_str, start, len); udata->sect_count++; @@ -545,14 +545,14 @@ H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, /* * Print the values. */ - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Address of fractal heap that owns this block:", hdr->heap_addr); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE" \n", indent, "", fwidth, "Offset of direct block in heap:", dblock->block_off); blk_prefix_size = H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Size of block header:", blk_prefix_size); @@ -660,13 +660,13 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, /* * Print the values. */ - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Address of fractal heap that owns this block:", hdr->heap_addr); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE" \n", indent, "", fwidth, "Offset of indirect block in heap:", iblock->block_off); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Size of indirect block:", iblock->size); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, @@ -693,13 +693,13 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, HDsnprintf(temp_str, sizeof(temp_str), "Col #%u:", (unsigned)v); if(hdr->filter_len > 0) - HDfprintf(stream, "%*s%-*s %9a/%6Zu/%x\n", indent + 6, "", MAX(0, fwidth - 6), + HDfprintf(stream, "%*s%-*s %9" PRIuHADDR "/%6zu/%x\n", indent + 6, "", MAX(0, fwidth - 6), temp_str, iblock->ents[off].addr, iblock->filt_ents[off].size, iblock->filt_ents[off].filter_mask); else - HDfprintf(stream, "%*s%-*s %9a\n", indent + 6, "", MAX(0, fwidth - 6), + HDfprintf(stream, "%*s%-*s %9" PRIuHADDR "\n", indent + 6, "", MAX(0, fwidth - 6), temp_str, iblock->ents[off].addr); } /* end for */ @@ -720,7 +720,7 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, size_t off = (u * hdr->man_dtable.cparam.width) + v; HDsnprintf(temp_str, sizeof(temp_str), "Col #%u:", (unsigned)v); - HDfprintf(stream, "%*s%-*s %9a\n", indent + 6, "", MAX(0, fwidth - 6), + HDfprintf(stream, "%*s%-*s %9" PRIuHADDR "\n", indent + 6, "", MAX(0, fwidth - 6), temp_str, iblock->ents[off].addr); } /* end for */ @@ -735,14 +735,14 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, HDfprintf(stream, "%*sFractal Indirect Block Internal Information:\n", indent, ""); /* Print general information */ - HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3), + HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", MAX(0, fwidth - 3), "Reference count:", iblock->rc); /* Print parent's information */ HDfprintf(stream, "%*s%-*s %p\n", indent + 3, "", MAX(0, fwidth - 3), "Parent indirect block address:", - iblock->parent); + (void *)iblock->parent); if(iblock->parent) H5HF_iblock_print(iblock->parent, TRUE, stream, indent + 6, fwidth); } /* end if */ @@ -843,10 +843,10 @@ H5HF_sects_debug_cb(H5FS_section_info_t *_sect, void *_udata) (sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE ? "single" : (sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW ? "first row" : (sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW ? "normal row" : "unknown")))); - HDfprintf(udata->stream, "%*s%-*s %a\n", udata->indent, "", udata->fwidth, + HDfprintf(udata->stream, "%*s%-*s %" PRIuHADDR "\n", udata->indent, "", udata->fwidth, "Section address:", sect->sect_info.addr); - HDfprintf(udata->stream, "%*s%-*s %Hu\n", udata->indent, "", udata->fwidth, + HDfprintf(udata->stream, "%*s%-*s %" PRIuHSIZE "\n", udata->indent, "", udata->fwidth, "Section size:", sect->sect_info.size); #ifdef QAK diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index a6560e2..b5567f0 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -405,7 +405,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, /* Check for skipping over blocks */ if(min_dblock_size > next_size) { -HDfprintf(stderr, "%s: Skipping direct block sizes not supported, min_dblock_size = %Zu, next_size = %Zu\n", FUNC, min_dblock_size, next_size); +HDfprintf(stderr, "%s: Skipping direct block sizes not supported, min_dblock_size = %zu, next_size = %zu\n", FUNC, min_dblock_size, next_size); HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "skipping direct block sizes not supported yet") } /* end if */ diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c index edb0261..a299e47 100644 --- a/src/H5HLdbg.c +++ b/src/H5HLdbg.c @@ -69,10 +69,10 @@ H5HL_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth)) HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, "Header size (in bytes):", (unsigned long)h->prfx_size); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Address of heap data:", h->dblk_addr); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Data bytes allocated for heap:", h->dblk_size); @@ -88,7 +88,7 @@ H5HL_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth)) char temp_str[32]; HDsnprintf(temp_str, sizeof(temp_str), "Block #%d:", free_block); - HDfprintf(stream, "%*s%-*s %8Zu, %8Zu\n", indent+3, "", MAX(0,fwidth-9), temp_str, freelist->offset, freelist->size); + HDfprintf(stream, "%*s%-*s %8zu, %8zu\n", indent+3, "", MAX(0,fwidth-9), temp_str, freelist->offset, freelist->size); if((freelist->offset + freelist->size) > h->dblk_size) HDfprintf(stream, "***THAT FREE BLOCK IS OUT OF BOUNDS!\n"); else { diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index 43e2305..557843e 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -118,13 +118,13 @@ H5MF__sects_debug_cb(H5FS_section_info_t *_sect, void *_udata) (sect->sect_info.type == H5MF_FSPACE_SECT_SIMPLE ? "simple" : (sect->sect_info.type == H5MF_FSPACE_SECT_SMALL ? "small" : (sect->sect_info.type == H5MF_FSPACE_SECT_LARGE ? "large" : "unknown")))); - HDfprintf(udata->stream, "%*s%-*s %a\n", udata->indent, "", udata->fwidth, + HDfprintf(udata->stream, "%*s%-*s %" PRIuHADDR "\n", udata->indent, "", udata->fwidth, "Section address:", sect->sect_info.addr); - HDfprintf(udata->stream, "%*s%-*s %Hu\n", udata->indent, "", udata->fwidth, + HDfprintf(udata->stream, "%*s%-*s %" PRIuHSIZE "\n", udata->indent, "", udata->fwidth, "Section size:", sect->sect_info.size); - HDfprintf(udata->stream, "%*s%-*s %Hu\n", udata->indent, "", udata->fwidth, + HDfprintf(udata->stream, "%*s%-*s %" PRIuHSIZE "\n", udata->indent, "", udata->fwidth, "End of section:", (haddr_t)((sect->sect_info.addr + sect->sect_info.size) - 1)); HDfprintf(udata->stream, "%*s%-*s %s\n", udata->indent, "", udata->fwidth, @@ -237,7 +237,7 @@ HDfprintf(stderr, "%s: Dumping file free space sections\n", FUNC); if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") #ifdef H5MF_ALLOC_DEBUG -HDfprintf(stderr, "%s: for type = H5FD_MEM_DEFAULT, eoa = %a\n", FUNC, eoa); +HDfprintf(stderr, "%s: for type = H5FD_MEM_DEFAULT, eoa = %" PRIuHADDR "\n", FUNC, eoa); #endif /* H5MF_ALLOC_DEBUG */ if(H5F_PAGED_AGGR(f)) { /* File space paging */ @@ -279,13 +279,13 @@ HDfprintf(stderr, "%s: for type = H5FD_MEM_DEFAULT, eoa = %a\n", FUNC, eoa); /* Retrieve metadata aggregator info, if available */ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); #ifdef H5MF_ALLOC_DEBUG -HDfprintf(stderr, "%s: ma_addr = %a, ma_size = %Hu, end of ma = %a\n", FUNC, ma_addr, ma_size, (haddr_t)((ma_addr + ma_size) - 1)); +HDfprintf(stderr, "%s: ma_addr = %" PRIuHADDR ", ma_size = %" PRIuHSIZE ", end of ma = %" PRIuHADDR "\n", FUNC, ma_addr, ma_size, (haddr_t)((ma_addr + ma_size) - 1)); #endif /* H5MF_ALLOC_DEBUG */ /* Retrieve 'small data' aggregator info, if available */ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sda_addr, &sda_size); #ifdef H5MF_ALLOC_DEBUG -HDfprintf(stderr, "%s: sda_addr = %a, sda_size = %Hu, end of sda = %a\n", FUNC, sda_addr, sda_size, (haddr_t)((sda_addr + sda_size) - 1)); +HDfprintf(stderr, "%s: sda_addr = %" PRIuHADDR ", sda_size = %" PRIuHSIZE ", end of sda = %" PRIuHADDR "\n", FUNC, sda_addr, sda_size, (haddr_t)((sda_addr + sda_size) - 1)); #endif /* H5MF_ALLOC_DEBUG */ /* Iterate over all the free space types that have managers and dump each free list's space */ @@ -298,7 +298,7 @@ HDfprintf(stderr, "%s: sda_addr = %a, sda_size = %Hu, end of sda = %a\n", FUNC, /* Retrieve the 'eoa' for this file memory type */ if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, atype))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") - HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3), "eoa:", eoa); + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent + 3, "", MAX(0, fwidth - 3), "eoa:", eoa); /* Print header for sections */ HDfprintf(stream, "%*sSections:\n", indent + 3, ""); diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index 2d95ee9..203a55b 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -519,19 +519,19 @@ H5O__ainfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, HDassert(indent >= 0); HDassert(fwidth >= 0); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Number of attributes:", ainfo->nattrs); - HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, - "Track creation order of attributes:", ainfo->track_corder); - HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, - "Index creation order of attributes:", ainfo->index_corder); + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, + "Track creation order of attributes:", ainfo->track_corder ? "TRUE" : "FALSE"); + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, + "Index creation order of attributes:", ainfo->index_corder ? "TRUE" : "FALSE"); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Max. creation index value:", (unsigned)ainfo->max_crt_idx); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "'Dense' attribute storage fractal heap address:", ainfo->fheap_addr); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "'Dense' attribute storage name index v2 B-tree address:", ainfo->name_bt2_addr); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "'Dense' attribute storage creation order index v2 B-tree address:", ainfo->corder_bt2_addr); diff --git a/src/H5Oattr.c b/src/H5Oattr.c index e38ef5c..83a0c21 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -852,10 +852,10 @@ H5O__attr_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwid HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Character Set of Name:", s); - HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Object opened:", - mesg->obj_opened); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + mesg->obj_opened ? "TRUE" : "FALSE"); + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Object:", mesg->oloc.addr); diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c index 6ac04c8..dad0c9c 100644 --- a/src/H5Ocache_image.c +++ b/src/H5Ocache_image.c @@ -374,10 +374,10 @@ H5O__mdci_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, HDassert(indent >= 0); HDassert(fwidth >= 0); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Metadata Cache Image Block address:", mdci->addr); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Metadata Cache Image Block size in bytes:", mdci->size); FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5Ocont.c b/src/H5Ocont.c index ad54272..2fbd89b 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -273,7 +273,7 @@ H5O__cont_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, HDassert(indent >= 0); HDassert(fwidth >= 0); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Continuation address:", cont->addr); HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, diff --git a/src/H5Odbg.c b/src/H5Odbg.c index 3c91cae..f1d1ad9 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -303,9 +303,9 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int /* debug */ HDfprintf(stream, "%*sObject Header...\n", indent, ""); - HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Dirty:", - oh->cache_info.is_dirty); + oh->cache_info.is_dirty ? "TRUE" : "FALSE"); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Version:", oh->version); @@ -370,10 +370,10 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int } /* end if */ } /* end if */ - HDfprintf(stream, "%*s%-*s %Zu (%Zu)\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu (%zu)\n", indent, "", fwidth, "Number of messages (allocated):", oh->nmesgs, oh->alloc_nmesgs); - HDfprintf(stream, "%*s%-*s %Zu (%Zu)\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu (%zu)\n", indent, "", fwidth, "Number of chunks (allocated):", oh->nchunks, oh->alloc_nchunks); @@ -383,7 +383,7 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int HDfprintf(stream, "%*sChunk %d...\n", indent, "", i); - HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3), + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent + 3, "", MAX(0, fwidth - 3), "Address:", oh->chunk[i].addr); @@ -400,11 +400,11 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int chunk_total += chunk_size; gap_total += oh->chunk[i].gap; - HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3), + HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", MAX(0, fwidth - 3), "Size in bytes:", chunk_size); - HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3), + HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", MAX(0, fwidth - 3), "Gap:", oh->chunk[i].gap); } /* end for */ @@ -438,9 +438,9 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int (unsigned) (oh->mesg[i].type->id), oh->mesg[i].type->name, sequence[oh->mesg[i].type->id]++); - HDfprintf(stream, "%*s%-*s %t\n", indent + 3, "", MAX (0, fwidth - 3), + HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", MAX (0, fwidth - 3), "Dirty:", - oh->mesg[i].dirty); + oh->mesg[i].dirty ? "TRUE" : "FALSE"); HDfprintf(stream, "%*s%-*s ", indent + 3, "", MAX (0, fwidth - 3), "Message flags:"); if(oh->mesg[i].flags) { @@ -499,7 +499,7 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int chunkno = oh->mesg[i].chunkno; if(chunkno >= oh->nchunks) HDfprintf(stream, "*** BAD CHUNK NUMBER\n"); - HDfprintf(stream, "%*s%-*s (%Zu, %Zu) bytes\n", indent + 3, "", MAX(0, fwidth - 3), + HDfprintf(stream, "%*s%-*s (%zu, %zu) bytes\n", indent + 3, "", MAX(0, fwidth - 3), "Raw message data (offset, size) in chunk:", (size_t)(oh->mesg[i].raw - oh->chunk[chunkno].image), oh->mesg[i].raw_size); diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c index eb678e4..0f51646 100644 --- a/src/H5Odrvinfo.c +++ b/src/H5Odrvinfo.c @@ -305,7 +305,7 @@ H5O__drvinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Driver name:", mesg->name); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Buffer size:", mesg->len); FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5Oefl.c b/src/H5Oefl.c index b18d819..f4673dc 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -542,34 +542,34 @@ H5O__efl_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, HDassert(indent >= 0); HDassert(fwidth >= 0); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Heap address:", mesg->heap_addr); - HDfprintf(stream, "%*s%-*s %u/%u\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu/%zu\n", indent, "", fwidth, "Slots used/allocated:", mesg->nused, mesg->nalloc); for(u = 0; u < mesg->nused; u++) { char buf[64]; - HDsnprintf(buf, sizeof(buf), "File %u", (unsigned)u); + HDsnprintf(buf, sizeof(buf), "File %zu", u); HDfprintf(stream, "%*s%s:\n", indent, "", buf); HDfprintf(stream, "%*s%-*s \"%s\"\n", indent+3, "", MAX (fwidth-3, 0), "Name:", mesg->slot[u].name); - HDfprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0), + HDfprintf(stream, "%*s%-*s %zu\n", indent+3, "", MAX (fwidth-3, 0), "Name offset:", - (unsigned long)(mesg->slot[u].name_offset)); + mesg->slot[u].name_offset); - HDfprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0), + HDfprintf(stream, "%*s%-*s %" PRIdMAX "\n", indent+3, "", MAX (fwidth-3, 0), "Offset of data in file:", - (unsigned long)(mesg->slot[u].offset)); + (intmax_t)(mesg->slot[u].offset)); - HDfprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0), + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent+3, "", MAX (fwidth-3, 0), "Bytes reserved for data:", - (unsigned long)(mesg->slot[u].size)); + (mesg->slot[u].size)); } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5Ofill.c b/src/H5Ofill.c index cb75bc3..8a8d5c7 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -950,7 +950,7 @@ H5O__fill_debug(H5F_t H5_ATTR_UNUSED *f, const void *_fill, FILE *stream, break; } /* end switch */ - HDfprintf(stream, "%*s%-*s %Zd\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zd\n", indent, "", fwidth, "Size:", fill->size); HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Data type:"); if(fill->type) { diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index 78e8e19..dcfb1fe 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -464,24 +464,24 @@ H5O__fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, HDfprintf(stream, "%s\n", "unknown"); } /* end switch */ - HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, - "Free-space persist:", fsinfo->persist); + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, + "Free-space persist:", fsinfo->persist ? "TRUE" : "FALSE"); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Free-space section threshold:", fsinfo->threshold); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "File space page size:", fsinfo->page_size); - HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Page end metadata threshold:", fsinfo->pgend_meta_thres); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "eoa_pre_fsm_fsalloc:", fsinfo->eoa_pre_fsm_fsalloc); if(fsinfo->persist) { for(ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++) - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Free space manager address:", fsinfo->fs_addr[ptype-1]); } /* end if */ diff --git a/src/H5Oint.c b/src/H5Oint.c index 04220af..9816661 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -598,7 +598,7 @@ H5O_open(H5O_loc_t *loc) #ifdef H5O_DEBUG if(H5DEBUG(O)) - HDfprintf(H5DEBUG(O), "> %a\n", loc->addr); + HDfprintf(H5DEBUG(O), "> %" PRIuHADDR "\n", loc->addr); #endif /* Turn off the variable for holding file or increment open-lock counters */ @@ -834,9 +834,9 @@ H5O_close(H5O_loc_t *loc, hbool_t *file_closed /*out*/) #ifdef H5O_DEBUG if(H5DEBUG(O)) { if(FALSE == H5F_ID_EXISTS(loc->file) && 1 == H5F_NREFS(loc->file)) - HDfprintf(H5DEBUG(O), "< %a auto %lu remaining\n", loc->addr, (unsigned long)H5F_NOPEN_OBJS(loc->file)); + HDfprintf(H5DEBUG(O), "< %" PRIuHADDR " auto %lu remaining\n", loc->addr, (unsigned long)H5F_NOPEN_OBJS(loc->file)); else - HDfprintf(H5DEBUG(O), "< %a\n", loc->addr); + HDfprintf(H5DEBUG(O), "< %" PRIuHADDR "\n", loc->addr); } #endif diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 8e6e204..c265db1 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -1172,35 +1172,35 @@ H5O__layout_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, "Index Type:", "Unknown", (unsigned)mesg->u.chunk.idx_type); break; } /* end switch */ - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Index address:", mesg->storage.u.chunk.idx_addr); break; case H5D_CONTIGUOUS: HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Contiguous"); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Data address:", mesg->storage.u.contig.addr); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Data Size:", mesg->storage.u.contig.size); break; case H5D_COMPACT: HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Compact"); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Data Size:", mesg->storage.u.compact.size); break; case H5D_VIRTUAL: HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Virtual"); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Global heap address:", mesg->storage.u.virt.serial_list_hobjid.addr); - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Global heap index:", mesg->storage.u.virt.serial_list_hobjid.idx); for(u = 0; u < mesg->storage.u.virt.list_nused; u++) { - HDfprintf(stream, "%*sMapping %u:\n", indent, "", u); + HDfprintf(stream, "%*sMapping %zu:\n", indent, "", u); HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth - 3, "Virtual selection:", ""); HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth - 3, diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index a2f88d9..bb09b76 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -568,19 +568,19 @@ H5O__linfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, HDassert(indent >= 0); HDassert(fwidth >= 0); - HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, - "Track creation order of links:", linfo->track_corder); - HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, - "Index creation order of links:", linfo->index_corder); - HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, + "Track creation order of links:", linfo->track_corder ? "TRUE" : "FALSE"); + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, + "Index creation order of links:", linfo->index_corder ? "TRUE" : "FALSE"); + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Number of links:", linfo->nlinks); - HDfprintf(stream, "%*s%-*s %Hd\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRId64 "\n", indent, "", fwidth, "Max. creation order value:", linfo->max_corder); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "'Dense' link storage fractal heap address:", linfo->fheap_addr); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "'Dense' link storage name index v2 B-tree address:", linfo->name_bt2_addr); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "'Dense' link storage creation order index v2 B-tree address:", linfo->corder_bt2_addr); diff --git a/src/H5Olink.c b/src/H5Olink.c index 1f0c6c7..f052a53 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -822,7 +822,7 @@ H5O__link_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, (lnk->type >= H5L_TYPE_UD_MIN ? "User-defined" : "Unknown"))))); if(lnk->corder_valid) - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Creation Order:", lnk->corder); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, @@ -834,7 +834,7 @@ H5O__link_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, /* Display link-specific information */ switch(lnk->type) { case H5L_TYPE_HARD: - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Object address:", lnk->u.hard.addr); break; @@ -852,12 +852,13 @@ H5O__link_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, const char *objname = (const char *)lnk->u.ud.udata + (HDstrlen((const char *)lnk->u.ud.udata) + 1); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "External File Name:", lnk->u.ud.udata); + "External File Name:", + (const char *)lnk->u.ud.udata); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "External Object Name:", objname); } /* end if */ else { - HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "User-Defined Link Size:", lnk->u.ud.size); } /* end else */ } /* end if */ diff --git a/src/H5Opline.c b/src/H5Opline.c index a956725..d886c74 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -656,7 +656,7 @@ H5O__pline_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE *stream, HDassert(indent >= 0); HDassert(fwidth >= 0); - HDfprintf(stream, "%*s%-*s %Zu/%Zu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu/%zu\n", indent, "", fwidth, "Number of filters:", pline->nused, pline->nalloc); @@ -680,7 +680,7 @@ H5O__pline_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE *stream, HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3), "Flags:", pline->filter[i].flags); - HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3), + HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", MAX(0, fwidth - 3), "Num CD values:", pline->filter[i].cd_nelmts); diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 33310dc..2d9361e 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -521,7 +521,7 @@ H5O__sdspace_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE * stream, HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Dim Size:"); for(u = 0; u < sdim->rank; u++) - HDfprintf (stream, "%s%Hu", u?", ":"", sdim->size[u]); + HDfprintf (stream, "%s%" PRIuHSIZE, u?", ":"", sdim->size[u]); HDfprintf (stream, "}\n"); HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Dim Max:"); @@ -531,7 +531,7 @@ H5O__sdspace_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE * stream, if(H5S_UNLIMITED==sdim->max[u]) HDfprintf (stream, "%sUNLIM", u?", ":""); else - HDfprintf (stream, "%s%Hu", u?", ":"", sdim->max[u]); + HDfprintf (stream, "%s%" PRIuHSIZE, u?", ":"", sdim->max[u]); } /* end for */ HDfprintf (stream, "}\n"); } /* end if */ diff --git a/src/H5Oshared.c b/src/H5Oshared.c index b49e501..6922ce3 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -733,7 +733,7 @@ H5O__shared_debug(const H5O_shared_t *mesg, FILE *stream, int indent, int fwidth HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Shared Message type:", "Obj Hdr"); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Object address:", mesg->u.loc.oh_addr); break; diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c index 136268a..b33a6db 100644 --- a/src/H5Oshmesg.c +++ b/src/H5Oshmesg.c @@ -238,7 +238,7 @@ H5O__shmesg_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Version:", mesg->version); - HDfprintf(stream, "%*s%-*s %a (rel)\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR " (rel)\n", indent, "", fwidth, "Shared message table address:", mesg->addr); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Number of indexes:", mesg->nindexes); diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 0f14a4b..9432f4f 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -437,10 +437,10 @@ H5O__stab_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, HDassert(indent >= 0); HDassert(fwidth >= 0); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "B-tree address:", stab->btree_addr); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Name heap address:", stab->heap_addr); FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5SM.c b/src/H5SM.c index 6eea80d..8d2f43b 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -2587,19 +2587,19 @@ H5SM_table_debug(H5F_t *f, haddr_t table_addr, FILE *stream, int indent, (table->indexes[x].index_type == H5SM_LIST ? "List" : (table->indexes[x].index_type == H5SM_BTREE ? "B-Tree" : "Unknown"))); - HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent + 3, "", fwidth, "Address of index:", table->indexes[x].index_addr); - HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent + 3, "", fwidth, "Address of index's heap:", table->indexes[x].heap_addr); HDfprintf(stream, "%*s%-*s 0x%08x\n", indent + 3, "", fwidth, "Message type flags:", table->indexes[x].mesg_types); - HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", fwidth, "Minimum size of messages:", table->indexes[x].min_mesg_size); - HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", fwidth, "Number of messages:", table->indexes[x].num_messages); - HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", fwidth, "Maximum list size:", table->indexes[x].list_max); - HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", fwidth, "Minimum B-tree size:", table->indexes[x].btree_min); } /* end for */ @@ -2687,17 +2687,17 @@ H5SM_list_debug(H5F_t *f, haddr_t list_addr, FILE *stream, int indent, HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth, "Location:", "in heap"); - HDfprintf(stream, "%*s%-*s 0x%Zx\n", indent + 3, "", fwidth, - "Heap ID:", list->messages[x].u.heap_loc.fheap_id); - HDfprintf(stream, "%*s%-*s %u\n", indent + 3, "", fwidth, + HDfprintf(stream, "%*s%-*s 0x%" PRIx64 "\n", indent + 3, "", fwidth, + "Heap ID:", list->messages[x].u.heap_loc.fheap_id.val); + HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent + 3, "", fwidth, "Reference count:", list->messages[x].u.heap_loc.ref_count); } /* end if */ else if(list->messages[x].location == H5SM_IN_OH) { HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth, "Location:", "in object header"); - HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent + 3, "", fwidth, "Object header address:", list->messages[x].u.mesg_loc.oh_addr); - HDfprintf(stream, "%*s%-*s %u\n", indent + 3, "", fwidth, + HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent + 3, "", fwidth, "Message creation index:", list->messages[x].u.mesg_loc.oh_addr); HDfprintf(stream, "%*s%-*s %u\n", indent + 3, "", fwidth, "Message type ID:", list->messages[x].msg_type_id); diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c index 7f6c804..e6dc76e 100644 --- a/src/H5SMbtree2.c +++ b/src/H5SMbtree2.c @@ -199,12 +199,12 @@ H5SM__bt2_debug(FILE *stream, int indent, int fwidth, FUNC_ENTER_STATIC_NOERR if(sohm->location == H5SM_IN_HEAP) - HDfprintf(stream, "%*s%-*s {%a, %lo, %Hx}\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s {%" PRIu64 ", %" PRIo32 ", %" PRIxHSIZE "}\n", indent, "", fwidth, "Shared Message in heap:", - sohm->u.heap_loc.fheap_id, sohm->hash, sohm->u.heap_loc.ref_count); + sohm->u.heap_loc.fheap_id.val, sohm->hash, sohm->u.heap_loc.ref_count); else { HDassert(sohm->location == H5SM_IN_OH); - HDfprintf(stream, "%*s%-*s {%a, %lo, %Hx, %Hx}\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %" PRIo32 ", %x, %" PRIx32 "}\n", indent, "", fwidth, "Shared Message in OH:", sohm->u.mesg_loc.oh_addr, sohm->hash, sohm->msg_type_id, sohm->u.mesg_loc.index); } /* end else */ diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 06eb44e..db76543 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -911,15 +911,15 @@ done: \ # define CI_PRINT_STATS(STYPE,DTYPE) { \ if (H5DEBUG(T) && ((H5T_conv_hw_t *)cdata->priv)->s_aligned) { \ HDfprintf(H5DEBUG(T), \ - " %Hu src elements aligned on %lu-byte boundaries\n", \ + " %zu src elements aligned on %zu-byte boundaries\n", \ ((H5T_conv_hw_t *)cdata->priv)->s_aligned, \ - (unsigned long)H5T_NATIVE_##STYPE##_ALIGN_g); \ + H5T_NATIVE_##STYPE##_ALIGN_g); \ } \ if (H5DEBUG(T) && ((H5T_conv_hw_t *)cdata->priv)->d_aligned) { \ HDfprintf(H5DEBUG(T), \ - " %Hu dst elements aligned on %lu-byte boundaries\n", \ + " %zu dst elements aligned on %zu-byte boundaries\n", \ ((H5T_conv_hw_t *)cdata->priv)->d_aligned, \ - (unsigned long)H5T_NATIVE_##DTYPE##_ALIGN_g); \ + H5T_NATIVE_##DTYPE##_ALIGN_g); \ } \ } diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index 7af736a..6172611 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -101,16 +101,25 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* if(H5DEBUG(T) && path->stats.ncalls > 0) { hsize_t nbytes; char bandwidth[32]; - - if(nprint && 0 == (*nprint)++) { - HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "Conversion", "Elmts", "Calls", "User", - "System", "Elapsed", "Bandwidth"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "----------", "-----", "-----", "----", - "------", "-------", "---------"); - } /* end if */ + struct { + char *user; + char *system; + char *elapsed; + } timestrs = { + H5_timer_get_time_string(path->stats.times.user), + H5_timer_get_time_string(path->stats.times.system), + H5_timer_get_time_string(path->stats.times.elapsed) + }; + + if(nprint && 0 == (*nprint)++) { + HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", + "Conversion", "Elmts", "Calls", "User", + "System", "Elapsed", "Bandwidth"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", + "----------", "-----", "-----", "----", + "------", "-------", "---------"); + } /* end if */ if(path->src && path->dst) nbytes = MAX(H5T_get_size(path->src), H5T_get_size(path->dst)); @@ -120,18 +129,15 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* nbytes = H5T_get_size(path->dst); else nbytes = 0; - - nbytes *= path->stats.nelmts; + nbytes *= path->stats.nelmts; H5_bandwidth(bandwidth, (double)nbytes, path->stats.times.elapsed); - HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8T %8T %8T %10s\n", - path->name, - path->stats.nelmts, - path->stats.ncalls, - path->stats.times.user, - path->stats.times.system, - path->stats.times.elapsed, - bandwidth); - } /* end if */ + HDfprintf(H5DEBUG(T), " %-16s %10" PRIdHSIZE " %10u %8s %8s %8s %10s\n", + path->name, path->stats.nelmts, path->stats.ncalls, + timestrs.user, timestrs.system, timestrs.elapsed, bandwidth); + free(timestrs.user); + free(timestrs.system); + free(timestrs.elapsed); + } #endif FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5Z.c b/src/H5Z.c index af5b888..2103a08 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -137,48 +137,61 @@ H5Z_term_package(void) size_t i; if(H5DEBUG(Z)) { - for(i = 0; i < H5Z_table_used_g; i++) { - for(dir = 0; dir<2; dir++) { - if(0 == H5Z_stat_table_g[i].stats[dir].total) - continue; - - if(0 == nprint++) { - /* Print column headers */ - HDfprintf(H5DEBUG(Z), "H5Z: filter statistics " - "accumulated over life of library:\n"); - HDfprintf(H5DEBUG(Z), - " %-16s %10s %10s %8s %8s %8s %10s\n", - "Filter", "Total", "Errors", "User", - "System", "Elapsed", "Bandwidth"); - HDfprintf(H5DEBUG(Z), - " %-16s %10s %10s %8s %8s %8s %10s\n", - "------", "-----", "------", "----", - "------", "-------", "---------"); - } /* end if */ - - /* Truncate the comment to fit in the field */ - HDstrncpy(comment, H5Z_table_g[i].name, sizeof comment); - comment[sizeof(comment) - 1] = '\0'; - - /* - * Format bandwidth to have four significant digits and - * units of `B/s', `kB/s', `MB/s', `GB/s', or `TB/s' or - * the word `Inf' if the elapsed time is zero. - */ - H5_bandwidth(bandwidth, (double)(H5Z_stat_table_g[i].stats[dir].total), - H5Z_stat_table_g[i].stats[dir].times.elapsed); - - /* Print the statistics */ - HDfprintf(H5DEBUG(Z), " %s%-15s %10Hd %10Hd %8T %8T %8T %10s\n", - (dir ? "<" : ">"), comment, - H5Z_stat_table_g[i].stats[dir].total, - H5Z_stat_table_g[i].stats[dir].errors, - H5Z_stat_table_g[i].stats[dir].times.user, - H5Z_stat_table_g[i].stats[dir].times.system, - H5Z_stat_table_g[i].stats[dir].times.elapsed, - bandwidth); - } /* end for */ - } /* end for */ + for(i = 0; i < H5Z_table_used_g; i++) for (dir = 0; dir<2; dir++) { + struct { + char *user; + char *system; + char *elapsed; + } timestrs = { + H5_timer_get_time_string(H5Z_stat_table_g[i].stats[dir].times.user), + H5_timer_get_time_string(H5Z_stat_table_g[i].stats[dir].times.system), + H5_timer_get_time_string(H5Z_stat_table_g[i].stats[dir].times.elapsed) + }; + if(0 == H5Z_stat_table_g[i].stats[dir].total) + goto next; + + if(0 == nprint++) { + /* Print column headers */ + HDfprintf(H5DEBUG(Z), "H5Z: filter statistics " + "accumulated over life of library:\n"); + HDfprintf(H5DEBUG(Z), + " %-16s %10s %10s %8s %8s %8s %10s\n", + "Filter", "Total", "Errors", "User", + "System", "Elapsed", "Bandwidth"); + HDfprintf(H5DEBUG(Z), + " %-16s %10s %10s %8s %8s %8s %10s\n", + "------", "-----", "------", "----", + "------", "-------", "---------"); + } /* end if */ + + /* Truncate the comment to fit in the field */ + HDstrncpy(comment, H5Z_table_g[i].name, sizeof comment); + comment[sizeof(comment) - 1] = '\0'; + + /* + * Format bandwidth to have four significant digits and + * units of `B/s', `kB/s', `MB/s', `GB/s', or `TB/s' or + * the word `Inf' if the elapsed time is zero. + */ + H5_bandwidth(bandwidth, (double)(H5Z_stat_table_g[i].stats[dir].total), + H5Z_stat_table_g[i].stats[dir].times.elapsed); + + /* Print the statistics */ + HDfprintf(H5DEBUG(Z), + " %s%-15s %10" PRIdHSIZE " %10" PRIdHSIZE + " %8s %8s %8s %10s\n", + (dir ? "<" : ">"), comment, + H5Z_stat_table_g[i].stats[dir].total, + H5Z_stat_table_g[i].stats[dir].errors, + timestrs.user, + timestrs.system, + timestrs.elapsed, + bandwidth); +next: + free(timestrs.user); + free(timestrs.system); + free(timestrs.elapsed); + } /* end for */ } /* end if */ #endif /* H5Z_DEBUG */ diff --git a/src/H5dbg.c b/src/H5dbg.c index 4939bca..4878884 100644 --- a/src/H5dbg.c +++ b/src/H5dbg.c @@ -100,7 +100,7 @@ H5_buffer_dump(FILE *stream, int indent, const uint8_t *buf, for(u = 0; u < buf_size; u += 16) { uint8_t c; - HDfprintf(stream, "%*s %8d: ", indent, "", u + buf_offset); + HDfprintf(stream, "%*s %8zu: ", indent, "", u + buf_offset); /* Print the hex values */ for(v = 0; v < 16; v++) { diff --git a/src/H5private.h b/src/H5private.h index 836d7d5..3c21d3e 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -687,6 +687,11 @@ typedef struct { #ifndef HDacos #define HDacos(X) acos(X) #endif /* HDacos */ +#ifndef HDvasprintf +# ifdef H5_HAVE_VASPRINTF +# define HDvasprintf(RET,FMT,A) vasprintf(RET,FMT,A) +# endif /* H5_HAVE_VASPRINTF */ +#endif /* HDvasprintf */ #ifndef HDalarm #ifdef H5_HAVE_ALARM #define HDalarm(N) alarm(N) @@ -912,10 +917,12 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDfork #define HDfork() fork() #endif /* HDfork */ +#ifndef HDfprintf +#define HDfprintf fprintf +#endif #ifndef HDfpathconf #define HDfpathconf(F,N) fpathconf(F,N) #endif /* HDfpathconf */ -H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #ifndef HDfputc #define HDfputc(C,F) fputc(C,F) #endif /* HDfputc */ @@ -1248,7 +1255,7 @@ typedef off_t h5_stat_size_t; #define HDpread(F,B,C,O) pread(F,B,C,O) #endif /* HDpread */ #ifndef HDprintf - #define HDprintf(...) HDfprintf(stdout, __VA_ARGS__) + #define HDprintf printf #endif /* HDprintf */ #ifndef HDputc #define HDputc(C,F) putc(C,F) @@ -1610,9 +1617,6 @@ typedef off_t h5_stat_size_t; #ifndef HDva_start #define HDva_start(A,P) va_start(A,P) #endif /* HDva_start */ -#ifndef HDvasprintf - #define HDvasprintf(RET,FMT,A) vasprintf(RET,FMT,A) -#endif /* HDvasprintf */ #ifndef HDvfprintf #define HDvfprintf(F,FMT,A) vfprintf(F,FMT,A) #endif /* HDvfprintf */ diff --git a/src/H5public.h b/src/H5public.h index 93cb2ea..68f6e02 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -177,42 +177,82 @@ typedef long long ssize_t; #endif #endif +/* int64_t type is used for creation order field for links. It may be + * defined in Posix.1g, otherwise it is defined here. + */ +#if H5_SIZEOF_INT64_T>=8 +#elif H5_SIZEOF_INT>=8 + typedef int int64_t; +# undef H5_SIZEOF_INT64_T +# define H5_SIZEOF_INT64_T H5_SIZEOF_INT +#elif H5_SIZEOF_LONG>=8 + typedef long int64_t; +# undef H5_SIZEOF_INT64_T +# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG +#elif H5_SIZEOF_LONG_LONG>=8 + typedef long long int64_t; +# undef H5_SIZEOF_INT64_T +# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG_LONG +#else +# error "nothing appropriate for int64_t" +#endif + +/* uint64_t type is used for fields for H5O_info_t. It may be + * defined in Posix.1g, otherwise it is defined here. + */ +#if H5_SIZEOF_UINT64_T>=8 +#elif H5_SIZEOF_INT>=8 + typedef unsigned uint64_t; +# undef H5_SIZEOF_UINT64_T +# define H5_SIZEOF_UINT64_T H5_SIZEOF_INT +#elif H5_SIZEOF_LONG>=8 + typedef unsigned long uint64_t; +# undef H5_SIZEOF_UINT64_T +# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG +#elif H5_SIZEOF_LONG_LONG>=8 + typedef unsigned long long uint64_t; +# undef H5_SIZEOF_UINT64_T +# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG_LONG +#else +# error "nothing appropriate for uint64_t" +#endif + /* * The sizes of file objects have their own types defined here, use a 64-bit * type. */ -#if H5_SIZEOF_LONG_LONG >= 8 -H5_GCC_DIAG_OFF(long-long) -typedef unsigned long long hsize_t; -typedef signed long long hssize_t; -H5_GCC_DIAG_ON(long-long) -# define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG -# define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG -#else -# error "nothing appropriate for hsize_t" -#endif -#define HSIZE_UNDEF ((hsize_t)(hssize_t)(-1)) +typedef uint64_t hsize_t; +typedef int64_t hssize_t; +#define PRIXHSIZE PRIX64 +#define PRIdHSIZE PRId64 +#define PRIiHSIZE PRIi64 +#define PRIoHSIZE PRIo64 +#define PRIuHSIZE PRIu64 +#define PRIxHSIZE PRIx64 +#define H5_SIZEOF_HSIZE_T H5_SIZEOF_UINT64_T +#define H5_SIZEOF_HSSIZE_T H5_SIZEOF_INT64_T +#define HSIZE_UNDEF UINT64_MAX /* * File addresses have their own types. */ #if H5_SIZEOF_INT >= 8 typedef unsigned haddr_t; -# define HADDR_UNDEF ((haddr_t)(-1)) +# define HADDR_UNDEF UINT_MAX # define H5_SIZEOF_HADDR_T H5_SIZEOF_INT # ifdef H5_HAVE_PARALLEL # define HADDR_AS_MPI_TYPE MPI_UNSIGNED # endif /* H5_HAVE_PARALLEL */ #elif H5_SIZEOF_LONG >= 8 typedef unsigned long haddr_t; -# define HADDR_UNDEF ((haddr_t)(long)(-1)) +# define HADDR_UNDEF ULONG_MAX # define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG # ifdef H5_HAVE_PARALLEL # define HADDR_AS_MPI_TYPE MPI_UNSIGNED_LONG # endif /* H5_HAVE_PARALLEL */ #elif H5_SIZEOF_LONG_LONG >= 8 typedef unsigned long long haddr_t; -# define HADDR_UNDEF ((haddr_t)(long long)(-1)) +# define HADDR_UNDEF ULLONG_MAX # define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG_LONG # ifdef H5_HAVE_PARALLEL # define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT @@ -221,14 +261,24 @@ H5_GCC_DIAG_ON(long-long) # error "nothing appropriate for haddr_t" #endif #if H5_SIZEOF_HADDR_T == H5_SIZEOF_INT -# define H5_PRINTF_HADDR_FMT "%u" +# define PRIXHADDR "X" +# define PRIoHADDR "o" +# define PRIuHADDR "u" +# define PRIxHADDR "x" #elif H5_SIZEOF_HADDR_T == H5_SIZEOF_LONG -# define H5_PRINTF_HADDR_FMT "%lu" +# define PRIXHADDR "lX" +# define PRIoHADDR "lo" +# define PRIuHADDR "lu" +# define PRIxHADDR "lx" #elif H5_SIZEOF_HADDR_T == H5_SIZEOF_LONG_LONG -# define H5_PRINTF_HADDR_FMT "%" H5_PRINTF_LL_WIDTH "u" +# define PRIXHADDR H5_PRINTF_LL_WIDTH "X" +# define PRIoHADDR H5_PRINTF_LL_WIDTH "o" +# define PRIuHADDR H5_PRINTF_LL_WIDTH "u" +# define PRIxHADDR H5_PRINTF_LL_WIDTH "x" #else # error "nothing appropriate for H5_PRINTF_HADDR_FMT" #endif +#define H5_PRINTF_HADDR_FMT "%" PRIuHADDR #define HADDR_MAX (HADDR_UNDEF-1) /* uint32_t type is used for creation order field for messages. It may be @@ -251,46 +301,6 @@ H5_GCC_DIAG_ON(long-long) # error "nothing appropriate for uint32_t" #endif -/* int64_t type is used for creation order field for links. It may be - * defined in Posix.1g, otherwise it is defined here. - */ -#if H5_SIZEOF_INT64_T>=8 -#elif H5_SIZEOF_INT>=8 - typedef int int64_t; -# undef H5_SIZEOF_INT64_T -# define H5_SIZEOF_INT64_T H5_SIZEOF_INT -#elif H5_SIZEOF_LONG>=8 - typedef long int64_t; -# undef H5_SIZEOF_INT64_T -# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG -#elif H5_SIZEOF_LONG_LONG>=8 - typedef long long int64_t; -# undef H5_SIZEOF_INT64_T -# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG_LONG -#else -# error "nothing appropriate for int64_t" -#endif - -/* uint64_t type is used for fields for H5O_info_t. It may be - * defined in Posix.1g, otherwise it is defined here. - */ -#if H5_SIZEOF_UINT64_T>=8 -#elif H5_SIZEOF_INT>=8 - typedef unsigned uint64_t; -# undef H5_SIZEOF_UINT64_T -# define H5_SIZEOF_UINT64_T H5_SIZEOF_INT -#elif H5_SIZEOF_LONG>=8 - typedef unsigned long uint64_t; -# undef H5_SIZEOF_UINT64_T -# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG -#elif H5_SIZEOF_LONG_LONG>=8 - typedef unsigned long long uint64_t; -# undef H5_SIZEOF_UINT64_T -# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG_LONG -#else -# error "nothing appropriate for uint64_t" -#endif - /* Common iteration orders */ typedef enum { H5_ITER_UNKNOWN = -1, /* Unknown order */ diff --git a/src/H5system.c b/src/H5system.c index b3db39c..f5c3fae 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -73,407 +73,28 @@ /* Track whether tzset routine was called */ static hbool_t H5_ntzset = FALSE; - -/*------------------------------------------------------------------------- - * Function: HDfprintf - * - * Purpose: Prints the optional arguments under the control of the format - * string FMT to the stream STREAM. This function takes the - * same format as fprintf(3c) with a few added features: - * - * The conversion modifier `H' refers to the size of an - * `hsize_t' or `hssize_t' type. For instance, "0x%018Hx" - * prints an `hsize_t' value as a hex number right justified and - * zero filled in an 18-character field. - * - * The conversion 'a' refers to an haddr_t type. - * - * The conversion 't' refers to an htri_t type. - * - * The conversion 'k' refers to an H5O_token_t type. - * - * Return: Success: Number of characters printed - * - * Failure: -1 - * - * Programmer: Robb Matzke - * Thursday, April 9, 1998 - * - *------------------------------------------------------------------------- +/* HDvasprintf provides vasprintf-like function on targets where it is + * unavailable. */ -/* Disable warning for "format not a string literal" here -QAK */ -/* - * This pragma only needs to surround the fprintf() calls with - * format_templ in the code below, but early (4.4.7, at least) gcc only - * allows diagnostic pragmas to be toggled outside of functions. - */ -H5_GCC_DIAG_OFF(format-nonliteral) int -HDfprintf(FILE *stream, const char *fmt, ...) +HDvasprintf(char **bufp, const char *fmt, va_list ap) { - int n=0, nout = 0; - int fwidth, prec; - int zerofill; - int leftjust; - int plussign; - int ldspace; - int prefix; - char modifier[8]; - int conv; - char *rest, format_templ[128]; - int len; - const char *s; - va_list ap; - - HDassert(stream); - HDassert(fmt); - - HDva_start (ap, fmt); - while (*fmt) { - fwidth = prec = 0; - zerofill = 0; - leftjust = 0; - plussign = 0; - prefix = 0; - ldspace = 0; - modifier[0] = '\0'; - - if ('%'==fmt[0] && '%'==fmt[1]) { - HDputc ('%', stream); - fmt += 2; - nout++; - } else if ('%'==fmt[0]) { - s = fmt + 1; - - /* Flags */ - while(HDstrchr("-+ #", *s)) { - switch(*s) { - case '-': - leftjust = 1; - break; - - case '+': - plussign = 1; - break; - - case ' ': - ldspace = 1; - break; - - case '#': - prefix = 1; - break; - - default: - HDassert(0 && "Unknown format flag"); - } /* end switch */ /*lint !e744 Switch statement doesn't _need_ default */ - s++; - } /* end while */ - - /* Field width */ - if(HDisdigit(*s)) { - zerofill = ('0' == *s); - fwidth = (int)HDstrtol (s, &rest, 10); - s = rest; - } /* end if */ - else if ('*'==*s) { - fwidth = HDva_arg(ap, int); - if(fwidth < 0) { - leftjust = 1; - fwidth = -fwidth; - } - s++; - } - - /* Precision */ - if('.'==*s) { - s++; - if(HDisdigit(*s)) { - prec = (int)HDstrtol(s, &rest, 10); - s = rest; - } else if('*'==*s) { - prec = HDva_arg(ap, int); - s++; - } - if(prec < 1) - prec = 1; - } - - /* Extra type modifiers */ - if(HDstrchr("zZHhlqLI", *s)) { - switch(*s) { - /*lint --e{506} Don't issue warnings about constant value booleans */ - /*lint --e{774} Don't issue warnings boolean within 'if' always evaluates false/true */ - case 'H': - if(sizeof(hsize_t) < sizeof(long)) - modifier[0] = '\0'; - else if(sizeof(hsize_t) == sizeof(long)) { - HDstrncpy(modifier, "l", sizeof(modifier)); - modifier[sizeof(modifier) - 1] = '\0'; - } /* end if */ - else { - HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, sizeof(modifier)); - modifier[sizeof(modifier) - 1] = '\0'; - } /* end else */ - break; - - case 'Z': - case 'z': - if(sizeof(size_t) < sizeof(long)) - modifier[0] = '\0'; - else if(sizeof(size_t) == sizeof(long)) { - HDstrncpy(modifier, "l", sizeof(modifier)); - modifier[sizeof(modifier) - 1] = '\0'; - } /* end if */ - else { - HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, sizeof(modifier)); - modifier[sizeof(modifier) - 1] = '\0'; - } /* end else */ - break; - - default: - /* Handle 'I64' modifier for Microsoft's "__int64" type */ - if(*s=='I' && *(s+1)=='6' && *(s+2)=='4') { - modifier[0] = *s; - modifier[1] = *(s+1); - modifier[2] = *(s+2); - modifier[3] = '\0'; - s += 2; /* Increment over 'I6', the '4' is taken care of below */ - } /* end if */ - else { - /* Handle 'll' for long long types */ - if(*s=='l' && *(s+1)=='l') { - modifier[0] = *s; - modifier[1] = *s; - modifier[2] = '\0'; - s++; /* Increment over first 'l', second is taken care of below */ - } /* end if */ - else { - modifier[0] = *s; - modifier[1] = '\0'; - } /* end else */ - } /* end else */ - break; - } - s++; - } - - /* Conversion */ - conv = *s++; - - /* Create the format template */ - len = 0; - len += HDsnprintf(format_templ, (sizeof(format_templ) - (size_t)(len + 1)), "%%%s%s%s%s%s", (leftjust ? "-" : ""), - (plussign ? "+" : ""), (ldspace ? " " : ""), - (prefix ? "#" : ""), (zerofill ? "0" : "")); - if(fwidth > 0) - len += HDsnprintf(format_templ + len, (sizeof(format_templ) - (size_t)(len + 1)), "%d", fwidth); - if(prec > 0) - len += HDsnprintf(format_templ + len, (sizeof(format_templ) - (size_t)(len + 1)), ".%d", prec); - if(*modifier) - len += HDsnprintf(format_templ + len, (sizeof(format_templ) - (size_t)(len + 1)), "%s", modifier); - HDsnprintf(format_templ + len, (sizeof(format_templ) - (size_t)(len + 1)), "%c", conv); - - /* Conversion */ - switch (conv) { - case 'd': - case 'i': - if(!HDstrcmp(modifier, "h")) { - short x = (short)HDva_arg(ap, int); - n = fprintf(stream, format_templ, x); - } else if(!*modifier) { - int x = HDva_arg(ap, int); - n = fprintf(stream, format_templ, x); - } else if(!HDstrcmp(modifier, "l")) { - long x = HDva_arg(ap, long); - n = fprintf(stream, format_templ, x); - } else { - int64_t x = HDva_arg(ap, int64_t); - n = fprintf(stream, format_templ, x); - } - break; - - case 'o': - case 'u': - case 'x': - case 'X': - if(!HDstrcmp(modifier, "h")) { - unsigned short x = (unsigned short)HDva_arg(ap, unsigned int); - n = fprintf(stream, format_templ, x); - } else if(!*modifier) { - unsigned int x = HDva_arg(ap, unsigned int); - n = fprintf(stream, format_templ, x); - } else if(!HDstrcmp(modifier, "l")) { - unsigned long x = HDva_arg(ap, unsigned long); - n = fprintf(stream, format_templ, x); - } else { - uint64_t x = HDva_arg(ap, uint64_t); - n = fprintf(stream, format_templ, x); - } - break; - - case 'f': - case 'e': - case 'E': - case 'g': - case 'G': - if(!HDstrcmp(modifier, "h")) { - float x = (float)HDva_arg(ap, double); - n = fprintf(stream, format_templ, (double)x); - } else if(!*modifier || !HDstrcmp(modifier, "l")) { - double x = HDva_arg(ap, double); - n = fprintf(stream, format_templ, x); - } else { - /* - * Some compilers complain when `long double' and - * `double' are the same thing. - */ -#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE - long double x = HDva_arg(ap, long double); - n = fprintf(stream, format_templ, x); -#else - double x = HDva_arg(ap, double); - n = fprintf(stream, format_templ, x); -#endif - } - break; - - case 'a': - { - haddr_t x = HDva_arg(ap, haddr_t); - - if(H5F_addr_defined(x)) { - len = 0; - len += HDsnprintf(format_templ, (sizeof(format_templ) - (size_t)(len + 1)), "%%%s%s%s%s%s", - (leftjust ? "-" : ""), (plussign ? "+" : ""), - (ldspace ? " " : ""), (prefix ? "#" : ""), - (zerofill ? "0" : "")); - if(fwidth > 0) - len += HDsnprintf(format_templ + len, (sizeof(format_templ) - (size_t)(len + 1)), "%d", fwidth); - - /*lint --e{506} Don't issue warnings about constant value booleans */ - /*lint --e{774} Don't issue warnings boolean within 'if' always evaluates false/true */ - if(sizeof(x) == H5_SIZEOF_INT) { - HDstrncat(format_templ, "u", (sizeof(format_templ) - (size_t)(len + 1))); - len++; - } /* end if */ - else if(sizeof(x) == H5_SIZEOF_LONG) { - HDstrncat(format_templ, "lu", (sizeof(format_templ) - (size_t)(len + 1))); - len++; - } /* end if */ - else if(sizeof(x) == H5_SIZEOF_LONG_LONG) { - HDstrncat(format_templ, H5_PRINTF_LL_WIDTH, (sizeof(format_templ) - (size_t)(len + 1))); - len += (int)sizeof(H5_PRINTF_LL_WIDTH); - HDstrncat(format_templ, "u", (sizeof(format_templ) - (size_t)(len + 1))); - len++; - } - n = fprintf(stream, format_templ, x); - } else { - len = 0; - HDstrncpy(format_templ, "%", (sizeof(format_templ) - (size_t)(len + 1))); - len++; - if(leftjust) { - HDstrncat(format_templ, "-", (sizeof(format_templ) - (size_t)(len + 1))); - len++; - } /* end if */ - if(fwidth) - len += HDsnprintf(format_templ + len, (sizeof(format_templ) - (size_t)(len + 1)), "%d", fwidth); - HDstrncat(format_templ, "s", (sizeof(format_templ) - (size_t)(len + 1))); - n = fprintf(stream, format_templ, "UNDEF"); - } - } - break; - - case 'c': - { - char x = (char)HDva_arg(ap, int); - n = fprintf(stream, format_templ, x); - } - break; - - case 's': - case 'p': - { - char *x = HDva_arg(ap, char*); - n = fprintf(stream, format_templ, x); - } - break; - - case 'n': - format_templ[HDstrlen(format_templ) - 1] = 'u'; - n = fprintf(stream, format_templ, nout); - break; - - case 't': - { - htri_t tri_var = HDva_arg(ap, htri_t); - - if(tri_var > 0) - n = fprintf(stream, "TRUE"); - else if(!tri_var) - n = fprintf(stream, "FALSE"); - else - n = fprintf(stream, "FAIL(%d)", (int)tri_var); - } - break; - - case 'T': /* Elapsed time, in seconds */ - { - double seconds = HDva_arg(ap, double); - char *time_string = H5_timer_get_time_string(seconds); - - if(time_string) { - n = fprintf(stream, format_templ, time_string); - HDfree(time_string); - } /* end if */ - else - n = fprintf(stream, format_templ, "(error)"); - } - break; - - case 'k': - { - H5O_token_t token = HDva_arg(ap, H5O_token_t); - - /* Print the raw token. */ - n = fprintf(stream, "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", - (unsigned char)token.__data[15], - (unsigned char)token.__data[14], - (unsigned char)token.__data[13], - (unsigned char)token.__data[12], - (unsigned char)token.__data[11], - (unsigned char)token.__data[10], - (unsigned char)token.__data[9], - (unsigned char)token.__data[8], - (unsigned char)token.__data[7], - (unsigned char)token.__data[6], - (unsigned char)token.__data[5], - (unsigned char)token.__data[4], - (unsigned char)token.__data[3], - (unsigned char)token.__data[2], - (unsigned char)token.__data[1], - (unsigned char)token.__data[0] - ); - } - break; - - default: - HDfputs(format_templ, stream); - n = (int)HDstrlen(format_templ); - break; - } - nout += n; - fmt = s; - } else { - HDputc(*fmt, stream); - fmt++; - nout++; + char *buf; /* buffer to receive formatted string */ + size_t bufsz; /* size of buffer to allocate */ + + for (bufsz = 32; (buf = HDmalloc(bufsz)) != NULL; ) { + const int ret = HDvsnprintf(buf, bufsz, fmt, ap); + if (ret >= 0 && (size_t)ret < bufsz) { + *bufp = buf; + return ret; } + HDfree(buf); + if (ret < 0) + return ret; + bufsz = (size_t)ret + 1; } - HDva_end(ap); - return nout; -} /* end HDfprintf() */ -H5_GCC_DIAG_ON(format-nonliteral) + return -1; +} /*------------------------------------------------------------------------- diff --git a/src/H5trace.c b/src/H5trace.c index 91019a4..ba8ba94 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -269,7 +269,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { haddr_t addr = HDva_arg(ap, haddr_t); - HDfprintf(out, "%a", addr); + HDfprintf(out, "%" PRIuHADDR, addr); } /* end else */ break; @@ -1179,7 +1179,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) if(H5S_UNLIMITED == p[i]) HDfprintf(out, "%sH5S_UNLIMITED", (i ? ", " : "")); else - HDfprintf(out, "%s%Hu", (i ? ", " : ""), p[i]); + HDfprintf(out, "%s%" PRIuHSIZE, (i ? ", " : ""), p[i]); } /* end for */ HDfprintf(out, "}"); } /* end if */ @@ -1193,7 +1193,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) if(H5S_UNLIMITED == hsize) HDfprintf(out, "H5S_UNLIMITED"); else { - HDfprintf(out, "%Hu", hsize); + HDfprintf(out, "%" PRIuHSIZE, hsize); asize[argno] = (hssize_t)hsize; } /* end else */ } /* end else */ @@ -1210,7 +1210,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%Hd", (i ? ", " : ""), p[i]); + HDfprintf(out, "%s%" PRIdHSIZE, (i ? ", " : ""), p[i]); HDfprintf(out, "}"); } /* end if */ } /* end if */ @@ -1220,7 +1220,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { hssize_t hssize = HDva_arg(ap, hssize_t); - HDfprintf(out, "%Hd", hssize); + HDfprintf(out, "%" PRIdHSIZE, hssize); asize[argno] = (hssize_t)hssize; } /* end else */ break; @@ -1899,7 +1899,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { hobj_ref_t ref = HDva_arg(ap, hobj_ref_t); - HDfprintf(out, "Reference Object=%a", ref); + HDfprintf(out, "Reference Object=%" PRIuHADDR, ref); } /* end else */ break; @@ -3562,7 +3562,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%Zu", (i ? ", " : ""), p[i]); + HDfprintf(out, "%s%zu", (i ? ", " : ""), p[i]); HDfprintf(out, "}"); } /* end if */ } /* end if */ @@ -3572,7 +3572,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { size_t size = HDva_arg(ap, size_t); - HDfprintf(out, "%Zu", size); + HDfprintf(out, "%zu", size); asize[argno] = (hssize_t)size; } /* end else */ break; @@ -3668,7 +3668,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, " {"); for(i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%Zd", (i ? ", " : ""), p[i]); + HDfprintf(out, "%s%zd", (i ? ", " : ""), p[i]); HDfprintf(out, "}"); } /* end if */ } /* end if */ @@ -3678,7 +3678,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { ssize_t ssize = HDva_arg(ap, ssize_t); - HDfprintf(out, "%Zd", ssize); + HDfprintf(out, "%zd", ssize); asize[argno] = (hssize_t)ssize; } /* end else */ break; diff --git a/test/accum.c b/test/accum.c index 548a04d..44af697 100644 --- a/test/accum.c +++ b/test/accum.c @@ -2061,15 +2061,16 @@ accum_printf(const H5F_t *f) HDprintf("=====================================================\n"); HDprintf(" accumulator allocated size == %zu\n", accum->alloc_size); HDprintf(" accumulated data size == %zu\n", accum->size); - HDfprintf(stdout, " accumulator dirty? == %t\n", accum->dirty); + HDfprintf(stdout, " accumulator dirty? == %s\n", + accum->dirty ? "TRUE" : "FALSE"); HDprintf("=====================================================\n"); - HDfprintf(stdout, " start of accumulated data, loc = %a\n", accum->loc); + HDfprintf(stdout, " start of accumulated data, loc = %" PRIuHADDR "\n", accum->loc); if(accum->dirty) { - HDfprintf(stdout, " start of dirty region, loc = %a\n", (haddr_t)(accum->loc + accum->dirty_off)); - HDfprintf(stdout, " end of dirty region, loc = %a\n", (haddr_t)(accum->loc + accum->dirty_off + accum->dirty_len)); + HDfprintf(stdout, " start of dirty region, loc = %" PRIuHADDR "\n", (haddr_t)(accum->loc + accum->dirty_off)); + HDfprintf(stdout, " end of dirty region, loc = %" PRIuHADDR "\n", (haddr_t)(accum->loc + accum->dirty_off + accum->dirty_len)); } /* end if */ - HDfprintf(stdout, " end of accumulated data, loc = %a\n", (haddr_t)(accum->loc + accum->size)); - HDfprintf(stdout, " end of accumulator allocation, loc = %a\n", (haddr_t)(accum->loc + accum->alloc_size)); + HDfprintf(stdout, " end of accumulated data, loc = %" PRIuHADDR "\n", (haddr_t)(accum->loc + accum->size)); + HDfprintf(stdout, " end of accumulator allocation, loc = %" PRIuHADDR "\n", (haddr_t)(accum->loc + accum->alloc_size)); HDprintf("=====================================================\n"); } HDprintf("\n\n"); diff --git a/test/big.c b/test/big.c index a2f07af..f5e78df 100644 --- a/test/big.c +++ b/test/big.c @@ -433,7 +433,7 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n) for (i=0; i where is\n" - "\t\ta positive float point number. Default value is %Hu.\n" + "\t\ta positive float point number. Default value is %" PRIuHSIZE ".\n" "Examples:\n" "\tbig -fsize 2.1e9 \t# test with file size just under 2GB\n" "\tbig -fsize 2.2e9 \t# test with file size just above 2GB\n" diff --git a/test/cache_common.c b/test/cache_common.c index 1dc13a1..880afb3 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -830,13 +830,15 @@ deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *udata, hb if((*(((const char *)image) + 2)) != (char)(idx & 0xFF)) { HDfprintf(stdout, "type = %d, idx = %d, addr = 0x%lx.\n", type, idx, (long)addr); - HDfprintf(stdout, "*image = 0x%x 0x%x 0x%x\n", - (int)(*((const char *)image)), - (int)(*(((const char *)image) + 1)), - (int)(*(((const char *)image) + 2))); - HDfprintf(stdout, "expected *image = 0x%x\n", - (int)(idx & 0xFF), - (int)((idx & 0xFF00) >> 8)); + HDfprintf(stdout, + "*image = 0x%" PRIx8 " 0x%" PRIx8 " 0x%" PRIx8 "\n", + (*((const uint8_t *)image)), + (*(((const uint8_t *)image) + 1)), + (*(((const uint8_t *)image) + 2))); + HDfprintf(stdout, + "expected *image = 0x%02" PRIx32 "%02" PRIx32 "\n", + (uint32_t)idx & 0xFF, + (((uint32_t)idx & 0xFF00) >> 8)); } /* end if */ HDassert((*((const char *)image)) == (char)(type & 0xFF)); HDassert((*(((const char *)image) + 1)) == (char)((idx & 0xFF00) >> 8)); diff --git a/test/chunk_info.c b/test/chunk_info.c index 0afff66..3c97470 100644 --- a/test/chunk_info.c +++ b/test/chunk_info.c @@ -337,7 +337,7 @@ verify_selected_chunks(hid_t dset, hid_t plist, hsize_t *start, hsize_t *end) /* Verify that read chunk is the same as the corresponding written one */ if(HDmemcmp(expected_buf[chk_index], read_buf, CHUNK_NX*CHUNK_NY) != 0) { - HDfprintf(stderr, "Read chunk differs from written chunk at offset (%d,%d)\n", offset[0], offset[1]); + HDfprintf(stderr, "Read chunk differs from written chunk at offset (%" PRIuHSIZE ",%" PRIuHSIZE ")\n", offset[0], offset[1]); return FAIL; } } diff --git a/test/dsets.c b/test/dsets.c index 4ab3efa..fdaea7c 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -4306,7 +4306,7 @@ test_nbit_int_size(hid_t file) if((dset_size = H5Dget_storage_size(dataset)) < DSET_DIM1*DSET_DIM2*(precision/8) || dset_size > DSET_DIM1*DSET_DIM2*(precision/8) + 1*KB) { H5_FAILED(); - HDfprintf(stdout, " Line %d: wrong dataset size: %Hu\n",__LINE__, dset_size); + HDfprintf(stdout, " Line %d: wrong dataset size: %" PRIuHSIZE "\n",__LINE__, dset_size); goto error; } @@ -4520,7 +4520,7 @@ test_nbit_flt_size(hid_t file) if((dset_size = H5Dget_storage_size(dataset)) < DSET_DIM1*DSET_DIM2*(precision/8) || dset_size > DSET_DIM1*DSET_DIM2*(precision/8) + 1*KB) { H5_FAILED(); - HDfprintf(stdout, " Line %d: wrong dataset size: %Hu\n",__LINE__, dset_size); + HDfprintf(stdout, " Line %d: wrong dataset size: %" PRIuHSIZE "\n",__LINE__, dset_size); goto error; } /* end if */ diff --git a/test/earray.c b/test/earray.c index 6597afd..5382a70 100644 --- a/test/earray.c +++ b/test/earray.c @@ -340,49 +340,49 @@ check_stats(const H5EA_t *ea, const earray_state_t *state) /* Compare information */ if(earray_stats.stored.max_idx_set != state->max_idx_set) { - HDfprintf(stdout, "earray_stats.stored.max_idx_set = %Hu, state->max_idx_set = %Hu\n", earray_stats.stored.max_idx_set, state->max_idx_set); + HDfprintf(stdout, "earray_stats.stored.max_idx_set = %" PRIuHSIZE ", state->max_idx_set = %" PRIuHSIZE "\n", earray_stats.stored.max_idx_set, state->max_idx_set); TEST_ERROR } /* end if */ if(earray_stats.stored.nelmts != state->nelmts) { - HDfprintf(stdout, "earray_stats.stored.nelmts = %Hu, state->nelmts = %Hu\n", earray_stats.stored.nelmts, state->nelmts); + HDfprintf(stdout, "earray_stats.stored.nelmts = %" PRIuHSIZE ", state->nelmts = %" PRIuHSIZE "\n", earray_stats.stored.nelmts, state->nelmts); TEST_ERROR } /* end if */ if(earray_stats.computed.hdr_size != state->hdr_size) { - HDfprintf(stdout, "earray_stats.computed.hdr_size = %Hu, state->hdr_size = %Hu\n", earray_stats.computed.hdr_size, state->hdr_size); + HDfprintf(stdout, "earray_stats.computed.hdr_size = %" PRIuHSIZE ", state->hdr_size = %" PRIuHSIZE "\n", earray_stats.computed.hdr_size, state->hdr_size); TEST_ERROR } /* end if */ if(earray_stats.computed.nindex_blks != state->nindex_blks) { - HDfprintf(stdout, "earray_stats.computed.nindex_blks = %Hu, state->nindex_blks = %Hu\n", earray_stats.computed.nindex_blks, state->nindex_blks); + HDfprintf(stdout, "earray_stats.computed.nindex_blks = %" PRIuHSIZE ", state->nindex_blks = %" PRIuHSIZE "\n", earray_stats.computed.nindex_blks, state->nindex_blks); TEST_ERROR } /* end if */ if(earray_stats.computed.index_blk_size != state->index_blk_size) { - HDfprintf(stdout, "earray_stats.computed.index_blk_size = %Hu, state->index_blk_size = %Hu\n", earray_stats.computed.index_blk_size, state->index_blk_size); + HDfprintf(stdout, "earray_stats.computed.index_blk_size = %" PRIuHSIZE ", state->index_blk_size = %" PRIuHSIZE "\n", earray_stats.computed.index_blk_size, state->index_blk_size); TEST_ERROR } /* end if */ if(earray_stats.stored.ndata_blks != state->ndata_blks) { - HDfprintf(stdout, "earray_stats.stored.ndata_blks = %Hu, state->ndata_blks = %Hu\n", earray_stats.stored.ndata_blks, state->ndata_blks); + HDfprintf(stdout, "earray_stats.stored.ndata_blks = %" PRIuHSIZE ", state->ndata_blks = %" PRIuHSIZE "\n", earray_stats.stored.ndata_blks, state->ndata_blks); TEST_ERROR } /* end if */ /* Don't compare this currently, it's very hard to compute */ #ifdef NOT_YET if(earray_stats.stored.data_blk_size != state->data_blk_size) { - HDfprintf(stdout, "earray_stats.stored.data_blk_size = %Hu, state->data_blk_size = %Hu\n", earray_stats.stored.data_blk_size, state->data_blk_size); + HDfprintf(stdout, "earray_stats.stored.data_blk_size = %" PRIuHSIZE ", state->data_blk_size = %" PRIuHSIZE "\n", earray_stats.stored.data_blk_size, state->data_blk_size); TEST_ERROR } /* end if */ #endif /* NOT_YET */ if(earray_stats.stored.nsuper_blks != state->nsuper_blks) { - HDfprintf(stdout, "earray_stats.stored.nsuper_blks = %Hu, state->nsuper_blks = %Hu\n", earray_stats.stored.nsuper_blks, state->nsuper_blks); + HDfprintf(stdout, "earray_stats.stored.nsuper_blks = %" PRIuHSIZE ", state->nsuper_blks = %" PRIuHSIZE "\n", earray_stats.stored.nsuper_blks, state->nsuper_blks); TEST_ERROR } /* end if */ /* Don't compare this currently, it's very hard to compute */ #ifdef NOT_YET if(earray_stats.stored.super_blk_size != state->super_blk_size) { - HDfprintf(stdout, "earray_stats.stored.super_blk_size = %Hu, state->super_blk_size = %Hu\n", earray_stats.stored.super_blk_size, state->super_blk_size); + HDfprintf(stdout, "earray_stats.stored.super_blk_size = %" PRIuHSIZE ", state->super_blk_size = %" PRIuHSIZE "\n", earray_stats.stored.super_blk_size, state->super_blk_size); TEST_ERROR } /* end if */ #endif /* NOT_YET */ #ifdef QAK -HDfprintf(stderr, "nelmts = %Hu, total EA size = %Hu\n", earray_stats.stored.nelmts, +HDfprintf(stderr, "nelmts = %" PRIuHSIZE ", total EA size = %" PRIuHSIZE "\n", earray_stats.stored.nelmts, (earray_stats.computed.hdr_size + earray_stats.computed.index_blk_size + earray_stats.stored.super_blk_size + earray_stats.stored.data_blk_size)); #endif /* QAK */ @@ -561,7 +561,7 @@ finish(hid_t file, hid_t fapl, H5F_t *f, H5EA_t *ea, haddr_t ea_addr) FAIL_STACK_ERROR #ifdef QAK -HDfprintf(stderr, "ea_addr = %a\n", ea_addr); +HDfprintf(stderr, "ea_addr = %" PRIuHADDR "\n", ea_addr); H5Fflush(file, H5F_SCOPE_GLOBAL); HDsystem("cp earray.h5 earray.h5.save"); #endif /* QAK */ @@ -1385,17 +1385,17 @@ eiter_fw_state(void *_eiter, const H5EA_create_t *cparam, /* (same eqn. as in H5EA__dblock_sblk_idx()) */ sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); #ifdef QAK -HDfprintf(stderr, "idx = %Hu, tparam->sblk_info[%u] = {%Zu, %Zu, %Hu, %Hu}\n", idx, sblk_idx, tparam->sblk_info[sblk_idx].ndblks, tparam->sblk_info[sblk_idx].dblk_nelmts, tparam->sblk_info[sblk_idx].start_idx, tparam->sblk_info[sblk_idx].start_dblk); +HDfprintf(stderr, "idx = %" PRIuHSIZE ", tparam->sblk_info[%u] = {%zu, %zu, %" PRIuHSIZE ", %" PRIuHSIZE "}\n", idx, sblk_idx, tparam->sblk_info[sblk_idx].ndblks, tparam->sblk_info[sblk_idx].dblk_nelmts, tparam->sblk_info[sblk_idx].start_idx, tparam->sblk_info[sblk_idx].start_dblk); #endif /* QAK */ state->nelmts = EA_NELMTS(cparam, tparam, idx, sblk_idx); #ifdef QAK -HDfprintf(stderr, "state->nelmts = %Hu\n", state->nelmts); +HDfprintf(stderr, "state->nelmts = %" PRIuHSIZE "\n", state->nelmts); #endif /* QAK */ state->ndata_blks = EA_NDATA_BLKS(cparam, tparam, idx, sblk_idx); #ifdef QAK -HDfprintf(stderr, "state->ndata_blks = %Hu\n", state->ndata_blks); +HDfprintf(stderr, "state->ndata_blks = %" PRIuHSIZE "\n", state->ndata_blks); #endif /* QAK */ /* Check if we have any super blocks yet */ @@ -1406,7 +1406,7 @@ HDfprintf(stderr, "state->ndata_blks = %Hu\n", state->ndata_blks); state->nsuper_blks = (sblk_idx - eiter->base_sblk_idx) + 1; #ifdef QAK -HDfprintf(stderr, "state->nsuper_blks = %Hu\n", state->nsuper_blks); +HDfprintf(stderr, "state->nsuper_blks = %" PRIuHSIZE "\n", state->nsuper_blks); #endif /* QAK */ } /* end if */ else @@ -1620,9 +1620,9 @@ eiter_rv_state(void *_eiter, const H5EA_create_t *cparam, loc_sblk_idx = H5VM_log2_gen((uint64_t)(((loc_idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); } /* end else */ #ifdef QAK -HDfprintf(stderr, "idx = %Hu, loc_idx = %Hu, eiter->max_sblk_idx = %u, idx_sblk_idx = %u, loc_sblk_idx = %u\n", idx, loc_idx, eiter->max_sblk_idx, idx_sblk_idx, loc_sblk_idx); -HDfprintf(stderr, "tparam->sblk_info[%u] = {%Zu, %Zu, %Hu, %Hu}\n", idx_sblk_idx, tparam->sblk_info[idx_sblk_idx].ndblks, tparam->sblk_info[idx_sblk_idx].dblk_nelmts, tparam->sblk_info[idx_sblk_idx].start_idx, tparam->sblk_info[idx_sblk_idx].start_dblk); -HDfprintf(stderr, "tparam->sblk_info[%u] = {%Zu, %Zu, %Hu, %Hu}\n", eiter->max_sblk_idx, tparam->sblk_info[eiter->max_sblk_idx].ndblks, tparam->sblk_info[eiter->max_sblk_idx].dblk_nelmts, tparam->sblk_info[eiter->max_sblk_idx].start_idx, tparam->sblk_info[eiter->max_sblk_idx].start_dblk); +HDfprintf(stderr, "idx = %" PRIuHSIZE ", loc_idx = %" PRIuHSIZE ", eiter->max_sblk_idx = %u, idx_sblk_idx = %u, loc_sblk_idx = %u\n", idx, loc_idx, eiter->max_sblk_idx, idx_sblk_idx, loc_sblk_idx); +HDfprintf(stderr, "tparam->sblk_info[%u] = {%zu, %zu, %" PRIuHSIZE ", %" PRIuHSIZE "}\n", idx_sblk_idx, tparam->sblk_info[idx_sblk_idx].ndblks, tparam->sblk_info[idx_sblk_idx].dblk_nelmts, tparam->sblk_info[idx_sblk_idx].start_idx, tparam->sblk_info[idx_sblk_idx].start_dblk); +HDfprintf(stderr, "tparam->sblk_info[%u] = {%zu, %zu, %" PRIuHSIZE ", %" PRIuHSIZE "}\n", eiter->max_sblk_idx, tparam->sblk_info[eiter->max_sblk_idx].ndblks, tparam->sblk_info[eiter->max_sblk_idx].dblk_nelmts, tparam->sblk_info[eiter->max_sblk_idx].start_idx, tparam->sblk_info[eiter->max_sblk_idx].start_dblk); #endif /* QAK */ if(idx < cparam->idx_blk_elmts + cparam->data_blk_min_elmts) @@ -1631,7 +1631,7 @@ HDfprintf(stderr, "tparam->sblk_info[%u] = {%Zu, %Zu, %Hu, %Hu}\n", eiter->max_s idx_nelmts = EA_NELMTS(cparam, tparam, loc_idx, loc_sblk_idx); state->nelmts = (eiter->max_nelmts - idx_nelmts) + cparam->idx_blk_elmts; #ifdef QAK -HDfprintf(stderr, "eiter->max_nelmts = %Hu, idx_nelmts = %Hu, state->nelmts = %Hu\n", eiter->max_nelmts, idx_nelmts, state->nelmts); +HDfprintf(stderr, "eiter->max_nelmts = %" PRIuHSIZE ", idx_nelmts = %" PRIuHSIZE ", state->nelmts = %" PRIuHSIZE "\n", eiter->max_nelmts, idx_nelmts, state->nelmts); #endif /* QAK */ if(idx < cparam->idx_blk_elmts + cparam->data_blk_min_elmts) @@ -1640,7 +1640,7 @@ HDfprintf(stderr, "eiter->max_nelmts = %Hu, idx_nelmts = %Hu, state->nelmts = %H idx_ndata_blks = EA_NDATA_BLKS(cparam, tparam, loc_idx, loc_sblk_idx); state->ndata_blks = eiter->max_ndata_blks - idx_ndata_blks; #ifdef QAK -HDfprintf(stderr, "eiter->max_ndata_blks = %Hu, idx_ndata_blks = %Hu, state->ndata_blks = %Hu\n", eiter->max_ndata_blks, idx_ndata_blks, state->ndata_blks); +HDfprintf(stderr, "eiter->max_ndata_blks = %" PRIuHSIZE ", idx_ndata_blks = %" PRIuHSIZE ", state->ndata_blks = %" PRIuHSIZE "\n", eiter->max_ndata_blks, idx_ndata_blks, state->ndata_blks); #endif /* QAK */ /* Check if we have any super blocks yet */ @@ -1650,7 +1650,7 @@ HDfprintf(stderr, "eiter->max_ndata_blks = %Hu, idx_ndata_blks = %Hu, state->nda else state->nsuper_blks = (eiter->max_sblk_idx - eiter->idx_blk_nsblks) + 1; #ifdef QAK -HDfprintf(stderr, "eiter->idx_blk_nsblks = %Hu, state->nsuper_blks = %Hu\n", eiter->idx_blk_nsblks, state->nsuper_blks); +HDfprintf(stderr, "eiter->idx_blk_nsblks = %" PRIuHSIZE ", state->nsuper_blks = %" PRIuHSIZE "\n", eiter->idx_blk_nsblks, state->nsuper_blks); #endif /* QAK */ } /* end if */ } /* end else */ diff --git a/test/farray.c b/test/farray.c index b647b51..b29768e 100644 --- a/test/farray.c +++ b/test/farray.c @@ -189,19 +189,19 @@ check_stats(const H5FA_t *fa, const farray_state_t *state) /* Compare information */ if (farray_stats.hdr_size != state->hdr_size) { - HDfprintf(stdout, "farray_stats.hdr_size = %Hu, state->hdr_size = %Hu\n", + HDfprintf(stdout, "farray_stats.hdr_size = %" PRIuHSIZE ", state->hdr_size = %" PRIuHSIZE "\n", farray_stats.hdr_size, state->hdr_size); TEST_ERROR } if (farray_stats.dblk_size != state->dblk_size) { - HDfprintf(stdout, "farray_stats.dblk_size = %Hu, state->dblk_size = %Hu\n", + HDfprintf(stdout, "farray_stats.dblk_size = %" PRIuHSIZE ", state->dblk_size = %" PRIuHSIZE "\n", farray_stats.dblk_size, state->dblk_size); TEST_ERROR } if (farray_stats.nelmts != state->nelmts) { - HDfprintf(stdout, "farray_stats.nelmts = %Hu, state->nelmts = %Hu\n", + HDfprintf(stdout, "farray_stats.nelmts = %" PRIuHSIZE ", state->nelmts = %" PRIuHSIZE "\n", farray_stats.nelmts, state->nelmts); TEST_ERROR } diff --git a/test/fheap.c b/test/fheap.c index b1a0db0..4894f50 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -271,35 +271,35 @@ check_stats(const H5HF_t *fh, const fheap_heap_state_t *state) if(H5HF_stat_info(fh, &heap_stats) < 0) FAIL_STACK_ERROR if(heap_stats.man_nobjs != state->man_nobjs) { - HDfprintf(stdout, "heap_stats.man_nobjs = %Hu, state->man_nobjs = %Zu\n", heap_stats.man_nobjs, state->man_nobjs); + HDfprintf(stdout, "heap_stats.man_nobjs = %" PRIuHSIZE ", state->man_nobjs = %zu\n", heap_stats.man_nobjs, state->man_nobjs); TEST_ERROR } /* end if */ if(heap_stats.man_size != state->man_size) { - HDfprintf(stdout, "heap_stats.man_size = %Hu, state->man_size = %Hu\n", heap_stats.man_size, state->man_size); + HDfprintf(stdout, "heap_stats.man_size = %" PRIuHSIZE ", state->man_size = %" PRIuHSIZE "\n", heap_stats.man_size, state->man_size); TEST_ERROR } /* end if */ if(heap_stats.man_alloc_size != state->man_alloc_size) { - HDfprintf(stdout, "heap_stats.man_alloc_size = %Hu, state->man_alloc_size = %Hu\n", heap_stats.man_alloc_size, state->man_alloc_size); + HDfprintf(stdout, "heap_stats.man_alloc_size = %" PRIuHSIZE ", state->man_alloc_size = %" PRIuHSIZE "\n", heap_stats.man_alloc_size, state->man_alloc_size); TEST_ERROR } /* end if */ if(heap_stats.man_free_space != state->man_free_space) { - HDfprintf(stdout, "heap_stats.man_free_space = %Hu, state->man_free_space = %Hu\n", heap_stats.man_free_space, state->man_free_space); + HDfprintf(stdout, "heap_stats.man_free_space = %" PRIuHSIZE ", state->man_free_space = %" PRIuHSIZE "\n", heap_stats.man_free_space, state->man_free_space); TEST_ERROR } /* end if */ if(heap_stats.huge_nobjs != state->huge_nobjs) { - HDfprintf(stdout, "heap_stats.huge_nobjs = %Hu, state->huge_nobjs = %Zu\n", heap_stats.huge_nobjs, state->huge_nobjs); + HDfprintf(stdout, "heap_stats.huge_nobjs = %" PRIuHSIZE ", state->huge_nobjs = %zu\n", heap_stats.huge_nobjs, state->huge_nobjs); TEST_ERROR } /* end if */ if(heap_stats.huge_size != state->huge_size) { - HDfprintf(stdout, "heap_stats.huge_size = %Hu, state->huge_size = %Hu\n", heap_stats.huge_size, state->huge_size); + HDfprintf(stdout, "heap_stats.huge_size = %" PRIuHSIZE ", state->huge_size = %" PRIuHSIZE "\n", heap_stats.huge_size, state->huge_size); TEST_ERROR } /* end if */ if(heap_stats.tiny_nobjs != state->tiny_nobjs) { - HDfprintf(stdout, "heap_stats.tiny_nobjs = %Hu, state->tiny_nobjs = %Zu\n", heap_stats.tiny_nobjs, state->tiny_nobjs); + HDfprintf(stdout, "heap_stats.tiny_nobjs = %" PRIuHSIZE ", state->tiny_nobjs = %zu\n", heap_stats.tiny_nobjs, state->tiny_nobjs); TEST_ERROR } /* end if */ if(heap_stats.tiny_size != state->tiny_size) { - HDfprintf(stdout, "heap_stats.tiny_size = %Hu, state->tiny_size = %Hu\n", heap_stats.tiny_size, state->tiny_size); + HDfprintf(stdout, "heap_stats.tiny_size = %" PRIuHSIZE ", state->tiny_size = %" PRIuHSIZE "\n", heap_stats.tiny_size, state->tiny_size); TEST_ERROR } /* end if */ @@ -9590,7 +9590,7 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; #ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); +HDfprintf(stderr, "obj_size = %zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) @@ -9726,7 +9726,7 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; #ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); +HDfprintf(stderr, "obj_size = %zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) @@ -9748,7 +9748,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Insert object too large for initial block size in skipped indirect blocks */ obj_size = (size_t)DBLOCK_SIZE(fh, 3) + 1; #ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); +HDfprintf(stderr, "obj_size = %zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, 4); if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) @@ -9761,7 +9761,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Insert object to fill space in (medium) block just created */ obj_size = (size_t)DBLOCK_FREE(fh, 4) - obj_size; #ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); +HDfprintf(stderr, "obj_size = %zu\n", obj_size); #endif /* QAK */ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10507,7 +10507,7 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; #ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); +HDfprintf(stderr, "obj_size = %zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) @@ -10661,7 +10661,7 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows) + 1; #ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); +HDfprintf(stderr, "obj_size = %zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows + 1); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) @@ -10674,7 +10674,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows + 1) - obj_size; #ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); +HDfprintf(stderr, "obj_size = %zu\n", obj_size); #endif /* QAK */ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR @@ -10830,7 +10830,7 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; #ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); +HDfprintf(stderr, "obj_size = %zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) @@ -10999,7 +10999,7 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; #ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); +HDfprintf(stderr, "obj_size = %zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) @@ -11156,7 +11156,7 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; #ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); +HDfprintf(stderr, "obj_size = %zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) @@ -11333,7 +11333,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; #ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); +HDfprintf(stderr, "obj_size = %zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) @@ -11545,7 +11545,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; #ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); +HDfprintf(stderr, "obj_size = %zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) @@ -11741,7 +11741,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; #ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); +HDfprintf(stderr, "obj_size = %zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) @@ -11973,7 +11973,7 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; #ifdef QAK -HDfprintf(stderr, "obj_size = %Zu\n", obj_size); +HDfprintf(stderr, "obj_size = %zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) @@ -15523,7 +15523,7 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); total_obj_added += obj_size; } /* end while */ #ifdef QAK -HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %Hu\n", keep_ids.num_ids, total_obj_added, size_limit); +HDfprintf(stderr, "keep_ids.num_ids = %zu, total_obj_added = %" PRIuHSIZE ", size_limit = %" PRIuHSIZE "\n", keep_ids.num_ids, total_obj_added, size_limit); #endif /* QAK */ /* Randomize the order of the IDs kept */ @@ -15741,7 +15741,7 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); total_obj_added += obj_size; } /* end while */ #ifdef QAK -HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %Hu\n", keep_ids.num_ids, total_obj_added, size_limit); +HDfprintf(stderr, "keep_ids.num_ids = %zu, total_obj_added = %" PRIuHSIZE ", size_limit = %" PRIuHSIZE "\n", keep_ids.num_ids, total_obj_added, size_limit); #endif /* QAK */ /* Randomize the order of the IDs kept */ diff --git a/test/fillval.c b/test/fillval.c index 72b8dcb..db979c6 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -805,7 +805,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, if(fill_time!=H5D_FILL_TIME_NEVER && val_rd!=fillval) { H5_FAILED(); HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__); - HDfprintf(stdout," Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %u, " + HDfprintf(stdout," Elmt={%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE "}, read: %u, " "Fill value: %u\n", hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], @@ -822,7 +822,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, rd_c.z != fill_c.z)) { H5_FAILED(); HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__); - HDfprintf(stdout," Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %f, %d, %f, %c" + HDfprintf(stdout," Elmt={%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE "}, read: %f, %d, %f, %c" "Fill value: %f, %d, %f, %c\n", hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], @@ -862,7 +862,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, if(buf[u] != fillval) { H5_FAILED(); HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__); - HDfprintf(stdout," Elmt={%Hu, %Hu, %Hu, %Hu, %Hu}, read: %u, " + HDfprintf(stdout," Elmt={%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE "}, read: %u, " "Fill value: %u\n", hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], @@ -889,7 +889,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, !H5_DBL_ABS_EQUAL(buf_c[u].y, fill_c.y) || buf_c[u].z != fill_c.z) { H5_FAILED(); HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__); - HDfprintf(stdout," Elmt={%Hu, %Hu, %Hu, %Hu, %Hu}, read: %f, %d, %f, %c" + HDfprintf(stdout," Elmt={%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE "}, read: %f, %d, %f, %c" "Fill value: %f, %d, %f, %c\n", hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], @@ -1284,7 +1284,7 @@ test_extend_verify_integer(unsigned lineno, const hsize_t *offset, /* Verify value */ if(*test_val != *compare_val) { HDfprintf(stdout, "%u: Value read was not expected.\n", lineno); - HDfprintf(stdout," Elmt = {%Hu, %Hu, %Hu, %Hu, %Hu}, read: %d, " + HDfprintf(stdout," Elmt = {%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE "}, read: %d, " "expected: %d\n", offset[0], offset[1], offset[2], offset[3], @@ -1380,7 +1380,7 @@ test_extend_verify_cmpd_vl(unsigned lineno, const hsize_t *offset, HDstrcmp(test_val->b, compare_val->b) || (test_val->y != compare_val->y)) { HDfprintf(stdout, "%u: Value read was not expected.\n", lineno); - HDfprintf(stdout," Elmt = {%Hu, %Hu, %Hu, %Hu, %Hu}, read: {%d, '%s', '%s', %d} " + HDfprintf(stdout," Elmt = {%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE "}, read: {%d, '%s', '%s', %d} " "expected: {%d, '%s', '%s', %d}\n", offset[0], offset[1], offset[2], offset[3], offset[4], test_val->x, test_val->a, test_val->b, test_val->y, diff --git a/test/filter_plugin.c b/test/filter_plugin.c index 9897c84..529a440 100644 --- a/test/filter_plugin.c +++ b/test/filter_plugin.c @@ -1069,7 +1069,7 @@ test_path_api_calls(void) /* Get the path */ if ((path_len = H5PLget(0, path, 256)) <= 0) { - HDfprintf(stderr," get 0 len: %u : %s\n", path_len, path); + HDfprintf(stderr," get 0 len: %zd : %s\n", path_len, path); TEST_ERROR; } if (HDstrcmp(path, "a_path_0") != 0) { diff --git a/test/freespace.c b/test/freespace.c index 124ae3e..fb2b45d 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -411,22 +411,22 @@ check_stats(const H5F_t *f, const H5FS_t *frsp, frspace_state_t *state) FAIL_STACK_ERROR if(frspace_stats.tot_space != state->tot_space) { - HDfprintf(stdout, "frspace_stats.tot_space = %Hu, state->tot_space = %Zu\n", + HDfprintf(stdout, "frspace_stats.tot_space = %" PRIuHSIZE ", state->tot_space = %" PRIuHSIZE "\n", frspace_stats.tot_space, state->tot_space); TEST_ERROR } /* end if */ if(frspace_stats.tot_sect_count != state->tot_sect_count) { - HDfprintf(stdout, "frspace_stats.tot_sect_count = %Hu, state->tot_sect_count = %Hu\n", + HDfprintf(stdout, "frspace_stats.tot_sect_count = %" PRIuHSIZE ", state->tot_sect_count = %" PRIuHSIZE "\n", frspace_stats.tot_sect_count, state->tot_sect_count); TEST_ERROR } /* end if */ if(frspace_stats.serial_sect_count != state->serial_sect_count) { - HDfprintf(stdout, "frspace_stats.serial_sect_count = %Hu, state->serial_sect_count = %Hu\n", + HDfprintf(stdout, "frspace_stats.serial_sect_count = %" PRIuHSIZE ", state->serial_sect_count = %" PRIuHSIZE "\n", frspace_stats.serial_sect_count, state->serial_sect_count); TEST_ERROR } /* end if */ if(frspace_stats.ghost_sect_count != state->ghost_sect_count) { - HDfprintf(stdout, "frspace_stats.ghost_sect_count = %Hu, state->ghost_sect_count = %Hu\n", + HDfprintf(stdout, "frspace_stats.ghost_sect_count = %" PRIuHSIZE ", state->ghost_sect_count = %" PRIuHSIZE "\n", frspace_stats.ghost_sect_count, state->ghost_sect_count); TEST_ERROR } /* end if */ diff --git a/test/hdfs.c b/test/hdfs.c index ab39da6..9f5874f 100644 --- a/test/hdfs.c +++ b/test/hdfs.c @@ -235,9 +235,10 @@ if (!(condition)) { \ *---------------------------------------------------------------------------- */ #define JSERR_STR(expected, actual, reason) { \ + const char *_reason = reason; \ JSFAILED_AT() \ - if ((reason) != NULL) { \ - HDprintf("%s\n", (reason)); \ + if (_reason != NULL) { \ + HDprintf("%s\n", _reason); \ } else { \ HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", \ (expected), (actual)); \ diff --git a/test/hyperslab.c b/test/hyperslab.c index e702023..8434aad 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -1154,7 +1154,7 @@ test_array_offset_n_calc(size_t n, size_t x, size_t y, size_t z) /* Check computed coordinates */ for(v = 0; v < ARRAY_OFFSET_NDIMS; v++) if(coords[v] != new_coords[v]) { - HDfprintf(stderr,"coords[%u]=%Hu, new_coords[%u]=%Hu\n", (unsigned)v, coords[v], (unsigned)v, new_coords[v]); + HDfprintf(stderr,"coords[%zu]=%" PRIuHSIZE ", new_coords[%zu]=%" PRIuHSIZE "\n", v, coords[v], v, new_coords[v]); TEST_ERROR; } /* end if */ } /* end for */ diff --git a/test/mf.c b/test/mf.c index 7cfc954..8d646ba 100644 --- a/test/mf.c +++ b/test/mf.c @@ -171,22 +171,22 @@ check_stats(const H5F_t *f, const H5FS_t *frsp, H5FS_stat_t *state) FAIL_STACK_ERROR if(frspace_stats.tot_space != state->tot_space) { - HDfprintf(stdout, "frspace_stats.tot_space = %Hu, state->tot_space = %Zu\n", + HDfprintf(stdout, "frspace_stats.tot_space = %" PRIuHSIZE ", state->tot_space = %" PRIuHSIZE "\n", frspace_stats.tot_space, state->tot_space); TEST_ERROR } /* end if */ if(frspace_stats.tot_sect_count != state->tot_sect_count) { - HDfprintf(stdout, "frspace_stats.tot_sect_count = %Hu, state->tot_sect_count = %Hu\n", + HDfprintf(stdout, "frspace_stats.tot_sect_count = %" PRIuHSIZE ", state->tot_sect_count = %" PRIuHSIZE "\n", frspace_stats.tot_sect_count, state->tot_sect_count); TEST_ERROR } /* end if */ if(frspace_stats.serial_sect_count != state->serial_sect_count) { - HDfprintf(stdout, "frspace_stats.serial_sect_count = %Hu, state->serial_sect_count = %Hu\n", + HDfprintf(stdout, "frspace_stats.serial_sect_count = %" PRIuHSIZE ", state->serial_sect_count = %" PRIuHSIZE "\n", frspace_stats.serial_sect_count, state->serial_sect_count); TEST_ERROR } /* end if */ if(frspace_stats.ghost_sect_count != state->ghost_sect_count) { - HDfprintf(stdout, "frspace_stats.ghost_sect_count = %Hu, state->ghost_sect_count = %Hu\n", + HDfprintf(stdout, "frspace_stats.ghost_sect_count = %" PRIuHSIZE ", state->ghost_sect_count = %" PRIuHSIZE "\n", frspace_stats.ghost_sect_count, state->ghost_sect_count); TEST_ERROR } /* end if */ diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index 59b11d6..6bfab30 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -323,9 +323,9 @@ get_class(H5T_class_t tclass) void print_found(hsize_t nfound) { if(g_Parallel) - parallel_print("%"H5_PRINTF_LL_WIDTH"u differences found\n", (unsigned long long)nfound); + parallel_print("%" PRIuHSIZE " differences found\n", nfound); else - HDfprintf(stdout,"%Hu differences found\n",nfound); + HDfprintf(stdout,"%" PRIuHSIZE " differences found\n",nfound); } diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index b59ae93..2477de2 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -81,7 +81,7 @@ h5tool_format_t h5tools_dataformat = { 1, /*skip_first */ 1, /*obj_hidefileno */ - " "H5_PRINTF_HADDR_FMT, /*obj_format */ + " %" PRIuHADDR, /*obj_format */ 1, /*dset_hidefileno */ "DATASET %s ", /*dset_format */ @@ -3313,7 +3313,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, if (HADDR_UNDEF == ioffset) h5tools_str_append(&buffer, "OFFSET HADDR_UNDEF"); else - h5tools_str_append(&buffer, "OFFSET "H5_PRINTF_HADDR_FMT, ioffset); + h5tools_str_append(&buffer, "OFFSET %" PRIuHADDR, ioffset); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); } } diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c index 1df205c..364cdcd 100644 --- a/tools/src/h5dump/h5dump_ddl.c +++ b/tools/src/h5dump/h5dump_ddl.c @@ -1233,9 +1233,9 @@ dump_fcpl(hid_t fid) indentation(dump_indent + COL); PRINTSTREAM(rawoutstream, "%s %s\n","FREE_SPACE_PERSIST", fs_persist ? "TRUE" : "FALSE"); indentation(dump_indent + COL); - PRINTSTREAM(rawoutstream, "%s %Hu\n","FREE_SPACE_SECTION_THRESHOLD", fs_threshold); + PRINTSTREAM(rawoutstream, "%s %" PRIuHSIZE "\n","FREE_SPACE_SECTION_THRESHOLD", fs_threshold); indentation(dump_indent + COL); - PRINTSTREAM(rawoutstream, "%s %Hu\n","FILE_SPACE_PAGE_SIZE", fsp_size); + PRINTSTREAM(rawoutstream, "%s %" PRIuHSIZE "\n","FILE_SPACE_PAGE_SIZE", fsp_size); /*------------------------------------------------------------------------- * USER_BLOCK @@ -1244,7 +1244,7 @@ dump_fcpl(hid_t fid) indentation(dump_indent + COL); PRINTSTREAM(rawoutstream, "USER_BLOCK %s\n",BEGIN); indentation(dump_indent + COL + COL); - PRINTSTREAM(rawoutstream,"%s %Hu\n","USERBLOCK_SIZE", userblock); + PRINTSTREAM(rawoutstream,"%s %" PRIuHSIZE "\n","USERBLOCK_SIZE", userblock); indentation(dump_indent + COL); PRINTSTREAM(rawoutstream, "%s\n",END); diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 95aff48..7086388 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -93,7 +93,7 @@ static h5tool_format_t xml_dataformat = { 1, /*skip_first */ 1, /*obj_hidefileno */ - " "H5_PRINTF_HADDR_FMT, /*obj_format */ + " %" PRIuHADDR, /*obj_format */ 1, /*dset_hidefileno */ "DATASET %s ", /*dset_format */ diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 765ab63..08a561e 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -96,7 +96,7 @@ static h5tool_format_t ls_dataformat = { 0, /*skip_first */ 0, /*obj_hidefileno */ - "-%lu:"H5_PRINTF_HADDR_FMT, /*obj_format */ + "-%lu:%" PRIuHADDR, /*obj_format */ 0, /*dset_hidefileno */ "DSET-%s ", /*dset_format */ @@ -954,7 +954,7 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind) /*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"d", *((long long*)((void*)copy))); + h5tools_str_append(buffer, "%lld", *((long long*)((void*)copy))); } } @@ -2126,7 +2126,7 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) print_string(&buffer, f_name, TRUE); } else { - h5tools_str_append(&buffer, " #%03d %10"H5_PRINTF_LL_WIDTH"u %10"H5_PRINTF_LL_WIDTH"u %10"H5_PRINTF_LL_WIDTH"u ", + h5tools_str_append(&buffer, " #%03d %10" PRIuHSIZE " %10" PRIuHSIZE " %10" PRIuHSIZE " ", i, total, (hsize_t)f_offset, f_size); print_string(&buffer, f_name, TRUE); } diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index fb3d50d7..f94ab65 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -1208,7 +1208,7 @@ print_file_info(const iter_t *iter) HDprintf("\t# of unique links: %lu\n", iter->uniq_links); HDprintf("\t# of unique other: %lu\n", iter->uniq_others); HDprintf("\tMax. # of links to object: %lu\n", iter->max_links); - HDfprintf(stdout, "\tMax. # of objects in group: %Hu\n", iter->max_fanout); + HDfprintf(stdout, "\tMax. # of objects in group: %" PRIuHSIZE "\n", iter->max_fanout); return 0; } /* print_file_info() */ @@ -1232,40 +1232,40 @@ static herr_t print_file_metadata(const iter_t *iter) { HDfprintf(stdout, "File space information for file metadata (in bytes):\n"); - HDfprintf(stdout, "\tSuperblock: %Hu\n", iter->super_size); - HDfprintf(stdout, "\tSuperblock extension: %Hu\n", iter->super_ext_size); - HDfprintf(stdout, "\tUser block: %Hu\n", iter->ublk_size); + HDfprintf(stdout, "\tSuperblock: %" PRIuHSIZE "\n", iter->super_size); + HDfprintf(stdout, "\tSuperblock extension: %" PRIuHSIZE "\n", iter->super_ext_size); + HDfprintf(stdout, "\tUser block: %" PRIuHSIZE "\n", iter->ublk_size); HDfprintf(stdout, "\tObject headers: (total/unused)\n"); - HDfprintf(stdout, "\t\tGroups: %Hu/%Hu\n", iter->group_ohdr_info.total_size, + HDfprintf(stdout, "\t\tGroups: %" PRIuHSIZE "/%" PRIuHSIZE "\n", iter->group_ohdr_info.total_size, iter->group_ohdr_info.free_size); - HDfprintf(stdout, "\t\tDatasets(exclude compact data): %Hu/%Hu\n", + HDfprintf(stdout, "\t\tDatasets(exclude compact data): %" PRIuHSIZE "/%" PRIuHSIZE "\n", iter->dset_ohdr_info.total_size, iter->dset_ohdr_info.free_size); - HDfprintf(stdout, "\t\tDatatypes: %Hu/%Hu\n", iter->dtype_ohdr_info.total_size, + HDfprintf(stdout, "\t\tDatatypes: %" PRIuHSIZE "/%" PRIuHSIZE "\n", iter->dtype_ohdr_info.total_size, iter->dtype_ohdr_info.free_size); HDfprintf(stdout, "\tGroups:\n"); - HDfprintf(stdout, "\t\tB-tree/List: %Hu\n", iter->groups_btree_storage_size); - HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->groups_heap_storage_size); + HDfprintf(stdout, "\t\tB-tree/List: %" PRIuHSIZE "\n", iter->groups_btree_storage_size); + HDfprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\n", iter->groups_heap_storage_size); HDfprintf(stdout, "\tAttributes:\n"); - HDfprintf(stdout, "\t\tB-tree/List: %Hu\n", iter->attrs_btree_storage_size); - HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->attrs_heap_storage_size); + HDfprintf(stdout, "\t\tB-tree/List: %" PRIuHSIZE "\n", iter->attrs_btree_storage_size); + HDfprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\n", iter->attrs_heap_storage_size); HDfprintf(stdout, "\tChunked datasets:\n"); - HDfprintf(stdout, "\t\tIndex: %Hu\n", iter->datasets_index_storage_size); + HDfprintf(stdout, "\t\tIndex: %" PRIuHSIZE "\n", iter->datasets_index_storage_size); HDfprintf(stdout, "\tDatasets:\n"); - HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->datasets_heap_storage_size); + HDfprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\n", iter->datasets_heap_storage_size); HDfprintf(stdout, "\tShared Messages:\n"); - HDfprintf(stdout, "\t\tHeader: %Hu\n", iter->SM_hdr_storage_size); - HDfprintf(stdout, "\t\tB-tree/List: %Hu\n", iter->SM_index_storage_size); - HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->SM_heap_storage_size); + HDfprintf(stdout, "\t\tHeader: %" PRIuHSIZE "\n", iter->SM_hdr_storage_size); + HDfprintf(stdout, "\t\tB-tree/List: %" PRIuHSIZE "\n", iter->SM_index_storage_size); + HDfprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\n", iter->SM_heap_storage_size); HDfprintf(stdout, "\tFree-space managers:\n"); - HDfprintf(stdout, "\t\tHeader: %Hu\n", iter->free_hdr); - HDfprintf(stdout, "\t\tAmount of free space: %Hu\n", iter->free_space); + HDfprintf(stdout, "\t\tHeader: %" PRIuHSIZE "\n", iter->free_hdr); + HDfprintf(stdout, "\t\tAmount of free space: %" PRIuHSIZE "\n", iter->free_space); return 0; } /* print_file_metadata() */ @@ -1345,11 +1345,11 @@ print_group_metadata(const iter_t *iter) { HDprintf("File space information for groups' metadata (in bytes):\n"); - HDfprintf(stdout, "\tObject headers (total/unused): %Hu/%Hu\n", + HDfprintf(stdout, "\tObject headers (total/unused): %" PRIuHSIZE "/%" PRIuHSIZE "\n", iter->group_ohdr_info.total_size, iter->group_ohdr_info.free_size); - HDfprintf(stdout, "\tB-tree/List: %Hu\n", iter->groups_btree_storage_size); - HDfprintf(stdout, "\tHeap: %Hu\n", iter->groups_heap_storage_size); + HDfprintf(stdout, "\tB-tree/List: %" PRIuHSIZE "\n", iter->groups_btree_storage_size); + HDfprintf(stdout, "\tHeap: %" PRIuHSIZE "\n", iter->groups_heap_storage_size); return 0; } /* print_group_metadata() */ @@ -1384,7 +1384,7 @@ print_dataset_info(const iter_t *iter) HDprintf("\t\t# of dataset with rank %u: %lu\n", u, iter->dset_rank_count[u]); HDprintf("1-D Dataset information:\n"); - HDfprintf(stdout, "\tMax. dimension size of 1-D datasets: %Hu\n", iter->max_dset_dims); + HDfprintf(stdout, "\tMax. dimension size of 1-D datasets: %" PRIuHSIZE "\n", iter->max_dset_dims); HDprintf("\tSmall 1-D datasets (with dimension sizes 0 to %u):\n", sdsets_threshold - 1); total = 0; for(u = 0; u < (unsigned)sdsets_threshold; u++) { @@ -1417,8 +1417,8 @@ print_dataset_info(const iter_t *iter) } /* end if */ HDprintf("Dataset storage information:\n"); - HDfprintf(stdout, "\tTotal raw data size: %Hu\n", iter->dset_storage_size); - HDfprintf(stdout, "\tTotal external raw data size: %Hu\n", iter->dset_external_storage_size); + HDfprintf(stdout, "\tTotal raw data size: %" PRIuHSIZE "\n", iter->dset_storage_size); + HDfprintf(stdout, "\tTotal external raw data size: %" PRIuHSIZE "\n", iter->dset_external_storage_size); HDprintf("Dataset layout information:\n"); for(u = 0; u < H5D_NLAYOUTS; u++) @@ -1460,12 +1460,12 @@ print_dset_metadata(const iter_t *iter) { HDprintf("File space information for datasets' metadata (in bytes):\n"); - HDfprintf(stdout, "\tObject headers (total/unused): %Hu/%Hu\n", + HDfprintf(stdout, "\tObject headers (total/unused): %" PRIuHSIZE "/%" PRIuHSIZE "\n", iter->dset_ohdr_info.total_size, iter->dset_ohdr_info.free_size); - HDfprintf(stdout, "\tIndex for Chunked datasets: %Hu\n", + HDfprintf(stdout, "\tIndex for Chunked datasets: %" PRIuHSIZE "\n", iter->datasets_index_storage_size); - HDfprintf(stdout, "\tHeap: %Hu\n", iter->datasets_heap_storage_size); + HDfprintf(stdout, "\tHeap: %" PRIuHSIZE "\n", iter->datasets_heap_storage_size); return 0; } /* print_dset_metadata() */ @@ -1582,7 +1582,7 @@ print_freespace_info(const iter_t *iter) unsigned u; /* Local index variable */ HDfprintf(stdout, "Free-space persist: %s\n", iter->fs_persist ? "TRUE" : "FALSE"); - HDfprintf(stdout, "Free-space section threshold: %Hu bytes\n", iter->fs_threshold); + HDfprintf(stdout, "Free-space section threshold: %" PRIuHSIZE " bytes\n", iter->fs_threshold); HDprintf("Small size free-space sections (< %u bytes):\n", (unsigned)SIZE_SMALL_SECTS); total = 0; for(u = 0; u < SIZE_SMALL_SECTS; u++) { @@ -1632,7 +1632,7 @@ print_storage_summary(const iter_t *iter) double percent = 0.0f; HDfprintf(stdout, "File space management strategy: %s\n", FS_STRATEGY_NAME[iter->fs_strategy]); - HDfprintf(stdout, "File space page size: %Hu bytes\n", iter->fsp_size); + HDfprintf(stdout, "File space page size: %" PRIuHSIZE " bytes\n", iter->fsp_size); HDprintf("Summary of file space information:\n"); total_meta = iter->super_size + iter->super_ext_size + iter->ublk_size + @@ -1650,26 +1650,26 @@ print_storage_summary(const iter_t *iter) iter->SM_heap_storage_size + iter->free_hdr; - HDfprintf(stdout, " File metadata: %Hu bytes\n", total_meta); - HDfprintf(stdout, " Raw data: %Hu bytes\n", iter->dset_storage_size); + HDfprintf(stdout, " File metadata: %" PRIuHSIZE " bytes\n", total_meta); + HDfprintf(stdout, " Raw data: %" PRIuHSIZE " bytes\n", iter->dset_storage_size); percent = ((double)iter->free_space / (double)iter->filesize) * (double)100.0f; - HDfprintf(stdout, " Amount/Percent of tracked free space: %Hu bytes/%3.1f%\n", + HDfprintf(stdout, " Amount/Percent of tracked free space: %" PRIuHSIZE " bytes/%3.1f\n", iter->free_space, percent); if(iter->filesize < (total_meta + iter->dset_storage_size + iter->free_space)) { unaccount = (total_meta + iter->dset_storage_size + iter->free_space) - iter->filesize; - HDfprintf(stdout, " ??? File has %Hu more bytes accounted for than its size! ???\n", unaccount); + HDfprintf(stdout, " ??? File has %" PRIuHSIZE " more bytes accounted for than its size! ???\n", unaccount); } else { unaccount = iter->filesize - (total_meta + iter->dset_storage_size + iter->free_space); - HDfprintf(stdout, " Unaccounted space: %Hu bytes\n", unaccount); + HDfprintf(stdout, " Unaccounted space: %" PRIuHSIZE " bytes\n", unaccount); } - HDfprintf(stdout, "Total space: %Hu bytes\n", total_meta + iter->dset_storage_size + iter->free_space + unaccount); + HDfprintf(stdout, "Total space: %" PRIuHSIZE " bytes\n", total_meta + iter->dset_storage_size + iter->free_space + unaccount); if(iter->nexternal) - HDfprintf(stdout, "External raw data: %Hu bytes\n", iter->dset_external_storage_size); + HDfprintf(stdout, "External raw data: %" PRIuHSIZE " bytes\n", iter->dset_external_storage_size); return 0; } /* print_storage_summary() */ diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index f95d1bc..b81e2b3 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -363,7 +363,7 @@ main (int argc, const char *argv[]) h5tools_setstatus(EXIT_FAILURE); goto done; } - HDfprintf(stdout, "EOA is %a; EOF is %a \n", eoa, st.st_size); + HDfprintf(stdout, "EOA is %" PRIuHADDR "; EOF is %" PRIuHADDR " \n", eoa, st.st_size); } /* --increment option */ diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index e9a783b..f986354 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -351,7 +351,7 @@ main(int argc, char *argv[]) /* * Read the signature at the specified file position. */ - HDfprintf(stdout, "Reading signature at address %a (rel)\n", addr); + HDfprintf(stdout, "Reading signature at address %" PRIuHADDR " (rel)\n", addr); if(H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), sig) < 0) { HDfprintf(stderr, "cannot read signature\n"); exit_value = 3; diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c index d7c56af..d8af390 100644 --- a/tools/test/perform/chunk_cache.c +++ b/tools/test/perform/chunk_cache.c @@ -258,9 +258,9 @@ static int check_partial_chunks_perf(hid_t file) end_t = H5_get_time(); if((end_t - start_t) > (double)0.0f) - printf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %lu\n", (end_t -start_t), nbytes_global); + printf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %zu\n", (end_t -start_t), nbytes_global); else - printf("1. Partial chunks: no total read time because timer is not available; number of bytes being read from file is %lu\n", nbytes_global); + printf("1. Partial chunks: no total read time because timer is not available; number of bytes being read from file is %zu\n", nbytes_global); H5Dclose (dataset); H5Sclose (filespace); @@ -332,9 +332,9 @@ static int check_hash_value_perf(hid_t file) end_t = H5_get_time(); if((end_t - start_t) > (double)0.0f) - printf("2. Hash value: total read time is %lf; number of bytes being read from file is %lu\n", (end_t -start_t), nbytes_global); + printf("2. Hash value: total read time is %lf; number of bytes being read from file is %zu\n", (end_t -start_t), nbytes_global); else - printf("2. Hash value: no total read time because timer is not available; number of bytes being read from file is %lu\n", nbytes_global); + printf("2. Hash value: no total read time because timer is not available; number of bytes being read from file is %zu\n", nbytes_global); H5Dclose (dataset); H5Sclose (filespace); diff --git a/tools/test/perform/sio_engine.c b/tools/test/perform/sio_engine.c index aa3a316..5a2208d 100644 --- a/tools/test/perform/sio_engine.c +++ b/tools/test/perform/sio_engine.c @@ -785,7 +785,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) /* Allocate data verification buffer */ if(NULL == (buffer2 = (char *)malloc(linear_buf_size))) { - HDfprintf(stderr, "malloc for data verification buffer size (%Zu) failed\n", linear_buf_size); + HDfprintf(stderr, "malloc for data verification buffer size (%zu) failed\n", linear_buf_size); GOTOERROR(FAIL); } /* end if */ diff --git a/tools/test/perform/sio_perf.c b/tools/test/perform/sio_perf.c index d2eb3fc..0656e94 100644 --- a/tools/test/perform/sio_perf.c +++ b/tools/test/perform/sio_perf.c @@ -867,9 +867,9 @@ report_parameters(struct options *opts) HDfprintf(output, "\n"); if(opts->page_size) { - HDfprintf(output, "Page Aggregation Enabled. Page size = %ld\n", opts->page_size); + HDfprintf(output, "Page Aggregation Enabled. Page size = %zu\n", opts->page_size); if(opts->page_buffer_size) - HDfprintf(output, "Page Buffering Enabled. Page Buffer size = %ld\n", opts->page_buffer_size); + HDfprintf(output, "Page Buffering Enabled. Page Buffer size = %zu\n", opts->page_buffer_size); else HDfprintf(output, "Page Buffering Disabled\n"); } -- cgit v0.12 From ca8a73923f8977bf04c5ee590a09ebda22938bdd Mon Sep 17 00:00:00 2001 From: David Young Date: Fri, 24 Apr 2020 18:49:16 -0500 Subject: Fix fprintf arguments: "%p" expects a `void *` argument. --- src/H5trace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/H5trace.c b/src/H5trace.c index ba8ba94..f61a996 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -824,7 +824,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5E_error2_t *error = HDva_arg(ap, H5E_error2_t *); - HDfprintf(out, "0x%p", error); + HDfprintf(out, "0x%p", (void *)error); } /* end else */ break; @@ -1156,7 +1156,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5G_stat_t *statbuf = HDva_arg(ap, H5G_stat_t*); - HDfprintf(out, "0x%p", statbuf); + HDfprintf(out, "0x%p", (void *)statbuf); } break; #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -3619,7 +3619,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5Z_class2_t *filter = HDva_arg(ap, H5Z_class2_t*); - HDfprintf(out, "0x%p", filter); + HDfprintf(out, "0x%p", (void *)filter); } /* end else */ break; -- cgit v0.12 From 4e41ca05aac25fabd61993405708a97d63baa83f Mon Sep 17 00:00:00 2001 From: David Young Date: Fri, 24 Apr 2020 18:50:07 -0500 Subject: Delete extra argument, there is no formatting for it. --- tools/src/h5repack/h5repack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index b2cb02b..4fd163c 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -711,7 +711,7 @@ check_options(pack_opt_t *options) } if (options->ublock_filename == NULL && options->ublock_size != 0) - H5TOOLS_GOTO_ERROR((-1), "file name missing for user block", options->ublock_filename); + H5TOOLS_GOTO_ERROR((-1), "file name missing for user block"); /*------------------------------------------------------------------------ * Verify alignment options; threshold is zero default but alignment not -- cgit v0.12 From 23bbe96c754fe15ec64d72dfd8009405b049a017 Mon Sep 17 00:00:00 2001 From: David Young Date: Fri, 24 Apr 2020 18:50:59 -0500 Subject: Use PRIuHSIZE and PRIXHSIZE for portability. --- test/h5test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/h5test.c b/test/h5test.c index 1b445dd..a76f953 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -2088,7 +2088,7 @@ h5_compare_file_bytes(char *f1name, char *f2name) f2size = HDftell(f2ptr); if (f1size != f2size) { - HDfprintf(stderr, "Files differ in size, %llu vs. %llu\n", f1size, f2size); + HDfprintf(stderr, "Files differ in size, %" PRIuHSIZE " vs. %" PRIuHSIZE "\n", f1size, f2size); ret_value = -1; goto done; } @@ -2100,7 +2100,7 @@ h5_compare_file_bytes(char *f1name, char *f2name) HDfread(&f1char, 1, 1, f1ptr); HDfread(&f2char, 1, 1, f2ptr); if (f1char != f2char) { - HDfprintf(stderr, "Mismatch @ 0x%llX: 0x%X != 0x%X\n", ii, f1char, f2char); + HDfprintf(stderr, "Mismatch @ 0x%" PRIXHSIZE ": 0x%X != 0x%X\n", ii, f1char, f2char); ret_value = -1; goto done; } -- cgit v0.12 From c6fcec46c9793ee43e59f11724a128a02b11872c Mon Sep 17 00:00:00 2001 From: David Young Date: Sat, 25 Apr 2020 10:30:07 -0500 Subject: Correct a couple of format strings. --- test/mirror_vfd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/mirror_vfd.c b/test/mirror_vfd.c index 4da742f..00ccf08 100644 --- a/test/mirror_vfd.c +++ b/test/mirror_vfd.c @@ -2457,7 +2457,8 @@ test_vanishing_datasets(void) TEST_ERROR; } if (group_info.nlinks > 0) { - HDfprintf(stderr, "links in rw file: %d\n", group_info.nlinks); + HDfprintf(stderr, "links in rw file: %" PRIuHSIZE "\n", + group_info.nlinks); HDfflush(stderr); TEST_ERROR; } @@ -2472,7 +2473,8 @@ test_vanishing_datasets(void) TEST_ERROR; } if (group_info.nlinks > 0) { - HDfprintf(stderr, "links in wo file: %d\n", group_info.nlinks); + HDfprintf(stderr, "links in wo file: %" PRIuHSIZE "\n", + group_info.nlinks); HDfflush(stderr); TEST_ERROR; } -- cgit v0.12 From 345443f9ad239297e6dadbbf2153c12cbed2410e Mon Sep 17 00:00:00 2001 From: David Young Date: Sat, 25 Apr 2020 13:01:03 -0500 Subject: Take pains to provide UINT64_MAX in all conditions. --- src/H5public.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/H5public.h b/src/H5public.h index 68f6e02..97bcb3c 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -201,16 +201,22 @@ typedef long long ssize_t; * defined in Posix.1g, otherwise it is defined here. */ #if H5_SIZEOF_UINT64_T>=8 +#ifndef UINT64_MAX +#define UINT64_MAX ((uint64_t)-1) +#endif #elif H5_SIZEOF_INT>=8 typedef unsigned uint64_t; +# define UINT64_MAX UINT_MAX # undef H5_SIZEOF_UINT64_T # define H5_SIZEOF_UINT64_T H5_SIZEOF_INT #elif H5_SIZEOF_LONG>=8 typedef unsigned long uint64_t; +# define UINT64_MAX ULONG_MAX # undef H5_SIZEOF_UINT64_T # define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG #elif H5_SIZEOF_LONG_LONG>=8 typedef unsigned long long uint64_t; +# define UINT64_MAX ULLONG_MAX # undef H5_SIZEOF_UINT64_T # define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG_LONG #else -- cgit v0.12 From 9159b93da623e5fdd95236322d79d003cce14c61 Mon Sep 17 00:00:00 2001 From: David Young Date: Mon, 27 Apr 2020 10:07:36 -0500 Subject: Fix code that made GCC complain about a NULL or `unsigned char *` arguments for "%s". XXX The duplication between test/ros3.c test/s3comms.c is really annoying. --- test/ros3.c | 39 ++++++++++++++++++++++++--------------- test/s3comms.c | 36 +++++++++++++++++++++++------------- 2 files changed, 47 insertions(+), 28 deletions(-) diff --git a/test/ros3.c b/test/ros3.c index 73b6ac2..6618194 100644 --- a/test/ros3.c +++ b/test/ros3.c @@ -197,14 +197,19 @@ if (!(condition)) { \ * *---------------------------------------------------------------------------- */ +static inline void +jserr_long(long expected, long actual, const char *reason) +{ + if (reason != NULL) { + HDprintf("%s\n", reason); + } else { + HDprintf(" ! Expected %ld\n ! Actual %ld\n", expected, actual); + } +} + #define JSERR_LONG(expected, actual, reason) { \ JSFAILED_AT() \ - if (reason!= NULL) { \ - HDprintf("%s\n", (reason)); \ - } else { \ - HDprintf(" ! Expected %ld\n ! Actual %ld\n", \ - (long)(expected), (long)(actual)); \ - } \ + jserr_long((long)(expected), (long)(actual), (reason)); \ } @@ -236,18 +241,21 @@ if (!(condition)) { \ * *---------------------------------------------------------------------------- */ +static inline void +jserr_str(const char *expected, const char *actual, const char *reason) +{ + if (reason != NULL) { + HDprintf("%s\n", reason); + } else { + HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", expected, actual); + } +} + #define JSERR_STR(expected, actual, reason) { \ JSFAILED_AT() \ - if ((reason) != NULL) { \ - HDprintf("%s\n", (reason)); \ - } else { \ - HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", \ - (expected), (actual)); \ - } \ + jserr_str((expected), (actual), (reason)); \ } - - #ifdef JSVERIFY_EXP_ACT @@ -1594,7 +1602,8 @@ test_cmp(void) fapl_id = H5Pcreate(H5P_FILE_ACCESS); FAIL_IF( 0 > fapl_id ) - JSVERIFY( SUCCEED, H5Pset_fapl_ros3(fapl_id, &restricted_access_fa), NULL ) + JSVERIFY( SUCCEED, H5Pset_fapl_ros3(fapl_id, &restricted_access_fa), + NULL ) fd_raven = H5FDopen( url_text_public, diff --git a/test/s3comms.c b/test/s3comms.c index 9453b75..77dfc7d 100644 --- a/test/s3comms.c +++ b/test/s3comms.c @@ -185,14 +185,19 @@ if (!(condition)) { \ * *---------------------------------------------------------------------------- */ +static inline void +jserr_long(long expected, long actual, const char *reason) +{ + if (reason != NULL) { + HDprintf("%s\n", reason); + } else { + HDprintf(" ! Expected %ld\n ! Actual %ld\n", expected, actual); + } +} + #define JSERR_LONG(expected, actual, reason) { \ JSFAILED_AT() \ - if (reason!= NULL) { \ - HDprintf("%s\n", (reason)); \ - } else { \ - HDprintf(" ! Expected %ld\n ! Actual %ld\n", \ - (long)(expected), (long)(actual)); \ - } \ + jserr_long((long)(expected), (long)(actual), reason);\ } @@ -224,14 +229,19 @@ if (!(condition)) { \ * *---------------------------------------------------------------------------- */ +static inline void +jserr_str(const char *expected, const char *actual, const char *reason) +{ + if (reason != NULL) { + HDprintf("%s\n", reason); + } else { + HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", expected, actual); + } +} + #define JSERR_STR(expected, actual, reason) { \ JSFAILED_AT() \ - if ((reason) != NULL) { \ - HDprintf("%s\n", (reason)); \ - } else { \ - HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", \ - (expected), (actual)); \ - } \ + jserr_str((expected), (actual), (reason)); \ } #ifdef JSVERIFY_EXP_ACT @@ -2260,7 +2270,7 @@ test_signing_key(void) strncmp((const char *)cases[i].exp, (const char *)key, SHA256_DIGEST_LENGTH), - cases[i].exp ) + (const char *)cases[i].exp ) free(key); key = NULL; -- cgit v0.12 From d553bd4bf3d654268a3cf1b273d9abd34db3f9d4 Mon Sep 17 00:00:00 2001 From: David Young Date: Tue, 28 Apr 2020 09:53:26 -0500 Subject: Restore a literal percent sign ("%%") that I accidentally deleted. --- tools/src/h5stat/h5stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index f94ab65..82fc731 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -1654,7 +1654,7 @@ print_storage_summary(const iter_t *iter) HDfprintf(stdout, " Raw data: %" PRIuHSIZE " bytes\n", iter->dset_storage_size); percent = ((double)iter->free_space / (double)iter->filesize) * (double)100.0f; - HDfprintf(stdout, " Amount/Percent of tracked free space: %" PRIuHSIZE " bytes/%3.1f\n", + HDfprintf(stdout, " Amount/Percent of tracked free space: %" PRIuHSIZE " bytes/%3.1f%%\n", iter->free_space, percent); if(iter->filesize < (total_meta + iter->dset_storage_size + iter->free_space)) { -- cgit v0.12 From f68226ed892d8a0536900e568a8308bb60673afc Mon Sep 17 00:00:00 2001 From: David Young Date: Tue, 28 Apr 2020 09:54:06 -0500 Subject: Use the portable `-eq` operator instead of the bash-ism `==`. Fixes the tests on NetBSD, where /bin/sh != bash. --- tools/test/h5repack/h5repack.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index ad6fef8..5a032cb 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -629,7 +629,7 @@ DIFFFAIL() $RUNSERIAL $H5DIFF_BIN -q "$@" ) RET=$? - if [ $RET == 0 ] ; then + if [ $RET -eq 0 ] ; then echo "*FAILED*" nerrors="`expr $nerrors + 1`" else -- cgit v0.12 From 90466630ea7e7d0bb5677c4ed44aaf7572e0ca71 Mon Sep 17 00:00:00 2001 From: David Young Date: Tue, 16 Jun 2020 10:40:35 -0500 Subject: Promote format-string warnings to errors. --- config/gnu-warnings/error-general | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/gnu-warnings/error-general b/config/gnu-warnings/error-general index f0e61f8..4358b20 100644 --- a/config/gnu-warnings/error-general +++ b/config/gnu-warnings/error-general @@ -59,7 +59,7 @@ # jni/h5util.c # -Werror=format(-overflow) # --Wformat +-Werror=format # # #Examples and tests do not use the same set of extensive warning flags as libraries -- cgit v0.12 From 62dbb80cb6aa770bba771f57cea4643217b509d3 Mon Sep 17 00:00:00 2001 From: David Young Date: Tue, 16 Jun 2020 15:00:13 -0500 Subject: Fix va_list usage in the vasprintf(3) implementation. --- src/H5system.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/H5system.c b/src/H5system.c index f5c3fae..6722488 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -77,13 +77,18 @@ static hbool_t H5_ntzset = FALSE; * unavailable. */ int -HDvasprintf(char **bufp, const char *fmt, va_list ap) +HDvasprintf(char **bufp, const char *fmt, va_list _ap) { char *buf; /* buffer to receive formatted string */ size_t bufsz; /* size of buffer to allocate */ for (bufsz = 32; (buf = HDmalloc(bufsz)) != NULL; ) { - const int ret = HDvsnprintf(buf, bufsz, fmt, ap); + int ret; + va_list ap; + + va_copy(ap, _ap); + ret = HDvsnprintf(buf, bufsz, fmt, ap); + va_end(ap); if (ret >= 0 && (size_t)ret < bufsz) { *bufp = buf; return ret; -- cgit v0.12 From 922e465b468ffc9a924fecaa3519b5e3e518b914 Mon Sep 17 00:00:00 2001 From: David Young Date: Mon, 6 Jul 2020 21:12:38 -0500 Subject: Provide an HDvasprintf implementation only if it isn't #defined. This should fix the mingw compilation issue that Allen reported. --- src/H5system.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/H5system.c b/src/H5system.c index 6722488..310eb11 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -73,6 +73,7 @@ /* Track whether tzset routine was called */ static hbool_t H5_ntzset = FALSE; +#ifndef HDvasprintf /* HDvasprintf provides vasprintf-like function on targets where it is * unavailable. */ @@ -100,6 +101,7 @@ HDvasprintf(char **bufp, const char *fmt, va_list _ap) } return -1; } +#endif /*------------------------------------------------------------------------- -- cgit v0.12 From a8dc4bd93fad5ac70a1c99d291d3cc9738209639 Mon Sep 17 00:00:00 2001 From: David Young Date: Mon, 6 Jul 2020 21:13:40 -0500 Subject: Always #define HDfprintf as fprintf in this header. I believe this will fix the Windows build error that Allen reported. --- tools/test/perform/sio_standalone.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h index 99e13bc..74a6245 100644 --- a/tools/test/perform/sio_standalone.h +++ b/tools/test/perform/sio_standalone.h @@ -151,7 +151,7 @@ #define HDfopen(S,M) fopen(S,M) #define HDfork() fork() #define HDfpathconf(F,N) fpathconf(F,N) -H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); +#define HDfprintf fprintf #define HDfputc(C,F) fputc(C,F) #define HDfputs(S,F) fputs(S,F) #define HDfread(M,Z,N,F) fread(M,Z,N,F) -- cgit v0.12