Add more const correctness
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 15 Mar 2016 17:06:15 +0000 (18:06 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Sat, 19 Mar 2016 13:49:16 +0000 (14:49 +0100)
commitce467c120e14a7f4ffb28efc444b123e175fd1e3
tree02c8f04c305531d60e7d0631e71a258b5e30d8a4
parent03ca44f647eb0d89a190c8b10d27112d1cb1f81d
Add more const correctness

This helps reduce the size of a future change to how we handle reading
and writing conformation files.

In particular, the way we write symmetric low-level I/O routines that
do both reading or writing according to the value of a parameter
requires that parameters for values to be written are passed as
non-const at some level of the call stack. In several cases, this
change moves that point lower down, so that routines whose job is
writing complex data to files take const parameters. Improving this
helps understand what is going on when e.g. an analysis tool reads in
coordinates, perhaps modifies them, and then writes them. The down
side is that we need to use some const_cast as we get close to the
low-level routines.

Change-Id: I5c22d8681fa5f247f302409bf67b062ebc9fe766
90 files changed:
src/gromacs/fft/calcgrid.cpp
src/gromacs/fft/calcgrid.h
src/gromacs/fileio/confio.cpp
src/gromacs/fileio/confio.h
src/gromacs/fileio/enxio.cpp
src/gromacs/fileio/enxio.h
src/gromacs/fileio/espio.cpp
src/gromacs/fileio/espio.h
src/gromacs/fileio/g96io.cpp
src/gromacs/fileio/g96io.h
src/gromacs/fileio/groio.cpp
src/gromacs/fileio/groio.h
src/gromacs/fileio/pdbio.cpp
src/gromacs/fileio/pdbio.h
src/gromacs/fileio/tngio_for_tools.cpp
src/gromacs/fileio/tngio_for_tools.h
src/gromacs/fileio/tpxio.cpp
src/gromacs/fileio/tpxio.h
src/gromacs/fileio/trrio.cpp
src/gromacs/fileio/trrio.h
src/gromacs/fileio/trxio.cpp
src/gromacs/fileio/trxio.h
src/gromacs/fileio/xtcio.cpp
src/gromacs/fileio/xtcio.h
src/gromacs/gmxana/dlist.cpp
src/gromacs/gmxana/eigio.cpp
src/gromacs/gmxana/eigio.h
src/gromacs/gmxana/gmx_anaeig.cpp
src/gromacs/gmxana/gmx_chi.cpp
src/gromacs/gmxana/gmx_confrms.cpp
src/gromacs/gmxana/gmx_densorder.cpp
src/gromacs/gmxana/gmx_dipoles.cpp
src/gromacs/gmxana/gmx_disre.cpp
src/gromacs/gmxana/gmx_dos.cpp
src/gromacs/gmxana/gmx_dyndom.cpp
src/gromacs/gmxana/gmx_energy.cpp
src/gromacs/gmxana/gmx_h2order.cpp
src/gromacs/gmxana/gmx_hbond.cpp
src/gromacs/gmxana/gmx_make_edi.cpp
src/gromacs/gmxana/gmx_make_ndx.cpp
src/gromacs/gmxana/gmx_mindist.cpp
src/gromacs/gmxana/gmx_mk_angndx.cpp
src/gromacs/gmxana/gmx_msd.cpp
src/gromacs/gmxana/gmx_nmeig.cpp
src/gromacs/gmxana/gmx_order.cpp
src/gromacs/gmxana/gmx_pme_error.cpp
src/gromacs/gmxana/gmx_potential.cpp
src/gromacs/gmxana/gmx_principal.cpp
src/gromacs/gmxana/gmx_rms.cpp
src/gromacs/gmxana/gmx_rmsdist.cpp
src/gromacs/gmxana/gmx_rmsf.cpp
src/gromacs/gmxana/gmx_rotmat.cpp
src/gromacs/gmxana/gmx_saltbr.cpp
src/gromacs/gmxana/gmx_spol.cpp
src/gromacs/gmxana/gmx_traj.cpp
src/gromacs/gmxana/gmx_velacc.cpp
src/gromacs/gmxana/gstat.h
src/gromacs/gmxana/hxprops.cpp
src/gromacs/gmxana/hxprops.h
src/gromacs/gmxana/nrama.cpp
src/gromacs/gmxana/nsfactor.cpp
src/gromacs/gmxana/nsfactor.h
src/gromacs/gmxana/princ.cpp
src/gromacs/gmxana/princ.h
src/gromacs/gmxana/sfactor.cpp
src/gromacs/gmxana/sfactor.h
src/gromacs/gmxpreprocess/grompp.cpp
src/gromacs/gmxpreprocess/solvate.cpp
src/gromacs/gmxpreprocess/topio.cpp
src/gromacs/gmxpreprocess/topio.h
src/gromacs/gmxpreprocess/x2top.cpp
src/gromacs/math/3dtransforms.cpp
src/gromacs/math/3dtransforms.h
src/gromacs/math/do_fit.cpp
src/gromacs/math/do_fit.h
src/gromacs/mdlib/perf_est.cpp
src/gromacs/mdlib/perf_est.h
src/gromacs/pbcutil/mshift.cpp
src/gromacs/pbcutil/mshift.h
src/gromacs/pbcutil/rmpbc.cpp
src/gromacs/pbcutil/rmpbc.h
src/gromacs/tools/check.cpp
src/gromacs/tools/compare.cpp
src/gromacs/tools/compare.h
src/gromacs/topology/atoms.cpp
src/gromacs/topology/atoms.h
src/gromacs/topology/index.cpp
src/gromacs/topology/index.h
src/gromacs/topology/mtop_util.cpp
src/gromacs/topology/mtop_util.h