summaryrefslogtreecommitdiffstats
path: root/src/H5FDonion_index.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-07-28 19:33:16 (GMT)
committerGitHub <noreply@github.com>2023-07-28 19:33:16 (GMT)
commit8ddf2706f7e0cde59fad6624e2863960e62f6544 (patch)
treef090bb9fa368c90f67029f5d860ef39df3e8b038 /src/H5FDonion_index.c
parentb1ab59d239c74cdbea7d518b1398458c4150655f (diff)
downloadhdf5-8ddf2706f7e0cde59fad6624e2863960e62f6544.zip
hdf5-8ddf2706f7e0cde59fad6624e2863960e62f6544.tar.gz
hdf5-8ddf2706f7e0cde59fad6624e2863960e62f6544.tar.bz2
Sync of src w/ develop (#3307)
Diffstat (limited to 'src/H5FDonion_index.c')
-rw-r--r--src/H5FDonion_index.c71
1 files changed, 36 insertions, 35 deletions
diff --git a/src/H5FDonion_index.c b/src/H5FDonion_index.c
index a164e91..62cc009 100644
--- a/src/H5FDonion_index.c
+++ b/src/H5FDonion_index.c
@@ -19,11 +19,12 @@
/* This source code file is part of the H5FD driver module */
#include "H5FDdrvr_module.h"
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FDprivate.h" /* File drivers */
-#include "H5FDonion.h" /* Onion file driver */
-#include "H5FDonion_priv.h" /* Onion file driver internals */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5FDonion.h" /* Onion file driver */
+#include "H5FDonion_priv.h" /* Onion file driver internals */
+#include "H5MMprivate.h" /* Memory management */
/* 2^n for uint64_t types -- H5_EXP2 unsafe past 32 bits */
#define U64_EXP2(n) ((uint64_t)1 << (n))
@@ -51,7 +52,7 @@ H5FD__onion_ingest_revision_record(H5FD_onion_revision_record_t *r_out, H5FD_t *
haddr_t addr = 0;
size_t size = 0;
- FUNC_ENTER_PACKAGE;
+ FUNC_ENTER_PACKAGE
assert(r_out);
assert(raw_file);
@@ -161,7 +162,7 @@ done:
H5MM_xfree(r_out->archival_index.list);
}
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__onion_ingest_revision_record() */
/*-----------------------------------------------------------------------------
@@ -183,23 +184,23 @@ H5FD__onion_archival_index_is_valid(const H5FD_onion_archival_index_t *aix)
{
hbool_t ret_value = TRUE;
- FUNC_ENTER_PACKAGE_NOERR;
+ FUNC_ENTER_PACKAGE_NOERR
assert(aix);
if (H5FD_ONION_ARCHIVAL_INDEX_VERSION_CURR != aix->version)
- HGOTO_DONE(FALSE)
+ HGOTO_DONE(FALSE);
if (NULL == aix->list)
- HGOTO_DONE(FALSE)
+ HGOTO_DONE(FALSE);
/* Ensure list is sorted on logical_page field */
if (aix->n_entries > 1)
for (uint64_t i = 1; i < aix->n_entries - 1; i++)
if (aix->list[i + 1].logical_page <= aix->list[i].logical_page)
- HGOTO_DONE(FALSE)
+ HGOTO_DONE(FALSE);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__onion_archival_index_is_valid() */
/*-----------------------------------------------------------------------------
@@ -227,7 +228,7 @@ H5FD__onion_archival_index_find(const H5FD_onion_archival_index_t *aix, uint64_t
H5FD_onion_index_entry_t *x = NULL;
int ret_value = 0;
- FUNC_ENTER_PACKAGE_NOERR;
+ FUNC_ENTER_PACKAGE_NOERR
assert(aix);
assert(H5FD_ONION_ARCHIVAL_INDEX_VERSION_CURR == aix->version);
@@ -241,7 +242,7 @@ H5FD__onion_archival_index_find(const H5FD_onion_archival_index_t *aix, uint64_t
/* Trivial cases */
if (aix->n_entries == 0 || logical_page > aix->list[high].logical_page ||
logical_page < aix->list[0].logical_page)
- HGOTO_DONE(0)
+ HGOTO_DONE(0);
/*
* Binary search on sorted list
@@ -275,7 +276,7 @@ H5FD__onion_archival_index_find(const H5FD_onion_archival_index_t *aix, uint64_t
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__onion_archival_index_find() */
/*-----------------------------------------------------------------------------
@@ -291,7 +292,7 @@ H5FD__onion_revision_index_destroy(H5FD_onion_revision_index_t *rix)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_PACKAGE_NOERR;
+ FUNC_ENTER_PACKAGE_NOERR
assert(rix);
assert(H5FD_ONION_REVISION_INDEX_VERSION_CURR == rix->version);
@@ -314,7 +315,7 @@ H5FD__onion_revision_index_destroy(H5FD_onion_revision_index_t *rix)
H5MM_xfree(rix->_hash_table);
H5MM_xfree(rix);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__onion_revision_index_destroy() */
/*-----------------------------------------------------------------------------
@@ -335,7 +336,7 @@ H5FD__onion_revision_index_init(uint32_t page_size)
H5FD_onion_revision_index_t *rix = NULL;
H5FD_onion_revision_index_t *ret_value = NULL;
- FUNC_ENTER_PACKAGE;
+ FUNC_ENTER_PACKAGE
assert(0 != page_size);
assert(POWER_OF_TWO(page_size));
@@ -363,7 +364,7 @@ done:
if (NULL == ret_value)
H5MM_xfree(rix);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__onion_revision_index_init() */
/*-----------------------------------------------------------------------------
@@ -389,7 +390,7 @@ H5FD__onion_revision_index_resize(H5FD_onion_revision_index_t *rix)
uint64_t new_n_keys_populated = 0;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_PACKAGE;
+ FUNC_ENTER_PACKAGE
assert(rix);
assert(H5FD_ONION_REVISION_INDEX_VERSION_CURR == rix->version);
@@ -427,7 +428,7 @@ H5FD__onion_revision_index_resize(H5FD_onion_revision_index_t *rix)
rix->_hash_table = new_table;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__onion_revision_index_resize() */
/*-----------------------------------------------------------------------------
@@ -451,7 +452,7 @@ H5FD__onion_revision_index_insert(H5FD_onion_revision_index_t *rix, const H5FD_o
H5FD_onion_revision_index_hash_chain_node_t **append_dest = NULL;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_PACKAGE;
+ FUNC_ENTER_PACKAGE
assert(rix);
assert(H5FD_ONION_REVISION_INDEX_VERSION_CURR == rix->version);
@@ -501,7 +502,7 @@ H5FD__onion_revision_index_insert(H5FD_onion_revision_index_t *rix, const H5FD_o
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__onion_revision_index_insert() */
/*-----------------------------------------------------------------------------
@@ -524,7 +525,7 @@ H5FD__onion_revision_index_find(const H5FD_onion_revision_index_t *rix, uint64_t
uint64_t key = 0;
int ret_value = 0;
- FUNC_ENTER_PACKAGE_NOERR;
+ FUNC_ENTER_PACKAGE_NOERR
assert(rix);
assert(H5FD_ONION_REVISION_INDEX_VERSION_CURR == rix->version);
@@ -546,7 +547,7 @@ H5FD__onion_revision_index_find(const H5FD_onion_revision_index_t *rix, uint64_t
}
}
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__onion_revision_index_find() */
/*-----------------------------------------------------------------------------
@@ -596,7 +597,7 @@ H5FD__onion_revision_record_decode(unsigned char *buf, H5FD_onion_revision_recor
unsigned char *ptr = NULL;
size_t ret_value = 0;
- FUNC_ENTER_PACKAGE;
+ FUNC_ENTER_PACKAGE
assert(buf != NULL);
assert(record != NULL);
@@ -722,7 +723,7 @@ H5FD__onion_revision_record_decode(unsigned char *buf, H5FD_onion_revision_recor
ret_value = (size_t)(ptr - buf);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__onion_revision_record_decode() */
/*-----------------------------------------------------------------------------
@@ -753,7 +754,7 @@ H5FD__onion_revision_record_encode(H5FD_onion_revision_record_t *record, unsigne
uint32_t vers_u32 = (uint32_t)record->version; /* pad out unused bytes */
uint32_t page_size = 0;
- FUNC_ENTER_PACKAGE_NOERR;
+ FUNC_ENTER_PACKAGE_NOERR
assert(checksum != NULL);
assert(buf != NULL);
@@ -804,7 +805,7 @@ H5FD__onion_revision_record_encode(H5FD_onion_revision_record_t *record, unsigne
*checksum = H5_checksum_fletcher32(buf, (size_t)(ptr - buf));
UINT32ENCODE(ptr, *checksum);
- FUNC_LEAVE_NOAPI((size_t)(ptr - buf));
+ FUNC_LEAVE_NOAPI((size_t)(ptr - buf))
} /* end H5FD__onion_revision_record_encode() */
/*-----------------------------------------------------------------------------
@@ -853,7 +854,7 @@ H5FD__onion_merge_revision_index_into_archival_index(const H5FD_onion_revision_i
};
herr_t ret_value = SUCCEED;
- FUNC_ENTER_PACKAGE;
+ FUNC_ENTER_PACKAGE
assert(rix);
assert(aix);
@@ -881,8 +882,8 @@ H5FD__onion_merge_revision_index_into_archival_index(const H5FD_onion_revision_i
}
/* Sort the new archival list */
- HDqsort(new_aix.list, new_aix.n_entries, sizeof(H5FD_onion_index_entry_t),
- H5FD__onion_archival_index_list_sort_cmp);
+ qsort(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
* old archival list entries that are not also included in the revision
@@ -923,13 +924,13 @@ H5FD__onion_merge_revision_index_into_archival_index(const H5FD_onion_revision_i
}
/* Sort this list */
- HDqsort(aix->list, aix->n_entries, sizeof(H5FD_onion_index_entry_t),
- H5FD__onion_archival_index_list_sort_cmp);
+ qsort(aix->list, aix->n_entries, sizeof(H5FD_onion_index_entry_t),
+ H5FD__onion_archival_index_list_sort_cmp);
done:
/* Free the temporary lists */
H5MM_xfree(kept_list);
H5MM_xfree(new_aix.list);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__onion_merge_revision_index_into_archival_index() */