Remove sysstuff.h includes from headers
authorTeemu Murtola <teemu.murtola@gmail.com>
Sun, 13 Apr 2014 07:05:14 +0000 (10:05 +0300)
committerRoland Schulz <roland@rschulz.eu>
Wed, 16 Apr 2014 01:45:30 +0000 (03:45 +0200)
Remove #include "sysstuff.h" from all headers, and replace it with
standard headers where necessary.  Add necessary standard headers to
source files that previously got them transitively from one of these.

Use snew() in gmx_spatial.c instead of a custom implementation.
Replace some free() with sfree().

Part of getting rid of sysstuff.h.

Change-Id: I857ba69c004aea16195e629c5bf69df32724b3fc

55 files changed:
src/gromacs/fileio/enxio.c
src/gromacs/fileio/pdbio.h
src/gromacs/gmxana/geminate.c
src/gromacs/gmxana/gmx_anadock.c
src/gromacs/gmxana/gmx_cluster.c
src/gromacs/gmxana/gmx_current.c
src/gromacs/gmxana/gmx_disre.c
src/gromacs/gmxana/gmx_eneconv.c
src/gromacs/gmxana/gmx_energy.c
src/gromacs/gmxana/gmx_rms.c
src/gromacs/gmxana/gmx_spatial.c
src/gromacs/gmxana/gmx_tune_pme.c
src/gromacs/gmxana/powerspect.c
src/gromacs/gmxlib/checkpoint.c
src/gromacs/gmxlib/gmx_detect_hardware.c
src/gromacs/gmxlib/mtop_util.c
src/gromacs/gmxlib/network.c
src/gromacs/gmxlib/sighandler.c
src/gromacs/gmxlib/splitter.c
src/gromacs/gmxlib/txtdump.c
src/gromacs/gmxlib/typedefs.c
src/gromacs/gmxlib/viewit.c
src/gromacs/gmxpreprocess/calc_verletbuf.c
src/gromacs/gmxpreprocess/gen_vsite.c
src/gromacs/gmxpreprocess/h_db.h
src/gromacs/gmxpreprocess/hackblock.c
src/gromacs/gmxpreprocess/readadress.c
src/gromacs/gmxpreprocess/sortwater.c
src/gromacs/gmxpreprocess/ter_db.h
src/gromacs/imd/imd.c
src/gromacs/imd/imdsocket.c
src/gromacs/legacyheaders/chargegroup.h
src/gromacs/legacyheaders/disre.h
src/gromacs/legacyheaders/ebin.h
src/gromacs/legacyheaders/macros.h
src/gromacs/legacyheaders/mdebin.h
src/gromacs/legacyheaders/ns.h
src/gromacs/legacyheaders/orires.h
src/gromacs/legacyheaders/pbc.h
src/gromacs/legacyheaders/rbin.h
src/gromacs/legacyheaders/typedefs.h
src/gromacs/legacyheaders/types/inputrec.h
src/gromacs/legacyheaders/vcm.h
src/gromacs/legacyheaders/vec.h
src/gromacs/legacyheaders/xvgr.h
src/gromacs/mdlib/clincs.c
src/gromacs/mdlib/constr.c
src/gromacs/mdlib/ewald.c
src/gromacs/mdlib/mdebin.c
src/gromacs/mdlib/nbnxn_atomdata.c
src/gromacs/mdlib/pme.c
src/gromacs/mdlib/shellfc.c
src/gromacs/selection/centerofmass.cpp
src/gromacs/selection/indexutil.cpp
src/gromacs/timing/wallcycle.c

index ec3388764d607b7296a1ca74781d0994edd183b5..70718363dfbb94a87c48717543d880d594b914b5 100644 (file)
@@ -38,6 +38,7 @@
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
 
 #include "gromacs/utility/futil.h"
@@ -110,31 +111,31 @@ static void enxsubblock_free(t_enxsubblock *sb)
 {
     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;
     }
@@ -146,10 +147,10 @@ static void enxsubblock_free(t_enxsubblock *sb)
         {
             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;
     }
@@ -231,7 +232,7 @@ static void enxblock_free(t_enxblock *eb)
         {
             enxsubblock_free(&(eb->sub[i]));
         }
-        free(eb->sub);
+        sfree(eb->sub);
         eb->nsub_alloc = 0;
         eb->sub        = NULL;
     }
