From 17535fbc174978ae71d916a02ee4dacee66a9d8c Mon Sep 17 00:00:00 2001 From: Robb Matzke Date: Thu, 25 Feb 1999 10:40:27 -0500 Subject: [svn-r1101] Changes since 19990219 ---------------------- ./config/irix64 The old (-32) compiler is now supported by setting envrionment CC='cc -32'. The -64 compiler is the default or you can set CC='cc -64'. ./src/H5A.c ./src/H5D.c ./src/H5F.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5G.c ./src/H5I.c ./src/H5Ocomp.c ./src/H5P.c ./src/H5R.c ./src/H5RA.c ./src/H5T.c ./src/H5Tbit.c ./src/H5Tconv.c ./src/H5Z.c ./src/H5detect.c ./test/big.c ./test/cmpd_dset.c ./test/dsets.c ./test/dtypes.c ./test/enum.c ./test/mtime.c ./test/ohdr.c ./tools/h5ls.c Fixed lots of warnings on Irix64. Mailed a few remaining warnings in H5S to Quincey and a few in the dumper to Ruey-Hsia. --- README | 2 +- config/irix64 | 24 ++- src/.distdep | 342 ++++++++++++++++++++-------------------- src/H5A.c | 2 +- src/H5D.c | 5 +- src/H5Distore.c | 3 +- src/H5F.c | 4 +- src/H5Fistore.c | 3 +- src/H5Flow.c | 6 +- src/H5G.c | 14 +- src/H5I.c | 2 +- src/H5Ocomp.c | 2 +- src/H5P.c | 2 +- src/H5R.c | 2 +- src/H5RA.c | 4 +- src/H5T.c | 6 +- src/H5Tbit.c | 23 +-- src/H5Tconv.c | 38 +++-- src/H5Z.c | 6 +- src/H5detect.c | 1 + test/.distdep | 467 +++++++++++++++++++++++++++++-------------------------- test/big.c | 2 +- test/cmpd_dset.c | 2 - test/dsets.c | 14 +- test/dtypes.c | 214 +++++++++++++------------ test/enum.c | 24 +-- test/mtime.c | 4 +- test/ohdr.c | 10 +- tools/h5ls.c | 7 +- 29 files changed, 650 insertions(+), 585 deletions(-) diff --git a/README b/README index 2a3d354..069b84a 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -This is hdf5-1.1.50 released on Thu Feb 25 04:18:56 CST 1999 +This is hdf5-1.1.51 released on Thu Feb 25 10:21:23 CST 1999 Please refer to the INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/config/irix64 b/config/irix64 index 1bedb5d..5512c41 100644 --- a/config/irix64 +++ b/config/irix64 @@ -8,7 +8,7 @@ # Use SGI supplied C compiler by default. There is no ranlib if test "X-" = "X-$CC"; then - CC=cc + CC='cc -64' CC_BASENAME=cc fi RANLIB=: @@ -26,18 +26,36 @@ case "X-$CC_BASENAME" in ;; *) - # Always turn off these compiler warnings: + CFLAGS="$CFLAGS -ansi" + + # Always turn off these compiler warnings for the -64 compiler: # 1174: function declared but not used # 1429: the `long long' type is not standard # 1209: constant expressions # 1196: __vfork() (this is an SGI config problem) + # 1685: turn off warnings about turning off invalid warnings + CFLAGS="$CFLAGS -woff 1174,1429,1209,1196,1685" + + # Always turn off these compiler warnings for the old compiler: + # 799: the `long long' type is not standard + # 803: turn off warnings about turning off invalid warnings + # 835: __vfork() (this is an SGI config problem) + CFLAGS="$CFLAGS -woff 799,803,835" + # Always turn off these loader warnings: + # 47: branch instructions that degrade performance on R4000 # 84: a library is not used - CFLAGS="$CFLAGS -ansi -64 -woff 1174,1429,1209,1196 -Wl,-woff,84" + CFLAGS="$CFLAGS -Wl,-woff,47,84" + + # Extra debugging flags DEBUG_CFLAGS="-g -fullwarn" DEBUG_CPPFLAGS= + + # Extra production flags PROD_CFLAGS=-O PROD_CPPFLAGS= + + # Extra profiling flags PROFILE_CFLAGS=-pg PROFILE_CPPFLAGS= ;; diff --git a/src/.distdep b/src/.distdep index 730145a..aa275bb 100644 --- a/src/.distdep +++ b/src/.distdep @@ -135,38 +135,6 @@ H5E.o: \ H5config.h \ H5api_adpt.h \ H5Iprivate.h -H5F.o: \ - H5F.c \ - H5private.h \ - H5public.h \ - H5config.h \ - H5api_adpt.h \ - H5Aprivate.h \ - H5Apublic.h \ - H5Ipublic.h \ - H5Gprivate.h \ - H5Gpublic.h \ - H5Bprivate.h \ - H5Bpublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Dpublic.h \ - H5Dprivate.h \ - H5Oprivate.h \ - H5Opublic.h \ - H5HGprivate.h \ - H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Zprivate.h \ - H5Zpublic.h \ - H5Iprivate.h \ - H5ACprivate.h \ - H5ACpublic.h \ - H5Eprivate.h \ - H5Epublic.h H5Farray.o: \ H5Farray.c \ H5private.h \ @@ -245,18 +213,6 @@ H5Fistore.o: \ H5Zpublic.h \ H5Eprivate.h \ H5Epublic.h -H5Flow.o: \ - H5Flow.c \ - H5private.h \ - H5public.h \ - H5config.h \ - H5api_adpt.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5Ipublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Dpublic.h H5Fmpio.o: \ H5Fmpio.c \ H5private.h \ @@ -320,43 +276,6 @@ H5Fstdio.o: \ H5Fprivate.h \ H5Fpublic.h \ H5Dpublic.h -H5G.o: \ - H5G.c \ - H5private.h \ - H5public.h \ - H5config.h \ - H5api_adpt.h \ - H5Aprivate.h \ - H5Apublic.h \ - H5Ipublic.h \ - H5Gprivate.h \ - H5Gpublic.h \ - H5Bprivate.h \ - H5Bpublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Dpublic.h \ - H5Dprivate.h \ - H5Oprivate.h \ - H5Opublic.h \ - H5HGprivate.h \ - H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Zprivate.h \ - H5Zpublic.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5Gpkg.h \ - H5ACprivate.h \ - H5ACpublic.h \ - H5HLprivate.h \ - H5HLpublic.h \ - H5Iprivate.h \ - H5MMprivate.h \ - H5MMpublic.h H5Gent.o: \ H5Gent.c \ H5private.h \ @@ -935,38 +854,6 @@ H5R.o: \ H5Zprivate.h \ H5Zpublic.h \ H5Eprivate.h -H5RA.o: \ - H5RA.c \ - H5RAprivate.h \ - H5RApublic.h \ - H5Ipublic.h \ - H5public.h \ - H5config.h \ - H5api_adpt.h \ - H5Dprivate.h \ - H5Dpublic.h \ - H5private.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Gprivate.h \ - H5Gpublic.h \ - H5Bprivate.h \ - H5Bpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ - H5HGprivate.h \ - H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Zprivate.h \ - H5Zpublic.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5Iprivate.h \ - H5MMprivate.h \ - H5MMpublic.h H5S.o: \ H5S.c \ H5private.h \ @@ -1021,33 +908,6 @@ H5Sall.o: \ H5Zprivate.h \ H5Zpublic.h \ H5Vprivate.h -H5Shyper.o: \ - H5Shyper.c \ - H5private.h \ - H5public.h \ - H5config.h \ - H5api_adpt.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5Ipublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Fprivate.h \ - H5Fpublic.h \ - H5Dpublic.h \ - H5Gprivate.h \ - H5Gpublic.h \ - H5Bprivate.h \ - H5Bpublic.h \ - H5Oprivate.h \ - H5Opublic.h \ - H5HGprivate.h \ - H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Zprivate.h \ - H5Zpublic.h \ - H5Vprivate.h H5Smpio.o: \ H5Smpio.c \ H5private.h \ @@ -1183,8 +1043,20 @@ H5T.o: \ H5MMpublic.h \ H5Tpkg.h \ H5Rprivate.h -H5Tbit.o: \ - H5Tbit.c \ +H5TB.o: \ + H5TB.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Iprivate.h \ + H5Ipublic.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5MMprivate.h \ + H5MMpublic.h +H5V.o: \ + H5V.c \ H5private.h \ H5public.h \ H5config.h \ @@ -1192,19 +1064,110 @@ H5Tbit.o: \ H5Eprivate.h \ H5Epublic.h \ H5Ipublic.h \ - H5Iprivate.h \ - H5Tpkg.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h +H5RA.o: \ + H5RA.c \ + H5RAprivate.h \ + H5RApublic.h \ + H5Ipublic.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Dprivate.h \ + H5Dpublic.h \ + H5private.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ H5HGprivate.h \ H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Iprivate.h \ + H5MMprivate.h \ + H5MMpublic.h +H5Shyper.o: \ + H5Shyper.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5Ipublic.h \ + H5Sprivate.h \ + H5Spublic.h \ H5Fprivate.h \ H5Fpublic.h \ H5Dpublic.h \ - H5Rprivate.h \ - H5Rpublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Vprivate.h +H5F.o: \ + H5F.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Aprivate.h \ + H5Apublic.h \ + H5Ipublic.h \ H5Gprivate.h \ - H5Gpublic.h + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Dprivate.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Iprivate.h \ + H5ACprivate.h \ + H5ACpublic.h \ + H5Eprivate.h \ + H5Epublic.h H5Tconv.o: \ H5Tconv.c \ H5Iprivate.h \ @@ -1229,42 +1192,57 @@ H5Tconv.o: \ H5Tpublic.h \ H5Gprivate.h \ H5Gpublic.h -H5Tinit.o: \ - H5Tinit.c \ +H5Flow.o: \ + H5Flow.c \ H5private.h \ H5public.h \ H5config.h \ H5api_adpt.h \ - H5Iprivate.h \ - H5Ipublic.h \ H5Eprivate.h \ H5Epublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ - H5Tpkg.h \ - H5HGprivate.h \ - H5HGpublic.h \ + H5Ipublic.h \ H5Fprivate.h \ H5Fpublic.h \ - H5Dpublic.h \ - H5Rprivate.h \ - H5Rpublic.h \ - H5Tprivate.h \ - H5Tpublic.h -H5TB.o: \ - H5TB.c \ + H5Dpublic.h +H5G.o: \ + H5G.c \ H5private.h \ H5public.h \ H5config.h \ H5api_adpt.h \ - H5Iprivate.h \ + H5Aprivate.h \ + H5Apublic.h \ H5Ipublic.h \ + H5Gprivate.h \ + H5Gpublic.h \ + H5Bprivate.h \ + H5Bpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Dprivate.h \ + H5Oprivate.h \ + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ H5Eprivate.h \ H5Epublic.h \ + H5Gpkg.h \ + H5ACprivate.h \ + H5ACpublic.h \ + H5HLprivate.h \ + H5HLpublic.h \ + H5Iprivate.h \ H5MMprivate.h \ H5MMpublic.h -H5V.o: \ - H5V.c \ +H5Tbit.o: \ + H5Tbit.c \ H5private.h \ H5public.h \ H5config.h \ @@ -1272,17 +1250,39 @@ H5V.o: \ H5Eprivate.h \ H5Epublic.h \ H5Ipublic.h \ - H5Oprivate.h \ - H5Opublic.h \ + H5Iprivate.h \ + H5Tpkg.h \ + H5HGprivate.h \ + H5HGpublic.h \ H5Fprivate.h \ H5Fpublic.h \ H5Dpublic.h \ + H5Rprivate.h \ + H5Rpublic.h \ + H5Tprivate.h \ + H5Tpublic.h \ H5Gprivate.h \ - H5Gpublic.h \ - H5Bprivate.h \ - H5Bpublic.h \ + H5Gpublic.h +H5Tinit.o: \ + H5Tinit.c \ + H5private.h \ + H5public.h \ + H5config.h \ + H5api_adpt.h \ + H5Iprivate.h \ + H5Ipublic.h \ + H5Eprivate.h \ + H5Epublic.h \ + H5MMprivate.h \ + H5MMpublic.h \ + H5Tpkg.h \ H5HGprivate.h \ H5HGpublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h \ + H5Rprivate.h \ + H5Rpublic.h \ H5Tprivate.h \ H5Tpublic.h H5Z.o: \ diff --git a/src/H5A.c b/src/H5A.c index 94c4c66..a52d773 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -990,7 +990,7 @@ H5Aget_name(hid_t attr_id, size_t buf_size, char *buf) } /* get the real attribute length */ - ret_value=HDstrlen(attr->name); + ret_value=(hssize_t)HDstrlen(attr->name); /* compute the string length which will fit into the user's buffer */ copy_len=MIN(buf_size-1,ret_value); diff --git a/src/H5D.c b/src/H5D.c index f3ef9d1..a303af5 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -2324,7 +2324,7 @@ H5D_init_storage(H5D_t *dset, const H5S_t *space) { intn ndims; hsize_t dim[H5O_LAYOUT_NDIMS]; - hssize_t npoints, ptsperbuf; + hssize_t npoints, ptsperbuf; size_t size, bufsize=8*1024; hid_t buf_id = -1; haddr_t addr; @@ -2350,7 +2350,8 @@ H5D_init_storage(H5D_t *dset, const H5S_t *space) * this quite efficiently by making sure we copy the fill value * in relatively large pieces. */ - ptsperbuf = MAX(1, bufsize/dset->create_parms->fill.size); + ptsperbuf = (hssize_t)MAX(1, + bufsize/dset->create_parms->fill.size); bufsize = ptsperbuf * dset->create_parms->fill.size; if ((buf_id=H5TB_get_buf(bufsize, TRUE, &buf))<0) { HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, diff --git a/src/H5Distore.c b/src/H5Distore.c index 7f3fb7f..a4d415c 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -1181,7 +1181,8 @@ H5F_istore_lock (H5F_t *f, const H5O_layout_t *layout, assert(split_ratios); if (rdcc->nslots>0) { - idx = layout->addr.offset; + /* We don't care about loss of precision in the following statement. */ + idx = (uintn)(layout->addr.offset); H5F_MIXUP(idx); for (i=0; indims; i++) { idx += offset[i]; diff --git a/src/H5F.c b/src/H5F.c index 5cc5cf8..b2f351d 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -251,7 +251,7 @@ H5F_term_interface(intn status) static intn H5F_flush_all_cb(H5F_t *f, const void *_invalidate) { - hbool_t invalidate = (hbool_t)_invalidate; + hbool_t invalidate = *((const hbool_t*)_invalidate); H5F_flush(f, H5F_SCOPE_LOCAL, invalidate); return 0; } @@ -279,7 +279,7 @@ H5F_flush_all(hbool_t invalidate) { FUNC_ENTER(H5F_flush_all, FAIL); H5I_search(H5I_FILE, (H5I_search_func_t)H5F_flush_all_cb, - (void*)invalidate); + (void*)&invalidate); FUNC_LEAVE(SUCCEED); } diff --git a/src/H5Fistore.c b/src/H5Fistore.c index 7f3fb7f..a4d415c 100644 --- a/src/H5Fistore.c +++ b/src/H5Fistore.c @@ -1181,7 +1181,8 @@ H5F_istore_lock (H5F_t *f, const H5O_layout_t *layout, assert(split_ratios); if (rdcc->nslots>0) { - idx = layout->addr.offset; + /* We don't care about loss of precision in the following statement. */ + idx = (uintn)(layout->addr.offset); H5F_MIXUP(idx); for (i=0; indims; i++) { idx += offset[i]; diff --git a/src/H5Flow.c b/src/H5Flow.c index cb518e6..2ec0897e 100644 --- a/src/H5Flow.c +++ b/src/H5Flow.c @@ -1033,8 +1033,10 @@ H5F_addr_pack(H5F_t __unused__ *f, haddr_t *addr, const unsigned long objno[2]) assert(objno); assert(addr); - addr->offset=objno[0]; - addr->offset|=((uint64_t)objno[1])<<(8*sizeof(long)); + addr->offset = objno[0]; +#if SIZEOF_LONGoffset |= ((uint64_t)objno[1]) << (8*sizeof(long)); +#endif return(SUCCEED); } diff --git a/src/H5G.c b/src/H5G.c index fd7659e..b75f20f 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -873,14 +873,13 @@ H5G_component(const char *name, size_t *size_p) static const char * H5G_basename(const char *name, size_t *size_p) { - size_t i, end; + size_t i; FUNC_ENTER(H5G_basename, NULL); /* Find the end of the base name */ i = strlen(name); while (i>0 && '/'==name[i-1]) --i; - end = i; /* Skip backward over base name */ while (i>0 && '/'!=name[i-1]) --i; @@ -1770,6 +1769,7 @@ H5G_loc (hid_t loc_id) case H5I_NGROUPS: case H5I_BADID: case H5I_FILE_CLOSING: + case H5I_REFERENCE: HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid object ID"); } @@ -2005,10 +2005,12 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link, } else { /* Some other type of object */ statbuf->objno[0] = (unsigned long)(obj_ent.header.offset); - if (sizeof(obj_ent.header.offset)>sizeof(long)) { - statbuf->objno[1] = (unsigned long)(obj_ent.header.offset >> - 8*sizeof(long)); - } +#if SIZEOF_UINT64_T>SIZEOF_LONG + statbuf->objno[1] = (unsigned long)(obj_ent.header.offset >> + 8*sizeof(long)); +#else + statbuf->objno[1] = 0; +#endif statbuf->nlink = H5O_link (&obj_ent, 0); statbuf->type = H5G_LINK; if (NULL==H5O_read(&obj_ent, H5O_MTIME, 0, &(statbuf->mtime))) { diff --git a/src/H5I.c b/src/H5I.c index 54e516f..a9bf18f 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -170,7 +170,7 @@ H5I_term_interface(intn status) H5I_type_t grp; if (interface_initialize_g>0) { - for (grp=0; grpnfilters; + *p++ = (uint8_t)(pline->nfilters); *p++ = 0; /*reserved 1*/ *p++ = 0; /*reserved 2*/ *p++ = 0; /*reserved 3*/ diff --git a/src/H5P.c b/src/H5P.c index e1734b2..230e81a 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -2316,7 +2316,7 @@ H5Pget_nfilters(hid_t plist_id) "not a dataset creation property list"); } - FUNC_LEAVE(plist->pline.nfilters); + FUNC_LEAVE((int)(plist->pline.nfilters)); } diff --git a/src/H5R.c b/src/H5R.c index e6b09fc..261aae1 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -483,7 +483,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static H5S_t * -H5R_get_region(H5D_t *dset, H5R_type_t ref_type, void *_ref) +H5R_get_region(H5D_t *dset, H5R_type_t __unused__ ref_type, void *_ref) { H5D_t *dataset; /* Pointer to dataset to open */ H5G_entry_t ent; /* Symbol table entry */ diff --git a/src/H5RA.c b/src/H5RA.c index 1c5a9f4..76455b5 100644 --- a/src/H5RA.c +++ b/src/H5RA.c @@ -543,14 +543,12 @@ H5RA_open(H5G_entry_t *loc, const char *name) herr_t H5RAclose(hid_t array_id) { - H5RA_t *ra=NULL; - FUNC_ENTER(H5RAclose, FAIL); H5TRACE1("e","i",array_id); /* Check args */ if (H5I_RAGGED!=H5I_get_type(array_id) || - NULL==(ra=H5I_object(array_id))) { + NULL==H5I_object(array_id)) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a ragged array"); } diff --git a/src/H5T.c b/src/H5T.c index 61b6521..746afa6 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -6221,7 +6221,7 @@ H5T_entof (H5T_t *dt) *------------------------------------------------------------------------- */ static herr_t -H5T_print_stats(H5T_path_t __unused__ *path, intn *nprint/*in,out*/) +H5T_print_stats(H5T_path_t __unused__ *path, intn __unused__ *nprint/*in,out*/) { #ifdef H5T_DEBUG hsize_t nbytes; @@ -6449,8 +6449,8 @@ H5T_debug(H5T_t *dt, FILE *stream) for (i=0; iu.enumer.nmembs; i++) { fprintf(stream, "\n\"%s\" = 0x", dt->u.enumer.name[i]); for (k=0; ku.enumer.value+i*base_size+k)); + fprintf(stream, "%02lx", + (unsigned long)(dt->u.enumer.value+i*base_size+k)); } } fprintf(stream, "\n"); diff --git a/src/H5Tbit.c b/src/H5Tbit.c index ed074ab..f675794 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -314,6 +314,7 @@ H5T_bit_find (uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, { ssize_t base=(ssize_t)offset; ssize_t idx, i; + size_t iu; /* Some functions call this with value=TRUE */ assert (TRUE==1); @@ -322,14 +323,14 @@ H5T_bit_find (uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, switch (direction) { case H5T_BIT_LSB: /* Calculate index */ - idx = offset / 8; + idx = (ssize_t)(offset / 8); offset %= 8; /* Beginning */ if (offset) { - for (i=offset; i<8 && size>0; i++, size--) { - if (value==(hbool_t)((buf[idx]>>i) & 0x01)) { - return 8*idx+i - base; + for (iu=offset; iu<8 && size>0; iu++, size--) { + if (value==(hbool_t)((buf[idx]>>iu) & 0x01)) { + return 8*idx+(ssize_t)iu - base; } } offset = 0; @@ -357,14 +358,14 @@ H5T_bit_find (uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, case H5T_BIT_MSB: /* Calculate index */ - idx = (offset+size-1) / 8; + idx = (ssize_t)((offset+size-1) / 8); offset %= 8; /* Beginning */ if (size>8-offset && (offset+size)%8) { - for (i=(offset+size)%8-1; i>=0; --i, --size) { - if (value==(hbool_t)((buf[idx]>>i) & 0x01)) { - return 8*idx+i - base; + for (iu=(offset+size)%8; iu>0; --iu, --size) { + if (value==(hbool_t)((buf[idx]>>(iu-1)) & 0x01)) { + return 8*idx+(ssize_t)(iu-1) - base; } } --idx; @@ -383,9 +384,9 @@ H5T_bit_find (uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, } /* End */ if (size>0) { - for (i=offset+size-1; i>=(ssize_t)offset; --i) { - if (value==(hbool_t)((buf[idx]>>i) & 0x01)) { - return 8*idx+i - base; + for (iu=offset+size; iu>offset; --iu) { + if (value==(hbool_t)((buf[idx]>>(iu-1)) & 0x01)) { + return 8*idx+(ssize_t)(iu-1) - base; } } } diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 8816894..462bc25 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -126,7 +126,7 @@ static intn interface_initialize_g = 0; #define H5T_CONV_sS(S_ALIGN,D_ALIGN,ST,DT) { \ assert(sizeof(ST)<=sizeof(DT)); \ CI_BEGIN(S_ALIGN, D_ALIGN, ST, DT, nelmts-1, --) { \ - *d = *s; \ + *d = (DT)(*s); \ } CI_END; \ } @@ -139,7 +139,7 @@ static intn interface_initialize_g = 0; *d = 0; \ } \ } else { \ - *d = *s; \ + *d = (DT)(*s); \ } \ } CI_END; \ } @@ -153,7 +153,7 @@ static intn interface_initialize_g = 0; *d = (D_MAX); \ } \ } else { \ - *d = *s; \ + *d = (DT)(*s); \ } \ } CI_END; \ } @@ -161,7 +161,7 @@ static intn interface_initialize_g = 0; #define H5T_CONV_uU(STYPE,DTYPE,ST,DT) { \ assert(sizeof(ST)<=sizeof(DT)); \ CI_BEGIN(STYPE, DTYPE, ST, DT, nelmts-1, --) { \ - *d = *s; \ + *d = (DT)(*s); \ } CI_END; \ } @@ -179,7 +179,7 @@ static intn interface_initialize_g = 0; *d = (D_MIN); \ } \ } else { \ - *d = *s; \ + *d = (DT)(*s); \ } \ } CI_END; \ } @@ -199,7 +199,7 @@ static intn interface_initialize_g = 0; *d = (D_MAX); \ } \ } else { \ - *d = *s; \ + *d = (DT)(*s); \ } \ } CI_END; \ } @@ -213,7 +213,7 @@ static intn interface_initialize_g = 0; *d = (D_MAX); \ } \ } else { \ - *d = *s; \ + *d = (DT)(*s); \ } \ } CI_END; \ } @@ -227,7 +227,7 @@ static intn interface_initialize_g = 0; *d = (D_MAX); \ } \ } else { \ - *d = *s; \ + *d = (DT)(*s); \ } \ } CI_END; \ } @@ -241,7 +241,7 @@ static intn interface_initialize_g = 0; *d = 0; \ } \ } else { \ - *d = *s; \ + *d = (DT)(*s); \ } \ } CI_END; \ } @@ -255,7 +255,7 @@ static intn interface_initialize_g = 0; *d = (D_MAX); \ } \ } else { \ - *d = *s; \ + *d = (DT)(*s); \ } \ } CI_END; \ } @@ -1100,12 +1100,12 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Direction of conversion. */ if (dst->size <= src->size) { - src_delta = src->size; - dst_delta = dst->size; + src_delta = (int)src->size; /*overflow shouldn't be possible*/ + dst_delta = (int)dst->size; /*overflow shouldn't be possible*/ s = d = buf; } else { - src_delta = -(src->size); - dst_delta = -(dst->size); + src_delta = -(int)src->size; /*overflow shouldn't be possible*/ + dst_delta = -(int)dst->size; /*overflow shouldn't be possible*/ s = buf + (nelmts-1) * src->size; d = buf + (nelmts-1) * dst->size; } @@ -2013,14 +2013,18 @@ H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = 1; olap = 0; } else if (src->size>=dst->size) { + double olapd = HDceil((double)(dst->size)/ + (double)(src->size-dst->size)); + olap = (size_t)olapd; sp = dp = (uint8_t*)buf; direction = 1; - olap = HDceil((double)(dst->size)/(double)(src->size-dst->size)); } else { + double olapd = HDceil((double)(src->size)/ + (double)(dst->size-src->size)); + olap = (size_t)olapd; sp = (uint8_t*)buf + (nelmts-1) * src->size; dp = (uint8_t*)buf + (nelmts-1) * dst->size; direction = -1; - olap = HDceil((double)(src->size)/(double)(dst->size-src->size)); } /* Allocate the overlap buffer */ @@ -2034,7 +2038,7 @@ H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* * If the source and destination buffers overlap then use a - * temporary buffer fot eh destination. + * temporary buffer for the destination. */ if (direction>0) { s = sp; diff --git a/src/H5Z.c b/src/H5Z.c index c9c6d13..bb22f47 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -501,22 +501,22 @@ H5Z_filter_deflate (uintn flags, size_t cd_nelmts, const uintn cd_values[], size_t nbytes, size_t *buf_size, void **buf) { size_t ret_value = 0; - int aggression = 6; void *outbuf = NULL; #if defined(HAVE_COMPRESS2) + int aggression = 6; int status; #endif FUNC_ENTER (H5Z_filter_deflate, 0); - /* Get aggression level */ + /* Check arguments */ if (cd_nelmts!=1 || cd_values[0]>9) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid deflate aggression level"); } - aggression = cd_values[0]; #if defined(HAVE_COMPRESS2) + aggression = cd_values[0]; if (flags & H5Z_FLAG_REVERSE) { /* Input; uncompress */ z_stream z_strm; diff --git a/src/H5detect.c b/src/H5detect.c index 92fe3ae..3346b91 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -249,6 +249,7 @@ precision (detected_t *d) pid_t _child; \ int _status; \ \ + srand((unsigned int)_val); /*suppress "set but unused" warning*/ \ for (_ano=0; _ano=0); - if ((status = H5Pset_buffer (xfer, 1000, tconv_buf, NULL))<0) goto error; + if (H5Pset_buffer (xfer, 1000, tconv_buf, NULL)<0) goto error; /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_SIMPLE_IO_NAME, H5T_NATIVE_INT, space, @@ -722,16 +721,19 @@ int main(void) { hid_t file, grp, fapl; - int nerrors=0, mdc_nelmts; + int nerrors=0; char filename[1024]; h5_reset(); fapl = h5_fileaccess(); #if 0 - /* Turn off raw data cache */ - if (H5Pget_cache(fapl, &mdc_nelmts, NULL, NULL, NULL)<0) goto error; - if (H5Pset_cache(fapl, mdc_nelmts, 0, 0, 0.0)<0) goto error; + { + /* Turn off raw data cache */ + int mdc_nelmts; + if (H5Pget_cache(fapl, &mdc_nelmts, NULL, NULL, NULL)<0) goto error; + if (H5Pset_cache(fapl, mdc_nelmts, 0, 0, 0.0)<0) goto error; + } #endif h5_fixname(FILENAME[0], fapl, filename, sizeof filename); diff --git a/test/dtypes.c b/test/dtypes.c index 22ebe2a..588815e 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -66,7 +66,9 @@ typedef enum int_t { } int_t; /* Count the number of overflows */ +#ifdef SHOW_OVERFLOWS static int noverflows_g = 0; +#endif /* Skip overflow tests if non-zero */ static int skip_overflow_tests_g = 0; @@ -1393,7 +1395,9 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) dst_size = H5Tget_size(dst); buf = aligned_malloc(nelmts*MAX(src_size, dst_size)); saved = aligned_malloc(nelmts*MAX(src_size, dst_size)); +#ifdef SHOW_OVERFLOWS noverflows_g = 0; +#endif /* The tests */ for (i=0; i60.0) { FAILED(); tm = localtime(&(sb1.mtime)); - strftime(buf1, sizeof buf1, "%Y-%m-%d %H:%M:%S", tm); + strftime((char*)buf1, sizeof buf1, "%Y-%m-%d %H:%M:%S", tm); tm = localtime(&now); - strftime(buf2, sizeof buf2, "%Y-%m-%d %H:%M:%S", tm); + strftime((char*)buf2, sizeof buf2, "%Y-%m-%d %H:%M:%S", tm); printf(" got: %s\n ans: %s\n", buf1, buf2); return 1; } diff --git a/test/ohdr.c b/test/ohdr.c index ec6c3b1..32b97bb 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -44,7 +44,7 @@ main(void) H5F_t *f=NULL; char filename[1024]; H5G_entry_t oh_ent; - H5O_stab_t stab, ro, *ptr=NULL; + H5O_stab_t stab, ro; int i; /* Reset library */ @@ -83,7 +83,7 @@ main(void) H5Eprint(stdout); goto error; } - if (NULL==(ptr=H5O_read(&oh_ent, H5O_STAB, 0, &ro))) { + if (NULL==H5O_read(&oh_ent, H5O_STAB, 0, &ro)) { FAILED(); H5Eprint(stdout); goto error; @@ -115,7 +115,7 @@ main(void) H5Eprint(stdout); goto error; } - if (NULL==(ptr=H5O_read(&oh_ent, H5O_STAB, 0, &ro))) { + if (NULL==H5O_read(&oh_ent, H5O_STAB, 0, &ro)) { FAILED(); H5Eprint(stdout); goto error; @@ -148,7 +148,7 @@ main(void) H5Eprint(stdout); goto error; } - if (NULL==(ptr=H5O_read(&oh_ent, H5O_STAB, 1, &ro))) { + if (NULL==H5O_read(&oh_ent, H5O_STAB, 1, &ro)) { FAILED(); H5Eprint(stdout); goto error; @@ -180,7 +180,7 @@ main(void) H5Eprint(stdout); goto error; } - if (NULL==(ptr=H5O_read(&oh_ent, H5O_STAB, 1, &ro))) { + if (NULL==H5O_read(&oh_ent, H5O_STAB, 1, &ro)) { FAILED(); H5Eprint(stdout); goto error; diff --git a/tools/h5ls.c b/tools/h5ls.c index b6268bf..64775fe 100644 --- a/tools/h5ls.c +++ b/tools/h5ls.c @@ -594,7 +594,6 @@ display_float_type(hid_t type, int indent) indent, "", (unsigned long)esize, 1==esize?"":"s", (unsigned long)epos, (unsigned long)ebias); printf("\n%*s(sign bit at %lu)", indent, "", (unsigned long)spos); - return TRUE; /* Display internal padding */ if (1+esize+msize