diff options
Diffstat (limited to 'src')
62 files changed, 479 insertions, 855 deletions
diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index 843799e..0b38a4c 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -380,9 +380,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() */ @@ -537,9 +537,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 0d93ed6..1917987 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -133,13 +133,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, @@ -245,7 +245,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, @@ -261,7 +261,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 ee37c54..faa81f0 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 d900852..0d0a56d 100644 --- a/src/H5Bdbg.c +++ b/src/H5Bdbg.c @@ -98,10 +98,10 @@ H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5 "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, @@ -110,10 +110,10 @@ H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5 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, @@ -125,7 +125,7 @@ H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5 */ 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 */ @@ -638,7 +638,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, (cache_ptr->resize_ctl).lower_hr_threshold); HDfprintf(stdout, - "%scache size increased from (%Zu/%Zu) to (%Zu/%Zu).\n", + "%scache size increased from (%zu/%zu) to (%zu/%zu).\n", cache_ptr->prefix, old_max_cache_size, old_min_clean_size, @@ -650,13 +650,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, @@ -712,7 +712,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, @@ -997,7 +997,7 @@ H5C_dest(H5F_t * f) if ( cache_ptr->get_entry_ptr_from_addr_counter > 0 ) { HDfprintf(stdout, - "*** %ld calls to H5C_get_entry_ptr_from_add(). ***\n", + "*** %" 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 47370f8..dae735d 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -291,13 +291,12 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(calling_fcn != NULL); - HDfprintf(stdout, "\n\nDumping metadata cache skip list from %s.\n", + HDfprintf(stdout, "\n\nDumping metadata cache skip list from %s.\n", calling_fcn); - HDfprintf(stdout, " slist enabled = %d.\n", - (int)(cache_ptr->slist_enabled)); - HDfprintf(stdout, " slist len = %u.\n", cache_ptr->slist_len); - HDfprintf(stdout, " slist size = %lld.\n", - (long long)(cache_ptr->slist_size)); + HDfprintf(stdout, " slist %s.\n", + cache_ptr->slist_enabled ? "enabled" : "disabled"); + HDfprintf(stdout, " slist len = %" PRIu32 ".\n", cache_ptr->slist_len); + HDfprintf(stdout, " slist size = %zu.\n", cache_ptr->slist_size); if(cache_ptr->slist_len > 0) { @@ -335,7 +334,7 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) 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 */ @@ -728,7 +727,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, diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index a4c295b..9171cf7 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -786,17 +786,16 @@ H5C_mark_entries_as_clean(H5F_t * f, if(entry_ptr == NULL) { #if H5C_DO_SANITY_CHECKS HDfprintf(stdout, - "H5C_mark_entries_as_clean: entry[%u] = %a not in cache.\n", - u, - addr); + "H5C_mark_entries_as_clean: entry[%u] = %" PRIuHADDR + " not in cache.\n", u, addr); #endif /* H5C_DO_SANITY_CHECKS */ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not in cache?!?!?") } /* end if */ else if(!entry_ptr->is_dirty) { #if H5C_DO_SANITY_CHECKS HDfprintf(stdout, - "H5C_mark_entries_as_clean: entry %a is not dirty!?!\n", - addr); + "H5C_mark_entries_as_clean: entry %" PRIuHADDR + " is not dirty!?!\n", addr); #endif /* H5C_DO_SANITY_CHECKS */ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not dirty?!?!?") } /* end else-if */ diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index 5b5ff4a..6da858f 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -773,7 +773,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) @@ -1420,7 +1420,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 d233ce5..567db94 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) @@ -1504,7 +1504,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 b2a9eb6..557dd95 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -6574,9 +6574,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 a53489e..f1a6a5e 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 a9202c2..d83c191 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/H5Dmpio.c b/src/H5Dmpio.c index e56f341..e6274d5 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1082,7 +1082,7 @@ if(H5DEBUG(D)) #ifdef H5D_DEBUG if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"total_chunks = %Zu, num_chunk = %Zu\n", total_chunks, num_chunk); + HDfprintf(H5DEBUG(D),"total_chunks = %zu, num_chunk = %zu\n", total_chunks, num_chunk); #endif /* Set up MPI datatype for chunks selected */ @@ -1545,7 +1545,7 @@ H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *ty chunk_addr = (haddr_t *)H5MM_calloc(total_chunk * sizeof(haddr_t)); #ifdef H5D_DEBUG if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D), "total_chunk %Zu\n", total_chunk); + HDfprintf(H5DEBUG(D), "total_chunk %zu\n", total_chunk); #endif /* Obtain IO option for each chunk */ @@ -1579,7 +1579,7 @@ if(H5DEBUG(D)) #ifdef H5D_DEBUG if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"mpi_rank = %d, chunk index = %Zu\n", mpi_rank, u); + HDfprintf(H5DEBUG(D),"mpi_rank = %d, chunk index = %zu\n", mpi_rank, u); #endif /* Get the chunk info for this chunk, if there are elements selected */ chunk_info = fm->select_chunk[u]; @@ -1599,7 +1599,7 @@ if(H5DEBUG(D)) if(chunk_io_option[u] == H5D_CHUNK_IO_MODE_COL) { #ifdef H5D_DEBUG if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"inside collective chunk IO mpi_rank = %d, chunk index = %Zu\n", mpi_rank, u); + HDfprintf(H5DEBUG(D),"inside collective chunk IO mpi_rank = %d, chunk index = %zu\n", mpi_rank, u); #endif /* Set the file & memory dataspaces */ @@ -1637,7 +1637,7 @@ if(H5DEBUG(D)) else { /* possible independent IO for this chunk */ #ifdef H5D_DEBUG if(H5DEBUG(D)) - HDfprintf(H5DEBUG(D),"inside independent IO mpi_rank = %d, chunk index = %Zu\n", mpi_rank, u); + HDfprintf(H5DEBUG(D),"inside independent IO mpi_rank = %d, chunk index = %zu\n", mpi_rank, u); #endif HDassert(chunk_io_option[u] == 0); diff --git a/src/H5Dnone.c b/src/H5Dnone.c index 751d067..4622c84 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 cd71e93..5c505d6 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() */ @@ -1355,10 +1355,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 */ @@ -1388,31 +1384,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) @@ -1421,16 +1395,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 e5b68be..2686579 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -124,13 +124,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, @@ -148,19 +148,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); @@ -228,13 +228,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); @@ -263,7 +263,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 */ @@ -279,7 +279,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 */ @@ -349,13 +349,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); @@ -369,7 +369,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 */ @@ -433,7 +433,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, ""); @@ -441,7 +441,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 cf1d649..e193c78 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -671,10 +671,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 */ @@ -703,31 +699,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) @@ -736,16 +710,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 5d1b536..2faeab1 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -756,13 +756,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 */ @@ -773,13 +773,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 */ @@ -790,13 +790,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 */ @@ -954,7 +954,7 @@ H5FD__log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hs } /* 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 */ @@ -994,7 +994,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) @@ -1062,7 +1062,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 */ @@ -1078,7 +1078,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 */ @@ -1230,7 +1230,7 @@ H5FD__log_read(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 @@ -1283,7 +1283,7 @@ H5FD__log_read(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_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 */ @@ -1319,7 +1319,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had /* 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) { @@ -1439,7 +1439,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha /* 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 @@ -1492,7 +1492,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha 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 */ @@ -1521,7 +1521,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha /* 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) { @@ -1641,7 +1641,7 @@ H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_ /* 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 4c762d1..db795b1 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -1291,7 +1291,7 @@ H5FD_s3comms_s3r_read(s3r_t *handle, if(rangebytesstr == NULL) HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string."); 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) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format HTTP Range value"); @@ -1300,7 +1300,7 @@ H5FD_s3comms_s3r_read(s3r_t *handle, if(rangebytesstr == NULL) HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string."); ret = HDsnprintf(rangebytesstr, (S3COMMS_MAX_RANGE_STRING_SIZE), - "bytes="H5_PRINTF_HADDR_FMT"-", offset); + "bytes=%" PRIuHADDR "-", offset); if(ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format HTTP Range value"); } diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c index 9708e9e..fa536f9 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 09f6829..ff08242 100644 --- a/src/H5Fdbg.c +++ b/src/H5Fdbg.c @@ -77,9 +77,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, @@ -105,16 +105,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 632ffa0..97a50a7 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -545,7 +545,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, @@ -560,10 +560,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 756ddb5..3858464 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 e841d78..4d2296e 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -161,7 +161,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); @@ -202,10 +202,10 @@ H5HF__dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fw 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, @@ -216,7 +216,7 @@ H5HF__dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fw 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, @@ -233,7 +233,7 @@ H5HF__dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fw 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); @@ -275,52 +275,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); @@ -331,7 +331,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), @@ -351,7 +351,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 */ @@ -463,7 +463,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++; @@ -539,14 +539,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); @@ -653,13 +653,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, @@ -686,13 +686,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 */ @@ -713,7 +713,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 */ @@ -728,14 +728,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 */ @@ -834,10 +834,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); diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 1e0813c..022f5fb 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -402,7 +402,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 c0ec68b..636ea9d 100644 --- a/src/H5HLdbg.c +++ b/src/H5HLdbg.c @@ -66,13 +66,13 @@ H5HL_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth)) H5E_THROW(H5E_CANTPROTECT, "unable to load/protect local heap"); HDfprintf(stream, "%*sLocal Heap...\n", indent, ""); - HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Header size (in bytes):", - (unsigned long)h->prfx_size); - HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, + h->prfx_size); + 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 { @@ -2412,9 +2412,9 @@ H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) FUNC_ENTER_STATIC_NOERR - HDfprintf(stderr, " id = %lu\n", (unsigned long)(item->id)); + HDfprintf(stderr, " id = %" PRIdHID "\n", item->id); HDfprintf(stderr, " count = %u\n", item->count); - HDfprintf(stderr, " obj = 0x%08p\n", item->obj_ptr); + HDfprintf(stderr, " obj = 0x%8p\n", item->obj_ptr); /* Get the group location, so we get get the name */ switch (type) { diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index 34a408f..c0334b0 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -53,6 +53,12 @@ typedef enum H5I_type_t { /* Type of atoms to return to users */ typedef int64_t hid_t; + +#define PRIdHID PRId64 +#define PRIxHID PRIx64 +#define PRIXHID PRIX64 +#define PRIoHID PRIo64 + #define H5_SIZEOF_HID_T H5_SIZEOF_INT64_T /* An invalid object ID. This is also negative for error return. */ diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index abdecce..98b9483 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -117,13 +117,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, @@ -234,7 +234,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 */ @@ -276,13 +276,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 */ @@ -295,7 +295,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 fb08048..80be046 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -514,19 +514,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 8b02724..880a909 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -855,10 +855,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 ac51aff..f1882ee 100644 --- a/src/H5Ocache_image.c +++ b/src/H5Ocache_image.c @@ -342,10 +342,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 68a88e2..850fa5c 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -269,7 +269,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 b476b17..ade85d1 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -300,9 +300,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); @@ -367,10 +367,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); @@ -380,7 +380,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); @@ -397,11 +397,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 */ @@ -435,9 +435,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) { @@ -496,7 +496,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 dffacfd..7ef0e89 100644 --- a/src/H5Odrvinfo.c +++ b/src/H5Odrvinfo.c @@ -304,7 +304,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 83bab09..8c391a7 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 b9422fb..652f72f 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -949,7 +949,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 d0f447c..a6406d5 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -388,25 +388,26 @@ 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) + 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 */ FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O__fsinfo_debug() */ diff --git a/src/H5Oint.c b/src/H5Oint.c index e41f0fe..18bb41c 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -587,7 +587,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 */ @@ -823,9 +823,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 99e646d..232d8de 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:", "<Not yet implemented>"); HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth - 3, diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index ebb34dc..5d3b77a 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -562,19 +562,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 70b654f..0a0c818 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -834,7 +834,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, @@ -846,7 +846,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; @@ -864,12 +864,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 6ee0735..89893f6 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -655,7 +655,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); @@ -664,7 +664,7 @@ H5O__pline_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE *stream, for(i = 0; i < pline->nused; i++) { char name[32]; - HDsnprintf(name, sizeof(name), "Filter at position %u", (unsigned)i); + HDsnprintf(name, sizeof(name), "Filter at position %zu", i); HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, name); HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3), "Filter identification:", @@ -679,7 +679,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 54ac71f..da279ab 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -504,7 +504,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:"); @@ -514,7 +514,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 ca6c873..43d48d8 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -729,7 +729,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 10181ad..5983513 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 18f32b3..14c7470 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -429,10 +429,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) @@ -2602,19 +2602,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 */ @@ -2702,17 +2702,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 644f3dc..55ca131 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/H5Smpio.c b/src/H5Smpio.c index 147fd25..2f8c43a 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -704,7 +704,7 @@ if(H5DEBUG(S)) #ifdef H5S_DEBUG if(H5DEBUG(S)) { - HDfprintf(H5DEBUG(S), "%s: start=%Hd stride=%Hu count=%Hu block=%Hu xtent=%Hu", + HDfprintf(H5DEBUG(S), "%s: start=%" PRIdHSIZE " stride=%" PRIuHSIZE " count=%" PRIuHSIZE " block=%" PRIuHSIZE " xtent=%" PRIuHSIZE, FUNC, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent); if(u == 0) HDfprintf(H5DEBUG(S), " rank=%u\n", rank); @@ -736,7 +736,7 @@ if(H5DEBUG(S)) #ifdef H5S_DEBUG if(H5DEBUG(S)) { - HDfprintf(H5DEBUG(S), "%s: start=%Hd stride=%Hu count=%Hu block=%Hu xtent=%Hu", + HDfprintf(H5DEBUG(S), "%s: start=%" PRIdHSIZE " stride=%" PRIuHSIZE " count=%" PRIuHSIZE " block=%" PRIuHSIZE " xtent=%" PRIuHSIZE, FUNC, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent); if(u == 0) HDfprintf(H5DEBUG(S), " rank=%u\n", rank); @@ -761,7 +761,7 @@ if(H5DEBUG(S)) { #ifdef H5S_DEBUG if(H5DEBUG(S)) { i = ((int)rank) - 1; - HDfprintf(H5DEBUG(S), " offset[%2d]=%Hu; max_xtent[%2d]=%Hu\n", i, offset[i], i, max_xtent[i]); + HDfprintf(H5DEBUG(S), " offset[%2d]=%" PRIuHSIZE "; max_xtent[%2d]=%" PRIuHSIZE "\n", i, offset[i], i, max_xtent[i]); } #endif for(i = ((int)rank) - 2; i >= 0; --i) { @@ -769,7 +769,7 @@ if(H5DEBUG(S)) { max_xtent[i] = max_xtent[i + 1] * d[i].xtent; #ifdef H5S_DEBUG if(H5DEBUG(S)) - HDfprintf(H5DEBUG(S), " offset[%2d]=%Hu; max_xtent[%2d]=%Hu\n", i, offset[i], i, max_xtent[i]); + HDfprintf(H5DEBUG(S), " offset[%2d]=%" PRIuHSIZE "; max_xtent[%2d]=%" PRIuHSIZE "\n", i, offset[i], i, max_xtent[i]); #endif } /* end for */ @@ -784,9 +784,9 @@ if(H5DEBUG(S)) *******************************************************/ #ifdef H5S_DEBUG if(H5DEBUG(S)) { - HDfprintf(H5DEBUG(S), "%s: Making contig type %Zu MPI_BYTEs\n", FUNC, elmt_size); + HDfprintf(H5DEBUG(S), "%s: Making contig type %zu MPI_BYTEs\n", FUNC, elmt_size); for(i = ((int)rank) - 1; i >= 0; --i) - HDfprintf(H5DEBUG(S), "d[%d].xtent=%Hu \n", i, d[i].xtent); + HDfprintf(H5DEBUG(S), "d[%d].xtent=%" PRIuHSIZE "\n", i, d[i].xtent); } #endif @@ -814,7 +814,9 @@ if(H5DEBUG(S)) { #ifdef H5S_DEBUG if(H5DEBUG(S)) HDfprintf(H5DEBUG(S), "%s: Dimension i=%d \n" - "start=%Hd count=%Hu block=%Hu stride=%Hu, xtent=%Hu max_xtent=%d\n", + "start=%" PRIdHSIZE " count=%" PRIuHSIZE " block=%" PRIuHSIZE + " stride=%" PRIuHSIZE ", xtent=%" PRIuHSIZE + " max_xtent=%" PRIuHSIZE "\n", FUNC, i, d[i].start, d[i].count, d[i].block, d[i].strid, d[i].xtent, max_xtent[i]); #endif @@ -955,7 +957,7 @@ done: #ifdef H5S_DEBUG if(H5DEBUG(S)) - HDfprintf(H5DEBUG(S), "Leave %s, count=%ld is_derived_type=%t\n", FUNC, *count, *is_derived_type); + HDfprintf(H5DEBUG(S), "Leave %s, count=%d is_derived_type=%s\n", FUNC, *count, (*is_derived_type) ? "TRUE" : "FALSE"); #endif FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__mpio_reg_hyper_type() */ diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 6dae0b4..2f6efa0 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 6188138..a230753 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) @@ -417,7 +423,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) HDfprintf(stream, "\n\"%s\" = 0x", dt->shared->u.enumer.name[i]); for (k = 0; k < base_size; k++) - HDfprintf(stream, "%02p", ((uint8_t *)dt->shared->u.enumer.value + (i * base_size) + k)); + HDfprintf(stream, "%02" PRIx8, *((uint8_t *)dt->shared->u.enumer.value + (i * base_size) + k)); } /* end for */ HDfprintf(stream, "\n"); } @@ -139,8 +139,17 @@ H5Z_term_package(void) if(H5DEBUG(Z)) { 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) - continue; + goto next; if(0 == nprint++) { /* Print column headers */ @@ -161,23 +170,29 @@ H5Z_term_package(void) 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. - */ + * 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); + 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 for */ } /* end if */ diff --git a/src/H5dbg.c b/src/H5dbg.c index 819653d..98bb8a0 100644 --- a/src/H5dbg.c +++ b/src/H5dbg.c @@ -99,7 +99,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 9c5b450..5f9652c 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) @@ -1613,9 +1620,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 249cc1d..5216906 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -176,42 +176,88 @@ 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 +#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 +# 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 PRIdHSIZE PRId64 +#define PRIiHSIZE PRIi64 +#define PRIoHSIZE PRIo64 +#define PRIuHSIZE PRIu64 +#define PRIxHSIZE PRIx64 +#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 @@ -220,14 +266,27 @@ 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" +# 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" +# 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" +# define PRIXHADDR H5_PRINTF_LL_WIDTH "X" #else -# error "nothing appropriate for H5_PRINTF_HADDR_FMT" +# error "nothing appropriate for PRI.HADDR" #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 @@ -250,46 +309,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 d664038..edb44ae 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -73,408 +73,35 @@ /* 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 - * - *------------------------------------------------------------------------- +#ifndef HDvasprintf +/* 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; ) { + int ret; + va_list ap; + + HDva_copy(ap, _ap); + ret = HDvsnprintf(buf, bufsz, fmt, ap); + va_end(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; +} +#endif /*------------------------------------------------------------------------- * Function: HDstrtoll diff --git a/src/H5trace.c b/src/H5trace.c index 40967ee..100b6c3 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; @@ -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 */ @@ -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; @@ -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; @@ -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/src/H5win32defs.h b/src/H5win32defs.h index 71162eb..cc70e94 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -31,33 +31,40 @@ # define PRIoPTR "llo" # define PRIuPTR "llu" # define PRIxPTR "llx" +# define PRIXPTR "llX" #else /* _WIN64 */ # define PRIdPTR "ld" # define PRIoPTR "lo" # define PRIuPTR "lu" # define PRIxPTR "lx" +# define PRIXPTR "lX" #endif /* _WIN64 */ # define PRId8 "d" # define PRIo8 "o" # define PRIu8 "u" # define PRIx8 "x" +# define PRIX8 "X" # define PRId16 "d" # define PRIo16 "o" # define PRIu16 "u" # define PRIx16 "x" +# define PRIX16 "X" # define PRId32 "d" # define PRIo32 "o" # define PRIu32 "u" # define PRIx32 "x" +# define PRIX32 "X" # define PRId64 "lld" # define PRIo64 "llo" # define PRIu64 "llu" # define PRIx64 "llx" +# define PRIX64 "llX" # define PRIdMAX "lld" # define PRIoMAX "llo" # define PRIuMAX "llu" # define PRIxMAX "llx" +# define PRIXMAX "llX" #endif /* |