diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2004-04-23 21:25:33 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2004-04-23 21:25:33 (GMT) |
commit | af184d7e8c4a865ecb74b24796f73e896890ebc2 (patch) | |
tree | b6c4e38823285717df61e2b5829cc4b40a63d56b | |
parent | 507ab9cafb1ceb89ae52e1e53253c7efa50c0387 (diff) | |
download | hdf5-af184d7e8c4a865ecb74b24796f73e896890ebc2.zip hdf5-af184d7e8c4a865ecb74b24796f73e896890ebc2.tar.gz hdf5-af184d7e8c4a865ecb74b24796f73e896890ebc2.tar.bz2 |
[svn-r8414] Purpose:
bug fix
Description:
added compability for the 1.4 version
Solution:
Platforms tested:
free BSD
linux
Misc. update:
-rw-r--r-- | tools/h5repack/h5repack.h | 5 | ||||
-rw-r--r-- | tools/h5repack/h5repack_copy.c | 38 | ||||
-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 | 80 | ||||
-rw-r--r-- | tools/h5repack/h5repack_verify.c | 18 | ||||
-rw-r--r-- | tools/h5repack/testh5repack_dset.c | 22 | ||||
-rw-r--r-- | tools/h5repack/testh5repack_main.c | 6 | ||||
-rw-r--r-- | tools/h5repack/testh5repack_make.c | 25 | ||||
-rw-r--r-- | tools/lib/h5diff.c | 2 | ||||
-rw-r--r-- | tools/lib/h5diff.h | 2 | ||||
-rw-r--r-- | tools/lib/h5diff_array.c | 8 | ||||
-rw-r--r-- | tools/lib/h5trav.c | 6 | ||||
-rw-r--r-- | tools/lib/h5trav.h | 23 | ||||
-rw-r--r-- | tools/lib/h5trav_table.c | 4 |
16 files changed, 120 insertions, 134 deletions
diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h index 4e88f1e..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; @@ -159,8 +159,7 @@ int copy_attr(hid_t loc_in, int do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, - pack_opt_t *options, - const char *fnamein); /* repack options */ + pack_opt_t *options); /* repack options */ diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index cc774d0..7763bd2 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -87,7 +87,7 @@ int copy_objects(const char* fnamein, * and create hard links *------------------------------------------------------------------------- */ - if(do_copy_refobjs(fidin,fidout,travt,options,fnamein)<0) { + if(do_copy_refobjs(fidin,fidout,travt,options)<0) { printf("h5repack: <%s>: Could not copy data to: %s\n", fnamein, fnameout); goto out; } @@ -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 1035a06..4d57b44 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -20,19 +20,16 @@ #include "h5repack.h" static const char* MapIdToName(hid_t refobj_id, - trav_table_t *travt, - const char* fname); + trav_table_t *travt); -static void close_obj(H5G_obj_t obj_type, hid_t obj_id); +static void close_obj(H5G_obj_t1 obj_type, hid_t obj_id); static int copy_refs_attr(hid_t loc_in, hid_t loc_out, pack_opt_t *options, trav_table_t *travt, - hid_t fidout, /* for saving references */ - hid_t fidin, - const char *fname + hid_t fidout /* for saving references */ ); /*------------------------------------------------------------------------- @@ -53,18 +50,17 @@ static int copy_refs_attr(hid_t loc_in, int do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, - pack_opt_t *options, /* repack options */ - const char *fnamein) + 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 */ @@ -153,7 +149,7 @@ int do_copy_refobjs(hid_t fidin, */ if (H5Tequal(mtype_id, H5T_STD_REF_OBJ)) { - H5G_obj_t obj_type; + H5G_obj_t1 obj_type; hid_t refobj_id; hobj_ref_t *refbuf=NULL; /* buffer for object references */ hobj_ref_t *buf=NULL; @@ -190,7 +186,7 @@ int do_copy_refobjs(hid_t fidin, } H5E_END_TRY; /* get the name. a valid name could only occur in the second traversal of the file */ - if ((refname=MapIdToName(refobj_id,travt,fnamein))!=NULL) + if ((refname=MapIdToName(refobj_id,travt))!=NULL) { /* create the reference, -1 parameter for objects */ if (H5Rcreate(&refbuf[u],fidout,refname,H5R_OBJECT,-1)<0) @@ -228,7 +224,7 @@ int do_copy_refobjs(hid_t fidin, */ else if (H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) { - H5G_obj_t obj_type; + H5G_obj_t1 obj_type; hid_t refobj_id; hdset_reg_ref_t *refbuf=NULL; /* input buffer for region references */ hdset_reg_ref_t *buf=NULL; /* output buffer */ @@ -270,7 +266,7 @@ int do_copy_refobjs(hid_t fidin, /* get the name. a valid name could only occur in the second traversal of the file */ - if ((refname=MapIdToName(refobj_id,travt,fnamein))!=NULL) + if ((refname=MapIdToName(refobj_id,travt))!=NULL) { hid_t region_id; /* region id of the referenced dataset */ if ((region_id = H5Rget_region(dset_in,H5R_DATASET_REGION,&buf[u]))<0) @@ -323,7 +319,7 @@ int do_copy_refobjs(hid_t fidin, * copy referenced objects in attributes *------------------------------------------------------------------------- */ - if (copy_refs_attr(dset_in,dset_out,options,travt,fidout,fidin,fnamein)<0) + if (copy_refs_attr(dset_in,dset_out,options,travt,fidout)<0) goto error; @@ -410,7 +406,7 @@ int do_copy_refobjs(hid_t fidin, if ((grp_in = H5Gopen(fidin,"/"))<0) goto error; - if (copy_refs_attr(grp_in,grp_out,options,travt,fidout,fidin,fnamein)<0) + if (copy_refs_attr(grp_in,grp_out,options,travt,fidout)<0) goto error; if (H5Gclose(grp_out)<0) @@ -459,16 +455,14 @@ static int copy_refs_attr(hid_t loc_in, hid_t loc_out, pack_opt_t *options, trav_table_t *travt, - hid_t fidout, /* for saving references */ - hid_t fidin, - const char *fnamein + 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 */ @@ -527,7 +521,7 @@ static int copy_refs_attr(hid_t loc_in, */ if (H5Tequal(mtype_id, H5T_STD_REF_OBJ)) { - H5G_obj_t obj_type; + H5G_obj_t1 obj_type; hid_t refobj_id; hobj_ref_t *refbuf=NULL; unsigned k; @@ -564,7 +558,7 @@ static int copy_refs_attr(hid_t loc_in, } H5E_END_TRY; /* get the name. a valid name could only occur in the second traversal of the file */ - if ((refname=MapIdToName(refobj_id,travt,fnamein))!=NULL) + if ((refname=MapIdToName(refobj_id,travt))!=NULL) { /* create the reference */ if (H5Rcreate(&refbuf[k],fidout,refname,H5R_OBJECT,-1)<0) @@ -604,7 +598,7 @@ static int copy_refs_attr(hid_t loc_in, */ else if (H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) { - H5G_obj_t obj_type; + H5G_obj_t1 obj_type; hid_t refobj_id; hdset_reg_ref_t *refbuf=NULL; /* input buffer for region references */ hdset_reg_ref_t *buf=NULL; /* output buffer */ @@ -646,7 +640,7 @@ static int copy_refs_attr(hid_t loc_in, } H5E_END_TRY; /* get the name. a valid name could only occur in the second traversal of the file */ - if ((refname=MapIdToName(refobj_id,travt,fnamein))!=NULL) + if ((refname=MapIdToName(refobj_id,travt))!=NULL) { hid_t region_id; /* region id of the referenced dataset */ if ((region_id = H5Rget_region(attr_id,H5R_DATASET_REGION,&buf[k]))<0) @@ -714,7 +708,7 @@ error: *------------------------------------------------------------------------- */ -static void close_obj(H5G_obj_t obj_type, hid_t obj_id) +static void close_obj(H5G_obj_t1 obj_type, hid_t obj_id) { H5E_BEGIN_TRY { @@ -744,17 +738,16 @@ static void close_obj(H5G_obj_t obj_type, hid_t obj_id) */ static const char* MapIdToName(hid_t refobj_id, - trav_table_t *travt, - const char* fname) + trav_table_t *travt) { hid_t id; hid_t fid; int i; - /* open */ - if ((fid=H5Fopen(fname,H5F_ACC_RDONLY,H5P_DEFAULT))<0 ){ - printf("h5repack: <%s>: %s\n", fname, H5FOPENERROR ); - exit(1); + /* obtains the file ID given an object ID. This ID must be closed */ + if ((fid = H5Iget_file_id(refobj_id))<0) + { + return NULL; } /* linear search */ @@ -785,7 +778,8 @@ static const char* MapIdToName(hid_t refobj_id, } /* switch */ } /* i */ - H5Fclose(fid); + if (H5Fclose(fid)<0) + return NULL; return NULL; } 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_main.c b/tools/h5repack/testh5repack_main.c index 1959ea2..ddecd98 100644 --- a/tools/h5repack/testh5repack_main.c +++ b/tools/h5repack/testh5repack_main.c @@ -38,7 +38,6 @@ int main (void) { - int verbose=0; pack_opt_t pack_options; diff_opt_t diff_options; memset(&diff_options, 0, sizeof (diff_opt_t)); @@ -59,14 +58,14 @@ int main (void) * it returns RET==0 if the objects have the same data *------------------------------------------------------------------------- */ - + TESTING(" copy of datasets"); /*------------------------------------------------------------------------- * file with all kinds of dataset datatypes *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, verbose)<0) + if (h5repack_init (&pack_options, 0)<0) TEST_ERROR; if (h5repack(FNAME1,FNAME1OUT,&pack_options)<0) TEST_ERROR; @@ -125,7 +124,6 @@ int main (void) *------------------------------------------------------------------------- */ PASSED(); - TESTING(" copy of datasets with all filters"); if (h5repack_init (&pack_options, 0)<0) 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; diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 9ac321b..a84a9b5 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -369,7 +369,7 @@ int diff( hid_t file1_id, hid_t file2_id, const char *path2, diff_opt_t *options, - H5G_obj_t type ) + H5G_obj_t1 type ) { hid_t type1_id=-1; hid_t type2_id=-1; diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 0c52f76..09a96fd 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -108,7 +108,7 @@ int diff( hid_t file1_id, hid_t file2_id, const char *path2, diff_opt_t *options, - H5G_obj_t type ); + H5G_obj_t1 type ); int diff_compare( hid_t file1_id, const char *file1_name, diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 838cc3d..25ebf83 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -53,7 +53,7 @@ static int diff_char(unsigned char *mem1, int *ph); static hbool_t is_zero(const void *_mem, size_t size); -static void close_obj(H5G_obj_t obj_type, hid_t obj_id); +static void close_obj(H5G_obj_t1 obj_type, hid_t obj_id); static int diff_region(hid_t region1_id, hid_t region2_id); @@ -228,8 +228,8 @@ int diff_datum( void *_mem1, size_t size; int iszero1; int iszero2; - H5G_obj_t obj1_type; - H5G_obj_t obj2_type; + H5G_obj_t1 obj1_type; + H5G_obj_t1 obj2_type; hid_t obj1_id; hid_t obj2_id; H5G_stat_t sb1; @@ -1673,7 +1673,7 @@ is_zero(const void *_mem, size_t size) */ static -void close_obj(H5G_obj_t obj_type, hid_t obj_id) +void close_obj(H5G_obj_t1 obj_type, hid_t obj_id) { switch (obj_type) { diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 9c1db43..08c75e6 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -32,7 +32,7 @@ herr_t get_name_type( hid_t loc_id, const char *group_name, int idx, char **name, - H5G_obj_t *type ); + H5G_obj_t1 *type ); /*------------------------------------------------------------------------- * Function: h5trav_getinfo @@ -277,7 +277,7 @@ herr_t get_name_type( hid_t loc_id, const char *group_name, int idx, char **name, - H5G_obj_t *type ) + H5G_obj_t1 *type ) { trav_info_t info; @@ -313,7 +313,7 @@ int traverse( hid_t loc_id, { char *name=NULL; - H5G_obj_t type; + H5G_obj_t1 type; int n_names; char *path=NULL; H5G_stat_t statbuf; diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h index af41a4e..4493b0b 100644 --- a/tools/lib/h5trav.h +++ b/tools/lib/h5trav.h @@ -27,15 +27,22 @@ * the TYPE can be: * H5G_UNKNOWN = -1, * H5G_LINK, Object is a symbolic link - * H5G_GROUP, Object is a group - * H5G_DATASET, Object is a dataset - * H5G_TYPE, Object is a named data type + * H5G_GROUP, Object is a group + * H5G_DATASET, Object is a dataset + * H5G_TYPE, Object is a named data type *------------------------------------------------------------------------- */ +/* hack to alow v1.4 compability */ +#ifdef H5_WANT_H5_V1_4_COMPAT + typedef int H5G_obj_t1; +#else + typedef H5G_obj_t H5G_obj_t1; +#endif + typedef struct trav_info_t { - char *name; - H5G_obj_t type; + char *name; + H5G_obj_t1 type; } trav_info_t; @@ -58,7 +65,7 @@ typedef struct trav_obj_t { unsigned flags[2]; /* h5diff.object is present or not in both files*/ char *name; /* name */ int displayed; /* hard link already traversed once */ - H5G_obj_t type; /* type of object */ + H5G_obj_t1 type; /* type of object */ trav_link_t *links; /* array of possible link names */ int sizelinks; /* size of links array */ int nlinks; /* number of links */ @@ -122,12 +129,12 @@ int trav_table_search(unsigned long *objno, void trav_table_add(unsigned long *objno, char *objname, - H5G_obj_t type, + H5G_obj_t1 type, trav_table_t *table); void trav_table_addflags(unsigned *flags, char *objname, - H5G_obj_t type, + H5G_obj_t1 type, trav_table_t *table); diff --git a/tools/lib/h5trav_table.c b/tools/lib/h5trav_table.c index 940fc0e..7527975 100644 --- a/tools/lib/h5trav_table.c +++ b/tools/lib/h5trav_table.c @@ -58,7 +58,7 @@ int trav_table_search(unsigned long *objno, trav_table_t *table ) void trav_table_add(unsigned long *objno, char *name, - H5G_obj_t type, + H5G_obj_t1 type, trav_table_t *table) { int i; @@ -108,7 +108,7 @@ void trav_table_add(unsigned long *objno, void trav_table_addflags(unsigned *flags, char *name, - H5G_obj_t type, + H5G_obj_t1 type, trav_table_t *table) { int i; |