diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/.distdep | 243 | ||||
-rw-r--r-- | src/H5.c | 56 | ||||
-rw-r--r-- | src/H5F.c | 4 | ||||
-rw-r--r-- | src/H5Flow.c | 5 | ||||
-rw-r--r-- | src/H5Fmpio.c | 3 | ||||
-rw-r--r-- | src/H5Fsec2.c | 3 | ||||
-rw-r--r-- | src/H5Fstdio.c | 3 | ||||
-rw-r--r-- | src/H5Gnode.c | 20 | ||||
-rw-r--r-- | src/H5Ofill.c | 11 | ||||
-rw-r--r-- | src/H5P.c | 2 | ||||
-rw-r--r-- | src/H5Rpublic.h | 12 | ||||
-rw-r--r-- | src/H5Tconv.c | 2 | ||||
-rw-r--r-- | src/H5V.c | 20 | ||||
-rw-r--r-- | src/H5Vprivate.h | 5 | ||||
-rw-r--r-- | src/H5config.h.in | 18 | ||||
-rw-r--r-- | src/H5detect.c | 66 | ||||
-rw-r--r-- | src/H5private.h | 190 | ||||
-rw-r--r-- | src/H5public.h | 32 |
18 files changed, 361 insertions, 334 deletions
diff --git a/src/.distdep b/src/.distdep index fbc62fa..24cf35b 100644 --- a/src/.distdep +++ b/src/.distdep @@ -25,7 +25,10 @@ H5.o: \ H5Gprivate.h \ H5Gpublic.h \ H5Oprivate.h \ - H5Opublic.h + H5Opublic.h \ + H5HGprivate.h \ + H5HGpublic.h \ + H5Tprivate.h H5A.o: \ H5A.c \ H5private.h \ @@ -56,9 +59,7 @@ H5A.o: \ H5MMprivate.h \ H5MMpublic.h \ H5Pprivate.h \ - H5Ppublic.h \ - H5Apkg.h \ - H5Aprivate.h + H5Ppublic.h H5AC.o: \ H5AC.c \ H5private.h \ @@ -69,9 +70,7 @@ H5AC.o: \ H5Fprivate.h \ H5Fpublic.h \ H5Ipublic.h \ - H5Dpublic.h \ - H5Eprivate.h \ - H5Epublic.h + H5Dpublic.h H5B.o: \ H5B.c \ H5private.h \ @@ -87,9 +86,7 @@ H5B.o: \ H5Bpublic.h \ H5Eprivate.h \ H5Epublic.h \ - H5MFprivate.h \ - H5MFpublic.h \ - H5MMprivate.h + H5MFprivate.h H5D.o: \ H5D.c \ H5private.h \ @@ -125,17 +122,13 @@ H5D.o: \ H5MFpublic.h \ H5MMprivate.h \ H5MMpublic.h \ - H5Pprivate.h \ - H5Ppublic.h \ - H5TBprivate.h + H5Pprivate.h H5E.o: \ H5E.c \ H5private.h \ H5public.h \ H5config.h \ - H5Iprivate.h \ - H5Ipublic.h \ - H5Eprivate.h + H5Iprivate.h H5F.o: \ H5F.c \ H5private.h \ @@ -166,11 +159,7 @@ H5F.o: \ H5ACprivate.h \ H5ACpublic.h \ H5Eprivate.h \ - H5Epublic.h \ - H5MMprivate.h \ - H5MMpublic.h \ - H5Pprivate.h \ - H5Ppublic.h + H5Epublic.h H5Farray.o: \ H5Farray.c \ H5private.h \ @@ -196,9 +185,7 @@ H5Farray.o: \ H5Zprivate.h \ H5Zpublic.h \ H5Eprivate.h \ - H5Epublic.h \ - H5MFprivate.h \ - H5MFpublic.h + H5Epublic.h H5Fcore.o: \ H5Fcore.c \ H5private.h \ @@ -206,7 +193,10 @@ H5Fcore.o: \ H5config.h \ H5Eprivate.h \ H5Epublic.h \ - H5Ipublic.h + H5Ipublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h H5Ffamily.o: \ H5Ffamily.c \ H5private.h \ @@ -214,7 +204,10 @@ H5Ffamily.o: \ H5config.h \ H5Eprivate.h \ H5Epublic.h \ - H5Ipublic.h + H5Ipublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h H5Fistore.o: \ H5Fistore.c \ H5private.h \ @@ -240,9 +233,7 @@ H5Fistore.o: \ H5Zprivate.h \ H5Zpublic.h \ H5Eprivate.h \ - H5Epublic.h \ - H5MFprivate.h \ - H5MFpublic.h + H5Epublic.h H5Flow.o: \ H5Flow.c \ H5private.h \ @@ -253,9 +244,7 @@ H5Flow.o: \ H5Ipublic.h \ H5Fprivate.h \ H5Fpublic.h \ - H5Dpublic.h \ - H5MMprivate.h \ - H5MMpublic.h + H5Dpublic.h H5Fmpio.o: \ H5Fmpio.c \ H5private.h \ @@ -281,9 +270,7 @@ H5Fmpio.o: \ H5Sprivate.h \ H5Spublic.h \ H5Zprivate.h \ - H5Zpublic.h \ - H5MMprivate.h \ - H5MMpublic.h + H5Zpublic.h H5Fsec2.o: \ H5Fsec2.c \ H5private.h \ @@ -294,9 +281,7 @@ H5Fsec2.o: \ H5Ipublic.h \ H5Fprivate.h \ H5Fpublic.h \ - H5Dpublic.h \ - H5MMprivate.h \ - H5MMpublic.h + H5Dpublic.h H5Fsplit.o: \ H5Fsplit.c \ H5private.h \ @@ -307,9 +292,7 @@ H5Fsplit.o: \ H5Ipublic.h \ H5Fprivate.h \ H5Fpublic.h \ - H5Dpublic.h \ - H5MFprivate.h \ - H5MFpublic.h + H5Dpublic.h H5Fstdio.o: \ H5Fstdio.c \ H5private.h \ @@ -320,9 +303,7 @@ H5Fstdio.o: \ H5Ipublic.h \ H5Fprivate.h \ H5Fpublic.h \ - H5Dpublic.h \ - H5MMprivate.h \ - H5MMpublic.h + H5Dpublic.h H5G.o: \ H5G.c \ H5private.h \ @@ -355,7 +336,10 @@ H5G.o: \ H5ACprivate.h \ H5ACpublic.h \ H5HLprivate.h \ - H5HLpublic.h + H5HLpublic.h \ + H5Iprivate.h \ + H5MMprivate.h \ + H5MMpublic.h H5Gent.o: \ H5Gent.c \ H5private.h \ @@ -373,7 +357,10 @@ H5Gent.o: \ H5Gprivate.h \ H5Gpublic.h \ H5Bprivate.h \ - H5Bpublic.h + H5Bpublic.h \ + H5HLprivate.h \ + H5HLpublic.h \ + H5MMprivate.h H5Gnode.o: \ H5Gnode.c \ H5private.h \ @@ -404,9 +391,7 @@ H5Gnode.o: \ H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Zprivate.h + H5Sprivate.h H5Gstab.o: \ H5Gstab.c \ H5private.h \ @@ -435,7 +420,9 @@ H5Gstab.o: \ H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h \ - H5Sprivate.h + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h H5HG.o: \ H5HG.c \ H5private.h \ @@ -451,9 +438,7 @@ H5HG.o: \ H5Epublic.h \ H5HGprivate.h \ H5HGpublic.h \ - H5MFprivate.h \ - H5MFpublic.h \ - H5MMprivate.h + H5MFprivate.h H5HL.o: \ H5HL.c \ H5private.h \ @@ -469,17 +454,13 @@ H5HL.o: \ H5Epublic.h \ H5HLprivate.h \ H5HLpublic.h \ - H5MFprivate.h \ - H5MFpublic.h \ - H5MMprivate.h + H5MFprivate.h H5I.o: \ H5I.c \ H5private.h \ H5public.h \ H5config.h \ - H5Iprivate.h \ - H5Ipublic.h \ - H5Eprivate.h + H5Iprivate.h H5MF.o: \ H5MF.c \ H5private.h \ @@ -487,15 +468,16 @@ H5MF.o: \ H5config.h \ H5Eprivate.h \ H5Epublic.h \ - H5Ipublic.h + H5Ipublic.h \ + H5Fprivate.h \ + H5Fpublic.h \ + H5Dpublic.h H5MM.o: \ H5MM.c \ H5private.h \ H5public.h \ H5config.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5Ipublic.h + H5Eprivate.h H5O.o: \ H5O.c \ H5private.h \ @@ -521,9 +503,7 @@ H5O.o: \ H5Bpublic.h \ H5HGprivate.h \ H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h + H5Tprivate.h H5Oattr.o: \ H5Oattr.c \ H5private.h \ @@ -549,9 +529,7 @@ H5Oattr.o: \ H5Tpublic.h \ H5Sprivate.h \ H5Spublic.h \ - H5Zprivate.h \ - H5Zpublic.h \ - H5Apkg.h + H5Zprivate.h H5Ocomp.o: \ H5Ocomp.c \ H5private.h \ @@ -574,7 +552,10 @@ H5Ocomp.o: \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h H5Ocont.o: \ H5Ocont.c \ H5private.h \ @@ -597,7 +578,10 @@ H5Ocont.o: \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h H5Odtype.o: \ H5Odtype.c \ H5private.h \ @@ -623,9 +607,7 @@ H5Odtype.o: \ H5Tpublic.h \ H5Sprivate.h \ H5Spublic.h \ - H5Zprivate.h \ - H5Zpublic.h \ - H5Tpkg.h + H5Zprivate.h H5Oefl.o: \ H5Oefl.c \ H5private.h \ @@ -651,9 +633,7 @@ H5Oefl.o: \ H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h \ - H5Zprivate.h + H5Sprivate.h H5Ofill.o: \ H5Ofill.c \ H5private.h \ @@ -676,7 +656,10 @@ H5Ofill.o: \ H5Bpublic.h \ H5HGprivate.h \ H5HGpublic.h \ - H5Tprivate.h + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h H5Olayout.o: \ H5Olayout.c \ H5private.h \ @@ -699,7 +682,10 @@ H5Olayout.o: \ H5Tpublic.h \ H5Sprivate.h \ H5Spublic.h \ - H5Zprivate.h + H5Zprivate.h \ + H5Zpublic.h \ + H5Eprivate.h \ + H5Epublic.h H5Omtime.o: \ H5Omtime.c \ H5private.h \ @@ -722,7 +708,10 @@ H5Omtime.o: \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h H5Oname.o: \ H5Oname.c \ H5private.h \ @@ -745,7 +734,10 @@ H5Oname.o: \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h H5Onull.o: \ H5Onull.c \ H5private.h \ @@ -763,7 +755,10 @@ H5Onull.o: \ H5Bpublic.h \ H5HGprivate.h \ H5HGpublic.h \ - H5Tprivate.h + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h H5Osdspace.o: \ H5Osdspace.c \ H5private.h \ @@ -786,7 +781,10 @@ H5Osdspace.o: \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h H5Oshared.o: \ H5Oshared.c \ H5private.h \ @@ -809,7 +807,10 @@ H5Oshared.o: \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h H5Ostab.o: \ H5Ostab.c \ H5private.h \ @@ -832,7 +833,10 @@ H5Ostab.o: \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h \ + H5Zprivate.h H5P.o: \ H5P.c \ H5private.h \ @@ -858,9 +862,7 @@ H5P.o: \ H5Spublic.h \ H5Zprivate.h \ H5Zpublic.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5MMprivate.h + H5Eprivate.h H5R.o: \ H5R.c \ H5private.h \ @@ -886,9 +888,7 @@ H5R.o: \ H5Spublic.h \ H5Zprivate.h \ H5Zpublic.h \ - H5Eprivate.h \ - H5Epublic.h \ - H5Rprivate.h + H5Eprivate.h H5RA.o: \ H5RA.c \ H5RAprivate.h \ @@ -916,7 +916,10 @@ H5RA.o: \ H5Zprivate.h \ H5Zpublic.h \ H5Eprivate.h \ - H5Epublic.h + H5Epublic.h \ + H5Iprivate.h \ + H5MMprivate.h \ + H5MMpublic.h H5S.o: \ H5S.c \ H5private.h \ @@ -939,7 +942,10 @@ H5S.o: \ H5Bpublic.h \ H5HGprivate.h \ H5HGpublic.h \ - H5Tprivate.h + H5Tprivate.h \ + H5Tpublic.h \ + H5Sprivate.h \ + H5Spublic.h H5Sall.o: \ H5Sall.c \ H5private.h \ @@ -962,7 +968,10 @@ H5Sall.o: \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h + H5Tpublic.h \ + H5Zprivate.h \ + H5Zpublic.h \ + H5Vprivate.h H5Shyper.o: \ H5Shyper.c \ H5private.h \ @@ -988,9 +997,7 @@ H5Shyper.o: \ H5Tpublic.h \ H5Zprivate.h \ H5Zpublic.h \ - H5Vprivate.h \ - H5MMprivate.h \ - H5MMpublic.h + H5Vprivate.h H5Smpio.o: \ H5Smpio.c \ H5private.h \ @@ -1011,9 +1018,7 @@ H5Smpio.o: \ H5Oprivate.h \ H5Opublic.h \ H5HGprivate.h \ - H5HGpublic.h \ - H5Tprivate.h \ - H5Tpublic.h + H5HGpublic.h H5Spoint.o: \ H5Spoint.c \ H5private.h \ @@ -1039,9 +1044,7 @@ H5Spoint.o: \ H5HGpublic.h \ H5Tprivate.h \ H5Tpublic.h \ - H5Zprivate.h \ - H5Zpublic.h \ - H5Vprivate.h + H5Zprivate.h H5Sselect.o: \ H5Sselect.c \ H5private.h \ @@ -1067,9 +1070,7 @@ H5Sselect.o: \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h \ - H5Zprivate.h \ - H5Zpublic.h + H5Tpublic.h H5T.o: \ H5T.c \ H5private.h \ @@ -1097,7 +1098,10 @@ H5T.o: \ H5Iprivate.h \ H5Eprivate.h \ H5Epublic.h \ - H5MMprivate.h + H5MMprivate.h \ + H5MMpublic.h \ + H5Tpkg.h \ + H5Rprivate.h H5Tbit.o: \ H5Tbit.c \ H5private.h \ @@ -1115,7 +1119,10 @@ H5Tbit.o: \ H5Dpublic.h \ H5Rprivate.h \ H5Rpublic.h \ - H5Tprivate.h + H5Tprivate.h \ + H5Tpublic.h \ + H5Gprivate.h \ + H5Gpublic.h H5Tconv.o: \ H5Tconv.c \ H5Iprivate.h \ @@ -1138,9 +1145,7 @@ H5Tconv.o: \ H5Tprivate.h \ H5Tpublic.h \ H5Gprivate.h \ - H5Gpublic.h \ - H5Bprivate.h \ - H5Bpublic.h + H5Gpublic.h H5Tinit.o: \ H5Tinit.c \ H5private.h \ @@ -1161,9 +1166,7 @@ H5Tinit.o: \ H5Rprivate.h \ H5Rpublic.h \ H5Tprivate.h \ - H5Tpublic.h \ - H5Gprivate.h \ - H5Gpublic.h + H5Tpublic.h H5TB.o: \ H5TB.c \ H5private.h \ @@ -1171,7 +1174,10 @@ H5TB.o: \ H5config.h \ H5Iprivate.h \ H5Ipublic.h \ - H5Eprivate.h + H5Eprivate.h \ + H5Epublic.h \ + H5MMprivate.h \ + H5MMpublic.h H5V.o: \ H5V.c \ H5private.h \ @@ -1192,9 +1198,7 @@ H5V.o: \ H5HGprivate.h \ H5HGpublic.h \ H5Tprivate.h \ - H5Tpublic.h \ - H5Sprivate.h \ - H5Spublic.h + H5Tpublic.h H5Z.o: \ H5Z.c \ H5private.h \ @@ -1220,5 +1224,4 @@ H5Z.o: \ H5Tpublic.h \ H5Sprivate.h \ H5Spublic.h \ - H5Zprivate.h \ - H5Zpublic.h + H5Zprivate.h @@ -35,18 +35,6 @@ static char RcsId[] = "@(#)$Revision$"; H5_init_interface -- initialize the H5 interface + */ -#include <ctype.h> -#include <errno.h> -#include <stdarg.h> -#include <stdio.h> -#if defined(WIN32) -#include <time.h> -#else -#include <sys/time.h> -#include <sys/resource.h> -#endif -/* We need this on Irix64 even though we've included stdio.h as documented */ -FILE *fdopen(int fd, const char *mode); /* private headers */ #include <H5private.h> /*library */ @@ -61,6 +49,9 @@ FILE *fdopen(int fd, const char *mode); #include <H5Tprivate.h> /*data types */ #include <H5Zprivate.h> /*filters */ +/* We need this on Irix64 even though we've included stdio.h as documented */ +FILE *fdopen(int fd, const char *mode); + #define PABLO_MASK H5_mask hbool_t library_initialize_g = FALSE; @@ -653,27 +644,21 @@ HDfprintf (FILE *stream, const char *fmt, ...) if (HDstrchr ("ZHhlq", *s)) { switch (*s) { case 'H': - if (sizeof(hsize_t)==sizeof(long)) { + if (sizeof(hsize_t)<sizeof(long)) { + modifier[0] = '\0'; + } else if (sizeof(hsize_t)==sizeof(long)) { HDstrcpy (modifier, "l"); -#if defined(WIN32) - } else if (sizeof(hsize_t)==sizeof(__int64)) { -#else - } else if (sizeof(hsize_t)==sizeof(long long)) { -#endif + } else { HDstrcpy (modifier, PRINTF_LL_WIDTH); } break; case 'Z': - if (sizeof(size_t)==sizeof(long)) { + if (sizeof(size_t)<sizeof(long)) { + modifier[0] = '\0'; + } else if (sizeof(size_t)==sizeof(long)) { HDstrcpy (modifier, "l"); -#if defined(WIN32) - } else if (sizeof(size_t)==sizeof(__int64)) { -#else - } else if (sizeof(size_t)==sizeof(long long)) { -#endif + } else { HDstrcpy (modifier, PRINTF_LL_WIDTH); - } else if (sizeof(size_t)==sizeof(int)) { - modifier[0] = '\0'; } break; @@ -718,11 +703,7 @@ HDfprintf (FILE *stream, const char *fmt, ...) long x = va_arg (ap, long); n = fprintf (stream, template, x); } else { -#if defined(WIN32) - __int64 x = va_arg(ap, __int64); -#else - long long x = va_arg (ap, long long); -#endif + int64 x = va_arg(ap, int64); n = fprintf (stream, template, x); } break; @@ -741,12 +722,8 @@ HDfprintf (FILE *stream, const char *fmt, ...) unsigned long x = va_arg (ap, unsigned long); n = fprintf (stream, template, x); } else { -#if defined(WIN32) - unsigned __int64 x = va_arg (ap, unsigned __int64); -#else - unsigned long long x = va_arg (ap, unsigned long long); -#endif - n = fprintf (stream, template, x); + uint64 x = va_arg(ap, uint64); + n = fprintf (stream, template, x); } break; @@ -794,6 +771,9 @@ HDfprintf (FILE *stream, const char *fmt, ...) } else if (sizeof(x->offset)==SIZEOF_LONG_LONG) { HDstrcat(template, PRINTF_LL_WIDTH); HDstrcat(template, "d"); + } else if (sizeof(x->offset)==SIZEOF___INT64) { + HDstrcat(template, PRINTF_LL_WIDTH); + HDstrcat(template, "d"); } n = fprintf(stream, template, x->offset); } else { @@ -1003,7 +983,6 @@ H5_timer_reset (H5_timer_t *timer) void H5_timer_begin (H5_timer_t *timer) { -#if !defined(WIN32) #ifdef HAVE_GETRUSAGE struct rusage rusage; #endif @@ -1024,7 +1003,6 @@ H5_timer_begin (H5_timer_t *timer) gettimeofday (&etime, NULL); timer->etime = (double)etime.tv_sec + (double)etime.tv_usec/1e6; -#endif } @@ -49,10 +49,6 @@ static char RcsId[] = "@(#)$Revision$"; #include <H5Pprivate.h> /*property lists */ #include <H5Tprivate.h> /*data types */ -#include <ctype.h> -#include <sys/types.h> -#include <sys/stat.h> - /* * Define the following if you want H5F_block_read() and H5F_block_write() to * keep track of the file position and attempt to minimize calls to the file diff --git a/src/H5Flow.c b/src/H5Flow.c index 5193f36..5b13715 100644 --- a/src/H5Flow.c +++ b/src/H5Flow.c @@ -15,9 +15,6 @@ #include <H5Fprivate.h> #include <H5MMprivate.h> -#include <sys/types.h> -#include <sys/stat.h> - #define addr_defined(X) (((uint64)(-1)!=(X)->offset) ? TRUE : FALSE) #define PABLO_MASK H5F_low @@ -1017,7 +1014,7 @@ H5F_addr_hash(const haddr_t *addr, uintn mod) *------------------------------------------------------------------------- */ herr_t -H5F_addr_pack(H5F_t *f, haddr_t *addr, const long objno[2]) +H5F_addr_pack(H5F_t __unused__ *f, haddr_t *addr, const long objno[2]) { assert(f); assert(objno); diff --git a/src/H5Fmpio.c b/src/H5Fmpio.c index d9ba4b0..1ade4b6 100644 --- a/src/H5Fmpio.c +++ b/src/H5Fmpio.c @@ -47,9 +47,6 @@ #include <H5Dprivate.h> #include <H5MMprivate.h> -#include <sys/types.h> -#include <sys/stat.h> - #ifndef HAVE_PARALLEL /* * The H5F_mpio_xxxx functions are for parallel I/O only and are diff --git a/src/H5Fsec2.c b/src/H5Fsec2.c index 874172b..172ec1c 100644 --- a/src/H5Fsec2.c +++ b/src/H5Fsec2.c @@ -19,9 +19,6 @@ #include <H5Fprivate.h> #include <H5MMprivate.h> -#include <sys/types.h> -#include <sys/stat.h> - #define PABLO_MASK H5F_sec2 static hbool_t interface_initialize_g = FALSE; #define INTERFACE_INIT NULL diff --git a/src/H5Fstdio.c b/src/H5Fstdio.c index 5863dd6..ae31305 100644 --- a/src/H5Fstdio.c +++ b/src/H5Fstdio.c @@ -13,9 +13,6 @@ #include <H5Fprivate.h> #include <H5MMprivate.h> -#include <sys/types.h> -#include <sys/stat.h> - #define PABLO_MASK H5F_stdio static hbool_t interface_initialize_g = FALSE; #define INTERFACE_INIT NULL diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 57ad6bd..1107e56 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -20,16 +20,16 @@ #define H5G_PACKAGE /*suppress error message about including H5Gpkg.h */ /* Packages needed by this file... */ -#include <H5private.h> /*library */ -#include <H5ACprivate.h> /*cache */ -#include <H5Bprivate.h> /*B-link trees */ -#include <H5Eprivate.h> /*error handling */ -#include <H5Fprivate.h> /*file access */ -#include <H5Gpkg.h> /*me */ -#include <H5HLprivate.h> /*heap */ -#include <H5MFprivate.h> /*file memory management */ -#include <H5MMprivate.h> /*core memory management */ -#include <H5Oprivate.h> /*header messages */ +#include <H5private.h> /*library */ +#include <H5ACprivate.h> /*cache */ +#include <H5Bprivate.h> /*B-link trees */ +#include <H5Eprivate.h> /*error handling */ +#include <H5Fprivate.h> /*file access */ +#include <H5Gpkg.h> /*me */ +#include <H5HLprivate.h> /*local heap */ +#include <H5MFprivate.h> /*file memory management */ +#include <H5MMprivate.h> /*core memory management */ +#include <H5Oprivate.h> /*header messages */ #define PABLO_MASK H5G_node_mask diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 3755e7a..4e680f9 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -61,7 +61,8 @@ static hbool_t interface_initialize_g = FALSE; *------------------------------------------------------------------------- */ static void * -H5O_fill_decode(H5F_t *f, const uint8 *p, H5O_shared_t *sh) +H5O_fill_decode(H5F_t __unused__ *f, const uint8 *p, + H5O_shared_t __unused__ *sh) { H5O_fill_t *mesg=NULL; void *ret_value = NULL; @@ -110,7 +111,7 @@ H5O_fill_decode(H5F_t *f, const uint8 *p, H5O_shared_t *sh) *------------------------------------------------------------------------- */ static herr_t -H5O_fill_encode(H5F_t *f, uint8 *p, const void *_mesg) +H5O_fill_encode(H5F_t __unused__ *f, uint8 *p, const void *_mesg) { const H5O_fill_t *mesg = (const H5O_fill_t *)_mesg; @@ -201,7 +202,7 @@ H5O_fill_copy(const void *_mesg, void *_dest) *------------------------------------------------------------------------- */ static size_t -H5O_fill_size(H5F_t *f, const void *_mesg) +H5O_fill_size(H5F_t __unused__ *f, const void *_mesg) { const H5O_fill_t *mesg = (const H5O_fill_t *)_mesg; @@ -261,8 +262,8 @@ H5O_fill_reset(void *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_fill_debug(H5F_t *f, const void *_mesg, FILE *stream, intn indent, - intn fwidth) +H5O_fill_debug(H5F_t __unused__ *f, const void *_mesg, FILE *stream, + intn indent, intn fwidth) { const H5O_fill_t *mesg = (const H5O_fill_t *)_mesg; @@ -16,8 +16,6 @@ static char RcsId[] = "@(#)$Revision$"; /* $Id$ */ -#include <stdarg.h> - /* Private header files */ #include <H5private.h> /* Generic Functions */ #include <H5Iprivate.h> /* IDs */ diff --git a/src/H5Rpublic.h b/src/H5Rpublic.h index 48a5765..7447694 100644 --- a/src/H5Rpublic.h +++ b/src/H5Rpublic.h @@ -24,11 +24,11 @@ * Reference types allowed. */ typedef enum { - H5R_BADTYPE = (-1), /* invalid Reference Type */ - H5R_OBJECT, /* Object reference */ - H5R_DATASET_REGION, /* Dataset Region Reference */ - H5R_INTERNAL, /* Internal Reference */ - H5R_MAXTYPE /* highest type in group (Invalid as true type)*/ + H5R_BADTYPE = (-1), /*invalid Reference Type */ + H5R_OBJECT, /*Object reference */ + H5R_DATASET_REGION, /*Dataset Region Reference */ + H5R_INTERNAL, /*Internal Reference */ + H5R_MAXTYPE /*highest type (Invalid as true type) */ } H5R_type_t; #ifdef LATER @@ -53,7 +53,7 @@ extern "C" { /* Functions in H5R.c */ herr_t H5Rcreate(void *ref, hid_t loc_id, const char *name, - H5R_type_t ref_type, hid_t space_id); + H5R_type_t ref_type, hid_t space_id); hid_t H5Rdereference(hid_t dataset, H5R_type_t ref_type, void *ref); hid_t H5Rget_region(hid_t dataset, H5R_type_t ref_type, void *ref); diff --git a/src/H5Tconv.c b/src/H5Tconv.c index f46524f..2e34c36 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -14,8 +14,6 @@ #include <H5Eprivate.h> #include <H5MMprivate.h> #include <H5Tpkg.h> -#include <math.h> /*for ceil() */ -#include <float.h> /*for FLT_MAX and HUGE_VAL */ /* Conversion data for H5T_conv_struct() */ typedef struct H5T_conv_struct_t { @@ -415,7 +415,7 @@ H5V_hyper_copy(intn n, const hsize_t *_size, { hsize_t dst_acc; /*accumulator */ hsize_t src_acc; /*accumulator */ - int i; /*counter */ + int ii; /*counter */ /* init */ dst_stride[n-1] = 1; @@ -424,17 +424,17 @@ H5V_hyper_copy(intn n, const hsize_t *_size, src_start = src_offset ? src_offset[n-1] : 0; /* others */ - for (i=n-2, dst_acc=1, src_acc=1; i>=0; --i) { - hsize_t tmp1 = dst_acc * (dst_size[i+1] - size[i+1]); - hsize_t tmp2 = src_acc * (src_size[i+1] - size[i+1]); + for (ii=n-2, dst_acc=1, src_acc=1; ii>=0; --ii) { + hsize_t tmp1 = dst_acc * (dst_size[ii+1] - size[ii+1]); + hsize_t tmp2 = src_acc * (src_size[ii+1] - size[ii+1]); assert (tmp1<((hsize_t)1<<(8*sizeof(hssize_t)-1))); assert (tmp2<((hsize_t)1<<(8*sizeof(hssize_t)-1))); - dst_stride[i] = (hssize_t)tmp1; /*overflow checked*/ - src_stride[i] = (hssize_t)tmp2; /*overflow checked*/ - dst_acc *= dst_size[i+1]; - src_acc *= src_size[i+1]; - dst_start += dst_acc * (dst_offset ? dst_offset[i] : 0); - src_start += src_acc * (src_offset ? src_offset[i] : 0); + dst_stride[ii] = (hssize_t)tmp1; /*overflow checked*/ + src_stride[ii] = (hssize_t)tmp2; /*overflow checked*/ + dst_acc *= dst_size[ii+1]; + src_acc *= src_size[ii+1]; + dst_start += dst_acc * (dst_offset ? dst_offset[ii] : 0); + src_start += src_acc * (src_offset ? src_offset[ii] : 0); } } #endif /* NO_INLINED_CODE */ diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h index 616202e..b3d55e9 100644 --- a/src/H5Vprivate.h +++ b/src/H5Vprivate.h @@ -22,11 +22,6 @@ #define H5V_vector_le_u(N,V1,V2) (H5V_vector_cmp_u (N, V1, V2)<=0) #define H5V_vector_ge_u(N,V1,V2) (H5V_vector_cmp_u (N, V1, V2)>=0) -#if defined(WIN32) -#undef inline -#define inline -#endif - /* Other functions */ #define H5V_vector_cpy(N,DST,SRC) { \ assert (sizeof(*(DST))==sizeof(*(SRC))); \ diff --git a/src/H5config.h.in b/src/H5config.h.in index f244669..755ec7e 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -22,6 +22,9 @@ /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Define if you can safely include both <sys/time.h> and <time.h>. */ +#undef TIME_WITH_SYS_TIME + /* Define if your <sys/time.h> declares struct tm. */ #undef TM_IN_SYS_TIME @@ -53,6 +56,9 @@ /* Define if `struct timezone' is defined */ #undef HAVE_STRUCT_TIMEZONE +/* The number of bytes in a __int64. */ +#undef SIZEOF___INT64 + /* The number of bytes in a double. */ #undef SIZEOF_DOUBLE @@ -116,9 +122,21 @@ /* Define if you have the waitpid function. */ #undef HAVE_WAITPID +/* Define if you have the <io.h> header file. */ +#undef HAVE_IO_H + +/* Define if you have the <sys/resource.h> header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define if you have the <sys/time.h> header file. */ +#undef HAVE_SYS_TIME_H + /* Define if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H +/* Define if you have the <winsock.h> header file. */ +#undef HAVE_WINSOCK_H + /* Define if you have the <zlib.h> header file. */ #undef HAVE_ZLIB_H diff --git a/src/H5detect.c b/src/H5detect.c index bbd9ba9..9979135 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -30,19 +30,33 @@ static const char *FileHeader = "\n\ *------------------------------------------------------------------------- */ #undef NDEBUG -#include <assert.h> -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> -#if !defined(WIN32) -#include <unistd.h> -#include <sys/time.h> -#include <pwd.h> +#include <H5config.h> + +/* See H5private.h for how to include files */ +#ifdef STDC_HEADERS +# include <assert.h> +# include <math.h> +# include <stdio.h> +# include <stdlib.h> +# include <string.h> #endif -#include <H5config.h> +#ifdef HAVE_UNISTD_H +# include <sys/types.h> +# include <unistd.h> +#endif +#ifdef _POSIX_VERSION +# include <pwd.h> +#endif + +#if defined(TIME_WITH_SYS_TIME) +# include <sys/time.h> +# include <time.h> +#elif defined(HAVE_SYS_TIME_H) +# include <sys/time.h> +#else +# include <time.h> +#endif #define MAXDETECT 16 @@ -801,11 +815,15 @@ print_header(void) time_t now = time(NULL); struct tm *tm = localtime(&now); - struct passwd *pwd = NULL; char real_name[30]; char host_name[256]; int i; const char *s; +#ifdef HAVE_GETPWUID + struct passwd *pwd = NULL; +#else + int pwd = 1; +#endif static const char *month_name[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", @@ -895,7 +913,7 @@ bit.\n"; if (pwd || real_name[0] || host_name[0]) { printf(" *\t\t\t"); if (real_name[0]) printf("%s <", real_name); -#if !defined(WIN32) +#ifdef HAVE_GETPWUID if (pwd) fputs(pwd->pw_name, stdout); #endif if (host_name[0]) printf("@%s", host_name); @@ -953,23 +971,21 @@ main(void) DETECT_I(long, LONG, d[nd]); nd++; DETECT_I(unsigned long, ULONG, d[nd]); nd++; -#if SIZEOF_LONG == SIZEOF_LONG_LONG +#if SIZEOF_LONG_LONG > SIZEOF_LONG + DETECT_I(long long, LLONG, d[nd]); nd++; + DETECT_I(unsigned long long, ULLONG, d[nd]); nd++; +#elif SIZEOF___INT64 > SIZEOF_LONG + DETECT_I(__int64, LLONG, d[nd]); nd++; + DETECT_I(unsigned __int64, ULLONG, d[nd]); nd++; +#else /* - * If sizeof(long)==sizeof(long long) then assume that `long long' isn't - * supported and use `long' instead. This suppresses warnings on some - * systems. + * This architecture doesn't support an integer type larger than `long' + * so we'll just make H5T_NATIVE_LLONG the same as H5T_NATIVE_LONG. */ DETECT_I(long, LLONG, d[nd]); nd++; DETECT_I(unsigned long, ULLONG, d[nd]); nd++; -#else -#if defined(WIN32) - DETECT_I(__int64, LLONG, d[nd]); nd++; - DETECT_I(unsigned __int64, ULLONG, d[nd]); nd++; -#else - DETECT_I(long long, LLONG, d[nd]); nd++; - DETECT_I(unsigned long long, ULLONG, d[nd]); nd++; -#endif #endif + DETECT_F(float, FLOAT, d[nd]); nd++; DETECT_F(double, DOUBLE, d[nd]); nd++; diff --git a/src/H5private.h b/src/H5private.h index 25e93f6..2769269 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1,70 +1,90 @@ -/**************************************************************************** - * NCSA HDF * - * Software Development Group * - * National Center for Supercomputing Applications * - * University of Illinois at Urbana-Champaign * - * 605 E. Springfield, Champaign IL 61820 * - * * - * For conditions of distribution and use, see the accompanying * - * hdf/COPYING file. * - * * - ****************************************************************************/ - -/* $Id$ */ - /* - * This file contains macros & private information for general HDF5 functions. - * Every HDF5 source file will include this file immediately after any - * system include files but before any other private include files. + * Copyright (C) 1998 NCSA + * All rights reserved. + * + * Programmer: Robb Matzke <matzke@llnl.gov> + * Friday, October 30, 1998 + * + * Purpose: This file is included by all HDF5 library source files to + * define common things which are not defined in the HDF5 API. + * The configuration constants like HAVE_UNISTD_H etc. are + * defined in H5config.h which is included by H5public.h. */ #ifndef _H5private_H #define _H5private_H #include <H5public.h> /* Include Public Definitions */ -/* Version #'s of the major components of the file format */ -#define HDF5_BOOTBLOCK_VERSION 0 /* of the boot block format */ -#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */ -#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */ -#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */ - -/* - * Status return values for the `herr_t' type. - * Since some unix/c routines use 0 and -1 (or more precisely, non-negative - * vs. negative) as their return code, and some assumption had been made in - * the code about that, it is important to keep these constants the same - * values. When checking the success or failure of an integer-valued - * function, remember to compare against zero and not one of these two - * values. - */ -#define SUCCEED 0 -#define FAIL (-1) -#define UFAIL (unsigned)(-1) - - /* - * Include those things that almost all source files need. + * Include ANSI-C header files. */ #ifdef STDC_HEADERS # include <assert.h> # include <ctype.h> +# include <errno.h> # include <fcntl.h> +# include <float.h> +# include <math.h> +# include <stdarg.h> # include <stdio.h> # include <stdlib.h> # include <string.h> -# include <time.h> +#endif -#if defined(WIN32) -# include<sys\types.h> -# include<io.h> -#define F_OK 00 -#define R_OK 04 -#define W_OK 02 -#else -# include <sys/time.h> +/* + * If _POSIX_VERSION is defined in unistd.h then this system is Posix.1 + * compliant. Otherwise all bets are off. + */ +#ifdef HAVE_UNISTD_H # include <sys/types.h> # include <unistd.h> -#endif /*if defined(WIN32)*/ +#endif +#ifdef _POSIX_VERSION +# include <sys/stat.h> +# include <sys/wait.h> +# include <pwd.h> +#endif +/* + * If a program may include both `time.h' and `sys/time.h' then + * TIME_WITH_SYS_TIME is defined (see AC_HEADER_TIME in configure.in). + * On some older systems, `sys/time.h' includes `time.h' but `time.h' is not + * protected against multiple inclusion, so programs should not explicitly + * include both files. This macro is useful in programs that use, for example, + * `struct timeval' or `struct timezone' as well as `struct tm'. It is best + * used in conjunction with `HAVE_SYS_TIME_H', whose existence is checked + * by `AC_CHECK_HEADERS(sys/time.h)' in configure.in. + */ +#if defined(TIME_WITH_SYS_TIME) +# include <sys/time.h> +# include <time.h> +#elif defined(HAVE_SYS_TIME_H) +# include <sys/time.h> +#else +# include <time.h> +#endif + +/* + * Resource usage is not Posix.1 but HDF5 uses it anyway for some performance + * and debugging code if available. + */ +#ifdef HAVE_SYS_RESOURCE_H +# include <sys/resource.h> +#endif + +/* + * Win32 is severely broken when it comes to ANSI-C and Posix.1 compliance. + */ +#ifdef HAVE_IO_H +# include <io.h> +#endif +#ifdef HAVE_WINSOCK_H +# include <winsock.h> +# include <winsock2.h> +#endif +#ifndef F_OK +# define F_OK 00 +# define W_OK 02 +# define R_OK 04 #endif /* @@ -77,44 +97,64 @@ # include "ProcIDs.h" #endif -/* Does the compiler support the __attribute__(()) syntax? */ -#ifndef HAVE_ATTRIBUTE +/* + * Does the compiler support the __attribute__(()) syntax? This is how gcc + * suppresses warnings about unused function arguments. It's no big deal if + * we don't. + */ +#ifdef HAVE_ATTRIBUTE +# define __unused__ __attribute__((unused)) +#else # define __attribute__(X) /*void*/ # define __unused__ /*void*/ -#else -# define __unused__ __attribute__((unused)) -#endif - -#if defined(WIN32) -#undef __unused__ -#define __unused__ #endif -/* Does the compiler expand __FUNCTION__? */ +/* + * Does the compiler expand __FUNCTION__ to be the name of the function + * currently being defined? If not then define it to be some constant + * string. + */ #ifndef HAVE_FUNCTION -# define __FUNCTION__ "NoFuntionName" +# define __FUNCTION__ "NoFunctionName" #endif +/* Version #'s of the major components of the file format */ +#define HDF5_BOOTBLOCK_VERSION 0 /* of the boot block format */ +#define HDF5_FREESPACE_VERSION 0 /* of the Free-Space Info */ +#define HDF5_OBJECTDIR_VERSION 0 /* of the Object Directory format */ +#define HDF5_SHAREDHEADER_VERSION 0 /* of the Shared-Header Info */ + +/* + * Status return values for the `herr_t' type. + * Since some unix/c routines use 0 and -1 (or more precisely, non-negative + * vs. negative) as their return code, and some assumption had been made in + * the code about that, it is important to keep these constants the same + * values. When checking the success or failure of an integer-valued + * function, remember to compare against zero and not one of these two + * values. + */ +#define SUCCEED 0 +#define FAIL (-1) +#define UFAIL (unsigned)(-1) + /* number of members in an array */ #ifndef NELMTS # define NELMTS(X) (sizeof(X)/sizeof(X[0])) #endif /* minimum of two, three, or four values */ -#ifndef MIN -# define MIN(a,b) (((a)<(b)) ? (a) : (b)) -# define MIN2(a,b) MIN(a,b) -# define MIN3(a,b,c) MIN(a,MIN(b,c)) -# define MIN4(a,b,c,d) MIN(MIN(a,b),MIN(c,d)) -#endif +#undef MIN +#define MIN(a,b) (((a)<(b)) ? (a) : (b)) +#define MIN2(a,b) MIN(a,b) +#define MIN3(a,b,c) MIN(a,MIN(b,c)) +#define MIN4(a,b,c,d) MIN(MIN(a,b),MIN(c,d)) /* maximum of two, three, or four values */ -#ifndef MAX -# define MAX(a,b) (((a)>(b)) ? (a) : (b)) -# define MAX2(a,b) MAX(a,b) -# define MAX3(a,b,c) MAX(a,MAX(b,c)) -# define MAX4(a,b,c,d) MAX(MAX(a,b),MAX(c,d)) -#endif +#undef MAX +#define MAX(a,b) (((a)>(b)) ? (a) : (b)) +#define MAX2(a,b) MAX(a,b) +#define MAX3(a,b,c) MAX(a,MAX(b,c)) +#define MAX4(a,b,c,d) MAX(MAX(a,b),MAX(c,d)) /* limit the middle value to be within a range (inclusive) */ #define RANGE(LO,X,HI) MAX(LO,MIN(X,HI)) @@ -178,13 +218,11 @@ typedef unsigned uint64; typedef long int64; typedef unsigned long uint64; #elif SIZEOF_LONG_LONG==8 -#if defined(WIN32) -typedef __int64 int64; -typedef unsigned __int64 uint64; -#else typedef long long int64; typedef unsigned long long uint64; -#endif +#elif SIZEOF___INT64==8 +typedef __int64 int64; +typedef unsigned __int64 uint64; #else # error "no 64-bit integer type" #endif diff --git a/src/H5public.h b/src/H5public.h index 3c4ec4e..6e49151 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -27,10 +27,10 @@ /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 1 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 6 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 20 /* For tweaks, bug-fixes, or development */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ - H5_VERS_RELEASE) + H5_VERS_RELEASE) /* * Status return values. Failed integer functions in HDF5 result almost @@ -64,24 +64,22 @@ typedef int herr_t; typedef unsigned int hbool_t; typedef int htri_t; - /* - * The sizes of file-objects in hdf5 have their own types defined here. On - * most systems, these are the same as size_t and ssize_t, but on systems - * with small address spaces these are defined to be larger. + * The sizes of file objects have their own types defined here. If large + * sizes are enabled then use a 64-bit data type, otherwise use the size of + * memory objects. */ -#if defined(HAVE_LARGE_HSIZET) && SIZEOF_SIZE_T<SIZEOF_LONG_LONG -#if defined(WIN32) -typedef unsigned __int64 hsize_t; -typedef signed __int64 hssize_t; -typedef signed int ssize_t; -#else -typedef unsigned long long hsize_t; -typedef signed long long hssize_t; -#endif +#ifdef HAVE_LARGE_HSIZET +# if SIZEOF_LONG_LONG==8 +typedef unsigned long long hsize_t; +typedef signed long long hssize_t; +# elif SIZEOF___INT64==8 +typedef unsigned __int64 hsize_t; +typedef signed __int64 hssize_t; +# endif #else -typedef size_t hsize_t; -typedef ssize_t hssize_t; +typedef size_t hsize_t; +typedef ssize_t hssize_t; #endif #ifdef __cplusplus |