summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure10
-rw-r--r--configure.in4
-rw-r--r--hl/tools/gif2h5/Makefile.in19
-rw-r--r--src/H5FD.c26
-rw-r--r--src/H5FDstdio.c102
-rw-r--r--src/H5L.c1
-rw-r--r--src/H5config.h.in6
-rw-r--r--test/Makefile.am6
-rw-r--r--test/Makefile.in6
-rw-r--r--test/big.c50
-rw-r--r--test/vfd.c11
11 files changed, 181 insertions, 60 deletions
diff --git a/configure b/configure
index ed7cf05..b5ad69a 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.in Id: configure.in 13476 2007-03-08 20:09:19Z hdftest .
+# From configure.in Id: configure.in 13523 2007-03-16 23:26:30Z acheng .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.60 for HDF5 1.8.0-alpha6snap3.
#
@@ -26709,7 +26709,9 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(exit $ac_status); }; }; then
-for ac_func in lseek64 fseek64
+
+
+for ac_func in lseek64 fseek64 fseeko ftello
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -26830,8 +26832,8 @@ else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- { echo "$as_me:$LINENO: result: skipping test for lseek64() and fseek64()" >&5
-echo "${ECHO_T}skipping test for lseek64() and fseek64()" >&6; }
+ { echo "$as_me:$LINENO: result: skipping test for lseek64(), fseek64(), fseeko(), and ftello" >&5
+echo "${ECHO_T}skipping test for lseek64(), fseek64(), fseeko(), and ftello" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
diff --git a/configure.in b/configure.in
index dc9efc2..10900c7 100644
--- a/configure.in
+++ b/configure.in
@@ -1172,8 +1172,8 @@ esac
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()])])
+ [AC_CHECK_FUNCS([lseek64 fseek64 fseeko ftello])],
+ [AC_MSG_RESULT([skipping test for lseek64(), fseek64(), fseeko(), and ftello])])
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/stat.h>],
diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in
index bf58dac..41b7611 100644
--- a/hl/tools/gif2h5/Makefile.in
+++ b/hl/tools/gif2h5/Makefile.in
@@ -56,7 +56,7 @@ host_triplet = @host@
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/config/commence.am \
$(top_srcdir)/config/conclude.am
-bin_PROGRAMS = gif2h5$(EXEEXT) h52gif$(EXEEXT)
+bin_PROGRAMS = gif2h5$(EXEEXT) h52gif$(EXEEXT) h52gifgentst$(EXEEXT)
subdir = hl/tools/gif2h5
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
@@ -83,6 +83,11 @@ h52gif_OBJECTS = $(am_h52gif_OBJECTS)
h52gif_LDADD = $(LDADD)
h52gif_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
$(am__DEPENDENCIES_3)
+am_h52gifgentst_OBJECTS = h52gifgentst.$(OBJEXT)
+h52gifgentst_OBJECTS = $(am_h52gifgentst_OBJECTS)
+h52gifgentst_LDADD = $(LDADD)
+h52gifgentst_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/bin/depcomp
am__depfiles_maybe = depfiles
@@ -94,8 +99,9 @@ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(gif2h5_SOURCES) $(h52gif_SOURCES)
-DIST_SOURCES = $(gif2h5_SOURCES) $(h52gif_SOURCES)
+SOURCES = $(gif2h5_SOURCES) $(h52gif_SOURCES) $(h52gifgentst_SOURCES)
+DIST_SOURCES = $(gif2h5_SOURCES) $(h52gif_SOURCES) \
+ $(h52gifgentst_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -338,8 +344,9 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Include src and tools/lib directories
INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src
-gif2h5_SOURCES = gif2hdf.c gif2mem.c decompress.c gifread.c writehdf.c
+gif2h5_SOURCES = gif2hdf.c gif2mem.c decompress.c gifread.c writehdf.c
h52gif_SOURCES = hdf2gif.c hdfgifwr.c readhdf.c
+h52gifgentst_SOURCES = h52gifgentst.c
# Programs all depend on the hdf5 library, the tools library, and the HL
# library.
@@ -428,6 +435,9 @@ gif2h5$(EXEEXT): $(gif2h5_OBJECTS) $(gif2h5_DEPENDENCIES)
h52gif$(EXEEXT): $(h52gif_OBJECTS) $(h52gif_DEPENDENCIES)
@rm -f h52gif$(EXEEXT)
$(LINK) $(h52gif_LDFLAGS) $(h52gif_OBJECTS) $(h52gif_LDADD) $(LIBS)
+h52gifgentst$(EXEEXT): $(h52gifgentst_OBJECTS) $(h52gifgentst_DEPENDENCIES)
+ @rm -f h52gifgentst$(EXEEXT)
+ $(LINK) $(h52gifgentst_LDFLAGS) $(h52gifgentst_OBJECTS) $(h52gifgentst_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -439,6 +449,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif2hdf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif2mem.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifread.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h52gifgentst.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hdf2gif.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hdfgifwr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readhdf.Po@am__quote@
diff --git a/src/H5FD.c b/src/H5FD.c
index d1cb7c1..cb15467 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -1535,11 +1535,11 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
if(type != H5FD_MEM_DRAW) {
/* Handle metadata differently from "raw" data */
if((ret_value = H5FD_alloc_metadata(file, type, dxpl_id, size)) == HADDR_UNDEF)
- HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't allocate for metadata")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate for metadata")
} else {
/* Allocate "raw" data */
if((ret_value = H5FD_alloc_raw(file, type, dxpl_id, size)) == HADDR_UNDEF)
- HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't allocate for raw data")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate for raw data")
}
done:
@@ -1857,7 +1857,8 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
*/
if(size >= file->def_meta_block_size) {
/* Allocate more room for this new block the regular way */
- new_meta = H5FD_real_alloc(file, type, dxpl_id, size);
+ if(HADDR_UNDEF==(new_meta = H5FD_real_alloc(file, type, dxpl_id, size)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate metadata block")
/*
* Check if the new metadata is at the end of the current
@@ -1879,8 +1880,9 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
}
} else {
/* Allocate another metadata block */
- new_meta = H5FD_real_alloc(file, H5FD_MEM_DEFAULT, dxpl_id,
- file->def_meta_block_size);
+ if(HADDR_UNDEF==(new_meta = H5FD_real_alloc(file, H5FD_MEM_DEFAULT, dxpl_id,
+ file->def_meta_block_size)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate metadata block")
/*
* Check if the new metadata is at the end of the current
@@ -1916,7 +1918,8 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
}
} else {
/* Allocate data the regular way */
- ret_value = H5FD_real_alloc(file, type, dxpl_id, size);
+ if(HADDR_UNDEF==(ret_value = H5FD_real_alloc(file, type, dxpl_id, size)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate metadata block")
}
done:
@@ -1970,7 +1973,8 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
/* Check if the block asked for is too large for the "small data" block */
if(size >= file->def_sdata_block_size) {
/* Allocate more room for this new block the regular way */
- new_data = H5FD_real_alloc(file, type, dxpl_id, size);
+ if(HADDR_UNDEF==(new_data = H5FD_real_alloc(file, type, dxpl_id, size)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate raw data block")
/*
* Check if the new raw data is at the end of the current
@@ -1992,8 +1996,9 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
}
} else {
/* Allocate another "small data" block */
- new_data = H5FD_real_alloc(file, type, dxpl_id,
- file->def_sdata_block_size);
+ if(HADDR_UNDEF==(new_data = H5FD_real_alloc(file, type, dxpl_id,
+ file->def_sdata_block_size)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate raw data block")
/*
* Check if the new raw data is at the end of the current
@@ -2032,7 +2037,8 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
}
} else {
/* Allocate data the regular way */
- ret_value = H5FD_real_alloc(file, type, dxpl_id, size);
+ if(HADDR_UNDEF==(ret_value = H5FD_real_alloc(file, type, dxpl_id, size)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate raw data block")
}
done:
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c
index e299311..87eb1dd 100644
--- a/src/H5FDstdio.c
+++ b/src/H5FDstdio.c
@@ -28,6 +28,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <errno.h>
/* Disable certain warnings in PC-Lint: */
/*lint --emacro( {534, 830}, H5P_FILE_ACCESS) */
@@ -113,6 +114,18 @@ typedef struct H5FD_stdio_t {
#endif
} H5FD_stdio_t;
+#ifdef H5_HAVE_LSEEK64
+# define file_offset_t off64_t
+# define file_truncate ftruncate64
+#elif defined (WIN32) && !defined(__MWERKS__)
+# /*MSVC*/
+# define file_offset_t __int64
+# define file_truncate _chsize
+#else
+# define file_offset_t off_t
+# define file_truncate ftruncate
+#endif
+
/*
* These macros check for overflow of various quantities. These macros
* assume that file_offset_t is signed and haddr_t and size_t are unsigned.
@@ -135,17 +148,8 @@ typedef struct H5FD_stdio_t {
#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \
HADDR_UNDEF==(A)+(Z) || (file_offset_t)((A)+(Z))<(file_offset_t)(A))
-#ifdef H5_HAVE_LSEEK64
-# define file_offset_t off64_t
-# define file_truncate ftruncate64
-#elif defined (WIN32) && !defined(__MWERKS__)
-# /*MSVC*/
-# define file_offset_t __int64
-# define file_truncate _chsize
-#else
-# define file_offset_t off_t
-# define file_truncate ftruncate
-#endif
+/* Define big file as 2GB */
+#define BIG_FILE 0x80000000UL
/* Prototypes */
static H5FD_t *H5FD_stdio_open(const char *name, unsigned flags,
@@ -153,6 +157,7 @@ static H5FD_t *H5FD_stdio_open(const char *name, unsigned flags,
static herr_t H5FD_stdio_close(H5FD_t *lf);
static int H5FD_stdio_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
static herr_t H5FD_stdio_query(const H5FD_t *_f1, unsigned long *flags);
+static haddr_t H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
static haddr_t H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
static herr_t H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
static haddr_t H5FD_stdio_get_eof(const H5FD_t *_file);
@@ -181,7 +186,7 @@ static const H5FD_class_t H5FD_stdio_g = {
H5FD_stdio_close, /*close */
H5FD_stdio_cmp, /*cmp */
H5FD_stdio_query, /*query */
- NULL, /*alloc */
+ H5FD_stdio_alloc, /*alloc */
NULL, /*free */
H5FD_stdio_get_eoa, /*get_eoa */
H5FD_stdio_set_eoa, /*set_eoa */
@@ -372,10 +377,18 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id,
file->op = H5FD_STDIO_OP_SEEK;
file->pos = HADDR_UNDEF;
file->write_access=write_access; /* Note the write_access for later */
- if(fseek(file->fp, (long)0, SEEK_END) < 0) {
+#ifdef H5_HAVE_FSEEKO
+ if(fseeko(file->fp, (off_t)0, SEEK_END) < 0) {
+#else
+ if(fseek(file->fp, (long)0L, SEEK_END) < 0) {
+#endif
file->op = H5FD_STDIO_OP_UNKNOWN;
} else {
+#ifdef H5_HAVE_FTELLO
+ off_t x = ftello (file->fp);
+#else
long x = ftell (file->fp);
+#endif
assert (x>=0);
file->eof = (haddr_t)x;
}
@@ -525,6 +538,61 @@ H5FD_stdio_query(const H5FD_t *_f, unsigned long *flags /* out */)
/*-------------------------------------------------------------------------
+ * Function: H5FD_stdio_alloc
+ *
+ * Purpose: Allocates file memory. If fseeko isn't available, makes
+ * sure the file size isn't bigger than 2GB because the
+ * parameter OFFSET of fseek is of the type LONG INT, limiting
+ * the file size to 2GB.
+ *
+ * Return: Success: Address of new memory
+ *
+ * Failure: HADDR_UNDEF
+ *
+ * Programmer: Raymond Lu
+ * 30 March 2007
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static haddr_t
+H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl_id, hsize_t size)
+{
+ H5FD_stdio_t *file = (H5FD_stdio_t*)_file;
+ haddr_t addr;
+ static const char *func="H5FD_stdio_alloc"; /* Function Name for error reporting */
+ haddr_t ret_value; /* Return value */
+
+ /* Clear the error stack */
+ H5Eclear_stack(H5E_DEFAULT);
+
+ /* Compute the address for the block to allocate */
+ addr = file->eoa;
+
+ /* Check if we need to align this block */
+ if(size>=file->pub.threshold) {
+ /* Check for an already aligned block */
+ if(addr%file->pub.alignment!=0)
+ addr=((addr/file->pub.alignment)+1)*file->pub.alignment;
+ } /* end if */
+
+#ifndef H5_HAVE_FSEEKO
+ /* If fseeko isn't available, big files (>2GB) won't be supported. */
+ if(addr+size>BIG_FILE)
+ H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "can't write file bigger than 2GB because fseek isn't available", -1)
+#endif
+
+ file->eoa = addr+size;
+
+ /* Set return value */
+ ret_value=addr;
+
+ return(ret_value);
+} /* H5FD_stdio_alloc() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5FD_stdio_get_eoa
*
* Purpose: Gets the end-of-address marker for the file. The EOA marker
@@ -727,7 +795,11 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz
*/
if (!(file->op == H5FD_STDIO_OP_READ || file->op==H5FD_STDIO_OP_SEEK) ||
file->pos != addr) {
+#ifdef H5_HAVE_FSEEKO
+ if (fseeko(file->fp, (off_t)addr, SEEK_SET) < 0) {
+#else
if (fseek(file->fp, (long)addr, SEEK_SET) < 0) {
+#endif
file->op = H5FD_STDIO_OP_UNKNOWN;
file->pos = HADDR_UNDEF;
H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "fseek failed", -1)
@@ -817,7 +889,11 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
*/
if ((file->op != H5FD_STDIO_OP_WRITE && file->op != H5FD_STDIO_OP_SEEK) ||
file->pos != addr) {
+#ifdef H5_HAVE_FSEEKO
+ if (fseeko(file->fp, (off_t)addr, SEEK_SET) < 0) {
+#else
if (fseek(file->fp, (long)addr, SEEK_SET) < 0) {
+#endif
file->op = H5FD_STDIO_OP_UNKNOWN;
file->pos = HADDR_UNDEF;
H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "fseek failed", -1)
diff --git a/src/H5L.c b/src/H5L.c
index 1a78f55..79d28da 100644
--- a/src/H5L.c
+++ b/src/H5L.c
@@ -855,6 +855,7 @@ H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id)
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(H5Lexists, FAIL)
+ H5TRACE3("e", "i*si", loc_id, name, lapl_id);
/* Check arguments */
if(H5G_loc(loc_id, &loc))
diff --git a/src/H5config.h.in b/src/H5config.h.in
index 2804109..96c6520 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -100,9 +100,15 @@
/* Define to 1 if you have the `fseek64' function. */
#undef HAVE_FSEEK64
+/* Define to 1 if you have the `fseeko' function. */
+#undef HAVE_FSEEKO
+
/* Define to 1 if you have the `fstat64' function. */
#undef HAVE_FSTAT64
+/* Define to 1 if you have the `ftello' function. */
+#undef HAVE_FTELLO
+
/* Define if the compiler understand the __FUNCTION__ keyword */
#undef HAVE_FUNCTION
diff --git a/test/Makefile.am b/test/Makefile.am
index f52d63f..d32d856 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -106,13 +106,13 @@ CHECK_CLEANFILES+=cmpd_dset.h5 compact_dataset.h5 dataset.h5 extend.h5 istore.h5
tfile[1-4].h5 th5s[1-3].h5 lheap.h5 fheap.h5 ohdr.h5 stab.h5 \
extern_[1-3].h5 extern_[1-4][ab].raw gheap[0-4].h5 dt_arith[1-2]\
links.h5 links[1-3].h5 big.data big[0-9][0-9][0-9][0-9][0-9].h5 \
- dtypes[1-8].h5 dt_arith[1-2].h5 tattr.h5 tselect.h5 mtime.h5 \
- unlink.h5 unicode.h5 \
+ stdio.h5 dtypes[1-8].h5 dt_arith[1-2].h5 tattr.h5 tselect.h5 \
+ mtime.h5 unlink.h5 unicode.h5 \
fillval_[0-9].h5 fillval.raw mount_[0-9].h5 testmeta.h5 ttime.h5 \
trefer[1-3].h5 tvltypes.h5 tvlstr.h5 tvlstr2.h5 flush.h5 \
enum1.h5 titerate.h5 ttsafe.h5 tarray1.h5 tgenprop.h5 \
tmisc[0-9]*.h5 set_extent_read.h5 set_extent_create.h5 \
- getname.h5 getname[1-3].h5 sec2_file.h5 \
+ getname.h5 getname[1-3].h5 sec2_file.h5 direct_file.h5 \
family_file000[0-3][0-9].h5 multi_file-[rs].h5 core_file \
new_move_[ab].h5 ntypes.h5 dangle.h5 error_test.h5 err_compat.h5 \
dtransform.h5 test_filters.h5 get_file_name.h5 tstint[1-2].h5 \
diff --git a/test/Makefile.in b/test/Makefile.in
index e282369..59dea0b 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -602,15 +602,15 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog cmpd_dset.h5 \
tfile[1-4].h5 th5s[1-3].h5 lheap.h5 fheap.h5 ohdr.h5 stab.h5 \
extern_[1-3].h5 extern_[1-4][ab].raw gheap[0-4].h5 \
dt_arith[1-2] links.h5 links[1-3].h5 big.data \
- big[0-9][0-9][0-9][0-9][0-9].h5 dtypes[1-8].h5 \
+ big[0-9][0-9][0-9][0-9][0-9].h5 stdio.h5 dtypes[1-8].h5 \
dt_arith[1-2].h5 tattr.h5 tselect.h5 mtime.h5 unlink.h5 \
unicode.h5 fillval_[0-9].h5 fillval.raw mount_[0-9].h5 \
testmeta.h5 ttime.h5 trefer[1-3].h5 tvltypes.h5 tvlstr.h5 \
tvlstr2.h5 flush.h5 enum1.h5 titerate.h5 ttsafe.h5 tarray1.h5 \
tgenprop.h5 tmisc[0-9]*.h5 set_extent_read.h5 \
set_extent_create.h5 getname.h5 getname[1-3].h5 sec2_file.h5 \
- family_file000[0-3][0-9].h5 multi_file-[rs].h5 core_file \
- new_move_[ab].h5 ntypes.h5 dangle.h5 error_test.h5 \
+ direct_file.h5 family_file000[0-3][0-9].h5 multi_file-[rs].h5 \
+ core_file new_move_[ab].h5 ntypes.h5 dangle.h5 error_test.h5 \
err_compat.h5 dtransform.h5 test_filters.h5 get_file_name.h5 \
tstint[1-2].h5 unlink_chunked.h5 btree2.h5 objcopy_src.h5 \
objcopy_dst.h5 objcopy_ext.dat trefer1.h5 trefer2.h5
diff --git a/test/big.c b/test/big.c
index 990e0b1..aabc7b7 100644
--- a/test/big.c
+++ b/test/big.c
@@ -21,6 +21,7 @@
const char *FILENAME[] = {
"big",
+ "stdio",
NULL
};
@@ -122,7 +123,7 @@ is_sparse(void)
if ((fd=HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, 0666))<0) return 0;
if (HDlseek(fd, (off_t)(1024*1024), SEEK_SET)!=1024*1024) return 0;
- if (5!=HDwrite(fd, "hello", 5)) return 0;
+ if (5!=HDwrite(fd, "hello", (size_t)5)) return 0;
if (HDclose(fd)<0) return 0;
if (HDstat("x.h5", &sb)<0) return 0;
if (HDunlink("x.h5")<0) return 0;
@@ -176,7 +177,7 @@ enough_room(hid_t fapl)
if ((off_t)size != HDlseek(fd[i], (off_t)size, SEEK_SET)) {
goto done;
}
- if (1!=HDwrite(fd[i], "X", 1)) {
+ if (1!=HDwrite(fd[i], "X", (size_t)1)) {
goto done;
}
}
@@ -213,17 +214,16 @@ enough_room(hid_t fapl)
*-------------------------------------------------------------------------
*/
static int
-writer (hid_t fapl, int wrt_n)
+writer (char* filename, hid_t fapl, int wrt_n)
{
hsize_t size1[4] = {8, 1024, 1024, 1024};
hsize_t size2[1] = {GB8LL};
hsize_t hs_start[1];
hsize_t hs_size[1];
hid_t file=-1, space1=-1, space2=-1, mem_space=-1, d1=-1, d2=-1;
- int *buf = malloc (sizeof(int) * WRT_SIZE);
+ int *buf = (int*)malloc (sizeof(int) * WRT_SIZE);
int i, j;
FILE *out = fopen(DNAME, "w");
- char filename[1024];
hid_t dcpl;
TESTING("large dataset write");
@@ -232,7 +232,6 @@ writer (hid_t fapl, int wrt_n)
* We might be on a machine that has 32-bit files, so create an HDF5 file
* which is a family of files. Each member of the family will be 1GB
*/
- h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) {
goto error;
}
@@ -324,22 +323,20 @@ writer (hid_t fapl, int wrt_n)
*-------------------------------------------------------------------------
*/
static int
-reader (hid_t fapl)
+reader (char *filename, hid_t fapl)
{
FILE *script = NULL;
hid_t file=-1, mspace=-1, fspace=-1, d2=-1;
char ln[128], *s;
hsize_t hs_offset[1];
hsize_t hs_size[1] = {WRT_SIZE};
- int *buf = malloc (sizeof(int) * WRT_SIZE);
+ int *buf = (int*)malloc (sizeof(int) * WRT_SIZE);
int i, j, zero, wrong, nerrors=0;
- char filename[1024];
/* Open script file */
script = fopen (DNAME, "r");
/* Open HDF5 file */
- h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if ((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0) goto error;
/* Open the dataset */
@@ -350,7 +347,7 @@ reader (hid_t fapl)
if ((mspace = H5Screate_simple (1, hs_size, hs_size))<0) goto error;
/* Read each region */
- while (fgets (ln, sizeof(ln), script)) {
+ while (fgets (ln, (int)sizeof(ln), script)) {
if ('#'!=ln[0]) break;
i = (int)strtol (ln+1, &s, 10);
hs_offset[0] = HDstrtoll (s, NULL, 0);
@@ -463,6 +460,7 @@ main (int ac, char **av)
hsize_t family_size_def; /* default family file size */
double family_size_def_dbl; /* default family file size */
int cflag=1; /* check file system before test */
+ char filename[1024];
/* parameters setup */
family_size_def = FAMILY_SIZE;
@@ -501,7 +499,8 @@ main (int ac, char **av)
h5_reset();
fapl = h5_fileaccess();
- /* The file driver must be the family driver */
+ /* Test big file with the family driver */
+ puts("Testing big file with the Family Driver ");
if (H5FD_FAMILY!=H5Pget_driver(fapl)) {
HDfprintf(stdout,
"Changing file drivers to the family driver, %Hu bytes each\n",
@@ -546,10 +545,29 @@ main (int ac, char **av)
}
}
- /* Do the test */
- if (writer(fapl, WRT_N)) goto error;
- if (reader(fapl)) goto error;
- puts("All big tests passed.");
+ /* Do the test with the Family Driver */
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+
+ if (writer(filename, fapl, WRT_N)) goto error;
+ if (reader(filename, fapl)) goto error;
+
+ /* Clean up the test file */
+ if (h5_cleanup(FILENAME, fapl)) remove(DNAME);
+ puts("Test passed with the Family Driver.");
+
+
+ /* Test big file with the STDIO driver */
+ puts("\nTesting big file with the STDIO Driver ");
+
+ fapl = h5_fileaccess();
+ if(H5Pset_fapl_stdio(fapl)<0)
+
+ HDmemset(filename, 0, sizeof(filename));
+ h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
+
+ if (writer(filename, fapl, WRT_N)) goto error;
+ if (reader(filename, fapl)) goto error;
+ puts("Test passed with the STDIO Driver.");
quit:
/* End with normal exit code */
diff --git a/test/vfd.c b/test/vfd.c
index dd79e32..8f11364 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -22,7 +22,7 @@
#include "h5test.h"
-#define KB 1024
+#define KB 1024U
#define FAMILY_NUMBER 4
#define FAMILY_SIZE (1*KB)
#define FAMILY_SIZE2 (5*KB)
@@ -379,7 +379,7 @@ test_core(void)
/* Set property list and file name for CORE driver */
fapl = h5_fileaccess();
- if(H5Pset_fapl_core(fapl, CORE_INCREMENT, TRUE)<0)
+ if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE)<0)
TEST_ERROR;
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
@@ -418,7 +418,7 @@ test_core(void)
/* Open the file with backing store off for read and write.
* Changes won't be saved in file. */
- if(H5Pset_fapl_core(fapl, CORE_INCREMENT, FALSE)<0)
+ if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, FALSE)<0)
TEST_ERROR;
if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0)
@@ -480,7 +480,7 @@ test_core(void)
/* Open the file with backing store on for read and write.
* Changes will be saved in file. */
- if(H5Pset_fapl_core(fapl, CORE_INCREMENT, TRUE)<0)
+ if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE)<0)
TEST_ERROR;
if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0)
@@ -660,7 +660,7 @@ test_family(void)
hid_t access_fapl = -1;
char filename[1024];
char dname[]="dataset";
- int i, j;
+ unsigned int i, j;
int *fhandle=NULL, *fhandle2=NULL;
int buf[FAMILY_NUMBER][FAMILY_SIZE];
hsize_t dims[2]={FAMILY_NUMBER, FAMILY_SIZE};
@@ -719,6 +719,7 @@ test_family(void)
for(i=0; i<FAMILY_NUMBER; i++)
for(j=0; j<FAMILY_SIZE; j++)
buf[i][j] = i*10000+j;
+
if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0)
TEST_ERROR;