Remove some include order dependencies
authorRoland Schulz <roland@utk.edu>
Sun, 24 Aug 2014 06:56:12 +0000 (02:56 -0400)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sun, 7 Sep 2014 15:14:42 +0000 (17:14 +0200)
Add explicit #include statements to headers that need definitions from
other headers, instead of relying on the including code to include those
headers earlier.  This allows reordering and refactoring #include
statements without breaking the compilation in unrelated pieces of code.

This set of changes is sufficient to make things compile after applying
the WIP automatic include sorter with the default order; other ordering
may expose more such dependencies.

Change-Id: I52536bca8930f1c489b084327071f090eec8a445

19 files changed:
src/external/thread_mpi/include/thread_mpi/mpi_bindings.h
src/gromacs/gmxana/geminate.h
src/gromacs/gmxpreprocess/convparm.h
src/gromacs/gmxpreprocess/nm2type.h
src/gromacs/gmxpreprocess/tomorse.h
src/gromacs/gmxpreprocess/xlate.h
src/gromacs/legacyheaders/types/fcdata.h
src/gromacs/legacyheaders/types/forcerec.h
src/gromacs/legacyheaders/types/genborn.h
src/gromacs/legacyheaders/types/interaction_const.h
src/gromacs/legacyheaders/types/ns.h
src/gromacs/legacyheaders/types/qmmmrec.h
src/gromacs/mdlib/mdebin_bar.h
src/gromacs/pulling/pull_rotation.h
src/gromacs/selection/mempool.h
src/gromacs/swap/swapcoords.h
src/programs/mdrun/pme_loadbal.h
src/programs/view/nmol.h
src/programs/view/xmb.h

index 419ffb64a236c1de024ebf7bc93363d7d20c4995..f4cf02b9435a4006279aa3c5abc09d33a4735e8b 100644 (file)
@@ -38,6 +38,8 @@
 #ifndef TMPI_MPI_BINDINGS_H_
 #define TMPI_MPI_BINDINGS_H_
 
+#include "tmpi.h"
+
 /** \file
    \brief MPI bindings for thread_mpi/tmpi.h
 
index dc95b06d96329220e8f9413e9b748a57fe203f0f..91bb0974210a17b7b2b3110ef7a1b154e365255e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,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 _GEMINATE_H
 #define _GEMINATE_H
 
+#include <stddef.h>
+
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
+
 enum {
     gemNULL, gemNONE, gemDD, gemAD, gemAA, gemA4, gemNR
 };
index 60f1d5f7f411a87e0b9534e23eda891af48d7c71..d8c69a250ddc50cf9d72bf416acfb53685523467 100644 (file)
@@ -38,6 +38,7 @@
 #ifndef GMX_GMXPREPROCESS_CONVPARM_H
 #define GMX_GMXPREPROCESS_CONVPARM_H
 
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
index 9b428bbf9f32a2674a05234fd38830bbf8ac5c0f..4f8505ed04bf7817835db8ab72f0a51da5bc164a 100644 (file)
 
 #include <stdio.h>
 
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/topology/atoms.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index e24817c8297e8cbc272cd7756b7dd91810751216..39630fbf62d4e337497a8edf01e91c91c04721ad 100644 (file)
@@ -39,6 +39,8 @@
 #define GMX_GMXPREPROCESS_TOMORSE_H
 
 #include <stdio.h>
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
index 549aa4563b6bc1682b941752219fdd6fdbd173fa..aa1c61006d4f2e50d1dc426f424e37c976fecbba 100644 (file)
@@ -38,6 +38,7 @@
 #ifndef GMX_GMXPREPROCESS_XLATE_H
 #define GMX_GMXPREPROCESS_XLATE_H
 
+#include "gromacs/gmxpreprocess/hackblock.h"
 #include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
index e158f982bd95bcaa65837a94ff981bdcd3a28fb4..9188a3bb6ea74a6e4ef616e04f761dc1c62543b3 100644 (file)
@@ -41,6 +41,8 @@
 extern "C" {
 #endif
 
+#include "gromacs/math/vectypes.h"
+
 typedef real rvec5[5];
 
 /* Distance restraining stuff */
index 007f7f4481b39490cf77fd5dc143b40e2b43db22..07fc2be29f521e5b502136e28dc0df4c88aff97a 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
+#ifndef GMX_LEGACYHEADERS_TYPES_FORCEREC_H
+#define GMX_LEGACYHEADERS_TYPES_FORCEREC_H
+
+#include "gromacs/legacyheaders/types/enums.h"
 #include "gromacs/legacyheaders/types/ns.h"
 #include "gromacs/legacyheaders/types/genborn.h"
 #include "gromacs/legacyheaders/types/qmmmrec.h"
@@ -496,3 +500,4 @@ typedef struct {
 #ifdef __cplusplus
 }
 #endif
