diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-07-20 17:58:37 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-07-20 17:58:37 (GMT) |
commit | 34595bac3b5f0b2dad3050907c07e023a6972097 (patch) | |
tree | 34ce0884c518396dd75dfc88faf15084ee18aa05 /src/H5Odtype.c | |
parent | 1dbacc8377754e33e8088ad6c7895a5f68bf7dfb (diff) | |
download | hdf5-34595bac3b5f0b2dad3050907c07e023a6972097.zip hdf5-34595bac3b5f0b2dad3050907c07e023a6972097.tar.gz hdf5-34595bac3b5f0b2dad3050907c07e023a6972097.tar.bz2 |
[svn-r518] Changes since 19980720
----------------------
./doc/html/H5.format.html
./src/H5Oattr.c
./src/H5Odtype.c
./src/H5Oefl.c
./src/H5Olayout.c
./src/H5Osdspace.c
./src/H5Oshared.c
Added version numbers to some object header messages so we can
update them easier in the future. The library currently just
gives up if the version numbers don't match, but in the future
the library could handle multiple versions of a message.
./test/testhdf5.c
Removed an argument from the H5version() call that I missed
last time.
Diffstat (limited to 'src/H5Odtype.c')
-rw-r--r-- | src/H5Odtype.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/H5Odtype.c b/src/H5Odtype.c index c890a03..8e44223 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -55,6 +55,8 @@ const H5O_class_t H5O_DTYPE[1] = {{ H5O_dtype_debug, /* debug the message */ }}; +#define H5O_DTYPE_VERSION 1 + /* Interface initialization */ static hbool_t interface_initialize_g = FALSE; #define INTERFACE_INIT NULL @@ -78,7 +80,7 @@ static hbool_t interface_initialize_g = FALSE; static herr_t H5O_dtype_decode_helper(const uint8 **pp, H5T_t *dt) { - uintn flags, perm_word; + uintn flags, perm_word, version; intn i, j; FUNC_ENTER(H5O_dtype_decode_helper, FAIL); @@ -89,7 +91,12 @@ H5O_dtype_decode_helper(const uint8 **pp, H5T_t *dt) /* decode */ UINT32DECODE(*pp, flags); - dt->type = (H5T_class_t)(flags & 0xff); + version = (flags>>4) & 0x0f; + if (version!=H5O_DTYPE_VERSION) { + HRETURN_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, + "bad version number for data type message"); + } + dt->type = (H5T_class_t)(flags & 0x0f); flags >>= 8; UINT32DECODE(*pp, dt->size); @@ -455,7 +462,7 @@ H5O_dtype_encode_helper(uint8 **pp, const H5T_t *dt) break; } - *hdr++ = dt->type; + *hdr++ = ((uintn)(dt->type) & 0x0f) | (H5O_DTYPE_VERSION<<4); *hdr++ = (flags >> 0) & 0xff; *hdr++ = (flags >> 8) & 0xff; *hdr++ = (flags >> 16) & 0xff; |