clang-tidy: readability-non-const-parameter (2/2)
authorRoland Schulz <roland.schulz@intel.com>
Sun, 20 May 2018 20:28:38 +0000 (13:28 -0700)
committerMark Abraham <mark.j.abraham@gmail.com>
Sun, 1 Jul 2018 19:33:21 +0000 (21:33 +0200)
Automatic fix-it

Change-Id: I574696fc8595855438802af81112e04b3312b8c2

158 files changed:
src/gromacs/CMakeLists.txt
src/gromacs/analysisdata/modules/histogram.cpp
src/gromacs/analysisdata/modules/histogram.h
src/gromacs/analysisdata/modules/plot.cpp
src/gromacs/analysisdata/modules/plot.h
src/gromacs/correlationfunctions/crosscorr.cpp
src/gromacs/correlationfunctions/expfit.cpp
src/gromacs/correlationfunctions/expfit.h
src/gromacs/correlationfunctions/gmx_lmcurve.cpp
src/gromacs/domdec/domdec.cpp
src/gromacs/domdec/domdec.h
src/gromacs/domdec/domdec_topology.cpp
src/gromacs/domdec/redistribute.cpp
src/gromacs/essentialdynamics/edsam.cpp
src/gromacs/ewald/ewald.cpp
src/gromacs/ewald/long-range-correction.cpp
src/gromacs/ewald/long-range-correction.h
src/gromacs/ewald/pme-gather.cpp
src/gromacs/ewald/pme-gather.h
src/gromacs/ewald/pme-grid.cpp
src/gromacs/ewald/pme-grid.h
src/gromacs/ewald/pme-redistribute.cpp
src/gromacs/ewald/pme-spread.cpp
src/gromacs/ewald/pme.cpp
src/gromacs/fft/fft5d.cpp
src/gromacs/fft/parallel_3dfft.cpp
src/gromacs/fft/parallel_3dfft.h
src/gromacs/fileio/enxio.cpp
src/gromacs/fileio/espio.cpp
src/gromacs/fileio/espio.h
src/gromacs/fileio/libxdrf.cpp
src/gromacs/fileio/matio.cpp
src/gromacs/fileio/pdbio.cpp
src/gromacs/gmxana/anadih.cpp
src/gromacs/gmxana/binsearch.cpp
src/gromacs/gmxana/binsearch.h
src/gromacs/gmxana/dens_filter.cpp
src/gromacs/gmxana/dens_filter.h
src/gromacs/gmxana/fitahx.cpp
src/gromacs/gmxana/gmx_anaeig.cpp
src/gromacs/gmxana/gmx_analyze.cpp
src/gromacs/gmxana/gmx_bar.cpp
src/gromacs/gmxana/gmx_bundle.cpp
src/gromacs/gmxana/gmx_chi.cpp
src/gromacs/gmxana/gmx_cluster.cpp
src/gromacs/gmxana/gmx_confrms.cpp
src/gromacs/gmxana/gmx_current.cpp
src/gromacs/gmxana/gmx_density.cpp
src/gromacs/gmxana/gmx_densorder.cpp
src/gromacs/gmxana/gmx_dielectric.cpp
src/gromacs/gmxana/gmx_dipoles.cpp
src/gromacs/gmxana/gmx_disre.cpp
src/gromacs/gmxana/gmx_do_dssp.cpp
src/gromacs/gmxana/gmx_dyndom.cpp
src/gromacs/gmxana/gmx_editconf.cpp
src/gromacs/gmxana/gmx_energy.cpp
src/gromacs/gmxana/gmx_genion.cpp
src/gromacs/gmxana/gmx_gyrate.cpp
src/gromacs/gmxana/gmx_h2order.cpp
src/gromacs/gmxana/gmx_hbond.cpp
src/gromacs/gmxana/gmx_hydorder.cpp
src/gromacs/gmxana/gmx_make_edi.cpp
src/gromacs/gmxana/gmx_make_ndx.cpp
src/gromacs/gmxana/gmx_mdmat.cpp
src/gromacs/gmxana/gmx_mindist.cpp
src/gromacs/gmxana/gmx_mk_angndx.cpp
src/gromacs/gmxana/gmx_nmr.cpp
src/gromacs/gmxana/gmx_order.cpp
src/gromacs/gmxana/gmx_pme_error.cpp
src/gromacs/gmxana/gmx_potential.cpp
src/gromacs/gmxana/gmx_rmsdist.cpp
src/gromacs/gmxana/gmx_rmsf.cpp
src/gromacs/gmxana/gmx_sham.cpp
src/gromacs/gmxana/gmx_sorient.cpp
src/gromacs/gmxana/gmx_spol.cpp
src/gromacs/gmxana/gmx_traj.cpp
src/gromacs/gmxana/gmx_trjconv.cpp
src/gromacs/gmxana/gmx_tune_pme.cpp
src/gromacs/gmxana/gmx_velacc.cpp
src/gromacs/gmxana/gmx_wham.cpp
src/gromacs/gmxana/gmx_xpm2ps.cpp
src/gromacs/gmxana/gstat.h
src/gromacs/gmxana/hxprops.cpp
src/gromacs/gmxana/hxprops.h
src/gromacs/gmxana/nrama.cpp
src/gromacs/gmxana/nsfactor.cpp
src/gromacs/gmxana/nsfactor.h
src/gromacs/gmxana/princ.cpp
src/gromacs/gmxana/princ.h
src/gromacs/gmxana/sfactor.cpp
src/gromacs/gmxana/sfactor.h
src/gromacs/gmxana/thermochemistry.cpp
src/gromacs/gmxana/thermochemistry.h
src/gromacs/gmxlib/conformation-utilities.cpp
src/gromacs/gmxlib/conformation-utilities.h
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsall.cpp
src/gromacs/gmxlib/nrnb.cpp
src/gromacs/gmxpreprocess/add_par.cpp
src/gromacs/gmxpreprocess/add_par.h
src/gromacs/gmxpreprocess/convparm.cpp
src/gromacs/gmxpreprocess/gen_ad.cpp
src/gromacs/gmxpreprocess/gen_maxwell_velocities.cpp
src/gromacs/gmxpreprocess/gen_vsite.cpp
src/gromacs/gmxpreprocess/genconf.cpp
src/gromacs/gmxpreprocess/genhydro.cpp
src/gromacs/gmxpreprocess/grompp.cpp
src/gromacs/gmxpreprocess/hizzie.cpp
src/gromacs/gmxpreprocess/pdb2gmx.cpp
src/gromacs/gmxpreprocess/pdb2top.cpp
src/gromacs/gmxpreprocess/pdb2top.h
src/gromacs/gmxpreprocess/topio.cpp
src/gromacs/gmxpreprocess/topshake.cpp
src/gromacs/gmxpreprocess/vsite_parm.cpp
src/gromacs/imd/imd.cpp
src/gromacs/listed-forces/listed-internal.cpp
src/gromacs/listed-forces/listed-internal.h
src/gromacs/listed-forces/pairs.cpp
src/gromacs/math/do_fit.cpp
src/gromacs/math/do_fit.h
src/gromacs/mdlib/calcmu.cpp
src/gromacs/mdlib/calcmu.h
src/gromacs/mdlib/calcvir.cpp
src/gromacs/mdlib/expanded.cpp
src/gromacs/mdlib/force.cpp
src/gromacs/mdlib/groupcoord.cpp
src/gromacs/mdlib/groupcoord.h
src/gromacs/mdlib/lincs.cpp
src/gromacs/mdlib/mdebin.cpp
src/gromacs/mdlib/mdebin_bar.cpp
src/gromacs/mdlib/membed.cpp
src/gromacs/mdlib/nbnxn_search.cpp
src/gromacs/mdlib/nsgrid.cpp
src/gromacs/mdlib/qmmm.cpp
src/gromacs/mdlib/rbin.cpp
src/gromacs/mdlib/rbin.h
src/gromacs/mdlib/repl_ex.cpp
src/gromacs/mdlib/settle.cpp
src/gromacs/mdlib/settle.h
src/gromacs/mdlib/shake.cpp
src/gromacs/mdlib/shellfc.cpp
src/gromacs/mdlib/sim_util.cpp
src/gromacs/mdlib/splitter.cpp
src/gromacs/mdlib/stat.cpp
src/gromacs/mdlib/update.cpp
src/gromacs/mdlib/vcm.cpp
src/gromacs/mdrunutility/threadaffinity.cpp
src/gromacs/pbcutil/mshift.cpp
src/gromacs/pulling/pull.cpp
src/gromacs/pulling/pull_rotation.cpp
src/gromacs/selection/sm_compare.cpp
src/gromacs/statistics/statistics.cpp
src/gromacs/swap/swapcoords.cpp
src/gromacs/tables/forcetable.cpp
src/gromacs/tools/convert_tpr.cpp
src/gromacs/topology/atomprop.cpp
src/gromacs/topology/index.cpp
src/gromacs/topology/index.h
src/gromacs/trajectoryanalysis/modules/sasa.cpp

