Tidy: modernize-use-nullptr
[alexxy/gromacs.git] / src / gromacs / selection / sm_compare.cpp
index c92a940e02864adbbee4f656764a041271c5cd05..03762e4929274055152b6666e7165467879b60cc 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.
@@ -142,14 +142,14 @@ evaluate_compare(const gmx::SelMethodEvalContext &context,
 
 /** Parameters for comparison expression evaluation. */
 static gmx_ana_selparam_t smparams_compare[] = {
-    {"int1",  {INT_VALUE,  -1, {NULL}}, NULL,
+    {"int1",  {INT_VALUE,  -1, {nullptr}}, nullptr,
      SPAR_OPTIONAL | SPAR_DYNAMIC | SPAR_ATOMVAL},
-    {"real1", {REAL_VALUE, -1, {NULL}}, NULL,
+    {"real1", {REAL_VALUE, -1, {nullptr}}, nullptr,
      SPAR_OPTIONAL | SPAR_DYNAMIC | SPAR_ATOMVAL},
-    {"op",    {STR_VALUE,   1, {NULL}}, NULL, 0},
-    {"int2",  {INT_VALUE,  -1, {NULL}}, NULL,
+    {"op",    {STR_VALUE,   1, {nullptr}}, nullptr, 0},
+    {"int2",  {INT_VALUE,  -1, {nullptr}}, nullptr,
      SPAR_OPTIONAL | SPAR_DYNAMIC | SPAR_ATOMVAL},
-    {"real2", {REAL_VALUE, -1, {NULL}}, NULL,
+    {"real2", {REAL_VALUE, -1, {nullptr}}, nullptr,
      SPAR_OPTIONAL | SPAR_DYNAMIC | SPAR_ATOMVAL},
 };
 
@@ -158,14 +158,14 @@ gmx_ana_selmethod_t sm_compare = {
     "cmp", GROUP_VALUE, SMETH_SINGLEVAL,
     asize(smparams_compare), smparams_compare,
     &init_data_compare,
-    NULL,
+    nullptr,
     &init_compare,
-    NULL,
+    nullptr,
     &free_data_compare,
-    NULL,
+    nullptr,
     &evaluate_compare,
-    NULL,
-    {NULL, NULL, 0, NULL},
+    nullptr,
+    {nullptr, nullptr, 0, nullptr},
 };
 
 /*! \brief
@@ -206,7 +206,7 @@ comparison_type(char *str)
 static const char *
 comparison_type_str(e_comparison_t cmpt)
 {
-    const char *p = NULL;
+    const char *p = nullptr;
     switch (cmpt)
     {
         case CMP_INVALID: p = "INVALID"; break;
@@ -330,8 +330,8 @@ init_comparison_value(t_compare_value *val, gmx_ana_selparam_t param[2])
     else
     {
         n           = 0;
-        val->i      = NULL;
-        val->r      = NULL;
+        val->i      = nullptr;
+        val->r      = nullptr;
     }
     return n;
 }
@@ -458,9 +458,9 @@ init_compare(const gmx_mtop_t * /* top */, int /* npar */, gmx_ana_selparam_t *p
             /* Reverse the sides to place the integer on the right */
             int    flags;
             d->left.r      = d->right.r;
-            d->right.r     = NULL;
+            d->right.r     = nullptr;
             d->right.i     = d->left.i;
-            d->left.i      = NULL;
+            d->left.i      = nullptr;
             flags          = d->left.flags;
             d->left.flags  = d->right.flags;
             d->right.flags = flags;