From ea052ffd55cabca3ef756a7f44e7f3f2fa32b679 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 19 Jun 2002 11:06:55 -0500 Subject: [svn-r5674] Purpose: Code cleanup Description: Removed more compiler warnings, etc. Platforms tested: Linux 2.2.x (eirene) w/parallel --- c++/Makefile.in | 2 +- perform/pio_engine.c | 16 +++++------ perform/pio_perf.c | 26 +++++++++--------- perform/pio_timer.c | 2 +- src/H5Distore.c | 7 ++--- src/H5FDmpio.c | 13 ++++----- src/H5Fistore.c | 7 ++--- src/H5T.c | 2 +- test/h5test.c | 4 +-- testpar/t_dset.c | 68 ++++++++++++++++++++++++----------------------- testpar/t_mdset.c | 11 ++++---- testpar/t_mpi.c | 7 +++-- testpar/testphdf5.c | 12 ++++----- testpar/testphdf5.h | 6 +---- tools/h5dump/h5dumptst.c | 4 +-- tools/lib/h5tools_utils.c | 2 +- 16 files changed, 93 insertions(+), 96 deletions(-) diff --git a/c++/Makefile.in b/c++/Makefile.in index b39832c..9a4ccad 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -109,7 +109,7 @@ distclean: done -$(RM) config/commence config/conclude -$(RM) config/stamp1 config/stamp2 config/depend? - -$(RM) config.cache config.log config.status + -$(RM) config.cache config.log config.status configure.lineno -$(RM) src/H5config.h src/H5pubconf.h -$(RM) libtool Makefile diff --git a/perform/pio_engine.c b/perform/pio_engine.c index dfcb465..0a59158 100644 --- a/perform/pio_engine.c +++ b/perform/pio_engine.c @@ -342,7 +342,7 @@ done: static char * pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t size) { - const char *prefix, *suffix; + const char *prefix, *suffix=""; char *ptr, last = '\0'; size_t i, j; @@ -460,11 +460,11 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nelmts_xfer; size_t nelmts_toxfer; char dname[64]; - off_t dset_offset; /*dataset offset in a file */ + off_t dset_offset=0; /*dataset offset in a file */ off_t file_offset; /*file offset of the next transfer */ off_t dset_size; /*one dataset size in bytes */ size_t nelmts_in_buf; /*how many element the buffer holds */ - size_t nelmts_in_blk; /*how many element a block holds */ + size_t nelmts_in_blk=0; /*how many element a block holds */ off_t elmts_begin; /*first elmt this process transfer */ off_t elmts_count; /*number of elmts this process transfer */ hid_t dcpl = -1; /* Dataset creation property list */ @@ -678,7 +678,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, if (parms->verify) { /*Prepare write data for verify later*/ int *intptr = (int *)buffer; - register int i; + size_t i; for (i = 0; i < nelmts_toxfer; ++i) *intptr++ = pio_mpi_rank_g; @@ -845,11 +845,11 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nelmts_xfer; size_t nelmts_toxfer; char dname[64]; - off_t dset_offset; /*dataset offset in a file */ + off_t dset_offset=0; /*dataset offset in a file */ off_t file_offset; /*file offset of the next transfer */ off_t dset_size; /*one dataset size in bytes */ size_t nelmts_in_buf; /*how many element the buffer holds */ - size_t nelmts_in_blk; /*how many element a block holds */ + size_t nelmts_in_blk=0; /*how many element a block holds */ off_t elmts_begin; /*first elmt this process transfer */ off_t elmts_count; /*number of elmts this process transfer */ @@ -1121,8 +1121,8 @@ HDfprintf(output, if (parms->verify) { /*verify read data*/ int *intptr = (int *)buffer; - register int i; - register int nerror=0; + size_t i; + int nerror=0; for (i = 0; i < nelmts_toxfer; ++i){ if (*intptr++ != pio_mpi_rank_g){ diff --git a/perform/pio_perf.c b/perform/pio_perf.c index f0b158c..661821a 100644 --- a/perform/pio_perf.c +++ b/perform/pio_perf.c @@ -505,16 +505,16 @@ run_test(iotype iot, parameters parms, struct options *opts) /* allocate space for tables minmax and that it is sufficient */ /* to initialize all elements to zeros by calloc. */ - write_mpi_mm_table = calloc(parms.num_iters , sizeof(minmax)); - write_mm_table = calloc(parms.num_iters , sizeof(minmax)); - write_gross_mm_table = calloc(parms.num_iters , sizeof(minmax)); - write_raw_mm_table = calloc(parms.num_iters , sizeof(minmax)); + write_mpi_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + write_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + write_gross_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + write_raw_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); if (!parms.h5_write_only) { - read_mpi_mm_table = calloc(parms.num_iters , sizeof(minmax)); - read_mm_table = calloc(parms.num_iters , sizeof(minmax)); - read_gross_mm_table = calloc(parms.num_iters , sizeof(minmax)); - read_raw_mm_table = calloc(parms.num_iters , sizeof(minmax)); + read_mpi_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + read_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + read_gross_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); + read_raw_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax)); } /* Do IO iteration times, collecting statistics each time */ @@ -779,7 +779,7 @@ static int create_comm_world(int num_procs, int *doing_pio) { /* MPI variables */ - int mrc, ret_value; /* return values */ + int mrc; /* return values */ int color; /* for communicator creation */ int myrank, nprocs; @@ -819,7 +819,7 @@ create_comm_world(int num_procs, int *doing_pio) done: *doing_pio = color; - return ret_value; + return SUCCESS; error_done: destroy_comm_world(); @@ -1116,10 +1116,10 @@ parse_command_line(int argc, char *argv[]) buf[i++] = *end; if (strlen(buf) > 1 || isdigit(buf[0])) { - register int i; + size_t j; - for (i = 0; i < 10 && buf[i] != '\0'; ++i) - if (!isdigit(buf[i])) { + for (j = 0; j < 10 && buf[j] != '\0'; ++j) + if (!isdigit(buf[j])) { fprintf(stderr, "pio_perf: invalid --debug option %s\n", buf); exit(EXIT_FAILURE); diff --git a/perform/pio_timer.c b/perform/pio_timer.c index 588ea1d..6b87c3e 100644 --- a/perform/pio_timer.c +++ b/perform/pio_timer.c @@ -130,7 +130,7 @@ set_time(pio_time *pt, timer_type t, int start_stop) } if (pio_debug_level >= 4) { - char *msg; + const char *msg; int myrank; MPI_Comm_rank(pio_comm_g, &myrank); diff --git a/src/H5Distore.c b/src/H5Distore.c index 913bdf9..a44ce5a 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -2396,7 +2396,8 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, /* Check if fill values should be written to blocks */ if(fill_time != H5D_FILL_TIME_NEVER) { /* Allocate chunk buffer for processes to use when writing fill values */ - if (NULL==(chunk = H5MM_malloc(chunk_size))) + H5_CHECK_OVERFLOW(chunk_size,hsize_t,size_t); + if (NULL==(chunk = H5MM_malloc((size_t)chunk_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for chunk"); /* Fill the chunk with the proper values */ @@ -2405,12 +2406,12 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, * Replicate the fill value throughout the chunk. */ assert(0==chunk_size % fill.size); - H5V_array_fill(chunk, fill.buf, fill.size, chunk_size/fill.size); + H5V_array_fill(chunk, fill.buf, fill.size, (size_t)chunk_size/fill.size); } else { /* * No fill value was specified, assume all zeros. */ - HDmemset (chunk, 0, chunk_size); + HDmemset (chunk, 0, (size_t)chunk_size); } /* end else */ } /* end if */ diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 064341b..842c6e4 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -643,6 +643,9 @@ H5FD_mpio_wait_for_left_neighbor(H5FD_t *_file) assert(file); assert(H5FD_MPIO==file->pub.driver_id); + /* Portably initialize MPI status variable */ + HDmemset(&rcvstat,0,sizeof(MPI_Status)); + /* p0 has no left neighbor; all other procs wait for msg */ if (file->mpi_rank != 0) { if (MPI_SUCCESS!= MPI_Recv( &msgbuf, 1, MPI_CHAR, file->mpi_rank-1, MPI_ANY_TAG, file->comm, &rcvstat )) @@ -781,7 +784,7 @@ H5FD_mpio_fapl_get(H5FD_t *_file) */ static H5FD_t * H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id, - haddr_t maxaddr/*unused*/) + haddr_t UNUSED maxaddr) { H5FD_mpio_t *file=NULL; MPI_File fh; @@ -987,18 +990,12 @@ H5FD_mpio_close(H5FD_t *_file) *------------------------------------------------------------------------- */ static herr_t -H5FD_mpio_query(const H5FD_t *_file, unsigned long *flags /* out */) +H5FD_mpio_query(const H5FD_t UNUSED *_file, unsigned long *flags /* out */) { -#ifndef NDEBUG - const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file; -#endif /* NDEBUG */ herr_t ret_value=SUCCEED; FUNC_ENTER_NOAPI(H5FD_mpio_query, FAIL); - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); - /* Set the VFL feature flags that this driver supports */ if(flags) { *flags=0; diff --git a/src/H5Fistore.c b/src/H5Fistore.c index 913bdf9..a44ce5a 100644 --- a/src/H5Fistore.c +++ b/src/H5Fistore.c @@ -2396,7 +2396,8 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, /* Check if fill values should be written to blocks */ if(fill_time != H5D_FILL_TIME_NEVER) { /* Allocate chunk buffer for processes to use when writing fill values */ - if (NULL==(chunk = H5MM_malloc(chunk_size))) + H5_CHECK_OVERFLOW(chunk_size,hsize_t,size_t); + if (NULL==(chunk = H5MM_malloc((size_t)chunk_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for chunk"); /* Fill the chunk with the proper values */ @@ -2405,12 +2406,12 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, * Replicate the fill value throughout the chunk. */ assert(0==chunk_size % fill.size); - H5V_array_fill(chunk, fill.buf, fill.size, chunk_size/fill.size); + H5V_array_fill(chunk, fill.buf, fill.size, (size_t)chunk_size/fill.size); } else { /* * No fill value was specified, assume all zeros. */ - HDmemset (chunk, 0, chunk_size); + HDmemset (chunk, 0, (size_t)chunk_size); } /* end else */ } /* end if */ diff --git a/src/H5T.c b/src/H5T.c index 12832e5..4a3c533 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -7921,7 +7921,7 @@ done: */ hid_t H5Tarray_create(hid_t base_id, int ndims, const hsize_t dim[/* ndims */], - const int UNUSED *perm/* ndims */) + const int perm[/* ndims */]) { H5T_t *base = NULL; /* base data type */ H5T_t *dt = NULL; /* new array data type */ diff --git a/test/h5test.c b/test/h5test.c index 1951803..195819e 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -442,7 +442,7 @@ h5_fileaccess(void) HDmemset(memb_map, 0, sizeof memb_map); HDmemset(memb_fapl, 0, sizeof memb_fapl); - HDmemset((void*)(&memb_name[0]), 0, sizeof memb_name); + HDmemset(memb_name, 0, sizeof memb_name); HDmemset(memb_addr, 0, sizeof memb_addr); assert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); @@ -693,7 +693,7 @@ h5_dump_info_object(MPI_Info info) int flag; int i, nkeys; - printf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", info, + printf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", (int)info, MPI_MAX_INFO_VAL); if (info==MPI_INFO_NULL){ printf("object is MPI_INFO_NULL\n"); diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 91b6bd5..6e18453 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -28,7 +28,7 @@ * ZROW same as BYROW except process 0 gets 0 rows * ZCOL same as BYCOL except process 0 gets 0 columns */ -void +static void slab_set(int mpi_rank, int mpi_size, hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], int mode) { @@ -108,16 +108,16 @@ if (verbose){ * Fill the dataset with trivial data for testing. * Assume dimension rank is 2 and data is stored contiguous. */ -void -dataset_fill(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE * dataset) +static void +dataset_fill(hssize_t start[], hsize_t block[], DATATYPE * dataset) { DATATYPE *dataptr = dataset; - int i, j; + hsize_t i, j; /* put some trivial data in the data_array */ for (i=0; i < block[0]; i++){ for (j=0; j < block[1]; j++){ - *dataptr = (i+start[0])*100 + (j+start[1]+1); + *dataptr = (DATATYPE)((i+start[0])*100 + (j+start[1]+1)); dataptr++; } } @@ -127,10 +127,11 @@ dataset_fill(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[ /* * Print the content of the dataset. */ -void dataset_print(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE * dataset) +static void +dataset_print(hssize_t start[], hsize_t block[], DATATYPE * dataset) { DATATYPE *dataptr = dataset; - int i, j; + hsize_t i, j; /* print the column heading */ printf("%-8s", "Cols:"); @@ -155,7 +156,8 @@ void dataset_print(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t */ int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, DATATYPE *original) { - int i, j, vrfyerrs; + hsize_t i, j; + int vrfyerrs; /* print it if verbose */ if (verbose) { @@ -164,9 +166,9 @@ int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t bl (long)start[0], (long)start[1], (unsigned long)count[0], (unsigned long)count[1], (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]); printf("original values:\n"); - dataset_print(start, count, stride, block, original); + dataset_print(start, block, original); printf("compared values:\n"); - dataset_print(start, count, stride, block, dataset); + dataset_print(start, block, dataset); } vrfyerrs = 0; @@ -174,9 +176,9 @@ int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t bl for (j=0; j < block[1]; j++){ if (*dataset != *original){ if (vrfyerrs++ < MAX_ERR_REPORT || verbose){ - printf("Dataset Verify failed at [%d][%d](row %d, col %d): expect %d, got %d\n", - i, j, - (int)(i+start[0]), (int)(j+start[1]), + printf("Dataset Verify failed at [%ld][%ld](row %ld, col %ld): expect %d, got %d\n", + (long)i, (long)j, + (long)(i+start[0]), (long)(j+start[1]), *(original), *(dataset)); } dataset++; @@ -285,7 +287,7 @@ dataset_writeInd(char *filename) slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW); /* put some trivial data in the data_array */ - dataset_fill(start, count, stride, block, data_array1); + dataset_fill(start, block, data_array1); MESG("data_array initialized"); /* create a file dataspace independently */ @@ -415,7 +417,7 @@ dataset_readInd(char *filename) VRFY((mem_dataspace >= 0), ""); /* fill dataset with test data */ - dataset_fill(start, count, stride, block, data_origin1); + dataset_fill(start, block, data_origin1); /* read data independently */ ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace, @@ -558,11 +560,11 @@ dataset_writeAll(char *filename) VRFY((mem_dataspace >= 0), ""); /* fill the local slab with some trivial data */ - dataset_fill(start, count, stride, block, data_array1); + dataset_fill(start, block, data_array1); MESG("data_array initialized"); if (verbose){ MESG("data_array created"); - dataset_print(start, count, stride, block, data_array1); + dataset_print(start, block, data_array1); } /* set up the collective transfer properties list */ @@ -604,11 +606,11 @@ dataset_writeAll(char *filename) slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL); /* put some trivial data in the data_array */ - dataset_fill(start, count, stride, block, data_array1); + dataset_fill(start, block, data_array1); MESG("data_array initialized"); if (verbose){ MESG("data_array created"); - dataset_print(start, count, stride, block, data_array1); + dataset_print(start, block, data_array1); } /* create a file dataspace independently */ @@ -622,11 +624,11 @@ dataset_writeAll(char *filename) VRFY((mem_dataspace >= 0), ""); /* fill the local slab with some trivial data */ - dataset_fill(start, count, stride, block, data_array1); + dataset_fill(start, block, data_array1); MESG("data_array initialized"); if (verbose){ MESG("data_array created"); - dataset_print(start, count, stride, block, data_array1); + dataset_print(start, block, data_array1); } /* set up the collective transfer properties list */ @@ -769,11 +771,11 @@ dataset_readAll(char *filename) VRFY((mem_dataspace >= 0), ""); /* fill dataset with test data */ - dataset_fill(start, count, stride, block, data_origin1); + dataset_fill(start, block, data_origin1); MESG("data_array initialized"); if (verbose){ MESG("data_array created"); - dataset_print(start, count, stride, block, data_origin1); + dataset_print(start, block, data_origin1); } /* set up the collective transfer properties list */ @@ -832,11 +834,11 @@ dataset_readAll(char *filename) VRFY((mem_dataspace >= 0), ""); /* fill dataset with test data */ - dataset_fill(start, count, stride, block, data_origin1); + dataset_fill(start, block, data_origin1); MESG("data_array initialized"); if (verbose){ MESG("data_array created"); - dataset_print(start, count, stride, block, data_origin1); + dataset_print(start, block, data_origin1); } /* set up the collective transfer properties list */ @@ -1006,11 +1008,11 @@ extend_writeInd(char *filename) slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW); /* put some trivial data in the data_array */ - dataset_fill(start, count, stride, block, data_array1); + dataset_fill(start, block, data_array1); MESG("data_array initialized"); if (verbose){ MESG("data_array created"); - dataset_print(start, count, stride, block, data_array1); + dataset_print(start, block, data_array1); } /* create a memory dataspace independently */ @@ -1046,11 +1048,11 @@ extend_writeInd(char *filename) slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL); /* put some trivial data in the data_array */ - dataset_fill(start, count, stride, block, data_array1); + dataset_fill(start, block, data_array1); MESG("data_array initialized"); if (verbose){ MESG("data_array created"); - dataset_print(start, count, stride, block, data_array1); + dataset_print(start, block, data_array1); } /* create a memory dataspace independently */ @@ -1209,10 +1211,10 @@ extend_readInd(char *filename) VRFY((mem_dataspace >= 0), ""); /* fill dataset with test data */ - dataset_fill(start, count, stride, block, data_origin1); + dataset_fill(start, block, data_origin1); if (verbose){ MESG("data_array created"); - dataset_print(start, count, stride, block, data_array1); + dataset_print(start, block, data_array1); } /* read data independently */ @@ -1244,10 +1246,10 @@ extend_readInd(char *filename) VRFY((mem_dataspace >= 0), ""); /* fill dataset with test data */ - dataset_fill(start, count, stride, block, data_origin1); + dataset_fill(start, block, data_origin1); if (verbose){ MESG("data_array created"); - dataset_print(start, count, stride, block, data_array1); + dataset_print(start, block, data_array1); } /* read data independently */ diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index bd06cc9..0b6de7a 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -280,12 +280,12 @@ void multiple_group_read(char *filename, int ngroups) /* check the data. */ if(m != 0) - if( error_num = read_dataset(memspace, filespace, gid) ) + if( (error_num = read_dataset(memspace, filespace, gid))>0) nerrors += error_num; /* check attribute.*/ error_num = 0; - if( error_num = read_attribute(gid, is_group, m) ) + if( (error_num = read_attribute(gid, is_group, m))>0 ) nerrors += error_num; H5Gclose(gid); @@ -343,7 +343,7 @@ int read_dataset(hid_t memspace, hid_t filespace, hid_t gid) vrfy_errors = check_value(indata, outdata); /* check attribute.*/ - if( attr_errors = read_attribute(did, is_dset, n) ) + if( (attr_errors = read_attribute(did, is_dset, n))>0 ) vrfy_errors += attr_errors; H5Dclose(did); @@ -455,7 +455,8 @@ int read_attribute(hid_t obj_id, int this_type, int num) * hyperslab part only by process ID. */ int check_value(DATATYPE *indata, DATATYPE *outdata) { - int mpi_rank, mpi_size, i, j, err_num=0; + int mpi_rank, mpi_size, err_num=0; + hsize_t i, j; hssize_t chunk_origin[DIM]; hsize_t chunk_dims[DIM], count[DIM]; @@ -470,7 +471,7 @@ int check_value(DATATYPE *indata, DATATYPE *outdata) for(j=chunk_origin[1]; j<(chunk_origin[1]+chunk_dims[1]); j++) { if( *indata != *outdata ) if(err_num++ < MAX_ERR_REPORT || verbose) - printf("Dataset Verify failed at [%d][%d](row %d, col%d): expect %d, got %d\n", i, j, i, j, *outdata, *indata); + printf("Dataset Verify failed at [%ld][%ld](row %ld, col%ld): expect %d, got %d\n", (long)i, (long)j, (long)i, (long)j, *outdata, *indata); } if(err_num > MAX_ERR_REPORT && !verbose) printf("[more errors ...]\n"); diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index 8f6b55a..3a28146 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -26,7 +26,6 @@ hid_t fapl; /* file access property list */ /* protocols */ static void test_mpio_overlap_writes(char *filename); static void test_mpio_gb_file(char *filename); -static void test_mpio_gb_file(char *filename); static int parse_options(int argc, char **argv); static void usage(void); @@ -282,13 +281,13 @@ test_mpio_gb_file(char *filename) for (i=ntimes-2; i <= ntimes; i++){ mpi_off = (i*mpi_size + mpi_rank)*(MPI_Offset)MB; if (verbose) - printf("proc %d: write to mpi_off=%016llx, %lld\n", + HDfprintf(stdout,"proc %d: write to mpi_off=%016llx, %lld\n", mpi_rank, mpi_off, mpi_off); /* set data to some trivial pattern for easy verification */ for (j=0; j] [-n] " @@ -244,7 +244,7 @@ parse_options(int argc, char **argv) * Create the appropriate File access property list */ hid_t -create_faccess_plist(MPI_Comm comm, MPI_Info info, int facc_type ) +create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type ) { hid_t ret_pl = -1; herr_t ret; /* generic return value */ @@ -256,17 +256,17 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int facc_type ) ret_pl = H5Pcreate (H5P_FILE_ACCESS); VRFY((ret_pl >= 0), "H5P_FILE_ACCESS"); - if (facc_type == FACC_DEFAULT) + if (l_facc_type == FACC_DEFAULT) return (ret_pl); - if (facc_type == FACC_MPIO){ + if (l_facc_type == FACC_MPIO){ /* set Parallel access with communicator */ ret = H5Pset_fapl_mpio(ret_pl, comm, info); VRFY((ret >= 0), ""); return(ret_pl); } - if (facc_type == (FACC_MPIO | FACC_SPLIT)){ + if (l_facc_type == (FACC_MPIO | FACC_SPLIT)){ hid_t mpio_pl; mpio_pl = H5Pcreate (H5P_FILE_ACCESS); @@ -290,7 +290,7 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int facc_type ) } -main(int argc, char **argv) +int main(int argc, char **argv) { int mpi_size, mpi_rank; /* mpi variables */ diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index 636769d..57510df 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -3,10 +3,6 @@ #ifndef PHDF5TEST_H #define PHDF5TEST_H -#include -#include - -#include "hdf5.h" #include "h5test.h" /* Define some handy debugging shorthands, routines, ... */ @@ -102,7 +98,7 @@ extern void *old_client_data; /*previous error handler arg.*/ extern int facc_type; /*Test file access type */ /* prototypes */ -hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int facc_type ); +hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type ); void multiple_dset_write(char *filename, int ndatasets); void multiple_group_write(char *filename, int ngroups); void multiple_group_read(char *filename, int ngroups); diff --git a/tools/h5dump/h5dumptst.c b/tools/h5dump/h5dumptst.c index 0fb523b..55f9d70 100644 --- a/tools/h5dump/h5dumptst.c +++ b/tools/h5dump/h5dumptst.c @@ -1029,7 +1029,7 @@ static void test_many(void) { dset1[j].a[idx[3]][idx[2]][idx[1]][idx[0]] = i0+j; dset1[j].b[idx[3]][idx[2]][idx[1]][idx[0]] = (double)(i0+j); -#if WIN32 +#ifdef WIN32 dset1[j].c[idx[3]][idx[2]][idx[1]][idx[0]] = (double)(i0+j+(signed __int64)sdim); #else dset1[j].c[idx[3]][idx[2]][idx[1]][idx[0]] = (double)(i0+j+sdim); @@ -2778,7 +2778,7 @@ void test_multi(void) HDmemset(memb_map, 0, sizeof memb_map); HDmemset(memb_fapl, 0, sizeof memb_fapl); - HDmemset((void *)(&memb_name[0]), 0, sizeof memb_name); + HDmemset(memb_name, 0, sizeof memb_name); HDmemset(memb_addr, 0, sizeof memb_addr); assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index e96ad99..675d03f 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -429,7 +429,7 @@ find_objs(hid_t group, const char *name, void *op_data) switch (statbuf.type) { case H5G_GROUP: if ((obj = H5Gopen(group, name)) >= 0) { - if (info->prefix_len < (int)(HDstrlen(info->prefix) + HDstrlen(name) + 2)) { + if (info->prefix_len < (HDstrlen(info->prefix) + HDstrlen(name) + 2)) { info->prefix_len *= 2; info->prefix = HDrealloc(info->prefix, info->prefix_len * sizeof(char)); -- cgit v0.12