summaryrefslogtreecommitdiffstats
path: root/test/external.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-01-09 21:22:30 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-01-09 21:22:30 (GMT)
commit35bc545296209684a5c46db0cde11beb9403a4dc (patch)
tree98b5a037ed928085b98abc1fee71fc62f81073c1 /test/external.c
parent1290c4808d3e9890c765b1445f66b823c9026734 (diff)
downloadhdf5-35bc545296209684a5c46db0cde11beb9403a4dc.zip
hdf5-35bc545296209684a5c46db0cde11beb9403a4dc.tar.gz
hdf5-35bc545296209684a5c46db0cde11beb9403a4dc.tar.bz2
[svn-r3252] Purpose:
Code cleanup. Description: Fixed _lots_ (I mean _tons_) of warnings spit out by the gcc with the extra warnings. Including a few show-stoppers for compression on IRIX machines. Solution: Changed lots of variables' types to more sensible and consistent types, more range-checking, more variable typecasts, etc. Platforms tested: FreeBSD 4.2 (hawkwind), IRIX64-64 (modi4)
Diffstat (limited to 'test/external.c')
-rw-r--r--test/external.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/test/external.c b/test/external.c
index 0ea5498..810d5b8 100644
--- a/test/external.c
+++ b/test/external.c
@@ -98,7 +98,7 @@ test_1a(hid_t file)
/* Create the dataset */
if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
cur_size[0] = max_size[0] = 100;
- if (H5Pset_external(dcpl, "ext1.data", 0,
+ if (H5Pset_external(dcpl, "ext1.data", (off_t)0,
(hsize_t)(max_size[0]*sizeof(int)))<0) goto error;
if ((space = H5Screate_simple (1, cur_size, max_size))<0) goto error;
if ((dset = H5Dcreate (file, "dset1", H5T_NATIVE_INT, space, dcpl))<0)
@@ -177,7 +177,7 @@ test_1b(hid_t file)
TESTING("external storage is too small");
if ((dcpl = H5Pcreate (H5P_DATASET_CREATE))<0) goto error;
cur_size[0] = max_size[0] = 100;
- if (H5Pset_external(dcpl, "ext1.data", 0,
+ if (H5Pset_external(dcpl, "ext1.data", (off_t)0,
(hsize_t)(max_size[0]*sizeof(int)-1))<0) goto error;
if ((space = H5Screate_simple (1, cur_size, max_size))<0) goto error;
H5E_BEGIN_TRY {
@@ -234,7 +234,7 @@ test_1c(hid_t file)
if ((dcpl=H5Pcreate (H5P_DATASET_CREATE))<0) goto error;
cur_size[0] = 100;
max_size[0] = 200;
- if (H5Pset_external(dcpl, "ext1.data", 0,
+ if (H5Pset_external(dcpl, "ext1.data", (off_t)0,
(hsize_t)(max_size[0]*sizeof(int)))<0) goto error;
if ((space = H5Screate_simple (1, cur_size, max_size))<0) goto error;
if ((dset = H5Dcreate (file, "dset3", H5T_NATIVE_INT, space, dcpl))<0)
@@ -285,7 +285,7 @@ test_1d(hid_t file)
if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
cur_size[0] = 100;
max_size[0] = 200;
- if (H5Pset_external(dcpl, "ext1.data", 0,
+ if (H5Pset_external(dcpl, "ext1.data", (off_t)0,
(hsize_t)(max_size[0]*sizeof(int)-1))<0) goto error;
if ((space=H5Screate_simple(1, cur_size, max_size))<0) goto error;
H5E_BEGIN_TRY {
@@ -345,7 +345,7 @@ test_1e(hid_t file)
/* Create dataset */
if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_external(dcpl, "ext1.data", 0, H5F_UNLIMITED)<0) goto error;
+ if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED)<0) goto error;
cur_size[0] = 100;
max_size[0] = H5S_UNLIMITED;
if ((space=H5Screate_simple(1, cur_size, max_size))<0) goto error;
@@ -423,13 +423,13 @@ test_1f(hid_t file)
TESTING("multiple external files");
if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
cur_size[0] = max_size[0] = 100;
- if (H5Pset_external(dcpl, "ext1.data", 0,
+ if (H5Pset_external(dcpl, "ext1.data", (off_t)0,
(hsize_t)(max_size[0]*sizeof(int)/4))<0) goto error;
- if (H5Pset_external(dcpl, "ext2.data", 0,
+ if (H5Pset_external(dcpl, "ext2.data", (off_t)0,
(hsize_t)(max_size[0]*sizeof(int)/4))<0) goto error;
- if (H5Pset_external(dcpl, "ext3.data", 0,
+ if (H5Pset_external(dcpl, "ext3.data", (off_t)0,
(hsize_t)(max_size[0]*sizeof(int)/4))<0) goto error;
- if (H5Pset_external(dcpl, "ext4.data", 0,
+ if (H5Pset_external(dcpl, "ext4.data", (off_t)0,
(hsize_t)(max_size[0]*sizeof(int)/4))<0) goto error;
if ((space=H5Screate_simple(1, cur_size, max_size))<0) goto error;
if ((dset=H5Dcreate(file, "dset6", H5T_NATIVE_INT, space, dcpl))<0)
@@ -476,9 +476,9 @@ test_1g(void)
TESTING("external file following unlimited file");
if ((dcpl=H5Pcreate (H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_external(dcpl, "ext1.data", 0, H5F_UNLIMITED)<0) goto error;
+ if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED)<0) goto error;
H5E_BEGIN_TRY {
- status = H5Pset_external(dcpl, "ext2.data", 0, (hsize_t)100);
+ status = H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)100);
} H5E_END_TRY;
if (status>=0) {
FAILED();
@@ -528,9 +528,9 @@ test_1h(void)
TESTING("address overflow in external files");
if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_external(dcpl, "ext1.data", 0, H5F_UNLIMITED-1)<0) goto error;
+ if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED-1)<0) goto error;
H5E_BEGIN_TRY {
- status = H5Pset_external(dcpl, "ext2.data", 0, (hsize_t)100);
+ status = H5Pset_external(dcpl, "ext2.data", (off_t)0, (hsize_t)100);
} H5E_END_TRY;
if (status>=0) {
FAILED();
@@ -596,7 +596,7 @@ test_2 (hid_t fapl)
assert (fd>=0);
/* n = lseek (fd, (off_t)(i*10), SEEK_SET);
*/
- n = write(fd,temparray,i*10);
+ n = write(fd,temparray,(size_t)i*10);
assert (n>=0 && (size_t)n==i*10);
n = write (fd, part, sizeof(part));
assert (n==sizeof(part));
@@ -617,10 +617,10 @@ test_2 (hid_t fapl)
/* Create the dataset */
if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_external (dcpl, "extern_1a.raw", 0, (hsize_t)sizeof part)<0 ||
- H5Pset_external (dcpl, "extern_2a.raw", 10, (hsize_t)sizeof part)<0 ||
- H5Pset_external (dcpl, "extern_3a.raw", 20, (hsize_t)sizeof part)<0 ||
- H5Pset_external (dcpl, "extern_4a.raw", 30, (hsize_t)sizeof part)<0)
+ if (H5Pset_external (dcpl, "extern_1a.raw", (off_t)0, (hsize_t)sizeof part)<0 ||
+ H5Pset_external (dcpl, "extern_2a.raw", (off_t)10, (hsize_t)sizeof part)<0 ||
+ H5Pset_external (dcpl, "extern_3a.raw", (off_t)20, (hsize_t)sizeof part)<0 ||
+ H5Pset_external (dcpl, "extern_4a.raw", (off_t)30, (hsize_t)sizeof part)<0)
goto error;
cur_size = 100;
if ((space=H5Screate_simple (1, &cur_size, NULL))<0) goto error;
@@ -721,10 +721,10 @@ test_3 (hid_t fapl)
/* Create the external file list */
if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_external(dcpl, "extern_1b.raw", 0, (hsize_t)sizeof part)<0 ||
- H5Pset_external(dcpl, "extern_2b.raw", 10, (hsize_t)sizeof part)<0 ||
- H5Pset_external(dcpl, "extern_3b.raw", 20, (hsize_t)sizeof part)<0 ||
- H5Pset_external(dcpl, "extern_4b.raw", 30, H5F_UNLIMITED)<0)
+ if (H5Pset_external(dcpl, "extern_1b.raw", (off_t)0, (hsize_t)sizeof part)<0 ||
+ H5Pset_external(dcpl, "extern_2b.raw", (off_t)10, (hsize_t)sizeof part)<0 ||
+ H5Pset_external(dcpl, "extern_3b.raw", (off_t)20, (hsize_t)sizeof part)<0 ||
+ H5Pset_external(dcpl, "extern_4b.raw", (off_t)30, H5F_UNLIMITED)<0)
goto error;
/* Make sure the output files are fresh*/