diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-06-06 19:23:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-06 19:23:59 (GMT) |
commit | 3c05dd74b865135ee7b0dcf0c38d5df85c6d95d8 (patch) | |
tree | 0ca6fc1d353505daebfe7813d17f05053f52bd9c /src/H5HLcache.c | |
parent | 2384a731763a7ceb11e39d48cc0f6991d908389e (diff) | |
download | hdf5-3c05dd74b865135ee7b0dcf0c38d5df85c6d95d8.zip hdf5-3c05dd74b865135ee7b0dcf0c38d5df85c6d95d8.tar.gz hdf5-3c05dd74b865135ee7b0dcf0c38d5df85c6d95d8.tar.bz2 |
Move encode/decode macros to a new header (#3040)
Moves the file-independent encode and decode macros to a new
H5encode.h header that is itself included in H5private.h.
Removes UINT64ENCODE_VARLEN and UINT64DECODE_VARLEN, which
were unused.
Fixes include statements in files where H5VMprivate.h and
H5MMprivate.h were included via H5Fprivate.h.
Diffstat (limited to 'src/H5HLcache.c')
-rw-r--r-- | src/H5HLcache.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 04b86a0..bdce190 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -28,12 +28,14 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5HLpkg.h" /* Local Heaps */ -#include "H5MFprivate.h" /* File memory management */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5WBprivate.h" /* Wrapped Buffers */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata Cache */ +#include "H5Cprivate.h" /* Cache */ +#include "H5Eprivate.h" /* Error Handling */ +#include "H5Fprivate.h" /* Files */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5HLpkg.h" /* Local Heaps */ +#include "H5MMprivate.h" /* Memory Management */ /****************/ /* Local Macros */ @@ -178,12 +180,12 @@ H5HL__hdr_deserialize(H5HL_t *heap, const uint8_t *image, size_t len, H5HL_cache /* Heap data size */ if (H5_IS_BUFFER_OVERFLOW(image, udata->sizeof_size, p_end)) HGOTO_ERROR(H5E_HEAP, H5E_OVERFLOW, FAIL, "ran off end of input buffer while decoding"); - H5F_DECODE_LENGTH_LEN(image, heap->dblk_size, udata->sizeof_size); + H5_DECODE_LENGTH_LEN(image, heap->dblk_size, udata->sizeof_size); /* Free list head */ if (H5_IS_BUFFER_OVERFLOW(image, udata->sizeof_size, p_end)) HGOTO_ERROR(H5E_HEAP, H5E_OVERFLOW, FAIL, "ran off end of input buffer while decoding"); - H5F_DECODE_LENGTH_LEN(image, heap->free_block, udata->sizeof_size); + H5_DECODE_LENGTH_LEN(image, heap->free_block, udata->sizeof_size); if (heap->free_block != H5HL_FREE_NULL && heap->free_block >= heap->dblk_size) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad heap free list") @@ -239,12 +241,12 @@ H5HL__fl_deserialize(H5HL_t *heap) /* Decode offset of next free block */ image = heap->dblk_image + free_block; - H5F_DECODE_LENGTH_LEN(image, free_block, heap->sizeof_size); + H5_DECODE_LENGTH_LEN(image, free_block, heap->sizeof_size); if (0 == free_block) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "free block size is zero?") /* Decode length of this free block */ - H5F_DECODE_LENGTH_LEN(image, fl->size, heap->sizeof_size); + H5_DECODE_LENGTH_LEN(image, fl->size, heap->sizeof_size); if ((fl->offset + fl->size) > heap->dblk_size) HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "bad heap free list") @@ -296,11 +298,11 @@ H5HL__fl_serialize(const H5HL_t *heap) image = heap->dblk_image + fl->offset; if (fl->next) - H5F_ENCODE_LENGTH_LEN(image, fl->next->offset, heap->sizeof_size) + H5_ENCODE_LENGTH_LEN(image, fl->next->offset, heap->sizeof_size) else - H5F_ENCODE_LENGTH_LEN(image, H5HL_FREE_NULL, heap->sizeof_size) + H5_ENCODE_LENGTH_LEN(image, H5HL_FREE_NULL, heap->sizeof_size) - H5F_ENCODE_LENGTH_LEN(image, fl->size, heap->sizeof_size) + H5_ENCODE_LENGTH_LEN(image, fl->size, heap->sizeof_size) } FUNC_LEAVE_NOAPI_VOID @@ -576,8 +578,8 @@ H5HL__cache_prefix_serialize(const H5_ATTR_NDEBUG_UNUSED H5F_t *f, void *_image, *image++ = 0; /*reserved*/ *image++ = 0; /*reserved*/ *image++ = 0; /*reserved*/ - H5F_ENCODE_LENGTH_LEN(image, heap->dblk_size, heap->sizeof_size); - H5F_ENCODE_LENGTH_LEN(image, heap->free_block, heap->sizeof_size); + H5_ENCODE_LENGTH_LEN(image, heap->dblk_size, heap->sizeof_size); + H5_ENCODE_LENGTH_LEN(image, heap->free_block, heap->sizeof_size); H5F_addr_encode_len(heap->sizeof_addr, &image, heap->dblk_addr); /* Check if the local heap is a single object in cache */ |