diff options
Diffstat (limited to 'src/H5HFhuge.c')
-rw-r--r-- | src/H5HFhuge.c | 34 |
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) */ |