diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-09-14 05:04:25 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-09-14 05:04:25 (GMT) |
commit | b73f3230590f7716ac9bc603bd6692345a376c8e (patch) | |
tree | f3ed8a6ffc5a30b1c5fe6d726ebcdf3ced429d51 /fortran/src | |
parent | 147951e4bb7a7967bbec2324b6f5cc66e40260f3 (diff) | |
download | hdf5-b73f3230590f7716ac9bc603bd6692345a376c8e.zip hdf5-b73f3230590f7716ac9bc603bd6692345a376c8e.tar.gz hdf5-b73f3230590f7716ac9bc603bd6692345a376c8e.tar.bz2 |
[svn-r9250] 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 'fortran/src')
-rw-r--r-- | fortran/src/H5Df.c | 4 | ||||
-rw-r--r-- | fortran/src/H5Rf.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index 83b69e7..b7c5263 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -290,7 +290,7 @@ nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ buf_c = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t)*(n)); if ( buf_c != NULL ) { for (i = 0; i < n; i++) { - HDmemcpy(buf_c[i].heapid, buf, H5R_DSET_REG_REF_BUF_SIZE); + HDmemcpy(&buf_c[i], buf, H5R_DSET_REG_REF_BUF_SIZE); buf = buf + REF_REG_BUF_LEN_F; } } @@ -496,7 +496,7 @@ nh5dread_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i ret = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf_c); if (ret >=0) { for (i = 0; i < n; i++) { - HDmemcpy(buf, buf_c[i].heapid, H5R_DSET_REG_REF_BUF_SIZE); + HDmemcpy(buf, &buf_c[i], H5R_DSET_REG_REF_BUF_SIZE); buf = buf + REF_REG_BUF_LEN_F; } } diff --git a/fortran/src/H5Rf.c b/fortran/src/H5Rf.c index 06cb6e3..070efdd 100644 --- a/fortran/src/H5Rf.c +++ b/fortran/src/H5Rf.c @@ -102,7 +102,7 @@ nh5rcreate_region_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid HDfree(c_name); if (ret_value_c >= 0) { - HDmemcpy (ref, ref_c.heapid, H5R_DSET_REG_REF_BUF_SIZE); + HDmemcpy (ref, &ref_c, H5R_DSET_REG_REF_BUF_SIZE); ret_value = 0; } return ret_value; @@ -127,7 +127,7 @@ nh5rdereference_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id) hdset_reg_ref_t ref_c; hid_t c_obj_id; - HDmemcpy (ref_c.heapid, ref, H5R_DSET_REG_REF_BUF_SIZE); + HDmemcpy (&ref_c, ref, H5R_DSET_REG_REF_BUF_SIZE); /* * Call H5Rdereference function. @@ -192,7 +192,7 @@ nh5rget_region_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *space_id) hid_t c_space_id; hdset_reg_ref_t ref_c; - HDmemcpy (ref_c.heapid, ref, H5R_DSET_REG_REF_BUF_SIZE); + HDmemcpy (&ref_c, ref, H5R_DSET_REG_REF_BUF_SIZE); /* * Call H5Rget_region function. |