diff --git a/ompi/class/ompi_circular_buffer_fifo.h b/ompi/class/ompi_circular_buffer_fifo.h index 358bbb16b9..21a10f6239 100644 --- a/ompi/class/ompi_circular_buffer_fifo.h +++ b/ompi/class/ompi_circular_buffer_fifo.h @@ -154,7 +154,7 @@ static inline int ompi_cb_fifo_init(int size_of_fifo, fifo->mask = (size - 1); /* allocate fifo array */ - buf = memory_allocator->mpool_alloc(memory_allocator, + buf = (char *) memory_allocator->mpool_alloc(memory_allocator, sizeof(void *) * size + 2*CACHE_LINE_SIZE, CACHE_LINE_SIZE, 0, NULL); if (NULL == buf) { diff --git a/ompi/class/ompi_free_list.c b/ompi/class/ompi_free_list.c index 1dbea6e084..7a5af6f44a 100644 --- a/ompi/class/ompi_free_list.c +++ b/ompi/class/ompi_free_list.c @@ -157,7 +157,7 @@ int ompi_free_list_grow(ompi_free_list_t* flist, size_t num_elements) elem_size = OPAL_ALIGN(flist->fl_elem_size - flist->fl_elem_class->cls_sizeof, flist->fl_alignment, size_t); if(elem_size != 0) { - mpool_alloc_ptr = flist->fl_mpool->mpool_alloc(flist->fl_mpool, + mpool_alloc_ptr = (unsigned char *) flist->fl_mpool->mpool_alloc(flist->fl_mpool, num_elements * elem_size, flist->fl_alignment, MCA_MPOOL_FLAGS_CACHE_BYPASS, ®); if(NULL == mpool_alloc_ptr) { diff --git a/ompi/datatype/convertor.c b/ompi/datatype/convertor.c index e4f807a907..17e6e16460 100644 --- a/ompi/datatype/convertor.c +++ b/ompi/datatype/convertor.c @@ -246,7 +246,7 @@ int32_t ompi_convertor_pack( ompi_convertor_t* pConv, goto complete_contiguous_data_pack; } if( OPAL_LIKELY(NULL == iov[i].iov_base) ) - iov[i].iov_base = base_pointer; + iov[i].iov_base = (IOVBASE_TYPE *) base_pointer; else MEMCPY( iov[i].iov_base, base_pointer, iov[i].iov_len ); pending_length -= iov[i].iov_len; @@ -258,7 +258,7 @@ int32_t ompi_convertor_pack( ompi_convertor_t* pConv, complete_contiguous_data_pack: iov[i].iov_len = pending_length; if( OPAL_LIKELY(NULL == iov[i].iov_base) ) - iov[i].iov_base = base_pointer; + iov[i].iov_base = (IOVBASE_TYPE *) base_pointer; else MEMCPY( iov[i].iov_base, base_pointer, iov[i].iov_len ); pConv->bConverted = pConv->local_size; diff --git a/ompi/datatype/datatype_pack.c b/ompi/datatype/datatype_pack.c index bb5e8c78a2..38b32f025d 100644 --- a/ompi/datatype/datatype_pack.c +++ b/ompi/datatype/datatype_pack.c @@ -71,7 +71,7 @@ ompi_pack_homogeneous_contig_function( ompi_convertor_t* pConv, if( (size_t)iov[iov_count].iov_len > length ) iov[iov_count].iov_len = length; if( iov[iov_count].iov_base == NULL ) { - iov[iov_count].iov_base = source_base; + iov[iov_count].iov_base = (IOVBASE_TYPE *) source_base; COMPUTE_CSUM( iov[iov_count].iov_base, iov[iov_count].iov_len, pConv ); } else { /* contiguous data just memcpy the smallest data in the user buffer */ @@ -133,7 +133,7 @@ ompi_pack_homogeneous_contig_with_gaps_function( ompi_convertor_t* pConv, if( (uint32_t)pStack->count < ((*out_size) - iov_count) ) { pStack[1].count = pData->size - (pConv->bConverted % pData->size); for( index = iov_count; i < pConv->count; i++, index++ ) { - iov[index].iov_base = user_memory; + iov[index].iov_base = (IOVBASE_TYPE *) user_memory; iov[index].iov_len = pStack[1].count; pStack[0].disp += extent; total_bytes_converted += pStack[1].count; @@ -156,13 +156,13 @@ ompi_pack_homogeneous_contig_with_gaps_function( ompi_convertor_t* pConv, for( index = iov_count; (i < pConv->count) && (index < (*out_size)); i++, index++ ) { if( max_allowed < pData->size ) { - iov[index].iov_base = user_memory; + iov[index].iov_base = (IOVBASE_TYPE *) user_memory; iov[index].iov_len = max_allowed; max_allowed = 0; COMPUTE_CSUM( iov[index].iov_base, iov[index].iov_len, pConv ); break; } else { - iov[index].iov_base = user_memory; + iov[index].iov_base = (IOVBASE_TYPE *) user_memory; iov[index].iov_len = pData->size; user_memory += extent; COMPUTE_CSUM( iov[index].iov_base, (size_t)iov[index].iov_len, pConv ); @@ -185,7 +185,7 @@ ompi_pack_homogeneous_contig_with_gaps_function( ompi_convertor_t* pConv, uint32_t counter; size_t done; - packed_buffer = iov[iov_count].iov_base; + packed_buffer = (unsigned char *) iov[iov_count].iov_base; done = pConv->bConverted - i * pData->size; /* partial data from last pack */ if( done != 0 ) { /* still some data to copy from the last time */ done = pData->size - done; @@ -281,7 +281,7 @@ ompi_generic_simple_pack_function( ompi_convertor_t* pConvertor, pConvertor->stack_pos, pStack->index, (int)pStack->count, (long)pStack->disp ); ); for( iov_count = 0; iov_count < (*out_size); iov_count++ ) { - destination = iov[iov_count].iov_base; + destination = (unsigned char *) iov[iov_count].iov_base; iov_len_local = iov[iov_count].iov_len; while( 1 ) { while( pElem->elem.common.flags & DT_FLAG_DATA ) { diff --git a/ompi/datatype/datatype_unpack.c b/ompi/datatype/datatype_unpack.c index 523a7d816a..8bfb3d9d88 100644 --- a/ompi/datatype/datatype_unpack.c +++ b/ompi/datatype/datatype_unpack.c @@ -385,7 +385,7 @@ ompi_generic_simple_unpack_function( ompi_convertor_t* pConvertor, for( iov_count = 0; iov_count < (*out_size); iov_count++ ) { - packed_buffer = iov[iov_count].iov_base; + packed_buffer = (unsigned char *) iov[iov_count].iov_base; iov_len_local = iov[iov_count].iov_len; if( 0 != pConvertor->partial_length ) { size_t element_length = ompi_ddt_basicDatatypes[pElem->elem.common.type]->size; diff --git a/ompi/mca/btl/tcp/btl_tcp_component.c b/ompi/mca/btl/tcp/btl_tcp_component.c index 85b0580141..83a70d2fd2 100644 --- a/ompi/mca/btl/tcp/btl_tcp_component.c +++ b/ompi/mca/btl/tcp/btl_tcp_component.c @@ -374,7 +374,7 @@ static int mca_btl_tcp_component_create_instances(void) return OMPI_ERROR; } - kindexes = malloc(sizeof(int) * if_count); + kindexes = (int *) malloc(sizeof(int) * if_count); if (NULL == kindexes) { return OMPI_ERR_OUT_OF_RESOURCE; } diff --git a/ompi/mca/coll/tuned/coll_tuned_alltoall.c b/ompi/mca/coll/tuned/coll_tuned_alltoall.c index ef22aa4eba..8eef126751 100644 --- a/ompi/mca/coll/tuned/coll_tuned_alltoall.c +++ b/ompi/mca/coll/tuned/coll_tuned_alltoall.c @@ -195,7 +195,7 @@ int ompi_coll_tuned_alltoall_intra_bruck(void *sbuf, int scount, if (err != MPI_SUCCESS) { line = __LINE__; goto err_hndl; } /* Copy back new data from recvbuf to tmpbuf */ - err = ompi_ddt_copy_content_same_ddt(new_ddt, 1,tmpbuf, rbuf); + err = ompi_ddt_copy_content_same_ddt(new_ddt, 1,tmpbuf, (char *) rbuf); if (err < 0) { line = __LINE__; err = -1; goto err_hndl; } /* free ddt */ diff --git a/ompi/mca/coll/tuned/coll_tuned_gather.c b/ompi/mca/coll/tuned/coll_tuned_gather.c index 5a1fd1dd70..66fc944644 100644 --- a/ompi/mca/coll/tuned/coll_tuned_gather.c +++ b/ompi/mca/coll/tuned/coll_tuned_gather.c @@ -78,7 +78,7 @@ ompi_coll_tuned_gather_intra_binomial(void *sbuf, int scount, if (rank == root) { if (0 == root){ /* root on 0, just use the recv buffer */ - ptmp = rbuf; + ptmp = (char *) rbuf; if (sbuf != MPI_IN_PLACE) { err = ompi_ddt_sndrcv(sbuf, scount, sdtype, ptmp, rcount, rdtype); @@ -87,7 +87,7 @@ ompi_coll_tuned_gather_intra_binomial(void *sbuf, int scount, } else { /* root is not on 0, allocate temp buffer for recv, * rotate data at the end */ - tempbuf = malloc(rtrue_extent + (rcount*size - 1) * rextent); + tempbuf = (char *) malloc(rtrue_extent + (rcount*size - 1) * rextent); if (NULL == tempbuf) { err= OMPI_ERR_OUT_OF_RESOURCE; line = __LINE__; goto err_hndl; } @@ -110,7 +110,7 @@ ompi_coll_tuned_gather_intra_binomial(void *sbuf, int scount, /* other non-leaf nodes, allocate temp buffer for data received from * children, the most we need is half of the total data elements due * to the property of binimoal tree */ - tempbuf = malloc(strue_extent + (scount*size - 1) * sextent); + tempbuf = (char *) malloc(strue_extent + (scount*size - 1) * sextent); if (NULL == tempbuf) { err= OMPI_ERR_OUT_OF_RESOURCE; line = __LINE__; goto err_hndl; } @@ -130,7 +130,7 @@ ompi_coll_tuned_gather_intra_binomial(void *sbuf, int scount, } else { /* leaf nodes, no temp buffer needed, use sdtype,scount as * rdtype,rdcount since they are ignored on non-root procs */ - ptmp = sbuf; + ptmp = (char *) sbuf; total_recv = scount; } @@ -180,7 +180,7 @@ ompi_coll_tuned_gather_intra_binomial(void *sbuf, int scount, err = ompi_ddt_copy_content_same_ddt(rdtype, rcount*root, - rbuf, ptmp + rextent*rcount*(size-root)); + (char *) rbuf, ptmp + rextent*rcount*(size-root)); if (MPI_SUCCESS != err) { line = __LINE__; goto err_hndl; } free(tempbuf); diff --git a/ompi/mca/coll/tuned/coll_tuned_reduce.c b/ompi/mca/coll/tuned/coll_tuned_reduce.c index 211f317ea5..5c00035f38 100644 --- a/ompi/mca/coll/tuned/coll_tuned_reduce.c +++ b/ompi/mca/coll/tuned/coll_tuned_reduce.c @@ -521,7 +521,7 @@ int ompi_coll_tuned_reduce_intra_in_order_binary( void *sendbuf, void *recvbuf, ompi_ddt_get_true_extent(datatype, &tlb, &text); if ((root == rank) && (MPI_IN_PLACE == sendbuf)) { - tmpbuf = malloc(text + (count - 1) * ext); + tmpbuf = (char *) malloc(text + (count - 1) * ext); if (NULL == tmpbuf) { return MPI_ERR_INTERN; } @@ -530,7 +530,7 @@ int ompi_coll_tuned_reduce_intra_in_order_binary( void *sendbuf, void *recvbuf, (char*)recvbuf); use_this_sendbuf = tmpbuf; } else if (io_root == rank) { - tmpbuf = malloc(text + (count - 1) * ext); + tmpbuf = (char *) malloc(text + (count - 1) * ext); if (NULL == tmpbuf) { return MPI_ERR_INTERN; } diff --git a/ompi/mca/coll/tuned/coll_tuned_reduce_scatter.c b/ompi/mca/coll/tuned/coll_tuned_reduce_scatter.c index 30d007f9ff..bd2131fbbe 100644 --- a/ompi/mca/coll/tuned/coll_tuned_reduce_scatter.c +++ b/ompi/mca/coll/tuned/coll_tuned_reduce_scatter.c @@ -603,7 +603,7 @@ ompi_coll_tuned_reduce_scatter_intra_ring(void *sbuf, void *rbuf, int *rcounts, ompi_op_reduce(op, inbuf[inbi], tmprecv, rcounts[rank], dtype); /* Copy result from tmprecv to rbuf */ - ret = ompi_ddt_copy_content_same_ddt(dtype, rcounts[rank], rbuf, tmprecv); + ret = ompi_ddt_copy_content_same_ddt(dtype, rcounts[rank], (char *) rbuf, tmprecv); if (ret < 0) { line = __LINE__; goto error_hndl; } if (NULL != displs) free(displs); diff --git a/ompi/mca/coll/tuned/coll_tuned_scatter.c b/ompi/mca/coll/tuned/coll_tuned_scatter.c index f49dbdb6ed..5652463983 100644 --- a/ompi/mca/coll/tuned/coll_tuned_scatter.c +++ b/ompi/mca/coll/tuned/coll_tuned_scatter.c @@ -76,7 +76,7 @@ ompi_coll_tuned_scatter_intra_binomial(void *sbuf, int scount, if (rank == root) { if (0 == root) { /* root on 0, just use the send buffer */ - ptmp = sbuf; + ptmp = (char *) sbuf; if (rbuf != MPI_IN_PLACE) { /* local copy to rbuf */ err = ompi_ddt_sndrcv(sbuf, scount, sdtype, @@ -85,7 +85,7 @@ ompi_coll_tuned_scatter_intra_binomial(void *sbuf, int scount, } } else { /* root is not on 0, allocate temp buffer for send */ - tempbuf = malloc(strue_extent + (scount*size - 1) * sextent); + tempbuf = (char *) malloc(strue_extent + (scount*size - 1) * sextent); if (NULL == tempbuf) { err = OMPI_ERR_OUT_OF_RESOURCE; line = __LINE__; goto err_hndl; } @@ -99,7 +99,7 @@ ompi_coll_tuned_scatter_intra_binomial(void *sbuf, int scount, err = ompi_ddt_copy_content_same_ddt(sdtype, scount*root, - ptmp + sextent*scount*(size - root), sbuf); + ptmp + sextent*scount*(size - root), (char *) sbuf); if (MPI_SUCCESS != err) { line = __LINE__; goto err_hndl; } if (rbuf != MPI_IN_PLACE) { @@ -113,7 +113,7 @@ ompi_coll_tuned_scatter_intra_binomial(void *sbuf, int scount, } else if (!(vrank % 2)) { /* non-root, non-leaf nodes, allocte temp buffer for recv * the most we need is rcount*size/2 */ - tempbuf = malloc(rtrue_extent + (rcount*size - 1) * rextent); + tempbuf = (char *) malloc(rtrue_extent + (rcount*size - 1) * rextent); if (NULL == tempbuf) { err= OMPI_ERR_OUT_OF_RESOURCE; line = __LINE__; goto err_hndl; } @@ -126,7 +126,7 @@ ompi_coll_tuned_scatter_intra_binomial(void *sbuf, int scount, total_send = scount; } else { /* leaf nodes, just use rbuf */ - ptmp = rbuf; + ptmp = (char *) rbuf; } if (!(vrank % 2)) { diff --git a/ompi/mca/osc/rdma/osc_rdma_component.c b/ompi/mca/osc/rdma/osc_rdma_component.c index 3186de8d25..2d0dc06b63 100644 --- a/ompi/mca/osc/rdma/osc_rdma_component.c +++ b/ompi/mca/osc/rdma/osc_rdma_component.c @@ -365,7 +365,7 @@ ompi_osc_rdma_component_select(ompi_win_t *win, /* buffer setup */ module->m_use_buffers = check_config_value_bool("use_buffers", info); - module->m_pending_buffers = malloc(sizeof(ompi_osc_rdma_buffer_t) * + module->m_pending_buffers = (ompi_osc_rdma_buffer_t *) malloc(sizeof(ompi_osc_rdma_buffer_t) * ompi_comm_size(module->m_comm)); memset(module->m_pending_buffers, 0, sizeof(ompi_osc_rdma_buffer_t) * ompi_comm_size(module->m_comm)); @@ -1125,7 +1125,7 @@ setup_rdma(ompi_osc_rdma_module_t *module) #endif /* create a setup info structure */ - module->m_setup_info = malloc(sizeof(ompi_osc_rdma_setup_info_t)); + module->m_setup_info = (ompi_osc_rdma_setup_info_t *) malloc(sizeof(ompi_osc_rdma_setup_info_t)); if (NULL == module->m_setup_info) { ret = OMPI_ERR_TEMP_OUT_OF_RESOURCE; goto cleanup; @@ -1134,7 +1134,7 @@ setup_rdma(ompi_osc_rdma_module_t *module) module->m_setup_info->num_btls_expected = -1; module->m_setup_info->num_btls_outgoing = 0; module->m_setup_info->outstanding_btl_requests = - malloc(sizeof(opal_list_t) * ompi_comm_size(module->m_comm)); + (opal_list_t *) malloc(sizeof(opal_list_t) * ompi_comm_size(module->m_comm)); if (NULL == module->m_setup_info->outstanding_btl_requests) { ret = OMPI_ERR_TEMP_OUT_OF_RESOURCE; goto cleanup; @@ -1271,7 +1271,7 @@ setup_rdma(ompi_osc_rdma_module_t *module) } /* fill in information about remote peers */ - remote = malloc(sizeof(uint64_t) * ompi_comm_size(module->m_comm)); + remote = (uint64_t *) malloc(sizeof(uint64_t) * ompi_comm_size(module->m_comm)); if (NULL == remote) { ret = OMPI_ERR_TEMP_OUT_OF_RESOURCE; goto cleanup; diff --git a/ompi/mca/pml/ob1/pml_ob1.c b/ompi/mca/pml/ob1/pml_ob1.c index 586a777b40..a2d1bd3272 100644 --- a/ompi/mca/pml/ob1/pml_ob1.c +++ b/ompi/mca/pml/ob1/pml_ob1.c @@ -596,7 +596,8 @@ int mca_pml_ob1_ft_event( int state ) int mca_pml_ob1_com_btl_comp(const void *v1, const void *v2) { - const mca_pml_ob1_com_btl_t *b1 = v1, *b2 = v2; + const mca_pml_ob1_com_btl_t *b1 = (const mca_pml_ob1_com_btl_t *) v1; + const mca_pml_ob1_com_btl_t *b2 = (const mca_pml_ob1_com_btl_t *) v2; if(b1->bml_btl->btl_weight < b2->bml_btl->btl_weight) return 1;