diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-07-20 13:45:25 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-07-20 13:45:25 (GMT) |
commit | 365dac33e385affcb57a6b8a5cf53f8d03ac2510 (patch) | |
tree | dee1bd85c27ba9de2b2cbc2d958a2e4e2861ed9b /src | |
parent | 79d65106abab53203ad5c6ceda033f65eb2d3099 (diff) | |
download | hdf5-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')
-rw-r--r-- | src/H5Gent.c | 5 | ||||
-rw-r--r-- | src/H5Gprivate.h | 3 | ||||
-rw-r--r-- | src/H5HG.c | 28 | ||||
-rw-r--r-- | src/H5HGprivate.h | 15 | ||||
-rw-r--r-- | src/H5Oattr.c | 334 | ||||
-rw-r--r-- | src/H5Oprivate.h | 2 | ||||
-rw-r--r-- | src/H5Oshared.c | 22 | ||||
-rw-r--r-- | src/H5detect.c | 2 |
8 files changed, 145 insertions, 266 deletions
diff --git a/src/H5Gent.c b/src/H5Gent.c index 93fb1d7..1c0e981 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -142,6 +142,8 @@ H5G_ent_decode_vec(H5F_t *f, const uint8 **pp, H5G_entry_t *ent, intn n) * Jul 18 1997 * * Modifications: + * Robb Matzke, 17 Jul 1998 + * Added a 4-byte padding field for alignment and future expansion. * *------------------------------------------------------------------------- */ @@ -164,6 +166,7 @@ H5G_ent_decode(H5F_t *f, const uint8 **pp, H5G_entry_t *ent) H5F_decode_length(f, *pp, ent->name_off); H5F_addr_decode(f, pp, &(ent->header)); UINT32DECODE(*pp, tmp); + *pp += 4; /*reserved*/ ent->type=(H5G_type_t)tmp; /* decode scratch-pad */ @@ -275,6 +278,7 @@ H5G_ent_encode(H5F_t *f, uint8 **pp, const H5G_entry_t *ent) H5F_encode_length(f, *pp, ent->name_off); H5F_addr_encode(f, pp, &(ent->header)); UINT32ENCODE(*pp, ent->type); + UINT32ENCODE(*pp, 0); /*reserved*/ /* encode scratch-pad */ switch (ent->type) { @@ -300,6 +304,7 @@ H5G_ent_encode(H5F_t *f, uint8 **pp, const H5G_entry_t *ent) H5F_addr_undef(&undef); H5F_addr_encode(f, pp, &undef); UINT32ENCODE(*pp, H5G_NOTHING_CACHED); + UINT32ENCODE(*pp, 0); /*reserved*/ } /* fill with zero */ diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index ae3064a..03f0348 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -43,7 +43,8 @@ (H5F_SIZEOF_SIZE(F) + /*offset of name into heap */ \ H5F_SIZEOF_ADDR(F) + /*address of object header */ \ 4 + /*entry type */ \ - H5G_SIZEOF_SCRATCH) /*scratch pad space */ + 4 + /*reserved */ \ + H5G_SIZEOF_SCRATCH) /*scratch pad space */ /* * Various types of object header information can be cached in a symbol @@ -102,6 +102,7 @@ H5HG_create (H5F_t *f, size_t size) /* Check args */ assert (f); if (size<H5HG_MINSIZE) size = H5HG_MINSIZE; + size = H5HG_ALIGN(size); /* Create it */ if (H5MF_alloc (f, H5MF_META, (hsize_t)size, &addr/*out*/)<0) { @@ -137,8 +138,9 @@ H5HG_create (H5F_t *f, size_t size) /* The freespace object */ heap->obj[0].size = size - H5HG_SIZEOF_HDR (f); heap->obj[0].begin = p; - UINT16ENCODE (p, 0); /*object ID*/ - UINT16ENCODE (p, 0); /*reference count*/ + UINT16ENCODE(p, 0); /*object ID*/ + UINT16ENCODE(p, 0); /*reference count*/ + UINT32ENCODE(p, 0); /*reserved*/ H5F_encode_length (f, p, heap->obj[0].size); HDmemset (p, 0, (size_t)((heap->chunk+heap->nalloc) - p)); @@ -289,6 +291,7 @@ H5HG_load (H5F_t *f, const haddr_t *addr, const void __unused__ *udata1, assert (idx<heap->nalloc); assert (NULL==heap->obj[idx].begin); UINT16DECODE (p, heap->obj[idx].nrefs); + p += 4; /*reserved*/ H5F_decode_length (f, p, heap->obj[idx].size); heap->obj[idx].begin = begin; p = begin + heap->obj[idx].size; @@ -440,8 +443,9 @@ H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, int cwfsno, size_t size) heap->obj[idx].size = size; heap->obj[idx].begin = heap->obj[0].begin; p = heap->obj[idx].begin; - UINT16ENCODE (p, idx); - UINT16ENCODE (p, 0); /*nrefs*/ + UINT16ENCODE(p, idx); + UINT16ENCODE(p, 0); /*nrefs*/ + UINT32ENCODE(p, 0); /*reserved*/ H5F_encode_length (f, p, size); /* Fix the free space object */ @@ -466,8 +470,9 @@ H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, int cwfsno, size_t size) heap->obj[0].size -= size; heap->obj[0].begin += size; p = heap->obj[0].begin; - UINT16ENCODE (p, 0); /*id*/ - UINT16ENCODE (p, 0); /*nrefs*/ + UINT16ENCODE(p, 0); /*id*/ + UINT16ENCODE(p, 0); /*nrefs*/ + UINT32ENCODE(p, 0); /*reserved*/ H5F_encode_length (f, p, heap->obj[0].size); } else { @@ -528,7 +533,7 @@ H5HG_insert (H5F_t *f, size_t size, void *obj, H5HG_t *hobj/*out*/) } /* Find a large enough collection on the CWFS list */ - need = size + H5HG_SIZEOF_OBJHDR (f); + need = H5HG_ALIGN(size + H5HG_SIZEOF_OBJHDR(f)); for (cwfsno=0; cwfsno<f->shared->ncwfs; cwfsno++) { if (f->shared->cwfs[cwfsno]->obj[0].size>=need) { /* @@ -565,7 +570,9 @@ H5HG_insert (H5F_t *f, size_t size, void *obj, H5HG_t *hobj/*out*/) assert (idx>0); /* Copy data into the heap */ - HDmemcpy (heap->obj[idx].begin+H5HG_SIZEOF_OBJHDR(f), obj, size); + HDmemcpy(heap->obj[idx].begin+H5HG_SIZEOF_OBJHDR(f), obj, size); + HDmemset(heap->obj[idx].begin+H5HG_SIZEOF_OBJHDR(f)+size, 0, + need-(H5HG_SIZEOF_OBJHDR(f)+size)); heap->dirty = TRUE; /* Return value */ @@ -820,8 +827,9 @@ H5HG_remove (H5F_t *f, H5HG_t *hobj) heap->size-((obj_start+size)-heap->chunk)); if (heap->obj[0].size>=H5HG_SIZEOF_OBJHDR (f)) { p = heap->obj[0].begin; - UINT32ENCODE (p, 0); /*id*/ - UINT32ENCODE (p, 0); /*nrefs*/ + UINT16ENCODE(p, 0); /*id*/ + UINT16ENCODE(p, 0); /*nrefs*/ + UINT32ENCODE(p, 0); /*reserved*/ H5F_encode_length (f, p, size); } HDmemset (heap->obj+hobj->idx, 0, sizeof(H5HG_obj_t)); diff --git a/src/H5HGprivate.h b/src/H5HGprivate.h index c6ec1cd..8f66ef7 100644 --- a/src/H5HGprivate.h +++ b/src/H5HGprivate.h @@ -24,6 +24,16 @@ #define H5HG_VERSION 1 /* + * Pad all global heap messages to a multiple of eight bytes so we can load + * the entire collection into memory and operate on it there. Eight should + * be sufficient for machines that have alignment constraints because our + * largest data type is eight bytes. + */ +#define H5HG_ALIGNMENT 8 +#define H5HG_ALIGN(X) (H5HG_ALIGNMENT*(((X)+H5HG_ALIGNMENT-1)/ \ + H5HG_ALIGNMENT)) + +/* * All global heap collections are at least this big. This allows us to read * most collections with a single read() since we don't have to read a few * bytes of header to figure out the size. If the heap is larger than this @@ -53,8 +63,9 @@ /* * The overhead associated with each object in the heap. */ -#define H5HG_SIZEOF_OBJHDR(f) (2 + /*reference count */ \ - 2 + /*reserved */ \ +#define H5HG_SIZEOF_OBJHDR(f) (2 + /*object id number */ \ + 2 + /*reference count */ \ + 4 + /*reserved */ \ H5F_SIZEOF_SIZE(f)) /*object data size */ /* diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 5be08b9..6021802 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -72,6 +72,10 @@ static hbool_t interface_initialize_g = FALSE; This function decodes the "raw" disk form of a attribute message into a struct in memory native format. The struct is allocated within this function using malloc() and is returned to the caller. + * + * Modifications: + * Robb Matzke, 17 Jul 1998 + * Added padding for alignment. --------------------------------------------------------------------------*/ static void * H5O_attr_decode(H5F_t *f, const uint8 *p, H5O_shared_t __unused__ *sh) @@ -90,24 +94,30 @@ H5O_attr_decode(H5F_t *f, const uint8 *p, H5O_shared_t __unused__ *sh) HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); } + + /* + * Decode the sizes of the parts of the attribute. The sizes stored in + * the file are exact but the parts are aligned on 8-byte boundaries. + */ + UINT16DECODE(p, name_len); /*including null*/ + UINT16DECODE(p, attr->dt_size); + UINT16DECODE(p, attr->ds_size); + p += 2; /*reserved*/ /* Decode and store the name */ - UINT16DECODE(p, name_len); - if (NULL==(attr->name=H5MM_malloc(name_len+1))) { + if (NULL==(attr->name=H5MM_malloc(name_len))) { HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); } HDmemcpy(attr->name,p,name_len); - attr->name[name_len]='\0'; - p+=name_len; /* advance the memory pointer */ + p += H5O_ALIGN(name_len); /* advance the memory pointer */ /* decode the attribute datatype */ if((attr->dt=(H5O_DTYPE->decode)(f,p,NULL))==NULL) { HRETURN_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute datatype"); } - attr->dt_size=(H5O_DTYPE->raw_size)(f,attr->dt); - p+=attr->dt_size; + p += H5O_ALIGN(attr->dt_size); /* decode the attribute dataspace */ if (NULL==(attr->ds = H5MM_calloc(sizeof(H5S_t)))) { @@ -120,9 +130,8 @@ H5O_attr_decode(H5F_t *f, const uint8 *p, H5O_shared_t __unused__ *sh) H5MM_xfree(simple); } else { attr->ds->extent.type = H5S_SCALAR; - } /* end else */ - attr->ds_size=(H5O_SDSPACE->raw_size)(f,&(attr->ds->extent.u.simple)); - p+=attr->ds_size; + } + p += H5O_ALIGN(attr->ds_size); /* Compute the size of the data */ attr->data_size=H5S_extent_npoints(attr->ds)*H5T_get_size(attr->dt); @@ -162,6 +171,10 @@ H5O_attr_decode(H5F_t *f, const uint8 *p, H5O_shared_t __unused__ *sh) DESCRIPTION This function encodes the native memory form of the attribute message in the "raw" disk form. + * + * Modifications: + * Robb Matzke, 17 Jul 1998 + * Added padding for alignment. --------------------------------------------------------------------------*/ static herr_t H5O_attr_encode(H5F_t *f, uint8 *p, const void *mesg) @@ -176,25 +189,40 @@ H5O_attr_encode(H5F_t *f, uint8 *p, const void *mesg) assert(p); assert(attr); - /* encode the attribute name */ - name_len=HDstrlen(attr->name); + /* + * Encode the lengths of the various parts of the attribute message. The + * encoded lengths are exact but we pad each part except the data to be a + * multiple of eight bytes. + */ + name_len = HDstrlen(attr->name)+1; UINT16ENCODE(p, name_len); - HDmemcpy(p,attr->name,name_len); - p+=name_len; + UINT16ENCODE(p, attr->dt_size); + UINT16ENCODE(p, attr->ds_size); + UINT16ENCODE(p, 0); /*reserved*/ + + /* + * Write the name including null terminator padded to the correct number + * of bytes. + */ + HDmemcpy(p, attr->name, name_len); + HDmemset(p+name_len, 0, H5O_ALIGN(name_len)-name_len); + p += H5O_ALIGN(name_len); /* encode the attribute datatype */ if((H5O_DTYPE->encode)(f,p,attr->dt)<0) { HRETURN_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode attribute datatype"); } - p+=attr->dt_size; + HDmemset(p+attr->dt_size, 0, H5O_ALIGN(attr->dt_size)-attr->dt_size); + p += H5O_ALIGN(attr->dt_size); /* encode the attribute dataspace */ if((H5O_SDSPACE->encode)(f,p,&(attr->ds->extent.u.simple))<0) { HRETURN_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "can't encode attribute dataspace"); } - p+=attr->ds_size; + HDmemset(p+attr->ds_size, 0, H5O_ALIGN(attr->ds_size)-attr->ds_size); + p += H5O_ALIGN(attr->ds_size); /* Store attribute data */ HDmemcpy(p,attr->data,attr->data_size); @@ -256,32 +284,36 @@ H5O_attr_copy(const void *_src, void *_dst) This function returns the size of the raw attribute message on success. (Not counting the message type or size fields, only the data portion of the message). It doesn't take into account alignment. + * + * Modified: + * Robb Matzke, 17 Jul 1998 + * Added padding between message parts for alignment. --------------------------------------------------------------------------*/ static size_t H5O_attr_size(H5F_t __unused__ *f, const void *mesg) { - size_t ret_value = 0; - const H5A_t *attr = (const H5A_t *) mesg; + size_t ret_value = 0; + size_t name_len; + const H5A_t *attr = (const H5A_t *) mesg; FUNC_ENTER(H5O_attr_size, 0); assert(attr); - /* Get size of name */ - ret_value=2; /* Size to store length of name */ - ret_value+=HDstrlen(attr->name); /* Add length of name (non-zero terminated) */ + name_len = HDstrlen(attr->name)+1; - /* Get size of datatype information */ - ret_value+=attr->dt_size; - - /* Get size of [simple] dataspace information */ - ret_value+=attr->ds_size; - - /* Get size of attribute data */ - ret_value+=attr->data_size; + ret_value = 2 + /*name size inc. null */ + 2 + /*type size */ + 2 + /*space size */ + 2 + /*reserved */ + H5O_ALIGN(name_len) + /*attribute name */ + H5O_ALIGN(attr->dt_size) + /*data type */ + H5O_ALIGN(attr->ds_size) + /*data space */ + attr->data_size; /*the data itself */ FUNC_LEAVE(ret_value); } + /*------------------------------------------------------------------------- * Function: H5O_attr_reset @@ -339,15 +371,10 @@ H5O_attr_reset(void *_mesg) parameter. --------------------------------------------------------------------------*/ static herr_t -H5O_attr_debug(H5F_t __unused__ *f, const void __unused__ *mesg, - FILE __unused__ * stream, intn __unused__ indent, - intn __unused__ fwidth) +H5O_attr_debug(H5F_t *f, const void *_mesg, FILE * stream, intn indent, + intn fwidth) { -#ifdef LATER - const char *s; - char buf[256]; - intn i, j; -#endif /* LATER */ + const H5A_t *mesg = (const H5A_t *)_mesg; FUNC_ENTER(H5O_attr_debug, FAIL); @@ -357,218 +384,29 @@ H5O_attr_debug(H5F_t __unused__ *f, const void __unused__ *mesg, assert(indent >= 0); assert(fwidth >= 0); -#ifdef LATER - switch (dt->type) { - case H5T_INTEGER: - s = "integer"; - break; - case H5T_FLOAT: - s = "floating-point"; - break; - case H5T_TIME: - s = "date and time"; - break; - case H5T_STRING: - s = "text string"; - break; - case H5T_BITFIELD: - s = "bit field"; - break; - case H5T_OPAQUE: - s = "opaque"; - break; - case H5T_COMPOUND: - s = "compound"; - break; - default: - sprintf(buf, "H5T_CLASS_%d", (int) (dt->type)); - s = buf; - break; - } - fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Type class:", - s); - - fprintf(stream, "%*s%-*s %lu byte%s\n", indent, "", fwidth, - "Size:", - (unsigned long) (dt->size), 1 == dt->size ? "" : "s"); - - if (H5T_COMPOUND == dt->type) { - fprintf(stream, "%*s%-*s %d\n", indent, "", fwidth, - "Number of members:", - dt->u.compnd.nmembs); - for (i = 0; i < dt->u.compnd.nmembs; i++) { - sprintf(buf, "Member %d:", i); - fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - buf, - dt->u.compnd.memb[i].name); - fprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MAX(0, fwidth-3), - "Byte offset:", - (unsigned long) (dt->u.compnd.memb[i].offset)); - fprintf(stream, "%*s%-*s %d%s\n", indent + 3, "", MAX(0, fwidth-3), - "Dimensionality:", - dt->u.compnd.memb[i].ndims, - 0 == dt->u.compnd.memb[i].ndims ? " (scalar)" : ""); - if (dt->u.compnd.memb[i].ndims > 0) { - fprintf(stream, "%*s%-*s {", indent + 3, "", MAX(0, fwidth-3), - "Size:"); - for (j = 0; j < dt->u.compnd.memb[i].ndims; j++) { - fprintf(stream, "%s%lu", j ? ", " : "", - (unsigned long) (dt->u.compnd.memb[i].dim[j])); - } - fprintf(stream, "}\n"); - fprintf(stream, "%*s%-*s {", indent + 3, "", MAX(0, fwidth-3), - "Permutation:"); - for (j = 0; j < dt->u.compnd.memb[i].ndims; j++) { - fprintf(stream, "%s%lu", j ? ", " : "", - (unsigned long) (dt->u.compnd.memb[i].perm[j])); - } - fprintf(stream, "}\n"); - } - H5O_dtype_debug(f, dt->u.compnd.memb[i].type, stream, - indent + 3, MAX(0, fwidth - 3)); - } - } else { - switch (dt->u.atomic.order) { - case H5T_ORDER_LE: - s = "little endian"; - break; - case H5T_ORDER_BE: - s = "big endian"; - break; - case H5T_ORDER_VAX: - s = "VAX"; - break; - case H5T_ORDER_NONE: - s = "none"; - break; - default: - sprintf(buf, "H5T_ORDER_%d", dt->u.atomic.order); - s = buf; - break; - } - fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Byte order:", - s); - - fprintf(stream, "%*s%-*s %lu bit%s\n", indent, "", fwidth, - "Precision:", - (unsigned long) (dt->u.atomic.prec), - 1 == dt->u.atomic.prec ? "" : "s"); - - fprintf(stream, "%*s%-*s %lu bit%s\n", indent, "", fwidth, - "Offset:", - (unsigned long) (dt->u.atomic.offset), - 1 == dt->u.atomic.offset ? "" : "s"); - - switch (dt->u.atomic.lsb_pad) { - case H5T_PAD_ZERO: - s = "zero"; - break; - case H5T_PAD_ONE: - s = "one"; - break; - default: - s = "pad?"; - break; - } - fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Low pad type:", s); - - switch (dt->u.atomic.msb_pad) { - case H5T_PAD_ZERO: - s = "zero"; - break; - case H5T_PAD_ONE: - s = "one"; - break; - default: - s = "pad?"; - break; - } - fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "High pad type:", s); - - if (H5T_FLOAT == dt->type) { - switch (dt->u.atomic.u.f.pad) { - case H5T_PAD_ZERO: - s = "zero"; - break; - case H5T_PAD_ONE: - s = "one"; - break; - default: - if (dt->u.atomic.u.f.pad < 0) { - sprintf(buf, "H5T_PAD_%d", -(dt->u.atomic.u.f.pad)); - } else { - sprintf(buf, "bit-%d", dt->u.atomic.u.f.pad); - } - s = buf; - break; - } - fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Internal pad type:", s); - - switch (dt->u.atomic.u.f.norm) { - case H5T_NORM_IMPLIED: - s = "implied"; - break; - case H5T_NORM_MSBSET: - s = "msb set"; - break; - case H5T_NORM_NONE: - s = "none"; - break; - default: - sprintf(buf, "H5T_NORM_%d", (int) (dt->u.atomic.u.f.norm)); - s = buf; - } - fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Normalization:", s); - - fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, - "Sign bit location:", - (unsigned long) (dt->u.atomic.u.f.sign)); - - fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, - "Exponent location:", - (unsigned long) (dt->u.atomic.u.f.epos)); - - fprintf(stream, "%*s%-*s 0x%08lx\n", indent, "", fwidth, - "Exponent bias:", - (unsigned long) (dt->u.atomic.u.f.ebias)); - - fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, - "Exponent size:", - (unsigned long) (dt->u.atomic.u.f.esize)); - - fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, - "Mantissa location:", - (unsigned long) (dt->u.atomic.u.f.mpos)); - - fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, - "Mantissa size:", - (unsigned long) (dt->u.atomic.u.f.msize)); - - } else if (H5T_INTEGER == dt->type) { - switch (dt->u.atomic.u.i.sign) { - case H5T_SGN_NONE: - s = "none"; - break; - case H5T_SGN_2: - s = "2's comp"; - break; - default: - sprintf(buf, "H5T_SGN_%d", (int) (dt->u.atomic.u.i.sign)); - s = buf; - break; - } - fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Sign scheme:", s); - - } - } -#endif /* LATER */ + fprintf(stream, "%*s%-*s \"%s\"\n", indent, "", fwidth, + "Name:", + mesg->name); + fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, + "Initialized:", + (unsigned int)mesg->initialized); + fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, + "Opened:", + (unsigned int)mesg->ent_opened); + fprintf(stream, "%*sSymbol table entry...\n", indent, ""); + H5G_ent_debug(f, &(mesg->ent), stream, indent+3, MAX(0, fwidth-3), NULL); + + fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, + "Data type size:", + (unsigned long)(mesg->dt_size)); + fprintf(stream, "%*sData type...\n", indent, ""); + (H5O_DTYPE->debug)(f, mesg->dt, stream, indent+3, MAX(0, fwidth-3)); + + fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, + "Data space size:", + (unsigned long)(mesg->ds_size)); + fprintf(stream, "%*sData space...\n", indent, ""); + (H5O_SDSPACE->debug)(f, mesg->ds, stream, indent+3, MAX(0, fwidth-3)); FUNC_LEAVE(SUCCEED); } diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 677241e..7f6cabb 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -184,7 +184,7 @@ typedef struct H5O_compress_t { /* * Attribute Message. */ -#define H5O_ATTR_ID 0x000C +#define H5O_ATTR_ID 0x000c extern const H5O_class_t H5O_ATTR[1]; /* operates on an H5A_t struct */ 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 */ diff --git a/src/H5detect.c b/src/H5detect.c index 7398cc1..1236a5b 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -953,7 +953,7 @@ main(void) * systems. */ DETECT_I(long, LLONG, d[nd]); nd++; - DETECT_I(unsigned long, ULLONG, d[nd]); dn++; + DETECT_I(unsigned long, ULLONG, d[nd]); nd++; #else DETECT_I(long long, LLONG, d[nd]); nd++; DETECT_I(unsigned long long, ULLONG, d[nd]); nd++; |