summaryrefslogtreecommitdiffstats
path: root/src/H5R.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-09-14 05:04:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-09-14 05:04:28 (GMT)
commit48339a4e26f071c7227b964f48e4d5600c26af16 (patch)
tree8d1b30401a326920818aa6037fdb3edf58aa54b2 /src/H5R.c
parent6a9aebbc41a2ae06756e2f70907fb0127d28b59b (diff)
downloadhdf5-48339a4e26f071c7227b964f48e4d5600c26af16.zip
hdf5-48339a4e26f071c7227b964f48e4d5600c26af16.tar.gz
hdf5-48339a4e26f071c7227b964f48e4d5600c26af16.tar.bz2
[svn-r9251] Purpose:
Bug fix Description: Correct typedef for dataset region references to avoid struct alignment issues on Crays. Solution: Change the typedef for hdset_reg_ref_t from a struct to an array of unsigned char's of the correct size and propagate the appropriate adjustments around the code. Platforms tested: FreeBSD 4.10 (sleipnir) Linux 2.4 (verbena) w/fortran Cray T90 (subzero) w/fortran Cray SV1 (wind) w/fortran & parallel Cray T3E (cyclone) w/fortran & parallel
Diffstat (limited to 'src/H5R.c')
-rw-r--r--src/H5R.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/H5R.c b/src/H5R.c
index 1916edc..8a3c6ff 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -158,7 +158,7 @@ H5R_create(void *_ref, H5G_entry_t *loc, const char *name, H5R_type_t ref_type,
uint8_t *p; /* Pointer to OID to store */
/* Set information for reference */
- p=(uint8_t *)ref->oid;
+ p=(uint8_t *)ref;
H5F_addr_pack(loc->file,&addr,&sb.objno[0]);
H5F_addr_encode(loc->file,&p,addr);
break;
@@ -180,8 +180,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 */
@@ -192,7 +192,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)
@@ -221,7 +221,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);
@@ -357,7 +357,7 @@ H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref)
* open a dataset for now
*/
/* Get the object oid */
- p=(uint8_t *)ref->oid;
+ p=(uint8_t *)ref;
H5F_addr_decode(ent.file,(const uint8_t **)&p,&(ent.header));
} /* end case */
break;
@@ -369,7 +369,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);
@@ -536,7 +536,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);
@@ -772,7 +772,7 @@ H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref)
hobj_ref_t *ref=(hobj_ref_t *)_ref; /* Only object references currently supported */
/* Get the object oid */
- p=(uint8_t *)ref->oid;
+ p=(uint8_t *)ref;
H5F_addr_decode(ent.file,(const uint8_t **)&p,&(ent.header));
} /* end case */
break;
@@ -784,7 +784,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);