From b78a27820be59844bdd27ddd8b83970be3cadf3f Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Sun, 5 Dec 2021 13:08:25 -0800 Subject: typedef changes and adds RFCs to doc directory (#1264) * Adds struct/enum typedefs in line with existing library * Adds onion VFD RFC docs (.docx and .pdf) * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- doc/Onion_VFD_RFC_v4.docx | Bin 0 -> 287276 bytes doc/Onion_VFD_RFC_v4.pdf | Bin 0 -> 766454 bytes src/H5FDonion.c | 270 +++++++++++++++++++-------------------- src/H5FDonion.h | 28 ++--- src/H5FDonion_priv.h | 121 +++++++++--------- test/onion.c | 313 +++++++++++++++++++++++----------------------- tools/src/h5dump/h5dump.c | 7 +- 7 files changed, 364 insertions(+), 375 deletions(-) create mode 100644 doc/Onion_VFD_RFC_v4.docx create mode 100644 doc/Onion_VFD_RFC_v4.pdf diff --git a/doc/Onion_VFD_RFC_v4.docx b/doc/Onion_VFD_RFC_v4.docx new file mode 100644 index 0000000..4aa1425 Binary files /dev/null and b/doc/Onion_VFD_RFC_v4.docx differ diff --git a/doc/Onion_VFD_RFC_v4.pdf b/doc/Onion_VFD_RFC_v4.pdf new file mode 100644 index 0000000..92b6dbd Binary files /dev/null and b/doc/Onion_VFD_RFC_v4.pdf differ diff --git a/src/H5FDonion.c b/src/H5FDonion.c index a957d59..314137f 100644 --- a/src/H5FDonion.c +++ b/src/H5FDonion.c @@ -41,9 +41,6 @@ static hid_t H5FD_ONION_g = 0; * This structure is created when such a file is "opened" and * discarded when it is "closed". * - * Programmer: Jacob "Jake" Smith - * 6 July 2020 - * * `pub` (H5FD_t) * * Instance of H5FD_t which contains all fields common to all VFDs. @@ -84,15 +81,15 @@ static hid_t H5FD_ONION_g = 0; * * Remember whether onion-writes must be aligned to page boundaries. * - * `header` (struct H5FD__onion_history_header) + * `header` (H5FD_onion_history_header_t) * * In-memory copy of the onion history data header. * - * `summary` (struct H5FD__onion_whole_history) + * `summary` (H5FD_onion_whole_history_t) * * In-memory copy of the onion history "whole-history". * - * `rev_record` (struct H5FD__onion_revision_record) + * `rev_record` (H5FD_onion_revision_record_t) * * `history_eof` (haddr_t) * @@ -126,22 +123,22 @@ static hid_t H5FD_ONION_g = 0; ****************************************************************************** */ typedef struct H5FD_onion_t { - H5FD_t pub; - H5FD_onion_fapl_info_t fa; - H5FD_t * backing_canon; - H5FD_t * backing_onion; - H5FD_t * backing_recov; - char * name_recov; - hbool_t is_open_rw; - hbool_t page_align_history; - struct H5FD__onion_history_header header; - struct H5FD__onion_whole_history summary; - struct H5FD__onion_revision_record rev_record; - struct H5FD__onion_revision_index *rev_index; - haddr_t history_eof; - haddr_t origin_eof; - haddr_t logi_eoa; - haddr_t logi_eof; + H5FD_t pub; + H5FD_onion_fapl_info_t fa; + H5FD_t * backing_canon; + H5FD_t * backing_onion; + H5FD_t * backing_recov; + char * name_recov; + hbool_t is_open_rw; + hbool_t page_align_history; + H5FD_onion_history_header_t header; + H5FD_onion_whole_history_t summary; + H5FD_onion_revision_record_t rev_record; + H5FD__onion_revision_index_t *rev_index; + haddr_t history_eof; + haddr_t origin_eof; + haddr_t logi_eoa; + haddr_t logi_eof; } H5FD_onion_t; H5FL_DEFINE_STATIC(H5FD_onion_t); @@ -162,11 +159,11 @@ static herr_t H5FD__onion_term(void); static herr_t H5FD__onion_write(H5FD_t *, H5FD_mem_t, hid_t, haddr_t, size_t, const void *); static int H5FD__onion_archival_index_list_sort_cmp(const void *, const void *); -static herr_t H5FD__onion_ingest_whole_history(struct H5FD__onion_whole_history *whs_out, H5FD_t *raw_file, +static herr_t H5FD__onion_ingest_whole_history(H5FD_onion_whole_history_t *whs_out, H5FD_t *raw_file, haddr_t addr, haddr_t size); static herr_t H5FD__onion_open_rw(H5FD_onion_t *, unsigned int, haddr_t, bool new_open); static herr_t H5FD__onion_revision_index_resize(H5FD__onion_revision_index_t *); -static uint64_t H5FD__onion_whole_history_write(struct H5FD__onion_whole_history *whs, H5FD_t *file_dest, +static uint64_t H5FD__onion_whole_history_write(H5FD_onion_whole_history_t *whs, H5FD_t *file_dest, haddr_t off_start, haddr_t filesize_curr); static herr_t H5FD__onion_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out*/); @@ -510,7 +507,7 @@ done: *----------------------------------------------------------------------------- */ static uint64_t -H5FD__onion_whole_history_write(struct H5FD__onion_whole_history *whs, H5FD_t *file_dest, haddr_t off_start, +H5FD__onion_whole_history_write(H5FD_onion_whole_history_t *whs, H5FD_t *file_dest, haddr_t off_start, haddr_t filesize_curr) { uint32_t _sum = 0; /* Required by the API call but unused here */ @@ -588,14 +585,14 @@ done: static herr_t H5FD__onion_commit_new_revision_record(H5FD_onion_t *file) { - uint32_t _sum = 0; /* required */ - uint64_t size = 0; - uint64_t phys_addr = 0; /* offset in history file to record start */ - unsigned char * buf = NULL; - herr_t ret_value = SUCCEED; - struct H5FD__onion_revision_record *rec_p = &file->rev_record; - struct H5FD__onion_whole_history * whs_p = &file->summary; - struct H5FD__onion_record_pointer * new_list = NULL; + uint32_t _sum = 0; /* required */ + uint64_t size = 0; + uint64_t phys_addr = 0; /* offset in history file to record start */ + unsigned char * buf = NULL; + herr_t ret_value = SUCCEED; + H5FD_onion_revision_record_t *rec_p = &file->rev_record; + H5FD_onion_whole_history_t * whs_p = &file->summary; + H5FD_onion_record_pointer_t * new_list = NULL; time_t rawtime; struct tm *info; @@ -639,7 +636,7 @@ H5FD__onion_commit_new_revision_record(H5FD_onion_t *file) HDassert(whs_p->record_pointer_list == NULL); whs_p->n_revisions = 1; - if (NULL == (whs_p->record_pointer_list = H5MM_calloc(sizeof(struct H5FD__onion_record_pointer)))) + if (NULL == (whs_p->record_pointer_list = H5MM_calloc(sizeof(H5FD_onion_record_pointer_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate temporary record pointer list") whs_p->record_pointer_list[0].phys_addr = phys_addr; @@ -655,11 +652,10 @@ H5FD__onion_commit_new_revision_record(H5FD_onion_t *file) HDassert(whs_p->record_pointer_list != NULL); - if (NULL == - (new_list = H5MM_calloc((whs_p->n_revisions + 1) * sizeof(struct H5FD__onion_record_pointer)))) + if (NULL == (new_list = H5MM_calloc((whs_p->n_revisions + 1) * sizeof(H5FD_onion_record_pointer_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "unable to resize record pointer list") HDmemcpy(new_list, whs_p->record_pointer_list, - sizeof(struct H5FD__onion_record_pointer) * whs_p->n_revisions); + sizeof(H5FD_onion_record_pointer_t) * whs_p->n_revisions); H5MM_xfree(whs_p->record_pointer_list); whs_p->record_pointer_list = new_list; new_list = NULL; @@ -833,7 +829,7 @@ get_legit_fapl_id(hid_t fapl_id) *----------------------------------------------------------------------------- */ uint64_t -H5FD_onion_history_header_decode(unsigned char *buf, struct H5FD__onion_history_header *header) +H5FD_onion_history_header_decode(unsigned char *buf, H5FD_onion_history_header_t *header) { uint32_t ui32 = 0; uint32_t sum = 0; @@ -917,8 +913,7 @@ done: *----------------------------------------------------------------------------- */ uint64_t -H5FD_onion_history_header_encode(struct H5FD__onion_history_header *header, unsigned char *buf, - uint32_t *sum_out) +H5FD_onion_history_header_encode(H5FD_onion_history_header_t *header, unsigned char *buf, uint32_t *sum_out) { unsigned char *ptr = buf; uint64_t ret_value = 0; @@ -985,7 +980,7 @@ H5FD_onion_history_header_encode(struct H5FD__onion_history_header *header, unsi *----------------------------------------------------------------------------- */ uint64_t -H5FD_onion_revision_record_decode(unsigned char *buf, struct H5FD__onion_revision_record *record) +H5FD_onion_revision_record_decode(unsigned char *buf, H5FD_onion_revision_record_t *record) { uint32_t ui32 = 0; uint32_t page_size = 0; @@ -1074,8 +1069,8 @@ H5FD_onion_revision_record_decode(unsigned char *buf, struct H5FD__onion_revisio HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "n_entries in archival index does not match decoded") } else { - struct H5FD__onion_index_entry *entry_p = NULL; - size_t i = 0; + H5FD_onion_index_entry_t *entry_p = NULL; + size_t i = 0; if (record->archival_index.list == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "no archival index entry list") @@ -1173,8 +1168,7 @@ done: *----------------------------------------------------------------------------- */ uint64_t -H5FD_onion_revision_record_encode(struct H5FD__onion_revision_record *record, unsigned char *buf, - uint32_t *sum_out) +H5FD_onion_revision_record_encode(H5FD_onion_revision_record_t *record, unsigned char *buf, uint32_t *sum_out) { unsigned char *ptr = buf; /* original pointer */ uint32_t vers_u32 = (uint32_t)record->version; /* pad out unused bytes */ @@ -1211,9 +1205,9 @@ H5FD_onion_revision_record_encode(struct H5FD__onion_revision_record *record, un HDassert(record->archival_index.list != NULL); for (i = 0; i < record->archival_index.n_entries; i++) { - uint32_t sum = 0; - struct H5FD__onion_index_entry *entry_p = NULL; - uint64_t logi_addr = 0; + uint32_t sum = 0; + H5FD_onion_index_entry_t *entry_p = NULL; + uint64_t logi_addr = 0; entry_p = &record->archival_index.list[i]; logi_addr = entry_p->logi_page << page_size_log2; @@ -1274,7 +1268,7 @@ H5FD_onion_revision_record_encode(struct H5FD__onion_revision_record *record, un *----------------------------------------------------------------------------- */ uint64_t -H5FD_onion_whole_history_decode(unsigned char *buf, struct H5FD__onion_whole_history *summary) +H5FD_onion_whole_history_decode(unsigned char *buf, H5FD_onion_whole_history_t *summary) { uint32_t ui32 = 0; uint32_t sum = 0; @@ -1317,7 +1311,7 @@ H5FD_onion_whole_history_decode(unsigned char *buf, struct H5FD__onion_whole_his HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "list is NULL -- cannot populate") for (i = 0; i < n_revisions; i++) { - struct H5FD__onion_record_pointer *rpp = &summary->record_pointer_list[i]; + H5FD_onion_record_pointer_t *rpp = &summary->record_pointer_list[i]; HDmemcpy(&ui64, ptr, 8); ui8p = (uint8_t *)&ui64; @@ -1375,8 +1369,7 @@ done: *----------------------------------------------------------------------------- */ uint64_t -H5FD_onion_whole_history_encode(struct H5FD__onion_whole_history *summary, unsigned char *buf, - uint32_t *sum_out) +H5FD_onion_whole_history_encode(H5FD_onion_whole_history_t *summary, unsigned char *buf, uint32_t *sum_out) { unsigned char *ptr = buf; uint32_t vers_u32 = (uint32_t)summary->version; /* pad out unused bytes */ @@ -1419,7 +1412,7 @@ H5FD_onion_whole_history_encode(struct H5FD__onion_whole_history *summary, unsig *----------------------------------------------------------------------------- */ static herr_t -H5FD__onion_set_userinfo_in_record(struct H5FD__onion_revision_record *rec_p) +H5FD__onion_set_userinfo_in_record(H5FD_onion_revision_record_t *rec_p) { uid_t uid = 0; struct passwd *user_info = NULL; @@ -1467,13 +1460,13 @@ static herr_t H5FD__onion_create_truncate_onion(H5FD_onion_t *file, const char *filename, const char *name_onion, const char *name_recovery, unsigned int flags, haddr_t maxaddr) { - hid_t backing_fapl_id = H5I_INVALID_HID; - struct H5FD__onion_history_header * hdr_p = NULL; - struct H5FD__onion_whole_history * whs_p = NULL; - struct H5FD__onion_revision_record *rec_p = NULL; - unsigned char * buf = NULL; - uint64_t size = 0; - herr_t ret_value = SUCCEED; + hid_t backing_fapl_id = H5I_INVALID_HID; + H5FD_onion_history_header_t * hdr_p = NULL; + H5FD_onion_whole_history_t * whs_p = NULL; + H5FD_onion_revision_record_t *rec_p = NULL; + unsigned char * buf = NULL; + uint64_t size = 0; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC; @@ -1579,7 +1572,7 @@ done: *----------------------------------------------------------------------------- */ static herr_t -H5FD__onion_ingest_history_header(struct H5FD__onion_history_header *hdr_out, H5FD_t *raw_file, haddr_t addr) +H5FD__onion_ingest_history_header(H5FD_onion_history_header_t *hdr_out, H5FD_t *raw_file, haddr_t addr) { unsigned char *buf = NULL; herr_t ret_value = SUCCEED; @@ -1624,8 +1617,8 @@ done: *----------------------------------------------------------------------------- */ static herr_t -H5FD__onion_ingest_revision_record(struct H5FD__onion_revision_record *r_out, H5FD_t *raw_file, - const struct H5FD__onion_whole_history *whs, uint64_t revision_id) +H5FD__onion_ingest_revision_record(H5FD_onion_revision_record_t *r_out, H5FD_t *raw_file, + const H5FD_onion_whole_history_t *whs, uint64_t revision_id) { unsigned char *buf = NULL; herr_t ret_value = SUCCEED; @@ -1747,8 +1740,8 @@ H5FD__onion_ingest_revision_record(struct H5FD__onion_revision_record *r_out, H5 HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate comment space") if (r_out->archival_index.n_entries > 0) - if (NULL == (r_out->archival_index.list = H5MM_calloc(r_out->archival_index.n_entries * - sizeof(struct H5FD__onion_index_entry)))) + if (NULL == (r_out->archival_index.list = + H5MM_calloc(r_out->archival_index.n_entries * sizeof(H5FD_onion_index_entry_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate index entry list") if (H5FD_onion_revision_record_decode(buf, r_out) != size) @@ -1779,7 +1772,7 @@ done: *----------------------------------------------------------------------------- */ static herr_t -H5FD__onion_ingest_whole_history(struct H5FD__onion_whole_history *whs_out, H5FD_t *raw_file, haddr_t addr, +H5FD__onion_ingest_whole_history(H5FD_onion_whole_history_t *whs_out, H5FD_t *raw_file, haddr_t addr, haddr_t size) { unsigned char *buf = NULL; @@ -1814,8 +1807,7 @@ H5FD__onion_ingest_whole_history(struct H5FD__onion_whole_history *whs_out, H5FD HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "checksum mismatch between buffer and stored"); } - whs_out->record_pointer_list = - H5MM_calloc(whs_out->n_revisions * sizeof(struct H5FD__onion_record_pointer)); + whs_out->record_pointer_list = H5MM_calloc(whs_out->n_revisions * sizeof(H5FD_onion_record_pointer_t)); if (whs_out->n_revisions > 0 && NULL == whs_out->record_pointer_list) { HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate record pointer list"); } @@ -1961,13 +1953,13 @@ H5FD__onion_open(const char *filename, unsigned flags, hid_t fapl_id, haddr_t ma /* TODO: Move to a new function */ if (NULL == file->backing_onion) { if (H5F_ACC_RDWR & flags) { - struct H5FD__onion_history_header * hdr_p = NULL; - struct H5FD__onion_whole_history * whs_p = NULL; - struct H5FD__onion_revision_record *rec_p = NULL; - unsigned char * head_buf = NULL; - unsigned char * wh_buf = NULL; - uint64_t size = 0; - uint64_t saved_size = 0; + H5FD_onion_history_header_t * hdr_p = NULL; + H5FD_onion_whole_history_t * whs_p = NULL; + H5FD_onion_revision_record_t *rec_p = NULL; + unsigned char * head_buf = NULL; + unsigned char * wh_buf = NULL; + uint64_t size = 0; + uint64_t saved_size = 0; HDassert(file != NULL); @@ -2311,11 +2303,11 @@ H5FD__onion_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h /* Read, page-by-page */ for (i = 0; i < n_pages; i++) { - const struct H5FD__onion_index_entry *entry_out_p = NULL; - haddr_t page_gap_head = 0; /* start of page to start of buffer */ - haddr_t page_gap_tail = 0; /* end of buffer to end of page */ - size_t page_readsize = 0; - uint64_t page_i = page_0 + i; + const H5FD_onion_index_entry_t *entry_out_p = NULL; + haddr_t page_gap_head = 0; /* start of page to start of buffer */ + haddr_t page_gap_tail = 0; /* end of buffer to end of page */ + size_t page_readsize = 0; + uint64_t page_i = page_0 + i; if (0 == i) { page_gap_head = offset & (((uint32_t)1 << page_size_log2) - 1); @@ -2467,13 +2459,13 @@ H5FD__onion_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, /* Write, page-by-page */ for (i = 0; i < n_pages; i++) { - const unsigned char * write_buf = buf; - struct H5FD__onion_index_entry new_entry; - const struct H5FD__onion_index_entry *entry_out_p = NULL; - haddr_t page_gap_head = 0; /* start of page to start of buffer */ - haddr_t page_gap_tail = 0; /* end of buffer to end of page */ - size_t page_n_used = 0; /* nbytes from buffer for this page-write */ - uint64_t page_i = page_0 + i; + const unsigned char * write_buf = buf; + H5FD_onion_index_entry_t new_entry; + const H5FD_onion_index_entry_t *entry_out_p = NULL; + haddr_t page_gap_head = 0; /* start of page to start of buffer */ + haddr_t page_gap_tail = 0; /* end of buffer to end of page */ + size_t page_n_used = 0; /* nbytes from buffer for this page-write */ + uint64_t page_i = page_0 + i; if (0 == i) { page_gap_head = offset & (((uint32_t)1 << page_size_log2) - 1); @@ -2600,7 +2592,7 @@ done: *----------------------------------------------------------------------------- */ hbool_t -H5FD_onion_archival_index_is_valid(const struct H5FD__onion_archival_index *aix) +H5FD_onion_archival_index_is_valid(const H5FD_onion_archival_index_t *aix) { hbool_t ret_value = TRUE; @@ -2640,15 +2632,15 @@ done: *----------------------------------------------------------------------------- */ int -H5FD_onion_archival_index_find(const struct H5FD__onion_archival_index *aix, uint64_t logi_page, - const struct H5FD__onion_index_entry **entry_out_p) +H5FD_onion_archival_index_find(const H5FD_onion_archival_index_t *aix, uint64_t logi_page, + const H5FD_onion_index_entry_t **entry_out_p) { - uint64_t low = 0; - uint64_t high = 0; - uint64_t n = 0; - uint64_t range = 0; - struct H5FD__onion_index_entry *x = NULL; - int ret_value = 0; + uint64_t low = 0; + uint64_t high = 0; + uint64_t n = 0; + uint64_t range = 0; + H5FD_onion_index_entry_t *x = NULL; + int ret_value = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR; @@ -2722,8 +2714,8 @@ H5FD_onion_revision_index_destroy(H5FD__onion_revision_index_t *rix) HDassert(H5FD__ONION_REVISION_INDEX_VERSION_CURR == rix->version); for (i = 0; 0 < rix->_hash_table_n_keys_populated && i < rix->_hash_table_size; i++) { - struct H5FD__onion_revision_index_hash_chain_node *next_p = NULL; - struct H5FD__onion_revision_index_hash_chain_node *node_p = rix->_hash_table[i]; + H5FD_onion_revision_index_hash_chain_node_t *next_p = NULL; + H5FD_onion_revision_index_hash_chain_node_t *node_p = rix->_hash_table[i]; if (node_p != NULL) rix->_hash_table_n_keys_populated -= 1; @@ -2770,8 +2762,8 @@ H5FD_onion_revision_index_init(uint32_t page_size) if (NULL == (rix = H5MM_calloc(sizeof(H5FD__onion_revision_index_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "cannot allocate index") - if (NULL == (rix->_hash_table = - H5MM_calloc(table_size * sizeof(struct H5FD__onion_revision_index_hash_chain_node *)))) + if (NULL == + (rix->_hash_table = H5MM_calloc(table_size * sizeof(H5FD_onion_revision_index_hash_chain_node_t *)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "cannot allocate hash table") rix->version = H5FD__ONION_REVISION_INDEX_VERSION_CURR; @@ -2811,12 +2803,12 @@ done: static herr_t H5FD__onion_revision_index_resize(H5FD__onion_revision_index_t *rix) { - struct H5FD__onion_revision_index_hash_chain_node **new_table = NULL; - uint64_t i = 0; - uint64_t new_size_log2 = rix->_hash_table_size_log2 + 1; - uint64_t new_size = U64_EXP2(new_size_log2); - uint64_t new_n_keys_populated = 0; - herr_t ret_value = SUCCEED; + H5FD_onion_revision_index_hash_chain_node_t **new_table = NULL; + uint64_t i = 0; + uint64_t new_size_log2 = rix->_hash_table_size_log2 + 1; + uint64_t new_size = U64_EXP2(new_size_log2); + uint64_t new_n_keys_populated = 0; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC; @@ -2824,14 +2816,13 @@ H5FD__onion_revision_index_resize(H5FD__onion_revision_index_t *rix) HDassert(H5FD__ONION_REVISION_INDEX_VERSION_CURR == rix->version); HDassert(rix->_hash_table); - if (NULL == - (new_table = H5MM_calloc(new_size * sizeof(struct H5FD__onion_revision_index_hash_chain_node *)))) + if (NULL == (new_table = H5MM_calloc(new_size * sizeof(H5FD_onion_revision_index_hash_chain_node_t *)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "cannot allocate new hash table") for (i = 0; i < rix->_hash_table_size; i++) { while (rix->_hash_table[i] != NULL) { - struct H5FD__onion_revision_index_hash_chain_node *node = NULL; - uint64_t key = 0; + H5FD_onion_revision_index_hash_chain_node_t *node = NULL; + uint64_t key = 0; /* Pop entry off of bucket stack and re-hash */ node = rix->_hash_table[i]; @@ -2876,13 +2867,12 @@ done: *----------------------------------------------------------------------------- */ herr_t -H5FD_onion_revision_index_insert(H5FD__onion_revision_index_t * rix, - const struct H5FD__onion_index_entry *entry) +H5FD_onion_revision_index_insert(H5FD__onion_revision_index_t *rix, const H5FD_onion_index_entry_t *entry) { - uint64_t key = 0; - struct H5FD__onion_revision_index_hash_chain_node * node = NULL; - struct H5FD__onion_revision_index_hash_chain_node **append_dest = NULL; - herr_t ret_value = SUCCEED; + uint64_t key = 0; + H5FD_onion_revision_index_hash_chain_node_t * node = NULL; + H5FD_onion_revision_index_hash_chain_node_t **append_dest = NULL; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT; @@ -2915,7 +2905,7 @@ H5FD_onion_revision_index_insert(H5FD__onion_revision_index_t * rix, if (entry->phys_addr != node->entry_data.phys_addr) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "physical address mismatch"); } - HDmemcpy(&node->entry_data, entry, sizeof(struct H5FD__onion_index_entry)); + HDmemcpy(&node->entry_data, entry, sizeof(H5FD_onion_index_entry_t)); append_dest = NULL; /* Node updated, do not append */ break; } @@ -2924,11 +2914,11 @@ H5FD_onion_revision_index_insert(H5FD__onion_revision_index_t * rix, /* Add new entry to bucket chain */ if (append_dest != NULL) { - if (NULL == (node = H5MM_malloc(sizeof(struct H5FD__onion_revision_index_hash_chain_node)))) + if (NULL == (node = H5MM_malloc(sizeof(H5FD_onion_revision_index_hash_chain_node_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "cannot allocate new ash chain node") node->version = H5FD__ONION_REVISION_INDEX_HASH_CHAIN_NODE_VERSION_CURR; node->next = NULL; - HDmemcpy(&node->entry_data, entry, sizeof(struct H5FD__onion_index_entry)); + HDmemcpy(&node->entry_data, entry, sizeof(H5FD_onion_index_entry_t)); *append_dest = node; rix->n_entries++; } @@ -2954,7 +2944,7 @@ done: */ int H5FD_onion_revision_index_find(const H5FD__onion_revision_index_t *rix_p, uint64_t logi_page, - const struct H5FD__onion_index_entry **entry_out_p) + const H5FD_onion_index_entry_t **entry_out_p) { uint64_t key = 0; int ret_value = 0; @@ -2970,7 +2960,7 @@ H5FD_onion_revision_index_find(const H5FD__onion_revision_index_t *rix_p, uint64 HDassert(key < rix_p->_hash_table_size); if (rix_p->_hash_table[key] != NULL) { - struct H5FD__onion_revision_index_hash_chain_node *node = NULL; + H5FD_onion_revision_index_hash_chain_node_t *node = NULL; for (node = rix_p->_hash_table[key]; node != NULL; node = node->next) { if (logi_page == node->entry_data.logi_page) { @@ -2993,8 +2983,8 @@ H5FD_onion_revision_index_find(const H5FD__onion_revision_index_t *rix_p, uint64 static int H5FD__onion_archival_index_list_sort_cmp(const void *_a, const void *_b) { - const struct H5FD__onion_index_entry *a = (const struct H5FD__onion_index_entry *)_a; - const struct H5FD__onion_index_entry *b = (const struct H5FD__onion_index_entry *)_b; + const H5FD_onion_index_entry_t *a = (const H5FD_onion_index_entry_t *)_a; + const H5FD_onion_index_entry_t *b = (const H5FD_onion_index_entry_t *)_b; if (a->logi_page < b->logi_page) return -1; @@ -3023,12 +3013,12 @@ H5FD__onion_archival_index_list_sort_cmp(const void *_a, const void *_b) */ herr_t H5FD_onion_merge_revision_index_into_archival_index(const H5FD__onion_revision_index_t *rix, - struct H5FD__onion_archival_index * aix) + H5FD_onion_archival_index_t * aix) { - uint64_t i = 0; - uint64_t n_kept = 0; - struct H5FD__onion_index_entry * kept_list = NULL; - struct H5FD__onion_archival_index new_aix = { + uint64_t i = 0; + uint64_t n_kept = 0; + H5FD_onion_index_entry_t * kept_list = NULL; + H5FD_onion_archival_index_t new_aix = { H5FD__ONION_ARCHIVAL_INDEX_VERSION_CURR, 0, /* page_size_log2 tbd */ 0, /* n_entries */ NULL, /* list pointer (allocated later) */ @@ -3050,21 +3040,20 @@ H5FD_onion_merge_revision_index_into_archival_index(const H5FD__onion_revision_i /* Add all revision index entries to new archival list */ new_aix.page_size_log2 = aix->page_size_log2; - if (NULL == (new_aix.list = H5MM_calloc(rix->n_entries * sizeof(struct H5FD__onion_index_entry)))) + if (NULL == (new_aix.list = H5MM_calloc(rix->n_entries * sizeof(H5FD_onion_index_entry_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "unable to allocate new archival index list") for (i = 0; i < rix->_hash_table_size; i++) { - const struct H5FD__onion_revision_index_hash_chain_node *node_p = NULL; + const H5FD_onion_revision_index_hash_chain_node_t *node_p = NULL; for (node_p = rix->_hash_table[i]; node_p != NULL; node_p = node_p->next) { - HDmemcpy(&new_aix.list[new_aix.n_entries], &node_p->entry_data, - sizeof(struct H5FD__onion_index_entry)); + HDmemcpy(&new_aix.list[new_aix.n_entries], &node_p->entry_data, sizeof(H5FD_onion_index_entry_t)); new_aix.n_entries++; } } /* Sort the new archival list */ - HDqsort(new_aix.list, new_aix.n_entries, sizeof(struct H5FD__onion_index_entry), + HDqsort(new_aix.list, new_aix.n_entries, sizeof(H5FD_onion_index_entry_t), H5FD__onion_archival_index_list_sort_cmp); /* Add the old archival index entries to a 'kept' list containing the @@ -3075,15 +3064,15 @@ H5FD_onion_merge_revision_index_into_archival_index(const H5FD__onion_revision_i * archival list. */ if (aix->n_entries > 0) - if (NULL == (kept_list = H5MM_calloc(aix->n_entries * sizeof(struct H5FD__onion_index_entry)))) + if (NULL == (kept_list = H5MM_calloc(aix->n_entries * sizeof(H5FD_onion_index_entry_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "unable to allocate larger archival index list") for (i = 0; i < aix->n_entries; i++) { - const struct H5FD__onion_index_entry *_p = NULL; + const H5FD_onion_index_entry_t *_p = NULL; /* Add only if page not already added from revision index */ if (H5FD_onion_archival_index_find(&new_aix, aix->list[i].logi_page, &_p) == 0) { - HDmemcpy(&kept_list[n_kept], &aix->list[i], sizeof(struct H5FD__onion_index_entry)); + HDmemcpy(&kept_list[n_kept], &aix->list[i], sizeof(H5FD_onion_index_entry_t)); n_kept++; } } @@ -3092,22 +3081,21 @@ H5FD_onion_merge_revision_index_into_archival_index(const H5FD__onion_revision_i * the revision list entries and the kept list entries */ H5MM_xfree(aix->list); - if (NULL == - (aix->list = H5MM_calloc((new_aix.n_entries + n_kept) * sizeof(struct H5FD__onion_index_entry)))) + if (NULL == (aix->list = H5MM_calloc((new_aix.n_entries + n_kept) * sizeof(H5FD_onion_index_entry_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "unable to allocate exact-size archival index list") /* Copy (new) revision list entries to replacement list */ - HDmemcpy(aix->list, new_aix.list, sizeof(struct H5FD__onion_index_entry) * new_aix.n_entries); + HDmemcpy(aix->list, new_aix.list, sizeof(H5FD_onion_index_entry_t) * new_aix.n_entries); aix->n_entries = new_aix.n_entries; /* Copy (old) kept archival list entries to replacement list */ if (n_kept > 0) { - HDmemcpy(&aix->list[aix->n_entries], kept_list, sizeof(struct H5FD__onion_index_entry) * n_kept); + HDmemcpy(&aix->list[aix->n_entries], kept_list, sizeof(H5FD_onion_index_entry_t) * n_kept); aix->n_entries += n_kept; } /* Sort this list */ - HDqsort(aix->list, aix->n_entries, sizeof(struct H5FD__onion_index_entry), + HDqsort(aix->list, aix->n_entries, sizeof(H5FD_onion_index_entry_t), H5FD__onion_archival_index_list_sort_cmp); done: diff --git a/src/H5FDonion.h b/src/H5FDonion.h index 49fbffe..d583a75 100644 --- a/src/H5FDonion.h +++ b/src/H5FDonion.h @@ -29,11 +29,11 @@ #define H5FD_ONION_FAPL_INFO_COMMENT_MAX_LEN 255 #define H5FD_ONION_FAPL_INFO_REVISION_ID_LATEST (uint64_t)(-1) -enum H5FD_onion_target_file_constant { - H5FD_ONION_STORE_TARGET_H5, /* onion history as part of H5 file */ - H5FD_ONION_STORE_TARGET_ONION, /* separate, single "onion" file */ +typedef enum H5FD_onion_target_file_constant_t { + H5FD_ONION_STORE_TARGET_H5, /* Onion history as part of HDF5 file */ + H5FD_ONION_STORE_TARGET_ONION, /* Separate, single "onion" file */ /* TODO: other storage location/scheme? */ -}; +} H5FD_onion_target_file_constant_t; /*----------------------------------------------------------------------------- * Structure H5FD_onion_fapl_info_t @@ -50,8 +50,8 @@ enum H5FD_onion_target_file_constant { * original file. * * page_size: Size of the amended data pages. If opening an existing file, - * must equal the existing page size or zero (0). If creating a - * new file or an initial revision of an existing file, must be a + * must equal the existing page size or zero. If creating a new + * file or an initial revision of an existing file, must be a * power of 2. * * store_target: @@ -113,14 +113,14 @@ enum H5FD_onion_target_file_constant { *----------------------------------------------------------------------------- */ typedef struct H5FD_onion_fapl_info_t { - uint8_t version; - hid_t backing_fapl_id; - uint32_t page_size; - enum H5FD_onion_target_file_constant store_target; - uint64_t revision_id; - uint8_t force_write_open; - uint8_t creation_flags; - char comment[H5FD_ONION_FAPL_INFO_COMMENT_MAX_LEN + 1]; + uint8_t version; + hid_t backing_fapl_id; + uint32_t page_size; + H5FD_onion_target_file_constant_t store_target; + uint64_t revision_id; + uint8_t force_write_open; + uint8_t creation_flags; + char comment[H5FD_ONION_FAPL_INFO_COMMENT_MAX_LEN + 1]; } H5FD_onion_fapl_info_t; #ifdef __cplusplus diff --git a/src/H5FDonion_priv.h b/src/H5FDonion_priv.h index 2fc1f6e..d064281 100644 --- a/src/H5FDonion_priv.h +++ b/src/H5FDonion_priv.h @@ -68,10 +68,10 @@ * *----------------------------------------------------------------------------- */ -struct H5FD__onion_index_entry { +typedef struct H5FD_onion_index_entry_t { uint64_t logi_page; uint64_t phys_addr; -}; +} H5FD_onion_index_entry_t; /*----------------------------------------------------------------------------- * @@ -97,34 +97,35 @@ struct H5FD__onion_index_entry { * *----------------------------------------------------------------------------- */ -struct H5FD__onion_archival_index { - uint8_t version; - uint32_t page_size_log2; - uint64_t n_entries; - struct H5FD__onion_index_entry *list; -}; +typedef struct H5FD_onion_archival_index_t { + uint8_t version; + uint32_t page_size_log2; + uint64_t n_entries; + H5FD_onion_index_entry_t *list; +} H5FD_onion_archival_index_t; /* data structure for storing index entries at a hash key collision */ /* version 1 implements a singly-linked list */ -struct H5FD__onion_revision_index_hash_chain_node { - uint8_t version; - struct H5FD__onion_index_entry entry_data; - struct H5FD__onion_revision_index_hash_chain_node *next; +typedef struct H5FD_onion_revision_index_hash_chain_node_t H5FD_onion_revision_index_hash_chain_node_t; +struct H5FD_onion_revision_index_hash_chain_node_t { + uint8_t version; + H5FD_onion_index_entry_t entry_data; + H5FD_onion_revision_index_hash_chain_node_t *next; }; -typedef struct H5FD__onion_revision_index { - uint8_t version; - uint32_t page_size_log2; - uint64_t n_entries; /* count of all entries in table */ - uint64_t _hash_table_size; /* 'slots' in hash table */ - uint64_t _hash_table_size_log2; /* 2^(n) -> 'slots' in hash table */ - uint64_t _hash_table_n_keys_populated; /* count of slots not NULL */ - struct H5FD__onion_revision_index_hash_chain_node **_hash_table; +typedef struct H5FD__onion_revision_index_t { + uint8_t version; + uint32_t page_size_log2; + uint64_t n_entries; /* count of all entries in table */ + uint64_t _hash_table_size; /* 'slots' in hash table */ + uint64_t _hash_table_size_log2; /* 2^(n) -> 'slots' in hash table */ + uint64_t _hash_table_n_keys_populated; /* count of slots not NULL */ + H5FD_onion_revision_index_hash_chain_node_t **_hash_table; } H5FD__onion_revision_index_t; /* In-memory representation of the on-store onion history file header. */ -struct H5FD__onion_history_header { +typedef struct H5FD_onion_history_header_t { uint8_t version; uint32_t flags; /* at most three bytes used! */ uint32_t page_size; @@ -132,42 +133,42 @@ struct H5FD__onion_history_header { uint64_t whole_history_addr; uint64_t whole_history_size; uint32_t checksum; -}; +} H5FD_onion_history_header_t; /* In-memory representation of the on-store revision record. */ -struct H5FD__onion_revision_record { - uint8_t version; - uint64_t revision_id; - uint64_t parent_revision_id; - char time_of_creation[16]; - uint64_t logi_eof; - uint32_t user_id; - uint32_t username_size; - uint32_t comment_size; - struct H5FD__onion_archival_index archival_index; - char * username; - char * comment; - uint32_t checksum; -}; +typedef struct H5FD_onion_revision_record_t { + uint8_t version; + uint64_t revision_id; + uint64_t parent_revision_id; + char time_of_creation[16]; + uint64_t logi_eof; + uint32_t user_id; + uint32_t username_size; + uint32_t comment_size; + H5FD_onion_archival_index_t archival_index; + char * username; + char * comment; + uint32_t checksum; +} H5FD_onion_revision_record_t; /* In-memory representation of the on-store revision record pointer. * Used in the whole-history. */ -struct H5FD__onion_record_pointer { +typedef struct H5FD_onion_record_pointer_t { uint64_t phys_addr; uint64_t record_size; uint32_t checksum; -}; +} H5FD_onion_record_pointer_t; /* In-memory representation of the on-store whole-history record/summary. */ -struct H5FD__onion_whole_history { - uint8_t version; - uint64_t n_revisions; - struct H5FD__onion_record_pointer *record_pointer_list; - uint32_t checksum; -}; +typedef struct H5FD_onion_whole_history_t { + uint8_t version; + uint64_t n_revisions; + H5FD_onion_record_pointer_t *record_pointer_list; + uint32_t checksum; +} H5FD_onion_whole_history_t; #ifdef __cplusplus extern "C" { @@ -177,31 +178,29 @@ extern "C" { * INTERNAL FUNCTION DECLARATIONS */ -H5_DLL hbool_t H5FD_onion_archival_index_is_valid(const struct H5FD__onion_archival_index *); -H5_DLL int H5FD_onion_archival_index_find(const struct H5FD__onion_archival_index *, uint64_t, - const struct H5FD__onion_index_entry **); +H5_DLL hbool_t H5FD_onion_archival_index_is_valid(const H5FD_onion_archival_index_t *); +H5_DLL int H5FD_onion_archival_index_find(const H5FD_onion_archival_index_t *, uint64_t, + const H5FD_onion_index_entry_t **); -H5_DLL struct H5FD__onion_revision_index *H5FD_onion_revision_index_init(uint32_t page_size); -H5_DLL herr_t H5FD_onion_revision_index_destroy(H5FD__onion_revision_index_t *); -H5_DLL herr_t H5FD_onion_revision_index_insert(H5FD__onion_revision_index_t *, - const struct H5FD__onion_index_entry *); +H5_DLL H5FD__onion_revision_index_t *H5FD_onion_revision_index_init(uint32_t page_size); +H5_DLL herr_t H5FD_onion_revision_index_destroy(H5FD__onion_revision_index_t *); +H5_DLL herr_t H5FD_onion_revision_index_insert(H5FD__onion_revision_index_t *, + const H5FD_onion_index_entry_t *); H5_DLL int H5FD_onion_revision_index_find(const H5FD__onion_revision_index_t *, uint64_t, - const struct H5FD__onion_index_entry **); + const H5FD_onion_index_entry_t **); H5_DLL herr_t H5FD_onion_merge_revision_index_into_archival_index(const H5FD__onion_revision_index_t *, - struct H5FD__onion_archival_index *); + H5FD_onion_archival_index_t *); -H5_DLL uint64_t H5FD_onion_history_header_decode(unsigned char *, struct H5FD__onion_history_header *); -H5_DLL uint64_t H5FD_onion_history_header_encode(struct H5FD__onion_history_header *, unsigned char *, - uint32_t *); +H5_DLL uint64_t H5FD_onion_history_header_decode(unsigned char *, H5FD_onion_history_header_t *); +H5_DLL uint64_t H5FD_onion_history_header_encode(H5FD_onion_history_header_t *, unsigned char *, uint32_t *); -H5_DLL uint64_t H5FD_onion_revision_record_decode(unsigned char *, struct H5FD__onion_revision_record *); -H5_DLL uint64_t H5FD_onion_revision_record_encode(struct H5FD__onion_revision_record *, unsigned char *, +H5_DLL uint64_t H5FD_onion_revision_record_decode(unsigned char *, H5FD_onion_revision_record_t *); +H5_DLL uint64_t H5FD_onion_revision_record_encode(H5FD_onion_revision_record_t *, unsigned char *, uint32_t *); -H5_DLL uint64_t H5FD_onion_whole_history_decode(unsigned char *, struct H5FD__onion_whole_history *); -H5_DLL uint64_t H5FD_onion_whole_history_encode(struct H5FD__onion_whole_history *, unsigned char *, - uint32_t *); +H5_DLL uint64_t H5FD_onion_whole_history_decode(unsigned char *, H5FD_onion_whole_history_t *); +H5_DLL uint64_t H5FD_onion_whole_history_encode(H5FD_onion_whole_history_t *, unsigned char *, uint32_t *); #ifdef __cplusplus } diff --git a/test/onion.c b/test/onion.c index 20be50b..945a1a0 100644 --- a/test/onion.c +++ b/test/onion.c @@ -84,7 +84,7 @@ static void onion_filepaths_destroy(struct onion_filepaths *); static struct onion_filepaths *onion_filepaths_init(const char *, H5FD_onion_fapl_info_t *); #if 0 static int is_onion_data_page_aligned( - const struct H5FD__onion_history_header *); + const H5FD_onion_history_header_t *); static uint32_t up_size_to_page_boundary(uint64_t, uint32_t); #endif @@ -161,7 +161,7 @@ onion_filepaths_destroy(struct onion_filepaths *s) #if 0 static int -is_onion_data_page_aligned(const struct H5FD__onion_history_header *header) +is_onion_data_page_aligned(const H5FD_onion_history_header_t *header) { return header->flags & H5FD__ONION_HEADER_FLAG_PAGE_ALIGNMENT; } @@ -191,26 +191,26 @@ static int test_archival_index(void) { /* We can ignore each entry's physical address and checksum values */ - struct H5FD__onion_index_entry e0 = {1, 474}; - struct H5FD__onion_index_entry e1 = {4, 558}; - struct H5FD__onion_index_entry e2 = {5, 306}; - struct H5FD__onion_index_entry e3 = {9, 515}; - struct H5FD__onion_index_entry e4 = {14, 386}; - struct H5FD__onion_index_entry e5 = {18, 90}; - struct H5FD__onion_index_entry e6 = {19, 94}; - struct H5FD__onion_index_entry e7 = {20, 509}; - struct H5FD__onion_index_entry sorted[8] = {e0, e1, e2, e3, e4, e5, e6, e7}; - struct H5FD__onion_index_entry sorted_duplicates[8] = {e0, e1, e2, e2, e4, e5, e6, e7}; - struct H5FD__onion_index_entry sorted_incomplete[8] = {e1, e3, e4, e5}; + H5FD_onion_index_entry_t e0 = {1, 474}; + H5FD_onion_index_entry_t e1 = {4, 558}; + H5FD_onion_index_entry_t e2 = {5, 306}; + H5FD_onion_index_entry_t e3 = {9, 515}; + H5FD_onion_index_entry_t e4 = {14, 386}; + H5FD_onion_index_entry_t e5 = {18, 90}; + H5FD_onion_index_entry_t e6 = {19, 94}; + H5FD_onion_index_entry_t e7 = {20, 509}; + H5FD_onion_index_entry_t sorted[8] = {e0, e1, e2, e3, e4, e5, e6, e7}; + H5FD_onion_index_entry_t sorted_duplicates[8] = {e0, e1, e2, e2, e4, e5, e6, e7}; + H5FD_onion_index_entry_t sorted_incomplete[8] = {e1, e3, e4, e5}; /* partially-sorted list also aligned to 2 * page-size */ - struct H5FD__onion_index_entry sorted_partial[8] = {e1, e4, e5, e7, e0, e6, e2, e3}; /* 0..3 sorted */ - struct H5FD__onion_index_entry unsorted[8] = {e3, e1, e4, e5, e0, e6, e2, e7}; - struct H5FD__onion_archival_index aix = { + H5FD_onion_index_entry_t sorted_partial[8] = {e1, e4, e5, e7, e0, e6, e2, e3}; /* 0..3 sorted */ + H5FD_onion_index_entry_t unsorted[8] = {e3, e1, e4, e5, e0, e6, e2, e7}; + H5FD_onion_archival_index_t aix = { H5FD__ONION_ARCHIVAL_INDEX_VERSION_CURR, 1, /* page_size_log2 */ 8, /* list must be populated and sorted through 0 .. (count-1) */ sorted, /* list */ }; - const struct H5FD__onion_index_entry *entry_out_p = NULL; + const H5FD_onion_index_entry_t *entry_out_p = NULL; TESTING("archival index"); @@ -319,12 +319,12 @@ error: static int test_revision_index(void) { - struct H5FD__onion_revision_index *rix_p = NULL; - struct H5FD__onion_index_entry entry = { + H5FD__onion_revision_index_t *rix_p = NULL; + H5FD_onion_index_entry_t entry = { 42, /* logi_page */ 111112, /* phys_addr */ }; - const struct H5FD__onion_index_entry *entry_out_p = NULL; + const H5FD_onion_index_entry_t *entry_out_p = NULL; TESTING("revision index"); @@ -424,15 +424,15 @@ error: static int test_revision_index_collisions(void) { - H5FD__onion_revision_index_t * rix_p = NULL; - struct H5FD__onion_index_entry entry = { + H5FD__onion_revision_index_t *rix_p = NULL; + H5FD_onion_index_entry_t entry = { 0, /* logi_page */ 0, /* phys_addr */ }; - const struct H5FD__onion_index_entry *entry_out_p = NULL; - uint64_t i = 0; - const uint64_t n_insert = 40; - const uint64_t offset_from_power = 5; + const H5FD_onion_index_entry_t *entry_out_p = NULL; + uint64_t i = 0; + const uint64_t n_insert = 40; + const uint64_t offset_from_power = 5; TESTING("revision index collisions"); @@ -488,14 +488,14 @@ error: static int test_revision_index_resizing(void) { - H5FD__onion_revision_index_t * rix_p = NULL; - struct H5FD__onion_index_entry entry = { + H5FD__onion_revision_index_t *rix_p = NULL; + H5FD_onion_index_entry_t entry = { 0, /* logi_page */ 0, /* phys_addr */ }; - const struct H5FD__onion_index_entry *entry_out_p = NULL; - uint64_t i = 0; - const uint64_t n_insert = U64_EXP2((H5FD__ONION_REVISION_INDEX_STARTING_SIZE_LOG2 + 3)); + const H5FD_onion_index_entry_t *entry_out_p = NULL; + uint64_t i = 0; + const uint64_t n_insert = U64_EXP2((H5FD__ONION_REVISION_INDEX_STARTING_SIZE_LOG2 + 3)); TESTING("revision index resizing"); @@ -550,12 +550,12 @@ error: static int test_revision_index_to_archival_index(void) { - H5FD__onion_revision_index_t * rix_p = NULL; - struct H5FD__onion_index_entry rix_entry = { + H5FD__onion_revision_index_t *rix_p = NULL; + H5FD_onion_index_entry_t rix_entry = { 0, /* logi_page */ 0, /* phys_addr */ }; - struct H5FD__onion_archival_index aix = { + H5FD_onion_archival_index_t aix = { H5FD__ONION_ARCHIVAL_INDEX_VERSION_CURR, 5, /* page_size_log2 */ 0, /* n_entries to be set */ @@ -601,8 +601,8 @@ test_revision_index_to_archival_index(void) TEST_ERROR; /* Failed to resize and/or update archival index info */ for (i = 0; i < n_insert; i++) { - const struct H5FD__onion_index_entry *aix_entry_p = NULL; - uint64_t n = 2003 * (i + 1) + 47; + const H5FD_onion_index_entry_t *aix_entry_p = NULL; + uint64_t n = 2003 * (i + 1) + 47; aix_entry_p = &aix.list[i]; @@ -616,7 +616,7 @@ test_revision_index_to_archival_index(void) H5MM_xfree(aix.list); aix.list = NULL; - if (NULL == (aix.list = H5MM_malloc(sizeof(struct H5FD__onion_index_entry) * 2))) + if (NULL == (aix.list = H5MM_malloc(sizeof(H5FD_onion_index_entry_t) * 2))) TEST_ERROR; aix.list[0].logi_page = 47; aix.list[0].phys_addr = 47 * 13; @@ -637,8 +637,8 @@ test_revision_index_to_archival_index(void) TEST_ERROR; for (i = 0; i < (n_insert + 2); i++) { - const struct H5FD__onion_index_entry *aix_entry_p = NULL; - uint64_t n = 2003 * i + 47; + const H5FD_onion_index_entry_t *aix_entry_p = NULL; + uint64_t n = 2003 * i + 47; aix_entry_p = &aix.list[i]; @@ -652,7 +652,7 @@ test_revision_index_to_archival_index(void) H5MM_xfree(aix.list); aix.list = NULL; - if (NULL == (aix.list = H5MM_malloc(sizeof(struct H5FD__onion_index_entry) * 2))) + if (NULL == (aix.list = H5MM_malloc(sizeof(H5FD_onion_index_entry_t) * 2))) TEST_ERROR; aix.list[0].logi_page = 2003 * (n_insert / 2) + 47; aix.list[0].phys_addr = 103; @@ -673,8 +673,8 @@ test_revision_index_to_archival_index(void) TEST_ERROR; for (i = 0; i < n_insert; i++) { - const struct H5FD__onion_index_entry *aix_entry_p = NULL; - uint64_t n = 2003 * (i + 1) + 47; + const H5FD_onion_index_entry_t *aix_entry_p = NULL; + uint64_t n = 2003 * (i + 1) + 47; aix_entry_p = &aix.list[i]; @@ -922,13 +922,13 @@ test_header_encode_decode(void) 88, 0, 0, 0, 0, 0, 0, 0, /* whole_history_size */ 0, 0, 0, 0 /* sum populated below */ }; - unsigned char * ptr = NULL; - uint32_t sum = 0; - uint32_t sum_out = 0; - size_t i = 0; - uint64_t size_ret = 0; - struct H5FD__onion_history_header hdr; - struct H5FD__onion_history_header hdr_out; + unsigned char * ptr = NULL; + uint32_t sum = 0; + uint32_t sum_out = 0; + size_t i = 0; + uint64_t size_ret = 0; + H5FD_onion_history_header_t hdr; + H5FD_onion_history_header_t hdr_out; TESTING("encode/decode history header"); @@ -1043,17 +1043,17 @@ test_whole_history_encode_decode_empty(void) 1, 0, 0, 0, /* NOTE: update version w/ "current" as needed */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* sum populated below */ }; - unsigned char * ptr = NULL; - uint32_t sum = 0; - uint32_t sum_out = 0; - size_t i = 0; - uint64_t size_ret = 0; - struct H5FD__onion_whole_history whs = { + unsigned char * ptr = NULL; + uint32_t sum = 0; + uint32_t sum_out = 0; + size_t i = 0; + uint64_t size_ret = 0; + H5FD_onion_whole_history_t whs = { H5FD__ONION_WHOLE_HISTORY_VERSION_CURR, 0, /* n_revisions */ NULL, /* list */ 0, /* checksum */ }; - struct H5FD__onion_whole_history whs_out = { + H5FD_onion_whole_history_t whs_out = { H5FD__ONION_WHOLE_HISTORY_VERSION_CURR, 0, /* n_revisions */ NULL, /* list */ 0, /* checksum */ @@ -1165,15 +1165,15 @@ test_whole_history_encode_decode(void) /* final checksum */ 0, 0, 0, 0 /* sum populated below */ }; - unsigned char * buf_p = NULL; - uint32_t sum_out = 0; - size_t i = 0; - struct H5FD__onion_whole_history whs = { + unsigned char * buf_p = NULL; + uint32_t sum_out = 0; + size_t i = 0; + H5FD_onion_whole_history_t whs = { H5FD__ONION_WHOLE_HISTORY_VERSION_CURR, 3, /* n_revisions */ NULL, /* list set below */ 0, /* checksum not set by us */ }; - struct H5FD__onion_whole_history whs_out = { + H5FD_onion_whole_history_t whs_out = { H5FD__ONION_WHOLE_HISTORY_VERSION_CURR, 0, /* n_revisions must start as zero */ NULL, /* list */ 0, /* checksum */ @@ -1186,8 +1186,8 @@ test_whole_history_encode_decode(void) if (80 != exp_size) TEST_ERROR; - whs.record_pointer_list = (struct H5FD__onion_record_pointer *)HDcalloc( - whs.n_revisions, sizeof(struct H5FD__onion_record_pointer)); + whs.record_pointer_list = + (H5FD_onion_record_pointer_t *)HDcalloc(whs.n_revisions, sizeof(H5FD_onion_record_pointer_t)); if (NULL == whs.record_pointer_list) TEST_ERROR; @@ -1245,8 +1245,8 @@ test_whole_history_encode_decode(void) /* True decode requires allocating space for record pointers */ - whs_out.record_pointer_list = (struct H5FD__onion_record_pointer *)HDcalloc( - whs_out.n_revisions, sizeof(struct H5FD__onion_record_pointer)); + whs_out.record_pointer_list = + (H5FD_onion_record_pointer_t *)HDcalloc(whs_out.n_revisions, sizeof(H5FD_onion_record_pointer_t)); if (NULL == whs_out.record_pointer_list) TEST_ERROR; @@ -1261,8 +1261,8 @@ test_whole_history_encode_decode(void) if (NULL == whs_out.record_pointer_list) TEST_ERROR; for (i = 0; i < whs.n_revisions; i++) { - struct H5FD__onion_record_pointer exp_rp = whs.record_pointer_list[i]; - struct H5FD__onion_record_pointer act_rp = whs_out.record_pointer_list[i]; + H5FD_onion_record_pointer_t exp_rp = whs.record_pointer_list[i]; + H5FD_onion_record_pointer_t act_rp = whs_out.record_pointer_list[i]; if (exp_rp.phys_addr != act_rp.phys_addr) TEST_ERROR; @@ -1340,14 +1340,14 @@ test_revision_record_encode_decode(void) /* final checksum */ 0, 0, 0, 0 /* sum populated below */ /* checksum */ }; - unsigned char * buf_p = NULL; - size_t i = 0; - uint64_t size_ret; - struct H5FD__onion_revision_record r_out; - uint32_t sum_out = 0; - char username[8] = "JohnDoe"; - char comment[25] = "Example comment message."; - struct H5FD__onion_revision_record record = { + unsigned char * buf_p = NULL; + size_t i = 0; + uint64_t size_ret; + H5FD_onion_revision_record_t r_out; + uint32_t sum_out = 0; + char username[8] = "JohnDoe"; + char comment[25] = "Example comment message."; + H5FD_onion_revision_record_t record = { H5FD__ONION_REVISION_RECORD_VERSION_CURR, 5, /* revision ID */ 2, /* parent revision ID */ @@ -1379,8 +1379,8 @@ test_revision_record_encode_decode(void) TEST_ERROR; HDmemcpy(record.time_of_creation, "19411207T190643Z", 16); - record.archival_index.list = (struct H5FD__onion_index_entry *)HDcalloc( - record.archival_index.n_entries, sizeof(struct H5FD__onion_index_entry)); + record.archival_index.list = (H5FD_onion_index_entry_t *)HDcalloc(record.archival_index.n_entries, + sizeof(H5FD_onion_index_entry_t)); if (NULL == record.archival_index.list) TEST_ERROR; /* convert logi_page and should match address in expected buffer */ @@ -1495,8 +1495,8 @@ test_revision_record_encode_decode(void) r_out.comment = (char *)HDcalloc(r_out.comment_size, sizeof(char)); if (NULL == r_out.comment) TEST_ERROR; - r_out.archival_index.list = (struct H5FD__onion_index_entry *)HDcalloc( - r_out.archival_index.n_entries, sizeof(struct H5FD__onion_index_entry)); + r_out.archival_index.list = (H5FD_onion_index_entry_t *)HDcalloc(r_out.archival_index.n_entries, + sizeof(H5FD_onion_index_entry_t)); if (NULL == r_out.archival_index.list) TEST_ERROR; @@ -1541,8 +1541,8 @@ test_revision_record_encode_decode(void) if (record.archival_index.n_entries != r_out.archival_index.n_entries) TEST_ERROR; for (i = 0; i < record.archival_index.n_entries; i++) { - struct H5FD__onion_index_entry *ep = &record.archival_index.list[i]; - struct H5FD__onion_index_entry *ap = &r_out.archival_index.list[i]; + H5FD_onion_index_entry_t *ep = &record.archival_index.list[i]; + H5FD_onion_index_entry_t *ap = &r_out.archival_index.list[i]; if (ep->phys_addr != ap->phys_addr) TEST_ERROR; @@ -1651,13 +1651,13 @@ error: static int verify_history_as_expected_onion(H5FD_t *raw_file, struct expected_history *filter) { - unsigned char * buf = NULL; /* allocated area for actual file bytes */ - struct H5FD__onion_history_header hdr_out; - struct H5FD__onion_whole_history whs_out; - struct H5FD__onion_revision_record rev_out; - uint64_t filesize = 0; - uint64_t readsize = 0; - size_t i = 0; + unsigned char * buf = NULL; /* allocated area for actual file bytes */ + H5FD_onion_history_header_t hdr_out; + H5FD_onion_whole_history_t whs_out; + H5FD_onion_revision_record_t rev_out; + uint64_t filesize = 0; + uint64_t readsize = 0; + size_t i = 0; hdr_out.version = H5FD__ONION_HEADER_VERSION_CURR; @@ -1725,15 +1725,15 @@ verify_history_as_expected_onion(H5FD_t *raw_file, struct expected_history *filt TEST_ERROR; /* Final read, populate pointers to revision records */ - whs_out.record_pointer_list = (struct H5FD__onion_record_pointer *)HDcalloc( - whs_out.n_revisions, sizeof(struct H5FD__onion_record_pointer)); + whs_out.record_pointer_list = + (H5FD_onion_record_pointer_t *)HDcalloc(whs_out.n_revisions, sizeof(H5FD_onion_record_pointer_t)); if (NULL == whs_out.record_pointer_list) TEST_ERROR; if (H5FD_onion_whole_history_decode(buf, &whs_out) != readsize) TEST_ERROR; /* Re-use buffer space to sanity-check checksum for record pointer(s). */ - HDassert(readsize >= sizeof(struct H5FD__onion_record_pointer)); + HDassert(readsize >= sizeof(H5FD_onion_record_pointer_t)); for (i = 0; i < whs_out.n_revisions; i++) { #if 0 uint32_t sum = 0; @@ -1755,8 +1755,8 @@ verify_history_as_expected_onion(H5FD_t *raw_file, struct expected_history *filt */ for (i = 0; i < whs_out.n_revisions; i++) { - struct H5FD__onion_record_pointer *rpp = &whs_out.record_pointer_list[i]; - struct expected_revision * erp = &filter->revisions[i]; + H5FD_onion_record_pointer_t *rpp = &whs_out.record_pointer_list[i]; + struct expected_revision * erp = &filter->revisions[i]; rev_out.archival_index.list = NULL; rev_out.archival_index.n_entries = 0; @@ -1796,8 +1796,8 @@ verify_history_as_expected_onion(H5FD_t *raw_file, struct expected_history *filt rev_out.comment = (char *)HDmalloc((size_t)rev_out.comment_size); if (NULL == rev_out.comment) TEST_ERROR; - rev_out.archival_index.list = (struct H5FD__onion_index_entry *)HDcalloc( - rev_out.archival_index.n_entries, sizeof(struct H5FD__onion_index_entry)); + rev_out.archival_index.list = (H5FD_onion_index_entry_t *)HDcalloc(rev_out.archival_index.n_entries, + sizeof(H5FD_onion_index_entry_t)); if (NULL == rev_out.archival_index.list) TEST_ERROR; rev_out.username = (char *)HDmalloc((size_t)rev_out.username_size); @@ -2346,14 +2346,14 @@ test_several_revisions_with_logical_gaps(void) unsigned char * buf = NULL; struct revise_revision about[4]; #if 0 - struct H5FD__onion_history_header hdr_out; - struct H5FD__onion_revision_record rev_out; + H5FD_onion_history_header_t hdr_out; + H5FD_onion_revision_record_t rev_out; #endif - struct H5FD__onion_whole_history whs_out; - size_t i = 0; - haddr_t size = 0; - uint64_t a_off = ONION_TEST_PAGE_SIZE_5 + 7; /* 39 */ - uint64_t b_off = (((a_off + a_list_size_s + ONION_TEST_PAGE_SIZE_5 - 1) >> 5) << 5) + + H5FD_onion_whole_history_t whs_out; + size_t i = 0; + haddr_t size = 0; + uint64_t a_off = ONION_TEST_PAGE_SIZE_5 + 7; /* 39 */ + uint64_t b_off = (((a_off + a_list_size_s + ONION_TEST_PAGE_SIZE_5 - 1) >> 5) << 5) + ONION_TEST_PAGE_SIZE_5 + 7; /* full page between */ TESTING("multiple revisions with gaps and overlap"); @@ -2426,7 +2426,7 @@ test_several_revisions_with_logical_gaps(void) if (NULL == file) TEST_ERROR; if (0 != H5FDget_eof(file, H5FD_MEM_DRAW)) { - HDprintf("\nEOF is not zero, it is: %llu\n", H5FDget_eof(file, H5FD_MEM_DRAW)); + HDprintf("\nEOF is not zero, it is: %" PRIuHADDR "\n", H5FDget_eof(file, H5FD_MEM_DRAW)); TEST_ERROR; } if (H5FDclose(file) < 0) @@ -2447,7 +2447,7 @@ test_several_revisions_with_logical_gaps(void) if (NULL == file) TEST_ERROR; if (0 != H5FDget_eof(file, H5FD_MEM_DRAW)) { - HDprintf("\nEOF is not zero, it is: %llu\n", H5FDget_eof(file, H5FD_MEM_DRAW)); + HDprintf("\nEOF is not zero, it is: %" PRIuHADDR "\n", H5FDget_eof(file, H5FD_MEM_DRAW)); TEST_ERROR; } if (H5FDclose(file) < 0) @@ -2470,7 +2470,8 @@ test_several_revisions_with_logical_gaps(void) TEST_ERROR; size = a_off + a_list_size_s; if (size != H5FDget_eof(file, H5FD_MEM_DRAW)) { - HDprintf("\nEOF is not %llu, it is: %llu\n", size, H5FDget_eof(file, H5FD_MEM_DRAW)); + HDprintf("\nEOF is not %" PRIuHADDR ", it is: %" PRIuHADDR "\n", size, + H5FDget_eof(file, H5FD_MEM_DRAW)); TEST_ERROR; } buf = (unsigned char *)HDmalloc(sizeof(unsigned char) * size); @@ -2810,16 +2811,16 @@ test_page_aligned_history_create(void) H5FD_ONION_FAPL_INFO_CREATE_FLAG_ENABLE_PAGE_ALIGNMENT, "initial commit" /* comment */ }; - H5FD_t * file = NULL; /* Onion virtual file for read/write */ - unsigned char * buf = NULL; - struct revise_revision about[2]; - struct H5FD__onion_history_header hdr_out; + H5FD_t * file = NULL; /* Onion virtual file for read/write */ + unsigned char * buf = NULL; + struct revise_revision about[2]; + H5FD_onion_history_header_t hdr_out; #if 0 - struct H5FD__onion_revision_record rev_out; + H5FD_onion_revision_record_t rev_out; #endif - struct H5FD__onion_whole_history whs_out; - size_t i = 0; - uint64_t a_off = b_list_size_s - a_list_size_s; + H5FD_onion_whole_history_t whs_out; + size_t i = 0; + uint64_t a_off = b_list_size_s - a_list_size_s; TESTING("page-aligned history on onion-created file"); @@ -2936,8 +2937,8 @@ test_page_aligned_history_create(void) TEST_ERROR; if (whs_out.n_revisions != 2) TEST_ERROR; - whs_out.record_pointer_list = (struct H5FD__onion_record_pointer *)HDcalloc( - whs_out.n_revisions, sizeof(struct H5FD__onion_record_pointer)); + whs_out.record_pointer_list = + (H5FD_onion_record_pointer_t *)HDcalloc(whs_out.n_revisions, sizeof(H5FD_onion_record_pointer_t)); if (NULL == whs_out.record_pointer_list) TEST_ERROR; if (H5FD_onion_whole_history_decode(buf, &whs_out) != hdr_out.whole_history_size) @@ -2946,7 +2947,7 @@ test_page_aligned_history_create(void) buf = NULL; for (i = 0; i < whs_out.n_revisions; i++) { - struct H5FD__onion_record_pointer *rr_p = &whs_out.record_pointer_list[i]; + H5FD_onion_record_pointer_t *rr_p = &whs_out.record_pointer_list[i]; if (rr_p->phys_addr & ((1 << 5) - 1)) /* 5::PAGE_SIZE_5 */ TEST_ERROR; /* TODO: check phys_addr of each page entry? */ @@ -3122,17 +3123,17 @@ test_integration_create(void) /* * Create first revision */ - HDputs("."); + // HDputs("."); fflush(stdout); file_id = H5Fopen(paths->canon, H5F_ACC_RDWR, fapl_id); - HDputs("."); + // HDputs("."); fflush(stdout); if (H5I_INVALID_HID == file_id) { TEST_ERROR; } - HDputs("."); + // HDputs("."); HDfflush(stdout); /// @@ -3141,7 +3142,7 @@ test_integration_create(void) TEST_ERROR } - HDputs("."); + // HDputs("."); HDfflush(stdout); int dset_data[4][7]; for (i = 0; i < 4; i++) @@ -3158,14 +3159,14 @@ test_integration_create(void) } #endif - HDputs("."); + // HDputs("."); HDfflush(stdout); if (H5Dwrite(dset, H5T_STD_I32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data) < 0) TEST_ERROR; - HDputs("."); + // HDputs("."); HDfflush(stdout); - HDputs("."); + // HDputs("."); HDfflush(stdout); if (H5Dclose(dset) < 0) @@ -3178,17 +3179,17 @@ test_integration_create(void) /* * Create second revision */ - HDputs("."); + // HDputs("."); fflush(stdout); file_id = H5Fopen(paths->canon, H5F_ACC_RDWR, fapl_id); - HDputs("."); + // HDputs("."); fflush(stdout); if (H5I_INVALID_HID == file_id) { TEST_ERROR; } - HDputs("."); + // HDputs("."); HDfflush(stdout); dset = H5Dopen(file_id, "DS1", H5P_DEFAULT); @@ -3196,7 +3197,7 @@ test_integration_create(void) TEST_ERROR } - HDputs("."); + // HDputs("."); HDfflush(stdout); for (i = 0; i < 4; i++) for (j = 0; j < 7; j++) @@ -3212,14 +3213,14 @@ test_integration_create(void) } #endif - HDputs("."); + // HDputs("."); HDfflush(stdout); if (H5Dwrite(dset, H5T_STD_I32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data) < 0) TEST_ERROR; - HDputs("."); + // HDputs("."); HDfflush(stdout); - HDputs("."); + // HDputs("."); HDfflush(stdout); /* @@ -3245,17 +3246,17 @@ test_integration_create(void) if (H5Pset_fapl_onion(fapl_id, &onion_info) < 0) TEST_ERROR; - HDputs("."); + // HDputs("."); fflush(stdout); file_id = H5Fopen(paths->canon, H5F_ACC_RDWR, fapl_id); - HDputs("."); + // HDputs("."); fflush(stdout); if (H5I_INVALID_HID == file_id) { TEST_ERROR; } - HDputs("."); + // HDputs("."); HDfflush(stdout); /// @@ -3264,7 +3265,7 @@ test_integration_create(void) TEST_ERROR } - HDputs("."); + // HDputs("."); #if 0 HDputs("\n\nREADING\n\n"); #endif @@ -3450,7 +3451,7 @@ test_integration_create_simple(void) //////////////////////////// - HDputs("."); + // HDputs("."); fflush(stdout); file_id = H5Fopen(paths->canon, H5F_ACC_RDWR, fapl_id); @@ -3458,7 +3459,7 @@ test_integration_create_simple(void) TEST_ERROR; } - HDputs("."); + // HDputs("."); HDfflush(stdout); dset = H5Dopen(file_id, "DS1", H5P_DEFAULT); @@ -3466,7 +3467,7 @@ test_integration_create_simple(void) TEST_ERROR } - HDputs("."); + // HDputs("."); HDfflush(stdout); int dset_data[1][1024]; for (i = 0; i < 1024; i++) @@ -3482,14 +3483,14 @@ test_integration_create_simple(void) } #endif - HDputs("."); + // HDputs("."); HDfflush(stdout); if (H5Dwrite(dset, H5T_STD_I32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data) < 0) TEST_ERROR; - HDputs("."); + // HDputs("."); HDfflush(stdout); - HDputs("."); + // HDputs("."); HDfflush(stdout); if (H5Dclose(dset) < 0) @@ -3502,7 +3503,7 @@ test_integration_create_simple(void) /* * Create second revision */ - HDputs("."); + // HDputs("."); fflush(stdout); file_id = H5Fopen(paths->canon, H5F_ACC_RDWR, fapl_id); @@ -3511,7 +3512,7 @@ test_integration_create_simple(void) TEST_ERROR; } - HDputs("."); + // HDputs("."); HDfflush(stdout); dset = H5Dopen(file_id, "DS1", H5P_DEFAULT); @@ -3520,7 +3521,7 @@ test_integration_create_simple(void) TEST_ERROR } - HDputs("."); + // HDputs("."); HDfflush(stdout); for (i = 0; i < 1024; i++) dset_data[0][i] = i + 2048; @@ -3535,14 +3536,14 @@ test_integration_create_simple(void) } #endif - HDputs("."); + // HDputs("."); HDfflush(stdout); if (H5Dwrite(dset, H5T_STD_I32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data) < 0) TEST_ERROR; - HDputs("."); + // HDputs("."); HDfflush(stdout); - HDputs("."); + // HDputs("."); HDfflush(stdout); /* @@ -3560,7 +3561,7 @@ test_integration_create_simple(void) * Create third revision */ - HDputs("."); + // HDputs("."); fflush(stdout); file_id = H5Fopen(paths->canon, H5F_ACC_RDWR, fapl_id); @@ -3569,7 +3570,7 @@ test_integration_create_simple(void) TEST_ERROR; } - HDputs("."); + // HDputs("."); HDfflush(stdout); dset = H5Dopen(file_id, "DS1", H5P_DEFAULT); @@ -3578,7 +3579,7 @@ test_integration_create_simple(void) TEST_ERROR } - HDputs("."); + // HDputs("."); HDfflush(stdout); for (i = 0; i < 1024; i += 20) dset_data[0][i] = i + 3072; @@ -3593,14 +3594,14 @@ test_integration_create_simple(void) } #endif - HDputs("."); + // HDputs("."); HDfflush(stdout); if (H5Dwrite(dset, H5T_STD_I32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data) < 0) TEST_ERROR; - HDputs("."); + // HDputs("."); HDfflush(stdout); - HDputs("."); + // HDputs("."); HDfflush(stdout); /* @@ -3630,18 +3631,18 @@ test_integration_create_simple(void) if (H5Pset_fapl_onion(fapl_id, &onion_info) < 0) TEST_ERROR; - HDputs("."); + // HDputs("."); fflush(stdout); file_id = H5Fopen(paths->canon, H5F_ACC_RDWR, fapl_id); - HDputs("."); + // HDputs("."); fflush(stdout); if (H5I_INVALID_HID == file_id) { printf("\n\n\n\nERROR OPENING\n\n\n\n"); TEST_ERROR; } - HDputs("."); + // HDputs("."); HDfflush(stdout); dset = H5Dopen(file_id, "DS1", H5P_DEFAULT); @@ -3650,7 +3651,7 @@ test_integration_create_simple(void) TEST_ERROR } - HDputs("."); + // HDputs("."); #if 0 HDputs("\n\nREADING\n\n"); #endif diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index 3abc3d2..57c328a 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -60,7 +60,7 @@ static H5FD_onion_fapl_info_t onion_fa_g = { 0, /* creation_flags */ "indoor speaking voices", /* comment */ }; -static int64_t onion_revision_g = -1; +static uint64_t onion_revision_g = UINT64_MAX; /* module-scoped variables for XML option */ #define DEFAULT_XSD "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" @@ -1273,8 +1273,9 @@ end_collect: vol_info_g.info_string = H5_optarg; break; case 'F': - onion_revision_g = atol(H5_optarg); - HDprintf("Using revision %d\n", onion_revision_g); + /* TODO: Convert to strtoumax */ + onion_revision_g = (uint64_t)HDatol(H5_optarg); + HDprintf("Using revision %" PRIu64 "\n", onion_revision_g); break; case '?': default: -- cgit v0.12