From d09b08ce39f96d70f1d68a9f2e0313495c784619 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 17 Apr 2004 23:10:36 -0500 Subject: [svn-r8384] Purpose: Code cleanup Description: Clean up lots of warnings based on those reported from the SGI compilers as well as gcc. Platforms tested: SGI O3900, IRIX64 6.5 (Cheryl's SGI machine) FreeBSD 4.9 (sleipnir) w/ & w/o parallel h5committest --- fortran/src/H5Pf.c | 8 +- src/H5D.c | 42 ++--- src/H5Dcontig.c | 8 - src/H5Dio.c | 8 +- src/H5FDmpio.c | 2 +- src/H5Fcontig.c | 8 - src/H5G.c | 8 +- src/H5R.c | 6 +- src/H5Smpio.c | 1 - src/H5V.c | 10 +- src/H5Vprivate.h | 5 +- src/H5Zdeflate.c | 2 +- test/dsets.c | 24 ++- test/dtypes.c | 6 +- test/h5test.h | 1 + test/hyperslab.c | 10 +- test/istore.c | 8 +- test/testframe.c | 2 +- test/theap.c | 6 +- test/titerate.c | 6 +- test/ttst.c | 2 +- test/tvltypes.c | 4 - test/unlink.c | 4 +- testpar/t_mpi.c | 12 +- testpar/testphdf5.h | 1 + tools/h5diff/h5diff.c | 389 +++++++++++++++++++++++----------------------- tools/h5diff/h5difftst.c | 1 - tools/h5dump/h5dump.c | 67 ++++---- tools/h5import/h5import.c | 14 +- tools/h5ls/h5ls.c | 2 +- tools/lib/h5tools_str.c | 9 +- 31 files changed, 314 insertions(+), 362 deletions(-) diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index a1dc96b..4fc934a 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -1683,10 +1683,9 @@ int_f nh5pset_hyper_cache_c(hid_t_f *prp_id, int_f * cache, int_f * limit) { int ret_value = -1; - hid_t c_prp_id; #ifdef H5_WANT_H5_V1_4_COMPAT + hid_t c_prp_id; herr_t ret; -#endif /* H5_WANT_H5_V1_4_COMPAT */ unsigned c_cache, c_limit; c_cache = (unsigned) *cache; @@ -1696,7 +1695,6 @@ nh5pset_hyper_cache_c(hid_t_f *prp_id, int_f * cache, int_f * limit) * Call H5Pset_hyper_cache function. */ c_prp_id = (hid_t)*prp_id; -#ifdef H5_WANT_H5_V1_4_COMPAT ret = H5Pset_hyper_cache(c_prp_id, c_cache, c_limit); if (ret < 0) return ret_value; #endif /* H5_WANT_H5_V1_4_COMPAT */ @@ -1860,7 +1858,7 @@ nh5pset_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) { int ret_value = -1; hid_t c_fapl_id; - hid_t c_degree; + H5F_close_degree_t c_degree; c_fapl_id = (hid_t)*fapl_id; c_degree = (H5F_close_degree_t)*degree; @@ -1915,7 +1913,7 @@ nh5pget_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) c_prp_id = (hid_t)*prp_id; c_size = H5Pget_buffer(c_prp_id, NULL, NULL); - if ( c_size < 0 ) return ret_value; + if ( c_size == 0 ) return ret_value; *size = (hsize_t)c_size; ret_value = 0; return ret_value; diff --git a/src/H5D.c b/src/H5D.c index 066c048..f3affc4 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -599,7 +599,7 @@ done: *------------------------------------------------------------------------- */ static int -H5D_crt_fill_value_cmp(const void *value1, const void *value2, size_t size) +H5D_crt_fill_value_cmp(const void *value1, const void *value2, size_t UNUSED size) { const H5O_fill_t *fill1=(const H5O_fill_t *)value1, /* Create local aliases for values */ *fill2=(const H5O_fill_t *)value2; @@ -655,7 +655,7 @@ done: *------------------------------------------------------------------------- */ static int -H5D_crt_ext_file_list_cmp(const void *value1, const void *value2, size_t size) +H5D_crt_ext_file_list_cmp(const void *value1, const void *value2, size_t UNUSED size) { const H5O_efl_t *efl1=(const H5O_efl_t *)value1, /* Create local aliases for values */ *efl2=(const H5O_efl_t *)value2; @@ -737,7 +737,7 @@ done: *------------------------------------------------------------------------- */ static int -H5D_crt_data_pipeline_cmp(const void *value1, const void *value2, size_t size) +H5D_crt_data_pipeline_cmp(const void *value1, const void *value2, size_t UNUSED size) { const H5O_pline_t *pline1=(const H5O_pline_t *)value1, /* Create local aliases for values */ *pline2=(const H5O_pline_t *)value2; @@ -763,40 +763,40 @@ H5D_crt_data_pipeline_cmp(const void *value1, const void *value2, size_t size) if(pline1->filter==NULL && pline2->filter!=NULL) HGOTO_DONE(-1); if(pline1->filter!=NULL && pline2->filter==NULL) HGOTO_DONE(1); if(pline1->filter!=NULL && pline1->nfilters>0) { - int i; /* Local index variable */ + size_t u; /* Local index variable */ /* Loop through all filters, comparing them */ - for(i=0; infilters; i++) { + for(u=0; unfilters; u++) { /* Check the ID of the filter */ - if(pline1->filter[i].id < pline2->filter[i].id) HGOTO_DONE(-1); - if(pline1->filter[i].id > pline2->filter[i].id) HGOTO_DONE(1); + if(pline1->filter[u].id < pline2->filter[u].id) HGOTO_DONE(-1); + if(pline1->filter[u].id > pline2->filter[u].id) HGOTO_DONE(1); /* Check the flags for the filter */ - if(pline1->filter[i].flags < pline2->filter[i].flags) HGOTO_DONE(-1); - if(pline1->filter[i].flags > pline2->filter[i].flags) HGOTO_DONE(1); + if(pline1->filter[u].flags < pline2->filter[u].flags) HGOTO_DONE(-1); + if(pline1->filter[u].flags > pline2->filter[u].flags) HGOTO_DONE(1); /* Check the name of the filter */ - if(pline1->filter[i].name==NULL && pline2->filter[i].name!=NULL) HGOTO_DONE(-1); - if(pline1->filter[i].name!=NULL && pline2->filter[i].name==NULL) HGOTO_DONE(1); - if(pline1->filter[i].name!=NULL) - if((cmp_value=HDstrcmp(pline1->filter[i].name,pline2->filter[i].name))!=0) + if(pline1->filter[u].name==NULL && pline2->filter[u].name!=NULL) HGOTO_DONE(-1); + if(pline1->filter[u].name!=NULL && pline2->filter[u].name==NULL) HGOTO_DONE(1); + if(pline1->filter[u].name!=NULL) + if((cmp_value=HDstrcmp(pline1->filter[u].name,pline2->filter[u].name))!=0) HGOTO_DONE(cmp_value); /* Check the number of parameters for the filter */ - if(pline1->filter[i].cd_nelmts < pline2->filter[i].cd_nelmts) HGOTO_DONE(-1); - if(pline1->filter[i].cd_nelmts > pline2->filter[i].cd_nelmts) HGOTO_DONE(1); + if(pline1->filter[u].cd_nelmts < pline2->filter[u].cd_nelmts) HGOTO_DONE(-1); + if(pline1->filter[u].cd_nelmts > pline2->filter[u].cd_nelmts) HGOTO_DONE(1); /* Check the filter parameter information */ - if(pline1->filter[i].cd_values==NULL && pline2->filter[i].cd_values!=NULL) HGOTO_DONE(-1); - if(pline1->filter[i].cd_values!=NULL && pline2->filter[i].cd_values==NULL) HGOTO_DONE(1); - if(pline1->filter[i].cd_values!=NULL && pline1->filter[i].cd_nelmts>0) { + if(pline1->filter[u].cd_values==NULL && pline2->filter[u].cd_values!=NULL) HGOTO_DONE(-1); + if(pline1->filter[u].cd_values!=NULL && pline2->filter[u].cd_values==NULL) HGOTO_DONE(1); + if(pline1->filter[u].cd_values!=NULL && pline1->filter[u].cd_nelmts>0) { size_t v; /* Local index variable */ /* Loop through all parameters, comparing them */ - for(v=0; vfilter[i].cd_nelmts; v++) { + for(v=0; vfilter[u].cd_nelmts; v++) { /* Check each parameter for the filter */ - if(pline1->filter[i].cd_values[v] < pline2->filter[i].cd_values[v]) HGOTO_DONE(-1); - if(pline1->filter[i].cd_values[v] > pline2->filter[i].cd_values[v]) HGOTO_DONE(1); + if(pline1->filter[u].cd_values[v] < pline2->filter[u].cd_values[v]) HGOTO_DONE(-1); + if(pline1->filter[u].cd_values[v] > pline2->filter[u].cd_values[v]) HGOTO_DONE(1); } /* end for */ } /* end if */ } /* end for */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 525d557..9b1ad40 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -138,7 +138,6 @@ H5F_contig_fill(H5F_t *f, hid_t dxpl_id, struct H5O_layout_t *layout, #ifdef H5_HAVE_PARALLEL MPI_Comm mpi_comm=MPI_COMM_NULL; /* MPI communicator for file */ int mpi_rank=(-1); /* This process's rank */ - int mpi_size=(-1); /* Total # of processes */ int mpi_code; /* MPI return code */ unsigned blocks_written=0; /* Flag to indicate that chunk was actually written */ unsigned using_mpi=0; /* Flag to indicate that the file is being accessed with an MPI-capable file driver */ @@ -167,8 +166,6 @@ H5F_contig_fill(H5F_t *f, hid_t dxpl_id, struct H5O_layout_t *layout, /* Get the MPI rank & size */ if ((mpi_rank=H5FD_mpio_mpi_rank(f->shared->lf))<0) HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI rank"); - if ((mpi_size=H5FD_mpio_mpi_size(f->shared->lf))<0) - HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI size"); /* Set the MPI-capable file driver flag */ using_mpi=1; @@ -181,8 +178,6 @@ H5F_contig_fill(H5F_t *f, hid_t dxpl_id, struct H5O_layout_t *layout, /* Get the MPI rank & size */ if ((mpi_rank=H5FD_mpiposix_mpi_rank(f->shared->lf))<0) HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI rank"); - if ((mpi_size=H5FD_mpiposix_mpi_size(f->shared->lf))<0) - HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI size"); /* Set the MPI-capable file driver flag */ using_mpi=1; @@ -197,9 +192,6 @@ H5F_contig_fill(H5F_t *f, hid_t dxpl_id, struct H5O_layout_t *layout, if ((mpi_rank = H5FD_fphdf5_mpi_rank(f->shared->lf)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI rank"); - if ((mpi_size = H5FD_fphdf5_mpi_size(f->shared->lf)) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI size"); - /* Set the MPI-capable file driver flag */ using_mpi = 1; } /* end if */ diff --git a/src/H5Dio.c b/src/H5Dio.c index 364eaea..452663a 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -2690,7 +2690,7 @@ H5D_create_chunk_file_map_hyper(const fm_map *fm) } /* end for */ /* Calculate the index of this chunk */ - if(H5V_chunk_index(fm->f_ndims,coords,fm->layout->dim,fm->chunks,fm->down_chunks,&chunk_index)<0) + if(H5V_chunk_index(fm->f_ndims,coords,fm->layout->dim,fm->down_chunks,&chunk_index)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index"); /* Iterate through each chunk in the dataset */ @@ -2802,7 +2802,7 @@ H5D_create_chunk_file_map_hyper(const fm_map *fm) } while(coords[curr_dim]>sel_end[curr_dim]); /* Re-Calculate the index of this chunk */ - if(H5V_chunk_index(fm->f_ndims,coords,fm->layout->dim,fm->chunks,fm->down_chunks,&chunk_index)<0) + if(H5V_chunk_index(fm->f_ndims,coords,fm->layout->dim,fm->down_chunks,&chunk_index)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index"); } /* end if */ } /* end while */ @@ -3024,7 +3024,7 @@ H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, hsize_t ndims, hssize FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_file_cb) /* Calculate the index of this chunk */ - if(H5V_chunk_index((unsigned)ndims,coords,fm->layout->dim,fm->chunks,fm->down_chunks,&chunk_index)<0) + if(H5V_chunk_index((unsigned)ndims,coords,fm->layout->dim,fm->down_chunks,&chunk_index)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") /* Find correct chunk in file & memory TBBTs */ @@ -3135,7 +3135,7 @@ H5D_chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, hsize_t ndims, hssize_ FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_mem_cb); /* Calculate the index of this chunk */ - if(H5V_chunk_index((unsigned)ndims,coords,fm->layout->dim,fm->chunks,fm->down_chunks,&chunk_index)<0) + if(H5V_chunk_index((unsigned)ndims,coords,fm->layout->dim,fm->down_chunks,&chunk_index)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index"); /* Find correct chunk in file & memory TBBTs */ diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 8f8c769..7cf6677 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -1754,7 +1754,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */ /* Obtain the data transfer properties */ - xfer_mode = H5P_peek_unsigned(plist, H5D_XFER_IO_XFER_MODE_NAME); + xfer_mode = (H5FD_mpio_xfer_t)H5P_peek_unsigned(plist, H5D_XFER_IO_XFER_MODE_NAME); /* * Set up for a fancy xfer using complex types, or single byte block. We diff --git a/src/H5Fcontig.c b/src/H5Fcontig.c index 525d557..9b1ad40 100644 --- a/src/H5Fcontig.c +++ b/src/H5Fcontig.c @@ -138,7 +138,6 @@ H5F_contig_fill(H5F_t *f, hid_t dxpl_id, struct H5O_layout_t *layout, #ifdef H5_HAVE_PARALLEL MPI_Comm mpi_comm=MPI_COMM_NULL; /* MPI communicator for file */ int mpi_rank=(-1); /* This process's rank */ - int mpi_size=(-1); /* Total # of processes */ int mpi_code; /* MPI return code */ unsigned blocks_written=0; /* Flag to indicate that chunk was actually written */ unsigned using_mpi=0; /* Flag to indicate that the file is being accessed with an MPI-capable file driver */ @@ -167,8 +166,6 @@ H5F_contig_fill(H5F_t *f, hid_t dxpl_id, struct H5O_layout_t *layout, /* Get the MPI rank & size */ if ((mpi_rank=H5FD_mpio_mpi_rank(f->shared->lf))<0) HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI rank"); - if ((mpi_size=H5FD_mpio_mpi_size(f->shared->lf))<0) - HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI size"); /* Set the MPI-capable file driver flag */ using_mpi=1; @@ -181,8 +178,6 @@ H5F_contig_fill(H5F_t *f, hid_t dxpl_id, struct H5O_layout_t *layout, /* Get the MPI rank & size */ if ((mpi_rank=H5FD_mpiposix_mpi_rank(f->shared->lf))<0) HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI rank"); - if ((mpi_size=H5FD_mpiposix_mpi_size(f->shared->lf))<0) - HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI size"); /* Set the MPI-capable file driver flag */ using_mpi=1; @@ -197,9 +192,6 @@ H5F_contig_fill(H5F_t *f, hid_t dxpl_id, struct H5O_layout_t *layout, if ((mpi_rank = H5FD_fphdf5_mpi_rank(f->shared->lf)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI rank"); - if ((mpi_size = H5FD_fphdf5_mpi_size(f->shared->lf)) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI size"); - /* Set the MPI-capable file driver flag */ using_mpi = 1; } /* end if */ diff --git a/src/H5G.c b/src/H5G.c index b120231..e615963 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -595,9 +595,9 @@ H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx) /* Check args */ if (NULL==(loc=H5G_loc (loc_id))) - HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a location ID"); + HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "not a location ID"); if(H5G_get_type(loc,H5AC_ind_dxpl_id)!=H5G_GROUP) - HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a group"); + HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "not a group"); if (H5G_get_num_objs(loc, &num_objs, H5AC_ind_dxpl_id)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "unable to retrieve number of members"); @@ -605,7 +605,7 @@ H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "index out of bound"); /*call private function*/ - ret_value = H5G_get_objtype_by_idx(loc, idx, H5AC_ind_dxpl_id); + ret_value = (H5G_obj_t)H5G_get_objtype_by_idx(loc, idx, H5AC_ind_dxpl_id); done: FUNC_LEAVE_API(ret_value); @@ -2566,7 +2566,7 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link, statbuf->mtime = 0; } } - statbuf->type = H5G_get_type(&obj_ent, dxpl_id); + statbuf->type = (H5G_obj_t)H5G_get_type(&obj_ent, dxpl_id); H5E_clear(); /*clear errors resulting from checking type*/ /* Get object header information */ diff --git a/src/H5R.c b/src/H5R.c index 8e18959..50e8745 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -880,7 +880,11 @@ H5Rget_obj_type(hid_t id, H5R_type_t ref_type, void *_ref) file=loc->file; /* Get the object information */ - if ((ret_value=H5R_get_obj_type(file,H5AC_ind_dxpl_id,ref_type,_ref))<0) + if ((ret_value= +#ifndef H5_WANT_H5_V1_4_COMPAT + (H5G_obj_t) +#endif /* H5_WANT_H5_V1_4_COMPAT */ + H5R_get_obj_type(file,H5AC_ind_dxpl_id,ref_type,_ref))<0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5G_UNKNOWN, "unable to determine object type"); done: diff --git a/src/H5Smpio.c b/src/H5Smpio.c index e820b92..08632b9 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -567,7 +567,6 @@ H5S_mpio_space_type( const H5S_t *space, size_t elmt_size, case H5S_COMPLEX: /* not yet implemented */ HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "complex data spaces are not supported yet"); - break; default: assert("unknown data space type" && 0); diff --git a/src/H5V.c b/src/H5V.c index 88793e2..dfadee9 100644 --- a/src/H5V.c +++ b/src/H5V.c @@ -1027,7 +1027,7 @@ done: *------------------------------------------------------------------------- */ hsize_t -H5V_array_offset_pre(unsigned n, const hsize_t *total_size, const hsize_t *acc, const hssize_t *offset) +H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hssize_t *offset) { hsize_t skip; /*starting point byte offset */ int i; /*counter */ @@ -1036,7 +1036,6 @@ H5V_array_offset_pre(unsigned n, const hsize_t *total_size, const hsize_t *acc, FUNC_ENTER_NOAPI(H5V_array_offset_pre, (HDabort(), 0)); assert(n <= H5V_HYPER_NDIMS); - assert(total_size); assert(acc); assert(offset); @@ -1089,7 +1088,7 @@ H5V_array_offset(unsigned n, const hsize_t *total_size, const hssize_t *offset) HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, UFAIL, "can't compute down sizes"); /* Set return value */ - ret_value=H5V_array_offset_pre(n,total_size,acc_arr,offset); + ret_value=H5V_array_offset_pre(n,acc_arr,offset); done: FUNC_LEAVE_NOAPI(ret_value); @@ -1194,7 +1193,7 @@ done: */ herr_t H5V_chunk_index(unsigned ndims, const hssize_t *coord, const hsize_t *chunk, - const hsize_t *nchunks, const hsize_t *down_nchunks, hsize_t *chunk_idx) + const hsize_t *down_nchunks, hsize_t *chunk_idx) { hssize_t scaled_coord[H5V_HYPER_NDIMS]; /* Scaled, coordinates, in terms of chunks */ unsigned u; /* Local index variable */ @@ -1206,7 +1205,6 @@ H5V_chunk_index(unsigned ndims, const hssize_t *coord, const hsize_t *chunk, assert(ndims <= H5V_HYPER_NDIMS); assert(coord); assert(chunk); - assert(nchunks); assert(chunk_idx); /* Compute the scaled coordinates for actual coordinates */ @@ -1214,7 +1212,7 @@ H5V_chunk_index(unsigned ndims, const hssize_t *coord, const hsize_t *chunk, scaled_coord[u]=coord[u]/chunk[u]; /* Compute the chunk index */ - *chunk_idx=H5V_array_offset_pre(ndims,nchunks,down_nchunks,scaled_coord); + *chunk_idx=H5V_array_offset_pre(ndims,down_nchunks,scaled_coord); done: FUNC_LEAVE_NOAPI(ret_value); diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h index 07692b0..f109e27 100644 --- a/src/H5Vprivate.h +++ b/src/H5Vprivate.h @@ -85,15 +85,14 @@ H5_DLL herr_t H5V_array_fill(void *_dst, const void *src, size_t size, size_t count); H5_DLL herr_t H5V_array_down(unsigned n, const hsize_t *total_size, hsize_t *down); -H5_DLL hsize_t H5V_array_offset_pre(unsigned n, const hsize_t *total_size, +H5_DLL hsize_t H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hssize_t *offset); H5_DLL hsize_t H5V_array_offset(unsigned n, const hsize_t *total_size, const hssize_t *offset); H5_DLL herr_t H5V_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hssize_t *coords); H5_DLL herr_t H5V_chunk_index(unsigned ndims, const hssize_t *coord, - const hsize_t *chunk, const hsize_t *nchunks, const hsize_t *down_nchunks, - hsize_t *chunk_idx); + const hsize_t *chunk, const hsize_t *down_nchunks, hsize_t *chunk_idx); H5_DLL ssize_t H5V_memcpyvv(void *_dst, size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], hsize_t dst_off_arr[], const void *_src, diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index 89f15cc..e83cd86 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -48,7 +48,7 @@ const H5Z_class_t H5Z_DEFLATE[1] = {{ H5Z_filter_deflate, /* The actual filter function */ }}; -#define H5Z_DEFLATE_SIZE_ADJUST(s) (HDceil((double)((s)*1.001))+12) +#define H5Z_DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s))*1.001)+12) /*------------------------------------------------------------------------- diff --git a/test/dsets.c b/test/dsets.c index 3862f84..176f64e 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -1425,7 +1425,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, for (i=0; i CLLoop + 1) && ((HDstrcmp(argv[CLLoop], "-verbose") == 0) || diff --git a/test/theap.c b/test/theap.c index 3c134bb..87c4836 100644 --- a/test/theap.c +++ b/test/theap.c @@ -87,15 +87,13 @@ static int tst_inc_sort(const void *_i1, const void *_i2) static void test_heap_init(void) { - time_t curr_time; /* Current time, for seeding random number generator */ size_t u; /* Local index variables */ /* Create randomized set of numbers */ - curr_time=time(NULL); - HDsrandom((unsigned long)curr_time); + HDsrandom((unsigned long)HDtime(NULL)); for(u=0; u MPIO_TEST_WRITE_SIZE) - stride = MPIO_TEST_WRITE_SIZE - mpi_off; + stride = MPIO_TEST_WRITE_SIZE - (int)mpi_off; /* set data to some trivial pattern for easy verification */ for (i=0; i MPIO_TEST_WRITE_SIZE) - stride = MPIO_TEST_WRITE_SIZE - mpi_off; + stride = MPIO_TEST_WRITE_SIZE - (int)mpi_off; mrc = MPI_File_read_at(fh, mpi_off, buf, stride, MPI_BYTE, &mpi_stat); VRFY((mrc==MPI_SUCCESS), ""); vrfyerrs=0; for (i=0; i #include #include -#include #include "hdf5.h" #include "h5trav.h" #include "H5private.h" @@ -63,18 +62,18 @@ options_t options = {0,0,0,0,0,0,0}; */ static int diff_dataset( hid_t file1_id, hid_t file2_id, const char *obj1_name, - const char *obj2_name, options_t options ); + const char *obj2_name, options_t opts ); static int diff( hid_t file1_id, const char *obj1_name, hid_t file2_id, const char *obj2_name, - options_t options, int type ); + options_t opts, int type ); static int compare( hid_t file1_id, const char *file1_name, const char *obj1_name, int nobjects1, info_t *info1, hid_t file2_id, const char *file2_name, const char *obj2_name, int nobjects2, info_t *info2, - options_t options ); + options_t opts ); static int match( hid_t file1_id, int nobjects1, info_t *info1, - hid_t file2_id, int nobjects2, info_t *info2, options_t options ); + hid_t file2_id, int nobjects2, info_t *info2, options_t opts ); static int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims, - options_t options, const char *obj1, const char *obj2, + options_t opts, const char *obj1, const char *obj2, hid_t m_type ); /*------------------------------------------------------------------------- @@ -576,7 +575,7 @@ int compare_object( char *obj1, char *obj2 ) */ static int match( hid_t file1_id, int nobjects1, info_t *info1, - hid_t file2_id, int nobjects2, info_t *info2, options_t options ) + hid_t file2_id, int nobjects2, info_t *info2, options_t opts ) { int cmp; int more_names_exist = (nobjects1>0 && nobjects2>0) ? 1 : 0; @@ -673,7 +672,7 @@ int match( hid_t file1_id, int nobjects1, info_t *info1, if ( table->objs[i].objno[0]==1 && table->objs[i].objno[1]==1 ) nfound+=diff( file1_id, table->objs[i].objname, file2_id, table->objs[i].objname, - options, table->objs[i].type ); + opts, table->objs[i].type ); } /* free table */ @@ -745,7 +744,7 @@ int compare( hid_t file1_id, const char *file1_name, const char *obj1_name, int nobjects1, info_t *info1, hid_t file2_id, const char *file2_name, const char *obj2_name, int nobjects2, info_t *info2, - options_t options ) + options_t opts ) { int f1=0, f2=0; @@ -781,7 +780,7 @@ int compare( hid_t file1_id, const char *file1_name, const char *obj1_name, return 0; } - nfound=diff( file1_id, obj1_name, file2_id, obj2_name, options, info1[i].type ); + nfound=diff( file1_id, obj1_name, file2_id, obj2_name, opts, info1[i].type ); return nfound; } @@ -807,14 +806,14 @@ int compare( hid_t file1_id, const char *file1_name, const char *obj1_name, static int diff( hid_t file1_id, const char *obj1_name, hid_t file2_id, const char *obj2_name, - options_t options, int type ) + options_t opts, int type ) { int nfound=0; switch ( type ) { case H5G_DATASET: - nfound=diff_dataset(file1_id,file2_id,obj1_name,obj2_name,options); + nfound=diff_dataset(file1_id,file2_id,obj1_name,obj2_name,opts); break; default: @@ -849,7 +848,7 @@ int diff( hid_t file1_id, const char *obj1_name, hid_t file2_id, const char *obj */ static int diff_dataset( hid_t file1_id, hid_t file2_id, const char *obj1_name, - const char *obj2_name, options_t options ) + const char *obj2_name, options_t opts ) { void *edata; hid_t (*func)(void*); @@ -1189,7 +1188,7 @@ int diff_dataset( hid_t file1_id, hid_t file2_id, const char *obj1_name, printf( "Comparing <%s> with <%s>\n", obj1_name, obj2_name ); name1=h5diff_basename(obj1_name); name2=h5diff_basename(obj2_name); - nfound = array_diff(buf1,buf2,tot_cnt1,rank1,dims1,options,name1,name2,m_type1); + nfound = array_diff(buf1,buf2,tot_cnt1,rank1,dims1,opts,name1,name2,m_type1); printf("%d differences found\n", nfound ); /*------------------------------------------------------------------------- @@ -1238,7 +1237,7 @@ out: */ static int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims, - options_t options, const char *obj1, const char *obj2, + options_t opts, const char *obj1, const char *obj2, hid_t m_type ) { char fmt_llong[255], fmt_ullong[255]; @@ -1288,13 +1287,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_char, _buf1, sizeof(char)); memcpy(&temp2_char, _buf2, sizeof(char)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (abs(temp1_char-temp2_char) > options.delta) + if (abs(temp1_char-temp2_char) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1304,13 +1303,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options.percent ) + if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1321,14 +1320,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options.percent && - abs(temp1_char-temp2_char) > options.delta ) + if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > opts.percent && + abs(temp1_char-temp2_char) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1340,9 +1339,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_char != temp2_char) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1372,13 +1371,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_uchar, _buf1, sizeof(unsigned char)); memcpy(&temp2_uchar, _buf2, sizeof(unsigned char)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (abs(temp1_uchar-temp2_uchar) > options.delta) + if (abs(temp1_uchar-temp2_uchar) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1388,13 +1387,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options.percent ) + if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1405,14 +1404,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options.percent && - abs(temp1_uchar-temp2_uchar) > options.delta ) + if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > opts.percent && + abs(temp1_uchar-temp2_uchar) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1424,9 +1423,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_uchar != temp2_uchar) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1457,13 +1456,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_short, _buf1, sizeof(short)); memcpy(&temp2_short, _buf2, sizeof(short)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (abs(temp1_short-temp2_short) > options.delta) + if (abs(temp1_short-temp2_short) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1473,13 +1472,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options.percent ) + if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1490,14 +1489,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options.percent && - abs(temp1_short-temp2_short) > options.delta ) + if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > opts.percent && + abs(temp1_short-temp2_short) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1509,9 +1508,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_short != temp2_short) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1541,13 +1540,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_ushort, _buf1, sizeof(unsigned short)); memcpy(&temp2_ushort, _buf2, sizeof(unsigned short)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (abs(temp1_ushort-temp2_ushort) > options.delta) + if (abs(temp1_ushort-temp2_ushort) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1557,13 +1556,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options.percent ) + if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1574,14 +1573,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options.percent && - abs(temp1_ushort-temp2_ushort) > options.delta ) + if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > opts.percent && + abs(temp1_ushort-temp2_ushort) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1593,9 +1592,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_ushort != temp2_ushort) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1626,13 +1625,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_int, _buf1, sizeof(int)); memcpy(&temp2_int, _buf2, sizeof(int)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (abs(temp1_int-temp2_int) > options.delta) + if (abs(temp1_int-temp2_int) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1642,13 +1641,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options.percent ) + if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1659,14 +1658,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options.percent && - abs(temp1_int-temp2_int) > options.delta ) + if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > opts.percent && + abs(temp1_int-temp2_int) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1678,9 +1677,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_int != temp2_int) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1711,13 +1710,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_uint, _buf1, sizeof(unsigned int)); memcpy(&temp2_uint, _buf2, sizeof(unsigned int)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (abs((int)(temp1_uint-temp2_uint)) > options.delta) + if (abs((int)(temp1_uint-temp2_uint)) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1727,13 +1726,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > options.percent ) + if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1744,14 +1743,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > options.percent && - abs((int)(temp1_uint-temp2_uint)) > options.delta ) + if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > opts.percent && + abs((int)(temp1_uint-temp2_uint)) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1763,9 +1762,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_uint != temp2_uint) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1796,13 +1795,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_long, _buf1, sizeof(long)); memcpy(&temp2_long, _buf2, sizeof(long)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (labs(temp1_long-temp2_long) > (long)options.delta) + if (labs(temp1_long-temp2_long) > (long)opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1812,13 +1811,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)options.percent ) + if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1829,14 +1828,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)options.percent && - labs(temp1_long-temp2_long) > (long)options.delta ) + if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)opts.percent && + labs(temp1_long-temp2_long) > (long)opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1848,9 +1847,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_long != temp2_long) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1880,13 +1879,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_ulong, _buf1, sizeof(unsigned long)); memcpy(&temp2_ulong, _buf2, sizeof(unsigned long)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (labs((long)(temp1_ulong-temp2_ulong)) > (long)options.delta) + if (labs((long)(temp1_ulong-temp2_ulong)) > (long)opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1896,13 +1895,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)options.percent ) + if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1913,14 +1912,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)options.percent && - labs((long)(temp1_ulong-temp2_ulong)) > (long)options.delta ) + if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)opts.percent && + labs((long)(temp1_ulong-temp2_ulong)) > (long)opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1932,9 +1931,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_ulong != temp2_ulong) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1964,13 +1963,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_llong, _buf1, sizeof(long_long)); memcpy(&temp2_llong, _buf2, sizeof(long_long)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (labs((long)(temp1_llong-temp2_llong)) > (long)options.delta) + if (labs((long)(temp1_llong-temp2_llong)) > (long)opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1980,13 +1979,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)options.percent ) + if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1997,14 +1996,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)options.percent && - labs((long)(temp1_llong-temp2_llong)) > (long)options.delta ) + if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)opts.percent && + labs((long)(temp1_llong-temp2_llong)) > (long)opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2016,9 +2015,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_llong != temp2_llong) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2048,13 +2047,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_ullong, _buf1, sizeof(unsigned long_long)); memcpy(&temp2_ullong, _buf2, sizeof(unsigned long_long)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (labs((long)(temp1_ullong-temp2_ullong)) > (long)options.delta) + if (labs((long)(temp1_ullong-temp2_ullong)) > (long)opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2065,13 +2064,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)options.percent ) + if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2083,14 +2082,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)options.percent && - labs((long)(temp1_ullong-temp2_ullong)) > (long)options.delta ) + if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)opts.percent && + labs((long)(temp1_ullong-temp2_ullong)) > (long)opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2103,9 +2102,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_ullong != temp2_ullong) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2136,13 +2135,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_float, _buf1, sizeof(float)); memcpy(&temp2_float, _buf2, sizeof(float)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (fabs(temp1_float-temp2_float) > options.delta) + if (fabs(temp1_float-temp2_float) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2152,13 +2151,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options.percent ) + if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2169,14 +2168,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options.percent && - fabs(temp1_float-temp2_float) > options.delta ) + if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > opts.percent && + fabs(temp1_float-temp2_float) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2188,9 +2187,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_float != temp2_float) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2220,13 +2219,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims memcpy(&temp1_double, _buf1, sizeof(double)); memcpy(&temp2_double, _buf2, sizeof(double)); /* -d and !-p */ - if (options.d && !options.p) + if (opts.d && !opts.p) { - if (fabs(temp1_double-temp2_double) > options.delta) + if (fabs(temp1_double-temp2_double) > opts.delta) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2236,13 +2235,13 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* !-d and -p */ - else if (!options.d && options.p) + else if (!opts.d && opts.p) { - if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options.percent ) + if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > opts.percent ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2253,14 +2252,14 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } } /* -d and -p */ - else if ( options.d && options.p) + else if ( opts.d && opts.p) { - if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options.percent && - fabs(temp1_double-temp2_double) > options.delta ) + if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > opts.percent && + fabs(temp1_double-temp2_double) > opts.delta ) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2272,9 +2271,9 @@ int array_diff( void *buf1, void *buf2, hsize_t tot_cnt, int rank, hsize_t *dims } else if (temp1_double != temp2_double) { - if (options.n && nfound>=options.count) + if (opts.n && nfound>=opts.count) return nfound; - if ( options.r==0 ) + if ( opts.r==0 ) { print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); diff --git a/tools/h5diff/h5difftst.c b/tools/h5diff/h5difftst.c index 783eb42..e270171 100644 --- a/tools/h5diff/h5difftst.c +++ b/tools/h5diff/h5difftst.c @@ -14,7 +14,6 @@ #include #include -#include #include "hdf5.h" #include "H5private.h" diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 21913cd..601b3bd 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -70,7 +70,9 @@ static void dump_oid(hid_t oid); static void print_enum(hid_t type); static herr_t dump_all(hid_t group, const char *name, void *op_data); static char *lookup_ref_path(hobj_ref_t *); +#ifdef LATER static void check_compression(hid_t); +#endif /* LATER */ static struct ref_path_table_entry_t *ref_path_table_lookup(const char *); static int xml_name_to_XID(const char *, char *, int , int ); static int get_next_xid(void); @@ -1425,7 +1427,6 @@ dump_all(hid_t group, const char *name, void * op_data) dump_header_format->datasetblockend); } else { /* the XML version */ - int res; char *t_tmp; char *t_prefix; char *t_name; @@ -1437,8 +1438,8 @@ dump_all(hid_t group, const char *name, void * op_data) t_tmp = xml_escape_the_name(strcat(strcat(tx_tmp, "/"), name)); t_prefix = xml_escape_the_name(prefix); t_name = xml_escape_the_name(name); - res = xml_name_to_XID( strcat(strcat(tmp,"/"),name), dsetxid,100,1); - res = xml_name_to_XID( prefix ,parentxid,100,1); + xml_name_to_XID( strcat(strcat(tmp,"/"),name), dsetxid,100,1); + xml_name_to_XID( prefix ,parentxid,100,1); printf("<%sDataset Name=\"%s\" OBJ-XID=\"%s-%d\" " "H5Path=\"%s\" Parents=\"%s\" " @@ -1449,7 +1450,7 @@ dump_all(hid_t group, const char *name, void * op_data) (strcmp(prefix, "") ? t_prefix : "/")); indentation(indent + COL); - res = xml_name_to_XID(dset_table->objs[i].objname,pointerxid,100,1); + xml_name_to_XID(dset_table->objs[i].objname,pointerxid,100,1); printf("<%sDatasetPtr OBJ-XID=\"%s\" H5Path=\"%s\"/>\n", xmlnsprefix, pointerxid,t_tmp); @@ -3743,9 +3744,8 @@ xml_print_datatype(hid_t type, unsigned in_group) /* This should be defined somewhere else */ /* These 2 cases are handled the same right now, but probably will have something different eventually */ - int res; char * dtxid = malloc(100); - res = xml_name_to_XID(type_table->objs[i].objname,dtxid,100,1); + xml_name_to_XID(type_table->objs[i].objname,dtxid,100,1); if (!type_table->objs[i].recorded) { /* 'anonymous' NDT. Use it's object num. as it's name. */ @@ -4111,9 +4111,8 @@ xml_dump_datatype(hid_t type) if (i >= 0) { /* Shared data type, must be entered as an object */ /* These 2 cases are the same now, but may change */ - int res; char * dtxid = malloc(100); - res = xml_name_to_XID(type_table->objs[i].objname,dtxid,100,1); + xml_name_to_XID(type_table->objs[i].objname,dtxid,100,1); if (!type_table->objs[i].recorded) { /* anonymous stored data type: following the dumper's current @@ -4457,7 +4456,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, void UNUSED * op_data) static void xml_dump_named_datatype(hid_t type, const char *name) { - int res; char *tmp; char * dtxid; char * parentxid; @@ -4476,8 +4474,8 @@ xml_dump_named_datatype(hid_t type, const char *name) /*char **/t_tmp = xml_escape_the_name(tmp); /*char **/t_prefix = xml_escape_the_name(prefix); /*char **/t_name = xml_escape_the_name(name); - res = xml_name_to_XID(tmp,dtxid,100,1); - res = xml_name_to_XID(prefix,parentxid,100,1); + xml_name_to_XID(tmp,dtxid,100,1); + xml_name_to_XID(prefix,parentxid,100,1); if (strncmp(name, "#", 1) == 0) { /* Special: this is an 'anonymous' NDT, deleted but still in use. @@ -4583,20 +4581,19 @@ xml_dump_group(hid_t gid, const char *name) d_status = EXIT_FAILURE; } else if (group_table->objs[i].displayed) { /* already seen: enter a groupptr */ - int res; char *t_name = xml_escape_the_name(name); char *grpxid = malloc(100); char *parentxid = malloc(100); if (isRoot) { /* probably can't happen! */ - res = xml_name_to_XID("/",grpxid,100,1); + xml_name_to_XID("/",grpxid,100,1); printf("<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">\n", xmlnsprefix,grpxid,"/"); } else { t_objname = xml_escape_the_name(group_table->objs[i].objname); par_name = xml_escape_the_name(par); - res = xml_name_to_XID(tmp,grpxid,100,1); - res = xml_name_to_XID(par,parentxid,100,1); + xml_name_to_XID(tmp,grpxid,100,1); + xml_name_to_XID(par,parentxid,100,1); printf("<%sGroup Name=\"%s\" OBJ-XID=\"%s-%d\" H5Path=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\">\n", xmlnsprefix,t_name, grpxid, get_next_xid(), @@ -4611,8 +4608,8 @@ xml_dump_group(hid_t gid, const char *name) ptrstr = malloc(100); t_objname = xml_escape_the_name(group_table->objs[i].objname); par_name = xml_escape_the_name(par); - res = xml_name_to_XID(par,parentxid,100,1); - res = xml_name_to_XID(group_table->objs[i].objname,ptrstr,100,1); + xml_name_to_XID(par,parentxid,100,1); + xml_name_to_XID(group_table->objs[i].objname,ptrstr,100,1); printf("<%sGroupPtr OBJ-XID=\"%s\" H5Path=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\" />\n", xmlnsprefix, @@ -4623,19 +4620,18 @@ xml_dump_group(hid_t gid, const char *name) } else { /* first time this group has been seen -- describe it */ - int res; char *t_name = xml_escape_the_name(name); char *grpxid = malloc(100); char *parentxid = malloc(100); if (isRoot) { - res = xml_name_to_XID("/",grpxid,100,1); + xml_name_to_XID("/",grpxid,100,1); printf("<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">\n", xmlnsprefix,grpxid,"/"); } else { char *t_tmp = xml_escape_the_name(tmp); par_name = xml_escape_the_name(par); - res = xml_name_to_XID(tmp,grpxid,100,1); - res = xml_name_to_XID(par,parentxid,100,1); + xml_name_to_XID(tmp,grpxid,100,1); + xml_name_to_XID(par,parentxid,100,1); printf("<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\" >\n", xmlnsprefix,t_name, grpxid, t_tmp, parentxid, par_name); @@ -4682,19 +4678,18 @@ xml_dump_group(hid_t gid, const char *name) } else { /* only link -- must be first time! */ - int res; char *t_name = xml_escape_the_name(name); char *grpxid = malloc(100); char *parentxid = malloc(100); if (isRoot) { - res = xml_name_to_XID("/",grpxid,100,1); + xml_name_to_XID("/",grpxid,100,1); printf("<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">\n", xmlnsprefix,grpxid,"/"); } else { char *t_tmp = xml_escape_the_name(tmp); par_name = xml_escape_the_name(par); - res = xml_name_to_XID(tmp,grpxid,100,1); - res = xml_name_to_XID(par,parentxid,100,1); + xml_name_to_XID(tmp,grpxid,100,1); + xml_name_to_XID(par,parentxid,100,1); printf("<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\" >\n", xmlnsprefix,t_name, grpxid, t_tmp, @@ -4864,7 +4859,7 @@ xml_print_strs(hid_t did, int source) char *bp; char *onestring=NULL; hsize_t ssiz; - size_t tsiz, str_size; + size_t tsiz, str_size=0; size_t i; htri_t is_vlstr; @@ -4967,6 +4962,7 @@ xml_print_strs(hid_t did, int source) * *------------------------------------------------------------------------- */ +#ifdef LATER static void check_compression(hid_t dcpl) { @@ -4997,6 +4993,8 @@ check_compression(hid_t dcpl) } } } +#endif /* LATER */ + /*------------------------------------------------------------------------- * Function: check_filters * @@ -5095,8 +5093,8 @@ check_filters(hid_t dcpl) static void xml_dump_fill_value(hid_t dcpl, hid_t type) { -int sz; -int i; +size_t sz; +size_t i; hsize_t space; void * buf; char * path; @@ -5160,6 +5158,7 @@ char * name; printf("\""); for (i = 0; i < sz; i++) { printf("%x ",*(unsigned int *)buf); + buf = (char *)buf + sizeof(unsigned int); } printf("\"\n"); indentation(indent); @@ -5230,7 +5229,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) { hid_t type, space; hid_t dcpl; - herr_t err; H5D_fill_value_t fvstatus; int maxdims; hsize_t *chsize; @@ -5238,7 +5236,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) int i; H5D_alloc_time_t at; H5D_fill_time_t ft; - int res; hsize_t tempi; char *tmp; char *t_name, *t_tmp, *t_prefix; @@ -5255,8 +5252,8 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) t_tmp = xml_escape_the_name(tmp); t_prefix = xml_escape_the_name(prefix); - res = xml_name_to_XID(tmp, rstr, 100, 1); - res = xml_name_to_XID(prefix, pstr, 100, 1); + xml_name_to_XID(tmp, rstr, 100, 1); + xml_name_to_XID(prefix, pstr, 100, 1); printf("<%sDataset Name=\"%s\" OBJ-XID=\"%s\" H5Path= \"%s\" Parents=\"%s\" H5ParentPaths=\"%s\">\n",xmlnsprefix, t_name, rstr, t_tmp, pstr, strcmp(prefix, "") ? t_prefix : "/"); @@ -5341,7 +5338,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) indent += COL; indentation(indent); printf("<%sFillValueInfo ",xmlnsprefix); - err = H5Pget_fill_time(dcpl, &ft); + H5Pget_fill_time(dcpl, &ft); printf("FillTime=\""); switch ( ft ) { case H5D_FILL_TIME_ALLOC: @@ -5358,7 +5355,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) break; } printf("\" "); - err = H5Pget_alloc_time(dcpl, &at); + H5Pget_alloc_time(dcpl, &at); printf("AllocationTime=\""); switch ( at ) { case H5D_ALLOC_TIME_EARLY: @@ -5382,7 +5379,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) indentation(indent); printf("<%sFillValue>\n",xmlnsprefix); indent += COL; - err = H5Pfill_value_defined(dcpl, &fvstatus); + H5Pfill_value_defined(dcpl, &fvstatus); if (fvstatus == H5D_FILL_VALUE_UNDEFINED) { indentation(indent + COL); printf("<%sNoFill/>\n",xmlnsprefix); diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index 20dc785..28020d5 100755 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -158,7 +158,7 @@ int main(int argc, char *argv[]) break; case 14: /* read data size */ - if (getInputSize(in, HDstrtol(argv[i], NULL, BASE_10)) == -1) + if (getInputSize(in, (int)HDstrtol(argv[i], NULL, BASE_10)) == -1) { (void) fprintf(stderr, err8, argv[i]); goto err; @@ -384,7 +384,6 @@ readIntegerData(FILE **strm, struct Input *in) default: (void) fprintf(stderr, err2); return (-1); - break; } break; @@ -418,7 +417,6 @@ readIntegerData(FILE **strm, struct Input *in) default: (void) fprintf(stderr, err2); return (-1); - break; } break; @@ -451,7 +449,6 @@ readIntegerData(FILE **strm, struct Input *in) default: (void) fprintf(stderr, err2); return (-1); - break; } break; @@ -486,7 +483,6 @@ readIntegerData(FILE **strm, struct Input *in) default: (void) fprintf(stderr, err2); return (-1); - break; } break; #endif /* ifndef WIN32 */ @@ -551,7 +547,6 @@ readUIntegerData(FILE **strm, struct Input *in) default: (void) fprintf(stderr, err2); return (-1); - break; } break; @@ -584,7 +579,6 @@ readUIntegerData(FILE **strm, struct Input *in) default: (void) fprintf(stderr, err2); return (-1); - break; } break; @@ -617,7 +611,6 @@ readUIntegerData(FILE **strm, struct Input *in) default: (void) fprintf(stderr, err2); return (-1); - break; } break; @@ -652,7 +645,6 @@ readUIntegerData(FILE **strm, struct Input *in) default: (void) fprintf(stderr, err2); return (-1); - break; } break; #endif /* ifndef WIN32 */ @@ -716,7 +708,6 @@ readFloatData(FILE **strm, struct Input *in) default: (void) fprintf(stderr, err2); return (-1); - break; } break; @@ -754,7 +745,6 @@ readFloatData(FILE **strm, struct Input *in) default: (void) fprintf(stderr, err2); return (-1); - break; } break; @@ -1796,12 +1786,10 @@ getCompressionParameter(struct Input *in, FILE** strm) } in->compressionParam = ival; return (0); - break; default: (void) fprintf(stderr, err3); return (-1); - break; } } diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index aeb4594..58fb782 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1755,7 +1755,7 @@ list (hid_t group, const char *name, void *_iter) return 0; } else if (sb.type<0 || sb.type>=H5G_NTYPES) { printf("Unknown type(%d)", sb.type); - sb.type = -1; + sb.type = H5G_UNKNOWN; } if (sb.type>=0 && dispatch_g[sb.type].name) { fputs(dispatch_g[sb.type].name, stdout); diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 1053b60..970a46b 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -43,7 +43,7 @@ /* Variable length string datatype */ #define STR_INIT_LEN 4096 /*initial length */ -static char *h5tools_escape(char *s, size_t size, int escape_spaces); +static char *h5tools_escape(char *s, size_t size); static hbool_t h5tools_is_zero(const void *_mem, size_t size); /*------------------------------------------------------------------------- @@ -751,7 +751,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container, char enum_name[1024]; if (H5Tenum_nameof(type, vp, enum_name, sizeof enum_name) >= 0) { - h5tools_str_append(str, h5tools_escape(enum_name, sizeof(enum_name), TRUE)); + h5tools_str_append(str, h5tools_escape(enum_name, sizeof(enum_name))); } else { size_t i; n = H5Tget_size(type); @@ -940,8 +940,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container, * Function: h5tools_escape * * Purpose: Changes all "funny" characters in S into standard C escape - * sequences. If ESCAPE_SPACES is non-zero then spaces are - * escaped by prepending a backslash. + * sequences. * * Return: Success: S * @@ -957,7 +956,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container, *------------------------------------------------------------------------- */ static char * -h5tools_escape(char *s/*in,out*/, size_t size, int escape_spaces) +h5tools_escape(char *s/*in,out*/, size_t size) { register size_t i; size_t n = strlen(s); -- cgit v0.12