summaryrefslogtreecommitdiffstats
path: root/src/H5Obogus.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-05-01 21:00:52 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-05-01 21:00:52 (GMT)
commit2757f75317a07422c9a1d0378f969c3eb802c3a0 (patch)
tree6374d38220529efef51cbeead15f906e1782ebbd /src/H5Obogus.c
parent4e243fd5e741fbdeaf92a484d52dbae4b0008268 (diff)
downloadhdf5-2757f75317a07422c9a1d0378f969c3eb802c3a0.zip
hdf5-2757f75317a07422c9a1d0378f969c3eb802c3a0.tar.gz
hdf5-2757f75317a07422c9a1d0378f969c3eb802c3a0.tar.bz2
[svn-r13721] Description:
Add "fail if unknown" and "mark if unknown" flags to object header messages. This gives the library a clean way to tell older libraries that a message should not be just ignored if it's unknown, but that other actions should occur. Tested on: Mac OS X/32 10.4.9 (amazon) FreeBSD/32 6.2 (duty) FreeBSD/64 6.2 (liberty) Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5Obogus.c')
-rw-r--r--src/H5Obogus.c58
1 files changed, 27 insertions, 31 deletions
diff --git a/src/H5Obogus.c b/src/H5Obogus.c
index 488758b..4def755 100644
--- a/src/H5Obogus.c
+++ b/src/H5Obogus.c
@@ -86,37 +86,37 @@ const H5O_msg_class_t H5O_MSG_BOGUS[1] = {{
*-------------------------------------------------------------------------
*/
static void *
-H5O_bogus_decode(H5F_t UNUSED *f, hid_t dxpl_id, unsigned UNUSED mesg_flags,
+H5O_bogus_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags,
const uint8_t *p)
{
H5O_bogus_t *mesg = NULL;
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5O_bogus_decode);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_bogus_decode)
/* check args */
- assert(f);
- assert(p);
+ HDassert(f);
+ HDassert(p);
/* Allocate the bogus message */
- if (NULL==(mesg = H5MM_calloc(sizeof(H5O_bogus_t))))
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
+ if(NULL == (mesg = H5MM_calloc(sizeof(H5O_bogus_t))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* decode */
UINT32DECODE(p, mesg->u);
/* Validate the bogus info */
- if(mesg->u!=H5O_BOGUS_VALUE)
- HGOTO_ERROR (H5E_OHDR, H5E_BADVALUE, NULL, "invalid bogus value :-)");
+ if(mesg->u != H5O_BOGUS_VALUE)
+ HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "invalid bogus value :-)")
/* Set return value */
- ret_value=mesg;
+ ret_value = mesg;
done:
- if(ret_value==NULL && mesg!=NULL)
+ if(ret_value == NULL && mesg != NULL)
H5MM_xfree(mesg);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_bogus_decode() */
@@ -136,17 +136,17 @@ done:
static herr_t
H5O_bogus_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, const void UNUSED *mesg)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_bogus_encode);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_bogus_encode)
/* check args */
- assert(f);
- assert(p);
- assert(mesg);
+ HDassert(f);
+ HDassert(p);
+ HDassert(mesg);
/* encode */
UINT32ENCODE(p, H5O_BOGUS_VALUE);
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O_bogus_encode() */
@@ -171,12 +171,9 @@ H5O_bogus_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, con
static size_t
H5O_bogus_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void UNUSED *mesg)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_bogus_size);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_bogus_size)
- /* check args */
- assert(f);
-
- FUNC_LEAVE_NOAPI(4);
+ FUNC_LEAVE_NOAPI(4)
} /* end H5O_bogus_size() */
@@ -201,20 +198,19 @@ H5O_bogus_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *
{
const H5O_bogus_t *mesg = (const H5O_bogus_t *)_mesg;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_name_debug);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_bogus_debug)
/* check args */
- assert(f);
- assert(mesg);
- assert(stream);
- assert(indent >= 0);
- assert(fwidth >= 0);
+ HDassert(f);
+ HDassert(mesg);
+ HDassert(stream);
+ HDassert(indent >= 0);
+ HDassert(fwidth >= 0);
- fprintf(stream, "%*s%-*s `%u'\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s `%u'\n", indent, "", fwidth,
"Bogus Value:", mesg->u);
- FUNC_LEAVE_NOAPI(SUCCEED);
-}
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5O_bogus_debug() */
#endif /* H5O_ENABLE_BOGUS */
-