- Move index.h and index.c to topology/.
- Remove some unused and duplicate includes.
- Convert the source file to C++ (scanf issues suppressed for now).
Change-Id: I99374f5d2e53b6c26bf6441b630234177c83affb
#include "gromacs/fileio/pdbio.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/fileio/xvgr.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gstat.h"
#include "gromacs/fileio/tpxio.h"
#include "viewit.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/fileio/xvgr.h"
#include "gstat.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/pdbio.h"
void cat(FILE *out,char *fn,real t)
#include "gromacs/math/vec.h"
#include "gromacs/utility/futil.h"
#include "copyrite.h"
-#include "index.h"
#include "gromacs/fileio/tpxio.h"
int main(int argc,char *argv[])
#include "gromacs/utility/futil.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/tpxio.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/utility/smalloc.h"
#include "nrnb.h"
#include "gstat.h"
#include "macros.h"
#include "copyrite.h"
#include "gromacs/commandline/pargs.h"
-#include "index.h"
#include "gromacs/math/vec.h"
#include "typedefs.h"
#include "gbutil.h"
#include <string.h>
#include "gromacs/legacyheaders/copyrite.h"
-#include "gromacs/legacyheaders/index.h"
#include "gromacs/legacyheaders/types/ifunc.h"
#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/utility/futil.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/atomprop.h"
+#include "gromacs/topology/index.h"
#include "gromacs/topology/symtab.h"
#include "gromacs/topology/topology.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/smalloc.h"
#include "gstat.h"
#include "gromacs/utility/fatalerror.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
t_dlist *mk_dlist(FILE *log,
t_atoms *atoms, int *nlist,
#include "gromacs/utility/futil.h"
#include "gstat.h"
#include "gromacs/math/vec.h"
-#include "index.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/pdbio.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/commandline/pargs.h"
#include "copyrite.h"
#include "gromacs/math/vec.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "macros.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/fileio/xvgr.h"
#include "macros.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/fileio/tpxio.h"
#include "macros.h"
#include "gromacs/math/utilities.h"
#include "gromacs/math/units.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/math/vec.h"
#include "macros.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/random/random.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/utility/futil.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/utility/smalloc.h"
#include "nrnb.h"
#include "gromacs/math/units.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/math/vec.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/fileio/confio.h"
#include "macros.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/trnio.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/math/units.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/statistics/statistics.h"
#include "gmx_ana.h"
#include "macros.h"
#include "gstat.h"
#include "viewit.h"
#include "gromacs/pbcutil/pbc.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/math/units.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "txtdump.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "gstat.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/math/units.h"
#include "txtdump.h"
#include "gromacs/statistics/statistics.h"
#include "gstat.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/random/random.h"
#include "names.h"
#include "gromacs/math/units.h"
#include "gstat.h"
#include "main.h"
#include "gromacs/fileio/pdbio.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "mdatoms.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "typedefs.h"
#include "macros.h"
#include "gromacs/fileio/pdbio.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gstat.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "macros.h"
#include "gromacs/math/utilities.h"
#include "gromacs/math/units.h"
-#include "index.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/commandline/pargs.h"
#include "txtdump.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/pbcutil/pbc.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include <config.h>
#endif
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/math/units.h"
#include "gmx_ana.h"
#include "gromacs/fileio/confio.h"
#include "macros.h"
#include "gromacs/fileio/strdb.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "typedefs.h"
#include "gromacs/gmxlib/conformation-utilities.h"
#include "gromacs/math/units.h"
#include "gromacs/utility/smalloc.h"
#include "macros.h"
#include "gromacs/math/vec.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "princ.h"
#include "gromacs/fileio/tpxio.h"
#include "mdrun.h"
#include "gromacs/random/random.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gmx_ana.h"
static void insert_ion(int nsa, int *nwater,
#include "gromacs/utility/futil.h"
#include "macros.h"
#include "gromacs/math/vec.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gmx_ana.h"
#include "macros.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/xvgr.h"
#include "viewit.h"
#include "princ.h"
#include "viewit.h"
#include "gromacs/utility/futil.h"
#include "gromacs/commandline/pargs.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gmx_ana.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/math/units.h"
#include "macros.h"
#include "gromacs/utility/fatalerror.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/vec.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/math/utilities.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
-#include "index.h"
#include "gromacs/utility/smalloc.h"
#include "txtdump.h"
#include "typedefs.h"
#include "typedefs.h"
#include "macros.h"
#include "gromacs/math/vec.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gstat.h"
#include "gmx_ana.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "binsearch.h"
#include "gromacs/fileio/xvgr.h"
#include "txtdump.h"
#include "eigio.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/utility/cstringutil.h"
typedef struct
#include "macros.h"
#include "gromacs/fileio/confio.h"
#include "typedefs.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/math/vec.h"
-#include "index.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/topology/block.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/fileio/matio.h"
#include "gromacs/fileio/xvgr.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/utility/futil.h"
#include "gromacs/commandline/pargs.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "macros.h"
#include "gromacs/fileio/confio.h"
#include "viewit.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gmx_ana.h"
#include "gromacs/fileio/trxio.h"
#include "macros.h"
#include "gromacs/math/utilities.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "typedefs.h"
#include "viewit.h"
#include "gstat.h"
#include "macros.h"
#include "copyrite.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
#include "gstat.h"
#include "txtdump.h"
#include "eigio.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/pdbio.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
#include "gromacs/fileio/pdbio.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "viewit.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/utility/futil.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/math/vec.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "macros.h"
#include "gromacs/fileio/xvgr.h"
#include "viewit.h"
#include "viewit.h"
#include "gromacs/utility/futil.h"
#include "gromacs/commandline/pargs.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gmx_ana.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/fileio/trxio.h"
#include "macros.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "princ.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "txtdump.h"
#include "gromacs/math/units.h"
#include "gromacs/utility/futil.h"
#include "gromacs/commandline/pargs.h"
-#include "index.h"
#include "nrama.h"
#include "gmx_ana.h"
#include "gromacs/utility/futil.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "nrnb.h"
#include "coulomb.h"
#include "gstat.h"
#include "copyrite.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/math/vec.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "princ.h"
#include "gromacs/fileio/strdb.h"
#include "gromacs/math/vec.h"
#include "macros.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/fileio/xvgr.h"
#include "viewit.h"
#include "viewit.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/math/vec.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/pdbio.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "typedefs.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "macros.h"
#include "gstat.h"
#include "gromacs/math/vec.h"
#include "macros.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/xvgr.h"
#include "viewit.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "macros.h"
#include "gromacs/math/vec.h"
#include "copyrite.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gstat.h"
#include "gmx_ana.h"
#include "nsfactor.h"
#include "gromacs/math/vec.h"
#include "viewit.h"
#include "gromacs/pbcutil/pbc.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "gmx_ana.h"
#include "gromacs/math/vec.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gmx_ana.h"
#include "gstat.h"
#include "viewit.h"
#include "gromacs/pbcutil/pbc.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/math/units.h"
#include "macros.h"
#include "gromacs/math/utilities.h"
#include "gromacs/math/units.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/commandline/pargs.h"
#include "txtdump.h"
#include "macros.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/xvgr.h"
#include "viewit.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/pdbio.h"
#include "gromacs/fileio/confio.h"
#include "names.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/math/vec.h"
#include "gromacs/fileio/xtcio.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/fileio/pdbio.h"
#include "gromacs/fileio/confio.h"
#include "names.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/math/vec.h"
#include "gromacs/fileio/xtcio.h"
#include "viewit.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/math/utilities.h"
#include "gromacs/utility/futil.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "typedefs.h"
#include "gromacs/fileio/xvgr.h"
#include "viewit.h"
#include "macros.h"
#include "gromacs/math/utilities.h"
#include "gromacs/math/units.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/commandline/pargs.h"
#include "txtdump.h"
#include "gromacs/utility/smalloc.h"
#include "macros.h"
#include "gromacs/math/vec.h"
-#include "index.h"
#include "gstat.h"
#include "gromacs/utility/fatalerror.h"
#include "gmx_ana.h"
#define GMX_GMXANA_GSTAT_H
#include "../legacyheaders/typedefs.h"
-#include "../commandline/pargs.h"
#include "../legacyheaders/oenv.h"
-#include "../legacyheaders/index.h"
+#include "../commandline/pargs.h"
+#include "../topology/index.h"
#ifdef __cplusplus
extern "C" {
#include "macros.h"
#include "gromacs/math/units.h"
#include "gromacs/math/vec.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "hxprops.h"
#include "gromacs/utility/smalloc.h"
#include "bondf.h"
#ifndef _nsfactor_h
#define _nsfactor_h
-#include "gromacs/legacyheaders/index.h"
#include "gromacs/legacyheaders/oenv.h"
#include "gromacs/legacyheaders/types/simple.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/math/vec.h"
#include "macros.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/fileio/strdb.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#ifndef _sfactor_h
#define _sfactor_h
-#include "index.h"
#include "types/simple.h"
#include "../math/gmxcomplex.h"
#include "oenv.h"
#include "gromacs/math/vec.h"
#include "toputil.h"
#include "gromacs/math/units.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "names.h"
#include "gromacs/utility/futil.h"
#include "gpp_atomtype.h"
#include "gromacs/gmxpreprocess/sortwater.h"
#include "convparm.h"
#include "warninp.h"
-#include "index.h"
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/trnio.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/gmxlib/conformation-utilities.h"
#include "genhydro.h"
#include "readinp.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "fflibutil.h"
#include "macros.h"
#include "gromacs/fileio/strdb.h"
#include "gromacs/topology/atomprop.h"
#include "gromacs/topology/block.h"
+#include "gromacs/topology/index.h"
#include "gromacs/topology/symtab.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/fileio/pdbio.h"
#include "gen_ad.h"
#include "gromacs/fileio/filenm.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gen_vsite.h"
#include "add_par.h"
#include "toputil.h"
#include "genhydro.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/math/vec.h"
#include "hackblock.h"
#include "gromacs/math/units.h"
#include "names.h"
#include "macros.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "gromacs/utility/cstringutil.h"
#include "readinp.h"
#include "warninp.h"
#include "readir.h"
#include "toputil.h"
-#include "index.h"
#include "network.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/pbc.h"
#include "names.h"
#include "gromacs/utility/fatalerror.h"
#include "macros.h"
-#include "index.h"
#include "readinp.h"
#include "readir.h"
#include "mdatoms.h"
#include "gromacs/math/vec.h"
#include "toputil.h"
#include "gromacs/math/units.h"
-#include "index.h"
#include "names.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/cstringutil.h"
#include <string.h>
#include "typedefs.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "fflibutil.h"
#include "hackblock.h"
#include "xlate.h"
#ifndef GMX_GMXPREPROCESS_XLATE_H
#define GMX_GMXPREPROCESS_XLATE_H
-#include "index.h"
+#include "gromacs/topology/index.h"
#ifdef __cplusplus
extern "C" {
#include <string.h>
#include "gromacs/utility/futil.h"
-#include "index.h"
#include "typedefs.h"
#include "types/commrec.h"
#include "network.h"
#include "names.h"
#include "gromacs/utility/fatalerror.h"
#include "macros.h"
-#include "index.h"
#include "gromacs/fileio/confio.h"
#include "network.h"
#include "gromacs/pbcutil/pbc.h"
#include <string>
#include <vector>
-#include "gromacs/legacyheaders/index.h"
-
#include "gromacs/topology/block.h"
+#include "gromacs/topology/index.h"
#include "gromacs/topology/topology.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/smalloc.h"
#include "txtdump.h"
#include "gromacs/math/vec.h"
#include "gromacs/math/units.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "names.h"
#include "gromacs/utility/futil.h"
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/legacyheaders/types/inputrec.h"
#include "gromacs/legacyheaders/types/simple.h"
#include "gromacs/legacyheaders/types/state.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "macros.h"
#include "names.h"
#include "gromacs/gmxpreprocess/readir.h"
atoms.h
block.h
idef.h
+ index.h
mtop_util.h
symtab.h
topology.h)
#include "gromacs/fileio/strdb.h"
#include "gromacs/legacyheaders/copyrite.h"
-#include "gromacs/legacyheaders/index.h"
#include "gromacs/math/utilities.h"
+#include "gromacs/topology/index.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
* 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/topology/index.h"
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
#include <string.h>
-#include "macros.h"
-#include "names.h"
-#include "typedefs.h"
-#include "macros.h"
-#include "index.h"
-#include "txtdump.h"
+#include <algorithm>
+
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/strdb.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/topology/block.h"
#include "gromacs/topology/invblock.h"
+#include "gromacs/utility/common.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
p_status(const char **restype, int nres, const char **typenames, int ntypes)
{
int i, j;
- int found;
-
int * counter;
snew(counter, ntypes);
}
for (i = 0; i < nres; i++)
{
- found = 0;
for (j = 0; j < ntypes; j++)
{
if (!gmx_strcasecmp(restype[i], typenames[j]))
}
-atom_id *
+static atom_id *
mk_aid(t_atoms *atoms, const char ** restype, const char * typestring, int *nra, gmx_bool bMatch)
/* Make an array of atom_ids for all atoms with residuetypes matching typestring, or the opposite if bMatch is false */
{
/** The set of atom names that will be used to form this index group */
const char **defining_atomnames;
/** Size of the defining_atomnames array */
- const int num_defining_atomnames;
+ int num_defining_atomnames;
/** Name of this index group */
const char *group_name;
/** Whether the above atom names name the atoms in the group, or
int n, j;
atom_id *aid;
- int nra, nnpres, npres;
+ int nra, npres;
gmx_bool match;
char ndx_name[STRLEN], *atnm;
int i;
if (nra > 0)
{
add_grp(gb, gn, nra, aid, "SwapSC-CO");
- nra = 0;
}
}
}
int
gmx_residuetype_add(gmx_residuetype_t rt, const char *newresname, const char *newrestype)
{
- int i;
int found;
const char * p_oldtype;
FILE * db;
char line[STRLEN];
char resname[STRLEN], restype[STRLEN], dum[STRLEN];
- char * p;
- int i;
struct gmx_residuetype *rt;
snew(rt, 1);
const char *** p_typenames,
int * ntypes)
{
- int i, j, n;
- int found;
+ int i, n;
const char ** my_typename;
- char * p;
-
- n = 0;
+ n = 0;
my_typename = NULL;
for (i = 0; i < rt->n; i++)
{
- p = rt->restype[i];
- found = 0;
- for (j = 0; j < n && !found; j++)
+ const char *const p = rt->restype[i];
+ bool bFound = false;
+ for (int j = 0; j < n && !bFound; j++)
{
- found = !gmx_strcasecmp(p, my_typename[j]);
+ assert(my_typename != NULL);
+ bFound = !gmx_strcasecmp(p, my_typename[j]);
}
-
- if (!found)
+ if (!bFound)
{
srenew(my_typename, n+1);
my_typename[n] = p;
const char ** restype;
int nra;
int i, k;
- size_t j;
int ntypes;
- char * p;
const char ** p_typename;
int iwater, iion;
int nwater, nion;
found = 0;
for (k = 0; k < ntypes && !found; k++)
{
+ assert(p_typename != NULL);
found = !strcmp(restype[i], p_typename[k]);
}
if (!found)
FILE *in;
t_blocka *b;
int a, maxentries;
- int i, j, ng, nread;
+ int i, j, ng;
char line[STRLEN], *pt, str[STRLEN];
in = gmx_fio_fopen(gfile, "r");
snew(b->a, b->nra);
for (i = 0; (i < b->nr); i++)
{
- nread = fscanf(in, "%s%d", str, &ng);
+ GMX_IGNORE_RETURN_VALUE(fscanf(in, "%s%d", str, &ng));
(*grpname)[i] = strdup(str);
b->index[i+1] = b->index[i]+ng;
if (b->index[i+1] > b->nra)
}
for (j = 0; (j < ng); j++)
{
- nread = fscanf(in, "%d", &a);
+ GMX_IGNORE_RETURN_VALUE(fscanf(in, "%d", &a));
b->a[b->index[i]+j] = a;
}
}
c->maxframe = -1;
for (i = 0; (i < c->clust->nra); i++)
{
- c->maxframe = max(c->maxframe, c->clust->a[i]);
+ c->maxframe = std::max(c->maxframe, c->clust->a[i]);
}
fprintf(fplog ? fplog : stdout,
"There are %d clusters containing %d structures, highest framenr is %d\n",
* To help us fund GROMACS development, we humbly ask that you cite
* the research papers on the package. Check out http://www.gromacs.org.
*/
-
-#ifndef _index_h
-#define _index_h
+#ifndef GMX_TOPOLOGY_INDEX_H
+#define GMX_TOPOLOGY_INDEX_H
#include <stdio.h>
-#include "types/simple.h"
+#include "../legacyheaders/types/simple.h"
#ifdef __cplusplus
extern "C" {
t_cluster_ndx *cluster_index(FILE *fplog, const char *ndx);
-typedef struct {
- int n;
- char **name;
-} t_names;
-
-typedef struct gmx_residuetype *
- gmx_residuetype_t;
+typedef struct gmx_residuetype *gmx_residuetype_t;
int
gmx_residuetype_init(gmx_residuetype_t *rt);
}
#endif
-#endif /* _index_h */
+#endif
#include "mdebin.h"
#include "nrnb.h"
#include "calcmu.h"
-#include "index.h"
#include "vsite.h"
#include "update.h"
#include "ns.h"
#include "macros.h"
#include "gromacs/utility/futil.h"
#include "gromacs/essentialdynamics/edsam.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "names.h"
#include "gromacs/topology/mtop_util.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "macros.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
#include "xdlghi.h"
#include "dialogs.h"
-#include "index.h"
#include "gromacs/utility/fatalerror.h"
t_filter *init_filter(t_atoms *atoms, const char *fn, int natom_trx)
--suppress=unnecessaryForwardDeclaration
--suppress=invalidscanf:src/gromacs/fileio/matio.cpp
--suppress=invalidscanf:src/gromacs/fileio/xvgr.cpp
+ --suppress=invalidscanf:src/gromacs/topology/index.cpp
--suppress=invalidscanf:src/gromacs/gmxpreprocess/pdb2top.cpp)
# This list will hold the list of all files with cppcheck errors