clang-tidy: misleading-indentation+noexcept-move
authorRoland Schulz <roland.schulz@intel.com>
Tue, 26 Jun 2018 07:18:36 +0000 (00:18 -0700)
committerMark Abraham <mark.j.abraham@gmail.com>
Fri, 29 Jun 2018 04:17:54 +0000 (06:17 +0200)
manual fixes (check without auto fix) for
readability-misleading-indentation
performance-noexcept-move-constructor

Change-Id: I5c004c623b03a4a9e907ba0b340a3a721f511dd3

13 files changed:
src/gromacs/CMakeLists.txt
src/gromacs/commandline/cmdlinehelpcontext.cpp
src/gromacs/commandline/cmdlinehelpcontext.h
src/gromacs/fileio/trxio.cpp
src/gromacs/gmxana/gmx_confrms.cpp
src/gromacs/gmxana/gmx_make_edi.cpp
src/gromacs/gmxana/gmx_trjconv.cpp
src/gromacs/gmxpreprocess/pdb2gmx.cpp
src/gromacs/utility/classhelpers.h
src/gromacs/utility/keyvaluetreetransform.cpp
src/gromacs/utility/keyvaluetreetransform.h
src/gromacs/utility/loggerbuilder.cpp
src/gromacs/utility/loggerbuilder.h

index 0f95b62de3f08ecf85ab728d37445464e1966f89..099c42bb414d5786148c35e155fc2979aa033c21 100644 (file)
@@ -280,8 +280,8 @@ if (GMX_CLANG_TIDY)
    set_target_properties(libgromacs PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE};--checks=\
        -clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-core.NullDereference,\
        bugprone-*,misc-*,readability-*,performance-*,mpi-*,\
-       -misc-misplaced-widening-cast,-readability-named-parameter,-performance-noexcept-move-constructor,\
-       -readability-misleading-indentation,-misc-suspicious-string-compare,\
+       -misc-misplaced-widening-cast,-readability-named-parameter,\
+       -misc-suspicious-string-compare,\
        -readability-redundant-control-flow,-performance-unnecessary-value-param,\
        -readability-static-definition-in-anonymous-namespace,-misc-suspicious-missing-comma,\
        -readability-redundant-member-init,-misc-misplaced-const,\
