Tidy: modernize-use-nullptr
[alexxy/gromacs.git] / src / gromacs / selection / selectionoptionbehavior.cpp
index 8de8667f1becac9c9976ed8a7a6b6288cd051be6..f1886386468099ce6ad0800b78f285a2af4b8840 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017, 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.
@@ -80,12 +80,12 @@ class SelectionOptionBehavior::Impl
         Impl(SelectionCollection *selections,
              ITopologyProvider   *topologyProvider)
             : selections_(*selections), topologyProvider_(*topologyProvider),
-              manager_(selections), grps_(NULL)
+              manager_(selections), grps_(nullptr)
         {
         }
         ~Impl()
         {
-            if (grps_ != NULL)
+            if (grps_ != nullptr)
             {
                 gmx_ana_indexgrps_free(grps_);
             }
@@ -109,27 +109,27 @@ class SelectionOptionBehavior::Impl
                                  "  %s\n(with -n), but it was not used by any selection.\n",
                                  ndxfile_.c_str());
                 }
-                selections_.setIndexGroups(NULL);
+                selections_.setIndexGroups(nullptr);
                 return;
             }
             if (ndxfile_.empty())
             {
                 gmx_mtop_t *top = topologyProvider_.getTopology(false);
-                gmx_ana_indexgrps_init(&grps_, top, NULL);
+                gmx_ana_indexgrps_init(&grps_, top, nullptr);
             }
             else
             {
-                gmx_ana_indexgrps_init(&grps_, NULL, ndxfile_.c_str());
+                gmx_ana_indexgrps_init(&grps_, nullptr, ndxfile_.c_str());
             }
             selections_.setIndexGroups(grps_);
         }
         void doneIndexGroups()
         {
-            if (grps_ != NULL)
+            if (grps_ != nullptr)
             {
-                selections_.setIndexGroups(NULL);
+                selections_.setIndexGroups(nullptr);
                 gmx_ana_indexgrps_free(grps_);
-                grps_ = NULL;
+                grps_ = nullptr;
             }
         }
 
@@ -138,7 +138,7 @@ class SelectionOptionBehavior::Impl
             const bool  topRequired = selections_.requiredTopologyProperties().needsTopology;
             gmx_mtop_t *top         = topologyProvider_.getTopology(topRequired);
             int         natoms      = -1;
-            if (top == NULL)
+            if (top == nullptr)
             {
                 natoms = topologyProvider_.getAtomCount();
             }