From 016782e806e0f510ffc8d07c5e86f73e2e9e8135 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Wed, 3 Oct 2018 09:37:57 -0400 Subject: [PATCH] reformat --- include/deal.II/base/mpi.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/include/deal.II/base/mpi.h b/include/deal.II/base/mpi.h index aa9b0b4bbc..359208c7d1 100644 --- a/include/deal.II/base/mpi.h +++ b/include/deal.II/base/mpi.h @@ -49,24 +49,27 @@ using MPI_Op = int; -// Helper macro to remove const from the pointer arguments to some MPI_* -// functions. -// -// This is needed as the input arguments of functions like MPI_Allgather() are -// not marked as const in OpenMPI 1.6.5. +/** Helper macro to remove const from the pointer arguments to some MPI_* + * functions. + * + * This is needed as the input arguments of functions like MPI_Allgather() are + * not marked as const in OpenMPI 1.6.5. If using MPI 3 or newer, this macro + * is a NOOP, while we do the following otherwise: + * + * 1. remove * from type of @p expr + * 2. remove const from resulting type + * 3. add * to resulting type + * 4. const_cast the given expression @p expr to this new type. + */ #ifdef DEAL_II_WITH_MPI # if DEAL_II_MPI_VERSION_GTE(3, 0) -// We are good, no casts are needed. + # define DEAL_II_MPI_CONST_CAST(expr) (expr) + # else # include -// This monster of a macro will: -// 1. remove * -// 2. remove const -// 3. add * -// 4. const_cast the given expression to this new type. # define DEAL_II_MPI_CONST_CAST(expr) \ const_cast< \ std::remove_const::type>::type *>( \ -- 2.39.5