From 784337aab10e6145a03cb4f830759c8ffb726a50 Mon Sep 17 00:00:00 2001 From: Vishwanath Venkatesan Date: Wed, 3 Apr 2013 17:06:02 +0000 Subject: [PATCH] typecasting with intptr_t to remove warnings This commit was SVN r28276. --- .../two_phase/fcoll_two_phase_file_read_all.c | 18 +++++++++--------- .../two_phase/fcoll_two_phase_file_write_all.c | 16 ++++++++-------- .../two_phase/fcoll_two_phase_support_fns.c | 4 ++-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c index 7e8867ef3a..e5605cfbc5 100644 --- a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c +++ b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c @@ -259,7 +259,7 @@ mca_fcoll_two_phase_file_read_all (mca_io_ompio_file_t *fh, flat_buf->count = local_size; i=0;j=0; while(j < local_size){ - flat_buf->indices[j] = (OMPI_MPI_OFFSET_TYPE)decoded_iov[i].iov_base; + flat_buf->indices[j] = (OMPI_MPI_OFFSET_TYPE)(intptr_t)decoded_iov[i].iov_base; flat_buf->blocklens[j] = decoded_iov[i].iov_len; if(i < (int)iov_count) @@ -289,9 +289,9 @@ mca_fcoll_two_phase_file_read_all (mca_io_ompio_file_t *fh, } #endif - start_offset = (OMPI_MPI_OFFSET_TYPE)iov[0].iov_base; - end_offset = (OMPI_MPI_OFFSET_TYPE)iov[local_count-1].iov_base + - (OMPI_MPI_OFFSET_TYPE)iov[local_count-1].iov_len - 1; + start_offset = (OMPI_MPI_OFFSET_TYPE)(intptr_t)iov[0].iov_base; + end_offset = (OMPI_MPI_OFFSET_TYPE)(intptr_t)iov[local_count-1].iov_base + + (OMPI_MPI_OFFSET_TYPE)(intptr_t)iov[local_count-1].iov_len - 1; #if DEBUG printf("%d: START OFFSET:%ld, END OFFSET:%ld\n", @@ -654,9 +654,9 @@ static int two_phase_read_and_exch(mca_io_ompio_file_t *fh, &(others_req[i].mem_ptrs[j])); send_size[i] += (int)(OMPIO_MIN(real_off + real_size - req_off, - (OMPI_MPI_OFFSET_TYPE)(unsigned)req_len)); + (OMPI_MPI_OFFSET_TYPE)req_len)); - if (real_off+real_size-req_off < (OMPI_MPI_OFFSET_TYPE)(unsigned)req_len) { + if (real_off+real_size-req_off < (OMPI_MPI_OFFSET_TYPE)req_len) { partial_send[i] = (int) (real_off + real_size - req_off); if ((j+1 < others_req[i].count) && (others_req[i].offsets[j+1] < @@ -693,7 +693,7 @@ static int two_phase_read_and_exch(mca_io_ompio_file_t *fh, opal_output(1, "OUT OF MEMORY\n"); return OMPI_ERR_OUT_OF_RESOURCE; } - fh->f_io_array[0].offset = (IOVBASE_TYPE *) off; + fh->f_io_array[0].offset = (IOVBASE_TYPE *)(intptr_t)off; fh->f_io_array[0].length = len; fh->f_io_array[0].memory_address = read_buf+for_curr_iter; @@ -1029,7 +1029,7 @@ static int two_phase_exchange_data(mca_io_ompio_file_t *fh, n_buftypes++; \ } \ user_buf_idx = flat_buf->indices[flat_buf_idx] + \ - (OMPI_MPI_OFFSET_TYPE)n_buftypes*(OMPI_MPI_OFFSET_TYPE)buftype_extent; \ + (OMPI_MPI_OFFSET_TYPE)n_buftypes*(OMPI_MPI_OFFSET_TYPE)buftype_extent; \ flat_buf_sz = flat_buf->blocklens[flat_buf_idx]; \ } \ size -= size_in_buf; \ @@ -1086,7 +1086,7 @@ static void two_phase_fill_user_buffer(mca_io_ompio_file_t *fh, for (i=0; iindices = - (OMPI_MPI_OFFSET_TYPE *)malloc(local_size * - sizeof(OMPI_MPI_OFFSET_TYPE)); + (OMPI_MPI_OFFSET_TYPE *)malloc(local_size * + sizeof(OMPI_MPI_OFFSET_TYPE)); if ( NULL == flat_buf->indices ){ ret = OMPI_ERR_OUT_OF_RESOURCE; goto exit; @@ -304,7 +304,7 @@ mca_fcoll_two_phase_file_write_all (mca_io_ompio_file_t *fh, flat_buf->count = local_size; i=0;j=0; while(j < local_size){ - flat_buf->indices[j] = (OMPI_MPI_OFFSET_TYPE)decoded_iov[i].iov_base; + flat_buf->indices[j] = (OMPI_MPI_OFFSET_TYPE)(intptr_t)decoded_iov[i].iov_base; flat_buf->blocklens[j] = decoded_iov[i].iov_len; if(i < (int)iov_count) i+=1; @@ -334,8 +334,8 @@ mca_fcoll_two_phase_file_write_all (mca_io_ompio_file_t *fh, #endif - start_offset = (OMPI_MPI_OFFSET_TYPE)iov[0].iov_base; - end_offset = (OMPI_MPI_OFFSET_TYPE)iov[local_count-1].iov_base + + start_offset = (OMPI_MPI_OFFSET_TYPE)(intptr_t)iov[0].iov_base; + end_offset = (OMPI_MPI_OFFSET_TYPE)(intptr_t)iov[local_count-1].iov_base + (OMPI_MPI_OFFSET_TYPE)iov[local_count-1].iov_len - 1; #if DEBUG_ON @@ -790,7 +790,7 @@ static int two_phase_exch_and_write(mca_io_ompio_file_t *fh, return OMPI_ERR_OUT_OF_RESOURCE; } - fh->f_io_array[0].offset =(IOVBASE_TYPE *) off; + fh->f_io_array[0].offset =(IOVBASE_TYPE *)(intptr_t) off; fh->f_io_array[0].length = len; fh->f_io_array[0].memory_address = write_buf; fh->f_num_of_io_entries = 1; @@ -1038,7 +1038,7 @@ static int two_phase_exchage_data(mca_io_ompio_file_t *fh, opal_output(1, "OUT OF MEMORY\n"); return OMPI_ERR_OUT_OF_RESOURCE; } - fh->f_io_array[0].offset =(IOVBASE_TYPE *) off; + fh->f_io_array[0].offset =(IOVBASE_TYPE *)(intptr_t) off; fh->f_num_of_io_entries = 1; fh->f_io_array[0].length = size; fh->f_io_array[0].memory_address = write_buf; @@ -1250,7 +1250,7 @@ static int two_phase_fill_send_buffer(mca_io_ompio_file_t *fh, for (i=0; i