]> https://gitweb.dealii.org/ - dealii.git/commitdiff
TpetraWrappers: fix dangling else warning, fix embedded macro warning
authorMatthias Maier <tamiko@43-1.org>
Thu, 18 Jan 2024 22:52:40 +0000 (16:52 -0600)
committerMatthias Maier <tamiko@43-1.org>
Thu, 18 Jan 2024 22:56:38 +0000 (16:56 -0600)
Triggered on gcc-9.4.0 on Ubuntu LTS 20.04

include/deal.II/lac/trilinos_tpetra_vector.h
include/deal.II/lac/trilinos_tpetra_vector.templates.h

index a34e7d87bad683f9a5fa61abf3df72626c088059..1411617a8f68938810c2f37dcaf31c740079a13a 100644 (file)
@@ -1001,10 +1001,12 @@ namespace LinearAlgebra
 #  endif
 
           if (local_row != Teuchos::OrdinalTraits<int>::invalid())
-            if (nonlocal)
-              vector_1d_nonlocal(local_row) += values[i];
-            else
-              vector_1d_local(local_row) += values[i];
+            {
+              if (nonlocal)
+                vector_1d_nonlocal(local_row) += values[i];
+              else
+                vector_1d_local(local_row) += values[i];
+            }
         }
 
 #  if !DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
index e119b4f5adf7e757c2412cbcfe9d417c3a3c83ad..6d93e62eeb8f72d45407dcb43f2f1aa9bd4738e5 100644 (file)
@@ -247,14 +247,16 @@ namespace LinearAlgebra
             vector->getMap()->getLocalElement(row);
 
 
+#  if DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
           Assert(
             local_row != Teuchos::OrdinalTraits<int>::invalid(),
-#  if DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
             ExcAccessToNonLocalElement(row,
                                        vector->getMap()->getLocalNumElements(),
                                        vector->getMap()->getMinLocalIndex(),
                                        vector->getMap()->getMaxLocalIndex()));
 #  else
+          Assert(
+            local_row != Teuchos::OrdinalTraits<int>::invalid(),
             ExcAccessToNonLocalElement(row,
                                        vector->getMap()->getNodeNumElements(),
                                        vector->getMap()->getMinLocalIndex(),

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.