index 24ba0d1a6166491f22e3eb606a092cefaf3696c3..149236a4171c1e70b377b7023c557a8c794759f4 100644 (file)
@@ -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()
 
index 1a1d1cb610609fd858254c3703e51e31e3890b51..932f9e7dae6f498467d625dce6a8e4c0e2fe7d2c 100644 (file)
@@ -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)
     {
index 43a4b72b68fdaa7c88254f83d84a87c54e00a2e4..a3bb56ed748484874d9d95e2ffdb270412a55aaa 100644 (file)
@@ -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.
          *
index c80a5bba386379618be33126efa255967680ebe8..fa8a49558f8a5ebf4bc3e5ba574b45b3916d7814 100644 (file)
@@ -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)
     {
index 5887c080c8266366b30128340b5d57b96cb08950..dfc5c8ac79e6d6cba2c8f7b3f5c67a857cc00c9c 100644 (file)
@@ -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);
 
index 22291ee132ee0e9bd902458b3a0e89b4be1fc876..d757fba9fb67d9fd25b62079fa1e123d7f8e0193 100644 (file)
@@ -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);
index 81334b45b3471068459ce6da7595557fc58726b5..61070fbee6e55c91208b5dc938bfe8b95ad582a6 100644 (file)
@@ -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)
index 76aab9332398eb0656f7ac192705c00c8e81f6d8..e18fa13826ad579607852892f84921a8c7a5c3e4 100644 (file)
@@ -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);
index 8b3870e958dda3a06bd374188df77849fdf28f26..9745e807b831ba1559a2f079a195cd3c7121db7f 100644 (file)
@@ -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)
index b3ef12b770e8e8c8e49ec1460387a2b80384cacd..cbd0dc214ce3a3671246aea95811abc2ea685ffa 100644 (file)
@@ -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<int> index_gl,
-                             int  *recv_i,
+                             const int  *recv_i,
                              rvec *cg_cm,    rvec *recv_vr,
                              gmx::ArrayRef<int> 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<int>     *localAtomGroups,
                    dd_comm_setup_work_t *work)
 {
index 3cf2726a7c0ec8ee1ba96d8db0cd77ff58070661..83120c9280c2f860fe9fa54f9cf81a6dabae0615 100644 (file)
@@ -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,
index 6bb38470b5c3a2239929f086982e1e86068fc0c3..647d58f06f83e641de3182de6a8369b60f1e3d0d 100644 (file)
@@ -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,
index 8afc95d8f9376fae1fab88a76e648d4e1cd77f2d..6f913b1a6f62e235ee05f238093f0590f5f63a33 100644 (file)
@@ -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,
index 05e6560540ac3ccc01fb0bb661cc516d4125b8b6..d68a981bdc15a579dfb5102b7c1e1994fa9a876b 100644 (file)
@@ -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;
index e27d793e5fa5bf9b402afe4ac8785515545d58c6..92603997b3c9e193db5dce791bd093087b37bd62 100644 (file)
@@ -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;
 
index da0eaef89c120b566e09938e6042e971dbc09904..96c529a5475ca17acafc79a83e984d9a20ce79ce 100644 (file)
@@ -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,
index 617a0bfac0c9b75ce2325073e8d09fa69e237077..37108de07f06d48aaf6c78194c168738696725f4 100644 (file)
@@ -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,
index e9c5c0d8935697f254c46f9c8a140e33ea0bb4bb..000f24929b2a7d745e6e89f173a43ae7e6595956 100644 (file)
@@ -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;
index fdee72a41b1ab71b6e4ddf2083b769a5adf6818f..864eda3be218f6aba195afcce8b02298cfe576ee 100644 (file)
@@ -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
index dcf2a06c3cc624a15b3e362bd18e82faf033580b..a2a0dfaff072a00207ccde2a44343cd28bda086a 100644 (file)
@@ -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;
index 73e16b968f26825a3188c0d90d6119bfc169730f..f86199759580fea40d420ec5f64961ccb6e486d8 100644 (file)
@@ -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,
index 82407d4c648ad759afdb25dc62d401eb0644e6be..045646a4ad4cad7b103a3e9636672fdad0f8bda3 100644 (file)
@@ -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;
index 62c9862dd61ee2423bd7e0665bff854587bd4647..e77c7910d939f7419f5cfc4725dc58e003ecb73e 100644 (file)
@@ -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 */
index 1f5691f7fb2894207a5e27066bbaea4855260349..0bd225d7dfe92787bbac0328ea7d4151344f16f6 100644 (file)
@@ -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;
 
index d25178fc776b81f1f730bacb5a7e162b2a3425ba..83a155ec813ef9c524a14cdd2c18197946ae13b1 100644 (file)
@@ -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;
index c218f4f28453ad99ef9d7b5883afbdad11107e28..64f97b6b9942574d7cea98ce2ce9120255b4c6fd 100644 (file)
@@ -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 */
index 0104fe833e63e5f004e4e7ae213c378d3e250d91..8f0002399d34e810eff4e9ddd709e21128c915f7 100644 (file)
@@ -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],
index d3661e47a5e869f511410cef066a6615b8536c4b..1b3d358ef810912b3dd4c6c9da0e9dd5842d5f5d 100644 (file)
@@ -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;
index 34eaa711b3aedd51f4864ec1aa067ce2224b748e..f254eb0459663af64bab5fabf2e441bc814b97d9 100644 (file)
@@ -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;
index 3de1138bcdaaad4bbb01505c05e94d0e66631e87..bcbee55cb3d089d5861ab7e4872f346a9d980b6a 100644 (file)
@@ -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
index a87b1df66cb908ad3fb5850d8c132e5b89e7baa7..8b8cc023615cd7238a21fb132b382be62ab53349 100644 (file)
@@ -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;
index 26c1a06e36870f0ffd13a96948423ddf880f8b02..c125394cf95172427e1667f9e148cad4706e34fd 100644 (file)
@@ -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,
index d6c7579199759b7517429e5fca7df086e2a1d568..761d1723d1fa18739134552e6dfff5b646312086 100644 (file)
@@ -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;
index c71466757dd6f59fc48a2de4cddb82baa109a4c5..5fa6873fc1dd4b74404c924ee525f7feae5bb2e7 100644 (file)
@@ -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;
index d30d16bc72087abfa2bee548e8453b12a88d6d40..b9b9b93a81b9e4dce9caa83b90b5716ec84b6791 100644 (file)
@@ -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*/
index 24cf8f465bf1f7f295cb8c7ab8258172f04ad925..df6054da4f5d3c4a9781b8a4cffb3e2d063b35a0 100644 (file)
@@ -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
index fbe045b4827084fbd4965fffb6ff46db6d04bf0f..01e0a604eb6c49c858d1405be2f662feb02eef25 100644 (file)
@@ -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;
index acbc23ae156d09474e162d16da974650bb4bcb3b..396a378034f49f0f73384cd58d7de2d6163ccfca 100644 (file)
@@ -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
index dc6f581d074bbb1ac991b8698e73d3e4374d4de8..2d828082a3170bbb5075ce245ffda2408e16d6a7 100644 (file)
@@ -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;
 