@@ -265,7 +266,7 @@ void free_enxframe(t_enxframe *fr)
     {
         enxblock_free(&(fr->block[b]));
     }
-    free(fr->block);
+    sfree(fr->block);
 }
 
 void add_blocks_enxframe(t_enxframe *fr, int n)
index 18745d2c87b8971da088822ea34f2bb2ae94dbfa..7b152c6b354dacff7268a167469d142d86eb10f9 100644 (file)
@@ -2,8 +2,8 @@
  * 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.
@@ -38,7 +38,8 @@
 #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"
index 10d965044b1454af62aff9ad646a89d9c650c0a5..7d00997b1cfa5e943b4ea037cbda075807b3560c 100644 (file)
@@ -37,6 +37,8 @@
 #endif
 
 #include <math.h>
+#include <stdlib.h>
+
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "vec.h"
index 7f9228af0a313e0b5c0ad8b20a26526ab50215bb..7c0da6dfe008055576ceb2d1186e5126a84b5429 100644 (file)
@@ -38,6 +38,7 @@
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
 
 #include "gromacs/fileio/confio.h"
index 0950de5d0712132209a050cf0f132e2880b01b5d..86a0cdc21b5f876a7333b2236896a781b6cb1226 100644 (file)
@@ -39,6 +39,7 @@
 #endif
 
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "macros.h"
index 14be9bc5a85b2df64dee77bc8fd7e9f83409a99d..d6531e04a27f33bd67e26bb8174a93a0f3795a2a 100644 (file)
@@ -36,6 +36,8 @@
 #include <config.h>
 #endif
 
+#include <stdlib.h>
+
 #include "gromacs/commandline/pargs.h"
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
index 84ebace731160fcc9af9dd0d38caab3cec4c1c1d..274588849d3dc1f79d0950b405df5a9f48d87e24 100644 (file)
@@ -37,7 +37,9 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "typedefs.h"
index b789cad7e5e89999456e45059c0ea74a6c2e4fff..ef2a219e541a4ce98ce3fcf99e4e2c2fac0a48b3 100644 (file)
 #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"
index 3b510e14119bc1d61d34a999f6bfe354ca44e6c8..ebacc2c22968627f1070fd7d165a78b312a5e71c 100644 (file)
@@ -39,6 +39,7 @@
 #endif
 
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "typedefs.h"
index c0d913e7a95f8af29e616de5df00499429e1f455..514367abcb4441032004d26c300296ef43beb862 100644 (file)
 #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"
index 32d2fefc36a505d920248932576fae3736b94d4d..7e881f4e226dd1aff74369953427d7ba99314555 100644 (file)
@@ -36,7 +36,8 @@
 #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[] = {
@@ -218,25 +211,13 @@ int gmx_spatial(int argc, char *argv[])
         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);
