Manual part of readability-non-const-parameter.
Auto fix-it works outside of:
- function pointers
- passing pointer to constructor for storage
- non-const usage inside #if
Those are fixed/ignored here. Auto patch is next.
Change-Id: I996367d9710a764db53f84e6601935afb7415544
point. */
} t_corr;
-typedef real t_calc_func (t_corr *curr, int nx, int index[], int nx0, rvec xc[],
- rvec dcom, gmx_bool bTen, matrix mat);
+typedef real t_calc_func (t_corr *curr, int nx, const int index[], int nx0, rvec xc[],
+ const rvec dcom, gmx_bool bTen, matrix mat);
static real thistime(t_corr *curr)
{
}
/* the non-mass-weighted mean-squared displacement calcuation */
-static real calc1_norm(t_corr *curr, int nx, int index[], int nx0, rvec xc[],
- rvec dcom, gmx_bool bTen, matrix mat)
+static real calc1_norm(t_corr *curr, int nx, const int index[], int nx0, rvec xc[],
+ const rvec dcom, gmx_bool bTen, matrix mat)
{
int i, ix, m, m2;
real g, r, r2;
}
/* calculate the com of molecules in x and put it into xa */
-static void calc_mol_com(int nmol, int *molindex, const t_block *mols, const t_atoms *atoms,
+static void calc_mol_com(int nmol, const int *molindex, const t_block *mols, const t_atoms *atoms,
rvec *x, rvec *xa)
{
int m, mol, i, d;
}
static real calc_one_mw(t_corr *curr, int ix, int nx0, rvec xc[], real *tm,
- rvec dcom, gmx_bool bTen, matrix mat)
+ const rvec dcom, gmx_bool bTen, matrix mat)
{
real r2, r, mm;
rvec rv;
}
/* the normal, mass-weighted mean-squared displacement calcuation */
-static real calc1_mw(t_corr *curr, int nx, int index[], int nx0, rvec xc[],
- rvec dcom, gmx_bool bTen, matrix mat)
+static real calc1_mw(t_corr *curr, int nx, const int index[], int nx0, rvec xc[],
+ const rvec dcom, gmx_bool bTen, matrix mat)
{
int i;
real g, tm;
xcur = the current coordinates
xprev = the previous coordinates
box = the box matrix */
-static void prep_data(gmx_bool bMol, int gnx, int index[],
+static void prep_data(gmx_bool bMol, int gnx, const int index[],
rvec xcur[], rvec xprev[], matrix box)
{
int i, m, ind;
}
-static real calc1_mol(t_corr *curr, int nx, int gmx_unused index[], int nx0, rvec xc[],
- rvec dcom, gmx_bool bTen, matrix mat)
+static real calc1_mol(t_corr *curr, int nx, const int gmx_unused index[], int nx0, rvec xc[],
+ const rvec dcom, gmx_bool bTen, matrix mat)
{
int i;
real g, tm, gtot, tt;
}
static void printmol(t_corr *curr, const char *fn,
- const char *fn_pdb, int *molindex, const t_topology *top,
+ const char *fn_pdb, const int *molindex, const t_topology *top,
rvec *x, int ePBC, matrix box, const gmx_output_env_t *oenv)
{
#define NDIST 100
static inline void add_j_to_nblist_cg(t_nblist *nlist,
int j_start, int j_end,
- t_excl *bexcl, gmx_bool i_is_j)
+ const t_excl *bexcl, gmx_bool i_is_j)
{
int nrj = nlist->nrj;
int j;
}
typedef void
- put_in_list_t (gmx_bool bHaveVdW[],
+ put_in_list_t (const gmx_bool bHaveVdW[],
int ngid,
const t_mdatoms *md,
int icg,
int jgid,
int nj,
- int jjcg[],
- int index[],
- t_excl bExcl[],
+ const int jjcg[],
+ const int index[],
+ const t_excl bExcl[],
int shift,
t_forcerec * fr,
gmx_bool bDoVdW,
int solvent_opt);
static void
-put_in_list_at(gmx_bool bHaveVdW[],
- int ngid,
- const t_mdatoms *md,
- int icg,
- int jgid,
- int nj,
- int jjcg[],
- int index[],
- t_excl bExcl[],
- int shift,
- t_forcerec * fr,
- gmx_bool bDoVdW,
- gmx_bool bDoCoul,
- int solvent_opt)
+put_in_list_at(const gmx_bool bHaveVdW[],
+ int ngid,
+ const t_mdatoms *md,
+ int icg,
+ int jgid,
+ int nj,
+ const int jjcg[],
+ const int index[],
+ const t_excl bExcl[],
+ int shift,
+ t_forcerec * fr,
+ gmx_bool bDoVdW,
+ gmx_bool bDoCoul,
+ int solvent_opt)
{
/* The a[] index has been removed,
* to put it back in i_atom should be a[i0] and jj should be a[jj].
}
static void
-put_in_list_qmmm(gmx_bool gmx_unused bHaveVdW[],
+put_in_list_qmmm(const gmx_bool gmx_unused bHaveVdW[],
int ngid,
const t_mdatoms * /* md */,
int icg,
int jgid,
int nj,
- int jjcg[],
- int index[],
- t_excl bExcl[],
+ const int jjcg[],
+ const int index[],
+ const t_excl bExcl[],
int shift,
t_forcerec * fr,
gmx_bool gmx_unused bDoVdW,
}
static void
-put_in_list_cg(gmx_bool gmx_unused bHaveVdW[],
+put_in_list_cg(const gmx_bool gmx_unused bHaveVdW[],
int ngid,
const t_mdatoms * /* md */,
int icg,
int jgid,
int nj,
- int jjcg[],
- int index[],
- t_excl bExcl[],
+ const int jjcg[],
+ const int index[],
+ const t_excl bExcl[],
int shift,
t_forcerec * fr,
gmx_bool gmx_unused bDoVdW,
*
************************************************/
-static real calc_image_tric(rvec xi, rvec xj, matrix box,
- rvec b_inv, int *shift)
+static real calc_image_tric(const rvec xi, const rvec xj, matrix box,
+ const rvec b_inv, int *shift)
{
/* This code assumes that the cut-off is smaller than
* a half times the smallest diagonal element of the box.
return r2;
}
-static real calc_image_rect(rvec xi, rvec xj, rvec box_size,
- rvec b_inv, int *shift)
+static real calc_image_rect(const rvec xi, const rvec xj, const rvec box_size,
+ const rvec b_inv, int *shift)
{
const real h15 = 1.5;
real ddx, ddy, ddz;
nsbuf->nj += nrj;
}
-static void ns_inner_tric(rvec x[],
- int icg,
- int *i_egp_flags,
- int njcg,
- int jcg[],
- matrix box,
- rvec b_inv,
- real rcut2,
- t_block *cgs,
- t_ns_buf **ns_buf,
- gmx_bool bHaveVdW[],
- int ngid,
- const t_mdatoms *md,
- t_excl bexcl[],
- t_forcerec *fr,
- put_in_list_t *put_in_list)
+static void ns_inner_tric(rvec x[],
+ int icg,
+ const int *i_egp_flags,
+ int njcg,
+ const int jcg[],
+ matrix box,
+ rvec b_inv,
+ real rcut2,
+ t_block *cgs,
+ t_ns_buf **ns_buf,
+ gmx_bool bHaveVdW[],
+ int ngid,
+ const t_mdatoms *md,
+ t_excl bexcl[],
+ t_forcerec *fr,
+ put_in_list_t *put_in_list)
{
int shift;
int j, nrj, jgid;
}
}
-static void ns_inner_rect(rvec x[],
- int icg,
- int *i_egp_flags,
- int njcg,
- int jcg[],
- gmx_bool bBox,
- rvec box_size,
- rvec b_inv,
- real rcut2,
- t_block *cgs,
- t_ns_buf **ns_buf,
- gmx_bool bHaveVdW[],
- int ngid,
- const t_mdatoms *md,
- t_excl bexcl[],
- t_forcerec *fr,
- put_in_list_t *put_in_list)
+static void ns_inner_rect(rvec x[],
+ int icg,
+ const int *i_egp_flags,
+ int njcg,
+ const int jcg[],
+ gmx_bool bBox,
+ rvec box_size,
+ rvec b_inv,
+ real rcut2,
+ t_block *cgs,
+ t_ns_buf **ns_buf,
+ gmx_bool bHaveVdW[],
+ int ngid,
+ const t_mdatoms *md,
+ t_excl bexcl[],
+ t_forcerec *fr,
+ put_in_list_t *put_in_list)
{
int shift;
int j, nrj, jgid;
gmx_localtop_t *top,
t_grid *grid,
t_excl bexcl[],
- gmx_bool *bExcludeAlleg,
+ const gmx_bool *bExcludeAlleg,
const t_mdatoms *md,
put_in_list_t *put_in_list,
gmx_bool bHaveVdW[],
* stores the pointers for later use.
* See the class description for additional semantics.
*/
- MindistAction(int *closestPoint, real *minDist2, rvec *dx)
+ MindistAction(int *closestPoint, real *minDist2, rvec *dx) // NOLINT(readability-non-const-parameter)
: closestPoint_(*closestPoint), minDist2_(*minDist2), dx_(*dx)
{
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, 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.
#endif
}
-void init(int *argc, char ***argv)
+void init(int *argc, char ***argv) // NOLINT(readability-non-const-parameter)
{
#if GMX_LIB_MPI
int isInitialized = 0, isFinalized = 0;