index 1f912ceaff0af0d65b0074679d6b1fa28ebe5619..09a4fac4f84c29af229a53827114d5bc22be7117 100644 (file)
@@ -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)
 {
index 4cb6ecf364b03947d1d21d55267765166e263c5e..d2ff834b159a02adb29eddd942c4154c5468ff0d 100644 (file)
@@ -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))
index 86f17f7c0199b071e880b1798dadcdebba4b44ab..b51e938323b94ea0878b0dd37c21523f606a35f6 100644 (file)
@@ -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;
index 286e67a57d007ea3e2ed53d57a08b29a4af43ca3..ce5da3b7d155ddc2eb72ac070a7d3ddb9e70d811 100644 (file)
@@ -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;
index 8c293f9334c24bb398a40cd4d4893ad5ff178bbc..35adac367f932a87030e9022555b5a54e5377eda 100644 (file)
@@ -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,
index f0b82f8f048dcb2cc471c3925f72747e8518c234..119891485750584f1474c4cd95064d9f5237f4ff 100644 (file)
@@ -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;
index 81623973234cd00f1b791aa3f826f699ca392164..4b08985406206317022b708bd8eaef14bb886726 100644 (file)
@@ -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;
 
index 3c80befdc366ab5f572f2cff00cbdcd7c8900b9d..fd6c082ae809e82fc72ccc0388457275b79c8993 100644 (file)
@@ -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;
index 60ed9b3fb0978835217caa774b18017ab2f1def4..918ebd6c4e7cfee8bbef47f4ec7a6a50e0a6bd40 100644 (file)
@@ -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,
index 74c4fd7a449754862b281ca775e5fc0070c11be7..8fb14e1a98e1fce467e6ec75ceccc8d26d770f35 100644 (file)
@@ -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)
 
 {
 /*
index e6ba83d90e47a3524fc2f0f4f38cf5bfcf071379..adc6469451875290b728ec8d65062555b8cfa600 100644 (file)
@@ -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;
index b3f237bf08fd0e12cce750e36355df99fbd49d62..00333c9094b38ecb877bbbf0c3c25f7b8b926a28 100644 (file)
@@ -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;
index de2731492e4ca7a2ddf8f21657161a132b71294e..29eedead116f0c3f64546b2d839bac6c4ae41c52 100644 (file)
@@ -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;
index a8aab1bc21c1734db7b7b0a47c0d119ffbc53d00..0ac6b72760de39ccf8079ae08df360bdd8e556f3 100644 (file)
@@ -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;
 
index 720496b637bc30dd7a9a600502427736907e900c..55219d814194e463a6a52cf1f646884fcbb02a7f 100644 (file)
@@ -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;
index 7e0198bb8225f761bfdaacab54d722de1d39a9d2..176a334a139c9d5421ce15cd56517f05c65ee232 100644 (file)
@@ -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;
index 3ae3480feb838007d55f5cf466fbe7b915ba0f6b..ec8d33d62f211bd967ec6b40994be9c8b679ff65 100644 (file)
@@ -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)
 {
index c74701d5ae4a6e3dc1b50ba9f1c11b5df60efe10..176090e4a896c8ffaa0d483061a8651c845c0582 100644 (file)
@@ -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)
 {
index 50ec5bee3b111b20d7fb3107e45280fdb319e318..567854e5744a49f7ce8f8a2a1413584d4cdd4cae 100644 (file)
@@ -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;
index 85492b7ac710d00d8c9117e538f1ba782b597805..9a092248741a3060578195c35fa8f970c17c82fa 100644 (file)
@@ -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,
index 87b31fbdaea67c4c389200ede0bde58d58552d17..08a7a8cf7b0f9fc8cddf7c16f7b56d32cc8fc652 100644 (file)
@@ -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;
index e5554dbafc96b1eeb6c8d6dd44bf178f6ab54664..312a70a57e8664e3fbf715b204999d495e577465 100644 (file)
@@ -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)
index 4a8e521762fe7d2ee9eab6abd36f14793be6a43d..821748c7889f416868ed3e881fe15495e77d9e2f 100644 (file)
@@ -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
  */
index cfe5ebaeb58fe3c11f71b60b1bf4056ab330983e..2fe4ba63248366a8b25570c2c0791c7c07df3c9a 100644 (file)
@@ -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;
 
index f59673d35b353fa483189ccb659fbef984341eb8..9603303c7164f356f2b1e95e78cfdb7056cec913 100644 (file)
@@ -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;
index 7035b3be468aac40eefe4655ee5d64be850839f7..8f9e57b06fbed0f9f8cf85090ea239c14fc32af3 100644 (file)
@@ -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;
index 0609897bd22badcf2555a879f6cd0821e297e5ae..f9dee1e3e318ef56008299e303ee13c617957dd9 100644 (file)
@@ -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;
index 28fe1de444bc3f6f21986234f02fda7467498953..035ab0eb11c39427ba60a7f6108adb18117e68e2 100644 (file)
@@ -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;
index 3316f3e0f8c9666e01cb8f0b16262f64203d2433..fe804b62e6c61357c4a8346bd23a5d5b8c223c7e 100644 (file)
@@ -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*/
index 9a50a498ca64e4ff3e7e21d0fda1526d29288117..92f05df19bcdd5f07ed5cdfc876d42e084823297 100644 (file)
@@ -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*/
index dadda8fa0a97f9aebac30cad7c158772d4425a1c..40cb12033eec278bded765e6071d5b75e09682ca 100644 (file)
@@ -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;
index 5e3704925b7c224d5b541df9647f5a4820e6f47c..6431b17e2ab84d42732f9d38cf368ce1158da3cb 100644 (file)
@@ -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;
index b70a673b80511cd88f26ddfe82c1f934bb604504..87af428628997f67cbf0bcd6b11e133388747839 100644 (file)
@@ -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;
index b7806994df34e9b470fb796ab7cc91cae82f2812..46793e090124ec62e1298cde6474d01d0f871327 100644 (file)
 #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;
index 90f440c5d4a6d0bba432c1a530b467c24988b178..2a88186f8bf92ebb64f1e82af4600e18de705e28 100644 (file)
@@ -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;
index ed62da7c5d94cf82fb396e64404c68631e033d4a..8894887353402dc8b76e0bf3fa5d6ebf1bed3008 100644 (file)
@@ -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;
index 0289165fe22155c8c2d64bf903f97e370aa312c6..fc28be140f510b868b09a7afc59e50f863f33e25 100644 (file)
@@ -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;
index 2f780885125b00a0a482d370dbd93b5c8f88f232..f62d901983f00c2c60324973cd83e18ee2031177 100644 (file)
@@ -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;
index 9947077818c4fe4f292ead1eb9180198d8f9bb10..066ee653fbfe046236c0380ff6b7f3933b2d6df4 100644 (file)
@@ -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;
index 5cbd55bb47c9c24e9a1dd0c43c7051f616ecf007..f9b9f07120309a25dbb7755112823f5307d161fb 100644 (file)
@@ -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;
index 46c39ca92cbd5aebc2d64fa2759c6ae792c4ff55..5e39155df8215961766bdf89cbbad49c89a5cc26 100644 (file)
@@ -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;
 
index f15f0955e38ade0963fde7fc73c4641b147089b4..507366702824d3df7bcff6fa0c1926db8cb687d4 100644 (file)
@@ -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;
index f9c8e8e7d10f7f37ff867399f53cd3c295074d2e..8959b01446d6c9cc7a0b5224863fb3c4130876c9 100644 (file)
@@ -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
 }
