]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve alignment of \s in macros. 6206/head
authorDavid Wells <wellsd2@rpi.edu>
Sun, 8 Apr 2018 23:37:25 +0000 (19:37 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Mon, 9 Apr 2018 12:27:40 +0000 (08:27 -0400)
This is a bit tricky: doxygen wants to place the first '{' all the way to the
left regardless of its indentation (and indent the rest of the lines in each
macro normally), but astyle does not like left-justified macro blocks. Resolve
the issue by telling astyle to leave preprocessor blocks alone and
left-justifying all preprocessor blocks.

contrib/styles/astyle.rc
include/deal.II/base/exceptions.h

index 86650e7db1bdfcc295796568faef856b5983c798..817fa3b3acb235e083d41a7c7fe35a1a13aae8de 100644 (file)
@@ -18,7 +18,6 @@
 --style=gnu
 
 --convert-tabs
---indent-preprocessor
 --indent=spaces=2
 --indent-namespaces
 --keep-one-line-blocks
index 33341335a3f2eaa36b2f600b65aaaf0a13012f6c..eba661a79d97a9ad9eaa2e565299904920389e7d 100644 (file)
@@ -1110,24 +1110,24 @@ namespace deal_II_exceptions
  */
 #ifdef DEBUG
 #  ifdef DEAL_II_HAVE_BUILTIN_EXPECT
-#    define Assert(cond, exc)                                                  \
-  {                                                                            \
-    if (__builtin_expect(!(cond), false))                                      \
-      ::dealii::deal_II_exceptions::internals:: issue_error_noreturn(          \
-          ::dealii::deal_II_exceptions::internals::abort_on_exception,         \
-          __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc);          \
-  }
+#    define Assert(cond, exc)                                                \
+{                                                                            \
+  if (__builtin_expect(!(cond), false))                                      \
+    ::dealii::deal_II_exceptions::internals:: issue_error_noreturn(          \
+        ::dealii::deal_II_exceptions::internals::abort_on_exception,         \
+        __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc);          \
+}
 #  else /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
-#    define Assert(cond, exc)                                                  \
-  {                                                                            \
-    if (!(cond))                                                               \
-      ::dealii::deal_II_exceptions::internals:: issue_error_noreturn(          \
-          ::dealii::deal_II_exceptions::internals::abort_on_exception,         \
-          __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc);          \
-  }
+#    define Assert(cond, exc)                                                \
+{                                                                            \
+  if (!(cond))                                                               \
+    ::dealii::deal_II_exceptions::internals:: issue_error_noreturn(          \
+        ::dealii::deal_II_exceptions::internals::abort_on_exception,         \
+        __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc);          \
+}
 #  endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
 #else
-#define Assert(cond, exc)                                                      \
+#define Assert(cond, exc)                                                    \
   {}
 #endif
 
@@ -1150,24 +1150,24 @@ namespace deal_II_exceptions
  */
 #ifdef DEBUG
 #  ifdef DEAL_II_HAVE_BUILTIN_EXPECT
-#    define AssertNothrow(cond, exc)                                           \
-  {                                                                              \
-    if (__builtin_expect(!(cond), false))                                        \
-      ::dealii::deal_II_exceptions::internals::issue_error_nothrow(              \
-          ::dealii::deal_II_exceptions::internals::abort_nothrow_on_exception,   \
-          __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc);            \
-  }
+#    define AssertNothrow(cond, exc)                                             \
+{                                                                                \
+  if (__builtin_expect(!(cond), false))                                          \
+    ::dealii::deal_II_exceptions::internals::issue_error_nothrow(                \
+        ::dealii::deal_II_exceptions::internals::abort_nothrow_on_exception,     \
+        __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc);              \
+}
 #  else /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
-#    define AssertNothrow(cond, exc)                                           \
-  {                                                                              \
-    if (!(cond))                                                                 \
-      ::dealii::deal_II_exceptions::internals::issue_error_nothrow(              \
-          ::dealii::deal_II_exceptions::internals::abort_nothrow_on_exception,   \
-          __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc);            \
-  }
+#    define AssertNothrow(cond, exc)                                             \
+{                                                                                \
+  if (!(cond))                                                                   \
+    ::dealii::deal_II_exceptions::internals::issue_error_nothrow(                \
+        ::dealii::deal_II_exceptions::internals::abort_nothrow_on_exception,     \
+        __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc);              \
+}
 #  endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
 #else
-#define AssertNothrow(cond, exc)                                               \
+#define AssertNothrow(cond, exc)                                                 \
   {}
 #endif
 
@@ -1188,20 +1188,20 @@ namespace deal_II_exceptions
  */
 #ifdef DEAL_II_HAVE_BUILTIN_EXPECT
 #define AssertThrow(cond, exc)                                                 \
-  {                                                                            \
-    if (__builtin_expect(!(cond), false))                                      \
-      ::dealii::deal_II_exceptions::internals:: issue_error_noreturn(          \
-          ::dealii::deal_II_exceptions::internals::throw_on_exception,         \
-          __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc);          \
-  }
+{                                                                              \
+  if (__builtin_expect(!(cond), false))                                        \
+    ::dealii::deal_II_exceptions::internals:: issue_error_noreturn(            \
+        ::dealii::deal_II_exceptions::internals::throw_on_exception,           \
+        __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc);            \
+}
 #else /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
 #define AssertThrow(cond, exc)                                                 \
-  {                                                                            \
-    if (!(cond))                                                               \
-      ::dealii::deal_II_exceptions::internals::issue_error_noreturn(           \
-          ::dealii::deal_II_exceptions::internals::throw_on_exception,         \
-          __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc);          \
-  }
+{                                                                              \
+  if (!(cond))                                                                 \
+    ::dealii::deal_II_exceptions::internals::issue_error_noreturn(             \
+        ::dealii::deal_II_exceptions::internals::throw_on_exception,           \
+        __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc);            \
+}
 #endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/
 
 /**
@@ -1251,10 +1251,10 @@ namespace internal
  * @author Guido Kanschat 2007
  */
 #define AssertIndexRange(index,range)                                          \
-  Assert((index) < (range),                                                    \
-         dealii::ExcIndexRangeType<typename ::dealii::internal::argument_type< \
-         void(typename std::common_type<decltype(index),                       \
-              decltype(range)>::type)>::type>((index),0,(range)))
+Assert((index) < (range),                                                      \
+       dealii::ExcIndexRangeType<typename ::dealii::internal::argument_type<   \
+       void(typename std::common_type<decltype(index),                         \
+            decltype(range)>::type)>::type>((index),0,(range)))
 
 /**
  * An assertion that checks whether a number is finite or not. We explicitly
@@ -1266,8 +1266,8 @@ namespace internal
  * @author Wolfgang Bangerth, 2015
  */
 #define AssertIsFinite(number)                                                 \
-  Assert(dealii::numbers::is_finite(number),                                   \
-         dealii::ExcNumberNotFinite(std::complex<double>(number)))
+Assert(dealii::numbers::is_finite(number),                                     \
+       dealii::ExcNumberNotFinite(std::complex<double>(number)))
 
 #ifdef DEAL_II_WITH_MPI
 /**
@@ -1280,8 +1280,8 @@ namespace internal
  * @ingroup Exceptions
  * @author David Wells, 2016
  */
-#define AssertThrowMPI(error_code) \
-  AssertThrow(error_code == MPI_SUCCESS, dealii::ExcMPI(error_code))
+#define AssertThrowMPI(error_code)                                             \
+AssertThrow(error_code == MPI_SUCCESS, dealii::ExcMPI(error_code))
 #else
 #define AssertThrowMPI(error_code) {}
 #endif // DEAL_II_WITH_MPI

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.