index 08584600f99537ff34c5d074a11a6e1f5729c4ae..d3ca47a2bc3290914d7778ce23e476fd72826550 100644 (file)
@@ -36,6 +36,7 @@
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <time.h>
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
index 4f4ae6df98cab1d2c68905fedc7133c09c10e30f..571646f259be7884944c57959775ad3566de8dd6 100644 (file)
@@ -73,7 +73,6 @@ void powerspectavg(real ***intftab, int tsteps, int xbins, int ybins, char **out
 /*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");
     }
 
@@ -113,8 +112,8 @@ void powerspectavg(real ***intftab, int tsteps, int xbins, int ybins, char **out
     gmx_ffclose(datfile1);
     gmx_ffclose(datfile2);
 
-    free(ftspect1);
-    free(ftspect2);
+    sfree(ftspect1);
+    sfree(ftspect2);
 
 }
 
index 72f6da0ea9356a99f2cbb16efbac09b27c076ac6..3651f026ee0e1e1c164dbc8310fa53d88cb8cfce 100644 (file)
@@ -41,6 +41,8 @@
 #include <config.h>
 #endif
 
+#include <errno.h>
+#include <stdlib.h>
 #include <string.h>
 #include <time.h>
 
index 62e67b8c58572bf46d3e5cd112f759229fc08c23..f3400d33818bb3ff6144addc0c2e9b3f77df7e0e 100644 (file)
@@ -36,8 +36,9 @@
 #include <config.h>
 #endif
 
-#include <stdlib.h>
 #include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
 #include <string.h>
 
 #ifdef HAVE_UNISTD_H
index 39ffce6d61492541a3931728df10a6dfe802563d..7fd56a6e19c9cb6c20e513af6d6ab6cc5a4d6d9f 100644 (file)
@@ -37,7 +37,9 @@
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
+
 #include "gromacs/utility/smalloc.h"
 #include "typedefs.h"
 #include "mtop_util.h"
index e46c7eea997b5137ca9b0f92bbcf57fac281d950..b683c97ec459bc03d33cdffdf5d6636c476a1e97 100644 (file)
@@ -42,6 +42,7 @@
 
 #include <ctype.h>
 #include <stdarg.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "types/commrec.h"
index d42be8a220353039bc5e2425b4fbbbcd4d0692c5..757ba30f40401d10e59f036233f8584c9e1fc37a 100644 (file)
 #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",
index 78e9e479a6b266c71dd44a9c29dfd022ad5324f6..c5793a5e2b75c8318fb9af61c70112b270ff29d7 100644 (file)
 #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;
index a84e2e4b49ea67f428bead18af781f5c784a825c..314eef2d3dbbdefb7694ad9270a7da424c2637da 100644 (file)
@@ -41,6 +41,8 @@
 /* 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"
index 81eab1b2ebf765d19b7f0090a4ae24f106cbb140..92b10975ca885d062640ad4db30beb4c6e3a0db6 100644 (file)
@@ -331,12 +331,12 @@ void done_molblock(gmx_molblock_t *molb)
     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);
     }
 }
 
index fe685e43d1d7fcfd3a6fae71d8cf5f50d67f231d..4f77869b8017f0d8ce6c6717abdb9cbb8880c825 100644 (file)
@@ -39,6 +39,7 @@
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
 
 #include "oenv.h"
index a506e9b1ceada1184a304ce16726dac33711bfac..0ea860be07d889ab0744f7f81451beed2b4931d3 100644 (file)
 #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.
index c8731622c2c6409f60466f5196605eab207c23c2..5e95eecb39dd1222c230d814f4ad4777d3de7156 100644 (file)
 
 #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"
@@ -57,7 +56,9 @@
 #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         */
index 604966552b26d006585b95a01aae4c26dd87ba29..f297506765f1e06dfbef013178b541483a79de12 100644 (file)
@@ -38,7 +38,8 @@
 #ifndef GMX_GMXPREPROCESS_H_DB_H
 #define GMX_GMXPREPROCESS_H_DB_H
 
-#include "sysstuff.h"
+#include <stdio.h>
+
 #include "hackblock.h"
 
 #ifdef __cplusplus
index 262e308f72da17defb1fbe9bf05a35514b361571..b74e294bf2e00a5d8b4d7c6ea771b241c2a4adef 100644 (file)
@@ -93,7 +93,7 @@ void free_t_restp(int nrtp, t_restp **rtp)
             free_t_bondeds(&(*rtp)[i].rb[j]);
         }
     }
-    free(*rtp);
+    sfree(*rtp);
 }
 
 void free_t_hack(int nh, t_hack **h)
index f8aa8b6971413ca52a9e7a90eecfa8bf20955e42..422198aa0a8c5d067c0b0be2c1f1cac503ce8b7c 100644 (file)
  * 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
 
index 63834a92585c7fac628a66f597d1c901aecb487d..abcac867ccba39666d99852faf78caea81b6afc4 100644 (file)
 #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;
index 3f859699af918bef8020991e2462dc603e4b017b..40547627da54ed8b442304a00844f2f8ce1eee07 100644 (file)
@@ -38,7 +38,6 @@
 #ifndef GMX_GMXPREPROCESS_TER_DB_H
 #define GMX_GMXPREPROCESS_TER_DB_H
 
-#include "sysstuff.h"
 #include "hackblock.h"
 #include "grompp-impl.h"
 
index 2f919d6326224f5132e855b04cafce12ee5fa565..960d9504a8c533b0e6f476382e3b77ca1107400b 100644 (file)
@@ -50,7 +50,7 @@
 #include <config.h>
 #endif
 
-
+#include <errno.h>
 #include <string.h>
 
 #ifdef GMX_NATIVE_WINDOWS
index 3c0d08a0ca23a8b184ae00e28ca26950b1787ef0..8c0719eab5efc0c077d90bdc6c419aca8f5b9817 100644 (file)
 #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. */
