From eab1776e9aa6d99c948b2de530ac9fc6867302c3 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Wed, 8 Nov 2006 17:02:46 +0000 Subject: [PATCH] Explicit casts for our friendly Windows environment... This commit was SVN r12496. --- ompi/errhandler/errhandler.c | 2 +- ompi/mca/btl/self/btl_self.c | 4 ++-- ompi/mca/btl/self/btl_self_frag.c | 12 ++++++------ ompi/mca/pml/base/pml_base_bsend.c | 2 +- ompi/mca/pml/dr/pml_dr_sendreq.c | 2 +- ompi/mca/pml/ob1/pml_ob1_recvreq.c | 2 +- ompi/mca/pml/ob1/pml_ob1_recvreq.h | 4 ++-- ompi/mca/pml/ob1/pml_ob1_sendreq.h | 2 +- ompi/mpi/c/add_error_string.c | 2 +- ompi/request/grequest.c | 6 +++--- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ompi/errhandler/errhandler.c b/ompi/errhandler/errhandler.c index 5e49f636dc..c8de02ff56 100644 --- a/ompi/errhandler/errhandler.c +++ b/ompi/errhandler/errhandler.c @@ -218,7 +218,7 @@ ompi_errhandler_t *ompi_errhandler_create(ompi_errhandler_type_t object_type, */ static void ompi_errhandler_construct(ompi_errhandler_t *new_errhandler) { - size_t ret_val; + int ret_val; /* assign entry in fortran <-> c translation array */ diff --git a/ompi/mca/btl/self/btl_self.c b/ompi/mca/btl/self/btl_self.c index 010bf612a4..b56222d883 100644 --- a/ompi/mca/btl/self/btl_self.c +++ b/ompi/mca/btl/self/btl_self.c @@ -77,9 +77,9 @@ int mca_btl_self_add_procs( struct mca_btl_base_module_t* btl, struct mca_btl_base_endpoint_t **peers, ompi_bitmap_t* reachability ) { - size_t i; + int i; - for( i = 0; i < nprocs; i++ ) { + for( i = 0; i < (int)nprocs; i++ ) { if( procs[i] == ompi_proc_local_proc ) { ompi_bitmap_set_bit( reachability, i ); break; /* there will always be only one ... */ diff --git a/ompi/mca/btl/self/btl_self_frag.c b/ompi/mca/btl/self/btl_self_frag.c index 201bab5ebf..55ae81e7cc 100644 --- a/ompi/mca/btl/self/btl_self_frag.c +++ b/ompi/mca/btl/self/btl_self_frag.c @@ -22,11 +22,11 @@ static inline void mca_btl_self_frag_constructor(mca_btl_self_frag_t* frag) { frag->segment.seg_addr.pval = frag+1; - frag->segment.seg_len = frag->size; - frag->base.des_src = NULL; - frag->base.des_src_cnt = 0; - frag->base.des_dst = NULL; - frag->base.des_dst_cnt = 0; + frag->segment.seg_len = (uint32_t)frag->size; + frag->base.des_src = &frag->segment; + frag->base.des_src_cnt = 1; + frag->base.des_dst = &frag->segment; + frag->base.des_dst_cnt = 1; frag->base.des_flags = 0; } @@ -46,7 +46,7 @@ static void mca_btl_self_frag_rdma_constructor(mca_btl_self_frag_t* frag) { frag->size = 0; frag->segment.seg_addr.pval = frag+1; - frag->segment.seg_len = frag->size; + frag->segment.seg_len = (uint32_t)frag->size; frag->base.des_src = NULL; frag->base.des_src_cnt = 0; frag->base.des_dst = NULL; diff --git a/ompi/mca/pml/base/pml_base_bsend.c b/ompi/mca/pml/base/pml_base_bsend.c index 39a271598b..12c4e4515c 100644 --- a/ompi/mca/pml/base/pml_base_bsend.c +++ b/ompi/mca/pml/base/pml_base_bsend.c @@ -177,7 +177,7 @@ int mca_pml_base_bsend_detach(void* addr, int* size) if(NULL != addr) *((void**)addr) = mca_pml_bsend_base; if(NULL != size) - *size = mca_pml_bsend_size; + *size = (int)mca_pml_bsend_size; /* reset local variables */ mca_pml_bsend_base = NULL; diff --git a/ompi/mca/pml/dr/pml_dr_sendreq.c b/ompi/mca/pml/dr/pml_dr_sendreq.c index a54c738ae1..273c907bd6 100644 --- a/ompi/mca/pml/dr/pml_dr_sendreq.c +++ b/ompi/mca/pml/dr/pml_dr_sendreq.c @@ -1153,7 +1153,7 @@ void mca_pml_dr_sendreq_cleanup_active(mca_btl_base_module_t* btl) { item = opal_list_get_next(item)) { mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*) item; mca_btl_base_descriptor_t* des = sendreq->req_descriptor; - mca_bml_base_btl_t* bml_btl = des->des_context; + mca_bml_base_btl_t* bml_btl = (mca_bml_base_btl_t*)des->des_context; if( bml_btl && bml_btl->btl == btl) { des->des_context = NULL; } diff --git a/ompi/mca/pml/ob1/pml_ob1_recvreq.c b/ompi/mca/pml/ob1/pml_ob1_recvreq.c index 5985b0cbe0..541e3671c3 100644 --- a/ompi/mca/pml/ob1/pml_ob1_recvreq.c +++ b/ompi/mca/pml/ob1/pml_ob1_recvreq.c @@ -37,7 +37,7 @@ static mca_pml_ob1_recv_frag_t* mca_pml_ob1_recv_request_match_specific_proc( void mca_pml_ob1_recv_request_process_pending(void) { mca_pml_ob1_recv_request_t* recvreq; - int i, s = opal_list_get_size(&mca_pml_ob1.recv_pending); + int i, s = (int)opal_list_get_size(&mca_pml_ob1.recv_pending); for(i = 0; i < s; i++) { OPAL_THREAD_LOCK(&mca_pml_ob1.lock); diff --git a/ompi/mca/pml/ob1/pml_ob1_recvreq.h b/ompi/mca/pml/ob1/pml_ob1_recvreq.h index 6d472b2d37..7af9943a55 100644 --- a/ompi/mca/pml/ob1/pml_ob1_recvreq.h +++ b/ompi/mca/pml/ob1/pml_ob1_recvreq.h @@ -148,10 +148,10 @@ do { /* initialize request status */ \ recvreq->req_recv.req_base.req_pml_complete = true; \ recvreq->req_recv.req_base.req_ompi.req_status._count = \ - recvreq->req_bytes_received; \ + (int)recvreq->req_bytes_received; \ if (recvreq->req_bytes_received > recvreq->req_bytes_delivered) { \ recvreq->req_recv.req_base.req_ompi.req_status._count = \ - recvreq->req_bytes_delivered; \ + (int)recvreq->req_bytes_delivered; \ recvreq->req_recv.req_base.req_ompi.req_status.MPI_ERROR = \ MPI_ERR_TRUNCATE; \ } \ diff --git a/ompi/mca/pml/ob1/pml_ob1_sendreq.h b/ompi/mca/pml/ob1/pml_ob1_sendreq.h index 59230389bd..a1e7f40476 100644 --- a/ompi/mca/pml/ob1/pml_ob1_sendreq.h +++ b/ompi/mca/pml/ob1/pml_ob1_sendreq.h @@ -145,7 +145,7 @@ do { (sendreq)->req_send.req_base.req_tag; \ (sendreq)->req_send.req_base.req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS; \ (sendreq)->req_send.req_base.req_ompi.req_status._count = \ - (sendreq)->req_send.req_bytes_packed; \ + (int)(sendreq)->req_send.req_bytes_packed; \ MCA_PML_BASE_REQUEST_MPI_COMPLETE( &((sendreq)->req_send.req_base.req_ompi) ); \ \ /* Could be moved to MCA_PML_BASE_REQUEST_MPI_COMPLETE, but before broadcast */ \ diff --git a/ompi/mpi/c/add_error_string.c b/ompi/mpi/c/add_error_string.c index 35098eba3f..ff5862564b 100644 --- a/ompi/mpi/c/add_error_string.c +++ b/ompi/mpi/c/add_error_string.c @@ -45,7 +45,7 @@ int MPI_Add_error_string(int errorcode, char *string) FUNC_NAME); } - rc = ompi_mpi_errcode_add_string (errorcode, string, strlen(string)+1); + rc = ompi_mpi_errcode_add_string (errorcode, string, (int)(strlen(string)+1)); if ( OMPI_SUCCESS != rc ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); diff --git a/ompi/request/grequest.c b/ompi/request/grequest.c index 6d032d6445..3fb59ff026 100644 --- a/ompi/request/grequest.c +++ b/ompi/request/grequest.c @@ -52,7 +52,7 @@ static int ompi_grequest_cancel(ompi_request_t* req, int flag) greq->greq_base.req_complete); } else { fflag = (MPI_Flogical) greq->greq_base.req_complete; - greq->greq_cancel.f_cancel(greq->greq_state, &fflag, &ierr); + greq->greq_cancel.f_cancel((MPI_Aint*)greq->greq_state, &fflag, &ierr); rc = OMPI_FINT_2_INT(ierr); } } @@ -125,7 +125,7 @@ static void ompi_grequest_destruct(ompi_grequest_t* greq) if (greq->greq_funcs_are_c) { greq->greq_free.c_free(greq->greq_state); } else { - greq->greq_free.f_free(greq->greq_state, &ierr); + greq->greq_free.f_free((MPI_Aint*)greq->greq_state, &ierr); } } @@ -214,7 +214,7 @@ int ompi_grequest_invoke_query(ompi_request_t *request, } else { MPI_Fint ierr; MPI_Fint fstatus[sizeof(MPI_Status) / sizeof(int)]; - g->greq_query.f_query(g->greq_state, fstatus, &ierr); + g->greq_query.f_query((MPI_Aint*)g->greq_state, fstatus, &ierr); MPI_Status_f2c(fstatus, status); rc = OMPI_FINT_2_INT(ierr); }