From bcccc0820adfbfa1a2385c28774930890afd8f55 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 2 Jun 2021 17:44:11 -0400 Subject: [PATCH] Replace "#if defined(...)" by #ifdef(...) --- include/deal.II/base/partitioner.templates.h | 6 +++--- include/deal.II/base/tensor.h | 2 +- include/deal.II/base/vectorization.h | 2 +- include/deal.II/differentiation/ad/adolc_math.h | 4 ++-- include/deal.II/dofs/dof_accessor.templates.h | 2 +- include/deal.II/lac/read_write_vector.h | 2 +- include/deal.II/lac/read_write_vector.templates.h | 6 +++--- include/deal.II/lac/trilinos_epetra_vector.h | 2 +- include/deal.II/lac/trilinos_linear_operator.h | 2 +- include/deal.II/lac/trilinos_tpetra_communication_pattern.h | 2 +- include/deal.II/lac/trilinos_tpetra_vector.h | 2 +- include/deal.II/lac/vector_element_access.h | 2 +- include/deal.II/numerics/data_out_dof_data.templates.h | 2 +- source/base/mpi.cc | 2 +- source/base/utilities.cc | 4 ++-- source/lac/trilinos_vector.cc | 4 ++-- tests/base/is_finite.cc | 2 +- tests/base/is_finite_complex.cc | 2 +- tests/base/log_nan.cc | 2 +- tests/quick_tests/affinity.cc | 4 ++-- 20 files changed, 28 insertions(+), 28 deletions(-) diff --git a/include/deal.II/base/partitioner.templates.h b/include/deal.II/base/partitioner.templates.h index 076dcab77a..c91db2b6d1 100644 --- a/include/deal.II/base/partitioner.templates.h +++ b/include/deal.II/base/partitioner.templates.h @@ -226,7 +226,7 @@ namespace Utilities } else { -# if defined(DEAL_II_COMPILER_CUDA_AWARE) +# ifdef DEAL_II_COMPILER_CUDA_AWARE cudaError_t cuda_error = cudaMemcpy(ghost_array.data() + ghost_range.first, ghost_array.data() + offset, @@ -376,7 +376,7 @@ namespace Utilities } else { -# if defined(DEAL_II_COMPILER_CUDA_AWARE) +# ifdef DEAL_II_COMPILER_CUDA_AWARE cudaError_t cuda_error = cudaMemcpy(ghost_array_ptr + offset, ghost_array.data() + my_ghosts->first, @@ -525,7 +525,7 @@ namespace Utilities "import_from_ghosted_array_start as is passed " "to import_from_ghosted_array_finish.")); -# if defined(DEAL_II_COMPILER_CUDA_AWARE) +# ifdef DEAL_II_COMPILER_CUDA_AWARE if (std::is_same::value) { cudaMemset(ghost_array.data(), diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index e777735b5f..003b90da86 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -1050,7 +1050,7 @@ template constexpr inline bool Tensor<0, dim, Number>::operator==(const Tensor<0, dim, OtherNumber> &p) const { -# if defined(DEAL_II_ADOLC_WITH_ADVANCED_BRANCHING) +# ifdef DEAL_II_ADOLC_WITH_ADVANCED_BRANCHING Assert(!(std::is_same::value || std::is_same::value), ExcMessage( diff --git a/include/deal.II/base/vectorization.h b/include/deal.II/base/vectorization.h index a58a4aaf04..f754144e02 100644 --- a/include/deal.II/base/vectorization.h +++ b/include/deal.II/base/vectorization.h @@ -59,7 +59,7 @@ "Mismatch in vectorization capabilities: AVX-512F was detected during configuration of deal.II and switched on, but it is apparently not available for the file you are trying to compile at the moment. Check compilation flags controlling the instruction set, such as -march=native." # endif -# if defined(_MSC_VER) +# ifdef _MSC_VER # include # elif defined(__ALTIVEC__) # include diff --git a/include/deal.II/differentiation/ad/adolc_math.h b/include/deal.II/differentiation/ad/adolc_math.h index bd7034020c..d1e79547f0 100644 --- a/include/deal.II/differentiation/ad/adolc_math.h +++ b/include/deal.II/differentiation/ad/adolc_math.h @@ -123,7 +123,7 @@ namespace std DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(log) DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(log10) DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(sqrt) -# if defined(DEAL_II_ADOLC_WITH_ATRIG_ERF) +# ifdef DEAL_II_ADOLC_WITH_ATRIG_ERF DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(erf) inline adouble erfc(const adouble &x) @@ -153,7 +153,7 @@ namespace std DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(sinh) DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(cosh) DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(tanh) -# if defined(DEAL_II_ADOLC_WITH_ATRIG_ERF) +# ifdef DEAL_II_ADOLC_WITH_ATRIG_ERF DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(asinh) DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(acosh) DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(atanh) diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index 7bf7c0333d..dde3407dfb 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -705,7 +705,7 @@ namespace internal -#if defined(DEAL_II_WITH_TRILINOS) +#ifdef DEAL_II_WITH_TRILINOS static std::vector sort_indices(const types::global_dof_index *v_begin, const types::global_dof_index *v_end) diff --git a/include/deal.II/lac/read_write_vector.h b/include/deal.II/lac/read_write_vector.h index 2e2fecad4e..967c3961c9 100644 --- a/include/deal.II/lac/read_write_vector.h +++ b/include/deal.II/lac/read_write_vector.h @@ -693,7 +693,7 @@ namespace LinearAlgebra void resize_val(const size_type new_allocated_size); -#if defined(DEAL_II_WITH_TRILINOS) +#ifdef DEAL_II_WITH_TRILINOS # ifdef DEAL_II_TRILINOS_WITH_TPETRA /** * Return a TpetraWrappers::CommunicationPattern and store it for future diff --git a/include/deal.II/lac/read_write_vector.templates.h b/include/deal.II/lac/read_write_vector.templates.h index 59f92e4479..ac4bc07f1a 100644 --- a/include/deal.II/lac/read_write_vector.templates.h +++ b/include/deal.II/lac/read_write_vector.templates.h @@ -299,7 +299,7 @@ namespace LinearAlgebra -#if defined(DEAL_II_WITH_TRILINOS) +#ifdef DEAL_II_WITH_TRILINOS template void ReadWriteVector::reinit( @@ -570,7 +570,7 @@ namespace LinearAlgebra -#if defined(DEAL_II_WITH_TRILINOS) +#ifdef DEAL_II_WITH_TRILINOS # ifdef DEAL_II_TRILINOS_WITH_TPETRA template void @@ -1033,7 +1033,7 @@ namespace LinearAlgebra -#if defined(DEAL_II_WITH_TRILINOS) +#ifdef DEAL_II_WITH_TRILINOS # ifdef DEAL_II_TRILINOS_WITH_TPETRA template TpetraWrappers::CommunicationPattern diff --git a/include/deal.II/lac/trilinos_epetra_vector.h b/include/deal.II/lac/trilinos_epetra_vector.h index 400dc2ec5d..fd717964c6 100644 --- a/include/deal.II/lac/trilinos_epetra_vector.h +++ b/include/deal.II/lac/trilinos_epetra_vector.h @@ -19,7 +19,7 @@ #include -#if defined(DEAL_II_WITH_TRILINOS) +#ifdef DEAL_II_WITH_TRILINOS # include # include diff --git a/include/deal.II/lac/trilinos_linear_operator.h b/include/deal.II/lac/trilinos_linear_operator.h index 63492c2a15..4515a8ee02 100644 --- a/include/deal.II/lac/trilinos_linear_operator.h +++ b/include/deal.II/lac/trilinos_linear_operator.h @@ -18,7 +18,7 @@ #include -#if defined(DEAL_II_WITH_TRILINOS) +#ifdef DEAL_II_WITH_TRILINOS # include # include diff --git a/include/deal.II/lac/trilinos_tpetra_communication_pattern.h b/include/deal.II/lac/trilinos_tpetra_communication_pattern.h index fe14d69af0..a746580583 100644 --- a/include/deal.II/lac/trilinos_tpetra_communication_pattern.h +++ b/include/deal.II/lac/trilinos_tpetra_communication_pattern.h @@ -19,7 +19,7 @@ #include -#if defined(DEAL_II_TRILINOS_WITH_TPETRA) +#ifdef DEAL_II_TRILINOS_WITH_TPETRA # include diff --git a/include/deal.II/lac/trilinos_tpetra_vector.h b/include/deal.II/lac/trilinos_tpetra_vector.h index 82fd1aa606..8e3a56b8b1 100644 --- a/include/deal.II/lac/trilinos_tpetra_vector.h +++ b/include/deal.II/lac/trilinos_tpetra_vector.h @@ -19,7 +19,7 @@ #include -#if defined(DEAL_II_TRILINOS_WITH_TPETRA) +#ifdef DEAL_II_TRILINOS_WITH_TPETRA # include # include diff --git a/include/deal.II/lac/vector_element_access.h b/include/deal.II/lac/vector_element_access.h index ff0c2aa9af..2a14cef74e 100644 --- a/include/deal.II/lac/vector_element_access.h +++ b/include/deal.II/lac/vector_element_access.h @@ -78,7 +78,7 @@ namespace internal -#if defined(DEAL_II_WITH_TRILINOS) +#ifdef DEAL_II_WITH_TRILINOS template <> inline void ElementAccess::add( diff --git a/include/deal.II/numerics/data_out_dof_data.templates.h b/include/deal.II/numerics/data_out_dof_data.templates.h index 547603ce43..d7db51a919 100644 --- a/include/deal.II/numerics/data_out_dof_data.templates.h +++ b/include/deal.II/numerics/data_out_dof_data.templates.h @@ -665,7 +665,7 @@ namespace internal -#if defined(DEAL_II_TRILINOS_WITH_TPETRA) +#ifdef DEAL_II_TRILINOS_WITH_TPETRA template <> inline void VectorHelper>::extract( diff --git a/source/base/mpi.cc b/source/base/mpi.cc index 83567af5f9..dd82111c50 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -1017,7 +1017,7 @@ namespace Utilities release_unused_memory(); // Next with Trilinos: -# if defined(DEAL_II_WITH_TRILINOS) +# ifdef DEAL_II_WITH_TRILINOS GrowingVectorMemory< TrilinosWrappers::MPI::Vector>::release_unused_memory(); GrowingVectorMemory< diff --git a/source/base/utilities.cc b/source/base/utilities.cc index f687aa26a9..0534635e6f 100644 --- a/source/base/utilities.cc +++ b/source/base/utilities.cc @@ -914,7 +914,7 @@ namespace Utilities namespace System { -#if defined(__linux__) +#ifdef __linux__ double get_cpu_load() @@ -974,7 +974,7 @@ namespace Utilities // parsing /proc/self/stat would be a // lot easier, but it does not contain // VmHWM, so we use /status instead. -#if defined(__linux__) +#ifdef __linux__ std::ifstream file("/proc/self/status"); std::string line; std::string name; diff --git a/source/lac/trilinos_vector.cc b/source/lac/trilinos_vector.cc index 021da0fd94..bbe9fc84a7 100644 --- a/source/lac/trilinos_vector.cc +++ b/source/lac/trilinos_vector.cc @@ -259,7 +259,7 @@ namespace TrilinosWrappers last_action = Insert; } -# if defined(DEBUG) +# ifdef DEBUG const Epetra_MpiComm *comm_ptr = dynamic_cast(&(v.vector->Comm())); Assert(comm_ptr != nullptr, ExcInternalError()); @@ -335,7 +335,7 @@ namespace TrilinosWrappers } else vector = std::move(actual_vec); -# if defined(DEBUG) +# ifdef DEBUG const Epetra_MpiComm *comm_ptr = dynamic_cast(&(vector->Comm())); Assert(comm_ptr != nullptr, ExcInternalError()); diff --git a/tests/base/is_finite.cc b/tests/base/is_finite.cc index 46964a4bbf..5684f9f8e9 100644 --- a/tests/base/is_finite.cc +++ b/tests/base/is_finite.cc @@ -66,7 +66,7 @@ main() // unusable since we can no longer detect whether something is a // NaN. that said, to make the test work in these cases, simply // switch off floating point exceptions for invalid arguments -#if defined(DEAL_II_HAVE_FP_EXCEPTIONS) +#ifdef DEAL_II_HAVE_FP_EXCEPTIONS fedisableexcept(FE_INVALID); #endif diff --git a/tests/base/is_finite_complex.cc b/tests/base/is_finite_complex.cc index 647ab6eee0..861021831b 100644 --- a/tests/base/is_finite_complex.cc +++ b/tests/base/is_finite_complex.cc @@ -147,7 +147,7 @@ main() // unusable since we can no longer detect whether something is a // NaN. that said, to make the test work in these cases, simply // switch off floating point exceptions for invalid arguments -#if defined(DEAL_II_HAVE_FP_EXCEPTIONS) +#ifdef DEAL_II_HAVE_FP_EXCEPTIONS fedisableexcept(FE_INVALID); #endif diff --git a/tests/base/log_nan.cc b/tests/base/log_nan.cc index 7f0135beee..dbd5bcd078 100644 --- a/tests/base/log_nan.cc +++ b/tests/base/log_nan.cc @@ -34,7 +34,7 @@ main() // unusable since we can no longer detect whether something is a // NaN. that said, to make the test work in these cases, simply // switch off floating point exceptions for invalid arguments -#if defined(DEAL_II_HAVE_FP_EXCEPTIONS) +#ifdef DEAL_II_HAVE_FP_EXCEPTIONS fedisableexcept(FE_INVALID); #endif diff --git a/tests/quick_tests/affinity.cc b/tests/quick_tests/affinity.cc index edde64a356..460b347c6b 100644 --- a/tests/quick_tests/affinity.cc +++ b/tests/quick_tests/affinity.cc @@ -24,7 +24,7 @@ #include -#if defined(__linux__) +#ifdef __linux__ # include # include #endif @@ -35,7 +35,7 @@ getaffinity(unsigned int &bits_set, unsigned int &mask) bits_set = 0; mask = 0x00; -#if defined(__linux__) +#ifdef __linux__ cpu_set_t my_set; CPU_ZERO(&my_set); -- 2.39.5