@@ -78,7 +78,6 @@ extern int imdsock_winsockinit()
 #endif
 #else
 /* On UNIX, we can use nice errors from errno.h */
-#include <errno.h>
 #include <unistd.h>
 #endif
 
index 2fab5bc79cc1b21aa934691515a6e9ffc4f9fd59..44a429fe575f17ff13afa53aa4803fb9e84b24d0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * 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.
@@ -38,7 +38,8 @@
 #ifndef _chargegroup_h
 #define _chargegroup_h
 
-#include "sysstuff.h"
+#include <stdio.h>
+
 #include "typedefs.h"
 
 #ifdef __cplusplus
index 2b8cfab10cfb876fb53caafe06add1da91eb75c6..eca746698af2a3a1be038732d1a7b52dfaed3050 100644 (file)
@@ -38,7 +38,8 @@
 #ifndef _disre_h
 #define _disre_h
 
-#include "sysstuff.h"
+#include <stdio.h>
+
 #include "typedefs.h"
 
 #ifdef __cplusplus
index b468a3bc6b6dc1d3881d81758ddc4612108ab8c7..61a8db1de3340efde074a145c3158b8bca4965fc 100644 (file)
@@ -3,7 +3,7 @@
  *
  * 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.
@@ -38,7 +38,8 @@
 #ifndef _ebin_h
 #define _ebin_h
 
-#include "sysstuff.h"
+#include <stdio.h>
+
 #include "typedefs.h"
 #include "../fileio/enxio.h"
 
index 0d02e7f53ba18694fbfb0425b7951dad667ec6ab..4452325a6395853551d4abeae7922e2d49b3c4ad 100644 (file)
@@ -3,7 +3,7 @@
  *
  * 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.
@@ -38,7 +38,7 @@
 #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 */
 
index 4516a07367860787a8e1b72642a58f73d34c0660..ad76bd567ac8925227e9ca19a962a79506468baa 100644 (file)
@@ -3,7 +3,7 @@
  *
  * 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.
@@ -38,8 +38,9 @@
 #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"
index dafbfa9f6e7fe64e68da0df51d58d87663095ede..24e1bc8042de3774204a83740d56be9647f7f7dc 100644 (file)
@@ -39,7 +39,7 @@
 #define _ns_h
 
 #include <stdio.h>
-#include "sysstuff.h"
+
 #include "typedefs.h"
 #include "pbc.h"
 #include "tgroup.h"
index deb1bfe7f121985f6bb818698052ec1f3bb4d6a9..1a6b17ef92cd6008a84b7e163e0996debe3d1693 100644 (file)
@@ -38,7 +38,8 @@
 #ifndef _orires_h
 #define _orires_h
 
-#include "sysstuff.h"
+#include <stdio.h>
+
 #include "typedefs.h"
 
 #ifdef __cplusplus
index be7e51fa9e421344d1dea33f5f1fe409873ab068..eca121f79dfc575f5141ca8576db7fd2f0ee9ae8 100644 (file)
@@ -38,7 +38,8 @@
 #ifndef _types_pbc_h
 #define _types_pbc_h
 
-#include "sysstuff.h"
+#include <stdio.h>
+
 #include "typedefs.h"
 
 #ifdef __cplusplus
index 72f5b4ce1c2f1c880eb16786eace4d58d27c3217..f8ff166fea35cf0eba8a462bd6cdf7c5f06dda96 100644 (file)
@@ -3,7 +3,7 @@
  *
  * 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.
@@ -38,9 +38,7 @@
 #ifndef _rbin_h
 #define _rbin_h
 
-#include "sysstuff.h"
 #include "typedefs.h"