index 9c6d7aea0a09b7951e7febf03d70b8ab29a10d41..667c8f456ffd43d45e1242168622b987b2a01bdc 100644 (file)
@@ -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;
index 88de40811cbb4af95529ecf9f30fffc15212e7aa..e079ebe15e86169f258dd06a4d7115f5bac8bc39 100644 (file)
@@ -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,
index 36dcc8a9b1b933f6d13f29d1c46dbe536ad4a7ad..b721117b2abacea35562b004875f2dc66d512aee 100644 (file)
@@ -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;
index d05c9b616212e6f0d12a948c477bd41618f54e79..647d5deb0af4cea38dde91d2439dab69d5fa6286 100644 (file)
@@ -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;
index 949d42922b3238d9a82a60cc95f6b8b5433c234d..d8550cdd112d9121ac20621e3096ff1f2d34fc85 100644 (file)
@@ -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);
 
index e7da5b98efa0364983fa4bd67ef7e2ca7409065d..4f8e9af8f2fffe2a98daed63c0940ba69e5115af 100644 (file)
@@ -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;
 
index 426fefb57b82f99af1e1a9677ee3591e1981344d..e89b05327bea26a53805f92f02db8f085d317fad 100644 (file)
@@ -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
index c0f7e44ee0f8229c81367fafb3fb2327230556ae..3a67fd11e1ac0d445331e462c47d15df76e7ff49 100644 (file)
@@ -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 */
 {
index 8c1bb45177f13ff557c30ccb30f7f244808a2c3a..e1ad7604153c15c5ae670bc30a41406d10a2cb05 100644 (file)
@@ -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,
index e3d14381018c705904be131ab079842448a7b45f..8327b378e7e9079ea1d68098983f37ee96843b91 100644 (file)
@@ -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");
index 68d9c8ea251bc371f5e7e56663b3be549d79d73c..5874f172c934fdddbe81f8c643b9b92d20a230b2 100644 (file)
@@ -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
  *
index d5fe1e0ad187bf1850a950c71913fb8ea677b6e4..5f93fd7573172eda4259af3bc819fc2cd5c9ec8d 100644 (file)
@@ -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;
index 0fbe271f04714d0cc2eb649bf2c689d1d2f3d0de..65abf50464ac0d7f24695165a5db3bcbec0f9b5c 100644 (file)
@@ -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
index f20c65f6f669405eeaf7db2d1710c48cfa4eef95..2b88ee7b8fa109101d2c69be17cfd72ff9d68146 100644 (file)
@@ -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;
index ba5ec1da26525a10d2abfb9ad3d5fa58018cbf6a..a9bd5e861d44db7c39a65d2507a55a7d75067203 100644 (file)
@@ -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;
index 96cf768664d28ff62c5e5e5e0ef06b442808532f..e5a884ed1afcf6f7216cbf5bb38fd998b033738c 100644 (file)
@@ -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;
 
index 925a321f598a82318baf5caa1c6db8d2cedbf367..dbdd58cac46dcd8fb44ef278799049aea1d92a68 100644 (file)
@@ -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);
index 7dc03d1e6d6fe5516143190bd3dea174e208dece..a092887605075859961e416412898c7e0866d564 100644 (file)
@@ -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;
 
