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/H5Fstdio.c | |
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/H5Fstdio.c')
-rw-r--r-- | src/H5Fstdio.c | 28 |
1 files changed, 22 insertions, 6 deletions
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; } /* |