-#include "network.h"
 
 #ifdef __cplusplus
 extern "C" {
index eb0b30b563c2d483007ebd35005b6e60da41838e..92f883b1b6c52cce6e007f4464479b9b1ed2fd8f 100644 (file)
@@ -43,7 +43,7 @@
 #define NOTSET -12345
 
 #include <sys/types.h>
-#include "sysstuff.h"
+
 #include "types/simple.h"
 #include "types/enums.h"
 #include "types/block.h"
index 3f463dcd53443547f885c9b8df131a04a3dcb85e..3380b12b50f13b677fb6a0c7923eb1b8ad612731 100644 (file)
 #ifndef _inputrec_h_
 #define _inputrec_h_
 
+#include <stdio.h>
 
 #include "simple.h"
 #include "enums.h"
-#include "../sysstuff.h"
 #include "../../swap/enums.h"
 
 #ifdef __cplusplus
index affebb924fa492e5f3eae6a5325d7e5d37c64b64..c11f77c87aed5c74a36b1924f2cddf10bb0c0ff0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * 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.
@@ -38,7 +38,8 @@
 #ifndef _vcm_h
 #define _vcm_h
 
-#include "sysstuff.h"
+#include <stdio.h>
+
 #include "typedefs.h"
 
 #ifdef __cplusplus
index a8300ea00b5d278e5f8de6aae35f34c6ec69c1cd..8687faa88c9f10ee3bd3c85f04028423431d08ab 100644 (file)
 
 #include "types/simple.h"
 #include "typedefs.h"
-#include "sysstuff.h"
 #include "physics.h"
 
 #include "../math/utilities.h"
index 22123bdd0441be5c86cc108d698225a18138a236..d42e79d3564193c04fdd1b3a64797ce51aac21da 100644 (file)
@@ -3,7 +3,7 @@
  *
  * 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.
@@ -38,7 +38,8 @@
 #ifndef _xvgr_h
 #define _xvgr_h
 
-#include "sysstuff.h"
+#include <stdio.h>
+
 #include "typedefs.h"
 #include "viewit.h"
 
index d51afd5a198757dab41c647dc0841ebec5c870dc..01e30da5325f16b4323ffdaab1e164646cb603b3 100644 (file)
@@ -40,6 +40,7 @@
 #endif
 
 #include <math.h>
+#include <stdlib.h>
 
 #include "types/commrec.h"
 #include "constr.h"
@@ -47,7 +48,6 @@
 #include "physics.h"
 #include "vec.h"
 #include "pbc.h"
-#include "gromacs/utility/smalloc.h"
 #include "mdrun.h"
 #include "nrnb.h"
 #include "domdec.h"
@@ -57,6 +57,7 @@
 #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 */
index c9349a4a8bb7517c7492b562656666a618d195a3..aac7cc7d54ac9f597501c11dd662db9bc3b92910 100644 (file)
@@ -38,6 +38,8 @@
 #include <config.h>
 #endif
 
+#include <stdlib.h>
+
 #include "gromacs/fileio/confio.h"
 #include "types/commrec.h"
 #include "constr.h"
index 0a95977d638e4f99e759389aa16cdfd66c4a0ae8..4992003fa07443ee6346b7b0bf1b46cf490489cf 100644 (file)
 #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"
index 89bf17167f28d6f0e3e90b79443595602e2bd4eb..285f65e67fa059572ae5087572d7a87fa109f279 100644 (file)
 #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"
index 68365412121494b5daeab85794965ca63608977c..84a1c761032e76bd1694f1c7c955ddd5b016f65f 100644 (file)
 #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)
 {
index 63b7056b39247cffb8cfb4a325dc9c80e7637e83..6259694f81145733a96873736ff2f618ef4e7d1c 100644 (file)
 #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"
index caca5722993eb84183c3671cc9544411acde50e5..1121ee28228daf3e4c1c520662a37f5b703f6c3b 100644 (file)
@@ -38,7 +38,9 @@
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <string.h>
+
 #include "typedefs.h"
 #include "types/commrec.h"
 #include "gromacs/utility/smalloc.h"
index a46facd626b4ef26e9ef16f8b91d0ea4253743f3..bd14886ca46783840442560f444eb428ddc5e803 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * 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.
@@ -41,6 +41,8 @@
  */
 #include "gromacs/selection/centerofmass.h"
 
+#include <errno.h>
+
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/legacyheaders/pbc.h"
 #include "gromacs/legacyheaders/vec.h"
index 52b467e2dc81227b01f80efc7e4ec2495828f729..061c08bc246122752b0688308144082709998b35 100644 (file)
@@ -41,6 +41,7 @@
  */
 #include "gromacs/selection/indexutil.h"
 
+#include <cstdlib>
 #include <cstring>
 
 #include <string>
@@ -464,7 +465,7 @@ cmp_atomid(const void *a, const void *b)
 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);
 }
 
 /*!
index ccecbe8ca4e2d217df2d49f11422d1e61946afc7..ca6e0a88fbc652872fe208d7964e87ef12b44355 100644 (file)
 #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