summaryrefslogtreecommitdiffstats
path: root/perform
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-12-12 18:40:09 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-12-12 18:40:09 (GMT)
commit47d88766dbee3c631c842639d44c362c2b7b8e44 (patch)
tree77058751c8bcb0260593674f609cb5df1224198c /perform
parent6e9c0514fb45ddb358d36832237a3beace6ffb6b (diff)
downloadhdf5-47d88766dbee3c631c842639d44c362c2b7b8e44.zip
hdf5-47d88766dbee3c631c842639d44c362c2b7b8e44.tar.gz
hdf5-47d88766dbee3c631c842639d44c362c2b7b8e44.tar.bz2
[svn-r4706] Purpose:
Code cleanup Description: Tweaked internal error handling macros to reduce the size of the library's object code by about 10-20%. Also cleaned up some compiler warnings... Platforms tested: FreeBSD 4.4 (sleipnir)
Diffstat (limited to 'perform')
-rw-r--r--perform/chunk.c14
-rw-r--r--perform/iopipe.c4
-rw-r--r--perform/overhead.c8
3 files changed, 13 insertions, 13 deletions
diff --git a/perform/chunk.c b/perform/chunk.c
index 0b915c8..9366c98 100644
--- a/perform/chunk.c
+++ b/perform/chunk.c
@@ -162,7 +162,7 @@ create_dataset (void)
*-------------------------------------------------------------------------
*/
static double
-test_rowmaj (int op, size_t cache_size, hsize_t io_size)
+test_rowmaj (int op, size_t cache_size, size_t io_size)
{
hid_t file, dset, mem_space, file_space;
signed char *buf = calloc (1, SQUARE(io_size));
@@ -242,7 +242,7 @@ test_rowmaj (int op, size_t cache_size, hsize_t io_size)
*-------------------------------------------------------------------------
*/
static double
-test_diag (int op, size_t cache_size, hsize_t io_size, hsize_t offset)
+test_diag (int op, size_t cache_size, size_t io_size, size_t offset)
{
hid_t file, dset, mem_space, file_space;
hsize_t i, hs_size[2];
@@ -322,7 +322,7 @@ test_diag (int op, size_t cache_size, hsize_t io_size, hsize_t offset)
int
main (void)
{
- hsize_t io_size;
+ size_t io_size;
double effic, io_percent;
FILE *f, *d;
size_t cache_size;
@@ -370,7 +370,7 @@ main (void)
cache_size<=RM_CACHE_END;
cache_size+=RM_CACHE_DELT) {
for (io_percent=RM_START; io_percent<=RM_END; io_percent+=RM_DELTA) {
- io_size = MAX (1, (int)(CH_SIZE*io_percent));
+ io_size = MAX (1, (size_t)(CH_SIZE*io_percent));
printf ("Rowmaj-rd %8d %8.2f", cache_size, io_percent);
fflush (stdout);
effic = test_rowmaj (READ, cache_size, io_size);
@@ -416,7 +416,7 @@ main (void)
cache_size<=RM_CACHE_END;
cache_size+=RM_CACHE_DELT) {
for (io_percent=RM_START; io_percent<=RM_END; io_percent+=RM_DELTA) {
- io_size = MAX (1, (int)(CH_SIZE*io_percent));
+ io_size = MAX (1, (size_t)(CH_SIZE*io_percent));
printf ("Rowmaj-wr %8d %8.2f", cache_size, io_percent);
fflush (stdout);
effic = test_rowmaj (WRITE, cache_size, io_size);
@@ -461,7 +461,7 @@ main (void)
for (io_percent=DIAG_START;
io_percent<=DIAG_END;
io_percent+=DIAG_DELTA) {
- io_size = MAX (1, (int)(CH_SIZE*io_percent));
+ io_size = MAX (1, (size_t)(CH_SIZE*io_percent));
printf ("Diag-rd %8d %8.2f", cache_size, io_percent);
fflush (stdout);
effic = test_diag (READ, cache_size, io_size, MAX (1, io_size/2));
@@ -506,7 +506,7 @@ main (void)
for (io_percent=DIAG_START;
io_percent<=DIAG_END;
io_percent+=DIAG_DELTA) {
- io_size = MAX (1, (int)(CH_SIZE*io_percent));
+ io_size = MAX (1, (size_t)(CH_SIZE*io_percent));
printf ("Diag-wr %8d %8.2f", cache_size, io_percent);
fflush (stdout);
effic = test_diag (WRITE, cache_size, io_size, MAX (1, io_size/2));
diff --git a/perform/iopipe.c b/perform/iopipe.c
index 9c3e256..dea98aa 100644
--- a/perform/iopipe.c
+++ b/perform/iopipe.c
@@ -317,7 +317,7 @@ printf("Before getrusage() call\n");
for (i=0; i<nwrite; i++) {
putc (PROGRESS, stderr);
fflush (stderr);
- offset = lseek (fd, 0, SEEK_SET);
+ offset = lseek (fd, (off_t)0, SEEK_SET);
assert (0==offset);
n = write (fd, the_data, (size_t)(size[0]*size[1]));
assert (n>=0 && (size_t)n==size[0]*size[1]);
@@ -396,7 +396,7 @@ printf("Before getrusage() call\n");
for (i=0; i<nread; i++) {
putc (PROGRESS, stderr);
fflush (stderr);
- offset = lseek (fd, 0, SEEK_SET);
+ offset = lseek (fd, (off_t)0, SEEK_SET);
assert (0==offset);
n = read (fd, the_data, (size_t)(size[0]*size[1]));
assert (n>=0 && (size_t)n==size[0]*size[1]);
diff --git a/perform/overhead.c b/perform/overhead.c
index cea8dac..0723879 100644
--- a/perform/overhead.c
+++ b/perform/overhead.c
@@ -174,21 +174,21 @@ static int
test(fill_t fill_style, const double splits[],
hbool_t verbose, hbool_t use_rdcc)
{
- hid_t file, fapl, dcpl, xfer, mspace, fspace, dset;
+ hid_t file = (-1), fapl = (-1), dcpl = (-1), xfer = (-1), mspace = (-1), fspace = (-1), dset = (-1);
hsize_t ch_size[1] = {1}; /*chunk size */
hsize_t cur_size[1] = {1000}; /*current dataset size */
hsize_t max_size[1] = {H5S_UNLIMITED}; /*maximum dataset size */
hssize_t hs_start[1]; /*hyperslab start offset*/
hsize_t hs_count[1] = {1}; /*hyperslab nelmts */
- int fd; /*h5 file direct */
+ int fd = (-1); /*h5 file direct */
static int *had = NULL; /*for random filling */
- const char *sname; /*fill style nam */
+ const char *sname=NULL; /*fill style nam */
int mdc_nelmts; /*num meta objs to cache*/
hsize_t i;
int j;
struct stat sb;
- if (!had) had = calloc(cur_size[0], sizeof(int));
+ if (!had) had = calloc((size_t)cur_size[0], sizeof(int));
if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) goto error;
if (!use_rdcc) {
if (H5Pget_cache(fapl, &mdc_nelmts, NULL, NULL, NULL)<0) goto error;