summaryrefslogtreecommitdiffstats
path: root/test/hyperslab.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-04-07 15:34:16 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-04-07 15:34:16 (GMT)
commit68fa66bf8130d6a6e607e233da8cc61a154bf172 (patch)
treeb5a0e0120492c7bb9f935ab74f4cef97d6bbcbee /test/hyperslab.c
parent92571bbe1d77c74ddefeeba6ac0b2097593c058d (diff)
downloadhdf5-68fa66bf8130d6a6e607e233da8cc61a154bf172.zip
hdf5-68fa66bf8130d6a6e607e233da8cc61a154bf172.tar.gz
hdf5-68fa66bf8130d6a6e607e233da8cc61a154bf172.tar.bz2
[svn-r337] Changes since 19980403
---------------------- ./configure.in Moved setting of compiler warning switches earlier in the file. Turned on more warning switches to gcc. ./config/linux Prints a warning if the gcc version is less than 2.8.1 since that version has problems with register allocation for `long long'. ./html/Datatypes.html Documented sharing of data types between datasets. ./src/H5G.c ./src/H5Gpublic.h Implemented H5Gmove(), H5Glink() and H5Gunlink() for hard links. Still have soft links to do. ./src/H5AC.c ./src/H5ACprivate.h ./src/H5D.c ./src/H5E.c ./src/H5Eprivate.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5Gpkg.h ./src/H5Gprivate.h ./src/H5HG.c ./src/H5HL.c ./src/H5HLprivate.h ./src/H5I.c ./src/H5Iprivate.h ./src/H5MM.c ./src/H5MMprivate.h ./src/H5O.c ./src/H5Oefl.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5S.c ./src/H5Ssimp.c ./src/H5T.c ./src/H5Tconv.c ./src/H5Tprivate.h ./src/H5Tpublic.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5detect.c ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tstab.c Fixed comparisons between signed and unsigned values. Fixed warnings about unused function arguments.
Diffstat (limited to 'test/hyperslab.c')
-rw-r--r--test/hyperslab.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/test/hyperslab.c b/test/hyperslab.c
index 746be52..01e4fa6 100644
--- a/test/hyperslab.c
+++ b/test/hyperslab.c
@@ -45,13 +45,13 @@
static uintn
init_full(uint8 *array, size_t nx, size_t ny, size_t nz)
{
- int i, j, k;
+ size_t i, j, k;
uint8 acc = 128;
uintn total = 0;
- for (i = 0; i < nx; i++) {
- for (j = 0; j < ny; j++) {
- for (k = 0; k < nz; k++) {
+ for (i=0; i<nx; i++) {
+ for (j=0; j<ny; j++) {
+ for (k=0; k<nz; k++) {
total += acc;
*array++ = acc++;
}
@@ -77,22 +77,22 @@ init_full(uint8 *array, size_t nx, size_t ny, size_t nz)
static void
print_array(uint8 *array, size_t nx, size_t ny, size_t nz)
{
- int i, j, k;
+ size_t i, j, k;
- for (i = 0; i < nx; i++) {
- if (nz > 1) {
+ for (i=0; i<nx; i++) {
+ if (nz>1) {
printf("i=%d:\n", i);
} else {
printf("%03d:", i);
}
- for (j = 0; j < ny; j++) {
- if (nz > 1)
+ for (j=0; j<ny; j++) {
+ if (nz>1)
printf("%03d:", j);
- for (k = 0; k < nz; k++) {
+ for (k=0; k<nz; k++) {
printf(" %3d", *array++);
}
- if (nz > 1)
+ if (nz>1)
printf("\n");
}
printf("\n");
@@ -120,7 +120,7 @@ print_ref(size_t nx, size_t ny, size_t nz)
{
uint8 *array;
- array = H5MM_xcalloc(nx * ny * nz, sizeof(uint8));
+ array = H5MM_xcalloc((intn)(nx*ny*nz), sizeof(uint8));
printf("Reference array:\n");
init_full(array, nx, ny, nz);
@@ -154,7 +154,7 @@ test_fill(size_t nx, size_t ny, size_t nz,
size_t dst_offset[3]; /*offset of hyperslab in dest */
uintn ref_value; /*reference value */
uintn acc; /*accumulator */
- int i, j, k, dx, dy, dz; /*counters */
+ size_t i, j, k, dx, dy, dz; /*counters */
size_t u, v, w;
int ndims; /*hyperslab dimensionality */
char dim[64], s[256]; /*temp string */
@@ -183,7 +183,7 @@ test_fill(size_t nx, size_t ny, size_t nz,
fflush(stdout);
/* Allocate array */
- dst = H5MM_xcalloc(nx * ny * nz, 1);
+ dst = H5MM_xcalloc(1, nx*ny*nz);
init_full(dst, nx, ny, nz);
for (i = 0; i < nx; i += di) {
@@ -321,7 +321,7 @@ test_copy(int mode,
size_t src_offset[3]; /*offset of hyperslab in source */
uintn ref_value; /*reference value */
uintn acc; /*accumulator */
- int i, j, k, dx, dy, dz; /*counters */
+ size_t i, j, k, dx, dy, dz; /*counters */
size_t u, v, w;
int ndims; /*hyperslab dimensionality */
char dim[64], s[256]; /*temp string */
@@ -380,8 +380,8 @@ test_copy(int mode,
/*
* Allocate arrays
*/
- src = H5MM_xcalloc(nx * ny * nz, 1);
- dst = H5MM_xcalloc(nx * ny * nz, 1);
+ src = H5MM_xcalloc(1, nx*ny*nz);
+ dst = H5MM_xcalloc(1, nx*ny*nz);
init_full(src, nx, ny, nz);
for (i = 0; i < nx; i += di) {
@@ -571,9 +571,9 @@ test_copy(int mode,
*-------------------------------------------------------------------------
*/
static herr_t
-test_multifill(int nx)
+test_multifill(size_t nx)
{
- int i, j;
+ size_t i, j;
size_t size;
ssize_t src_stride;
ssize_t dst_stride;
@@ -690,7 +690,7 @@ test_endian(size_t nx)
ssize_t src_stride[2]; /*source strides */
ssize_t dst_stride[2]; /*destination strides */
size_t size[2]; /*size vector */
- int i, j;
+ size_t i, j;
printf("%-70s", "Testing endian conversion by stride");
fflush(stdout);
@@ -698,7 +698,7 @@ test_endian(size_t nx)
/* Initialize arrays */
src = H5MM_xmalloc(nx * 4);
init_full(src, nx, 4, 1);
- dst = H5MM_xcalloc(nx, 4);
+ dst = H5MM_xcalloc(4, nx);
/* Initialize strides */
src_stride[0] = 0;
@@ -766,7 +766,7 @@ test_transpose(size_t nx, size_t ny)
{
intn *src = NULL;
intn *dst = NULL;
- int i, j;
+ size_t i, j;
ssize_t src_stride[2], dst_stride[2];
size_t size[2];
char s[256];
@@ -783,7 +783,7 @@ test_transpose(size_t nx, size_t ny)
src[i * ny + j] = (intn)(i * ny + j);
}
}
- dst = H5MM_xcalloc(nx * ny, sizeof(*dst));
+ dst = H5MM_xcalloc((intn)(nx*ny), sizeof(*dst));
/* Build stride info */
size[0] = nx;
@@ -873,7 +873,7 @@ test_sub_super(size_t nx, size_t ny)
ssize_t src_stride[4]; /*source stride info */
ssize_t dst_stride[4]; /*destination stride info */
size_t size[4]; /*number of sample points */
- int i, j;
+ size_t i, j;
char s[256];
sprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ",
@@ -885,8 +885,8 @@ test_sub_super(size_t nx, size_t ny)
/* Initialize */
full = H5MM_xmalloc(4 * nx * ny);
init_full(full, 2 * nx, 2 * ny, 1);
- half = H5MM_xcalloc(nx * ny, 1);
- twice = H5MM_xcalloc(4 * nx * ny, 1);
+ half = H5MM_xcalloc(1, nx*ny);
+ twice = H5MM_xcalloc(1, 4*nx*ny);
/* Setup */
size[0] = nx;