index fe26641bc2863ff9af52c4d7a6581aa1267d57a6..090390bd8db4df8ba8fe3a4638b4317ae4cb99a7 100644 (file)
@@ -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;
 
index 350e1ad95176a82c4f356cf4e4cd1e7e346be393..6192ca8b8579d2653726c50ba71b219c60b8b2f0 100644 (file)
@@ -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;
index 80349aaed3af712fcf1fb82889e804b18d08612c..69d78151626535ef814d5fbb767ddceb8b8bde99 100644 (file)
@@ -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;
 
index 1c0275bc8cbaa4e7a38bd12b4311ac1e28f807a8..4e67d0ea895cf3e7e9135d233f73fc574307d211 100644 (file)
@@ -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;
index bec357639dfb47ef82b474ede7bea02c7267bfaf..5fca3ba6b4f7d219ae25b8306d6231f1bfbe3ef7 100644 (file)
@@ -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;
 
index 3307448b1b978626873a67cdbebd42a273f8c0ef..d8dc2bda92bbb9e378532cbc403202dea9dbcf90 100644 (file)
@@ -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;
 
index 5dfbe4947beb5d61a45a85927ac0b3bd7e0fcf83..7a6e9282f6e6d2fbc9e9e733c765d5921903144a 100644 (file)
@@ -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;
index b8a870e58c60914ea3231c1cc7f8b48e4a53cc50..29c28bdf6aab9c248e172a27be81c703e5bcb557 100644 (file)
@@ -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)
 {
index 83406af20617424a2de71c0f8c84bb7a442ac005..e275d694be0d62699931799cf86fdd76a96a25c5 100644 (file)
@@ -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;
index 810514cfb7a0fbd8135c0a4c4473c366b0a8d934..782b1e9388313136ad8d9fc39a61b018912ccc3e 100644 (file)
@@ -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);
index 32106323da8a9ccfc7c1ab771a37b876361fa039..0e529d1c16ee1d407b0a9c3626438a7fde312e59 100644 (file)
@@ -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. */
index bf0537ddaf7d1dfe658d87cbc3bd2997986e8f51..854c42234017bed2c65db7a16716d28e5e344625 100644 (file)
@@ -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;
 
