summaryrefslogtreecommitdiffstats
path: root/test/gheap.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/gheap.c')
-rw-r--r--test/gheap.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/test/gheap.c b/test/gheap.c
index 3f66d35..317e306 100644
--- a/test/gheap.c
+++ b/test/gheap.c
@@ -81,7 +81,7 @@ test_1 (hid_t fapl)
H5HG_t obj[1024];
uint8_t out[1024];
uint8_t in[1024];
- int i;
+ size_t u;
size_t size;
herr_t status;
int nerrors = 0;
@@ -104,16 +104,16 @@ test_1 (hid_t fapl)
* a clean file, the addresses allocated for the collections should also
* be monotonically increasing.
*/
- for(i = 0; i < 1024; i++) {
- size = i + 1;
- HDmemset(out, 'A' + i % 26, size);
+ for(u = 0; u < 1024; u++) {
+ size = u + 1;
+ HDmemset(out, (int)('A' + u % 26), size);
H5Eclear2(H5E_DEFAULT);
- status = H5HG_insert(f, H5AC_ind_read_dxpl_id, size, out, obj + i);
+ status = H5HG_insert(f, H5AC_ind_read_dxpl_id, size, out, obj + u);
if(status < 0) {
H5_FAILED();
puts(" Unable to insert object into global heap");
nerrors++;
- } else if(i && H5F_addr_gt(obj[i - 1].addr, obj[i].addr)) {
+ } else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) {
H5_FAILED();
puts(" Collection addresses are not monotonically increasing");
nerrors++;
@@ -123,11 +123,11 @@ test_1 (hid_t fapl)
/*
* Now try to read each object back.
*/
- for(i = 0; i < 1024; i++) {
- size = i + 1;
- HDmemset(out, 'A' + i % 26, size);
+ for(u = 0; u < 1024; u++) {
+ size = u + 1;
+ HDmemset(out, (int)('A' + u % 26), size);
H5Eclear2(H5E_DEFAULT);
- if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, obj + i, in, NULL)) {
+ if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) {
H5_FAILED();
puts(" Unable to read object");
nerrors++;
@@ -177,7 +177,7 @@ test_2 (hid_t fapl)
H5HG_t obj[1024];
uint8_t out[1024];
uint8_t in[1024];
- int i;
+ size_t u;
size_t size;
int nerrors = 0;
char filename[1024];
@@ -197,11 +197,11 @@ test_2 (hid_t fapl)
/*
* Write the objects, monotonically decreasing in length.
*/
- for (i=0; i<1024; i++) {
- size = 1024-i;
- memset (out, 'A'+i%26, size);
+ for(u = 0; u < 1024; u++) {
+ size = 1024 - u;
+ HDmemset(out, (int)('A' + u % 26), size);
H5Eclear2(H5E_DEFAULT);
- if (H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj+i)<0) {
+ if (H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u) < 0) {
H5_FAILED();
puts(" Unable to insert object into global heap");
nerrors++;
@@ -211,11 +211,11 @@ test_2 (hid_t fapl)
/*
* Now try to read each object back.
*/
- for (i=0; i<1024; i++) {
- size = 1024-i;
- memset (out, 'A'+i%26, size);
+ for(u = 0; u < 1024; u++) {
+ size = 1024 - u;
+ HDmemset(out, (int)('A' + u % 26), size);
H5Eclear2(H5E_DEFAULT);
- if (NULL==H5HG_read (f, H5AC_ind_read_dxpl_id, obj+i, in, NULL)) {
+ if (NULL==H5HG_read (f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) {
H5_FAILED();
puts(" Unable to read object");
nerrors++;
@@ -263,7 +263,7 @@ test_3 (hid_t fapl)
H5F_t *f = NULL;
H5HG_t obj[1024];
uint8_t out[1024];
- int i;
+ size_t u;
size_t size;
herr_t status;
int nerrors = 0;
@@ -282,11 +282,11 @@ test_3 (hid_t fapl)
}
/* Create some stuff */
- for (i=0; i<1024; i++) {
- size = i%30+100;
- memset (out, 'A'+i%26, size);
+ for(u = 0; u < 1024; u++) {
+ size = u % 30 + 100;
+ HDmemset(out, (int)('A' + u % 26), size);
H5Eclear2(H5E_DEFAULT);
- status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj+i);
+ status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u);
if (status<0) {
H5_FAILED();
puts(" Unable to insert object into global heap");
@@ -295,8 +295,8 @@ test_3 (hid_t fapl)
}
/* Remove everything */
- for (i=0; i<1024; i++) {
- status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj+i);
+ for(u = 0; u < 1024; u++) {
+ status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u);
if (status<0) {
H5_FAILED();
puts(" Unable to remove object");
@@ -342,7 +342,7 @@ test_4 (hid_t fapl)
H5F_t *f = NULL;
H5HG_t obj[1024];
uint8_t out[1024];
- int i;
+ size_t u;
size_t size;
herr_t status;
int nerrors = 0;
@@ -360,12 +360,12 @@ test_4 (hid_t fapl)
goto error;
}
- for (i=0; i<1024; i++) {
+ for(u = 0; u < 1024; u++) {
/* Insert */
- size = i%30+100;
- memset (out, 'A'+i%26, size);
+ size = u % 30 + 100;
+ HDmemset(out, (int)('A' + u % 26), size);
H5Eclear2(H5E_DEFAULT);
- status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj+i);
+ status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u);
if (status<0) {
H5_FAILED();
puts(" Unable to insert object into global heap");
@@ -377,15 +377,15 @@ test_4 (hid_t fapl)
* next one has already been inserted. That is, insert A, B, C;
* remove B, insert D, E, F; remove E; etc.
*/
- if (1==i%3) {
+ if(1 == (u % 3)) {
H5Eclear2(H5E_DEFAULT);
- status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj+i-1);
+ status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u - 1);
if (status<0) {
H5_FAILED();
puts(" Unable to remove object");
nerrors++;
}
- memset (obj+i-1, 0, sizeof *obj);
+ HDmemset(obj + u - 1, 0, sizeof *obj);
}
}