From 2b9cbcb80c367a00867a2f5d9674834dba17f4b4 Mon Sep 17 00:00:00 2001 From: Roland Schulz Date: Thu, 24 Aug 2017 18:26:34 -0700 Subject: [PATCH] Enable missing declarations warning Change-Id: I055e12554e40fea43d37590ea3989d0a8fbe732d --- cmake/gmxCFlags.cmake | 4 +- .../gtest/include/gtest/gtest-param-test.h | 2 +- src/gromacs/correlationfunctions/autocorr.cpp | 6 +- src/gromacs/domdec/domdec_constraints.cpp | 1 + src/gromacs/ewald/pme-gather.cpp | 2 + src/gromacs/fileio/pdbio.cpp | 2 +- src/gromacs/fileio/tests/confio.cpp | 2 +- src/gromacs/fileio/tpxio.cpp | 4 +- src/gromacs/gmxana/binsearch.cpp | 6 +- src/gromacs/gmxana/edittop.cpp | 219 ------------------ src/gromacs/gmxana/gmx_analyze.cpp | 4 +- src/gromacs/gmxana/gmx_bar.cpp | 4 +- src/gromacs/gmxana/gmx_chi.cpp | 10 +- src/gromacs/gmxana/gmx_cluster.cpp | 28 +-- src/gromacs/gmxana/gmx_confrms.cpp | 22 +- src/gromacs/gmxana/gmx_density.cpp | 42 ++-- src/gromacs/gmxana/gmx_dielectric.cpp | 10 +- src/gromacs/gmxana/gmx_dipoles.cpp | 8 +- src/gromacs/gmxana/gmx_disre.cpp | 2 +- src/gromacs/gmxana/gmx_do_dssp.cpp | 8 +- src/gromacs/gmxana/gmx_editconf.cpp | 24 +- src/gromacs/gmxana/gmx_genion.cpp | 6 +- src/gromacs/gmxana/gmx_gyrate.cpp | 10 +- src/gromacs/gmxana/gmx_h2order.cpp | 14 +- src/gromacs/gmxana/gmx_lie.cpp | 4 +- src/gromacs/gmxana/gmx_make_edi.cpp | 30 +-- src/gromacs/gmxana/gmx_make_ndx.cpp | 2 +- src/gromacs/gmxana/gmx_mdmat.cpp | 4 +- src/gromacs/gmxana/gmx_mindist.cpp | 18 +- src/gromacs/gmxana/gmx_msd.cpp | 28 +-- src/gromacs/gmxana/gmx_order.cpp | 20 +- src/gromacs/gmxana/gmx_potential.cpp | 24 +- src/gromacs/gmxana/gmx_principal.cpp | 2 +- src/gromacs/gmxana/gmx_rmsdist.cpp | 2 +- src/gromacs/gmxana/gmx_rmsf.cpp | 6 +- src/gromacs/gmxana/gmx_sigeps.cpp | 6 +- src/gromacs/gmxana/gmx_spol.cpp | 2 +- src/gromacs/gmxana/gmx_trjconv.cpp | 4 +- src/gromacs/gmxana/gmx_wham.cpp | 130 +++++------ src/gromacs/gmxana/gmx_wheel.cpp | 4 +- src/gromacs/gmxana/gmx_xpm2ps.cpp | 72 +++--- src/gromacs/gmxana/powerspect.cpp | 4 +- src/gromacs/gmxlib/nonbonded/nb_kernel.cpp | 9 - src/gromacs/gmxpreprocess/add_par.cpp | 2 + src/gromacs/gmxpreprocess/gen_ad.cpp | 2 +- src/gromacs/gmxpreprocess/genhydro.cpp | 2 +- src/gromacs/gmxpreprocess/grompp.cpp | 8 +- src/gromacs/gmxpreprocess/hackblock.cpp | 2 +- src/gromacs/gmxpreprocess/hizzie.cpp | 4 +- src/gromacs/gmxpreprocess/hizzie.h | 5 +- src/gromacs/gmxpreprocess/pdb2gmx.cpp | 20 +- src/gromacs/gmxpreprocess/pdb2top.cpp | 2 +- src/gromacs/gmxpreprocess/readir.cpp | 6 +- src/gromacs/gmxpreprocess/resall.cpp | 8 +- src/gromacs/gmxpreprocess/ter_db.cpp | 2 +- src/gromacs/gmxpreprocess/topio.cpp | 6 +- src/gromacs/gmxpreprocess/toppush.cpp | 2 +- src/gromacs/gmxpreprocess/toputil.cpp | 8 +- src/gromacs/gmxpreprocess/x2top.cpp | 24 +- src/gromacs/gpu_utils/ocl_compiler.cpp | 4 +- src/gromacs/gpu_utils/oclutils.cpp | 10 +- src/gromacs/listed-forces/bonded.cpp | 18 +- src/gromacs/listed-forces/pairs.cpp | 4 +- src/gromacs/mdlib/clincs.cpp | 2 +- src/gromacs/mdlib/expanded.cpp | 31 +-- src/gromacs/mdlib/genborn.cpp | 12 +- src/gromacs/mdlib/mdebin_bar.cpp | 2 +- src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu | 7 +- src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h | 53 +++++ .../mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu | 8 +- src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl.cpp | 22 +- .../mdlib/nbnxn_ocl/nbnxn_ocl_data_mgmt.cpp | 22 +- src/gromacs/mdlib/ns.cpp | 2 +- src/gromacs/mdlib/nsgrid.cpp | 6 +- src/gromacs/mdlib/qm_orca.cpp | 10 +- src/gromacs/mdlib/qm_orca.h | 47 ++++ src/gromacs/mdlib/qmmm.cpp | 24 +- src/gromacs/mdlib/shakef.cpp | 14 +- src/gromacs/mdlib/sim_util.cpp | 70 +++--- src/gromacs/selection/sm_compare.cpp | 1 + src/gromacs/swap/swapcoords.cpp | 6 +- src/gromacs/timing/wallcycle.cpp | 8 +- src/gromacs/tools/check.cpp | 10 +- src/gromacs/tools/convert_tpr.cpp | 2 + src/gromacs/tools/dump.cpp | 8 +- src/gromacs/utility/futil.cpp | 2 +- src/programs/mdrun/membed.cpp | 2 +- src/programs/mdrun/tests/energyreader.cpp | 4 +- src/programs/mdrun/tests/termination.cpp | 4 +- src/programs/mdrun/tests/trajectoryreader.cpp | 4 +- src/programs/view/fgrid.cpp | 4 +- src/programs/view/molps.cpp | 4 +- src/programs/view/nleg.cpp | 4 +- src/programs/view/nmol.cpp | 10 +- src/programs/view/popup.cpp | 4 +- src/programs/view/view.cpp | 2 + src/programs/view/xdlg.cpp | 2 +- src/programs/view/xmb.cpp | 2 +- src/testutils/refdata-checkers.h | 4 +- 99 files changed, 586 insertions(+), 783 deletions(-) delete mode 100644 src/gromacs/gmxana/edittop.cpp create mode 100644 src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h create mode 100644 src/gromacs/mdlib/qm_orca.h diff --git a/cmake/gmxCFlags.cmake b/cmake/gmxCFlags.cmake index 4df62a8ee4..a1703625dd 100644 --- a/cmake/gmxCFlags.cmake +++ b/cmake/gmxCFlags.cmake @@ -133,7 +133,7 @@ macro (gmx_c_flags) GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-Wall" GMXC_CXXFLAGS) # Problematic with CUDA # GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EFFCXX "-Wnon-virtual-dtor" GMXC_CXXFLAGS) - GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith" GMXC_CXXFLAGS) + GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith -Wmissing-declarations" GMXC_CXXFLAGS) # CUDA versions prior to 7.5 come with a header (math_functions.h) which uses the _MSC_VER macro # unconditionally, so we don't use -Wundef for earlier CUDA versions. if(NOT(GMX_GPU AND CUDA_VERSION VERSION_LESS "7.5")) @@ -313,7 +313,7 @@ GMX_TEST_CFLAG(CFLAGS_WARN "/W3 /wd177 /wd411 /wd593 /wd981 /wd1418 /wd1419 /wd1 endif() if (GMX_COMPILER_WARNINGS) GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-Wall" GMXC_CXXFLAGS) - GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith" GMXC_CXXFLAGS) + GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith -Wmissing-prototypes" GMXC_CXXFLAGS) GMX_TEST_CXXFLAG(CXXFLAGS_DEPRECATED "-Wdeprecated" GMXC_CXXFLAGS) endif() endif() diff --git a/src/external/gmock-1.7.0/gtest/include/gtest/gtest-param-test.h b/src/external/gmock-1.7.0/gtest/include/gtest/gtest-param-test.h index d6702c8f16..40c6648f4f 100644 --- a/src/external/gmock-1.7.0/gtest/include/gtest/gtest-param-test.h +++ b/src/external/gmock-1.7.0/gtest/include/gtest/gtest-param-test.h @@ -1404,7 +1404,7 @@ internal::CartesianProductHolder10 \ + static ::testing::internal::ParamGenerator \ gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ int gtest_##prefix##test_case_name##_dummy_ = \ ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ diff --git a/src/gromacs/correlationfunctions/autocorr.cpp b/src/gromacs/correlationfunctions/autocorr.cpp index 22b1ad04c7..b61ad45bc5 100644 --- a/src/gromacs/correlationfunctions/autocorr.cpp +++ b/src/gromacs/correlationfunctions/autocorr.cpp @@ -244,7 +244,7 @@ static void do_ac_core(int nframes, int nout, } /*! \brief Routine to normalize ACF, dividing by corr[0]. */ -void normalize_acf(int nout, real corr[]) +static void normalize_acf(int nout, real corr[]) { int j; double c0; @@ -285,7 +285,7 @@ void normalize_acf(int nout, real corr[]) } /*! \brief Routine that averages ACFs. */ -void average_acf(gmx_bool bVerbose, int n, int nitem, real **c1) +static void average_acf(gmx_bool bVerbose, int n, int nitem, real **c1) { real c0; int i, j; @@ -307,7 +307,7 @@ void average_acf(gmx_bool bVerbose, int n, int nitem, real **c1) } /*! \brief Normalize ACFs. */ -void norm_and_scale_vectors(int nframes, real c1[], real scale) +static void norm_and_scale_vectors(int nframes, real c1[], real scale) { int j, m; real *rij; diff --git a/src/gromacs/domdec/domdec_constraints.cpp b/src/gromacs/domdec/domdec_constraints.cpp index 299b6e21c4..c20440a276 100644 --- a/src/gromacs/domdec/domdec_constraints.cpp +++ b/src/gromacs/domdec/domdec_constraints.cpp @@ -66,6 +66,7 @@ #include "gromacs/utility/smalloc.h" #include "domdec_specatomcomm.h" +#include "domdec_vsite.h" #include "hash.h" /*! \brief Struct used during constraint setup with domain decomposition */ diff --git a/src/gromacs/ewald/pme-gather.cpp b/src/gromacs/ewald/pme-gather.cpp index 28f715fc8c..fe8d3d11ca 100644 --- a/src/gromacs/ewald/pme-gather.cpp +++ b/src/gromacs/ewald/pme-gather.cpp @@ -37,6 +37,8 @@ #include "gmxpre.h" +#include "pme-gather.h" + #include "gromacs/math/vec.h" #include "gromacs/simd/simd.h" #include "gromacs/utility/basedefinitions.h" diff --git a/src/gromacs/fileio/pdbio.cpp b/src/gromacs/fileio/pdbio.cpp index a07a1549af..d6c7579199 100644 --- a/src/gromacs/fileio/pdbio.cpp +++ b/src/gromacs/fileio/pdbio.cpp @@ -426,7 +426,7 @@ void write_pdbfile(FILE *out, const char *title, const t_atoms *atoms, const rve sfree(index); } -int line2type(char *line) +static int line2type(char *line) { int k; char type[8]; diff --git a/src/gromacs/fileio/tests/confio.cpp b/src/gromacs/fileio/tests/confio.cpp index c544689f71..23e8f91a39 100644 --- a/src/gromacs/fileio/tests/confio.cpp +++ b/src/gromacs/fileio/tests/confio.cpp @@ -65,7 +65,7 @@ /*! \brief * Google Test formatter for GromacsFileType values. */ -void PrintTo(const GromacsFileType &ftp, std::ostream *os) +static void PrintTo(const GromacsFileType &ftp, std::ostream *os) { *os << "'" << ftp2ext(ftp) << "'"; } diff --git a/src/gromacs/fileio/tpxio.cpp b/src/gromacs/fileio/tpxio.cpp index ea75ea6eb6..d6f6975140 100644 --- a/src/gromacs/fileio/tpxio.cpp +++ b/src/gromacs/fileio/tpxio.cpp @@ -1755,8 +1755,8 @@ static void do_harm(t_fileio *fio, t_iparams *iparams) gmx_fio_do_real(fio, iparams->harmonic.krB); } -void do_iparams(t_fileio *fio, t_functype ftype, t_iparams *iparams, - gmx_bool bRead, int file_version) +static void do_iparams(t_fileio *fio, t_functype ftype, t_iparams *iparams, + gmx_bool bRead, int file_version) { int idum; real rdum; diff --git a/src/gromacs/gmxana/binsearch.cpp b/src/gromacs/gmxana/binsearch.cpp index 74f1514265..d30d16bc72 100644 --- a/src/gromacs/gmxana/binsearch.cpp +++ b/src/gromacs/gmxana/binsearch.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2010,2011,2013,2014,2015,2016, by the GROMACS development team, led by + * Copyright (c) 2010,2011,2013,2014,2015,2016,2017, 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. @@ -51,7 +51,7 @@ void rangeArray(int *ar, int size) } } -void pswap(int *v1, int *v2) +static void pswap(int *v1, int *v2) { int temp; temp = *v1; @@ -60,7 +60,7 @@ void pswap(int *v1, int *v2) } -void Swap (real *v1, real *v2) +static void Swap (real *v1, real *v2) { real temp; temp = *v1; diff --git a/src/gromacs/gmxana/edittop.cpp b/src/gromacs/gmxana/edittop.cpp deleted file mode 100644 index 41e7acb790..0000000000 --- a/src/gromacs/gmxana/edittop.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/* - * This file is part of the GROMACS molecular simulation package. - * - * 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 - * 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. - * - * GROMACS is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * GROMACS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GROMACS; if not, see - * http://www.gnu.org/licenses, or write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * If you want to redistribute modifications to GROMACS, please - * consider that scientific software is very special. Version - * control is crucial - bugs must be traceable. We will be happy to - * consider code for inclusion in the official distribution, but - * derived work must not be called official GROMACS. Details are found - * in the README & COPYING files - if they are missing, get the - * official version at http://www.gromacs.org. - * - * To help us fund GROMACS development, we humbly ask that you cite - * the research papers on the package. Check out http://www.gromacs.org. - */ -#include "gmxpre.h" - -#include "gromacs/topology/ifunc.h" -#include "gromacs/topology/symtab.h" -#include "gromacs/topology/topology.h" -#include "gromacs/utility/fatalerror.h" -#include "gromacs/utility/smalloc.h" - -void replace_atom(t_topology *top, int inr, char *anm, char *resnm, - real q, real m, int type) -{ - t_atoms *atoms; - - atoms = &(top->atoms); - - /* Replace important properties of an atom by other properties */ - if ((inr < 0) || (inr > atoms->nr)) - { - gmx_fatal(FARGS, "Replace_atom: inr (%d) not in %d .. %d", inr, 0, atoms->nr); - } - if (debug) - { - fprintf(debug, "Replacing atom %d ... ", inr); - } - /* Charge, mass and type */ - atoms->atom[inr].q = atoms->atom[inr].qB = q; - atoms->atom[inr].m = atoms->atom[inr].mB = m; - atoms->atom[inr].type = atoms->atom[inr].typeB = type; - - /* Residue name */ - atoms->resinfo[atoms->atom[inr].resind].name = put_symtab(&top->symtab, resnm); - /* Atom name */ - atoms->atomname[inr] = put_symtab(&top->symtab, anm); - if (debug) - { - fprintf(debug, " done\n"); - } -} - -static void delete_from_interactions(t_idef *idef, int inr) -{ - int i, j, k, nra, nnr; - t_iatom *niatoms; - gmx_bool bDel; - - /* Delete interactions including atom inr from lists */ - for (i = 0; (i < F_NRE); i++) - { - nra = interaction_function[i].nratoms; - nnr = 0; - snew(niatoms, idef->il[i].nr); - for (j = 0; (j < idef->il[i].nr); j += nra+1) - { - bDel = FALSE; - for (k = 0; (k < nra); k++) - { - if (idef->il[i].iatoms[j+k+1] == inr) - { - bDel = TRUE; - } - } - if (!bDel) - { - /* If this does not need to be deleted, then copy it to temp array */ - for (k = 0; (k < nra+1); k++) - { - niatoms[nnr+k] = idef->il[i].iatoms[j+k]; - } - nnr += nra+1; - } - } - /* Copy temp array back */ - for (j = 0; (j < nnr); j++) - { - idef->il[i].iatoms[j] = niatoms[j]; - } - idef->il[i].nr = nnr; - sfree(niatoms); - } -} - -static void delete_from_block(t_block *block, int inr) -{ - /* Update block data structure */ - int i, i1, j; - - for (i = 0; (i < block->nr); i++) - { - for (j = block->index[i]; (j < block->index[i+1]); j++) - { - if (j == inr) - { - /* This atom has to go */ - /* Change indices too */ - for (i1 = i+1; (i1 <= block->nr); i1++) - { - block->index[i1]--; - } - } - } - } -} - -static void delete_from_blocka(t_blocka *block, int inr) -{ - /* Update block data structure */ - int i, i1, j1, j, k; - - for (i = 0; (i < block->nr); i++) - { - for (j = block->index[i]; (j < block->index[i+1]); j++) - { - k = block->a[j]; - if (k == inr) - { - /* This atom has to go */ - for (j1 = j; (j1 < block->nra-1); j1++) - { - block->a[j1] = block->a[j1+1]; - } - block->nra--; - /* Change indices too */ - for (i1 = i+1; (i1 <= block->nr); i1++) - { - block->index[i1]--; - } - } - } - } -} - -static void delete_from_atoms(t_atoms *atoms, int inr) -{ - int i; - - /* Shift the atomnames down */ - for (i = inr; (i < atoms->nr-1); i++) - { - atoms->atomname[i] = atoms->atomname[i+1]; - } - - /* Shift the atom struct down */ - for (i = inr; (i < atoms->nr-1); i++) - { - atoms->atom[i] = atoms->atom[i+1]; - } - - if (atoms->havePdbInfo) - { - /* Shift the pdbatom struct down */ - for (i = inr; (i < atoms->nr-1); i++) - { - atoms->pdbinfo[i] = atoms->pdbinfo[i+1]; - } - } - atoms->nr--; -} - -void delete_atom(t_topology *top, int inr) -{ - if ((inr < 0) || (inr >= top->atoms.nr)) - { - gmx_fatal(FARGS, "Delete_atom: inr (%d) not in %d .. %d", inr, 0, - top->atoms.nr); - } - if (debug) - { - fprintf(debug, "Deleting atom %d ...", inr); - } - - /* First remove bonds etc. */ - delete_from_interactions(&top->idef, inr); - /* Now charge groups etc. */ - delete_from_block(&(top->cgs), inr); - delete_from_block(&(top->mols), inr); - delete_from_blocka(&(top->excls), inr); - /* Now from the atoms struct */ - delete_from_atoms(&top->atoms, inr); - if (debug) - { - fprintf(debug, " done\n"); - } -} diff --git a/src/gromacs/gmxana/gmx_analyze.cpp b/src/gromacs/gmxana/gmx_analyze.cpp index 36ad1e0940..f2642dd88f 100644 --- a/src/gromacs/gmxana/gmx_analyze.cpp +++ b/src/gromacs/gmxana/gmx_analyze.cpp @@ -237,8 +237,8 @@ static void regression_analysis(int n, gmx_bool bXYdy, } } -void histogram(const char *distfile, real binwidth, int n, int nset, real **val, - const gmx_output_env_t *oenv) +static void histogram(const char *distfile, real binwidth, int n, int nset, real **val, + const gmx_output_env_t *oenv) { FILE *fp; int i, s; diff --git a/src/gromacs/gmxana/gmx_bar.cpp b/src/gromacs/gmxana/gmx_bar.cpp index 4755864f06..865cf3c6a3 100644 --- a/src/gromacs/gmxana/gmx_bar.cpp +++ b/src/gromacs/gmxana/gmx_bar.cpp @@ -985,8 +985,8 @@ static void sample_coll_make_hist(sample_coll_t *sc, int **bin, } /* write a collection of histograms to a file */ -void sim_data_histogram(sim_data_t *sd, const char *filename, - int nbin_default, const gmx_output_env_t *oenv) +static void sim_data_histogram(sim_data_t *sd, const char *filename, + int nbin_default, const gmx_output_env_t *oenv) { char label_x[STRLEN]; const char *dhdl = "dH/d\\lambda", *deltag = "\\DeltaH", *lambda = "\\lambda"; diff --git a/src/gromacs/gmxana/gmx_chi.cpp b/src/gromacs/gmxana/gmx_chi.cpp index 1ce9b2645f..35dc63c92d 100644 --- a/src/gromacs/gmxana/gmx_chi.cpp +++ b/src/gromacs/gmxana/gmx_chi.cpp @@ -138,7 +138,7 @@ static gmx_bool bAllowed(real phi, real psi) return (map[x][y] == '1') ? TRUE : FALSE; } -int *make_chi_ind(int nl, t_dlist dl[], int *ndih) +static int *make_chi_ind(int nl, t_dlist dl[], int *ndih) { int *id; int i, Xi, n; @@ -211,14 +211,6 @@ int *make_chi_ind(int nl, t_dlist dl[], int *ndih) return id; } -int bin(real chi, int mult) -{ - mult = 3; - - return static_cast(chi*mult/360.0); -} - - static void do_dihcorr(const char *fn, int nf, int ndih, real **dih, real dt, int nlist, t_dlist dlist[], real time[], int maxchi, gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, gmx_bool bOmega, diff --git a/src/gromacs/gmxana/gmx_cluster.cpp b/src/gromacs/gmxana/gmx_cluster.cpp index 2c7cf6de70..96cdf384ca 100644 --- a/src/gromacs/gmxana/gmx_cluster.cpp +++ b/src/gromacs/gmxana/gmx_cluster.cpp @@ -140,20 +140,10 @@ typedef struct { int *nb; } t_nnb; -void cp_index(int nn, int from[], int to[]) -{ - int i; - - for (i = 0; (i < nn); i++) - { - to[i] = from[i]; - } -} - -void mc_optimize(FILE *log, t_mat *m, real *time, - int maxiter, int nrandom, - int seed, real kT, - const char *conv, gmx_output_env_t *oenv) +static void mc_optimize(FILE *log, t_mat *m, real *time, + int maxiter, int nrandom, + int seed, real kT, + const char *conv, gmx_output_env_t *oenv) { FILE *fp = nullptr; real ecur, enext, emin, prob, enorm; @@ -347,7 +337,7 @@ static bool nrnb_comp(const t_nnb &a, const t_nnb &b) return b.nr < a.nr; } -void gather(t_mat *m, real cutoff, t_clusters *clust) +static void gather(t_mat *m, real cutoff, t_clusters *clust) { t_clustid *c; t_dist *d; @@ -437,7 +427,7 @@ void gather(t_mat *m, real cutoff, t_clusters *clust) sfree(d); } -gmx_bool jp_same(int **nnb, int i, int j, int P) +static gmx_bool jp_same(int **nnb, int i, int j, int P) { gmx_bool bIn; int k, ii, jj, pp; @@ -762,8 +752,8 @@ static void gromos(int n1, real **mat, real rmsdcut, t_clusters *clust) clust->ncl = k-1; } -rvec **read_whole_trj(const char *fn, int isize, int index[], int skip, - int *nframe, real **time, const gmx_output_env_t *oenv, gmx_bool bPBC, gmx_rmpbc_t gpbc) +static rvec **read_whole_trj(const char *fn, int isize, int index[], int skip, + int *nframe, real **time, const gmx_output_env_t *oenv, gmx_bool bPBC, gmx_rmpbc_t gpbc) { rvec **xx, *x; matrix box; @@ -1394,7 +1384,7 @@ int gmx_cluster(int argc, char *argv[]) }; FILE *fp, *log; - int nf, i, i1, i2, j; + int nf = 0, i, i1, i2, j; gmx_int64_t nrms = 0; matrix box; diff --git a/src/gromacs/gmxana/gmx_confrms.cpp b/src/gromacs/gmxana/gmx_confrms.cpp index d037276756..8d80f8c15f 100644 --- a/src/gromacs/gmxana/gmx_confrms.cpp +++ b/src/gromacs/gmxana/gmx_confrms.cpp @@ -63,7 +63,7 @@ static const int NOTSET = -9368163; -void calc_rm_cm(int isize, int index[], const t_atoms *atoms, rvec x[], rvec xcm) +static void calc_rm_cm(int isize, int index[], const t_atoms *atoms, rvec x[], rvec xcm) { int i, d; real tm, m; @@ -87,7 +87,7 @@ void calc_rm_cm(int isize, int index[], const t_atoms *atoms, rvec x[], rvec xcm } } -int build_res_index(int isize, int index[], t_atom atom[], int rindex[]) +static int build_res_index(int isize, int index[], t_atom atom[], int rindex[]) { int i, r; @@ -106,7 +106,7 @@ int build_res_index(int isize, int index[], t_atom atom[], int rindex[]) return r; } -int find_res_end(int i, int isize, int index[], const t_atoms *atoms) +static int find_res_end(int i, int isize, int index[], const t_atoms *atoms) { int rnr; @@ -118,7 +118,7 @@ int find_res_end(int i, int isize, int index[], const t_atoms *atoms) return i; } -int debug_strcmp(char s1[], char s2[]) +static int debug_strcmp(char s1[], char s2[]) { if (debug) { @@ -127,10 +127,10 @@ int debug_strcmp(char s1[], char s2[]) return std::strcmp(s1, s2); } -int find_next_match_atoms_in_res(int *i1, int index1[], - int m1, char **atnms1[], - int *i2, int index2[], - int m2, char **atnms2[]) +static int find_next_match_atoms_in_res(int *i1, int index1[], + int m1, char **atnms1[], + int *i2, int index2[], + int m2, char **atnms2[]) { int dx, dy, dmax, cmp; gmx_bool bFW = FALSE; @@ -309,7 +309,7 @@ static int find_next_match_res(int *rnr1, int isize1, return cmp; } -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, int index[], t_atom atom[]) { int i; @@ -329,8 +329,8 @@ int find_first_atom_in_res(int rnr, int isize, int index[], t_atom atom[]) } } -void find_matching_names(int *isize1, int index1[], const t_atoms *atoms1, - int *isize2, int index2[], const t_atoms *atoms2) +static void find_matching_names(int *isize1, int index1[], const t_atoms *atoms1, + int *isize2, int index2[], const t_atoms *atoms2) { int i1, i2, ii1, ii2, m1, m2; int atcmp, rescmp; diff --git a/src/gromacs/gmxana/gmx_density.cpp b/src/gromacs/gmxana/gmx_density.cpp index f62f4180e6..e436d98a16 100644 --- a/src/gromacs/gmxana/gmx_density.cpp +++ b/src/gromacs/gmxana/gmx_density.cpp @@ -71,7 +71,7 @@ typedef struct { /****************************************************************************/ /* used for sorting the list */ -int compare(void *a, void *b) +static int compare(void *a, void *b) { t_electron *tmp1, *tmp2; tmp1 = (t_electron *)a; tmp2 = (t_electron *)b; @@ -79,7 +79,7 @@ int compare(void *a, void *b) return std::strcmp(tmp1->atomname, tmp2->atomname); } -int get_electrons(t_electron **eltab, const char *fn) +static int get_electrons(t_electron **eltab, const char *fn) { char buffer[256]; /* to read in a line */ char tempname[80]; /* buffer to hold name */ @@ -129,8 +129,8 @@ int get_electrons(t_electron **eltab, const char *fn) return nr; } -void center_coords(t_atoms *atoms, int *index_center, int ncenter, - matrix box, rvec x0[]) +static void center_coords(t_atoms *atoms, int *index_center, int ncenter, + matrix box, rvec x0[]) { int i, k, m; real tmass, mm; @@ -167,13 +167,13 @@ void center_coords(t_atoms *atoms, int *index_center, int ncenter, } } -void calc_electron_density(const char *fn, int **index, int gnx[], - double ***slDensity, int *nslices, t_topology *top, - int ePBC, - int axis, int nr_grps, real *slWidth, - t_electron eltab[], int nr, gmx_bool bCenter, - int *index_center, int ncenter, - gmx_bool bRelative, const gmx_output_env_t *oenv) +static void calc_electron_density(const char *fn, int **index, int gnx[], + double ***slDensity, int *nslices, t_topology *top, + int ePBC, + int axis, int nr_grps, real *slWidth, + t_electron eltab[], int nr, gmx_bool bCenter, + int *index_center, int ncenter, + gmx_bool bRelative, const gmx_output_env_t *oenv) { rvec *x0; /* coordinates without pbc */ matrix box; /* box (3x3) */ @@ -326,11 +326,11 @@ void calc_electron_density(const char *fn, int **index, int gnx[], sfree(x0); /* free memory used by coordinate array */ } -void calc_density(const char *fn, int **index, 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, - gmx_bool bRelative, const gmx_output_env_t *oenv) +static void calc_density(const char *fn, int **index, 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, + gmx_bool bRelative, const gmx_output_env_t *oenv) { rvec *x0; /* coordinates without pbc */ matrix box; /* box (3x3) */ @@ -475,11 +475,11 @@ void calc_density(const char *fn, int **index, int gnx[], sfree(x0); /* free memory used by coordinate array */ } -void plot_density(double *slDensity[], const char *afile, int nslices, - int nr_grps, char *grpname[], real slWidth, - const char **dens_opt, - gmx_bool bCenter, gmx_bool bRelative, gmx_bool bSymmetrize, - const gmx_output_env_t *oenv) +static void plot_density(double *slDensity[], const char *afile, int nslices, + int nr_grps, char *grpname[], real slWidth, + const char **dens_opt, + gmx_bool bCenter, gmx_bool bRelative, gmx_bool bSymmetrize, + const gmx_output_env_t *oenv) { FILE *den; const char *title = nullptr; diff --git a/src/gromacs/gmxana/gmx_dielectric.cpp b/src/gromacs/gmxana/gmx_dielectric.cpp index 11cd32e5f9..e6ba83d90e 100644 --- a/src/gromacs/gmxana/gmx_dielectric.cpp +++ b/src/gromacs/gmxana/gmx_dielectric.cpp @@ -59,7 +59,7 @@ #include "gromacs/utility/smalloc.h" /* Determines at which point in the array the fit should start */ -int calc_nbegin(int nx, real x[], real tbegin) +static int calc_nbegin(int nx, real x[], real tbegin) { int nbegin; @@ -86,8 +86,8 @@ int calc_nbegin(int nx, real x[], real tbegin) return nbegin; } -real numerical_deriv(int nx, real x[], real y[], real fity[], real combined[], real dy[], - real tendInt, int nsmooth) +static real numerical_deriv(int nx, real x[], real y[], real fity[], real combined[], real dy[], + real tendInt, int nsmooth) { FILE *tmpfp; int i, nbegin, i0, i1; @@ -151,8 +151,8 @@ real numerical_deriv(int nx, real x[], real y[], real fity[], real combined[], r return integralSmth; } -void do_four(const char *fn, const char *cn, int nx, real x[], real dy[], - real eps0, real epsRF, const gmx_output_env_t *oenv) +static void do_four(const char *fn, const char *cn, int nx, real x[], real dy[], + real eps0, real epsRF, const gmx_output_env_t *oenv) { FILE *fp, *cp; t_complex *tmp, gw, hw, kw; diff --git a/src/gromacs/gmxana/gmx_dipoles.cpp b/src/gromacs/gmxana/gmx_dipoles.cpp index b10f25364a..32dd9125cc 100644 --- a/src/gromacs/gmxana/gmx_dipoles.cpp +++ b/src/gromacs/gmxana/gmx_dipoles.cpp @@ -410,8 +410,8 @@ static void print_gkrbin(const char *fn, t_gkrbin *gb, xvgrclose(fp); } -gmx_bool read_mu_from_enx(ener_file_t fmu, int Vol, ivec iMu, rvec mu, real *vol, - real *t, int nre, t_enxframe *fr) +static gmx_bool read_mu_from_enx(ener_file_t fmu, int Vol, ivec iMu, rvec mu, real *vol, + real *t, int nre, t_enxframe *fr) { int i; gmx_bool bCont; @@ -621,7 +621,7 @@ static void mol_quad(int k0, int k1, rvec x[], const t_atom atom[], rvec quad) /* * Calculates epsilon according to M. Neumann, Mol. Phys. 50, 841 (1983) */ -real calc_eps(double M_diff, double volume, double epsRF, double temp) +static real calc_eps(double M_diff, double volume, double epsRF, double temp) { double eps, A, teller, noemer; double eps_0 = 8.854187817e-12; /* epsilon_0 in C^2 J^-1 m^-1 */ @@ -1469,7 +1469,7 @@ static void do_dip(const t_topology *top, int ePBC, real volume, } } -void dipole_atom2molindex(int *n, int *index, const t_block *mols) +static void dipole_atom2molindex(int *n, int *index, const t_block *mols) { int nmol, i, j, m; diff --git a/src/gromacs/gmxana/gmx_disre.cpp b/src/gromacs/gmxana/gmx_disre.cpp index a6a0a316b0..a1f309b583 100644 --- a/src/gromacs/gmxana/gmx_disre.cpp +++ b/src/gromacs/gmxana/gmx_disre.cpp @@ -106,7 +106,7 @@ static void reset5(void) } } -int tpcomp(const void *a, const void *b) +static int tpcomp(const void *a, const void *b) { t_toppop *tpa; t_toppop *tpb; diff --git a/src/gromacs/gmxana/gmx_do_dssp.cpp b/src/gromacs/gmxana/gmx_do_dssp.cpp index 1d2ee996b2..a8aab1bc21 100644 --- a/src/gromacs/gmxana/gmx_do_dssp.cpp +++ b/src/gromacs/gmxana/gmx_do_dssp.cpp @@ -269,7 +269,7 @@ static void norm_acc(t_atoms *atoms, int nres, } } -void prune_ss_legend(t_matrix *mat) +static void prune_ss_legend(t_matrix *mat) { gmx_bool *present; int *newnum; @@ -314,7 +314,7 @@ void prune_ss_legend(t_matrix *mat) } } -void write_sas_mat(const char *fn, real **accr, int nframe, int nres, t_matrix *mat) +static void write_sas_mat(const char *fn, real **accr, int nframe, int nres, t_matrix *mat) { real lo, hi; int i, j, nlev; @@ -341,8 +341,8 @@ void write_sas_mat(const char *fn, real **accr, int nframe, int nres, t_matrix * } } -void analyse_ss(const char *outfile, t_matrix *mat, const char *ss_string, - const gmx_output_env_t *oenv) +static void analyse_ss(const char *outfile, t_matrix *mat, const char *ss_string, + const gmx_output_env_t *oenv) { FILE *fp; t_mapping *map; diff --git a/src/gromacs/gmxana/gmx_editconf.cpp b/src/gromacs/gmxana/gmx_editconf.cpp index 290dee0550..7abb509a26 100644 --- a/src/gromacs/gmxana/gmx_editconf.cpp +++ b/src/gromacs/gmxana/gmx_editconf.cpp @@ -67,7 +67,7 @@ #include "gromacs/utility/strdb.h" -real calc_mass(t_atoms *atoms, gmx_bool bGetMass, gmx_atomprop_t aps) +static real calc_mass(t_atoms *atoms, gmx_bool bGetMass, gmx_atomprop_t aps) { real tmass; int i; @@ -87,8 +87,8 @@ real calc_mass(t_atoms *atoms, gmx_bool bGetMass, gmx_atomprop_t aps) return tmass; } -real calc_geom(int isize, int *index, rvec *x, rvec geom_center, rvec minval, - rvec maxval, gmx_bool bDiam) +static real calc_geom(int isize, int *index, rvec *x, rvec geom_center, rvec minval, + rvec maxval, gmx_bool bDiam) { real diam2, d; int ii, i, j; @@ -162,7 +162,7 @@ real calc_geom(int isize, int *index, rvec *x, rvec geom_center, rvec minval, return std::sqrt(diam2); } -void center_conf(int natom, rvec *x, rvec center, rvec geom_cent) +static void center_conf(int natom, rvec *x, rvec center, rvec geom_cent) { int i; rvec shift; @@ -178,7 +178,7 @@ void center_conf(int natom, rvec *x, rvec center, rvec geom_cent) } } -void scale_conf(int natom, rvec x[], matrix box, rvec scale) +static void scale_conf(int natom, rvec x[], matrix box, rvec scale) { int i, j; @@ -198,7 +198,7 @@ void scale_conf(int natom, rvec x[], matrix box, rvec scale) } } -void read_bfac(const char *fn, int *n_bfac, double **bfac_val, int **bfac_nr) +static void read_bfac(const char *fn, int *n_bfac, double **bfac_val, int **bfac_nr) { int i; char **bfac_lines; @@ -216,8 +216,8 @@ void read_bfac(const char *fn, int *n_bfac, double **bfac_val, int **bfac_nr) } -void set_pdb_conf_bfac(int natoms, int nres, t_atoms *atoms, int n_bfac, - double *bfac, int *bfac_nr, gmx_bool peratom) +static void set_pdb_conf_bfac(int natoms, int nres, t_atoms *atoms, int n_bfac, + double *bfac, int *bfac_nr, gmx_bool peratom) { real bfac_min, bfac_max; int i, n; @@ -306,7 +306,7 @@ void set_pdb_conf_bfac(int natoms, int nres, t_atoms *atoms, int n_bfac, } } -void pdb_legend(FILE *out, int natoms, int nres, t_atoms *atoms, rvec x[]) +static void pdb_legend(FILE *out, int natoms, int nres, t_atoms *atoms, rvec x[]) { real bfac_min, bfac_max, xmin, ymin, zmin; int i; @@ -336,7 +336,7 @@ void pdb_legend(FILE *out, int natoms, int nres, t_atoms *atoms, rvec x[]) } } -void visualize_images(const char *fn, int ePBC, matrix box) +static void visualize_images(const char *fn, int ePBC, matrix box) { t_atoms atoms; rvec *img; @@ -366,7 +366,7 @@ void visualize_images(const char *fn, int ePBC, matrix box) sfree(img); } -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, rvec gridsize) { int *edge; rvec *vert, shift; @@ -451,7 +451,7 @@ void visualize_box(FILE *out, int a0, int r0, matrix box, rvec gridsize) } } -void calc_rotmatrix(rvec principal_axis, rvec targetvec, matrix rotmatrix) +static void calc_rotmatrix(rvec principal_axis, rvec targetvec, matrix rotmatrix) { rvec rotvec; real ux, uy, uz, costheta, sintheta; diff --git a/src/gromacs/gmxana/gmx_genion.cpp b/src/gromacs/gmxana/gmx_genion.cpp index 3a88b6a8f1..deb93af437 100644 --- a/src/gromacs/gmxana/gmx_genion.cpp +++ b/src/gromacs/gmxana/gmx_genion.cpp @@ -137,9 +137,9 @@ static char *aname(const char *mname) return str; } -void sort_ions(int nsa, int nw, int repl[], int index[], - t_atoms *atoms, rvec x[], - const char *p_name, const char *n_name) +static void sort_ions(int nsa, int nw, int repl[], int index[], + t_atoms *atoms, rvec x[], + const char *p_name, const char *n_name) { int i, j, k, r, np, nn, starta, startr, npi, nni; rvec *xt; diff --git a/src/gromacs/gmxana/gmx_gyrate.cpp b/src/gromacs/gmxana/gmx_gyrate.cpp index 4b61de02a5..50ec5bee3b 100644 --- a/src/gromacs/gmxana/gmx_gyrate.cpp +++ b/src/gromacs/gmxana/gmx_gyrate.cpp @@ -59,8 +59,8 @@ #include "gromacs/utility/futil.h" #include "gromacs/utility/smalloc.h" -real calc_gyro(rvec x[], int gnx, int index[], t_atom atom[], real tm, - rvec gvec, rvec d, gmx_bool bQ, gmx_bool bRot, gmx_bool bMOI, matrix trans) +static real calc_gyro(rvec x[], int gnx, int index[], t_atom atom[], real tm, + rvec gvec, rvec d, gmx_bool bQ, gmx_bool bRot, gmx_bool bMOI, matrix trans) { int i, ii, m; real gyro, dx2, m0, Itot; @@ -108,9 +108,9 @@ real calc_gyro(rvec x[], int gnx, int index[], t_atom atom[], real tm, return std::sqrt(gyro/tm); } -void calc_gyro_z(rvec x[], matrix box, - int gnx, int index[], t_atom atom[], - int nz, real time, FILE *out) +static void calc_gyro_z(rvec x[], matrix box, + int gnx, int index[], t_atom atom[], + int nz, real time, FILE *out) { static dvec *inertia = nullptr; static double *tm = nullptr; diff --git a/src/gromacs/gmxana/gmx_h2order.cpp b/src/gromacs/gmxana/gmx_h2order.cpp index 498d30aa7d..85492b7ac7 100644 --- a/src/gromacs/gmxana/gmx_h2order.cpp +++ b/src/gromacs/gmxana/gmx_h2order.cpp @@ -63,11 +63,11 @@ /* directions. */ /****************************************************************************/ -void calc_h2order(const char *fn, 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, - const gmx_output_env_t *oenv) +static void calc_h2order(const char *fn, 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, + const gmx_output_env_t *oenv) { rvec *x0, /* coordinates with pbc */ dipole, /* dipole moment due to one molecules */ @@ -232,8 +232,8 @@ void calc_h2order(const char *fn, int index[], int ngx, rvec **slDipole, sfree(x0); /* free memory used by coordinate arrays */ } -void h2order_plot(rvec dipole[], real order[], const char *afile, - int nslices, real slWidth, const gmx_output_env_t *oenv) +static void h2order_plot(rvec dipole[], real order[], const char *afile, + int nslices, real slWidth, const gmx_output_env_t *oenv) { FILE *ord; /* xvgr files with order parameters */ int slice; /* loop index */ diff --git a/src/gromacs/gmxana/gmx_lie.cpp b/src/gromacs/gmxana/gmx_lie.cpp index 25ef0044d5..9ba2b1b966 100644 --- a/src/gromacs/gmxana/gmx_lie.cpp +++ b/src/gromacs/gmxana/gmx_lie.cpp @@ -114,8 +114,8 @@ static t_liedata *analyze_names(int nre, gmx_enxnm_t *names, const char *ligand) return ld; } -real calc_lie(t_liedata *ld, t_energy ee[], real lie_lj, real lie_qq, - real fac_lj, real fac_qq) +static real calc_lie(t_liedata *ld, t_energy ee[], real lie_lj, real lie_qq, + real fac_lj, real fac_qq) { int i; real lj_tot, qq_tot; diff --git a/src/gromacs/gmxana/gmx_make_edi.cpp b/src/gromacs/gmxana/gmx_make_edi.cpp index 10bf7bbe86..bb9c7ac0a7 100644 --- a/src/gromacs/gmxana/gmx_make_edi.cpp +++ b/src/gromacs/gmxana/gmx_make_edi.cpp @@ -105,14 +105,14 @@ typedef struct edipar -void make_t_edx(struct edix *edx, int natoms, rvec *pos, int index[]) +static void make_t_edx(struct edix *edx, int natoms, rvec *pos, int index[]) { edx->nr = natoms; edx->anrs = index; edx->x = pos; } -void write_t_edx(FILE *fp, struct edix edx, const char *comment) +static void write_t_edx(FILE *fp, struct edix edx, const char *comment) { /*here we copy only the pointers into the t_edx struct no data is copied and edx.box is ignored */ @@ -124,7 +124,7 @@ void write_t_edx(FILE *fp, struct edix edx, const char *comment) } } -int sscan_list(int *list[], const char *str, const char *listname) +static int sscan_list(int *list[], const char *str, const char *listname) { /*this routine scans a string of the form 1,3-6,9 and returns the selected numbers (in this case 1 3 4 5 6 9) in NULL-terminated array of integers. @@ -304,7 +304,7 @@ int sscan_list(int *list[], const char *str, const char *listname) return nvecs; } /*sscan_list*/ -void write_eigvec(FILE* fp, int natoms, int eig_list[], rvec** eigvecs, int nvec, const char *grouptitle, real steps[]) +static void write_eigvec(FILE* fp, int natoms, int eig_list[], rvec** eigvecs, int nvec, const char *grouptitle, real steps[]) { /* eig_list is a zero-terminated list of indices into the eigvecs array. eigvecs are coordinates of eigenvectors @@ -359,8 +359,8 @@ enum { #define MAGIC 670 -void write_the_whole_thing(FILE* fp, t_edipar *edpars, rvec** eigvecs, - int nvec, int *eig_listen[], real* evStepList[]) +static void write_the_whole_thing(FILE* fp, t_edipar *edpars, rvec** eigvecs, + int nvec, int *eig_listen[], real* evStepList[]) { /* write edi-file */ @@ -393,7 +393,7 @@ void write_the_whole_thing(FILE* fp, t_edipar *edpars, rvec** eigvecs, write_t_edx(fp, edpars->sori, "NORIGIN, XORIGIN"); } -int read_conffile(const char *confin, rvec **x) +static int read_conffile(const char *confin, rvec **x) { t_topology top; matrix box; @@ -404,8 +404,8 @@ int read_conffile(const char *confin, rvec **x) } -void read_eigenvalues(int vecs[], const char *eigfile, real values[], - gmx_bool bHesse, real kT, int natoms_average_struct) +static void read_eigenvalues(int vecs[], const char *eigfile, real values[], + gmx_bool bHesse, real kT, int natoms_average_struct) { int neig, nrow, i; double **eigval; @@ -497,15 +497,15 @@ static real *scan_vecparams(const char *str, const char * par, int nvecs) } -void init_edx(struct edix *edx) +static void init_edx(struct edix *edx) { edx->nr = 0; snew(edx->x, 1); snew(edx->anrs, 1); } -void filter2edx(struct edix *edx, int nindex, int index[], int ngro, - int igro[], const rvec *x, const char* structure) +static void filter2edx(struct edix *edx, int nindex, int index[], int ngro, + int igro[], const rvec *x, const char* structure) { /* filter2edx copies coordinates from x to edx which are given in index */ @@ -530,9 +530,9 @@ void filter2edx(struct edix *edx, int nindex, int index[], int ngro, } } -void get_structure(const t_atoms *atoms, const char *IndexFile, - const char *StructureFile, struct edix *edx, int nfit, - int ifit[], int nav, int index[]) +static void get_structure(const t_atoms *atoms, const char *IndexFile, + const char *StructureFile, struct edix *edx, int nfit, + int ifit[], int nav, int index[]) { int *igro; /*index corresponding to target or origin structure*/ int ngro; diff --git a/src/gromacs/gmxana/gmx_make_ndx.cpp b/src/gromacs/gmxana/gmx_make_ndx.cpp index eb7552ad08..85468fbebe 100644 --- a/src/gromacs/gmxana/gmx_make_ndx.cpp +++ b/src/gromacs/gmxana/gmx_make_ndx.cpp @@ -1483,7 +1483,7 @@ static int block2natoms(t_blocka *block) return natoms; } -void merge_blocks(t_blocka *dest, t_blocka *source) +static void merge_blocks(t_blocka *dest, t_blocka *source) { int i, nra0, i0; diff --git a/src/gromacs/gmxana/gmx_mdmat.cpp b/src/gromacs/gmxana/gmx_mdmat.cpp index 191b635b7f..f59673d35b 100644 --- a/src/gromacs/gmxana/gmx_mdmat.cpp +++ b/src/gromacs/gmxana/gmx_mdmat.cpp @@ -63,7 +63,7 @@ #define FARAWAY 10000 -int *res_ndx(t_atoms *atoms) +static int *res_ndx(t_atoms *atoms) { int *rndx; int i, r0; @@ -82,7 +82,7 @@ int *res_ndx(t_atoms *atoms) return rndx; } -int *res_natm(t_atoms *atoms) +static int *res_natm(t_atoms *atoms) { int *natm; int i, j, r0; diff --git a/src/gromacs/gmxana/gmx_mindist.cpp b/src/gromacs/gmxana/gmx_mindist.cpp index 202eda2b10..7035b3be46 100644 --- a/src/gromacs/gmxana/gmx_mindist.cpp +++ b/src/gromacs/gmxana/gmx_mindist.cpp @@ -325,13 +325,13 @@ static void calc_dist(real rcut, gmx_bool bPBC, int ePBC, matrix box, rvec x[], *rmax = std::sqrt(rmax2); } -void dist_plot(const char *fn, const char *afile, const char *dfile, - const char *nfile, const char *rfile, const char *xfile, - real rcut, gmx_bool bMat, const t_atoms *atoms, - int ng, int *index[], int gnx[], char *grpn[], gmx_bool bSplit, - gmx_bool bMin, int nres, int *residue, gmx_bool bPBC, int ePBC, - gmx_bool bGroup, gmx_bool bEachResEachTime, gmx_bool bPrintResName, - const gmx_output_env_t *oenv) +static void dist_plot(const char *fn, const char *afile, const char *dfile, + const char *nfile, const char *rfile, const char *xfile, + real rcut, gmx_bool bMat, const t_atoms *atoms, + int ng, int *index[], int gnx[], char *grpn[], gmx_bool bSplit, + gmx_bool bMin, int nres, int *residue, gmx_bool bPBC, int ePBC, + gmx_bool bGroup, gmx_bool bEachResEachTime, gmx_bool bPrintResName, + const gmx_output_env_t *oenv) { FILE *atm, *dist, *num; t_trxstatus *trxout; @@ -597,7 +597,7 @@ void dist_plot(const char *fn, const char *afile, const char *dfile, sfree(x0); } -int find_residues(const t_atoms *atoms, int n, int index[], int **resindex) +static int find_residues(const t_atoms *atoms, int n, int index[], int **resindex) { int i; int nres = 0, resnr, presnr = 0; @@ -629,7 +629,7 @@ int find_residues(const t_atoms *atoms, int n, int index[], int **resindex) return nres; } -void dump_res(FILE *out, int nres, int *resindex, int index[]) +static void dump_res(FILE *out, int nres, int *resindex, int index[]) { int i, j; diff --git a/src/gromacs/gmxana/gmx_msd.cpp b/src/gromacs/gmxana/gmx_msd.cpp index 58c81c52e9..eabc5a6ea4 100644 --- a/src/gromacs/gmxana/gmx_msd.cpp +++ b/src/gromacs/gmxana/gmx_msd.cpp @@ -109,9 +109,9 @@ static gmx_bool in_data(t_corr *curr, int nx00) return curr->nframes-curr->n_offs[nx00]; } -t_corr *init_corr(int nrgrp, int type, int axis, real dim_factor, - int nmol, gmx_bool bTen, gmx_bool bMass, real dt, const t_topology *top, - real beginfit, real endfit) +static t_corr *init_corr(int nrgrp, int type, int axis, real dim_factor, + int nmol, gmx_bool bTen, gmx_bool bMass, real dt, const t_topology *top, + real beginfit, real endfit) { t_corr *curr; int i; @@ -635,11 +635,11 @@ static void printmol(t_corr *curr, const char *fn, * fx and nx are file pointers to things like read_first_x and * read_next_x */ -int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC, - gmx_bool bMol, int gnx[], int *index[], - t_calc_func *calc1, gmx_bool bTen, int *gnx_com, int *index_com[], - real dt, real t_pdb, rvec **x_pdb, matrix box_pdb, - const gmx_output_env_t *oenv) +static int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC, + gmx_bool bMol, int gnx[], int *index[], + t_calc_func *calc1, gmx_bool bTen, int *gnx_com, int *index_com[], + real dt, real t_pdb, rvec **x_pdb, matrix box_pdb, + const gmx_output_env_t *oenv) { rvec *x[2]; /* the coordinates to read */ rvec *xa[2]; /* the coordinates to calculate displacements for */ @@ -867,12 +867,12 @@ static void index_atom2mol(int *n, int *index, const t_block *mols) *n = nmol; } -void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file, - const char *mol_file, const char *pdb_file, real t_pdb, - int nrgrp, t_topology *top, int ePBC, - gmx_bool bTen, gmx_bool bMW, gmx_bool bRmCOMM, - int type, real dim_factor, int axis, - real dt, real beginfit, real endfit, const gmx_output_env_t *oenv) +static void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file, + const char *mol_file, const char *pdb_file, real t_pdb, + int nrgrp, t_topology *top, int ePBC, + gmx_bool bTen, gmx_bool bMW, gmx_bool bRmCOMM, + int type, real dim_factor, int axis, + real dt, real beginfit, real endfit, const gmx_output_env_t *oenv) { t_corr *msd; int *gnx; /* the selected groups' sizes */ diff --git a/src/gromacs/gmxana/gmx_order.cpp b/src/gromacs/gmxana/gmx_order.cpp index 2b5f1bb15d..674046c64e 100644 --- a/src/gromacs/gmxana/gmx_order.cpp +++ b/src/gromacs/gmxana/gmx_order.cpp @@ -372,12 +372,12 @@ static void check_length(real length, int a, int b) } } -void calc_order(const char *fn, 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, - real ***distvals, - const gmx_output_env_t *oenv) +static void calc_order(const char *fn, 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, + real ***distvals, + const gmx_output_env_t *oenv) { /* if permolecule = TRUE, order parameters will be calculed per molecule * and stored in slOrder with #slices = # molecules */ @@ -751,9 +751,9 @@ void calc_order(const char *fn, int *index, int *a, rvec **order, } -void order_plot(rvec order[], real *slOrder[], const char *afile, const char *bfile, - const char *cfile, int ngrps, int nslices, real slWidth, gmx_bool bSzonly, - gmx_bool permolecule, real **distvals, const gmx_output_env_t *oenv) +static void order_plot(rvec order[], real *slOrder[], const char *afile, const char *bfile, + const char *cfile, int ngrps, int nslices, real slWidth, gmx_bool bSzonly, + gmx_bool permolecule, real **distvals, const gmx_output_env_t *oenv) { FILE *ord, *slOrd; /* xvgr files with order parameters */ int atom, slice; /* atom corresponding to order para.*/ @@ -832,7 +832,7 @@ void order_plot(rvec order[], real *slOrder[], const char *afile, const char *bf xvgrclose(slOrd); } -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, int *index, int *a, int nslices, int ngrps, real **order, const t_topology *top, real **distvals, gmx_output_env_t *oenv) { /*function to write order parameters as B factors in PDB file using first frame of trajectory*/ diff --git a/src/gromacs/gmxana/gmx_potential.cpp b/src/gromacs/gmxana/gmx_potential.cpp index 277c035a88..646dc07f3c 100644 --- a/src/gromacs/gmxana/gmx_potential.cpp +++ b/src/gromacs/gmxana/gmx_potential.cpp @@ -75,7 +75,7 @@ static int ce = 0, cb = 0; /* this routine integrates the array data and returns the resulting array */ /* routine uses simple trapezoid rule */ -void p_integrate(double *result, double data[], int ndata, double slWidth) +static void p_integrate(double *result, double data[], int ndata, double slWidth) { int i, slice; double sum; @@ -100,13 +100,13 @@ void p_integrate(double *result, double data[], int ndata, double slWidth) return; } -void calc_potential(const char *fn, int **index, int gnx[], - double ***slPotential, double ***slCharge, - double ***slField, int *nslices, - const t_topology *top, int ePBC, - int axis, int nr_grps, double *slWidth, - double fudge_z, gmx_bool bSpherical, gmx_bool bCorrect, - const gmx_output_env_t *oenv) +static void calc_potential(const char *fn, int **index, int gnx[], + double ***slPotential, double ***slCharge, + double ***slField, int *nslices, + const t_topology *top, int ePBC, + int axis, int nr_grps, double *slWidth, + double fudge_z, gmx_bool bSpherical, gmx_bool bCorrect, + const gmx_output_env_t *oenv) { rvec *x0; /* coordinates without pbc */ matrix box; /* box (3x3) */ @@ -360,10 +360,10 @@ void calc_potential(const char *fn, int **index, int gnx[], sfree(x0); /* free memory used by coordinate array */ } -void plot_potential(double *potential[], double *charge[], double *field[], - const char *afile, const char *bfile, const char *cfile, - int nslices, int nr_grps, const char *grpname[], double slWidth, - const gmx_output_env_t *oenv) +static void plot_potential(double *potential[], double *charge[], double *field[], + const char *afile, const char *bfile, const char *cfile, + int nslices, int nr_grps, const char *grpname[], double slWidth, + const gmx_output_env_t *oenv) { FILE *pot, /* xvgr file with potential */ *cha, /* xvgr file with charges */ diff --git a/src/gromacs/gmxana/gmx_principal.cpp b/src/gromacs/gmxana/gmx_principal.cpp index 312aaa4991..6a5c037b37 100644 --- a/src/gromacs/gmxana/gmx_principal.cpp +++ b/src/gromacs/gmxana/gmx_principal.cpp @@ -56,7 +56,7 @@ #include "gromacs/utility/smalloc.h" -void +static void calc_principal_axes(const t_topology *top, rvec *x, int *index, diff --git a/src/gromacs/gmxana/gmx_rmsdist.cpp b/src/gromacs/gmxana/gmx_rmsdist.cpp index 4cf174ed51..ae49501f95 100644 --- a/src/gromacs/gmxana/gmx_rmsdist.cpp +++ b/src/gromacs/gmxana/gmx_rmsdist.cpp @@ -611,7 +611,7 @@ static void calc_rms(int nind, int nframes, } } -real rms_diff(int natom, real **d, real **d_r) +static real rms_diff(int natom, real **d, real **d_r) { int i, j; real r, r2; diff --git a/src/gromacs/gmxana/gmx_rmsf.cpp b/src/gromacs/gmxana/gmx_rmsf.cpp index 354f092b02..e2e3ea795c 100644 --- a/src/gromacs/gmxana/gmx_rmsf.cpp +++ b/src/gromacs/gmxana/gmx_rmsf.cpp @@ -89,8 +89,8 @@ static real find_pdb_bfac(const t_atoms *atoms, t_resinfo *ri, char *atomnm) return atoms->pdbinfo[i].bfac; } -void correlate_aniso(const char *fn, t_atoms *ref, t_atoms *calc, - const gmx_output_env_t *oenv) +static void correlate_aniso(const char *fn, t_atoms *ref, t_atoms *calc, + const gmx_output_env_t *oenv) { FILE *fp; int i, j; @@ -153,7 +153,7 @@ static void average_residues(double f[], double **U, int uind, } } -void print_dir(FILE *fp, real *Uaver) +static void print_dir(FILE *fp, real *Uaver) { real eigvec[DIM*DIM]; real tmp[DIM*DIM]; diff --git a/src/gromacs/gmxana/gmx_sigeps.cpp b/src/gromacs/gmxana/gmx_sigeps.cpp index a74cb7b922..02da8ac8ae 100644 --- a/src/gromacs/gmxana/gmx_sigeps.cpp +++ b/src/gromacs/gmxana/gmx_sigeps.cpp @@ -50,17 +50,17 @@ #include "gromacs/utility/arraysize.h" #include "gromacs/utility/smalloc.h" -real pot(real x, real qq, real c6, real cn, int npow) +static real pot(real x, real qq, real c6, real cn, int npow) { return cn*pow(x, -npow)-c6/gmx::power6(x)+qq*ONE_4PI_EPS0/x; } -real bhpot(real x, real A, real B, real C) +static real bhpot(real x, real A, real B, real C) { return A*std::exp(-B*x) - C/gmx::power6(x); } -real dpot(real x, real qq, real c6, real cn, int npow) +static real dpot(real x, real qq, real c6, real cn, int npow) { return -(npow*cn*std::pow(x, -npow-1)-6*c6/(x*gmx::power6(x))+qq*ONE_4PI_EPS0/gmx::square(x)); } diff --git a/src/gromacs/gmxana/gmx_spol.cpp b/src/gromacs/gmxana/gmx_spol.cpp index d166e44d2d..ed62da7c5d 100644 --- a/src/gromacs/gmxana/gmx_spol.cpp +++ b/src/gromacs/gmxana/gmx_spol.cpp @@ -115,7 +115,7 @@ static void calc_com_pbc(int nrefat, const t_topology *top, rvec x[], t_pbc *pbc } } -void spol_atom2molindex(int *n, int *index, const t_block *mols) +static void spol_atom2molindex(int *n, int *index, const t_block *mols) { int nmol, i, j, m; diff --git a/src/gromacs/gmxana/gmx_trjconv.cpp b/src/gromacs/gmxana/gmx_trjconv.cpp index 45d8686b89..51d48f2b5f 100644 --- a/src/gromacs/gmxana/gmx_trjconv.cpp +++ b/src/gromacs/gmxana/gmx_trjconv.cpp @@ -463,7 +463,7 @@ static void mk_filenm(char *base, const char *ext, int ndigit, int file_nr, std::strcat(out_file, ext); } -void check_trr(const char *fn) +static void check_trr(const char *fn) { if (fn2ftp(fn) != efTRR) { @@ -471,7 +471,7 @@ void check_trr(const char *fn) } } -void do_trunc(const char *fn, real t0) +static void do_trunc(const char *fn, real t0) { t_fileio *in; FILE *fp; diff --git a/src/gromacs/gmxana/gmx_wham.cpp b/src/gromacs/gmxana/gmx_wham.cpp index 55f60a95b7..334995fe7d 100644 --- a/src/gromacs/gmxana/gmx_wham.cpp +++ b/src/gromacs/gmxana/gmx_wham.cpp @@ -323,7 +323,7 @@ typedef struct } t_UmbrellaOptions; //! Make an umbrella window (may contain several histograms) -t_UmbrellaWindow * initUmbrellaWindows(int nwin) +static t_UmbrellaWindow * initUmbrellaWindows(int nwin) { t_UmbrellaWindow *win; int i; @@ -344,7 +344,7 @@ t_UmbrellaWindow * initUmbrellaWindows(int nwin) } //! Delete an umbrella window (may contain several histograms) -void freeUmbrellaWindows(t_UmbrellaWindow *win, int nwin) +static void freeUmbrellaWindows(t_UmbrellaWindow *win, int nwin) { int i, j; for (i = 0; i < nwin; i++) @@ -393,7 +393,7 @@ void freeUmbrellaWindows(t_UmbrellaWindow *win, int nwin) /*! \brief * Read and setup tabulated umbrella potential */ -void setup_tab(const char *fn, t_UmbrellaOptions *opt) +static void setup_tab(const char *fn, t_UmbrellaOptions *opt) { int i, ny, nl; double **y; @@ -432,7 +432,7 @@ void setup_tab(const char *fn, t_UmbrellaOptions *opt) } //! Read the header of an PDO file (position, force const, nr of groups) -void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *opt) +static void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *opt) { char line[2048]; char Buffer0[256], Buffer1[256], Buffer2[256], Buffer3[256], Buffer4[256]; @@ -569,10 +569,10 @@ static char *fgets3(FILE *fp, char ptr[], int *len) * At the moment, this warning is avoided by hiding the format string * the variable fmtlf. */ -void read_pdo_data(FILE * file, t_UmbrellaHeader * header, - int fileno, t_UmbrellaWindow * win, - t_UmbrellaOptions *opt, - gmx_bool bGetMinMax, real *mintmp, real *maxtmp) +static void read_pdo_data(FILE * file, t_UmbrellaHeader * header, + int fileno, t_UmbrellaWindow * win, + t_UmbrellaOptions *opt, + gmx_bool bGetMinMax, real *mintmp, real *maxtmp) { int i, inttemp, bins, count, ntot; real minval, maxval, minfound = 1e20, maxfound = -1e20; @@ -780,7 +780,7 @@ void read_pdo_data(FILE * file, t_UmbrellaHeader * header, * by this routine (not recommended). Since we now support autocorrelations, it is better to set * an appropriate autocorrelation times instead of using this function. */ -void enforceEqualWeights(t_UmbrellaWindow * window, int nWindows) +static void enforceEqualWeights(t_UmbrellaWindow * window, int nWindows) { int i, k, j, NEnforced; double ratio; @@ -806,7 +806,7 @@ void enforceEqualWeights(t_UmbrellaWindow * window, int nWindows) /*! \brief Simple linear interpolation between two given tabulated points */ -double tabulated_pot(double dist, t_UmbrellaOptions *opt) +static double tabulated_pot(double dist, t_UmbrellaOptions *opt) { int jl, ju; double pl, pu, dz, dp; @@ -833,8 +833,8 @@ double tabulated_pot(double dist, t_UmbrellaOptions *opt) * After rapid convergence (using only substiantal contributions), we always switch to * full precision. */ -void setup_acc_wham(double *profile, t_UmbrellaWindow * window, int nWindows, - t_UmbrellaOptions *opt) +static void setup_acc_wham(double *profile, t_UmbrellaWindow * window, int nWindows, + t_UmbrellaOptions *opt) { int i, j, k, nGrptot = 0, nContrib = 0, nTot = 0; double U, min = opt->min, dz = opt->dz, temp, ztot_half, distance, ztot, contrib1, contrib2; @@ -934,8 +934,8 @@ void setup_acc_wham(double *profile, t_UmbrellaWindow * window, int nWindows, } //! Compute the PMF (one of the two main WHAM routines) -void calc_profile(double *profile, t_UmbrellaWindow * window, int nWindows, - t_UmbrellaOptions *opt, gmx_bool bExact) +static void calc_profile(double *profile, t_UmbrellaWindow * window, int nWindows, + t_UmbrellaOptions *opt, gmx_bool bExact) { double ztot_half, ztot, min = opt->min, dz = opt->dz; @@ -1001,8 +1001,8 @@ void calc_profile(double *profile, t_UmbrellaWindow * window, int nWindows, } //! Compute the free energy offsets z (one of the two main WHAM routines) -double calc_z(double * profile, t_UmbrellaWindow * window, int nWindows, - t_UmbrellaOptions *opt, gmx_bool bExact) +static double calc_z(double * profile, t_UmbrellaWindow * window, int nWindows, + t_UmbrellaOptions *opt, gmx_bool bExact) { double min = opt->min, dz = opt->dz, ztot_half, ztot; double maxglob = -1e20; @@ -1095,7 +1095,7 @@ double calc_z(double * profile, t_UmbrellaWindow * window, int nWindows, } //! Make PMF symmetric around 0 (useful e.g. for membranes) -void symmetrizeProfile(double* profile, t_UmbrellaOptions *opt) +static void symmetrizeProfile(double* profile, t_UmbrellaOptions *opt) { int i, j, bins = opt->bins; double *prof2, min = opt->min, max = opt->max, dz = opt->dz, zsym, deltaz, profsym; @@ -1135,7 +1135,7 @@ void symmetrizeProfile(double* profile, t_UmbrellaOptions *opt) } //! Set energy unit (kJ/mol,kT,kCal/mol) and set it to zero at opt->zProf0 -void prof_normalization_and_unit(double * profile, t_UmbrellaOptions *opt) +static void prof_normalization_and_unit(double * profile, t_UmbrellaOptions *opt) { int i, bins, imin; double unit_factor = 1., diff; @@ -1203,7 +1203,7 @@ void prof_normalization_and_unit(double * profile, t_UmbrellaOptions *opt) } //! Make an array of random integers (used for bootstrapping) -void getRandomIntArray(int nPull, int blockLength, int* randomArray, gmx::DefaultRandomEngine * rng) +static void getRandomIntArray(int nPull, int blockLength, int* randomArray, gmx::DefaultRandomEngine * rng) { gmx::UniformIntDistribution dist(0, blockLength-1); @@ -1240,8 +1240,8 @@ void getRandomIntArray(int nPull, int blockLength, int* randomArray, gmx::Defaul * This is used when bootstapping new trajectories and thereby create new histogtrams, * but it is not required if we bootstrap complete histograms. */ -void copy_pullgrp_to_synthwindow(t_UmbrellaWindow *synthWindow, - t_UmbrellaWindow *thisWindow, int pullid) +static void copy_pullgrp_to_synthwindow(t_UmbrellaWindow *synthWindow, + t_UmbrellaWindow *thisWindow, int pullid) { synthWindow->N [0] = thisWindow->N [pullid]; synthWindow->Histo [0] = thisWindow->Histo [pullid]; @@ -1259,8 +1259,8 @@ void copy_pullgrp_to_synthwindow(t_UmbrellaWindow *synthWindow, * which are distributed according to the histograms. Required to generate * the "synthetic" histograms for the Bootstrap method */ -void calc_cumulatives(t_UmbrellaWindow *window, int nWindows, - t_UmbrellaOptions *opt, const char *fnhist, const char *xlabel) +static void calc_cumulatives(t_UmbrellaWindow *window, int nWindows, + t_UmbrellaOptions *opt, const char *fnhist, const char *xlabel) { int i, j, k, nbin; double last; @@ -1324,7 +1324,7 @@ void calc_cumulatives(t_UmbrellaWindow *window, int nWindows, * * This is used to generate a random sequence distributed according to a histogram */ -void searchCumulative(double xx[], int n, double x, int *j) +static void searchCumulative(double xx[], int n, double x, int *j) { int ju, jm, jl; @@ -1357,8 +1357,8 @@ void searchCumulative(double xx[], int n, double x, int *j) } //! Bootstrap new trajectories and thereby generate new (bootstrapped) histograms -void create_synthetic_histo(t_UmbrellaWindow *synthWindow, t_UmbrellaWindow *thisWindow, - int pullid, t_UmbrellaOptions *opt) +static void create_synthetic_histo(t_UmbrellaWindow *synthWindow, t_UmbrellaWindow *thisWindow, + int pullid, t_UmbrellaOptions *opt) { int N, i, nbins, r_index, ibin; double r, tausteps = 0.0, a, ap, dt, x, invsqrt2, g, y, sig = 0., z, mu = 0.; @@ -1502,8 +1502,8 @@ void create_synthetic_histo(t_UmbrellaWindow *synthWindow, t_UmbrellaWindow *thi * If bs_index>=0, a number is added to the output file name to allow the ouput of all * sets of bootstrapped histograms. */ -void print_histograms(const char *fnhist, t_UmbrellaWindow * window, int nWindows, - int bs_index, t_UmbrellaOptions *opt, const char *xlabel) +static void print_histograms(const char *fnhist, t_UmbrellaWindow * window, int nWindows, + int bs_index, t_UmbrellaOptions *opt, const char *xlabel) { char *fn = nullptr, *buf = nullptr, title[256]; FILE *fp; @@ -1549,7 +1549,7 @@ void print_histograms(const char *fnhist, t_UmbrellaWindow * window, int nWindow } //! Used for qsort to sort random numbers -int func_wham_is_larger(const void *a, const void *b) +static int func_wham_is_larger(const void *a, const void *b) { double *aa, *bb; aa = (double*)a; @@ -1569,7 +1569,7 @@ int func_wham_is_larger(const void *a, const void *b) } //! Make random weights for histograms for the Bayesian bootstrap of complete histograms) -void setRandomBsWeights(t_UmbrellaWindow *synthwin, int nAllPull, t_UmbrellaOptions *opt) +static void setRandomBsWeights(t_UmbrellaWindow *synthwin, int nAllPull, t_UmbrellaOptions *opt) { int i; double *r; @@ -1604,9 +1604,9 @@ void setRandomBsWeights(t_UmbrellaWindow *synthwin, int nAllPull, t_UmbrellaOpti } //! The main bootstrapping routine -void do_bootstrapping(const char *fnres, const char* fnprof, const char *fnhist, - const char *xlabel, char* ylabel, double *profile, - t_UmbrellaWindow * window, int nWindows, t_UmbrellaOptions *opt) +static void do_bootstrapping(const char *fnres, const char* fnprof, const char *fnhist, + const char *xlabel, char* ylabel, double *profile, + t_UmbrellaWindow * window, int nWindows, t_UmbrellaOptions *opt) { t_UmbrellaWindow * synthWindow; double *bsProfile, *bsProfiles_av, *bsProfiles_av2, maxchange = 1e20, tmp, stddev; @@ -1802,7 +1802,7 @@ void do_bootstrapping(const char *fnres, const char* fnprof, const char *fnhist, } //! Return type of input file based on file extension (xvg, pdo, or tpr) -int whaminFileType(char *fn) +static int whaminFileType(char *fn) { int len; len = std::strlen(fn); @@ -1826,8 +1826,8 @@ int whaminFileType(char *fn) } //! Read the files names in pdo-files.dat, pullf/x-files.dat, tpr-files.dat -void read_wham_in(const char *fn, char ***filenamesRet, int *nfilesRet, - t_UmbrellaOptions *opt) +static void read_wham_in(const char *fn, char ***filenamesRet, int *nfilesRet, + t_UmbrellaOptions *opt) { char **filename = nullptr, tmp[WHAM_MAXFILELEN+2]; int nread, sizenow, i, block = 1; @@ -1868,7 +1868,7 @@ void read_wham_in(const char *fn, char ***filenamesRet, int *nfilesRet, } //! Open a file or a pipe to a gzipped file -FILE *open_pdo_pipe(const char *fn, t_UmbrellaOptions *opt, gmx_bool *bPipeOpen) +static FILE *open_pdo_pipe(const char *fn, t_UmbrellaOptions *opt, gmx_bool *bPipeOpen) { char Buffer[1024], gunzip[1024], *Path = nullptr; FILE *pipe = nullptr; @@ -1938,7 +1938,7 @@ FILE *open_pdo_pipe(const char *fn, t_UmbrellaOptions *opt, gmx_bool *bPipeOpen) } //! Close file or pipe -void pdo_close_file(FILE *fp) +static void pdo_close_file(FILE *fp) { #if HAVE_PIPES pclose(fp); @@ -1948,8 +1948,8 @@ void pdo_close_file(FILE *fp) } //! Reading all pdo files -void read_pdo_files(char **fn, int nfiles, t_UmbrellaHeader* header, - t_UmbrellaWindow *window, t_UmbrellaOptions *opt) +static void read_pdo_files(char **fn, int nfiles, t_UmbrellaHeader* header, + t_UmbrellaWindow *window, t_UmbrellaOptions *opt) { FILE *file; real mintmp, maxtmp, done = 0.; @@ -2049,7 +2049,7 @@ void read_pdo_files(char **fn, int nfiles, t_UmbrellaHeader* header, #define int2YN(a) (((a) == 0) ? ("N") : ("Y")) //! Read pull groups from a tpr file (including position, force const, geometry, number of groups) -void read_tpr_header(const char *fn, t_UmbrellaHeader* header, t_UmbrellaOptions *opt, t_coordselection *coordsel) +static void read_tpr_header(const char *fn, t_UmbrellaHeader* header, t_UmbrellaOptions *opt, t_coordselection *coordsel) { t_inputrec irInstance; t_inputrec *ir = &irInstance; @@ -2186,24 +2186,12 @@ void read_tpr_header(const char *fn, t_UmbrellaHeader* header, t_UmbrellaOptions first = 0; } -//! 2-norm in a ndim-dimensional space -double dist_ndim(double **dx, int ndim, int line) -{ - int i; - double r2 = 0.; - for (i = 0; i < ndim; i++) - { - r2 += gmx::square(dx[i][line]); - } - return std::sqrt(r2); -} - //! Read pullx.xvg or pullf.xvg -void read_pull_xf(const char *fn, t_UmbrellaHeader * header, - t_UmbrellaWindow * window, - t_UmbrellaOptions *opt, - gmx_bool bGetMinMax, real *mintmp, real *maxtmp, - t_coordselection *coordsel) +static void read_pull_xf(const char *fn, t_UmbrellaHeader * header, + t_UmbrellaWindow * window, + t_UmbrellaOptions *opt, + gmx_bool bGetMinMax, real *mintmp, real *maxtmp, + t_coordselection *coordsel) { double **y = nullptr, pos = 0., t, force, time0 = 0., dt; int ny, nt, bins, ibin, i, g, gUsed, dstep = 1; @@ -2533,9 +2521,9 @@ void read_pull_xf(const char *fn, t_UmbrellaHeader * header, } //! read pullf-files.dat or pullx-files.dat and tpr-files.dat -void read_tpr_pullxf_files(char **fnTprs, char **fnPull, int nfiles, - t_UmbrellaHeader* header, - t_UmbrellaWindow *window, t_UmbrellaOptions *opt) +static void read_tpr_pullxf_files(char **fnTprs, char **fnPull, int nfiles, + t_UmbrellaHeader* header, + t_UmbrellaWindow *window, t_UmbrellaOptions *opt) { int i; real mintmp, maxtmp; @@ -2622,7 +2610,7 @@ void read_tpr_pullxf_files(char **fnTprs, char **fnPull, int nfiles, * Note: Here we consider tau[int] := int_0^inf ACF(t) as the integrated autocorrelation times. * The factor `g := 1 + 2*tau[int]` subsequently enters the uncertainty. */ -void readIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins, const char* fn) +static void readIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins, const char* fn) { int nlines, ny, i, ig; double **iact; @@ -2665,7 +2653,7 @@ void readIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins, con * If opt->bAllowReduceIact==FALSE, the ACTs are never reduced, only increased * by the smoothing */ -void smoothIact(t_UmbrellaWindow *window, int nwins, t_UmbrellaOptions *opt) +static void smoothIact(t_UmbrellaWindow *window, int nwins, t_UmbrellaOptions *opt) { int i, ig, j, jg; double pos, dpos2, siglim, siglim2, gaufact, invtwosig2, w, weight, tausm; @@ -2719,8 +2707,8 @@ void smoothIact(t_UmbrellaWindow *window, int nwins, t_UmbrellaOptions *opt) /*! \brief Try to compute the autocorrelation time for each umbrealla window */ -void calcIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins, - t_UmbrellaOptions *opt, const char *fn, const char *xlabel) +static void calcIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins, + t_UmbrellaOptions *opt, const char *fn, const char *xlabel) { int i, ig, ncorr, ntot, j, k, *count, restart; real *corr, c0, dt, tmp; @@ -2887,7 +2875,7 @@ void calcIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins, /*! \brief * compute average and sigma of each umbrella histogram */ -void averageSigma(t_UmbrellaWindow *window, int nwins) +static void averageSigma(t_UmbrellaWindow *window, int nwins) { int i, ig, ntot, k; real av, sum2, sig, diff, *ztime, nSamplesIndep; @@ -2936,7 +2924,7 @@ void averageSigma(t_UmbrellaWindow *window, int nwins) /*! \brief * Use histograms to compute average force on pull group. */ -void computeAverageForce(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptions *opt) +static void computeAverageForce(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptions *opt) { int i, j, bins = opt->bins, k; double dz, min = opt->min, max = opt->max, displAv, temp, distance, ztot, ztot_half, w, weight; @@ -2999,8 +2987,8 @@ void computeAverageForce(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptio /*! \brief * Check if the complete reaction coordinate is covered by the histograms */ -void checkReactionCoordinateCovered(t_UmbrellaWindow *window, int nwins, - t_UmbrellaOptions *opt) +static void checkReactionCoordinateCovered(t_UmbrellaWindow *window, int nwins, + t_UmbrellaOptions *opt) { int i, ig, j, bins = opt->bins, bBoundary; real avcount = 0, z, relcount, *count; @@ -3042,7 +3030,7 @@ void checkReactionCoordinateCovered(t_UmbrellaWindow *window, int nwins, * * This speeds up the convergence by roughly a factor of 2 */ -void guessPotByIntegration(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptions *opt, const char *xlabel) +static void guessPotByIntegration(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptions *opt, const char *xlabel) { int i, j, ig, bins = opt->bins, nHist, winmin, groupmin; double dz, min = opt->min, *pot, pos, hispos, dist, diff, fAv, distmin, *f; @@ -3165,7 +3153,7 @@ static int wordcount(char *ptr) * * TO DO: ptr=fgets(...) is never freed (small memory leak) */ -void readPullCoordSelection(t_UmbrellaOptions *opt, char **fnTpr, int nTpr) +static void readPullCoordSelection(t_UmbrellaOptions *opt, char **fnTpr, int nTpr) { FILE *fp; int i, iline, n, len = STRLEN, temp; diff --git a/src/gromacs/gmxana/gmx_wheel.cpp b/src/gromacs/gmxana/gmx_wheel.cpp index 669b75eb7a..52d4fb8faa 100644 --- a/src/gromacs/gmxana/gmx_wheel.cpp +++ b/src/gromacs/gmxana/gmx_wheel.cpp @@ -74,7 +74,7 @@ static gmx_bool *bPhobics(int nres, char *resnm[]) return bb; } -void wheel(const char *fn, int nres, char *resnm[], int r0, real rot0, char *title) +static void wheel(const char *fn, int nres, char *resnm[], int r0, real rot0, char *title) { const real fontsize = 16; const real gray = 0.9; @@ -152,7 +152,7 @@ void wheel(const char *fn, int nres, char *resnm[], int r0, real rot0, char *tit ps_close(out); } -void wheel2(const char *fn, int nres, char *resnm[], real rot0, char *title) +static void wheel2(const char *fn, int nres, char *resnm[], real rot0, char *title) { const real fontsize = 14; const real gray = 0.9; diff --git a/src/gromacs/gmxana/gmx_xpm2ps.cpp b/src/gromacs/gmxana/gmx_xpm2ps.cpp index 90f0448fb1..185844fc9a 100644 --- a/src/gromacs/gmxana/gmx_xpm2ps.cpp +++ b/src/gromacs/gmxana/gmx_xpm2ps.cpp @@ -114,7 +114,7 @@ enum { ecSel, ecHalves, ecAdd, ecSub, ecMult, ecDiv, ecNR }; -void get_params(const char *mpin, const char *mpout, t_psrec *psr) +static void get_params(const char *mpin, const char *mpout, t_psrec *psr) { static const char *gmx_bools[BOOL_NR+1] = { "no", "yes", nullptr }; /* this must correspond to t_rgb *linecolors[] below */ @@ -197,7 +197,7 @@ t_rgb blue = { 0, 0, 1 }; /* this must correspond to *colors[] in get_params */ t_rgb *linecolors[] = { nullptr, &black, &white, nullptr }; -gmx_bool diff_maps(int nmap1, t_mapping *map1, int nmap2, t_mapping *map2) +static gmx_bool diff_maps(int nmap1, t_mapping *map1, int nmap2, t_mapping *map2) { int i; gmx_bool bDiff, bColDiff = FALSE; @@ -235,8 +235,8 @@ gmx_bool diff_maps(int nmap1, t_mapping *map1, int nmap2, t_mapping *map2) return bDiff; } -void leg_discrete(t_psdata ps, real x0, real y0, char *label, - real fontsize, char *font, int nmap, t_mapping map[]) +static void leg_discrete(t_psdata ps, real x0, real y0, char *label, + real fontsize, char *font, int nmap, t_mapping map[]) { int i; real yhh; @@ -265,10 +265,10 @@ void leg_discrete(t_psdata ps, real x0, real y0, char *label, } } -void leg_continuous(t_psdata ps, real x0, real x, real y0, char *label, - real fontsize, char *font, - int nmap, t_mapping map[], - int mapoffset) +static void leg_continuous(t_psdata ps, real x0, real x, real y0, char *label, + real fontsize, char *font, + int nmap, t_mapping map[], + int mapoffset) { int i; real xx0; @@ -309,9 +309,9 @@ void leg_continuous(t_psdata ps, real x0, real x, real y0, char *label, - boxxh/2, yhh, map[nmap-1].desc, eXCenter); } -void leg_bicontinuous(t_psdata ps, real x0, real x, real y0, char *label1, - char *label2, real fontsize, char *font, - int nmap1, t_mapping map1[], int nmap2, t_mapping map2[]) +static void leg_bicontinuous(t_psdata ps, real x0, real x, real y0, char *label1, + char *label2, real fontsize, char *font, + int nmap1, t_mapping map1[], int nmap2, t_mapping map2[]) { real xx1, xx2, x1, x2; @@ -636,8 +636,8 @@ static void box_dim(int nmat, t_matrix mat[], t_matrix *mat2, t_psrec *psr, *dh = dhh; } -int add_maps(t_mapping **newmap, - int nmap1, t_mapping map1[], int nmap2, t_mapping map2[]) +static int add_maps(t_mapping **newmap, + int nmap1, t_mapping map1[], int nmap2, t_mapping map2[]) { static char mapper[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+{}|;:',<.>/?"; int nsymbols; @@ -683,8 +683,8 @@ int add_maps(t_mapping **newmap, return nmap; } -void xpm_mat(const char *outf, int nmat, t_matrix *mat, t_matrix *mat2, - gmx_bool bDiag, gmx_bool bFirstDiag) +static void xpm_mat(const char *outf, int nmat, t_matrix *mat, t_matrix *mat2, + gmx_bool bDiag, gmx_bool bFirstDiag) { FILE *out; int i, x, y, col; @@ -786,11 +786,11 @@ static void tick_spacing(int n, real axis[], real offset, char axisnm, axisnm, *major, *minor); } -void ps_mat(const char *outf, int nmat, t_matrix mat[], t_matrix mat2[], - gmx_bool bFrame, gmx_bool bDiag, gmx_bool bFirstDiag, - gmx_bool bTitle, gmx_bool bTitleOnce, gmx_bool bYonce, int elegend, - real size, real boxx, real boxy, const char *m2p, const char *m2pout, - int mapoffset) +static void ps_mat(const char *outf, int nmat, t_matrix mat[], t_matrix mat2[], + gmx_bool bFrame, gmx_bool bDiag, gmx_bool bFirstDiag, + gmx_bool bTitle, gmx_bool bTitleOnce, gmx_bool bYonce, int elegend, + real size, real boxx, real boxy, const char *m2p, const char *m2pout, + int mapoffset) { const char *libm2p; char *legend; @@ -1056,7 +1056,7 @@ void ps_mat(const char *outf, int nmat, t_matrix mat[], t_matrix mat2[], ps_close(out); } -void make_axis_labels(int nmat, t_matrix *mat) +static void make_axis_labels(int nmat, t_matrix *mat) { int i, j; @@ -1083,7 +1083,7 @@ void make_axis_labels(int nmat, t_matrix *mat) } } -void prune_mat(int nmat, t_matrix *mat, t_matrix *mat2, int skip) +static void prune_mat(int nmat, t_matrix *mat, t_matrix *mat2, int skip) { int i, x, y, xs, ys; @@ -1138,7 +1138,7 @@ void prune_mat(int nmat, t_matrix *mat, t_matrix *mat2, int skip) } } -void zero_lines(int nmat, t_matrix *mat, t_matrix *mat2) +static void zero_lines(int nmat, t_matrix *mat, t_matrix *mat2) { int i, x, y, m; t_matrix *mats; @@ -1179,9 +1179,9 @@ void zero_lines(int nmat, t_matrix *mat, t_matrix *mat2) } } -void write_combined_matrix(int ecombine, const char *fn, - int nmat, t_matrix *mat1, t_matrix *mat2, - real *cmin, real *cmax) +static void write_combined_matrix(int ecombine, const char *fn, + int nmat, t_matrix *mat1, t_matrix *mat2, + real *cmin, real *cmax) { int i, j, k, nlevels; FILE *out; @@ -1262,12 +1262,12 @@ void write_combined_matrix(int ecombine, const char *fn, gmx_ffclose(out); } -void do_mat(int nmat, t_matrix *mat, t_matrix *mat2, - gmx_bool bFrame, gmx_bool bZeroLine, gmx_bool bDiag, gmx_bool bFirstDiag, gmx_bool bTitle, - gmx_bool bTitleOnce, gmx_bool bYonce, int elegend, - real size, real boxx, real boxy, - const char *epsfile, const char *xpmfile, const char *m2p, - const char *m2pout, int skip, int mapoffset) +static void do_mat(int nmat, t_matrix *mat, t_matrix *mat2, + gmx_bool bFrame, gmx_bool bZeroLine, gmx_bool bDiag, gmx_bool bFirstDiag, gmx_bool bTitle, + gmx_bool bTitleOnce, gmx_bool bYonce, int elegend, + real size, real boxx, real boxy, + const char *epsfile, const char *xpmfile, const char *m2p, + const char *m2pout, int skip, int mapoffset) { int i, j, k; @@ -1318,7 +1318,7 @@ void do_mat(int nmat, t_matrix *mat, t_matrix *mat2, } } -void gradient_map(rvec grad, int nmap, t_mapping map[]) +static void gradient_map(rvec grad, int nmap, t_mapping map[]) { int i; real c; @@ -1332,7 +1332,7 @@ void gradient_map(rvec grad, int nmap, t_mapping map[]) } } -void gradient_mat(rvec grad, int nmat, t_matrix mat[]) +static void gradient_mat(rvec grad, int nmat, t_matrix mat[]) { int m; @@ -1342,7 +1342,7 @@ void gradient_mat(rvec grad, int nmat, t_matrix mat[]) } } -void rainbow_map(gmx_bool bBlue, int nmap, t_mapping map[]) +static void rainbow_map(gmx_bool bBlue, int nmap, t_mapping map[]) { int i; real c, r, g, b; @@ -1388,7 +1388,7 @@ void rainbow_map(gmx_bool bBlue, int nmap, t_mapping map[]) } } -void rainbow_mat(gmx_bool bBlue, int nmat, t_matrix mat[]) +static void rainbow_mat(gmx_bool bBlue, int nmat, t_matrix mat[]) { int m; diff --git a/src/gromacs/gmxana/powerspect.cpp b/src/gromacs/gmxana/powerspect.cpp index dab5952016..442003ecdf 100644 --- a/src/gromacs/gmxana/powerspect.cpp +++ b/src/gromacs/gmxana/powerspect.cpp @@ -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,2017, 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. @@ -44,7 +44,7 @@ #include "gromacs/utility/real.h" #include "gromacs/utility/smalloc.h" -void addtoavgenergy(t_complex *list, real *result, int size, int tsteps) +static void addtoavgenergy(t_complex *list, real *result, int size, int tsteps) { int i; for (i = 0; i < size; i++) diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel.cpp b/src/gromacs/gmxlib/nonbonded/nb_kernel.cpp index 2ee2c6b845..77e36fed1b 100644 --- a/src/gromacs/gmxlib/nonbonded/nb_kernel.cpp +++ b/src/gromacs/gmxlib/nonbonded/nb_kernel.cpp @@ -119,15 +119,6 @@ nb_kernel_list_hash_init(void) return 0; } -void -nb_kernel_list_hash_destroy() -{ - sfree(kernel_list_hash); - kernel_list_hash = nullptr; - kernel_list_hash_size = 0; -} - - nb_kernel_t * nb_kernel_list_findkernel(FILE gmx_unused * log, const char * arch, diff --git a/src/gromacs/gmxpreprocess/add_par.cpp b/src/gromacs/gmxpreprocess/add_par.cpp index d2c2f2c667..96cf768664 100644 --- a/src/gromacs/gmxpreprocess/add_par.cpp +++ b/src/gromacs/gmxpreprocess/add_par.cpp @@ -37,6 +37,8 @@ /* This file is completely threadsafe - keep it that way! */ #include "gmxpre.h" +#include "add_par.h" + #include #include diff --git a/src/gromacs/gmxpreprocess/gen_ad.cpp b/src/gromacs/gmxpreprocess/gen_ad.cpp index 0396424d43..fe26641bc2 100644 --- a/src/gromacs/gmxpreprocess/gen_ad.cpp +++ b/src/gromacs/gmxpreprocess/gen_ad.cpp @@ -564,7 +564,7 @@ static int nb_dist(t_nextnb *nnb, int ai, int aj) return NRE; } -gmx_bool is_hydro(t_atoms *atoms, int ai) +static gmx_bool is_hydro(t_atoms *atoms, int ai) { return ((*(atoms->atomname[ai]))[0] == 'H'); } diff --git a/src/gromacs/gmxpreprocess/genhydro.cpp b/src/gromacs/gmxpreprocess/genhydro.cpp index 4d58b30b82..5f6643ec3a 100644 --- a/src/gromacs/gmxpreprocess/genhydro.cpp +++ b/src/gromacs/gmxpreprocess/genhydro.cpp @@ -108,7 +108,7 @@ static void hacksearch_atom(int *ii, int *jj, char *name, return; } -void dump_ab(FILE *out, int natom, int nab[], t_hack *ab[], gmx_bool bHeader) +static void dump_ab(FILE *out, int natom, int nab[], t_hack *ab[], gmx_bool bHeader) { int i, j; diff --git a/src/gromacs/gmxpreprocess/grompp.cpp b/src/gromacs/gmxpreprocess/grompp.cpp index 59e4f73743..bc47e738fd 100644 --- a/src/gromacs/gmxpreprocess/grompp.cpp +++ b/src/gromacs/gmxpreprocess/grompp.cpp @@ -1070,7 +1070,7 @@ static int nrdf_internal(t_atoms *atoms) return nrdf; } -void +static void spline1d( double dx, double * y, int n, @@ -1100,7 +1100,7 @@ spline1d( double dx, } -void +static void interpolate1d( double xmin, double dx, double * ya, @@ -1122,7 +1122,7 @@ interpolate1d( double xmin, } -void +static void setup_cmap (int grid_spacing, int nc, real * grid, @@ -1200,7 +1200,7 @@ setup_cmap (int grid_spacing, } } -void init_cmap_grid(gmx_cmap_t *cmap_grid, int ngrid, int grid_spacing) +static void init_cmap_grid(gmx_cmap_t *cmap_grid, int ngrid, int grid_spacing) { int i, nelem; diff --git a/src/gromacs/gmxpreprocess/hackblock.cpp b/src/gromacs/gmxpreprocess/hackblock.cpp index d9d3daf849..cf81e0e10c 100644 --- a/src/gromacs/gmxpreprocess/hackblock.cpp +++ b/src/gromacs/gmxpreprocess/hackblock.cpp @@ -200,7 +200,7 @@ static gmx_bool contains_char(t_rbonded *s, char c) return bRet; } -int +static int rbonded_find_atoms_in_list(t_rbonded *b, t_rbonded blist[], int nlist, int natoms) { int i, k; diff --git a/src/gromacs/gmxpreprocess/hizzie.cpp b/src/gromacs/gmxpreprocess/hizzie.cpp index a6800c5221..5dfbe4947b 100644 --- a/src/gromacs/gmxpreprocess/hizzie.cpp +++ b/src/gromacs/gmxpreprocess/hizzie.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2017, 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. @@ -37,6 +37,8 @@ /* This file is completely threadsafe - keep it that way! */ #include "gmxpre.h" +#include "hizzie.h" + #include #include diff --git a/src/gromacs/gmxpreprocess/hizzie.h b/src/gromacs/gmxpreprocess/hizzie.h index 5bdcb8801c..7de66843a9 100644 --- a/src/gromacs/gmxpreprocess/hizzie.h +++ b/src/gromacs/gmxpreprocess/hizzie.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2017, 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. @@ -38,6 +38,9 @@ #ifndef GMX_GMXPREPROCESS_HIZZIE_H #define GMX_GMXPREPROCESS_HIZZIE_H +#include "gromacs/math/vectypes.h" +#include "gromacs/topology/atoms.h" + void set_histp(t_atoms *pdba, rvec *x, real angle, real distance); /* calculate HIStidine protonation state */ diff --git a/src/gromacs/gmxpreprocess/pdb2gmx.cpp b/src/gromacs/gmxpreprocess/pdb2gmx.cpp index 91841dc7c0..ab093624d9 100644 --- a/src/gromacs/gmxpreprocess/pdb2gmx.cpp +++ b/src/gromacs/gmxpreprocess/pdb2gmx.cpp @@ -500,7 +500,7 @@ static void check_occupancy(t_atoms *atoms, const char *filename, gmx_bool bVerb } } -void write_posres(char *fn, t_atoms *pdba, real fc) +static void write_posres(char *fn, t_atoms *pdba, real fc) { FILE *fp; int i; @@ -598,12 +598,12 @@ static int read_pdball(const char *inf, const char *outf, char *title, return natom; } -void process_chain(t_atoms *pdba, rvec *x, - gmx_bool bTrpU, gmx_bool bPheU, gmx_bool bTyrU, - gmx_bool bLysMan, gmx_bool bAspMan, gmx_bool bGluMan, - gmx_bool bHisMan, gmx_bool bArgMan, gmx_bool bGlnMan, - real angle, real distance, t_symtab *symtab, - int nrr, const rtprename_t *rr) +static void process_chain(t_atoms *pdba, rvec *x, + gmx_bool bTrpU, gmx_bool bPheU, gmx_bool bTyrU, + gmx_bool bLysMan, gmx_bool bAspMan, gmx_bool bGluMan, + gmx_bool bHisMan, gmx_bool bArgMan, gmx_bool bGlnMan, + real angle, real distance, t_symtab *symtab, + int nrr, const rtprename_t *rr) { /* Rename aromatics, lys, asp and histidine */ if (bTyrU) @@ -677,7 +677,7 @@ typedef struct { char altloc; /* alternate location indicator */ } t_pdbindex; -int pdbicomp(const void *a, const void *b) +static int pdbicomp(const void *a, const void *b) { t_pdbindex *pa, *pb; int d; @@ -859,8 +859,8 @@ static int remove_duplicate_atoms(t_atoms *pdba, rvec x[], gmx_bool bVerbose) return pdba->nr; } -void find_nc_ter(t_atoms *pdba, int r0, int r1, int *r_start, int *r_end, - gmx_residuetype_t *rt) +static void find_nc_ter(t_atoms *pdba, int r0, int r1, int *r_start, int *r_end, + gmx_residuetype_t *rt) { int i; const char *p_startrestype; diff --git a/src/gromacs/gmxpreprocess/pdb2top.cpp b/src/gromacs/gmxpreprocess/pdb2top.cpp index dad86e404a..5686b15245 100644 --- a/src/gromacs/gmxpreprocess/pdb2top.cpp +++ b/src/gromacs/gmxpreprocess/pdb2top.cpp @@ -962,7 +962,7 @@ static void check_restp_types(t_restp *r0, t_restp *r1) } } -void add_atom_to_restp(t_restp *restp, int at_start, const t_hack *hack) +static void add_atom_to_restp(t_restp *restp, int at_start, const t_hack *hack) { char buf[STRLEN]; int k; diff --git a/src/gromacs/gmxpreprocess/readir.cpp b/src/gromacs/gmxpreprocess/readir.cpp index 0af04f7cc3..e30ff84b90 100644 --- a/src/gromacs/gmxpreprocess/readir.cpp +++ b/src/gromacs/gmxpreprocess/readir.cpp @@ -1716,8 +1716,8 @@ static void add_wall_energrps(gmx_groups_t *groups, int nwall, t_symtab *symtab) } } -void read_expandedparams(int *ninp_p, t_inpfile **inp_p, - t_expanded *expand, warninp_t wi) +static void read_expandedparams(int *ninp_p, t_inpfile **inp_p, + t_expanded *expand, warninp_t wi) { int ninp; t_inpfile *inp; @@ -3197,7 +3197,7 @@ static void make_swap_groups( } -void make_IMD_group(t_IMD *IMDgroup, char *IMDgname, t_blocka *grps, char **gnames) +static void make_IMD_group(t_IMD *IMDgroup, char *IMDgname, t_blocka *grps, char **gnames) { int ig, i; diff --git a/src/gromacs/gmxpreprocess/resall.cpp b/src/gromacs/gmxpreprocess/resall.cpp index a821f64617..689eae682f 100644 --- a/src/gromacs/gmxpreprocess/resall.cpp +++ b/src/gromacs/gmxpreprocess/resall.cpp @@ -178,7 +178,7 @@ static gmx_bool read_atoms(FILE *in, char *line, return TRUE; } -gmx_bool read_bondeds(int bt, FILE *in, char *line, t_restp *rtp) +static gmx_bool read_bondeds(int bt, FILE *in, char *line, t_restp *rtp) { char str[STRLEN]; int j, n, ni, maxrb; @@ -260,7 +260,7 @@ static void check_rtp(int nrtp, t_restp rtp[], char *libfn) } } -int get_bt(char* header) +static int get_bt(char* header) { int i; @@ -274,13 +274,13 @@ int get_bt(char* header) return NOTSET; } -void clear_t_restp(t_restp *rrtp) +static void clear_t_restp(t_restp *rrtp) { memset((void *)rrtp, 0, sizeof(t_restp)); } /* print all the ebtsNR type numbers */ -void print_resall_header(FILE *out, t_restp rtp[]) +static void print_resall_header(FILE *out, t_restp rtp[]) { fprintf(out, "[ bondedtypes ]\n"); fprintf(out, "; bonds angles dihedrals impropers all_dihedrals nr_exclusions HH14 remove_dih\n"); diff --git a/src/gromacs/gmxpreprocess/ter_db.cpp b/src/gromacs/gmxpreprocess/ter_db.cpp index 1af82e44ce..079726dc03 100644 --- a/src/gromacs/gmxpreprocess/ter_db.cpp +++ b/src/gromacs/gmxpreprocess/ter_db.cpp @@ -62,7 +62,7 @@ const char *kw_names[ekwNR] = { "replace", "add", "delete" }; -int find_kw(char *keyw) +static int find_kw(char *keyw) { int i; diff --git a/src/gromacs/gmxpreprocess/topio.cpp b/src/gromacs/gmxpreprocess/topio.cpp index dc4f779cf3..905e27da4e 100644 --- a/src/gromacs/gmxpreprocess/topio.cpp +++ b/src/gromacs/gmxpreprocess/topio.cpp @@ -396,7 +396,7 @@ static char ** cpp_opts(const char *define, const char *include, } -int +static int find_gb_bondlength(t_params *plist, int ai, int aj, real *length) { int i, j, a1, a2; @@ -428,7 +428,7 @@ find_gb_bondlength(t_params *plist, int ai, int aj, real *length) } -int +static int find_gb_anglelength(t_params *plist, int ai, int ak, real *length) { int i, j, a1, a2, a3; @@ -472,7 +472,7 @@ find_gb_anglelength(t_params *plist, int ai, int ak, real *length) return status; } -int +static int generate_gb_exclusion_interactions(t_molinfo *mi, gpp_atomtype_t atype, t_nextnb *nnb) { int j, n, ai, aj, ti, tj; diff --git a/src/gromacs/gmxpreprocess/toppush.cpp b/src/gromacs/gmxpreprocess/toppush.cpp index 97d45b1dcf..2abdf80903 100644 --- a/src/gromacs/gmxpreprocess/toppush.cpp +++ b/src/gromacs/gmxpreprocess/toppush.cpp @@ -1344,7 +1344,7 @@ static void push_atom_now(t_symtab *symtab, t_atoms *at, int atomnr, at->nr++; } -void push_cg(t_block *block, int *lastindex, int index, int a) +static void push_cg(t_block *block, int *lastindex, int index, int a) { if (debug) { diff --git a/src/gromacs/gmxpreprocess/toputil.cpp b/src/gromacs/gmxpreprocess/toputil.cpp index 1574962e56..6e84f4a3af 100644 --- a/src/gromacs/gmxpreprocess/toputil.cpp +++ b/src/gromacs/gmxpreprocess/toputil.cpp @@ -182,7 +182,7 @@ void init_molinfo(t_molinfo *mol) /* FREEING MEMORY */ -void done_bt (t_params *pl) +static void done_bt (t_params *pl) { sfree(pl->param); } @@ -202,9 +202,9 @@ void done_mi(t_molinfo *mi) /* PRINTING STRUCTURES */ -void print_bt(FILE *out, directive d, gpp_atomtype_t at, - int ftype, int fsubtype, t_params plist[], - gmx_bool bFullDih) +static void print_bt(FILE *out, directive d, gpp_atomtype_t at, + int ftype, int fsubtype, t_params plist[], + gmx_bool bFullDih) { /* This dihp is a DIRTY patch because the dih-types do not use * all four atoms to determine the type. diff --git a/src/gromacs/gmxpreprocess/x2top.cpp b/src/gromacs/gmxpreprocess/x2top.cpp index 3f17b1ff68..e9e85fb4a0 100644 --- a/src/gromacs/gmxpreprocess/x2top.cpp +++ b/src/gromacs/gmxpreprocess/x2top.cpp @@ -101,9 +101,9 @@ static gmx_bool is_bond(int nnm, t_nm2type nmt[], char *ai, char *aj, real blen) return FALSE; } -void mk_bonds(int nnm, t_nm2type nmt[], - t_atoms *atoms, const rvec x[], t_params *bond, int nbond[], - gmx_bool bPBC, matrix box) +static void mk_bonds(int nnm, t_nm2type nmt[], + t_atoms *atoms, const rvec x[], t_params *bond, int nbond[], + gmx_bool bPBC, matrix box) { t_param b; int i, j; @@ -164,7 +164,7 @@ void mk_bonds(int nnm, t_nm2type nmt[], fflush(stderr); } -int *set_cgnr(t_atoms *atoms, gmx_bool bUsePDBcharge, real *qtot, real *mtot) +static int *set_cgnr(t_atoms *atoms, gmx_bool bUsePDBcharge, real *qtot, real *mtot) { int i, n = 1; int *cgnr; @@ -191,8 +191,8 @@ int *set_cgnr(t_atoms *atoms, gmx_bool bUsePDBcharge, real *qtot, real *mtot) return cgnr; } -gpp_atomtype_t set_atom_type(t_symtab *tab, t_atoms *atoms, t_params *bonds, - int *nbonds, int nnm, t_nm2type nm2t[]) +static gpp_atomtype_t set_atom_type(t_symtab *tab, t_atoms *atoms, t_params *bonds, + int *nbonds, int nnm, t_nm2type nm2t[]) { gpp_atomtype_t atype; int nresolved; @@ -212,8 +212,8 @@ gpp_atomtype_t set_atom_type(t_symtab *tab, t_atoms *atoms, t_params *bonds, return atype; } -void lo_set_force_const(t_params *plist, real c[], int nrfp, gmx_bool bRound, - gmx_bool bDih, gmx_bool bParam) +static void lo_set_force_const(t_params *plist, real c[], int nrfp, gmx_bool bRound, + gmx_bool bDih, gmx_bool bParam) { int i, j; double cc; @@ -262,8 +262,8 @@ void lo_set_force_const(t_params *plist, real c[], int nrfp, gmx_bool bRound, } } -void set_force_const(t_params plist[], real kb, real kt, real kp, gmx_bool bRound, - gmx_bool bParam) +static void set_force_const(t_params plist[], real kb, real kt, real kp, gmx_bool bRound, + gmx_bool bParam) { real c[MAXFORCEPARAM]; @@ -277,8 +277,8 @@ void set_force_const(t_params plist[], real kb, real kt, real kp, gmx_bool bRoun lo_set_force_const(&plist[F_PDIHS], c, 3, bRound, TRUE, bParam); } -void calc_angles_dihs(t_params *ang, t_params *dih, const rvec x[], gmx_bool bPBC, - matrix box) +static void calc_angles_dihs(t_params *ang, t_params *dih, const rvec x[], gmx_bool bPBC, + matrix box) { int i, ai, aj, ak, al, t1, t2, t3; rvec r_ij, r_kj, r_kl, m, n; diff --git a/src/gromacs/gpu_utils/ocl_compiler.cpp b/src/gromacs/gpu_utils/ocl_compiler.cpp index 1f92b88f5e..76f439e1bd 100644 --- a/src/gromacs/gpu_utils/ocl_compiler.cpp +++ b/src/gromacs/gpu_utils/ocl_compiler.cpp @@ -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,2017, 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. @@ -366,7 +366,7 @@ static std::string makeKernelIncludePathOption(const std::string &unescapedKerne /*! \brief Builds a string with build options for the OpenCL kernels * * \throws std::bad_alloc if out of memory. */ -std::string +static std::string makePreprocessorOptions(const std::string &kernelRootPath, size_t warpSize, ocl_vendor_id_t deviceVendorId, diff --git a/src/gromacs/gpu_utils/oclutils.cpp b/src/gromacs/gpu_utils/oclutils.cpp index d757f70502..0e38ddb8ea 100644 --- a/src/gromacs/gpu_utils/oclutils.cpp +++ b/src/gromacs/gpu_utils/oclutils.cpp @@ -115,11 +115,11 @@ int ocl_copy_H2D(cl_mem d_dest, void * h_src, * identifying this particular device to host operation. The event can further * be used to queue a wait for this operation or to query profiling information. */ -int ocl_copy_D2H_generic(void * h_dest, cl_mem d_src, - size_t offset, size_t bytes, - bool bAsync, - cl_command_queue command_queue, - cl_event *copy_event) +static int ocl_copy_D2H_generic(void * h_dest, cl_mem d_src, + size_t offset, size_t bytes, + bool bAsync, + cl_command_queue command_queue, + cl_event *copy_event) { cl_int gmx_unused cl_error; diff --git a/src/gromacs/listed-forces/bonded.cpp b/src/gromacs/listed-forces/bonded.cpp index 0bcb39212a..4b05207a80 100644 --- a/src/gromacs/listed-forces/bonded.cpp +++ b/src/gromacs/listed-forces/bonded.cpp @@ -330,8 +330,8 @@ real FENE_bonds(int nbonds, return vtot; } -real harmonic(real kA, real kB, real xA, real xB, real x, real lambda, - real *V, real *F) +static real harmonic(real kA, real kB, real xA, real xB, real x, real lambda, + real *V, real *F) { const real half = 0.5; real L1, kk, x0, dx, dx2; @@ -1659,8 +1659,8 @@ do_dih_fup_noshiftf_simd(const int *ai, const int *aj, const int *ak, const int } #endif // GMX_SIMD_HAVE_REAL -real dopdihs(real cpA, real cpB, real phiA, real phiB, int mult, - real phi, real lambda, real *V, real *F) +static real dopdihs(real cpA, real cpB, real phiA, real phiB, int mult, + real phi, real lambda, real *V, real *F) { real v, dvdlambda, mdphi, v1, sdphi, ddphi; real L1 = 1.0 - lambda; @@ -3259,8 +3259,8 @@ cmap_dihs(int nbonds, * G R O M O S 9 6 F U N C T I O N S * ***********************************************************/ -real g96harmonic(real kA, real kB, real xA, real xB, real x, real lambda, - real *V, real *F) +static real g96harmonic(real kA, real kB, real xA, real xB, real x, real lambda, + real *V, real *F) { const real half = 0.5; real L1, kk, x0, dx, dx2; @@ -3340,9 +3340,9 @@ real g96bonds(int nbonds, return vtot; } -real g96bond_angle(const rvec xi, const rvec xj, const rvec xk, const t_pbc *pbc, - rvec r_ij, rvec r_kj, - int *t1, int *t2) +static real g96bond_angle(const rvec xi, const rvec xj, const rvec xk, const t_pbc *pbc, + rvec r_ij, rvec r_kj, + int *t1, int *t2) /* Return value is the angle between the bonds i-j and j-k */ { real costh; diff --git a/src/gromacs/listed-forces/pairs.cpp b/src/gromacs/listed-forces/pairs.cpp index 1b0827e98e..08e6844cdd 100644 --- a/src/gromacs/listed-forces/pairs.cpp +++ b/src/gromacs/listed-forces/pairs.cpp @@ -94,7 +94,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 */ -real +static real evaluate_single(real r2, real tabscale, real *vftab, real tableStride, real qq, real c6, real c12, real *velec, real *vvdw) { @@ -143,7 +143,7 @@ evaluate_single(real r2, real tabscale, real *vftab, real tableStride, } /*! \brief Compute the energy and force for a single pair interaction under FEP */ -real +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 qqA, real c6A, real c12A, real qqB, diff --git a/src/gromacs/mdlib/clincs.cpp b/src/gromacs/mdlib/clincs.cpp index 2b7844c56b..7a0d823b96 100644 --- a/src/gromacs/mdlib/clincs.cpp +++ b/src/gromacs/mdlib/clincs.cpp @@ -1254,7 +1254,7 @@ static void set_lincs_matrix_task(struct gmx_lincsdata *li, } /* Sets the elements in the LINCS matrix */ -void set_lincs_matrix(struct gmx_lincsdata *li, real *invmass, real lambda) +static void set_lincs_matrix(struct gmx_lincsdata *li, real *invmass, real lambda) { int i; const real invsqrt2 = 0.7071067811865475244; diff --git a/src/gromacs/mdlib/expanded.cpp b/src/gromacs/mdlib/expanded.cpp index 4edb6b1c8e..7493e6ef37 100644 --- a/src/gromacs/mdlib/expanded.cpp +++ b/src/gromacs/mdlib/expanded.cpp @@ -169,36 +169,7 @@ static void GenerateWeightedGibbsProbabilities(real *ene, double *p_k, double *p sfree(nene); } -real do_logsum(int N, real *a_n) -{ - - /* RETURN VALUE */ - /* log(\sum_{i=0}^(N-1) exp[a_n]) */ - real maxarg; - real sum; - int i; - real logsum; - /* compute maximum argument to exp(.) */ - - maxarg = a_n[0]; - for (i = 1; i < N; i++) - { - maxarg = std::max(maxarg, a_n[i]); - } - - /* compute sum of exp(a_n - maxarg) */ - sum = 0.0; - for (i = 0; i < N; i++) - { - sum = sum + std::exp(a_n[i] - maxarg); - } - - /* compute log sum */ - logsum = std::log(sum) + maxarg; - return logsum; -} - -int FindMinimum(real *min_metric, int N) +static int FindMinimum(real *min_metric, int N) { real min_val; diff --git a/src/gromacs/mdlib/genborn.cpp b/src/gromacs/mdlib/genborn.cpp index 38ee8a833f..e71150331c 100644 --- a/src/gromacs/mdlib/genborn.cpp +++ b/src/gromacs/mdlib/genborn.cpp @@ -1131,8 +1131,8 @@ real gb_bonds_tab(rvec x[], rvec f[], rvec fshift[], real *charge, real *p_gbtab return vctot; } -real calc_gb_selfcorrections(t_commrec *cr, int natoms, - real *charge, gmx_genborn_t *born, real *dvda, double facel) +static real calc_gb_selfcorrections(t_commrec *cr, int natoms, + real *charge, gmx_genborn_t *born, real *dvda, double facel) { int i, ai, at0, at1; real rai, e, derb, q, q2, fi, rai_inv, vtot; @@ -1177,8 +1177,8 @@ real calc_gb_selfcorrections(t_commrec *cr, int natoms, } -real calc_gb_nonpolar(t_commrec *cr, t_forcerec *fr, int natoms, gmx_genborn_t *born, gmx_localtop_t *top, - real *dvda, t_mdatoms *md) +static real calc_gb_nonpolar(t_commrec *cr, t_forcerec *fr, int natoms, gmx_genborn_t *born, gmx_localtop_t *top, + real *dvda, t_mdatoms *md) { int ai, i, at0, at1; real e, es, rai, term, probe, tmp, factor; @@ -1224,8 +1224,8 @@ real calc_gb_nonpolar(t_commrec *cr, t_forcerec *fr, int natoms, gmx_genborn_t * -real calc_gb_chainrule(int natoms, t_nblist *nl, real *dadx, real *dvda, rvec x[], rvec t[], rvec fshift[], - rvec shift_vec[], int gb_algorithm, gmx_genborn_t *born) +static real calc_gb_chainrule(int natoms, t_nblist *nl, real *dadx, real *dvda, rvec x[], rvec t[], rvec fshift[], + rvec shift_vec[], int gb_algorithm, gmx_genborn_t *born) { int i, k, n, ai, aj, nj0, nj1, n0, n1; int shift; diff --git a/src/gromacs/mdlib/mdebin_bar.cpp b/src/gromacs/mdlib/mdebin_bar.cpp index f50e0c61dc..1b45587910 100644 --- a/src/gromacs/mdlib/mdebin_bar.cpp +++ b/src/gromacs/mdlib/mdebin_bar.cpp @@ -208,7 +208,7 @@ static void mde_delta_h_make_hist(t_mde_delta_h *dh, int hi, gmx_bool invert) } -void mde_delta_h_handle_block(t_mde_delta_h *dh, t_enxblock *blk) +static void mde_delta_h_handle_block(t_mde_delta_h *dh, t_enxblock *blk) { /* first check which type we should use: histogram or raw data */ if (dh->nhist == 0) diff --git a/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu index 940d7b5b34..4df4cdf49f 100644 --- a/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu +++ b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu @@ -51,6 +51,8 @@ #endif +#include "nbnxn_cuda.h" + #include "gromacs/gpu_utils/cudautils.cuh" #include "gromacs/mdlib/force_flags.h" #include "gromacs/mdlib/nb_verlet.h" @@ -929,29 +931,24 @@ void nbnxn_gpu_wait_for_gpu(gmx_nbnxn_cuda_t *nb, plist->haveFreshList = false; } -/*! Return the reference to the nbfp texture. */ const struct texture &nbnxn_cuda_get_nbfp_texref() { assert(!c_disableCudaTextures); return nbfp_texref; } -/*! Return the reference to the nbfp_comb texture. */ const struct texture &nbnxn_cuda_get_nbfp_comb_texref() { assert(!c_disableCudaTextures); return nbfp_comb_texref; } -/*! Return the reference to the coulomb_tab. */ const struct texture &nbnxn_cuda_get_coulomb_tab_texref() { assert(!c_disableCudaTextures); return coulomb_tab_texref; } -/*! Set up the cache configuration for the non-bonded kernels, - */ void nbnxn_cuda_set_cacheconfig(const gmx_device_info_t *devinfo) { cudaError_t stat; diff --git a/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h new file mode 100644 index 0000000000..ba70b3a8ed --- /dev/null +++ b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h @@ -0,0 +1,53 @@ +/* + * This file is part of the GROMACS molecular simulation package. + * + * Copyright (c) 2017, 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. + * + * GROMACS is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * GROMACS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GROMACS; if not, see + * http://www.gnu.org/licenses, or write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * If you want to redistribute modifications to GROMACS, please + * consider that scientific software is very special. Version + * control is crucial - bugs must be traceable. We will be happy to + * consider code for inclusion in the official distribution, but + * derived work must not be called official GROMACS. Details are found + * in the README & COPYING files - if they are missing, get the + * official version at http://www.gromacs.org. + * + * To help us fund GROMACS development, we humbly ask that you cite + * the research papers on the package. Check out http://www.gromacs.org. + */ +/*! \internal \file + * \brief + * Declares nbnxn cuda cache and texture helper functions + */ +#ifndef GMX_MDLIB_NBNXN_CUDA_NBNXN_CUDA_H +#define GMX_MDLIB_NBNXN_CUDA_NBNXN_CUDA_H + +#include "nbnxn_cuda_types.h" + +//! Set up the cache configuration for the non-bonded kernels. +void nbnxn_cuda_set_cacheconfig(const gmx_device_info_t *devinfo); +//! Return the reference to the nbfp texture. +const struct texture &nbnxn_cuda_get_nbfp_texref(); +//! Return the reference to the nbfp_comb texture. +const struct texture &nbnxn_cuda_get_nbfp_comb_texref(); +//! Return the reference to the coulomb_tab. +const struct texture &nbnxn_cuda_get_coulomb_tab_texref(); + +#endif diff --git a/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu index 9f951b344a..5aa1db803f 100644 --- a/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu +++ b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu @@ -63,6 +63,7 @@ #include "gromacs/utility/real.h" #include "gromacs/utility/smalloc.h" +#include "nbnxn_cuda.h" #include "nbnxn_cuda_types.h" static bool bUseCudaEventBlockingSync = false; /* makes the CPU thread block */ @@ -77,13 +78,6 @@ static bool bUseCudaEventBlockingSync = false; /* makes the CPU thread block */ */ static unsigned int gpu_min_ci_balanced_factor = 44; -/* Functions from nbnxn_cuda.cu */ -extern void nbnxn_cuda_set_cacheconfig(const gmx_device_info_t *devinfo); -extern const struct texture &nbnxn_cuda_get_nbfp_texref(); -extern const struct texture &nbnxn_cuda_get_nbfp_comb_texref(); -extern const struct texture &nbnxn_cuda_get_coulomb_tab_texref(); - - /* Fw. decl. */ static void nbnxn_cuda_clear_e_fshift(gmx_nbnxn_cuda_t *nb); diff --git a/src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl.cpp b/src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl.cpp index 7a4608bb7c..4e4f618b4f 100644 --- a/src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl.cpp +++ b/src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl.cpp @@ -345,30 +345,12 @@ static void fillin_ocl_structures(cl_nbparam_t *nbp, nbparams_params->vdw_switch = nbp->vdw_switch; } -/*! \brief Waits for the commands associated with the input event to finish. - * Then it releases the event and sets it to 0. - * Don't use this function when more than one wait will be issued for the event. - */ -void wait_ocl_event(cl_event *ocl_event) -{ - cl_int gmx_unused cl_error; - - /* Blocking wait for the event */ - cl_error = clWaitForEvents(1, ocl_event); - assert(CL_SUCCESS == cl_error); - - /* Release event and reset it to 0 */ - cl_error = clReleaseEvent(*ocl_event); - assert(CL_SUCCESS == cl_error); - *ocl_event = 0; -} - /*! \brief Enqueues a wait for event completion. * * Then it releases the event and sets it to 0. * Don't use this function when more than one wait will be issued for the event. * Equivalent to Cuda Stream Sync. */ -void sync_ocl_event(cl_command_queue stream, cl_event *ocl_event) +static void sync_ocl_event(cl_command_queue stream, cl_event *ocl_event) { cl_int gmx_unused cl_error; @@ -395,7 +377,7 @@ void sync_ocl_event(cl_command_queue stream, cl_event *ocl_event) * The function returns 0.0 if the input event, *ocl_event, is 0. * Don't use this function when more than one wait will be issued for the event. */ -double ocl_event_elapsed_ms(cl_event *ocl_event) +static double ocl_event_elapsed_ms(cl_event *ocl_event) { cl_int gmx_unused cl_error; cl_ulong start_ns, end_ns; diff --git a/src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_data_mgmt.cpp b/src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_data_mgmt.cpp index 4b8f5e75fd..c765d694d1 100644 --- a/src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_data_mgmt.cpp +++ b/src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_data_mgmt.cpp @@ -96,7 +96,7 @@ bool useLjCombRule(int vdwType) * * If the pointers to the size variables are NULL no resetting happens. */ -void ocl_free_buffered(cl_mem d_ptr, int *n, int *nalloc) +static void ocl_free_buffered(cl_mem d_ptr, int *n, int *nalloc) { cl_int gmx_unused cl_error; @@ -131,14 +131,14 @@ void ocl_free_buffered(cl_mem d_ptr, int *n, int *nalloc) * for this operation or to query profiling information. * OpenCL equivalent of cu_realloc_buffered. */ -void ocl_realloc_buffered(cl_mem *d_dest, void *h_src, - size_t type_size, - int *curr_size, int *curr_alloc_size, - int req_size, - cl_context context, - cl_command_queue s, - bool bAsync = true, - cl_event *copy_event = NULL) +static void ocl_realloc_buffered(cl_mem *d_dest, void *h_src, + size_t type_size, + int *curr_size, int *curr_alloc_size, + int req_size, + cl_context context, + cl_command_queue s, + bool bAsync = true, + cl_event *copy_event = NULL) { if (d_dest == NULL || req_size < 0) { @@ -1056,7 +1056,7 @@ void nbnxn_gpu_init_atomdata(gmx_nbnxn_ocl_t *nb, } /*! \brief Releases an OpenCL kernel pointer */ -void free_kernel(cl_kernel *kernel_ptr) +static void free_kernel(cl_kernel *kernel_ptr) { cl_int gmx_unused cl_error; @@ -1072,7 +1072,7 @@ void free_kernel(cl_kernel *kernel_ptr) } /*! \brief Releases a list of OpenCL kernel pointers */ -void free_kernels(cl_kernel *kernels, int count) +static void free_kernels(cl_kernel *kernels, int count) { int i; diff --git a/src/gromacs/mdlib/ns.cpp b/src/gromacs/mdlib/ns.cpp index 9cca369a9a..53f6e5c93c 100644 --- a/src/gromacs/mdlib/ns.cpp +++ b/src/gromacs/mdlib/ns.cpp @@ -2029,7 +2029,7 @@ static int nsgrid_core(t_commrec *cr, t_forcerec *fr, return nns; } -void ns_realloc_natoms(gmx_ns_t *ns, int natoms) +static void ns_realloc_natoms(gmx_ns_t *ns, int natoms) { int i; diff --git a/src/gromacs/mdlib/nsgrid.cpp b/src/gromacs/mdlib/nsgrid.cpp index 8b6b40f0a9..1252a1a66b 100644 --- a/src/gromacs/mdlib/nsgrid.cpp +++ b/src/gromacs/mdlib/nsgrid.cpp @@ -96,9 +96,9 @@ static void calc_x_av_stddev(int n, rvec *x, rvec av, rvec stddev) } } -void get_nsgrid_boundaries_vac(real av, real stddev, - real *bound0, real *bound1, - real *bdens0, real *bdens1) +static void get_nsgrid_boundaries_vac(real av, real stddev, + real *bound0, real *bound1, + real *bdens0, real *bdens1) { /* Set the grid to 2 times the standard deviation of * the charge group centers in both directions. diff --git a/src/gromacs/mdlib/qm_orca.cpp b/src/gromacs/mdlib/qm_orca.cpp index 57d5e9fd1c..517fb01eb7 100644 --- a/src/gromacs/mdlib/qm_orca.cpp +++ b/src/gromacs/mdlib/qm_orca.cpp @@ -36,6 +36,8 @@ */ #include "gmxpre.h" +#include "qm_orca.h" + #include #include #include @@ -95,7 +97,7 @@ void init_orca(t_QMrec *qm) } -void write_orca_input(t_forcerec *fr, t_QMrec *qm, t_MMrec *mm) +static void write_orca_input(t_forcerec *fr, t_QMrec *qm, t_MMrec *mm) { int i; t_QMMMrec *QMMMrec; @@ -251,8 +253,8 @@ void write_orca_input(t_forcerec *fr, t_QMrec *qm, t_MMrec *mm) fclose(out); } /* write_orca_input */ -real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr, - t_QMrec *qm, t_MMrec *mm) +static real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr, + t_QMrec *qm, t_MMrec *mm) { int i, j, atnum; @@ -424,7 +426,7 @@ real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr, return(QMener); } -void do_orca(char *orca_dir, char *basename) +static void do_orca(char *orca_dir, char *basename) { /* make the call to the orca binary through system() diff --git a/src/gromacs/mdlib/qm_orca.h b/src/gromacs/mdlib/qm_orca.h new file mode 100644 index 0000000000..7ab55e2009 --- /dev/null +++ b/src/gromacs/mdlib/qm_orca.h @@ -0,0 +1,47 @@ +/* + * This file is part of the GROMACS molecular simulation package. + * + * Copyright (c) 2017, 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. + * + * GROMACS is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * GROMACS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GROMACS; if not, see + * http://www.gnu.org/licenses, or write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * If you want to redistribute modifications to GROMACS, please + * consider that scientific software is very special. Version + * control is crucial - bugs must be traceable. We will be happy to + * consider code for inclusion in the official distribution, but + * derived work must not be called official GROMACS. Details are found + * in the README & COPYING files - if they are missing, get the + * official version at http://www.gromacs.org. + * + * To help us fund GROMACS development, we humbly ask that you cite + * the research papers on the package. Check out http://www.gromacs.org. + */ +#include "gromacs/mdlib/qmmm.h" + +#ifndef GMX_MDLIB_QM_ORCA_H +#define GMX_MDLIB_QM_ORCA_H + +void +init_orca(t_QMrec *qm); + +real +call_orca(t_forcerec *fr, t_QMrec *qm, + t_MMrec *mm, rvec f[], rvec fshift[]); + +#endif diff --git a/src/gromacs/mdlib/qmmm.cpp b/src/gromacs/mdlib/qmmm.cpp index 7342b77999..8dc2353682 100644 --- a/src/gromacs/mdlib/qmmm.cpp +++ b/src/gromacs/mdlib/qmmm.cpp @@ -109,15 +109,7 @@ real call_gaussian(t_forcerec *fr, t_QMrec *qm, t_MMrec *mm, rvec f[], rvec fshift[]); #elif GMX_QMMM_ORCA -/* ORCA interface */ - -void -init_orca(t_QMrec *qm); - -real -call_orca(t_forcerec *fr, t_QMrec *qm, - t_MMrec *mm, rvec f[], rvec fshift[]); - +#include "gromacs/mdlib/qm_orca.h" #endif @@ -139,8 +131,8 @@ static int struct_comp(const void *a, const void *b) } /* struct_comp */ -real call_QMroutine(t_commrec gmx_unused *cr, t_forcerec gmx_unused *fr, t_QMrec gmx_unused *qm, - t_MMrec gmx_unused *mm, rvec gmx_unused f[], rvec gmx_unused fshift[]) +static real call_QMroutine(t_commrec gmx_unused *cr, t_forcerec gmx_unused *fr, t_QMrec gmx_unused *qm, + t_MMrec gmx_unused *mm, rvec gmx_unused f[], rvec gmx_unused fshift[]) { /* makes a call to the requested QM routine (qm->QMmethod) * Note that f is actually the gradient, i.e. -f @@ -192,7 +184,7 @@ real call_QMroutine(t_commrec gmx_unused *cr, t_forcerec gmx_unused *fr, t_QMrec return (QMener); } -void init_QMroutine(t_commrec gmx_unused *cr, t_QMrec gmx_unused *qm, t_MMrec gmx_unused *mm) +static void init_QMroutine(t_commrec gmx_unused *cr, t_QMrec gmx_unused *qm, t_MMrec gmx_unused *mm) { /* makes a call to the requested QM routine (qm->QMmethod) */ @@ -220,7 +212,7 @@ void init_QMroutine(t_commrec gmx_unused *cr, t_QMrec gmx_unused *qm, t_MMrec gm } } /* init_QMroutine */ -void update_QMMM_coord(rvec x[], t_forcerec *fr, t_QMrec *qm, t_MMrec *mm) +static void update_QMMM_coord(rvec x[], t_forcerec *fr, t_QMrec *qm, t_MMrec *mm) { /* shifts the QM and MM particles into the central box and stores * these shifted coordinates in the coordinate arrays of the @@ -297,14 +289,14 @@ static void punch_QMMM_excl(t_QMrec *qm, t_MMrec *mm, t_blocka *excls) /* QMMM core routines */ -t_QMrec *mk_QMrec(void) +static t_QMrec *mk_QMrec(void) { t_QMrec *qm; snew(qm, 1); return qm; } /* mk_QMrec */ -t_MMrec *mk_MMrec(void) +static t_MMrec *mk_MMrec(void) { t_MMrec *mm; snew(mm, 1); @@ -370,7 +362,7 @@ static void init_QMrec(int grpnr, t_QMrec *qm, int nr, int *atomarray, } /* init_QMrec */ -t_QMrec *copy_QMrec(t_QMrec *qm) +static t_QMrec *copy_QMrec(t_QMrec *qm) { /* copies the contents of qm into a new t_QMrec struct */ t_QMrec diff --git a/src/gromacs/mdlib/shakef.cpp b/src/gromacs/mdlib/shakef.cpp index adeb79f394..31a690df4c 100644 --- a/src/gromacs/mdlib/shakef.cpp +++ b/src/gromacs/mdlib/shakef.cpp @@ -202,13 +202,13 @@ void cshake(const int iatom[], int ncon, int *nnit, int maxnit, *nerror = error; } -int vec_shakef(FILE *fplog, gmx_shakedata_t shaked, - real invmass[], int ncon, - t_iparams ip[], t_iatom *iatom, - real tol, rvec x[], rvec prime[], real omega, - gmx_bool bFEP, real lambda, real scaled_lagrange_multiplier[], - real invdt, rvec *v, - gmx_bool bCalcVir, tensor vir_r_m_dr, int econq) +static int vec_shakef(FILE *fplog, gmx_shakedata_t shaked, + real invmass[], int ncon, + t_iparams ip[], t_iatom *iatom, + real tol, rvec x[], rvec prime[], real omega, + gmx_bool bFEP, real lambda, real scaled_lagrange_multiplier[], + real invdt, rvec *v, + gmx_bool bCalcVir, tensor vir_r_m_dr, int econq) { rvec *rij; real *half_of_reduced_mass, *distance_squared_tolerance, *constraint_distance_squared; diff --git a/src/gromacs/mdlib/sim_util.cpp b/src/gromacs/mdlib/sim_util.cpp index 6b32084ef8..8bd347ed45 100644 --- a/src/gromacs/mdlib/sim_util.cpp +++ b/src/gromacs/mdlib/sim_util.cpp @@ -707,24 +707,24 @@ static void checkPotentialEnergyValidity(const gmx_enerdata_t *enerd) } } -void do_force_cutsVERLET(FILE *fplog, t_commrec *cr, - t_inputrec *inputrec, - gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, - gmx_localtop_t *top, - gmx_groups_t gmx_unused *groups, - matrix box, rvec x[], history_t *hist, - PaddedRVecVector *force, - tensor vir_force, - t_mdatoms *mdatoms, - gmx_enerdata_t *enerd, t_fcdata *fcd, - real *lambda, t_graph *graph, - t_forcerec *fr, interaction_const_t *ic, - gmx_vsite_t *vsite, rvec mu_tot, - double t, gmx_edsam_t ed, - gmx_bool bBornRadii, - int flags, - DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion, - DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion) +static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr, + t_inputrec *inputrec, + gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, + gmx_localtop_t *top, + gmx_groups_t gmx_unused *groups, + matrix box, rvec x[], history_t *hist, + PaddedRVecVector *force, + tensor vir_force, + t_mdatoms *mdatoms, + gmx_enerdata_t *enerd, t_fcdata *fcd, + real *lambda, t_graph *graph, + t_forcerec *fr, interaction_const_t *ic, + gmx_vsite_t *vsite, rvec mu_tot, + double t, gmx_edsam_t ed, + gmx_bool bBornRadii, + int flags, + DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion, + DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion) { int cg1, i, j; double mu[2*DIM]; @@ -1465,23 +1465,23 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr, } } -void do_force_cutsGROUP(FILE *fplog, t_commrec *cr, - t_inputrec *inputrec, - gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, - gmx_localtop_t *top, - gmx_groups_t *groups, - matrix box, rvec x[], history_t *hist, - PaddedRVecVector *force, - tensor vir_force, - t_mdatoms *mdatoms, - gmx_enerdata_t *enerd, t_fcdata *fcd, - real *lambda, t_graph *graph, - t_forcerec *fr, gmx_vsite_t *vsite, rvec mu_tot, - double t, gmx_edsam_t ed, - gmx_bool bBornRadii, - int flags, - DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion, - DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion) +static void do_force_cutsGROUP(FILE *fplog, t_commrec *cr, + t_inputrec *inputrec, + gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle, + gmx_localtop_t *top, + gmx_groups_t *groups, + matrix box, rvec x[], history_t *hist, + PaddedRVecVector *force, + tensor vir_force, + t_mdatoms *mdatoms, + gmx_enerdata_t *enerd, t_fcdata *fcd, + real *lambda, t_graph *graph, + t_forcerec *fr, gmx_vsite_t *vsite, rvec mu_tot, + double t, gmx_edsam_t ed, + gmx_bool bBornRadii, + int flags, + DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion, + DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion) { int cg0, cg1, i, j; double mu[2*DIM]; diff --git a/src/gromacs/selection/sm_compare.cpp b/src/gromacs/selection/sm_compare.cpp index 03762e4929..94704d32d6 100644 --- a/src/gromacs/selection/sm_compare.cpp +++ b/src/gromacs/selection/sm_compare.cpp @@ -49,6 +49,7 @@ #include "gromacs/utility/exceptions.h" #include "gromacs/utility/smalloc.h" +#include "keywords.h" #include "selmethod.h" /** Defines the comparison operator for comparison expressions. */ diff --git a/src/gromacs/swap/swapcoords.cpp b/src/gromacs/swap/swapcoords.cpp index d6844b0dd4..f330981f84 100644 --- a/src/gromacs/swap/swapcoords.cpp +++ b/src/gromacs/swap/swapcoords.cpp @@ -1336,7 +1336,7 @@ static real getRequestedChargeImbalance(t_swap *s) * This routine should be called for the 'anions' and 'cations' group, * of which the indices were lumped together in the older version of the code. */ -void copyIndicesToGroup( +static void copyIndicesToGroup( int *indIons, int nIons, t_swapGroup *g, @@ -1380,7 +1380,7 @@ void copyIndicesToGroup( * #4 cations - empty before conversion * */ -void convertOldToNewGroupFormat( +static void convertOldToNewGroupFormat( t_swapcoords *sc, gmx_mtop_t *mtop, gmx_bool bVerbose, @@ -1437,7 +1437,7 @@ void convertOldToNewGroupFormat( /*! \brief Returns TRUE if we started from an old .tpr * * Then we need to re-sort anions and cations into separate groups */ -gmx_bool bConvertFromOldTpr(t_swapcoords *sc) +static gmx_bool bConvertFromOldTpr(t_swapcoords *sc) { // If the last group has no atoms it means we need to convert! if ( (sc->ngrp >= 5) && (0 == sc->grp[4].nat) ) diff --git a/src/gromacs/timing/wallcycle.cpp b/src/gromacs/timing/wallcycle.cpp index a18a271a8e..637c8d7dac 100644 --- a/src/gromacs/timing/wallcycle.cpp +++ b/src/gromacs/timing/wallcycle.cpp @@ -185,8 +185,9 @@ gmx_wallcycle_t wallcycle_init(FILE *fplog, int resetstep, t_commrec gmx_unused return wc; } -void wallcycle_destroy(gmx_wallcycle_t wc) -{ +/* TODO: Should be called from finish_run() or runner() + void wallcycle_destroy(gmx_wallcycle_t wc) + { if (wc == nullptr) { return; @@ -205,7 +206,8 @@ void wallcycle_destroy(gmx_wallcycle_t wc) sfree(wc->wcsc); } sfree(wc); -} + } + */ static void wallcycle_all_start(gmx_wallcycle_t wc, int ewc, gmx_cycles_t cycle) { diff --git a/src/gromacs/tools/check.cpp b/src/gromacs/tools/check.cpp index 6b665a79a7..691d0b136d 100644 --- a/src/gromacs/tools/check.cpp +++ b/src/gromacs/tools/check.cpp @@ -36,6 +36,8 @@ */ #include "gmxpre.h" +#include "check.h" + #include #include #include @@ -376,7 +378,7 @@ static void chk_bonds(t_idef *idef, int ePBC, rvec *x, matrix box, real tol) } } -void chk_trj(const gmx_output_env_t *oenv, const char *fn, const char *tpr, real tol) +static void chk_trj(const gmx_output_env_t *oenv, const char *fn, const char *tpr, real tol) { t_trxframe fr; t_count count; @@ -512,7 +514,7 @@ void chk_trj(const gmx_output_env_t *oenv, const char *fn, const char *tpr, real PRINTITEM ( "Box", bBox ); } -void chk_tps(const char *fn, real vdw_fac, real bon_lo, real bon_hi) +static void chk_tps(const char *fn, real vdw_fac, real bon_lo, real bon_hi) { int natom, i, j, k; t_topology top; @@ -713,7 +715,7 @@ void chk_tps(const char *fn, real vdw_fac, real bon_lo, real bon_hi) } } -void chk_ndx(const char *fn) +static void chk_ndx(const char *fn) { t_blocka *grps; char **grpname; @@ -745,7 +747,7 @@ void chk_ndx(const char *fn) done_blocka(grps); } -void chk_enx(const char *fn) +static void chk_enx(const char *fn) { int nre, fnr; ener_file_t in; diff --git a/src/gromacs/tools/convert_tpr.cpp b/src/gromacs/tools/convert_tpr.cpp index f63d708d4a..a2b32eb56a 100644 --- a/src/gromacs/tools/convert_tpr.cpp +++ b/src/gromacs/tools/convert_tpr.cpp @@ -36,6 +36,8 @@ */ #include "gmxpre.h" +#include "convert_tpr.h" + #include #include "gromacs/commandline/pargs.h" diff --git a/src/gromacs/tools/dump.cpp b/src/gromacs/tools/dump.cpp index f960a00500..c085126b61 100644 --- a/src/gromacs/tools/dump.cpp +++ b/src/gromacs/tools/dump.cpp @@ -36,6 +36,8 @@ */ #include "gmxpre.h" +#include "dump.h" + #include "config.h" #include @@ -276,7 +278,7 @@ static void list_trr(const char *fn) gmx_trr_close(fpread); } -void list_xtc(const char *fn) +static void list_xtc(const char *fn) { t_fileio *xd; int indent; @@ -406,7 +408,7 @@ static void list_tng(const char gmx_unused *fn) #endif } -void list_trx(const char *fn) +static void list_trx(const char *fn) { switch (fn2ftp(fn)) { @@ -425,7 +427,7 @@ void list_trx(const char *fn) } } -void list_ene(const char *fn) +static void list_ene(const char *fn) { ener_file_t in; gmx_bool bCont; diff --git a/src/gromacs/utility/futil.cpp b/src/gromacs/utility/futil.cpp index 149ac9560d..c7d0a40521 100644 --- a/src/gromacs/utility/futil.cpp +++ b/src/gromacs/utility/futil.cpp @@ -144,7 +144,7 @@ void gmx_set_max_backup_count(int count) s_maxBackupCount = count; } -void push_ps(FILE *fp) +static void push_ps(FILE *fp) { t_pstack *ps; diff --git a/src/programs/mdrun/membed.cpp b/src/programs/mdrun/membed.cpp index 6a10a22149..375df08f41 100644 --- a/src/programs/mdrun/membed.cpp +++ b/src/programs/mdrun/membed.cpp @@ -824,7 +824,7 @@ static void rm_group(gmx_groups_t *groups, gmx_mtop_t *mtop, rm_t *rm_p, t_state } /* remove al bonded interactions from mtop for the molecule to be embedded */ -int rm_bonded(t_block *ins_at, gmx_mtop_t *mtop) +static int rm_bonded(t_block *ins_at, gmx_mtop_t *mtop) { int i, j, m; int type, natom, nmol, at, atom1 = 0, rm_at = 0; diff --git a/src/programs/mdrun/tests/energyreader.cpp b/src/programs/mdrun/tests/energyreader.cpp index e72e0640d7..0fe91c7e1e 100644 --- a/src/programs/mdrun/tests/energyreader.cpp +++ b/src/programs/mdrun/tests/energyreader.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016, by the GROMACS development team, led by + * Copyright (c) 2016,2017, 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. @@ -122,7 +122,7 @@ openEnergyFileToReadFields(const std::string &filename, } //! Helper function to obtain resources -t_enxframe *make_enxframe() +static t_enxframe *make_enxframe() { t_enxframe *frame; diff --git a/src/programs/mdrun/tests/termination.cpp b/src/programs/mdrun/tests/termination.cpp index ec77550248..3ab7316310 100644 --- a/src/programs/mdrun/tests/termination.cpp +++ b/src/programs/mdrun/tests/termination.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016, by the GROMACS development team, led by + * Copyright (c) 2016,2017, 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. @@ -55,7 +55,7 @@ namespace test { //! Build a simple .mdp file -void organizeMdpFile(SimulationRunner *runner) +static void organizeMdpFile(SimulationRunner *runner) { // Make sure -maxh has a chance to propagate runner->useStringAsMdpFile("nsteps = 100\n" diff --git a/src/programs/mdrun/tests/trajectoryreader.cpp b/src/programs/mdrun/tests/trajectoryreader.cpp index 35b2a4e106..fb237221b4 100644 --- a/src/programs/mdrun/tests/trajectoryreader.cpp +++ b/src/programs/mdrun/tests/trajectoryreader.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016, by the GROMACS development team, led by + * Copyright (c) 2016,2017, 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. @@ -61,7 +61,7 @@ namespace test { //! Helper function to obtain resources -t_trxframe *make_trxframe() +static t_trxframe *make_trxframe() { t_trxframe *frame; diff --git a/src/programs/view/fgrid.cpp b/src/programs/view/fgrid.cpp index 13104d405c..526552a190 100644 --- a/src/programs/view/fgrid.cpp +++ b/src/programs/view/fgrid.cpp @@ -52,8 +52,8 @@ static const char *type[] = { "pixmap", "statictext", "edittext", "defbutton" }; -void ReadDlgError(const char *infile, eDLGERR err, const char *s, - const char *file, int line) +static void ReadDlgError(const char *infile, eDLGERR err, const char *s, + const char *file, int line) { std::fprintf(stderr, "Error: "); switch (err) diff --git a/src/programs/view/molps.cpp b/src/programs/view/molps.cpp index a2c6054629..e285dd43d4 100644 --- a/src/programs/view/molps.cpp +++ b/src/programs/view/molps.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2013, The GROMACS development team. - * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2017, 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. @@ -36,6 +36,8 @@ */ #include "gmxpre.h" +#include "molps.h" + #include #include "gromacs/fileio/writeps.h" diff --git a/src/programs/view/nleg.cpp b/src/programs/view/nleg.cpp index d27b367184..f9920c2d47 100644 --- a/src/programs/view/nleg.cpp +++ b/src/programs/view/nleg.cpp @@ -68,7 +68,7 @@ static t_atomcolor ac[] = { }; #define NAC asize(ac) -int search_ac(const char *type) +static int search_ac(const char *type) { unsigned int i, nb, mij, best, besti; @@ -114,7 +114,7 @@ t_rgb *Type2RGB(const char *type) return &(ac[i].rgb); } -void DrawLegend(t_x11 *x11, t_windata *Win) +static void DrawLegend(t_x11 *x11, t_windata *Win) { #define NLAB 6 #define COLS 3 diff --git a/src/programs/view/nmol.cpp b/src/programs/view/nmol.cpp index fb19996a83..c1123cf54c 100644 --- a/src/programs/view/nmol.cpp +++ b/src/programs/view/nmol.cpp @@ -98,7 +98,7 @@ static bool MWCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data) return false; } -void set_def (t_molwin *mw, int ePBC, matrix box) +static void set_def (t_molwin *mw, int ePBC, matrix box) { mw->bShowHydrogen = true; mw->bond_type = eBFat; @@ -368,10 +368,10 @@ int filter_vis(t_manager *man) return nvis; } -void draw_objects(Display *disp, Window w, GC gc, int nobj, - t_object objs[], iv2 vec2[], rvec x[], - unsigned long col[], int size[], bool bShowHydro, int bond_type, - bool bPlus) +static void draw_objects(Display *disp, Window w, GC gc, int nobj, + t_object objs[], iv2 vec2[], rvec x[], + unsigned long col[], int size[], bool bShowHydro, int bond_type, + bool bPlus) { bool bBalls; int i; diff --git a/src/programs/view/popup.cpp b/src/programs/view/popup.cpp index 584d5c63c0..94fae9e020 100644 --- a/src/programs/view/popup.cpp +++ b/src/programs/view/popup.cpp @@ -48,7 +48,7 @@ #include "x11.h" #include "xutil.h" -bool ChildCallBack(t_x11 *x11, XEvent *event, Window w, void *data) +static bool ChildCallBack(t_x11 *x11, XEvent *event, Window w, void *data) { t_child *child; t_mentry *m; @@ -93,7 +93,7 @@ bool ChildCallBack(t_x11 *x11, XEvent *event, Window w, void *data) return false; } -bool MenuCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data) +static bool MenuCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data) { t_menu *m; diff --git a/src/programs/view/view.cpp b/src/programs/view/view.cpp index 4bf5973475..ce3c306b3a 100644 --- a/src/programs/view/view.cpp +++ b/src/programs/view/view.cpp @@ -36,6 +36,8 @@ */ #include "gmxpre.h" +#include "view.h" + #include "config.h" #include diff --git a/src/programs/view/xdlg.cpp b/src/programs/view/xdlg.cpp index 2306238207..027b116f4c 100644 --- a/src/programs/view/xdlg.cpp +++ b/src/programs/view/xdlg.cpp @@ -598,7 +598,7 @@ static bool DlgCB(t_x11 *x11, XEvent *event, Window w, void *data) * the item itself may not be freed until the dlg is done with * ****************************/ -void DoCreateDlg(t_dlg *dlg) +static void DoCreateDlg(t_dlg *dlg) { XSizeHints hints; XSetWindowAttributes attr; diff --git a/src/programs/view/xmb.cpp b/src/programs/view/xmb.cpp index 69f1228665..155d1a3d14 100644 --- a/src/programs/view/xmb.cpp +++ b/src/programs/view/xmb.cpp @@ -62,7 +62,7 @@ static int icon_height = 0; static unsigned long icon_fg = 0; static unsigned long icon_bg = 0; -void SetIcon(unsigned char *bits, int w, int h, unsigned long fg, unsigned long bg) +static void SetIcon(unsigned char *bits, int w, int h, unsigned long fg, unsigned long bg) { icon_bits = (bmchar *)bits; icon_width = w; diff --git a/src/testutils/refdata-checkers.h b/src/testutils/refdata-checkers.h index ca933a5a82..9a5c4fd0a4 100644 --- a/src/testutils/refdata-checkers.h +++ b/src/testutils/refdata-checkers.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2017, 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. @@ -146,7 +146,7 @@ class ExactStringBlockChecker : public IReferenceDataEntryChecker //! Helper function to parse a floating-point reference data value. -double convertDoubleReferenceValue(const std::string &value) +static inline double convertDoubleReferenceValue(const std::string &value) { try { -- 2.22.0