summaryrefslogtreecommitdiffstats
path: root/src/H5FA.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-09-24 20:30:47 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-09-24 20:30:47 (GMT)
commit74c6507d9fcdb1c9d7057ac07dd04fac038b599e (patch)
tree80eddf92875cd2b2951b4da985942b07188c0101 /src/H5FA.c
parentd67bb5f13077b54ef8fd1e61520f60a5103cdcaa (diff)
downloadhdf5-74c6507d9fcdb1c9d7057ac07dd04fac038b599e.zip
hdf5-74c6507d9fcdb1c9d7057ac07dd04fac038b599e.tar.gz
hdf5-74c6507d9fcdb1c9d7057ac07dd04fac038b599e.tar.bz2
[svn-r17518] Description:
Bring most of Vailin's changes to the fixed array data structure back to the trunk, including new regression test for data structure. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.8 (amazon) in debug mode Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5FA.c')
-rw-r--r--src/H5FA.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/H5FA.c b/src/H5FA.c
index a8cd36b..7d6a136 100644
--- a/src/H5FA.c
+++ b/src/H5FA.c
@@ -361,16 +361,16 @@ HDfprintf(stderr, "%s: fixed array data block address not defined!\n", FUNC, idx
else { /* paging */
size_t page_idx; /* Index of page within data block */
size_t dblk_page_nelmts; /* # of elements in a data block page */
- hsize_t elmt_idx; /* Element index within the page */
+ size_t elmt_idx; /* Element index within the page */
haddr_t dblk_page_addr; /* Address of data block page */
/* Compute the page & element index */
- page_idx = (size_t)idx / dblock->dblk_page_nelmts;
- elmt_idx = (size_t)idx % dblock->dblk_page_nelmts;
+ page_idx = (size_t)(idx / dblock->dblk_page_nelmts);
+ elmt_idx = (size_t)(idx % dblock->dblk_page_nelmts);
/* Get the address of the data block page */
dblk_page_addr = dblock->addr + H5FA_DBLOCK_PREFIX_SIZE(dblock) +
- (page_idx * dblock->dblk_page_size);
+ ((hsize_t)page_idx * dblock->dblk_page_size);
/* Check for using last page, to set the number of elements on the page */
if((page_idx + 1) == dblock->npages)
@@ -378,7 +378,7 @@ HDfprintf(stderr, "%s: fixed array data block address not defined!\n", FUNC, idx
else
dblk_page_nelmts = dblock->dblk_page_nelmts;
- /* Check if the page has been create yet */
+ /* Check if the page has been created yet */
if(!H5V_bit_get(dblock->dblk_page_init, page_idx)) {
/* Create the data block page */
if(H5FA__dblk_page_create(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts) < 0)
@@ -468,7 +468,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx);
size_t page_idx; /* Index of page within data block */
/* Compute the page index */
- page_idx = (size_t)idx / dblock->dblk_page_nelmts;
+ page_idx = (size_t)(idx / dblock->dblk_page_nelmts);
/* Check if the page is defined yet */
if(!H5V_bit_get(dblock->dblk_page_init, page_idx)) {
@@ -480,15 +480,15 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx);
H5_LEAVE(SUCCEED)
} /* end if */
else { /* get the page */
- hsize_t elmt_idx; /* Element index within the page */
- haddr_t dblk_page_addr; /* Address of data block page */
- size_t dblk_page_nelmts; /* # of elements in a data block page */
+ size_t dblk_page_nelmts; /* # of elements in a data block page */
+ size_t elmt_idx; /* Element index within the page */
+ haddr_t dblk_page_addr; /* Address of data block page */
/* Compute the element index */
- elmt_idx = (size_t)idx % dblock->dblk_page_nelmts;
+ elmt_idx = (size_t)(idx % dblock->dblk_page_nelmts);
/* Compute the address of the data block */
- dblk_page_addr = dblock->addr + H5FA_DBLOCK_PREFIX_SIZE(dblock) + (page_idx * dblock->dblk_page_size);
+ dblk_page_addr = dblock->addr + H5FA_DBLOCK_PREFIX_SIZE(dblock) + ((hsize_t)page_idx * dblock->dblk_page_size);
/* Check for using last page, to set the number of elements on the page */
if((page_idx + 1) == dblock->npages)