diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5.c | 2 | ||||
-rw-r--r-- | src/H5R.c | 14 | ||||
-rw-r--r-- | src/H5Rpublic.h | 6 |
3 files changed, 10 insertions, 12 deletions
@@ -2464,7 +2464,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } else { hobj_ref_t ref = va_arg (ap, hobj_ref_t); - fprintf (out, "Reference Object=%p", (void *)&ref); + HDfprintf(out, "Reference Object=%a", ref); } break; @@ -175,8 +175,8 @@ H5R_create(void *_ref, H5G_entry_t *loc, const char *name, H5R_type_t ref_type, /* Return any previous heap block to the free list if we are garbage collecting */ if(loc->file->shared->gc_ref) { /* Check for an existing heap ID in the reference */ - for(u=0, heapid_found=0; u<H5R_DSET_REG_REF_BUF_SIZE; u++) - if(ref->heapid[u]!=0) { + for(u=0, heapid_found=0, p=(uint8_t *)ref; u<H5R_DSET_REG_REF_BUF_SIZE; u++) + if(p[u]!=0) { heapid_found=1; break; } /* end if */ @@ -187,7 +187,7 @@ H5R_create(void *_ref, H5G_entry_t *loc, const char *name, H5R_type_t ref_type, } /* end if */ /* Zero the heap ID out, may leak heap space if user is re-using reference and doesn't have garbage collection on */ - HDmemset(ref->heapid,H5R_DSET_REG_REF_BUF_SIZE,0); + HDmemset(ref,H5R_DSET_REG_REF_BUF_SIZE,0); /* Get the amount of space required to serialize the selection */ if ((buf_size = H5S_SELECT_SERIAL_SIZE(space)) < 0) @@ -215,7 +215,7 @@ H5R_create(void *_ref, H5G_entry_t *loc, const char *name, H5R_type_t ref_type, HGOTO_ERROR(H5E_REFERENCE, H5E_WRITEERROR, FAIL, "Unable to serialize selection"); /* Serialize the heap ID and index for storage in the file */ - p=(uint8_t *)ref->heapid; + p=(uint8_t *)ref; H5F_addr_encode(loc->file,&p,hobjid.addr); INT32ENCODE(p,hobjid.idx); @@ -358,7 +358,7 @@ H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref) uint8_t *buf; /* Buffer to store serialized selection in */ /* Get the heap ID for the dataset region */ - p=(uint8_t *)ref->heapid; + p=(uint8_t *)ref; H5F_addr_decode(ent.file,(const uint8_t **)&p,&(hobjid.addr)); INT32DECODE(p,hobjid.idx); @@ -525,7 +525,7 @@ H5R_get_region(H5F_t *file, hid_t dxpl_id, H5R_type_t UNUSED ref_type, void *_re ent.file=file; /* Get the heap ID for the dataset region */ - p=(uint8_t *)ref->heapid; + p=(uint8_t *)ref; H5F_addr_decode(ent.file,(const uint8_t **)&p,&(hobjid.addr)); INT32DECODE(p,hobjid.idx); @@ -667,7 +667,7 @@ H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref) uint8_t *buf; /* Buffer to store serialized selection in */ /* Get the heap ID for the dataset region */ - p=(uint8_t *)ref->heapid; + p=(uint8_t *)ref; H5F_addr_decode(ent.file,(const uint8_t **)&p,&(hobjid.addr)); INT32DECODE(p,hobjid.idx); diff --git a/src/H5Rpublic.h b/src/H5Rpublic.h index 574ce80..efffb8c 100644 --- a/src/H5Rpublic.h +++ b/src/H5Rpublic.h @@ -57,10 +57,8 @@ typedef haddr_t hobj_ref_t; /* Needs to be large enough to store largest haddr_t the Crays and other machines (the heap ID is always encoded as an int32 anyway) */ /* Dataset Region reference structure for user's code */ -typedef struct { - unsigned char heapid[H5R_DSET_REG_REF_BUF_SIZE]; /* Buffer to store heap ID and index */ - /* Needs to be large enough to store largest haddr_t in a worst case machine (ie. 8 bytes currently) plus an int */ -} hdset_reg_ref_t; +typedef unsigned char hdset_reg_ref_t[H5R_DSET_REG_REF_BUF_SIZE];/* Buffer to store heap ID and index */ +/* Needs to be large enough to store largest haddr_t in a worst case machine (ie. 8 bytes currently) plus an int */ /* Publicly visible datastructures */ |