summaryrefslogtreecommitdiffstats
path: root/src/H5Omtime.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-03-21 15:10:17 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-03-21 15:10:17 (GMT)
commiteb89d7b53ab95623ab454186a602e1cafc7391f0 (patch)
treeceafe458b3011e38853e765352d3c7e59bbecce1 /src/H5Omtime.c
parent3e468e6ff65d540a439e99ea568a6bff7add7cea (diff)
downloadhdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.zip
hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.tar.gz
hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.tar.bz2
[svn-r22105] Description:
Bring r20557:22085 from trunk to this branch, also fixing some other issues/failures in the branch simultaneously. The h5repack tests are still failing, but Neil will be checking into those, so the branch can be fully functional again. Tested on: Mac OSX/64 10.7.3 (amazon) w/debug
Diffstat (limited to 'src/H5Omtime.c')
-rw-r--r--src/H5Omtime.c88
1 files changed, 47 insertions, 41 deletions
diff --git a/src/H5Omtime.c b/src/H5Omtime.c
index 731d833..612d656 100644
--- a/src/H5Omtime.c
+++ b/src/H5Omtime.c
@@ -105,8 +105,11 @@ H5FL_DEFINE(time_t);
/*-------------------------------------------------------------------------
* Function: H5O_mtime_new_decode
*
- * Purpose: Decode a new modification time message and return a pointer to a
- * new time_t value.
+ * Purpose: Decode a new modification time message and return a pointer to
+ * a new time_t value.
+ *
+ * The new modification time message format was added due to the
+ * performance overhead of the old format.
*
* Return: Success: Ptr to new message in native struct.
*
@@ -126,11 +129,11 @@ H5O_mtime_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_o
uint32_t tmp_time; /* Temporary copy of the time */
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5O_mtime_new_decode);
+ FUNC_ENTER_NOAPI_NOINIT
/* check args */
- assert(f);
- assert(p);
+ HDassert(f);
+ HDassert(p);
/* decode */
if(*p++ != H5O_MTIME_VERSION)
@@ -151,15 +154,18 @@ H5O_mtime_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_o
ret_value=mesg;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_mtime_new_decode() */
/*-------------------------------------------------------------------------
* Function: H5O_mtime_decode
*
- * Purpose: Decode a modification time message and return a pointer to a
- * new time_t value.
+ * Purpose: Decode a modification time message and return a pointer to a
+ * new time_t value.
+ *
+ * The new modification time message format was added due to the
+ * performance overhead of the old format.
*
* Return: Success: Ptr to new message in native struct.
*
@@ -180,7 +186,7 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
struct tm tm;
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5O_mtime_decode)
+ FUNC_ENTER_NOAPI_NOINIT
/* check args */
HDassert(f);
@@ -287,12 +293,12 @@ H5O_mtime_new_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p,
{
const time_t *mesg = (const time_t *) _mesg;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_new_encode);
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
/* check args */
- assert(f);
- assert(p);
- assert(mesg);
+ HDassert(f);
+ HDassert(p);
+ HDassert(mesg);
/* Version */
*p++ = H5O_MTIME_VERSION;
@@ -305,7 +311,7 @@ H5O_mtime_new_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p,
/* Encode time */
UINT32ENCODE(p, *mesg);
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O_mtime_new_encode() */
@@ -330,12 +336,12 @@ H5O_mtime_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, con
const time_t *mesg = (const time_t *) _mesg;
struct tm *tm;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_encode);
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
/* check args */
- assert(f);
- assert(p);
- assert(mesg);
+ HDassert(f);
+ HDassert(p);
+ HDassert(mesg);
/* encode */
tm = HDgmtime(mesg);
@@ -343,7 +349,7 @@ H5O_mtime_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, con
1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
}
@@ -372,10 +378,10 @@ H5O_mtime_copy(const void *_mesg, void *_dest)
time_t *dest = (time_t *) _dest;
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5O_mtime_copy);
+ FUNC_ENTER_NOAPI_NOINIT
/* check args */
- assert(mesg);
+ HDassert(mesg);
if (!dest && NULL==(dest = H5FL_MALLOC(time_t)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
@@ -386,7 +392,7 @@ H5O_mtime_copy(const void *_mesg, void *_dest)
ret_value=dest;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -413,13 +419,13 @@ done:
static size_t
H5O_mtime_new_size(const H5F_t UNUSED * f, hbool_t UNUSED disable_shared, const void UNUSED * mesg)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_new_size);
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
/* check args */
- assert(f);
- assert(mesg);
+ HDassert(f);
+ HDassert(mesg);
- FUNC_LEAVE_NOAPI(8);
+ FUNC_LEAVE_NOAPI(8)
} /* end H5O_mtime_new_size() */
@@ -446,13 +452,13 @@ H5O_mtime_new_size(const H5F_t UNUSED * f, hbool_t UNUSED disable_shared, const
static size_t
H5O_mtime_size(const H5F_t UNUSED * f, hbool_t UNUSED disable_shared, const void UNUSED * mesg)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_size);
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
/* check args */
- assert(f);
- assert(mesg);
+ HDassert(f);
+ HDassert(mesg);
- FUNC_LEAVE_NOAPI(16);
+ FUNC_LEAVE_NOAPI(16)
}
@@ -474,9 +480,9 @@ H5O_mtime_size(const H5F_t UNUSED * f, hbool_t UNUSED disable_shared, const void
static herr_t
H5O_mtime_reset(void UNUSED *_mesg)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_reset);
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
}
@@ -497,7 +503,7 @@ H5O_mtime_reset(void UNUSED *_mesg)
static herr_t
H5O_mtime_free(void *mesg)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_free)
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
HDassert(mesg);
@@ -530,22 +536,22 @@ H5O_mtime_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *
struct tm *tm;
char buf[128];
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_debug);
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
/* 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);
/* debug */
tm = HDlocaltime(mesg);
HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm);
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Time:", buf);
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
}