diff --git a/src/datatype/datatype.h b/src/datatype/datatype.h index 228c74ae30..45ee901237 100644 --- a/src/datatype/datatype.h +++ b/src/datatype/datatype.h @@ -100,11 +100,11 @@ dt_desc_t* ompi_ddt_create( int expectedSize ); int ompi_ddt_commit( dt_desc_t** ); int ompi_ddt_destroy( dt_desc_t** ); static inline int ompi_ddt_is_committed( ompi_datatype_t* type ) -{ return (type->flags & DT_FLAG_COMMITED); } +{ return ((type->flags & DT_FLAG_COMMITED) == DT_FLAG_COMMITED); } static inline int ompi_ddt_is_overlapped( ompi_datatype_t* type ) -{ return (type->flags & DT_FLAG_OVERLAP); } +{ return ((type->flags & DT_FLAG_OVERLAP) == DT_FLAG_OVERLAP); } static inline int ompi_ddt_is_acceptable_for_one_sided( ompi_datatype_t* type ) -{ return (type->flags & DT_FLAG_ONE_SIDED); } +{ return ((type->flags & DT_FLAG_ONE_SIDED) == DT_FLAG_ONE_SIDED); } void ompi_ddt_dump( dt_desc_t* pData ); /* data creation functions */ int ompi_ddt_duplicate( dt_desc_t* oldType, dt_desc_t** newType ); diff --git a/src/mpi/c/bindings.h b/src/mpi/c/bindings.h index acda998d94..8bcda6b7e9 100644 --- a/src/mpi/c/bindings.h +++ b/src/mpi/c/bindings.h @@ -24,28 +24,31 @@ extern bool ompi_mpi_param_check; * on the top level MPI functions, as they does not trigger the error handler. Is the user * responsability to do it. */ -#define OMPI_CHECK_DATATYPE_FOR_SEND( RC, DDT, COUNT ) \ -do { \ - if( NULL == (DDT) || MPI_DATATYPE_NULL == (DDT) ) (RC) = MPI_ERR_TYPE; \ - else if( (COUNT) < 0 ) (RC) = MPI_ERR_COUNT; \ - else if( !ompi_ddt_is_committed((DDT)) ) (RC) = MPI_ERR_TYPE; \ -} while (0) +#define OMPI_CHECK_DATATYPE_FOR_SEND( RC, DDT, COUNT ) \ + do { \ + (RC) = MPI_SUCCESS; \ + if( NULL == (DDT) || MPI_DATATYPE_NULL == (DDT) ) (RC) = MPI_ERR_TYPE; \ + else if( (COUNT) < 0 ) (RC) = MPI_ERR_COUNT; \ + else if( !ompi_ddt_is_committed((DDT)) ) (RC) = MPI_ERR_TYPE; \ + } while (0) #define OMPI_CHECK_DATATYPE_FOR_RECV( RC, DDT, COUNT ) \ -do { \ - if( NULL == (DDT) || MPI_DATATYPE_NULL == (DDT) ) (RC) = MPI_ERR_TYPE; \ - else if( (COUNT) < 0 ) (RC) = MPI_ERR_COUNT; \ - else if( !ompi_ddt_is_committed((DDT)) ) (RC) = MPI_ERR_TYPE; \ - else if( ompi_ddt_is_overlapped((DDT)) ) (RC) = MPI_ERR_TYPE; \ -} while (0) + do { \ + (RC) = MPI_SUCCESS; \ + if( NULL == (DDT) || MPI_DATATYPE_NULL == (DDT) ) (RC) = MPI_ERR_TYPE; \ + else if( (COUNT) < 0 ) (RC) = MPI_ERR_COUNT; \ + else if( !ompi_ddt_is_committed((DDT)) ) (RC) = MPI_ERR_TYPE; \ + else if( ompi_ddt_is_overlapped((DDT)) ) (RC) = MPI_ERR_TYPE; \ + } while (0) -#define OMPI_CHECK_DATATYPE_FOR_ONE_SIDED( RC, DDT, COUNT ) \ -do { \ - if( NULL == (DDT) || MPI_DATATYPE_NULL == (DDT) ) (RC) = MPI_ERR_TYPE; \ - else if( (COUNT) < 0 ) (RC) = MPI_ERR_COUNT; \ - else if( !ompi_ddt_is_committed((DDT)) ) (RC) = MPI_ERR_TYPE; \ - else if( ompi_ddt_is_overerlapped((DDT)) ) (RC) = MPI_ERR_TYPE; \ - else if( !ompi_ddt_is_acceptable_for_one_sided((DDT)) ) (RC) = MPI_ERR_TYPE; \ -} while(0) +#define OMPI_CHECK_DATATYPE_FOR_ONE_SIDED( RC, DDT, COUNT ) \ + do { \ + (RC) = MPI_SUCCESS; \ + if( NULL == (DDT) || MPI_DATATYPE_NULL == (DDT) ) (RC) = MPI_ERR_TYPE; \ + else if( (COUNT) < 0 ) (RC) = MPI_ERR_COUNT; \ + else if( !ompi_ddt_is_committed((DDT)) ) (RC) = MPI_ERR_TYPE; \ + else if( ompi_ddt_is_overerlapped((DDT)) ) (RC) = MPI_ERR_TYPE; \ + else if( !ompi_ddt_is_acceptable_for_one_sided((DDT)) ) (RC) = MPI_ERR_TYPE; \ + } while(0) #endif /* OMPI_C_BINDINGS_H */