diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-02-03 23:42:24 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-02-03 23:42:24 (GMT) |
commit | ba149f834f1cfa431e320ff6b7f985f71c8ca8c4 (patch) | |
tree | 70c64fc4f3b444e56b1593bbff3309c7dddeb9d8 /src/H5O.c | |
parent | 9ada07ef3a98f12fe04cedc331e5f6a4b570b57e (diff) | |
download | hdf5-ba149f834f1cfa431e320ff6b7f985f71c8ca8c4.zip hdf5-ba149f834f1cfa431e320ff6b7f985f71c8ca8c4.tar.gz hdf5-ba149f834f1cfa431e320ff6b7f985f71c8ca8c4.tar.bz2 |
[svn-r16414] Description:
Eliminate some more calls to H5E_clear_stack() from within library code.
Clean up some warnings & comments also.
Tested on:
Mac OS X/32 10.5.6 (amazon)
(Too minor to require h5committest)
Diffstat (limited to 'src/H5O.c')
-rw-r--r-- | src/H5O.c | 38 |
1 files changed, 26 insertions, 12 deletions
@@ -1652,11 +1652,11 @@ 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)) == UFAIL) + if(UFAIL == (idx = H5O_msg_alloc(f, dxpl_id, oh, H5O_MSG_MTIME_NEW, &mesg_flags, &now))) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for modification time message") /* Set the message's flags if appropriate */ - oh->mesg[idx].flags = mesg_flags; + oh->mesg[idx].flags = (uint8_t)mesg_flags; } /* end if */ /* Allocate 'native' space, if necessary */ @@ -1892,8 +1892,8 @@ done: * * Purpose: Retrieves the type of object pointed to by `loc'. * - * Return: Success: An object type defined in H5Gpublic.h - * Failure: H5G_UNKNOWN + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Robb Matzke * Wednesday, November 4, 1998 @@ -1929,8 +1929,8 @@ done: * * Purpose: Returns the type of object pointed to by `oh'. * - * Return: Success: An object type defined in H5Opublic.h - * Failure: H5G_UNKNOWN + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Monday, November 21, 2005 @@ -2311,6 +2311,8 @@ H5O_get_info(H5O_loc_t *oloc, hid_t dxpl_id, hbool_t want_ih_info, H5O_info_t *o oinfo->btime = oh->btime; } /* end if */ else { + htri_t exists; /* Flag if header message of interest exists */ + /* No information for access & modification fields */ /* (we stopped updating the "modification time" header message for * raw data changes, so the "modification time" header message @@ -2321,13 +2323,25 @@ H5O_get_info(H5O_loc_t *oloc, hid_t dxpl_id, hbool_t want_ih_info, H5O_info_t *o oinfo->btime = 0; /* Might be information for modification time */ - if(NULL == H5O_msg_read_oh(oloc->file, dxpl_id, oh, H5O_MTIME_ID, &oinfo->ctime)) { - H5E_clear_stack(NULL); - if(NULL == H5O_msg_read_oh(oloc->file, dxpl_id, oh, H5O_MTIME_NEW_ID, &oinfo->ctime)) { - H5E_clear_stack(NULL); - oinfo->ctime = 0; - } /* end if */ + if((exists = H5O_msg_exists_oh(oh, H5O_MTIME_ID)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for MTIME message") + if(exists > 0) { + /* Get "old style" modification time info */ + if(NULL == H5O_msg_read_oh(oloc->file, dxpl_id, oh, H5O_MTIME_ID, &oinfo->ctime)) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read MTIME message") } /* end if */ + else { + /* Check for "new style" modification time info */ + if((exists = H5O_msg_exists_oh(oh, H5O_MTIME_NEW_ID)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for MTIME_NEW message") + if(exists > 0) { + /* Get "new style" modification time info */ + if(NULL == H5O_msg_read_oh(oloc->file, dxpl_id, oh, H5O_MTIME_NEW_ID, &oinfo->ctime)) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read MTIME_NEW message") + } /* end if */ + else + oinfo->ctime = 0; + } /* end else */ } /* end else */ /* Set the version for the object header */ |