index 0ce5b9a8ba629a2cd7822193eb6641fb9bb3cfab..7c4162eb82db3bace69bf29eed1cbeeb3b2202a2 100644 (file)
@@ -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;
index 4e9f85c030157989b9c6f27e6422909827c929c1..d46848f96b380e3623027e6a58fa17a9c927fe01 100644 (file)
@@ -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;
 
index ce1dc3003828c0546cb4f5a3644434b4db63995c..a753f76cc7325823e53d6298748254b3ca28e455 100644 (file)
@@ -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 <cstdlib>
 
-int glatnr(int *global_atom_index, int i)
+int glatnr(const int *global_atom_index, int i)
 {
     int atnr;
 
index 0aba630237f44f3e2f7b917708e257e6b905e2d6..1681cdb5e0181cc744f7c854716e9551b84d209d 100644 (file)
@@ -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
index 01bf6130a45b3e001e9a86b45825ba42db7a4e2e..53984ff786482ccd14d45f98e36c56d71905fd3b 100644 (file)
@@ -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)
 {
index a846325cf53d33a7df633147e1808dcb42aa2512..b9584d97a281d4b33347b8926b12b26dd196d2a9 100644 (file)
@@ -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;
index 2c73d4538d9951fb975c0ba9ae3b20f91f0b5d41..980c3b5d16a79bebfb6b5b73754265e8d584c4de 100644 (file)
@@ -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)
index ef8bb89fafa7b214f502e1b288149f382a6a7949..8d04914175f2f2e058da9a52352d6ca08bf9ee3f 100644 (file)
@@ -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<gmx::RVec> x, real q[], real qB[],
+void calc_mu(int start, int homenr, gmx::ArrayRef<gmx::RVec> x, const real q[], const real qB[],
              int nChargePerturbed,
              dvec mu, dvec mu_B)
 {
index f33e6af3189dd8fe071c8a313496eb05f5e3390e..aefeb44a9ec1a81ebfd44742588cecfc2b0ee4f5 100644 (file)
@@ -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<gmx::RVec> x, real q[], real qB[],
+void calc_mu(int start, int homenr, gmx::ArrayRef<gmx::RVec> x, const real q[], const real qB[],
              int nChargePerturbed,
              dvec mu, dvec mu_B);
 
index 641b116682a93849f915eca91e9f14e3333afb93..f09ced4a52e4653133ec266cb0c141383f4782ac 100644 (file)
@@ -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;
index 0fcf17a5d805f5124ce1a26aa4ac78e2c69c5a44..9484d757cc4b24eace79560d3fcfa5834fd5a28b 100644 (file)
@@ -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;
index f37a997a808d92ac063cdb7362c5eaa5706b33cd..788d9bf5bac91e919089e9531175f90b2ed63219 100644 (file)
@@ -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;
index b1b6d48c107f9bf59b8769da96613912ca1bde3c..e93f2e9ca5bbe0a373d4416901ef6f3b1da7618a 100644 (file)
@@ -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;
 
index a61b3e172b440ae5ab96d046c62d3e902d4d6df2..bdbf8bee30aea76b107e8788b314d10357a00ce9 100644 (file)
@@ -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.
index 105e6e527cd5a9c931412760d427dc00a295ed35..943327f6fb8fad765f4d5f3ce400dbc10b0a8cc9 100644 (file)
@@ -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;
index a238548b92939248df2bd9b599357c1b21544790..42e8976b45ff62a83e748164c9f1fbe2e1dda834 100644 (file)
@@ -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;
 
index 1623b4ad7e93898943e2d6fafccaa33975b276ab..c1c359ac54a9b094cc1e722e94c97ee0e4fa0cd8 100644 (file)
@@ -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;
 
index 642b6781845fd516be885306bb8e39736f8eecfa..b86f7ee757cf759b7650a3f0e60ccea7f6ac804e 100644 (file)
@@ -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++)
index 8c4cefad68b1b39f61234668c6effcbc670d27e1..2b1a6bb2fa27772060534f40247c25b793b2ee1f 100644 (file)
@@ -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;
index 600a944692b31dc8ccf8553fa88c952e2d237c53..447b2535ffcc6bbd216b6cdf499c8f9fd9cf54d9 100644 (file)
@@ -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]);
index 3362658873f11481693dc3a6659d7a9293a25c5d..27886e15f19ae6e535111a2d2f217d2a8dfa3e75 100644 (file)
@@ -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
index 1e0a209e61112b85d3b5f192560168bdebeaeef4..d0f49b146d35a8cfcc7560fa130c9e72350ea8b5 100644 (file)
@@ -105,7 +105,7 @@ int add_binr(t_bin *b, gmx::ArrayRef<const real> 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;
index 7e3a42f66c61183dd5a4d81d249e34f42ea02b3c..f76b93c9b0250ef55ec2e367404c273400acc293 100644 (file)
@@ -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<const real> 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);
index b6662b13ae74c31cba41a55867d8fcc997d40685..909587bddc088df961c532f48af5b0b4945bd47e 100644 (file)
@@ -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;
 
