From d009580500c4a2ab7a4c674bd73f50d7ab69d54f Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Tue, 14 Mar 2023 18:51:29 +0300 Subject: [PATCH] Fix definition of predefined ctx and team handles * Protect casts with parentheses ((type)value) to avoid issues with C operator precedence, cf. MPICH and Open MPI mpi.h header file. --- include/shmem.h.in.tpl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/shmem.h.in.tpl b/include/shmem.h.in.tpl index 02a25cc..09e8a81 100644 --- a/include/shmem.h.in.tpl +++ b/include/shmem.h.in.tpl @@ -88,9 +88,9 @@ typedef void* shmem_team_t; typedef struct { int num_contexts; } shmem_team_config_t; -#define SHMEM_TEAM_WORLD (shmem_team_t) 0x90000 -#define SHMEM_TEAM_SHARED (shmem_team_t) 0x90001 -#define SHMEM_TEAM_INVALID NULL +#define SHMEM_TEAM_WORLD ((shmem_team_t)0x90000) +#define SHMEM_TEAM_SHARED ((shmem_team_t)0x90001) +#define SHMEM_TEAM_INVALID ((shmem_team_t)NULL) #define SHMEM_TEAM_NUM_CONTEXTS 0x091001L @@ -104,8 +104,8 @@ typedef struct { #define SHMEM_CTX_NOSTORE 0x001003L typedef void* shmem_ctx_t; -#define SHMEM_CTX_DEFAULT (shmem_ctx_t) 0x80000 -#define SHMEM_CTX_INVALID NULL +#define SHMEM_CTX_DEFAULT ((shmem_ctx_t)0x80000) +#define SHMEM_CTX_INVALID ((shmem_ctx_t)NULL) /* Signaling Operations */ #define SHMEM_SIGNAL_SET 0