index 5d81d9a878bd052c9c3806128c05eed6eff6854e..b65a065a7d946bd528d6aeeac183c61ac022f1dc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -124,13 +124,13 @@ CommandLineHelpContext::CommandLineHelpContext(
 {
 }
 
-CommandLineHelpContext::CommandLineHelpContext(CommandLineHelpContext &&other)
+CommandLineHelpContext::CommandLineHelpContext(CommandLineHelpContext &&other) noexcept
     : impl_(std::move(other.impl_))
 {
 }
 
 CommandLineHelpContext &CommandLineHelpContext::operator=(
-        CommandLineHelpContext &&other)
+        CommandLineHelpContext &&other) noexcept
 {
     impl_ = std::move(other.impl_);
     return *this;
index fefa06967f3ffd1c831e0b686142d27893ed7ff0..1b0c144f3a5923ba57bb8bfc8625e1edff8924d4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -88,9 +88,9 @@ class CommandLineHelpContext
         //! Creates a copy of the context.
         explicit CommandLineHelpContext(const CommandLineHelpContext &other);
         //! Moves the context.
-        CommandLineHelpContext(CommandLineHelpContext &&other);
+        CommandLineHelpContext(CommandLineHelpContext &&other) noexcept;
         //! Move-assigns the context.
-        CommandLineHelpContext &operator=(CommandLineHelpContext &&other);
+        CommandLineHelpContext &operator=(CommandLineHelpContext &&other) noexcept;
         ~CommandLineHelpContext();
 
         /*! \brief
index 86ac53d4e8881ef0d20d0aad2cf313d327148cee..3c548f54be6d636610b6897b3c2891845ea47ef8 100644 (file)
@@ -718,8 +718,7 @@ static gmx_bool gmx_next_frame(t_trxstatus *status, t_trxframe *fr)
             fr->not_ok = DATA_NOT_OK;
         }
     }
-    else
-    if (!bOK)
+    else if (!bOK)
     {
         fr->not_ok = HEADER_NOT_OK;
     }
index 1f1b1642d0448fe6c3850b941136ce1fb926f8a8..4c2255fd55b4478471e6fbba13f69c6012e923a0 100644 (file)
@@ -291,8 +291,7 @@ static int find_next_match_res(int *rnr1, int isize1,
             rr1 += dx;
             rr2 += dx;
         }
-        else
-        if (bFW)
+        else if (bFW)
         {
             rr1 += dx;
             rr2 += dy;
index bb9c7ac0a767c68b62047051a3e9dffe54423ffc..4a8e521762fe7d2ee9eab6abd36f14793be6a43d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -168,7 +168,8 @@ static int sscan_list(int *list[], const char *str, const char *listname)
         switch (status)
         {
             /* expect a number */
-            case sBefore: if (std::isdigit(c))
+            case sBefore:
+                if (std::isdigit(c))
                 {
                     start  = pos;
                     status = sNumber;
@@ -177,10 +178,12 @@ static int sscan_list(int *list[], const char *str, const char *listname)
                 else
                 {
                     status = sError;
-                } break;
+                }
+                break;
 
             /* have read a number, expect ',' or '-' */
-            case sNumber: if (c == ',')
+            case sNumber:
+                if (c == ',')
                 {
                     /*store number*/
                     srenew(*list, nvecs+1);
@@ -203,7 +206,8 @@ static int sscan_list(int *list[], const char *str, const char *listname)
                 else
                 {
                     status = sError;
-                } break;
+                }
+                break;
 
             /* have read a '-' -> expect a number */
             case sMinus:
@@ -215,7 +219,8 @@ static int sscan_list(int *list[], const char *str, const char *listname)
                 else
                 {
                     status = sError;
-                } break;
+                }
+                break;
 
             case sSteppedRange:
                 if (std::isdigit(c))
@@ -234,7 +239,8 @@ static int sscan_list(int *list[], const char *str, const char *listname)
                 else
                 {
                     status = sError;
-                } break;
+                }
+                break;
 
             /* have read the number after a minus, expect ',' or ':' */
             case sRange:
@@ -280,7 +286,8 @@ static int sscan_list(int *list[], const char *str, const char *listname)
                 else
                 {
                     status = sError;
-                } break;
+                }
+                break;
 
             /* format error occured */
             case sError:
index 583549c9ab60de22decc93c129b8ccde3e7ca870..2f780885125b00a0a482d370dbd93b5c8f88f232 100644 (file)
@@ -1615,8 +1615,7 @@ int gmx_trjconv(int argc, char *argv[])
                     {
                         frout_time = tzero + frame*timestep;
                     }
-                    else
-                    if (bSetTime)
+                    else if (bSetTime)
                     {
                         frout_time += tshift;
                     }
index dc9cc47654edaa460b8204159d6323533ebcd112..b8a870e58c60914ea3231c1cc7f8b48e4a53cc50 100644 (file)
@@ -2246,8 +2246,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
         {
             top_file2 = nullptr;
         }
-        else
-        if (bITP)
+        else if (bITP)
         {
             top_file2 = itp_file;
         }
index 4875068a7f48598843f6c4fbca20ec3beff1baae..b24546b4942a2439d3ac8844f59552e2ae3bc4f6 100644 (file)
@@ -166,8 +166,8 @@ class PrivateImplPointer
         explicit PrivateImplPointer(Impl *ptr) : ptr_(ptr) {}
         //! \cond
         // Explicitly declared to work around MSVC problems.
