diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-02-27 20:07:37 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-02-27 20:07:37 (GMT) |
commit | 0b4d32bb4a12fe0e34026c0f069aa99bf34cd834 (patch) | |
tree | 78bda62db83274079ca09e0d6bb4554dafa25544 /src | |
parent | ed6d456f28862192e5768c279d96ca6da5d0f6cb (diff) | |
download | hdf5-0b4d32bb4a12fe0e34026c0f069aa99bf34cd834.zip hdf5-0b4d32bb4a12fe0e34026c0f069aa99bf34cd834.tar.gz hdf5-0b4d32bb4a12fe0e34026c0f069aa99bf34cd834.tar.bz2 |
[svn-r301] Changes since 19980226
----------------------
./bin/release
Changed default to not tag CVS sources.
./src/H5F.c
Replaced a constant switch with preprocessor directives.
Removed a local variable which was set but not used.
./src/H5Fprivate.h
Changed `long long' to `int64' to get rid of ansi warnings in
a few places.
Fixed bugs in INT64DECODE() and UINT64DECODE() for big-endian
architectures. This fixes all the bugs with the Irix -64
compile.
./src/H5F.c
The default address and length sizes are set according to the
sizeof(size_t) now that the bugs have been fixed.
./src/H5Fpublic.h
Removed a trailing comma in an enumerated type.
./src/H5Fstdio.c
./src/H5Fsec2.c
Added two more calls to fseek64() and lseek64(). Removed `long
long' in place of `int64' to suppress -ansi warnings.
./src/H5P.c
Replaced a FAIL with H5F_LOW_ERROR.
./src/H5private.h
./configure.in
Increased version number to hdf5-1.0.1a since we've already
released hdf5-1.0.0a. Include <sys/types.h>. Fixed
indentation. Fixed detection of off64_t for old Irix systems
where it might be a struct.
./src/Makefile.in
Moved a comment from the shell to the makefile since some
versions of sh barf on interactive comments.
./config/linux
Allow overriding of the CC variable from the command-line. It
still defaults to gcc but this allows us to specify a complete
path from test scripts by saying:
CC=/usr/local/tools/gnu/gcc sh configure
Diffstat (limited to 'src')
-rw-r--r-- | src/H5F.c | 39 | ||||
-rw-r--r-- | src/H5Fprivate.h | 14 | ||||
-rw-r--r-- | src/H5Fpublic.h | 2 | ||||
-rw-r--r-- | src/H5Fsec2.c | 10 | ||||
-rw-r--r-- | src/H5Fstdio.c | 28 | ||||
-rw-r--r-- | src/H5P.c | 2 | ||||
-rw-r--r-- | src/H5private.h | 60 | ||||
-rw-r--r-- | src/Makefile.in | 3 |
8 files changed, 79 insertions, 79 deletions
@@ -77,8 +77,8 @@ const H5F_create_t H5F_create_dflt = { 0, /* unused */ 0, /* unused */ }, - 4, /* Default offset size */ - 4, /* Default length size */ + sizeof(size_t), /* Default offset size */ + sizeof(size_t), /* Default length size */ HDF5_BOOTBLOCK_VERSION, /* Current Boot-Block version # */ HDF5_SMALLOBJECT_VERSION, /* Current Small-Object heap version # */ HDF5_FREESPACE_VERSION, /* Current Free-Space info version # */ @@ -143,23 +143,23 @@ H5F_init_interface(void) /* Initialize the default file access template */ H5F_access_dflt.driver = H5F_LOW_DFLT; - switch (H5F_LOW_DFLT) { - case H5F_LOW_STDIO: - case H5F_LOW_SEC2: - case H5F_LOW_CORE: - case H5F_LOW_SPLIT: - case H5F_LOW_FAMILY: - /* nothing more to init */ - break; - - case H5F_LOW_MPI: -#ifdef HAVE_PARALLEL - H5F_access_dflt.u.mpio.access_mode = 0; - H5F_access_dflt.u.mpio.comm = MPI_COMM_NULL; - H5F_access_dflt.u.mpio.info = MPI_INFO_NULL; +#if (H5F_LOW_DFLT == H5F_LOW_SEC2) + /* Nothing to initialize */ +#elif (H5F_LOW_DFLT == H5F_LOW_STDIO) + /* Nothing to initialize */ +#elif (H5F_LOW_DFLT == H5F_LOW_CORE) + H5F_access_dflt.u.core.increment = 10*1024; +#elif (H5F_LOW_DFLT == H5F_LOW_MPI) + H5F_access_dflt.u.mpio.access_mode = 0; + H5F_access_dflt.u.mpio.comm = MPI_COMM_NULL; + H5F_access_dflt.u.mpio.info = MPI_INFO_NULL; +#elif (H5F_LOW_DFLT == H5F_LOW_SPLIT) + /* Nothing to initialize */ +#elif (H5F_LOW_DFLT == H5F_LOW_FAMILY) + /* Nothing to initialize */ +#else +# error "Unknown default file driver" #endif - break; - } FUNC_LEAVE(ret_value); } @@ -1388,7 +1388,6 @@ H5F_close(H5F_t *f) herr_t H5Fclose(hid_t fid) { - H5F_t *file = NULL; /* file struct for file to close */ herr_t ret_value = SUCCEED; FUNC_ENTER(H5Fclose, FAIL); @@ -1397,7 +1396,7 @@ H5Fclose(hid_t fid) if (H5_FILE != H5A_group(fid)) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file atom"); } - if (NULL == (file = H5A_object(fid))) { + if (NULL == H5A_object(fid)) { HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't unatomize file"); } diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 0bee571..7a9e593 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -143,10 +143,10 @@ # define INT64DECODE(p, n) { \ /* WE DON'T CHECK FOR OVERFLOW! */ \ size_t _i; \ - n = 0; \ + n = 0; \ (p) += 8; \ - for (_i=0; _i<sizeof(int64); _i++, n<<=8) { \ - n |= *(--p); \ + for (_i=0; _i<sizeof(int64); _i++) { \ + n = (n<<8) | *(--p); \ } \ (p) += 8; \ } @@ -154,10 +154,10 @@ # define UINT64DECODE(p, n) { \ /* WE DON'T CHECK FOR OVERFLOW! */ \ size_t _i; \ - n = 0; \ + n = 0; \ (p) += 8; \ - for (_i=0; _i<sizeof(uint64); _i++, n<<=8) { \ - n |= *(--p); \ + for (_i=0; _i<sizeof(uint64); _i++) { \ + n = (n<<8) | *(--p); \ } \ (p) += 8; \ } @@ -339,7 +339,7 @@ typedef struct H5F_low_t { FILE *f; /* Posix stdio file */ H5F_fileop_t op; /* Previous file operation */ #ifdef HAVE_FSEEK64 - long long cur; /* Current file position */ + int64 cur; /* Current file position */ #else off_t cur; /* Current file position */ #endif diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index fbd827c..27745cd 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -55,7 +55,7 @@ typedef enum H5F_driver_t { H5F_LOW_MPI = 2, /*use indep or collective MPI-IO */ H5F_LOW_CORE = 3, /*use malloc() and free() */ H5F_LOW_SPLIT = 4, /*separate meta data from raw data */ - H5F_LOW_FAMILY = 5, /*split addr space over many files */ + H5F_LOW_FAMILY = 5 /*split addr space over many files */ } H5F_driver_t; diff --git a/src/H5Fsec2.c b/src/H5Fsec2.c index dd0ab0f..57dd7a6 100644 --- a/src/H5Fsec2.c +++ b/src/H5Fsec2.c @@ -177,9 +177,9 @@ H5F_sec2_read(H5F_low_t *lf, const H5F_access_t *access_parms, HRETURN_ERROR (H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed"); } #ifdef HAVE_LSEEK64 - offset = (off64_t)(addr->offset); /*checked for overflow*/ + offset = (off64_t)(addr->offset); /*checked for overflow above*/ #else - offset = (off_t)(addr->offset); /*checked for overflow*/ + offset = (off_t)(addr->offset); /*checked for overflow above*/ #endif /* Check easy cases */ @@ -196,9 +196,15 @@ H5F_sec2_read(H5F_low_t *lf, const H5F_access_t *access_parms, if (!H5F_OPT_SEEK || lf->u.sec2.op == H5F_OP_UNKNOWN || lf->u.sec2.cur != offset) { +#ifdef HAVE_LSEEK64 + if (lseek64 (lf->u.sec2.fd, offset, SEEK_SET)<0) { + HRETURN_ERROR (H5E_IO, H5E_SEEKERROR, FAIL, "lseek64 failed"); + } +#else if (lseek(lf->u.sec2.fd, offset, SEEK_SET) < 0) { HRETURN_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "lseek failed"); } +#endif lf->u.sec2.cur = offset; } diff --git a/src/H5Fstdio.c b/src/H5Fstdio.c index ed0cdb2..6224dd6 100644 --- a/src/H5Fstdio.c +++ b/src/H5Fstdio.c @@ -185,7 +185,7 @@ H5F_stdio_read(H5F_low_t *lf, const H5F_access_t *access_parms, size_t n; uint64 mask; #ifdef HAVE_FSEEK64 - long long offset; + int64 offset; #else off_t offset; #endif @@ -200,7 +200,7 @@ H5F_stdio_read(H5F_low_t *lf, const H5F_access_t *access_parms, HRETURN_ERROR (H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed"); } #ifdef HAVE_FSEEK64 - offset = (long long)(addr->offset); /*checked for overflow*/ + offset = (int64)(addr->offset); /*checked for overflow*/ #else offset = (off_t)(addr->offset); /*checked for overflow*/ #endif @@ -218,9 +218,15 @@ H5F_stdio_read(H5F_low_t *lf, const H5F_access_t *access_parms, if (!H5F_OPT_SEEK || lf->u.stdio.op != H5F_OP_READ || lf->u.stdio.cur != offset) { +#ifdef HAVE_FSEEK64 + if (fseek64 (lf->u.stdio.f, offset, SEEK_SET)<0) { + HRETURN_ERROR (H5E_IO, H5E_SEEKERROR, FAIL, "fseek64 failed"); + } +#else if (fseek(lf->u.stdio.f, offset, SEEK_SET) < 0) { HRETURN_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "fseek failed"); } +#endif lf->u.stdio.cur = offset; } @@ -250,7 +256,11 @@ H5F_stdio_read(H5F_low_t *lf, const H5F_access_t *access_parms, * Update the file position data. */ lf->u.stdio.op = H5F_OP_READ; - lf->u.stdio.cur = offset + n; +#ifdef HAVE_FSEEK64 + lf->u.stdio.cur = (int64)(offset+n); /*checked for overflow above*/ +#else + lf->u.stdio.cur = (off_t)(offset+n); /*checked for overflow above*/ +#endif FUNC_LEAVE(SUCCEED); } @@ -284,7 +294,7 @@ H5F_stdio_write(H5F_low_t *lf, const H5F_access_t *access_parms, ssize_t n; uint64 mask; #ifdef HAVE_FSEEK64 - long long offset; + int64 offset; #else off_t offset; #endif @@ -299,8 +309,8 @@ H5F_stdio_write(H5F_low_t *lf, const H5F_access_t *access_parms, HRETURN_ERROR (H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed"); } #ifdef HAVE_FSEEK64 - offset = (long long)(addr->offset); /*checked for overflow*/ - n = (long long)size; /*checked for overflow*/ + offset = (int64)(addr->offset); /*checked for overflow*/ + n = (int64)size; /*checked for overflow*/ #else offset = (long)(addr->offset); /*checked for overflow*/ n = (off_t)size; /*checked for overflow*/ @@ -312,9 +322,15 @@ H5F_stdio_write(H5F_low_t *lf, const H5F_access_t *access_parms, if (!H5F_OPT_SEEK || lf->u.stdio.op != H5F_OP_WRITE || lf->u.stdio.cur != offset) { +#ifdef HAVE_FSEEK64 + if (fseek64 (lf->u.stdio.f, offset, SEEK_SET)<0) { + HRETURN_ERROR (H5E_IO, H5E_SEEKERROR, FAIL, "fseek64 failed"); + } +#else if (fseek(lf->u.stdio.f, offset, SEEK_SET) < 0) { HRETURN_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "fseek failed"); } +#endif lf->u.stdio.cur = offset; } /* @@ -983,7 +983,7 @@ H5Pget_driver (hid_t tid) /* Check arguments */ if (H5P_FILE_ACCESS != H5Pget_class (tid) || NULL == (tmpl = H5A_object (tid))) { - HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, + HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, H5F_LOW_ERROR, "not a file access property list"); } diff --git a/src/H5private.h b/src/H5private.h index dd57431..1fc944b 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -24,7 +24,7 @@ /* Version #'s of library code */ #define HDF5_MAJOR_VERSION 1 /* For major interface changes */ #define HDF5_MINOR_VERSION 0 /* For minor interface changes */ -#define HDF5_RELEASE_VERSION 0 /* For interface tweaks & bug-fixes */ +#define HDF5_RELEASE_VERSION 1 /* For interface tweaks & bug-fixes */ #define HDF5_PATCH_VERSION 0 /* For small groups of bug fixes */ /* Version #'s of the major components of the file format */ @@ -38,61 +38,62 @@ * Include those things that almost all source files need. */ #ifdef STDC_HEADERS -# include <assert.h> -# include <fcntl.h> -# include <stdio.h> -# include <stdlib.h> -# include <string.h> -# include <unistd.h> +# include <assert.h> +# include <fcntl.h> +# include <stdio.h> +# include <stdlib.h> +# include <string.h> +# include <sys/types.h> +# include <unistd.h> #endif /* * Pablo support files. */ #ifdef HAVE_PABLO -# define IOTRACE -# include "IOTrace.h" -# include "ProcIDS.h" +# define IOTRACE +# include "IOTrace.h" +# include "ProcIDS.h" #endif /* Does the compiler support the __attribute__(()) syntax? */ #ifndef HAVE_ATTRIBUTE -# define __attribute__(X) /*void */ +# define __attribute__(X) /*void */ #endif /* Does the compiler expand __FUNCTION__? */ #ifndef HAVE_FUNCTION -# define __FUNCTION__ "NoFuntionName" +# define __FUNCTION__ "NoFuntionName" #endif /* number of members in an array */ #ifndef NELMTS -# define NELMTS(X) (sizeof(X)/sizeof(X[0])) +# define NELMTS(X) (sizeof(X)/sizeof(X[0])) #endif /* minimum of two values */ #ifndef MIN -# define MIN(a,b) (((a)<(b)) ? (a) : (b)) +# define MIN(a,b) (((a)<(b)) ? (a) : (b)) #endif /* maximum of two values */ #ifndef MAX -# define MAX(a,b) (((a)>(b)) ? (a) : (b)) +# define MAX(a,b) (((a)>(b)) ? (a) : (b)) #endif /* absolute value */ #ifndef ABS -# define ABS(a) (((a)>=0) ? (a) : -(a)) +# define ABS(a) (((a)>=0) ? (a) : -(a)) #endif /* sign of argument */ #ifndef SIGN -# define SIGN(a) ((a)>0 ? 1 : (a)<0 ? -1 : 0) +# define SIGN(a) ((a)>0 ? 1 : (a)<0 ? -1 : 0) #endif /* maximum of three values */ #ifndef MAX3 -# define MAX3(a,b,c) MAX(MAX(a,b),c) +# define MAX3(a,b,c) MAX(MAX(a,b),c) #endif /* @@ -113,29 +114,6 @@ typedef struct { } haddr_t; /* - * We try to use lseek64() and fseek64() if they're available, but they're - * not Posix and thus take different arguments on different systems. These - * macros attempt to overcome those problems. - */ -#ifdef HAVE_LSEEK64 -# ifdef _MIPS_SZLONG - /* SGI systems */ -# if (_MIPS_SZLONG == 64) -# define OFF64_SET(VAR,VAL) VAR=VAL -# elif defined(_LONGLONG) -# define OFF64_SET(VAR,VAL) VAR=VAL -# else -# define OFF64_SET(VAR,VAL) (VAR.hi32=VAL>>32, \ - VAR.lo32=(int)(VAL & 0xffffffff), \ - VAL) -# endif -# else -# warn "HAVE_LSEEK64 has been turned off" -# undef HAVE_LSEEK64 -# endif -#endif - -/* * Some compilers have problems declaring auto variables that point * to string constants. Use the CONSTR() macro so it's easy to fix * those compilers. diff --git a/src/Makefile.in b/src/Makefile.in index 249e4d7..c9e4f55 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -48,8 +48,9 @@ PRIVATE_HDR=H5private.h H5Aprivate.h H5ACprivate.h H5Bprivate.h \ H5Tinit.c: H5detect $(RUNTEST) ./H5detect >H5Tinit.c +# no $(LIB) in the action below since that's being made now. H5detect: H5detect.o - $(CC) $(CFLAGS) -o $@ H5detect.o $(LIBS) # no $(LIB) which is being made + $(CC) $(CFLAGS) -o $@ H5detect.o $(LIBS) # How to build the programs... debug: debug.o $(LIB) |