summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5Abtree2.c16
-rw-r--r--src/H5Oprivate.h5
-rw-r--r--src/H5Oshared.c2
-rw-r--r--src/H5SMmessage.c6
4 files changed, 18 insertions, 11 deletions
diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c
index eb2c741..31dcb66 100644
--- a/src/H5Abtree2.c
+++ b/src/H5Abtree2.c
@@ -326,7 +326,8 @@ H5A_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ct
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_btree2_name_encode)
/* Encode the record's fields */
- UINT64ENCODE(raw, nrecord->id);
+ HDmemcpy(raw, nrecord->id.id, (size_t)H5O_FHEAP_ID_LEN);
+ raw += H5O_FHEAP_ID_LEN;
*raw++ = nrecord->flags;
UINT32ENCODE(raw, nrecord->corder)
UINT32ENCODE(raw, nrecord->hash)
@@ -356,7 +357,8 @@ H5A_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ct
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_btree2_name_decode)
/* Decode the record's fields */
- UINT64DECODE(raw, nrecord->id);
+ HDmemcpy(nrecord->id.id, raw, (size_t)H5O_FHEAP_ID_LEN);
+ raw += H5O_FHEAP_ID_LEN;
nrecord->flags = *raw++;
UINT32DECODE(raw, nrecord->corder)
UINT32DECODE(raw, nrecord->hash)
@@ -388,7 +390,7 @@ H5A_dense_btree2_name_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dx
HDfprintf(stream, "%*s%-*s {%016Hx, %02x, %u, %08lx}\n", indent, "", fwidth,
"Record:",
- (hsize_t)nrecord->id, (unsigned)nrecord->flags, (unsigned)nrecord->corder, (unsigned long)nrecord->hash);
+ (hsize_t)nrecord->id.val, (unsigned)nrecord->flags, (unsigned)nrecord->corder, (unsigned long)nrecord->hash);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5A_dense_btree2_name_debug() */
@@ -484,7 +486,8 @@ H5A_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void UNUSED *
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_btree2_corder_encode)
/* Encode the record's fields */
- UINT64ENCODE(raw, nrecord->id);
+ HDmemcpy(raw, nrecord->id.id, (size_t)H5O_FHEAP_ID_LEN);
+ raw += H5O_FHEAP_ID_LEN;
*raw++ = nrecord->flags;
UINT32ENCODE(raw, nrecord->corder)
@@ -513,7 +516,8 @@ H5A_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void UNUSED *
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_btree2_corder_decode)
/* Decode the record's fields */
- UINT64DECODE(raw, nrecord->id);
+ HDmemcpy(nrecord->id.id, raw, (size_t)H5O_FHEAP_ID_LEN);
+ raw += H5O_FHEAP_ID_LEN;
nrecord->flags = *raw++;
UINT32DECODE(raw, nrecord->corder)
@@ -544,7 +548,7 @@ H5A_dense_btree2_corder_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED
HDfprintf(stream, "%*s%-*s {%016Hx, %02x, %u}\n", indent, "", fwidth,
"Record:",
- (hsize_t)nrecord->id, (unsigned)nrecord->flags, (unsigned)nrecord->corder);
+ (hsize_t)nrecord->id.val, (unsigned)nrecord->flags, (unsigned)nrecord->corder);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5A_dense_btree2_corder_debug() */
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index 93eb40f..39ae9cf 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -119,7 +119,10 @@ typedef struct H5O_t H5O_t;
/* Fractal heap ID type for shared message & attribute heap IDs. */
-typedef uint64_t H5O_fheap_id_t;
+typedef union {
+ uint8_t id[H5O_FHEAP_ID_LEN]; /* Buffer to hold ID, for encoding/decoding */
+ uint64_t val; /* Value, for quick comparisons */
+} H5O_fheap_id_t;
/* The object location information for an object */
typedef struct H5O_loc_t {
diff --git a/src/H5Oshared.c b/src/H5Oshared.c
index fd7cc8b..cdd9778 100644
--- a/src/H5Oshared.c
+++ b/src/H5Oshared.c
@@ -731,7 +731,7 @@ H5O_shared_debug(const H5O_shared_t *mesg, FILE *stream, int indent, int fwidth)
"SOHM");
HDfprintf(stream, "%*s%-*s %016llx\n", indent, "", fwidth,
"Heap ID:",
- (unsigned long long)mesg->u.heap_id);
+ (unsigned long long)mesg->u.heap_id.val);
break;
case H5O_SHARE_TYPE_HERE:
diff --git a/src/H5SMmessage.c b/src/H5SMmessage.c
index 9a214ea..32ded03 100644
--- a/src/H5SMmessage.c
+++ b/src/H5SMmessage.c
@@ -201,7 +201,7 @@ H5SM_message_compare(const void *rec1, const void *rec2)
* message in the index, we've found the message.
*/
if(mesg->location == H5SM_IN_HEAP && key->message.location == H5SM_IN_HEAP) {
- if(key->message.u.heap_loc.fheap_id == mesg->u.heap_loc.fheap_id)
+ if(key->message.u.heap_loc.fheap_id.val == mesg->u.heap_loc.fheap_id.val)
HGOTO_DONE(0);
} /* end if */
else if(mesg->location == H5SM_IN_OH && key->message.location == H5SM_IN_OH) {
@@ -301,7 +301,7 @@ H5SM_message_encode(uint8_t *raw, const void *_nrecord, void *_ctx)
if(message->location == H5SM_IN_HEAP) {
UINT32ENCODE(raw, message->u.heap_loc.ref_count);
- UINT64ENCODE(raw, message->u.heap_loc.fheap_id);
+ HDmemcpy(raw, message->u.heap_loc.fheap_id.id, (size_t)H5O_FHEAP_ID_LEN);
} /* end if */
else {
HDassert(message->location == H5SM_IN_OH);
@@ -342,7 +342,7 @@ H5SM_message_decode(const uint8_t *raw, void *_nrecord, void *_ctx)
if(message->location == H5SM_IN_HEAP) {
UINT32DECODE(raw, message->u.heap_loc.ref_count);
- UINT64DECODE(raw, message->u.heap_loc.fheap_id);
+ HDmemcpy(message->u.heap_loc.fheap_id.id, raw, (size_t)H5O_FHEAP_ID_LEN);
} /* end if */
else {
HDassert(message->location == H5SM_IN_OH);