summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2016-08-13 09:23:53 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2016-08-13 09:23:53 (GMT)
commitf40381b0eab242182a02b0bb97aed88b37095086 (patch)
tree600c15466f4bbb9576ccc78f82287e5e6c78612b /tools
parentae0b7490126e45e312b63a27b499e5a25e402f40 (diff)
downloadhdf5-f40381b0eab242182a02b0bb97aed88b37095086.zip
hdf5-f40381b0eab242182a02b0bb97aed88b37095086.tar.gz
hdf5-f40381b0eab242182a02b0bb97aed88b37095086.tar.bz2
[svn-r30285] Description:
More warning cleanups, bringing the build down to 25 unique types of warnings, with 550 warnings in 122 files (down from 28, 770, and 134). Tested on: MacOSX/64 10.11.5 (amazon) w/serial & parallel (h5committest forthcoming)
Diffstat (limited to 'tools')
-rw-r--r--tools/h5diff/h5diff_common.c9
-rw-r--r--tools/h5dump/h5dumpgentest.c20
-rw-r--r--tools/h5import/h5importtest.c16
-rw-r--r--tools/h5jam/h5jamgentest.c4
-rw-r--r--tools/lib/io_timer.c4
-rw-r--r--tools/misc/h5repart.c18
-rw-r--r--tools/misc/h5repart_gentest.c3
-rw-r--r--tools/perform/chunk.c18
-rw-r--r--tools/perform/iopipe.c18
-rw-r--r--tools/perform/overhead.c19
-rw-r--r--tools/perform/sio_engine.c112
11 files changed, 116 insertions, 125 deletions
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c
index 8a996d9..2453ffc 100644
--- a/tools/h5diff/h5diff_common.c
+++ b/tools/h5diff/h5diff_common.c
@@ -218,7 +218,7 @@ void parse_command_line(int argc,
options->delta = atof( opt_arg );
/* -d 0 is the same as default */
- if (options->delta == 0)
+ if (H5_DBL_ABS_EQUAL(options->delta, (double)0.0F))
options->d=0;
break;
@@ -235,7 +235,7 @@ void parse_command_line(int argc,
options->percent = atof( opt_arg );
/* -p 0 is the same as default */
- if (options->percent == 0)
+ if (H5_DBL_ABS_EQUAL(options->percent, (double)0.0F))
options->p = 0;
break;
@@ -249,16 +249,17 @@ void parse_command_line(int argc,
usage();
h5diff_exit(EXIT_FAILURE);
}
- options->count = atol( opt_arg );
-
+ options->count = HDstrtoull(opt_arg, NULL, 0);
break;
case 'N':
options->do_nans = 0;
break;
+
case 'c':
options->m_list_not_cmp = 1;
break;
+
case 'e':
options->use_system_epsilon = 1;
break;
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index 4506da2..c95ada3 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -376,15 +376,12 @@ typedef struct s1_t {
/* "File 82" macros */
/* Name of dataset to create in datafile */
#define F82_DATASETNAME "CompoundComplex1D"
-#define F82_DATASETNAME2 "CompoundComplex2D"
-#define F82_DATASETNAME3 "CompoundComplex3D"
-#define F82_DATASETNAME4 "CompoundComplex4D"
/* Dataset dimensions */
#define F82_DIM32 32
#define F82_RANK 1
-#define F82_RANK2 2
-#define F82_RANK3 3
-#define F82_RANK4 4
+//#define F82_RANK2 2
+//#define F82_RANK3 3
+//#define F82_RANK4 4
/* "File 83" macros */
/* Name of dataset to create in datafile */
@@ -9923,9 +9920,9 @@ static void gent_compound_complex2(void)
compound buf[F82_DIM32]; /* compound */
- hid_t file, grp=-1, type=-1, space=-1, dset=-1;
+ hid_t file, type=-1, space=-1, dset=-1;
hid_t dset_array_a, dset_array_b, dset_array_c;
- hid_t cmpd_tid1, cmpd_tid2, cmpd_tid3;
+ hid_t cmpd_tid1 = -1, cmpd_tid2 = -1, cmpd_tid3 = -1;
size_t i;
size_t j, k;
unsigned dset_array_ndims;
@@ -9937,6 +9934,10 @@ static void gent_compound_complex2(void)
if ((space = H5Screate_simple(F82_RANK, &nelmts, NULL)) >= 0) {
/* CompoundComplex1D */
if ((type = H5Tcreate(H5T_COMPOUND, sizeof(compound))) >= 0) {
+ hid_t str_type, array;
+ hsize_t dims[1];
+ hid_t nest1, nest2;
+
/* Insert top-level array members */
dset_array_ndims = 1; dset_array_a_dims[0] = 4;
dset_array_a = H5Tarray_create2(H5T_STD_U32LE, dset_array_ndims, dset_array_a_dims);
@@ -9954,8 +9955,6 @@ static void gent_compound_complex2(void)
H5Tclose(dset_array_c);
/* Insert first nested compound */
- hid_t str_type, array;
- hsize_t dims[1];
cmpd_tid1 = H5Tcreate(H5T_COMPOUND, sizeof(nested_compound));
H5Tinsert(cmpd_tid1, "nested_double", HOFFSET(nested_compound, nested_a), H5T_IEEE_F64LE);
@@ -9977,7 +9976,6 @@ static void gent_compound_complex2(void)
H5Tinsert(type, "nested_compound", HOFFSET(compound, d), cmpd_tid1);
/* Insert second nested compound */
- hid_t nest1, nest2;
cmpd_tid2 = H5Tcreate(H5T_COMPOUND, sizeof(multiple_nested_compound));
H5Tinsert(cmpd_tid2, "nested_float", HOFFSET(multiple_nested_compound, a), H5T_IEEE_F32LE);
diff --git a/tools/h5import/h5importtest.c b/tools/h5import/h5importtest.c
index ac839fb..38fd75b 100644
--- a/tools/h5import/h5importtest.c
+++ b/tools/h5import/h5importtest.c
@@ -119,8 +119,8 @@ main(void)
#ifdef H5_SIZEOF_LONG_LONG
row4i64[i] = row4i64[i - 1] + rowi4i64;
#endif
- row4i16[i] = row4i16[i - 1] + rowi4i16;
- row4i8[i] = row4i8[i - 1] + rowi4i8;
+ row4i16[i] = (short)(row4i16[i - 1] + rowi4i16);
+ row4i8[i] = (char)(row4i8[i - 1] + rowi4i8);
}
for (j = 1; j < ncol; j++)
@@ -131,8 +131,8 @@ main(void)
#ifdef H5_SIZEOF_LONG_LONG
col4i64[j] = col4i64[j - 1] + coli4i64;
#endif
- col4i16[j] = col4i16[j - 1] + coli4i16;
- col4i8[j] = col4i8[j - 1] + coli4i8;
+ col4i16[j] = (short)(col4i16[j - 1] + coli4i16);
+ col4i8[j] = (char)(col4i8[j - 1] + coli4i8);
}
for (k = 1; k < npln; k++)
{
@@ -142,8 +142,8 @@ main(void)
#ifdef H5_SIZEOF_LONG_LONG
pln4i64[k] = pln4i64[k - 1] + plni4i64;
#endif
- pln4i16[k] = pln4i16[k - 1] + plni4i16;
- pln4i8[k] = pln4i8[k - 1] + plni4i8;
+ pln4i16[k] = (short)(pln4i16[k - 1] + plni4i16);
+ pln4i8[k] = (char)(pln4i8[k - 1] + plni4i8);
}
/*
@@ -157,8 +157,8 @@ main(void)
for (k = 0; k < npln; k++) {
b64r3[k][i][j] = row8[i] + col8[j] + pln8[k];
b32i3[k][i][j] = row4i[i] + col4i[j] + pln4i[k];
- b16i3[k][i][j] = row4i16[i] + col4i16[j] + pln4i16[k];
- b8i3[k][i][j] = row4i8[i] + col4i8[j] + pln4i8[k];
+ b16i3[k][i][j] = (short)(row4i16[i] + col4i16[j] + pln4i16[k]);
+ b8i3[k][i][j] = (char)(row4i8[i] + col4i8[j] + pln4i8[k]);
}
diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c
index 7ae3169..a12b17a 100644
--- a/tools/h5jam/h5jamgentest.c
+++ b/tools/h5jam/h5jamgentest.c
@@ -248,7 +248,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
space = H5Screate_simple(1, dims, NULL);
dataset = H5Dcreate2(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
for (i = 0; i < 10; i++)
- dset2_1[i] = (float)(i*0.1F+1);
+ dset2_1[i] = (float)((float)i * 0.1F + 1.0F);
H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1);
H5Sclose(space);
H5Dclose(dataset);
@@ -259,7 +259,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
dataset = H5Dcreate2(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
for (i = 0; i < 3; i++)
for (j = 0; j < 5; j++)
- dset2_2[i][j] = (float)((i+1)*j*0.1F);
+ dset2_2[i][j] = (float)(((float)i + 1.0F) * (float)j * 0.1F);
H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_2);
H5Sclose(space);
H5Dclose(dataset);
diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c
index 4d79a9b..6053ce9 100644
--- a/tools/lib/io_timer.c
+++ b/tools/lib/io_timer.c
@@ -55,9 +55,9 @@ io_time_t *timer_g; /* timer: global for stub functions */
static double sub_time(struct timeval* a, struct timeval* b)
{
return (((double)a->tv_sec +
- ((double)a->tv_usec) / MICROSECOND) -
+ ((double)a->tv_usec) / (double)MICROSECOND) -
((double)b->tv_sec +
- ((double)b->tv_usec) / MICROSECOND));
+ ((double)b->tv_usec) / (double)MICROSECOND));
}
diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c
index 8657cbc..e44c957 100644
--- a/tools/misc/h5repart.c
+++ b/tools/misc/h5repart.c
@@ -194,9 +194,7 @@ main (int argc, char *argv[])
int src, dst=-1; /*source & destination files */
int need_seek=FALSE; /*destination needs to seek? */
int need_write; /*data needs to be written? */
- /*struct stat sb; temporary file stat buffer */
- /*struct _stati64 sb;*/
- h5_stat_t sb;
+ h5_stat_t sb; /*temporary file stat buffer */
int verbose=FALSE; /*display file names? */
@@ -243,7 +241,7 @@ main (int argc, char *argv[])
family_to_sec2 = TRUE;
argno++;
} else if ('b'==argv[argno][1]) {
- blk_size = get_size (prog_name, &argno, argc, argv);
+ blk_size = (size_t)get_size (prog_name, &argno, argc, argv);
} else if ('m'==argv[argno][1]) {
dst_size = get_size (prog_name, &argno, argc, argv);
} else {
@@ -308,7 +306,7 @@ main (int argc, char *argv[])
if (dst_is_family) n = (size_t)MIN((off_t)n, dst_size-dst_offset);
if (left_overs) {
n = (size_t)MIN ((off_t)n, left_overs);
- left_overs -= n;
+ left_overs = left_overs - (off_t)n;
need_write = FALSE;
} else if (src_offset<src_act_size) {
n = (size_t)MIN ((off_t)n, src_act_size-src_offset);
@@ -359,16 +357,16 @@ main (int argc, char *argv[])
* loop. The destination offset must be updated so we can fix
* trailing holes.
*/
- src_offset += n;
+ src_offset = src_offset + (off_t)n;
if (src_offset==src_act_size) {
HDclose (src);
if (!src_is_family) {
- dst_offset += n;
+ dst_offset = dst_offset + (off_t)n;
break;
}
sprintf (src_name, src_gen_name, ++src_membno);
if ((src=HDopen (src_name, O_RDONLY,0))<0 && ENOENT==errno) {
- dst_offset += n;
+ dst_offset = dst_offset + (off_t)n;
break;
} else if (src<0) {
perror (src_name);
@@ -392,7 +390,7 @@ main (int argc, char *argv[])
* needed. The first member is extended to the logical member size
* but other members might be smaller if they end with a hole.
*/
- dst_offset += n;
+ dst_offset = dst_offset + (off_t)n;
if (dst_is_family && dst_offset==dst_size) {
if (0==dst_membno) {
if (HDlseek (dst, dst_size-1, SEEK_SET)<0) {
@@ -474,7 +472,7 @@ main (int argc, char *argv[])
}
/* Set the property of the new member size as hsize_t */
- hdsize = dst_size;
+ hdsize = (hsize_t)dst_size;
if(H5Pset(fapl, H5F_ACS_FAMILY_NEWSIZE_NAME, &hdsize) < 0) {
perror ("H5Pset");
exit (EXIT_FAILURE);
diff --git a/tools/misc/h5repart_gentest.c b/tools/misc/h5repart_gentest.c
index f7d9a73..8a34694 100644
--- a/tools/misc/h5repart_gentest.c
+++ b/tools/misc/h5repart_gentest.c
@@ -27,12 +27,13 @@
#define FAMILY_SIZE 1024
#define FILENAME "family_file%05d.h5"
+static int buf[FAMILY_NUMBER][FAMILY_SIZE];
+
int main(void)
{
hid_t file=(-1), fapl, space=(-1), dset=(-1);
char dname[]="dataset";
int i, j;
- int buf[FAMILY_NUMBER][FAMILY_SIZE];
hsize_t dims[2]={FAMILY_NUMBER, FAMILY_SIZE};
/* Set property list and file name for FAMILY driver */
diff --git a/tools/perform/chunk.c b/tools/perform/chunk.c
index 0ea16e8..b1419ee 100644
--- a/tools/perform/chunk.c
+++ b/tools/perform/chunk.c
@@ -57,9 +57,9 @@
#define RM_CACHE_STRT 25
#define RM_CACHE_END 25
#define RM_CACHE_DELT 5
-#define RM_START 0.50F
-#define RM_END 5.00F
-#define RM_DELTA 0.50F
+#define RM_START (double)0.50F
+#define RM_END (double)5.00F
+#define RM_DELTA (double)0.50F
#define RM_W0 0.0F
#define RM_NRDCC 521
@@ -67,9 +67,9 @@
#define DIAG_CACHE_STRT 25
#define DIAG_CACHE_END 25
#define DIAG_CACHE_DELT 5
-#define DIAG_START 0.50F
-#define DIAG_END 5.00F
-#define DIAG_DELTA 0.50F
+#define DIAG_START (double)0.50F
+#define DIAG_END (double)5.00F
+#define DIAG_DELTA (double)0.50F
/* #define DIAG_W0 0.65F */
/* #define DIAG_NRDCC 521 */
@@ -320,7 +320,7 @@ test_diag (int op, size_t cache_size, size_t io_size, size_t offset)
* Win32 version 5.0 compiler.
* 1998-11-06 ptl
*/
- return (double)(hssize_t)nio/(hssize_t)nio_g;
+ return (double)nio/(double)nio_g;
}
@@ -479,9 +479,7 @@ main (void)
for (cache_size=DIAG_CACHE_STRT;
cache_size<=DIAG_CACHE_END;
cache_size+=DIAG_CACHE_DELT) {
- for (io_percent=DIAG_START;
- io_percent<=DIAG_END;
- io_percent+=DIAG_DELTA) {
+ for (io_percent=DIAG_START; io_percent<=DIAG_END; io_percent+=DIAG_DELTA) {
io_size = MAX (1, (size_t)(CH_SIZE*io_percent));
printf ("Diag-rd %8d %8.2f", (int)cache_size, io_percent);
fflush (stdout);
diff --git a/tools/perform/iopipe.c b/tools/perform/iopipe.c
index 6ac7ccb..fd62d37 100644
--- a/tools/perform/iopipe.c
+++ b/tools/perform/iopipe.c
@@ -81,25 +81,25 @@ print_stats (const char *prefix,
double u_time, s_time;
u_time = ((double)(r_stop->ru_utime.tv_sec)+
- (double)(r_stop->ru_utime.tv_usec)/1000000.0F) -
+ (double)(r_stop->ru_utime.tv_usec)/(double)1000000.0F) -
((double)(r_start->ru_utime.tv_sec)+
- (double)(r_start->ru_utime.tv_usec)/1000000.0F);
+ (double)(r_start->ru_utime.tv_usec)/(double)1000000.0F);
s_time = ((double)(r_stop->ru_stime.tv_sec)+
- (double)(r_stop->ru_stime.tv_usec)/1000000.0F) -
+ (double)(r_stop->ru_stime.tv_usec)/(double)1000000.0F) -
((double)(r_start->ru_stime.tv_sec)+
- (double)(r_start->ru_stime.tv_usec)/1000000.0F);
+ (double)(r_start->ru_stime.tv_usec)/(double)1000000.0F);
#endif
#ifndef H5_HAVE_SYS_TIMEB
e_time = ((double)(t_stop->tv_sec)+
- (double)(t_stop->tv_usec)/1000000.0F) -
+ (double)(t_stop->tv_usec)/(double)1000000.0F) -
((double)(t_start->tv_sec)+
- (double)(t_start->tv_usec)/1000000.0F);
+ (double)(t_start->tv_usec)/(double)1000000.0F);
#else
e_time = ((double)(t_stop->tv_sec)+
- (double)(t_stop->tv_usec)/1000.0F) -
+ (double)(t_stop->tv_usec)/(double)1000.0F) -
((double)(t_start->tv_sec)+
- (double)(t_start->tv_usec)/1000.0F);
+ (double)(t_start->tv_usec)/(double)1000.0F);
#endif
bw = (double)nbytes / e_time;
@@ -196,7 +196,7 @@ main (void)
* 1998-11-06 ptl
*/
printf ("I/O request size is %1.1fMB\n",
- (double)(hssize_t)(size[0]*size[1])/1024.0F*1024);
+ (double)(hssize_t)(size[0]*size[1])/(double)1024.0F*(double)1024);
/* Open the files */
file = H5Fcreate (HDF5_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
diff --git a/tools/perform/overhead.c b/tools/perform/overhead.c
index 277f7a4..98093c7 100644
--- a/tools/perform/overhead.c
+++ b/tools/perform/overhead.c
@@ -199,7 +199,7 @@ test(fill_t fill_style, const double splits[],
int *had = NULL; /*for random filling */
const char *sname=NULL; /*fill style nam */
int mdc_nelmts; /*num meta objs to cache*/
- hsize_t i;
+ hsize_t i, k;
int j;
h5_stat_t sb;
@@ -236,13 +236,13 @@ test(fill_t fill_style, const double splits[],
hs_start[0] = i%2 ? i/2 : cur_size[0]-i/2;
break;
case FILL_OUTWARD:
- j = (int)(cur_size[0]-i)+1;
- hs_start[0] = j%2 ? j/2 : (hssize_t)cur_size[0]-j/2;
+ k = (cur_size[0] - i) + 1;
+ hs_start[0] = k % 2 ? (k / 2) : (hsize_t)((hssize_t)cur_size[0] - (hssize_t)(k / 2));
break;
case FILL_RANDOM:
for (j=HDrand()%(int)cur_size[0]; had[j]; j=(j+1)%(int)cur_size[0])
/*void*/;
- hs_start[0] = j;
+ hs_start[0] = (hsize_t)j;
had[j] = 1;
break;
case FILL_ALL:
@@ -265,14 +265,9 @@ test(fill_t fill_style, const double splits[],
if (verbose) {
if (H5Fflush(file, H5F_SCOPE_LOCAL) < 0) goto error;
if (HDfstat(fd, &sb) < 0) goto error;
- /*
- * The extra cast in the following statement is a bug workaround
- * for the Win32 version 5.0 compiler.
- * 1998-11-06 ptl
- */
printf("%4lu %8.3f ***\n",
(unsigned long)i,
- (double)(hssize_t)(sb.st_size-i*sizeof(int))/(hssize_t)i);
+ (double)(sb.st_size - (HDoff_t)(i * sizeof(int))) / (double)i);
}
}
@@ -316,8 +311,8 @@ test(fill_t fill_style, const double splits[],
if (HDfstat(fd, &sb) < 0) goto error;
printf("%-7s %8.3f\n", sname,
- (double)(hssize_t)(sb.st_size-cur_size[0]*sizeof(int))/
- (hssize_t)cur_size[0]);
+ (double)(sb.st_size - (HDoff_t)(cur_size[0] * sizeof(int))) /
+ (double)cur_size[0]);
}
HDclose(fd);
diff --git a/tools/perform/sio_engine.c b/tools/perform/sio_engine.c
index 11d8f65..abf1fa6 100644
--- a/tools/perform/sio_engine.c
+++ b/tools/perform/sio_engine.c
@@ -96,7 +96,7 @@ static herr_t do_fclose(iotype iot, file_descr *fd);
static void do_cleanupfile(iotype iot, char *fname);
/* global variables */
-static off_t offset[MAX_DIMS]; /* dataset size in bytes */
+static HDoff_t offset[MAX_DIMS]; /* dataset size in bytes */
static size_t buf_offset[MAX_DIMS]; /* dataset size in bytes */
static int order[MAX_DIMS]; /* dimension access order */
static size_t linear_buf_size; /* linear buffer size */
@@ -406,7 +406,8 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
{
int ret_code = SUCCESS;
char dname[64];
- long i;
+ int i;
+ size_t u;
/* HDF5 variables */
herr_t hrc; /*HDF5 return code */
hsize_t h5dims[MAX_DIMS]; /*dataset dim sizes */
@@ -416,20 +417,20 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
hsize_t h5start[MAX_DIMS]; /*selection start */
hsize_t h5maxdims[MAX_DIMS];
int rank; /*rank of dataset */
- /* Prepare buffer for verifying data */
+
+ /* Prepare buffer for verifying data */
/* if (parms->verify)
memset(buffer,1,linear_buf_size); */
buf_p=(unsigned char *)buffer;
- for (i=0; i < linear_buf_size; i++)
- buf_p[i]=i%128;
+ for(u = 0; u < linear_buf_size; u++)
+ buf_p[u] = u % 128;
rank = parms->rank;
- for (i=0; i<rank; i++) {
+ for(i = 0; i < rank; i++)
h5offset[i] = offset[i] = 0;
- }
/* I/O Access specific setup */
switch (parms->io_type) {
@@ -616,20 +617,22 @@ done:
* Programmer: Christian Chilan, April, 2008
* Modifications:
*/
-
-static herr_t dset_write(int local_dim, file_descr *fd, parameters *parms, void *buffer)
+static herr_t
+dset_write(int local_dim, file_descr *fd, parameters *parms, void *buffer)
{
int cur_dim = order[local_dim]-1;
int ret_code = SUCCESS;
int k;
hsize_t dims[MAX_DIMS], maxdims[MAX_DIMS];
- long i,j;
+ hsize_t i;
+ int j;
herr_t hrc;
/* iterates according to the dimensions in order array */
for (i=0; i < parms->dset_size[cur_dim]; i += parms->buf_size[cur_dim]){
- h5offset[cur_dim] = offset[cur_dim] = i;
+ h5offset[cur_dim] = (hssize_t)i;
+ offset[cur_dim] = (HDoff_t)i;
if (local_dim > 0){
@@ -641,17 +644,15 @@ static herr_t dset_write(int local_dim, file_descr *fd, parameters *parms, void
case POSIXIO:
/* initialize POSIX offset in the buffer */
- for (j=0; j < parms->rank; j++) {
- buf_offset[j]=0;
- }
+ for(j = 0; j < parms->rank; j++)
+ buf_offset[j] = 0;
buf_p = (unsigned char *)buffer;
/* write POSIX buffer */
posix_buffer_write(0, fd, parms, buffer);
break;
case HDF5:
- /* if dimensions are extendable, extend them as needed during
- access */
+ /* if dimensions are extendable, extend them as needed during access */
if (parms->h5_use_chunks && parms->h5_extendable) {
hrc=H5Sget_simple_extent_dims(h5dset_space_id,dims,maxdims);
@@ -659,7 +660,8 @@ static herr_t dset_write(int local_dim, file_descr *fd, parameters *parms, void
for (k=0; k < parms->rank; k++){
- if (dims[k] <= h5offset[k]) {
+ HDassert(h5offset[k] >= 0);
+ if (dims[k] <= (hsize_t)h5offset[k]) {
dims[k] = dims[k]+h5count[k];
hrc=H5Sset_extent_simple(h5dset_space_id,parms->rank,dims,maxdims);
VRFY((hrc >= 0), "H5Sset_extent_simple");
@@ -700,20 +702,17 @@ done:
* Modifications:
*/
-static herr_t posix_buffer_write(int local_dim, file_descr *fd, parameters *parms, void *buffer)
+static herr_t
+posix_buffer_write(int local_dim, file_descr *fd, parameters *parms, void *buffer)
{
- int dtype_size = 1;
int ret_code = SUCCESS;
- long i;
- size_t d_offset;
- size_t linear_dset_offset = 0;
- int j, rc;
/* if dimension is not contiguous, call recursively */
if (local_dim < parms->rank-1 && local_dim != cont_dim) {
+ size_t u;
- for (i=0; i < parms->buf_size[local_dim]; i += dtype_size) {
- buf_offset[local_dim] = i;
+ for(u = 0; u < parms->buf_size[local_dim]; u ++) {
+ buf_offset[local_dim] = u;
posix_buffer_write(local_dim+1, fd, parms, buffer);
/* if next dimension is cont_dim, it will fill out the buffer
@@ -724,17 +723,20 @@ static herr_t posix_buffer_write(int local_dim, file_descr *fd, parameters *parm
}
/* otherwise, perform contiguous POSIX access */
} else {
+ HDoff_t d_offset;
+ HDoff_t linear_dset_offset = 0;
+ int i, j, rc;
buf_offset[local_dim] = 0;
/* determine offset in the buffer */
- for (i=0; i < parms->rank; i++){
- d_offset=1;
+ for(i = 0; i < parms->rank; i++) {
+ d_offset = 1;
- for (j=i+1; j < parms->rank; j++)
- d_offset *= parms->dset_size[j];
+ for(j = i + 1; j < parms->rank; j++)
+ d_offset *= (HDoff_t)parms->dset_size[j];
- linear_dset_offset += (offset[i]+buf_offset[i])*d_offset;
+ linear_dset_offset += (offset[i] + (HDoff_t)buf_offset[i]) * d_offset;
}
/* only care if seek returns error */
@@ -749,6 +751,7 @@ static herr_t posix_buffer_write(int local_dim, file_descr *fd, parameters *parm
buf_p += cont_size;
}
+
done:
return ret_code;
}
@@ -766,7 +769,8 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
char *buffer2 = NULL; /* Buffer for data verification */
int ret_code = SUCCESS;
char dname[64];
- long i;
+ int i;
+ size_t u;
/* HDF5 variables */
herr_t hrc; /*HDF5 return code */
hsize_t h5dims[MAX_DIMS]; /*dataset dim sizes */
@@ -782,8 +786,8 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
} /* end if */
/* Prepare buffer for verifying data */
- for(i = 0; i < linear_buf_size; i++)
- buffer2[i] = i % 128;
+ for(u = 0; u < linear_buf_size; u++)
+ buffer2[u] = (char)(u % 128);
rank = parms->rank;
for(i = 0; i < rank; i++)
@@ -937,18 +941,21 @@ done:
* Modifications:
*/
-static herr_t dset_read(int local_dim, file_descr *fd, parameters *parms,
- void *buffer, const char *buffer2)
+static herr_t
+dset_read(int local_dim, file_descr *fd, parameters *parms, void *buffer,
+ const char *buffer2)
{
int cur_dim = order[local_dim]-1;
- int ret_code = SUCCESS;
- long i,j;
+ hsize_t i;
+ int j;
herr_t hrc;
+ int ret_code = SUCCESS;
/* iterate on the current dimension */
for (i=0; i < parms->dset_size[cur_dim]; i += parms->buf_size[cur_dim]){
- h5offset[cur_dim] = offset[cur_dim] = i;
+ h5offset[cur_dim] = (hssize_t)i;
+ offset[cur_dim] = (HDoff_t)i;
/* if traverse in order array is incomplete, recurse */
if (local_dim > 0){
@@ -975,13 +982,6 @@ static herr_t dset_read(int local_dim, file_descr *fd, parameters *parms,
hrc = H5Dread(h5ds_id, ELMT_H5_TYPE, h5mem_space_id,
h5dset_space_id, h5dxpl, buffer);
VRFY((hrc >= 0), "H5Dread");
-#if 0
- for (j=0; j<linear_buf_size; j++) {
- buf_p = (unsigned char*)buffer;
- if (buf_p[j]!=buffer2[j])
- printf("Inconsistent data in %d\n", j);
- }
-#endif
break;
default:
@@ -1004,26 +1004,26 @@ done:
* Modifications:
*/
-static herr_t posix_buffer_read(int local_dim, file_descr *fd, parameters *parms, void *buffer)
+static herr_t
+posix_buffer_read(int local_dim, file_descr *fd, parameters *parms, void *buffer)
{
- int dtype_size = 1;
int ret_code = SUCCESS;
- long i;
- size_t d_offset;
- size_t linear_dset_offset = 0;
- int j, rc;
/* if local dimension is not contiguous, recurse */
if (local_dim < parms->rank-1 && local_dim != cont_dim) {
+ size_t u;
- for (i=0; i < parms->buf_size[local_dim]; i += dtype_size) {
- buf_offset[local_dim] = i;
+ for(u = 0; u < parms->buf_size[local_dim]; u++) {
+ buf_offset[local_dim] = u;
ret_code = posix_buffer_read(local_dim+1, fd, parms, buffer);
if (local_dim+1==cont_dim)
break;
}
/* otherwise, perform contiguous POSIX access */
} else {
+ HDoff_t d_offset;
+ HDoff_t linear_dset_offset = 0;
+ int i, j, rc;
buf_offset[local_dim] = 0;
/* determine offset in buffer */
@@ -1031,9 +1031,9 @@ static herr_t posix_buffer_read(int local_dim, file_descr *fd, parameters *parms
d_offset=1;
for (j=i+1; j<parms->rank; j++)
- d_offset *= parms->dset_size[j];
+ d_offset *= (HDoff_t)parms->dset_size[j];
- linear_dset_offset += (offset[i]+buf_offset[i])*d_offset;
+ linear_dset_offset += (offset[i] + (HDoff_t)buf_offset[i]) * d_offset;
}
/* only care if seek returns error */
@@ -1165,7 +1165,7 @@ set_vfd(parameters *param)
memb_fapl[mt] = H5P_DEFAULT;
sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
memb_name[mt] = sv[mt];
- memb_addr[mt] = MAX(mt-1,0)*(HADDR_MAX/10);
+ memb_addr[mt] = (haddr_t)MAX(mt - 1,0) * (HADDR_MAX / 10);
}
if (H5Pset_fapl_multi(my_fapl, memb_map, memb_fapl, memb_name,