Skip to content

Commit

Permalink
Don't cast function pointers to void*
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Schuchart <[email protected]>
  • Loading branch information
devreal committed Jun 11, 2024
1 parent 1f4884e commit 790a7b6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ompi/request/request.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ typedef struct ompi_request_t ompi_request_t;
#define REQUEST_PENDING (void *)0L
#define REQUEST_COMPLETED (void *)1L

#define REQUEST_CB_PENDING (void *)0L
#define REQUEST_CB_COMPLETED (void *)1L

#define REQUEST_CB_PENDING (ompi_request_complete_fn_t)0L
#define REQUEST_CB_COMPLETED (ompi_request_complete_fn_t)1L

struct ompi_predefined_request_t {
struct ompi_request_t request;
Expand Down Expand Up @@ -566,9 +565,9 @@ static inline int ompi_request_set_callback(ompi_request_t* request,
{
request->req_complete_cb_data = cb_data;
opal_atomic_wmb();
if ((REQUEST_CB_COMPLETED == request->req_complete_cb) ||
(REQUEST_CB_COMPLETED == (void*)OPAL_ATOMIC_SWAP_PTR((opal_atomic_intptr_t*)&request->req_complete_cb,
(intptr_t)cb))) {
if ((REQUEST_CB_COMPLETED == (ompi_request_complete_fn_t)request->req_complete_cb) ||
(REQUEST_CB_COMPLETED == (ompi_request_complete_fn_t)OPAL_ATOMIC_SWAP_PTR((opal_atomic_intptr_t*)&request->req_complete_cb,
(intptr_t)cb))) {
if (NULL != cb) {
/* the request was marked at least partially completed, make sure it's fully complete */
while (!REQUEST_COMPLETE(request)) {}
Expand Down

0 comments on commit 790a7b6

Please sign in to comment.