Skip to content

Commit 31f7b91

Browse files
committed
Don't cast function pointers to void*
Signed-off-by: Joseph Schuchart <[email protected]>
1 parent 638c008 commit 31f7b91

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

ompi/request/request.h

+5-6
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,8 @@ typedef struct ompi_request_t ompi_request_t;
139139
#define REQUEST_PENDING (void *)0L
140140
#define REQUEST_COMPLETED (void *)1L
141141

142-
#define REQUEST_CB_PENDING (void *)0L
143-
#define REQUEST_CB_COMPLETED (void *)1L
144-
142+
#define REQUEST_CB_PENDING (ompi_request_complete_fn_t)0L
143+
#define REQUEST_CB_COMPLETED (ompi_request_complete_fn_t)1L
145144

146145
struct ompi_predefined_request_t {
147146
struct ompi_request_t request;
@@ -566,9 +565,9 @@ static inline int ompi_request_set_callback(ompi_request_t* request,
566565
{
567566
request->req_complete_cb_data = cb_data;
568567
opal_atomic_wmb();
569-
if ((REQUEST_CB_COMPLETED == request->req_complete_cb) ||
570-
(REQUEST_CB_COMPLETED == (void*)OPAL_ATOMIC_SWAP_PTR((opal_atomic_intptr_t*)&request->req_complete_cb,
571-
(intptr_t)cb))) {
568+
if ((REQUEST_CB_COMPLETED == (ompi_request_complete_fn_t)request->req_complete_cb) ||
569+
(REQUEST_CB_COMPLETED == (ompi_request_complete_fn_t)OPAL_ATOMIC_SWAP_PTR((opal_atomic_intptr_t*)&request->req_complete_cb,
570+
(intptr_t)cb))) {
572571
if (NULL != cb) {
573572
/* the request was marked at least partially completed, make sure it's fully complete */
574573
while (!REQUEST_COMPLETE(request)) {}

0 commit comments

Comments
 (0)