summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-08-12 21:27:02 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-08-12 21:27:02 (GMT)
commitd9af3b4fdf7f2a8e2ef26855482d0af251864414 (patch)
tree3f690d1eae883dfb0ce12e4d1c6abe54d53295d9 /tools
parent94e652b097b56c9fd20995e065a859847a9ef933 (diff)
downloadhdf5-d9af3b4fdf7f2a8e2ef26855482d0af251864414.zip
hdf5-d9af3b4fdf7f2a8e2ef26855482d0af251864414.tar.gz
hdf5-d9af3b4fdf7f2a8e2ef26855482d0af251864414.tar.bz2
[svn-r19238] Description:
Bring r19237 from trunk to 1.8 branch: 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')
-rw-r--r--tools/h5repack/h5repack_refs.c27
-rw-r--r--tools/lib/h5diff_array.c8
-rw-r--r--tools/lib/h5tools.c63
-rw-r--r--tools/lib/h5tools_str.c23
-rw-r--r--tools/lib/h5tools_str.h13
5 files changed, 59 insertions, 75 deletions
diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c
index fcdfbd5..aa2e823 100644
--- a/tools/h5repack/h5repack_refs.c
+++ b/tools/h5repack/h5repack_refs.c
@@ -707,34 +707,29 @@ error:
*
*-------------------------------------------------------------------------
*/
-
-static const char* MapIdToName(hid_t refobj_id,
- trav_table_t *travt)
+static const char*
+MapIdToName(hid_t refobj_id, trav_table_t *travt)
{
- unsigned int i;
+ unsigned int u;
const char* ret = NULL;
- H5O_info_t ref_oinfo; /* Stat for the refobj id */
/* linear search */
- for(i = 0; i < travt->nobjs; i++)
- {
- if(travt->objs[i].type == H5O_TYPE_DATASET ||
- travt->objs[i].type == H5O_TYPE_GROUP ||
- travt->objs[i].type == H5O_TYPE_NAMED_DATATYPE)
- {
+ for(u = 0; u < travt->nobjs; u++) {
+ if(travt->objs[u].type == H5O_TYPE_DATASET ||
+ travt->objs[u].type == H5O_TYPE_GROUP ||
+ travt->objs[u].type == H5O_TYPE_NAMED_DATATYPE) {
H5O_info_t ref_oinfo; /* Stat for the refobj id */
/* obtain information to identify the referenced object uniquely */
if(H5Oget_info(refobj_id, &ref_oinfo) < 0)
goto out;
- if(ref_oinfo.addr == travt->objs[i].objno)
- {
- ret = travt->objs[i].name;
+ if(ref_oinfo.addr == travt->objs[u].objno) {
+ ret = travt->objs[u].name;
goto out;
- }
+ } /* end if */
} /* end if */
- } /* i */
+ } /* u */
out:
return ret;
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index c94c91f..d3f3c6b 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 f29d6bf..e0ead62 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -204,10 +204,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,
@@ -225,7 +227,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);
@@ -669,8 +671,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) {
@@ -759,7 +760,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 */
@@ -1299,8 +1300,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) {
@@ -1584,8 +1585,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);
@@ -1645,12 +1646,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;
@@ -3867,10 +3867,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);
@@ -3918,17 +3918,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;
@@ -4020,9 +4019,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;
@@ -4030,7 +4030,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");
@@ -4053,8 +4052,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);
@@ -4092,12 +4091,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;
@@ -4150,15 +4147,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 da9218f..46ad8c9 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;
@@ -970,7 +969,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)) {
@@ -1148,7 +1147,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];
@@ -1166,9 +1165,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);