diff options
-rw-r--r-- | fortran/src/H5Pf.c | 13 | ||||
-rw-r--r-- | src/H5FD.c | 4 | ||||
-rw-r--r-- | src/H5FDmulti.c | 48 | ||||
-rw-r--r-- | src/H5I.c | 4 | ||||
-rw-r--r-- | src/H5Ofill.c | 12 | ||||
-rw-r--r-- | src/H5private.h | 14 | ||||
-rw-r--r-- | test/dsets.c | 4 | ||||
-rw-r--r-- | test/dtypes.c | 17 | ||||
-rw-r--r-- | test/fillval.c | 9 | ||||
-rw-r--r-- | test/h5test.c | 4 | ||||
-rw-r--r-- | test/stab.c | 2 | ||||
-rw-r--r-- | testpar/t_mdset.c | 6 | ||||
-rw-r--r-- | tools/lib/h5tools_utils.h | 2 |
13 files changed, 83 insertions, 56 deletions
diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 49c518a..2ea4e5e 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -645,7 +645,11 @@ nh5pget_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk) int i; herr_t ret; int c_ik; +#ifdef H5_WANT_H5_V1_4_COMPAT int c_lk; +#else /* H5_WANT_H5_V1_4_COMPAT */ + unsigned c_lk; +#endif /* H5_WANT_H5_V1_4_COMPAT */ /* * Call H5Pget_sym_k function. @@ -1646,12 +1650,14 @@ nh5pget_external_c(hid_t_f *prp_id,int*idx, size_t_f* name_size, _fcd name, int_ * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5pset_hyper_cache_c(hid_t_f *prp_id, int_f* cache, int_f* limit) +nh5pset_hyper_cache_c(hid_t_f *prp_id, int_f * cache, int_f * limit) { int ret_value = -1; +#ifdef H5_WANT_H5_V1_4_COMPAT hid_t c_prp_id; herr_t ret; unsigned c_cache, c_limit; + c_cache = (unsigned) *cache; c_limit = (unsigned) *limit; @@ -1659,7 +1665,6 @@ nh5pset_hyper_cache_c(hid_t_f *prp_id, int_f* cache, int_f* limit) * Call H5Pset_hyper_cache function. */ c_prp_id = *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 */ @@ -1681,9 +1686,10 @@ nh5pset_hyper_cache_c(hid_t_f *prp_id, int_f* cache, int_f* limit) * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5pget_hyper_cache_c(hid_t_f *prp_id, int_f* cache, int_f* limit) +nh5pget_hyper_cache_c(hid_t_f *prp_id, int_f * cache, int_f * limit) { int ret_value = -1; +#ifdef H5_WANT_H5_V1_4_COMPAT hid_t c_prp_id; herr_t ret; unsigned c_cache, c_limit; @@ -1691,7 +1697,6 @@ nh5pget_hyper_cache_c(hid_t_f *prp_id, int_f* cache, int_f* limit) * Call H5Pget__hyper_cache function. */ c_prp_id = *prp_id; -#ifdef H5_WANT_H5_V1_4_COMPAT ret = H5Pget_hyper_cache(c_prp_id, &c_cache, &c_limit); if (ret < 0) return ret_value; *cache = (int_f)c_cache; @@ -207,7 +207,7 @@ H5FDregister(const H5FD_class_t *cls) HRETURN_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`read' and/or `write' method is not defined"); } - for (type=H5FD_MEM_DEFAULT; type<H5FD_MEM_NTYPES; type = type+1) { + for (type=H5FD_MEM_DEFAULT; type<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,type)) { if (cls->fl_map[type]<H5FD_MEM_NOLIST || cls->fl_map[type]>=H5FD_MEM_NTYPES) { HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, @@ -904,7 +904,7 @@ H5FD_close(H5FD_t *file) /* Free all free-lists, leaking any memory thus described. Also leaks * file space allocated but not used when metadata aggregation is * turned on. */ - for (i=H5FD_MEM_DEFAULT; i<H5FD_MEM_NTYPES; i=i+1) { + for (i=H5FD_MEM_DEFAULT; i<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,i)) { for (cur=file->fl[i]; cur; cur=next) { #ifdef H5F_DEBUG nblocks++; diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index ea09b90..2e7045b 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -43,7 +43,7 @@ hbool_t _seen[H5FD_MEM_NTYPES]; \ \ memset(_seen, 0, sizeof _seen); \ - for (_unmapped=H5FD_MEM_SUPER; _unmapped<H5FD_MEM_NTYPES; _unmapped=_unmapped+1) { \ + for (_unmapped=H5FD_MEM_SUPER; _unmapped<H5FD_MEM_NTYPES; _unmapped=(H5FD_mem_t)(_unmapped+1)) { \ LOOPVAR = MAP[_unmapped]; \ if (H5FD_MEM_DEFAULT==LOOPVAR) LOOPVAR=_unmapped; \ assert(LOOPVAR>0 && LOOPVAR<H5FD_MEM_NTYPES); \ @@ -59,7 +59,7 @@ #define ALL_MEMBERS(LOOPVAR) { \ H5FD_mem_t LOOPVAR; \ - for (LOOPVAR=H5FD_MEM_DEFAULT; LOOPVAR<H5FD_MEM_NTYPES; LOOPVAR=LOOPVAR+1) { + for (LOOPVAR=H5FD_MEM_DEFAULT; LOOPVAR<H5FD_MEM_NTYPES; LOOPVAR=(H5FD_mem_t)(LOOPVAR+1)) { #define END_MEMBERS }} @@ -259,7 +259,7 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, H5Eclear(); /* Initialize */ - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { memb_map[mt] = (H5FD_MEM_DRAW==mt?mt:H5FD_MEM_SUPER); memb_fapl[mt] = -1; memb_name[mt] = NULL; @@ -408,33 +408,33 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "not an access list", -1); if (!memb_map) { - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { _memb_map[mt] = H5FD_MEM_DEFAULT; } memb_map = _memb_map; } if (!memb_fapl) { - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { _memb_fapl[mt] = H5P_DEFAULT; } memb_fapl = _memb_fapl; } if (!memb_name) { assert(strlen(letters)==H5FD_MEM_NTYPES); - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { sprintf(_memb_name[mt], "%%s-%c.h5", letters[mt]); _memb_name_ptrs[mt] = _memb_name[mt]; } memb_name = _memb_name_ptrs; } if (!memb_addr) { - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { _memb_addr[mt] = (mt?mt-1:0) * HADDR_MAX/H5FD_MEM_NTYPES; } memb_addr = _memb_addr; } - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { /* Map usage type */ mmt = memb_map[mt]; if (mmt<0 || mmt>=H5FD_MEM_NTYPES) @@ -513,7 +513,7 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, memcpy(memb_map, fa->memb_map, H5FD_MEM_NTYPES*sizeof(H5FD_mem_t)); } if (memb_fapl) { - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { if (fa->memb_fapl[mt]>=0) { memb_fapl[mt] = H5Pcopy(fa->memb_fapl[mt]); } else { @@ -522,7 +522,7 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, } } if (memb_name) { - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { if (fa->memb_name[mt]) { memb_name[mt] = malloc(strlen(fa->memb_name[mt])+1); strcpy(memb_name[mt], fa->memb_name[mt]); @@ -578,7 +578,7 @@ H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl) H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1); if (!memb_dxpl) H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "invalid pointer", -1); - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { if (H5P_DEFAULT!=memb_dxpl[mt] && TRUE!=H5Pisa_class(memb_dxpl[mt], H5P_DATASET_XFER)) H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1); @@ -627,7 +627,7 @@ H5Pget_dxpl_multi(hid_t dxpl_id, hid_t *memb_dxpl/*out*/) H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1); if (memb_dxpl) { - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { if (dx->memb_dxpl[mt]>=0) { memb_dxpl[mt] = H5Pcopy(dx->memb_dxpl[mt]); } else { @@ -729,7 +729,7 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/, strcpy(name, "NCSAmulti"); assert(7==H5FD_MEM_NTYPES); - for (m=H5FD_MEM_SUPER; m<H5FD_MEM_NTYPES; m=m+1) { + for (m=H5FD_MEM_SUPER; m<H5FD_MEM_NTYPES; m=(H5FD_mem_t)(m+1)) { buf[m-1] = file->fa.memb_map[m]; } buf[7] = 0; @@ -989,7 +989,7 @@ H5FD_multi_fapl_copy(const void *_old_fa) H5Eclear(); memcpy(new_fa, old_fa, sizeof(H5FD_multi_fapl_t)); - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { if (old_fa->memb_fapl[mt]>=0) { new_fa->memb_fapl[mt] = H5Pcopy(old_fa->memb_fapl[mt]); if (new_fa->memb_fapl[mt]<0) nerrors++; @@ -1002,7 +1002,7 @@ H5FD_multi_fapl_copy(const void *_old_fa) } if (nerrors) { - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { if (new_fa->memb_fapl[mt]>=0) H5Pclose(new_fa->memb_fapl[mt]); if (new_fa->memb_name[mt]) free(new_fa->memb_name[mt]); } @@ -1038,7 +1038,7 @@ H5FD_multi_fapl_free(void *_fa) /* Clear the error stack */ H5Eclear(); - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { if (fa->memb_fapl[mt]>=0) H5Pclose(fa->memb_fapl[mt]); if (fa->memb_name[mt]) free(fa->memb_name[mt]); } @@ -1078,7 +1078,7 @@ H5FD_multi_dxpl_copy(const void *_old_dx) H5Eclear(); memcpy(new_dx, old_dx, sizeof(H5FD_multi_dxpl_t)); - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { if (old_dx->memb_dxpl[mt]>=0) { new_dx->memb_dxpl[mt] = H5Pcopy(old_dx->memb_dxpl[mt]); if (new_dx->memb_dxpl[mt]<0) nerrors++; @@ -1086,7 +1086,7 @@ H5FD_multi_dxpl_copy(const void *_old_dx) } if (nerrors) { - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) H5Pclose(new_dx->memb_dxpl[mt]); free(new_dx); H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "invalid freespace objects", NULL); @@ -1120,7 +1120,7 @@ H5FD_multi_dxpl_free(void *_dx) /* Clear the error stack */ H5Eclear(); - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) if (dx->memb_dxpl[mt]>=0) H5Pclose(dx->memb_dxpl[mt]); free(dx); @@ -1323,7 +1323,7 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2) /* Clear the error stack */ H5Eclear(); - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { if (f1->memb[mt] && f2->memb[mt]) break; if (!cmp) { if (f1->memb[mt]) cmp = -1; @@ -1431,7 +1431,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, haddr_t eoa) H5Eclear(); /* Find the subfile in which the new EOA value falls */ - for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { mmt = file->fa.memb_map[mt]; if (H5FD_MEM_DEFAULT==mmt) mmt = mt; assert(mmt>0 && mmt<H5FD_MEM_NTYPES); @@ -1621,7 +1621,7 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz } /* Find the file to which this address belongs */ - for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { mmt = file->fa.memb_map[mt]; if (H5FD_MEM_DEFAULT==mmt) mmt = mt; assert(mmt>0 && mmt<H5FD_MEM_NTYPES); @@ -1676,7 +1676,7 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si } /* Find the file to which this address belongs */ - for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { mmt = file->fa.memb_map[mt]; if (H5FD_MEM_DEFAULT==mmt) mmt = mt; assert(mmt>0 && mmt<H5FD_MEM_NTYPES); @@ -1755,7 +1755,7 @@ H5FD_multi_flush(H5FD_t *_file, unsigned closing) H5Eclear(); /* Flush each file */ - for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { if (file->memb[mt]) { H5E_BEGIN_TRY { if (H5FDflush(file->memb[mt],closing)<0) nerrors++; @@ -121,14 +121,14 @@ H5I_term_interface(void) if (interface_initialize_g) { /* How many groups are still being used? */ - for (grp=(H5I_type_t)0; grp<H5I_NGROUPS; grp=grp+1) { + for (grp=(H5I_type_t)0; grp<H5I_NGROUPS; H5_INC_ENUM(H5I_type_t,grp)) { if ((grp_ptr=H5I_id_group_list_g[grp]) && grp_ptr->id_list) n++; } /* If no groups are used then clean up */ if (0==n) { - for (grp=(H5I_type_t)0; grp<H5I_NGROUPS; grp=grp+1) { + for (grp=(H5I_type_t)0; grp<H5I_NGROUPS; H5_INC_ENUM(H5I_type_t,grp)) { grp_ptr = H5I_id_group_list_g[grp]; H5MM_xfree(grp_ptr); H5I_id_group_list_g[grp] = NULL; diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 4342f13..b50e2da 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -116,10 +116,10 @@ H5O_fill_new_decode(H5F_t UNUSED *f, const uint8_t *p, } /* Space allocation time */ - mesg->space_time = *p++; + mesg->space_time = (H5D_space_time_t)*p++; /* Fill value write time */ - mesg->fill_time = *p++; + mesg->fill_time = (H5D_fill_time_t)*p++; /* Whether fill value is defined */ mesg->fill_defined = *p++; @@ -510,9 +510,9 @@ H5O_fill_new_reset(void *_mesg) H5T_close(mesg->type); mesg->type = NULL; } - mesg->space_time = 0; - mesg->fill_time = 0; - mesg->fill_defined = 0; + mesg->space_time = (H5D_space_time_t)0; + mesg->fill_time = (H5D_fill_time_t)0; + mesg->fill_defined = (H5D_fill_value_t)0; FUNC_LEAVE(SUCCEED); } @@ -712,7 +712,7 @@ H5O_fill_convert(void *_fill, H5T_t *dset_type) } H5T_close(fill->type); fill->type = NULL; - fill->size = H5T_get_size(dset_type); + H5_ASSIGN_OVERFLOW(fill->size,H5T_get_size(dset_type),size_t,ssize_t); ret_value = SUCCEED; done: diff --git a/src/H5private.h b/src/H5private.h index 425fd32..15721db 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -411,6 +411,20 @@ #endif /* + * A macro to portably increment enumerated types. + */ +#ifndef H5_INC_ENUM +# define H5_INC_ENUM(TYPE,VAR) (VAR)=((TYPE)((VAR)+1)) +#endif + +/* + * A macro to portably decrement enumerated types. + */ +#ifndef H5_DEC_ENUM +# define H5_DEC_ENUM(TYPE,VAR) (VAR)=((TYPE)((VAR)-1)) +#endif + +/* * A macro for detecting over/under-flow when casting between types */ #ifndef NDEBUG diff --git a/test/dsets.c b/test/dsets.c index fd3d479..1343f22 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -366,13 +366,17 @@ test_compression(hid_t file) const hsize_t chunk_size[2] = {2, 25}; const hssize_t hs_offset[2] = {7, 30}; const hsize_t hs_size[2] = {4, 50}; +#if !(defined(H5_HAVE_COMPRESS2) && defined(H5_HAVE_ZLIB_H) && defined(H5_HAVE_LIBZ)) const char *not_supported; +#endif hsize_t i, j, n; void *tconv_buf = NULL; +#if !(defined(H5_HAVE_COMPRESS2) && defined(H5_HAVE_ZLIB_H) && defined(H5_HAVE_LIBZ)) not_supported = " Deflate compression is not supported.\n" " The zlib was not found when hdf5 was configured."; +#endif TESTING("compression (setup)"); diff --git a/test/dtypes.c b/test/dtypes.c index d423582..13df634 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -1112,7 +1112,6 @@ test_query(void) hid_t file=-1, tid1=-1, tid2=-1; char filename[1024]; char compnd_type[]="Compound_type", enum_type[]="Enum_type"; - int nmembs, indx; short enum_val; TESTING("query functions of compound and enumeration types"); @@ -1182,24 +1181,24 @@ test_query(void) } /* end if */ /* Query member number and member index by name, for compound type. */ - if((nmembs=H5Tget_nmembers(tid1))!=4) { + if(H5Tget_nmembers(tid1)!=4) { H5_FAILED(); printf("Can't get member number\n"); goto error; } /* end if */ - if((indx=H5Tget_member_index(tid1, "c"))!=2) { + if(H5Tget_member_index(tid1, "c")!=2) { H5_FAILED(); printf("Can't get correct index number\n"); goto error; } /* end if */ /* Query member number and member index by name, for enumeration type. */ - if((nmembs=H5Tget_nmembers(tid2))!=5) { + if(H5Tget_nmembers(tid2)!=5) { H5_FAILED(); printf("Can't get member number\n"); goto error; } /* end if */ - if((indx=H5Tget_member_index(tid2, "ORANGE"))!=3) { + if(H5Tget_member_index(tid2, "ORANGE")!=3) { H5_FAILED(); printf("Can't get correct index number\n"); goto error; @@ -1242,24 +1241,24 @@ test_query(void) } /* end if */ /* Query member number and member index by name, for compound type */ - if((nmembs=H5Tget_nmembers(tid1))!=4) { + if(H5Tget_nmembers(tid1)!=4) { H5_FAILED(); printf("Can't get member number\n"); goto error; } /* end if */ - if((indx=H5Tget_member_index(tid1, "c"))!=2) { + if(H5Tget_member_index(tid1, "c")!=2) { H5_FAILED(); printf("Can't get correct index number\n"); goto error; } /* end if */ /* Query member number and member index by name, for enumeration type */ - if((nmembs=H5Tget_nmembers(tid2))!=5) { + if(H5Tget_nmembers(tid2)!=5) { H5_FAILED(); printf("Can't get member number\n"); goto error; } /* end if */ - if((indx=H5Tget_member_index(tid2, "ORANGE"))!=3) { + if(H5Tget_member_index(tid2, "ORANGE")!=3) { H5_FAILED(); printf("Can't get correct index number\n"); goto error; diff --git a/test/fillval.c b/test/fillval.c index 100180f..97bb690 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -100,7 +100,6 @@ static hid_t create_compound_type(void) static int test_getset(void) { - herr_t status; hid_t dcpl=-1; int fill_i; hid_t type_ss=-1, type_si=-1; @@ -138,7 +137,7 @@ test_getset(void) * no fill value should result in a failure. */ H5E_BEGIN_TRY { - status = H5Pget_fill_value(dcpl, H5T_NATIVE_INT, &fill_i); + H5Pget_fill_value(dcpl, H5T_NATIVE_INT, &fill_i); } H5E_END_TRY; if (fill_i != 0) { H5_FAILED(); @@ -226,7 +225,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) { hid_t file=-1, space=-1, dcpl=-1, comp_type_id=-1; hid_t dset1=-1, dset2=-1, dset3=-1, dset4=-1, dset5=-1, - dset6=-1, dset7=-1, dset8=-1, dset9=-1; + dset6=-1, /* dset7=-1, */ dset8=-1, dset9=-1; hsize_t cur_size[5] = {32, 16, 8, 4, 2}; hsize_t ch_size[5] = {1, 1, 1, 4, 2}; short rd_s, fill_s = 0x1234; @@ -303,7 +302,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if(H5Pset_fill_value(dcpl, -1, NULL)<0) goto error; if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; H5E_BEGIN_TRY { - if((dset7 = H5Dcreate(file, "dset7", H5T_NATIVE_LONG, space, dcpl))!=FAIL) + if(H5Dcreate(file, "dset7", H5T_NATIVE_LONG, space, dcpl)!=FAIL) goto error; } H5E_END_TRY; @@ -342,7 +341,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) * Supposed to fail. */ if(H5Pset_fill_value(dcpl, -1, NULL)<0) goto error; H5E_BEGIN_TRY { - if((dset7 = H5Dcreate(file, "dset7", H5T_NATIVE_LONG, space, dcpl))!=FAIL) + if(H5Dcreate(file, "dset7", H5T_NATIVE_LONG, space, dcpl)!=FAIL) goto error; } H5E_END_TRY; diff --git a/test/h5test.c b/test/h5test.c index 05d5147..23ecb33 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -151,7 +151,7 @@ h5_cleanup(const char *base_name[], hid_t fapl) H5FD_mem_t mt; assert(strlen(multi_letters)==H5FD_MEM_NTYPES); - for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt=mt+1) { + for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]); HDremove(temp); /*don't care if it fails*/ @@ -443,7 +443,7 @@ h5_fileaccess(void) HDmemset(memb_addr, 0, sizeof memb_addr); assert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); - for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=mt+1) { + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { memb_fapl[mt] = H5P_DEFAULT; sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); memb_name[mt] = sv[mt]; diff --git a/test/stab.c b/test/stab.c index c2af94f..bd799c0 100644 --- a/test/stab.c +++ b/test/stab.c @@ -107,7 +107,7 @@ test_long(hid_t file) /* Group names */ name1 = malloc(namesize); for (i=0; i<namesize; i++) - name1[i] = 'A' + i%26; + name1[i] = (char)('A' + i%26); name1[namesize-1] = '\0'; name2 = malloc(2*namesize + 2); sprintf(name2, "%s/%s", name1, name1); diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index df12bcd..271aed0 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -68,7 +68,9 @@ void multiple_dset_write(char *filename, int ndatasets) H5Dclose (dataset); if (! ((n+1) % 10)) { +#ifdef VERBOSE printf("created %d datasets\n", n+1); +#endif /* VERBOSE */ MPI_Barrier(MPI_COMM_WORLD); } } @@ -153,7 +155,9 @@ void multiple_group_write(char *filename, int ngroups) H5Gclose(gid); if(! ((m+1) % 10)) { +#ifdef VERBOSE printf("created %d groups\n", m+1); +#endif /* VERBOSE */ MPI_Barrier(MPI_COMM_WORLD); } } @@ -218,7 +222,9 @@ void create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid, MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); if(! ((counter+1) % 10)) { +#ifdef VERBOSE printf("created %dth child groups\n", counter+1); +#endif /* VERBOSE */ MPI_Barrier(MPI_COMM_WORLD); } diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index 1ace7ad..2214de3 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -84,7 +84,7 @@ typedef struct table_t { /*this struct stores the information that is passed to the find_objs function*/ typedef struct find_objs_t { - int prefix_len; + size_t prefix_len; char *prefix; unsigned int threshold; /* should be 0 or 1 */ table_t *group_table; |