Tidy: modernize-use-nullptr
[alexxy/gromacs.git] / src / gromacs / options / timeunitmanager.cpp
index 8136f80681eabfcdd88fda6916b7e4071f96b654..4a4e9af6f5036278783d978ef4202c0884b9ae57 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -123,7 +123,7 @@ double TimeUnitManager::inverseTimeScaleFactor() const
  */
 
 TimeUnitBehavior::TimeUnitBehavior()
-    : timeUnit_(TimeUnit_Default), timeUnitStore_(NULL)
+    : timeUnit_(TimeUnit_Default), timeUnitStore_(nullptr)
 {
 }
 
@@ -132,7 +132,7 @@ void TimeUnitBehavior::setTimeUnit(TimeUnit timeUnit)
     GMX_RELEASE_ASSERT(timeUnit >= 0 && timeUnit <= TimeUnit_s,
                        "Invalid time unit");
     timeUnit_ = timeUnit;
-    if (timeUnitStore_ != NULL)
+    if (timeUnitStore_ != nullptr)
     {
         *timeUnitStore_ = timeUnit;
     }
@@ -147,7 +147,7 @@ void TimeUnitBehavior::setTimeUnitStore(TimeUnit *store)
 void TimeUnitBehavior::setTimeUnitFromEnvironment()
 {
     const char *const value = std::getenv("GMXTIMEUNIT");
-    if (value != NULL)
+    if (value != nullptr)
     {
         ConstArrayRef<const char *>                 timeUnits(g_timeUnits);
         ConstArrayRef<const char *>::const_iterator i =
@@ -216,7 +216,7 @@ void TimeUnitBehavior::optionsFinishing(Options *options)
     double factor = TimeUnitManager(timeUnit()).timeScaleFactor();
     TimeOptionScaler<DoubleOptionInfo>(factor).visitSection(&options->rootSection());
     TimeOptionScaler<FloatOptionInfo>(factor).visitSection(&options->rootSection());
-    if (timeUnitStore_ != NULL)
+    if (timeUnitStore_ != nullptr)
     {
         *timeUnitStore_ = static_cast<TimeUnit>(timeUnit_);
     }