diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-04-18 04:10:09 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-04-18 04:10:09 (GMT) |
commit | 0a29514b9dd967deb64b53b39e12d6b55177b76c (patch) | |
tree | a0a2fce3c7a13fcdf1deed6c022a47bfb5a2cbf1 /tools/h5repack | |
parent | 432f394cbbc6f77861501f91dc2fc5c209f3811f (diff) | |
download | hdf5-0a29514b9dd967deb64b53b39e12d6b55177b76c.zip hdf5-0a29514b9dd967deb64b53b39e12d6b55177b76c.tar.gz hdf5-0a29514b9dd967deb64b53b39e12d6b55177b76c.tar.bz2 |
[svn-r8383] 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
Diffstat (limited to 'tools/h5repack')
-rw-r--r-- | tools/h5repack/h5repack.h | 2 | ||||
-rw-r--r-- | tools/h5repack/h5repack_copy.c | 36 | ||||
-rw-r--r-- | tools/h5repack/h5repack_filters.c | 7 | ||||
-rw-r--r-- | tools/h5repack/h5repack_main.c | 2 | ||||
-rw-r--r-- | tools/h5repack/h5repack_opttable.c | 6 | ||||
-rw-r--r-- | tools/h5repack/h5repack_refs.c | 28 | ||||
-rw-r--r-- | tools/h5repack/h5repack_verify.c | 18 | ||||
-rw-r--r-- | tools/h5repack/testh5repack_dset.c | 22 | ||||
-rw-r--r-- | tools/h5repack/testh5repack_make.c | 25 |
9 files changed, 67 insertions, 79 deletions
diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h index 8e7e195..b91d516 100644 --- a/tools/h5repack/h5repack.h +++ b/tools/h5repack/h5repack.h @@ -99,7 +99,7 @@ typedef struct { chunk_info_t chunk_g; /*global chunk INFO for the ALL case */ H5D_layout_t layout_g; /*global layout information for the ALL case */ int verbose; /*verbose mode */ - int threshold; /*minimum size to compress, in bytes */ + hsize_t threshold; /*minimum size to compress, in bytes */ } pack_opt_t; diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index c74f5a4..7763bd2 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -141,23 +141,25 @@ int do_copy_objects(hid_t fidin, trav_table_t *travt, pack_opt_t *options) /* repack options */ { - hid_t grp_in; /* group ID */ - hid_t grp_out; /* group ID */ - hid_t dset_in; /* read dataset ID */ - hid_t dset_out; /* write dataset ID */ - hid_t type_in; /* named type ID */ - hid_t type_out; /* named type ID */ - hid_t dcpl_id; /* dataset creation property list ID */ - hid_t space_id; /* space ID */ - hid_t ftype_id; /* file data type ID */ - hid_t mtype_id; /* memory data type ID */ + hid_t grp_in=-1; /* group ID */ + hid_t grp_out=-1; /* group ID */ + hid_t dset_in=-1; /* read dataset ID */ + hid_t dset_out=-1; /* write dataset ID */ + hid_t type_in=-1; /* named type ID */ + hid_t type_out=-1; /* named type ID */ + hid_t dcpl_id=-1; /* dataset creation property list ID */ + hid_t space_id=-1; /* space ID */ + hid_t ftype_id=-1; /* file data type ID */ + hid_t mtype_id=-1; /* memory data type ID */ size_t msize; /* memory size of memory type */ void *buf=NULL; /* data buffer */ hsize_t nelmts; /* number of elements in dataset */ int rank; /* rank of dataset */ hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ hsize_t dsize_in; /* input dataset size before filter */ +#ifdef LATER hsize_t dsize_out; /* output dataset size after filter */ +#endif /* LATER */ int i, j; /*------------------------------------------------------------------------- @@ -308,12 +310,14 @@ int do_copy_objects(hid_t fidin, if (copy_attr(dset_in,dset_out,options)<0) goto error; +#ifdef LATER /*------------------------------------------------------------------------- * store the storage sizes *------------------------------------------------------------------------- */ dsize_out=H5Dget_storage_size(dset_out); +#endif /* LATER */ /*close */ if (H5Dclose(dset_out)<0) @@ -482,13 +486,13 @@ int copy_attr(hid_t loc_in, pack_opt_t *options ) { - hid_t attr_id; /* attr ID */ - hid_t attr_out; /* attr ID */ - hid_t space_id; /* space ID */ - hid_t ftype_id; /* file data type ID */ - hid_t mtype_id; /* memory data type ID */ + hid_t attr_id=-1; /* attr ID */ + hid_t attr_out=-1; /* attr ID */ + hid_t space_id=-1; /* space ID */ + hid_t ftype_id=-1; /* file data type ID */ + hid_t mtype_id=-1; /* memory data type ID */ size_t msize; /* memory size of type */ - void *buf; /* data buffer */ + void *buf=NULL; /* data buffer */ hsize_t nelmts; /* number of elements in dataset */ int rank; /* rank of dataset */ hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c index 9aacdd3..c8b9b5d 100644 --- a/tools/h5repack/h5repack_filters.c +++ b/tools/h5repack/h5repack_filters.c @@ -143,7 +143,7 @@ int apply_filters(const char* name, /* object name from traverse list */ { if (options->verbose) printf("Warning: Filter not applied to <%s>. Dataset smaller than <%d> bytes\n", - name,options->threshold); + name,(int)options->threshold); return 0; } @@ -346,7 +346,7 @@ int check_szip(hid_t type_id, /* dataset datatype */ unsigned *szip_pixels_per_block /*IN,OUT*/, pack_opt_t *options) { - size_t size; /* size of datatype in bytes */ + size_t size=0; /* size of datatype in bytes */ szip_comp_t szip; int i; unsigned ppb=*szip_pixels_per_block; @@ -360,7 +360,6 @@ int check_szip(hid_t type_id, /* dataset datatype */ { default: return 0; - break; case H5T_INTEGER: case H5T_FLOAT: break; @@ -437,7 +436,7 @@ int check_szip(hid_t type_id, /* dataset datatype */ szip.bits_per_pixel = 64; break; default: - printf("Warning: Invalid numeric type of size <%d> for SZIP\n",size); + printf("Warning: Invalid numeric type of size <%u> for SZIP\n",(unsigned)size); return 0; }} diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 8056fcc..cc3f6ea 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -61,7 +61,7 @@ int main(int argc, char **argv) else if (strcmp(argv[i], "-m") == 0) { options.threshold = parse_number(argv[i+1]); - if (options.threshold==-1) { + if ((int)options.threshold==-1) { printf("Error: Invalid treshold size <%s>\n",argv[i+1]); exit(1); } diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c index fa7fd11..45dfac5 100644 --- a/tools/h5repack/h5repack_opttable.c +++ b/tools/h5repack/h5repack_opttable.c @@ -41,7 +41,7 @@ void init_packobject(pack_info_t *obj) } obj->chunk.rank = -1; obj->refobj_id = -1; - obj->layout = -1; + obj->layout = H5D_LAYOUT_ERROR; obj->nfilters = 0; @@ -104,7 +104,7 @@ static int aux_inctable(pack_opttbl_t *table, int n_objs ) } table->objs[i].chunk.rank = -1; table->objs[i].refobj_id = -1; - table->objs[i].layout = -1; + table->objs[i].layout = H5D_LAYOUT_ERROR; table->objs[i].nfilters = 0; } return 0; @@ -148,7 +148,7 @@ int options_table_init( pack_opttbl_t **tbl ) } table->objs[i].chunk.rank = -1; table->objs[i].refobj_id = -1; - table->objs[i].layout = -1; + table->objs[i].layout = H5D_LAYOUT_ERROR; table->objs[i].nfilters = 0; } diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index 5955a08..e824493 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -52,15 +52,15 @@ int do_copy_refobjs(hid_t fidin, trav_table_t *travt, pack_opt_t *options) /* repack options */ { - hid_t grp_in; /* group ID */ - hid_t grp_out; /* group ID */ - hid_t dset_in; /* read dataset ID */ - hid_t dset_out; /* write dataset ID */ - hid_t type_in; /* named type ID */ - hid_t dcpl_id; /* dataset creation property list ID */ - hid_t space_id; /* space ID */ - hid_t ftype_id; /* file data type ID */ - hid_t mtype_id; /* memory data type ID */ + hid_t grp_in=-1; /* group ID */ + hid_t grp_out=-1; /* group ID */ + hid_t dset_in=-1; /* read dataset ID */ + hid_t dset_out=-1; /* write dataset ID */ + hid_t type_in=-1; /* named type ID */ + hid_t dcpl_id=-1; /* dataset creation property list ID */ + hid_t space_id=-1; /* space ID */ + hid_t ftype_id=-1; /* file data type ID */ + hid_t mtype_id=-1; /* memory data type ID */ size_t msize; /* memory size of memory type */ hsize_t nelmts; /* number of elements in dataset */ int rank; /* rank of dataset */ @@ -458,11 +458,11 @@ static int copy_refs_attr(hid_t loc_in, hid_t fidout /* for saving references */ ) { - hid_t attr_id; /* attr ID */ - hid_t attr_out; /* attr ID */ - hid_t space_id; /* space ID */ - hid_t ftype_id; /* file data type ID */ - hid_t mtype_id; /* memory data type ID */ + hid_t attr_id=-1; /* attr ID */ + hid_t attr_out=-1; /* attr ID */ + hid_t space_id=-1; /* space ID */ + hid_t ftype_id=-1; /* file data type ID */ + hid_t mtype_id=-1; /* memory data type ID */ size_t msize; /* memory size of type */ hsize_t nelmts; /* number of elements in dataset */ int rank; /* rank of dataset */ diff --git a/tools/h5repack/h5repack_verify.c b/tools/h5repack/h5repack_verify.c index e1c01eb..4f69d5f 100644 --- a/tools/h5repack/h5repack_verify.c +++ b/tools/h5repack/h5repack_verify.c @@ -157,9 +157,9 @@ int h5repack_verify(const char *fname, pack_opt_t *options) { hid_t fid; /* file ID */ - hid_t dset_id; /* dataset ID */ - hid_t dcpl_id; /* dataset creation property list ID */ - hid_t space_id; /* space ID */ + hid_t dset_id=-1; /* dataset ID */ + hid_t dcpl_id=-1; /* dataset creation property list ID */ + hid_t space_id=-1; /* space ID */ int ret=1, i, j; trav_table_t *travt=NULL; @@ -343,12 +343,12 @@ error: int h5repack_cmpdcpl(const char *fname1, const char *fname2) { - hid_t fid1; /* file ID */ - hid_t fid2; /* file ID */ - hid_t dset1; /* dataset ID */ - hid_t dset2; /* dataset ID */ - hid_t dcpl1; /* dataset creation property list ID */ - hid_t dcpl2; /* dataset creation property list ID */ + hid_t fid1=-1; /* file ID */ + hid_t fid2=-1; /* file ID */ + hid_t dset1=-1; /* dataset ID */ + hid_t dset2=-1; /* dataset ID */ + hid_t dcpl1=-1; /* dataset creation property list ID */ + hid_t dcpl2=-1; /* dataset creation property list ID */ trav_table_t *travt1=NULL; trav_table_t *travt2=NULL; int ret=1, i; diff --git a/tools/h5repack/testh5repack_dset.c b/tools/h5repack/testh5repack_dset.c index 74ca97e..57a5b27 100644 --- a/tools/h5repack/testh5repack_dset.c +++ b/tools/h5repack/testh5repack_dset.c @@ -17,7 +17,9 @@ #include "h5repack.h" static void make_dset_reg_ref(hid_t loc_id); +#ifdef LATER static void read_dset_reg_ref(hid_t loc_id); +#endif /* LATER */ @@ -80,7 +82,6 @@ void write_dset_in(hid_t loc_id, char buf22[3][2]= {{1,2},{3,4},{5,6}}; /* bitfield, opaque */ s_t buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; /* compound */ hobj_ref_t buf42[3][2]; /* reference */ - e_t buf452[3][2]; /* enum */ hvl_t buf52[3][2]; /* vlen */ int buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; /* array */ int buf72[3][2]= {{1,2},{3,4},{5,6}}; /* integer */ @@ -94,7 +95,6 @@ void write_dset_in(hid_t loc_id, char buf23[4][3][2]; /* bitfield, opaque */ s_t buf33[4][3][2]; /* compound */ hobj_ref_t buf43[4][3][2]; /* reference */ - e_t buf453[4][3][2]; /* enum */ hvl_t buf53[4][3][2]; /* vlen */ int buf63[24][3]; /* array */ int buf73[4][3][2]; /* integer */ @@ -360,13 +360,6 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - for (i=0; i<3; i++) - for (j=0; j<2; j++) - { - if (make_diffs) buf452[i][j]=GREEN; else buf452[i][j]=RED; - } - - type_id = H5Tcreate(H5T_ENUM, sizeof(e_t)); H5Tenum_insert(type_id, "RED", (val = 0, &val)); H5Tenum_insert(type_id, "GREEN", (val = 1, &val)); @@ -546,15 +539,6 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - - for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) { - if (make_diffs) buf453[i][j][k]=RED; else buf453[i][j][k]=GREEN; - } - } - } - type_id = H5Tcreate(H5T_ENUM, sizeof(e_t)); H5Tenum_insert(type_id, "RED", (val = 0, &val)); H5Tenum_insert(type_id, "GREEN", (val = 1, &val)); @@ -741,6 +725,7 @@ static void make_dset_reg_ref(hid_t loc_id) *------------------------------------------------------------------------- */ +#ifdef LATER static void read_dset_reg_ref(hid_t loc_id) { hid_t dset1; /* Dataset ID */ @@ -838,3 +823,4 @@ static void read_dset_reg_ref(hid_t loc_id) free(rbuf); free(drbuf); } +#endif /* LATER */ diff --git a/tools/h5repack/testh5repack_make.c b/tools/h5repack/testh5repack_make.c index 3b8cb5c..c69abd9 100644 --- a/tools/h5repack/testh5repack_make.c +++ b/tools/h5repack/testh5repack_make.c @@ -20,7 +20,7 @@ int make_all_objects(hid_t loc_id); int make_attributes(hid_t loc_id); int make_special_objects(hid_t loc_id); -int make_early(); +int make_early(void); @@ -245,7 +245,6 @@ int make_special_objects(hid_t loc_id) hid_t dset_id; hid_t space_id; hid_t plist_id; - herr_t status; int fillvalue=2; /*------------------------------------------------------------------------- @@ -290,13 +289,13 @@ int make_special_objects(hid_t loc_id) */ plist_id = H5Pcreate(H5P_DATASET_CREATE); - status = H5Pset_fill_value(plist_id, H5T_NATIVE_INT, &fillvalue); + H5Pset_fill_value(plist_id, H5T_NATIVE_INT, &fillvalue); space_id = H5Screate_simple(2,dims,NULL); dset_id = H5Dcreate(loc_id,"dset_fill",H5T_NATIVE_INT,space_id,plist_id); - status = H5Dwrite(dset_id,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf); - status = H5Pclose(plist_id); - status = H5Dclose(dset_id); - status = H5Sclose(space_id); + H5Dwrite(dset_id,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf); + H5Pclose(plist_id); + H5Dclose(dset_id); + H5Sclose(space_id); return 0; @@ -310,15 +309,15 @@ int make_special_objects(hid_t loc_id) * *------------------------------------------------------------------------- */ -int make_early() +int make_early(void) { hsize_t dims[1] ={3000}; hsize_t cdims[1]={30}; - hid_t fid; - hid_t dset_id; - hid_t sid; - hid_t tid; - hid_t dcpl; + hid_t fid=-1; + hid_t dset_id=-1; + hid_t sid=-1; + hid_t tid=-1; + hid_t dcpl=-1; int i; char name[10]; int iter=100; |