Tidy: modernize-use-nullptr
[alexxy/gromacs.git] / src / gromacs / trajectoryanalysis / modules / select.cpp
index f84fc44e49659c67d8ebeac477173f12379e8a2b..3137b8ddac0219c91dbc26491456fe1b84ed5ebf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,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.
@@ -137,7 +137,7 @@ class IndexFileWriterModule : public AnalysisDataModuleSerial
  */
 
 IndexFileWriterModule::IndexFileWriterModule()
-    : fp_(NULL), currentGroup_(-1), currentSize_(0), bAnyWritten_(false)
+    : fp_(nullptr), currentGroup_(-1), currentSize_(0), bAnyWritten_(false)
 {
 }
 
@@ -150,10 +150,10 @@ IndexFileWriterModule::~IndexFileWriterModule()
 
 void IndexFileWriterModule::closeFile()
 {
-    if (fp_ != NULL)
+    if (fp_ != nullptr)
     {
         gmx_fio_fclose(fp_);
-        fp_ = NULL;
+        fp_ = nullptr;
     }
 }
 
@@ -197,7 +197,7 @@ void IndexFileWriterModule::frameStarted(const AnalysisDataFrameHeader & /*heade
 void
 IndexFileWriterModule::pointsAdded(const AnalysisDataPointSetRef &points)
 {
-    if (fp_ == NULL)
+    if (fp_ == nullptr)
     {
         return;
     }
@@ -245,7 +245,7 @@ void IndexFileWriterModule::frameFinished(const AnalysisDataFrameHeader & /*head
 
 void IndexFileWriterModule::dataFinished()
 {
-    if (fp_ != NULL)
+    if (fp_ != nullptr)
     {
         std::fprintf(fp_, "\n");
     }
@@ -322,7 +322,7 @@ class Select : public TrajectoryAnalysisModule
 Select::Select()
     : bTotNorm_(false), bFracNorm_(false), bResInd_(false),
       bCumulativeLifetimes_(true), resNumberType_(ResidueNumbering_ByNumber),
-      pdbAtoms_(PdbAtomsSelection_All), top_(NULL),
+      pdbAtoms_(PdbAtomsSelection_All), top_(nullptr),
       occupancyModule_(new AnalysisDataAverageModule()),
       lifetimeModule_(new AnalysisDataLifetimeModule())
 {
@@ -723,7 +723,7 @@ Select::writeOutput()
             case PdbAtomsSelection_All:
             {
                 t_trxstatus *status = open_trx(fnPDB_.c_str(), "w");
-                write_trxframe(status, &fr, NULL);
+                write_trxframe(status, &fr, nullptr);
                 close_trx(status);
                 break;
             }
@@ -739,7 +739,7 @@ Select::writeOutput()
                                                  atomIndicesSet.end());
                 t_trxstatus      *status = open_trx(fnPDB_.c_str(), "w");
                 write_trxframe_indexed(status, &fr, allAtomIndices.size(),
-                                       allAtomIndices.data(), NULL);
+                                       allAtomIndices.data(), nullptr);
                 close_trx(status);
                 break;
             }
@@ -754,7 +754,7 @@ Select::writeOutput()
                     }
                 }
                 t_trxstatus *status = open_trx(fnPDB_.c_str(), "w");
-                write_trxframe_indexed(status, &fr, indices.size(), indices.data(), NULL);
+                write_trxframe_indexed(status, &fr, indices.size(), indices.data(), nullptr);
                 close_trx(status);
                 break;
             }