index 19a305bea3af3cc34ccbfab08be5465c982cbf85..767390c24b993f6a43a6df076ea3816d24e73890 100644 (file)
@@ -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,
index 3c7e36afd0d4a807a66d62b60e619bdb5530f135..7c7473d4b561e03db71eb795e1b882c4cb7a8bfd 100644 (file)
@@ -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,
index 43413750dd5e6e6803ddd41e319b1513853bf0fb..b42bf619b8bb85d8399427508f3e7808db8e1238 100644 (file)
@@ -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)
 {
     /*
index 26fe9446fca96be167de912f005019db12517e1c..e14c604103fc0ba87315c8cc118b5f889096f7da 100644 (file)
@@ -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;
index 22a58d6b032af5cede89547eb86fa6d5b4f8e1d1..893e848163709566bb7804efba9f921671152466 100644 (file)
@@ -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;
index 37a44906a5f1caf5ee6f03b3206b7efed8f864d1..be752e8bb8c674964ce8eb54b198db53867c3c02 100644 (file)
@@ -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.
  */
index a84a151015f7e19d86c8bbe7a3b2edd36d2f1ff8..32fed5d8f107570879405a7ec39a0bbcea325b91 100644 (file)
@@ -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;
index 0634b5d5c017a2b96c4f6eb8178a3bac9eeac098..a969baf6b56aaf905b5f9fd64fa9602172b3cecb 100644 (file)
@@ -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;
index 16a0c2b41265d675b294e0928b0cc712f023e913..7d10937e68e19f076f0d92692bb1277407e2bd16 100644 (file)
@@ -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;
 
index c0a96bf819069af9f25d7f3905c43057c830fb8e..5495da474e3edef8b9d5af98add109bb5f7c4b6c 100644 (file)
@@ -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
index 236848fcdc3523976f855406a3b23cd67eebf9a1..f0ff01ab08fc90be11efb1ca9ccd3be497c38709 100644 (file)
@@ -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.
  */
index 947f2df1179b3fa8c16a4b4a3abac41d7c0aad9f..5054b38d15565edcc3b36293cbfbdd6f9a45f546 100644 (file)
@@ -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)
 {
index 1296be0e2992fa61f7907de5a18ac805b03c01a8..a3411b06a5460dd180e8af4efee4c414d86b1f47 100644 (file)
@@ -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;
index 94704d32d647f4ebf2bf48a7eb5af5cc61f44f45..84263f84f0a0a0a4ca703cf454f7cf455135f874 100644 (file)
@@ -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])
     {
index 2e9fbc1b8020201664bded23612d1d6cd63ab62f..ac62fce847d17632e3d896fa796df54aea6850a4 100644 (file)
@@ -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();
index 7edbd04ef1baf46d3e95e0fdbbe72f0c179994c5..2cf9b33c426c7b8fc44df2749e905a1b814ca0bb 100644 (file)
@@ -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;
 
index 6b2a87692f0f2a80fc0855c5dac040da396da023..0d4d73ca6532f096c822869308a52a1345f96479 100644 (file)
@@ -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;
index 242a1a76cca1a8ce6e5f4094a287348e8e1b6f74..4dd517ecd28088ecdf45d38af02428668695b5ec 100644 (file)
@@ -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)
     {
index 693d7d8bb5776cd00f445236c52789762d98a7b1..d4bffefe6e7483fbdf422da732a8cf4dd9ee654f 100644 (file)
@@ -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;
 
index 3d3b87a4b863b46a2f8a28a5780f0c03658197cf..c5bc7beb35deb14c0ddc6b4b95560d17d6e3d6c3 100644 (file)
@@ -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;
 
index 504b6c4deb6b5310d3f10bc5bb4e4e02c898e7bb..f1c18a5a0c2d171ee285816844a584798dde454c 100644 (file)
@@ -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,
index 1b655851f66d22ef24a9572b217a14afbeb5bdfe..cad893791f292c85947441befc75571f5c6e1805 100644 (file)
@@ -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";