diff options
author | James Laird <jlaird@hdfgroup.org> | 2007-01-05 18:30:59 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2007-01-05 18:30:59 (GMT) |
commit | 869ed6e043dfc20b6b6dfda6728c3442ef0409be (patch) | |
tree | 40f02a44e098e1976075d5a69428202fe16f493d /src/H5Omessage.c | |
parent | ec1b0dfda6ac7049f1eeb32fbb93ebd92ccfd342 (diff) | |
download | hdf5-869ed6e043dfc20b6b6dfda6728c3442ef0409be.zip hdf5-869ed6e043dfc20b6b6dfda6728c3442ef0409be.tar.gz hdf5-869ed6e043dfc20b6b6dfda6728c3442ef0409be.tar.bz2 |
[svn-r13113] Refactoring. Cleaned up code, added a few sanity checks.
Extracted duplicated code into functions.
Tested on Windows, juniper, and kagiso. Will test on copper next.
Diffstat (limited to 'src/H5Omessage.c')
-rw-r--r-- | src/H5Omessage.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 1dd0287..515e131 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -1537,6 +1537,7 @@ H5O_msg_get_share(unsigned type_id, const void *mesg, H5O_shared_t *share) /* Check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); + HDassert(type_id != H5O_SHARED_ID); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ HDassert(type); HDassert(type->get_share); @@ -1576,12 +1577,11 @@ H5O_msg_is_shared(unsigned type_id, const void *mesg) /* Check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); + HDassert(type_id != H5O_SHARED_ID); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ HDassert(type); HDassert(mesg); - HDassert(type_id != H5O_SHARED_ID); /* JAMES: check for this mistake elsewhere, too */ - /* If there is no is_shared function, then obviously it's not a shared message! */ if(!(type->is_shared)) ret_value = FALSE; @@ -1617,6 +1617,7 @@ H5O_msg_set_share(unsigned type_id, H5O_shared_t *share, void *mesg) /* Check args */ HDassert(share); HDassert(type_id < NELMTS(H5O_msg_class_g)); + HDassert(type_id != H5O_SHARED_ID); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ HDassert(type); HDassert(type->set_share); @@ -1659,6 +1660,7 @@ H5O_msg_reset_share(unsigned type_id, void *mesg) /* Check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); + HDassert(type_id != H5O_SHARED_ID); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ HDassert(type); HDassert(type->set_share); |