diff options
-rwxr-xr-x | bin/release | 4 | ||||
-rw-r--r-- | config/linux | 5 | ||||
-rwxr-xr-x | configure | 163 | ||||
-rw-r--r-- | configure.in | 7 | ||||
-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 |
12 files changed, 207 insertions, 130 deletions
diff --git a/bin/release b/bin/release index 3fe118a..dc48b59 100755 --- a/bin/release +++ b/bin/release @@ -210,9 +210,9 @@ EOF if (-d "CVS") { my $tag = $ver; $tag =~ s/\./-/g; - print "Tag CVS sources with \"$tag\"? [y] "; + print "Tag CVS sources with \"$tag\"? [n] "; chomp ($_ = <STDIN>); - if (!$_ || $_ eq 'y') { + if ($_ eq 'y') { print "Tagging CVS sources...\n"; my $status = system "cvs tag -R $tag"; die "cvs tag failed" if $status >> 8; diff --git a/config/linux b/config/linux index 3f10d92..ab397a1 100644 --- a/config/linux +++ b/config/linux @@ -33,9 +33,8 @@ # $debug $warn -DH5F_LOW_DFLT=H5F_LOW_SEC2 # -# Unconditionally set the compiler to gcc since the following flags -# only apply to that compiler. -CC=gcc +# The following flags only apply to the gcc compiler. +CC=${CC:-gcc} @@ -1149,7 +1149,7 @@ fi -for ac_func in lseek64 fseek64 getpwuid gethostname +for ac_func in getpwuid gethostname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:1156: checking for $ac_func" >&5 @@ -1205,16 +1205,89 @@ fi done +cat > conftest.$ac_ext <<EOF +#line 1210 "configure" +#include "confdefs.h" +#include<sys/types.h> +int main() { +off64_t n = 0; +; return 0; } +EOF +if { (eval echo configure:1217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + for ac_func in lseek64 fseek64 +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1222: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1227 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "$ac_t""skipping test for lseek64() and fseek64()" 1>&6 +fi +rm -f conftest* + echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:1211: checking whether byte ordering is bigendian" >&5 +echo "configure:1284: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext <<EOF -#line 1218 "configure" +#line 1291 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -1225,11 +1298,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext <<EOF -#line 1233 "configure" +#line 1306 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -1240,7 +1313,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -1260,7 +1333,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 1264 "configure" +#line 1337 "configure" #include "confdefs.h" main () { /* Are we little or big endian? From Harbison&Steele. */ @@ -1273,7 +1346,7 @@ main () { exit (u.c[sizeof (long) - 1] == 1); } EOF -if { (eval echo configure:1277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -1297,7 +1370,7 @@ EOF fi echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:1301: checking size of short" >&5 +echo "configure:1374: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1305,7 +1378,7 @@ else ac_cv_sizeof_short=2 else cat > conftest.$ac_ext <<EOF -#line 1309 "configure" +#line 1382 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -1316,7 +1389,7 @@ main() exit(0); } EOF -if { (eval echo configure:1320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -1336,7 +1409,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:1340: checking size of int" >&5 +echo "configure:1413: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1344,7 +1417,7 @@ else ac_cv_sizeof_int=4 else cat > conftest.$ac_ext <<EOF -#line 1348 "configure" +#line 1421 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -1355,7 +1428,7 @@ main() exit(0); } EOF -if { (eval echo configure:1359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -1375,7 +1448,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:1379: checking size of long" >&5 +echo "configure:1452: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1383,7 +1456,7 @@ else ac_cv_sizeof_long=4 else cat > conftest.$ac_ext <<EOF -#line 1387 "configure" +#line 1460 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -1394,7 +1467,7 @@ main() exit(0); } EOF -if { (eval echo configure:1398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -1414,7 +1487,7 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:1418: checking size of long long" >&5 +echo "configure:1491: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1422,7 +1495,7 @@ else ac_cv_sizeof_long_long=8 else cat > conftest.$ac_ext <<EOF -#line 1426 "configure" +#line 1499 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -1433,7 +1506,7 @@ main() exit(0); } EOF -if { (eval echo configure:1437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -1453,7 +1526,7 @@ EOF echo $ac_n "checking size of float""... $ac_c" 1>&6 -echo "configure:1457: checking size of float" >&5 +echo "configure:1530: checking size of float" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1461,7 +1534,7 @@ else ac_cv_sizeof_float=4 else cat > conftest.$ac_ext <<EOF -#line 1465 "configure" +#line 1538 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -1472,7 +1545,7 @@ main() exit(0); } EOF -if { (eval echo configure:1476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_float=`cat conftestval` else @@ -1492,7 +1565,7 @@ EOF echo $ac_n "checking size of double""... $ac_c" 1>&6 -echo "configure:1496: checking size of double" >&5 +echo "configure:1569: checking size of double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1500,7 +1573,7 @@ else ac_cv_sizeof_double=8 else cat > conftest.$ac_ext <<EOF -#line 1504 "configure" +#line 1577 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -1511,7 +1584,7 @@ main() exit(0); } EOF -if { (eval echo configure:1515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_double=`cat conftestval` else @@ -1535,12 +1608,12 @@ EOF echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1539: checking for working const" >&5 +echo "configure:1612: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1544 "configure" +#line 1617 "configure" #include "confdefs.h" int main() { @@ -1589,7 +1662,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1610,21 +1683,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1614: checking for inline" >&5 +echo "configure:1687: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 1621 "configure" +#line 1694 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:1628: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1651,16 +1724,16 @@ esac echo $ac_n "checking for __attribute__ extension""... $ac_c" 1>&6 -echo "configure:1655: checking for __attribute__ extension" >&5 +echo "configure:1728: checking for __attribute__ extension" >&5 cat > conftest.$ac_ext <<EOF -#line 1657 "configure" +#line 1730 "configure" #include "confdefs.h" int main() { int __attribute__((unused)) f(void){return 1;} ; return 0; } EOF -if { (eval echo configure:1664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_ATTRIBUTE 1 @@ -1676,16 +1749,16 @@ fi rm -f conftest* echo $ac_n "checking for __FUNCTION__ extension""... $ac_c" 1>&6 -echo "configure:1680: checking for __FUNCTION__ extension" >&5 +echo "configure:1753: checking for __FUNCTION__ extension" >&5 cat > conftest.$ac_ext <<EOF -#line 1682 "configure" +#line 1755 "configure" #include "confdefs.h" int main() { int f(void){return __FUNCTION__;} ; return 0; } EOF -if { (eval echo configure:1689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1762: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_FUNCTION 1 @@ -1708,7 +1781,7 @@ if test "${enable_parallel+set}" = set; then fi echo $ac_n "checking for parallel support""... $ac_c" 1>&6 -echo "configure:1712: checking for parallel support" >&5; +echo "configure:1785: checking for parallel support" >&5; RUNTEST="" @@ -1734,7 +1807,7 @@ EOF CPPFLAGS="$CPPFLAGS $MPI_INC" CFLAGS="$CFLAGS $MPI_LIB" echo $ac_n "checking for main in -lmpi""... $ac_c" 1>&6 -echo "configure:1738: checking for main in -lmpi" >&5 +echo "configure:1811: checking for main in -lmpi" >&5 ac_lib_var=`echo mpi'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1742,14 +1815,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lmpi $LIBS" cat > conftest.$ac_ext <<EOF -#line 1746 "configure" +#line 1819 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:1753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1776,7 +1849,7 @@ else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking for main in -lmpio""... $ac_c" 1>&6 -echo "configure:1780: checking for main in -lmpio" >&5 +echo "configure:1853: checking for main in -lmpio" >&5 ac_lib_var=`echo mpio'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1784,14 +1857,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lmpio $LIBS" cat > conftest.$ac_ext <<EOF -#line 1788 "configure" +#line 1861 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:1795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else diff --git a/configure.in b/configure.in index a5a72fe..1686261 100644 --- a/configure.in +++ b/configure.in @@ -107,7 +107,12 @@ AC_TYPE_SIZE_T dnl ---------------------------------------------------------------------- dnl Check for functions. dnl -AC_CHECK_FUNCS(lseek64 fseek64 getpwuid gethostname) +AC_CHECK_FUNCS(getpwuid gethostname) + +AC_TRY_COMPILE([#include<sys/types.h>], + [off64_t n = 0;], + AC_CHECK_FUNCS(lseek64 fseek64), + AC_MSG_RESULT([skipping test for lseek64() and fseek64()])) dnl ---------------------------------------------------------------------- @@ -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) |