diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2002-06-19 16:08:27 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2002-06-19 16:08:27 (GMT) |
commit | 8bb096b6977a90df82ca3d32287aa2a7abeb5510 (patch) | |
tree | c63e215da154603f99afff0b9d9b31149a9c2e5c /src | |
parent | c0c4219b5084ebcbcfe56bb807ece294f2f4f4aa (diff) | |
download | hdf5-8bb096b6977a90df82ca3d32287aa2a7abeb5510.zip hdf5-8bb096b6977a90df82ca3d32287aa2a7abeb5510.tar.gz hdf5-8bb096b6977a90df82ca3d32287aa2a7abeb5510.tar.bz2 |
[svn-r5675] Purpose:
Code cleanup
Description:
Removed more compiler warnings, etc.
Platforms tested:
Linux 2.2.x (eirene) w/parallel
Diffstat (limited to 'src')
-rw-r--r-- | src/H5D.c | 8 | ||||
-rw-r--r-- | src/H5Distore.c | 9 | ||||
-rw-r--r-- | src/H5FDmpio.c | 16 | ||||
-rw-r--r-- | src/H5Fistore.c | 9 | ||||
-rw-r--r-- | src/H5S.c | 6 | ||||
-rw-r--r-- | src/H5Smpio.c | 6 | ||||
-rw-r--r-- | src/H5T.c | 2 |
7 files changed, 27 insertions, 29 deletions
@@ -1606,7 +1606,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, hbool_t must_convert; /*have to xfer the slow way*/ #ifdef H5_HAVE_PARALLEL H5FD_mpio_dxpl_t *dx = NULL; - H5FD_mpio_xfer_t xfer_mode; /*xfer_mode for this request */ + H5FD_mpio_xfer_t xfer_mode=H5FD_MPIO_INDEPENDENT; /*xfer_mode for this request */ hbool_t xfer_mode_changed=0; /*xfer_mode needs restore */ hbool_t doing_mpio=0; /*This is an MPIO access */ #endif @@ -1654,7 +1654,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, /* Collect Parallel I/O information for possible later use */ if (H5FD_MPIO==xfer_parms->driver_id){ doing_mpio++; - if (dx=xfer_parms->driver_info){ + if ((dx=xfer_parms->driver_info)!=NULL){ xfer_mode = dx->xfer_mode; }else HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, @@ -2060,7 +2060,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, hbool_t must_convert; /*have to xfer the slow way*/ #ifdef H5_HAVE_PARALLEL H5FD_mpio_dxpl_t *dx = NULL; - H5FD_mpio_xfer_t xfer_mode; /*xfer_mode for this request */ + H5FD_mpio_xfer_t xfer_mode=H5FD_MPIO_INDEPENDENT; /*xfer_mode for this request */ hbool_t xfer_mode_changed=0; /*xfer_mode needs restore */ hbool_t doing_mpio=0; /*This is an MPIO access */ #endif @@ -2137,7 +2137,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, /* Collect Parallel I/O information for possible later use */ if (H5FD_MPIO==xfer_parms->driver_id){ doing_mpio++; - if (dx=xfer_parms->driver_info){ + if ((dx=xfer_parms->driver_info)!=NULL){ xfer_mode = dx->xfer_mode; }else HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, diff --git a/src/H5Distore.c b/src/H5Distore.c index cbfa1bf..ce29bbf 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -2317,7 +2317,8 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, } /* 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 */ @@ -2326,12 +2327,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 */ /* Retrieve up MPI parameters */ @@ -2359,7 +2360,7 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, /* Round-robin write the chunks out from only one process */ if(mpi_round==mpi_rank) { - if (H5F_block_write(f, H5FD_MEM_DRAW, udata.addr, udata.key.nbytes, dxpl_id, chunk)<0) + if (H5F_block_write(f, H5FD_MEM_DRAW, udata.addr, (hsize_t)udata.key.nbytes, dxpl_id, chunk)<0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file"); } /* end if */ mpi_round=(++mpi_round)%mpi_size; diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 4d360d7..6724d18 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -428,7 +428,7 @@ H5FD_mpio_communicator(H5FD_t *_file) { H5FD_mpio_t *file = (H5FD_mpio_t*)_file; - FUNC_ENTER(H5FD_mpio_communicator, NULL); + FUNC_ENTER(H5FD_mpio_communicator, MPI_COMM_NULL); assert(file); assert(H5FD_MPIO==file->pub.driver_id); @@ -612,12 +612,15 @@ H5FD_mpio_wait_for_left_neighbor(H5FD_t *_file) { H5FD_mpio_t *file = (H5FD_mpio_t*)_file; char msgbuf[1]; - MPI_Status rcvstat = {0}; + MPI_Status rcvstat; FUNC_ENTER(H5FD_mpio_wait_for_left_neighbor, FAIL); 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 )) @@ -785,7 +788,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; @@ -991,16 +994,11 @@ 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(H5FD_mpio_query, FAIL); - assert(file); - assert(H5FD_MPIO==file->pub.driver_id); /* Set the VFL feature flags that this driver supports */ if(flags) { diff --git a/src/H5Fistore.c b/src/H5Fistore.c index cbfa1bf..ce29bbf 100644 --- a/src/H5Fistore.c +++ b/src/H5Fistore.c @@ -2317,7 +2317,8 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, } /* 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 */ @@ -2326,12 +2327,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 */ /* Retrieve up MPI parameters */ @@ -2359,7 +2360,7 @@ H5F_istore_allocate(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, /* Round-robin write the chunks out from only one process */ if(mpi_round==mpi_rank) { - if (H5F_block_write(f, H5FD_MEM_DRAW, udata.addr, udata.key.nbytes, dxpl_id, chunk)<0) + if (H5F_block_write(f, H5FD_MEM_DRAW, udata.addr, (hsize_t)udata.key.nbytes, dxpl_id, chunk)<0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file"); } /* end if */ mpi_round=(++mpi_round)%mpi_size; @@ -265,11 +265,9 @@ H5S_term_interface(void) H5I_destroy_group(H5I_DATASPACE); /* Clear/free conversion table */ - HDmemset((void*)&H5S_fconv_g[0], 0, sizeof(H5S_fconv_g)); - HDmemset((void*)&H5S_mconv_g[0], 0, sizeof(H5S_mconv_g)); + HDmemset(H5S_fconv_g, 0, sizeof(H5S_fconv_g)); + HDmemset(H5S_mconv_g, 0, sizeof(H5S_mconv_g)); - /*HDmemset(H5S_fconv_g, 0, sizeof(H5S_fconv_g)); - HDmemset(H5S_mconv_g, 0, sizeof(H5S_mconv_g));*/ for (i=0; i<H5S_nconv_g; i++) H5MM_xfree(H5S_conv_g[i]); H5S_conv_g = H5MM_xfree(H5S_conv_g); H5S_nconv_g = H5S_aconv_g = 0; diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 7469943..f44992b 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -120,7 +120,7 @@ H5S_mpio_all_type( const H5S_t *space, const size_t elmt_size, hbool_t *is_derived_type ) { hsize_t total_bytes; - int i; + unsigned u; FUNC_ENTER (H5S_mpio_all_type, FAIL); @@ -129,8 +129,8 @@ H5S_mpio_all_type( const H5S_t *space, const size_t elmt_size, /* Just treat the entire extent as a block of bytes */ total_bytes = (hsize_t)elmt_size; - for (i=0; i<space->extent.u.simple.rank; ++i) - total_bytes *= space->extent.u.simple.size[i]; + for (u=0; u<space->extent.u.simple.rank; ++u) + total_bytes *= space->extent.u.simple.size[u]; /* fill in the return values */ *new_type = MPI_BYTE; @@ -7333,7 +7333,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 */ |