summaryrefslogtreecommitdiffstats
path: root/src/H5O.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5O.c')
-rw-r--r--src/H5O.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/H5O.c b/src/H5O.c
index 7049288..b601809 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -149,7 +149,7 @@ H5O_create(H5F_t *f, size_t size_hint, H5G_entry_t *ent/*out*/)
/* allocate disk space for header and first chunk */
size = H5O_SIZEOF_HDR(f) + size_hint;
ent->file = f;
- if (H5MF_alloc(f, H5MF_META, size, &(ent->header)/*out*/) < 0) {
+ if (H5MF_alloc(f, H5MF_META, (hsize_t)size, &(ent->header)/*out*/) < 0) {
HRETURN_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
"unable to allocate file space for object header hdr");
}
@@ -166,7 +166,7 @@ H5O_create(H5F_t *f, size_t size_hint, H5G_entry_t *ent/*out*/)
oh->chunk = H5MM_xmalloc(oh->alloc_nchunks * sizeof(H5O_chunk_t));
tmp_addr = ent->header;
- H5F_addr_inc(&tmp_addr, H5O_SIZEOF_HDR(f));
+ H5F_addr_inc(&tmp_addr, (hsize_t)H5O_SIZEOF_HDR(f));
oh->chunk[0].dirty = TRUE;
oh->chunk[0].addr = tmp_addr;
oh->chunk[0].size = size_hint;
@@ -308,7 +308,8 @@ H5O_close(H5G_entry_t *obj_ent)
*-------------------------------------------------------------------------
*/
static H5O_t *
-H5O_load(H5F_t *f, const haddr_t *addr, const void *_udata1, void *_udata2)
+H5O_load(H5F_t *f, const haddr_t *addr, const void __unused__ *_udata1,
+ void __unused__ *_udata2)
{
H5O_t *oh = NULL;
H5O_t *ret_value = NULL;
@@ -334,7 +335,7 @@ H5O_load(H5F_t *f, const haddr_t *addr, const void *_udata1, void *_udata2)
/* read fixed-lenth part of object header */
hdr_size = H5O_SIZEOF_HDR(f);
- if (H5F_block_read(f, addr, hdr_size, buf) < 0) {
+ if (H5F_block_read(f, addr, (hsize_t)hdr_size, buf) < 0) {
HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL,
"unable to read object header");
}
@@ -358,7 +359,7 @@ H5O_load(H5F_t *f, const haddr_t *addr, const void *_udata1, void *_udata2)
/* decode first chunk info */
chunk_addr = *addr;
- H5F_addr_inc(&chunk_addr, H5O_SIZEOF_HDR(f));
+ H5F_addr_inc(&chunk_addr, (hsize_t)H5O_SIZEOF_HDR(f));
UINT32DECODE(p, chunk_size);
/* build the message array */
@@ -381,7 +382,7 @@ H5O_load(H5F_t *f, const haddr_t *addr, const void *_udata1, void *_udata2)
oh->chunk[chunkno].addr = chunk_addr;
oh->chunk[chunkno].size = chunk_size;
oh->chunk[chunkno].image = H5MM_xmalloc(chunk_size);
- if (H5F_block_read(f, &chunk_addr, chunk_size,
+ if (H5F_block_read(f, &chunk_addr, (hsize_t)chunk_size,
oh->chunk[chunkno].image) < 0) {
HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL,
"unable to read object header data");
@@ -520,7 +521,7 @@ H5O_flush(H5F_t *f, hbool_t destroy, const haddr_t *addr, H5O_t *oh)
HDmemset (p, 0, H5O_SIZEOF_HDR(f)-12);
/* write the object header header */
- if (H5F_block_write(f, addr, H5O_SIZEOF_HDR(f), buf) < 0) {
+ if (H5F_block_write(f, addr, (hsize_t)H5O_SIZEOF_HDR(f), buf) < 0) {
HRETURN_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL,
"unable to write object header hdr to disk");
}
@@ -550,7 +551,7 @@ H5O_flush(H5F_t *f, hbool_t destroy, const haddr_t *addr, H5O_t *oh)
assert(cont->chunkno < oh->nchunks);
assert(!H5F_addr_defined(&(oh->chunk[cont->chunkno].addr)));
cont->size = oh->chunk[cont->chunkno].size;
- if (H5MF_alloc(f, H5MF_META, cont->size,
+ if (H5MF_alloc(f, H5MF_META, (hsize_t)(cont->size),
&(cont->addr)/*out*/) < 0) {
HRETURN_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
"unable to allocate space for object "
@@ -590,7 +591,8 @@ H5O_flush(H5F_t *f, hbool_t destroy, const haddr_t *addr, H5O_t *oh)
for (i = 0; i < oh->nchunks; i++) {
if (oh->chunk[i].dirty) {
assert(H5F_addr_defined(&(oh->chunk[i].addr)));
- if (H5F_block_write(f, &(oh->chunk[i].addr), oh->chunk[i].size,
+ if (H5F_block_write(f, &(oh->chunk[i].addr),
+ (hsize_t)(oh->chunk[i].size),
oh->chunk[i].image) < 0) {
HRETURN_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL,
"unable to write object header data to disk");
@@ -1697,7 +1699,7 @@ H5O_debug(H5F_t *f, const haddr_t *addr, FILE * stream, intn indent,
fprintf(stream, "\n");
tmp_addr = *addr;
- H5F_addr_inc(&tmp_addr, H5O_SIZEOF_HDR(f));
+ H5F_addr_inc(&tmp_addr, (hsize_t)H5O_SIZEOF_HDR(f));
if (0 == i && H5F_addr_ne(&(oh->chunk[i].addr), &tmp_addr)) {
fprintf(stream, "*** WRONG ADDRESS!\n");
}