From: Timo Heister Date: Wed, 3 Oct 2018 13:37:57 +0000 (-0400) Subject: reformat X-Git-Tag: v9.1.0-rc1~662^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7259%2Fhead;p=dealii.git reformat --- 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 *>( \