From: Roland Schulz Date: Sun, 24 Aug 2014 06:56:12 +0000 (-0400) Subject: Remove some include order dependencies X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?p=alexxy%2Fgromacs.git;a=commitdiff_plain;h=ca364374d27b09e182ef2a7bd099a6ec038ad21e Remove some include order dependencies 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 --- diff --git a/src/external/thread_mpi/include/thread_mpi/mpi_bindings.h b/src/external/thread_mpi/include/thread_mpi/mpi_bindings.h index 419ffb64a2..f4cf02b943 100644 --- a/src/external/thread_mpi/include/thread_mpi/mpi_bindings.h +++ b/src/external/thread_mpi/include/thread_mpi/mpi_bindings.h @@ -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 diff --git a/src/gromacs/gmxana/geminate.h b/src/gromacs/gmxana/geminate.h index dc95b06d96..91bb097421 100644 --- a/src/gromacs/gmxana/geminate.h +++ b/src/gromacs/gmxana/geminate.h @@ -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. @@ -35,6 +35,11 @@ #ifndef _GEMINATE_H #define _GEMINATE_H +#include + +#include "gromacs/utility/basedefinitions.h" +#include "gromacs/utility/real.h" + enum { gemNULL, gemNONE, gemDD, gemAD, gemAA, gemA4, gemNR }; diff --git a/src/gromacs/gmxpreprocess/convparm.h b/src/gromacs/gmxpreprocess/convparm.h index 60f1d5f7f4..d8c69a250d 100644 --- a/src/gromacs/gmxpreprocess/convparm.h +++ b/src/gromacs/gmxpreprocess/convparm.h @@ -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 diff --git a/src/gromacs/gmxpreprocess/nm2type.h b/src/gromacs/gmxpreprocess/nm2type.h index 9b428bbf9f..4f8505ed04 100644 --- a/src/gromacs/gmxpreprocess/nm2type.h +++ b/src/gromacs/gmxpreprocess/nm2type.h @@ -39,6 +39,10 @@ #include +#include "gromacs/gmxpreprocess/gpp_atomtype.h" +#include "gromacs/gmxpreprocess/grompp-impl.h" +#include "gromacs/topology/atoms.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/src/gromacs/gmxpreprocess/tomorse.h b/src/gromacs/gmxpreprocess/tomorse.h index e24817c829..39630fbf62 100644 --- a/src/gromacs/gmxpreprocess/tomorse.h +++ b/src/gromacs/gmxpreprocess/tomorse.h @@ -39,6 +39,8 @@ #define GMX_GMXPREPROCESS_TOMORSE_H #include +#include "gromacs/gmxpreprocess/gpp_atomtype.h" +#include "gromacs/gmxpreprocess/grompp-impl.h" #include "gromacs/legacyheaders/typedefs.h" #ifdef __cplusplus diff --git a/src/gromacs/gmxpreprocess/xlate.h b/src/gromacs/gmxpreprocess/xlate.h index 549aa4563b..aa1c61006d 100644 --- a/src/gromacs/gmxpreprocess/xlate.h +++ b/src/gromacs/gmxpreprocess/xlate.h @@ -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 diff --git a/src/gromacs/legacyheaders/types/fcdata.h b/src/gromacs/legacyheaders/types/fcdata.h index e158f982bd..9188a3bb6e 100644 --- a/src/gromacs/legacyheaders/types/fcdata.h +++ b/src/gromacs/legacyheaders/types/fcdata.h @@ -41,6 +41,8 @@ extern "C" { #endif +#include "gromacs/math/vectypes.h" + typedef real rvec5[5]; /* Distance restraining stuff */ diff --git a/src/gromacs/legacyheaders/types/forcerec.h b/src/gromacs/legacyheaders/types/forcerec.h index 007f7f4481..07fc2be29f 100644 --- a/src/gromacs/legacyheaders/types/forcerec.h +++ b/src/gromacs/legacyheaders/types/forcerec.h @@ -35,6 +35,10 @@ * 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 diff --git a/src/gromacs/legacyheaders/types/genborn.h b/src/gromacs/legacyheaders/types/genborn.h index d9e38bf9b7..d7acafe011 100644 --- a/src/gromacs/legacyheaders/types/genborn.h +++ b/src/gromacs/legacyheaders/types/genborn.h @@ -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 diff --git a/src/gromacs/legacyheaders/types/interaction_const.h b/src/gromacs/legacyheaders/types/interaction_const.h index 1f1a50ae63..319d6c2a61 100644 --- a/src/gromacs/legacyheaders/types/interaction_const.h +++ b/src/gromacs/legacyheaders/types/interaction_const.h @@ -33,8 +33,10 @@ * 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 diff --git a/src/gromacs/legacyheaders/types/ns.h b/src/gromacs/legacyheaders/types/ns.h index b5dffcd401..bc69cad31d 100644 --- a/src/gromacs/legacyheaders/types/ns.h +++ b/src/gromacs/legacyheaders/types/ns.h @@ -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 diff --git a/src/gromacs/legacyheaders/types/qmmmrec.h b/src/gromacs/legacyheaders/types/qmmmrec.h index f8e39ad5a4..7bbd8806e0 100644 --- a/src/gromacs/legacyheaders/types/qmmmrec.h +++ b/src/gromacs/legacyheaders/types/qmmmrec.h @@ -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 diff --git a/src/gromacs/mdlib/mdebin_bar.h b/src/gromacs/mdlib/mdebin_bar.h index 8da7c38fef..c31a068edf 100644 --- a/src/gromacs/mdlib/mdebin_bar.h +++ b/src/gromacs/mdlib/mdebin_bar.h @@ -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 diff --git a/src/gromacs/pulling/pull_rotation.h b/src/gromacs/pulling/pull_rotation.h index b650b71a98..567b4e95c8 100644 --- a/src/gromacs/pulling/pull_rotation.h +++ b/src/gromacs/pulling/pull_rotation.h @@ -49,6 +49,7 @@ #define GMX_PULLING_PULL_ROTATION_H #include "gromacs/legacyheaders/typedefs.h" +#include "gromacs/timing/wallcycle.h" #include "../fileio/filenm.h" diff --git a/src/gromacs/selection/mempool.h b/src/gromacs/selection/mempool.h index 352ed5fab6..d131eb9d06 100644 --- a/src/gromacs/selection/mempool.h +++ b/src/gromacs/selection/mempool.h @@ -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 + struct gmx_ana_index_t; /** Opaque struct for memory pooling. */ diff --git a/src/gromacs/swap/swapcoords.h b/src/gromacs/swap/swapcoords.h index 8a0ff76637..1693e1b670 100644 --- a/src/gromacs/swap/swapcoords.h +++ b/src/gromacs/swap/swapcoords.h @@ -54,6 +54,7 @@ #include "gromacs/legacyheaders/typedefs.h" #include "gromacs/legacyheaders/types/commrec.h" +#include "gromacs/timing/wallcycle.h" #ifdef __cplusplus extern "C" { diff --git a/src/programs/mdrun/pme_loadbal.h b/src/programs/mdrun/pme_loadbal.h index a96881eac3..db68beb1ab 100644 --- a/src/programs/mdrun/pme_loadbal.h +++ b/src/programs/mdrun/pme_loadbal.h @@ -40,6 +40,12 @@ 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 */ diff --git a/src/programs/view/nmol.h b/src/programs/view/nmol.h index fe66bb5b39..e1802ae5a0 100644 --- a/src/programs/view/nmol.h +++ b/src/programs/view/nmol.h @@ -38,6 +38,7 @@ #ifndef _nmol_h #define _nmol_h +#include "programs/view/manager.h" #include "x11.h" #include "xutil.h" diff --git a/src/programs/view/xmb.h b/src/programs/view/xmb.h index 00675dbbce..69234ce924 100644 --- a/src/programs/view/xmb.h +++ b/src/programs/view/xmb.h @@ -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,10 @@ #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)