-        PrivateImplPointer(PrivateImplPointer &&other) : ptr_(std::move(other.ptr_)) {}
-        PrivateImplPointer &operator=(PrivateImplPointer &&other)
+        PrivateImplPointer(PrivateImplPointer &&other) noexcept : ptr_(std::move(other.ptr_)) {}
+        PrivateImplPointer &operator=(PrivateImplPointer &&other) noexcept
         {
             ptr_ = std::move(other.ptr_);
             return *this;
index 7d861157dd7338f358bbdcb40ddf6d00a1d1ae7b..27d0b674a093275ce29f47f7bc721238bbe5217a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -98,11 +98,11 @@ KeyValueTreeTransformRulesScoped::KeyValueTreeTransformRulesScoped(
 }
 
 KeyValueTreeTransformRulesScoped::KeyValueTreeTransformRulesScoped(
-        KeyValueTreeTransformRulesScoped &&) = default;
+        KeyValueTreeTransformRulesScoped &&) noexcept = default;
 
 KeyValueTreeTransformRulesScoped &
 KeyValueTreeTransformRulesScoped::operator=(
-        KeyValueTreeTransformRulesScoped &&) = default;
+        KeyValueTreeTransformRulesScoped &&) noexcept = default;
 
 KeyValueTreeTransformRulesScoped::~KeyValueTreeTransformRulesScoped()
 {
index d4f3c5c146ab1a22f68d56d1e039cce81b27061e..25bad9ab832dfff8b47f466531481c43f79c01d5 100644 (file)
@@ -128,9 +128,9 @@ class KeyValueTreeTransformRulesScoped
             internal::KeyValueTreeTransformerImpl *impl,
             const KeyValueTreePath                &prefix);
         //! Supports returning the object from IKeyValueTreeTransformRules::scopedTransform().
-        KeyValueTreeTransformRulesScoped(KeyValueTreeTransformRulesScoped &&other);
+        KeyValueTreeTransformRulesScoped(KeyValueTreeTransformRulesScoped &&other) noexcept;
         //! Supports returning the object from IKeyValueTreeTransformRules::scopedTransform().
-        KeyValueTreeTransformRulesScoped &operator=(KeyValueTreeTransformRulesScoped &&other);
+        KeyValueTreeTransformRulesScoped &operator=(KeyValueTreeTransformRulesScoped &&other) noexcept;
         ~KeyValueTreeTransformRulesScoped();
 
         //! Returns the interface for adding rules to this scope.
index a5da7d056479e48c04793305e949068ca81ea2a9..a145bd15bca5463f7cec286ec3c8ee8ef5a53124 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -118,12 +118,12 @@ LoggerOwner::LoggerOwner(std::unique_ptr<Impl> impl)
 {
 }
 
-LoggerOwner::LoggerOwner(LoggerOwner &&other)
+LoggerOwner::LoggerOwner(LoggerOwner &&other) noexcept
     : impl_(std::move(other.impl_)), logger_(&impl_->logger_)
 {
 }
 
-LoggerOwner &LoggerOwner::operator=(LoggerOwner &&other)
+LoggerOwner &LoggerOwner::operator=(LoggerOwner &&other) noexcept
 {
     impl_   = std::move(other.impl_);
     logger_ = &impl_->logger_;
index 75ff25f9b553a4ce412b0260acc1dbbb42f26183..ce3b77b900a53ca3a208ae79f02893c896b5acd2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -124,11 +124,11 @@ class LoggerOwner
 {
     public:
         //! Move-constructs the owner.
-        LoggerOwner(LoggerOwner &&other);
+        LoggerOwner(LoggerOwner &&other) noexcept;
         ~LoggerOwner();
 
         //! Move-assings the owner.
-        LoggerOwner &operator=(LoggerOwner &&other);
+        LoggerOwner &operator=(LoggerOwner &&other) noexcept;
 
         //! Returns the logger for writing the logs.
         const MDLogger &logger() const { return *logger_; }