Merge branch 'master' into pygromacs
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_lie.cpp
similarity index 93%
rename from src/gromacs/gmxana/gmx_lie.c
rename to src/gromacs/gmxana/gmx_lie.cpp
index 8407637a6aa7fbb74ef53e4bd2b44513815a72d2..c5fb1dd3160b53db08d8e21679ecda4c3d44f9a1 100644 (file)
  */
 #include "gmxpre.h"
 
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/enxio.h"
@@ -70,7 +70,7 @@ static t_liedata *analyze_names(int nre, gmx_enxnm_t *names, const char *ligand)
     /* Skip until we come to pressure */
     for (i = 0; (i < F_NRE); i++)
     {
-        if (strcmp(names[i].name, interaction_function[F_PRES].longname) == 0)
+        if (std::strcmp(names[i].name, interaction_function[F_PRES].longname) == 0)
         {
             break;
         }
@@ -81,16 +81,16 @@ static t_liedata *analyze_names(int nre, gmx_enxnm_t *names, const char *ligand)
     snew(ld, 1);
     for (; (i < nre); i++)
     {
-        if ((strstr(names[i].name, ligand) != NULL) &&
-            (strstr(names[i].name, self) == NULL))
+        if ((std::strstr(names[i].name, ligand) != NULL) &&
+            (std::strstr(names[i].name, self) == NULL))
         {
-            if (strstr(names[i].name, "LJ") != NULL)
+            if (std::strstr(names[i].name, "LJ") != NULL)
             {
                 ld->nlj++;
                 srenew(ld->lj, ld->nlj);
                 ld->lj[ld->nlj-1] = i;
             }
-            else if (strstr(names[i].name, "Coul") != NULL)
+            else if (std::strstr(names[i].name, "Coul") != NULL)
             {
                 ld->nqq++;
                 srenew(ld->qq, ld->nqq);
@@ -166,7 +166,6 @@ int gmx_lie(int argc, char *argv[])
     FILE         *out;
     int           nre, nframes = 0, ct = 0;
     ener_file_t   fp;
-    gmx_bool      bCont;
     t_liedata    *ld;
     gmx_enxnm_t  *enm = NULL;
     t_enxframe   *fr;
@@ -213,7 +212,7 @@ int gmx_lie(int argc, char *argv[])
     if (nframes > 0)
     {
         printf("DGbind = %.3f (%.3f)\n", lieaver/nframes,
-               sqrt(lieav2/nframes-sqr(lieaver/nframes)));
+               std::sqrt(lieav2/nframes-sqr(lieaver/nframes)));
     }
 
     do_view(oenv, ftp2fn(efXVG, NFILE, fnm), "-nxy");