summaryrefslogtreecommitdiffstats
path: root/src/H5Oshared.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-07-20 13:45:25 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-07-20 13:45:25 (GMT)
commit365dac33e385affcb57a6b8a5cf53f8d03ac2510 (patch)
treedee1bd85c27ba9de2b2cbc2d958a2e4e2861ed9b /src/H5Oshared.c
parent79d65106abab53203ad5c6ceda033f65eb2d3099 (diff)
downloadhdf5-365dac33e385affcb57a6b8a5cf53f8d03ac2510.zip
hdf5-365dac33e385affcb57a6b8a5cf53f8d03ac2510.tar.gz
hdf5-365dac33e385affcb57a6b8a5cf53f8d03ac2510.tar.bz2
[svn-r515] Changes since 19980715
---------------------- ./doc/html/H5.format.html ./src/H5Gent.c ./src/H5Gprivate.h ./src/H5Oattr.c ./src/H5Oprivate.h ./src/H5Oshared.c ./src/H5HG.c ./src/H5HGprivate.h Added padding fields in symbol table entries, attribute messages, shared messages, and global heap objects to insure that things are aligned on 8-byte boundaries in the file, and thus in memory. Otherwise some little endian machines complain (DEC Alpha) during encoding/decoding of file meta data. I chose to add alignment to the file rather than rewriting the ENCODE/DECODE macros for the little endian case. Completely rewrote the section on attribute messages. More alignment stuff will follow. ./src/H5detect.c Fixed a typo `nd'->`dn' ./test/dtypes.c Commented out conversion tests to/from `long double' on machines where it's the same size as `double' to get rid of compiler warnings. ./doc/html/Big.html Fixed a couple typos.
Diffstat (limited to 'src/H5Oshared.c')
-rw-r--r--src/H5Oshared.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/H5Oshared.c b/src/H5Oshared.c
index b5c810b..f485143 100644
--- a/src/H5Oshared.c
+++ b/src/H5Oshared.c
@@ -64,6 +64,7 @@ static void *
H5O_shared_decode (H5F_t *f, const uint8 *buf, H5O_shared_t __unused__ *sh)
{
H5O_shared_t *mesg;
+ uintn flags;
FUNC_ENTER (H5O_shared_decode, NULL);
@@ -77,7 +78,11 @@ H5O_shared_decode (H5F_t *f, const uint8 *buf, H5O_shared_t __unused__ *sh)
HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL,
"memory allocation failed");
}
- UINT32DECODE (buf, mesg->in_gh);
+
+ flags = *buf++;
+ mesg->in_gh = (flags & 0x01);
+ buf += 7; /*reserved*/
+
if (mesg->in_gh) {
H5F_addr_decode (f, &buf, &(mesg->u.gh.addr));
INT32DECODE (buf, mesg->u.gh.idx);
@@ -109,6 +114,7 @@ static herr_t
H5O_shared_encode (H5F_t *f, uint8 *buf/*out*/, const void *_mesg)
{
const H5O_shared_t *mesg = (const H5O_shared_t *)_mesg;
+ uintn flags;
FUNC_ENTER (H5O_shared_encode, FAIL);
@@ -118,7 +124,16 @@ H5O_shared_encode (H5F_t *f, uint8 *buf/*out*/, const void *_mesg)
assert (mesg);
/* Encode */
- INT32ENCODE (buf, mesg->in_gh);
+ flags = mesg->in_gh ? 0x01 : 0x00;
+ *buf++ = flags;
+ *buf++ = 0; /*reserved 1*/
+ *buf++ = 0; /*reserved 2*/
+ *buf++ = 0; /*reserved 3*/
+ *buf++ = 0; /*reserved 4*/
+ *buf++ = 0; /*reserved 5*/
+ *buf++ = 0; /*reserved 6*/
+ *buf++ = 0; /*reserved 7*/
+
if (mesg->in_gh) {
H5F_addr_encode (f, &buf, &(mesg->u.gh.addr));
INT32ENCODE (buf, mesg->u.gh.idx);
@@ -153,7 +168,8 @@ H5O_shared_size (H5F_t *f, const void __unused__ *_mesg)
FUNC_ENTER (H5O_shared_size, 0);
- size = 4 + /*the flags field */
+ size = 1 + /*the flags field */
+ 7 + /*reserved */
MAX (H5F_SIZEOF_ADDR(f)+4, /*sharing via global heap */
H5G_SIZEOF_ENTRY(f)); /*sharing by another obj hdr */