diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-08-12 21:27:02 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-08-12 21:27:02 (GMT) |
commit | d9af3b4fdf7f2a8e2ef26855482d0af251864414 (patch) | |
tree | 3f690d1eae883dfb0ce12e4d1c6abe54d53295d9 | |
parent | 94e652b097b56c9fd20995e065a859847a9ef933 (diff) | |
download | hdf5-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
-rw-r--r-- | hl/tools/gif2h5/gif.h | 2 | ||||
-rw-r--r-- | hl/tools/gif2h5/gif2hdf.c | 2 | ||||
-rw-r--r-- | hl/tools/gif2h5/writehdf.c | 2 | ||||
-rw-r--r-- | test/getname.c | 1 | ||||
-rw-r--r-- | test/trefer.c | 48 | ||||
-rw-r--r-- | tools/h5repack/h5repack_refs.c | 27 | ||||
-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 |
10 files changed, 84 insertions, 105 deletions
diff --git a/hl/tools/gif2h5/gif.h b/hl/tools/gif2h5/gif.h index 737b7de..5334919 100644 --- a/hl/tools/gif2h5/gif.h +++ b/hl/tools/gif2h5/gif.h @@ -159,7 +159,7 @@ int hdfWriteGIF(FILE *fp, BYTE *pic, int ptype, int w, int h, BYTE *rmap, int colorstyle, int BitsPerPixel); /* WRITEHDF.C */ -int WriteHDF(GIFTOMEM , CHAR * , CHAR *); +int WriteHDF(GIFTOMEM , CHAR * ); /* Function: ReadHDF ** Return: 0 on completion without error, -1 on error diff --git a/hl/tools/gif2h5/gif2hdf.c b/hl/tools/gif2h5/gif2hdf.c index 39c71cf..1225613 100644 --- a/hl/tools/gif2h5/gif2hdf.c +++ b/hl/tools/gif2h5/gif2hdf.c @@ -108,7 +108,7 @@ main(int argv , char *argc[]) * Call WriteHDF from here. Go ahead and change WriteHDF to write whatever * format you want */ - if (WriteHDF(GifMemoryStruct , HDFFileName , GIFFileName)) + if (WriteHDF(GifMemoryStruct , HDFFileName)) printf("HDF Write Error\n\n"); /* Free all buffers */ diff --git a/hl/tools/gif2h5/writehdf.c b/hl/tools/gif2h5/writehdf.c index a150b3c..b4cca67 100644 --- a/hl/tools/gif2h5/writehdf.c +++ b/hl/tools/gif2h5/writehdf.c @@ -37,7 +37,7 @@ */ int -WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) +WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName) { GIFHEAD gifHead; /* GIF Header structure */ GIFIMAGEDESC *gifImageDesc; /* Logical Image Descriptor struct */ diff --git a/test/getname.c b/test/getname.c index eba0f6b..bef4756 100644 --- a/test/getname.c +++ b/test/getname.c @@ -2836,7 +2836,6 @@ test_elinks(hid_t fapl) char name[NAME_BUF_SIZE]; /* Buffer for storing object's name */ ssize_t namelen; /* Length of object's name */ hbool_t name_cached; /* Indicate if name is cached */ - unsigned u; /* Counting variables */ /* Initialize the file names */ h5_fixname(FILENAME[1], fapl, filename1, sizeof filename1); diff --git a/test/trefer.c b/test/trefer.c index 6ee298f..4ab3fba 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -79,23 +79,19 @@ test_reference_params(void) hobj_ref_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temp. buffer read from disk */ - hobj_ref_t nvrbuf[3]={0,101,1000000000}; /* buffer with non-valid refs */ unsigned *tu32; /* Temporary pointer to uint32 data */ - int i, j; /* counting variables */ - const char *write_comment="Foo!"; /* Comments for group */ - char read_comment[10]; - H5O_type_t obj_type; /* Object type */ + int i; /* counting variables */ + const char *write_comment = "Foo!"; /* Comments for group */ herr_t ret; /* Generic return value */ - char *ref_name; /* Buffer for ref name */ size_t name_size; /* Size of reference name */ /* Output message about test being performed */ MESSAGE(5, ("Testing Reference Parameters\n")); /* Allocate write & read buffers */ - wbuf = malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); - rbuf = malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); - tbuf = malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + wbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + rbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + tbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); /* Create file */ fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -263,9 +259,9 @@ test_reference_obj(void) MESSAGE(5, ("Testing Object Reference Functions\n")); /* Allocate write & read buffers */ - wbuf = malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); - rbuf = malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); - tbuf = malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + wbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + rbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + tbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); /* Create file */ fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -509,10 +505,10 @@ test_reference_region(void) MESSAGE(5, ("Testing Dataset Region Reference Functions\n")); /* Allocate write & read buffers */ - wbuf = HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); - rbuf = HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); - dwbuf = HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - drbuf = HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); + rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); /* Create file */ fid1 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -781,10 +777,10 @@ test_reference_region_1D(void) MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n")); /* Allocate write & read buffers */ - wbuf = HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); - rbuf = HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); - dwbuf = HDmalloc(sizeof(uint8_t) * SPACE3_DIM1); - drbuf = HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); + wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); + rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE3_DIM1); + drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); /* Create file */ fid1 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -922,7 +918,7 @@ test_reference_region_1D(void) VERIFY(ret, 30, "H5Sget_select_npoints"); ret = (int)H5Sget_select_hyper_nblocks(sid3); VERIFY(ret, 15, "H5Sget_select_hyper_nblocks"); - coords = HDmalloc(ret * SPACE3_RANK * sizeof(hsize_t) * 2); /* allocate space for the hyperslab blocks */ + coords = (hsize_t *)HDmalloc(ret * SPACE3_RANK * sizeof(hsize_t) * 2); /* allocate space for the hyperslab blocks */ ret = H5Sget_select_hyper_blocklist(sid3, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist"); VERIFY(coords[0], 2, "Hyperslab Coordinates"); @@ -974,7 +970,7 @@ test_reference_region_1D(void) VERIFY(ret, 10, "H5Sget_select_npoints"); ret = (int)H5Sget_select_elem_npoints(sid3); VERIFY(ret, 10, "H5Sget_select_elem_npoints"); - coords = HDmalloc(ret * SPACE3_RANK * sizeof(hsize_t)); /* allocate space for the element points */ + coords = (hsize_t *)HDmalloc(ret * SPACE3_RANK * sizeof(hsize_t)); /* allocate space for the element points */ ret = H5Sget_select_elem_pointlist(sid3, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_elem_pointlist"); VERIFY(coords[0], coord1[0][0], "Element Coordinates"); @@ -1313,10 +1309,10 @@ test_reference_compat(void) MESSAGE(5, ("Testing Deprecated Object Reference Functions\n")); /* Allocate write & read buffers */ - wbuf_obj = HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1); - rbuf_obj = HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); - wbuf_reg = HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf_reg = HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + wbuf_obj = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1); + rbuf_obj = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + wbuf_reg = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf_reg = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); /* Create file */ fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); 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); |