summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5AC.c11
-rw-r--r--src/H5D.c3
-rw-r--r--src/H5F.c39
-rw-r--r--src/H5FDfphdf5.c43
-rw-r--r--src/H5FDfphdf5.h2
-rw-r--r--src/H5FPclient.c2
-rw-r--r--src/H5FPserver.c2
-rw-r--r--src/H5G.c8
-rw-r--r--src/H5Gnode.c8
-rw-r--r--src/H5HL.c4
10 files changed, 50 insertions, 72 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index a9bf824..89ef2d9 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -1220,11 +1220,15 @@ done:
*/
void *
H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
- const void *udata1, void *udata2, H5AC_protect_t rw)
+ const void *udata1, void *udata2, H5AC_protect_t
+#ifndef H5_HAVE_FPHDF5
+ UNUSED
+#endif /* H5_HAVE_FPHDF5 */
+ rw)
{
unsigned idx; /* Index in cache */
void *thing = NULL;
- H5AC_t *cache;
+ H5AC_t *cache = NULL;
H5AC_info_t **info;
void *ret_value; /* Return value */
#ifdef H5_HAVE_FPHDF5
@@ -1449,7 +1453,6 @@ done:
if (ret_value)
++cache->nprots;
- rw = rw; /* Remove compiler warning if no FPHDF5 used */
FUNC_LEAVE_NOAPI(ret_value)
}
@@ -1492,7 +1495,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
{
unsigned idx;
H5AC_flush_func_t flush;
- H5AC_t *cache;
+ H5AC_t *cache = NULL;
H5AC_info_t **info;
herr_t ret_value = SUCCEED; /* Return value */
#ifdef H5_HAVE_FPHDF5
diff --git a/src/H5D.c b/src/H5D.c
index 0de1e56..1507f64 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -2843,7 +2843,7 @@ done:
static haddr_t
H5D_get_offset(const H5D_t *dset)
{
- haddr_t ret_value;
+ haddr_t ret_value=HADDR_UNDEF;
haddr_t base_addr;
H5F_t *f;
@@ -2854,7 +2854,6 @@ H5D_get_offset(const H5D_t *dset)
switch(dset->layout.type) {
case H5D_CHUNKED:
case H5D_COMPACT:
- ret_value = HADDR_UNDEF;
break;
case H5D_CONTIGUOUS:
diff --git a/src/H5F.c b/src/H5F.c
index 060f495..a3feb92 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -1795,7 +1795,6 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
hbool_t driver_has_cmp; /*`cmp' callback defined? */
H5P_genplist_t *a_plist; /*file access property list */
H5F_close_degree_t fc_degree; /*file close degree */
- int mrc; /*MPI return code */
H5F_t *ret_value = NULL; /*actual return value */
FUNC_ENTER_NOAPI(H5F_open, NULL)
@@ -1919,7 +1918,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
* empty or not.
*/
if (0==H5FD_get_eof(lf) && (flags & H5F_ACC_RDWR)) {
- hsize_t buf_size; /* Size of buffer needed to hold superblock info */
+ hsize_t buf_size=0; /* Size of buffer needed to hold superblock info */
void *buf=NULL; /* Buffer to hold superblock info */
/*
@@ -1963,6 +1962,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
* from the captain to the other clients
*/
if (H5FD_is_fphdf5_driver(lf)) {
+ int mrc; /*MPI return code */
H5FP_super_t super_info; /* Superblock information */
/* Captain sets up the information */
@@ -1985,13 +1985,14 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
} /* end if */
/* Broadcast the actual superblock */
- if ((mrc = MPI_Bcast(buf, super_info.size, MPI_BYTE, (int)H5FP_capt_barrier_rank,
+ H5_CHECK_OVERFLOW(super_info.size, hsize_t, int);
+ if ((mrc = MPI_Bcast(buf, (int)super_info.size, MPI_BYTE, (int)H5FP_capt_barrier_rank,
H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS)
HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mrc)
if (!H5FD_fphdf5_is_captain(lf)) {
if (H5F_read_superblock(file, dxpl_id, &root_ent, super_info.addr,
- buf, super_info.size) < 0)
+ buf, (size_t)super_info.size) < 0)
HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock")
if (H5G_mkroot(file, dxpl_id, &root_ent) < 0)
@@ -2353,14 +2354,14 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr
uint8_t *q; /*ptr into temp I/O buffer */
size_t sizeof_addr = 0;
size_t sizeof_size = 0;
- size_t fixed_size = 24; /*fixed sizeof superblock */
+ const size_t fixed_size = 24; /*fixed sizeof superblock */
unsigned sym_leaf_k = 0;
size_t variable_size; /*variable sizeof superblock */
unsigned btree_k[H5B_NUM_BTREE_ID]; /* B-tree internal node 'K' values */
H5F_file_t *shared = NULL; /* shared part of `file' */
H5FD_t *lf = NULL; /* file driver part of `shared' */
- const uint8_t *p = NULL; /* Temporary pointer into encoding buffers */
- const uint8_t *start_p; /* Start of encoding buffers */
+ uint8_t *p; /* Temporary pointer into encoding buffers */
+ uint8_t *start_p; /* Start of encoding buffers */
unsigned i; /* Index variable */
unsigned chksum; /* Checksum temporary variable */
size_t driver_size; /* Size of driver info block, in bytes */
@@ -2513,7 +2514,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr
if(!buf) {
if (H5FD_set_eoa(lf, shared->super_addr + fixed_size+variable_size) < 0 ||
H5FD_read(lf, H5FD_MEM_SUPER, dxpl_id, shared->super_addr + fixed_size,
- variable_size, &start_p[fixed_size]) < 0)
+ variable_size, p) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read superblock")
} /* end if */
@@ -2534,12 +2535,12 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr
HDmemcpy(shared->btree_k, btree_k, sizeof(unsigned) * H5B_NUM_BTREE_ID); /* Keep a local copy also */
- H5F_addr_decode(f, &p, &shared->base_addr/*out*/);
- H5F_addr_decode(f, &p, &shared->freespace_addr/*out*/);
- H5F_addr_decode(f, &p, &stored_eoa/*out*/);
- H5F_addr_decode(f, &p, &shared->driver_addr/*out*/);
+ H5F_addr_decode(f, (const uint8_t **)&p, &shared->base_addr/*out*/);
+ H5F_addr_decode(f, (const uint8_t **)&p, &shared->freespace_addr/*out*/);
+ H5F_addr_decode(f, (const uint8_t **)&p, &stored_eoa/*out*/);
+ H5F_addr_decode(f, (const uint8_t **)&p, &shared->driver_addr/*out*/);
- if (H5G_ent_decode(f, &p, root_ent/*out*/) < 0)
+ if (H5G_ent_decode(f, (const uint8_t **)&p, root_ent/*out*/) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read root symbol entry")
/*
@@ -2685,11 +2686,11 @@ H5F_init_superblock(H5F_t *f, hid_t dxpl_id)
hsize_t ret_value;
/* Encoding */
- FUNC_ENTER_NOAPI(H5F_init_superblock, FAIL)
+ FUNC_ENTER_NOAPI(H5F_init_superblock, UFAIL)
/* Get the shared file creation property list */
if (NULL == (plist = H5I_object(f->shared->fcpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, UFAIL, "not a property list")
/*
* The superblock starts immediately after the user-defined
@@ -2698,14 +2699,14 @@ H5F_init_superblock(H5F_t *f, hid_t dxpl_id)
* now.
*/
if(H5P_get(plist, H5F_CRT_USER_BLOCK_NAME, &userblock_size) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get user block size")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, UFAIL, "unable to get user block size")
f->shared->super_addr = userblock_size;
f->shared->base_addr = f->shared->super_addr;
f->shared->consist_flags = 0x03;
/* Grab superblock version from property list */
if (H5P_get(plist, H5F_CRT_SUPER_VERS_NAME, &super_vers) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get super block version")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, UFAIL, "unable to get super block version")
/* Compute the size of the superblock */
superblock_size=H5F_SIGNATURE_LEN /* Signature length (8 bytes) */
@@ -2732,11 +2733,11 @@ H5F_init_superblock(H5F_t *f, hid_t dxpl_id)
((hsize_t)f->shared->base_addr + superblock_size + driver_size));
if (HADDR_UNDEF == addr)
- HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL,
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, UFAIL,
"unable to allocate file space for userblock and/or superblock")
if (0 != addr)
- HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL,
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, UFAIL,
"file driver failed to allocate userblock and/or superblock at address zero")
/*
diff --git a/src/H5FDfphdf5.c b/src/H5FDfphdf5.c
index db2ca11..59dbecf 100644
--- a/src/H5FDfphdf5.c
+++ b/src/H5FDfphdf5.c
@@ -1255,7 +1255,7 @@ H5FD_fphdf5_read(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
H5FP_status_t sap_status = H5FP_STATUS_OK;
if (H5FP_request_read_metadata(_file, file->file_id, dxpl_id, mem_type,
- mpi_off, size, (uint8_t**)&buf,
+ addr, size, (uint8_t**)&buf,
&bytes_read, &req_id, &sap_status) != SUCCEED) {
/* FIXME: The read failed, for some reason */
HDfprintf(stderr, "%s:%d: Metadata cache read failed!\n", FUNC, __LINE__);
@@ -1347,7 +1347,6 @@ H5FD_fphdf5_write(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
haddr_t addr, size_t size, const void *buf)
{
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
- MPI_Offset mpi_off;
int size_i;
unsigned dumping = 0;
H5P_genplist_t *plist;
@@ -1365,11 +1364,7 @@ H5FD_fphdf5_write(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
assert(H5P_isa_class(dxpl_id, H5P_DATASET_XFER) == TRUE);
/* some numeric conversions */
- if (H5FD_fphdf5_haddr_to_MPIOff(addr, &mpi_off) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from haddr to MPI off")
-
size_i = (int)size;
-
if ((hsize_t)size_i != size)
HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from size to size_i")
@@ -1377,31 +1372,6 @@ H5FD_fphdf5_write(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
if ((plist = H5I_object(dxpl_id)) == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
-#if 0
- /* Metadata specific actions */
- if (mem_type != H5FD_MEM_DRAW) {
- unsigned block_before_meta_write = 0;
- int mrc;
-
- /*
- * Check if we need to syncronize all processes before attempting
- * metadata write (Prevents race condition where the process
- * writing the metadata goes ahead and writes the metadata to the
- * file before all the processes have read the data,
- * "transmitting" data from the "future" to the reading process.
- * -QAK )
- */
- if (H5P_exist_plist(plist, H5AC_BLOCK_BEFORE_META_WRITE_NAME) > 0)
- if (H5P_get(plist, H5AC_BLOCK_BEFORE_META_WRITE_NAME,
- &block_before_meta_write) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get H5AC property")
-
- if (block_before_meta_write)
- if ((mrc = MPI_Barrier(file->barrier_comm)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mrc)
- }
-#endif /* 0 */
-
if (H5P_exist_plist(plist, H5FD_FPHDF5_XFER_DUMPING_METADATA) > 0)
if (H5P_get(plist, H5FD_FPHDF5_XFER_DUMPING_METADATA, &dumping) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property")
@@ -1415,7 +1385,7 @@ H5FD_fphdf5_write(H5FD_t *_file, H5FD_mem_t mem_type, hid_t dxpl_id,
H5FP_status_t sap_status = H5FP_STATUS_OK;
if (H5FP_request_write_metadata(_file, file->file_id, dxpl_id, mem_type,
- mpi_off, size_i, buf, &req_id,
+ addr, size_i, buf, &req_id,
&sap_status) != SUCCEED) {
/* FIXME: Couldn't write metadata. This is bad... */
HDfprintf(stderr, "%s:%d: Couldn't write metadata to SAP (%d)\n",
@@ -1442,7 +1412,7 @@ HDfprintf(stderr, "%s: Couldn't write metadata to SAP (%d)\n",
}
/* FIXME: Should I check this return value or just pass it on out? */
- ret_value = H5FD_fphdf5_write_real(_file, dxpl_id, mpi_off, size_i, buf);
+ ret_value = H5FD_fphdf5_write_real(_file, dxpl_id, addr, size_i, buf);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1462,13 +1432,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int size,
+H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, int size,
const void *buf)
{
H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file;
MPI_Status status;
MPI_Datatype buf_type;
MPI_Datatype file_type;
+ MPI_Offset mpi_off;
int mrc;
int bytes_written;
unsigned use_view_this_time = 0;
@@ -1490,6 +1461,10 @@ H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id, MPI_Offset mpi_off, int siz
/* Portably initialize MPI status variable */
HDmemset(&status, 0, sizeof(MPI_Status));
+ /* some numeric conversions */
+ if (H5FD_fphdf5_haddr_to_MPIOff(addr, &mpi_off) < 0)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from haddr to MPI off")
+
/* Obtain the data transfer properties */
if ((plist = H5I_object(dxpl_id)) == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
diff --git a/src/H5FDfphdf5.h b/src/H5FDfphdf5.h
index 8cf27fd..0736c15 100644
--- a/src/H5FDfphdf5.h
+++ b/src/H5FDfphdf5.h
@@ -115,7 +115,7 @@ H5_DLL hbool_t H5FD_fphdf5_is_captain(H5FD_t *_file);
H5_DLL hbool_t H5FD_is_fphdf5_driver(H5FD_t *_file);
H5_DLL herr_t H5FD_fphdf5_write_real(H5FD_t *_file, hid_t dxpl_id,
- MPI_Offset mpi_off, int size,
+ haddr_t addr, int size,
const void *buf);
#ifdef __cplusplus
diff --git a/src/H5FPclient.c b/src/H5FPclient.c
index 7dcca9e..8468a47 100644
--- a/src/H5FPclient.c
+++ b/src/H5FPclient.c
@@ -510,7 +510,7 @@ H5FP_request_flush_metadata(H5FD_t *file, unsigned file_id, hid_t dxpl_id,
HDmemset(&req, 0, sizeof(req));
- if ((mrc = MPI_Comm_rank(H5FP_SAP_COMM, &req.proc_rank)) != MPI_SUCCESS)
+ if ((mrc = MPI_Comm_rank(H5FP_SAP_COMM, (int *)&req.proc_rank)) != MPI_SUCCESS)
HMPI_GOTO_ERROR(FAIL, "MPI_Comm_rank failed", mrc);
req.req_type = H5FP_REQ_FLUSH;
diff --git a/src/H5FPserver.c b/src/H5FPserver.c
index 4a3ac78..39258f0 100644
--- a/src/H5FPserver.c
+++ b/src/H5FPserver.c
@@ -1140,7 +1140,7 @@ H5FP_sap_handle_release_lock_request(H5FP_request_t *req)
} *oids;
unsigned list_size = 2; /* the size of the "oids" list */
H5FP_status_t exit_state = H5FP_STATUS_LOCK_RELEASED;
- herr_t ret_value;
+ herr_t ret_value = SUCCEED;
unsigned i, j;
FUNC_ENTER_NOINIT(H5FP_sap_handle_release_lock_request);
diff --git a/src/H5G.c b/src/H5G.c
index 4c79db8..7d15dee 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -102,8 +102,6 @@
#include "H5MMprivate.h" /* Memory management */
#include "H5Oprivate.h" /* Object headers */
-#include "H5FPprivate.h" /*FPHDF5 */
-
/* Local macros */
#define H5G_INIT_HEAP 8192
#define H5G_RESERVED_ATOMS 0
@@ -1560,7 +1558,7 @@ H5G_traverse_slink (H5G_entry_t *grp_ent/*in,out*/,
char *linkval = NULL; /*the copied link value */
H5G_entry_t tmp_grp_ent; /* Temporary copy of group entry */
H5RS_str_t *tmp_user_path_r=NULL, *tmp_canon_path_r=NULL; /* Temporary pointer to object's user path & canonical path */
- H5HL_t *heap;
+ const H5HL_t *heap;
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5G_traverse_slink, FAIL);
@@ -2517,7 +2515,7 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link,
*/
if (statbuf) {
if (H5G_CACHED_SLINK==obj_ent.type) {
- H5HL_t *heap;
+ const H5HL_t *heap;
/* Named object is a symbolic link */
if (NULL == H5O_read(&grp_ent, H5O_STAB_ID, 0, &stab_mesg, dxpl_id))
@@ -2743,7 +2741,7 @@ H5G_linkval (H5G_entry_t *loc, const char *name, size_t size, char *buf/*out*/,
const char *s = NULL;
H5G_entry_t grp_ent, obj_ent;
H5O_stab_t stab_mesg;
- H5HL_t *heap;
+ const H5HL_t *heap;
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5G_linkval, FAIL);
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index 044bcd3..928de64 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -61,6 +61,10 @@ typedef struct H5G_node_key_t {
#define PABLO_MASK H5G_node_mask
+/* PRIVATE PROTOTYPES */
+static herr_t H5G_node_serialize(H5F_t *f, H5G_node_t *sym, uint8_t *buf);
+static size_t H5G_node_size(H5F_t *f);
+
/* Metadata cache callbacks */
static H5G_node_t *H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_udata1,
void *_udata2);
@@ -70,8 +74,6 @@ static herr_t H5G_node_dest(H5F_t *f, H5G_node_t *sym);
static herr_t H5G_node_clear(H5F_t *f, H5G_node_t *sym, hbool_t destroy);
/* B-tree callbacks */
-static herr_t H5G_node_serialize(H5F_t *f, H5G_node_t *sym, uint8_t *buf);
-static size_t H5G_node_size(H5F_t *f);
static size_t H5G_node_sizeof_rkey(H5F_t *f, const void *_udata);
static herr_t H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t op, void *_lt_key,
void *_udata, void *_rt_key,
@@ -1187,7 +1189,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/,
/* "Normal" removal of a single entry from the symbol table node */
if(bt_udata->name!=NULL) {
- size_t len;
+ size_t len=0;
/* Get base address of heap */
if (NULL == (heap = H5HL_protect(f, dxpl_id, bt_udata->heap_addr)))
diff --git a/src/H5HL.c b/src/H5HL.c
index a015adb..b33b75f 100644
--- a/src/H5HL.c
+++ b/src/H5HL.c
@@ -839,14 +839,14 @@ H5HL_unprotect(H5F_t *f, hid_t dxpl_id, const H5HL_t *heap, haddr_t addr)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5HL_peek, FAIL);
+ FUNC_ENTER_NOAPI(H5HL_unprotect, FAIL);
/* check arguments */
assert(f);
assert(heap);
assert(H5F_addr_defined(addr));
- if (H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, FALSE) != SUCCEED)
+ if (H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, (void *)heap, FALSE) != SUCCEED)
HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header");
done: