summaryrefslogtreecommitdiffstats
path: root/src/H5HFhuge.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-06-06 19:23:59 (GMT)
committerGitHub <noreply@github.com>2023-06-06 19:23:59 (GMT)
commit3c05dd74b865135ee7b0dcf0c38d5df85c6d95d8 (patch)
tree0ca6fc1d353505daebfe7813d17f05053f52bd9c /src/H5HFhuge.c
parent2384a731763a7ceb11e39d48cc0f6991d908389e (diff)
downloadhdf5-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/H5HFhuge.c')
-rw-r--r--src/H5HFhuge.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c
index a71cbf2..23c3330 100644
--- a/src/H5HFhuge.c
+++ b/src/H5HFhuge.c
@@ -13,8 +13,6 @@
/*-------------------------------------------------------------------------
*
* Created: H5HFhuge.c
- * Aug 7 2006
- * Quincey Koziol
*
* Purpose: Routines for "huge" objects in fractal heap
*
@@ -801,34 +799,28 @@ done:
} /* end H5HF__huge_op_real() */
/*-------------------------------------------------------------------------
- * Function: H5HF__huge_write
+ * Function: H5HF__huge_write
*
- * Purpose: Write a 'huge' object to the heap
+ * Purpose: Write a 'huge' object to the heap
*
- * Note: This implementation somewhat limited: it doesn't handle
- * heaps with filters, which would require re-compressing the
- * huge object and probably changing the address of the object
- * on disk (and possibly the heap ID for "direct" huge IDs).
+ * Note: This implementation somewhat limited: it doesn't handle
+ * heaps with filters, which would require re-compressing the
+ * huge object and probably changing the address of the object
+ * on disk (and possibly the heap ID for "direct" huge IDs).
*
- * Return: SUCCEED/FAIL
- *
- * Programmer: Quincey Koziol
- * Feb 21 2007
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
herr_t
H5HF__huge_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj)
{
- haddr_t obj_addr; /* Object's address in the file */
- size_t obj_size; /* Object's size in the file */
- herr_t ret_value = SUCCEED; /* Return value */
+ haddr_t obj_addr = HADDR_UNDEF; /* Object's address in the file */
+ size_t obj_size = 0; /* Object's size in the file */
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_PACKAGE
- /*
- * Check arguments.
- */
HDassert(hdr);
HDassert(id);
HDassert(obj);
@@ -845,7 +837,7 @@ H5HF__huge_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj)
/* Retrieve the object's address and length (common) */
H5F_addr_decode(hdr->f, &id, &obj_addr);
H5F_DECODE_LENGTH(hdr->f, id, obj_size);
- } /* end if */
+ }
else {
H5HF_huge_bt2_indir_rec_t found_rec; /* Record found from tracking object */
H5HF_huge_bt2_indir_rec_t search_rec; /* Record for searching for object */
@@ -860,7 +852,7 @@ H5HF__huge_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj)
if (NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, hdr->huge_bt2_addr, hdr->f)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL,
"unable to open v2 B-tree for tracking 'huge' heap objects")
- } /* end if */
+ }
/* Get ID for looking up 'huge' object in v2 B-tree */
UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size)
@@ -874,7 +866,7 @@ H5HF__huge_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj)
/* Retrieve the object's address & length */
obj_addr = found_rec.addr;
H5_CHECKED_ASSIGN(obj_size, size_t, found_rec.len, hsize_t);
- } /* end else */
+ }
/* Write the object's data to the file */
/* (writes directly from application's buffer) */