diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-08-12 21:11:00 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-08-12 21:11:00 (GMT) |
commit | 54d5a565f95f83655d8bcccb017da6164860afa7 (patch) | |
tree | 07d5429ca460bcfc12cd167fa97a8bbb8011ac69 /tools/lib | |
parent | b95672cdcb6fb81f24a8a3dc00e7d233e65e9d87 (diff) | |
download | hdf5-54d5a565f95f83655d8bcccb017da6164860afa7.zip hdf5-54d5a565f95f83655d8bcccb017da6164860afa7.tar.gz hdf5-54d5a565f95f83655d8bcccb017da6164860afa7.tar.bz2 |
[svn-r19237] Description:
Clean up misc. compiler warnings.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5diff_array.c | 8 | ||||
-rw-r--r-- | tools/lib/h5tools.c | 63 | ||||
-rw-r--r-- | tools/lib/h5tools_str.c | 23 | ||||
-rw-r--r-- | tools/lib/h5tools_str.h | 13 |
4 files changed, 48 insertions, 59 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 48e08a5..dc3c9fb 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -5825,8 +5825,6 @@ void print_header(int pp, /* print percentage */ const char *obj1, const char *obj2 ) { - int i; - /* print header */ parallel_print("%-16s","size:"); print_dimensions (rank,dims); @@ -5834,8 +5832,7 @@ void print_header(int pp, /* print percentage */ print_dimensions (rank,dims); parallel_print("\n"); - if (pp) - { + if(pp) { parallel_print("%-15s %-15s %-15s %-15s %-15s\n", "position", (obj1!=NULL) ? obj1 : " ", @@ -5844,8 +5841,7 @@ void print_header(int pp, /* print percentage */ "relative"); parallel_print("------------------------------------------------------------------------\n"); } - else - { + else { parallel_print("%-15s %-15s %-15s %-20s\n", "position", (obj1!=NULL) ? obj1 : " ", diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 9926971..60f5d01 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -199,10 +199,12 @@ static const h5tools_dump_header_t * h5tools_dump_header_format; /* local prototypes */ static int do_bin_output(FILE *stream, hid_t container, hsize_t nelmts, hid_t tid, void *_mem); static int render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem); +static int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, + hid_t container, int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata); static hbool_t render_bin_output_region_blocks(hid_t region_space, hid_t region_id, - FILE *stream, hid_t container, hid_t tid, void *_mem); + FILE *stream, hid_t container); static hbool_t render_bin_output_region_points(hid_t region_space, hid_t region_id, - FILE *stream, hid_t container, hid_t tid, void *_mem); + FILE *stream, hid_t container); static hbool_t h5tools_is_zero(const void *_mem, size_t size); hbool_t h5tools_render_element(FILE *stream, const h5tool_format_t *info, @@ -220,7 +222,7 @@ hbool_t h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, hsize_t local_elmt_counter/*element counter*/, hsize_t elmt_counter); -int h5tools_print_region_data_blocks(hid_t region_space, hid_t region_id, +static int h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_format_t *info, h5tools_context_t ctx, h5tools_str_t *buffer/*string into which to render */, size_t ncols, int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata); @@ -664,8 +666,7 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, } /* Calculate new prefix */ - h5tools_str_prefix(&prefix, info, elmtno, ctx->ndims, ctx->p_min_idx, - ctx->p_max_idx, ctx); + h5tools_str_prefix(&prefix, info, elmtno, ctx->ndims, ctx); /* Write new prefix to output */ if (ctx->indent_level >= 0) { @@ -754,7 +755,7 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, } /* Calculate new prefix */ - h5tools_str_region_prefix(&prefix, info, elmtno, ptdata, ctx->ndims, ctx->p_min_idx, + h5tools_str_region_prefix(&prefix, info, elmtno, ptdata, ctx->ndims, ctx->p_max_idx, ctx); /* Write new prefix to output */ @@ -1294,8 +1295,8 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, * hssize_t nblocks is the number of blocks in the region *------------------------------------------------------------------------- */ -int -h5tools_print_region_data_blocks(hid_t region_space, hid_t region_id, +static int +h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_format_t *info, h5tools_context_t ctx, h5tools_str_t *buffer/*string into which to render */, size_t ncols, int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata) { @@ -1579,8 +1580,8 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, ctx->need_prefix = TRUE; - h5tools_print_region_data_blocks(region_space, region_id, - rawdatastream, info, *ctx, buffer, ncols, ndims, type_id, nblocks, ptdata); + h5tools_print_region_data_blocks(region_id, rawdatastream, info, *ctx, + buffer, ncols, ndims, type_id, nblocks, ptdata); done: free(ptdata); @@ -1640,12 +1641,11 @@ int h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stream, const h5tool_format_t *info, h5tools_context_t ctx, h5tools_str_t *buffer, size_t ncols, - int ndims, hid_t type_id, hssize_t npoints, hsize_t *ptdata) { + int ndims, hid_t type_id, hssize_t npoints, hsize_t *ptdata) +{ HERR_INIT(int, SUCCEED) hbool_t dimension_break = TRUE; - hsize_t alloc_size; hsize_t *dims1 = NULL; - h5tools_context_t region_ctx; /* print context */ hsize_t elmtno; /* elemnt index */ unsigned int region_flags; /* buffer extent flags */ hsize_t curr_pos; @@ -3862,10 +3862,10 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem) region_space = H5Rget_region(container, H5R_DATASET_REGION, mem); if (region_space >= 0) { region_type = H5Sget_select_type(region_space); - if(region_type==H5S_SEL_POINTS) - render_bin_output_region_points(region_space, region_id, stream, container, tid, mem); + if(region_type == H5S_SEL_POINTS) + render_bin_output_region_points(region_space, region_id, stream, container); else - render_bin_output_region_blocks(region_space, region_id, stream, container, tid, mem); + render_bin_output_region_blocks(region_space, region_id, stream, container); H5Sclose(region_space); } /* end if (region_space >= 0) */ H5Dclose(region_id); @@ -3913,17 +3913,16 @@ CATCH * *------------------------------------------------------------------------- */ -int -render_bin_output_region_data_blocks(hid_t region_space, hid_t region_id, - FILE *stream, hid_t container, - int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata) { +static int +render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, + hid_t container, int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata) +{ HERR_INIT(int, SUCCEED) hsize_t *dims1 = NULL; hsize_t *start = NULL; hsize_t *count = NULL; size_t numelem; hsize_t total_size[H5S_MAX_RANK]; - unsigned int region_flags; /* buffer extent flags */ int jndx; int type_size; hid_t mem_space = -1; @@ -4015,9 +4014,10 @@ CATCH * *------------------------------------------------------------------------- */ -hbool_t +static hbool_t render_bin_output_region_blocks(hid_t region_space, hid_t region_id, - FILE *stream, hid_t container, hid_t tid, void *_mem) { + FILE *stream, hid_t container) +{ HERR_INIT(hbool_t, TRUE) hssize_t nblocks; hsize_t alloc_size; @@ -4025,7 +4025,6 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, int ndims; hid_t dtype; hid_t type_id; - int i; if((nblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0) H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed"); @@ -4048,8 +4047,8 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, if((type_id = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0) HGOTO_ERROR(FALSE, H5E_tools_min_id_g, "H5Tget_native_type failed"); - render_bin_output_region_data_blocks(region_space, region_id, - stream, container, ndims, type_id, nblocks, ptdata); + render_bin_output_region_data_blocks(region_id, stream, container, ndims, + type_id, nblocks, ptdata); done: free(ptdata); @@ -4087,12 +4086,10 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, int render_bin_output_region_data_points(hid_t region_space, hid_t region_id, FILE *stream, hid_t container, - int ndims, hid_t type_id, hssize_t npoints, hsize_t *ptdata) { + int ndims, hid_t type_id, hssize_t npoints, hsize_t *ptdata) +{ HERR_INIT(int, SUCCEED) - hsize_t alloc_size; hsize_t *dims1 = NULL; - unsigned int region_flags; /* buffer extent flags */ - int indx; int jndx; int type_size; hid_t mem_space = -1; @@ -4145,15 +4142,15 @@ CATCH * *------------------------------------------------------------------------- */ -hbool_t +static hbool_t render_bin_output_region_points(hid_t region_space, hid_t region_id, - FILE *stream, hid_t container, hid_t tid, void *_mem) { + FILE *stream, hid_t container) +{ HERR_INIT(hbool_t, TRUE) hssize_t npoints; hsize_t alloc_size; hsize_t *ptdata; int ndims; - int indx; hid_t dtype; hid_t type_id; diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 55596cd..c5f10b8 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -305,8 +305,7 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt) */ char * h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, - hsize_t elmtno, unsigned ndims, hsize_t min_idx[], - hsize_t max_idx[], h5tools_context_t *ctx) + hsize_t elmtno, unsigned ndims, h5tools_context_t *ctx) { size_t i = 0; hsize_t curr_pos = elmtno; @@ -358,7 +357,7 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, */ char * h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, - hsize_t elmtno, hsize_t *ptdata, unsigned ndims, hsize_t min_idx[], hsize_t max_idx[], + hsize_t elmtno, hsize_t *ptdata, unsigned ndims, hsize_t max_idx[], h5tools_context_t *ctx) { hsize_t p_prod[H5S_MAX_RANK]; @@ -414,7 +413,7 @@ h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, */ void h5tools_str_dump_region_blocks(h5tools_str_t *str, hid_t region, - const h5tool_format_t *info, h5tools_context_t *ctx) + const h5tool_format_t *info) { hssize_t nblocks; hsize_t alloc_size; @@ -434,7 +433,7 @@ h5tools_str_dump_region_blocks(h5tools_str_t *str, hid_t region, alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ - ptdata = malloc((size_t) alloc_size); + ptdata = (hsize_t *)malloc((size_t) alloc_size); H5_CHECK_OVERFLOW(nblocks, hssize_t, hsize_t); H5Sget_select_hyper_blocklist(region, (hsize_t)0, (hsize_t)nblocks, ptdata); @@ -475,7 +474,7 @@ h5tools_str_dump_region_blocks(h5tools_str_t *str, hid_t region, */ void h5tools_str_dump_region_points(h5tools_str_t *str, hid_t region, - const h5tool_format_t *info, h5tools_context_t *ctx) + const h5tool_format_t *info) { hssize_t npoints; hsize_t alloc_size; @@ -495,7 +494,7 @@ h5tools_str_dump_region_points(h5tools_str_t *str, hid_t region, alloc_size = npoints * ndims * sizeof(ptdata[0]); assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ - ptdata = malloc((size_t) alloc_size); + ptdata = (hsize_t *)malloc((size_t) alloc_size); H5_CHECK_OVERFLOW(npoints, hssize_t, hsize_t); H5Sget_select_elem_pointlist(region, (hsize_t)0, (hsize_t)npoints, ptdata); @@ -639,7 +638,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai char *name; unsigned char *ucp_vp = (unsigned char *)vp; char *cp_vp = (char *)vp; - hid_t memb, obj, region; + hid_t memb, obj; unsigned nmembs; static char fmt_llong[8], fmt_ullong[8]; H5T_str_t pad; @@ -934,7 +933,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, "NULL"); } else { - h5tools_str_sprint_region(str, info, container, vp, ctx); + h5tools_str_sprint_region(str, info, container, vp); } } else if (H5Tequal(type, H5T_STD_REF_OBJ)) { @@ -1112,7 +1111,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai */ void h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info, - hid_t container, void *vp, h5tools_context_t *ctx) + hid_t container, void *vp) { hid_t obj, region; char ref_name[1024]; @@ -1130,9 +1129,9 @@ h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info, region_type = H5Sget_select_type(region); if(region_type==H5S_SEL_POINTS) - h5tools_str_dump_region_points(str, region, info, ctx); + h5tools_str_dump_region_points(str, region, info); else - h5tools_str_dump_region_blocks(str, region, info, ctx); + h5tools_str_dump_region_blocks(str, region, info); h5tools_str_append(str, "}"); diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h index 98dd065..599c7d1 100644 --- a/tools/lib/h5tools_str.h +++ b/tools/lib/h5tools_str.h @@ -33,20 +33,17 @@ extern char *h5tools_str_reset(h5tools_str_t *str); extern char *h5tools_str_trunc(h5tools_str_t *str, size_t size); extern char *h5tools_str_fmt(h5tools_str_t *str, size_t start, const char *fmt); extern char *h5tools_str_prefix(h5tools_str_t *str, const h5tool_format_t *info, - hsize_t elmtno, unsigned ndims, hsize_t min_idx[], - hsize_t max_idx[], h5tools_context_t *ctx); + hsize_t elmtno, unsigned ndims, h5tools_context_t *ctx); /* * new functions needed to display region reference data */ extern char *h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, - hsize_t elmtno, hsize_t *ptdata, unsigned ndims, hsize_t min_idx[], + hsize_t elmtno, hsize_t *ptdata, unsigned ndims, hsize_t max_idx[], h5tools_context_t *ctx); -extern void h5tools_str_dump_region_blocks(h5tools_str_t *, hid_t, const h5tool_format_t *, - h5tools_context_t *ctx); -extern void h5tools_str_dump_region_points(h5tools_str_t *, hid_t, const h5tool_format_t *, - h5tools_context_t *ctx); +extern void h5tools_str_dump_region_blocks(h5tools_str_t *, hid_t, const h5tool_format_t *); +extern void h5tools_str_dump_region_points(h5tools_str_t *, hid_t, const h5tool_format_t *); extern void h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info, hid_t container, - void *vp, h5tools_context_t *ctx); + void *vp); extern char *h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t container, hid_t type, void *vp, h5tools_context_t *ctx); |