* 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 "solvate.h"
+#include "gmxpre.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "solvate.h"
+#include <string.h>
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "smalloc.h"
-#include "string2.h"
+#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/fileio/confio.h"
-#include "macros.h"
-#include "gromacs/fileio/futil.h"
-#include "atomprop.h"
-#include "names.h"
-#include "vec.h"
-#include "gmx_fatal.h"
-#include "gromacs/commandline/pargs.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/legacyheaders/names.h"
#include "gromacs/gmxlib/conformation-utilities.h"
#include "addconf.h"
#include "read-conformation.h"
#include "gromacs/fileio/pdbio.h"
-#include "pbc.h"
+
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/atomprop.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
#ifdef DEBUG
static void print_stat(rvec *x, int natoms, matrix box)
moltp = NOTSET;
for (j = 0; (j < nrmoltypes) && (moltp == NOTSET); j++)
{
- if (strcmp(*(atoms->resinfo[atoms->atom[i].resind].name),
- moltypes[j].name) == 0)
+ /* cppcheck-suppress nullPointer
+ * moltypes is guaranteed to be allocated because otherwise
+ * nrmoltypes is 0. */
+ if (strcmp(*(atoms->resinfo[atoms->atom[i].resind].name), moltypes[j].name) == 0)
{
moltp = j;
}
if (ftp2bSet(efTOP, NFILE, fnm) )
{
fprintf(stderr, "Processing topology\n");
- fpin = ffopen(topinout, "r");
- fpout = ffopen(TEMP_FILENM, "w");
+ fpin = gmx_ffopen(topinout, "r");
+ fpout = gmx_ffopen(TEMP_FILENM, "w");
line = 0;
bSystem = bMolecules = FALSE;
while (fgets(buf, STRLEN, fpin))
fprintf(fpout, "%s", buf);
}
}
- ffclose(fpin);
+ gmx_ffclose(fpin);
if (nsol)
{
fprintf(stdout, "Adding line for %d solvent molecules to "
"topology file (%s)\n", nsol, topinout);
fprintf(fpout, "%-15s %5d\n", "SOL", nsol);
}
- ffclose(fpout);
- /* use ffopen to generate backup of topinout */
- fpout = ffopen(topinout, "w");
- ffclose(fpout);
+ gmx_ffclose(fpout);
+ /* use gmx_ffopen to generate backup of topinout */
+ fpout = gmx_ffopen(topinout, "w");
+ gmx_ffclose(fpout);
rename(TEMP_FILENM, topinout);
}
#undef TEMP_FILENM
"Keep velocities from input solute and solvent" },
};
- if (!parse_common_args(&argc, argv, PCA_BE_NICE, NFILE, fnm, asize(pa), pa,
+ if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
asize(desc), desc, asize(bugs), bugs, &oenv))
{
return 0;