Merge branch release-2016
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / solvate.cpp
index e2c1d49ad9d28602826cfba70f393b783734536c..f8d979085bf2f18285f55f0c1d9c54e0feaf89ca 100644 (file)
@@ -86,7 +86,7 @@ static void sort_molecule(t_atoms **atoms_solvt, std::vector<RVec> *x,
     atoms = *atoms_solvt;
 
     /* copy each residue from *atoms to a molecule in *molecule */
-    moltypes   = NULL;
+    moltypes   = nullptr;
     nrmoltypes = 0;
     for (i = 0; i < atoms->nr; i++)
     {
@@ -311,7 +311,7 @@ static void replicateSolventBox(t_atoms *atoms, std::vector<RVec> *x,
     // but not in all).
     t_atoms           newAtoms;
     init_t_atoms(&newAtoms, 0, FALSE);
-    gmx::AtomsBuilder builder(&newAtoms, NULL);
+    gmx::AtomsBuilder builder(&newAtoms, nullptr);
     builder.reserve(atoms->nr * nmol, atoms->nres * nmol);
     std::vector<RVec> newX(atoms->nr * nmol);
     std::vector<RVec> newV(!v->empty() ? atoms->nr * nmol : 0);
@@ -651,7 +651,7 @@ static void add_solv(const char *fn, t_topology *top,
 
     char             *filename = gmxlibfn(fn);
     snew(top_solvt, 1);
-    readConformation(filename, top_solvt, &x_solvt, !v->empty() ? &v_solvt : NULL,
+    readConformation(filename, top_solvt, &x_solvt, !v->empty() ? &v_solvt : nullptr,
                      &ePBC_solvt, box_solvt, "solvent");
     t_atoms *atoms_solvt = &top_solvt->atoms;
     if (0 == atoms_solvt->nr)
@@ -774,7 +774,7 @@ static void update_top(t_atoms *atoms, matrix box, int NFILE, t_filenm fnm[],
             bSkip = FALSE;
             line++;
             strcpy(buf2, buf);
-            if ((temp = strchr(buf2, '\n')) != NULL)
+            if ((temp = strchr(buf2, '\n')) != nullptr)
             {
                 temp[0] = '\0';
             }
@@ -782,7 +782,7 @@ static void update_top(t_atoms *atoms, matrix box, int NFILE, t_filenm fnm[],
             if (buf2[0] == '[')
             {
                 buf2[0] = ' ';
-                if ((temp = strchr(buf2, '\n')) != NULL)
+                if ((temp = strchr(buf2, '\n')) != nullptr)
                 {
                     temp[0] = '\0';
                 }
@@ -823,7 +823,7 @@ static void update_top(t_atoms *atoms, matrix box, int NFILE, t_filenm fnm[],
             }
             if (bSkip)
             {
-                if ((temp = strchr(buf, '\n')) != NULL)
+                if ((temp = strchr(buf, '\n')) != nullptr)
                 {
                     temp[0] = '\0';
                 }
@@ -920,8 +920,8 @@ int gmx_solvate(int argc, char *argv[])
     t_filenm    fnm[] = {
         { efSTX, "-cp", "protein", ffOPTRD },
         { efSTX, "-cs", "spc216",  ffLIBRD},
-        { efSTO, NULL,  NULL,      ffWRITE},
-        { efTOP, NULL,  NULL,      ffOPTRW},
+        { efSTO, nullptr,  nullptr,      ffWRITE},
+        { efTOP, nullptr,  nullptr,      ffOPTRW},
     };
 #define NFILE asize(fnm)
 
@@ -972,7 +972,7 @@ int gmx_solvate(int argc, char *argv[])
         /* Generate a solute configuration */
         conf_prot = opt2fn("-cp", NFILE, fnm);
         readConformation(conf_prot, top, &x,
-                         bReadV ? &v : NULL, &ePBC, box, "solute");
+                         bReadV ? &v : nullptr, &ePBC, box, "solute");
         if (bReadV && v.empty())
         {
             fprintf(stderr, "Note: no velocities found\n");
@@ -1005,7 +1005,7 @@ int gmx_solvate(int argc, char *argv[])
     fprintf(stderr, "Writing generated configuration to %s\n", confout);
     const char *outputTitle = (bProt ? *top->name : "Generated by gmx solvate");
     write_sto_conf(confout, outputTitle, &top->atoms, as_rvec_array(x.data()),
-                   !v.empty() ? as_rvec_array(v.data()) : NULL, ePBC, box);
+                   !v.empty() ? as_rvec_array(v.data()) : nullptr, ePBC, box);
 
     /* print size of generated configuration */
     fprintf(stderr, "\nOutput configuration contains %d atoms in %d residues\n",