From 4bb0d2d2997063e233095f9303c47b3a6fbebf36 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 26 Aug 2003 15:15:47 -0500 Subject: [svn-r7415] Purpose: Code cleanup Description: Clean up some of the code for writing out dataspace and datatype information. Platforms tested: FreeBSD 4.8 (sleipnir) too small to need h5committest --- src/H5Odtype.c | 7 ++++--- src/H5Osdspace.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 98f2bc0..1e70ff9 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -649,9 +649,9 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) *(*pp)++ = 0; /* Reserved */ - *(*pp)++ = '\0'; - *(*pp)++ = '\0'; - *(*pp)++ = '\0'; + *(*pp)++ = 0; + *(*pp)++ = 0; + *(*pp)++ = 0; /* Dimension permutation */ UINT32ENCODE(*pp, 0); @@ -767,6 +767,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) break; } + /* Encode the type's class, version and bit field */ *hdr++ = ((unsigned)(dt->type) & 0x0f) | (((dt->type==H5T_COMPOUND && dt->u.compnd.has_array) ? H5O_DTYPE_VERSION_UPDATED : H5O_DTYPE_VERSION_COMPAT )<<4); *hdr++ = (flags >> 0) & 0xff; *hdr++ = (flags >> 8) & 0xff; diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index e2f7aa1..69e3de7 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -133,7 +133,7 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_shared_ if (NULL==(sdim->perm=H5FL_ARR_MALLOC(hsize_t,sdim->rank))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); for (u = 0; u < sdim->rank; u++) - UINT32DECODE(p, sdim->perm[u]); + H5F_DECODE_LENGTH (f, p, sdim->perm[u]); } #endif /* LATER */ } @@ -220,7 +220,7 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *mesg) #ifdef LATER if (flags & H5S_VALID_PERM) { for (u = 0; u < sdim->rank; u++) - UINT32ENCODE(p, sdim->perm[u]); + H5F_ENCODE_LENGTH (f, p, sdim->perm[u]); } #endif } -- cgit v0.12