diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2013-08-17 20:05:27 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2013-08-17 20:05:27 (GMT) |
commit | 308c378ccd9310b19c12d524d123cf5d352b6260 (patch) | |
tree | 69a4527bd8f8777151cd71832ecbc6e802cc0171 /tools | |
parent | d663d78cd274a48b702a2d3ce17fa6bb01be1ae1 (diff) | |
download | hdf5-308c378ccd9310b19c12d524d123cf5d352b6260.zip hdf5-308c378ccd9310b19c12d524d123cf5d352b6260.tar.gz hdf5-308c378ccd9310b19c12d524d123cf5d352b6260.tar.bz2 |
[svn-r24020] Description:
Clean up compiler warnings
Tested on:
Mac OSX/64 10.8.4 (amazon) w/C++ & FORTRAN
(too minor to require h5committest)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5copy/h5copy.c | 16 | ||||
-rw-r--r-- | tools/h5diff/h5diffgentest.c | 9 | ||||
-rw-r--r-- | tools/h5dump/h5dump_ddl.c | 15 | ||||
-rw-r--r-- | tools/h5dump/h5dump_ddl.h | 5 | ||||
-rw-r--r-- | tools/h5dump/h5dump_xml.c | 3 | ||||
-rw-r--r-- | tools/h5dump/h5dumpgentest.c | 11 | ||||
-rw-r--r-- | tools/h5import/h5import.c | 3 | ||||
-rw-r--r-- | tools/misc/h5mkgrp.c | 28 |
8 files changed, 44 insertions, 46 deletions
diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index 3fb5701..b5965ba 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -157,35 +157,35 @@ usage: h5copy [OPTIONS] [OBJECTS...]\n\ */ -static int parse_flag(const char* str_flag, unsigned *flag) +static int parse_flag(const char* s_flag, unsigned *flag) { unsigned fla=0; - if (HDstrcmp(str_flag,"shallow")==0) + if (HDstrcmp(s_flag,"shallow")==0) { fla = H5O_COPY_SHALLOW_HIERARCHY_FLAG; } - else if (HDstrcmp(str_flag,"soft")==0) + else if (HDstrcmp(s_flag,"soft")==0) { fla = H5O_COPY_EXPAND_SOFT_LINK_FLAG; } - else if (HDstrcmp(str_flag,"ext")==0) + else if (HDstrcmp(s_flag,"ext")==0) { fla = H5O_COPY_EXPAND_EXT_LINK_FLAG; } - else if (HDstrcmp(str_flag,"ref")==0) + else if (HDstrcmp(s_flag,"ref")==0) { fla = H5O_COPY_EXPAND_REFERENCE_FLAG; } - else if (HDstrcmp(str_flag,"noattr")==0) + else if (HDstrcmp(s_flag,"noattr")==0) { fla = H5O_COPY_WITHOUT_ATTR_FLAG; } - else if (HDstrcmp(str_flag,"allflags")==0) + else if (HDstrcmp(s_flag,"allflags")==0) { fla = H5O_COPY_ALL; } - else if (HDstrcmp(str_flag,"nullmsg")==0) + else if (HDstrcmp(s_flag,"nullmsg")==0) { fla = H5O_COPY_PRESERVE_NULL_FLAG; } diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index b5e0ae6..d8b3b34 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -560,8 +560,8 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) int data4[3][2] = {{0,0},{0,0},{0,0}}; int data5[2][2] = {{0,0},{0,0}}; unsigned int data6[3][2] = {{0,0},{0,0},{0,0}}; - cmp1_t data7[1] = {1,2}; - cmp2_t data8[1] = {1,2}; + cmp1_t data7[1] = {{1,2}}; + cmp2_t data8[1] = {{1,2}}; hsize_t dims3[2] = { 2,2 }; hsize_t dims4[1] = { 1 }; size_t type_size; @@ -3664,9 +3664,6 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int }; hsize_t dims_fixlen_str_array[] = {FIXLEN_STR_ARRY_DIM}; - /* objref */ - hsize_t objref_dims[1]={1}; - /*------------------------------------------ * compound dataset *------------------------------------------*/ @@ -4873,7 +4870,7 @@ static void test_data_nocomparables (const char * fname, int make_diffs) int data1[DIM_ARRY] = {0,0,0}; int data2[DIM_ARRY] = {1,1,1}; int data3[DIM_ARRY+1] = {1,1,1,1}; - int data1_dim2[DIM_ARRY][1] = {0,0,0}; + int data1_dim2[DIM_ARRY][1] = {{0,0,0}}; int rank_attr; char data1_str[DIM_ARRY][STR_SIZE]= {"ab","cd","ef"}; herr_t status = SUCCEED; diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index 765cee4..ec93778 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -34,6 +34,10 @@ typedef struct { char *op_name; /* Object name wanted */ } trav_attr_udata_t; +/* callback function used by H5Literate() */ +static herr_t dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void *op_data); +static int dump_extlink(hid_t group, const char *linkname, const char *objname); + /*------------------------------------------------------------------------- * Function: dump_datatype * @@ -155,6 +159,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *info, vo return ret; } + /*------------------------------------------------------------------------- * Function: dump_all_cb * @@ -176,7 +181,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *info, vo * *------------------------------------------------------------------------- */ -herr_t +static herr_t dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED *op_data) { hid_t obj; @@ -1305,7 +1310,6 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *ainfo, vo int i; int j; int k; - char *obj_attrname; char *obj_op_name; char *obj_name; trav_attr_udata_t *attr_data = (trav_attr_udata_t*)_op_data; @@ -1450,9 +1454,7 @@ lnk_search(const char *path, const H5L_info_t *li, void *_op_data) void handle_paths(hid_t fid, const char *path_name, void* data, int pe, const char *display_name) { - hid_t obj_id = -1; hid_t gid = -1; - H5O_info_t oinfo; if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) { error_msg("unable to open root group\n"); @@ -2046,9 +2048,8 @@ handle_datatypes(hid_t fid, const char *type, void UNUSED * data, int pe, const * *------------------------------------------------------------------------- */ - - -static int dump_extlink(hid_t group, const char *linkname, const char *objname) +static int +dump_extlink(hid_t group, const char *linkname, const char *objname) { hid_t oid; H5O_info_t oi; diff --git a/tools/h5dump/h5dump_ddl.h b/tools/h5dump/h5dump_ddl.h index 4511f7b..c4f4638 100644 --- a/tools/h5dump/h5dump_ddl.h +++ b/tools/h5dump/h5dump_ddl.h @@ -12,13 +12,10 @@ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + #ifndef H5DUMP_DDL_H__ #define H5DUMP_DDL_H__ -/* callback function used by H5Literate() */ -static herr_t dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void *op_data); -static int dump_extlink(hid_t group, const char *linkname, const char *objname); - #ifdef __cplusplus extern "C" { #endif diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 28264e7..53ad894 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -38,7 +38,7 @@ static char *xml_escape_the_string(const char *, int); static char *xml_escape_the_name(const char *); /*------------------------------------------------------------------------- - * Function: dump_all_cb + * Function: xml_dump_all_cb * * Purpose: function callback called by H5Literate, * displays everything in the specified object @@ -1782,7 +1782,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU int ndims; int i; int status = -1; - int stdindent = COL; /* should be 3 */ void *buf = NULL; hsize_t curr_pos = 0; /* total data element position */ h5tools_str_t buffer; /* string into which to render */ diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index ac74637..71b1e65 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -3421,14 +3421,19 @@ static void gent_array8(void) H5P_DEFAULT); if(dset>=0) status = H5Dwrite (dset, filetype, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + HDassert(status >= 0); } /* * Close and release resources. */ status = H5Dclose (dset); + HDassert(status >= 0); status = H5Sclose (space); + HDassert(status >= 0); status = H5Tclose (filetype); + HDassert(status >= 0); status = H5Fclose (file); + HDassert(status >= 0); } static void gent_empty(void) @@ -7397,14 +7402,17 @@ gent_charsets(void) sid = H5Screate_simple( 1, dim, NULL ); fid = H5Fcreate( FILE68, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT ); status = H5Tset_cset( ascii_dtid, H5T_CSET_ASCII ); + HDassert(status >= 0); H5Tinsert( charset_dtid, "ascii", HOFFSET(CharSetInfo, ascii_p_ ), ascii_dtid ); status = H5Tset_cset( utf8_dtid, H5T_CSET_UTF8 ); + HDassert(status >= 0); H5Tinsert( charset_dtid, "utf8", HOFFSET( CharSetInfo, utf8_p_ ), utf8_dtid ); did = H5Dcreate2( fid, "CharSets", charset_dtid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT ); status = H5Dwrite( did, charset_dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, writeData ); + HDassert(status >= 0); H5Tclose( charset_dtid ); H5Tclose( ascii_dtid ); @@ -7415,7 +7423,7 @@ gent_charsets(void) } static void gent_compound_intsizes(void) { - hid_t fid, dataset, space, root; + hid_t fid, dataset, space; hsize_t dims[2]; hsize_t array_dim8[]={F70_XDIM,F70_YDIM8}; /* Array dimensions */ hsize_t array_dim16[]={F70_XDIM,F70_YDIM16}; /* Array dimensions */ @@ -7992,7 +8000,6 @@ static void gent_nested_compound_dt(void) { /* test nested data type */ dset3_t dset3[10]; enumtype dset4[] = {RED, GREEN, BLUE, GREEN, WHITE, BLUE}; - dset1_t dset5[10]; int i, j, k; unsigned ndims; diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index 9497e58..7038a95 100644 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -1009,10 +1009,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) char *str2 = NULL; char *str3 = NULL; char str[1024] = ""; - char c; - int results; int j; - int nlines = 0; int line; /*------------------------------------------------------------------------- diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c index b9fb588..8dee706 100644 --- a/tools/misc/h5mkgrp.c +++ b/tools/misc/h5mkgrp.c @@ -115,7 +115,7 @@ usage: h5mkgrp [OPTIONS] FILE GROUP...\n\ *------------------------------------------------------------------------- */ static int -parse_command_line(int argc, const char *argv[], param_t *params) +parse_command_line(int argc, const char *argv[], param_t *parms) { int opt; /* Option from command line */ size_t curr_group; /* Current group name to copy */ @@ -136,17 +136,17 @@ parse_command_line(int argc, const char *argv[], param_t *params) /* Create objects with the latest version of the format */ case 'l': - params->latest = TRUE; + parms->latest = TRUE; break; /* Create parent groups */ case 'p': - params->parents = TRUE; + parms->parents = TRUE; break; /* Verbose output */ case 'v': - params->verbose = TRUE; + parms->verbose = TRUE; break; /* Display version */ @@ -169,7 +169,7 @@ parse_command_line(int argc, const char *argv[], param_t *params) } /* end if */ /* Retrieve file name */ - params->fname = HDstrdup(argv[opt_ind]); + parms->fname = HDstrdup(argv[opt_ind]); opt_ind++; /* Check for group(s) to be created */ @@ -180,24 +180,24 @@ parse_command_line(int argc, const char *argv[], param_t *params) } /* end if */ /* Allocate space for the group name pointers */ - params->ngroups = (argc - opt_ind); - params->groups = HDmalloc(params->ngroups * sizeof(char *)); + parms->ngroups = (argc - opt_ind); + parms->groups = HDmalloc(parms->ngroups * sizeof(char *)); /* Retrieve the group names */ curr_group = 0; while(opt_ind < argc) { - params->groups[curr_group] = HDstrdup(argv[opt_ind]); + parms->groups[curr_group] = HDstrdup(argv[opt_ind]); curr_group++; opt_ind++; } /* end while */ #ifdef QAK -HDfprintf(stderr, "params->parents = %t\n", params->parents); -HDfprintf(stderr, "params->verbose = %t\n", params->verbose); -HDfprintf(stderr, "params->fname = '%s'\n", params->fname); -HDfprintf(stderr, "params->ngroups = %Zu\n", params->ngroups); -for(curr_group = 0; curr_group < params->ngroups; curr_group++) - HDfprintf(stderr, "params->group[%Zu] = '%s'\n", curr_group, params->groups[curr_group]); +HDfprintf(stderr, "parms->parents = %t\n", parms->parents); +HDfprintf(stderr, "parms->verbose = %t\n", parms->verbose); +HDfprintf(stderr, "parms->fname = '%s'\n", parms->fname); +HDfprintf(stderr, "parms->ngroups = %Zu\n", parms->ngroups); +for(curr_group = 0; curr_group < parms->ngroups; curr_group++) + HDfprintf(stderr, "parms->group[%Zu] = '%s'\n", curr_group, parms->groups[curr_group]); #endif /* QAK */ return(0); |