summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2000-10-19 16:42:33 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2000-10-19 16:42:33 (GMT)
commit95445613ca4282b2e62fb98b832e755f79d3a968 (patch)
treeeee37d5f144c7f9b0a23fecbf38fbe63b640f507 /src
parente5c61707549a9d193075db17f01557743b8a8407 (diff)
downloadhdf5-95445613ca4282b2e62fb98b832e755f79d3a968.zip
hdf5-95445613ca4282b2e62fb98b832e755f79d3a968.tar.gz
hdf5-95445613ca4282b2e62fb98b832e755f79d3a968.tar.bz2
[svn-r2699] Purpose:
Bug fix Description: "Time" datatypes (H5T_UNIX_D*) were not being stored and retrieved in the datatype object header message correctly. Solution: Store endian-ness and precision in the datatype object header message and added test to continue to track them working correctly. This fixes bug #512. Platforms tested: FreeBSD 4.1.1 (hawkwind)
Diffstat (limited to 'src')
-rw-r--r--src/H5Odtype.c23
-rw-r--r--src/H5T.c2
2 files changed, 24 insertions, 1 deletions
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index ad7faa0..b4ff181 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -322,6 +322,11 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt)
"invalid VL location");
break;
+ case H5T_TIME: /* Time datatypes */
+ dt->u.atomic.order = (flags & 0x1) ? H5T_ORDER_BE : H5T_ORDER_LE;
+ UINT16DECODE(*pp, dt->u.atomic.prec);
+ break;
+
default:
if (flags) {
HRETURN_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL,
@@ -656,6 +661,20 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt)
}
break;
+ case H5T_TIME: /* Time datatypes... */
+ switch (dt->u.atomic.order) {
+ case H5T_ORDER_LE:
+ break; /*nothing */
+ case H5T_ORDER_BE:
+ flags |= 0x01;
+ break;
+ default:
+ HRETURN_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL,
+ "byte order is not supported in file format yet");
+ }
+ UINT16ENCODE(*pp, dt->u.atomic.prec);
+ break;
+
default:
/*nothing */
break;
@@ -859,6 +878,10 @@ H5O_dtype_size(H5F_t *f, const void *mesg)
ret_value += H5O_dtype_size(f, dt->parent);
break;
+ case H5T_TIME:
+ ret_value += 2;
+ break;
+
default:
/*no properties */
break;
diff --git a/src/H5T.c b/src/H5T.c
index d823c9e..1562666 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -6426,7 +6426,7 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2)
break;
- case H5T_TIME:
+ case H5T_TIME: /* order and precision are checked above */
/*void */
break;