summaryrefslogtreecommitdiffstats
path: root/src/H5O.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-04-08 21:43:02 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-04-08 21:43:02 (GMT)
commitc01750fa740943c0083711b353278143c79d50a3 (patch)
treefd475b7c7a3639c05b30625b43547850d687b948 /src/H5O.c
parent68fa66bf8130d6a6e607e233da8cc61a154bf172 (diff)
downloadhdf5-c01750fa740943c0083711b353278143c79d50a3.zip
hdf5-c01750fa740943c0083711b353278143c79d50a3.tar.gz
hdf5-c01750fa740943c0083711b353278143c79d50a3.tar.bz2
[svn-r338] Changes since 19980407
---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
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");
}