From 09e75722b527b6e107cb847ab549f643bb569a0b Mon Sep 17 00:00:00 2001 From: Roland Schulz Date: Sun, 20 May 2018 13:28:38 -0700 Subject: [PATCH] clang-tidy: readability-non-const-parameter (2/2) Automatic fix-it Change-Id: I574696fc8595855438802af81112e04b3312b8c2 --- src/gromacs/CMakeLists.txt | 2 +- .../analysisdata/modules/histogram.cpp | 2 +- src/gromacs/analysisdata/modules/histogram.h | 4 +-- src/gromacs/analysisdata/modules/plot.cpp | 2 +- src/gromacs/analysisdata/modules/plot.h | 4 +-- .../correlationfunctions/crosscorr.cpp | 4 +-- src/gromacs/correlationfunctions/expfit.cpp | 2 +- src/gromacs/correlationfunctions/expfit.h | 4 +-- .../correlationfunctions/gmx_lmcurve.cpp | 2 +- src/gromacs/domdec/domdec.cpp | 10 +++--- src/gromacs/domdec/domdec.h | 2 +- src/gromacs/domdec/domdec_topology.cpp | 8 ++--- src/gromacs/domdec/redistribute.cpp | 10 +++--- src/gromacs/essentialdynamics/edsam.cpp | 2 +- src/gromacs/ewald/ewald.cpp | 2 +- src/gromacs/ewald/long-range-correction.cpp | 8 ++--- src/gromacs/ewald/long-range-correction.h | 8 ++--- src/gromacs/ewald/pme-gather.cpp | 2 +- src/gromacs/ewald/pme-gather.h | 4 +-- src/gromacs/ewald/pme-grid.cpp | 2 +- src/gromacs/ewald/pme-grid.h | 4 +-- src/gromacs/ewald/pme-redistribute.cpp | 2 +- src/gromacs/ewald/pme-spread.cpp | 2 +- src/gromacs/ewald/pme.cpp | 4 +-- src/gromacs/fft/fft5d.cpp | 8 ++--- src/gromacs/fft/parallel_3dfft.cpp | 18 +++++------ src/gromacs/fft/parallel_3dfft.h | 4 +-- src/gromacs/fileio/enxio.cpp | 4 +-- src/gromacs/fileio/espio.cpp | 4 +-- src/gromacs/fileio/espio.h | 4 +-- src/gromacs/fileio/libxdrf.cpp | 4 +-- src/gromacs/fileio/matio.cpp | 2 +- src/gromacs/fileio/pdbio.cpp | 6 ++-- src/gromacs/gmxana/anadih.cpp | 8 ++--- src/gromacs/gmxana/binsearch.cpp | 6 ++-- src/gromacs/gmxana/binsearch.h | 6 ++-- src/gromacs/gmxana/dens_filter.cpp | 6 ++-- src/gromacs/gmxana/dens_filter.h | 6 ++-- src/gromacs/gmxana/fitahx.cpp | 6 ++-- src/gromacs/gmxana/gmx_anaeig.cpp | 12 +++---- src/gromacs/gmxana/gmx_analyze.cpp | 4 +-- src/gromacs/gmxana/gmx_bar.cpp | 2 +- src/gromacs/gmxana/gmx_bundle.cpp | 4 +-- src/gromacs/gmxana/gmx_chi.cpp | 4 +-- src/gromacs/gmxana/gmx_cluster.cpp | 2 +- src/gromacs/gmxana/gmx_confrms.cpp | 16 +++++----- src/gromacs/gmxana/gmx_current.cpp | 8 ++--- src/gromacs/gmxana/gmx_density.cpp | 6 ++-- src/gromacs/gmxana/gmx_densorder.cpp | 2 +- src/gromacs/gmxana/gmx_dielectric.cpp | 6 ++-- src/gromacs/gmxana/gmx_dipoles.cpp | 6 ++-- src/gromacs/gmxana/gmx_disre.cpp | 4 +-- src/gromacs/gmxana/gmx_do_dssp.cpp | 6 ++-- src/gromacs/gmxana/gmx_dyndom.cpp | 4 +-- src/gromacs/gmxana/gmx_editconf.cpp | 6 ++-- src/gromacs/gmxana/gmx_energy.cpp | 4 +-- src/gromacs/gmxana/gmx_genion.cpp | 6 ++-- src/gromacs/gmxana/gmx_gyrate.cpp | 4 +-- src/gromacs/gmxana/gmx_h2order.cpp | 4 +-- src/gromacs/gmxana/gmx_hbond.cpp | 16 +++++----- src/gromacs/gmxana/gmx_hydorder.cpp | 2 +- src/gromacs/gmxana/gmx_make_edi.cpp | 4 +-- src/gromacs/gmxana/gmx_make_ndx.cpp | 6 ++-- src/gromacs/gmxana/gmx_mdmat.cpp | 6 ++-- src/gromacs/gmxana/gmx_mindist.cpp | 6 ++-- src/gromacs/gmxana/gmx_mk_angndx.cpp | 10 +++--- src/gromacs/gmxana/gmx_nmr.cpp | 2 +- src/gromacs/gmxana/gmx_order.cpp | 8 ++--- src/gromacs/gmxana/gmx_pme_error.cpp | 20 ++++++------ src/gromacs/gmxana/gmx_potential.cpp | 2 +- src/gromacs/gmxana/gmx_rmsdist.cpp | 8 ++--- src/gromacs/gmxana/gmx_rmsf.cpp | 2 +- src/gromacs/gmxana/gmx_sham.cpp | 32 +++++++++---------- src/gromacs/gmxana/gmx_sorient.cpp | 4 +-- src/gromacs/gmxana/gmx_spol.cpp | 4 +-- src/gromacs/gmxana/gmx_traj.cpp | 20 ++++++------ src/gromacs/gmxana/gmx_trjconv.cpp | 4 +-- src/gromacs/gmxana/gmx_tune_pme.cpp | 22 ++++++------- src/gromacs/gmxana/gmx_velacc.cpp | 2 +- src/gromacs/gmxana/gmx_wham.cpp | 6 ++-- src/gromacs/gmxana/gmx_xpm2ps.cpp | 4 +-- src/gromacs/gmxana/gstat.h | 8 ++--- src/gromacs/gmxana/hxprops.cpp | 14 ++++---- src/gromacs/gmxana/hxprops.h | 12 +++---- src/gromacs/gmxana/nrama.cpp | 4 +-- src/gromacs/gmxana/nsfactor.cpp | 22 ++++++------- src/gromacs/gmxana/nsfactor.h | 22 ++++++------- src/gromacs/gmxana/princ.cpp | 6 ++-- src/gromacs/gmxana/princ.h | 6 ++-- src/gromacs/gmxana/sfactor.cpp | 4 +-- src/gromacs/gmxana/sfactor.h | 4 +-- src/gromacs/gmxana/thermochemistry.cpp | 10 +++--- src/gromacs/gmxana/thermochemistry.h | 10 +++--- src/gromacs/gmxlib/conformation-utilities.cpp | 4 +-- src/gromacs/gmxlib/conformation-utilities.h | 4 +-- .../nb_kernel_c/nb_kernel_allvsall.cpp | 12 +++---- src/gromacs/gmxlib/nrnb.cpp | 2 +- src/gromacs/gmxpreprocess/add_par.cpp | 4 +-- src/gromacs/gmxpreprocess/add_par.h | 4 +-- src/gromacs/gmxpreprocess/convparm.cpp | 2 +- src/gromacs/gmxpreprocess/gen_ad.cpp | 8 ++--- .../gmxpreprocess/gen_maxwell_velocities.cpp | 4 +-- src/gromacs/gmxpreprocess/gen_vsite.cpp | 4 +-- src/gromacs/gmxpreprocess/genconf.cpp | 2 +- src/gromacs/gmxpreprocess/genhydro.cpp | 10 +++--- src/gromacs/gmxpreprocess/grompp.cpp | 32 +++++++++---------- src/gromacs/gmxpreprocess/hizzie.cpp | 6 ++-- src/gromacs/gmxpreprocess/pdb2gmx.cpp | 2 +- src/gromacs/gmxpreprocess/pdb2top.cpp | 4 +-- src/gromacs/gmxpreprocess/pdb2top.h | 4 +-- src/gromacs/gmxpreprocess/topio.cpp | 2 +- src/gromacs/gmxpreprocess/topshake.cpp | 4 +-- src/gromacs/gmxpreprocess/vsite_parm.cpp | 10 +++--- src/gromacs/imd/imd.cpp | 8 ++--- src/gromacs/listed-forces/listed-internal.cpp | 4 +-- src/gromacs/listed-forces/listed-internal.h | 2 +- src/gromacs/listed-forces/pairs.cpp | 10 +++--- src/gromacs/math/do_fit.cpp | 6 ++-- src/gromacs/math/do_fit.h | 6 ++-- src/gromacs/mdlib/calcmu.cpp | 4 +-- src/gromacs/mdlib/calcmu.h | 4 +-- src/gromacs/mdlib/calcvir.cpp | 4 +-- src/gromacs/mdlib/expanded.cpp | 6 ++-- src/gromacs/mdlib/force.cpp | 2 +- src/gromacs/mdlib/groupcoord.cpp | 26 +++++++-------- src/gromacs/mdlib/groupcoord.h | 2 +- src/gromacs/mdlib/lincs.cpp | 2 +- src/gromacs/mdlib/mdebin.cpp | 2 +- src/gromacs/mdlib/mdebin_bar.cpp | 2 +- src/gromacs/mdlib/membed.cpp | 2 +- src/gromacs/mdlib/nbnxn_search.cpp | 2 +- src/gromacs/mdlib/nsgrid.cpp | 2 +- src/gromacs/mdlib/qmmm.cpp | 2 +- src/gromacs/mdlib/rbin.cpp | 2 +- src/gromacs/mdlib/rbin.h | 2 +- src/gromacs/mdlib/repl_ex.cpp | 4 +-- src/gromacs/mdlib/settle.cpp | 2 +- src/gromacs/mdlib/settle.h | 2 +- src/gromacs/mdlib/shake.cpp | 6 ++-- src/gromacs/mdlib/shellfc.cpp | 2 +- src/gromacs/mdlib/sim_util.cpp | 2 +- src/gromacs/mdlib/splitter.cpp | 2 +- src/gromacs/mdlib/stat.cpp | 2 +- src/gromacs/mdlib/update.cpp | 24 +++++++------- src/gromacs/mdlib/vcm.cpp | 4 +-- src/gromacs/mdrunutility/threadaffinity.cpp | 2 +- src/gromacs/pbcutil/mshift.cpp | 12 +++---- src/gromacs/pulling/pull.cpp | 2 +- src/gromacs/pulling/pull_rotation.cpp | 16 +++++----- src/gromacs/selection/sm_compare.cpp | 4 +-- src/gromacs/statistics/statistics.cpp | 4 +-- src/gromacs/swap/swapcoords.cpp | 18 +++++------ src/gromacs/tables/forcetable.cpp | 4 +-- src/gromacs/tools/convert_tpr.cpp | 12 +++---- src/gromacs/topology/atomprop.cpp | 4 +-- src/gromacs/topology/index.cpp | 6 ++-- src/gromacs/topology/index.h | 8 ++--- .../trajectoryanalysis/modules/sasa.cpp | 4 +-- 158 files changed, 491 insertions(+), 491 deletions(-) diff --git a/src/gromacs/CMakeLists.txt b/src/gromacs/CMakeLists.txt index 24ba0d1a61..149236a417 100644 --- a/src/gromacs/CMakeLists.txt +++ b/src/gromacs/CMakeLists.txt @@ -284,7 +284,7 @@ if (GMX_CLANG_TIDY) -misc-misplaced-const,\ -misc-incorrect-roundings,-misc-macro-parentheses,-readability-function-size,-readability-else-after-return,\ -readability-inconsistent-declaration-parameter-name,-misc-throw-by-value-catch-by-reference,\ - -readability-non-const-parameter,-readability-implicit-bool-conversion,\ + -readability-implicit-bool-conversion,\ modernize-use-nullptr,modernize-use-emplace;-warnings-as-errors=*;-fix") endif() diff --git a/src/gromacs/analysisdata/modules/histogram.cpp b/src/gromacs/analysisdata/modules/histogram.cpp index 1a1d1cb610..932f9e7dae 100644 --- a/src/gromacs/analysisdata/modules/histogram.cpp +++ b/src/gromacs/analysisdata/modules/histogram.cpp @@ -396,7 +396,7 @@ AbstractAverageHistogram::scaleAll(real factor) void -AbstractAverageHistogram::scaleAllByVector(real factor[]) +AbstractAverageHistogram::scaleAllByVector(const real factor[]) { for (int c = 0; c < columnCount(); ++c) { diff --git a/src/gromacs/analysisdata/modules/histogram.h b/src/gromacs/analysisdata/modules/histogram.h index 43a4b72b68..a3bb56ed74 100644 --- a/src/gromacs/analysisdata/modules/histogram.h +++ b/src/gromacs/analysisdata/modules/histogram.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2013,2014,2015,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. @@ -306,7 +306,7 @@ class AbstractAverageHistogram : public AbstractAnalysisArrayData //! Scales all histograms by a uniform scaling factor. void scaleAll(real factor); //! Scales the value of each bin by a different scaling factor. - void scaleAllByVector(real factor[]); + void scaleAllByVector(const real factor[]); /*! \brief * Notifies attached modules of the histogram data. * diff --git a/src/gromacs/analysisdata/modules/plot.cpp b/src/gromacs/analysisdata/modules/plot.cpp index c80a5bba38..fa8a49558f 100644 --- a/src/gromacs/analysisdata/modules/plot.cpp +++ b/src/gromacs/analysisdata/modules/plot.cpp @@ -511,7 +511,7 @@ AnalysisDataVectorPlotModule::setWriteNorm(bool bWrite) void -AnalysisDataVectorPlotModule::setWriteMask(bool bWrite[DIM + 1]) +AnalysisDataVectorPlotModule::setWriteMask(const bool bWrite[DIM + 1]) { for (int i = 0; i < DIM + 1; ++i) { diff --git a/src/gromacs/analysisdata/modules/plot.h b/src/gromacs/analysisdata/modules/plot.h index 5887c080c8..dfc5c8ac79 100644 --- a/src/gromacs/analysisdata/modules/plot.h +++ b/src/gromacs/analysisdata/modules/plot.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2012,2013,2014,2015,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. @@ -315,7 +315,7 @@ class AnalysisDataVectorPlotModule : public AbstractPlotModule /*! \brief * Set mask for what to write. */ - void setWriteMask(bool bWrite[4]); + void setWriteMask(const bool bWrite[4]); virtual void pointsAdded(const AnalysisDataPointSetRef &points); diff --git a/src/gromacs/correlationfunctions/crosscorr.cpp b/src/gromacs/correlationfunctions/crosscorr.cpp index 22291ee132..d757fba9fb 100644 --- a/src/gromacs/correlationfunctions/crosscorr.cpp +++ b/src/gromacs/correlationfunctions/crosscorr.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2017,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. @@ -83,7 +83,7 @@ static void complexConjugatMult(t_complex *in1, t_complex *in2) * \param[out] corr output correlation * \param[in] fft FFT data structure */ -static void cross_corr_low(int n, real f[], real g[], real corr[], gmx_fft_t fft) +static void cross_corr_low(int n, const real f[], const real g[], real corr[], gmx_fft_t fft) { int i; const int size = zeroPaddingSize(n); diff --git a/src/gromacs/correlationfunctions/expfit.cpp b/src/gromacs/correlationfunctions/expfit.cpp index 81334b45b3..61070fbee6 100644 --- a/src/gromacs/correlationfunctions/expfit.cpp +++ b/src/gromacs/correlationfunctions/expfit.cpp @@ -587,7 +587,7 @@ static void print_chi2_params(FILE *fp, fprintf(fp, "\n"); } -real do_lmfit(int ndata, real c1[], real sig[], real dt, real *x0, +real do_lmfit(int ndata, const real c1[], real sig[], real dt, const real *x0, real begintimefit, real endtimefit, const gmx_output_env_t *oenv, gmx_bool bVerbose, int eFitFn, double fitparms[], int fix, const char *fn_fitted) diff --git a/src/gromacs/correlationfunctions/expfit.h b/src/gromacs/correlationfunctions/expfit.h index 76aab93323..e18fa13826 100644 --- a/src/gromacs/correlationfunctions/expfit.h +++ b/src/gromacs/correlationfunctions/expfit.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015, by the GROMACS development team, led by + * Copyright (c) 2014,2015,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. @@ -126,7 +126,7 @@ double fit_function(const int eFitFn, const double parm[], const double x); * \param[in] fn_fitted If not NULL file to print the data and fitted curve to * \return integral. */ -real do_lmfit(int ndata, real c1[], real sig[], real dt, real *x0, +real do_lmfit(int ndata, const real c1[], real sig[], real dt, const real *x0, real begintimefit, real endtimefit, const gmx_output_env_t *oenv, gmx_bool bVerbose, int eFitFn, double fitparms[], int fix, const char *fn_fitted); diff --git a/src/gromacs/correlationfunctions/gmx_lmcurve.cpp b/src/gromacs/correlationfunctions/gmx_lmcurve.cpp index 8b3870e958..9745e807b8 100644 --- a/src/gromacs/correlationfunctions/gmx_lmcurve.cpp +++ b/src/gromacs/correlationfunctions/gmx_lmcurve.cpp @@ -108,7 +108,7 @@ bool lmfit_exp(int nfit, const double x[], const double y[], const double dy[], - double parm[], + double parm[], // NOLINT(readability-non-const-parameter) bool bVerbose, int eFitFn, int nfix) diff --git a/src/gromacs/domdec/domdec.cpp b/src/gromacs/domdec/domdec.cpp index b3ef12b770..cbd0dc214c 100644 --- a/src/gromacs/domdec/domdec.cpp +++ b/src/gromacs/domdec/domdec.cpp @@ -186,7 +186,7 @@ static void dd_dlb_set_should_check_whether_to_turn_dlb_on(gmx_domdec_t *dd, gmx } */ -static void ddindex2xyz(ivec nc, int ind, ivec xyz) +static void ddindex2xyz(const ivec nc, int ind, ivec xyz) { xyz[XX] = ind / (nc[YY]*nc[ZZ]); xyz[YY] = (ind / nc[ZZ]) % nc[YY]; @@ -4651,7 +4651,7 @@ static void merge_cg_buffers(int ncell, gmx_domdec_comm_dim_t *cd, int pulse, int *ncg_cell, gmx::ArrayRef index_gl, - int *recv_i, + const int *recv_i, rvec *cg_cm, rvec *recv_vr, gmx::ArrayRef cgindex, cginfo_mb_t *cginfo_mb, int *cginfo) @@ -4752,7 +4752,7 @@ static void make_cell2at_index(gmx_domdec_comm_dim_t *cd, } } -static gmx_bool missing_link(t_blocka *link, int cg_gl, char *bLocalCG) +static gmx_bool missing_link(t_blocka *link, int cg_gl, const char *bLocalCG) { int i; gmx_bool bMiss; @@ -4895,13 +4895,13 @@ get_zone_pulse_cgs(gmx_domdec_t *dd, real skew_fac2_d, real skew_fac_01, rvec *v_d, rvec *v_0, rvec *v_1, const dd_corners_t *c, - rvec sf2_round, + const rvec sf2_round, gmx_bool bDistBonded, gmx_bool bBondComm, gmx_bool bDist2B, gmx_bool bDistMB, rvec *cg_cm, - int *cginfo, + const int *cginfo, std::vector *localAtomGroups, dd_comm_setup_work_t *work) { diff --git a/src/gromacs/domdec/domdec.h b/src/gromacs/domdec/domdec.h index 3cf2726a7c..83120c9280 100644 --- a/src/gromacs/domdec/domdec.h +++ b/src/gromacs/domdec/domdec.h @@ -406,7 +406,7 @@ void dd_make_local_cgs(struct gmx_domdec_t *dd, t_block *lcgs); /*! \brief Generate the local topology and virtual site data */ void dd_make_local_top(struct gmx_domdec_t *dd, struct gmx_domdec_zones_t *zones, int npbcdim, matrix box, - rvec cellsize_min, ivec npulse, + rvec cellsize_min, const ivec npulse, t_forcerec *fr, rvec *cgcm_or_x, gmx_vsite_t *vsite, diff --git a/src/gromacs/domdec/domdec_topology.cpp b/src/gromacs/domdec/domdec_topology.cpp index 6bb38470b5..647d58f06f 100644 --- a/src/gromacs/domdec/domdec_topology.cpp +++ b/src/gromacs/domdec/domdec_topology.cpp @@ -510,7 +510,7 @@ static int low_make_reverse_ilist(const t_ilist *il_mt, const t_atom *atom, int *count, gmx_bool bConstr, gmx_bool bSettle, gmx_bool bBCheck, - int *r_index, int *r_il, + const int *r_index, int *r_il, gmx_bool bLinkToAllAtoms, gmx_bool bAssign) { @@ -903,7 +903,7 @@ add_ifunc_for_vsites(t_iatom *tiatoms, gmx_ga2la_t *ga2la, } /*! \brief Store a bonded interaction at the end of \p il */ -static inline void add_ifunc(int nral, t_iatom *tiatoms, t_ilist *il) +static inline void add_ifunc(int nral, const t_iatom *tiatoms, t_ilist *il) { t_iatom *liatoms; int k; @@ -1280,7 +1280,7 @@ check_assign_interactions_atom(int i, int i_gl, const gmx_domdec_t *dd, const gmx_domdec_zones_t *zones, const gmx_molblock_t *molb, - gmx_bool bRCheckMB, ivec rcheck, gmx_bool bRCheck2B, + gmx_bool bRCheckMB, const ivec rcheck, gmx_bool bRCheck2B, real rc2, int *la2lc, t_pbc *pbc_null, @@ -2097,7 +2097,7 @@ void dd_make_local_cgs(gmx_domdec_t *dd, t_block *lcgs) void dd_make_local_top(gmx_domdec_t *dd, gmx_domdec_zones_t *zones, int npbcdim, matrix box, - rvec cellsize_min, ivec npulse, + rvec cellsize_min, const ivec npulse, t_forcerec *fr, rvec *cgcm_or_x, gmx_vsite_t *vsite, diff --git a/src/gromacs/domdec/redistribute.cpp b/src/gromacs/domdec/redistribute.cpp index 8afc95d8f9..6f913b1a6f 100644 --- a/src/gromacs/domdec/redistribute.cpp +++ b/src/gromacs/domdec/redistribute.cpp @@ -69,7 +69,7 @@ #define DD_FLAG_FW(d) (1<<(16+(d)*2)) #define DD_FLAG_BW(d) (1<<(16+(d)*2+1)) -static int compact_and_copy_vec_at(int ncg, int *move, +static int compact_and_copy_vec_at(int ncg, const int *move, const gmx::RangePartitioning &atomGroups, int nvec, int vec, rvec *src, gmx_domdec_comm_t *comm, @@ -113,7 +113,7 @@ static int compact_and_copy_vec_at(int ncg, int *move, return home_pos; } -static int compact_and_copy_vec_cg(int ncg, int *move, +static int compact_and_copy_vec_cg(int ncg, const int *move, const gmx::RangePartitioning &atomGroups, int nvec, rvec *src, gmx_domdec_comm_t *comm, gmx_bool bCompact) @@ -344,9 +344,9 @@ static int *getMovedBuffer(gmx_domdec_comm_t *comm, static void calc_cg_move(FILE *fplog, gmx_int64_t step, gmx_domdec_t *dd, t_state *state, - ivec tric_dir, matrix tcm, - rvec cell_x0, rvec cell_x1, - rvec limitd, rvec limit0, rvec limit1, + const ivec tric_dir, matrix tcm, + const rvec cell_x0, const rvec cell_x1, + rvec limitd, const rvec limit0, const rvec limit1, const gmx::RangePartitioning &atomGroups, int cg_start, int cg_end, rvec *cg_cm, diff --git a/src/gromacs/essentialdynamics/edsam.cpp b/src/gromacs/essentialdynamics/edsam.cpp index 05e6560540..d68a981bdc 100644 --- a/src/gromacs/essentialdynamics/edsam.cpp +++ b/src/gromacs/essentialdynamics/edsam.cpp @@ -621,7 +621,7 @@ static void do_edfit(int natoms, rvec *xp, rvec *x, matrix R, t_edpar *edi) } -static void rmfit(int nat, rvec *xcoll, rvec transvec, matrix rotmat) +static void rmfit(int nat, rvec *xcoll, const rvec transvec, matrix rotmat) { rvec vec; matrix tmat; diff --git a/src/gromacs/ewald/ewald.cpp b/src/gromacs/ewald/ewald.cpp index e27d793e5f..92603997b3 100644 --- a/src/gromacs/ewald/ewald.cpp +++ b/src/gromacs/ewald/ewald.cpp @@ -103,7 +103,7 @@ static void calc_lll(const rvec box, rvec lll) } //! Make tables for the structure factor parts -static void tabulateStructureFactors(int natom, const rvec x[], int kmax, cvec **eir, rvec lll) +static void tabulateStructureFactors(int natom, const rvec x[], int kmax, cvec **eir, const rvec lll) { int i, j, m; diff --git a/src/gromacs/ewald/long-range-correction.cpp b/src/gromacs/ewald/long-range-correction.cpp index da0eaef89c..96c529a547 100644 --- a/src/gromacs/ewald/long-range-correction.cpp +++ b/src/gromacs/ewald/long-range-correction.cpp @@ -69,10 +69,10 @@ void ewald_LRcorrection(int numAtomsLocal, int numThreads, int thread, t_forcerec *fr, const t_inputrec *ir, - real *chargeA, real *chargeB, - real *C6A, real *C6B, - real *sigmaA, real *sigmaB, - real *sigma3A, real *sigma3B, + const real *chargeA, const real *chargeB, + const real *C6A, const real *C6B, + const real *sigmaA, const real *sigmaB, + const real *sigma3A, const real *sigma3B, gmx_bool bHaveChargeOrTypePerturbed, gmx_bool calc_excl_corr, const t_blocka *excl, diff --git a/src/gromacs/ewald/long-range-correction.h b/src/gromacs/ewald/long-range-correction.h index 617a0bfac0..37108de07f 100644 --- a/src/gromacs/ewald/long-range-correction.h +++ b/src/gromacs/ewald/long-range-correction.h @@ -73,10 +73,10 @@ ewald_LRcorrection(int numAtomsLocal, int numThreads, int thread, t_forcerec *fr, const t_inputrec *ir, - real *chargeA, real *chargeB, - real *C6A, real *C6B, - real *sigmaA, real *sigmaB, - real *sigma3A, real *sigma3B, + const real *chargeA, const real *chargeB, + const real *C6A, const real *C6B, + const real *sigmaA, const real *sigmaB, + const real *sigma3A, const real *sigma3B, gmx_bool bHaveChargeOrTypePerturbed, gmx_bool calc_excl_corr, const t_blocka *excl, diff --git a/src/gromacs/ewald/pme-gather.cpp b/src/gromacs/ewald/pme-gather.cpp index e9c5c0d893..000f24929b 100644 --- a/src/gromacs/ewald/pme-gather.cpp +++ b/src/gromacs/ewald/pme-gather.cpp @@ -367,7 +367,7 @@ void gather_f_bsplines(const gmx_pme_t *pme, const real *grid, } -real gather_energy_bsplines(gmx_pme_t *pme, real *grid, +real gather_energy_bsplines(gmx_pme_t *pme, const real *grid, pme_atomcomm_t *atc) { splinedata_t *spline; diff --git a/src/gromacs/ewald/pme-gather.h b/src/gromacs/ewald/pme-gather.h index fdee72a41b..864eda3be2 100644 --- a/src/gromacs/ewald/pme-gather.h +++ b/src/gromacs/ewald/pme-gather.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2017,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. @@ -46,7 +46,7 @@ gather_f_bsplines(const struct gmx_pme_t *pme, const real *grid, real scale); real -gather_energy_bsplines(struct gmx_pme_t *pme, real *grid, +gather_energy_bsplines(struct gmx_pme_t *pme, const real *grid, pme_atomcomm_t *atc); #endif diff --git a/src/gromacs/ewald/pme-grid.cpp b/src/gromacs/ewald/pme-grid.cpp index dcf2a06c3c..a2a0dfaff0 100644 --- a/src/gromacs/ewald/pme-grid.cpp +++ b/src/gromacs/ewald/pme-grid.cpp @@ -235,7 +235,7 @@ void gmx_sum_qgrid_dd(struct gmx_pme_t *pme, real *grid, int direction) #endif -int copy_pmegrid_to_fftgrid(const gmx_pme_t *pme, real *pmegrid, real *fftgrid, int grid_index) +int copy_pmegrid_to_fftgrid(const gmx_pme_t *pme, const real *pmegrid, real *fftgrid, int grid_index) { ivec local_fft_ndata, local_fft_offset, local_fft_size; ivec local_pme_size; diff --git a/src/gromacs/ewald/pme-grid.h b/src/gromacs/ewald/pme-grid.h index 73e16b968f..f861997595 100644 --- a/src/gromacs/ewald/pme-grid.h +++ b/src/gromacs/ewald/pme-grid.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2016,2017,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. @@ -64,7 +64,7 @@ gmx_sum_qgrid_dd(gmx_pme_t *pme, real *grid, int direction); #endif int -copy_pmegrid_to_fftgrid(const gmx_pme_t *pme, real *pmegrid, real *fftgrid, int grid_index); +copy_pmegrid_to_fftgrid(const gmx_pme_t *pme, const real *pmegrid, real *fftgrid, int grid_index); int copy_fftgrid_to_pmegrid(gmx_pme_t *pme, const real *fftgrid, real *pmegrid, int grid_index, diff --git a/src/gromacs/ewald/pme-redistribute.cpp b/src/gromacs/ewald/pme-redistribute.cpp index 82407d4c64..045646a4ad 100644 --- a/src/gromacs/ewald/pme-redistribute.cpp +++ b/src/gromacs/ewald/pme-redistribute.cpp @@ -258,7 +258,7 @@ static void pme_dd_sendrecv(pme_atomcomm_t gmx_unused *atc, } static void dd_pmeredist_pos_coeffs(struct gmx_pme_t *pme, - int n, gmx_bool bX, rvec *x, real *data, + int n, gmx_bool bX, rvec *x, const real *data, pme_atomcomm_t *atc) { int *commnode, *buf_index; diff --git a/src/gromacs/ewald/pme-spread.cpp b/src/gromacs/ewald/pme-spread.cpp index 62c9862dd6..e77c7910d9 100644 --- a/src/gromacs/ewald/pme-spread.cpp +++ b/src/gromacs/ewald/pme-spread.cpp @@ -263,7 +263,7 @@ static void make_thread_local_ind(const pme_atomcomm_t *atc, } static void make_bsplines(splinevec theta, splinevec dtheta, int order, - rvec fractx[], int nr, int ind[], real coefficient[], + rvec fractx[], int nr, const int ind[], const real coefficient[], gmx_bool bDoSplines) { /* construct splines for local atoms */ diff --git a/src/gromacs/ewald/pme.cpp b/src/gromacs/ewald/pme.cpp index 1f5691f7fb..0bd225d7df 100644 --- a/src/gromacs/ewald/pme.cpp +++ b/src/gromacs/ewald/pme.cpp @@ -1071,7 +1071,7 @@ void gmx_pme_calc_energy(struct gmx_pme_t *pme, int n, rvec *x, real *q, real *V /*! \brief Calculate initial Lorentz-Berthelot coefficients for LJ-PME */ static void -calc_initial_lb_coeffs(struct gmx_pme_t *pme, real *local_c6, real *local_sigma) +calc_initial_lb_coeffs(struct gmx_pme_t *pme, const real *local_c6, const real *local_sigma) { int i; for (i = 0; i < pme->atc[0].n; ++i) @@ -1086,7 +1086,7 @@ calc_initial_lb_coeffs(struct gmx_pme_t *pme, real *local_c6, real *local_sigma) /*! \brief Calculate next Lorentz-Berthelot coefficients for LJ-PME */ static void -calc_next_lb_coeffs(struct gmx_pme_t *pme, real *local_sigma) +calc_next_lb_coeffs(struct gmx_pme_t *pme, const real *local_sigma) { int i; diff --git a/src/gromacs/fft/fft5d.cpp b/src/gromacs/fft/fft5d.cpp index d25178fc77..83a155ec81 100644 --- a/src/gromacs/fft/fft5d.cpp +++ b/src/gromacs/fft/fft5d.cpp @@ -124,7 +124,7 @@ double MPI_Wtime() #endif #endif -static int vmax(int* a, int s) +static int vmax(const int* a, int s) { int i, max = 0; for (i = 0; i < s; i++) @@ -684,7 +684,7 @@ enum order { NG, MG, KG is size of global data*/ static void splitaxes(t_complex* lout, const t_complex* lin, int maxN, int maxM, int maxK, int pM, - int P, int NG, int *N, int* oN, int starty, int startz, int endy, int endz) + int P, int NG, const int *N, const int* oN, int starty, int startz, int endy, int endz) { int x, y, z, i; int in_i, out_i, in_z, out_z, in_y, out_y; @@ -738,7 +738,7 @@ static void splitaxes(t_complex* lout, const t_complex* lin, KG global size*/ static void joinAxesTrans13(t_complex* lout, const t_complex* lin, int maxN, int maxM, int maxK, int pM, - int P, int KG, int* K, int* oK, int starty, int startx, int endy, int endx) + int P, int KG, const int* K, const int* oK, int starty, int startx, int endy, int endx) { int i, x, y, z; int out_i, in_i, out_x, in_x, out_z, in_z; @@ -790,7 +790,7 @@ static void joinAxesTrans13(t_complex* lout, const t_complex* lin, N,M,K local size MG, global size*/ static void joinAxesTrans12(t_complex* lout, const t_complex* lin, int maxN, int maxM, int maxK, int pN, - int P, int MG, int* M, int* oM, int startx, int startz, int endx, int endz) + int P, int MG, const int* M, const int* oM, int startx, int startz, int endx, int endz) { int i, z, y, x; int out_i, in_i, out_z, in_z, out_x, in_x; diff --git a/src/gromacs/fft/parallel_3dfft.cpp b/src/gromacs/fft/parallel_3dfft.cpp index c218f4f284..64f97b6b99 100644 --- a/src/gromacs/fft/parallel_3dfft.cpp +++ b/src/gromacs/fft/parallel_3dfft.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 1991-2005 David van der Spoel, Erik Lindahl, University of Groningen. - * Copyright (c) 2013,2014,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2017,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. @@ -53,14 +53,14 @@ struct gmx_parallel_3dfft { }; int -gmx_parallel_3dfft_init (gmx_parallel_3dfft_t * pfft_setup, - ivec ndata, - real ** real_data, - t_complex ** complex_data, - MPI_Comm comm[2], - gmx_bool bReproducible, - int nthreads, - gmx::PinningPolicy realGridAllocation) +gmx_parallel_3dfft_init (gmx_parallel_3dfft_t * pfft_setup, + const ivec ndata, + real ** real_data, + t_complex ** complex_data, + MPI_Comm comm[2], + gmx_bool bReproducible, + int nthreads, + gmx::PinningPolicy realGridAllocation) { int rN = ndata[2], M = ndata[1], K = ndata[0]; int flags = FFT5D_REALCOMPLEX | FFT5D_ORDER_YZ; /* FFT5D_DEBUG */ diff --git a/src/gromacs/fft/parallel_3dfft.h b/src/gromacs/fft/parallel_3dfft.h index 0104fe833e..8f0002399d 100644 --- a/src/gromacs/fft/parallel_3dfft.h +++ b/src/gromacs/fft/parallel_3dfft.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 1991-2005 David van der Spoel, Erik Lindahl, University of Groningen. - * Copyright (c) 2013,2014,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2017,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. @@ -82,7 +82,7 @@ typedef struct gmx_parallel_3dfft * */ int gmx_parallel_3dfft_init (gmx_parallel_3dfft_t * pfft_setup, - ivec ndata, + const ivec ndata, real **real_data, t_complex **complex_data, MPI_Comm comm[2], diff --git a/src/gromacs/fileio/enxio.cpp b/src/gromacs/fileio/enxio.cpp index d3661e47a5..1b3d358ef8 100644 --- a/src/gromacs/fileio/enxio.cpp +++ b/src/gromacs/fileio/enxio.cpp @@ -1250,9 +1250,9 @@ void get_enx_state(const char *fn, real t, const gmx_groups_t *groups, t_inputre sfree(fr); } -static real ener_tensor_diag(int n, int *ind1, int *ind2, +static real ener_tensor_diag(int n, const int *ind1, const int *ind2, gmx_enxnm_t *enm1, - int *tensi, int i, + const int *tensi, int i, t_energy e1[], t_energy e2[]) { int d1, d2; diff --git a/src/gromacs/fileio/espio.cpp b/src/gromacs/fileio/espio.cpp index 34eaa711b3..f254eb0459 100644 --- a/src/gromacs/fileio/espio.cpp +++ b/src/gromacs/fileio/espio.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2005, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -443,7 +443,7 @@ int get_espresso_coordnum(const char *infile) } void write_espresso_conf_indexed(FILE *out, const char *title, - const t_atoms *atoms, int nx, int *index, + const t_atoms *atoms, int nx, const int *index, const rvec *x, const rvec *v, const matrix box) { int i, j; diff --git a/src/gromacs/fileio/espio.h b/src/gromacs/fileio/espio.h index 3de1138bcd..bcbee55cb3 100644 --- a/src/gromacs/fileio/espio.h +++ b/src/gromacs/fileio/espio.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2005, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -53,7 +53,7 @@ void gmx_espresso_read_conf(const char *infile, int get_espresso_coordnum(const char *infile); void write_espresso_conf_indexed(FILE *out, const char *title, - const t_atoms *atoms, int nx, int *index, + const t_atoms *atoms, int nx, const int *index, const rvec *x, const rvec *v, const matrix box); #endif diff --git a/src/gromacs/fileio/libxdrf.cpp b/src/gromacs/fileio/libxdrf.cpp index a87b1df66c..8b8cc02361 100644 --- a/src/gromacs/fileio/libxdrf.cpp +++ b/src/gromacs/fileio/libxdrf.cpp @@ -170,7 +170,7 @@ static int sizeofint(const int size) | So I don't need to call 'sizeofints for those calls. */ -static int sizeofints( const int num_of_ints, unsigned int sizes[]) +static int sizeofints( const int num_of_ints, const unsigned int sizes[]) { int i, num; int bytes[32]; @@ -336,7 +336,7 @@ static int receivebits(int buf[], int num_of_bits) */ static void receiveints(int buf[], const int num_of_ints, int num_of_bits, - unsigned int sizes[], int nums[]) + const unsigned int sizes[], int nums[]) { int bytes[32]; int i, j, num_of_bytes, p, num; diff --git a/src/gromacs/fileio/matio.cpp b/src/gromacs/fileio/matio.cpp index 26c1a06e36..c125394cf9 100644 --- a/src/gromacs/fileio/matio.cpp +++ b/src/gromacs/fileio/matio.cpp @@ -778,7 +778,7 @@ static void pr_discrete_cmap(FILE *out, int *nlevel, int i0) static void write_xpm_map_split(FILE *out, int n_x, int n_y, - int *nlevel_top, real lo_top, real hi_top, + const int *nlevel_top, real lo_top, real hi_top, t_rgb rlo_top, t_rgb rhi_top, gmx_bool bDiscreteColor, int *nlevel_bot, real lo_bot, real hi_bot, diff --git a/src/gromacs/fileio/pdbio.cpp b/src/gromacs/fileio/pdbio.cpp index d6c7579199..761d1723d1 100644 --- a/src/gromacs/fileio/pdbio.cpp +++ b/src/gromacs/fileio/pdbio.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -426,7 +426,7 @@ void write_pdbfile(FILE *out, const char *title, const t_atoms *atoms, const rve sfree(index); } -static int line2type(char *line) +static int line2type(const char *line) { int k; char type[8]; @@ -575,7 +575,7 @@ void get_pdb_atomnumber(const t_atoms *atoms, gmx_atomprop_t aps) } static int read_atom(t_symtab *symtab, - char line[], int type, int natom, + const char line[], int type, int natom, t_atoms *atoms, rvec x[], int chainnum, gmx_bool bChange) { t_atom *atomn; diff --git a/src/gromacs/gmxana/anadih.cpp b/src/gromacs/gmxana/anadih.cpp index c71466757d..5fa6873fc1 100644 --- a/src/gromacs/gmxana/anadih.cpp +++ b/src/gromacs/gmxana/anadih.cpp @@ -621,7 +621,7 @@ void get_chi_product_traj (real **dih, int nframes, int nlist, } -void calc_distribution_props(int nh, int histo[], real start, +void calc_distribution_props(int nh, const int histo[], real start, int nkkk, t_karplus kkk[], real *S2) { @@ -696,7 +696,7 @@ static void calc_angles(struct t_pbc *pbc, } } -static real calc_fraction(real angles[], int nangles) +static real calc_fraction(const real angles[], int nangles) { int i; real trans = 0, gauche = 0; @@ -730,7 +730,7 @@ static real calc_fraction(real angles[], int nangles) } static void calc_dihs(struct t_pbc *pbc, - int n4, int index[], real ang[], rvec x_s[]) + int n4, const int index[], real ang[], rvec x_s[]) { int i, ix, t1, t2, t3; rvec r_ij, r_kj, r_kl, m, n; @@ -785,7 +785,7 @@ void make_histo(FILE *log, } } -void normalize_histo(int npoints, int histo[], real dx, real normhisto[]) +void normalize_histo(int npoints, const int histo[], real dx, real normhisto[]) { int i; double d, fac; diff --git a/src/gromacs/gmxana/binsearch.cpp b/src/gromacs/gmxana/binsearch.cpp index d30d16bc72..b9b9b93a81 100644 --- a/src/gromacs/gmxana/binsearch.cpp +++ b/src/gromacs/gmxana/binsearch.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2013,2014,2015,2016,2017,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. @@ -109,7 +109,7 @@ void insertionSort(real *arr, int *perm, int startndx, int endndx, int direction } -int BinarySearch (real *array, int low, int high, real key, int direction) +int BinarySearch (const real *array, int low, int high, real key, int direction) { int iMid, iMax, iMin; iMax = high+2; @@ -159,7 +159,7 @@ int start_binsearch(real *array, int *perm, int low, int high, return BinarySearch(array, low, high, key, direction); } -int LinearSearch (double *array, int startindx, int stopindx, +int LinearSearch (const double *array, int startindx, int stopindx, double key, int *count, int direction) { /*Iterative implementation - assume elements sorted*/ diff --git a/src/gromacs/gmxana/binsearch.h b/src/gromacs/gmxana/binsearch.h index 24cf8f465b..df6054da4f 100644 --- a/src/gromacs/gmxana/binsearch.h +++ b/src/gromacs/gmxana/binsearch.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2013,2014,2015, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2013,2014,2015,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. @@ -46,12 +46,12 @@ void rangeArray(int *ar, int size); void insertionSort(real *ar, int *perm, int start, int end, int direction); -int BinarySearch(real *ar, int start, int end, real key, int direction); +int BinarySearch(const real *ar, int start, int end, real key, int direction); int start_binsearch(real *array, int *perm, int low, int high, real key, int direction); -int LinearSearch(double *array, int startindx, int stopindx, +int LinearSearch(const double *array, int startindx, int stopindx, double key, int *count, int direction); #ifdef __cplusplus diff --git a/src/gromacs/gmxana/dens_filter.cpp b/src/gromacs/gmxana/dens_filter.cpp index fbe045b482..01e0a604eb 100644 --- a/src/gromacs/gmxana/dens_filter.cpp +++ b/src/gromacs/gmxana/dens_filter.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2011,2013,2014,2015, by the GROMACS development team, led by + * Copyright (c) 2011,2013,2014,2015,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. @@ -46,7 +46,7 @@ #include "gromacs/math/vec.h" #include "gromacs/utility/smalloc.h" -gmx_bool convolution(int dataSize, real *x, int kernelSize, real* kernel) +gmx_bool convolution(int dataSize, real *x, int kernelSize, const real* kernel) { int i, j, k; real *out; @@ -90,7 +90,7 @@ gmx_bool convolution(int dataSize, real *x, int kernelSize, real* kernel) /* Assuming kernel is shorter than x */ gmx_bool periodic_convolution(int datasize, real *x, int kernelsize, - real *kernel) + const real *kernel) { int i, j, idx; real *filtered; diff --git a/src/gromacs/gmxana/dens_filter.h b/src/gromacs/gmxana/dens_filter.h index acbc23ae15..396a378034 100644 --- a/src/gromacs/gmxana/dens_filter.h +++ b/src/gromacs/gmxana/dens_filter.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2011,2013,2014, by the GROMACS development team, led by + * Copyright (c) 2011,2013,2014,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. @@ -45,9 +45,9 @@ extern "C" #endif extern gmx_bool convolution(int dataSize, real* in, int kernelSize, - real* kernel); + const real* kernel); extern gmx_bool periodic_convolution(int dsize, real *in, int ksize, - real* kernel); + const real* kernel); extern void gausskernel(real *out, int size, real var); #ifdef __cplusplus diff --git a/src/gromacs/gmxana/fitahx.cpp b/src/gromacs/gmxana/fitahx.cpp index dc6f581d07..2d828082a3 100644 --- a/src/gromacs/gmxana/fitahx.cpp +++ b/src/gromacs/gmxana/fitahx.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2017,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. @@ -45,7 +45,7 @@ #include "gromacs/utility/fatalerror.h" #include "gromacs/utility/smalloc.h" -static void my_calc_xcm(int nbb, int bbind[], rvec x[], rvec xcm) +static void my_calc_xcm(int nbb, const int bbind[], rvec x[], rvec xcm) { int i, m, ai; @@ -61,7 +61,7 @@ static void my_calc_xcm(int nbb, int bbind[], rvec x[], rvec xcm) } } -static void my_sub_xcm(int nbb, int bbind[], rvec x[], rvec xcm) +static void my_sub_xcm(int nbb, const int bbind[], rvec x[], rvec xcm) { int i, ai; diff --git a/src/gromacs/gmxana/gmx_anaeig.cpp b/src/gromacs/gmxana/gmx_anaeig.cpp index 1f912ceaff..09a4fac4f8 100644 --- a/src/gromacs/gmxana/gmx_anaeig.cpp +++ b/src/gromacs/gmxana/gmx_anaeig.cpp @@ -313,8 +313,8 @@ compare(int natoms, int n1, rvec **eigvec1, int n2, rvec **eigvec2, static void inprod_matrix(const char *matfile, int natoms, int nvec1, int *eignr1, rvec **eigvec1, - int nvec2, int *eignr2, rvec **eigvec2, - gmx_bool bSelect, int noutvec, int *outvec) + int nvec2, const int *eignr2, rvec **eigvec2, + gmx_bool bSelect, int noutvec, const int *outvec) { FILE *out; real **mat; @@ -450,7 +450,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri const char *extremefile, gmx_bool bExtrAll, real extreme, int nextr, const t_atoms *atoms, int natoms, int *index, gmx_bool bFit, rvec *xref, int nfit, int *ifit, real *w_rls, - real *sqrtm, rvec *xav, + const real *sqrtm, rvec *xav, int *eignr, rvec **eigvec, int noutvec, int *outvec, gmx_bool bSplit, const gmx_output_env_t *oenv) @@ -818,7 +818,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri static void components(const char *outfile, int natoms, int *eignr, rvec **eigvec, - int noutvec, int *outvec, + int noutvec, const int *outvec, const gmx_output_env_t *oenv) { int g, s, v, i; @@ -860,9 +860,9 @@ static void components(const char *outfile, int natoms, fprintf(stderr, "\n"); } -static void rmsf(const char *outfile, int natoms, real *sqrtm, +static void rmsf(const char *outfile, int natoms, const real *sqrtm, int *eignr, rvec **eigvec, - int noutvec, int *outvec, + int noutvec, const int *outvec, real *eigval, int neig, const gmx_output_env_t *oenv) { diff --git a/src/gromacs/gmxana/gmx_analyze.cpp b/src/gromacs/gmxana/gmx_analyze.cpp index 4cb6ecf364..d2ff834b15 100644 --- a/src/gromacs/gmxana/gmx_analyze.cpp +++ b/src/gromacs/gmxana/gmx_analyze.cpp @@ -111,7 +111,7 @@ static void power_fit(int n, int nset, real **val, real *t) sfree(x); } -static real cosine_content(int nhp, int n, real *y) +static real cosine_content(int nhp, int n, const real *y) /* Assumes n equidistant points */ { double fac, cosyint, yyint; @@ -396,7 +396,7 @@ static void average(const char *avfile, int avbar_opt, * * See Eqn A17, Hess, JCP 116 (2002) 209-217 for details. */ -static real optimal_error_estimate(double sigma, double fitparm[], real tTotal) +static real optimal_error_estimate(double sigma, const double fitparm[], real tTotal) { double ss = fitparm[1]*fitparm[0]+(1-fitparm[1])*fitparm[2]; if ((tTotal <= 0) || (ss <= 0)) diff --git a/src/gromacs/gmxana/gmx_bar.cpp b/src/gromacs/gmxana/gmx_bar.cpp index 86f17f7c01..b51e938323 100644 --- a/src/gromacs/gmxana/gmx_bar.cpp +++ b/src/gromacs/gmxana/gmx_bar.cpp @@ -2713,7 +2713,7 @@ static double filename2lambda(const char *fn) return lambda; } -static void read_bar_xvg_lowlevel(const char *fn, real *temp, xvg_t *ba, +static void read_bar_xvg_lowlevel(const char *fn, const real *temp, xvg_t *ba, lambda_components_t *lc) { int i; diff --git a/src/gromacs/gmxana/gmx_bundle.cpp b/src/gromacs/gmxana/gmx_bundle.cpp index 286e67a57d..ce5da3b7d1 100644 --- a/src/gromacs/gmxana/gmx_bundle.cpp +++ b/src/gromacs/gmxana/gmx_bundle.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2017,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. @@ -87,7 +87,7 @@ static void rotate_ends(t_bundle *bun, rvec axis, int c0, int c1) axis[c1] = ax[c0]*tmp[c0] + ax[c1]*tmp[c1]; } -static void calc_axes(rvec x[], t_atom atom[], int gnx[], int *index[], +static void calc_axes(rvec x[], t_atom atom[], const int gnx[], int *index[], gmx_bool bRot, t_bundle *bun) { int end, i, div, d; diff --git a/src/gromacs/gmxana/gmx_chi.cpp b/src/gromacs/gmxana/gmx_chi.cpp index 8c293f9334..35adac367f 100644 --- a/src/gromacs/gmxana/gmx_chi.cpp +++ b/src/gromacs/gmxana/gmx_chi.cpp @@ -272,7 +272,7 @@ static void do_dihcorr(const char *fn, int nf, int ndih, real **dih, real dt, fprintf(stderr, "\n"); } -static void copy_dih_data(real in[], real out[], int nf, gmx_bool bLEAVE) +static void copy_dih_data(const real in[], real out[], int nf, gmx_bool bLEAVE) { /* if bLEAVE, do nothing to data in copying to out * otherwise multiply by 180/pi to convert rad to deg */ @@ -437,7 +437,7 @@ static int reset_em_all(int nlist, t_dlist dlist[], int nf, static void histogramming(FILE *log, int nbin, gmx_residuetype_t *rt, int nf, int maxchi, real **dih, int nlist, t_dlist dlist[], - int index[], + const int index[], gmx_bool bPhi, gmx_bool bPsi, gmx_bool bOmega, gmx_bool bChi, gmx_bool bNormalize, gmx_bool bSSHisto, const char *ssdump, real bfac_max, const t_atoms *atoms, diff --git a/src/gromacs/gmxana/gmx_cluster.cpp b/src/gromacs/gmxana/gmx_cluster.cpp index f0b82f8f04..1198914857 100644 --- a/src/gromacs/gmxana/gmx_cluster.cpp +++ b/src/gromacs/gmxana/gmx_cluster.cpp @@ -752,7 +752,7 @@ static void gromos(int n1, real **mat, real rmsdcut, t_clusters *clust) clust->ncl = k-1; } -static rvec **read_whole_trj(const char *fn, int isize, int index[], int skip, +static rvec **read_whole_trj(const char *fn, int isize, const int index[], int skip, int *nframe, real **time, const gmx_output_env_t *oenv, gmx_bool bPBC, gmx_rmpbc_t gpbc) { rvec **xx, *x; diff --git a/src/gromacs/gmxana/gmx_confrms.cpp b/src/gromacs/gmxana/gmx_confrms.cpp index 8162397323..4b08985406 100644 --- a/src/gromacs/gmxana/gmx_confrms.cpp +++ b/src/gromacs/gmxana/gmx_confrms.cpp @@ -63,7 +63,7 @@ static const int NOTSET = -9368163; -static void calc_rm_cm(int isize, int index[], const t_atoms *atoms, rvec x[], rvec xcm) +static void calc_rm_cm(int isize, const int index[], const t_atoms *atoms, rvec x[], rvec xcm) { int i, d; real tm, m; @@ -87,7 +87,7 @@ static void calc_rm_cm(int isize, int index[], const t_atoms *atoms, rvec x[], r } } -static int build_res_index(int isize, int index[], t_atom atom[], int rindex[]) +static int build_res_index(int isize, const int index[], t_atom atom[], int rindex[]) { int i, r; @@ -106,7 +106,7 @@ static int build_res_index(int isize, int index[], t_atom atom[], int rindex[]) return r; } -static int find_res_end(int i, int isize, int index[], const t_atoms *atoms) +static int find_res_end(int i, int isize, const int index[], const t_atoms *atoms) { int rnr; @@ -127,9 +127,9 @@ static int debug_strcmp(char s1[], char s2[]) return std::strcmp(s1, s2); } -static int find_next_match_atoms_in_res(int *i1, int index1[], +static int find_next_match_atoms_in_res(int *i1, const int index1[], int m1, char **atnms1[], - int *i2, int index2[], + int *i2, const int index2[], int m2, char **atnms2[]) { int dx, dy, dmax, cmp; @@ -195,9 +195,9 @@ static int find_next_match_atoms_in_res(int *i1, int index1[], } static int find_next_match_res(int *rnr1, int isize1, - int index1[], t_resinfo *resinfo1, + const int index1[], t_resinfo *resinfo1, int *rnr2, int isize2, - int index2[], t_resinfo *resinfo2) + const int index2[], t_resinfo *resinfo2) { int dx, dy, dmax, cmp, rr1, rr2; gmx_bool bFW = FALSE, bFF = FALSE; @@ -308,7 +308,7 @@ static int find_next_match_res(int *rnr1, int isize1, return cmp; } -static int find_first_atom_in_res(int rnr, int isize, int index[], t_atom atom[]) +static int find_first_atom_in_res(int rnr, int isize, const int index[], t_atom atom[]) { int i; diff --git a/src/gromacs/gmxana/gmx_current.cpp b/src/gromacs/gmxana/gmx_current.cpp index 3c80befdc3..fd6c082ae8 100644 --- a/src/gromacs/gmxana/gmx_current.cpp +++ b/src/gromacs/gmxana/gmx_current.cpp @@ -186,7 +186,7 @@ static void remove_jump(matrix box, int natoms, rvec xp[], rvec x[]) } } -static void calc_mj(t_topology top, int ePBC, matrix box, gmx_bool bNoJump, int isize, int index0[], \ +static void calc_mj(t_topology top, int ePBC, matrix box, gmx_bool bNoJump, int isize, const int index0[], \ rvec fr[], rvec mj, real mass2[], real qmol[]) { @@ -272,7 +272,7 @@ static real calceps(real prefactor, real md2, real mj2, real cor, real eps_rf, g } -static real calc_cacf(FILE *fcacf, real prefactor, real cacf[], real time[], int nfr, int vfr[], int ei, int nshift) +static real calc_cacf(FILE *fcacf, real prefactor, real cacf[], real time[], int nfr, const int vfr[], int ei, int nshift) { int i; @@ -323,7 +323,7 @@ static real calc_cacf(FILE *fcacf, real prefactor, real cacf[], real time[], int } -static void calc_mjdsp(FILE *fmjdsp, real prefactor, real dsp2[], real time[], int nfr, real refr[]) +static void calc_mjdsp(FILE *fmjdsp, real prefactor, real dsp2[], real time[], int nfr, const real refr[]) { int i; @@ -350,7 +350,7 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor, int ePBC, t_topology top, t_trxframe fr, real temp, real bfit, real efit, real bvit, real evit, t_trxstatus *status, int isize, int nmols, int nshift, - int *index0, int indexm[], real mass2[], + const int *index0, int indexm[], real mass2[], real qmol[], real eps_rf, const gmx_output_env_t *oenv) { int i, j; diff --git a/src/gromacs/gmxana/gmx_density.cpp b/src/gromacs/gmxana/gmx_density.cpp index 60ed9b3fb0..918ebd6c4e 100644 --- a/src/gromacs/gmxana/gmx_density.cpp +++ b/src/gromacs/gmxana/gmx_density.cpp @@ -129,7 +129,7 @@ static int get_electrons(t_electron **eltab, const char *fn) return nr; } -static void center_coords(t_atoms *atoms, int *index_center, int ncenter, +static void center_coords(t_atoms *atoms, const int *index_center, int ncenter, matrix box, rvec x0[]) { int i, k, m; @@ -167,7 +167,7 @@ static void center_coords(t_atoms *atoms, int *index_center, int ncenter, } } -static void calc_electron_density(const char *fn, int **index, int gnx[], +static void calc_electron_density(const char *fn, int **index, const int gnx[], double ***slDensity, int *nslices, t_topology *top, int ePBC, int axis, int nr_grps, real *slWidth, @@ -326,7 +326,7 @@ static void calc_electron_density(const char *fn, int **index, int gnx[], sfree(x0); /* free memory used by coordinate array */ } -static void calc_density(const char *fn, int **index, int gnx[], +static void calc_density(const char *fn, int **index, const int gnx[], double ***slDensity, int *nslices, t_topology *top, int ePBC, int axis, int nr_grps, real *slWidth, gmx_bool bCenter, int *index_center, int ncenter, diff --git a/src/gromacs/gmxana/gmx_densorder.cpp b/src/gromacs/gmxana/gmx_densorder.cpp index 74c4fd7a44..8fb14e1a98 100644 --- a/src/gromacs/gmxana/gmx_densorder.cpp +++ b/src/gromacs/gmxana/gmx_densorder.cpp @@ -101,7 +101,7 @@ static void center_coords(const t_atoms *atoms, matrix box, rvec x0[], int axis) } -static void density_in_time (const char *fn, int **index, int gnx[], real bw, real bwz, int nsttblock, real *****Densdevel, int *xslices, int *yslices, int *zslices, int *tblock, const t_topology *top, int ePBC, int axis, gmx_bool bCenter, gmx_bool bps1d, const gmx_output_env_t *oenv) +static void density_in_time (const char *fn, int **index, const int gnx[], real bw, real bwz, int nsttblock, real *****Densdevel, int *xslices, int *yslices, int *zslices, int *tblock, const t_topology *top, int ePBC, int axis, gmx_bool bCenter, gmx_bool bps1d, const gmx_output_env_t *oenv) { /* diff --git a/src/gromacs/gmxana/gmx_dielectric.cpp b/src/gromacs/gmxana/gmx_dielectric.cpp index e6ba83d90e..adc6469451 100644 --- a/src/gromacs/gmxana/gmx_dielectric.cpp +++ b/src/gromacs/gmxana/gmx_dielectric.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -86,7 +86,7 @@ static int calc_nbegin(int nx, real x[], real tbegin) return nbegin; } -static real numerical_deriv(int nx, real x[], real y[], real fity[], real combined[], real dy[], +static real numerical_deriv(int nx, real x[], const real y[], const real fity[], real combined[], real dy[], real tendInt, int nsmooth) { FILE *tmpfp; @@ -151,7 +151,7 @@ static real numerical_deriv(int nx, real x[], real y[], real fity[], real combin return integralSmth; } -static void do_four(const char *fn, const char *cn, int nx, real x[], real dy[], +static void do_four(const char *fn, const char *cn, int nx, const real x[], const real dy[], real eps0, real epsRF, const gmx_output_env_t *oenv) { FILE *fp, *cp; diff --git a/src/gromacs/gmxana/gmx_dipoles.cpp b/src/gromacs/gmxana/gmx_dipoles.cpp index b3f237bf08..00333c9094 100644 --- a/src/gromacs/gmxana/gmx_dipoles.cpp +++ b/src/gromacs/gmxana/gmx_dipoles.cpp @@ -176,7 +176,7 @@ static void rvec2sprvec(rvec dipcart, rvec dipsp) static void do_gkr(t_gkrbin *gb, int ncos, int *ngrp, int *molindex[], - int mindex[], rvec x[], rvec mu[], + const int mindex[], rvec x[], rvec mu[], int ePBC, const matrix box, const t_atom *atom, const int *nAtom) { static rvec *xcm[2] = { nullptr, nullptr}; @@ -410,7 +410,7 @@ static void print_gkrbin(const char *fn, t_gkrbin *gb, xvgrclose(fp); } -static gmx_bool read_mu_from_enx(ener_file_t fmu, int Vol, ivec iMu, rvec mu, real *vol, +static gmx_bool read_mu_from_enx(ener_file_t fmu, int Vol, const ivec iMu, rvec mu, real *vol, real *t, int nre, t_enxframe *fr) { int i; @@ -440,7 +440,7 @@ static gmx_bool read_mu_from_enx(ener_file_t fmu, int Vol, ivec iMu, rvec mu, re return bCont; } -static void neutralize_mols(int n, int *index, const t_block *mols, t_atom *atom) +static void neutralize_mols(int n, const int *index, const t_block *mols, t_atom *atom) { double mtot, qtot; int ncharged, m, a0, a1, a; diff --git a/src/gromacs/gmxana/gmx_disre.cpp b/src/gromacs/gmxana/gmx_disre.cpp index de2731492e..29eedead11 100644 --- a/src/gromacs/gmxana/gmx_disre.cpp +++ b/src/gromacs/gmxana/gmx_disre.cpp @@ -158,7 +158,7 @@ static void check_viol(FILE *log, t_ilist *disres, t_iparams forceparams[], rvec x[], rvec4 f[], t_pbc *pbc, t_graph *g, t_dr_result dr[], - int clust_id, int isize, int index[], real vvindex[], + int clust_id, int isize, const int index[], real vvindex[], t_fcdata *fcd) { t_iatom *forceatoms; @@ -373,7 +373,7 @@ static void dump_viol(FILE *log, int ndr, t_dr_stats *drs, gmx_bool bLinear) } } -static gmx_bool is_core(int i, int isize, int index[]) +static gmx_bool is_core(int i, int isize, const int index[]) { int kk; gmx_bool bIC = FALSE; diff --git a/src/gromacs/gmxana/gmx_do_dssp.cpp b/src/gromacs/gmxana/gmx_do_dssp.cpp index a8aab1bc21..0ac6b72760 100644 --- a/src/gromacs/gmxana/gmx_do_dssp.cpp +++ b/src/gromacs/gmxana/gmx_do_dssp.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015,2017,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. @@ -62,7 +62,7 @@ #include "gromacs/utility/strdb.h" static int strip_dssp(char *dsspfile, int nres, - gmx_bool bPhobres[], real t, + const gmx_bool bPhobres[], real t, real *acc, FILE *fTArea, t_matrix *mat, int average_area[], const gmx_output_env_t *oenv) @@ -237,7 +237,7 @@ static void check_oo(t_atoms *atoms) } static void norm_acc(t_atoms *atoms, int nres, - real av_area[], real norm_av_area[]) + const real av_area[], real norm_av_area[]) { int i, n, n_surf; diff --git a/src/gromacs/gmxana/gmx_dyndom.cpp b/src/gromacs/gmxana/gmx_dyndom.cpp index 720496b637..55219d8141 100644 --- a/src/gromacs/gmxana/gmx_dyndom.cpp +++ b/src/gromacs/gmxana/gmx_dyndom.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -53,7 +53,7 @@ #include "gromacs/utility/smalloc.h" static void rot_conf(t_atoms *atoms, const rvec x[], const rvec v[], real trans, real angle, - rvec head, rvec tail, int isize, int index[], + rvec head, rvec tail, int isize, const int index[], rvec xout[], rvec vout[]) { rvec arrow, xcm; diff --git a/src/gromacs/gmxana/gmx_editconf.cpp b/src/gromacs/gmxana/gmx_editconf.cpp index 7e0198bb82..176a334a13 100644 --- a/src/gromacs/gmxana/gmx_editconf.cpp +++ b/src/gromacs/gmxana/gmx_editconf.cpp @@ -87,7 +87,7 @@ static real calc_mass(t_atoms *atoms, gmx_bool bGetMass, gmx_atomprop_t aps) return tmass; } -static real calc_geom(int isize, int *index, rvec *x, rvec geom_center, rvec minval, +static real calc_geom(int isize, const int *index, rvec *x, rvec geom_center, rvec minval, rvec maxval, gmx_bool bDiam) { real diam2, d; @@ -178,7 +178,7 @@ static void center_conf(int natom, rvec *x, rvec center, rvec geom_cent) } } -static void scale_conf(int natom, rvec x[], matrix box, rvec scale) +static void scale_conf(int natom, rvec x[], matrix box, const rvec scale) { int i, j; @@ -366,7 +366,7 @@ static void visualize_images(const char *fn, int ePBC, matrix box) sfree(img); } -static void visualize_box(FILE *out, int a0, int r0, matrix box, rvec gridsize) +static void visualize_box(FILE *out, int a0, int r0, matrix box, const rvec gridsize) { int *edge; rvec *vert, shift; diff --git a/src/gromacs/gmxana/gmx_energy.cpp b/src/gromacs/gmxana/gmx_energy.cpp index 3ae3480feb..ec8d33d62f 100644 --- a/src/gromacs/gmxana/gmx_energy.cpp +++ b/src/gromacs/gmxana/gmx_energy.cpp @@ -869,7 +869,7 @@ static void analyse_ener(gmx_bool bCorr, const char *corrfn, gmx_int64_t step, double t, real reftemp, enerdata_t *edat, - int nset, int set[], gmx_bool *bIsEner, + int nset, const int set[], const gmx_bool *bIsEner, char **leg, gmx_enxnm_t *enm, real Vaver, real ezero, int nbmin, int nbmax, @@ -1205,7 +1205,7 @@ static void print1(FILE *fp, gmx_bool bDp, real e) } static void fec(const char *ene2fn, const char *runavgfn, - real reftemp, int nset, int set[], char *leg[], + real reftemp, int nset, const int set[], char *leg[], enerdata_t *edat, double time[], const gmx_output_env_t *oenv) { diff --git a/src/gromacs/gmxana/gmx_genion.cpp b/src/gromacs/gmxana/gmx_genion.cpp index c74701d5ae..176090e4a8 100644 --- a/src/gromacs/gmxana/gmx_genion.cpp +++ b/src/gromacs/gmxana/gmx_genion.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -60,7 +60,7 @@ #include "gromacs/utility/futil.h" #include "gromacs/utility/smalloc.h" -static void insert_ion(int nsa, int *nwater, +static void insert_ion(int nsa, const int *nwater, gmx_bool bSet[], int repl[], int index[], rvec x[], t_pbc *pbc, int sign, int q, const char *ionname, @@ -137,7 +137,7 @@ static char *aname(const char *mname) return str; } -static void sort_ions(int nsa, int nw, int repl[], int index[], +static void sort_ions(int nsa, int nw, const int repl[], const int index[], t_atoms *atoms, rvec x[], const char *p_name, const char *n_name) { diff --git a/src/gromacs/gmxana/gmx_gyrate.cpp b/src/gromacs/gmxana/gmx_gyrate.cpp index 50ec5bee3b..567854e574 100644 --- a/src/gromacs/gmxana/gmx_gyrate.cpp +++ b/src/gromacs/gmxana/gmx_gyrate.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -109,7 +109,7 @@ static real calc_gyro(rvec x[], int gnx, int index[], t_atom atom[], real tm, } static void calc_gyro_z(rvec x[], matrix box, - int gnx, int index[], t_atom atom[], + int gnx, const int index[], t_atom atom[], int nz, real time, FILE *out) { static dvec *inertia = nullptr; diff --git a/src/gromacs/gmxana/gmx_h2order.cpp b/src/gromacs/gmxana/gmx_h2order.cpp index 85492b7ac7..9a09224874 100644 --- a/src/gromacs/gmxana/gmx_h2order.cpp +++ b/src/gromacs/gmxana/gmx_h2order.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -63,7 +63,7 @@ /* directions. */ /****************************************************************************/ -static void calc_h2order(const char *fn, int index[], int ngx, rvec **slDipole, +static void calc_h2order(const char *fn, const int index[], int ngx, rvec **slDipole, real **slOrder, real *slWidth, int *nslices, const t_topology *top, int ePBC, int axis, gmx_bool bMicel, int micel[], int nmic, diff --git a/src/gromacs/gmxana/gmx_hbond.cpp b/src/gromacs/gmxana/gmx_hbond.cpp index 87b31fbdae..08a7a8cf7b 100644 --- a/src/gromacs/gmxana/gmx_hbond.cpp +++ b/src/gromacs/gmxana/gmx_hbond.cpp @@ -260,7 +260,7 @@ static void _set_hb(unsigned int hbexist[], unsigned int frame, gmx_bool bValue) } } -static gmx_bool is_hb(unsigned int hbexist[], int frame) +static gmx_bool is_hb(const unsigned int hbexist[], int frame) { return ((hbexist[OFFSET(frame)] & MASK(frame)) != 0) ? 1 : 0; } @@ -682,7 +682,7 @@ static void add_h2d(int id, int ih, t_donors *ddd) } } -static void add_dh(t_donors *ddd, int id, int ih, int grp, unsigned char *datable) +static void add_dh(t_donors *ddd, int id, int ih, int grp, const unsigned char *datable) { int i; @@ -912,7 +912,7 @@ static void reset_nhbonds(t_donors *ddd) } } -static void pbc_correct_gem(rvec dx, matrix box, rvec hbox); +static void pbc_correct_gem(rvec dx, matrix box, const rvec hbox); static void pbc_in_gridbox(rvec dx, matrix box); static void build_grid(t_hbdata *hb, rvec x[], rvec xshell, @@ -1079,7 +1079,7 @@ static void build_grid(t_hbdata *hb, rvec x[], rvec xshell, } } -static void count_da_grid(ivec ngrid, t_gridcell ***grid, t_icell danr) +static void count_da_grid(const ivec ngrid, t_gridcell ***grid, t_icell danr) { int gr, xi, yi, zi; @@ -1169,7 +1169,7 @@ static void dump_grid(FILE *fp, ivec ngrid, t_gridcell ***grid) /* New GMX record! 5 * in a row. Congratulations! * Sorry, only four left. */ -static void free_grid(ivec ngrid, t_gridcell ****grid) +static void free_grid(const ivec ngrid, t_gridcell ****grid) { int y, z; t_gridcell ***g = *grid; @@ -1186,7 +1186,7 @@ static void free_grid(ivec ngrid, t_gridcell ****grid) g = nullptr; } -static void pbc_correct_gem(rvec dx, matrix box, rvec hbox) +static void pbc_correct_gem(rvec dx, matrix box, const rvec hbox) { int m; gmx_bool bDone = FALSE; @@ -1869,7 +1869,7 @@ void analyse_corr(int n, real t[], real ct[], real nt[], real kt[], } } -void compute_derivative(int nn, real x[], real y[], real dydx[]) +void compute_derivative(int nn, const real x[], const real y[], real dydx[]) { int j; @@ -2226,7 +2226,7 @@ static void analyse_donor_properties(FILE *fp, t_hbdata *hb, int nframes, real t static void dump_hbmap(t_hbdata *hb, int nfile, t_filenm fnm[], gmx_bool bTwo, - gmx_bool bContact, int isize[], int *index[], char *grpnames[], + gmx_bool bContact, const int isize[], int *index[], char *grpnames[], const t_atoms *atoms) { FILE *fp, *fplog; diff --git a/src/gromacs/gmxana/gmx_hydorder.cpp b/src/gromacs/gmxana/gmx_hydorder.cpp index e5554dbafc..312a70a57e 100644 --- a/src/gromacs/gmxana/gmx_hydorder.cpp +++ b/src/gromacs/gmxana/gmx_hydorder.cpp @@ -61,7 +61,7 @@ static void find_tetra_order_grid(t_topology top, int ePBC, int natoms, matrix box, - rvec x[], int maxidx, int index[], + rvec x[], int maxidx, const int index[], real *sgmean, real *skmean, int nslicex, int nslicey, int nslicez, real ***sggrid, real ***skgrid) diff --git a/src/gromacs/gmxana/gmx_make_edi.cpp b/src/gromacs/gmxana/gmx_make_edi.cpp index 4a8e521762..821748c788 100644 --- a/src/gromacs/gmxana/gmx_make_edi.cpp +++ b/src/gromacs/gmxana/gmx_make_edi.cpp @@ -411,7 +411,7 @@ static int read_conffile(const char *confin, rvec **x) } -static void read_eigenvalues(int vecs[], const char *eigfile, real values[], +static void read_eigenvalues(const int vecs[], const char *eigfile, real values[], gmx_bool bHesse, real kT, int natoms_average_struct) { int neig, nrow, i; @@ -512,7 +512,7 @@ static void init_edx(struct edix *edx) } static void filter2edx(struct edix *edx, int nindex, int index[], int ngro, - int igro[], const rvec *x, const char* structure) + const int igro[], const rvec *x, const char* structure) { /* filter2edx copies coordinates from x to edx which are given in index */ diff --git a/src/gromacs/gmxana/gmx_make_ndx.cpp b/src/gromacs/gmxana/gmx_make_ndx.cpp index cfe5ebaeb5..2fe4ba6324 100644 --- a/src/gromacs/gmxana/gmx_make_ndx.cpp +++ b/src/gromacs/gmxana/gmx_make_ndx.cpp @@ -63,7 +63,7 @@ static const int NOTSET = -92637; gmx_bool bCase = FALSE; -static int or_groups(int nr1, int *at1, int nr2, int *at2, +static int or_groups(int nr1, const int *at1, int nr2, const int *at2, int *nr, int *at) { int i1, i2, max = 0; @@ -123,7 +123,7 @@ static int or_groups(int nr1, int *at1, int nr2, int *at2, return *nr; } -static int and_groups(int nr1, int *at1, int nr2, int *at2, +static int and_groups(int nr1, const int *at1, int nr2, const int *at2, int *nr, int *at) { int i1, i2; @@ -686,7 +686,7 @@ static int select_residuenames(const t_atoms *atoms, int n_names, char **names, return *nr; } -static void copy2block(int n, int *index, t_blocka *block) +static void copy2block(int n, const int *index, t_blocka *block) { int i, n0; diff --git a/src/gromacs/gmxana/gmx_mdmat.cpp b/src/gromacs/gmxana/gmx_mdmat.cpp index f59673d35b..9603303c71 100644 --- a/src/gromacs/gmxana/gmx_mdmat.cpp +++ b/src/gromacs/gmxana/gmx_mdmat.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2017,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. @@ -106,8 +106,8 @@ static int *res_natm(t_atoms *atoms) return natm; } -static void calc_mat(int nres, int natoms, int rndx[], - rvec x[], int *index, +static void calc_mat(int nres, int natoms, const int rndx[], + rvec x[], const int *index, real trunc, real **mdmat, int **nmat, int ePBC, matrix box) { int i, j, resi, resj; diff --git a/src/gromacs/gmxana/gmx_mindist.cpp b/src/gromacs/gmxana/gmx_mindist.cpp index 7035b3be46..8f9e57b06f 100644 --- a/src/gromacs/gmxana/gmx_mindist.cpp +++ b/src/gromacs/gmxana/gmx_mindist.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -64,7 +64,7 @@ static void periodic_dist(int ePBC, - matrix box, rvec x[], int n, int index[], + matrix box, rvec x[], int n, const int index[], real *rmin, real *rmax, int *min_ind) { #define NSHIFT_MAX 26 @@ -597,7 +597,7 @@ static void dist_plot(const char *fn, const char *afile, const char *dfile, sfree(x0); } -static int find_residues(const t_atoms *atoms, int n, int index[], int **resindex) +static int find_residues(const t_atoms *atoms, int n, const int index[], int **resindex) { int i; int nres = 0, resnr, presnr = 0; diff --git a/src/gromacs/gmxana/gmx_mk_angndx.cpp b/src/gromacs/gmxana/gmx_mk_angndx.cpp index 0609897bd2..f9dee1e3e3 100644 --- a/src/gromacs/gmxana/gmx_mk_angndx.cpp +++ b/src/gromacs/gmxana/gmx_mk_angndx.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015,2016,2017,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. @@ -50,7 +50,7 @@ #include "gromacs/utility/gmxassert.h" #include "gromacs/utility/smalloc.h" -static int calc_ntype(int nft, int *ft, const t_idef *idef) +static int calc_ntype(int nft, const int *ft, const t_idef *idef) { int i, f, nf = 0; @@ -68,7 +68,7 @@ static int calc_ntype(int nft, int *ft, const t_idef *idef) return nf; } -static void fill_ft_ind(int nft, int *ft, const t_idef *idef, +static void fill_ft_ind(int nft, const int *ft, const t_idef *idef, int ft_ind[], char *grpnames[]) { char buf[125]; @@ -141,8 +141,8 @@ static void fill_ft_ind(int nft, int *ft, const t_idef *idef, } } -static void fill_ang(int nft, int *ft, int fac, - int nr[], int *index[], int ft_ind[], const t_topology *top, +static void fill_ang(int nft, const int *ft, int fac, + int nr[], int *index[], const int ft_ind[], const t_topology *top, gmx_bool bNoH, real hq) { int f, ftype, i, j, indg, nr_fac; diff --git a/src/gromacs/gmxana/gmx_nmr.cpp b/src/gromacs/gmxana/gmx_nmr.cpp index 28fe1de444..035ab0eb11 100644 --- a/src/gromacs/gmxana/gmx_nmr.cpp +++ b/src/gromacs/gmxana/gmx_nmr.cpp @@ -281,7 +281,7 @@ static int get_bounds(const char *topnm, return nb; } -static void calc_violations(real rt[], real rav3[], int nb, int index[], +static void calc_violations(real rt[], real rav3[], int nb, const int index[], real bounds[], real *viol, double *st, double *sa) { const real sixth = 1.0/6.0; diff --git a/src/gromacs/gmxana/gmx_order.cpp b/src/gromacs/gmxana/gmx_order.cpp index 3316f3e0f8..fe804b62e6 100644 --- a/src/gromacs/gmxana/gmx_order.cpp +++ b/src/gromacs/gmxana/gmx_order.cpp @@ -77,7 +77,7 @@ static void find_nearest_neighbours(int ePBC, int natoms, matrix box, - rvec x[], int maxidx, int index[], + rvec x[], int maxidx, const int index[], real *sgmean, real *skmean, int nslice, int slice_dim, real sgslice[], real skslice[], @@ -348,7 +348,7 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS, /* Print name of first atom in all groups in index file */ -static void print_types(int index[], int a[], int ngrps, +static void print_types(const int index[], int a[], int ngrps, char *groups[], const t_topology *top) { int i; @@ -372,7 +372,7 @@ static void check_length(real length, int a, int b) } } -static void calc_order(const char *fn, int *index, int *a, rvec **order, +static void calc_order(const char *fn, const int *index, int *a, rvec **order, real ***slOrder, real *slWidth, int nslices, gmx_bool bSliced, gmx_bool bUnsat, const t_topology *top, int ePBC, int ngrps, int axis, gmx_bool permolecule, gmx_bool radial, gmx_bool distcalc, const char *radfn, @@ -832,7 +832,7 @@ static void order_plot(rvec order[], real *slOrder[], const char *afile, const c xvgrclose(slOrd); } -static void write_bfactors(t_filenm *fnm, int nfile, int *index, int *a, int nslices, int ngrps, real **order, const t_topology *top, real **distvals, gmx_output_env_t *oenv) +static void write_bfactors(t_filenm *fnm, int nfile, const int *index, const int *a, int nslices, int ngrps, real **order, const t_topology *top, real **distvals, gmx_output_env_t *oenv) { /*function to write order parameters as B factors in PDB file using first frame of trajectory*/ diff --git a/src/gromacs/gmxana/gmx_pme_error.cpp b/src/gromacs/gmxana/gmx_pme_error.cpp index 9a50a498ca..92f05df19b 100644 --- a/src/gromacs/gmxana/gmx_pme_error.cpp +++ b/src/gromacs/gmxana/gmx_pme_error.cpp @@ -418,16 +418,16 @@ static void calc_recipbox(matrix box, matrix recipbox) /* Estimate the reciprocal space part error of the SPME Ewald sum. */ static real estimate_reciprocal( - t_inputinfo *info, - rvec x[], /* array of particles */ - real q[], /* array of charges */ - int nr, /* number of charges = size of the charge array */ - FILE gmx_unused *fp_out, - gmx_bool bVerbose, - int seed, /* The seed for the random number generator */ - int *nsamples, /* Return the number of samples used if Monte Carlo - * algorithm is used for self energy error estimate */ - t_commrec *cr) + t_inputinfo *info, + rvec x[], /* array of particles */ + const real q[], /* array of charges */ + int nr, /* number of charges = size of the charge array */ + FILE gmx_unused *fp_out, + gmx_bool bVerbose, + int seed, /* The seed for the random number generator */ + int *nsamples, /* Return the number of samples used if Monte Carlo + * algorithm is used for self energy error estimate */ + t_commrec *cr) { real e_rec = 0; /* reciprocal error estimate */ real e_rec1 = 0; /* Error estimate term 1*/ diff --git a/src/gromacs/gmxana/gmx_potential.cpp b/src/gromacs/gmxana/gmx_potential.cpp index dadda8fa0a..40cb12033e 100644 --- a/src/gromacs/gmxana/gmx_potential.cpp +++ b/src/gromacs/gmxana/gmx_potential.cpp @@ -75,7 +75,7 @@ static int ce = 0, cb = 0; /* this routine integrates the array data and returns the resulting array */ /* routine uses simple trapezoid rule */ -static void p_integrate(double *result, double data[], int ndata, double slWidth) +static void p_integrate(double *result, const double data[], int ndata, double slWidth) { int i, slice; double sum; diff --git a/src/gromacs/gmxana/gmx_rmsdist.cpp b/src/gromacs/gmxana/gmx_rmsdist.cpp index 5e3704925b..6431b17e2a 100644 --- a/src/gromacs/gmxana/gmx_rmsdist.cpp +++ b/src/gromacs/gmxana/gmx_rmsdist.cpp @@ -62,7 +62,7 @@ #include "gromacs/utility/strdb.h" -static void calc_dist(int nind, int index[], const rvec x[], int ePBC, matrix box, +static void calc_dist(int nind, const int index[], const rvec x[], int ePBC, matrix box, real **d) { int i, j; @@ -83,7 +83,7 @@ static void calc_dist(int nind, int index[], const rvec x[], int ePBC, matrix bo } } -static void calc_dist_tot(int nind, int index[], rvec x[], +static void calc_dist_tot(int nind, const int index[], rvec x[], int ePBC, matrix box, real **d, real **dtot, real **dtot2, gmx_bool bNMR, real **dtot1_3, real **dtot1_6) @@ -281,7 +281,7 @@ static gmx_bool is_equiv(int neq, t_equiv **equiv, char **nname, } static int analyze_noe_equivalent(const char *eq_fn, - const t_atoms *atoms, int isize, int *index, + const t_atoms *atoms, int isize, const int *index, gmx_bool bSumH, int *noe_index, t_noe_gr *noe_gr) { @@ -465,7 +465,7 @@ static char *noe2scale(real r3, real r6, real rmax) return buf; } -static void calc_noe(int isize, int *noe_index, +static void calc_noe(int isize, const int *noe_index, real **dtot1_3, real **dtot1_6, int gnr, t_noe **noe) { int i, j, gi, gj; diff --git a/src/gromacs/gmxana/gmx_rmsf.cpp b/src/gromacs/gmxana/gmx_rmsf.cpp index b70a673b80..87af428628 100644 --- a/src/gromacs/gmxana/gmx_rmsf.cpp +++ b/src/gromacs/gmxana/gmx_rmsf.cpp @@ -111,7 +111,7 @@ static void correlate_aniso(const char *fn, t_atoms *ref, t_atoms *calc, } static void average_residues(double f[], double **U, int uind, - int isize, int index[], real w_rls[], + int isize, const int index[], const real w_rls[], const t_atoms *atoms) { int i, j, start; diff --git a/src/gromacs/gmxana/gmx_sham.cpp b/src/gromacs/gmxana/gmx_sham.cpp index b7806994df..46793e0901 100644 --- a/src/gromacs/gmxana/gmx_sham.cpp +++ b/src/gromacs/gmxana/gmx_sham.cpp @@ -59,12 +59,12 @@ #include "gromacs/utility/smalloc.h" -static int index2(int *ibox, int x, int y) +static int index2(const int *ibox, int x, int y) { return (ibox[1]*x+y); } -static int index3(int *ibox, int x, int y, int z) +static int index3(const int *ibox, int x, int y, int z) { return (ibox[2]*(ibox[1]*x+y)+z); } @@ -139,7 +139,7 @@ static void lo_write_xplor(XplorMap * map, const char * file) gmx_ffclose(fp); } -static void write_xplor(const char *file, real *data, int *ibox, real dmin[], real dmax[]) +static void write_xplor(const char *file, const real *data, int *ibox, const real dmin[], const real dmax[]) { XplorMap *xm; int i, j, k, n; @@ -176,7 +176,7 @@ static void write_xplor(const char *file, real *data, int *ibox, real dmin[], re sfree(xm); } -static void normalize_p_e(int len, double *P, int *nbin, real *E, real pmin) +static void normalize_p_e(int len, double *P, const int *nbin, real *E, real pmin) { int i; double Ptot = 0; @@ -244,11 +244,11 @@ void add_minimum(FILE *fp, int num, const t_minimum *min, t_minimum *mm) } static inline -gmx_bool is_local_minimum_from_below(const t_minimum *this_min, - int dimension_index, - int dimension_min, - int neighbour_index, - real *W) +gmx_bool is_local_minimum_from_below(const t_minimum *this_min, + int dimension_index, + int dimension_min, + int neighbour_index, + const real *W) { return ((dimension_index == dimension_min) || ((dimension_index > dimension_min) && @@ -257,11 +257,11 @@ gmx_bool is_local_minimum_from_below(const t_minimum *this_min, } static inline -gmx_bool is_local_minimum_from_above(const t_minimum *this_min, - int dimension_index, - int dimension_max, - int neighbour_index, - real *W) +gmx_bool is_local_minimum_from_above(const t_minimum *this_min, + int dimension_index, + int dimension_max, + int neighbour_index, + const real *W) { return ((dimension_index == dimension_max) || ((dimension_index < dimension_max) && @@ -419,8 +419,8 @@ static void do_sham(const char *fn, const char *ndx, gmx_bool bGE, int nenerT, real **enerT, real Tref, real pmax, real gmax, - real *emin, real *emax, int nlevels, real pmin, - int *idim, int *ibox, + const real *emin, const real *emax, int nlevels, real pmin, + const int *idim, int *ibox, gmx_bool bXmin, real *xmin, gmx_bool bXmax, real *xmax) { FILE *fp; diff --git a/src/gromacs/gmxana/gmx_sorient.cpp b/src/gromacs/gmxana/gmx_sorient.cpp index 90f440c5d4..2a88186f8b 100644 --- a/src/gromacs/gmxana/gmx_sorient.cpp +++ b/src/gromacs/gmxana/gmx_sorient.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -57,7 +57,7 @@ #include "gromacs/utility/smalloc.h" static void calc_com_pbc(int nrefat, t_topology *top, rvec x[], t_pbc *pbc, - int index[], rvec xref, gmx_bool bPBC) + const int index[], rvec xref, gmx_bool bPBC) { const real tol = 1e-4; gmx_bool bChanged; diff --git a/src/gromacs/gmxana/gmx_spol.cpp b/src/gromacs/gmxana/gmx_spol.cpp index ed62da7c5d..8894887353 100644 --- a/src/gromacs/gmxana/gmx_spol.cpp +++ b/src/gromacs/gmxana/gmx_spol.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -59,7 +59,7 @@ #include "gromacs/utility/smalloc.h" static void calc_com_pbc(int nrefat, const t_topology *top, rvec x[], t_pbc *pbc, - int index[], rvec xref, int ePBC) + const int index[], rvec xref, int ePBC) { const real tol = 1e-4; gmx_bool bChanged; diff --git a/src/gromacs/gmxana/gmx_traj.cpp b/src/gromacs/gmxana/gmx_traj.cpp index 0289165fe2..fc28be140f 100644 --- a/src/gromacs/gmxana/gmx_traj.cpp +++ b/src/gromacs/gmxana/gmx_traj.cpp @@ -65,8 +65,8 @@ #include "gromacs/utility/futil.h" #include "gromacs/utility/smalloc.h" -static void low_print_data(FILE *fp, real time, rvec x[], int n, int *index, - gmx_bool bDim[], const char *sffmt) +static void low_print_data(FILE *fp, real time, rvec x[], int n, const int *index, + const gmx_bool bDim[], const char *sffmt) { int i, ii, d; @@ -96,8 +96,8 @@ static void low_print_data(FILE *fp, real time, rvec x[], int n, int *index, fprintf(fp, "\n"); } -static void average_data(rvec x[], rvec xav[], real *mass, - int ngrps, int isize[], int **index) +static void average_data(rvec x[], rvec xav[], const real *mass, + int ngrps, const int isize[], int **index) { int g, i, ind, d; real m; @@ -209,7 +209,7 @@ static void write_trx_x(t_trxstatus *status, const t_trxframe *fr, real *mass, g } static void make_legend(FILE *fp, int ngrps, int isize, int index[], - char **name, gmx_bool bCom, gmx_bool bMol, gmx_bool bDim[], + char **name, gmx_bool bCom, gmx_bool bMol, const gmx_bool bDim[], const gmx_output_env_t *oenv) { char **leg; @@ -259,7 +259,7 @@ static void make_legend(FILE *fp, int ngrps, int isize, int index[], sfree(leg); } -static real ekrot(rvec x[], rvec v[], real mass[], int isize, int index[]) +static real ekrot(rvec x[], rvec v[], const real mass[], int isize, const int index[]) { real TCM[5][5], L[5][5]; double tm, m0, lxx, lxy, lxz, lyy, lyz, lzz, ekrot; @@ -337,7 +337,7 @@ static real ekrot(rvec x[], rvec v[], real mass[], int isize, int index[]) return ekrot; } -static real ektrans(rvec v[], real mass[], int isize, int index[]) +static real ektrans(rvec v[], const real mass[], int isize, const int index[]) { dvec mvcom; double mtot; @@ -358,7 +358,7 @@ static real ektrans(rvec v[], real mass[], int isize, int index[]) return dnorm2(mvcom)/(mtot*2); } -static real temp(rvec v[], real mass[], int isize, int index[]) +static real temp(rvec v[], const real mass[], int isize, const int index[]) { double ekin2; int i, j; @@ -408,7 +408,7 @@ static void write_pdb_bfac(const char *fname, const char *xname, const char *title, t_atoms *atoms, int ePBC, matrix box, int isize, int *index, int nfr_x, rvec *x, int nfr_v, rvec *sum, - gmx_bool bDim[], real scale_factor, + const gmx_bool bDim[], real scale_factor, const gmx_output_env_t *oenv) { FILE *fp; @@ -526,7 +526,7 @@ static void write_pdb_bfac(const char *fname, const char *xname, } } -static void update_histo(int gnx, int index[], rvec v[], +static void update_histo(int gnx, const int index[], rvec v[], int *nhisto, int **histo, real binwidth) { int i, m, in, nnn; diff --git a/src/gromacs/gmxana/gmx_trjconv.cpp b/src/gromacs/gmxana/gmx_trjconv.cpp index 2f78088512..f62d901983 100644 --- a/src/gromacs/gmxana/gmx_trjconv.cpp +++ b/src/gromacs/gmxana/gmx_trjconv.cpp @@ -78,7 +78,7 @@ enum { static void calc_pbc_cluster(int ecenter, int nrefat, t_topology *top, int ePBC, - rvec x[], int index[], matrix box) + rvec x[], const int index[], matrix box) { int m, i, j, j0, j1, jj, ai, aj; int imin, jmin; @@ -408,7 +408,7 @@ static void put_residue_com_in_box(int unitcell_enum, int ecenter, } } -static void center_x(int ecenter, rvec x[], matrix box, int n, int nc, int ci[]) +static void center_x(int ecenter, rvec x[], matrix box, int n, int nc, const int ci[]) { int i, m, ai; rvec cmin, cmax, box_center, dx; diff --git a/src/gromacs/gmxana/gmx_tune_pme.cpp b/src/gromacs/gmxana/gmx_tune_pme.cpp index 9947077818..066ee653fb 100644 --- a/src/gromacs/gmxana/gmx_tune_pme.cpp +++ b/src/gromacs/gmxana/gmx_tune_pme.cpp @@ -852,17 +852,17 @@ static gmx_bool can_scale_rvdw(int vdwtype) /* Make additional TPR files with more computational load for the * direct space processors: */ static void make_benchmark_tprs( - const char *fn_sim_tpr, /* READ : User-provided tpr file */ - char *fn_bench_tprs[], /* WRITE: Names of benchmark tpr files */ - gmx_int64_t benchsteps, /* Number of time steps for benchmark runs */ - gmx_int64_t statesteps, /* Step counter in checkpoint file */ - real rmin, /* Minimal Coulomb radius */ - real rmax, /* Maximal Coulomb radius */ - real bScaleRvdw, /* Scale rvdw along with rcoulomb */ - int *ntprs, /* No. of TPRs to write, each with a different - rcoulomb and fourierspacing */ - t_inputinfo *info, /* Contains information about mdp file options */ - FILE *fp) /* Write the output here */ + const char *fn_sim_tpr, /* READ : User-provided tpr file */ + char *fn_bench_tprs[], /* WRITE: Names of benchmark tpr files */ + gmx_int64_t benchsteps, /* Number of time steps for benchmark runs */ + gmx_int64_t statesteps, /* Step counter in checkpoint file */ + real rmin, /* Minimal Coulomb radius */ + real rmax, /* Maximal Coulomb radius */ + real bScaleRvdw, /* Scale rvdw along with rcoulomb */ + const int *ntprs, /* No. of TPRs to write, each with a different + rcoulomb and fourierspacing */ + t_inputinfo *info, /* Contains information about mdp file options */ + FILE *fp) /* Write the output here */ { int i, j, d; t_state state; diff --git a/src/gromacs/gmxana/gmx_velacc.cpp b/src/gromacs/gmxana/gmx_velacc.cpp index 5cbd55bb47..f9b9f07120 100644 --- a/src/gromacs/gmxana/gmx_velacc.cpp +++ b/src/gromacs/gmxana/gmx_velacc.cpp @@ -121,7 +121,7 @@ static void precalc(const t_topology &top, real normm[]) } -static void calc_spectrum(int n, real c[], real dt, const char *fn, +static void calc_spectrum(int n, const real c[], real dt, const char *fn, gmx_output_env_t *oenv, gmx_bool bRecip) { FILE *fp; diff --git a/src/gromacs/gmxana/gmx_wham.cpp b/src/gromacs/gmxana/gmx_wham.cpp index 46c39ca92c..5e39155df8 100644 --- a/src/gromacs/gmxana/gmx_wham.cpp +++ b/src/gromacs/gmxana/gmx_wham.cpp @@ -833,7 +833,7 @@ static double tabulated_pot(double dist, t_UmbrellaOptions *opt) * After rapid convergence (using only substiantal contributions), we always switch to * full precision. */ -static void setup_acc_wham(double *profile, t_UmbrellaWindow * window, int nWindows, +static void setup_acc_wham(const double *profile, t_UmbrellaWindow * window, int nWindows, t_UmbrellaOptions *opt) { int i, j, k, nGrptot = 0, nContrib = 0, nTot = 0; @@ -1001,7 +1001,7 @@ static void calc_profile(double *profile, t_UmbrellaWindow * window, int nWindow } //! Compute the free energy offsets z (one of the two main WHAM routines) -static double calc_z(double * profile, t_UmbrellaWindow * window, int nWindows, +static double calc_z(const double * profile, t_UmbrellaWindow * window, int nWindows, t_UmbrellaOptions *opt, gmx_bool bExact) { double min = opt->min, dz = opt->dz, ztot_half, ztot; @@ -1324,7 +1324,7 @@ static void calc_cumulatives(t_UmbrellaWindow *window, int nWindows, * * This is used to generate a random sequence distributed according to a histogram */ -static void searchCumulative(double xx[], int n, double x, int *j) +static void searchCumulative(const double xx[], int n, double x, int *j) { int ju, jm, jl; diff --git a/src/gromacs/gmxana/gmx_xpm2ps.cpp b/src/gromacs/gmxana/gmx_xpm2ps.cpp index f15f0955e3..5073667028 100644 --- a/src/gromacs/gmxana/gmx_xpm2ps.cpp +++ b/src/gromacs/gmxana/gmx_xpm2ps.cpp @@ -1179,7 +1179,7 @@ static void zero_lines(int nmat, t_matrix *mat, t_matrix *mat2) static void write_combined_matrix(int ecombine, const char *fn, int nmat, t_matrix *mat1, t_matrix *mat2, - real *cmin, real *cmax) + const real *cmin, const real *cmax) { int i, j, k, nlevels; FILE *out; @@ -1316,7 +1316,7 @@ static void do_mat(int nmat, t_matrix *mat, t_matrix *mat2, } } -static void gradient_map(rvec grad, int nmap, t_mapping map[]) +static void gradient_map(const rvec grad, int nmap, t_mapping map[]) { int i; real c; diff --git a/src/gromacs/gmxana/gstat.h b/src/gromacs/gmxana/gstat.h index f9c8e8e7d1..8959b01446 100644 --- a/src/gromacs/gmxana/gstat.h +++ b/src/gromacs/gmxana/gstat.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * 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. @@ -86,7 +86,7 @@ typedef struct { real Jcsig; /* Standard deviation in Jc */ } t_karplus; -void calc_distribution_props(int nh, int histo[], +void calc_distribution_props(int nh, const int histo[], real start, int nkkk, t_karplus kkk[], real *S2); /* This routine takes a dihedral distribution and calculates @@ -204,7 +204,7 @@ void make_histo(FILE *log, * if both are 0, these values are computed by the routine itself */ -void normalize_histo(int npoints, int histo[], real dx, real normhisto[]); +void normalize_histo(int npoints, const int histo[], real dx, real normhisto[]); /* * Normalize a histogram so that the integral over the histo is 1 * @@ -254,7 +254,7 @@ void analyse_corr(int n, real t[], real ct[], real nt[], real kt[], real sigma_ct[], real sigma_nt[], real sigma_kt[], real fit_start, real temp); -void compute_derivative(int nn, real x[], real y[], real dydx[]); +void compute_derivative(int nn, const real x[], const real y[], real dydx[]); #ifdef __cplusplus } diff --git a/src/gromacs/gmxana/hxprops.cpp b/src/gromacs/gmxana/hxprops.cpp index 9c6d7aea0a..667c8f456f 100644 --- a/src/gromacs/gmxana/hxprops.cpp +++ b/src/gromacs/gmxana/hxprops.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -103,7 +103,7 @@ real ellipticity(int nres, t_bb bb[]) return ell; } -real ahx_len(int gnx, int index[], rvec x[]) +real ahx_len(int gnx, const int index[], rvec x[]) /* Assume we have a list of Calpha atoms only! */ { rvec dx; @@ -113,7 +113,7 @@ real ahx_len(int gnx, int index[], rvec x[]) return norm(dx); } -real radius(FILE *fp, int nca, int ca_index[], rvec x[]) +real radius(FILE *fp, int nca, const int ca_index[], rvec x[]) /* Assume we have all the backbone */ { real dl2, dlt; @@ -140,7 +140,7 @@ real radius(FILE *fp, int nca, int ca_index[], rvec x[]) return std::sqrt(dlt/nca); } -static real rot(rvec x1, rvec x2) +static real rot(rvec x1, const rvec x2) { real phi1, dphi, cp, sp; real xx, yy; @@ -156,7 +156,7 @@ static real rot(rvec x1, rvec x2) return dphi; } -real twist(int nca, int caindex[], rvec x[]) +real twist(int nca, const int caindex[], rvec x[]) { real pt, dphi; int i, a0, a1; @@ -179,7 +179,7 @@ real twist(int nca, int caindex[], rvec x[]) return (pt/(nca-1)); } -real ca_phi(int gnx, int index[], rvec x[]) +real ca_phi(int gnx, const int index[], rvec x[]) /* Assume we have a list of Calpha atoms only! */ { real phi, phitot; @@ -227,7 +227,7 @@ real dip(int nbb, int const bbind[], const rvec x[], const t_atom atom[]) return norm(dipje); } -real rise(int gnx, int index[], rvec x[]) +real rise(int gnx, const int index[], rvec x[]) /* Assume we have a list of Calpha atoms only! */ { real z, z0, ztot; diff --git a/src/gromacs/gmxana/hxprops.h b/src/gromacs/gmxana/hxprops.h index 88de40811c..e079ebe15e 100644 --- a/src/gromacs/gmxana/hxprops.h +++ b/src/gromacs/gmxana/hxprops.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * 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. @@ -77,15 +77,15 @@ enum { efhAHX, efhNR }; -extern real ahx_len(int gnx, int index[], rvec x[]); +extern real ahx_len(int gnx, const int index[], rvec x[]); /* Assume we have a list of Calpha atoms only! */ extern real ellipticity(int nres, t_bb bb[]); -extern real radius(FILE *fp, int nca, int ca_index[], rvec x[]); +extern real radius(FILE *fp, int nca, const int ca_index[], rvec x[]); /* Assume we have calphas */ -extern real twist(int nca, int caindex[], rvec x[]); +extern real twist(int nca, const int caindex[], rvec x[]); /* Calculate the twist of the helix */ extern real pprms(FILE *fp, int nbb, t_bb bb[]); @@ -93,12 +93,12 @@ extern real pprms(FILE *fp, int nbb, t_bb bb[]); * and the distance per residue */ -extern real ca_phi(int gnx, int index[], rvec x[]); +extern real ca_phi(int gnx, const int index[], rvec x[]); /* Assume we have a list of Calpha atoms only! */ extern real dip(int nbb, const int bbind[], const rvec x[], const t_atom atom[]); -extern real rise(int gnx, int index[], rvec x[]); +extern real rise(int gnx, const int index[], rvec x[]); /* Assume we have a list of Calpha atoms only! */ extern void av_hblen(FILE *fp3, FILE *fp3a, diff --git a/src/gromacs/gmxana/nrama.cpp b/src/gromacs/gmxana/nrama.cpp index 36dcc8a9b1..b721117b2a 100644 --- a/src/gromacs/gmxana/nrama.cpp +++ b/src/gromacs/gmxana/nrama.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -117,7 +117,7 @@ static int find_atom(const char *find, char ***names, int start, int nr) return -1; } -static void add_xr(t_xrama *xr, int ff[5], const t_atoms *atoms) +static void add_xr(t_xrama *xr, const int ff[5], const t_atoms *atoms) { char buf[12]; int i; diff --git a/src/gromacs/gmxana/nsfactor.cpp b/src/gromacs/gmxana/nsfactor.cpp index d05c9b6162..647d5deb0a 100644 --- a/src/gromacs/gmxana/nsfactor.cpp +++ b/src/gromacs/gmxana/nsfactor.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015,2016,2017,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. @@ -190,16 +190,16 @@ gmx_sans_t *gmx_sans_init (const t_topology *top, gmx_neutron_atomic_structurefa } gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram ( - gmx_sans_t *gsans, - rvec *x, - matrix box, - int *index, - int isize, - double binwidth, - gmx_bool bMC, - gmx_bool bNORM, - real mcover, - unsigned int seed) + gmx_sans_t *gsans, + rvec *x, + matrix box, + const int *index, + int isize, + double binwidth, + gmx_bool bMC, + gmx_bool bNORM, + real mcover, + unsigned int seed) { gmx_radial_distribution_histogram_t *pr = nullptr; rvec dist; diff --git a/src/gromacs/gmxana/nsfactor.h b/src/gromacs/gmxana/nsfactor.h index 949d42922b..d8550cdd11 100644 --- a/src/gromacs/gmxana/nsfactor.h +++ b/src/gromacs/gmxana/nsfactor.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by + * Copyright (c) 2012,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. @@ -78,16 +78,16 @@ gmx_neutron_atomic_structurefactors_t *gmx_neutronstructurefactors_init(const ch gmx_sans_t *gmx_sans_init(const t_topology *top, gmx_neutron_atomic_structurefactors_t *gnsf); -gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram (gmx_sans_t *gsans, - rvec *x, - matrix box, - int *index, - int isize, - double binwidth, - gmx_bool bMC, - gmx_bool bNORM, - real mcover, - unsigned int seed); +gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram (gmx_sans_t *gsans, + rvec *x, + matrix box, + const int *index, + int isize, + double binwidth, + gmx_bool bMC, + gmx_bool bNORM, + real mcover, + unsigned int seed); gmx_static_structurefactor_t *convert_histogram_to_intensity_curve (gmx_radial_distribution_histogram_t *pr, double start_q, double end_q, double q_step); diff --git a/src/gromacs/gmxana/princ.cpp b/src/gromacs/gmxana/princ.cpp index e7da5b98ef..4f8e9af8f2 100644 --- a/src/gromacs/gmxana/princ.cpp +++ b/src/gromacs/gmxana/princ.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2012,2014,2015,2016,2017,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. @@ -197,7 +197,7 @@ void principal_comp(int n, const int index[], t_atom atom[], rvec x[], sfree(ev); } -void rotate_atoms(int gnx, int *index, rvec x[], matrix trans) +void rotate_atoms(int gnx, const int *index, rvec x[], matrix trans) { real xt, yt, zt; int i, ii; @@ -269,7 +269,7 @@ real sub_xcm(rvec x[], int gnx, const int *index, const t_atom atom[], rvec xcm, return tm; } -void add_xcm(rvec x[], int gnx, int *index, rvec xcm) +void add_xcm(rvec x[], int gnx, const int *index, rvec xcm) { int i, ii; diff --git a/src/gromacs/gmxana/princ.h b/src/gromacs/gmxana/princ.h index 426fefb57b..e89b05327b 100644 --- a/src/gromacs/gmxana/princ.h +++ b/src/gromacs/gmxana/princ.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2010,2014,2015,2016, by the GROMACS development team, led by + * Copyright (c) 2010,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. @@ -48,7 +48,7 @@ struct t_atoms; extern "C" { #endif -void rotate_atoms(int gnx, int index[], rvec x[], matrix trans); +void rotate_atoms(int gnx, const int index[], rvec x[], matrix trans); /* Rotate all atoms in index using matrix trans */ void principal_comp(int n, const int index[], t_atom atom[], rvec x[], @@ -75,7 +75,7 @@ real sub_xcm(rvec x[], int gnx, const int *index, const t_atom atom[], rvec xcm, * Returns the total mass */ -void add_xcm(rvec x[], int gnx, int *index, rvec xcm); +void add_xcm(rvec x[], int gnx, const int *index, rvec xcm); /* Increment all atoms in index with xcm */ #ifdef __cplusplus diff --git a/src/gromacs/gmxana/sfactor.cpp b/src/gromacs/gmxana/sfactor.cpp index c0f7e44ee0..3a67fd11e1 100644 --- a/src/gromacs/gmxana/sfactor.cpp +++ b/src/gromacs/gmxana/sfactor.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -335,7 +335,7 @@ extern gmx_structurefactors_t *gmx_structurefactors_init(const char *datfn) } -extern void rearrange_atoms (reduced_atom_t * positions, t_trxframe *fr, int * index, +extern void rearrange_atoms (reduced_atom_t * positions, t_trxframe *fr, const int * index, int isize, const t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf) /* given the group's index, return the (continuous) array of atoms */ { diff --git a/src/gromacs/gmxana/sfactor.h b/src/gromacs/gmxana/sfactor.h index 8c1bb45177..e1ad760415 100644 --- a/src/gromacs/gmxana/sfactor.h +++ b/src/gromacs/gmxana/sfactor.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * 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. @@ -73,7 +73,7 @@ double CMSF (gmx_structurefactors_t *gsf, int type, int nh, double lambda, doubl int return_atom_type (const char *name, gmx_structurefactors_t *gsf); -void rearrange_atoms (reduced_atom_t * positions, struct t_trxframe *fr, int * index, +void rearrange_atoms (reduced_atom_t * positions, struct t_trxframe *fr, const int * index, int isize, const t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf); int do_scattering_intensity (const char* fnTPS, const char* fnNDX, diff --git a/src/gromacs/gmxana/thermochemistry.cpp b/src/gromacs/gmxana/thermochemistry.cpp index e3d1438101..8327b378e7 100644 --- a/src/gromacs/gmxana/thermochemistry.cpp +++ b/src/gromacs/gmxana/thermochemistry.cpp @@ -128,11 +128,11 @@ double calcTranslationalEntropy(real mass, return RGAS*(std::log(qT) + 2.5); } -double calcRotationalEntropy(real temperature, - int natom, - gmx_bool linear, - rvec theta, - real sigma_r) +double calcRotationalEntropy(real temperature, + int natom, + gmx_bool linear, + const rvec theta, + real sigma_r) { GMX_RELEASE_ASSERT(sigma_r > 0, "Symmetry factor should be larger than zero"); GMX_RELEASE_ASSERT(temperature > 0, "Temperature should be larger than zero"); diff --git a/src/gromacs/gmxana/thermochemistry.h b/src/gromacs/gmxana/thermochemistry.h index 68d9c8ea25..5874f172c9 100644 --- a/src/gromacs/gmxana/thermochemistry.h +++ b/src/gromacs/gmxana/thermochemistry.h @@ -87,11 +87,11 @@ double calcTranslationalEntropy(real mass, * \param[in] sigma_r Symmetry factor, should be >= 1 * \returns The rotational entropy */ -double calcRotationalEntropy(real temperature, - int natom, - gmx_bool linear, - rvec theta, - real sigma_r); +double calcRotationalEntropy(real temperature, + int natom, + gmx_bool linear, + const rvec theta, + real sigma_r); /*! \brief Compute internal energy due to vibrational motion * diff --git a/src/gromacs/gmxlib/conformation-utilities.cpp b/src/gromacs/gmxlib/conformation-utilities.cpp index d5fe1e0ad1..5f93fd7573 100644 --- a/src/gromacs/gmxlib/conformation-utilities.cpp +++ b/src/gromacs/gmxlib/conformation-utilities.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by + * Copyright (c) 2012,2014,2015,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. @@ -85,7 +85,7 @@ void rotate_conf(int natom, rvec *x, rvec *v, real alfa, real beta, real gamma) } /* Make a new box around a configuration*/ -void make_new_box(int natoms, rvec *x, matrix box, rvec box_space, +void make_new_box(int natoms, rvec *x, matrix box, const rvec box_space, gmx_bool bCenter) { int i, m; diff --git a/src/gromacs/gmxlib/conformation-utilities.h b/src/gromacs/gmxlib/conformation-utilities.h index 0fbe271f04..65abf50464 100644 --- a/src/gromacs/gmxlib/conformation-utilities.h +++ b/src/gromacs/gmxlib/conformation-utilities.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2010,2014, by the GROMACS development team, led by + * Copyright (c) 2010,2014,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. @@ -48,7 +48,7 @@ extern "C" { void rotate_conf(int natom, rvec *x, rvec *v, real alfa, real beta, real gamma); /*rotate() rotates a configuration alfa degrees around the x_axis and beta degrees around the y_axis, *v can be NULL */ -void make_new_box(int natoms, rvec *x, matrix box, rvec box_space, +void make_new_box(int natoms, rvec *x, matrix box, const rvec box_space, gmx_bool bCenter); /* Generates a box around a configuration, box_space is optional extra * space around it. If bCenter then coordinates will be centered in diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsall.cpp b/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsall.cpp index f20c65f6f6..2b88ee7b8f 100644 --- a/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsall.cpp +++ b/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsall.cpp @@ -200,12 +200,12 @@ setup_exclusions_and_indices(gmx_allvsall_data_t * aadata, } static void -setup_aadata(gmx_allvsall_data_t ** p_aadata, - const t_blocka * excl, - int natoms, - int * type, - int ntype, - real * pvdwparam) +setup_aadata(gmx_allvsall_data_t ** p_aadata, + const t_blocka * excl, + int natoms, + const int * type, + int ntype, + const real * pvdwparam) { int i, j, idx; gmx_allvsall_data_t *aadata; diff --git a/src/gromacs/gmxlib/nrnb.cpp b/src/gromacs/gmxlib/nrnb.cpp index ba5ec1da26..a9bd5e861d 100644 --- a/src/gromacs/gmxlib/nrnb.cpp +++ b/src/gromacs/gmxlib/nrnb.cpp @@ -520,7 +520,7 @@ static const int constr_index[] = { #define NCONSTR_INDEX asize(constr_index) static double pr_av(FILE *log, t_commrec *cr, - double fav, double ftot[], const char *title) + double fav, const double ftot[], const char *title) { int i, perc; double dperc, unb; diff --git a/src/gromacs/gmxpreprocess/add_par.cpp b/src/gromacs/gmxpreprocess/add_par.cpp index 96cf768664..e5a884ed1a 100644 --- a/src/gromacs/gmxpreprocess/add_par.cpp +++ b/src/gromacs/gmxpreprocess/add_par.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2011,2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2011,2014,2015,2017,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. @@ -71,7 +71,7 @@ static void clear_force_param(int i0, real c[]) } } -void add_param(t_params *ps, int ai, int aj, real *c, char *s) +void add_param(t_params *ps, int ai, int aj, const real *c, char *s) { int i; diff --git a/src/gromacs/gmxpreprocess/add_par.h b/src/gromacs/gmxpreprocess/add_par.h index 925a321f59..dbdd58cac4 100644 --- a/src/gromacs/gmxpreprocess/add_par.h +++ b/src/gromacs/gmxpreprocess/add_par.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,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. @@ -42,7 +42,7 @@ #include "gromacs/gmxpreprocess/pdb2top.h" #include "gromacs/utility/real.h" -void add_param(t_params *ps, int ai, int aj, real *c, char *s); +void add_param(t_params *ps, int ai, int aj, const real *c, char *s); void add_imp_param(t_params *ps, int ai, int aj, int ak, int al, real c0, real c1, char *s); diff --git a/src/gromacs/gmxpreprocess/convparm.cpp b/src/gromacs/gmxpreprocess/convparm.cpp index 7dc03d1e6d..a092887605 100644 --- a/src/gromacs/gmxpreprocess/convparm.cpp +++ b/src/gromacs/gmxpreprocess/convparm.cpp @@ -498,7 +498,7 @@ static int enter_params(gmx_ffparams_t *ffparams, t_functype ftype, } static void append_interaction(t_ilist *ilist, - int type, int nral, int a[MAXATOMLIST]) + int type, int nral, const int a[MAXATOMLIST]) { int i, where1; diff --git a/src/gromacs/gmxpreprocess/gen_ad.cpp b/src/gromacs/gmxpreprocess/gen_ad.cpp index fe26641bc2..090390bd8d 100644 --- a/src/gromacs/gmxpreprocess/gen_ad.cpp +++ b/src/gromacs/gmxpreprocess/gen_ad.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -276,7 +276,7 @@ static void cpparam(t_param *dest, t_param *src) } } -static void set_p(t_param *p, int ai[4], real *c, char *s) +static void set_p(t_param *p, const int ai[4], const real *c, char *s) { int j; @@ -349,7 +349,7 @@ static void sort_id(int nr, t_param ps[]) } } -static int n_hydro(int a[], char ***atomname) +static int n_hydro(const int a[], char ***atomname) { int i, nh = 0; char c0, c1, *aname; @@ -570,7 +570,7 @@ static gmx_bool is_hydro(t_atoms *atoms, int ai) } static void get_atomnames_min(int n, char **anm, - int resind, t_atoms *atoms, int *a) + int resind, t_atoms *atoms, const int *a) { int m; diff --git a/src/gromacs/gmxpreprocess/gen_maxwell_velocities.cpp b/src/gromacs/gmxpreprocess/gen_maxwell_velocities.cpp index 350e1ad951..6192ca8b85 100644 --- a/src/gromacs/gmxpreprocess/gen_maxwell_velocities.cpp +++ b/src/gromacs/gmxpreprocess/gen_maxwell_velocities.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * 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. @@ -115,7 +115,7 @@ void maxwell_speed(real tempi, unsigned int seed, gmx_mtop_t *mtop, rvec v[]) low_mspeed(tempi, mtop, v, &rng); } -static real calc_cm(int natoms, real mass[], rvec x[], rvec v[], +static real calc_cm(int natoms, const real mass[], rvec x[], rvec v[], rvec xcm, rvec vcm, rvec acm, matrix L) { rvec dx, a0; diff --git a/src/gromacs/gmxpreprocess/gen_vsite.cpp b/src/gromacs/gmxpreprocess/gen_vsite.cpp index 80349aaed3..69d7815162 100644 --- a/src/gromacs/gmxpreprocess/gen_vsite.cpp +++ b/src/gromacs/gmxpreprocess/gen_vsite.cpp @@ -496,8 +496,8 @@ static void count_bonds(int atom, t_params *psb, char ***atomname, } static void print_bonds(FILE *fp, int o2n[], - int nrHatoms, int Hatoms[], int Heavy, - int nrheavies, int heavies[]) + int nrHatoms, const int Hatoms[], int Heavy, + int nrheavies, const int heavies[]) { int i; diff --git a/src/gromacs/gmxpreprocess/genconf.cpp b/src/gromacs/gmxpreprocess/genconf.cpp index 1c0275bc8c..4e67d0ea89 100644 --- a/src/gromacs/gmxpreprocess/genconf.cpp +++ b/src/gromacs/gmxpreprocess/genconf.cpp @@ -55,7 +55,7 @@ #include "gromacs/utility/smalloc.h" static void rand_rot(int natoms, rvec x[], rvec v[], vec4 xrot[], vec4 vrot[], - gmx::DefaultRandomEngine * rng, rvec max_rot) + gmx::DefaultRandomEngine * rng, const rvec max_rot) { mat4 mt1, mt2, mr[DIM], mtemp1, mtemp2, mtemp3, mxtot, mvtot; rvec xcm; diff --git a/src/gromacs/gmxpreprocess/genhydro.cpp b/src/gromacs/gmxpreprocess/genhydro.cpp index bec357639d..5fca3ba6b4 100644 --- a/src/gromacs/gmxpreprocess/genhydro.cpp +++ b/src/gromacs/gmxpreprocess/genhydro.cpp @@ -78,7 +78,7 @@ static int pdbasearch_atom(const char *name, int resind, t_atoms *pdba, } static void hacksearch_atom(int *ii, int *jj, char *name, - int nab[], t_hack *ab[], + const int nab[], t_hack *ab[], int resind, t_atoms *pdba) { int i, j; @@ -107,7 +107,7 @@ static void hacksearch_atom(int *ii, int *jj, char *name, } -static void dump_ab(FILE *out, int natom, int nab[], t_hack *ab[], gmx_bool bHeader) +static void dump_ab(FILE *out, int natom, const int nab[], t_hack *ab[], gmx_bool bHeader) { int i, j; @@ -138,7 +138,7 @@ static void dump_ab(FILE *out, int natom, int nab[], t_hack *ab[], gmx_bool bHea static t_hackblock *get_hackblocks(t_atoms *pdba, int nah, t_hackblock ah[], int nterpairs, t_hackblock **ntdb, t_hackblock **ctdb, - int *rN, int *rC) + const int *rN, const int *rC) { int i, rnr; t_hackblock *hb, *ahptr; @@ -289,7 +289,7 @@ static void expand_hackblocks_one(t_hackblock *hbr, char *atomname, static void expand_hackblocks(t_atoms *pdba, t_hackblock hb[], int nab[], t_hack *ab[], - int nterpairs, int *rN, int *rC) + int nterpairs, const int *rN, const int *rC) { int i, j; gmx_bool bN, bC; @@ -317,7 +317,7 @@ static void expand_hackblocks(t_atoms *pdba, t_hackblock hb[], } } -static int check_atoms_present(t_atoms *pdba, int nab[], t_hack *ab[]) +static int check_atoms_present(t_atoms *pdba, const int nab[], t_hack *ab[]) { int i, j, k, rnr, nadd; diff --git a/src/gromacs/gmxpreprocess/grompp.cpp b/src/gromacs/gmxpreprocess/grompp.cpp index 3307448b1b..d8dc2bda92 100644 --- a/src/gromacs/gmxpreprocess/grompp.cpp +++ b/src/gromacs/gmxpreprocess/grompp.cpp @@ -1054,11 +1054,11 @@ static int nrdf_internal(t_atoms *atoms) } static void -spline1d( double dx, - double * y, - int n, - double * u, - double * y2 ) +spline1d( double dx, + const double * y, + int n, + double * u, + double * y2 ) { int i; double p, q; @@ -1084,13 +1084,13 @@ spline1d( double dx, static void -interpolate1d( double xmin, - double dx, - double * ya, - double * y2a, - double x, - double * y, - double * y1) +interpolate1d( double xmin, + double dx, + const double * ya, + const double * y2a, + double x, + double * y, + double * y1) { int ix; double a, b; @@ -1106,10 +1106,10 @@ interpolate1d( double xmin, static void -setup_cmap (int grid_spacing, - int nc, - real * grid, - gmx_cmap_t * cmap_grid) +setup_cmap (int grid_spacing, + int nc, + const real * grid, + gmx_cmap_t * cmap_grid) { double *tmp_u, *tmp_u2, *tmp_yy, *tmp_y1, *tmp_t2, *tmp_grid; diff --git a/src/gromacs/gmxpreprocess/hizzie.cpp b/src/gromacs/gmxpreprocess/hizzie.cpp index 5dfbe4947b..7a6e9282f6 100644 --- a/src/gromacs/gmxpreprocess/hizzie.cpp +++ b/src/gromacs/gmxpreprocess/hizzie.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2017,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. @@ -82,7 +82,7 @@ static gmx_bool hbond(rvec x[], int i, int j, real distance) } static void chk_allhb(t_atoms *pdba, rvec x[], t_blocka *hb, - gmx_bool donor[], gmx_bool accept[], real dist) + const gmx_bool donor[], const gmx_bool accept[], real dist) { int i, j, k, ii, natom; @@ -143,7 +143,7 @@ static void pr_hbonds(FILE *fp, t_blocka *hb, t_atoms *pdba) } static gmx_bool chk_hbonds(int i, t_atoms *pdba, rvec x[], - gmx_bool ad[], gmx_bool hbond[], rvec xh, + const gmx_bool ad[], gmx_bool hbond[], rvec xh, real angle, real dist) { gmx_bool bHB; diff --git a/src/gromacs/gmxpreprocess/pdb2gmx.cpp b/src/gromacs/gmxpreprocess/pdb2gmx.cpp index b8a870e58c..29c28bdf6a 100644 --- a/src/gromacs/gmxpreprocess/pdb2gmx.cpp +++ b/src/gromacs/gmxpreprocess/pdb2gmx.cpp @@ -318,7 +318,7 @@ static char *search_resrename(int nrr, rtprename_t *rr, } -static void rename_resrtp(t_atoms *pdba, int nterpairs, int *r_start, int *r_end, +static void rename_resrtp(t_atoms *pdba, int nterpairs, const int *r_start, const int *r_end, int nrr, rtprename_t *rr, t_symtab *symtab, gmx_bool bVerbose) { diff --git a/src/gromacs/gmxpreprocess/pdb2top.cpp b/src/gromacs/gmxpreprocess/pdb2top.cpp index 83406af206..e275d694be 100644 --- a/src/gromacs/gmxpreprocess/pdb2top.cpp +++ b/src/gromacs/gmxpreprocess/pdb2top.cpp @@ -698,7 +698,7 @@ void print_top_mols(FILE *out, } } -void write_top(FILE *out, char *pr, char *molname, +void write_top(FILE *out, char *pr, const char *molname, t_atoms *at, gmx_bool bRTPresname, int bts[], t_params plist[], t_excls excls[], gpp_atomtype_t atype, int *cgnr, int nrexcl) @@ -1022,7 +1022,7 @@ void get_hackblocks_rtp(t_hackblock **hb, t_restp **restp, int nres, t_resinfo *resinfo, int nterpairs, t_hackblock **ntdb, t_hackblock **ctdb, - int *rn, int *rc, + const int *rn, const int *rc, gmx_bool bAllowMissing) { int i, j, k, l; diff --git a/src/gromacs/gmxpreprocess/pdb2top.h b/src/gromacs/gmxpreprocess/pdb2top.h index 810514cfb7..782b1e9388 100644 --- a/src/gromacs/gmxpreprocess/pdb2top.h +++ b/src/gromacs/gmxpreprocess/pdb2top.h @@ -74,7 +74,7 @@ void get_hackblocks_rtp(t_hackblock **hb, t_restp **restp, int nres, t_resinfo *resinfo, int nterpairs, t_hackblock **ntdb, t_hackblock **ctdb, - int *rn, int *rc, + const int *rn, const int *rc, gmx_bool bAllowMissing); /* Get the database entries for the nres residues in resinfo * and store them in restp and hb. @@ -98,7 +98,7 @@ void print_top_mols(FILE *out, int nincl, char **incls, int nmol, t_mols *mols); -void write_top(FILE *out, char *pr, char *molname, +void write_top(FILE *out, char *pr, const char *molname, t_atoms *at, gmx_bool bRTPresname, int bts[], t_params plist[], t_excls excls[], gpp_atomtype_t atype, int *cgnr, int nrexcl); diff --git a/src/gromacs/gmxpreprocess/topio.cpp b/src/gromacs/gmxpreprocess/topio.cpp index 32106323da..0e529d1c16 100644 --- a/src/gromacs/gmxpreprocess/topio.cpp +++ b/src/gromacs/gmxpreprocess/topio.cpp @@ -1028,7 +1028,7 @@ char **do_top(gmx_bool bVerbose, } -static void generate_qmexcl_moltype(gmx_moltype_t *molt, unsigned char *grpnr, +static void generate_qmexcl_moltype(gmx_moltype_t *molt, const unsigned char *grpnr, t_inputrec *ir, warninp_t wi) { /* This routine expects molt->ilist to be of size F_NRE and ordered. */ diff --git a/src/gromacs/gmxpreprocess/topshake.cpp b/src/gromacs/gmxpreprocess/topshake.cpp index bf0537ddaf..854c422340 100644 --- a/src/gromacs/gmxpreprocess/topshake.cpp +++ b/src/gromacs/gmxpreprocess/topshake.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,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. @@ -81,7 +81,7 @@ static void copy_bond (t_params *pr, int to, int from) } } -static int count_hydrogens (char ***atomname, int nra, int a[]) +static int count_hydrogens (char ***atomname, int nra, const int a[]) { int i, nh; diff --git a/src/gromacs/gmxpreprocess/vsite_parm.cpp b/src/gromacs/gmxpreprocess/vsite_parm.cpp index 0ce5b9a8ba..7c4162eb82 100644 --- a/src/gromacs/gmxpreprocess/vsite_parm.cpp +++ b/src/gromacs/gmxpreprocess/vsite_parm.cpp @@ -120,7 +120,7 @@ static void enter_bonded(int nratoms, int *nrbonded, t_mybonded **bondeds, (*nrbonded)++; } -static void get_bondeds(int nrat, t_iatom atoms[], +static void get_bondeds(int nrat, const t_iatom atoms[], at2vsitebond_t *at2vb, int *nrbond, t_mybonded **bonds, int *nrang, t_mybonded **angles, @@ -1001,7 +1001,7 @@ typedef struct { } t_pindex; static void check_vsite_constraints(t_params *plist, - int cftype, int vsite_type[]) + int cftype, const int vsite_type[]) { int i, k, n; int atom; @@ -1029,7 +1029,7 @@ static void check_vsite_constraints(t_params *plist, } static void clean_vsite_bonds(t_params *plist, t_pindex pindex[], - int cftype, int vsite_type[]) + int cftype, const int vsite_type[]) { int ftype, i, j, k, m, n, nvsite, nOut, kept_i; int nconverted, nremoved; @@ -1293,7 +1293,7 @@ static void clean_vsite_bonds(t_params *plist, t_pindex pindex[], } static void clean_vsite_angles(t_params *plist, t_pindex pindex[], - int cftype, int vsite_type[], + int cftype, const int vsite_type[], at2vsitecon_t *at2vc) { int i, j, k, m, n, nvsite, kept_i; @@ -1430,7 +1430,7 @@ static void clean_vsite_angles(t_params *plist, t_pindex pindex[], } static void clean_vsite_dihs(t_params *plist, t_pindex pindex[], - int cftype, int vsite_type[]) + int cftype, const int vsite_type[]) { int i, kept_i; t_params *ps; diff --git a/src/gromacs/imd/imd.cpp b/src/gromacs/imd/imd.cpp index 4e9f85c030..d46848f96b 100644 --- a/src/gromacs/imd/imd.cpp +++ b/src/gromacs/imd/imd.cpp @@ -1094,10 +1094,10 @@ static void init_imd_prepare_mols_in_imdgroup(t_gmx_IMD_setup *IMDsetup, gmx_mto /*! \brief Copied and modified from groupcoord.c shift_positions_group(). */ static void shift_positions( - matrix box, - rvec x[], /* The positions [0..nr] */ - ivec is, /* The shift [0..nr] */ - int nr) /* The number of positions */ + matrix box, + rvec x[], /* The positions [0..nr] */ + const ivec is, /* The shift [0..nr] */ + int nr) /* The number of positions */ { int i, tx, ty, tz; diff --git a/src/gromacs/listed-forces/listed-internal.cpp b/src/gromacs/listed-forces/listed-internal.cpp index ce1dc30038..a753f76cc7 100644 --- a/src/gromacs/listed-forces/listed-internal.cpp +++ b/src/gromacs/listed-forces/listed-internal.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2017, by the GROMACS development team, led by + * Copyright (c) 2014,2017,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. @@ -45,7 +45,7 @@ #include -int glatnr(int *global_atom_index, int i) +int glatnr(const int *global_atom_index, int i) { int atnr; diff --git a/src/gromacs/listed-forces/listed-internal.h b/src/gromacs/listed-forces/listed-internal.h index 0aba630237..1681cdb5e0 100644 --- a/src/gromacs/listed-forces/listed-internal.h +++ b/src/gromacs/listed-forces/listed-internal.h @@ -107,6 +107,6 @@ struct bonded_threading_t * numbers starting at 1. When global_atom_index=NULL returns i+1. */ int -glatnr(int *global_atom_index, int i); +glatnr(const int *global_atom_index, int i); #endif diff --git a/src/gromacs/listed-forces/pairs.cpp b/src/gromacs/listed-forces/pairs.cpp index 01bf6130a4..53984ff786 100644 --- a/src/gromacs/listed-forces/pairs.cpp +++ b/src/gromacs/listed-forces/pairs.cpp @@ -95,7 +95,7 @@ warning_rlimit(const rvec *x, int ai, int aj, int * global_atom_index, real r, r /*! \brief Compute the energy and force for a single pair interaction */ static real -evaluate_single(real r2, real tabscale, real *vftab, real tableStride, +evaluate_single(real r2, real tabscale, const real *vftab, real tableStride, real qq, real c6, real c12, real *velec, real *vvdw) { real rinv, r, rtab, eps, eps2, Y, F, Geps, Heps2, Fp, VVe, FFe, VVd, FFd, VVr, FFr, fscal; @@ -145,11 +145,11 @@ evaluate_single(real r2, real tabscale, real *vftab, real tableStride, /*! \brief Compute the energy and force for a single pair interaction under FEP */ static real free_energy_evaluate_single(real r2, real sc_r_power, real alpha_coul, - real alpha_vdw, real tabscale, real *vftab, real tableStride, + real alpha_vdw, real tabscale, const real *vftab, real tableStride, real qqA, real c6A, real c12A, real qqB, - real c6B, real c12B, real LFC[2], real LFV[2], real DLF[2], - real lfac_coul[2], real lfac_vdw[2], real dlfac_coul[2], - real dlfac_vdw[2], real sigma6_def, real sigma6_min, + real c6B, real c12B, const real LFC[2], const real LFV[2], const real DLF[2], + const real lfac_coul[2], const real lfac_vdw[2], const real dlfac_coul[2], + const real dlfac_vdw[2], real sigma6_def, real sigma6_min, real sigma2_def, real sigma2_min, real *velectot, real *vvdwtot, real *dvdl) { diff --git a/src/gromacs/math/do_fit.cpp b/src/gromacs/math/do_fit.cpp index a846325cf5..b9584d97a2 100644 --- a/src/gromacs/math/do_fit.cpp +++ b/src/gromacs/math/do_fit.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2012,2014,2015,2016,2017,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. @@ -49,7 +49,7 @@ #include "gromacs/utility/fatalerror.h" #include "gromacs/utility/smalloc.h" -real calc_similar_ind(gmx_bool bRho, int nind, int *index, real mass[], +real calc_similar_ind(gmx_bool bRho, int nind, const int *index, const real mass[], rvec x[], rvec xp[]) { int i, j, d; @@ -111,7 +111,7 @@ real rhodev(int natoms, real mass[], rvec x[], rvec xp[]) return calc_similar_ind(TRUE, natoms, nullptr, mass, x, xp); } -void calc_fit_R(int ndim, int natoms, real *w_rls, const rvec *xp, rvec *x, matrix R) +void calc_fit_R(int ndim, int natoms, const real *w_rls, const rvec *xp, rvec *x, matrix R) { int c, r, n, j, i, irot, s; double **omega, **om; diff --git a/src/gromacs/math/do_fit.h b/src/gromacs/math/do_fit.h index 2c73d4538d..980c3b5d16 100644 --- a/src/gromacs/math/do_fit.h +++ b/src/gromacs/math/do_fit.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2010,2014,2015,2016, by the GROMACS development team, led by + * Copyright (c) 2010,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. @@ -45,7 +45,7 @@ extern "C" { #endif -real calc_similar_ind(gmx_bool bRho, int nind, int *index, real mass[], +real calc_similar_ind(gmx_bool bRho, int nind, const int *index, const real mass[], rvec x[], rvec xp[]); /* Returns RMSD or Rho (depending on bRho) over all atoms in index */ @@ -66,7 +66,7 @@ real rhodev(int natoms, real mass[], rvec x[], rvec xp[]); * Maiorov & Crippen, PROTEINS 22, 273 (1995). */ -void calc_fit_R(int ndim, int natoms, real *w_rls, const rvec *xp, rvec *x, +void calc_fit_R(int ndim, int natoms, const real *w_rls, const rvec *xp, rvec *x, matrix R); /* Calculates the rotation matrix R for which * sum_i w_rls_i (xp_i - R x_i).(xp_i - R x_i) diff --git a/src/gromacs/mdlib/calcmu.cpp b/src/gromacs/mdlib/calcmu.cpp index ef8bb89faf..8d04914175 100644 --- a/src/gromacs/mdlib/calcmu.cpp +++ b/src/gromacs/mdlib/calcmu.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2012,2014,2015,2017,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. @@ -47,7 +47,7 @@ #include "gromacs/math/vec.h" #include "gromacs/mdlib/gmx_omp_nthreads.h" -void calc_mu(int start, int homenr, gmx::ArrayRef x, real q[], real qB[], +void calc_mu(int start, int homenr, gmx::ArrayRef x, const real q[], const real qB[], int nChargePerturbed, dvec mu, dvec mu_B) { diff --git a/src/gromacs/mdlib/calcmu.h b/src/gromacs/mdlib/calcmu.h index f33e6af318..aefeb44a9e 100644 --- a/src/gromacs/mdlib/calcmu.h +++ b/src/gromacs/mdlib/calcmu.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2010,2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2010,2014,2015,2017,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. @@ -43,7 +43,7 @@ #include "gromacs/utility/arrayref.h" #include "gromacs/utility/basedefinitions.h" -void calc_mu(int start, int homenr, gmx::ArrayRef x, real q[], real qB[], +void calc_mu(int start, int homenr, gmx::ArrayRef x, const real q[], const real qB[], int nChargePerturbed, dvec mu, dvec mu_B); diff --git a/src/gromacs/mdlib/calcvir.cpp b/src/gromacs/mdlib/calcvir.cpp index 641b116682..f09ced4a52 100644 --- a/src/gromacs/mdlib/calcvir.cpp +++ b/src/gromacs/mdlib/calcvir.cpp @@ -148,8 +148,8 @@ void calc_vir(int nxf, rvec x[], rvec f[], tensor vir, static void lo_fcv(int i0, int i1, - real x[], real f[], tensor vir, - int is[], real box[], gmx_bool bTriclinic) + const real x[], const real f[], tensor vir, + const int is[], const real box[], gmx_bool bTriclinic) { int i, i3, tx, ty, tz; real xx, yy, zz; diff --git a/src/gromacs/mdlib/expanded.cpp b/src/gromacs/mdlib/expanded.cpp index 0fcf17a5d8..9484d757cc 100644 --- a/src/gromacs/mdlib/expanded.cpp +++ b/src/gromacs/mdlib/expanded.cpp @@ -119,7 +119,7 @@ static void GenerateGibbsProbabilities(real *ene, double *p_k, double *pks, int } } -static void GenerateWeightedGibbsProbabilities(real *ene, double *p_k, double *pks, int nlim, real *nvals, real delta) +static void GenerateWeightedGibbsProbabilities(const real *ene, double *p_k, double *pks, int nlim, real *nvals, real delta) { int i; @@ -172,7 +172,7 @@ static void GenerateWeightedGibbsProbabilities(real *ene, double *p_k, double *p sfree(nene); } -static int FindMinimum(real *min_metric, int N) +static int FindMinimum(const real *min_metric, int N) { real min_val; @@ -192,7 +192,7 @@ static int FindMinimum(real *min_metric, int N) return min_nval; } -static gmx_bool CheckHistogramRatios(int nhisto, real *histo, real ratio) +static gmx_bool CheckHistogramRatios(int nhisto, const real *histo, real ratio) { int i; diff --git a/src/gromacs/mdlib/force.cpp b/src/gromacs/mdlib/force.cpp index f37a997a80..788d9bf5ba 100644 --- a/src/gromacs/mdlib/force.cpp +++ b/src/gromacs/mdlib/force.cpp @@ -652,7 +652,7 @@ void destroy_enerdata(gmx_enerdata_t *enerd) } } -static real sum_v(int n, real v[]) +static real sum_v(int n, const real v[]) { real t; int i; diff --git a/src/gromacs/mdlib/groupcoord.cpp b/src/gromacs/mdlib/groupcoord.cpp index b1b6d48c10..e93f2e9ca5 100644 --- a/src/gromacs/mdlib/groupcoord.cpp +++ b/src/gromacs/mdlib/groupcoord.cpp @@ -194,19 +194,19 @@ static void shift_positions_group( * The atom indices are retrieved from anrs_loc[0..nr_loc] * Note that coll_ind[i] = i is needed in the serial case */ extern void communicate_group_positions( - const t_commrec *cr, /* Pointer to MPI communication data */ - rvec *xcoll, /* Collective array of positions */ - ivec *shifts, /* Collective array of shifts for xcoll (can be NULL) */ - ivec *extra_shifts, /* (optional) Extra shifts since last time step */ - const gmx_bool bNS, /* (optional) NS step, the shifts have changed */ - const rvec *x_loc, /* Local positions on this node */ - const int nr, /* Total number of atoms in the group */ - const int nr_loc, /* Local number of atoms in the group */ - int *anrs_loc, /* Local atom numbers */ - int *coll_ind, /* Collective index */ - rvec *xcoll_old, /* (optional) Positions from the last time step, - used to make group whole */ - matrix box) /* (optional) The box */ + const t_commrec *cr, /* Pointer to MPI communication data */ + rvec *xcoll, /* Collective array of positions */ + ivec *shifts, /* Collective array of shifts for xcoll (can be NULL) */ + ivec *extra_shifts, /* (optional) Extra shifts since last time step */ + const gmx_bool bNS, /* (optional) NS step, the shifts have changed */ + const rvec *x_loc, /* Local positions on this node */ + const int nr, /* Total number of atoms in the group */ + const int nr_loc, /* Local number of atoms in the group */ + const int *anrs_loc, /* Local atom numbers */ + const int *coll_ind, /* Collective index */ + rvec *xcoll_old, /* (optional) Positions from the last time step, + used to make group whole */ + matrix box) /* (optional) The box */ { int i; diff --git a/src/gromacs/mdlib/groupcoord.h b/src/gromacs/mdlib/groupcoord.h index a61b3e172b..bdbf8bee30 100644 --- a/src/gromacs/mdlib/groupcoord.h +++ b/src/gromacs/mdlib/groupcoord.h @@ -130,7 +130,7 @@ extern void dd_make_local_group_indices(gmx_ga2la_t *ga2la, extern void communicate_group_positions(const t_commrec *cr, rvec *xcoll, ivec *shifts, ivec *extra_shifts, const gmx_bool bNS, const rvec *x_loc, const int nr, const int nr_loc, - int *anrs_loc, int *coll_ind, rvec *xcoll_old, + const int *anrs_loc, const int *coll_ind, rvec *xcoll_old, matrix box); /*! \brief Calculates the center of the positions x locally. diff --git a/src/gromacs/mdlib/lincs.cpp b/src/gromacs/mdlib/lincs.cpp index 105e6e527c..943327f6fb 100644 --- a/src/gromacs/mdlib/lincs.cpp +++ b/src/gromacs/mdlib/lincs.cpp @@ -2282,7 +2282,7 @@ void set_lincs(const t_idef &idef, //! Issues a warning when LINCS constraints cannot be satisfied. static void lincs_warning(gmx_domdec_t *dd, const rvec *x, rvec *xprime, t_pbc *pbc, - int ncons, int *bla, real *bllen, real wangle, + int ncons, const int *bla, real *bllen, real wangle, int maxwarn, int *warncount) { int b, i, j; diff --git a/src/gromacs/mdlib/mdebin.cpp b/src/gromacs/mdlib/mdebin.cpp index a238548b92..42e8976b45 100644 --- a/src/gromacs/mdlib/mdebin.cpp +++ b/src/gromacs/mdlib/mdebin.cpp @@ -883,7 +883,7 @@ extern FILE *open_dhdl(const char *filename, const t_inputrec *ir, return fp; } -static void copy_energy(t_mdebin *md, real e[], real ecpy[]) +static void copy_energy(t_mdebin *md, const real e[], real ecpy[]) { int i, j; diff --git a/src/gromacs/mdlib/mdebin_bar.cpp b/src/gromacs/mdlib/mdebin_bar.cpp index 1623b4ad7e..c1c359ac54 100644 --- a/src/gromacs/mdlib/mdebin_bar.cpp +++ b/src/gromacs/mdlib/mdebin_bar.cpp @@ -64,7 +64,7 @@ static void mde_delta_h_reset(t_mde_delta_h *dh) static void mde_delta_h_init(t_mde_delta_h *dh, int nbins, double dx, unsigned int ndhmax, int type, int derivative, int nlambda, - double *lambda) + const double *lambda) { int i; diff --git a/src/gromacs/mdlib/membed.cpp b/src/gromacs/mdlib/membed.cpp index 642b678184..b86f7ee757 100644 --- a/src/gromacs/mdlib/membed.cpp +++ b/src/gromacs/mdlib/membed.cpp @@ -513,7 +513,7 @@ static void init_resize(t_block *ins_at, rvec *r_ins, pos_ins_t *pos_ins, mem_t } /* resize performed in the md loop */ -static void resize(rvec *r_ins, rvec *r, pos_ins_t *pos_ins, rvec fac) +static void resize(rvec *r_ins, rvec *r, pos_ins_t *pos_ins, const rvec fac) { int i, j, k, at, c = 0; for (k = 0; k < pos_ins->pieces; k++) diff --git a/src/gromacs/mdlib/nbnxn_search.cpp b/src/gromacs/mdlib/nbnxn_search.cpp index 8c4cefad68..2b1a6bb2fa 100644 --- a/src/gromacs/mdlib/nbnxn_search.cpp +++ b/src/gromacs/mdlib/nbnxn_search.cpp @@ -2632,7 +2632,7 @@ real nbnxn_get_rlist_effective_inc(int cluster_size_j, real atom_density) } /* Estimates the interaction volume^2 for non-local interactions */ -static real nonlocal_vol2(const struct gmx_domdec_zones_t *zones, rvec ls, real r) +static real nonlocal_vol2(const struct gmx_domdec_zones_t *zones, const rvec ls, real r) { real cl, ca, za; real vold_est; diff --git a/src/gromacs/mdlib/nsgrid.cpp b/src/gromacs/mdlib/nsgrid.cpp index 600a944692..447b2535ff 100644 --- a/src/gromacs/mdlib/nsgrid.cpp +++ b/src/gromacs/mdlib/nsgrid.cpp @@ -454,7 +454,7 @@ void ci2xyz(t_grid *grid, int i, int *x, int *y, int *z) *z = ci; } -static int ci_not_used(ivec n) +static int ci_not_used(const ivec n) { /* Return an improbable value */ return xyz2ci(n[YY], n[ZZ], 3*n[XX], 3*n[YY], 3*n[ZZ]); diff --git a/src/gromacs/mdlib/qmmm.cpp b/src/gromacs/mdlib/qmmm.cpp index 3362658873..27886e15f1 100644 --- a/src/gromacs/mdlib/qmmm.cpp +++ b/src/gromacs/mdlib/qmmm.cpp @@ -252,7 +252,7 @@ static t_MMrec *mk_MMrec(void) return mm; } /* mk_MMrec */ -static void init_QMrec(int grpnr, t_QMrec *qm, int nr, int *atomarray, +static void init_QMrec(int grpnr, t_QMrec *qm, int nr, const int *atomarray, gmx_mtop_t *mtop, t_inputrec *ir) { /* fills the t_QMrec struct of QM group grpnr diff --git a/src/gromacs/mdlib/rbin.cpp b/src/gromacs/mdlib/rbin.cpp index 1e0a209e61..d0f49b146d 100644 --- a/src/gromacs/mdlib/rbin.cpp +++ b/src/gromacs/mdlib/rbin.cpp @@ -105,7 +105,7 @@ int add_binr(t_bin *b, gmx::ArrayRef r) return add_binr(b, r.size(), r.data()); } -int add_bind(t_bin *b, int nr, double r[]) +int add_bind(t_bin *b, int nr, const double r[]) { #define MULT 4 int i, rest, index; diff --git a/src/gromacs/mdlib/rbin.h b/src/gromacs/mdlib/rbin.h index 7e3a42f66c..f76b93c9b0 100644 --- a/src/gromacs/mdlib/rbin.h +++ b/src/gromacs/mdlib/rbin.h @@ -59,7 +59,7 @@ void reset_bin(t_bin *b); int add_binr(t_bin *b, int nr, const real r[]); int add_binr(t_bin *b, gmx::ArrayRef r); -int add_bind(t_bin *b, int nr, double r[]); +int add_bind(t_bin *b, int nr, const double r[]); /* Add reals to the bin. Returns index */ void sum_bin(t_bin *b, const t_commrec *cr); diff --git a/src/gromacs/mdlib/repl_ex.cpp b/src/gromacs/mdlib/repl_ex.cpp index b6662b13ae..909587bddc 100644 --- a/src/gromacs/mdlib/repl_ex.cpp +++ b/src/gromacs/mdlib/repl_ex.cpp @@ -585,7 +585,7 @@ static void scale_velocities(t_state *state, real fac) } } -static void print_transition_matrix(FILE *fplog, int n, int **nmoves, int *nattempt) +static void print_transition_matrix(FILE *fplog, int n, int **nmoves, const int *nattempt) { int i, j, ntot; float Tprint; @@ -622,7 +622,7 @@ static void print_transition_matrix(FILE *fplog, int n, int **nmoves, int *natte } } -static void print_ind(FILE *fplog, const char *leg, int n, int *ind, gmx_bool *bEx) +static void print_ind(FILE *fplog, const char *leg, int n, int *ind, const gmx_bool *bEx) { int i; diff --git a/src/gromacs/mdlib/settle.cpp b/src/gromacs/mdlib/settle.cpp index 19a305bea3..767390c24b 100644 --- a/src/gromacs/mdlib/settle.cpp +++ b/src/gromacs/mdlib/settle.cpp @@ -316,7 +316,7 @@ void settle_set_constraints(settledata *settled, } void settle_proj(settledata *settled, ConstraintVariable econq, - int nsettle, t_iatom iatoms[], + int nsettle, const t_iatom iatoms[], const t_pbc *pbc, const rvec x[], rvec *der, rvec *derp, diff --git a/src/gromacs/mdlib/settle.h b/src/gromacs/mdlib/settle.h index 3c7e36afd0..7c7473d4b5 100644 --- a/src/gromacs/mdlib/settle.h +++ b/src/gromacs/mdlib/settle.h @@ -91,7 +91,7 @@ void csettle(settledata *settled, /* The SETTLE structure */ * of coordinates working on settle type constraint. */ void settle_proj(settledata *settled, ConstraintVariable econq, - int nsettle, t_iatom iatoms[], + int nsettle, const t_iatom iatoms[], const t_pbc *pbc, /* PBC data pointer, can be NULL */ const rvec x[], rvec *der, rvec *derp, diff --git a/src/gromacs/mdlib/shake.cpp b/src/gromacs/mdlib/shake.cpp index 43413750dd..b42bf619b8 100644 --- a/src/gromacs/mdlib/shake.cpp +++ b/src/gromacs/mdlib/shake.cpp @@ -435,9 +435,9 @@ void cshake(const int iatom[], int ncon, int *nnit, int maxnit, //! Implements RATTLE (ie. SHAKE for velocity verlet integrators) static void -crattle(int iatom[], int ncon, int *nnit, int maxnit, - real constraint_distance_squared[], real vp[], real rij[], real m2[], real omega, - const real invmass[], real distance_squared_tolerance[], real scaled_lagrange_multiplier[], +crattle(const int iatom[], int ncon, int *nnit, int maxnit, + const real constraint_distance_squared[], real vp[], const real rij[], const real m2[], real omega, + const real invmass[], const real distance_squared_tolerance[], real scaled_lagrange_multiplier[], int *nerror, real invdt) { /* diff --git a/src/gromacs/mdlib/shellfc.cpp b/src/gromacs/mdlib/shellfc.cpp index 26fe9446fc..e14c604103 100644 --- a/src/gromacs/mdlib/shellfc.cpp +++ b/src/gromacs/mdlib/shellfc.cpp @@ -152,7 +152,7 @@ static void pr_shell(FILE *fplog, int ns, t_shell s[]) * removed. */ static void predict_shells(FILE *fplog, rvec x[], rvec v[], real dt, int ns, t_shell s[], - real mass[], gmx_mtop_t *mtop, gmx_bool bInit) + const real mass[], gmx_mtop_t *mtop, gmx_bool bInit) { int i, m, s1, n1, n2, n3; real dt_1, fudge, tm, m1, m2, m3; diff --git a/src/gromacs/mdlib/sim_util.cpp b/src/gromacs/mdlib/sim_util.cpp index 22a58d6b03..893e848163 100644 --- a/src/gromacs/mdlib/sim_util.cpp +++ b/src/gromacs/mdlib/sim_util.cpp @@ -2261,7 +2261,7 @@ void do_constrain_first(FILE *fplog, Constraints *constr, static void -integrate_table(real vdwtab[], real scale, int offstart, int rstart, int rend, +integrate_table(const real vdwtab[], real scale, int offstart, int rstart, int rend, double *enerout, double *virout) { double enersum, virsum; diff --git a/src/gromacs/mdlib/splitter.cpp b/src/gromacs/mdlib/splitter.cpp index 37a44906a5..be752e8bb8 100644 --- a/src/gromacs/mdlib/splitter.cpp +++ b/src/gromacs/mdlib/splitter.cpp @@ -114,7 +114,7 @@ static int mk_grey(egCol egc[], t_graph *g, int *AtomI, return ng; } -static int first_colour(int fC, egCol Col, t_graph *g, egCol egc[]) +static int first_colour(int fC, egCol Col, t_graph *g, const egCol egc[]) /* Return the first node with colour Col starting at fC. * return -1 if none found. */ diff --git a/src/gromacs/mdlib/stat.cpp b/src/gromacs/mdlib/stat.cpp index a84a151015..32fed5d8f1 100644 --- a/src/gromacs/mdlib/stat.cpp +++ b/src/gromacs/mdlib/stat.cpp @@ -89,7 +89,7 @@ void global_stat_destroy(gmx_global_stat_t gs) sfree(gs); } -static int filter_enerdterm(real *afrom, gmx_bool bToBuffer, real *ato, +static int filter_enerdterm(const real *afrom, gmx_bool bToBuffer, real *ato, gmx_bool bTemp, gmx_bool bPres, gmx_bool bEner) { int i, to, from; diff --git a/src/gromacs/mdlib/update.cpp b/src/gromacs/mdlib/update.cpp index 0634b5d5c0..a969baf6b5 100644 --- a/src/gromacs/mdlib/update.cpp +++ b/src/gromacs/mdlib/update.cpp @@ -673,9 +673,9 @@ static void do_update_md(int start, } static void do_update_vv_vel(int start, int nrend, real dt, - rvec accel[], ivec nFreeze[], real invmass[], - unsigned short ptype[], unsigned short cFREEZE[], - unsigned short cACC[], rvec v[], const rvec f[], + rvec accel[], ivec nFreeze[], const real invmass[], + const unsigned short ptype[], const unsigned short cFREEZE[], + const unsigned short cACC[], rvec v[], const rvec f[], gmx_bool bExtended, real veta, real alpha) { int gf = 0, ga = 0; @@ -721,7 +721,7 @@ static void do_update_vv_vel(int start, int nrend, real dt, static void do_update_vv_pos(int start, int nrend, real dt, ivec nFreeze[], - unsigned short ptype[], unsigned short cFREEZE[], + const unsigned short ptype[], const unsigned short cFREEZE[], const rvec x[], rvec xprime[], rvec v[], gmx_bool bExtended, real veta) { @@ -903,11 +903,11 @@ static void doSDUpdateGeneral(gmx_stochd_t *sd, int start, int nrend, real dt, rvec accel[], ivec nFreeze[], - real invmass[], unsigned short ptype[], - unsigned short cFREEZE[], unsigned short cACC[], - unsigned short cTC[], + const real invmass[], const unsigned short ptype[], + const unsigned short cFREEZE[], const unsigned short cACC[], + const unsigned short cTC[], const rvec x[], rvec xprime[], rvec v[], const rvec f[], - gmx_int64_t step, int seed, int *gatindex) + gmx_int64_t step, int seed, const int *gatindex) { if (updateType != SDUpdate::FrictionAndNoiseOnly) { @@ -988,12 +988,12 @@ doSDUpdateGeneral(gmx_stochd_t *sd, static void do_update_bd(int start, int nrend, real dt, ivec nFreeze[], - real invmass[], unsigned short ptype[], - unsigned short cFREEZE[], unsigned short cTC[], + const real invmass[], const unsigned short ptype[], + const unsigned short cFREEZE[], const unsigned short cTC[], const rvec x[], rvec xprime[], rvec v[], const rvec f[], real friction_coefficient, - real *rf, gmx_int64_t step, int seed, - int* gatindex) + const real *rf, gmx_int64_t step, int seed, + const int* gatindex) { /* note -- these appear to be full step velocities . . . */ int gf = 0, gt = 0; diff --git a/src/gromacs/mdlib/vcm.cpp b/src/gromacs/mdlib/vcm.cpp index 16a0c2b412..7d10937e68 100644 --- a/src/gromacs/mdlib/vcm.cpp +++ b/src/gromacs/mdlib/vcm.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -120,7 +120,7 @@ t_vcm *init_vcm(FILE *fp, gmx_groups_t *groups, const t_inputrec *ir) return vcm; } -static void update_tensor(rvec x, real m0, tensor I) +static void update_tensor(const rvec x, real m0, tensor I) { real xy, xz, yz; diff --git a/src/gromacs/mdrunutility/threadaffinity.cpp b/src/gromacs/mdrunutility/threadaffinity.cpp index c0a96bf819..5495da474e 100644 --- a/src/gromacs/mdrunutility/threadaffinity.cpp +++ b/src/gromacs/mdrunutility/threadaffinity.cpp @@ -263,7 +263,7 @@ get_thread_affinity_layout(const gmx::MDLogger &mdlog, } static bool set_affinity(const t_commrec *cr, int nthread_local, int intraNodeThreadOffset, - int offset, int core_pinning_stride, int *localityOrder, + int offset, int core_pinning_stride, const int *localityOrder, gmx::IThreadAffinityAccess *affinityAccess) { // Set the per-thread affinity. In order to be able to check the success diff --git a/src/gromacs/pbcutil/mshift.cpp b/src/gromacs/pbcutil/mshift.cpp index 236848fcdc..f0ff01ab08 100644 --- a/src/gromacs/pbcutil/mshift.cpp +++ b/src/gromacs/pbcutil/mshift.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2017,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. @@ -88,7 +88,7 @@ static void add_gbond(t_graph *g, int a0, int a1) static void mk_igraph(t_graph *g, int ftype, const t_ilist *il, int at_start, int at_end, - int *part) + const int *part) { t_iatom *ia; int i, j, np; @@ -504,7 +504,7 @@ void done_graph(t_graph *g) ************************************************************/ static void mk_1shift_tric(int npbcdim, const matrix box, const rvec hbox, - const rvec xi, const rvec xj, int *mi, int *mj) + const rvec xi, const rvec xj, const int *mi, int *mj) { /* Calculate periodicity for triclinic box... */ int m, d; @@ -542,7 +542,7 @@ static void mk_1shift_tric(int npbcdim, const matrix box, const rvec hbox, } static void mk_1shift(int npbcdim, const rvec hbox, const rvec xi, const rvec xj, - int *mi, int *mj) + const int *mi, int *mj) { /* Calculate periodicity for rectangular box... */ int m; @@ -572,7 +572,7 @@ static void mk_1shift(int npbcdim, const rvec hbox, const rvec xi, const rvec xj } static void mk_1shift_screw(const matrix box, const rvec hbox, - const rvec xi, const rvec xj, int *mi, int *mj) + const rvec xi, const rvec xj, const int *mi, int *mj) { /* Calculate periodicity for rectangular box... */ int signi, m; @@ -698,7 +698,7 @@ static int mk_grey(egCol egc[], t_graph *g, int *AtomI, return ng; } -static int first_colour(int fC, egCol Col, t_graph *g, egCol egc[]) +static int first_colour(int fC, egCol Col, t_graph *g, const egCol egc[]) /* Return the first node with colour Col starting at fC. * return -1 if none found. */ diff --git a/src/gromacs/pulling/pull.cpp b/src/gromacs/pulling/pull.cpp index 947f2df117..5054b38d15 100644 --- a/src/gromacs/pulling/pull.cpp +++ b/src/gromacs/pulling/pull.cpp @@ -1948,7 +1948,7 @@ void dd_make_local_pull_groups(const t_commrec *cr, struct pull_t *pull, t_mdato static void init_pull_group_index(FILE *fplog, const t_commrec *cr, int g, pull_group_work_t *pg, - gmx_bool bConstraint, ivec pulldim_con, + gmx_bool bConstraint, const ivec pulldim_con, const gmx_mtop_t *mtop, const t_inputrec *ir, real lambda) { diff --git a/src/gromacs/pulling/pull_rotation.cpp b/src/gromacs/pulling/pull_rotation.cpp index 1296be0e29..a3411b06a5 100644 --- a/src/gromacs/pulling/pull_rotation.cpp +++ b/src/gromacs/pulling/pull_rotation.cpp @@ -594,7 +594,7 @@ static inline real gaussian_weight(rvec curr_x, t_rotgrp *rotg, int n) /* Returns the weight in a single slab, also calculates the Gaussian- and mass- * weighted sum of positions for that slab */ -static real get_slab_weight(int j, t_rotgrp *rotg, rvec xc[], real mc[], rvec *x_weighted_sum) +static real get_slab_weight(int j, t_rotgrp *rotg, rvec xc[], const real mc[], rvec *x_weighted_sum) { rvec curr_x; /* The position of an atom */ rvec curr_x_weighted; /* The gaussian-weighted position */ @@ -1281,13 +1281,13 @@ static void weigh_coords(rvec* str, real* weight, int natoms) static real opt_angle_analytic( - rvec* ref_s, - rvec* act_s, - real* weight, - int natoms, - rvec ref_com, - rvec act_com, - rvec axis) + rvec * ref_s, + rvec * act_s, + real * weight, + int natoms, + const rvec ref_com, + const rvec act_com, + rvec axis) { int i, j, k; rvec *ref_s_1 = nullptr; diff --git a/src/gromacs/selection/sm_compare.cpp b/src/gromacs/selection/sm_compare.cpp index 94704d32d6..84263f84f0 100644 --- a/src/gromacs/selection/sm_compare.cpp +++ b/src/gromacs/selection/sm_compare.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017,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. @@ -182,7 +182,7 @@ gmx_ana_selmethod_t sm_compare = { * \ref CMP_INVALID is returned. */ static e_comparison_t -comparison_type(char *str) +comparison_type(const char *str) { switch (str[0]) { diff --git a/src/gromacs/statistics/statistics.cpp b/src/gromacs/statistics/statistics.cpp index 2e9fbc1b80..ac62fce847 100644 --- a/src/gromacs/statistics/statistics.cpp +++ b/src/gromacs/statistics/statistics.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2012,2014,2015,2017,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. @@ -681,7 +681,7 @@ int lsq_y_ax(int n, real x[], real y[], real *a) return ok; } -static int low_lsq_y_ax_b(int n, real *xr, double *xd, real yr[], +static int low_lsq_y_ax_b(int n, const real *xr, const double *xd, real yr[], real *a, real *b, real *r, real *chi2) { gmx_stats_t lsq = gmx_stats_init(); diff --git a/src/gromacs/swap/swapcoords.cpp b/src/gromacs/swap/swapcoords.cpp index 7edbd04ef1..2cf9b33c42 100644 --- a/src/gromacs/swap/swapcoords.cpp +++ b/src/gromacs/swap/swapcoords.cpp @@ -288,11 +288,11 @@ static void print_ionlist( * reference atom and determine the center with respect to this reference. */ static void get_molecule_center( - rvec x[], - int nat, - real *weights, - rvec center, - t_pbc *pbc) + rvec x[], + int nat, + const real *weights, + rvec center, + t_pbc *pbc) { int i; rvec weightedPBCimage; @@ -1338,10 +1338,10 @@ static real getRequestedChargeImbalance(t_swap *s) * of which the indices were lumped together in the older version of the code. */ static void copyIndicesToGroup( - int *indIons, - int nIons, - t_swapGroup *g, - t_commrec *cr) + const int *indIons, + int nIons, + t_swapGroup *g, + t_commrec *cr) { g->nat = nIons; diff --git a/src/gromacs/tables/forcetable.cpp b/src/gromacs/tables/forcetable.cpp index 6b2a87692f..0d4d73ca65 100644 --- a/src/gromacs/tables/forcetable.cpp +++ b/src/gromacs/tables/forcetable.cpp @@ -383,7 +383,7 @@ real ewald_spline3_table_scale(const interaction_const_t *ic) } static void copy2table(int n, int offset, int stride, - double x[], double Vtab[], double Ftab[], real scalefactor, + const double x[], const double Vtab[], const double Ftab[], real scalefactor, real dest[]) { /* Use double prec. for the intermediary variables @@ -434,7 +434,7 @@ static void init_table(int n, int nx0, } } -static void spline_forces(int nx, double h, double v[], gmx_bool bS3, gmx_bool bE3, +static void spline_forces(int nx, double h, const double v[], gmx_bool bS3, gmx_bool bE3, double f[]) { int start, end, i; diff --git a/src/gromacs/tools/convert_tpr.cpp b/src/gromacs/tools/convert_tpr.cpp index 242a1a76cc..4dd517ecd2 100644 --- a/src/gromacs/tools/convert_tpr.cpp +++ b/src/gromacs/tools/convert_tpr.cpp @@ -94,7 +94,7 @@ static int *invind(int gnx, int natoms, int index[]) return inv; } -static void reduce_block(gmx_bool bKeep[], t_block *block, +static void reduce_block(const gmx_bool bKeep[], t_block *block, const char *name) { int *index; @@ -125,7 +125,7 @@ static void reduce_block(gmx_bool bKeep[], t_block *block, block->nr = newi; } -static void reduce_blocka(int invindex[], gmx_bool bKeep[], t_blocka *block, +static void reduce_blocka(const int invindex[], const gmx_bool bKeep[], t_blocka *block, const char *name) { int *index, *a; @@ -161,7 +161,7 @@ static void reduce_blocka(int invindex[], gmx_bool bKeep[], t_blocka *block, block->nra = newj; } -static void reduce_rvec(int gnx, int index[], rvec vv[]) +static void reduce_rvec(int gnx, const int index[], rvec vv[]) { rvec *ptr; int i; @@ -178,7 +178,7 @@ static void reduce_rvec(int gnx, int index[], rvec vv[]) sfree(ptr); } -static void reduce_atom(int gnx, int index[], t_atom atom[], char ***atomname, +static void reduce_atom(int gnx, const int index[], t_atom atom[], char ***atomname, int *nres, t_resinfo *resinfo) { t_atom *ptr; @@ -218,7 +218,7 @@ static void reduce_atom(int gnx, int index[], t_atom atom[], char ***atomname, sfree(rinfo); } -static void reduce_ilist(int invindex[], gmx_bool bKeep[], +static void reduce_ilist(const int invindex[], const gmx_bool bKeep[], t_ilist *il, int nratoms, const char *name) { t_iatom *ia; @@ -306,7 +306,7 @@ static void reduce_topology_x(int gnx, int index[], mtop->natoms = top.atoms.nr; } -static void zeroq(int index[], gmx_mtop_t *mtop) +static void zeroq(const int index[], gmx_mtop_t *mtop) { for (gmx_moltype_t &moltype : mtop->moltype) { diff --git a/src/gromacs/topology/atomprop.cpp b/src/gromacs/topology/atomprop.cpp index 693d7d8bb5..d4bffefe6e 100644 --- a/src/gromacs/topology/atomprop.cpp +++ b/src/gromacs/topology/atomprop.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2017,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. @@ -80,7 +80,7 @@ enum { /* return number of matching characters, or NOTFOUND if not at least all characters in char *database match */ -static int dbcmp_len(char *search, char *database) +static int dbcmp_len(const char *search, const char *database) { int i; diff --git a/src/gromacs/topology/index.cpp b/src/gromacs/topology/index.cpp index 3d3b87a4b8..c5bc7beb35 100644 --- a/src/gromacs/topology/index.cpp +++ b/src/gromacs/topology/index.cpp @@ -113,7 +113,7 @@ void write_index(const char *outf, t_blocka *b, char **gnames, gmx_bool bDuplica gmx_ffclose(out); } -void add_grp(t_blocka *b, char ***gnames, int nra, int a[], const char *name) +void add_grp(t_blocka *b, char ***gnames, int nra, const int a[], const char *name) { int i; @@ -132,7 +132,7 @@ void add_grp(t_blocka *b, char ***gnames, int nra, int a[], const char *name) /* compare index in `a' with group in `b' at `index', when `index'<0 it is relative to end of `b' */ -static gmx_bool grp_cmp(t_blocka *b, int nra, int a[], int index) +static gmx_bool grp_cmp(t_blocka *b, int nra, const int a[], int index) { int i; @@ -734,7 +734,7 @@ void analyse(const t_atoms *atoms, t_blocka *gb, char ***gn, gmx_bool bASK, gmx_ } -void check_index(char *gname, int n, int index[], char *traj, int natoms) +void check_index(const char *gname, int n, int index[], const char *traj, int natoms) { int i; diff --git a/src/gromacs/topology/index.h b/src/gromacs/topology/index.h index 504b6c4deb..f1c18a5a0c 100644 --- a/src/gromacs/topology/index.h +++ b/src/gromacs/topology/index.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2010,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2010,2014,2015,2016,2017,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. @@ -48,8 +48,8 @@ extern "C" { struct t_atoms; struct t_blocka; -void check_index(char *gname, int n, int index[], - char *traj, int natoms); +void check_index(const char *gname, int n, int index[], + const char *traj, int natoms); /* Checks if any index is smaller than zero or larger than natoms, * if so a fatal_error is given with the gname (if gname=NULL, "Index" is used) * and traj (if traj=NULL, "the trajectory" is used). @@ -95,7 +95,7 @@ t_cluster_ndx *cluster_index(FILE *fplog, const char *ndx); void write_index(const char *outf, struct t_blocka *b, char **gnames, gmx_bool bDuplicate, int natoms); /* Writes index blocks to outf (writes an indexfile) */ -void add_grp(struct t_blocka *b, char ***gnames, int nra, int a[], const char *name); +void add_grp(struct t_blocka *b, char ***gnames, int nra, const int a[], const char *name); /* Ads group a with name name to block b and namelist gnames */ void analyse(const t_atoms *atoms, struct t_blocka *gb, char ***gn, diff --git a/src/gromacs/trajectoryanalysis/modules/sasa.cpp b/src/gromacs/trajectoryanalysis/modules/sasa.cpp index 1b655851f6..cad893791f 100644 --- a/src/gromacs/trajectoryanalysis/modules/sasa.cpp +++ b/src/gromacs/trajectoryanalysis/modules/sasa.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2006, The GROMACS development team. - * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by + * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,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. @@ -196,7 +196,7 @@ void do_conect(const char *fn, int n, rvec x[]) /*! \brief * Plots the surface into a PDB file, optionally including the original atoms. */ -void connolly_plot(const char *fn, int ndots, real dots[], rvec x[], t_atoms *atoms, +void connolly_plot(const char *fn, int ndots, const real dots[], rvec x[], t_atoms *atoms, t_symtab *symtab, int ePBC, const matrix box, gmx_bool bIncludeSolute) { const char *const atomnm = "DOT"; -- 2.22.0