Skip to content

Commit 5bcab7a

Browse files
committed
osc/rdma: be pedantically correct about casting types
Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
1 parent 65cf76e commit 5bcab7a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ompi/mca/osc/rdma/osc_rdma_accumulate.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* reserved.
1010
* Copyright (c) 2019-2021 Google, LLC. All rights reserved.
1111
* Copyright (c) 2021 IBM Corporation. All rights reserved.
12+
* Copyright (c) 2022 Cisco Systems, Inc. All rights reserved
1213
* $COPYRIGHT$
1314
*
1415
* Additional copyrights may follow
@@ -208,9 +209,9 @@ static int ompi_osc_rdma_fetch_and_op_cas (ompi_osc_rdma_sync_t *sync, const voi
208209
new_value = old_value;
209210

210211
if (&ompi_mpi_op_replace.op == op) {
211-
memcpy ((void *)((intptr_t) &new_value + offset), (void *)((intptr_t) origin_addr + dt->super.true_lb), extent);
212+
memcpy ((void *)((ptrdiff_t) &new_value + offset), (void *)((ptrdiff_t) origin_addr + dt->super.true_lb), extent);
212213
} else if (&ompi_mpi_op_no_op.op != op) {
213-
ompi_op_reduce (op, (void *) ((intptr_t) origin_addr + dt->super.true_lb), (void*)((intptr_t) &new_value + offset), 1, dt);
214+
ompi_op_reduce (op, (void *) ((ptrdiff_t) origin_addr + dt->super.true_lb), (void*)((ptrdiff_t) &new_value + offset), 1, dt);
214215
}
215216

216217
ret = ompi_osc_rdma_btl_cswap (module, peer->data_btl_index, peer->data_endpoint, address, target_handle,

0 commit comments

Comments
 (0)