summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-08-10 18:02:57 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-08-10 18:02:57 (GMT)
commit908ce6d7214948e71dbeb01f129789c4c669861a (patch)
treeea4a31ea59fd8102c9abb66fb9cf72a1a1be8a43 /src
parentdb134c8627d6a1c295ca01dfa9ee87b7a9475b6e (diff)
downloadhdf5-908ce6d7214948e71dbeb01f129789c4c669861a.zip
hdf5-908ce6d7214948e71dbeb01f129789c4c669861a.tar.gz
hdf5-908ce6d7214948e71dbeb01f129789c4c669861a.tar.bz2
[svn-r17314] Description:
Bring r17313 from trunk to 1.8 branch: Bring back various minor code cleanups from the file free space branch Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.8 (amazon) in debug mode Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src')
-rw-r--r--src/H5Apkg.h2
-rw-r--r--src/H5Bcache.c73
-rw-r--r--src/H5Dbtree.c1
-rw-r--r--src/H5Dchunk.c2
-rw-r--r--src/H5E.c2
-rw-r--r--src/H5Eint.c4
-rw-r--r--src/H5FD.c1
-rw-r--r--src/H5FDpublic.h19
-rw-r--r--src/H5FO.c10
-rw-r--r--src/H5FOprivate.h2
-rw-r--r--src/H5FSsection.c11
-rw-r--r--src/H5Faccum.c2
-rw-r--r--src/H5Fprivate.h1
-rw-r--r--src/H5Fpublic.h18
-rw-r--r--src/H5Gcache.c2
-rw-r--r--src/H5Gcompact.c2
-rw-r--r--src/H5Glink.c2
-rw-r--r--src/H5Gnode.c46
-rw-r--r--src/H5HFdblock.c1
-rw-r--r--src/H5HFhdr.c5
-rw-r--r--src/H5HFhuge.c10
-rw-r--r--src/H5HFiblock.c1
-rw-r--r--src/H5HFpkg.h15
-rw-r--r--src/H5HG.c14
-rw-r--r--src/H5HGcache.c3
-rw-r--r--src/H5HP.c30
-rw-r--r--src/H5Lexternal.c2
-rw-r--r--src/H5MF.c1
-rw-r--r--src/H5MFaggr.c35
-rw-r--r--src/H5MFsection.c1
-rw-r--r--src/H5O.c13
-rw-r--r--src/H5Oalloc.c8
-rw-r--r--src/H5Ocache.c2
-rw-r--r--src/H5Ocopy.c2
-rw-r--r--src/H5Odtype.c4
-rw-r--r--src/H5Pfcpl.c16
36 files changed, 184 insertions, 179 deletions
diff --git a/src/H5Apkg.h b/src/H5Apkg.h
index 4216fa3..de57e79 100644
--- a/src/H5Apkg.h
+++ b/src/H5Apkg.h
@@ -74,7 +74,7 @@
/****************************/
/* Define the shared attribute structure */
typedef struct H5A_shared_t {
- unsigned version; /* Version to encode attribute with */
+ uint8_t version; /* Version to encode attribute with */
char *name; /* Attribute's name */
H5T_cset_t encoding; /* Character encoding of attribute name */
diff --git a/src/H5Bcache.c b/src/H5Bcache.c
index 9765552..dd5b613 100644
--- a/src/H5Bcache.c
+++ b/src/H5Bcache.c
@@ -108,7 +108,7 @@ H5B_serialize(const H5F_t *f, const H5B_t *bt)
HDassert(f);
HDassert(bt);
HDassert(bt->rc_shared);
- shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared);
+ shared = (H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared);
HDassert(shared);
p = shared->page;
@@ -130,10 +130,10 @@ H5B_serialize(const H5F_t *f, const H5B_t *bt)
H5F_addr_encode(f, &p, bt->right);
/* child keys and pointers */
- native=bt->native;
- for (u = 0; u < bt->nchildren; ++u) {
+ native = bt->native;
+ for(u = 0; u < bt->nchildren; ++u) {
/* encode the key */
- if (shared->type->encode(f, bt, p, native) < 0)
+ if(shared->type->encode(f, bt, p, native) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key")
p += shared->sizeof_rkey;
native += shared->type->sizeof_nkey;
@@ -141,9 +141,9 @@ H5B_serialize(const H5F_t *f, const H5B_t *bt)
/* encode the child address */
H5F_addr_encode(f, &p, bt->child[u]);
} /* end for */
- if(bt->nchildren>0) {
+ if(bt->nchildren > 0) {
/* Encode the final key */
- if (shared->type->encode(f, bt, p, native) < 0)
+ if(shared->type->encode(f, bt, p, native) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key")
} /* end if */
@@ -186,29 +186,29 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata)
HDassert(type);
HDassert(type->get_shared);
- if (NULL==(bt = H5FL_MALLOC(H5B_t)))
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ if(NULL == (bt = H5FL_MALLOC(H5B_t)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
HDmemset(&bt->cache_info,0,sizeof(H5AC_info_t));
- if((bt->rc_shared=(type->get_shared)(f, udata))==NULL)
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "can't retrieve B-tree node buffer")
- shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared);
+ if(NULL == (bt->rc_shared=(type->get_shared)(f, udata)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't retrieve B-tree node buffer")
+ shared = (H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared);
HDassert(shared);
- if (NULL==(bt->native=H5FL_BLK_MALLOC(native_block,shared->sizeof_keys)) ||
- NULL==(bt->child=H5FL_SEQ_MALLOC(haddr_t,(size_t)shared->two_k)))
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ if(NULL == (bt->native = H5FL_BLK_MALLOC(native_block, shared->sizeof_keys)) ||
+ NULL == (bt->child = H5FL_SEQ_MALLOC(haddr_t, (size_t)shared->two_k)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
- if (H5F_block_read(f, H5FD_MEM_BTREE, addr, shared->sizeof_rnode, dxpl_id, shared->page)<0)
+ if(H5F_block_read(f, H5FD_MEM_BTREE, addr, shared->sizeof_rnode, dxpl_id, shared->page)<0)
HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree node")
p = shared->page;
/* magic number */
- if (HDmemcmp(p, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if(HDmemcmp(p, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree signature")
p += 4;
/* node type and level */
- if (*p++ != (uint8_t)type->id)
+ if(*p++ != (uint8_t)type->id)
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "incorrect B-tree node type")
bt->level = *p++;
@@ -220,22 +220,22 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata)
H5F_addr_decode(f, (const uint8_t **) &p, &(bt->right));
/* the child/key pairs */
- native=bt->native;
- for (u = 0; u < bt->nchildren; u++) {
+ native = bt->native;
+ for(u = 0; u < bt->nchildren; u++) {
/* Decode native key value */
- if ((type->decode) (f, bt, p, native) < 0)
+ if((type->decode)(f, bt, p, native) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDECODE, NULL, "unable to decode key")
p += shared->sizeof_rkey;
native += type->sizeof_nkey;
/* Decode address value */
H5F_addr_decode(f, (const uint8_t **) &p, bt->child + u);
- }
+ } /* end for */
/* Decode final key */
- if(bt->nchildren>0) {
+ if(bt->nchildren > 0) {
/* Decode native key value */
- if ((type->decode) (f, bt, p, native) < 0)
+ if((type->decode)(f, bt, p, native) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDECODE, NULL, "unable to decode key")
} /* end if */
@@ -243,8 +243,8 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata)
ret_value = bt;
done:
- if (!ret_value && bt)
- (void)H5B_dest(f,bt);
+ if(!ret_value && bt)
+ (void)H5B_dest(f, bt);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_load() */ /*lint !e818 Can't make udata a pointer to const */
@@ -285,8 +285,8 @@ H5B_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *bt, uns
HDassert(shared->type);
HDassert(shared->type->encode);
- if (bt->cache_info.is_dirty) {
- if (H5B_serialize(f, bt) < 0)
+ if(bt->cache_info.is_dirty) {
+ if(H5B_serialize(f, bt) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTSERIALIZE, FAIL, "unable to serialize B-tree")
/*
@@ -294,14 +294,14 @@ H5B_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *bt, uns
* bother writing data for the child entries that don't exist or
* for the final unchanged children.
*/
- if (H5F_block_write(f, H5FD_MEM_BTREE, addr, shared->sizeof_rnode, dxpl_id, shared->page) < 0)
+ if(H5F_block_write(f, H5FD_MEM_BTREE, addr, shared->sizeof_rnode, dxpl_id, shared->page) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to save B-tree node to disk")
bt->cache_info.is_dirty = FALSE;
} /* end if */
- if (destroy)
- if (H5B_dest(f,bt) < 0)
+ if(destroy)
+ if(H5B_dest(f,bt) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node")
done:
@@ -355,9 +355,9 @@ H5B_dest(H5F_t *f, H5B_t *bt)
/* Release resources for B-tree node */
H5FL_SEQ_FREE(haddr_t, bt->child);
- (void)H5FL_BLK_FREE(native_block, bt->native);
+ bt->native = H5FL_BLK_FREE(native_block, bt->native);
H5RC_DEC(bt->rc_shared);
- (void)H5FL_FREE(H5B_t, bt);
+ bt = H5FL_FREE(H5B_t, bt);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -392,8 +392,8 @@ H5B_clear(H5F_t *f, H5B_t *bt, hbool_t destroy)
/* Reset the dirty flag. */
bt->cache_info.is_dirty = FALSE;
- if (destroy)
- if (H5B_dest(f, bt) < 0)
+ if(destroy)
+ if(H5B_dest(f, bt) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node")
done:
@@ -416,7 +416,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5B_compute_size(const H5F_t *f, const H5B_t *bt, size_t *size_ptr)
+H5B_compute_size(const H5F_t UNUSED *f, const H5B_t *bt, size_t *size_ptr)
{
H5B_shared_t *shared; /* Pointer to shared B-tree info */
@@ -426,7 +426,7 @@ H5B_compute_size(const H5F_t *f, const H5B_t *bt, size_t *size_ptr)
HDassert(f);
HDassert(bt);
HDassert(bt->rc_shared);
- shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared);
+ shared = (H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared);
HDassert(shared);
HDassert(shared->type);
HDassert(size_ptr);
@@ -436,3 +436,4 @@ H5B_compute_size(const H5F_t *f, const H5B_t *bt, size_t *size_ptr)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5B_compute_size() */
+
diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c
index 7dfc288..c9561f2 100644
--- a/src/H5Dbtree.c
+++ b/src/H5Dbtree.c
@@ -1464,6 +1464,7 @@ H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent
/* Reset "fake" storage info */
HDmemset(&storage, 0, sizeof(storage));
+ storage.idx_type = H5D_CHUNK_BTREE;
/* Allocate the shared structure */
if(H5D_btree_shared_create(f, &storage, ndims) < 0)
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index fa96aac..b22a097 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -374,7 +374,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_chunk_construct(H5F_t *f, H5D_t *dset)
+H5D_chunk_construct(H5F_t UNUSED *f, H5D_t *dset)
{
const H5T_t *type = dset->shared->type; /* Convenience pointer to dataset's datatype */
hsize_t max_dim[H5O_LAYOUT_NDIMS]; /* Maximum size of data in elements */
diff --git a/src/H5E.c b/src/H5E.c
index beaf7d2..2d57cd6 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -336,7 +336,7 @@ H5E_get_stack(void)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_stack)
- estack = pthread_getspecific(H5TS_errstk_key_g);
+ estack = (H5E_t *)pthread_getspecific(H5TS_errstk_key_g);
if(!estack) {
/* no associated value with current thread - create one */
diff --git a/src/H5Eint.c b/src/H5Eint.c
index cba9155..f45e9fd 100644
--- a/src/H5Eint.c
+++ b/src/H5Eint.c
@@ -275,7 +275,7 @@ H5E_walk1_cb(int n, H5E_error1_t *err_desc, void *client_data)
fprintf(stream, "thread 0");
} /* end block */
#elif defined(H5_HAVE_THREADSAFE)
- fprintf(stream, "thread %lu", HDpthread_self_ulong());
+ fprintf(stream, "thread %lu", (unsigned long)HDpthread_self_ulong());
#else
fprintf(stream, "thread 0");
#endif
@@ -392,7 +392,7 @@ H5E_walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data)
fprintf(stream, "thread 0");
} /* end block */
#elif defined(H5_HAVE_THREADSAFE)
- fprintf(stream, "thread %lu", HDpthread_self_ulong());
+ fprintf(stream, "thread %lu", (unsigned long)HDpthread_self_ulong());
#else
fprintf(stream, "thread 0");
#endif
diff --git a/src/H5FD.c b/src/H5FD.c
index 4c316d1..f3b96d2 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -1717,7 +1717,6 @@ H5FD_get_fs_type_map(const H5FD_t *file, H5FD_mem_t *type_map)
FUNC_ENTER_NOAPI(H5FD_get_fs_type_map, FAIL)
/* Sanity check */
- HDassert(file);
HDassert(file && file->cls);
HDassert(type_map);
diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h
index 83137d5..dedbabb 100644
--- a/src/H5FDpublic.h
+++ b/src/H5FDpublic.h
@@ -26,23 +26,8 @@
#define H5_HAVE_VFL 1 /*define a convenient app feature test*/
#define H5FD_VFD_DEFAULT 0 /* Default VFL driver value */
-/*
- * Types of allocation requests. The values larger than H5FD_MEM_DEFAULT
- * should not change other than adding new types to the end. These numbers
- * might appear in files.
- */
-typedef enum H5FD_mem_t {
- H5FD_MEM_NOLIST = -1, /*must be negative*/
- H5FD_MEM_DEFAULT = 0, /*must be zero*/
- H5FD_MEM_SUPER = 1,
- H5FD_MEM_BTREE = 2,
- H5FD_MEM_DRAW = 3,
- H5FD_MEM_GHEAP = 4,
- H5FD_MEM_LHEAP = 5,
- H5FD_MEM_OHDR = 6,
-
- H5FD_MEM_NTYPES /*must be last*/
-} H5FD_mem_t;
+/* Types of allocation requests: see H5Fpublic.h */
+typedef enum H5F_mem_t H5FD_mem_t;
/* Map "fractal heap" header blocks to 'ohdr' type file memory, since its
* a fair amount of work to add a new kind of file memory and they are similar
diff --git a/src/H5FO.c b/src/H5FO.c
index 33241f0..6982e36 100644
--- a/src/H5FO.c
+++ b/src/H5FO.c
@@ -290,12 +290,12 @@ H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted)
PURPOSE
Check if an object is marked to be deleted when it is closed
USAGE
- htri_t H5FO_marked(f,addr)
+ hbool_t H5FO_marked(f,addr)
const H5F_t *f; IN: File opened object is in
haddr_t addr; IN: Address of object to delete
RETURNS
- Returns a TRUE/FALSE on success, negative on failure
+ Returns a TRUE/FALSE on success
DESCRIPTION
Checks if the object is currently in the "opened objects" tree and
whether its marks for deletion from the file when it is closed.
@@ -304,11 +304,11 @@ H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted)
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-htri_t
+hbool_t
H5FO_marked(const H5F_t *f, haddr_t addr)
{
H5FO_open_obj_t *open_obj; /* Information about open object */
- htri_t ret_value = FAIL; /* Return value */
+ hbool_t ret_value = FALSE; /* Return value */
FUNC_ENTER_NOAPI_NOFUNC(H5FO_marked)
@@ -320,7 +320,7 @@ H5FO_marked(const H5F_t *f, haddr_t addr)
/* Get the object node from the container */
if(NULL != (open_obj = (H5FO_open_obj_t *)H5SL_search(f->shared->open_objs, &addr)))
- ret_value = open_obj->deleted;
+ ret_value = (htri_t)open_obj->deleted;
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FO_marked() */
diff --git a/src/H5FOprivate.h b/src/H5FOprivate.h
index 9458a56..4648f02 100644
--- a/src/H5FOprivate.h
+++ b/src/H5FOprivate.h
@@ -41,7 +41,7 @@ H5_DLL void *H5FO_opened(const H5F_t *f, haddr_t addr);
H5_DLL herr_t H5FO_insert(const H5F_t *f, haddr_t addr, void *obj, hbool_t delete_flag);
H5_DLL herr_t H5FO_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr);
H5_DLL herr_t H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted);
-H5_DLL htri_t H5FO_marked(const H5F_t *f, haddr_t addr);
+H5_DLL hbool_t H5FO_marked(const H5F_t *f, haddr_t addr);
H5_DLL herr_t H5FO_dest(const H5F_t *f);
H5_DLL herr_t H5FO_top_create(H5F_t *f);
H5_DLL herr_t H5FO_top_incr(const H5F_t *f, haddr_t addr);
diff --git a/src/H5FSsection.c b/src/H5FSsection.c
index 9ad6c70..51229cb 100644
--- a/src/H5FSsection.c
+++ b/src/H5FSsection.c
@@ -27,6 +27,7 @@
#define H5FS_PACKAGE /*suppress error about including H5FSpkg */
+
/***********/
/* Headers */
/***********/
@@ -36,15 +37,11 @@
#include "H5MFprivate.h" /* File memory management */
#include "H5Vprivate.h" /* Vectors and arrays */
+
/****************/
/* Local Macros */
/****************/
-/* #define QAK */
-
-/* Default starting size of section buffer */
-#define H5FS_SINFO_SIZE_DEFAULT 64
-
/******************/
/* Local Typedefs */
@@ -87,6 +84,7 @@ static herr_t H5FS_sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect,
static htri_t H5FS_sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node);
static herr_t H5FS_sect_serialize_size(H5FS_t *fspace);
+
/*********************/
/* Package Variables */
/*********************/
@@ -178,8 +176,9 @@ done:
/* Release bins for skip lists */
if(sinfo->bins)
sinfo->bins = H5FL_SEQ_FREE(H5FS_bin_t, sinfo->bins);
+
/* Release free space section info */
- H5FL_FREE(H5FS_sinfo_t, sinfo);
+ sinfo = H5FL_FREE(H5FS_sinfo_t, sinfo);
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Faccum.c b/src/H5Faccum.c
index 9529e0c..d4e142b 100644
--- a/src/H5Faccum.c
+++ b/src/H5Faccum.c
@@ -597,7 +597,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F_accum_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr,
+H5F_accum_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t UNUSED type, haddr_t addr,
hsize_t size)
{
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 7204586..e3fe864 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -493,6 +493,7 @@ H5_DLL hbool_t H5F_use_latest_format(const H5F_t *f);
H5_DLL H5F_close_degree_t H5F_get_fc_degree(const H5F_t *f);
H5_DLL hbool_t H5F_store_msg_crt_idx(const H5F_t *f);
H5_DLL hbool_t H5F_is_tmp_addr(const H5F_t *f, haddr_t addr);
+H5_DLL hbool_t H5F_use_tmp_space(const H5F_t *f);
/* Functions that retrieve values from VFD layer */
H5_DLL hbool_t H5F_has_feature(const H5F_t *f, unsigned feature);
diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h
index 287e9b5..e23ad2d 100644
--- a/src/H5Fpublic.h
+++ b/src/H5Fpublic.h
@@ -111,6 +111,24 @@ typedef struct H5F_info_t {
} sohm;
} H5F_info_t;
+/*
+ * Types of allocation requests. The values larger than H5FD_MEM_DEFAULT
+ * should not change other than adding new types to the end. These numbers
+ * might appear in files.
+ */
+typedef enum H5F_mem_t {
+ H5FD_MEM_NOLIST = -1, /*must be negative*/
+ H5FD_MEM_DEFAULT = 0, /*must be zero*/
+ H5FD_MEM_SUPER = 1,
+ H5FD_MEM_BTREE = 2,
+ H5FD_MEM_DRAW = 3,
+ H5FD_MEM_GHEAP = 4,
+ H5FD_MEM_LHEAP = 5,
+ H5FD_MEM_OHDR = 6,
+
+ H5FD_MEM_NTYPES /*must be last*/
+} H5F_mem_t;
+
/* Library's file format versions */
typedef enum H5F_libver_t {
H5F_LIBVER_EARLIEST, /* Use the earliest possible format for storing objects */
diff --git a/src/H5Gcache.c b/src/H5Gcache.c
index 0e2a699..f711fda 100644
--- a/src/H5Gcache.c
+++ b/src/H5Gcache.c
@@ -311,7 +311,7 @@ H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5G_node_
/* entries */
if(H5G_ent_encode_vec(f, &p, sym->entry, sym->nsyms) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "can't serialize")
- HDmemset(p, 0, size - (p - node));
+ HDmemset(p, 0, size - (size_t)(p - node));
/* Write the serialized symbol table node. */
if(H5F_block_write(f, H5FD_MEM_BTREE, addr, size, dxpl_id, node) < 0)
diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c
index 9ecd6c1..26773cb 100644
--- a/src/H5Gcompact.c
+++ b/src/H5Gcompact.c
@@ -523,7 +523,7 @@ H5G_compact_lookup(H5O_loc_t *oloc, const char *name, H5O_link_t *lnk,
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over link messages")
/* Determine if we found the link we were looking for */
- ret_value = udata.found;
+ ret_value = (htri_t)udata.found;
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Glink.c b/src/H5Glink.c
index 7051453..37a0ede 100644
--- a/src/H5Glink.c
+++ b/src/H5Glink.c
@@ -377,7 +377,7 @@ H5G_link_to_info(const H5O_link_t *lnk, H5L_info_t *info)
if((cb_ret = (link_class->query_func)(lnk->name, lnk->u.ud.udata, lnk->u.ud.size, NULL, (size_t)0)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, "query buffer size callback returned failure")
- info->u.val_size = cb_ret;
+ info->u.val_size = (size_t)cb_ret;
} /* end if */
else
info->u.val_size = 0;
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index fe381fd..a58c66a 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -299,31 +299,31 @@ static herr_t
H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t UNUSED op, void *_lt_key,
void UNUSED *_udata, void *_rt_key, haddr_t *addr_p/*out*/)
{
- H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key;
- H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key;
- H5G_node_t *sym = NULL;
- hsize_t size = 0;
- herr_t ret_value=SUCCEED; /* Return value */
+ H5G_node_key_t *lt_key = (H5G_node_key_t *)_lt_key;
+ H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key;
+ H5G_node_t *sym = NULL;
+ hsize_t size = 0;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5G_node_create);
/*
* Check arguments.
*/
- assert(f);
- assert(H5B_INS_FIRST == op);
+ HDassert(f);
+ HDassert(H5B_INS_FIRST == op);
if(NULL == (sym = H5FL_CALLOC(H5G_node_t)))
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
size = H5G_node_size_real(f);
if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, size)))
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to allocate file space");
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to allocate file space")
sym->entry = H5FL_SEQ_CALLOC(H5G_entry_t, (size_t)(2 * H5F_SYM_LEAF_K(f)));
- if(NULL==sym->entry)
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
+ if(NULL == sym->entry)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
if(H5AC_set(f, dxpl_id, H5AC_SNODE, *addr_p, sym, H5AC__NO_FLAGS_SET) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to cache symbol table leaf node");
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to cache symbol table leaf node")
/*
* The left and right symbols in an empty tree are both the
* empty string stored at offset zero by the H5G functions. This
@@ -339,13 +339,13 @@ done:
if(ret_value < 0) {
if(sym != NULL) {
if(sym->entry != NULL)
- H5FL_SEQ_FREE(H5G_entry_t, sym->entry);
- (void)H5FL_FREE(H5G_node_t, sym);
+ sym->entry = H5FL_SEQ_FREE(H5G_entry_t, sym->entry);
+ sym = H5FL_FREE(H5G_node_t, sym);
} /* end if */
} /* end if */
- FUNC_LEAVE_NOAPI(ret_value);
-}
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5G_node_create() */
/*-------------------------------------------------------------------------
@@ -636,7 +636,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr,
*/
rt = sn->nsyms;
while(lt < rt) {
- idx = (lt + rt) / 2;
+ idx = (int)((lt + rt) / 2);
s = base + sn->entry[idx].name_off;
/* Check if symbol is already present */
@@ -644,9 +644,9 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr,
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, H5B_INS_ERROR, "symbol is already present in symbol table")
if (cmp < 0)
- rt = idx;
+ rt = (unsigned)idx;
else
- lt = idx + 1;
+ lt = (unsigned)(idx + 1);
} /* end while */
idx += cmp > 0 ? 1 : 0;
@@ -689,15 +689,17 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr,
insert_into = sn;
if(idx == (int)H5F_SYM_LEAF_K(f))
md_key->offset = ent.name_off;
- } else {
+ } /* end if */
+ else {
idx -= H5F_SYM_LEAF_K(f);
insert_into = snrt;
- if(idx == (int)H5F_SYM_LEAF_K (f)) {
+ if(idx == (int)H5F_SYM_LEAF_K(f)) {
rt_key->offset = ent.name_off;
*rt_key_changed = TRUE;
} /* end if */
} /* end else */
- } else {
+ } /* end if */
+ else {
/* Where to insert the new entry? */
ret_value = H5B_INS_NOOP;
sn_flags |= H5AC__DIRTIED_FLAG;
diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c
index bec300a..c4b7630 100644
--- a/src/H5HFdblock.c
+++ b/src/H5HFdblock.c
@@ -35,6 +35,7 @@
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File access */
#include "H5HFpkg.h" /* Fractal heaps */
#include "H5MFprivate.h" /* File memory management */
#include "H5Vprivate.h" /* Vectors and arrays */
diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c
index 4fd527d..d1f2675 100644
--- a/src/H5HFhdr.c
+++ b/src/H5HFhdr.c
@@ -43,6 +43,7 @@
/* Local Macros */
/****************/
+#ifndef NDEBUG
/* Limit on the size of the max. direct block size */
/* (This is limited to 32-bits currently, because I think it's unlikely to
* need to be larger, the 32-bit limit for H5V_log2_of2(n), and
@@ -55,6 +56,8 @@
* need to be larger, and its encoded with a maxiumum of 16-bits - QAK)
*/
#define H5HF_WIDTH_LIMIT (64 * 1024)
+#endif /* NDEBUG */
+
/******************/
/* Local Typedefs */
@@ -219,7 +222,7 @@ H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr)
HDassert(hdr);
/* Compute/cache some values */
- hdr->heap_off_size = H5HF_SIZEOF_OFFSET_BITS(hdr->man_dtable.cparam.max_index);
+ hdr->heap_off_size = (uint8_t)H5HF_SIZEOF_OFFSET_BITS(hdr->man_dtable.cparam.max_index);
if(H5HF_dtable_init(&hdr->man_dtable) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize doubling table info")
diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c
index 60c6c9f..792a865 100644
--- a/src/H5HFhuge.c
+++ b/src/H5HFhuge.c
@@ -68,20 +68,12 @@
/* Local v2 B-tree operations */
static herr_t H5HF_huge_bt2_create(H5HF_hdr_t *hdr, hid_t dxpl_id);
-/* v2 B-tree function callbacks (in H5HFbtree2.c) */
-H5_DLL herr_t H5HF_huge_bt2_indir_found(const void *nrecord, void *op_data);
-H5_DLL herr_t H5HF_huge_bt2_indir_remove(const void *nrecord, void *op_data);
-H5_DLL herr_t H5HF_huge_bt2_filt_indir_found(const void *nrecord, void *op_data);
-H5_DLL herr_t H5HF_huge_bt2_filt_indir_remove(const void *nrecord, void *op_data);
-H5_DLL herr_t H5HF_huge_bt2_dir_remove(const void *nrecord, void *op_data);
-H5_DLL herr_t H5HF_huge_bt2_filt_dir_found(const void *nrecord, void *op_data);
-H5_DLL herr_t H5HF_huge_bt2_filt_dir_remove(const void *nrecord, void *op_data);
-
/* Local 'huge' object support routines */
static hsize_t H5HF_huge_new_id(H5HF_hdr_t *hdr);
static herr_t H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id,
const uint8_t *id, hbool_t is_read, H5HF_operator_t op, void *op_data);
+
/*********************/
/* Package Variables */
/*********************/
diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c
index 04b1f50..879de78 100644
--- a/src/H5HFiblock.c
+++ b/src/H5HFiblock.c
@@ -35,6 +35,7 @@
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File access */
#include "H5HFpkg.h" /* Fractal heaps */
#include "H5MFprivate.h" /* File memory management */
#include "H5Vprivate.h" /* Vectors and arrays */
diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h
index bf80164..21e2865 100644
--- a/src/H5HFpkg.h
+++ b/src/H5HFpkg.h
@@ -351,9 +351,9 @@ typedef struct H5HF_hdr_t {
hbool_t huge_ids_direct; /* Flag to indicate that 'huge' object's offset & length are stored directly in heap ID */
size_t tiny_max_len; /* Max. size of tiny objects for this heap */
hbool_t tiny_len_extended; /* Flag to indicate that 'tiny' object's length is stored in extended form (i.e. w/extra byte) */
- unsigned char huge_id_size; /* Size of 'huge' heap IDs (in bytes) */
- unsigned char heap_off_size; /* Size of heap offsets (in bytes) */
- unsigned char heap_len_size; /* Size of heap ID lengths (in bytes) */
+ uint8_t huge_id_size; /* Size of 'huge' heap IDs (in bytes) */
+ uint8_t heap_off_size; /* Size of heap offsets (in bytes) */
+ uint8_t heap_len_size; /* Size of heap ID lengths (in bytes) */
} H5HF_hdr_t;
/* Common indirect block doubling table entry */
@@ -641,6 +641,15 @@ H5_DLL herr_t H5HF_huge_remove(H5HF_hdr_t *fh, hid_t dxpl_id, const uint8_t *id)
H5_DLL herr_t H5HF_huge_term(H5HF_hdr_t *hdr, hid_t dxpl_id);
H5_DLL herr_t H5HF_huge_delete(H5HF_hdr_t *hdr, hid_t dxpl_id);
+/* 'Huge' object v2 B-tree function callbacks */
+H5_DLL herr_t H5HF_huge_bt2_indir_found(const void *nrecord, void *op_data);
+H5_DLL herr_t H5HF_huge_bt2_indir_remove(const void *nrecord, void *op_data);
+H5_DLL herr_t H5HF_huge_bt2_filt_indir_found(const void *nrecord, void *op_data);
+H5_DLL herr_t H5HF_huge_bt2_filt_indir_remove(const void *nrecord, void *op_data);
+H5_DLL herr_t H5HF_huge_bt2_dir_remove(const void *nrecord, void *op_data);
+H5_DLL herr_t H5HF_huge_bt2_filt_dir_found(const void *nrecord, void *op_data);
+H5_DLL herr_t H5HF_huge_bt2_filt_dir_remove(const void *nrecord, void *op_data);
+
/* 'Tiny' object routines */
H5_DLL herr_t H5HF_tiny_init(H5HF_hdr_t *hdr);
H5_DLL herr_t H5HF_tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj,
diff --git a/src/H5HG.c b/src/H5HG.c
index 48e68b0..1df4b37 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -186,20 +186,18 @@ H5HG_create (H5F_t *f, hid_t dxpl_id, size_t size)
heap->addr = addr;
heap->size = size;
- if (NULL==(heap->chunk = H5FL_BLK_MALLOC (gheap_chunk,size)))
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, \
- "memory allocation failed");
+ if(NULL == (heap->chunk = H5FL_BLK_MALLOC(gheap_chunk, size)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed")
#ifdef H5_CLEAR_MEMORY
HDmemset(heap->chunk, 0, size);
#endif /* H5_CLEAR_MEMORY */
- heap->nalloc = H5HG_NOBJS (f, size);
+ heap->nalloc = H5HG_NOBJS(f, size);
heap->nused = 1; /* account for index 0, which is used for the free object */
- if (NULL==(heap->obj = H5FL_SEQ_MALLOC (H5HG_obj_t,heap->nalloc)))
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, \
- "memory allocation failed");
+ if(NULL == (heap->obj = H5FL_SEQ_MALLOC(H5HG_obj_t, heap->nalloc)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed")
/* Initialize the header */
- HDmemcpy (heap->chunk, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC);
+ HDmemcpy(heap->chunk, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC);
p = heap->chunk + H5_SIZEOF_MAGIC;
*p++ = H5HG_VERSION;
*p++ = 0; /*reserved*/
diff --git a/src/H5HGcache.c b/src/H5HGcache.c
index 04c2ea3..9419eef 100644
--- a/src/H5HGcache.c
+++ b/src/H5HGcache.c
@@ -172,7 +172,8 @@ H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * udata1,
nalloc = H5HG_NOBJS(f, heap->size);
if(NULL == (heap->obj = H5FL_SEQ_MALLOC(H5HG_obj_t, nalloc)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
- heap->obj[0].size = heap->obj[0].nrefs = 0;
+ heap->obj[0].nrefs = 0;
+ heap->obj[0].size = 0;
heap->obj[0].begin = NULL;
heap->nalloc = nalloc;
diff --git a/src/H5HP.c b/src/H5HP.c
index 2b1fe89..ad76817 100644
--- a/src/H5HP.c
+++ b/src/H5HP.c
@@ -378,11 +378,11 @@ H5HP_create(H5HP_type_t heap_type)
done:
/* Error cleanup */
- if(ret_value==NULL) {
- if(new_heap!=NULL) {
- if(new_heap->heap!=NULL)
- H5FL_SEQ_FREE(H5HP_ent_t,new_heap->heap);
- (void)H5FL_FREE(H5HP_t,new_heap);
+ if(NULL ==ret_value) {
+ if(NULL != new_heap) {
+ if(NULL != new_heap->heap)
+ new_heap->heap = H5FL_SEQ_FREE(H5HP_ent_t, new_heap->heap);
+ new_heap = H5FL_FREE(H5HP_t, new_heap);
} /* end if */
} /* end if */
@@ -772,20 +772,20 @@ H5HP_incr(H5HP_t *heap, unsigned amt, void *_obj)
assert(heap->heap[0].obj==NULL);
/* Get the location of the object in the heap */
- obj_loc=obj->heap_loc;
- assert(obj_loc>0 && obj_loc<=heap->nobjs);
+ obj_loc = obj->heap_loc;
+ assert(obj_loc > 0 && obj_loc <= heap->nobjs);
/* Change the heap object's priority */
- heap->heap[obj_loc].val+=amt;
+ heap->heap[obj_loc].val += (int)amt;
/* Restore heap condition */
- if(heap->type==H5HP_MAX_HEAP) {
- if(H5HP_swim_max(heap,obj_loc)<0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition");
+ if(H5HP_MAX_HEAP == heap->type) {
+ if(H5HP_swim_max(heap, obj_loc) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition")
} /* end if */
else {
- if(H5HP_sink_min(heap,obj_loc)<0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition");
+ if(H5HP_sink_min(heap, obj_loc) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition")
} /* end else */
done:
@@ -910,10 +910,10 @@ H5HP_close(H5HP_t *heap)
HDassert(NULL == heap->heap[0].obj);
/* Free internal structures for heap */
- H5FL_SEQ_FREE(H5HP_ent_t, heap->heap);
+ heap->heap = H5FL_SEQ_FREE(H5HP_ent_t, heap->heap);
/* Free actual heap object */
- (void)H5FL_FREE(H5HP_t, heap);
+ heap = H5FL_FREE(H5HP_t, heap);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5HP_close() */
diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c
index 8637429..57414c7 100644
--- a/src/H5Lexternal.c
+++ b/src/H5Lexternal.c
@@ -482,7 +482,7 @@ H5L_extern_query(const char UNUSED * link_name, const void *_udata, size_t udata
} /* end if */
/* Set return value */
- ret_value = udata_size;
+ ret_value = (ssize_t)udata_size;
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5MF.c b/src/H5MF.c
index 2cf52b0..637151e 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -394,6 +394,7 @@ HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", FUNC, ret_value,
#ifdef H5MF_ALLOC_DEBUG_DUMP
H5MF_sects_dump(f, dxpl_id, stderr);
#endif /* H5MF_ALLOC_DEBUG_DUMP */
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5MF_alloc() */
diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c
index 0f8a374..fa5014bc 100644
--- a/src/H5MFaggr.c
+++ b/src/H5MFaggr.c
@@ -86,10 +86,6 @@
* Programmer: Quincey Koziol
* Thursday, December 13, 2007
*
- * Modifications:
- * Vailin Choi, July 29th, 2008
- * The whole routine is modified to handle alignment
- *
*-------------------------------------------------------------------------
*/
haddr_t
@@ -133,13 +129,13 @@ HDfprintf(stderr, "%s: aggr = {%a, %Hu, %Hu}\n", FUNC, aggr->addr, aggr->tot_siz
#endif /* H5MF_AGGR_DEBUG */
alignment = f->shared->alignment;
- if (!((alignment > 1) && (size >= f->shared->threshold)))
+ if(!((alignment > 1) && (size >= f->shared->threshold)))
alignment = 0; /* no alignment */
- if (alignment && aggr->addr > 0 && aggr->size > 0 && (mis_align = aggr->addr % alignment)) {
+ if(alignment && aggr->addr > 0 && aggr->size > 0 && (mis_align = aggr->addr % alignment)) {
frag_addr = aggr->addr;
frag_size = alignment - mis_align;
- }
+ } /* end if */
alloc_type = aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA ? H5FD_MEM_DEFAULT : H5FD_MEM_DRAW;
other_alloc_type = other_aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA ? H5FD_MEM_DEFAULT : H5FD_MEM_DRAW;
@@ -155,7 +151,7 @@ HDfprintf(stderr, "%s: aggr = {%a, %Hu, %Hu}\n", FUNC, aggr->addr, aggr->tot_siz
if(H5F_addr_gt((aggr->addr + aggr->size + ext_size), f->shared->tmp_addr))
HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, HADDR_UNDEF, "'normal' file space allocation request will overlap into 'temporary' file space")
- if ((aggr->addr > 0) && (extended=H5FD_try_extend(f->shared->lf, alloc_type, aggr->addr + aggr->size, ext_size)) < 0)
+ if ((aggr->addr > 0) && (extended = H5FD_try_extend(f->shared->lf, alloc_type, aggr->addr + aggr->size, ext_size)) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't extending space")
else if (extended) {
/* aggr->size is unchanged */
@@ -176,7 +172,7 @@ HDfprintf(stderr, "%s: aggr = {%a, %Hu, %Hu}\n", FUNC, aggr->addr, aggr->tot_siz
other_aggr->addr = 0;
other_aggr->tot_size = 0;
other_aggr->size = 0;
- }
+ } /* end if */
if(HADDR_UNDEF == (new_space = H5FD_alloc(f->shared->lf, dxpl_id, type, size, &eoa_frag_addr, &eoa_frag_size)))
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate aggregation block")
@@ -193,14 +189,14 @@ HDfprintf(stderr, "%s: aggr = {%a, %Hu, %Hu}\n", FUNC, aggr->addr, aggr->tot_siz
HDfprintf(stderr, "%s: Allocating block\n", FUNC);
#endif /* H5MF_AGGR_DEBUG */
- if (frag_size > (ext_size - size))
+ if(frag_size > (ext_size - size))
ext_size += (frag_size - (ext_size - size));
/* Check for overlapping into file's temporary allocation space */
if(H5F_addr_gt((aggr->addr + aggr->size + ext_size), f->shared->tmp_addr))
HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, HADDR_UNDEF, "'normal' file space allocation request will overlap into 'temporary' file space")
- if ((aggr->addr > 0) && (extended = H5FD_try_extend(f->shared->lf, alloc_type, aggr->addr + aggr->size, ext_size)) < 0)
+ if((aggr->addr > 0) && (extended = H5FD_try_extend(f->shared->lf, alloc_type, aggr->addr + aggr->size, ext_size)) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't extending space")
else if (extended) {
aggr->addr += frag_size;
@@ -211,7 +207,7 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC);
if(H5F_addr_gt((eoa + aggr->alloc_size), f->shared->tmp_addr))
HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, HADDR_UNDEF, "'normal' file space allocation request will overlap into 'temporary' file space")
- if ((other_aggr->size > 0) && (H5F_addr_eq((other_aggr->addr + other_aggr->size), eoa)) &&
+ if((other_aggr->size > 0) && (H5F_addr_eq((other_aggr->addr + other_aggr->size), eoa)) &&
((other_aggr->tot_size - other_aggr->size) >= other_aggr->alloc_size)) {
if(H5FD_free(f->shared->lf, dxpl_id, other_alloc_type, other_aggr->addr, other_aggr->size) < 0)
@@ -219,7 +215,7 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC);
other_aggr->addr = 0;
other_aggr->tot_size = 0;
other_aggr->size = 0;
- }
+ } /* end if */
if(HADDR_UNDEF == (new_space = H5FD_alloc(f->shared->lf, dxpl_id, alloc_type, aggr->alloc_size, &eoa_frag_addr, &eoa_frag_size)))
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate aggregation block")
@@ -233,7 +229,6 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC);
aggr->addr = new_space;
aggr->size = aggr->alloc_size;
aggr->tot_size = aggr->alloc_size;
-
} /* end else */
/* Allocate space out of the metadata block */
@@ -243,12 +238,12 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC);
} /* end else */
/* freeing any possible fragment due to file allocation */
- if (eoa_frag_size)
+ if(eoa_frag_size)
if(H5MF_xfree(f, type, dxpl_id, eoa_frag_addr, eoa_frag_size) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't free eoa fragment")
/* freeing any possible fragment due to alignment in the block after extension */
- if (extended && frag_size)
+ if(extended && frag_size)
if(H5MF_xfree(f, type, dxpl_id, frag_addr, frag_size) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation fragment")
} /* end if */
@@ -262,7 +257,7 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC);
if (frag_size)
if(H5MF_xfree(f, type, dxpl_id, frag_addr, frag_size) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation fragment")
- }
+ } /* end else */
} /* end if */
else {
/* Check for overlapping into file's temporary allocation space */
@@ -272,7 +267,7 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC);
/* Allocate data from the file */
if(HADDR_UNDEF == (ret_value = H5FD_alloc(f->shared->lf, dxpl_id, type, size, &eoa_frag_addr, &eoa_frag_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space")
- if (eoa_frag_size)
+ if(eoa_frag_size)
if(H5MF_xfree(f, type, dxpl_id, eoa_frag_addr, eoa_frag_size) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't free eoa fragment")
} /* end else */
@@ -426,7 +421,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5MF_aggr_absorb(const H5F_t *f, H5F_blk_aggr_t *aggr, H5MF_free_section_t *sect,
+H5MF_aggr_absorb(const H5F_t UNUSED *f, H5F_blk_aggr_t *aggr, H5MF_free_section_t *sect,
hbool_t allow_sect_absorb)
{
FUNC_ENTER_NOAPI_NOFUNC(H5MF_aggr_absorb)
@@ -549,7 +544,7 @@ herr_t
H5MF_aggr_reset(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr)
{
H5FD_mem_t alloc_type; /* Type of file memory to work with */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5MF_aggr_reset, FAIL)
diff --git a/src/H5MFsection.c b/src/H5MFsection.c
index 200195a..0dc43c3 100644
--- a/src/H5MFsection.c
+++ b/src/H5MFsection.c
@@ -528,4 +528,3 @@ done:
FUNC_LEAVE_NOAPI((H5FS_section_info_t *)ret_value)
} /* end H5MF_sect_simple_split() */
-
diff --git a/src/H5O.c b/src/H5O.c
index 2017e1c..64d0b9b 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -1449,11 +1449,12 @@ H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, unsigned *oh_flags)
*oh_flags = H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG;
} /* end else */
} /* end if */
- } else {
+ } /* end if */
+ else {
/* A new object, or one that will be deleted */
- if(oh->nlink == 0) {
- /* Check if the object is current open, but marked for deletion */
- if(H5FO_marked(f, addr) > 0) {
+ if(0 == oh->nlink) {
+ /* Check if the object is currently open, but marked for deletion */
+ if(H5FO_marked(f, addr)) {
/* Remove "delete me" flag on the object */
if(H5FO_mark(f, addr, FALSE) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't mark object for deletion")
@@ -1496,7 +1497,7 @@ H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, unsigned *oh_flags)
} /* end if */
/* Set return value */
- ret_value = oh->nlink;
+ ret_value = (int)oh->nlink;
done:
FUNC_LEAVE_NOAPI(ret_value);
@@ -2934,5 +2935,3 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_visit() */
-
-
diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c
index b2d38da..6c8c931 100644
--- a/src/H5Oalloc.c
+++ b/src/H5Oalloc.c
@@ -163,7 +163,7 @@ H5O_add_gap(H5O_t *oh, unsigned chunkno, unsigned idx,
/* Check if we need to extend message table to hold the new null message */
if(oh->nmesgs >= oh->alloc_nmesgs)
if(H5O_alloc_msgs(oh, (size_t)1) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, UFAIL, "can't allocate more space for messages")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate more space for messages")
/* Increment new gap size */
oh->chunk[chunkno].gap += new_gap_size;
@@ -329,7 +329,7 @@ H5O_alloc_null(H5O_t *oh, unsigned null_idx, const H5O_msg_class_t *new_type,
/* Add the gap to the chunk */
if(H5O_add_gap(oh, alloc_msg->chunkno, null_idx, alloc_msg->raw + alloc_msg->raw_size, gap_size) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, UFAIL, "can't insert gap in chunk")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert gap in chunk")
} /* end if */
else {
size_t new_mesg_size = new_size + H5O_SIZEOF_MSGHDR_OH(oh); /* Total size of newly allocated message */
@@ -338,7 +338,7 @@ H5O_alloc_null(H5O_t *oh, unsigned null_idx, const H5O_msg_class_t *new_type,
/* Check if we need to extend message table to hold the new null message */
if(oh->nmesgs >= oh->alloc_nmesgs) {
if(H5O_alloc_msgs(oh, (size_t)1) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, UFAIL, "can't allocate more space for messages")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate more space for messages")
/* "Retarget" 'alloc_msg' pointer into newly re-allocated array of messages */
alloc_msg = &oh->mesg[null_idx];
@@ -361,7 +361,7 @@ H5O_alloc_null(H5O_t *oh, unsigned null_idx, const H5O_msg_class_t *new_type,
if(H5O_eliminate_gap(oh, null_msg,
((oh->chunk[null_chunkno].image + oh->chunk[null_chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[null_chunkno].gap)),
oh->chunk[null_chunkno].gap) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTREMOVE, UFAIL, "can't eliminate gap in chunk")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTREMOVE, FAIL, "can't eliminate gap in chunk")
/* Set the gap size to zero for the chunk */
oh->chunk[null_chunkno].gap = 0;
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index b256eef..72f2135 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -508,7 +508,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1,
HDassert(nullcnt == 0);
/* Set gap information for chunk */
- oh->chunk[chunkno].gap = (eom_ptr - p);
+ oh->chunk[chunkno].gap = (size_t)(eom_ptr - p);
/* Increment location in chunk */
p += oh->chunk[chunkno].gap;
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index 2926c6b..807d147 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -543,7 +543,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */,
/* Check if the chunk's data portion is too small */
dst_oh_gap = dst_oh_null = 0;
if(dst_oh_size < H5O_MIN_SIZE) {
- size_t delta = (H5O_MIN_SIZE - dst_oh_size); /* Delta in chunk size needed */
+ size_t delta = (size_t)(H5O_MIN_SIZE - dst_oh_size); /* Delta in chunk size needed */
/* Sanity check */
HDassert((oh_dst->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_1);
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index 83dbabc..a9812690 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -579,8 +579,8 @@ done:
if(ret_value < 0) {
if(dt != NULL) {
if(dt->shared != NULL)
- H5FL_FREE(H5T_shared_t, dt->shared);
- H5FL_FREE(H5T_t, dt);
+ dt->shared = H5FL_FREE(H5T_shared_t, dt->shared);
+ dt = H5FL_FREE(H5T_t, dt);
} /* end if */
} /* end if */
diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c
index a7956e7..4d576c6 100644
--- a/src/H5Pfcpl.c
+++ b/src/H5Pfcpl.c
@@ -758,15 +758,15 @@ H5Pset_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned mesg_type_
/* Check arguments */
if(mesg_type_flags > H5O_SHMESG_ALL_FLAG)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "unrecognized flags in mesg_type_flags");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "unrecognized flags in mesg_type_flags")
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Read the current number of indexes */
if(H5P_get(plist, H5F_CRT_SHMSG_NINDEXES_NAME, &nindexes) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get number of indexes");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get number of indexes")
/* Range check */
if(index_num >= nindexes)
@@ -784,9 +784,9 @@ H5Pset_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned mesg_type_
/* Write arrays back to plist */
if(H5P_set(plist, H5F_CRT_SHMSG_INDEX_TYPES_NAME, type_flags) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set index type flags");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set index type flags")
if(H5P_set(plist, H5F_CRT_SHMSG_INDEX_MINSIZE_NAME, minsizes) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set min mesg sizes");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set min mesg sizes")
done:
FUNC_LEAVE_API(ret_value)
@@ -845,7 +845,7 @@ H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned *mesg_type
done:
FUNC_LEAVE_API(ret_value);
-}
+} /* end H5Pset_shared_mesg_index() */
/*-------------------------------------------------------------------------
@@ -905,7 +905,7 @@ H5Pset_shared_mesg_phase_change(hid_t plist_id, unsigned max_list, unsigned min_
done:
FUNC_LEAVE_API(ret_value);
-}
+} /* end H5Pset_shared_mesg_phase_change() */
/*-------------------------------------------------------------------------
@@ -946,5 +946,5 @@ H5Pget_shared_mesg_phase_change(hid_t plist_id, unsigned *max_list, unsigned *mi
done:
FUNC_LEAVE_API(ret_value);
-}
+} /* end H5Pget_shared_mesg_phase_change() */