Tidy: modernize-use-nullptr
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_chi.cpp
index f3412fcb5f6bc291f2d9760127b9aba270d6ff8a..1ce9b2645f52f29d5b1893dda8f3111fc11eefe4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -479,16 +479,16 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t *rt,
 #define NKKKCHI asize(kkkchi1)
 #define NJC (NKKKPHI+NKKKPSI+NKKKCHI)
 
-    FILE       *fp, *ssfp[3] = {NULL, NULL, NULL};
+    FILE       *fp, *ssfp[3] = {nullptr, nullptr, nullptr};
     const char *sss[3] = { "sheet", "helix", "coil" };
     real        S2;
     real       *normhisto;
     real      **Jc, **Jcsig;
-    int     ****his_aa_ss = NULL;
+    int     ****his_aa_ss = nullptr;
     int      ***his_aa, *histmp;
     int         i, j, k, m, n, nn, Dih, nres, hindex, angle;
     gmx_bool    bBfac, bOccup;
-    char        hisfile[256], hhisfile[256], sshisfile[256], title[256], *ss_str = NULL;
+    char        hisfile[256], hhisfile[256], sshisfile[256], title[256], *ss_str = nullptr;
     char      **leg;
     const char *residue_name;
     int         rt_size;
@@ -630,7 +630,7 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t *rt,
                         }
                         break;
                     default: /* covers edOmega and higher Chis than Chi1 */
-                        calc_distribution_props(nbin, histmp, -M_PI, 0, NULL, &S2);
+                        calc_distribution_props(nbin, histmp, -M_PI, 0, nullptr, &S2);
                         break;
                 }
                 dlist[i].S2[Dih]        = S2;
@@ -892,12 +892,12 @@ static FILE *rama_file(const char *fn, const char *title, const char *xaxis,
 static void do_rama(int nf, int nlist, t_dlist dlist[], real **dih,
                     gmx_bool bViol, gmx_bool bRamOmega, const gmx_output_env_t *oenv)
 {
-    FILE    *fp, *gp = NULL;
+    FILE    *fp, *gp = nullptr;
     gmx_bool bOm;
     char     fn[256];
     int      i, j, k, Xi1, Xi2, Phi, Psi, Om = 0, nlevels;
 #define NMAT 120
-    real   **mat  = NULL, phi, psi, omega, axis[NMAT], lo, hi;
+    real   **mat  = nullptr, phi, psi, omega, axis[NMAT], lo, hi;
     t_rgb    rlo  = { 1.0, 0.0, 0.0 };
     t_rgb    rmid = { 1.0, 1.0, 1.0 };
     t_rgb    rhi  = { 0.0, 0.0, 1.0 };
@@ -1140,13 +1140,13 @@ static void order_params(FILE *log,
     }
     xvgrclose(fp);
 
-    if (NULL != pdbfn)
+    if (nullptr != pdbfn)
     {
         real x0, y0, z0;
 
         atoms->havePdbInfo = TRUE;
 
-        if (NULL == atoms->pdbinfo)
+        if (nullptr == atoms->pdbinfo)
         {
             snew(atoms->pdbinfo, atoms->nr);
         }
@@ -1174,7 +1174,7 @@ static void order_params(FILE *log,
         fprintf(fp, "REMARK generated by g_chi\n");
         fprintf(fp, "REMARK "
                 "B-factor field contains negative of dihedral order parameters\n");
-        write_pdbfile(fp, NULL, atoms, x, ePBC, box, ' ', 0, NULL, TRUE);
+        write_pdbfile(fp, nullptr, atoms, x, ePBC, box, ' ', 0, nullptr, TRUE);
         x0 = y0 = z0 = 1000.0;
         for (i = 0; (i < atoms->nr); i++)
         {
@@ -1312,7 +1312,7 @@ int gmx_chi(int argc, char *argv[])
     static gmx_bool    bAll        = FALSE;
     static gmx_bool    bPhi        = FALSE, bPsi = FALSE, bOmega = FALSE;
     static real        bfac_init   = -1.0, bfac_max = 0;
-    static const char *maxchistr[] = { NULL, "0", "1", "2", "3",  "4", "5", "6", NULL };
+    static const char *maxchistr[] = { nullptr, "0", "1", "2", "3",  "4", "5", "6", nullptr };
     static gmx_bool    bRama       = FALSE, bShift = FALSE, bViol = FALSE, bRamOmega = FALSE;
     static gmx_bool    bNormHisto  = TRUE, bChiProduct = FALSE, bHChi = FALSE, bRAD = FALSE, bPBC = TRUE;
     static real        core_frac   = 0.5;
@@ -1376,8 +1376,8 @@ int gmx_chi(int argc, char *argv[])
     int                i, **chi_lookup, *multiplicity;
 
     t_filenm           fnm[] = {
-        { efSTX, "-s",  NULL,     ffREAD  },
-        { efTRX, "-f",  NULL,     ffREAD  },
+        { efSTX, "-s",  nullptr,     ffREAD  },
+        { efTRX, "-f",  nullptr,     ffREAD  },
         { efXVG, "-o",  "order",  ffWRITE },
         { efPDB, "-p",  "order",  ffOPTWR },
         { efDAT, "-ss", "ssdump", ffOPTRD },
@@ -1452,9 +1452,9 @@ int gmx_chi(int argc, char *argv[])
     /* Find the chi angles using atoms struct and a list of amino acids */
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(ftp2fn(efSTX, NFILE, fnm), top, &ePBC, &x, NULL, box, FALSE);
+    read_tps_conf(ftp2fn(efSTX, NFILE, fnm), top, &ePBC, &x, nullptr, box, FALSE);
     t_atoms    &atoms = top->atoms;
-    if (atoms.pdbinfo == NULL)
+    if (atoms.pdbinfo == nullptr)
     {
         snew(atoms.pdbinfo, atoms.nr);
     }