From 2f46b793a560477881c44b5f16c9edbb37aa8a91 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 25 Sep 2023 21:51:20 -0400 Subject: [PATCH] while(0)->while(false) --- include/deal.II/base/exceptions.h | 38 +++++++++++----------- include/deal.II/lac/petsc_snes.templates.h | 4 +-- include/deal.II/lac/petsc_ts.templates.h | 4 +-- source/lac/petsc_communication_pattern.cc | 2 +- source/lac/petsc_compatibility.cc | 2 +- source/lac/petsc_precondition.cc | 2 +- source/lac/petsc_solver.cc | 2 +- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/include/deal.II/base/exceptions.h b/include/deal.II/base/exceptions.h index 9e4f4ebfd6..a288637d6c 100644 --- a/include/deal.II/base/exceptions.h +++ b/include/deal.II/base/exceptions.h @@ -1561,7 +1561,7 @@ namespace deal_II_exceptions Kokkos::abort(#cond); \ })) \ } \ - while (0) + while (false) # else /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/ # define Assert(cond, exc) \ do \ @@ -1583,7 +1583,7 @@ namespace deal_II_exceptions Kokkos::abort(#cond); \ })) \ } \ - while (0) + while (false) # endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/ # else /*if KOKKOS_VERSION >= 30600*/ # ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST @@ -1602,7 +1602,7 @@ namespace deal_II_exceptions #exc, \ exc); \ } \ - while (0) + while (false) # else /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/ # define Assert(cond, exc) \ do \ @@ -1618,7 +1618,7 @@ namespace deal_II_exceptions #exc, \ exc); \ } \ - while (0) + while (false) # endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/ # else /*#ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST*/ # define Assert(cond, exc) \ @@ -1627,7 +1627,7 @@ namespace deal_II_exceptions if (!(cond)) \ Kokkos::abort(#cond); \ } \ - while (0) + while (false) # endif /*ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST*/ # endif /*KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST*/ #else /*ifdef DEBUG*/ @@ -1635,7 +1635,7 @@ namespace deal_II_exceptions do \ { \ } \ - while (0) + while (false) #endif /*ifdef DEBUG*/ @@ -1675,7 +1675,7 @@ namespace deal_II_exceptions ::dealii::deal_II_exceptions::internals::issue_error_nothrow( \ __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \ } \ - while (0) + while (false) # else /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/ # define AssertNothrow(cond, exc) \ do \ @@ -1684,14 +1684,14 @@ namespace deal_II_exceptions ::dealii::deal_II_exceptions::internals::issue_error_nothrow( \ __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \ } \ - while (0) + while (false) # endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/ #else # define AssertNothrow(cond, exc) \ do \ { \ } \ - while (0) + while (false) #endif /** @@ -1736,7 +1736,7 @@ namespace deal_II_exceptions #exc, \ exc); \ } \ - while (0) + while (false) #else /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/ # define AssertThrow(cond, exc) \ do \ @@ -1752,7 +1752,7 @@ namespace deal_II_exceptions #exc, \ exc); \ } \ - while (0) + while (false) #endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/ @@ -1944,7 +1944,7 @@ namespace internal do \ { \ } \ - while (0) + while (false) #endif // DEAL_II_WITH_MPI #ifdef DEAL_II_WITH_CUDA @@ -1975,7 +1975,7 @@ namespace internal { \ (void)(error_code); \ } \ - while (0) + while (false) # endif /** @@ -2004,7 +2004,7 @@ namespace internal { \ (void)(error_code); \ } \ - while (0) + while (false) # endif /** @@ -2033,13 +2033,13 @@ namespace internal local_error_code = cudaDeviceSynchronize(); \ AssertCuda(local_error_code); \ } \ - while (0) + while (false) # else # define AssertCudaKernel() \ do \ { \ } \ - while (0) + while (false) # endif /** @@ -2072,7 +2072,7 @@ namespace internal { \ (void)(error_code); \ } \ - while (0) + while (false) # endif /** @@ -2104,7 +2104,7 @@ namespace internal { \ (void)(error_code); \ } \ - while (0) + while (false) # endif /** @@ -2137,7 +2137,7 @@ namespace internal { \ (void)(error_code); \ } \ - while (0) + while (false) # endif #endif diff --git a/include/deal.II/lac/petsc_snes.templates.h b/include/deal.II/lac/petsc_snes.templates.h index 16ff2b720b..156dbc4cd4 100644 --- a/include/deal.II/lac/petsc_snes.templates.h +++ b/include/deal.II/lac/petsc_snes.templates.h @@ -37,7 +37,7 @@ DEAL_II_NAMESPACE_OPEN PetscErrorCode ierr = (code); \ AssertThrow(ierr == 0, ExcPETScError(ierr)); \ } \ - while (0) + while (false) // Macro to wrap PETSc inside callbacks. // This is used to raise "PETSc" exceptions, i.e. @@ -49,7 +49,7 @@ DEAL_II_NAMESPACE_OPEN PetscErrorCode ierr = (code); \ CHKERRQ(ierr); \ } \ - while (0) + while (false) # define undefPetscCall # endif diff --git a/include/deal.II/lac/petsc_ts.templates.h b/include/deal.II/lac/petsc_ts.templates.h index 4c21dcfbc4..4146b3fe0b 100644 --- a/include/deal.II/lac/petsc_ts.templates.h +++ b/include/deal.II/lac/petsc_ts.templates.h @@ -37,7 +37,7 @@ DEAL_II_NAMESPACE_OPEN PetscErrorCode ierr = (code); \ AssertThrow(ierr == 0, ExcPETScError(ierr)); \ } \ - while (0) + while (false) // Macro to wrap PETSc inside callbacks. // This is used to raise "PETSc" exceptions, i.e. @@ -49,7 +49,7 @@ DEAL_II_NAMESPACE_OPEN PetscErrorCode ierr = (code); \ CHKERRQ(ierr); \ } \ - while (0) + while (false) # define undefPetscCall # endif diff --git a/source/lac/petsc_communication_pattern.cc b/source/lac/petsc_communication_pattern.cc index e13fc38175..e7b163e0ef 100644 --- a/source/lac/petsc_communication_pattern.cc +++ b/source/lac/petsc_communication_pattern.cc @@ -29,7 +29,7 @@ DEAL_II_NAMESPACE_OPEN PetscErrorCode ierr = (code); \ AssertThrow(ierr == 0, ExcPETScError(ierr)); \ } \ - while (0) + while (false) namespace PETScWrappers { diff --git a/source/lac/petsc_compatibility.cc b/source/lac/petsc_compatibility.cc index 7a6a02893f..c2e3f3a949 100644 --- a/source/lac/petsc_compatibility.cc +++ b/source/lac/petsc_compatibility.cc @@ -35,7 +35,7 @@ PetscErrorCode ierr = (code); \ AssertThrow(ierr == 0, ExcPETScError(ierr)); \ } \ - while (0) + while (false) DEAL_II_NAMESPACE_OPEN diff --git a/source/lac/petsc_precondition.cc b/source/lac/petsc_precondition.cc index 369b285ea9..89eaa6d7b1 100644 --- a/source/lac/petsc_precondition.cc +++ b/source/lac/petsc_precondition.cc @@ -1103,7 +1103,7 @@ namespace PETScWrappers PetscErrorCode ierr = (code); \ CHKERRQ(ierr); \ } \ - while (0) + while (false) # endif PetscErrorCode diff --git a/source/lac/petsc_solver.cc b/source/lac/petsc_solver.cc index 7dc7d53cd7..3944a275cf 100644 --- a/source/lac/petsc_solver.cc +++ b/source/lac/petsc_solver.cc @@ -33,7 +33,7 @@ PetscErrorCode ierr = (code); \ AssertThrow(ierr == 0, ExcPETScError(ierr)); \ } \ - while (0) + while (false) DEAL_II_NAMESPACE_OPEN -- 2.39.5