#include <config.h>
#endif
+#include <stdlib.h>
#include <string.h>
#include "gromacs/utility/futil.h"
{
if (sb->fval_alloc)
{
- free(sb->fval);
+ sfree(sb->fval);
sb->fval_alloc = 0;
sb->fval = NULL;
}
if (sb->dval_alloc)
{
- free(sb->dval);
+ sfree(sb->dval);
sb->dval_alloc = 0;
sb->dval = NULL;
}
if (sb->ival_alloc)
{
- free(sb->ival);
+ sfree(sb->ival);
sb->ival_alloc = 0;
sb->ival = NULL;
}
if (sb->lval_alloc)
{
- free(sb->lval);
+ sfree(sb->lval);
sb->lval_alloc = 0;
sb->lval = NULL;
}
if (sb->cval_alloc)
{
- free(sb->cval);
+ sfree(sb->cval);
sb->cval_alloc = 0;
sb->cval = NULL;
}
{
if (sb->sval[i])
{
- free(sb->sval[i]);
+ sfree(sb->sval[i]);
}
}
- free(sb->sval);
+ sfree(sb->sval);
sb->sval_alloc = 0;
sb->sval = NULL;
}
{
enxsubblock_free(&(eb->sub[i]));
}
- free(eb->sub);
+ sfree(eb->sub);
eb->nsub_alloc = 0;
eb->sub = NULL;
}
{
enxblock_free(&(fr->block[b]));
}
- free(fr->block);
+ sfree(fr->block);
}
void add_blocks_enxframe(t_enxframe *fr, int n)
* 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, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, 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.
#ifndef GMX_FILEIO_PDBIO_H
#define GMX_FILEIO_PDBIO_H
-#include "../legacyheaders/sysstuff.h"
+#include <stdio.h>
+
#include "../legacyheaders/typedefs.h"
#include "../legacyheaders/symtab.h"
#include "../legacyheaders/atomprop.h"
#endif
#include <math.h>
+#include <stdlib.h>
+
#include "typedefs.h"
#include "gromacs/utility/smalloc.h"
#include "vec.h"
#include <config.h>
#endif
+#include <stdlib.h>
#include <string.h>
#include "gromacs/fileio/confio.h"
#endif
#include <math.h>
+#include <stdlib.h>
#include <string.h>
#include "macros.h"
#include <config.h>
#endif
+#include <stdlib.h>
+
#include "gromacs/commandline/pargs.h"
#include "typedefs.h"
#include "gromacs/utility/smalloc.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+
#include <math.h>
+#include <stdlib.h>
#include <string.h>
#include "typedefs.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#include <string.h>
+
#include <math.h>
+#include <stdlib.h>
+#include <string.h>
#include "typedefs.h"
#include "gromacs/utility/smalloc.h"
#endif
#include <math.h>
+#include <stdlib.h>
#include <string.h>
#include "typedefs.h"
#include <config.h>
#endif
-#include "gromacs/utility/smalloc.h"
#include <math.h>
+#include <stdlib.h>
+
+#include "gromacs/utility/smalloc.h"
#include "macros.h"
#include "typedefs.h"
#include "xvgr.h"
#include <config.h>
#endif
-
+#include <math.h>
+#include <stdlib.h>
#include "gromacs/commandline/pargs.h"
#include "typedefs.h"
#include "vec.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
-#include <math.h>
#include "index.h"
#include "pbc.h"
#include "rmpbc.h"
#include "gmx_ana.h"
#include "macros.h"
-
static const double bohr = 0.529177249; /* conversion factor to compensate for VMD plugin conversion... */
-static void mequit(void)
-{
- printf("Memory allocation error\n");
- exit(1);
-}
-
int gmx_spatial(int argc, char *argv[])
{
const char *desc[] = {
MINBIN[i] -= (double)iNAB*rBINWIDTH;
nbin[i] = (long)ceil((MAXBIN[i]-MINBIN[i])/rBINWIDTH);
}
- bin = (long ***)malloc(nbin[XX]*sizeof(long **));
- if (!bin)
- {
- mequit();
- }
+ snew(bin, nbin[XX]);
for (i = 0; i < nbin[XX]; ++i)
{
- bin[i] = (long **)malloc(nbin[YY]*sizeof(long *));
- if (!bin[i])
- {
- mequit();
- }
+ snew(bin[i], nbin[YY]);
for (j = 0; j < nbin[YY]; ++j)
{
- bin[i][j] = (long *)calloc(nbin[ZZ], sizeof(long));
- if (!bin[i][j])
- {
- mequit();
- }
+ snew(bin[i][j], nbin[ZZ]);
}
}
copy_mat(box, box_pbc);
#include <config.h>
#endif
+#include <stdlib.h>
#include <time.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
/*Prepare data structures for FFT, with time averaging of power spectrum*/
if ( (status = gmx_fft_init_2d_real(&fftp, xbins, ybins, GMX_FFT_FLAG_NONE) ) != 0)
{
- free(fftp);
gmx_fatal(status, __FILE__, __LINE__, "Error allocating FFT");
}
gmx_ffclose(datfile1);
gmx_ffclose(datfile2);
- free(ftspect1);
- free(ftspect2);
+ sfree(ftspect1);
+ sfree(ftspect2);
}
#include <config.h>
#endif
+#include <errno.h>
+#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <config.h>
#endif
-#include <stdlib.h>
#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <config.h>
#endif
+#include <stdlib.h>
#include <string.h>
+
#include "gromacs/utility/smalloc.h"
#include "typedefs.h"
#include "mtop_util.h"
#include <ctype.h>
#include <stdarg.h>
+#include <stdlib.h>
#include <string.h>
#include "types/commrec.h"
#include <config.h>
#endif
+#include <stdlib.h>
+
#include "typedefs.h"
#include "gromacs/utility/fatalerror.h"
#include "sighandler.h"
-
const char *gmx_stop_cond_name[] =
{
"None",
#endif
#include <assert.h>
+#include <stdlib.h>
#include <string.h>
+
#include "macros.h"
-#include "gromacs/utility/smalloc.h"
#include "mshift.h"
+
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
typedef struct {
int atom, sid;
/* This file is completely threadsafe - please keep it that way! */
#include <stdio.h>
+#include <stdlib.h>
+
#include "typedefs.h"
#include "types/commrec.h"
#include "names.h"
if (molb->nposres_xA > 0)
{
molb->nposres_xA = 0;
- free(molb->posres_xA);
+ sfree(molb->posres_xA);
}
if (molb->nposres_xB > 0)
{
molb->nposres_xB = 0;
- free(molb->posres_xB);
+ sfree(molb->posres_xB);
}
}
#include <config.h>
#endif
+#include <stdlib.h>
#include <string.h>
#include "oenv.h"
#endif
#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
#include <sys/types.h>
-#include <math.h>
+
#include "typedefs.h"
#include "physics.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/utility/fatalerror.h"
#include "macros.h"
#include "vec.h"
#include "coulomb.h"
#include "calc_verletbuf.h"
#include "../mdlib/nbnxn_consts.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
+
#ifdef GMX_NBNXN_SIMD
/* The include below sets the SIMD instruction type (precision+width)
* for all nbnxn SIMD search and non-bonded kernel code.
#include <math.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-#include "gromacs/utility/cstringutil.h"
#include "gen_vsite.h"
-#include "gromacs/utility/smalloc.h"
#include "resall.h"
#include "add_par.h"
#include "vec.h"
#include "fflibutil.h"
#include "macros.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
#define MAXNAME 32
#define OPENDIR '[' /* starting sign for directive */
#ifndef GMX_GMXPREPROCESS_H_DB_H
#define GMX_GMXPREPROCESS_H_DB_H
-#include "sysstuff.h"
+#include <stdio.h>
+
#include "hackblock.h"
#ifdef __cplusplus
free_t_bondeds(&(*rtp)[i].rb[j]);
}
}
- free(*rtp);
+ sfree(*rtp);
}
void free_t_hack(int nh, t_hack **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 <stdlib.h>
#include <string.h>
-#include "gromacs/utility/cstringutil.h"
#include "readir.h"
#include "names.h"
-#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
#define MAXPTR 254
#include <config.h>
#endif
+#include <stdlib.h>
+
#include "typedefs.h"
-#include "gromacs/random/random.h"
-#include "gromacs/utility/smalloc.h"
#include "vec.h"
#include "sortwater.h"
+#include "gromacs/random/random.h"
+#include "gromacs/utility/smalloc.h"
+
static rvec *xptr, box_1;
static int nwat;
static matrix BOX;
#ifndef GMX_GMXPREPROCESS_TER_DB_H
#define GMX_GMXPREPROCESS_TER_DB_H
-#include "sysstuff.h"
#include "hackblock.h"
#include "grompp-impl.h"
#include <config.h>
#endif
-
+#include <errno.h>
#include <string.h>
#ifdef GMX_NATIVE_WINDOWS
#include <config.h>
#endif
-
+#include <errno.h>
#include <string.h>
+
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/fatalerror.h"
#include "imdsocket.h"
#include "imd.h"
-
#ifdef GMX_NATIVE_WINDOWS
#ifdef GMX_HAVE_WINSOCK
/*! \brief Define socklen type on Windows. */
#endif
#else
/* On UNIX, we can use nice errors from errno.h */
-#include <errno.h>
#include <unistd.h>
#endif
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, 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.
#ifndef _chargegroup_h
#define _chargegroup_h
-#include "sysstuff.h"
+#include <stdio.h>
+
#include "typedefs.h"
#ifdef __cplusplus
#ifndef _disre_h
#define _disre_h
-#include "sysstuff.h"
+#include <stdio.h>
+
#include "typedefs.h"
#ifdef __cplusplus
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, 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.
#ifndef _ebin_h
#define _ebin_h
-#include "sysstuff.h"
+#include <stdio.h>
+
#include "typedefs.h"
#include "../fileio/enxio.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, 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.
#ifndef _macros_h
#define _macros_h
-#include "typedefs.h" /* for real definition only */
+#include <stdlib.h>
/* no extern "C" for this header because it only defines Macros */
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, 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.
#ifndef _mdebin_h
#define _mdebin_h
+#include <stdio.h>
+
#include "typedefs.h"
-#include "sysstuff.h"
#include "ebin.h"
#include "../fileio/enxio.h"
#include "types/state.h"
#define _ns_h
#include <stdio.h>
-#include "sysstuff.h"
+
#include "typedefs.h"
#include "pbc.h"
#include "tgroup.h"
#ifndef _orires_h
#define _orires_h
-#include "sysstuff.h"
+#include <stdio.h>
+
#include "typedefs.h"
#ifdef __cplusplus
#ifndef _types_pbc_h
#define _types_pbc_h
-#include "sysstuff.h"
+#include <stdio.h>
+
#include "typedefs.h"
#ifdef __cplusplus
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, 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.
#ifndef _rbin_h
#define _rbin_h
-#include "sysstuff.h"
#include "typedefs.h"
-#include "network.h"
#ifdef __cplusplus
extern "C" {
#define NOTSET -12345
#include <sys/types.h>
-#include "sysstuff.h"
+
#include "types/simple.h"
#include "types/enums.h"
#include "types/block.h"
#ifndef _inputrec_h_
#define _inputrec_h_
+#include <stdio.h>
#include "simple.h"
#include "enums.h"
-#include "../sysstuff.h"
#include "../../swap/enums.h"
#ifdef __cplusplus
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, 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.
#ifndef _vcm_h
#define _vcm_h
-#include "sysstuff.h"
+#include <stdio.h>
+
#include "typedefs.h"
#ifdef __cplusplus
#include "types/simple.h"
#include "typedefs.h"
-#include "sysstuff.h"
#include "physics.h"
#include "../math/utilities.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, 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.
#ifndef _xvgr_h
#define _xvgr_h
-#include "sysstuff.h"
+#include <stdio.h>
+
#include "typedefs.h"
#include "viewit.h"
#endif
#include <math.h>
+#include <stdlib.h>
#include "types/commrec.h"
#include "constr.h"
#include "physics.h"
#include "vec.h"
#include "pbc.h"
-#include "gromacs/utility/smalloc.h"
#include "mdrun.h"
#include "nrnb.h"
#include "domdec.h"
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
typedef struct {
int b0; /* first constraint for this thread */
#include <config.h>
#endif
+#include <stdlib.h>
+
#include "gromacs/fileio/confio.h"
#include "types/commrec.h"
#include "constr.h"
#include <config.h>
#endif
-#include <stdio.h>
#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
#include "typedefs.h"
#include "types/commrec.h"
#include "vec.h"
#include <config.h>
#endif
-#include <string.h>
#include <float.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "typedefs.h"
#include "mdebin.h"
#include "gromacs/utility/smalloc.h"
#include <config.h>
#endif
+#include <assert.h>
#include <math.h>
+#include <stdlib.h>
#include <string.h>
-#include <assert.h>
-#include "gromacs/utility/smalloc.h"
+
#include "macros.h"
#include "vec.h"
#include "nbnxn_consts.h"
#include "nbnxn_internal.h"
#include "nbnxn_atomdata.h"
#include "nbnxn_search.h"
-#include "gromacs/utility/gmxomp.h"
#include "gmx_omp_nthreads.h"
#include "thread_mpi/atomic.h"
+#include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
+
/* Default nbnxn allocation routine, allocates NBNXN_MEM_ALIGN byte aligned */
void nbnxn_alloc_aligned(void **ptr, size_t nbytes)
{
#include <config.h>
#endif
+#include <assert.h>
+#include <math.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-#include <math.h>
-#include <assert.h>
+
#include "typedefs.h"
#include "txtdump.h"
#include "vec.h"
#include <config.h>
#endif
+#include <stdlib.h>
#include <string.h>
+
#include "typedefs.h"
#include "types/commrec.h"
#include "gromacs/utility/smalloc.h"
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014, 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.
*/
#include "gromacs/selection/centerofmass.h"
+#include <errno.h>
+
#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/legacyheaders/pbc.h"
#include "gromacs/legacyheaders/vec.h"
*/
#include "gromacs/selection/indexutil.h"
+#include <cstdlib>
#include <cstring>
#include <string>
void
gmx_ana_index_sort(gmx_ana_index_t *g)
{
- qsort(g->index, g->isize, sizeof(*g->index), cmp_atomid);
+ std::qsort(g->index, g->isize, sizeof(*g->index), cmp_atomid);
}
/*!
#include <config.h>
#endif
+#include <stdlib.h>
#include <string.h>
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/utility/fatalerror.h"
#include "md_logging.h"
-#include "gromacs/utility/cstringutil.h"
#include "gromacs/timing/cyclecounter.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/smalloc.h"
/* DEBUG_WCYCLE adds consistency checking for the counters.
* It checks if you stop a counter different from the last