summaryrefslogtreecommitdiffstats
path: root/src/H5O.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
commit427ff7da2848042f68ecfadf5a321b1d8077e9db (patch)
tree73024b1954031fbb724c2d96a485590348e5cc22 /src/H5O.c
parent9b96fd2003ae74cca389cc4c2216b4371d6eb173 (diff)
downloadhdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.zip
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.gz
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.bz2
[svn-r9727] Purpose:
Bug Fix/Code Cleanup/Doc Cleanup/Optimization/Branch Sync :-) Description: Generally speaking, this is the "signed->unsigned" change to selections. However, in the process of merging code back, things got stickier and stickier until I ended up doing a big "sync the two branches up" operation. So... I brought back all the "infrastructure" fixes from the development branch to the release branch (which I think were actually making some improvement in performance) as well as fixed several bugs which had been fixed in one branch, but not the other. I've also tagged the repository before making this checkin with the label "before_signed_unsigned_changes". Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel & fphdf5 FreeBSD 4.10 (sleipnir) w/threadsafe FreeBSD 4.10 (sleipnir) w/backward compatibility Solaris 2.7 (arabica) w/"purify options" Solaris 2.8 (sol) w/FORTRAN & C++ AIX 5.x (copper) w/parallel & FORTRAN IRIX64 6.5 (modi4) w/FORTRAN Linux 2.4 (heping) w/FORTRAN & C++ Misc. update:
Diffstat (limited to 'src/H5O.c')
-rw-r--r--src/H5O.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/H5O.c b/src/H5O.c
index 6c84e26..2dbd2fe 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -91,7 +91,7 @@ static H5O_t *H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_udata
static herr_t H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh);
static herr_t H5O_dest(H5F_t *f, H5O_t *oh);
static herr_t H5O_clear(H5F_t *f, H5O_t *oh, hbool_t destroy);
-static herr_t H5O_compute_size(H5F_t *f, H5O_t *oh, size_t *size_ptr);
+static herr_t H5O_compute_size(const H5F_t *f, const H5O_t *oh, size_t *size_ptr);
/* H5O inherits cache-like properties from H5AC */
static const H5AC_class_t H5AC_OHDR[1] = {{
@@ -833,7 +833,8 @@ H5O_dest(H5F_t UNUSED *f, H5O_t *oh)
oh->chunk[i].image = H5FL_BLK_FREE(chunk_image,oh->chunk[i].image);
}
- oh->chunk = H5FL_SEQ_FREE(H5O_chunk_t,oh->chunk);
+ if(oh->chunk)
+ oh->chunk = H5FL_SEQ_FREE(H5O_chunk_t,oh->chunk);
/* destroy messages */
for (i = 0; i < oh->nmesgs; i++) {
@@ -845,7 +846,8 @@ H5O_dest(H5F_t UNUSED *f, H5O_t *oh)
else
H5O_free_real(oh->mesg[i].type, oh->mesg[i].native);
}
- oh->mesg = H5FL_SEQ_FREE(H5O_mesg_t,oh->mesg);
+ if(oh->mesg)
+ oh->mesg = H5FL_SEQ_FREE(H5O_mesg_t,oh->mesg);
/* destroy object header */
H5FL_FREE(H5O_t,oh);
@@ -923,7 +925,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_compute_size(H5F_t *f, H5O_t *oh, size_t *size_ptr)
+H5O_compute_size(const H5F_t *f, const H5O_t *oh, size_t *size_ptr)
{
unsigned u;
size_t size;
@@ -938,9 +940,7 @@ H5O_compute_size(H5F_t *f, H5O_t *oh, size_t *size_ptr)
size = H5O_SIZEOF_HDR(f);
for (u = 0; u < oh->nchunks; u++)
- {
size += oh->chunk[u].size;
- }
HDassert(size >= H5O_SIZEOF_HDR(f));
@@ -3130,7 +3130,7 @@ done:
*-------------------------------------------------------------------------
*/
size_t
-H5O_raw_size(unsigned type_id, H5F_t *f, const void *mesg)
+H5O_raw_size(unsigned type_id, const H5F_t *f, const void *mesg)
{
const H5O_class_t *type; /* Actual H5O class type for the ID */
size_t ret_value; /* Return value */
@@ -3487,7 +3487,7 @@ done:
*-------------------------------------------------------------------------
*/
void*
-H5O_decode(H5F_t *f, unsigned char *buf, unsigned type_id)
+H5O_decode(H5F_t *f, const unsigned char *buf, unsigned type_id)
{
const H5O_class_t *type; /* Actual H5O class type for the ID */
void *ret_value=NULL; /* Return value */