*/
#include "gmxpre.h"
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
+#include <cmath>
+#include <cstdlib>
+#include <cstring>
+
+#include <algorithm>
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/confio.h"
real max, len2, scale;
atom_id maxi;
int i, m, onedim;
- gmx_bool bOne;
if ((nfr_x == 0) || (nfr_v == 0))
{
}
else
{
- scale = 10.0/sqrt(max);
+ scale = 10.0/std::sqrt(max);
}
}
printf("Maximum %s is %g on atom %d %s, res. %s %d\n",
- title, sqrt(max), maxi+1, *(atoms->atomname[maxi]),
+ title, std::sqrt(max), maxi+1, *(atoms->atomname[maxi]),
*(atoms->resinfo[atoms->atom[maxi].resind].name),
atoms->resinfo[atoms->atom[maxi].resind].nr);
len2 += sqr(sum[index[i]][m]);
}
}
- atoms->pdbinfo[index[i]].bfac = sqrt(len2)*scale;
+ atoms->pdbinfo[index[i]].bfac = std::sqrt(len2)*scale;
}
}
else
for (i = 0; (i < gnx); i++)
{
vn = norm(v[index[i]]);
- vnmax = max(vn, vnmax);
+ vnmax = std::max(vn, vnmax);
}
vnmax *= 2;
- *nhisto = 1+(vnmax/binwidth);
+ *nhisto = static_cast<int>(1+(vnmax/binwidth));
snew(*histo, *nhisto);
}
for (i = 0; (i < gnx); i++)
{
vn = norm(v[index[i]]);
- in = vn/binwidth;
+ in = static_cast<int>(vn/binwidth);
if (in >= *nhisto)
{
nnn = in+100;
t_trxstatus *status;
t_trxstatus *status_out = NULL;
gmx_rmpbc_t gpbc = NULL;
- int i, j, n;
+ int i, j;
int nr_xfr, nr_vfr, nr_ffr;
char **grpname;
int *isize0, *isize;
t_block *mols;
gmx_bool bTop, bOX, bOXT, bOV, bOF, bOB, bOT, bEKT, bEKR, bCV, bCF;
gmx_bool bDim[4], bDum[4], bVD;
- char *sffmt, sffmt6[1024];
+ char sffmt[STRLEN], sffmt6[STRLEN];
const char *box_leg[6] = { "XX", "YY", "ZZ", "YX", "ZX", "ZY" };
output_env_t oenv;
if (bFP)
{
- sffmt = "\t" gmx_real_fullprecision_pfmt;
+ sprintf(sffmt, "\t%s", gmx_real_fullprecision_pfmt);
}
else
{
- sffmt = "\t%g";
+ sprintf(sffmt, "\t%%g");
}
sprintf(sffmt6, "%s%s%s%s%s%s", sffmt, sffmt, sffmt, sffmt, sffmt, sffmt);