summaryrefslogtreecommitdiffstats
path: root/src/H5Dsingle.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2021-03-25 00:39:37 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2021-03-25 00:39:37 (GMT)
commitfeb20aac304b39e18c70f88cae2f7cf7d5c82db2 (patch)
treee15d7e751af4e3c42e77ea955d91db4cf27a71cf /src/H5Dsingle.c
parentbdac2ecdbff2c389a222b3d93ff1eb1d23ec6b23 (diff)
downloadhdf5-feb20aac304b39e18c70f88cae2f7cf7d5c82db2.zip
hdf5-feb20aac304b39e18c70f88cae2f7cf7d5c82db2.tar.gz
hdf5-feb20aac304b39e18c70f88cae2f7cf7d5c82db2.tar.bz2
Formats the source and updates the gcc warning pragmas
Diffstat (limited to 'src/H5Dsingle.c')
-rw-r--r--src/H5Dsingle.c196
1 files changed, 85 insertions, 111 deletions
diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c
index 3fa9bc2..7a8c3f6 100644
--- a/src/H5Dsingle.c
+++ b/src/H5Dsingle.c
@@ -26,55 +26,47 @@
/* Module Setup */
/****************/
-#include "H5Dmodule.h" /* This source code file is part of the H5D module */
-
+#include "H5Dmodule.h" /* This source code file is part of the H5D module */
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Dpkg.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5MFprivate.h" /* File space management */
-#include "H5VMprivate.h" /* Vector functions */
-
+#include "H5private.h" /* Generic Functions */
+#include "H5Dpkg.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5MFprivate.h" /* File space management */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
/* Local Macros */
/****************/
-
/******************/
/* Local Typedefs */
/******************/
-
/********************/
/* Local Prototypes */
/********************/
/* Single Chunk Index chunking I/O ops */
-static herr_t H5D__single_idx_init(const H5D_chk_idx_info_t *idx_info,
- const H5S_t *space, haddr_t dset_ohdr_addr);
-static herr_t H5D__single_idx_create(const H5D_chk_idx_info_t *idx_info);
+static herr_t H5D__single_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space,
+ haddr_t dset_ohdr_addr);
+static herr_t H5D__single_idx_create(const H5D_chk_idx_info_t *idx_info);
static hbool_t H5D__single_idx_is_space_alloc(const H5O_storage_chunk_t *storage);
-static herr_t H5D__single_idx_insert(const H5D_chk_idx_info_t *idx_info,
- H5D_chunk_ud_t *udata, const H5D_t *dset);
-static herr_t H5D__single_idx_get_addr(const H5D_chk_idx_info_t *idx_info,
- H5D_chunk_ud_t *udata);
-static int H5D__single_idx_iterate(const H5D_chk_idx_info_t *idx_info,
- H5D_chunk_cb_func_t chunk_cb, void *chunk_udata);
-static herr_t H5D__single_idx_remove(const H5D_chk_idx_info_t *idx_info,
- H5D_chunk_common_ud_t *udata);
-static herr_t H5D__single_idx_delete(const H5D_chk_idx_info_t *idx_info);
-static herr_t H5D__single_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
- const H5D_chk_idx_info_t *idx_info_dst);
-static herr_t H5D__single_idx_size(const H5D_chk_idx_info_t *idx_info,
- hsize_t *size);
-static herr_t H5D__single_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr);
-static herr_t H5D__single_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream);
-
+static herr_t H5D__single_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata,
+ const H5D_t *dset);
+static herr_t H5D__single_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata);
+static int H5D__single_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb,
+ void *chunk_udata);
+static herr_t H5D__single_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata);
+static herr_t H5D__single_idx_delete(const H5D_chk_idx_info_t *idx_info);
+static herr_t H5D__single_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
+ const H5D_chk_idx_info_t *idx_info_dst);
+static herr_t H5D__single_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size);
+static herr_t H5D__single_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr);
+static herr_t H5D__single_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream);
/*********************/
/* Package Variables */
@@ -82,37 +74,33 @@ static herr_t H5D__single_idx_dump(const H5O_storage_chunk_t *storage, FILE *str
/* Non Index chunk I/O ops */
const H5D_chunk_ops_t H5D_COPS_SINGLE[1] = {{
- FALSE, /* Single Chunk indexing doesn't current support SWMR access */
- H5D__single_idx_init, /* init */
- H5D__single_idx_create, /* create */
- H5D__single_idx_is_space_alloc, /* is_space_alloc */
- H5D__single_idx_insert, /* insert */
- H5D__single_idx_get_addr, /* get_addr */
- NULL, /* resize */
- H5D__single_idx_iterate, /* iterate */
- H5D__single_idx_remove, /* remove */
- H5D__single_idx_delete, /* delete */
- H5D__single_idx_copy_setup, /* copy_setup */
- NULL, /* copy_shutdown */
- H5D__single_idx_size, /* size */
- H5D__single_idx_reset, /* reset */
- H5D__single_idx_dump, /* dump */
- NULL, /* destroy */
- NULL /* close */
+ FALSE, /* Single Chunk indexing doesn't current support SWMR access */
+ H5D__single_idx_init, /* init */
+ H5D__single_idx_create, /* create */
+ H5D__single_idx_is_space_alloc, /* is_space_alloc */
+ H5D__single_idx_insert, /* insert */
+ H5D__single_idx_get_addr, /* get_addr */
+ NULL, /* resize */
+ H5D__single_idx_iterate, /* iterate */
+ H5D__single_idx_remove, /* remove */
+ H5D__single_idx_delete, /* delete */
+ H5D__single_idx_copy_setup, /* copy_setup */
+ NULL, /* copy_shutdown */
+ H5D__single_idx_size, /* size */
+ H5D__single_idx_reset, /* reset */
+ H5D__single_idx_dump, /* dump */
+ NULL, /* destroy */
+ NULL /* close */
}};
-
/*****************************/
/* Library Private Variables */
/*****************************/
-
/*******************/
/* Local Variables */
/*******************/
-
-
/*-------------------------------------------------------------------------
* Function: H5D__single_idx_init
*
@@ -126,8 +114,8 @@ const H5D_chunk_ops_t H5D_COPS_SINGLE[1] = {{
*-------------------------------------------------------------------------
*/
static herr_t
-H5D__single_idx_init(const H5D_chk_idx_info_t *idx_info,
- const H5S_t H5_ATTR_UNUSED *space, haddr_t H5_ATTR_UNUSED dset_ohdr_addr)
+H5D__single_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t H5_ATTR_UNUSED *space,
+ haddr_t H5_ATTR_UNUSED dset_ohdr_addr)
{
FUNC_ENTER_STATIC_NOERR
@@ -138,15 +126,14 @@ H5D__single_idx_init(const H5D_chk_idx_info_t *idx_info,
HDassert(idx_info->layout);
HDassert(idx_info->storage);
- if(idx_info->pline->nused)
- idx_info->layout->flags |= H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER;
+ if (idx_info->pline->nused)
+ idx_info->layout->flags |= H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER;
else
- idx_info->layout->flags = 0;
+ idx_info->layout->flags = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__single_idx_init() */
-
/*-------------------------------------------------------------------------
* Function: H5D__single_idx_create
*
@@ -174,15 +161,14 @@ H5D__single_idx_create(const H5D_chk_idx_info_t *idx_info)
HDassert(idx_info->layout->nchunks == 1);
HDassert(!H5F_addr_defined(idx_info->storage->idx_addr));
- if(idx_info->pline->nused)
- HDassert(idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER);
+ if (idx_info->pline->nused)
+ HDassert(idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER);
else
- HDassert(!(idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER));
+ HDassert(!(idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER));
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__single_idx_create() */
-
/*-------------------------------------------------------------------------
* Function: H5D__single_idx_is_space_alloc
*
@@ -205,7 +191,6 @@ H5D__single_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
FUNC_LEAVE_NOAPI((hbool_t)H5F_addr_defined(storage->idx_addr))
} /* end H5D__single_idx_is_space_alloc() */
-
/*-------------------------------------------------------------------------
* Function: H5D__single_idx_insert
*
@@ -218,10 +203,9 @@ H5D__single_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D__single_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata,
- const H5D_t *dset)
+H5D__single_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, const H5D_t *dset)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -239,22 +223,21 @@ H5D__single_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata
HDassert(H5F_addr_defined(udata->chunk_block.offset));
idx_info->storage->idx_addr = udata->chunk_block.offset;
- if(idx_info->pline->nused > 0) {
+ if (idx_info->pline->nused > 0) {
H5_CHECKED_ASSIGN(idx_info->storage->u.single.nbytes, uint32_t, udata->chunk_block.length, hsize_t);
- idx_info->storage->u.single.filter_mask = udata->filter_mask;
+ idx_info->storage->u.single.filter_mask = udata->filter_mask;
} /* end if */
- if(dset)
- if(dset->shared->dcpl_cache.fill.alloc_time != H5D_ALLOC_TIME_EARLY || idx_info->pline->nused > 0)
+ if (dset)
+ if (dset->shared->dcpl_cache.fill.alloc_time != H5D_ALLOC_TIME_EARLY || idx_info->pline->nused > 0)
/* Mark the layout dirty so that the address of the single chunk will be flushed later */
- if(H5D__mark(dset, H5D_MARK_LAYOUT) < 0)
+ if (H5D__mark(dset, H5D_MARK_LAYOUT) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark layout as dirty")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__single_idx_insert() */
-
/*-------------------------------------------------------------------------
* Function: H5D__single_idx_get_addr
*
@@ -283,21 +266,20 @@ H5D__single_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda
HDassert(udata);
udata->chunk_block.offset = idx_info->storage->idx_addr;
- if(idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER) {
- udata->chunk_block.length = idx_info->storage->u.single.nbytes;
- udata->filter_mask = idx_info->storage->u.single.filter_mask;
+ if (idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER) {
+ udata->chunk_block.length = idx_info->storage->u.single.nbytes;
+ udata->filter_mask = idx_info->storage->u.single.filter_mask;
} /* end if */
else {
- udata->chunk_block.length = idx_info->layout->size;
- udata->filter_mask = 0;
+ udata->chunk_block.length = idx_info->layout->size;
+ udata->filter_mask = 0;
} /* end else */
- if(!H5F_addr_defined(udata->chunk_block.offset))
+ if (!H5F_addr_defined(udata->chunk_block.offset))
udata->chunk_block.length = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5D__single_idx_get_addr() */
-
/*-------------------------------------------------------------------------
* Function: H5D__single_idx_iterate
*
@@ -310,11 +292,10 @@ H5D__single_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda
*-------------------------------------------------------------------------
*/
static int
-H5D__single_idx_iterate(const H5D_chk_idx_info_t *idx_info,
- H5D_chunk_cb_func_t chunk_cb, void *chunk_udata)
+H5D__single_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, void *chunk_udata)
{
- H5D_chunk_rec_t chunk_rec; /* generic chunk record */
- int ret_value = -1; /* Return value */
+ H5D_chunk_rec_t chunk_rec; /* generic chunk record */
+ int ret_value = -1; /* Return value */
FUNC_ENTER_STATIC_NOERR
@@ -332,23 +313,22 @@ H5D__single_idx_iterate(const H5D_chk_idx_info_t *idx_info,
HDmemset(&chunk_rec, 0, sizeof(chunk_rec));
chunk_rec.chunk_addr = idx_info->storage->idx_addr;
- if(idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER) {
- chunk_rec.nbytes = idx_info->storage->u.single.nbytes;
- chunk_rec.filter_mask = idx_info->storage->u.single.filter_mask;
+ if (idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER) {
+ chunk_rec.nbytes = idx_info->storage->u.single.nbytes;
+ chunk_rec.filter_mask = idx_info->storage->u.single.filter_mask;
} /* end if */
else {
- chunk_rec.nbytes = idx_info->layout->size;
- chunk_rec.filter_mask = 0;
+ chunk_rec.nbytes = idx_info->layout->size;
+ chunk_rec.filter_mask = 0;
} /* end else */
/* Make "generic chunk" callback */
- if((ret_value = (*chunk_cb)(&chunk_rec, chunk_udata)) < 0)
- HERROR(H5E_DATASET, H5E_CALLBACK, "failure in generic chunk iterator callback");
+ if ((ret_value = (*chunk_cb)(&chunk_rec, chunk_udata)) < 0)
+ HERROR(H5E_DATASET, H5E_CALLBACK, "failure in generic chunk iterator callback");
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__single_idx_iterate() */
-
/*-------------------------------------------------------------------------
* Function: H5D__single_idx_remove
*
@@ -363,8 +343,8 @@ H5D__single_idx_iterate(const H5D_chk_idx_info_t *idx_info,
static herr_t
H5D__single_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t H5_ATTR_UNUSED *udata)
{
- hsize_t nbytes; /* Size of all chunks */
- herr_t ret_value = SUCCEED; /* Return value */
+ hsize_t nbytes; /* Size of all chunks */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -376,12 +356,12 @@ H5D__single_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t
HDassert(idx_info->storage);
HDassert(H5F_addr_defined(idx_info->storage->idx_addr));
- if(idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER)
- nbytes = idx_info->storage->u.single.nbytes;
+ if (idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER)
+ nbytes = idx_info->storage->u.single.nbytes;
else
- nbytes = idx_info->layout->size;
+ nbytes = idx_info->layout->size;
- if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->storage->idx_addr, nbytes) < 0)
+ if (H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->storage->idx_addr, nbytes) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, H5_ITER_ERROR, "unable to free dataset chunks")
idx_info->storage->idx_addr = HADDR_UNDEF;
@@ -390,7 +370,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__single_idx_remove() */
-
/*-------------------------------------------------------------------------
* Function: H5D__single_idx_delete
*
@@ -406,7 +385,7 @@ done:
static herr_t
H5D__single_idx_delete(const H5D_chk_idx_info_t *idx_info)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC_NOERR
@@ -417,15 +396,14 @@ H5D__single_idx_delete(const H5D_chk_idx_info_t *idx_info)
HDassert(idx_info->layout);
HDassert(idx_info->storage);
- if(H5F_addr_defined(idx_info->storage->idx_addr))
- ret_value = H5D__single_idx_remove(idx_info, NULL);
+ if (H5F_addr_defined(idx_info->storage->idx_addr))
+ ret_value = H5D__single_idx_remove(idx_info, NULL);
else
- HDassert(!H5F_addr_defined(idx_info->storage->idx_addr));
+ HDassert(!H5F_addr_defined(idx_info->storage->idx_addr));
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__single_idx_delete() */
-
/*-------------------------------------------------------------------------
* Function: H5D__single_idx_copy_setup
*
@@ -439,9 +417,9 @@ H5D__single_idx_delete(const H5D_chk_idx_info_t *idx_info)
*/
static herr_t
H5D__single_idx_copy_setup(const H5D_chk_idx_info_t H5_ATTR_NDEBUG_UNUSED *idx_info_src,
- const H5D_chk_idx_info_t *idx_info_dst)
+ const H5D_chk_idx_info_t * idx_info_dst)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -463,7 +441,7 @@ H5D__single_idx_copy_setup(const H5D_chk_idx_info_t H5_ATTR_NDEBUG_UNUSED *idx_i
H5_BEGIN_TAG(H5AC__COPIED_TAG);
/* Set up information at the destination file */
- if(H5D__single_idx_create(idx_info_dst) < 0)
+ if (H5D__single_idx_create(idx_info_dst) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunked storage")
/* Reset metadata tag */
@@ -473,7 +451,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__single_idx_copy_setup() */
-
/*-------------------------------------------------------------------------
* Function: H5D__single_idx_size
*
@@ -499,7 +476,6 @@ H5D__single_idx_size(const H5D_chk_idx_info_t H5_ATTR_UNUSED *idx_info, hsize_t
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__single_idx_size() */
-
/*-------------------------------------------------------------------------
* Function: H5D__single_idx_reset
*
@@ -520,13 +496,12 @@ H5D__single_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr)
HDassert(storage);
/* Reset index info */
- if(reset_addr)
- storage->idx_addr = HADDR_UNDEF;
+ if (reset_addr)
+ storage->idx_addr = HADDR_UNDEF;
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__single_idx_reset() */
-
/*-------------------------------------------------------------------------
* Function: H5D__single_idx_dump
*
@@ -551,4 +526,3 @@ H5D__single_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__single_idx_dump() */
-