+#endif
index d9e38bf9b70e9b7c17311c1360a2f268d7ea1111..d7acafe0119ca7a66367b3669885cf5972b9f218 100644 (file)
@@ -35,6 +35,8 @@
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
+#ifndef GMX_LEGACYHEADERS_TYPES_GENBORN_H
+#define GMX_LEGACYHEADERS_TYPES_GENBORN_H
 
 #ifdef __cplusplus
 extern "C" {
@@ -113,3 +115,4 @@ gmx_genborn_t;
 #ifdef __cplusplus
 }
 #endif
+#endif
index 1f1a50ae63c69ad57508c92702ed3d79808edbed..319d6c2a61995b79fcac08c7636bdf1c863d9658 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifndef _INTERACTION_CONST_
-#define _INTERACTION_CONST_
+#ifndef GMX_LEGACYHEADERS_INTERACTION_CONST_H
+#define GMX_LEGACYHEADERS_INTERACTION_CONST_H
+
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -133,4 +135,4 @@ typedef struct {
 }
 #endif
 
-#endif /* _INTERACTION_CONST_ */
+#endif
index b5dffcd40112915b241a2cd4886db9eb7dfd958a..bc69cad31d298385950a53fd001f3845044dbb33 100644 (file)
@@ -35,6 +35,9 @@
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
+#ifndef GMX_LEGACYHEADERS_TYPES_NS_H
+#define GMX_LEGACYHEADERS_TYPES_NS_H
+
 #include "gromacs/legacyheaders/types/nsgrid.h"
 #include "gromacs/legacyheaders/types/nblist.h"
 
@@ -82,3 +85,4 @@ typedef struct {
 #ifdef __cplusplus
 }
 #endif
+#endif
index f8e39ad5a4e73f712d1a9412c96af0f9857c959e..7bbd8806e04bb0de1d8a251aa0ba783a7b859140 100644 (file)
@@ -35,6 +35,8 @@
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
+#ifndef GMX_LEGACYHEADERS_TYPES_QMMMREC_H
+#define GMX_LEGACYHEADERS_TYPES_QMMMREC_H
 
 #include "gromacs/legacyheaders/types/simple.h"
 
@@ -109,3 +111,4 @@ typedef struct {
 #ifdef __cplusplus
 }
 #endif
+#endif
index 8da7c38fef6cb2257519459af3b7cf8cbbe7dcc3..c31a068edf96544f35a31252af2e9219ee7bc881 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,6 +38,8 @@
 #ifndef _mdebin_bar_h
 #define _mdebin_bar_h
 
+#include "gromacs/legacyheaders/mdebin.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index b650b71a9895368659a34a3cbd75304c772754b4..567b4e95c88dd092b9190bc31e80b51a7365bfab 100644 (file)
@@ -49,6 +49,7 @@
 #define GMX_PULLING_PULL_ROTATION_H
 
 #include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/timing/wallcycle.h"
 #include "../fileio/filenm.h"
 
 
index 352ed5fab6aef921ea3801cfe2b5db147a659c77..d131eb9d068e544425a9acc8f9d0b58efa52b35f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,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.
@@ -47,6 +47,8 @@
 #ifndef GMX_SELECTION_MEMPOOL_H
 #define GMX_SELECTION_MEMPOOL_H
 
+#include <cstddef>
+
 struct gmx_ana_index_t;
 
 /** Opaque struct for memory pooling. */
index 8a0ff766370f330a12dd3a33b4d531655cc7ffcc..1693e1b6703c90d93674f729f6f01b38a8deb72f 100644 (file)
@@ -54,6 +54,7 @@
 
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/timing/wallcycle.h"
 
 #ifdef __cplusplus
 extern "C" {
index a96881eac3550caea84c56ca50d5e468eb01b628..db68beb1abd6bdbac04907698d6362a3e33525c4 100644 (file)
 extern "C" {
 #endif
 
+#include "gromacs/legacyheaders/types/commrec_fwd.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/interaction_const.h"
+#include "gromacs/legacyheaders/types/state.h"
+
 typedef struct pme_load_balancing *pme_load_balancing_t;
 
 /* Initialze the PP-PME load balacing data and infrastructure */
index fe66bb5b399fe8fb3aa35d57197bce1bb4425d90..e1802ae5a0b29ee5f2431e111244c7220ed4eb59 100644 (file)
@@ -38,6 +38,7 @@
 #ifndef _nmol_h
 #define _nmol_h
 
+#include "programs/view/manager.h"
 #include "x11.h"
 #include "xutil.h"
 
index 00675dbbcec464c35b26d8eb797a7c284159227f..69234ce924736f5bddc363dda2b5b8ad398e38f6 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.
 #ifndef _xmb_h
 #define _xmb_h
 
-#include "x11.h"
+#include "programs/view/manager.h"
+#include "programs/view/x11.h"
+#include "programs/view/xdlg.h"
+#include "programs/view/xmb.h"
 
 #define MB_OK              1
 #define MB_CANCEL          (1<<1)