Merge branch 'master' into pygromacs
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_mk_angndx.cpp
similarity index 97%
rename from src/gromacs/gmxana/gmx_mk_angndx.c
rename to src/gromacs/gmxana/gmx_mk_angndx.cpp
index 048d7452fa013cf7a8737b9c4a8fde44ae882c4f..b435bcb3b0ac99d22960b313f6f6767625be1c28 100644 (file)
  */
 #include "gmxpre.h"
 
-#include <math.h>
+#include <cmath>
 
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/trxio.h"
+#include "gromacs/gmxana/gmx_ana.h"
 #include "gromacs/legacyheaders/macros.h"
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
 static int calc_ntype(int nft, int *ft, t_idef *idef)
@@ -178,7 +180,7 @@ static void fill_ang(int nft, int *ft, int fac,
             {
                 for (j = 0; j < fac; j++)
                 {
-                    if (atom[ia[1+j]].m < 1.5 && fabs(atom[ia[1+j]].q) < hq)
+                    if (atom[ia[1+j]].m < 1.5 && std::abs(atom[ia[1+j]].q) < hq)
                     {
                         bUse = FALSE;
                     }
@@ -285,6 +287,7 @@ int gmx_mk_angndx(int argc, char *argv[])
         return 0;
     }
 
+    GMX_RELEASE_ASSERT(opt[0] != 0, "Options inconsistency; opt[0] is NULL");
 
     ft = select_ftype(opt[0], &nft, &mult);