diff options
author | kmu <kmu@hdfgroup.org> | 2020-01-13 19:20:19 (GMT) |
---|---|---|
committer | kmu <kmu@hdfgroup.org> | 2020-01-13 19:20:19 (GMT) |
commit | 9712fad601a7844dc01deb1dc4d81b5aa5402b5e (patch) | |
tree | a5020737164f843254a67695e4cae4586f568c3e /test/cache_common.c | |
parent | b0e5b2d9338bf352a4154a838c4146c84be8705b (diff) | |
download | hdf5-9712fad601a7844dc01deb1dc4d81b5aa5402b5e.zip hdf5-9712fad601a7844dc01deb1dc4d81b5aa5402b5e.tar.gz hdf5-9712fad601a7844dc01deb1dc4d81b5aa5402b5e.tar.bz2 |
fix unused related warnings
Diffstat (limited to 'test/cache_common.c')
-rw-r--r-- | test/cache_common.c | 67 |
1 files changed, 22 insertions, 45 deletions
diff --git a/test/cache_common.c b/test/cache_common.c index 24962bc..8607717 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -20,6 +20,7 @@ #include "H5CXprivate.h" /* API Contexts */ #include "H5MFprivate.h" #include "H5MMprivate.h" +#include "H5private.h" #include "cache_common.h" @@ -622,7 +623,7 @@ check_write_permitted(const H5F_t H5_ATTR_UNUSED *f, hbool_t *write_permitted_pt *------------------------------------------------------------------------- */ static herr_t -get_initial_load_size(void *udata, size_t *image_length, int32_t entry_type) +get_initial_load_size(void *udata, size_t *image_length, int32_t H5_ATTR_SANITY_CHECK entry_type) { test_entry_t *entry; test_entry_t *base_addr; @@ -732,7 +733,7 @@ notify_get_initial_load_size(void *udata, size_t *image_length) */ static herr_t get_final_load_size(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED image_len, - void *udata, size_t *actual_len, int32_t entry_type) + void *udata, size_t *actual_len, int32_t H5_ATTR_SANITY_CHECK entry_type) { test_entry_t *entry; test_entry_t *base_addr; @@ -792,7 +793,8 @@ variable_get_final_load_size(const void *image, size_t image_len, */ static htri_t -verify_chksum(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED len, void *udata, int32_t entry_type) +verify_chksum(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED len, void *udata, + int32_t H5_ATTR_SANITY_CHECK entry_type) { test_entry_t *entry; test_entry_t *base_addr; @@ -845,8 +847,8 @@ variable_verify_chksum(const void *image, size_t len, void *udata) *------------------------------------------------------------------------- */ static void * -deserialize(const void *image, size_t len, void *udata, hbool_t *dirty, - int32_t entry_type) +deserialize(const void *image, size_t H5_ATTR_SANITY_CHECK len, void *udata, hbool_t *dirty, + int32_t H5_ATTR_SANITY_CHECK entry_type) { test_entry_t *entry; test_entry_t *base_addr; @@ -1002,12 +1004,10 @@ notify_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) *------------------------------------------------------------------------- */ herr_t -image_len(const void *thing, size_t *image_length, int32_t entry_type) +image_len(const void *thing, size_t *image_length, int32_t H5_ATTR_SANITY_CHECK entry_type) { const test_entry_t *entry; - test_entry_t *base_addr; int32_t type; - int32_t idx; HDassert(thing); HDassert(image_length); @@ -1017,14 +1017,12 @@ image_len(const void *thing, size_t *image_length, int32_t entry_type) HDassert(entry->self == entry); type = entry->type; - idx = entry->index; HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); HDassert(type == entry_type); - HDassert((idx >= 0) && (idx <= max_indices[type])); + HDassert((entry->index >= 0) && (entry->index <= max_indices[type])); - base_addr = entries[type]; - HDassert(entry == &(base_addr[idx])); + HDassert(entry == &(entries[type][entry->index])); if(type != VARIABLE_ENTRY_TYPE) HDassert(entry->size == entry_sizes[type]); @@ -1124,18 +1122,15 @@ notify_image_len(const void *thing, size_t *image_length) *------------------------------------------------------------------------- */ herr_t -pre_serialize(H5F_t *f, +pre_serialize(H5F_t H5_ATTR_SANITY_CHECK *f, void *thing, - haddr_t addr, - size_t len, + haddr_t H5_ATTR_SANITY_CHECK addr, + size_t H5_ATTR_SANITY_CHECK len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr) { test_entry_t *entry; - test_entry_t *base_addr; - int32_t type; - int32_t idx; int32_t i; HDassert(f); @@ -1155,16 +1150,9 @@ pre_serialize(H5F_t *f, /* shouldn't serialize the entry unless it is dirty */ HDassert(entry->is_dirty); - - type = entry->type; - idx = entry->index; - - HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((idx >= 0) && (idx <= max_indices[type])); - - base_addr = entries[type]; - - HDassert(entry == &(base_addr[idx])); + HDassert((entry->type >= 0) && (entry->type < NUMBER_OF_ENTRY_TYPES)); + HDassert((entry->index >= 0) && (entry->index <= max_indices[entry->type])); + HDassert(entry == &(entries[entry->type][entry->index])); HDassert(entry->num_flush_ops >= 0); HDassert(entry->num_flush_ops < MAX_FLUSH_OPS); @@ -1376,9 +1364,7 @@ herr_t serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing) { test_entry_t *entry; - test_entry_t *base_addr; int32_t type; - int32_t idx; HDassert(image_ptr); HDassert(thing); @@ -1392,14 +1378,11 @@ serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thin HDassert(entry->is_dirty); type = entry->type; - idx = entry->index; HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((idx >= 0) && (idx <= max_indices[type])); + HDassert((entry->index >= 0) && (entry->index <= max_indices[type])); - base_addr = entries[type]; - - HDassert(entry == &(base_addr[idx])); + HDassert(entry == &(entries[type][entry->index])); HDassert(entry->num_flush_ops >= 0); HDassert(entry->num_flush_ops < MAX_FLUSH_OPS); @@ -1530,21 +1513,19 @@ notify_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, *------------------------------------------------------------------------- */ static herr_t -notify(H5C_notify_action_t action, void *thing, int32_t entry_type) +notify(H5C_notify_action_t action, void *thing, int32_t H5_ATTR_SANITY_CHECK entry_type) { test_entry_t *entry; - test_entry_t *base_addr; HDassert(thing); entry = (test_entry_t *)thing; - base_addr = entries[entry->type]; HDassert(entry->index >= 0); HDassert(entry->index <= max_indices[entry->type]); HDassert((entry->type >= 0) && (entry->type < NUMBER_OF_ENTRY_TYPES)); HDassert(entry->type == entry_type); - HDassert(entry == &(base_addr[entry->index])); + HDassert(entry == &(entries[entry->type][entry->index])); HDassert(entry == entry->self); if(!(action == H5C_NOTIFY_ACTION_ENTRY_DIRTIED && entry->action == TEST_ENTRY_ACTION_MOVE)) HDassert(entry->header.addr == entry->addr); @@ -1609,18 +1590,14 @@ notify_notify(H5C_notify_action_t action, void *thing) *------------------------------------------------------------------------- */ herr_t -free_icr(test_entry_t *entry, int32_t entry_type) +free_icr(test_entry_t *entry, int32_t H5_ATTR_SANITY_CHECK entry_type) { - test_entry_t *base_addr; - HDassert(entry); - base_addr = entries[entry->type]; - HDassert(entry->type == entry_type); HDassert(entry->index >= 0); HDassert(entry->index <= max_indices[entry->type]); - HDassert(entry == &(base_addr[entry->index])); + HDassert(entry == &(entries[entry->type][entry->index])); HDassert(entry == entry->self); HDassert(entry->cache_ptr != NULL); HDassert(entry->cache_ptr->magic == H5C__H5C_T_MAGIC); |