summaryrefslogtreecommitdiffstats
path: root/src/H5O.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-07-26 19:33:59 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-07-26 19:33:59 (GMT)
commit7143164de9d7de52516697bbb6bfc7cd2cf749d6 (patch)
tree107977d9f4732e672d5690072a2e85d82e1ebf28 /src/H5O.c
parent74e00605264ffb2b782b4f28be15accc7784217c (diff)
downloadhdf5-7143164de9d7de52516697bbb6bfc7cd2cf749d6.zip
hdf5-7143164de9d7de52516697bbb6bfc7cd2cf749d6.tar.gz
hdf5-7143164de9d7de52516697bbb6bfc7cd2cf749d6.tar.bz2
[svn-r22608] Description:
Switch propert list/class iteration from internal to external form of iteration, cleaning up and simplifying the code a bit. Bring other general improvements from plist_encode_decode branch back to trunk. Clean up many warnings. Tested on: Mac OSX/64 10.7.4 (amazon) w/gcc 4.7, debug and C++ & FORTRAN (too minor to require h5committest)
Diffstat (limited to 'src/H5O.c')
-rw-r--r--src/H5O.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/H5O.c b/src/H5O.c
index 5050941..a896ee0 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -1717,7 +1717,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot)
while(curr_msg < cont_msg_info.nmsgs) {
H5O_chunk_proxy_t *chk_proxy; /* Proxy for chunk, to bring it into memory */
#ifndef NDEBUG
- unsigned chkcnt = oh->nchunks; /* Count of chunks (for sanity checking) */
+ size_t chkcnt = oh->nchunks; /* Count of chunks (for sanity checking) */
#endif /* NDEBUG */
/* Bring the chunk into the cache */
@@ -2007,15 +2007,15 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force)
/* Check version, to determine how to store time information */
if(oh->version == H5O_VERSION_1) {
- int idx; /* Index of modification time message to update */
+ size_t idx; /* Index of modification time message to update */
/* Look for existing message */
- for(idx = 0; idx < (int)oh->nmesgs; idx++)
+ for(idx = 0; idx < oh->nmesgs; idx++)
if(H5O_MSG_MTIME == oh->mesg[idx].type || H5O_MSG_MTIME_NEW == oh->mesg[idx].type)
break;
/* Create a new message, if necessary */
- if(idx == (int)oh->nmesgs) {
+ if(idx == oh->nmesgs) {
unsigned mesg_flags = 0; /* Flags for message in object header */
/* If we would have to create a new message, but we aren't 'forcing' it, get out now */
@@ -2023,7 +2023,7 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force)
HGOTO_DONE(SUCCEED); /*nothing to do*/
/* Allocate space for the modification time message */
- if((idx = H5O_msg_alloc(f, dxpl_id, oh, H5O_MSG_MTIME_NEW, &mesg_flags, &now)) < 0)
+ if(H5O_msg_alloc(f, dxpl_id, oh, H5O_MSG_MTIME_NEW, &mesg_flags, &now, &idx) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for modification time message")
/* Set the message's flags if appropriate */
@@ -2130,7 +2130,7 @@ done:
herr_t
H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned mesg_flags)
{
- int idx; /* Local index variable */
+ size_t idx; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -2139,7 +2139,7 @@ H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned mesg_flags)
HDassert(oh);
/* Look for existing message */
- for(idx = 0; idx < (int)oh->nmesgs; idx++)
+ for(idx = 0; idx < oh->nmesgs; idx++)
if(H5O_MSG_BOGUS == oh->mesg[idx].type)
break;
@@ -2155,7 +2155,7 @@ H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned mesg_flags)
bogus->u = H5O_BOGUS_VALUE;
/* Allocate space in the object header for bogus message */
- if((idx = H5O_msg_alloc(f, dxpl_id, oh, H5O_MSG_BOGUS, &mesg_flags, bogus)) < 0)
+ if(H5O_msg_alloc(f, dxpl_id, oh, H5O_MSG_BOGUS, &mesg_flags, bogus, &idx) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for 'bogus' message")
/* Point to "bogus" information (take it over) */
@@ -2715,8 +2715,8 @@ H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr)
hdr->version = oh->version;
/* Set the number of messages & chunks */
- hdr->nmesgs = oh->nmesgs;
- hdr->nchunks = oh->nchunks;
+ H5_ASSIGN_OVERFLOW(hdr->nmesgs, oh->nmesgs, size_t, unsigned);
+ H5_ASSIGN_OVERFLOW(hdr->nchunks, oh->nchunks, size_t, unsigned);
/* Set the status flags */
hdr->flags = oh->flags;