diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-03-10 19:00:39 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-03-10 19:00:39 (GMT) |
commit | b4ff3e6e79a46fb474eb1786a11a7d2451455111 (patch) | |
tree | b73756af2d3eaee487c4087d55fbb04e1eba62b5 /tools | |
parent | da5058310c324dcce93dc9328ef2bd53bf1fed02 (diff) | |
download | hdf5-b4ff3e6e79a46fb474eb1786a11a7d2451455111.zip hdf5-b4ff3e6e79a46fb474eb1786a11a7d2451455111.tar.gz hdf5-b4ff3e6e79a46fb474eb1786a11a7d2451455111.tar.bz2 |
[svn-r16560] Description:
Remove another call to H5E_clear_stack() from within the library.
Clean up lots of compiler warnings.
Tested on:
Mac OS X/32 10.5.6 (amazon)
(followup on other platforms forthcoming)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5diff/h5diff_common.c | 15 | ||||
-rw-r--r-- | tools/h5diff/h5diffgentest.c | 14 | ||||
-rw-r--r-- | tools/h5diff/ph5diff_main.c | 10 | ||||
-rw-r--r-- | tools/h5dump/h5dumpgentest.c | 3 | ||||
-rwxr-xr-x | tools/h5import/h5importtest.c | 25 | ||||
-rw-r--r-- | tools/h5repack/h5repacktst.c | 8 | ||||
-rw-r--r-- | tools/h5stat/h5stat.c | 5 | ||||
-rw-r--r-- | tools/h5stat/h5stat_gentest.c | 7 |
8 files changed, 41 insertions, 46 deletions
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index 547d910..8e7b181 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -19,9 +19,9 @@ #include "h5diff_common.h" #include "h5tools_utils.h" -int check_n_input( const char* ); -int check_p_input( const char* ); -int check_d_input( const char* ); +static int check_n_input( const char* ); +static int check_p_input( const char* ); +static int check_d_input( const char* ); /* module-scoped variables */ @@ -228,7 +228,8 @@ void parse_command_line(int argc, * *------------------------------------------------------------------------- */ -int check_n_input( const char *str ) +static int +check_n_input( const char *str ) { unsigned i; char c; @@ -263,7 +264,8 @@ int check_n_input( const char *str ) * *------------------------------------------------------------------------- */ -int check_p_input( const char *str ) +static int +check_p_input( const char *str ) { double x; @@ -296,7 +298,8 @@ int check_p_input( const char *str ) * *------------------------------------------------------------------------- */ -int check_d_input( const char *str ) +static int +check_d_input( const char *str ) { double x; diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index d9495e5..181e242 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -55,7 +55,7 @@ return -1; } const H5L_class_t UD_link_class[1] = {{ H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */ - MY_LINKCLASS, /* Link type id number */ + (H5L_type_t)MY_LINKCLASS, /* Link type id number */ "UD link class", /* name for debugging */ NULL, /* Creation callback */ NULL, /* Move/rename callback */ @@ -492,7 +492,7 @@ int test_types(const char *fname) */ H5Lcreate_external("filename", "objname", fid1, "ext_link", H5P_DEFAULT, H5P_DEFAULT); H5Lregister(UD_link_class); - H5Lcreate_ud(fid1, "ud_link", MY_LINKCLASS, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT); + H5Lcreate_ud(fid1, "ud_link", (H5L_type_t)MY_LINKCLASS, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- * Close @@ -2608,6 +2608,7 @@ void gen_datareg(hid_t fid, sid1 = H5Screate_simple(2, dims1, NULL); did1 = H5Dcreate2(fid, "dsetref", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + assert(status >= 0); /* create the reference dataset */ sid2 = H5Screate_simple(1, dims2, NULL); @@ -2624,10 +2625,12 @@ void gen_datareg(hid_t fid, } status = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL); + assert(status >= 0); H5Sget_select_npoints(sid1); /* store first dataset region */ status = H5Rcreate(&rbuf[0], fid, "dsetref", H5R_DATASET_REGION, sid1); + assert(status >= 0); /* select sequence of five points for second reference */ coord[0][0]=6; coord[0][1]=9; @@ -2649,15 +2652,20 @@ void gen_datareg(hid_t fid, /* write */ status = H5Dwrite(did2,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,rbuf); + assert(status >= 0); /* close, free memory buffers */ status = H5Dclose(did1); + assert(status >= 0); status = H5Sclose(sid1); + assert(status >= 0); status = H5Dclose(did2); + assert(status >= 0); status = H5Sclose(sid2); + assert(status >= 0); + free(rbuf); free(buf); - } diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c index a4ac793..c613879 100644 --- a/tools/h5diff/ph5diff_main.c +++ b/tools/h5diff/ph5diff_main.c @@ -16,6 +16,7 @@ #include "h5diff.h" #include "ph5diff.h" #include <stdlib.h> +#include <string.h> #include <assert.h> #include "h5diff_common.h" @@ -59,7 +60,6 @@ int main(int argc, const char *argv[]) const char *fname2 = NULL; const char *objname1 = NULL; const char *objname2 = NULL; - hsize_t nfound=0; diff_opt_t options; outBuffOffset = 0; @@ -78,7 +78,7 @@ int main(int argc, const char *argv[]) parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); - nfound = h5diff(fname1, fname2, objname1, objname2, &options); + h5diff(fname1, fname2, objname1, objname2, &options); print_info(&options); @@ -92,7 +92,7 @@ int main(int argc, const char *argv[]) { parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); - nfound = h5diff(fname1, fname2, objname1, objname2, &options); + h5diff(fname1, fname2, objname1, objname2, &options); MPI_Barrier(MPI_COMM_WORLD); @@ -131,7 +131,6 @@ ph5diff_worker(int nID) hid_t file1_id, file2_id; char filenames[2][1024]; char out_data[PRINT_DATA_MAX_SIZE] = {0}; - hsize_t nfound=0; struct diffs_found diffs; int i; MPI_Status Status; @@ -170,8 +169,7 @@ ph5diff_worker(int nID) /*Recv parameters for diff from manager task */ MPI_Recv(&args, sizeof(args), MPI_BYTE, 0, MPI_TAG_ARGS, MPI_COMM_WORLD, &Status); /*Do the diff */ - nfound = diff(file1_id, args.name, file2_id, args.name, &(args.options), args.type); - diffs.nfound = nfound; + diffs.nfound = diff(file1_id, args.name, file2_id, args.name, &(args.options), args.type); diffs.not_cmp = args.options.not_cmp; /*If print buffer has something in it, request print token.*/ diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 3b11eac..fc75681 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -5502,7 +5502,6 @@ static int gent_ldouble(void) hid_t did; hid_t tid; hid_t sid; - size_t size; hsize_t dims[1] = {3}; long double buf[3] = {1,2,3}; @@ -5515,7 +5514,7 @@ static int gent_ldouble(void) if((tid = H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) goto error; - if((size = H5Tget_size(tid)) == 0) + if(H5Tget_size(tid) == 0) goto error; if((did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) diff --git a/tools/h5import/h5importtest.c b/tools/h5import/h5importtest.c index 718ec6b..dd1a2be 100755 --- a/tools/h5import/h5importtest.c +++ b/tools/h5import/h5importtest.c @@ -33,7 +33,6 @@ main(void) int i, j, k; FILE *sp; - float b32r3[5][3][4]; float row4[3], col4[4], pln4[5]; float rowo4 = (float)11.0e0, colo4 = (float)21.0e0, plno4 = (float)51.0e0; float rowi4 = (float)1.0e0, coli4 = (float)2.0e0, plni4 = (float)5.0e0; @@ -44,7 +43,6 @@ main(void) int rowi4i = (int)1 , coli4i = (int)2 , plni4i = (int)5 ; #ifndef WIN32 - long long b64i2[3][4], b64i3[5][3][4]; long long row4i64[3], col4i64[4], pln4i64[5]; long long rowo4i64 = (long long)11 , colo4i64 = (long long)21 , plno4i64 = (long long)51 ; long long rowi4i64 = (long long)1 , coli4i64 = (long long)2 , plni4i64 = (long long)5 ; @@ -142,16 +140,6 @@ main(void) pln4i8[k] = pln4i8[k - 1] + plni4i8; } - for (i = 0; i < nrow; i++) - { - for (j = 0; j < ncol; j++) - { -#ifndef WIN32 - b64i2[i][j] = row4i64[i] + col4i64[j]; -#endif - } - } - /* * build array elements - rank 3 * @@ -159,29 +147,18 @@ main(void) */ for (i = 0; i < nrow; i++) - { for (j = 0; j < ncol; j++) - { - for (k = 0; k < npln; k++) - { - b32r3[k][i][j] = row4[i] + col4[j] + pln4[k]; + for (k = 0; k < npln; k++) { b64r3[k][i][j] = row8[i] + col8[j] + pln8[k]; b32i3[k][i][j] = row4i[i] + col4i[j] + pln4i[k]; -#ifndef WIN32 - b64i3[k][i][j] = row4i64[i] + col4i64[j] + pln4i64[k]; -#endif b16i3[k][i][j] = row4i16[i] + col4i16[j] + pln4i16[k]; b8i3[k][i][j] = row4i8[i] + col4i8[j] + pln4i8[k]; } - } - } #ifndef UNICOS - - /*------------------------------------------------------------------------- * TOOLTEST txtin16.txt -c $srcdir/testfiles/txtin16.conf -o txtin16.h5 *------------------------------------------------------------------------- diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index c5f9d69..1a9422e 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -3735,9 +3735,11 @@ void make_dset_reg_ref(hid_t loc_id) /* Write selection to disk */ ret = H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dset2); + assert(ret >= 0); /* Create dataspace for the reference dataset */ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); @@ -3753,17 +3755,23 @@ void make_dset_reg_ref(hid_t loc_id) count[0] = 6; count[1] = 6; block[0] = 1; block[1] = 1; ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block); + assert(ret >= 0); /* Store dataset region */ ret = H5Rcreate(&wbuf[0], loc_id, "dsetreg", H5R_DATASET_REGION, sid2); + assert(ret >= 0); /* Write selection to disk */ ret=H5Dwrite(dset1,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf); + assert(ret >= 0); /* Close all objects */ ret = H5Sclose(sid1); + assert(ret >= 0); ret = H5Dclose(dset1); + assert(ret >= 0); ret = H5Sclose(sid2); + assert(ret >= 0); free(wbuf); free(dwbuf); diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index e95a9ee..315c558 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -98,9 +98,7 @@ int d_status = EXIT_SUCCESS; static int display_all = TRUE; static int display_file_metadata = FALSE; static int display_file = FALSE; -static int display_group_metadata = FALSE; static int display_group = FALSE; -static int display_dset_metadata = FALSE; static int display_dset = FALSE; static int display_dtype_metadata = FALSE; static int display_object = FALSE; @@ -698,7 +696,6 @@ parse_command_line(int argc, const char *argv[]) case 'G': display_all = FALSE; - display_group_metadata = TRUE; break; case 'g': @@ -713,7 +710,6 @@ parse_command_line(int argc, const char *argv[]) case 'D': display_all = FALSE; - display_dset_metadata = TRUE; break; case 'd': @@ -1106,7 +1102,6 @@ print_file_statistics(const iter_t *iter) display_file = TRUE; display_file_metadata = TRUE; display_group = TRUE; - display_group_metadata = TRUE; display_dset = TRUE; display_dtype_metadata = TRUE; display_attr = TRUE; diff --git a/tools/h5stat/h5stat_gentest.c b/tools/h5stat/h5stat_gentest.c index 250226e..3f933f2 100644 --- a/tools/h5stat/h5stat_gentest.c +++ b/tools/h5stat/h5stat_gentest.c @@ -23,6 +23,7 @@ * of the expected output and update the corresponding *.ddl files. */ +#include <assert.h> #include "hdf5.h" #define FILE "h5stat_newgrat.h5" @@ -47,6 +48,7 @@ static void gen_file(void) fapl = H5Pcreate(H5P_FILE_ACCESS); ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); + assert(ret >= 0); /* Create dataset */ file = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -68,12 +70,17 @@ static void gen_file(void) sprintf(attrname, "%s%d", ATTR_NAME,i); attr_id = H5Acreate2(dset_id, attrname, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); ret = H5Aclose(attr_id); + assert(ret >= 0); } /* end for */ ret = H5Dclose(dset_id); + assert(ret >= 0); ret = H5Sclose(space_id); + assert(ret >= 0); ret = H5Tclose(type_id); + assert(ret >= 0); ret = H5Fclose(file); + assert(ret >= 0); } int main(void) |