diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2012-05-25 17:58:59 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2012-05-25 17:58:59 (GMT) |
commit | fe744bd8df1c0ce23c2631773a9463e781d84052 (patch) | |
tree | 3ce1e18ffc3555d0fe65118a56de19dd0d7fe774 | |
parent | 2f7d953a9d328862297be8c33ecdaaeadd14ae14 (diff) | |
download | hdf5-fe744bd8df1c0ce23c2631773a9463e781d84052.zip hdf5-fe744bd8df1c0ce23c2631773a9463e781d84052.tar.gz hdf5-fe744bd8df1c0ce23c2631773a9463e781d84052.tar.bz2 |
[svn-r22412] reduce compiler warnings by removing unreferenced variables and adding cast
Tested: local linux
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/h5_attribute.c | 1 | ||||
-rw-r--r-- | hl/test/test_lite.c | 1 | ||||
-rw-r--r-- | test/tfile.c | 1 | ||||
-rw-r--r-- | test/vfd.c | 3 | ||||
-rw-r--r-- | tools/h5dump/h5dump_ddl.c | 7 | ||||
-rw-r--r-- | tools/h5dump/h5dump_xml.c | 3 | ||||
-rw-r--r-- | tools/h5jam/h5jam.c | 4 | ||||
-rw-r--r-- | tools/h5ls/h5ls.c | 16 | ||||
-rw-r--r-- | tools/lib/h5tools.c | 9 | ||||
-rw-r--r-- | tools/lib/h5tools_dump.c | 13 |
11 files changed, 24 insertions, 36 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 082cc48..b42c7b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -375,7 +375,7 @@ IF (CMAKE_BUILD_TYPE MATCHES Debug) ADD_DEFINITIONS (-Wall) ENDIF (NOT WIN32) ELSE (CMAKE_BUILD_TYPE MATCHES Debug) - ADD_DEFINITIONS (-UH5_DEBUG_API -DNDEBUG) + ADD_DEFINITIONS (-DNDEBUG) OPTION (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) IF (HDF5_ENABLE_TRACE) ADD_DEFINITIONS (-DH5_DEBUG_API ) diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c index 646b395..0ea0153 100644 --- a/examples/h5_attribute.c +++ b/examples/h5_attribute.c @@ -66,7 +66,6 @@ main (void) unsigned i, j; /* Counters */ char string_out[80]; /* Buffer to read string attribute back */ int point_out; /* Buffer to read scalar attribute back */ - int num_attr; /* Number of attributes */ /* * Data initialization. diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 0a7b0b4..5bdeaca 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1824,7 +1824,6 @@ static int test_valid_path(void) herr_t status; FILE *fp = NULL; htri_t path_valid; - char path[10]; const char *data_string_in = "test"; TESTING("H5LTpath_valid"); diff --git a/test/tfile.c b/test/tfile.c index 00b4fed..32831b9 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -2704,7 +2704,6 @@ test_libver_macros(void) unsigned major = H5_VERS_MAJOR; unsigned minor = H5_VERS_MINOR; unsigned release = H5_VERS_RELEASE; - herr_t ret; /* Return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing macros for library version comparison\n")); @@ -1148,11 +1148,10 @@ test_multi_compat(void) { hid_t file=(-1), fapl, fapl2=(-1), dset=(-1), space=(-1); hid_t access_fapl = -1; - char filename[1024], newname[1024], tmp[1024]; + char newname[1024]; char filename_s[1024], newname_s[1024]; char filename_r[1024], newname_r[1024]; int *fhandle2=NULL, *fhandle=NULL; - hsize_t file_size; H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; hid_t memb_fapl[H5FD_MEM_NTYPES]; haddr_t memb_addr[H5FD_MEM_NTYPES]; diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index b0136c8..db78118 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -1467,15 +1467,18 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis if(sset) { unsigned int i; + unsigned int ndims; hid_t sid = H5Dget_space(dsetid); - int ndims = H5Sget_simple_extent_ndims(sid); + int ndims_res = H5Sget_simple_extent_ndims(sid); H5Sclose(sid); - if(ndims < 0) { + if(ndims_res < 0) { error_msg("H5Sget_simple_extent_ndims failed\n"); h5tools_setstatus(EXIT_FAILURE); return; } + else + ndims = ndims_res; if(!sset->start.data || !sset->stride.data || !sset->count.data || !sset->block.data) { /* they didn't specify a ``stride'' or ``block''. default to 1 in all diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 0c48216..1a29659 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -1781,7 +1781,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU hsize_t nelmts = 1; int ndims; int i; - int depth; int status = -1; int stdindent = COL; /* should be 3 */ void *buf = NULL; @@ -2950,7 +2949,7 @@ xml_print_refs(hid_t did, int source) string_dataformat.do_escape = display_escape; outputformat = &string_dataformat; - for (i = 0; i < ssiz; i++) { + for (i = 0; i < (hsize_t)ssiz; i++) { const char *path = lookup_ref_path(*refbuf); ctx.indent_level++; diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index 981eead..52eb0aa 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -310,7 +310,7 @@ main (int argc, const char *argv[]) leave (EXIT_FAILURE); } - fsize = sbuf.st_size; + fsize = (off_t)sbuf.st_size; h5fid = HDopen(input_file, O_RDONLY, 0); if(h5fid < 0) { @@ -455,7 +455,7 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout, exit (EXIT_FAILURE); } - howmuch = sbuf.st_size; + howmuch = (ssize_t)sbuf.st_size; } else howmuch = limit; diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 2171682..0fc0531 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1436,13 +1436,13 @@ dump_dataset_values(hid_t dset) info = &outputformat; ctx.indent_level = 2; - ctx.cur_column = curr_pos; + ctx.cur_column = (size_t)curr_pos; /* Print all the values. */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, " Data:\n"); h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); ctx.need_prefix = TRUE; - ctx.cur_column = curr_pos; + ctx.cur_column = (size_t)curr_pos; if (h5tools_dump_dset(rawoutstream, info, &ctx, dset, -1, NULL) < 0) { h5tools_str_reset(&buffer); h5tools_str_append(&buffer, " Unable to print data."); @@ -1619,7 +1619,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, if(H5Aread(attr, p_type, buf) >= 0) { ctx.need_prefix = TRUE; ctx.indent_level = 2; - ctx.cur_column = curr_pos; + ctx.cur_column = (size_t)curr_pos; h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf); } @@ -1672,11 +1672,9 @@ dataset_list1(hid_t dset) H5S_class_t space_type; /* type of dataspace */ int i; hsize_t curr_pos = 0; /* total data element position */ - h5tool_link_info_t lnk_info; h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - h5tool_format_t outputformat; HDmemset(&ctx, 0, sizeof(ctx)); HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -1753,7 +1751,6 @@ dataset_list2(hid_t dset, const char UNUSED *name) h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - h5tool_format_t outputformat; HDmemset(&ctx, 0, sizeof(ctx)); HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -1921,7 +1918,6 @@ datatype_list2(hid_t type, const char UNUSED *name) h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - h5tool_format_t outputformat; HDmemset(&ctx, 0, sizeof(ctx)); HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -1962,7 +1958,6 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - h5tool_format_t outputformat; HDmemset(&ctx, 0, sizeof(ctx)); HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -2121,7 +2116,6 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - h5tool_format_t outputformat; HDmemset(&ctx, 0, sizeof(ctx)); HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -2309,11 +2303,9 @@ visit_obj(hid_t file, const char *oname, iter_t *iter) int retval = 0; H5O_info_t oi; /* Information for object */ hsize_t curr_pos = 0; /* total data element position */ - h5tool_link_info_t lnk_info; h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - h5tool_format_t outputformat; HDmemset(&ctx, 0, sizeof(ctx)); HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -2820,11 +2812,9 @@ main(int argc, const char *argv[]) /* Check the type of link given */ if(H5Lget_info(file, oname, &li, H5P_DEFAULT) < 0) { hsize_t curr_pos = 0; /* total data element position */ - h5tool_link_info_t lnk_info; h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - h5tool_format_t outputformat; HDmemset(&ctx, 0, sizeof(ctx)); HDmemset(&buffer, 0, sizeof(h5tools_str_t)); diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index f853b5c..f308a99 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -1051,6 +1051,7 @@ void init_acc_pos(h5tools_context_t *ctx, hsize_t *dims) { int i; + unsigned j; HDassert(ctx->ndims); @@ -1058,8 +1059,8 @@ init_acc_pos(h5tools_context_t *ctx, hsize_t *dims) for (i = (ctx->ndims - 2); i >= 0; i--) { ctx->acc[i] = ctx->acc[i + 1] * dims[i + 1]; } - for (i = 0; i < ctx->ndims; i++) - ctx->pos[i] = 0; + for (j = 0; j < ctx->ndims; j++) + ctx->pos[j] = 0; } /*------------------------------------------------------------------------- @@ -1525,7 +1526,7 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, if((type_size = H5Tget_size(type_id)) == 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); - if((region_buf = HDmalloc(type_size * numelem)) == NULL) + if((region_buf = HDmalloc(type_size * (size_t)numelem)) == NULL) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate region buffer"); /* Select (x , x , ..., x ) x (y , y , ..., y ) hyperslab for reading memory dataset */ @@ -1670,7 +1671,7 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id, if((type_size = H5Tget_size(type_id)) == 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); - if((region_buf = HDmalloc(type_size * npoints)) == NULL) + if((region_buf = HDmalloc(type_size * (size_t)npoints)) == NULL) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for region"); /* Allocate space for the dimension array */ diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 6a7df50..e771dcd 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -261,7 +261,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai h5tools_context_t *ctx/*in,out*/, unsigned flags, hsize_t nelmts, hid_t type, void *_mem) { - HERR_INIT(int, SUCCEED) + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ unsigned char *mem = (unsigned char*) _mem; hsize_t i; /*element counter */ size_t size; /*size of each datum */ @@ -390,7 +390,6 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai h5tools_str_close(&buffer); }/* else bin */ -CATCH return ret_value; } @@ -430,7 +429,7 @@ h5tools_print_region_data_blocks(hid_t region_id, hsize_t numelem; hsize_t numindex; size_t jndx; - int indx; + unsigned indx; int type_size; int ret_value = SUCCEED; hid_t mem_space = -1; @@ -466,7 +465,7 @@ h5tools_print_region_data_blocks(hid_t region_id, if((type_size = H5Tget_size(type_id)) == 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); - if((region_buf = HDmalloc(type_size * numelem)) == NULL) + if((region_buf = HDmalloc(type_size * (size_t)numelem)) == NULL) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate region buffer"); /* Select (x , x , ..., x ) x (y , y , ..., y ) hyperslab for reading memory dataset */ @@ -781,7 +780,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, hsize_t curr_pos = 0; hsize_t total_size[H5S_MAX_RANK]; size_t jndx; - int indx; + unsigned indx; int type_size; int ret_value = SUCCEED; unsigned int region_flags; /* buffer extent flags */ @@ -808,7 +807,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, if((type_size = H5Tget_size(type_id)) == 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); - if((region_buf = HDmalloc(type_size * npoints)) == NULL) + if((region_buf = HDmalloc(type_size * (size_t)npoints)) == NULL) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for region"); curr_pos = 0; @@ -1668,7 +1667,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte hid_t type, hid_t space, void *mem) { HERR_INIT(herr_t, SUCCEED) - int i; /*counters */ + unsigned i; /*counters */ hsize_t nelmts; /*total selected elmts */ ctx->ndims = H5Sget_simple_extent_ndims(space); |