diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2016-07-18 00:18:42 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2016-07-18 00:18:42 (GMT) |
commit | bb19817c9fd5d46cdc1ab5a396f38f0561dfa167 (patch) | |
tree | 69498cabeabf6f68faa23b835e24cb7ef4f80563 /tools | |
parent | c8f4641507bf4ca85c70c39c786c07f8ef4a24ed (diff) | |
download | hdf5-bb19817c9fd5d46cdc1ab5a396f38f0561dfa167.zip hdf5-bb19817c9fd5d46cdc1ab5a396f38f0561dfa167.tar.gz hdf5-bb19817c9fd5d46cdc1ab5a396f38f0561dfa167.tar.bz2 |
[svn-r30189] Description:
Clean up more warnings: drop the warning count from ~1310 down to ~940,
with only 31 types of warnings in 148 files (down from 38 types in 167 files).
Tested on:
MacOSX/64 10.11.5 (amazon) w/serial & parallel
(h5committest forthcoming)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5copy/h5copy.c | 24 | ||||
-rw-r--r-- | tools/h5diff/h5diff_main.c | 5 | ||||
-rw-r--r-- | tools/h5diff/h5diffgentest.c | 217 | ||||
-rw-r--r-- | tools/h5format_convert/h5fc_gentest.c | 4 | ||||
-rw-r--r-- | tools/h5jam/h5unjam.c | 10 | ||||
-rw-r--r-- | tools/h5ls/h5ls.c | 10 | ||||
-rw-r--r-- | tools/h5repack/h5repack.c | 5 | ||||
-rw-r--r-- | tools/h5repack/h5repack_filters.c | 17 | ||||
-rw-r--r-- | tools/lib/h5tools_filters.c | 4 | ||||
-rw-r--r-- | tools/lib/h5tools_ref.c | 2 | ||||
-rw-r--r-- | tools/perform/sio_engine.c | 32 | ||||
-rw-r--r-- | tools/perform/sio_perf.c | 89 | ||||
-rw-r--r-- | tools/perform/sio_perf.h | 32 | ||||
-rw-r--r-- | tools/perform/zip_perf.c | 24 |
14 files changed, 236 insertions, 239 deletions
diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index f3a0d7a..5371a21 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -417,19 +417,19 @@ main (int argc, const char *argv[]) /* create property to pass copy options */ if ( (ocpl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed"); + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pcreate failed"); /* set options for object copy */ if (flag) { if ( H5Pset_copy_object(ocpl_id, flag) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_copy_object failed"); + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pset_copy_object failed"); } /* Create link creation property list */ if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) { error_msg("Could not create link creation property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed"); + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pcreate failed"); } /* end if */ /* Check for creating intermediate groups */ @@ -437,7 +437,7 @@ main (int argc, const char *argv[]) /* Set the intermediate group creation property */ if(H5Pset_create_intermediate_group(lcpl_id, 1) < 0) { error_msg("Could not set property for creating parent groups\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_create_intermediate_group failed"); + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pset_create_intermediate_group failed"); } /* end if */ /* Display some output if requested */ @@ -464,7 +464,7 @@ main (int argc, const char *argv[]) { error_msg("group <%s> doesn't exist. Use -p to create parent groups.\n", str_ptr); HDfree(str_ptr); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Lexists failed"); + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Lexists failed"); } HDfree(str_ptr); } @@ -484,7 +484,7 @@ main (int argc, const char *argv[]) if(H5Lcopy(fid_src, oname_src, fid_dst, oname_dst, H5P_DEFAULT, H5P_DEFAULT) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Lcopy failed"); + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Lcopy failed"); } else /* valid link */ { @@ -494,7 +494,7 @@ main (int argc, const char *argv[]) oname_dst, /* Name of the destination object */ ocpl_id, /* Object copy property list */ lcpl_id)<0) /* Link creation property list */ - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Ocopy failed"); + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Ocopy failed"); } /* free link info path */ @@ -503,15 +503,15 @@ main (int argc, const char *argv[]) /* close propertis */ if(H5Pclose(ocpl_id)<0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pclose failed"); if(H5Pclose(lcpl_id)<0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pclose failed"); /* close files */ if (H5Fclose(fid_src)<0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fclose failed"); + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Fclose failed"); if (H5Fclose(fid_dst)<0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fclose failed"); + HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Fclose failed"); leave(EXIT_SUCCESS); @@ -529,6 +529,6 @@ done: H5Fclose(fid_dst); } H5E_END_TRY; - leave(EXIT_FAILURE); + leave(ret_value); } diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 7b4bc39..cdaca29 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -16,6 +16,7 @@ #include <stdlib.h> #include <assert.h> #include <memory.h> +#include "H5private.h" #include "h5diff.h" #include "h5diff_common.h" #include "h5tools.h" @@ -136,9 +137,9 @@ int main(int argc, const char *argv[]) * *------------------------------------------------------------------------- */ -void +H5_ATTR_NORETURN void h5diff_exit(int status) { - exit(status); + HDexit(status); } diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index 937bd32..339ff6c 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -28,7 +28,7 @@ * NOTE: this value should stay in sync with the value defined in the tools * library file: h5tools_utils.h */ -hsize_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); +size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); /*------------------------------------------------------------------------- * Program: h5diffgentest @@ -3745,7 +3745,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* vlen string */ hid_t sid_vlen_str=0; /* dataspace ID */ hid_t tid_vlen_str=0; /* datatype ID */ - const char vlen_str_buf[]= { + char vlen_str_buf[]= { "Variable length string" }; hsize_t dims_vlen_str[] = {VLEN_STR_DIM}; @@ -3762,7 +3762,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int hid_t sid_vlen_str_array=0; /* dataspace ID */ hid_t tid_vlen_str_array_pre=0; /* datatype ID */ hid_t tid_vlen_str_array=0; /* datatype ID */ - const char *vlen_str_array_buf[VLEN_STR_ARRY_DIM]= { + char *vlen_str_array_buf[VLEN_STR_ARRY_DIM]= { "1 - Variable length string Array", "2 - Testing variable length string array in compound type", "3 - Four score and seven\n years ago our forefathers brought forth on this continent a new nation," @@ -4478,8 +4478,8 @@ static void test_comps_array (const char *fname, const char *dset, const char *a wdata[i].i1 = i; for(j=0; j < SDIM_CMPD_ARRAY; j++) { - wdata[i].cmpd2[j].i2 = i*10 + diff; - wdata[i].cmpd2[j].f2 = (float)(i*10.5F) + diff; + wdata[i].cmpd2[j].i2 = i * 10 + diff; + wdata[i].cmpd2[j].f2 = (float)i * 10.5F + (float)diff; } /* end for */ } @@ -4588,15 +4588,13 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a herr_t ret; /* Generic return value */ /* Allocate and initialize VL data to write */ - for(i=0; i<SDIM_DSET; i++) - { - wdata[i].i1 = i; - wdata[i].vl.p = HDmalloc((i+1)*sizeof(cmpd2_t)); - wdata[i].vl.len = i+1; - for(j=0; j<(i+1); j++) - { - ((cmpd2_t *)wdata[i].vl.p)[j].i2 = i*10 + diff; - ((cmpd2_t *)wdata[i].vl.p)[j].f2 = (float)(i*10.5F) + diff; + for(i = 0; i < SDIM_DSET; i++) { + wdata[i].i1 = (int)i; + wdata[i].vl.p = HDmalloc((i + 1) * sizeof(cmpd2_t)); + wdata[i].vl.len = i + 1; + for(j = 0; j < (i + 1); j++) { + ((cmpd2_t *)wdata[i].vl.p)[j].i2 = (int)(i * 10 + (unsigned)diff); + ((cmpd2_t *)wdata[i].vl.p)[j].f2 = (float)i * 10.5F + (float)diff; } /* end for */ } /* end for */ @@ -4703,26 +4701,24 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch hid_t tid_cmpd3; /* Compound3 Datatype ID */ hsize_t sdims_dset[] = {SDIM_DSET}; hsize_t sdims_arry[] = {SDIM_CMPD_ARRAY}; - int i,j,k; /* counting variables */ - herr_t ret; /* Generic return value */ + unsigned i, j, k; /* counting variables */ + herr_t ret; /* Generic return value */ /* Initialize array data to write in compound1 */ - for(i=0; i < SDIM_DSET; i++) - { - wdata[i].i1 = i; + for(i = 0; i < SDIM_DSET; i++) { + wdata[i].i1 = (int)i; + /* Allocate and initialize VL data to write in compound2 */ - for(j=0; j < SDIM_CMPD_ARRAY; j++) - { - wdata[i].cmpd2[j].i2 = j*10; - wdata[i].cmpd2[j].vl.p = HDmalloc((j+1)*sizeof(cmpd3_t)); - wdata[i].cmpd2[j].vl.len = j+1; - for(k=0; k<(j+1); k++) - { + for(j = 0; j < SDIM_CMPD_ARRAY; j++) { + wdata[i].cmpd2[j].i2 = (int)(j * 10); + wdata[i].cmpd2[j].vl.p = HDmalloc((j + 1) * sizeof(cmpd3_t)); + wdata[i].cmpd2[j].vl.len = j + 1; + for(k = 0; k < (j + 1); k++) { /* Initialize data of compound3 */ - ((cmpd3_t *)wdata[i].cmpd2[j].vl.p)[k].i3 = j*10 + diff; - ((cmpd3_t *)wdata[i].cmpd2[j].vl.p)[k].f3 = (float)(j*10.5F) + diff; + ((cmpd3_t *)wdata[i].cmpd2[j].vl.p)[k].i3 = (int)j * 10 + diff; + ((cmpd3_t *)wdata[i].cmpd2[j].vl.p)[k].f3 = (float)j * 10.5F + (float)diff; } /* end for */ } /* end for */ } @@ -4856,22 +4852,19 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch herr_t ret; /* Generic return value */ /* Allocate and initialize VL data to write */ - for(i=0; i<SDIM_DSET; i++) - { + for(i = 0; i < SDIM_DSET; i++) { /* compound 1 data */ - wdata[i].i1 = i; - wdata[i].vl.p = HDmalloc((i+1)*sizeof(cmpd2_t)); - wdata[i].vl.len = i+1; - for(j=0; j<(i+1); j++) - { + wdata[i].i1 = (int)i; + wdata[i].vl.p = HDmalloc((i + 1) * sizeof(cmpd2_t)); + wdata[i].vl.len = i + 1; + for(j = 0; j < (i + 1); j++) { /* compound2 data */ - ((cmpd2_t *)wdata[i].vl.p)[j].i2 = i*10 + diff; - for (k=0; k < SDIM_CMPD_ARRAY; k++) - { + ((cmpd2_t *)wdata[i].vl.p)[j].i2 = (int)i * 10 + diff; + for(k = 0; k < SDIM_CMPD_ARRAY; k++) { /* compound 3 data */ - ((cmpd2_t *)(wdata[i].vl.p))[j].cmpd3[k].i3 = k*10.5F + diff; - ((cmpd2_t *)(wdata[i].vl.p))[j].cmpd3[k].f3 = (float)(k*10.5F) + diff; - } + ((cmpd2_t *)(wdata[i].vl.p))[j].cmpd3[k].i3 = (int)((float)k * 10.5F) + diff; + ((cmpd2_t *)(wdata[i].vl.p))[j].cmpd3[k].f3 = (float)k * 10.5F + (float)diff; + } /* end for */ } /* end for */ } /* end for */ @@ -5857,13 +5850,15 @@ void write_attr_in(hid_t loc_id, /* Allocate and initialize VL dataset to write */ n=0; - for (i = 0; i < 3; i++) { - for (j = 0; j < 2; j++) { - buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); - buf52[i][j].len = i + 1; - for (l = 0; l < i + 1; l++) - if (make_diffs)((int *)buf52[i][j].p)[l] = 0; - else ((int *)buf52[i][j].p)[l] = n++; + for(i = 0; i < 3; i++) { + for(j = 0; j < 2; j++) { + buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].len = (size_t)(i + 1); + for(l = 0; l < i + 1; l++) + if(make_diffs) + ((int *)buf52[i][j].p)[l] = 0; + else + ((int *)buf52[i][j].p)[l] = n++; } } @@ -6074,8 +6069,10 @@ void write_attr_in(hid_t loc_id, for (i = 0; i < 4; i++) { for (j = 0; j < 3; j++) { for (k = 0; k < 2; k++) { - if (make_diffs) buf23[i][j][k]=0; - else buf23[i][j][k]=n++; + if(make_diffs) + buf23[i][j][k] = 0; + else + buf23[i][j][k] = (char)n++; } } } @@ -6132,12 +6129,12 @@ void write_attr_in(hid_t loc_id, for (j = 0; j < 3; j++) { for (k = 0; k < 2; k++) { if (make_diffs) { - buf33[i][j][k].a=0; - buf33[i][j][k].b=0.0F; + buf33[i][j][k].a = 0; + buf33[i][j][k].b = 0.0F; } else { - buf33[i][j][k].a=n++; - buf33[i][j][k].b=n++; + buf33[i][j][k].a = (char)n++; + buf33[i][j][k].b = n++; } } } @@ -6275,11 +6272,13 @@ void write_attr_in(hid_t loc_id, for (i = 0; i < 4; i++) { for (j = 0; j < 3; j++) { for (k = 0; k < 2; k++) { - buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); - buf53[i][j][k].len = i + 1; + buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) - if (make_diffs)((int *)buf53[i][j][k].p)[l] = 0; - else ((int *)buf53[i][j][k].p)[l] = n++; + if(make_diffs) + ((int *)buf53[i][j][k].p)[l] = 0; + else + ((int *)buf53[i][j][k].p)[l] = n++; } } } @@ -6649,22 +6648,21 @@ void write_dset_in(hid_t loc_id, status = H5Tclose(tid); { - double *dbuf; /* information to write */ - hid_t did; /* dataset ID */ - hid_t sid; /* dataspace ID */ - hid_t tid; /* datatype ID */ + hid_t ldid; /* dataset ID */ + hid_t lsid; /* dataspace ID */ + hid_t ltid; /* datatype ID */ size_t size; hsize_t sdims[] = {1}; hsize_t tdims[] = {H5TOOLS_MALLOCSIZE / sizeof(double) + 1}; - int j; + size_t jj; /* allocate and initialize array data to write */ size = ( H5TOOLS_MALLOCSIZE / sizeof(double) + 1 ) * sizeof(double); - dbuf = (double *)HDmalloc( size ); + dbuf = (double *)HDmalloc(size); - for( j = 0; j < H5TOOLS_MALLOCSIZE / sizeof(double) + 1; j++) - dbuf[j] = j; + for(jj = 0; jj < (H5TOOLS_MALLOCSIZE / sizeof(double) + 1); jj++) + dbuf[jj] = (double)jj; if (make_diffs) { @@ -6673,19 +6671,19 @@ void write_dset_in(hid_t loc_id, } /* create a type larger than H5TOOLS_MALLOCSIZE */ - tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, 1, tdims); - size = H5Tget_size(tid); - sid = H5Screate_simple(1, sdims, NULL); - did = H5Dcreate2(loc_id, "arrayd", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + ltid = H5Tarray_create2(H5T_NATIVE_DOUBLE, 1, tdims); + size = H5Tget_size(ltid); + lsid = H5Screate_simple(1, sdims, NULL); + ldid = H5Dcreate2(loc_id, "arrayd", ltid, lsid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); #if defined(WRITE_ARRAY) - H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf); + H5Dwrite(ldid, ltid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf); #endif /* close */ - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - HDfree( dbuf ); + H5Dclose(ldid); + H5Tclose(ltid); + H5Sclose(lsid); + HDfree(dbuf); } /*------------------------------------------------------------------------- @@ -6815,15 +6813,12 @@ void write_dset_in(hid_t loc_id, /* Allocate and initialize VL dataset to write */ n = 0; - for(i = 0; i < 3; i++) - { - for(j = 0; j < 2; j++) - { - buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); - buf52[i][j].len = i + 1; - for(l = 0; l < i + 1; l++) - { - if (make_diffs) + for(i = 0; i < 3; i++) { + for(j = 0; j < 2; j++) { + buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].len = (size_t)(i + 1); + for(l = 0; l < i + 1; l++) { + if(make_diffs) ((int *)buf52[i][j].p)[l] = 0; else ((int *)buf52[i][j].p)[l] = n++; @@ -6933,15 +6928,13 @@ void write_dset_in(hid_t loc_id, n=1; - for (i = 0; i < 4; i++) - { - for (j = 0; j < 3; j++) - { - for (k = 0; k < 2; k++) - { - if (make_diffs) - buf23[i][j][k]=0; - else buf23[i][j][k]=n++; + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + if(make_diffs) + buf23[i][j][k] = 0; + else + buf23[i][j][k] = (char)n++; } } } @@ -6966,20 +6959,16 @@ void write_dset_in(hid_t loc_id, */ n=1; - for (i = 0; i < 4; i++) - { - for (j = 0; j < 3; j++) - { - for (k = 0; k < 2; k++) - { - if (make_diffs) - { - buf33[i][j][k].a=0; - buf33[i][j][k].b=0.0F; + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + if (make_diffs) { + buf33[i][j][k].a = 0; + buf33[i][j][k].b = 0.0F; } else { - buf33[i][j][k].a=n++; - buf33[i][j][k].b=n++; + buf33[i][j][k].a = (char)n++; + buf33[i][j][k].b = n++; } } } @@ -7026,16 +7015,12 @@ void write_dset_in(hid_t loc_id, /* Allocate and initialize VL dataset to write */ n=0; - for(i = 0; i < 4; i++) - { - for(j = 0; j < 3; j++) - { - for(k = 0; k < 2; k++) - { - buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); - buf53[i][j][k].len = i + 1; - for(l = 0; l < i + 1; l++) - { + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { + buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].len = (size_t)(i + 1); + for(l = 0; l < i + 1; l++) { if(make_diffs) ((int *)buf53[i][j][k].p)[l] = 0; else @@ -7265,7 +7250,7 @@ int test_hyperslab(const char *fname, if(make_diffs && i == 512 * 512) HDmemset(buf, 0, nelmts); - hs_start[0] = i * GBLL/(1024*1024); + hs_start[0] = (unsigned long long)i * GBLL / (1024 * 1024); if (H5Sselect_hyperslab (f_sid,H5S_SELECT_SET,hs_start,NULL,hs_size, NULL) < 0) goto out; diff --git a/tools/h5format_convert/h5fc_gentest.c b/tools/h5format_convert/h5fc_gentest.c index 8d3c5ae..97def9a 100644 --- a/tools/h5format_convert/h5fc_gentest.c +++ b/tools/h5format_convert/h5fc_gentest.c @@ -471,9 +471,9 @@ gen_err_level(const char *fname) hsize_t extent[2] = {0, 0}; start[0] = 0; - start[1] = n; + start[1] = (hsize_t)n; extent[0] = 1; - extent[1] = n+1; + extent[1] = (hsize_t)(n + 1); /* Set current dimension sizes for the dataset */ if(H5Dset_extent(did, extent) < 0) diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index 8e4eac4..8f88398 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -347,17 +347,19 @@ done: * Returns 0 on success, -1 on failure. */ herr_t -copy_to_file( FILE *infid, FILE *ofid, ssize_t _where, ssize_t how_much ) +copy_to_file( FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much ) { static char buf[COPY_BUF_SIZE]; + size_t how_much; off_t where = (off_t)_where; off_t to; off_t from; herr_t ret_value = 0; /* nothing to copy */ - if(how_much <= 0) + if(show_much <= 0) goto done; + how_much = (size_t)show_much; /* rewind */ HDfseek(infid, 0L, 0); @@ -392,8 +394,8 @@ copy_to_file( FILE *infid, FILE *ofid, ssize_t _where, ssize_t how_much ) /* Update positions/size */ how_much -= bytes_read; - from += bytes_read; - to += bytes_read; + from += (off_t)bytes_read; + to += (off_t)bytes_read; /* Write nchars bytes to output file */ bytes_wrote = HDfwrite(buf, (size_t)1, bytes_read, ofid); diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 98468c9..62de46c 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -196,7 +196,9 @@ usage: %s [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]\n\ as a soft link or external link and prints the value\n\ assigned to the symbolic link; it does not provide any\n\ information regarding the target object or determine\n\ - whether the link is a dangling link.\n\ + whether the link is a dangling link.\n", + h5tools_getprogname()); + HDfprintf(rawerrorstream, "\ --no-dangling-links\n\ Must be used with --follow-symlinks option;\n\ otherwise, h5ls shows error message and returns an exit\n\ @@ -216,7 +218,8 @@ usage: %s [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]\n\ -v, --verbose Generate more verbose output\n\ -V, --version Print version number and exit\n\ --vfd=DRIVER Use the specified virtual file driver\n\ - -x, --hexdump Show raw data in hexadecimal format\n\ + -x, --hexdump Show raw data in hexadecimal format\n"); + HDfprintf(rawerrorstream, "\ \n\ file/OBJECT\n\ Each object consists of an HDF5 file name optionally followed by a\n\ @@ -235,8 +238,7 @@ usage: %s [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]\n\ -E or --external Follow external links.\n\ Replaced by --follow-symlinks.\n\ -e, --errors Show all HDF5 error reporting\n\ - Replaced by --enable-error-stack.\n", - h5tools_getprogname()); + Replaced by --enable-error-stack.\n"); } diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index cf30b2b..b915d3a 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -564,7 +564,7 @@ done: H5Aclose(attr_out); } H5E_END_TRY; - return -1; + return ret_value; } /* end copy_attr() */ /*------------------------------------------------------------------------- @@ -606,6 +606,9 @@ static int check_options(pack_opt_t *options) { case H5D_CHUNKED: strcpy(slayout, "chunked"); break; + case H5D_VIRTUAL: + strcpy(slayout, "virtual"); + break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: error_msg("invalid layout\n"); diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c index 56e08ef..e21b829 100644 --- a/tools/h5repack/h5repack_filters.c +++ b/tools/h5repack/h5repack_filters.c @@ -34,8 +34,8 @@ * *------------------------------------------------------------------------- */ -static -int aux_find_obj(const char* name, /* object name from traverse list */ +static int +aux_find_obj(const char* name, /* object name from traverse list */ pack_opt_t *options, /* repack options */ pack_info_t *obj /*OUT*/) /* info about object to filter */ { @@ -48,7 +48,7 @@ int aux_find_obj(const char* name, /* object name from traverse list */ if (HDstrcmp(options->op_tbl->objs[i].path,name)==0) { *obj = options->op_tbl->objs[i]; - return i; + return (int)i; } pdest = HDstrstr(name,options->op_tbl->objs[i].path); @@ -58,7 +58,7 @@ int aux_find_obj(const char* name, /* object name from traverse list */ if( pdest != NULL && result==1 ) { *obj = options->op_tbl->objs[i]; - return i; + return (int)i; } }/*i*/ @@ -76,8 +76,8 @@ int aux_find_obj(const char* name, /* object name from traverse list */ * *------------------------------------------------------------------------- */ -static -int aux_assign_obj(const char* name, /* object name from traverse list */ +static int +aux_assign_obj(const char* name, /* object name from traverse list */ pack_opt_t *options, /* repack options */ pack_info_t *obj /*OUT*/) /* info about object to filter */ { @@ -109,6 +109,7 @@ int aux_assign_obj(const char* name, /* object name from traverse lis case H5D_LAYOUT_ERROR: case H5D_COMPACT: case H5D_CONTIGUOUS: + case H5D_VIRTUAL: case H5D_NLAYOUTS: break; default: @@ -128,6 +129,7 @@ int aux_assign_obj(const char* name, /* object name from traverse lis case H5D_LAYOUT_ERROR: case H5D_COMPACT: case H5D_CONTIGUOUS: + case H5D_VIRTUAL: case H5D_NLAYOUTS: break; default: @@ -184,6 +186,7 @@ int aux_assign_obj(const char* name, /* object name from traverse lis case H5D_LAYOUT_ERROR: case H5D_COMPACT: case H5D_CONTIGUOUS: + case H5D_VIRTUAL: case H5D_NLAYOUTS: break; default: @@ -433,7 +436,7 @@ int apply_filters(const char* name, /* object name from traverse list */ int scale_factor; scale_type = (H5Z_SO_scale_type_t)obj.filter[i].cd_values[0]; - scale_factor = obj.filter[i].cd_values[1]; + scale_factor = (int)obj.filter[i].cd_values[1]; if(H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths)<0) return -1; diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 748eb78..486d1c6 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -13,7 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include "hdf5.h" +#include "H5private.h" #include "h5tools.h" /*------------------------------------------------------------------------- @@ -147,7 +147,7 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr * *------------------------------------------------------------------------- */ -int +H5_ATTR_CONST int h5tools_can_encode(H5Z_filter_t filtn) { switch (filtn) { /* user defined filter */ diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 60666f1..8c869c8 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -39,7 +39,7 @@ typedef struct { haddr_t objno; /* Object ID (i.e. address) */ - const char *path; /* Object path */ + char *path; /* Object path */ } ref_path_node_t; static H5SL_t *ref_path_table = NULL; /* the "table" (implemented with a skip list) */ diff --git a/tools/perform/sio_engine.c b/tools/perform/sio_engine.c index 505b0f7..11d8f65 100644 --- a/tools/perform/sio_engine.c +++ b/tools/perform/sio_engine.c @@ -123,8 +123,8 @@ static hid_t h5dxpl = -1; /* Dataset transfer property list */ * Programmer: Christian Chilan, April, 2008 * Modifications: */ - results -do_sio(parameters param) +void +do_sio(parameters param, results *res) { char *buffer = NULL; /*data buffer pointer */ size_t buf_size[MAX_DIMS]; /* general buffer size in bytes */ @@ -133,7 +133,6 @@ do_sio(parameters param) char base_name[256]; /* test file base name */ /* return codes */ herr_t ret_code = 0; /*return code */ - results res; char fname[FILENAME_MAX]; /* test file name */ int i; @@ -148,11 +147,11 @@ do_sio(parameters param) switch (iot) { case POSIXIO: fd.posixfd = -1; - res.timers = io_time_new(SYS_CLOCK); + res->timers = io_time_new(SYS_CLOCK); break; case HDF5: fd.h5fd = -1; - res.timers = io_time_new(SYS_CLOCK); + res->timers = io_time_new(SYS_CLOCK); break; default: /* unknown request */ @@ -209,18 +208,18 @@ do_sio(parameters param) HDfprintf(output, "data filename=%s\n", fname); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART); + set_time(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, SIO_CREATE | SIO_WRITE); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART); - hrc = do_write(&res, &fd, ¶m, buffer); - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP); + set_time(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART); + hrc = do_write(res, &fd, ¶m, buffer); + set_time(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_write failed"); /* Close file for write */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP); + set_time(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); if (!param.h5_write_only) { @@ -229,19 +228,19 @@ do_sio(parameters param) */ /* Open file for read */ - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART); + set_time(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, SIO_READ); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART); - hrc = do_read(&res, &fd, ¶m, buffer); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP); + set_time(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTART); + hrc = do_read(res, &fd, ¶m, buffer); + set_time(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_read failed"); /* Close file for read */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP); + set_time(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); } @@ -272,8 +271,7 @@ done: if (buffer) free(buffer); - res.ret_code = ret_code; - return res; + res->ret_code = ret_code; } /* diff --git a/tools/perform/sio_perf.c b/tools/perform/sio_perf.c index a69e929..aceccb0 100644 --- a/tools/perform/sio_perf.c +++ b/tools/perform/sio_perf.c @@ -68,7 +68,7 @@ #define SIO_HDF5 0x4 /* report 0.0 in case t is zero too */ -#define MB_PER_SEC(bytes,t) (((t)==0.0F) ? 0.0F : ((((double)bytes) / ONE_MB) / (t))) +#define MB_PER_SEC(bytes,t) (H5_DBL_ABS_EQUAL(t, (double)0.0F) ? (double)0.0F : ((((double)bytes) / (double)ONE_MB) / (t))) #ifndef TRUE #define TRUE 1 @@ -279,18 +279,18 @@ struct options { long num_files; /* number of files */ off_t num_bpp; /* number of bytes per proc per dset */ int num_iters; /* number of iterations */ - off_t dset_size[MAX_DIMS]; /* Dataset size */ + hsize_t dset_size[MAX_DIMS]; /* Dataset size */ size_t buf_size[MAX_DIMS]; /* Buffer size */ size_t chk_size[MAX_DIMS]; /* Chunk size */ - int order[MAX_DIMS]; /* Dimension access order */ - int dset_rank; /* Rank */ - int buf_rank; /* Rank */ + int order[MAX_DIMS]; /* Dimension access order */ + int dset_rank; /* Rank */ + int buf_rank; /* Rank */ int order_rank; /* Rank */ - int chk_rank; /* Rank */ + int chk_rank; /* Rank */ int print_times; /* print times as well as throughputs */ int print_raw; /* print raw data throughput info */ - off_t h5_alignment; /* alignment in HDF5 file */ - off_t h5_threshold; /* threshold for alignment in HDF5 file */ + hsize_t h5_alignment; /* alignment in HDF5 file */ + hsize_t h5_threshold; /* threshold for alignment in HDF5 file */ int h5_use_chunks; /* Make HDF5 dataset chunked */ int h5_write_only; /* Perform the write tests only */ int h5_extendable; /* Perform the write tests only */ @@ -307,13 +307,13 @@ typedef struct _minmax { } minmax; /* local functions */ -static off_t parse_size_directive(const char *size); +static hsize_t parse_size_directive(const char *size); static struct options *parse_command_line(int argc, char *argv[]); static void run_test_loop(struct options *options); static int run_test(iotype iot, parameters parms, struct options *opts); static void output_all_info(minmax *mm, int count, int indent_level); static void get_minmax(minmax *mm, double val); -static minmax accumulate_minmax_stuff(minmax *mm, int count); +static void accumulate_minmax_stuff(const minmax *mm, int count, minmax *total_mm); static void output_results(const struct options *options, const char *name, minmax *table, int table_size, off_t data_size); static void output_report(const char *fmt, ...); @@ -392,6 +392,7 @@ run_test_loop(struct options *opts) parameters parms; int i; size_t buf_bytes; + /* load options into parameter structure */ parms.num_files = opts->num_files; parms.num_dsets = opts->num_dsets; @@ -496,7 +497,8 @@ run_test(iotype iot, parameters parms, struct options *opts) /* Do IO iteration times, collecting statistics each time */ for (i = 0; i < parms.num_iters; ++i) { double t; - res = do_sio(parms); + + do_sio(parms, &res); /* gather all of the "sys write" times */ t = get_time(res.timers, HDF5_MPI_WRITE); @@ -711,30 +713,27 @@ get_minmax(minmax *mm, double val) * Modifications: * Changed to use seconds instead of MB/s - QAK, 5/9/02 */ -static minmax -accumulate_minmax_stuff(minmax *mm, int count) +static void +accumulate_minmax_stuff(const minmax *mm, int count, minmax *total_mm) { int i; - minmax total_mm; - total_mm.sum = 0.0F; - total_mm.max = -DBL_MAX; - total_mm.min = DBL_MAX; - total_mm.num = count; + total_mm->sum = 0.0F; + total_mm->max = -DBL_MAX; + total_mm->min = DBL_MAX; + total_mm->num = count; for (i = 0; i < count; ++i) { double m = mm[i].max; - total_mm.sum += m; + total_mm->sum += m; - if (m < total_mm.min) - total_mm.min = m; + if (m < total_mm->min) + total_mm->min = m; - if (m > total_mm.max) - total_mm.max = m; + if (m > total_mm->max) + total_mm->max = m; } - - return total_mm; } @@ -752,7 +751,7 @@ output_results(const struct options *opts, const char *name, minmax *table, { minmax total_mm; - total_mm = accumulate_minmax_stuff(table, table_size); + accumulate_minmax_stuff(table, table_size, &total_mm); print_indent(3); output_report("%s (%d iteration(s)):\n", name,table_size); @@ -940,10 +939,11 @@ report_parameters(struct options *opts) static struct options * parse_command_line(int argc, char *argv[]) { - register int opt; + int opt; struct options *cl_opts; int i, default_rank, actual_rank, ranks[4]; - cl_opts = (struct options *)malloc(sizeof(struct options)); + + cl_opts = (struct options *)HDmalloc(sizeof(struct options)); cl_opts->output_file = NULL; cl_opts->io_types = 0; /* will set default after parsing options */ @@ -956,11 +956,11 @@ parse_command_line(int argc, char *argv[]) cl_opts->chk_rank = 0; cl_opts->order_rank = 0; - for (i=0; i<MAX_DIMS; i++){ - cl_opts->buf_size[i]=(i+1)*10; - cl_opts->dset_size[i]=(i+1)*100; - cl_opts->chk_size[i]=(i+1)*10; - cl_opts->order[i]=i+1; + for(i = 0; i < MAX_DIMS; i++) { + cl_opts->buf_size[i] = (size_t)((i + 1) * 10); + cl_opts->dset_size[i] = (hsize_t)((i + 1) * 100); + cl_opts->chk_size[i] = (size_t)((i + 1) * 10); + cl_opts->order[i] = i + 1; } cl_opts->vfd = sec2; @@ -985,7 +985,7 @@ parse_command_line(int argc, char *argv[]) while (end && *end != '\0') { char buf[10]; - memset(buf, '\0', sizeof(buf)); + HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) if (isalnum(*end) && i < 10) @@ -1024,7 +1024,7 @@ parse_command_line(int argc, char *argv[]) while (end && *end != '\0') { char buf[10]; - memset(buf, '\0', sizeof(buf)); + HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) if (isalnum(*end) && i < 10) @@ -1052,7 +1052,7 @@ parse_command_line(int argc, char *argv[]) while (end && *end != '\0') { char buf[10]; - memset(buf, '\0', sizeof(buf)); + HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) if (isalnum(*end) && i < 10) @@ -1110,7 +1110,7 @@ parse_command_line(int argc, char *argv[]) while (end && *end != '\0') { char buf[10]; - memset(buf, '\0', sizeof(buf)); + HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) if (isalnum(*end) && i < 10) @@ -1174,7 +1174,7 @@ parse_command_line(int argc, char *argv[]) while (end && *end != '\0') { char buf[10]; - memset(buf, '\0', sizeof(buf)); + HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) if (isalnum(*end) && i < 10) @@ -1202,13 +1202,13 @@ parse_command_line(int argc, char *argv[]) while (end && *end != '\0') { char buf[10]; - memset(buf, '\0', sizeof(buf)); + HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) if (isalnum(*end) && i < 10) buf[i++] = *end; - cl_opts->order[j] = parse_size_directive(buf); + cl_opts->order[j] = (int)parse_size_directive(buf); j++; @@ -1294,13 +1294,13 @@ parse_command_line(int argc, char *argv[]) * Modifications: */ -static off_t +static hsize_t parse_size_directive(const char *size) { - off_t s; + hsize_t s; char *endptr; - s = strtol(size, &endptr, 10); + s = HDstrtoull(size, &endptr, 10); if (endptr && *endptr) { while (*endptr != '\0' && (*endptr == ' ' || *endptr == '\t')) @@ -1311,14 +1311,17 @@ parse_size_directive(const char *size) case 'k': s *= ONE_KB; break; + case 'M': case 'm': s *= ONE_MB; break; + case 'G': case 'g': s *= ONE_GB; break; + default: fprintf(stderr, "Illegal size specifier '%c'\n", *endptr); exit(EXIT_FAILURE); diff --git a/tools/perform/sio_perf.h b/tools/perform/sio_perf.h index 311d909..7a7d708 100644 --- a/tools/perform/sio_perf.h +++ b/tools/perform/sio_perf.h @@ -52,21 +52,21 @@ typedef enum vfdtype_ { typedef struct parameters_ { iotype io_type; /* The type of IO test to perform */ vfdtype vfd; - long num_files; /* Number of files to create */ - long num_dsets; /* Number of datasets to create */ - off_t num_bytes; /* Number of bytes in each dset */ - int num_iters; /* Number of times to loop doing the IO */ - int rank; /* Rank of dataset */ - off_t dset_size[MAX_DIMS]; /* Dataset size */ - size_t buf_size[MAX_DIMS]; /* Buffer size */ - size_t chk_size[MAX_DIMS]; /* Chunk size */ - int order[MAX_DIMS]; /* Buffer size */ - hsize_t h5_align; /* HDF5 object alignment */ - hsize_t h5_thresh; /* HDF5 object alignment threshold */ - int h5_use_chunks; /* Make HDF5 dataset chunked */ - int h5_extendable; /* Make HDF5 dataset chunked */ - int h5_write_only; /* Perform the write tests only */ - int verify; /* Verify data correctness */ + long num_files; /* Number of files to create */ + long num_dsets; /* Number of datasets to create */ + hsize_t num_bytes; /* Number of bytes in each dset */ + int num_iters; /* Number of times to loop doing the IO */ + int rank; /* Rank of dataset */ + hsize_t dset_size[MAX_DIMS]; /* Dataset size */ + size_t buf_size[MAX_DIMS]; /* Buffer size */ + size_t chk_size[MAX_DIMS]; /* Chunk size */ + int order[MAX_DIMS]; /* Buffer size */ + hsize_t h5_align; /* HDF5 object alignment */ + hsize_t h5_thresh; /* HDF5 object alignment threshold */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_extendable; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ + int verify; /* Verify data correctness */ } parameters; typedef struct results_ { @@ -95,7 +95,7 @@ extern int sio_debug_level; /* The debug level: extern "C" { #endif /* __cplusplus */ -extern results do_sio(parameters param); +extern void do_sio(parameters param, results *res); #ifdef __cplusplus } diff --git a/tools/perform/zip_perf.c b/tools/perform/zip_perf.c index d025602..d9b1fa2 100644 --- a/tools/perform/zip_perf.c +++ b/tools/perform/zip_perf.c @@ -37,7 +37,7 @@ #define MICROSECOND 1000000.0F /* report 0.0 in case t is zero too */ -#define MB_PER_SEC(bytes,t) ((fabs(t)<0.0000000001F) ? 0.0F : ((((double)bytes) / ONE_MB) / (t))) +#define MB_PER_SEC(bytes,t) ((fabs(t) < (double)0.0000000001F) ? (double)0.0F : ((((double)bytes) / (double)ONE_MB) / (t))) #ifndef TRUE #define TRUE 1 @@ -173,7 +173,7 @@ write_file(Bytef *source, uLongf sourceLen) /* destination buffer needs to be at least 0.1% larger than sourceLen * plus 12 bytes */ - destLen = (uLongf)((double)sourceLen + ((double)sourceLen * 0.1F)) + 12; + destLen = (uLongf)((double)sourceLen + ((double)sourceLen * (double)0.1F)) + 12; dest = (Bytef *)HDmalloc(destLen); if (!dest) @@ -184,9 +184,9 @@ write_file(Bytef *source, uLongf sourceLen) HDgettimeofday(&timer_stop, NULL); compression_time += ((double)timer_stop.tv_sec + - ((double)timer_stop.tv_usec) / MICROSECOND) - + ((double)timer_stop.tv_usec) / (double)MICROSECOND) - ((double)timer_start.tv_sec + - ((double)timer_start.tv_usec) / MICROSECOND); + ((double)timer_start.tv_usec) / (double)MICROSECOND); if (report_once_flag) { HDfprintf(stdout, "\tCompression Ratio: %g\n", ((double)destLen) / (double)sourceLen); @@ -206,7 +206,7 @@ write_file(Bytef *source, uLongf sourceLen) if (rc == (int)d_len) break; - d_len -= rc; + d_len -= (size_t)rc; d_ptr += rc; } @@ -419,7 +419,7 @@ fill_with_random_data(Bytef *src, uLongf src_len) break; buf += rc; - len -= rc; + len -= (size_t)rc; } } else { HDfprintf(stdout, "Using random() for random data\n"); @@ -429,7 +429,7 @@ fill_with_random_data(Bytef *src, uLongf src_len) } if (compress_percent) { - unsigned long s = src_len * compress_percent / 100; + size_t s = (size_t)((src_len * (uLongf)compress_percent) / 100); HDmemset(src, '\0', s); } @@ -495,7 +495,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, if (rc == (ssize_t)s_len) break; - s_len -= rc; + s_len -= (size_t)rc; s_ptr += rc; } } @@ -504,9 +504,9 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, HDgettimeofday(&timer_stop, NULL); total_time = ((double)timer_stop.tv_sec + - ((double)timer_stop.tv_usec) / MICROSECOND) - + ((double)timer_stop.tv_usec) / (double)MICROSECOND) - ((double)timer_start.tv_sec + - ((double)timer_start.tv_usec) / MICROSECOND); + ((double)timer_start.tv_usec) / (double)MICROSECOND); HDfprintf(stdout, "\tUncompressed Write Time: %.2fs\n", total_time); HDfprintf(stdout, "\tUncompressed Write Throughput: %.2fMB/s\n", @@ -530,9 +530,9 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, HDgettimeofday(&timer_stop, NULL); total_time = ((double)timer_stop.tv_sec + - ((double)timer_stop.tv_usec) / MICROSECOND) - + ((double)timer_stop.tv_usec) / (double)MICROSECOND) - ((double)timer_start.tv_sec + - ((double)timer_start.tv_usec) / MICROSECOND); + ((double)timer_start.tv_usec) / (double)MICROSECOND); HDfprintf(stdout, "\tCompressed Write Time: %.2fs\n", total_time); HDfprintf(stdout, "\tCompressed Write Throughput: %.2fMB/s\n", |