if (a[0] != 0)
{
- e1 = exp(-x/a[0]) - 1;
+ e1 = gmx_expm1(-x/a[0]);
}
else
{
}
if (a[2] != 0)
{
- e2 = exp(-x/a[2]) - 1;
+ e2 = gmx_expm1(-x/a[2]);
}
else
{
//static var
int ExpfitTest::nrLines_;
+//cppcheck-suppress arrayIndexOutOfBounds fixed in 1.68-dev
std::vector<real> ExpfitTest::values_[expTestNrTypes];
int ExpfitTest::nrColumns_;
std::vector<real> ExpfitTest::standardDev_;
/* Keep the curr_edi pointer for the case that the next group is empty: */
last_edi = curr_edi;
/* Let's prepare to read in the next edi data set: */
- /* cppcheck-suppress uninitvar Fixed in cppcheck 1.65 */
curr_edi = edi_read;
}
if (edi_nr == 0)
#include "config.h"
+#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
}
break;
case eioNRVEC:
+ assert(item);
for (i = 0; (i < nitem); i++)
{
ptr = ((rvec *) item)[i];
{
res = sscanf(next_item(fp, ni_buf, NEXT_ITEM_BUF_LEN), "%lf\n",
&x);
- if (item)
- {
- ptr[m] = x;
- }
+ ptr[m] = x;
}
}
break;
idef->il[i].iatoms[j] = niatoms[j];
}
idef->il[i].nr = nnr;
- /* cppcheck-suppress uninitvar Fixed in cppcheck 1.65 */
sfree(niatoms);
}
}
/* This returns the real-valued index(!) to an ACF, equidistant on a log scale. */
static double getLogIndex(const int i, const t_gemParams *params)
{
- return (exp(((double)(i)) * params->logQuota) -1);
+ return gmx_expm1(((double)(i)) * params->logQuota);
}
extern t_gemParams *init_gemParams(const double sigma, const double D,
lambda = eigval[i]*AMU;
w = sqrt(BOLTZMANN*temp/lambda)/NANO;
hwkT = (hbar*w)/(BOLTZMANN*temp);
- dS = (hwkT/(exp(hwkT) - 1) - log(1-exp(-hwkT)));
+ dS = (hwkT/gmx_expm1(hwkT) - gmx_log1p(-exp(-hwkT)));
S += dS;
if (debug)
{
fprintf(stdout, "First time is not larger than 0, using index number as time for power fit\n");
for (i = 0; i < n; i++)
{
- x[i] = log(i+1);
+ x[i] = gmx_log1p(i);
}
}
{
n1 = (int)(2*amax/bin + 0.5);
nradial = (int)(rmax/bin + 0.5);
+ /* cppcheck-suppress zerodiv fixed in 1.68-dev */
invspa = n1/(2*amax);
+ /* cppcheck-suppress zerodiv fixed in 1.68-dev */
invspz = nradial/rmax;
if (bMirror)
{
}
else
{
- return bhn/(exp(bhn)-1) - log(1-exp(-bhn));
+ return bhn/gmx_expm1(bhn) - gmx_log1p(-exp(-bhn));
}
}
}
else
{
- return bhn/2 + bhn/(exp(bhn)-1)-1;
+ return bhn/2 + bhn/gmx_expm1(bhn)-1;
}
}
return 0;
}
+ if (maxangle == 0)
+ {
+ gmx_fatal(FARGS, "maxangle not given");
+ }
+
get_stx_coordnum (opt2fn("-f", NFILE, fnm), &natoms);
init_t_atoms(&atoms, natoms, TRUE);
snew(x, natoms);
add_at(&att, &natt, &prop[a], nmol);
}
- /* cppcheck-suppress uninitvar Fixed in cppcheck 1.65 */
sfree(vsite_m);
sfree(prop);
}
}
else if (simtemp->eSimTempScale == esimtempEXPONENTIAL)
{
- simtemp->temperatures[i] = simtemp->simtemp_low + (simtemp->simtemp_high-simtemp->simtemp_low)*((exp(temperature_lambdas[i])-1)/(exp(1.0)-1));
+ simtemp->temperatures[i] = simtemp->simtemp_low + (simtemp->simtemp_high-simtemp->simtemp_low)*(gmx_expm1(temperature_lambdas[i])/gmx_expm1(1.0));
}
else
{
last++;
}
}
- /* cppcheck-suppress uninitvar Fixed in cppcheck 1.65 */
sfree(bRemoveHarm);
fprintf(stderr, "Converted %d out of %d %s to morse bonds for mol %d\n",
nrharm-last, nrharm, interaction_function[bb].name, i);
gmx_fatal(FARGS, "Invalid particle type %s on line %s",
ptype, line);
}
+ /* cppcheck-suppress arrayIndexOutOfBounds #6329 */
pt = xl[j].ptype;
if (debug)
{
#define gmx_erfc(x) gmx_erfcf(x)
#endif
+#if defined(_MSC_VER) && _MSC_VER < 1800
+#define gmx_expm1(x) (exp(x)-1)
+#define gmx_log1p(x) log(1+x)
+#else
+#define gmx_expm1 expm1
+#define gmx_log1p log1p
+#endif
+
gmx_bool gmx_isfinite(real x);
gmx_bool gmx_isnan(real x);
static gmx_inline gmx_exclfilter gmx_simdcall
gmx_load_exclusion_filter(const unsigned *i)
{
+ /* cppcheck-suppress invalidPointerCast */
return gmx_simd_load_r((real *) (i));
}
{
if (mb >= 0)
{
+ /* cppcheck-suppress nullPointer #6330*/
if (atoms->nres <= mtop->maxres_renum)
{
/* Single residue molecule, keep counting */
+ /* cppcheck-suppress nullPointer #6330*/
maxresnr += mtop->molblock[mb].nmol*atoms->nres;
}
}
if (gmx_strcasecmp(buf, "nok") == 0)
{
/* An error occurred */
- for (i = 0; (i < nlines); i++)
+ if (lines)
{
- sfree(lines[i]);
+ for (i = 0; (i < nlines); i++)
+ {
+ sfree(lines[i]);
+ }
+ sfree(lines);
}
- sfree(lines);
NoHelp(dlg);
return;
}
--suppress=unusedStructMember
--suppress=invalidscanf
--suppress=sizeofCalculation
+ --suppress=invalidscanf_libc
--suppress=missingInclude:src/programs/mdrun/gmx_gpu_utils/gmx_gpu_utils.cu
--suppress=*:src/external/Random123-1.08/include/Random123/features/compilerfeatures.h
- --suppress=assignIfError:src/gromacs/mdlib/nbnxn_atomdata.c #Ticket 5695
--suppress=invalidPointerCast:src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh
--suppress=passedByValue:src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh
--suppress=passedByValue:src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_utils.cuh
-D__cplusplus
--suppress=variableScope
--suppress=unnecessaryForwardDeclaration
- --suppress=invalidscanf:src/gromacs/fileio/matio.cpp
- --suppress=invalidscanf:src/gromacs/fileio/xvgr.cpp
- --suppress=invalidscanf:src/gromacs/topology/index.cpp
- --suppress=invalidscanf:src/gromacs/gmxpreprocess/pdb2top.cpp
+ --suppress=memsetClassFloat #we assume IEEE754
+ --suppress=invalidscanf_libc #seems only important for security on non-std libc
+ --suppress=invalidscanf #same as last (style and portability checker have the same warning)
--suppress=passedByValue:src/gromacs/simd/tests/*
)