From c64ac252cdd9fe40b96313e2435551f16428b9d6 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 26 Mar 2007 22:06:48 -0500 Subject: [svn-r13549] Description: Check in changes from Elena and I to get pgcc compiler working again. Primarily (all?) changes to move from using 'hsize_t' as array index to using something else ('size_t') mostly. Tested on: Linux/32 2.4 kagiso w/pgcc --- hl/examples/ex_image1.c | 8 +-- hl/examples/ex_lite2.c | 6 +- hl/test/test_image.c | 12 ++-- hl/test/test_table.c | 140 +++++++++++++++++++------------------- src/H5Vprivate.h | 3 +- test/dsets.c | 174 ++++++++++++++++++++++++------------------------ test/dtypes.c | 6 +- test/enum.c | 15 +++-- test/external.c | 2 +- test/flush1.c | 8 +-- test/flush2.c | 6 +- test/istore.c | 2 +- test/tsohm.c | 6 +- tools/lib/h5tools.c | 20 +++--- tools/lib/h5tools_str.c | 6 +- 15 files changed, 211 insertions(+), 203 deletions(-) diff --git a/hl/examples/ex_image1.c b/hl/examples/ex_image1.c index 9b3c426..96bc7c7 100644 --- a/hl/examples/ex_image1.c +++ b/hl/examples/ex_image1.c @@ -16,8 +16,8 @@ #include "hdf5.h" #include "hdf5_hl.h" -#define WIDTH (hsize_t)400 -#define HEIGHT (hsize_t)200 +#define WIDTH 400 +#define HEIGHT 200 #define PAL_ENTRIES 9 unsigned char buf [ WIDTH*HEIGHT ]; @@ -26,7 +26,7 @@ int main( void ) hid_t file_id; herr_t status; hsize_t pal_dims[] = {PAL_ENTRIES,3}; - hsize_t i, j; + size_t i, j; int n, space; unsigned char pal[PAL_ENTRIES*3] = { /* create a palette with 9 colors */ 0,0,168, /* dark blue */ @@ -56,7 +56,7 @@ int main( void ) file_id = H5Fcreate( "ex_image1.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT ); /* make the image */ - status = H5IMmake_image_8bit( file_id, "image1", WIDTH, HEIGHT, buf ); + status = H5IMmake_image_8bit( file_id, "image1", (hsize_t)WIDTH, (hsize_t)HEIGHT, buf ); /* make a palette */ status = H5IMmake_palette( file_id, "pallete", pal_dims, pal ); diff --git a/hl/examples/ex_lite2.c b/hl/examples/ex_lite2.c index 5919ef9..98f92c8 100644 --- a/hl/examples/ex_lite2.c +++ b/hl/examples/ex_lite2.c @@ -22,7 +22,7 @@ int main( void ) int data[6]; hsize_t dims[2]; herr_t status; - hsize_t i, j, nrow, n_values; + size_t i, j, nrow, n_values; /* open file from ex_lite1.c */ file_id = H5Fopen ("ex_lite1.h5", H5F_ACC_RDONLY, H5P_DEFAULT); @@ -34,8 +34,8 @@ int main( void ) status = H5LTget_dataset_info(file_id,"/dset",dims,NULL,NULL); /* print it by rows */ - n_values = dims[0] * dims[1]; - nrow = dims[1]; + n_values = (size_t)(dims[0] * dims[1]); + nrow = (size_t)dims[1]; for (i=0; i space ) + if ( j > (size_t)space ) { n++; j=0; @@ -131,7 +131,7 @@ static int test_simple(void) if (n>PAL_ENTRIES-1) n=0; } /* create an image 3 byte RGB image */ - for (i=0, j=0, n=0; i < WIDTH*HEIGHT*3; i++, j++) + for (i=0, j=0, n=0; i < (size_t)(WIDTH*HEIGHT*3); i++, j++) { image_in2[i] = n; if (j==3) @@ -185,7 +185,7 @@ static int test_simple(void) goto out; /* check */ - for (i = 0; i < height*width*planes; i++) + for (i = 0; i < (size_t)(height*width*planes); i++) { if ( image_in1[i] != image_out1[i] ) { @@ -223,7 +223,7 @@ static int test_simple(void) goto out; /* check */ - for (i = 0; i < height*width*planes; i++) + for (i = 0; i < (size_t)(height*width*planes); i++) { if ( image_in2[i] != image_out2[i] ) { diff --git a/hl/test/test_table.c b/hl/test/test_table.c index 0848b43..fcc8a7b 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -157,6 +157,7 @@ test_table(hid_t fid, int do_write) hsize_t nfields; hsize_t rfields; hsize_t i, j; + size_t u; hsize_t start1; /* record to start reading from 1st table */ hsize_t start2; /* record to start writing in 2nd table */ @@ -580,8 +581,8 @@ test_table(hid_t fid, int do_write) * data= 0 1 2 3 4 5 6 7 *------------------------------------------------------------------------- */ - for( i=0; i= 2 && i <= 4 ) + if ( u >= 2 && u <= 4 ) { - if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati || - rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi || - rbuf[i].pressure != pressure_in[i-NRECORDS_ADD+1] ) + if ( rbuf[u].lati != position_in[u-(size_t)NRECORDS_ADD+1].lati || + rbuf[u].longi != position_in[u-(size_t)NRECORDS_ADD+1].longi || + rbuf[u].pressure != pressure_in[u-(size_t)NRECORDS_ADD+1] ) { fprintf(stderr,"%ld %f %d\n", - rbuf[i].longi,rbuf[i].pressure,rbuf[i].lati); + rbuf[u].longi,rbuf[u].pressure,rbuf[u].lati); fprintf(stderr,"%ld %f %d\n", - position_in[i].longi,pressure_in[i],position_in[i].lati); + position_in[u].longi,pressure_in[u],position_in[u].lati); goto out; } } @@ -980,9 +981,9 @@ test_table(hid_t fid, int do_write) goto out; /* Compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS_ADD; i++ ) + for( u = 0; u < (size_t)NRECORDS_ADD; u++ ) { - if ( pressure_out[i] != pressure_in[i] ) { + if ( pressure_out[u] != pressure_in[u] ) { goto out; } } @@ -1009,10 +1010,10 @@ test_table(hid_t fid, int do_write) goto out; /* Compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS_ADD; i++ ) + for( u = 0; u < (size_t)NRECORDS_ADD; u++ ) { - if ( position_out[i].lati != position_in[i].lati || - position_out[i].longi != position_in[i].longi ) + if ( position_out[u].lati != position_in[u].lati || + position_out[u].longi != position_in[u].longi ) goto out; } @@ -1040,18 +1041,18 @@ test_table(hid_t fid, int do_write) goto out; /* Compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( u = 0; u < (size_t)NRECORDS; u++ ) { - if ( ( strcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || - namepre_out[i].pressure != namepre_in[i].pressure ) { + if ( ( strcmp( namepre_out[u].name, namepre_in[u].name ) != 0 ) || + namepre_out[u].pressure != namepre_in[u].pressure ) { goto out; } } /* reset buffer */ - for( i = 0; i < NRECORDS; i++ ) + for( u = 0; u < (size_t)NRECORDS; u++ ) { - strcpy( namepre_out[i].name, "\0" ); - namepre_out[i].pressure = -1; + strcpy( namepre_out[u].name, "\0" ); + namepre_out[u].pressure = -1; } /*------------------------------------------------------------------------- @@ -1066,10 +1067,10 @@ test_table(hid_t fid, int do_write) goto out; /* Compare the extracted table with the initial values */ - for( i = 0; i < 3; i++ ) + for( u = 0; u < 3; u++ ) { - if ( ( strcmp( namepre_out[i].name, namepre_in[start+i].name ) != 0 ) || - namepre_out[i].pressure != namepre_in[start+i].pressure ) { + if ( ( strcmp( namepre_out[u].name, namepre_in[(size_t)start+u].name ) != 0 ) || + namepre_out[u].pressure != namepre_in[(size_t)start+u].pressure ) { goto out; } } @@ -1119,13 +1120,13 @@ test_table(hid_t fid, int do_write) goto out; /* Compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( u = 0; u < (size_t)NRECORDS; u++ ) { - if ( i >= 2 && i <= 4 ) + if ( u >= 2 && u <= 4 ) { - if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati || - rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi || - rbuf[i].pressure != pressure_in[i-NRECORDS_ADD+1] ) + if ( rbuf[u].lati != position_in[u-(size_t)NRECORDS_ADD+1].lati || + rbuf[u].longi != position_in[u-(size_t)NRECORDS_ADD+1].longi || + rbuf[u].pressure != pressure_in[u-(size_t)NRECORDS_ADD+1] ) goto out; } } @@ -1176,9 +1177,9 @@ test_table(hid_t fid, int do_write) goto out; /* compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( u = 0; u < (size_t)NRECORDS; u++ ) { - if ( pressure_out[i] != pressure_in[i] ) { + if ( pressure_out[u] != pressure_in[u] ) { goto out; } } @@ -1207,10 +1208,10 @@ test_table(hid_t fid, int do_write) goto out; /* compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS_ADD; i++ ) + for( u = 0; u < (size_t)NRECORDS_ADD; u++ ) { - if ( position_out[i].lati != position_in[i].lati || - position_out[i].longi != position_in[i].longi ) { + if ( position_out[u].lati != position_in[u].lati || + position_out[u].longi != position_in[u].longi ) { goto out; } } @@ -1241,19 +1242,19 @@ test_table(hid_t fid, int do_write) goto out; /* compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( u = 0; u < (size_t)NRECORDS; u++ ) { - if ( ( strcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || - namepre_out[i].pressure != namepre_in[i].pressure ) { + if ( ( strcmp( namepre_out[u].name, namepre_in[u].name ) != 0 ) || + namepre_out[u].pressure != namepre_in[u].pressure ) { goto out; } } /* reset buffer */ - for( i = 0; i < NRECORDS; i++ ) + for( u = 0; u < (size_t)NRECORDS; u++ ) { - strcpy( namepre_out[i].name, "\0" ); - namepre_out[i].pressure = -1; + strcpy( namepre_out[u].name, "\0" ); + namepre_out[u].pressure = -1; } /*------------------------------------------------------------------------- @@ -1271,10 +1272,10 @@ test_table(hid_t fid, int do_write) goto out; /* compare the extracted table with the initial values */ - for( i = 0; i < 3; i++ ) + for( u = 0; u < 3; u++ ) { - if ( ( strcmp( namepre_out[i].name, wbuf[start+i].name ) != 0 ) || - namepre_out[i].pressure != wbuf[start+i].pressure ) { + if ( ( strcmp( namepre_out[u].name, wbuf[(size_t)start+u].name ) != 0 ) || + namepre_out[u].pressure != wbuf[(size_t)start+u].pressure ) { goto out; } } @@ -1312,14 +1313,14 @@ test_table(hid_t fid, int do_write) goto out; /* compare the extracted table with the original array */ - for( i = 0; i < NRECORDS; i++ ) + for( u = 0; u < (size_t)NRECORDS; u++ ) { - if ( ( strcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) || - rbuf2[i].lati != wbuf[i].lati || - rbuf2[i].longi != wbuf[i].longi || - rbuf2[i].pressure != wbuf[i].pressure || - rbuf2[i].temperature != wbuf[i].temperature || - rbuf2[i].new_field != buf_new[i] ) { + if ( ( strcmp( rbuf2[u].name, wbuf[u].name ) != 0 ) || + rbuf2[u].lati != wbuf[u].lati || + rbuf2[u].longi != wbuf[u].longi || + rbuf2[u].pressure != wbuf[u].pressure || + rbuf2[u].temperature != wbuf[u].temperature || + rbuf2[u].new_field != buf_new[u] ) { goto out; } } @@ -1355,12 +1356,12 @@ test_table(hid_t fid, int do_write) goto out; /* compare the extracted table with the original array */ - for( i = 0; i < NRECORDS; i++ ) + for( u = 0; u < (size_t)NRECORDS; u++ ) { - if ( ( strcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) || - rbuf3[i].lati != wbuf[i].lati || - rbuf3[i].longi != wbuf[i].longi || - rbuf3[i].temperature != wbuf[i].temperature ) { + if ( ( strcmp( rbuf3[u].name, wbuf[u].name ) != 0 ) || + rbuf3[u].lati != wbuf[u].lati || + rbuf3[u].longi != wbuf[u].longi || + rbuf3[u].temperature != wbuf[u].temperature ) { goto out; } } @@ -1403,26 +1404,26 @@ test_table(hid_t fid, int do_write) /* alocate */ names_out = malloc( sizeof(char*) * (size_t)NFIELDS ); - for ( i = 0; i < NFIELDS; i++) + for ( u = 0; u < (size_t)NFIELDS; u++) { - names_out[i] = malloc( sizeof(char) * 255 ); + names_out[u] = malloc( sizeof(char) * 255 ); } /* Get field info */ if ( H5TBget_field_info(fid, "table1", names_out, sizes_out, offset_out, &size_out ) < 0 ) goto out; - for ( i = 0; i < NFIELDS; i++) + for ( u = 0; u < (size_t)NFIELDS; u++) { - if ( (strcmp( field_names[i], names_out[i] ) != 0)) { + if ( (strcmp( field_names[u], names_out[u] ) != 0)) { goto out; } } /* release */ - for ( i = 0; i < NFIELDS; i++) + for ( u = 0; u < (size_t)NFIELDS; u++) { - free ( names_out[i] ); + free ( names_out[u] ); } free ( names_out ); @@ -1549,8 +1550,9 @@ static hid_t h5file_open(const char *fname, unsigned flags) * function that compares one particle *------------------------------------------------------------------------- */ -static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf ) +static int cmp_par(hsize_t _i, hsize_t _j, particle_t *rbuf, particle_t *wbuf ) { + size_t i = (size_t)_i, j = (size_t)_j; if ( ( strcmp( rbuf[i].name, wbuf[j].name ) != 0 ) || rbuf[i].lati != wbuf[j].lati || rbuf[i].longi != wbuf[j].longi || diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h index 98317b2..94b3699 100644 --- a/src/H5Vprivate.h +++ b/src/H5Vprivate.h @@ -365,7 +365,8 @@ H5V_log2_gen(uint64_t n) if((tt = (unsigned)(n >> 16))) r = (t = (unsigned)(n >> 24)) ? 24 + LogTable256[t] : 16 + LogTable256[tt & 0xFF]; else - r = (t = (unsigned)(n >> 8)) ? 8 + LogTable256[t] : LogTable256[n]; + /* Added 'uint8_t' cast to pacify PGCC compiler */ + r = (t = (unsigned)(n >> 8)) ? 8 + LogTable256[t] : LogTable256[(uint8_t)n]; #ifdef H5_BAD_LOG2_CODE_GENERATED } /* end else */ #endif /* H5_BAD_LOG2_CODE_GENERATED */ diff --git a/test/dsets.c b/test/dsets.c index 794f9c2..1d055d2 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -1312,7 +1312,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */ const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */ void *tconv_buf = NULL; /* Temporary conversion buffer */ - hsize_t i, j, n; /* Local index variables */ + size_t i, j, n; /* Local index variables */ herr_t status; /* Error status */ /* Create the data space */ @@ -1357,8 +1357,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, if (H5Dread (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0) goto error; - for (i=0; i= size of int */ - for (i= 0;i< size[0]; i++) - for (j = 0; j < size[1]; j++) { + for (i= 0;i< (size_t)size[0]; i++) + for (j = 0; j < (size_t)size[1]; j++) { orig_data[i][j] = (int)(((long_long)HDrandom() % (long_long)HDpow(2.0, (double)(precision - 1))) << offset); @@ -2621,8 +2621,8 @@ test_nbit_int(hid_t file) * Use mask for checking the significant bits, ignoring the padding bits */ mask = ~(~0 << (precision + offset)) & (~0 << offset); - for (i=0; i= size of unsigned int */ - for (i= 0;i< size[0]; i++) - for (j = 0; j < size[1]; j++) - for (m = 0; m < adims[0]; m++) - for (n = 0; n < adims[1]; n++) + for (i= 0;i< (size_t)size[0]; i++) + for (j = 0; j < (size_t)size[1]; j++) + for (m = 0; m < (size_t)adims[0]; m++) + for (n = 0; n < (size_t)adims[1]; n++) orig_data[i][j][m][n] = (unsigned int)(((long_long)HDrandom() % (long_long)HDpow(2.0, (double)precision)) << offset); PASSED(); @@ -3028,10 +3028,10 @@ test_nbit_array(hid_t file) /* Check that the values read are the same as the values written */ - for (i=0; i= size of member datatypes */ - for (i= 0;i< size[0]; i++) - for (j = 0; j < size[1]; j++) { + for (i= 0;i< (size_t)size[0]; i++) + for (j = 0; j < (size_t)size[1]; j++) { orig_data[i][j].i = (int)(((long_long)HDrandom() % (long_long)HDpow(2.0, (double)(precision[0]-1))) << offset[0]); orig_data[i][j].c = (char)(((long_long)HDrandom() % @@ -3319,7 +3319,7 @@ test_nbit_compound_2(hid_t file) complex orig_data[2][5]; complex new_data[2][5]; unsigned int i_mask, s_mask, c_mask, b_mask; - hsize_t i, j, m, n, b_failed, d_failed; + size_t i, j, m, n, b_failed, d_failed; #else /* H5_HAVE_FILTER_NBIT */ const char *not_supported= " Nbit is not enabled."; @@ -3413,8 +3413,8 @@ test_nbit_compound_2(hid_t file) space,dc))<0) goto error; /* Initialize data, assuming size of long_long >= size of member datatypes */ - for (i= 0;i< size[0]; i++) - for (j = 0; j < size[1]; j++) { + for (i= 0;i< (size_t)size[0]; i++) + for (j = 0; j < (size_t)size[1]; j++) { orig_data[i][j].a.i = (int)(((long_long)HDrandom() % (long_long)HDpow(2.0, (double)(precision[0]-1))) << offset[0]); orig_data[i][j].a.c = (char)(((long_long)HDrandom() % @@ -3426,13 +3426,13 @@ test_nbit_compound_2(hid_t file) orig_data[i][j].v = (unsigned int)(((long_long)HDrandom() % (long_long)HDpow(2.0, (double)precision[3])) << offset[3]); - for(m = 0; m < array_dims[0]; m++) - for(n = 0; n < array_dims[1]; n++) + for(m = 0; m < (size_t)array_dims[0]; m++) + for(n = 0; n < (size_t)array_dims[1]; n++) orig_data[i][j].b[m][n] = (char)(((long_long)HDrandom() % (long_long)HDpow(2.0, (double)(precision[4]-1))) << offset[4]); - for(m = 0; m < array_dims[0]; m++) - for(n = 0; n < array_dims[1]; n++) { + for(m = 0; m < (size_t)array_dims[0]; m++) + for(n = 0; n < (size_t)array_dims[1]; n++) { orig_data[i][j].d[m][n].i = (int)(-((long_long)HDrandom() % (long_long)HDpow(2.0, (double)(precision[0]-1))) << offset[0]); orig_data[i][j].d[m][n].c = (char)(((long_long)HDrandom() % @@ -3485,20 +3485,20 @@ test_nbit_compound_2(hid_t file) c_mask = ~(~0 << (precision[1] + offset[1])) & (~0 << offset[1]); s_mask = ~(~0 << (precision[2] + offset[2])) & (~0 << offset[2]); b_mask = ~(~0 << (precision[4] + offset[4])) & (~0 << offset[4]); - for (i=0; i HDpow(10.0, -3.0)) { H5_FAILED(); printf(" Read different values than written.\n"); @@ -4194,7 +4194,7 @@ test_scaleoffset_float_2(hid_t file) hsize_t stride[2]; /* Stride of hyperslab */ hsize_t count[2]; /* Block count */ hsize_t block[2]; /* Block sizes */ - hsize_t j; + size_t j; #else /* H5_HAVE_FILTER_SCALEOFFSET */ const char *not_supported= " Scaleoffset is not enabled."; #endif /* H5_HAVE_FILTER_SCALEOFFSET */ @@ -4240,7 +4240,7 @@ test_scaleoffset_float_2(hid_t file) stride, count, block)<0) goto error; /* Initialize data of hyperslab */ - for (j = 0; j < size[1]; j++) { + for (j = 0; j < (size_t)size[1]; j++) { orig_data[0][j] = (float)((HDrandom() % 100000) / (float)1000.0); /* even-numbered values are negtive */ @@ -4283,7 +4283,7 @@ test_scaleoffset_float_2(hid_t file) new_data)<0) goto error; /* Check that the values read are the same as the values written */ - for (j=0; j HDpow(10.0, -3.0)) { H5_FAILED(); printf(" Read different values than written.\n"); @@ -4337,7 +4337,7 @@ test_scaleoffset_double(hid_t file) const hsize_t chunk_size[2] = {2,5}; double orig_data[2][5]; double new_data[2][5]; - hsize_t i, j; + size_t i, j; #else /* H5_HAVE_FILTER_SCALEOFFSET */ const char *not_supported= " Scaleoffset is not enabled."; #endif /* H5_HAVE_FILTER_SCALEOFFSET */ @@ -4369,8 +4369,8 @@ test_scaleoffset_double(hid_t file) space,dc))<0) goto error; /* Initialize data */ - for (i= 0;i< size[0]; i++) - for (j = 0; j < size[1]; j++) { + for (i= 0;i< (size_t)size[0]; i++) + for (j = 0; j < (size_t)size[1]; j++) { orig_data[i][j] = (HDrandom() % 10000000) / 10000000.0; /* even-numbered values are negtive */ @@ -4412,8 +4412,8 @@ test_scaleoffset_double(hid_t file) new_data)<0) goto error; /* Check that the values read are the same as the values written */ - for (i=0; i HDpow(10.0, -7.0)) { H5_FAILED(); printf(" Read different values than written.\n"); @@ -4474,7 +4474,7 @@ test_scaleoffset_double_2(hid_t file) hsize_t stride[2]; /* Stride of hyperslab */ hsize_t count[2]; /* Block count */ hsize_t block[2]; /* Block sizes */ - hsize_t j; + size_t j; #else /* H5_HAVE_FILTER_SCALEOFFSET */ const char *not_supported= " Scaleoffset is not enabled."; #endif /* H5_HAVE_FILTER_SCALEOFFSET */ @@ -4520,7 +4520,7 @@ test_scaleoffset_double_2(hid_t file) stride, count, block)<0) goto error; /* Initialize data of hyperslab */ - for (j = 0; j < size[1]; j++) { + for (j = 0; j < (size_t)size[1]; j++) { orig_data[0][j] = (HDrandom() % 10000000) / 10000000.0; /* even-numbered values are negtive */ @@ -4563,7 +4563,7 @@ test_scaleoffset_double_2(hid_t file) new_data)<0) goto error; /* Check that the values read are the same as the values written */ - for (j=0; j HDpow(10.0, -7.0)) { H5_FAILED(); printf(" Read different values than written.\n"); @@ -4794,7 +4794,7 @@ test_can_apply(hid_t file) const hsize_t dims[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ const hsize_t chunk_dims[2] = {2, 25}; /* Chunk dimensions */ hsize_t dset_size; /* Dataset size */ - hsize_t i,j; /* Local index variables */ + size_t i,j; /* Local index variables */ TESTING("dataset filter 'can apply' callback"); @@ -4883,8 +4883,8 @@ test_can_apply(hid_t file) /* Compare data */ /* Check that the values read are the same as the values written */ - for (i=0; i 0) - for (i = 0; i < ctx.ndims; i++) + for (i = 0; i < (size_t)ctx.ndims; i++) ctx.p_min_idx[i] = 0; H5Sget_simple_extent_dims(f_space, total_size, NULL); @@ -794,7 +796,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset /* get the offset count */ outer_count = 1; if (ctx.ndims > 2) - for (i = 0; i < ctx.ndims - 2; i++) + for (i = 0; i < (size_t)ctx.ndims - 2; i++) outer_count *= sset->count[ i ]; if(ctx.ndims>0) @@ -802,7 +804,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset /* initialize temporary start, count and maximum start */ - for (i = 0; i < ctx.ndims; i++) + for (i = 0; i < (size_t)ctx.ndims; i++) { temp_start[ i ] = sset->start[ i ]; temp_count[ i ] = sset->count[ i ]; @@ -811,7 +813,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset } if (ctx.ndims > 2) { - for (i = 0; i < ctx.ndims - 2; i++) + for (i = 0; i < (size_t)ctx.ndims - 2; i++) { max_start[ i ] = temp_start[ i ] + sset->count[ i ]; temp_count[ i ] = 1; @@ -896,10 +898,10 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset the element position at the start of hyperslab */ H5Sget_select_bounds(f_space,low,high); elmtno=0; - for (i = 0; i < ctx.ndims-1; i++) + for (i = 0; i < (size_t)ctx.ndims-1; i++) { hsize_t offset = 1; /* accumulation of the previous dimensions */ - for (j = i+1; j < ctx.ndims; j++) + for (j = i+1; j < (size_t)ctx.ndims; j++) offset *= total_size[j]; elmtno+= low[i] * offset; } @@ -989,7 +991,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, hid_t dset, { hid_t f_space; /* file data space */ hsize_t elmtno; /* counter */ - hsize_t i; /* counter */ + size_t i; /* counter */ int carry; /* counter carry value */ hsize_t zero[8]; /* vector of zeros */ unsigned int flags; /* buffer extent flags */ @@ -1037,7 +1039,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, hid_t dset, /* Assume entire data space to be printed */ if (ctx.ndims > 0) - for (i = 0; i < ctx.ndims; i++) + for (i = 0; i < (size_t)ctx.ndims; i++) ctx.p_min_idx[i] = 0; H5Sget_simple_extent_dims(f_space, total_size, NULL); diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index b4c5cc3..57758a1 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -312,7 +312,7 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, hsize_t max_idx[], h5tools_context_t *ctx) { hsize_t p_prod[H5S_MAX_RANK]; - hsize_t i = 0; + size_t i = 0; hsize_t curr_pos=elmtno; h5tools_str_reset(str); @@ -325,7 +325,7 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, for (i = ndims - 1, p_prod[ndims - 1] = 1; i > 0; --i) p_prod[i - 1] = (max_idx[i] - min_idx[i]) * p_prod[i]; - for ( i = 0; i < (hsize_t)ndims; i++) + for ( i = 0; i < (size_t)ndims; i++) { ctx->pos[i] = curr_pos/ctx->acc[i]; curr_pos -= ctx->acc[i]*ctx->pos[i]; @@ -333,7 +333,7 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, assert( curr_pos == 0 ); /* Print the index values */ - for (i = 0; i < (hsize_t)ndims; i++) { + for (i = 0; i < (size_t)ndims; i++) { if (i) h5tools_str_append(str, "%s", OPT(info->idx_sep, ",")); -- cgit v0.12