summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5AC.c2
-rw-r--r--src/H5Apkg.h11
-rw-r--r--src/H5B2.c3
-rw-r--r--src/H5B2int.c14
-rw-r--r--src/H5Cprivate.h4
-rw-r--r--src/H5Dio.c2
-rw-r--r--src/H5Dlayout.c33
-rw-r--r--src/H5Doh.c4
-rw-r--r--src/H5Dpkg.h2
-rw-r--r--src/H5EApkg.h60
-rw-r--r--src/H5EAprivate.h16
-rw-r--r--src/H5F.c1
-rw-r--r--src/H5FA.c2
-rw-r--r--src/H5FAprivate.h2
-rw-r--r--src/H5Fsuper.c2
-rw-r--r--src/H5Fsuper_cache.c2
-rw-r--r--src/H5Gstab.c4
-rw-r--r--src/H5HG.c24
-rw-r--r--src/H5HGpkg.h6
-rw-r--r--src/H5MF.c2
-rw-r--r--src/H5Oainfo.c6
-rw-r--r--src/H5Oalloc.c16
-rw-r--r--src/H5Ocache.c1
-rw-r--r--src/H5Ochunk.c8
-rw-r--r--src/H5Olayout.c72
-rw-r--r--src/Makefile.am2
-rw-r--r--test/dsets.c39
-rw-r--r--test/earray.c297
-rw-r--r--test/gen_plist.c2
-rw-r--r--test/h5test.c14
30 files changed, 182 insertions, 471 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index 6cd3b0e..64edc87 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -32,7 +32,7 @@
/****************/
#include "H5ACmodule.h" /* This source code file is part of the H5AC module */
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_FRIEND /* Suppress error about including H5Fpkg */
/***********/
diff --git a/src/H5Apkg.h b/src/H5Apkg.h
index b392497..5858147 100644
--- a/src/H5Apkg.h
+++ b/src/H5Apkg.h
@@ -220,15 +220,15 @@ H5_DLL herr_t H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id,
const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order,
hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op,
void *op_data);
-H5_DLL herr_t H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
- const char *name);
-H5_DLL herr_t H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
- H5_index_t idx_type, H5_iter_order_t order, hsize_t n);
+H5_DLL herr_t H5A_dense_remove(H5F_t *f, hid_t dxpl_id,
+ const H5O_ainfo_t *ainfo, const char *name);
+H5_DLL herr_t H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id,
+ const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order,
+ hsize_t n);
H5_DLL htri_t H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
const char *name);
H5_DLL herr_t H5A_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo);
-
/* Attribute table operations */
H5_DLL herr_t H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
H5_index_t idx_type, H5_iter_order_t order, H5A_attr_table_t *atable);
@@ -267,7 +267,6 @@ H5_DLL herr_t H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *me
H5_DLL herr_t H5A_dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t * ainfo_src,
H5O_loc_t *dst_oloc, H5O_ainfo_t *ainfo_dst, hid_t dxpl_id, H5O_copy_t *cpy_info);
-
/* Testing functions */
#ifdef H5A_TESTING
H5_DLL htri_t H5A_is_shared_test(hid_t aid);
diff --git a/src/H5B2.c b/src/H5B2.c
index caf2395..5cbeadd 100644
--- a/src/H5B2.c
+++ b/src/H5B2.c
@@ -535,11 +535,10 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op,
/* Unlock current node before failing */
H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET);
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records")
- }
+ } /* end if */
if(cmp > 0)
idx++;
-
if(cmp != 0) {
/* Get node pointer for next node to search */
next_node_ptr=internal->node_ptrs[idx];
diff --git a/src/H5B2int.c b/src/H5B2int.c
index a184b4b..8bdde3e 100644
--- a/src/H5B2int.c
+++ b/src/H5B2int.c
@@ -148,14 +148,14 @@ H5B2__locate_record(const H5B2_class_t *type, unsigned nrec, size_t *rec_off,
hi = nrec;
while(lo < hi && *cmp) {
- my_idx = (lo + hi) / 2;
- if((type->compare)(udata, native + rec_off[my_idx], cmp) < 0)
+ my_idx = (lo + hi) / 2;
+ if((type->compare)(udata, native + rec_off[my_idx], cmp) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records")
- if(*cmp < 0)
- hi = my_idx;
- else
- lo = my_idx + 1;
- }
+ if(*cmp < 0)
+ hi = my_idx;
+ else
+ lo = my_idx + 1;
+ } /* end while */
*idx = my_idx;
diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h
index 5502e9f..a062214 100644
--- a/src/H5Cprivate.h
+++ b/src/H5Cprivate.h
@@ -41,8 +41,8 @@
/**************************/
/* Cache configuration settings */
-#define H5C__MAX_NUM_TYPE_IDS 28
-#define H5C__PREFIX_LEN 32
+#define H5C__MAX_NUM_TYPE_IDS 28
+#define H5C__PREFIX_LEN 32
/* This sanity checking constant was picked out of the air. Increase
* or decrease it if appropriate. Its purposes is to detect corrupt
diff --git a/src/H5Dio.c b/src/H5Dio.c
index ae42702..7b3f553 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -760,7 +760,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
else
full_overwrite = (hbool_t)((hsize_t)file_nelmts == nelmts ? TRUE : FALSE);
- /* Allocate storage */
+ /* Allocate storage */
if(H5D__alloc_storage(&io_info, H5D_ALLOC_WRITE, full_overwrite, NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage")
} /* end if */
diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c
index e61dae0..bbaa9c5 100644
--- a/src/H5Dlayout.c
+++ b/src/H5Dlayout.c
@@ -23,10 +23,10 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Dpkg.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5HLprivate.h" /* Local heaps */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dpkg.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5HLprivate.h" /* Local heaps */
/****************/
@@ -61,15 +61,15 @@
/*-------------------------------------------------------------------------
- * Function: H5D__layout_set_io_ops
+ * Function: H5D__layout_set_io_ops
*
- * Purpose: Set the I/O operation function pointers for a dataset,
+ * Purpose: Set the I/O operation function pointers for a dataset,
* according to the dataset's layout
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * Thursday, March 20, 2008
+ * Programmer: Quincey Koziol
+ * Thursday, March 20, 2008
*
*-------------------------------------------------------------------------
*/
@@ -192,15 +192,15 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5D__layout_oh_create
+ * Function: H5D__layout_oh_create
*
- * Purpose: Create layout/pline/efl information for dataset
+ * Purpose: Create layout/pline/efl information for dataset
*
- * Return: Success: SUCCEED
- * Failure: FAIL
+ * Return: Success: SUCCEED
+ * Failure: FAIL
*
- * Programmer: Quincey Koziol
- * Monday, July 27, 2009
+ * Programmer: Quincey Koziol
+ * Monday, July 27, 2009
*
*-------------------------------------------------------------------------
*/
@@ -209,7 +209,7 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset,
hid_t dapl_id)
{
H5O_layout_t *layout; /* Dataset's layout information */
- const H5O_fill_t *fill_prop; /* Pointer to dataset's fill value information */
+ const H5O_fill_t *fill_prop; /* Pointer to dataset's fill value information */
hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */
herr_t ret_value = SUCCEED; /* Return value */
@@ -394,6 +394,7 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t
/* Adjust chunk dimensions to omit datatype size (in last dimension) for creation property */
if(H5D_CHUNKED == dataset->shared->layout.type)
dataset->shared->layout.u.chunk.ndims--;
+
/* Copy layout to the DCPL */
if(H5P_set(plist, H5D_CRT_LAYOUT_NAME, &dataset->shared->layout) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout")
diff --git a/src/H5Doh.c b/src/H5Doh.c
index 8b70362..54f7a5e 100644
--- a/src/H5Doh.c
+++ b/src/H5Doh.c
@@ -465,11 +465,11 @@ H5O__dset_flush(H5G_loc_t *obj_loc, hid_t dxpl_id)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset")
if(H5D__flush_real(dset, dxpl_id) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info")
+ HDONE_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info")
done:
if(dset && H5D_close(dset) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset")
+ HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O__dset_flush() */
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index bc04300..2629008 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -544,8 +544,8 @@ H5_DLL herr_t H5D__check_filters(H5D_t *dataset);
H5_DLL herr_t H5D__set_extent(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id);
H5_DLL herr_t H5D__get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache);
H5_DLL herr_t H5D__flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id);
-H5_DLL herr_t H5D__mark(const H5D_t *dataset, hid_t dxpl_id, unsigned flags);
H5_DLL herr_t H5D__flush_real(H5D_t *dataset, hid_t dxpl_id);
+H5_DLL herr_t H5D__mark(const H5D_t *dataset, hid_t dxpl_id, unsigned flags);
#ifdef H5_DEBUG_BUILD
H5_DLL herr_t H5D_set_io_info_dxpls(H5D_io_info_t *io_info, hid_t dxpl_id);
#endif /* H5_DEBUG_BUILD */
diff --git a/src/H5EApkg.h b/src/H5EApkg.h
index 3af1b2c..2e13694 100644
--- a/src/H5EApkg.h
+++ b/src/H5EApkg.h
@@ -14,12 +14,12 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
- * Tuesday, June 17, 2008
+ * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Tuesday, June 17, 2008
*
- * Purpose: This file contains declarations which are visible only within
- * the H5EA package. Source files outside the H5EA package should
- * include H5EAprivate.h instead.
+ * Purpose: This file contains declarations which are visible only
+ * within the H5EA package. Source files outside the H5EA
+ * package should include H5EAprivate.h instead.
*/
#if !(defined(H5EA_FRIEND) | defined(H5EA_MODULE))
#error "Do not include this file outside the H5EA package!"
@@ -32,7 +32,7 @@
#include "H5EAprivate.h"
/* Other private headers needed by this file */
-#include "H5FLprivate.h" /* Free Lists */
+#include "H5FLprivate.h" /* Free Lists */
/**************************/
@@ -95,10 +95,10 @@
/* General metadata fields */ \
H5EA_METADATA_PREFIX_SIZE(TRUE) \
\
- /* Sanity-checking fields */ \
+ /* Sanity-checking fields */ \
+ (i)->hdr->sizeof_addr /* File address of array owning the block */ \
\
- /* Extensible Array Index Block specific fields */ \
+ /* Extensible Array Index Block specific fields */ \
+ ((size_t)(i)->hdr->cparam.idx_blk_elmts * (size_t)(i)->hdr->cparam.raw_elmt_size) /* Elements in index block */ \
+ ((i)->ndblk_addrs * (i)->hdr->sizeof_addr) /* Data block addresses in index block */ \
+ ((i)->nsblk_addrs * (i)->hdr->sizeof_addr) /* Super block addresses in index block */ \
@@ -109,31 +109,31 @@
/* General metadata fields */ \
H5EA_METADATA_PREFIX_SIZE(TRUE) \
\
- /* Sanity-checking fields */ \
+ /* Sanity-checking fields */ \
+ (s)->hdr->sizeof_addr /* File address of array owning the block */ \
+ (s)->hdr->arr_off_size /* Offset of the block in the array */ \
\
- /* Extensible Array Super Block specific fields */ \
+ /* Extensible Array Super Block specific fields */ \
+ ((s)->ndblks * (s)->dblk_page_init_size) /* Data block 'page init' bitmasks in super block (can be 0 if no pages) */ \
+ ((s)->ndblks * (s)->hdr->sizeof_addr) /* Data block addresses in super block */ \
)
/* Size of the extensible array data block prefix on disk */
-#define H5EA_DBLOCK_PREFIX_SIZE(d) ( \
+#define H5EA_DBLOCK_PREFIX_SIZE(d) ( \
/* General metadata fields */ \
H5EA_METADATA_PREFIX_SIZE(TRUE) \
\
- /* Sanity-checking fields */ \
+ /* Sanity-checking fields */ \
+ (d)->hdr->sizeof_addr /* File address of array owning the block */ \
+ (d)->hdr->arr_off_size /* Offset of the block in the array */ \
)
/* Size of the extensible array data block on disk */
-#define H5EA_DBLOCK_SIZE(d) ( \
+#define H5EA_DBLOCK_SIZE(d) ( \
/* Data block prefix size */ \
H5EA_DBLOCK_PREFIX_SIZE(d) \
\
- /* Extensible Array Data Block specific fields */ \
+ /* Extensible Array Data Block specific fields */ \
+ ((d)->nelmts * (size_t)(d)->hdr->cparam.raw_elmt_size) /* Elements in data block */ \
+ ((d)->npages * H5EA_SIZEOF_CHKSUM) /* Checksum for each page */ \
)
@@ -219,9 +219,9 @@ typedef struct H5EA_iblock_t {
haddr_t *sblk_addrs; /* Buffer for addresses of super blocks in index block */
/* Internal array information (not stored) */
- H5EA_hdr_t *hdr; /* Shared array header info */
- haddr_t addr; /* Address of this index block on disk */
- size_t size; /* Size of index block on disk */
+ H5EA_hdr_t *hdr; /* Shared array header info */
+ haddr_t addr; /* Address of this index block on disk */
+ size_t size; /* Size of index block on disk */
/* Computed/cached values (not stored) */
size_t nsblks; /* # of super blocks whose data block addresses are in index block */
@@ -240,10 +240,10 @@ typedef struct H5EA_sblock_t {
uint8_t *page_init; /* Bitmap of whether a data block page is initialized */
/* Internal array information (not stored) */
- H5EA_hdr_t *hdr; /* Shared array header info */
- H5EA_iblock_t *parent; /* Parent object for super block (index block) */
- haddr_t addr; /* Address of this index block on disk */
- size_t size; /* Size of index block on disk */
+ H5EA_hdr_t *hdr; /* Shared array header info */
+ H5EA_iblock_t *parent; /* Parent object for super block (index block) */
+ haddr_t addr; /* Address of this index block on disk */
+ size_t size; /* Size of index block on disk */
/* Computed/cached values (not stored) */
unsigned idx; /* Super block index within the extensible array */
@@ -264,10 +264,10 @@ typedef struct H5EA_dblock_t {
void *elmts; /* Buffer for elements stored in data block */
/* Internal array information (not stored) */
- H5EA_hdr_t *hdr; /* Shared array header info */
- void *parent; /* Parent object for data block (index or super block) */
- haddr_t addr; /* Address of this data block on disk */
- size_t size; /* Size of data block on disk */
+ H5EA_hdr_t *hdr; /* Shared array header info */
+ void *parent; /* Parent object for data block (index or super block) */
+ haddr_t addr; /* Address of this data block on disk */
+ size_t size; /* Size of data block on disk */
/* Computed/cached values (not stored) */
size_t nelmts; /* Number of elements in block */
@@ -283,10 +283,10 @@ typedef struct H5EA_dbk_page_t {
void *elmts; /* Buffer for elements stored in data block page */
/* Internal array information (not stored) */
- H5EA_hdr_t *hdr; /* Shared array header info */
- H5EA_sblock_t *parent; /* Parent object for data block page (super block) */
- haddr_t addr; /* Address of this data block page on disk */
- size_t size; /* Size of data block page on disk */
+ H5EA_hdr_t *hdr; /* Shared array header info */
+ H5EA_sblock_t *parent; /* Parent object for data block page (super block) */
+ haddr_t addr; /* Address of this data block page on disk */
+ size_t size; /* Size of data block page on disk */
/* Computed/cached values (not stored) */
/* <none> */
@@ -360,7 +360,7 @@ H5_DLLVAR const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1];
H5_DLLVAR const H5EA_class_t H5EA_CLS_TEST[1];
/* Array of extensible array client ID -> client class mappings */
-extern const H5EA_class_t *const H5EA_client_class_g[H5EA_NUM_CLS_ID];
+H5_DLLVAR const H5EA_class_t *const H5EA_client_class_g[H5EA_NUM_CLS_ID];
/******************************/
diff --git a/src/H5EAprivate.h b/src/H5EAprivate.h
index 6ce3062..33b4553 100644
--- a/src/H5EAprivate.h
+++ b/src/H5EAprivate.h
@@ -15,12 +15,12 @@
/*-------------------------------------------------------------------------
*
- * Created: H5EAprivate.h
- * Jun 17 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Created: H5EAprivate.h
+ * Jun 17 2008
+ * Quincey Koziol <koziol@hdfgroup.org>
*
- * Purpose: Private header for library accessible extensible
- * array routines.
+ * Purpose: Private header for library accessible extensible
+ * array routines.
*
*-------------------------------------------------------------------------
*/
@@ -34,8 +34,8 @@
#endif /* NOT_YET */
/* Private headers needed by this file */
-#include "H5ACprivate.h" /* Metadata cache */
-#include "H5Fprivate.h" /* File access */
+#include "H5ACprivate.h" /* Metadata cache */
+#include "H5Fprivate.h" /* File access */
/**************************/
@@ -51,7 +51,7 @@
typedef enum H5EA_cls_id_t {
/* Start real class IDs at 0 -QAK */
/* (keep these last) */
- H5EA_CLS_TEST_ID, /* Extensible array is for testing (do not use for actual data) */
+ H5EA_CLS_TEST_ID, /* Extensible array is for testing (do not use for actual data) */
H5EA_NUM_CLS_ID /* Number of Extensible Array class IDs (must be last) */
} H5EA_cls_id_t;
diff --git a/src/H5F.c b/src/H5F.c
index 95d87fc..bf57daf 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -58,7 +58,6 @@
/********************/
-
/*********************/
/* Package Variables */
/*********************/
diff --git a/src/H5FA.c b/src/H5FA.c
index 1be3f2e..3e502c0 100644
--- a/src/H5FA.c
+++ b/src/H5FA.c
@@ -79,7 +79,7 @@ hbool_t H5_PKG_INIT_VAR = FALSE;
* client class..
*/
const H5FA_class_t *const H5FA_client_class_g[] = {
- H5FA_CLS_TEST, /* ? - H5FA_CLS_TEST_ID */
+ H5FA_CLS_TEST, /* ? - H5FA_CLS_TEST_ID */
};
diff --git a/src/H5FAprivate.h b/src/H5FAprivate.h
index aa88003..dfc73f5 100644
--- a/src/H5FAprivate.h
+++ b/src/H5FAprivate.h
@@ -32,7 +32,7 @@
#endif /* NOT_YET */
/* Private headers needed by this file */
-#include "H5Fprivate.h" /* File access */
+#include "H5Fprivate.h" /* File access */
/**************************/
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 6b4613d..70d1a49 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -115,7 +115,7 @@ H5F_super_ext_create(H5F_t *f, hid_t dxpl_id, H5O_loc_t *ext_ptr)
* extension.
*/
H5O_loc_reset(ext_ptr);
- if(H5O_create(f, dxpl_id, 0, (size_t)1, H5P_GROUP_CREATE_DEFAULT, ext_ptr) < 0)
+ if(H5O_create(f, dxpl_id, (size_t)0, (size_t)1, H5P_GROUP_CREATE_DEFAULT, ext_ptr) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "unable to create superblock extension")
/* Record the address of the superblock extension */
diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c
index 1e9e4dd..f445303 100644
--- a/src/H5Fsuper_cache.c
+++ b/src/H5Fsuper_cache.c
@@ -195,7 +195,7 @@ H5F__cache_superblock_deserialize(const void *_image, size_t len, void *_udata,
H5F_super_t *sblock = NULL; /* File's superblock */
H5F_superblock_cache_ud_t *udata = (H5F_superblock_cache_ud_t *)_udata; /* User data */
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
- size_t variable_size; /* Sariable size of superblock */
+ size_t variable_size; /* Variable size of superblock */
unsigned super_vers; /* Superblock version */
uint8_t sizeof_addr; /* Size of offsets in the file (in bytes) */
uint8_t sizeof_size; /* Size of lengths in the file (in bytes) */
diff --git a/src/H5Gstab.c b/src/H5Gstab.c
index 3a7cd9e..ed3dd84 100644
--- a/src/H5Gstab.c
+++ b/src/H5Gstab.c
@@ -153,10 +153,10 @@ H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t
/* Create the B-tree */
if(H5B_create(f, dxpl_id, H5B_SNODE, NULL, &(stab->btree_addr)/*out*/) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create B-tree")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create B-tree")
/* Create symbol table private heap */
- if(FAIL == H5HL_create(f, dxpl_id, size_hint, &(stab->heap_addr)/*out*/))
+ if(H5HL_create(f, dxpl_id, size_hint, &(stab->heap_addr)/*out*/) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create heap")
/* Pin the heap down in memory */
diff --git a/src/H5HG.c b/src/H5HG.c
index de25bc6..f95b607 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -297,9 +297,9 @@ done:
static size_t
H5HG_alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr)
{
- size_t idx;
- uint8_t *p;
- size_t need = H5HG_SIZEOF_OBJHDR(f) + H5HG_ALIGN(size);
+ size_t idx;
+ uint8_t *p;
+ size_t need = H5HG_SIZEOF_OBJHDR(f) + H5HG_ALIGN(size);
size_t ret_value = 0; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -358,11 +358,11 @@ H5HG_alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr)
/* Fix the free space object */
if(need == heap->obj[0].size) {
- /*
- * All free space has been exhausted from this collection.
- */
- heap->obj[0].size = 0;
- heap->obj[0].begin = NULL;
+ /*
+ * All free space has been exhausted from this collection.
+ */
+ heap->obj[0].size = 0;
+ heap->obj[0].begin = NULL;
} /* end if */
else if(heap->obj[0].size-need >= H5HG_SIZEOF_OBJHDR (f)) {
/*
@@ -785,10 +785,10 @@ done:
herr_t
H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj)
{
- H5HG_heap_t *heap = NULL;
- uint8_t *p = NULL, *obj_start = NULL;
- size_t need;
- unsigned u;
+ H5HG_heap_t *heap = NULL;
+ uint8_t *p = NULL, *obj_start = NULL;
+ size_t need;
+ unsigned u;
unsigned flags = H5AC__NO_FLAGS_SET;/* Whether the heap gets deleted */
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h
index ffbf7c6..e566ece 100644
--- a/src/H5HGpkg.h
+++ b/src/H5HGpkg.h
@@ -116,9 +116,9 @@ H5FL_BLK_EXTERN(gheap_chunk);
/****************************/
typedef struct H5HG_obj_t {
- int nrefs; /*reference count */
- size_t size; /*total size of object */
- uint8_t *begin; /*ptr to object into heap->chunk*/
+ int nrefs; /* reference count */
+ size_t size; /* total size of object */
+ uint8_t *begin; /* ptr to object into heap->chunk */
} H5HG_obj_t;
/* Forward declarations for fields */
diff --git a/src/H5MF.c b/src/H5MF.c
index 00a1ed8..15e7a96 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -1032,7 +1032,7 @@ H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, haddr_t addr,
H5MF_sect_ud_t udata; /* User data for callback */
H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
- htri_t ret_value = FAIL; /* Return value */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
#ifdef H5MF_ALLOC_DEBUG
diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c
index c5f692d..ab26c17 100644
--- a/src/H5Oainfo.c
+++ b/src/H5Oainfo.c
@@ -346,9 +346,11 @@ H5O_ainfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, void *_
HDassert(ainfo);
/* If the object is using "dense" attribute storage, delete it */
- if(H5F_addr_defined(ainfo->fheap_addr))
+ if(H5F_addr_defined(ainfo->fheap_addr)) {
+ /* Delete the attribute */
if(H5A_dense_delete(f, dxpl_id, ainfo) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free dense attribute storage")
+ } /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -428,7 +430,7 @@ H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst,
*ainfo_dst = *ainfo_src;
if(H5F_addr_defined(ainfo_src->fheap_addr)) {
- /* copy dense attribute */
+ /* Prepare to copy dense attributes - actual copy in post_copy */
/* Set copied metadata tag */
H5_BEGIN_TAG(dxpl_id, H5AC__COPIED_TAG, NULL);
diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c
index 3d930f0..99f1322 100644
--- a/src/H5Oalloc.c
+++ b/src/H5Oalloc.c
@@ -921,7 +921,7 @@ H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, size_t *new
oh->chunk = x;
} /* end if */
- chunkno = oh->nchunks++;
+ chunkno = (unsigned)oh->nchunks++;
oh->chunk[chunkno].addr = new_chunk_addr;
oh->chunk[chunkno].size = size;
oh->chunk[chunkno].gap = 0;
@@ -966,6 +966,8 @@ H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, size_t *new
oh->nmesgs--;
} /* end if */
else {
+ HDassert(curr_msg->type->id != H5O_CONT_ID);
+
/* Copy the raw data */
HDmemcpy(p, curr_msg->raw - (size_t)H5O_SIZEOF_MSGHDR_OH(oh),
curr_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh));
@@ -1544,13 +1546,13 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh)
if(H5O_CONT_ID == curr_msg->type->id) {
htri_t status; /* Status from moving messages */
- if((status = H5O_move_cont(f, dxpl_id, oh, u)) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "Error in moving messages into cont message")
- else if(status > 0) { /* Message(s) got moved into "continuation" message */
+ if((status = H5O_move_cont(f, dxpl_id, oh, u)) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "Error in moving messages into cont message")
+ else if(status > 0) { /* Message(s) got moved into "continuation" message */
packed_msg = TRUE;
- break;
- } /* end else-if */
- } /* end if */
+ break;
+ } /* end else-if */
+ } /* end if */
/* Don't let locked messages be moved into earlier chunk */
if(!curr_msg->locked) {
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index f74966e..e085242 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -158,7 +158,6 @@ H5FL_SEQ_DEFINE(H5O_cont_t);
/* Local Variables */
/*******************/
-
/*-------------------------------------------------------------------------
* Function: H5O__cache_get_load_size()
diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c
index 8abe660..18561b3 100644
--- a/src/H5Ochunk.c
+++ b/src/H5Ochunk.c
@@ -95,7 +95,7 @@ H5FL_DEFINE(H5O_chunk_proxy_t);
herr_t
H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx)
{
- H5O_chunk_proxy_t *chk_proxy = NULL; /* Proxy for chunk, to mark it dirty in the cache */
+ H5O_chunk_proxy_t *chk_proxy = NULL; /* Proxy for chunk, to mark it dirty in the cache */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, FAIL)
@@ -121,6 +121,7 @@ H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx)
/* Insert the chunk proxy into the cache */
if(H5AC_insert_entry(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header chunk")
+
chk_proxy = NULL;
done:
@@ -372,6 +373,7 @@ H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx)
{
H5O_chunk_proxy_t *chk_proxy; /* Proxy for chunk, to mark it dirty in the cache */
H5O_chk_cache_ud_t chk_udata; /* User data for loading chunk */
+ unsigned cache_flags = H5AC__DELETED_FLAG; /* Flags for unprotecting proxy */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, FAIL)
@@ -397,8 +399,10 @@ H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx)
HDassert(chk_proxy->oh == oh);
HDassert(chk_proxy->chunkno == idx);
+ cache_flags |= H5AC__DIRTIED_FLAG | H5AC__FREE_FILE_SPACE_FLAG;
+
/* Release the chunk proxy from the cache, marking it deleted */
- if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, (H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG)) < 0)
+ if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, cache_flags) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk")
done:
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 4e8aafb..31ddb88 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -19,18 +19,18 @@
* Purpose: Messages related to data layout.
*/
-#define H5D_FRIEND /*suppress error about including H5Dpkg */
+#define H5D_FRIEND /*suppress error about including H5Dpkg */
#include "H5Omodule.h" /* This source code file is part of the H5O module */
-#include "H5private.h" /* Generic Functions */
-#include "H5Dpkg.h" /* Dataset functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5MFprivate.h" /* File space management */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
-#include "H5Pprivate.h" /* Property lists */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dpkg.h" /* Dataset functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5MFprivate.h" /* File space management */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Opkg.h" /* Object headers */
+#include "H5Pprivate.h" /* Property lists */
/* Local macros */
@@ -52,31 +52,31 @@ static herr_t H5O__layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
static void *H5O__layout_copy_file(H5F_t *file_src, void *mesg_src,
H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags,
H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id);
-static herr_t H5O__layout_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream,
- int indent, int fwidth);
+static herr_t H5O__layout_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg,
+ FILE * stream, int indent, int fwidth);
/* This message derives from H5O message class */
const H5O_msg_class_t H5O_MSG_LAYOUT[1] = {{
- H5O_LAYOUT_ID, /*message id number */
- "layout", /*message name for debugging */
- sizeof(H5O_layout_t), /*native message size */
- 0, /* messages are sharable? */
- H5O__layout_decode, /*decode message */
- H5O__layout_encode, /*encode message */
- H5O__layout_copy, /*copy the native value */
- H5O__layout_size, /*size of message on disk */
- H5O__layout_reset, /*reset method */
- H5O__layout_free, /*free the struct */
- H5O__layout_delete, /* file delete method */
- NULL, /* link method */
- NULL, /*set share method */
- NULL, /*can share method */
- NULL, /* pre copy native value to file */
- H5O__layout_copy_file, /* copy native value to file */
- NULL, /* post copy native value to file */
- NULL, /* get creation index */
- NULL, /* set creation index */
- H5O__layout_debug /*debug the message */
+ H5O_LAYOUT_ID, /* message id number */
+ "layout", /* message name for debugging */
+ sizeof(H5O_layout_t), /* native message size */
+ 0, /* messages are sharable? */
+ H5O__layout_decode, /* decode message */
+ H5O__layout_encode, /* encode message */
+ H5O__layout_copy, /* copy the native value */
+ H5O__layout_size, /* size of message on disk */
+ H5O__layout_reset, /* reset method */
+ H5O__layout_free, /* free the struct */
+ H5O__layout_delete, /* file delete method */
+ NULL, /* link method */
+ NULL, /* set share method */
+ NULL, /* can share method */
+ NULL, /* pre copy native value to file */
+ H5O__layout_copy_file, /* copy native value to file */
+ NULL, /* post copy native value to file */
+ NULL, /* get creation index */
+ NULL, /* set creation index */
+ H5O__layout_debug /* debug the message */
}};
@@ -740,14 +740,14 @@ H5O__layout_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const vo
/*-------------------------------------------------------------------------
- * Function: H5O__layout_reset
+ * Function: H5O__layout_reset
*
- * Purpose: Frees resources within a data type message, but doesn't free
- * the message itself.
+ * Purpose: Frees resources within a data type message, but doesn't free
+ * the message itself.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, September 13, 2002
*
*-------------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index d6a5909..9f748bf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -126,7 +126,7 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers
H5Cpublic.h H5Dpublic.h \
H5Epubgen.h H5Epublic.h H5Fpublic.h \
H5FDpublic.h H5FDcore.h H5FDdirect.h \
- H5FDfamily.h H5FDlog.h H5FDmpi.h H5FDmpio.h \
+ H5FDfamily.h H5FDlog.h H5FDmpi.h H5FDmpio.h \
H5FDmulti.h H5FDsec2.h H5FDstdio.h \
H5Gpublic.h H5Ipublic.h H5Lpublic.h \
H5MMpublic.h H5Opublic.h H5Ppublic.h \
diff --git a/test/dsets.c b/test/dsets.c
index a9cda93..2cb51d3 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -20,37 +20,34 @@
* Purpose: Tests the dataset interface (H5D)
*/
-#include <stdlib.h>
-#include <time.h>
-
-/*
- * This file needs to access private information from the H5Z package.
- */
-#define H5Z_FRIEND
+#define H5D_FRIEND /*suppress error about including H5Dpkg */
+#define H5D_TESTING
+#define H5Z_FRIEND /*suppress error about including H5Zpkg */
#include "h5test.h"
#include "H5srcdir.h"
+#include "H5Dpkg.h"
#include "H5Zpkg.h"
#ifdef H5_HAVE_SZLIB_H
# include "szlib.h"
#endif
const char *FILENAME[] = {
- "dataset",
- "compact_dataset",
- "dset_offset",
- "max_compact_dataset",
- "simple",
- "set_local",
- "random_chunks",
- "huge_chunks",
- "chunk_cache",
- "big_chunk",
- "chunk_expand",
- "copy_dcpl_newfile",
- "layout_extend",
- "zero_chunk",
+ "dataset", /* 0 */
+ "compact_dataset", /* 1 */
+ "dset_offset", /* 2 */
+ "max_compact_dataset", /* 3 */
+ "simple", /* 4 */
+ "set_local", /* 5 */
+ "random_chunks", /* 6 */
+ "huge_chunks", /* 7 */
+ "chunk_cache", /* 8 */
+ "big_chunk", /* 9 */
+ "chunk_expand", /* 10 */
+ "copy_dcpl_newfile",/* 11 */
+ "layout_extend", /* 12 */
+ "zero_chunk", /* 13 */
NULL
};
#define FILENAME_BUF_SIZE 1024
diff --git a/test/earray.c b/test/earray.c
index 46f2712..c3c7d3d 100644
--- a/test/earray.c
+++ b/test/earray.c
@@ -1529,296 +1529,6 @@ error:
return 1;
} /* test_delete_open() */
-
-/*-------------------------------------------------------------------------
- * Function: test_flush_depend_cb
- *
- * Purpose: Callback for flush dependency 'depend'/'undepend' and
- * 'support'/'unsupport' routines
- *
- * Return: Success: 0
- * Failure: 1
- *
- * Programmer: Quincey Koziol
- * Tuesday, May 26, 2009
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-test_flush_depend_cb(const void *_elmt, size_t nelmts, void *udata)
-{
- earray_flush_depend_ctx_t *ctx = (earray_flush_depend_ctx_t *)udata;
- const uint64_t *elmt = (const uint64_t *)_elmt; /* Convenience pointer to native elements */
-
- /* Check for out of order flush */
- if(ctx->base_obj)
- return(FAIL);
-
- /* Look for magic values */
- while(nelmts > 0) {
- /* Check for elements of interest */
- if((uint64_t)0 == *elmt) {
- /* Check for out-of-order flush */
- if(!ctx->idx0_obj)
- return(FAIL);
-
- /* Indicate that the element was flushed */
- ctx->idx0_elem = TRUE;
- } /* end if */
- else if((uint64_t)1 == *elmt) {
- /* Check for out-of-order flush */
- if(!ctx->idx1_obj)
- return(FAIL);
-
- /* Indicate that the element was flushed */
- ctx->idx1_elem = TRUE;
- } /* end if */
- else if((uint64_t)10000 == *elmt) {
- /* Check for out-of-order flush */
- if(!ctx->idx10000_obj)
- return(FAIL);
-
- /* Indicate that the element was flushed */
- ctx->idx10000_elem = TRUE;
- } /* end if */
-
- /* Decrement elements left to inspect */
- nelmts--;
- elmt++;
- } /* end while */
-
- return(SUCCEED);
-} /* end test_flush_depend_cb() */
-
-
-/*-------------------------------------------------------------------------
- * Function: test_flush_depend
- *
- * Purpose: Exercise flush dependency 'depend'/'undepend' routines
- *
- * Return: Success: 0
- * Failure: 1
- *
- * Programmer: Quincey Koziol
- * Thursday, May 21, 2009
- *
- *-------------------------------------------------------------------------
- */
-static unsigned
-test_flush_depend(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSED *tparam)
-{
- hid_t file = -1; /* File ID */
- H5F_t *f = NULL; /* Internal file object pointer */
- H5EA_t *ea = NULL; /* Extensible array wrapper */
- haddr_t ea_addr = HADDR_UNDEF; /* Array address in file */
- H5EA__ctx_cb_t cb; /* Extensible array context action info */
- earray_flush_depend_ctx_t fd_info; /* Context information for flush depend test */
- haddr_t base_addr; /* Base test entry address */
- earray_test_t *base_entry; /* Pointer to base test entry */
- haddr_t addr1; /* Test entry #1 address */
- earray_test_t *entry1; /* Pointer to test entry #1 */
- haddr_t addr2; /* Test entry #2 address */
- earray_test_t *entry2; /* Pointer to test entry #2 */
- haddr_t addr3; /* Test entry #3 address */
- earray_test_t *entry3; /* Pointer to test entry #3 */
- uint64_t welmt; /* Element to write */
- hsize_t idx; /* Index value of element */
-
- /* Create file & retrieve pointer to internal file object */
- if(create_file(H5F_ACC_TRUNC, fapl, &file, &f) < 0)
- TEST_ERROR
-
- /*
- * Display testing message
- */
- TESTING("flush dependencies on array metadata");
-
- /* Create array */
- cb.encode = test_flush_depend_cb;
- HDmemset(&fd_info, 0, sizeof(earray_flush_depend_ctx_t));
- cb.udata = &fd_info;
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, &cb) < 0)
- TEST_ERROR
-
- /* Verify the creation parameters */
- if(verify_cparam(ea, cparam) < 0)
- TEST_ERROR
-
- /* Create base entry to insert */
- if(NULL == (base_entry = (earray_test_t *)HDmalloc(sizeof(earray_test_t))))
- TEST_ERROR
- HDmemset(base_entry, 0, sizeof(earray_test_t));
- base_entry->idx = (uint64_t)-1;
- base_entry->fd_info = &fd_info;
-
- /* Insert test entry into cache */
- base_addr = HADDR_MAX;
- if(H5AC_insert_entry(f, H5AC_ind_read_dxpl_id, H5AC_EARRAY_TEST, base_addr, base_entry, H5AC__PIN_ENTRY_FLAG) < 0)
- TEST_ERROR
-
- /* Set the base entry as a flush dependency for the array */
- if(H5EA_depend((H5AC_info_t *)base_entry, ea) < 0)
- TEST_ERROR
-
- /* Create entry #1 to insert */
- if(NULL == (entry1 = (earray_test_t *)HDmalloc(sizeof(earray_test_t))))
- TEST_ERROR
- HDmemset(entry1, 0, sizeof(earray_test_t));
- entry1->fd_info = &fd_info;
-
- /* Insert test entry into cache */
- addr1 = HADDR_MAX - 1;
- if(H5AC_insert_entry(f, H5AC_ind_read_dxpl_id, H5AC_EARRAY_TEST, addr1, entry1, H5AC__PIN_ENTRY_FLAG) < 0)
- TEST_ERROR
-
- /* Set the test entry as a flush dependency for 0th index in the array */
- if(H5EA_support(ea, H5AC_ind_read_dxpl_id, (hsize_t)0, (H5AC_info_t *)entry1) < 0)
- TEST_ERROR
-
- /* Set element of array */
- welmt = (uint64_t)0;
- idx = 0;
- if(H5EA_set(ea, H5AC_ind_read_dxpl_id, idx, &welmt) < 0)
- FAIL_STACK_ERROR
-
- /* Create entry #2 to insert */
- if(NULL == (entry2 = (earray_test_t *)HDmalloc(sizeof(earray_test_t))))
- TEST_ERROR
- HDmemset(entry2, 0, sizeof(earray_test_t));
- entry2->idx = (uint64_t)1;
- entry2->fd_info = &fd_info;
-
- /* Insert test entry into cache */
- addr2 = HADDR_MAX - 2;
- if(H5AC_insert_entry(f, H5AC_ind_read_dxpl_id, H5AC_EARRAY_TEST, addr2, entry2, H5AC__PIN_ENTRY_FLAG) < 0)
- TEST_ERROR
-
- /* Set the test entry as a flush dependency for 1st index in the array */
- if(H5EA_support(ea, H5AC_ind_read_dxpl_id, (hsize_t)1, (H5AC_info_t *)entry2) < 0)
- TEST_ERROR
-
- /* Set element of array */
- welmt = (uint64_t)1;
- idx = 1;
- if(H5EA_set(ea, H5AC_ind_read_dxpl_id, idx, &welmt) < 0)
- FAIL_STACK_ERROR
-
- /* Create entry #3 to insert */
- if(NULL == (entry3 = (earray_test_t *)HDmalloc(sizeof(earray_test_t))))
- TEST_ERROR
- HDmemset(entry3, 0, sizeof(earray_test_t));
- entry3->idx = (uint64_t)10000;
- entry3->fd_info = &fd_info;
-
- /* Insert test entry into cache */
- addr3 = HADDR_MAX - 3;
- if(H5AC_insert_entry(f, H5AC_ind_read_dxpl_id, H5AC_EARRAY_TEST, addr3, entry3, H5AC__PIN_ENTRY_FLAG) < 0)
- TEST_ERROR
-
- /* Set the test entry as a flush dependency for 10,000th index in the array */
- if(H5EA_support(ea, H5AC_ind_read_dxpl_id, (hsize_t)10000, (H5AC_info_t *)entry3) < 0)
- TEST_ERROR
-
- /* Set element of array */
- welmt = (uint64_t)10000;
- idx = 10000;
- if(H5EA_set(ea, H5AC_ind_read_dxpl_id, idx, &welmt) < 0)
- FAIL_STACK_ERROR
-
-
- /* Flush the cache */
- if(H5Fflush(file, H5F_SCOPE_GLOBAL) < 0)
- TEST_ERROR
-
- /* Check that all callback flags have been set */
- if(!fd_info.base_obj)
- TEST_ERROR
- if(!fd_info.idx0_obj)
- TEST_ERROR
- if(!fd_info.idx0_elem)
- TEST_ERROR
- if(!fd_info.idx1_obj)
- TEST_ERROR
- if(!fd_info.idx1_elem)
- TEST_ERROR
- if(!fd_info.idx10000_obj)
- TEST_ERROR
- if(!fd_info.idx10000_elem)
- TEST_ERROR
-
-
- /* Remove the base entry as a flush dependency for the array */
- if(H5EA_undepend((H5AC_info_t *)base_entry, ea) < 0)
- TEST_ERROR
-
- /* Protect the base entry */
- if(NULL == (base_entry = (earray_test_t *)H5AC_protect(f, H5AC_ind_read_dxpl_id, H5AC_EARRAY_TEST, base_addr, NULL, H5AC__NO_FLAGS_SET)))
- TEST_ERROR
-
- /* Unprotect & unpin the base entry */
- if(H5AC_unprotect(f, H5AC_ind_read_dxpl_id, H5AC_EARRAY_TEST, base_addr, base_entry, (H5AC__UNPIN_ENTRY_FLAG | H5AC__DELETED_FLAG)) < 0)
- TEST_ERROR
-
- /* Remove the test entry as a flush dependency for 0th index in the array */
- if(H5EA_unsupport(ea, H5AC_ind_read_dxpl_id, (hsize_t)0, (H5AC_info_t *)entry1) < 0)
- TEST_ERROR
-
- /* Protect the test entry */
- if(NULL == (entry1 = (earray_test_t *)H5AC_protect(f, H5AC_ind_read_dxpl_id, H5AC_EARRAY_TEST, addr1, NULL, H5AC__NO_FLAGS_SET)))
- TEST_ERROR
-
- /* Unprotect & unpin the test entry */
- if(H5AC_unprotect(f, H5AC_ind_read_dxpl_id, H5AC_EARRAY_TEST, addr1, entry1, (H5AC__UNPIN_ENTRY_FLAG | H5AC__DELETED_FLAG)) < 0)
- TEST_ERROR
-
- /* Remove the test entry as a flush dependency for 1st index in the array */
- if(H5EA_unsupport(ea, H5AC_ind_read_dxpl_id, (hsize_t)1, (H5AC_info_t *)entry2) < 0)
- TEST_ERROR
-
- /* Protect the test entry */
- if(NULL == (entry2 = (earray_test_t *)H5AC_protect(f, H5AC_ind_read_dxpl_id, H5AC_EARRAY_TEST, addr2, NULL, H5AC__NO_FLAGS_SET)))
- TEST_ERROR
-
- /* Unprotect & unpin the test entry */
- if(H5AC_unprotect(f, H5AC_ind_read_dxpl_id, H5AC_EARRAY_TEST, addr2, entry2, (H5AC__UNPIN_ENTRY_FLAG | H5AC__DELETED_FLAG)) < 0)
- TEST_ERROR
-
- /* Remove the test entry as a flush dependency for 10,000th index in the array */
- if(H5EA_unsupport(ea, H5AC_ind_read_dxpl_id, (hsize_t)10000, (H5AC_info_t *)entry3) < 0)
- TEST_ERROR
-
- /* Protect the test entry */
- if(NULL == (entry3 = (earray_test_t *)H5AC_protect(f, H5AC_ind_read_dxpl_id, H5AC_EARRAY_TEST, addr3, NULL, H5AC__NO_FLAGS_SET)))
- TEST_ERROR
-
- /* Unprotect & unpin the test entry */
- if(H5AC_unprotect(f, H5AC_ind_read_dxpl_id, H5AC_EARRAY_TEST, addr3, entry3, (H5AC__UNPIN_ENTRY_FLAG | H5AC__DELETED_FLAG)) < 0)
- TEST_ERROR
-
- /* Close the extensible array */
- if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0)
- FAIL_STACK_ERROR
- ea = NULL;
-
- /* Close the file */
- if(H5Fclose(file) < 0)
- FAIL_STACK_ERROR
-
- /* All tests passed */
- PASSED()
-
- return 0;
-
-error:
- H5E_BEGIN_TRY {
- if(ea)
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
- H5Fclose(file);
- } H5E_END_TRY;
-
- return 1;
-} /* test_flush_depend() */
-
/* Extensible array iterator info for forward iteration */
typedef struct eiter_fw_t {
hsize_t idx; /* Index of next array location */
@@ -3066,7 +2776,6 @@ main(void)
nerrors += test_open_twice(fapl, &cparam, &tparam);
nerrors += test_open_twice_diff(fapl, &cparam, &tparam);
nerrors += test_delete_open(fapl, &cparam, &tparam);
- nerrors += test_flush_depend(fapl, &cparam, &tparam);
/* Iterate over the type of capacity tests */
for(curr_iter = EARRAY_ITER_FW; curr_iter < EARRAY_ITER_NITERS; H5_INC_ENUM(earray_iter_type_t, curr_iter)) {
@@ -3160,7 +2869,7 @@ main(void)
if(nerrors)
goto error;
- puts("All extensible array tests passed.");
+ HDputs("All extensible array tests passed.");
/* Clean up file used */
h5_cleanup(FILENAME, fapl);
@@ -3168,10 +2877,10 @@ main(void)
return 0;
error:
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
H5E_BEGIN_TRY {
- H5Pclose(fapl);
+ H5Pclose(fapl);
} H5E_END_TRY;
return 1;
diff --git a/test/gen_plist.c b/test/gen_plist.c
index f071733..b45eeeb 100644
--- a/test/gen_plist.c
+++ b/test/gen_plist.c
@@ -34,7 +34,7 @@ main(void)
hid_t dapl1; /* dataset access prop. list */
hid_t dxpl1; /* dataset xfer prop. list */
hid_t gcpl1; /* group create prop. list */
- hid_t ocpypl1; /* object copy prop. list */
+ hid_t ocpypl1; /* object copy prop. list */
hid_t ocpl1; /* object create prop. list */
hid_t lcpl1; /* link create prop. list */
hid_t lapl1; /* link access prop. list */
diff --git a/test/h5test.c b/test/h5test.c
index c010adc..8285043 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -1557,8 +1557,6 @@ getenv_all(MPI_Comm comm, int root, const char* name)
* Programmer: Larry Knox
* Monday, October 13, 2009
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -1570,20 +1568,22 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name)
const char *filename = H5_get_srcdir_filename(origfilename);; /* Get the test file name to copy */
/* Copy old file into temporary file */
- if((fd_old = HDopen(filename, O_RDONLY, 0666)) < 0) return -1;
- if((fd_new = HDopen(local_copy_name, O_RDWR|O_CREAT|O_TRUNC, 0666))
- < 0) return -1;
+ if((fd_old = HDopen(filename, O_RDONLY, 0666)) < 0)
+ return -1;
+ if((fd_new = HDopen(local_copy_name, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0)
+ return -1;
/* Copy data */
while((nread = HDread(fd_old, buf, (size_t)READ_BUF_SIZE)) > 0)
- HDwrite(fd_new, buf, (size_t)nread);
+ if(HDwrite(fd_new, buf, (size_t)nread) < 0)
+ return -1;
/* Close files */
if(HDclose(fd_old) < 0) return -1;
if(HDclose(fd_new) < 0) return -1;
return 0;
-}
+} /* end h5_make_local_copy() */
/*-------------------------------------------------------------------------