Replaced gmx_bool to bool in C++ files
authorRoland Schulz <roland@utk.edu>
Wed, 14 Dec 2011 00:58:03 +0000 (19:58 -0500)
committerRoland Schulz <roland@utk.edu>
Thu, 15 Dec 2011 07:13:02 +0000 (02:13 -0500)
Replaced all files in folder: analysisdata fatalerror options
    selection trajectoryanalysis utility (C++ code)
Also replaced TRUE->true, FALSE->false
Removed all extern "C"

Change-Id: I891c41d3b4732d7abae58f0864f0513b32e5445f

42 files changed:
src/gromacs/analysisdata/modules/displacement-impl.h
src/gromacs/selection/centerofmass.cpp
src/gromacs/selection/centerofmass.h
src/gromacs/selection/compiler.cpp
src/gromacs/selection/evaluate.cpp
src/gromacs/selection/indexutil.cpp
src/gromacs/selection/indexutil.h
src/gromacs/selection/nbsearch.cpp
src/gromacs/selection/nbsearch.h
src/gromacs/selection/params.cpp
src/gromacs/selection/parsetree.cpp
src/gromacs/selection/parsetree.h
src/gromacs/selection/poscalc.cpp
src/gromacs/selection/poscalc.h
src/gromacs/selection/position.cpp
src/gromacs/selection/position.h
src/gromacs/selection/scanner.cpp
src/gromacs/selection/scanner.h
src/gromacs/selection/scanner.l
src/gromacs/selection/scanner_internal.cpp
src/gromacs/selection/scanner_internal.h
src/gromacs/selection/selection.cpp
src/gromacs/selection/selection.h
src/gromacs/selection/selectioncollection.cpp
src/gromacs/selection/selelem.cpp
src/gromacs/selection/selelem.h
src/gromacs/selection/selhelp.cpp
src/gromacs/selection/selmethod.cpp
src/gromacs/selection/selparam.h
src/gromacs/selection/selvalue.h
src/gromacs/selection/sm_compare.cpp
src/gromacs/selection/sm_insolidangle.cpp
src/gromacs/selection/sm_keywords.cpp
src/gromacs/selection/sm_permute.cpp
src/gromacs/selection/sm_position.cpp
src/gromacs/selection/sm_same.cpp
src/gromacs/selection/sm_simple.cpp
src/gromacs/selection/symrec.cpp
src/gromacs/selection/symrec.h
src/gromacs/trajectoryanalysis/analysissettings.h
src/gromacs/trajectoryanalysis/modules/select.cpp
src/gromacs/trajectoryanalysis/runnercommon.cpp

index 3d6b0f63cceb6fe562cd53def1339ffb826ea28b..02855db4ca4ed5188347d46be77f2229e6da5726 100644 (file)
@@ -64,7 +64,7 @@ class AnalysisDataDisplacementModule::Impl
         //! Number of dimensions per data point.
         int                     ndim;
 
-        //! TRUE if no frames have been read.
+        //! true if no frames have been read.
         bool                    bFirst;
         //! Stores the time of the first frame.
         real                    t0;
index 9a21ab9a759d35337cb23cc331e87d341ce266b3..49730d667e021a0dcdf3afd7e50e4ce45479c725 100644 (file)
@@ -146,13 +146,13 @@ gmx_calc_cog_f(t_topology *top, rvec f[], int nrefat, atom_id index[], rvec fout
 
 /*!
  * \param[in]  top   Topology structure with masses
- *   (can be NULL if \p bMASS==FALSE).
+ *   (can be NULL if \p bMASS==false).
  * \param[in]  x     Position vectors of all atoms.
  * \param[in]  nrefat Number of atoms in the index.
  * \param[in]  index Indices of atoms.
- * \param[in]  bMass If TRUE, mass weighting is used.
+ * \param[in]  bMass If true, mass weighting is used.
  * \param[out] xout  COM/COG position for the indexed atoms.
- * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is TRUE.
+ * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is true.
  *
  * Calls either gmx_calc_com() or gmx_calc_cog() depending on the value of
  * \p bMass.
@@ -160,7 +160,7 @@ gmx_calc_cog_f(t_topology *top, rvec f[], int nrefat, atom_id index[], rvec fout
  */
 int
 gmx_calc_comg(t_topology *top, rvec x[], int nrefat, atom_id index[],
-              gmx_bool bMass, rvec xout)
+              bool bMass, rvec xout)
 {
     if (bMass)
     {
@@ -174,13 +174,13 @@ gmx_calc_comg(t_topology *top, rvec x[], int nrefat, atom_id index[],
 
 /*!
  * \param[in]  top   Topology structure with masses
- *   (can be NULL if \p bMASS==TRUE).
+ *   (can be NULL if \p bMASS==true).
  * \param[in]  f     Forces on all atoms.
  * \param[in]  nrefat Number of atoms in the index.
  * \param[in]  index Indices of atoms.
- * \param[in]  bMass If TRUE, force on COM is calculated.
+ * \param[in]  bMass If true, force on COM is calculated.
  * \param[out] fout  Force on the COM/COG position for the indexed atoms.
- * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is FALSE.
+ * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is false.
  *
  * Calls either gmx_calc_cog() or gmx_calc_cog_f() depending on the value of
  * \p bMass.
@@ -188,7 +188,7 @@ gmx_calc_comg(t_topology *top, rvec x[], int nrefat, atom_id index[],
  */
 int
 gmx_calc_comg_f(t_topology *top, rvec f[], int nrefat, atom_id index[],
-                gmx_bool bMass, rvec fout)
+                bool bMass, rvec fout)
 {
     if (bMass)
     {
@@ -217,7 +217,7 @@ gmx_calc_cog_pbc(t_topology *top, rvec x[], t_pbc *pbc,
                  int nrefat, atom_id index[], rvec xout)
 {
     const real          tol = 1e-4;
-    gmx_bool                bChanged;
+    bool                bChanged;
     int                 m, j, ai, iter;
     rvec                dx, xtest;
 
@@ -229,7 +229,7 @@ gmx_calc_cog_pbc(t_topology *top, rvec x[], t_pbc *pbc,
         iter = 0;
         do
         {
-            bChanged = FALSE;
+            bChanged = false;
             for (m = 0; m < nrefat; ++m)
             {
                 ai = index[m];
@@ -242,7 +242,7 @@ gmx_calc_cog_pbc(t_topology *top, rvec x[], t_pbc *pbc,
                         /* Here we have used the wrong image for contributing to the COM */
                         xout[j] += (xtest[j] - x[ai][j]) / nrefat;
                         x[ai][j] = xtest[j];
-                        bChanged = TRUE;
+                        bChanged = true;
                     }
                 }
             }
@@ -274,7 +274,7 @@ gmx_calc_com_pbc(t_topology *top, rvec x[], t_pbc *pbc,
                  int nrefat, atom_id index[], rvec xout)
 {
     const real          tol = 1e-4;
-    gmx_bool                bChanged;
+    bool                bChanged;
     int                 m, j, ai, iter;
     real                mass, mtot;
     rvec                dx, xtest;
@@ -304,7 +304,7 @@ gmx_calc_com_pbc(t_topology *top, rvec x[], t_pbc *pbc,
         iter = 0;
         do
         {
-            bChanged = FALSE;
+            bChanged = false;
             for (m = 0; m < nrefat; ++m)
             {
                 ai = index[m];
@@ -318,7 +318,7 @@ gmx_calc_com_pbc(t_topology *top, rvec x[], t_pbc *pbc,
                         /* Here we have used the wrong image for contributing to the COM */
                         xout[j] += mass * (xtest[j] - x[ai][j]);
                         x[ai][j] = xtest[j];
-                        bChanged = TRUE;
+                        bChanged = true;
                     }
                 }
             }
@@ -331,14 +331,14 @@ gmx_calc_com_pbc(t_topology *top, rvec x[], t_pbc *pbc,
 
 /*!
  * \param[in]  top   Topology structure with masses
- *   (can be NULL if \p bMASS==FALSE).
+ *   (can be NULL if \p bMASS==false).
  * \param[in]  x     Position vectors of all atoms.
  * \param[in]  pbc    Periodic boundary conditions structure.
  * \param[in]  nrefat Number of atoms in the index.
  * \param[in]  index Indices of atoms.
- * \param[in]  bMass If TRUE, mass weighting is used.
+ * \param[in]  bMass If true, mass weighting is used.
  * \param[out] xout  COM/COG position for the indexed atoms.
- * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is TRUE.
+ * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is true.
  *
  * Calls either gmx_calc_com() or gmx_calc_cog() depending on the value of
  * \p bMass.
@@ -346,7 +346,7 @@ gmx_calc_com_pbc(t_topology *top, rvec x[], t_pbc *pbc,
  */
 int
 gmx_calc_comg_pbc(t_topology *top, rvec x[], t_pbc *pbc,
-                  int nrefat, atom_id index[], gmx_bool bMass, rvec xout)
+                  int nrefat, atom_id index[], bool bMass, rvec xout)
 {
     if (bMass)
     {
@@ -472,13 +472,13 @@ gmx_calc_cog_f_block(t_topology *top, rvec f[], t_block *block, atom_id index[],
 
 /*!
  * \param[in]  top   Topology structure with masses
- *   (can be NULL if \p bMASS==FALSE).
+ *   (can be NULL if \p bMASS==false).
  * \param[in]  x     Position vectors of all atoms.
  * \param[in]  block t_block structure that divides \p index into blocks.
  * \param[in]  index Indices of atoms.
- * \param[in]  bMass If TRUE, mass weighting is used.
+ * \param[in]  bMass If true, mass weighting is used.
  * \param[out] xout  \p block->nr COM/COG positions.
- * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is TRUE.
+ * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is true.
  *
  * Calls either gmx_calc_com_block() or gmx_calc_cog_block() depending on the
  * value of \p bMass.
@@ -486,7 +486,7 @@ gmx_calc_cog_f_block(t_topology *top, rvec f[], t_block *block, atom_id index[],
  */
 int
 gmx_calc_comg_block(t_topology *top, rvec x[], t_block *block, atom_id index[],
-                    gmx_bool bMass, rvec xout[])
+                    bool bMass, rvec xout[])
 {
     if (bMass)
     {
@@ -500,13 +500,13 @@ gmx_calc_comg_block(t_topology *top, rvec x[], t_block *block, atom_id index[],
 
 /*!
  * \param[in]  top   Topology structure with masses
- *   (can be NULL if \p bMASS==FALSE).
+ *   (can be NULL if \p bMASS==false).
  * \param[in]  f     Forces on all atoms.
  * \param[in]  block t_block structure that divides \p index into blocks.
  * \param[in]  index Indices of atoms.
- * \param[in]  bMass If TRUE, force on COM is calculated.
+ * \param[in]  bMass If true, force on COM is calculated.
  * \param[out] fout  \p block->nr forces on the COM/COG positions.
- * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is TRUE.
+ * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is true.
  *
  * Calls either gmx_calc_com_block() or gmx_calc_cog_block() depending on the
  * value of \p bMass.
@@ -514,7 +514,7 @@ gmx_calc_comg_block(t_topology *top, rvec x[], t_block *block, atom_id index[],
  */
 int
 gmx_calc_comg_f_block(t_topology *top, rvec f[], t_block *block, atom_id index[],
-                      gmx_bool bMass, rvec fout[])
+                      bool bMass, rvec fout[])
 {
     if (bMass)
     {
@@ -528,12 +528,12 @@ gmx_calc_comg_f_block(t_topology *top, rvec f[], t_block *block, atom_id index[]
 
 /*!
  * \param[in]  top   Topology structure with masses
- *   (can be NULL if \p bMASS==FALSE).
+ *   (can be NULL if \p bMASS==false).
  * \param[in]  x     Position vectors of all atoms.
  * \param[in]  block Blocks for calculation.
- * \param[in]  bMass If TRUE, mass weighting is used.
+ * \param[in]  bMass If true, mass weighting is used.
  * \param[out] xout  \p block->nr COM/COG positions.
- * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is TRUE.
+ * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is true.
  *
  * Calls gmx_calc_comg_block(), converting the \p t_blocka structure into
  * a \p t_block and an index. Other parameters are passed unmodified.
@@ -547,7 +547,7 @@ gmx_calc_comg_f_block(t_topology *top, rvec f[], t_block *block, atom_id index[]
  */
 int
 gmx_calc_comg_blocka(t_topology *top, rvec x[], t_blocka *block,
-                     gmx_bool bMass, rvec xout[])
+                     bool bMass, rvec xout[])
 {
     /* TODO: It would probably be better to do this without the type cast */
     return gmx_calc_comg_block(top, x, (t_block *)block, block->a, bMass, xout);
@@ -555,12 +555,12 @@ gmx_calc_comg_blocka(t_topology *top, rvec x[], t_blocka *block,
 
 /*!
  * \param[in]  top   Topology structure with masses
- *   (can be NULL if \p bMASS==TRUE).
+ *   (can be NULL if \p bMASS==true).
  * \param[in]  f     Forces on all atoms.
  * \param[in]  block Blocks for calculation.
- * \param[in]  bMass If TRUE, force on COM is calculated.
+ * \param[in]  bMass If true, force on COM is calculated.
  * \param[out] fout  \p block->nr forces on the COM/COG positions.
- * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is FALSE.
+ * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is false.
  *
  * Calls gmx_calc_comg_f_block(), converting the \p t_blocka structure into
  * a \p t_block and an index. Other parameters are passed unmodified.
@@ -574,7 +574,7 @@ gmx_calc_comg_blocka(t_topology *top, rvec x[], t_blocka *block,
  */
 int
 gmx_calc_comg_f_blocka(t_topology *top, rvec f[], t_blocka *block,
-                       gmx_bool bMass, rvec fout[])
+                       bool bMass, rvec fout[])
 {
     /* TODO: It would probably be better to do this without the type cast */
     return gmx_calc_comg_f_block(top, f, (t_block *)block, block->a, bMass, fout);
index 52226e98afb5325639caccc2611b6e716583c9d4..844c1c2343a939c28522aaf991d7e1cd23b97806 100644 (file)
@@ -48,7 +48,7 @@
  *  - gmx_calc_com(): Calculates the center of mass (COM) of a given group
  *    of atoms.
  *  - gmx_calc_comg(): Calculates either the COM or COG, based on a
- *    gmx_boolean flag.
+ *    boolean flag.
  *
  * A second set of routines is provided for calculating the centers for groups
  * that wrap over periodic boundaries (gmx_calc_cog_pbc(), gmx_calc_com_pbc(),
 
 #include "../legacyheaders/typedefs.h"
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
 /** Calculate a single center of geometry. */
 int
 gmx_calc_cog(t_topology *top, rvec x[], int nrefat, atom_id index[], rvec xout);
@@ -89,11 +84,11 @@ gmx_calc_cog_f(t_topology *top, rvec f[], int nrefat, atom_id index[], rvec fout
 /** Calculate a single center of mass/geometry. */
 int
 gmx_calc_comg(t_topology *top, rvec x[], int nrefat, atom_id index[],
-              gmx_bool bMass, rvec xout);
+              bool bMass, rvec xout);
 /** Calculate force on a single center of mass/geometry. */
 int
 gmx_calc_comg_f(t_topology *top, rvec f[], int nrefat, atom_id index[],
-                gmx_bool bMass, rvec fout);
+                bool bMass, rvec fout);
 
 /** Calculate a single center of geometry iteratively, taking PBC into account. */
 int
@@ -106,7 +101,7 @@ gmx_calc_com_pbc(t_topology *top, rvec x[], t_pbc *pbc,
 /** Calculate a single center of mass/geometry iteratively with PBC. */
 int
 gmx_calc_comg_pbc(t_topology *top, rvec x[], t_pbc *pbc,
-                  int nrefat, atom_id index[], gmx_bool bMass, rvec xout);
+                  int nrefat, atom_id index[], bool bMass, rvec xout);
 
 /** Calculate centers of geometry for a blocked index. */
 int
@@ -123,22 +118,18 @@ gmx_calc_cog_f_block(t_topology *top, rvec f[], t_block *block,
 /** Calculate centers of mass/geometry for a blocked index. */
 int
 gmx_calc_comg_block(t_topology *top, rvec x[], t_block *block,
-                    atom_id index[], gmx_bool bMass, rvec xout[]);
+                    atom_id index[], bool bMass, rvec xout[]);
 /** Calculate forces on centers of mass/geometry for a blocked index. */
 int
 gmx_calc_comg_f_block(t_topology *top, rvec f[], t_block *block,
-                      atom_id index[], gmx_bool bMass, rvec fout[]);
+                      atom_id index[], bool bMass, rvec fout[]);
 /** Calculate centers of mass/geometry for a set of blocks; */
 int
 gmx_calc_comg_blocka(t_topology *top, rvec x[], t_blocka *block,
-                     gmx_bool bMass, rvec xout[]);
+                     bool bMass, rvec xout[]);
 /** Calculate forces on centers of mass/geometry for a set of blocks; */
 int
 gmx_calc_comg_f_blocka(t_topology *top, rvec x[], t_blocka *block,
-                       gmx_bool bMass, rvec xout[]);
-
-#ifdef __cplusplus
-}
-#endif
+                       bool bMass, rvec xout[]);
 
 #endif
index cd417df141e170aac6aba002d6cc8c63d64916ad..43e10c8726046e9ec8f08aa2735319698f334173 100644 (file)
@@ -81,7 +81,7 @@
  *     here.
  *  -# A second pass with simple reordering and initialization is done:
  *    -# Boolean expressions are combined such that one element can evaluate,
- *       e.g., "A and B and C". The subexpressions in gmx_boolean expression are
+ *       e.g., "A and B and C". The subexpressions in boolean expression are
  *       reordered such that static expressions come first without otherwise
  *       altering the relative order of the expressions.
  *    -# The \c t_selelem::evaluate field is set to the correct evaluation
  *     possible selections, and these are stored in the internal compiler
  *     data structure for each element.
  *     To be able to do this for all possible values of dynamical expressions,
- *     special care needs to be taken with gmx_boolean expressions because they
+ *     special care needs to be taken with boolean expressions because they
  *     are short-circuiting. This is done through the
  *     \c SEL_CDATA_EVALMAX flag, which makes dynamic child expressions
  *     of \c BOOL_OR expressions evaluate to empty groups, while subexpressions
  * information, but do not unnecessarily copy the values.
  *
  *
- * \subsection selcompiler_tree_gmx_bool Boolean elements
+ * \subsection selcompiler_tree_bool Boolean elements
  *
  * \ref SEL_BOOLEAN elements have been merged such that one element
  * may carry out evaluation of more than one operation of the same type.
@@ -307,8 +307,8 @@ enum
     /*! \brief
      * Whether the whole subexpression should be treated as static.
      *
-     * This flag is always FALSE if \ref SEL_DYNAMIC is set for the element,
-     * but it is also FALSE for static elements within common subexpressions.
+     * This flag is always false if \ref SEL_DYNAMIC is set for the element,
+     * but it is also false for static elements within common subexpressions.
      */
     SEL_CDATA_STATIC      =  2,
     /** Whether the subexpression will always be evaluated in the same group. */
@@ -451,21 +451,21 @@ _gmx_selelem_free_compiler_data(t_selelem *sel)
  *
  * \param     sel   Selection element to initialize
  * \param[in] isize Maximum evaluation group size.
- * \param[in] bChildEval TRUE if children have already been processed.
- * \returns   TRUE if the memory was allocated, FALSE if children need to
+ * \param[in] bChildEval true if children have already been processed.
+ * \returns   true if the memory was allocated, false if children need to
  *   be processed first.
  *
  * If called more than once, memory is (re)allocated to ensure that the
  * maximum of the \p isize values can be stored.
  */
-static gmx_bool
-alloc_selection_data(t_selelem *sel, int isize, gmx_bool bChildEval)
+static bool
+alloc_selection_data(t_selelem *sel, int isize, bool bChildEval)
 {
     int        nalloc;
 
     if (sel->mempool)
     {
-        return TRUE;
+        return true;
     }
     /* Find out the number of elements to allocate */
     if (sel->flags & SEL_SINGLEVAL)
@@ -482,7 +482,7 @@ alloc_selection_data(t_selelem *sel, int isize, gmx_bool bChildEval)
 
         if (!bChildEval)
         {
-            return FALSE;
+            return false;
         }
         child = (sel->type == SEL_SUBEXPRREF ? sel->child : sel);
         if (child->type == SEL_SUBEXPR)
@@ -516,7 +516,7 @@ alloc_selection_data(t_selelem *sel, int isize, gmx_bool bChildEval)
             gmx_ana_pos_reserve(sel->v.u.p, isize, 0);
         }
     }
-    return TRUE;
+    return true;
 }
 
 /*! \brief
@@ -831,15 +831,15 @@ extract_subexpressions(t_selelem *sel)
  ********************************************************************/
 
 /*! \brief
- * Removes redundant gmx_boolean selection elements.
+ * Removes redundant boolean selection elements.
  *
  * \param  sel Root of the selection subtree to optimize.
  *
- * This function merges similar gmx_boolean operations (e.g., (A or B) or C becomes
+ * This function merges similar boolean operations (e.g., (A or B) or C becomes
  * a single OR operation with three operands).
  */
 static void
-optimize_gmx_boolean_expressions(t_selelem *sel)
+optimize_boolean_expressions(t_selelem *sel)
 {
     t_selelem *child, *prev;
 
@@ -850,7 +850,7 @@ optimize_gmx_boolean_expressions(t_selelem *sel)
         child = sel->child;
         while (child)
         {
-            optimize_gmx_boolean_expressions(child);
+            optimize_boolean_expressions(child);
             /* Remove double negations */
             if (child->type == SEL_BOOLEAN && child->u.boolt == BOOL_NOT
                 && child->child->type == SEL_BOOLEAN && child->child->u.boolt == BOOL_NOT)
@@ -915,7 +915,7 @@ optimize_gmx_boolean_expressions(t_selelem *sel)
 }
 
 /*! \brief
- * Reorders children of gmx_boolean expressions such that static selections
+ * Reorders children of boolean expressions such that static selections
  * come first.
  *
  * \param  sel Root of the selection subtree to reorder.
@@ -924,7 +924,7 @@ optimize_gmx_boolean_expressions(t_selelem *sel)
  * The same is true for the dynamic expressions.
  */
 static void
-reorder_gmx_boolean_static_children(t_selelem *sel)
+reorder_boolean_static_children(t_selelem *sel)
 {
     t_selelem *child, *prev, *next;
 
@@ -934,12 +934,12 @@ reorder_gmx_boolean_static_children(t_selelem *sel)
         child = sel->child;
         while (child)
         {
-            reorder_gmx_boolean_static_children(child);
+            reorder_boolean_static_children(child);
             child = child->next;
         }
     }
 
-    /* Reorder gmx_boolean expressions such that static selections come first */
+    /* Reorder boolean expressions such that static selections come first */
     if (sel->type == SEL_BOOLEAN && (sel->flags & SEL_DYNAMIC))
     {
         t_selelem  start;
@@ -1305,7 +1305,7 @@ init_item_compilerdata(t_selelem *sel)
      * for the children of this element. */
     if (sel->type == SEL_BOOLEAN)
     {
-        gmx_bool  bEvalMax;
+        bool  bEvalMax;
 
         bEvalMax = (sel->u.boolt == BOOL_AND);
         child = sel->child;
@@ -1343,7 +1343,7 @@ init_item_compilerdata(t_selelem *sel)
  * for any element for which the evaluation group may depend on the trajectory
  * frame, the flag is cleared.
  *
- * reorder_gmx_boolean_static_children() should have been called.
+ * reorder_boolean_static_children() should have been called.
  */
 static void
 init_item_staticeval(t_selelem *sel)
@@ -1378,7 +1378,7 @@ init_item_staticeval(t_selelem *sel)
     }
     else /* bStaticEval is set */
     {
-        /* For gmx_boolean expressions, any expression after the first dynamic
+        /* For boolean expressions, any expression after the first dynamic
          * expression should not have bStaticEval. */
         if (sel->type == SEL_BOOLEAN)
         {
@@ -1543,15 +1543,15 @@ initialize_evalgrps(gmx_ana_selcollection_t *sc)
  * Marks a subtree completely dynamic or undoes such a change.
  *
  * \param     sel      Selection subtree to mark.
- * \param[in] bDynamic If TRUE, the \p bStatic flag of the whole
- *   selection subtree is cleared. If FALSE, the flag is restored to
+ * \param[in] bDynamic If true, the \p bStatic flag of the whole
+ *   selection subtree is cleared. If false, the flag is restored to
  *   using \ref SEL_DYNAMIC.
  *
  * Does not descend into parameters of methods unless the parameters
  * are evaluated for each atom.
  */
 static void
-mark_subexpr_dynamic(t_selelem *sel, gmx_bool bDynamic)
+mark_subexpr_dynamic(t_selelem *sel, bool bDynamic)
 {
     t_selelem *child;
 
@@ -1738,16 +1738,16 @@ static void
 init_method(t_selelem *sel, t_topology *top, int isize)
 {
     t_selelem *child;
-    gmx_bool       bAtomVal;
+    bool       bAtomVal;
 
     /* Find out whether there are any atom-valued parameters */
-    bAtomVal = FALSE;
+    bAtomVal = false;
     child = sel->child;
     while (child)
     {
         if (child->flags & SEL_ATOMVAL)
         {
-            bAtomVal = TRUE;
+            bAtomVal = true;
         }
         child = child->next;
     }
@@ -1768,12 +1768,12 @@ init_method(t_selelem *sel, t_topology *top, int isize)
             sel->u.expr.method->outinit(top, &sel->v, sel->u.expr.mdata);
             if (sel->v.type != POS_VALUE && sel->v.type != GROUP_VALUE)
             {
-                alloc_selection_data(sel, isize, TRUE);
+                alloc_selection_data(sel, isize, true);
             }
         }
         else
         {
-            alloc_selection_data(sel, isize, TRUE);
+            alloc_selection_data(sel, isize, true);
             if ((sel->flags & SEL_DYNAMIC)
                 && sel->v.type != GROUP_VALUE && sel->v.type != POS_VALUE)
             {
@@ -1813,7 +1813,7 @@ init_method(t_selelem *sel, t_topology *top, int isize)
 }
 
 /*! \brief
- * Evaluates the static part of a gmx_boolean expression.
+ * Evaluates the static part of a boolean expression.
  *
  * \param[in]     data Evaluation data.
  * \param[in,out] sel Boolean selection element whose children should be
@@ -1824,7 +1824,7 @@ init_method(t_selelem *sel, t_topology *top, int isize)
  * reorder_item_static_children() should have been called.
  */
 static void
-evaluate_gmx_boolean_static_part(gmx_sel_evaluate_t *data, t_selelem *sel,
+evaluate_boolean_static_part(gmx_sel_evaluate_t *data, t_selelem *sel,
                              gmx_ana_index_t *g)
 {
     t_selelem *child, *next;
@@ -1854,7 +1854,7 @@ evaluate_gmx_boolean_static_part(gmx_sel_evaluate_t *data, t_selelem *sel,
         _gmx_selelem_set_vtype(child, GROUP_VALUE);
         child->evaluate   = NULL;
         _gmx_selvalue_reserve(&child->v, 1);
-        gmx_ana_index_copy(child->v.u.g, sel->v.u.g, TRUE);
+        gmx_ana_index_copy(child->v.u.g, sel->v.u.g, true);
         init_item_compilerdata(child);
         init_item_minmax_groups(child);
         child->cdata->flags &= ~SEL_CDATA_STATICEVAL;
@@ -1891,19 +1891,19 @@ evaluate_gmx_boolean_static_part(gmx_sel_evaluate_t *data, t_selelem *sel,
         if (child->u.cgrp.nalloc_index > 0)
         {
             char *name = child->u.cgrp.name;
-            gmx_ana_index_copy(&child->u.cgrp, child->v.u.g, FALSE);
+            gmx_ana_index_copy(&child->u.cgrp, child->v.u.g, false);
             gmx_ana_index_squeeze(&child->u.cgrp);
             child->u.cgrp.name = name;
         }
         else
         {
-            gmx_ana_index_copy(&child->u.cgrp, child->v.u.g, TRUE);
+            gmx_ana_index_copy(&child->u.cgrp, child->v.u.g, true);
         }
     }
 }
 
 /*! \brief
- * Evaluates the minimum and maximum groups for a gmx_boolean expression.
+ * Evaluates the minimum and maximum groups for a boolean expression.
  *
  * \param[in]  sel  \ref SEL_BOOLEAN element currently being evaluated.
  * \param[in]  g    Group for which \p sel has been evaluated.
@@ -1923,7 +1923,7 @@ evaluate_gmx_boolean_static_part(gmx_sel_evaluate_t *data, t_selelem *sel,
  * problem.
  */
 static void
-evaluate_gmx_boolean_minmax_grps(t_selelem *sel, gmx_ana_index_t *g,
+evaluate_boolean_minmax_grps(t_selelem *sel, gmx_ana_index_t *g,
                              gmx_ana_index_t *gmin, gmx_ana_index_t *gmax)
 {
     t_selelem *child;
@@ -1938,8 +1938,8 @@ evaluate_gmx_boolean_minmax_grps(t_selelem *sel, gmx_ana_index_t *g,
             break;
 
         case BOOL_AND:
-            gmx_ana_index_copy(gmin, sel->child->cdata->gmin, TRUE);
-            gmx_ana_index_copy(gmax, sel->child->cdata->gmax, TRUE);
+            gmx_ana_index_copy(gmin, sel->child->cdata->gmin, true);
+            gmx_ana_index_copy(gmax, sel->child->cdata->gmax, true);
             child = sel->child->next;
             while (child && gmax->isize > 0)
             {
@@ -1951,11 +1951,11 @@ evaluate_gmx_boolean_minmax_grps(t_selelem *sel, gmx_ana_index_t *g,
             if ((sel->child->cdata->flags & SEL_CDATA_STATIC)
                 && sel->child->v.u.g->isize > gmax->isize)
             {
-                gmx_ana_index_copy(sel->child->v.u.g, gmax, FALSE);
+                gmx_ana_index_copy(sel->child->v.u.g, gmax, false);
                 gmx_ana_index_squeeze(sel->child->v.u.g);
                 if (sel->child->u.cgrp.isize > 0)
                 {
-                    gmx_ana_index_copy(&sel->child->u.cgrp, gmax, FALSE);
+                    gmx_ana_index_copy(&sel->child->u.cgrp, gmax, false);
                     gmx_ana_index_squeeze(&sel->child->u.cgrp);
                 }
             }
@@ -1966,8 +1966,8 @@ evaluate_gmx_boolean_minmax_grps(t_selelem *sel, gmx_ana_index_t *g,
              * because of the way _gmx_sel_evaluate_or() works. */
             gmx_ana_index_reserve(gmin, g->isize);
             gmx_ana_index_reserve(gmax, g->isize);
-            gmx_ana_index_copy(gmin, sel->child->cdata->gmin, FALSE);
-            gmx_ana_index_copy(gmax, sel->child->cdata->gmax, FALSE);
+            gmx_ana_index_copy(gmin, sel->child->cdata->gmin, false);
+            gmx_ana_index_copy(gmax, sel->child->cdata->gmax, false);
             child = sel->child->next;
             while (child && gmin->isize < g->isize)
             {
@@ -1981,11 +1981,11 @@ evaluate_gmx_boolean_minmax_grps(t_selelem *sel, gmx_ana_index_t *g,
                 && sel->child->v.u.g->isize < gmin->isize)
             {
                 gmx_ana_index_reserve(sel->child->v.u.g, gmin->isize);
-                gmx_ana_index_copy(sel->child->v.u.g, gmin, FALSE);
+                gmx_ana_index_copy(sel->child->v.u.g, gmin, false);
                 if (sel->child->u.cgrp.isize > 0)
                 {
                     gmx_ana_index_reserve(&sel->child->u.cgrp, gmin->isize);
-                    gmx_ana_index_copy(&sel->child->u.cgrp, gmin, FALSE);
+                    gmx_ana_index_copy(&sel->child->u.cgrp, gmin, false);
                 }
             }
             break;
@@ -2019,11 +2019,11 @@ static void
 analyze_static(gmx_sel_evaluate_t *data, t_selelem *sel, gmx_ana_index_t *g)
 {
     t_selelem       *child, *next;
-    gmx_bool             bDoMinMax;
+    bool             bDoMinMax;
 
     if (sel->type != SEL_ROOT && g)
     {
-        alloc_selection_data(sel, g->isize, FALSE);
+        alloc_selection_data(sel, g->isize, false);
     }
 
     bDoMinMax = (sel->cdata->flags & SEL_CDATA_DOMINMAX);
@@ -2063,7 +2063,7 @@ analyze_static(gmx_sel_evaluate_t *data, t_selelem *sel, gmx_ana_index_t *g)
                 }
                 if (bDoMinMax)
                 {
-                    gmx_ana_index_copy(sel->cdata->gmax, g, TRUE);
+                    gmx_ana_index_copy(sel->cdata->gmax, g, true);
                 }
             }
             break;
@@ -2080,11 +2080,11 @@ analyze_static(gmx_sel_evaluate_t *data, t_selelem *sel, gmx_ana_index_t *g)
             else
             {
                 /* Evalute the static part if there is more than one expression */
-                evaluate_gmx_boolean_static_part(data, sel, g);
+                evaluate_boolean_static_part(data, sel, g);
 
                 /* Evaluate the selection.
-                 * If the type is gmx_boolean, we must explicitly handle the
-                 * static part evaluated in evaluate_gmx_boolean_static_part()
+                 * If the type is boolean, we must explicitly handle the
+                 * static part evaluated in evaluate_boolean_static_part()
                  * here because g may be larger. */
                 if (sel->u.boolt == BOOL_AND && sel->child->type == SEL_CONST)
                 {
@@ -2096,7 +2096,7 @@ analyze_static(gmx_sel_evaluate_t *data, t_selelem *sel, gmx_ana_index_t *g)
                 }
 
                 /* Evaluate minimal and maximal selections */
-                evaluate_gmx_boolean_minmax_grps(sel, g, sel->cdata->gmin,
+                evaluate_boolean_minmax_grps(sel, g, sel->cdata->gmin,
                                              sel->cdata->gmax);
             }
             break;
@@ -2112,7 +2112,7 @@ analyze_static(gmx_sel_evaluate_t *data, t_selelem *sel, gmx_ana_index_t *g)
             }
             else if (bDoMinMax)
             {
-                gmx_ana_index_copy(sel->cdata->gmax, g, TRUE);
+                gmx_ana_index_copy(sel->cdata->gmax, g, true);
             }
             break;
 
@@ -2132,8 +2132,8 @@ analyze_static(gmx_sel_evaluate_t *data, t_selelem *sel, gmx_ana_index_t *g)
                 sel->cdata->evaluate(data, sel, g);
                 if (bDoMinMax)
                 {
-                    gmx_ana_index_copy(sel->cdata->gmin, sel->child->cdata->gmin, TRUE);
-                    gmx_ana_index_copy(sel->cdata->gmax, sel->child->cdata->gmax, TRUE);
+                    gmx_ana_index_copy(sel->cdata->gmin, sel->child->cdata->gmin, true);
+                    gmx_ana_index_copy(sel->cdata->gmax, sel->child->cdata->gmax, true);
                 }
             }
             else
@@ -2143,7 +2143,7 @@ analyze_static(gmx_sel_evaluate_t *data, t_selelem *sel, gmx_ana_index_t *g)
                 {
                     isize += sel->u.cgrp.isize;
                     gmx_ana_index_reserve(&sel->u.cgrp, isize);
-                    alloc_selection_data(sel, isize, FALSE);
+                    alloc_selection_data(sel, isize, false);
                 }
                 sel->cdata->evaluate(data, sel, g);
                 if (isize > 0 && bDoMinMax)
@@ -2168,7 +2168,7 @@ analyze_static(gmx_sel_evaluate_t *data, t_selelem *sel, gmx_ana_index_t *g)
                 /* The subexpression should have been evaluated if g is NULL
                  * (i.e., this is a method parameter or a direct value of a
                  * selection). */
-                alloc_selection_data(sel, sel->child->cdata->gmax->isize, TRUE);
+                alloc_selection_data(sel, sel->child->cdata->gmax->isize, true);
             }
             sel->cdata->evaluate(data, sel, g);
             if ((sel->cdata->flags & SEL_CDATA_SIMPLESUBEXPR)
@@ -2189,8 +2189,8 @@ analyze_static(gmx_sel_evaluate_t *data, t_selelem *sel, gmx_ana_index_t *g)
             {
                 if ((sel->cdata->flags & SEL_CDATA_SIMPLESUBEXPR) || !g)
                 {
-                    gmx_ana_index_copy(sel->cdata->gmin, sel->child->cdata->gmin, TRUE);
-                    gmx_ana_index_copy(sel->cdata->gmax, sel->child->cdata->gmax, TRUE);
+                    gmx_ana_index_copy(sel->cdata->gmin, sel->child->cdata->gmin, true);
+                    gmx_ana_index_copy(sel->cdata->gmax, sel->child->cdata->gmax, true);
                 }
                 else
                 {
@@ -2222,7 +2222,7 @@ analyze_static(gmx_sel_evaluate_t *data, t_selelem *sel, gmx_ana_index_t *g)
     }
 
     /* Replace the result of the evaluation */
-    /* This is not necessary for subexpressions or for gmx_boolean negations
+    /* This is not necessary for subexpressions or for boolean negations
      * because the evaluation function already has done it properly. */
     if (sel->v.type == GROUP_VALUE && (sel->flags & SEL_DYNAMIC)
         && sel->type != SEL_SUBEXPR
@@ -2230,11 +2230,11 @@ analyze_static(gmx_sel_evaluate_t *data, t_selelem *sel, gmx_ana_index_t *g)
     {
         if (sel->cdata->flags & SEL_CDATA_EVALMAX)
         {
-            gmx_ana_index_copy(sel->v.u.g, sel->cdata->gmax, FALSE);
+            gmx_ana_index_copy(sel->v.u.g, sel->cdata->gmax, false);
         }
         else
         {
-            gmx_ana_index_copy(sel->v.u.g, sel->cdata->gmin, FALSE);
+            gmx_ana_index_copy(sel->v.u.g, sel->cdata->gmin, false);
         }
     }
 }
@@ -2294,7 +2294,7 @@ init_root_item(t_selelem *root, gmx_ana_index_t *gall)
         }
         else
         {
-            gmx_ana_index_copy(&root->u.cgrp, expr->cdata->gmax, TRUE);
+            gmx_ana_index_copy(&root->u.cgrp, expr->cdata->gmax, true);
         }
         /* For selections, store the maximum group for
          * gmx_ana_selcollection_evaluate_fin() as the value of the root
@@ -2322,7 +2322,7 @@ init_root_item(t_selelem *root, gmx_ana_index_t *gall)
                 _gmx_selelem_set_vtype(root, GROUP_VALUE);
                 root->flags  |= (SEL_ALLOCVAL | SEL_ALLOCDATA);
                 _gmx_selvalue_reserve(&root->v, 1);
-                gmx_ana_index_copy(root->v.u.g, expr->v.u.p->g, TRUE);
+                gmx_ana_index_copy(root->v.u.g, expr->v.u.p->g, true);
             }
         }
     }
@@ -2641,9 +2641,9 @@ gmx_ana_selcollection_compile(gmx::SelectionCollection *coll)
     item = sc->root;
     while (item)
     {
-        /* Process gmx_boolean and arithmetic expressions. */
-        optimize_gmx_boolean_expressions(item);
-        reorder_gmx_boolean_static_children(item);
+        /* Process boolean and arithmetic expressions. */
+        optimize_boolean_expressions(item);
+        reorder_boolean_static_children(item);
         optimize_arithmetic_expressions(item);
         /* Initialize evaluation */
         init_item_evalfunc(item);
@@ -2686,7 +2686,7 @@ gmx_ana_selcollection_compile(gmx::SelectionCollection *coll)
     {
         if (item->child->cdata->flags & SEL_CDATA_COMMONSUBEXPR)
         {
-            mark_subexpr_dynamic(item->child, TRUE);
+            mark_subexpr_dynamic(item->child, true);
         }
         set_evaluation_function(item, &analyze_static);
         item->evaluate(&evaldata, item, NULL);
@@ -2711,7 +2711,7 @@ gmx_ana_selcollection_compile(gmx::SelectionCollection *coll)
         {
             bool bMinMax = item->child->cdata->flags & SEL_CDATA_DOMINMAX;
 
-            mark_subexpr_dynamic(item->child, FALSE);
+            mark_subexpr_dynamic(item->child, false);
             item->child->u.cgrp.isize = 0;
             /* We won't clear item->child->v.u.g here, because it may
              * be static, and hence actually point to item->child->cdata->gmax,
index a74b916667e13dbf0454b9626b93b36bca58a573..8c7bdac77080e53092ff1b03a937c956f9a24b50 100644 (file)
@@ -342,7 +342,7 @@ gmx_ana_selcollection_evaluate_fin(gmx_ana_selcollection_t *sc, int nframes)
         t_selelem *elem = sel->selelem;
         if (sel->bDynamic)
         {
-            gmx_ana_index_copy(sel->g, elem->v.u.g, FALSE);
+            gmx_ana_index_copy(sel->g, elem->v.u.g, false);
             sel->g->name = NULL;
             gmx_ana_indexmap_update(&sel->p.m, sel->g, bMaskOnly);
             sel->p.nr = sel->p.m.nr;
@@ -515,7 +515,7 @@ _gmx_sel_evaluate_subexpr(gmx_sel_evaluate_t *data, t_selelem *sel, gmx_ana_inde
         /* We need to keep the name for the cgrp across the copy to avoid
          * problems if g has a name set. */
         char *name = sel->u.cgrp.name;
-        gmx_ana_index_copy(&sel->u.cgrp, g, FALSE);
+        gmx_ana_index_copy(&sel->u.cgrp, g, false);
         sel->u.cgrp.name = name;
         gmiss.isize = 0;
     }
@@ -729,13 +729,13 @@ _gmx_sel_evaluate_subexprref(gmx_sel_evaluate_t *data, t_selelem *sel, gmx_ana_i
             /* Currently, there is no need to do anything fancy here,
              * but some future extensions may need a more flexible
              * implementation. */
-            gmx_ana_pos_copy(sel->v.u.p, expr->v.u.p, FALSE);
+            gmx_ana_pos_copy(sel->v.u.p, expr->v.u.p, false);
             break;
 
         case GROUP_VALUE:
             if (!g)
             {
-                gmx_ana_index_copy(sel->v.u.g, expr->v.u.g, FALSE);
+                gmx_ana_index_copy(sel->v.u.g, expr->v.u.g, false);
             }
             else
             {
@@ -939,7 +939,7 @@ _gmx_sel_evaluate_and(gmx_sel_evaluate_t *data, t_selelem *sel, gmx_ana_index_t
     {
         MempoolSelelemReserver reserver(child, g->isize);
         child->evaluate(data, child, g);
-        gmx_ana_index_copy(sel->v.u.g, child->v.u.g, FALSE);
+        gmx_ana_index_copy(sel->v.u.g, child->v.u.g, false);
     }
     child = child->next;
     while (child && sel->v.u.g->isize > 0)
index 02f284804f40b5ec052d5f65e7b8e5aa2f9f321d..dd843eb276c0c04bb13a4d76a72b517bdbf4beb0 100644 (file)
@@ -80,12 +80,12 @@ gmx_ana_indexgrps_alloc(gmx_ana_indexgrps_t **g, int ngrps)
  * \param[in]  isize Array of index group sizes.
  * \param[in]  index Array of pointers to indices of each group.
  * \param[in]  name  Array of names of the groups.
- * \param[in]  bFree If TRUE, the \p isize, \p index and \p name arrays
+ * \param[in]  bFree If true, the \p isize, \p index and \p name arrays
  *   are freed after they have been copied.
  */
 void
 gmx_ana_indexgrps_set(gmx_ana_indexgrps_t **g, int ngrps, int *isize,
-                      atom_id **index, char **name, gmx_bool bFree)
+                      atom_id **index, char **name, bool bFree)
 {
     int  i;
 
@@ -192,7 +192,7 @@ gmx_ana_indexgrps_get(gmx_ana_indexgrps_t **g, t_topology *top,
     {
         get_index(&(top->atoms), fnm, ngrps, isize, index, name);
     }
-    gmx_ana_indexgrps_set(g, ngrps, isize, index, name, TRUE);
+    gmx_ana_indexgrps_set(g, ngrps, isize, index, name, true);
 }
 
 /*!
@@ -249,15 +249,15 @@ gmx_ana_indexgrps_clone(gmx_ana_indexgrps_t **dest, gmx_ana_indexgrps_t *src)
     gmx_ana_indexgrps_alloc(dest, src->nr);
     for (g = 0; g < src->nr; ++g)
     {
-        gmx_ana_index_copy(&(*dest)->g[g], &src->g[g], TRUE);
+        gmx_ana_index_copy(&(*dest)->g[g], &src->g[g], true);
     }
 }
 
 /*!
  * \param[out] g     Index group structure.
- * \returns    TRUE if \p g is empty, i.e., has 0 index groups.
+ * \returns    true if \p g is empty, i.e., has 0 index groups.
  */
-gmx_bool
+bool
 gmx_ana_indexgrps_is_empty(gmx_ana_indexgrps_t *g)
 {
     return g->nr == 0;
@@ -284,31 +284,31 @@ gmx_ana_indexgrps_get_grp(gmx_ana_indexgrps_t *g, int n)
  * \param[out] dest Output structure.
  * \param[in]  src  Input index groups.
  * \param[in]  n    Number of the group to extract.
- * \returns TRUE if \p n is a valid group in \p src, FALSE otherwise.
+ * \returns true if \p n is a valid group in \p src, false otherwise.
  */
-gmx_bool
+bool
 gmx_ana_indexgrps_extract(gmx_ana_index_t *dest, gmx_ana_indexgrps_t *src, int n)
 {
     if (n < 0 || n >= src->nr)
     {
         dest->isize = 0;
-        return FALSE;
+        return false;
     }
 
-    gmx_ana_index_copy(dest, &src->g[n], TRUE);
-    return TRUE;
+    gmx_ana_index_copy(dest, &src->g[n], true);
+    return true;
 }
 
 /*!
  * \param[out] dest Output structure.
  * \param[in]  src  Input index groups.
  * \param[in]  name Name (or part of the name) of the group to extract.
- * \returns TRUE if \p name is a valid group in \p src, FALSE otherwise.
+ * \returns true if \p name is a valid group in \p src, false otherwise.
  *
  * Uses the Gromacs routine find_group() to find the actual group;
  * the comparison is case-insensitive.
  */
-gmx_bool
+bool
 gmx_ana_indexgrps_find(gmx_ana_index_t *dest, gmx_ana_indexgrps_t *src, char *name)
 {
     int    i;
@@ -324,7 +324,7 @@ gmx_ana_indexgrps_find(gmx_ana_index_t *dest, gmx_ana_indexgrps_t *src, char *na
     if (i == NOTSET)
     {
         dest->isize = 0;
-        return FALSE;
+        return false;
     }
 
     return gmx_ana_indexgrps_extract(dest, src, i);
@@ -452,13 +452,13 @@ gmx_ana_index_deinit(gmx_ana_index_t *g)
 /*!
  * \param[out] dest   Destination index group.
  * \param[in]  src    Source index group.
- * \param[in]  bAlloc If TRUE, memory is allocated at \p dest; otherwise,
+ * \param[in]  bAlloc If true, memory is allocated at \p dest; otherwise,
  *   it is assumed that enough memory has been allocated for index.
  *
- * A deep copy of the name is only made if \p bAlloc is TRUE.
+ * A deep copy of the name is only made if \p bAlloc is true.
  */
 void
-gmx_ana_index_copy(gmx_ana_index_t *dest, gmx_ana_index_t *src, gmx_bool bAlloc)
+gmx_ana_index_copy(gmx_ana_index_t *dest, gmx_ana_index_t *src, bool bAlloc)
 {
     dest->isize = src->isize;
     if (dest->isize > 0)
@@ -551,10 +551,10 @@ gmx_ana_index_check(gmx_ana_index_t *g, int natoms)
 
 /*!
  * \param[in]  g      Index group to check.
- * \returns    TRUE if the index group is sorted and has no duplicates,
- *   FALSE otherwise.
+ * \returns    true if the index group is sorted and has no duplicates,
+ *   false otherwise.
  */
-gmx_bool
+bool
 gmx_ana_index_check_sorted(gmx_ana_index_t *g)
 {
     int  i;
@@ -563,10 +563,10 @@ gmx_ana_index_check_sorted(gmx_ana_index_t *g)
     {
         if (g->index[i+1] <= g->index[i])
         {
-            return FALSE;
+            return false;
         }
     }
-    return TRUE;
+    return true;
 }
 
 /********************************************************************
@@ -594,37 +594,37 @@ gmx_ana_index_sort(gmx_ana_index_t *g)
 /*!
  * \param[in]  a      Index group to check.
  * \param[in]  b      Index group to check.
- * \returns    TRUE if \p a and \p b are equal, FALSE otherwise.
+ * \returns    true if \p a and \p b are equal, false otherwise.
  */
-gmx_bool
+bool
 gmx_ana_index_equals(gmx_ana_index_t *a, gmx_ana_index_t *b)
 {
     int  i;
 
     if (a->isize != b->isize)
     {
-        return FALSE;
+        return false;
     }
     for (i = 0; i < a->isize; ++i)
     {
         if (a->index[i] != b->index[i])
         {
-            return FALSE;
+            return false;
         }
     }
-    return TRUE;
+    return true;
 }
 
 /*!
  * \param[in]  a      Index group to check against.
  * \param[in]  b      Index group to check.
- * \returns    TRUE if \p b is contained in \p a,
- *   FALSE otherwise.
+ * \returns    true if \p b is contained in \p a,
+ *   false otherwise.
  *
  * If the elements are not in the same order in both groups, the function
  * fails. However, the groups do not need to be sorted.
  */
-gmx_bool
+bool
 gmx_ana_index_contains(gmx_ana_index_t *a, gmx_ana_index_t *b)
 {
     int  i, j;
@@ -636,10 +636,10 @@ gmx_ana_index_contains(gmx_ana_index_t *a, gmx_ana_index_t *b)
         }
         if (i == a->isize)
         {
-            return FALSE;
+            return false;
         }
     }
-    return TRUE;
+    return true;
 }
 
 /*!
@@ -757,7 +757,7 @@ gmx_ana_index_partition(gmx_ana_index_t *dest1, gmx_ana_index_t *dest2,
     {
         dest2->index[k--] = src->index[j--];
     }
-    gmx_ana_index_copy(dest1, g, FALSE);
+    gmx_ana_index_copy(dest1, g, false);
 }
 
 /*!
@@ -843,7 +843,7 @@ gmx_ana_index_merge(gmx_ana_index_t *dest,
  *   (can be NULL if \p type is \ref INDEX_UNKNOWN).
  * \param[in]  type Type of partitioning to make.
  * \param[in]  bComplete
- *   If TRUE, the index group is expanded to include any residue/molecule
+ *   If true, the index group is expanded to include any residue/molecule
  *   (depending on \p type) that is partially contained in the group.
  *   If \p type is not INDEX_RES or INDEX_MOL, this has no effect.
  *
@@ -853,7 +853,7 @@ gmx_ana_index_merge(gmx_ana_index_t *dest,
  */
 void
 gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
-                         e_index_t type, gmx_bool bComplete)
+                         e_index_t type, bool bComplete)
 {
     int      i, j, ai;
     int      id, cur;
@@ -875,7 +875,7 @@ gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
      * off otherwise. */
     if (type != INDEX_RES && type != INDEX_MOL)
     {
-        bComplete = FALSE;
+        bComplete = false;
     }
     /* Allocate memory for the atom array and fill it unless we are using
      * completion. */
@@ -994,12 +994,12 @@ gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
 /*!
  * \param[in] g   Index group to check.
  * \param[in] b   Block data to check against.
- * \returns   TRUE if \p g consists of one or more complete blocks from \p b,
- *   FALSE otherwise.
+ * \returns   true if \p g consists of one or more complete blocks from \p b,
+ *   false otherwise.
  *
  * The atoms in \p g are assumed to be sorted.
  */
-gmx_bool
+bool
 gmx_ana_index_has_full_blocks(gmx_ana_index_t *g, t_block *b)
 {
     int  i, j, bi;
@@ -1016,31 +1016,31 @@ gmx_ana_index_has_full_blocks(gmx_ana_index_t *g, t_block *b)
         /* If not found, or if too large, return */
         if (bi == b->nr || i + b->index[bi+1] -  b->index[bi] > g->isize)
         {
-            return FALSE;
+            return false;
         }
         /* Check that the block matches the index */
         for (j = b->index[bi]; j < b->index[bi+1]; ++j, ++i)
         {
             if (g->index[i] != j)
             {
-                return FALSE;
+                return false;
             }
         }
         /* Move the search to the next block */
         ++bi;
     }
-    return TRUE;
+    return true;
 }
 
 /*!
  * \param[in] g   Index group to check.
  * \param[in] b   Block data to check against.
- * \returns   TRUE if \p g consists of one or more complete blocks from \p b,
- *   FALSE otherwise.
+ * \returns   true if \p g consists of one or more complete blocks from \p b,
+ *   false otherwise.
  *
  * The atoms in \p g and \p b->a are assumed to be in the same order.
  */
-gmx_bool
+bool
 gmx_ana_index_has_full_ablocks(gmx_ana_index_t *g, t_blocka *b)
 {
     int  i, j, bi;
@@ -1057,34 +1057,34 @@ gmx_ana_index_has_full_ablocks(gmx_ana_index_t *g, t_blocka *b)
         /* If not found, or if too large, return */
         if (bi == b->nr || i + b->index[bi+1] -  b->index[bi] > g->isize)
         {
-            return FALSE;
+            return false;
         }
         /* Check that the block matches the index */
         for (j = b->index[bi]; j < b->index[bi+1]; ++j, ++i)
         {
             if (b->a[j] != g->index[i])
             {
-                return FALSE;
+                return false;
             }
         }
         /* Move the search to the next block */
         ++bi;
     }
-    return TRUE;
+    return true;
 }
 
 /*!
  * \param[in] g     Index group to check.
  * \param[in] type  Block data to check against.
  * \param[in] top   Topology data.
- * \returns   TRUE if \p g consists of one or more complete elements of type
- *   \p type, FALSE otherwise.
+ * \returns   true if \p g consists of one or more complete elements of type
+ *   \p type, false otherwise.
  *
- * If \p type is \ref INDEX_ATOM, the return value is always TRUE.
+ * If \p type is \ref INDEX_ATOM, the return value is always true.
  * If \p type is \ref INDEX_UNKNOWN or \ref INDEX_ALL, the return value is
- * always FALSE.
+ * always false.
  */
-gmx_bool
+bool
 gmx_ana_index_has_complete_elems(gmx_ana_index_t *g, e_index_t type,
                                  t_topology *top)
 {
@@ -1092,10 +1092,10 @@ gmx_ana_index_has_complete_elems(gmx_ana_index_t *g, e_index_t type,
     {
         case INDEX_UNKNOWN:
         case INDEX_ALL:
-            return FALSE;
+            return false;
 
         case INDEX_ATOM:
-            return TRUE;
+            return true;
 
         case INDEX_RES:
         {
@@ -1111,12 +1111,12 @@ gmx_ana_index_has_complete_elems(gmx_ana_index_t *g, e_index_t type,
                 {
                     if (ai > 0 && top->atoms.atom[ai-1].resind == id)
                     {
-                        return FALSE;
+                        return false;
                     }
                     if (i > 0 && g->index[i-1] < top->atoms.nr - 1
                         && top->atoms.atom[g->index[i-1]+1].resind == prev)
                     {
-                        return FALSE;
+                        return false;
                     }
                 }
                 prev = id;
@@ -1124,7 +1124,7 @@ gmx_ana_index_has_complete_elems(gmx_ana_index_t *g, e_index_t type,
             if (g->index[i-1] < top->atoms.nr - 1
                 && top->atoms.atom[g->index[i-1]+1].resind == prev)
             {
-                return FALSE;
+                return false;
             }
             break;
         }
@@ -1132,7 +1132,7 @@ gmx_ana_index_has_complete_elems(gmx_ana_index_t *g, e_index_t type,
         case INDEX_MOL:
             return gmx_ana_index_has_full_blocks(g, &top->mols);
     }
-    return TRUE;
+    return true;
 }
 
 /*!
@@ -1157,8 +1157,8 @@ gmx_ana_indexmap_clear(gmx_ana_indexmap_t *m)
     m->b.a               = NULL;
     m->b.nalloc_index    = 0;
     m->b.nalloc_a        = 0;
-    m->bStatic           = TRUE;
-    m->bMapStatic        = TRUE;
+    m->bStatic           = true;
+    m->bMapStatic        = true;
 }
 
 /*!
@@ -1207,7 +1207,7 @@ gmx_ana_indexmap_init(gmx_ana_indexmap_t *m, gmx_ana_index_t *g,
     int      i, ii, mi;
 
     m->type   = type;
-    gmx_ana_index_make_block(&m->b, top, g, type, FALSE);
+    gmx_ana_index_make_block(&m->b, top, g, type, false);
     gmx_ana_indexmap_reserve(m, m->b.nr, m->b.nra);
     m->nr = m->b.nr;
     for (i = mi = 0; i < m->nr; ++i)
@@ -1241,8 +1241,8 @@ gmx_ana_indexmap_init(gmx_ana_indexmap_t *m, gmx_ana_index_t *g,
     }
     m->mapb.nr = m->nr;
     memcpy(m->mapb.index, m->b.index, (m->nr+1)*sizeof(*(m->mapb.index)));
-    m->bStatic    = TRUE;
-    m->bMapStatic = TRUE;
+    m->bStatic    = true;
+    m->bMapStatic = true;
 }
 
 /*!
@@ -1279,14 +1279,14 @@ gmx_ana_indexmap_set_static(gmx_ana_indexmap_t *m, t_blocka *b)
 /*!
  * \param[in,out] dest Destination data structure.
  * \param[in]     src  Source mapping.
- * \param[in]     bFirst If TRUE, memory is allocated for \p dest and a full
+ * \param[in]     bFirst If true, memory is allocated for \p dest and a full
  *   copy is made; otherwise, only variable parts are copied, and no memory
  *   is allocated.
  *
  * \p dest should have been initialized somehow (calloc() is enough).
  */
 void
-gmx_ana_indexmap_copy(gmx_ana_indexmap_t *dest, gmx_ana_indexmap_t *src, gmx_bool bFirst)
+gmx_ana_indexmap_copy(gmx_ana_indexmap_t *dest, gmx_ana_indexmap_t *src, bool bFirst)
 {
     if (bFirst)
     {
@@ -1310,7 +1310,7 @@ gmx_ana_indexmap_copy(gmx_ana_indexmap_t *dest, gmx_ana_indexmap_t *src, gmx_boo
 /*!
  * \param[in,out] m         Mapping structure.
  * \param[in]     g         Current index group.
- * \param[in]     bMaskOnly TRUE if the unused blocks should be masked with
+ * \param[in]     bMaskOnly true if the unused blocks should be masked with
  *   -1 instead of removing them.
  *
  * Updates the index group mapping with the new index group \p g.
@@ -1319,10 +1319,10 @@ gmx_ana_indexmap_copy(gmx_ana_indexmap_t *dest, gmx_ana_indexmap_t *src, gmx_boo
  */
 void
 gmx_ana_indexmap_update(gmx_ana_indexmap_t *m, gmx_ana_index_t *g,
-                        gmx_bool bMaskOnly)
+                        bool bMaskOnly)
 {
     int i, j, bi, bj;
-    gmx_bool bStatic;
+    bool bStatic;
 
     /* Process the simple cases first */
     if (m->type == INDEX_UNKNOWN && m->b.nra == 0)
@@ -1358,13 +1358,13 @@ gmx_ana_indexmap_update(gmx_ana_indexmap_t *m, gmx_ana_index_t *g,
             {
                 m->mapb.index[bj] = m->b.index[bj];
             }
-            m->bMapStatic = TRUE;
+            m->bMapStatic = true;
         }
     }
     /* Exit immediately if the group is static */
     if (bStatic)
     {
-        m->bStatic = TRUE;
+        m->bStatic = true;
         return;
     }
 
@@ -1421,10 +1421,10 @@ gmx_ana_indexmap_update(gmx_ana_indexmap_t *m, gmx_ana_index_t *g,
         /* Update the number of blocks */
         m->mapb.index[bi] = g->isize;
         m->nr             = bi;
-        m->bMapStatic     = FALSE;
+        m->bMapStatic     = false;
     }
     m->mapb.nr = m->nr;
-    m->bStatic = FALSE;
+    m->bStatic = false;
 }
 
 /*!
index b7b666835632eaff879f5cde49f5c912253875c5..031bfce6cdc74fdb4321aad85478fd88b2d51a5f 100644 (file)
 
 #include "../legacyheaders/typedefs.h"
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
 /** Stores a set of index groups. */
 typedef struct gmx_ana_indexgrps_t gmx_ana_indexgrps_t;
 
@@ -171,21 +166,21 @@ typedef struct gmx_ana_indexmap_t
      */
     t_blocka            b;
     /*! \brief
-     * TRUE if the current reference IDs are for the whole group (internal use only).
+     * true if the current reference IDs are for the whole group (internal use only).
      *
      * This is used internally to optimize the evaluation such that
      * gmx_ana_indexmap_update() does not take any time if the group is
      * actually static.
      */
-    gmx_bool                bStatic;
+    bool                bStatic;
     /*! \brief
-     * TRUE if the current mapping is for the whole group (internal use only).
+     * true if the current mapping is for the whole group (internal use only).
      *
      * This is used internally to optimize the evaluation such that
      * gmx_ana_indexmap_update() does not take any time if the group is
      * actually static.
      */
-    gmx_bool                bMapStatic;
+    bool                bMapStatic;
 } gmx_ana_indexmap_t;
 
 
@@ -198,7 +193,7 @@ gmx_ana_indexgrps_alloc(gmx_ana_indexgrps_t **g, int ngrps);
 /** Initializes index groups from arrays. */
 void
 gmx_ana_indexgrps_set(gmx_ana_indexgrps_t **g, int ngrps, int *isize,
-                      atom_id **index, char **name, gmx_bool bFree);
+                      atom_id **index, char **name, bool bFree);
 /** Reads index groups from a file or constructs them from topology. */
 void
 gmx_ana_indexgrps_init(gmx_ana_indexgrps_t **g, t_topology *top, 
@@ -217,18 +212,18 @@ gmx_ana_indexgrps_free(gmx_ana_indexgrps_t *g);
 /** Create a deep copy of \c gmx_ana_indexgrps_t. */
 void
 gmx_ana_indexgrps_clone(gmx_ana_indexgrps_t **dest, gmx_ana_indexgrps_t *src);
-/** Returns TRUE if the index group structure is emtpy. */
-gmx_bool
+/** Returns true if the index group structure is emtpy. */
+bool
 gmx_ana_indexgrps_is_empty(gmx_ana_indexgrps_t *g);
 
 /** Returns a pointer to an index group. */
 gmx_ana_index_t *
 gmx_ana_indexgrps_get_grp(gmx_ana_indexgrps_t *g, int n);
 /** Extracts a single index group. */
-gmx_bool
+bool
 gmx_ana_indexgrps_extract(gmx_ana_index_t *dest, gmx_ana_indexgrps_t *src, int n);
 /** Finds and extracts a single index group by name. */
-gmx_bool
+bool
 gmx_ana_indexgrps_find(gmx_ana_index_t *dest, gmx_ana_indexgrps_t *src, char *name);
 
 /** Writes out a list of index groups. */
@@ -260,7 +255,7 @@ void
 gmx_ana_index_deinit(gmx_ana_index_t *g);
 /** Copies a \c gmx_ana_index_t. */
 void
-gmx_ana_index_copy(gmx_ana_index_t *dest, gmx_ana_index_t *src, gmx_bool bAlloc);
+gmx_ana_index_copy(gmx_ana_index_t *dest, gmx_ana_index_t *src, bool bAlloc);
 
 /** Writes out the contents of a index group. */
 void
@@ -270,7 +265,7 @@ gmx_ana_index_dump(FILE *fp, gmx_ana_index_t *g, int i, int maxn);
 void
 gmx_ana_index_check(gmx_ana_index_t *g, int natoms);
 /** Checks whether an index group is sorted. */
-gmx_bool
+bool
 gmx_ana_index_check_sorted(gmx_ana_index_t *g);
 /*@}*/
 
@@ -281,10 +276,10 @@ gmx_ana_index_check_sorted(gmx_ana_index_t *g);
 void
 gmx_ana_index_sort(gmx_ana_index_t *g);
 /** Checks whether two index groups are equal. */
-gmx_bool
+bool
 gmx_ana_index_equals(gmx_ana_index_t *a, gmx_ana_index_t *b);
 /** Checks whether a sorted index group contains another sorted index group. */
-gmx_bool
+bool
 gmx_ana_index_contains(gmx_ana_index_t *a, gmx_ana_index_t *b);
 
 /** Calculates the intersection between two sorted index groups. */
@@ -318,15 +313,15 @@ gmx_ana_index_partition(gmx_ana_index_t *dest1, gmx_ana_index_t *dest2,
 /** Partition a group based on topology information. */
 void
 gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
-                         e_index_t type, gmx_bool bComplete);
+                         e_index_t type, bool bComplete);
 /** Checks whether a group consists of full blocks. */
-gmx_bool
+bool
 gmx_ana_index_has_full_blocks(gmx_ana_index_t *g, t_block *b);
 /** Checks whether a group consists of full blocks. */
-gmx_bool
+bool
 gmx_ana_index_has_full_ablocks(gmx_ana_index_t *g, t_blocka *b);
 /** Checks whether a group consists of full residues/molecules. */
-gmx_bool
+bool
 gmx_ana_index_has_complete_elems(gmx_ana_index_t *g, e_index_t type, t_topology *top);
 
 /** Initializes an empty index group mapping. */
@@ -347,14 +342,10 @@ void
 gmx_ana_indexmap_deinit(gmx_ana_indexmap_t *m);
 /** Makes a deep copy of an index group mapping. */
 void
-gmx_ana_indexmap_copy(gmx_ana_indexmap_t *dest, gmx_ana_indexmap_t *src, gmx_bool bFirst);
+gmx_ana_indexmap_copy(gmx_ana_indexmap_t *dest, gmx_ana_indexmap_t *src, bool bFirst);
 /** Updates an index group mapping. */
 void
-gmx_ana_indexmap_update(gmx_ana_indexmap_t *m, gmx_ana_index_t *g, gmx_bool bMaskOnly);
+gmx_ana_indexmap_update(gmx_ana_indexmap_t *m, gmx_ana_index_t *g, bool bMaskOnly);
 /*@}*/
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
index c8c36f685bf6a88d1ab323de1003273073e0e571..eafa51a536c1e4ccc1a1cb3caca9831d8828f32c 100644 (file)
@@ -107,13 +107,13 @@ struct gmx_ana_nbsearch_t
     int           *excl;
 
     /** Whether to try grid searching. */
-    gmx_bool           bTryGrid;
+    bool           bTryGrid;
     /** Whether grid searching is actually used for the current positions. */
-    gmx_bool           bGrid;
+    bool           bGrid;
     /** Array allocated for storing in-unit-cell reference positions. */
     rvec          *xref_alloc;
-    /** FALSE if the box is rectangular. */
-    gmx_bool           bTric;
+    /** false if the box is rectangular. */
+    bool           bTric;
     /** Box vectors of a single grid cell. */
     matrix         cellbox;
     /** The reciprocal cell vectors as columns; the inverse of \p cellbox. */
@@ -163,11 +163,11 @@ gmx_ana_nbsearch_create(real cutoff, int maxn)
     gmx_ana_nbsearch_t *d;
 
     snew(d, 1);
-    d->bTryGrid = TRUE;
+    d->bTryGrid = true;
     if (cutoff <= 0)
     {
         cutoff = GMX_REAL_MAX;
-        d->bTryGrid = FALSE;
+        d->bTryGrid = false;
     }
     d->cutoff = cutoff;
     d->cutoff2 = sqr(cutoff);
@@ -268,9 +268,9 @@ grid_init_cell_nblist(gmx_ana_nbsearch_t *d, t_pbc *pbc)
  *
  * \param[in,out] d    Grid information.
  * \param[in]     pbc  Information about the box.
- * \returns  FALSE if grid search is not suitable.
+ * \returns  false if grid search is not suitable.
  */
-static gmx_bool
+static bool
 grid_setup_cells(gmx_ana_nbsearch_t *d, t_pbc *pbc)
 {
     real targetsize;
@@ -291,7 +291,7 @@ grid_setup_cells(gmx_ana_nbsearch_t *d, t_pbc *pbc)
         d->ncells *= d->ncelldim[dd];
         if (d->ncelldim[dd] < 3)
         {
-            return FALSE;
+            return false;
         }
     }
     /* Reallocate if necessary */
@@ -309,7 +309,7 @@ grid_setup_cells(gmx_ana_nbsearch_t *d, t_pbc *pbc)
         }
         d->cells_nalloc = d->ncells;
     }
-    return TRUE;
+    return true;
 }
 
 /*! \brief
@@ -317,9 +317,9 @@ grid_setup_cells(gmx_ana_nbsearch_t *d, t_pbc *pbc)
  *
  * \param[in,out] d    Grid information.
  * \param[in]     pbc  Information about the box.
- * \returns  FALSE if grid search is not suitable.
+ * \returns  false if grid search is not suitable.
  */
-static gmx_bool
+static bool
 grid_set_box(gmx_ana_nbsearch_t *d, t_pbc *pbc)
 {
     int dd;
@@ -327,12 +327,12 @@ grid_set_box(gmx_ana_nbsearch_t *d, t_pbc *pbc)
     /* TODO: This check could be improved. */
     if (0.5*pbc->max_cutoff2 < d->cutoff2)
     {
-        return FALSE;
+        return false;
     }
 
     if (!grid_setup_cells(d, pbc))
     {
-        return FALSE;
+        return false;
     }
 
     d->bTric = TRICLINIC(pbc->box);
@@ -353,7 +353,7 @@ grid_set_box(gmx_ana_nbsearch_t *d, t_pbc *pbc)
         }
     }
     grid_init_cell_nblist(d, pbc);
-    return TRUE;
+    return true;
 }
 
 /*! \brief
@@ -455,7 +455,7 @@ gmx_ana_nbsearch_init(gmx_ana_nbsearch_t *d, t_pbc *pbc, int n, const rvec x[])
     d->nref = n;
     if (!pbc)
     {
-        d->bGrid = FALSE;
+        d->bGrid = false;
     }
     else if (d->bTryGrid)
     {
@@ -527,7 +527,7 @@ gmx_ana_nbsearch_set_excl(gmx_ana_nbsearch_t *d, int nexcl, int excl[])
 /*! \brief
  * Helper function to check whether a reference point should be excluded.
  */
-static gmx_bool
+static bool
 is_excluded(gmx_ana_nbsearch_t *d, int j)
 {
     if (d->exclind < d->nexcl)
@@ -541,7 +541,7 @@ is_excluded(gmx_ana_nbsearch_t *d, int j)
             if (d->exclind < d->nexcl && d->refid[j] == d->excl[d->exclind])
             {
                 ++d->exclind;
-                return TRUE;
+                return true;
             }
         }
         else
@@ -553,11 +553,11 @@ is_excluded(gmx_ana_nbsearch_t *d, int j)
             if (d->excl[d->exclind] == j)
             {
                 ++d->exclind;
-                return TRUE;
+                return true;
             }
         }
     }
-    return FALSE;
+    return false;
 }
 
 /*! \brief
@@ -584,9 +584,9 @@ grid_search_start(gmx_ana_nbsearch_t *d, const rvec x)
 /*! \brief
  * Does a grid search.
  */
-static gmx_bool
+static bool
 grid_search(gmx_ana_nbsearch_t *d,
-            gmx_bool (*action)(gmx_ana_nbsearch_t *d, int i, real r2))
+            bool (*action)(gmx_ana_nbsearch_t *d, int i, real r2))
 {
     int  i;
     rvec dx;
@@ -626,7 +626,7 @@ grid_search(gmx_ana_nbsearch_t *d,
                         d->prevnbi = nbi;
                         d->prevcai = cai;
                         d->previ   = i;
-                        return TRUE;
+                        return true;
                     }
                 }
             }
@@ -657,12 +657,12 @@ grid_search(gmx_ana_nbsearch_t *d,
                 if (action(d, i, r2))
                 {
                     d->previ = i;
-                    return TRUE;
+                    return true;
                 }
             }
         }
     }
-    return FALSE;
+    return false;
 }
 
 /*! \brief
@@ -670,29 +670,29 @@ grid_search(gmx_ana_nbsearch_t *d,
  *
  * Simply breaks the loop on the first found neighbor.
  */
-static gmx_bool
+static bool
 within_action(gmx_ana_nbsearch_t *d, int i, real r2)
 {
-    return TRUE;
+    return true;
 }
 
 /*! \brief
  * Helper function to use with grid_search() to find the minimum distance.
  */
-static gmx_bool
+static bool
 mindist_action(gmx_ana_nbsearch_t *d, int i, real r2)
 {
     d->cutoff2 = r2;
-    return FALSE;
+    return false;
 }
 
 /*!
  * \param[in] d   Neighborhood search data structure.
  * \param[in] x   Test position.
- * \returns   TRUE if \p x is within the cutoff of any reference position,
- *   FALSE otherwise.
+ * \returns   true if \p x is within the cutoff of any reference position,
+ *   false otherwise.
  */
-gmx_bool
+bool
 gmx_ana_nbsearch_is_within(gmx_ana_nbsearch_t *d, const rvec x)
 {
     grid_search_start(d, x);
@@ -703,10 +703,10 @@ gmx_ana_nbsearch_is_within(gmx_ana_nbsearch_t *d, const rvec x)
  * \param[in] d   Neighborhood search data structure.
  * \param[in] p   Test positions.
  * \param[in] i   Use the i'th position in \p p for testing.
- * \returns   TRUE if the test position is within the cutoff of any reference
- *   position, FALSE otherwise.
+ * \returns   true if the test position is within the cutoff of any reference
+ *   position, false otherwise.
  */
-gmx_bool
+bool
 gmx_ana_nbsearch_pos_is_within(gmx_ana_nbsearch_t *d, const gmx_ana_pos_t *p, int i)
 {
     return gmx_ana_nbsearch_is_within(d, p->x[i]);
@@ -747,9 +747,9 @@ gmx_ana_nbsearch_pos_mindist(gmx_ana_nbsearch_t *d, const gmx_ana_pos_t *p, int
  * \param[in]  d   Neighborhood search data structure.
  * \param[in]  x   Test positions.
  * \param[out] jp  Index of the reference position in the first pair.
- * \returns    TRUE if there are positions within the cutoff.
+ * \returns    true if there are positions within the cutoff.
  */
-gmx_bool
+bool
 gmx_ana_nbsearch_first_within(gmx_ana_nbsearch_t *d, const rvec x, int *jp)
 {
     grid_search_start(d, x);
@@ -761,9 +761,9 @@ gmx_ana_nbsearch_first_within(gmx_ana_nbsearch_t *d, const rvec x, int *jp)
  * \param[in]  p   Test positions.
  * \param[in]  i   Use the i'th position in \p p.
  * \param[out] jp  Index of the reference position in the first pair.
- * \returns    TRUE if there are positions within the cutoff.
+ * \returns    true if there are positions within the cutoff.
  */
-gmx_bool
+bool
 gmx_ana_nbsearch_pos_first_within(gmx_ana_nbsearch_t *d, const gmx_ana_pos_t *p,
                                   int i, int *jp)
 {
@@ -773,16 +773,16 @@ gmx_ana_nbsearch_pos_first_within(gmx_ana_nbsearch_t *d, const gmx_ana_pos_t *p,
 /*!
  * \param[in]  d   Neighborhood search data structure.
  * \param[out] jp  Index of the test position in the next pair.
- * \returns    TRUE if there are positions within the cutoff.
+ * \returns    true if there are positions within the cutoff.
  */
-gmx_bool
+bool
 gmx_ana_nbsearch_next_within(gmx_ana_nbsearch_t *d, int *jp)
 {
     if (grid_search(d, &within_action))
     {
         *jp = d->previ;
-        return TRUE;
+        return true;
     }
     *jp = -1;
-    return FALSE;
+    return false;
 }
index 0e671fce7e64a4eda1d0e0770e6f34ec549efd65..c483586cfa234a8d15f88d19c986abcb4c30c16a 100644 (file)
@@ -71,10 +71,10 @@ gmx_ana_nbsearch_pos_init(gmx_ana_nbsearch_t *d, t_pbc *pbc,
 void
 gmx_ana_nbsearch_set_excl(gmx_ana_nbsearch_t *d, int nexcl, int excl[]);
 /** Check whether a point is within a neighborhood. */
-gmx_bool
+bool
 gmx_ana_nbsearch_is_within(gmx_ana_nbsearch_t *d, const rvec x);
 /** Check whether a position is within a neighborhood. */
-gmx_bool
+bool
 gmx_ana_nbsearch_pos_is_within(gmx_ana_nbsearch_t *d,
                                const struct gmx_ana_pos_t *p, int i);
 /** Calculates the minimun distance from the reference points. */
@@ -85,14 +85,14 @@ real
 gmx_ana_nbsearch_pos_mindist(gmx_ana_nbsearch_t *d,
                              const struct gmx_ana_pos_t *p, int i);
 /** Finds the first reference position within the cutoff. */
-gmx_bool
+bool
 gmx_ana_nbsearch_first_within(gmx_ana_nbsearch_t *d, const rvec x, int *jp);
 /** Finds the first reference position within the cutoff. */
-gmx_bool
+bool
 gmx_ana_nbsearch_pos_first_within(gmx_ana_nbsearch_t *d,
                                   const struct gmx_ana_pos_t *p, int i, int *jp);
 /** Finds the next reference position within the cutoff. */
-gmx_bool
+bool
 gmx_ana_nbsearch_next_within(gmx_ana_nbsearch_t *d, int *jp);
 
 #endif
index 7adaa292b35c1dd94856cecd922f5c73ecf9d64c..7e86d53b6c4e9a25a740fd80104f825ba521ad8c 100644 (file)
@@ -95,7 +95,7 @@ gmx_ana_selparam_find(const char *name, int nparam, gmx_ana_selparam_t *param)
         {
             return &param[i];
         }
-        /* Check for 'no' prefix on gmx_boolean parameters */
+        /* Check for 'no' prefix on boolean parameters */
         if (param[i].val.type == NO_VALUE
             && strlen(name) > 2 && name[0] == 'n' && name[1] == 'o'
             && !strcmp(param[i].name, name+2))
@@ -296,9 +296,9 @@ cmp_real_range(const void *a, const void *b)
  * \param[in] values Pointer to the list of values.
  * \param     param  Parameter to parse.
  * \param[in] scanner Scanner data structure.
- * \returns   TRUE if the values were parsed successfully, FALSE otherwise.
+ * \returns   true if the values were parsed successfully, false otherwise.
  */
-static gmx_bool
+static bool
 parse_values_range(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
                    void *scanner)
 {
@@ -311,7 +311,7 @@ parse_values_range(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
     if (param->val.type != INT_VALUE && param->val.type != REAL_VALUE)
     {
         GMX_ERROR_NORET(gmx::eeInternalError, "Invalid range parameter type");
-        return FALSE;
+        return false;
     }
     idata = NULL;
     rdata = NULL;
@@ -330,12 +330,12 @@ parse_values_range(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
         if (value->bExpr)
         {
             _gmx_selparser_error(scanner, "expressions not supported within range parameters");
-            return FALSE;
+            return false;
         }
         if (value->type != param->val.type)
         {
             GMX_ERROR_NORET(gmx::eeInternalError, "Invalid range value type");
-            return FALSE;
+            return false;
         }
         if (param->val.type == INT_VALUE)
         {
@@ -446,7 +446,7 @@ parse_values_range(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
             _gmx_selparser_error(scanner, "the value should consist of exactly one range");
             sfree(idata);
             sfree(rdata);
-            return FALSE;
+            return false;
         }
         if (param->val.type == INT_VALUE)
         {
@@ -465,7 +465,7 @@ parse_values_range(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
     }
     param->nvalptr = NULL;
 
-    return TRUE;
+    return true;
 }
 
 /*! \brief
@@ -476,12 +476,12 @@ parse_values_range(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
  * \param     param  Parameter to parse.
  * \param     root   Selection element to which child expressions are added.
  * \param[in] scanner Scanner data structure.
- * \returns   TRUE if the values were parsed successfully, FALSE otherwise.
+ * \returns   true if the values were parsed successfully, false otherwise.
  *
  * For integer ranges, the sequence of numbers from the first to second value
  * is stored, each as a separate value.
  */
-static gmx_bool
+static bool
 parse_values_varnum(int nval, t_selexpr_value *values,
                     gmx_ana_selparam_t *param, t_selelem *root, void *scanner)
 {
@@ -509,7 +509,7 @@ parse_values_varnum(int nval, t_selexpr_value *values,
     {
         GMX_ERROR_NORET(gmx::eeInternalError,
                         "Variable-count value type not implemented");
-        return FALSE;
+        return false;
     }
 
     /* Reserve appropriate amount of memory */
@@ -531,12 +531,12 @@ parse_values_varnum(int nval, t_selexpr_value *values,
         if (value->bExpr)
         {
             _gmx_selparser_error(scanner, "expressions not supported within value lists");
-            return FALSE;
+            return false;
         }
         if (value->type != param->val.type)
         {
             GMX_ERROR_NORET(gmx::eeInternalError, "Invalid value type");
-            return FALSE;
+            return false;
         }
         switch (param->val.type)
         {
@@ -560,7 +560,7 @@ parse_values_varnum(int nval, t_selexpr_value *values,
                 if (value->u.r.r1 != value->u.r.r2)
                 {
                     _gmx_selparser_error(scanner, "real ranges not supported");
-                    return FALSE;
+                    return false;
                 }
                 param->val.u.r[i++] = value->u.r.r1;
                 break;
@@ -568,7 +568,7 @@ parse_values_varnum(int nval, t_selexpr_value *values,
             case POS_VALUE:  copy_rvec(value->u.x, param->val.u.p->x[i++]); break;
             default: /* Should not be reached */
                 GMX_ERROR_NORET(gmx::eeInternalError, "Invalid value type");
-                return FALSE;
+                return false;
         }
         value = value->next;
     }
@@ -599,7 +599,7 @@ parse_values_varnum(int nval, t_selexpr_value *values,
         place_child(root, child, param);
     }
 
-    return TRUE;
+    return true;
 }
 
 /*! \brief
@@ -686,9 +686,9 @@ on_error:
  * \param     param  Parameter to parse.
  * \param     root   Selection element to which child expressions are added.
  * \param[in] scanner Scanner data structure.
- * \returns   TRUE if the values were parsed successfully, FALSE otherwise.
+ * \returns   true if the values were parsed successfully, false otherwise.
  */
-static gmx_bool
+static bool
 parse_values_varnum_expr(int nval, t_selexpr_value *values,
                          gmx_ana_selparam_t *param, t_selelem *root,
                          void *scanner)
@@ -700,7 +700,7 @@ parse_values_varnum_expr(int nval, t_selexpr_value *values,
     if (nval != 1 || !values->bExpr)
     {
         GMX_ERROR_NORET(gmx::eeInternalError, "Invalid expression value");
-        return FALSE;
+        return false;
     }
 
     value = values;
@@ -708,7 +708,7 @@ parse_values_varnum_expr(int nval, t_selexpr_value *values,
     value->u.expr = NULL;
     if (!child)
     {
-        return FALSE;
+        return false;
     }
 
     /* Process single-valued expressions */
@@ -723,13 +723,13 @@ parse_values_varnum_expr(int nval, t_selexpr_value *values,
             *param->nvalptr = param->val.nr;
         }
         param->nvalptr = NULL;
-        return TRUE;
+        return true;
     }
 
     if (!(child->flags & SEL_VARNUMVAL))
     {
         _gmx_selparser_error(scanner, "invalid expression value");
-        return FALSE;
+        return false;
     }
 
     child->flags   |= SEL_ALLOCVAL;
@@ -738,7 +738,7 @@ parse_values_varnum_expr(int nval, t_selexpr_value *values,
     /* Rest of the initialization is done during compilation in
      * init_method(). */
 
-    return TRUE;
+    return true;
 }
 
 /*! \brief
@@ -754,14 +754,14 @@ parse_values_varnum_expr(int nval, t_selexpr_value *values,
  * as the value \p i of \p param.
  * This function is used internally by parse_values_std().
  */
-static gmx_bool
+static bool
 set_expr_value_store(t_selelem *sel, gmx_ana_selparam_t *param, int i,
                      void *scanner)
 {
     if (sel->v.type != GROUP_VALUE && !(sel->flags & SEL_SINGLEVAL))
     {
         _gmx_selparser_error(scanner, "invalid expression value");
-        return FALSE;
+        return false;
     }
     switch (sel->v.type)
     {
@@ -772,11 +772,11 @@ set_expr_value_store(t_selelem *sel, gmx_ana_selparam_t *param, int i,
         case GROUP_VALUE: sel->v.u.g = &param->val.u.g[i]; break;
         default: /* Error */
             GMX_ERROR_NORET(gmx::eeInternalError, "Invalid value type");
-            return FALSE;
+            return false;
     }
     sel->v.nr = 1;
     sel->v.nalloc = -1;
-    return TRUE;
+    return true;
 }
 
 /*! \brief
@@ -787,19 +787,19 @@ set_expr_value_store(t_selelem *sel, gmx_ana_selparam_t *param, int i,
  * \param     param  Parameter to parse.
  * \param     root   Selection element to which child expressions are added.
  * \param[in] scanner Scanner data structure.
- * \returns   TRUE if the values were parsed successfully, FALSE otherwise.
+ * \returns   true if the values were parsed successfully, false otherwise.
  *
  * For integer ranges, the sequence of numbers from the first to second value
  * is stored, each as a separate value.
  */
-static gmx_bool
+static bool
 parse_values_std(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
                  t_selelem *root, void *scanner)
 {
     t_selexpr_value   *value;
     t_selelem         *child;
     int                i, j;
-    gmx_bool               bDynamic;
+    bool               bDynamic;
 
     /* Handle atom-valued parameters */
     if (param->flags & SPAR_ATOMVAL)
@@ -807,7 +807,7 @@ parse_values_std(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
         if (nval > 1)
         {
             _gmx_selparser_error(scanner, "more than one value not supported");
-            return FALSE;
+            return false;
         }
         value = values;
         if (value->bExpr)
@@ -816,7 +816,7 @@ parse_values_std(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
             value->u.expr = NULL;
             if (!child)
             {
-                return FALSE;
+                return false;
             }
             child->flags |= SEL_ALLOCVAL;
             if (child->v.type != GROUP_VALUE && (child->flags & SEL_ATOMVAL))
@@ -829,7 +829,7 @@ parse_values_std(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
                 {
                     *param->nvalptr = -1;
                 }
-                return TRUE;
+                return true;
             }
             param->flags  &= ~SPAR_ATOMVAL;
             param->val.nr  = 1;
@@ -858,7 +858,7 @@ parse_values_std(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
 
     value = values;
     i = 0;
-    bDynamic = FALSE;
+    bDynamic = false;
     while (value && i < param->val.nr)
     {
         if (value->type != param->val.type)
@@ -875,15 +875,15 @@ parse_values_std(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
             /* Check that the expression is valid */
             if (!child)
             {
-                return FALSE;
+                return false;
             }
             if (!set_expr_value_store(child, param, i, scanner))
             {
-                return FALSE;
+                return false;
             }
             if (child->flags & SEL_DYNAMIC)
             {
-                bDynamic = TRUE;
+                bDynamic = true;
             }
         }
         else
@@ -920,7 +920,7 @@ parse_values_std(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
                     if (value->u.r.r1 != value->u.r.r2)
                     {
                         _gmx_selparser_error(scanner, "real ranges not supported");
-                        return FALSE;
+                        return false;
                     }
                     param->val.u.r[i] = value->u.r.r1;
                     break;
@@ -934,7 +934,7 @@ parse_values_std(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
                 case GROUP_VALUE:
                     GMX_ERROR_NORET(gmx::eeInternalError,
                                     "Invalid non-expression value");
-                    return FALSE;
+                    return false;
             }
         }
         ++i;
@@ -943,12 +943,12 @@ parse_values_std(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
     if (value != NULL)
     {
         _gmx_selparser_error(scanner, "extra values'");
-        return FALSE;
+        return false;
     }
     if (i < param->val.nr)
     {
         _gmx_selparser_error(scanner, "not enough values");
-        return FALSE;
+        return false;
     }
     if (!bDynamic)
     {
@@ -960,7 +960,7 @@ parse_values_std(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
     }
     param->nvalptr = NULL;
 
-    return TRUE;
+    return true;
 }
 
 /*! \brief
@@ -971,47 +971,47 @@ parse_values_std(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
  * \param[in] values Pointer to the list of values.
  * \param     param  Parameter to parse.
  * \param[in] scanner Scanner data structure.
- * \returns   TRUE if the values were parsed successfully, FALSE otherwise.
+ * \returns   true if the values were parsed successfully, false otherwise.
  */
-static gmx_bool
+static bool
 parse_values_bool(const char *name, int nval, t_selexpr_value *values,
                   gmx_ana_selparam_t *param, void *scanner)
 {
-    gmx_bool bSetNo;
+    bool bSetNo;
     int  len;
 
     if (param->val.type != NO_VALUE)
     {
         GMX_ERROR_NORET(gmx::eeInternalError, "Invalid boolean parameter");
-        return FALSE;
+        return false;
     }
     if (nval > 1 || (values && values->type != INT_VALUE))
     {
         _gmx_selparser_error(scanner, "parameter takes only a yes/no/on/off/0/1 value");
-        return FALSE;
+        return false;
     }
 
-    bSetNo = FALSE;
+    bSetNo = false;
     /* Check if the parameter name is given with a 'no' prefix */
     len = strlen(name);
     if (len > 2 && name[0] == 'n' && name[1] == 'o'
         && strncmp(name+2, param->name, len-2) == 0)
     {
-        bSetNo = TRUE;
+        bSetNo = true;
     }
     if (bSetNo && nval > 0)
     {
         _gmx_selparser_error(scanner, "parameter 'no%s' should not have a value",
                              param->name);
-        return FALSE;
+        return false;
     }
     if (values && values->u.i.i1 == 0)
     {
-        bSetNo = TRUE;
+        bSetNo = true;
     }
 
-    *param->val.u.b = bSetNo ? FALSE : TRUE;
-    return TRUE;
+    *param->val.u.b = bSetNo ? false : true;
+    return true;
 }
 
 /*! \brief
@@ -1021,9 +1021,9 @@ parse_values_bool(const char *name, int nval, t_selexpr_value *values,
  * \param[in] values Pointer to the list of values.
  * \param     param  Parameter to parse.
  * \param[in] scanner Scanner data structure.
- * \returns   TRUE if the values were parsed successfully, FALSE otherwise.
+ * \returns   true if the values were parsed successfully, false otherwise.
  */
-static gmx_bool
+static bool
 parse_values_enum(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
                   void *scanner)
 {
@@ -1032,17 +1032,17 @@ parse_values_enum(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
     if (nval != 1)
     {
         _gmx_selparser_error(scanner, "a single value is required");
-        return FALSE;
+        return false;
     }
     if (values->type != STR_VALUE || param->val.type != STR_VALUE)
     {
         GMX_ERROR_NORET(gmx::eeInternalError, "Invalid enum parameter");
-        return FALSE;
+        return false;
     }
     if (values->bExpr)
     {
         _gmx_selparser_error(scanner, "expression value for enumerated parameter not supported");
-        return FALSE;
+        return false;
     }
 
     len = strlen(values->u.s);
@@ -1056,7 +1056,7 @@ parse_values_enum(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
             if (match > 0)
             {
                 _gmx_selparser_error(scanner, "ambiguous value");
-                return FALSE;
+                return false;
             }
             match = i;
         }
@@ -1065,10 +1065,10 @@ parse_values_enum(int nval, t_selexpr_value *values, gmx_ana_selparam_t *param,
     if (match == 0)
     {
         _gmx_selparser_error(scanner, "invalid value");
-        return FALSE;
+        return false;
     }
     param->val.u.s[0] = param->val.u.s[match];
-    return TRUE;
+    return true;
 }
 
 /*! \brief
@@ -1088,7 +1088,7 @@ convert_const_values(t_selexpr_value *values)
             val->u.expr->type == SEL_CONST)
         {
             t_selelem *expr = val->u.expr;
-            val->bExpr = FALSE;
+            val->bExpr = false;
             switch (expr->v.type)
             {
                 case INT_VALUE:
@@ -1120,7 +1120,7 @@ convert_const_values(t_selexpr_value *values)
  * \param     params  Array of parameters to parse.
  * \param     root    Selection element to which child expressions are added.
  * \param[in] scanner Scanner data structure.
- * \returns   TRUE if the parameters were parsed successfully, FALSE otherwise.
+ * \returns   true if the parameters were parsed successfully, false otherwise.
  *
  * Initializes the \p params array based on the parameters in \p pparams.
  * See the documentation of \c gmx_ana_selparam_t for different options
@@ -1129,19 +1129,19 @@ convert_const_values(t_selexpr_value *values)
  * The list \p pparams and any associated values are freed after the parameters
  * have been processed, no matter is there was an error or not.
  */
-gmx_bool
+bool
 _gmx_sel_parse_params(t_selexpr_param *pparams, int nparam, gmx_ana_selparam_t *params,
                       t_selelem *root, void *scanner)
 {
     gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
     t_selexpr_param    *pparam;
     gmx_ana_selparam_t *oparam;
-    gmx_bool                bOk, rc;
+    bool                bOk, rc;
     int                 i;
 
     /* Check that the value pointers of SPAR_VARNUM parameters are NULL and
      * that they are not NULL for other parameters */
-    bOk = TRUE;
+    bOk = true;
     for (i = 0; i < nparam; ++i)
     {
         std::string contextStr = gmx::formatString("In parameter '%s'", params[i].name);
@@ -1159,7 +1159,7 @@ _gmx_sel_parse_params(t_selexpr_param *pparams, int nparam, gmx_ana_selparam_t *
             {
                 _gmx_selparser_error(scanner, "nvalptr is NULL but both "
                                      "SPAR_VARNUM and SPAR_DYNAMIC are specified");
-                bOk = FALSE;
+                bOk = false;
             }
         }
         else
@@ -1167,14 +1167,14 @@ _gmx_sel_parse_params(t_selexpr_param *pparams, int nparam, gmx_ana_selparam_t *
             if (params[i].val.u.ptr == NULL)
             {
                 _gmx_selparser_error(scanner, "value pointer is NULL");
-                bOk = FALSE;
+                bOk = false;
             }
         }
     }
     if (!bOk)
     {
         _gmx_selexpr_free_params(pparams);
-        return FALSE;
+        return false;
     }
     /* Parse the parameters */
     pparam = pparams;
@@ -1197,7 +1197,7 @@ _gmx_sel_parse_params(t_selexpr_param *pparams, int nparam, gmx_ana_selparam_t *
             {
                 oparam = NULL;
                 _gmx_selparser_error(scanner, "too many NULL parameters provided");
-                bOk = FALSE;
+                bOk = false;
                 pparam = pparam->next;
                 continue;
             }
@@ -1206,7 +1206,7 @@ _gmx_sel_parse_params(t_selexpr_param *pparams, int nparam, gmx_ana_selparam_t *
         else
         {
             _gmx_selparser_error(scanner, "all NULL parameters should appear in the beginning of the list");
-            bOk = FALSE;
+            bOk = false;
             pparam = pparam->next;
             continue;
         }
@@ -1214,13 +1214,13 @@ _gmx_sel_parse_params(t_selexpr_param *pparams, int nparam, gmx_ana_selparam_t *
         if (!oparam)
         {
             _gmx_selparser_error(scanner, "unknown parameter skipped");
-            bOk = FALSE;
+            bOk = false;
             goto next_param;
         }
         if (oparam->flags & SPAR_SET)
         {
             _gmx_selparser_error(scanner, "parameter set multiple times, extra values skipped");
-            bOk = FALSE;
+            bOk = false;
             goto next_param;
         }
         oparam->flags |= SPAR_SET;
@@ -1229,7 +1229,7 @@ _gmx_sel_parse_params(t_selexpr_param *pparams, int nparam, gmx_ana_selparam_t *
         if (convert_values(pparam->value, oparam->val.type, scanner) != 0)
         {
             _gmx_selparser_error(scanner, "invalid value");
-            bOk = FALSE;
+            bOk = false;
             goto next_param;
         }
         if (oparam->val.type == NO_VALUE)
@@ -1261,7 +1261,7 @@ _gmx_sel_parse_params(t_selexpr_param *pparams, int nparam, gmx_ana_selparam_t *
         }
         if (!rc)
         {
-            bOk = FALSE;
+            bOk = false;
         }
         /* Advance to the next parameter */
 next_param:
@@ -1273,7 +1273,7 @@ next_param:
         if (!(params[i].flags & SPAR_OPTIONAL) && !(params[i].flags & SPAR_SET))
         {
             _gmx_selparser_error(scanner, "required parameter '%s' not specified", params[i].name);
-            bOk = FALSE;
+            bOk = false;
         }
     }
 
index f2929a4cfa5956b251343e857ca43a92dd957a17..ffeb2a4c29ff9410f91cc87256414bee1e113687 100644 (file)
  *    from a variable, otherwise the child type is not \ref SEL_SUBEXPR.
  *
  *
- * \subsection selparser_tree_gmx_bool Boolean elements
+ * \subsection selparser_tree_bool Boolean elements
  *
- * One \ref SEL_BOOLEAN element is created for each gmx_boolean keyword in the
+ * One \ref SEL_BOOLEAN element is created for each boolean keyword in the
  * input, and the tree structure represents the evaluation order.
  * The \c t_selelem::boolt type gives the type of the operation.
  * Each element has exactly two children (one for \ref BOOL_NOT elements),
@@ -259,7 +259,7 @@ _gmx_selexpr_create_value(e_selvalue_t type)
     t_selexpr_value *value;
     snew(value, 1);
     value->type  = type;
-    value->bExpr = FALSE;
+    value->bExpr = false;
     value->next  = NULL;
     return value;
 }
@@ -274,7 +274,7 @@ _gmx_selexpr_create_value_expr(t_selelem *expr)
     t_selexpr_value *value;
     snew(value, 1);
     value->type   = expr->v.type;
-    value->bExpr  = TRUE;
+    value->bExpr  = true;
     value->u.expr = expr;
     value->next   = NULL;
     return value;
@@ -370,8 +370,8 @@ _gmx_selelem_update_flags(t_selelem *sel, yyscan_t scanner)
 {
     t_selelem          *child;
     int                 rc;
-    gmx_bool                bUseChildType=FALSE;
-    gmx_bool                bOnlySingleChildren;
+    bool                bUseChildType=false;
+    bool                bOnlySingleChildren;
 
     /* Return if the flags have already been set */
     if (sel->flags & SEL_FLAGSSET)
@@ -384,7 +384,7 @@ _gmx_selelem_update_flags(t_selelem *sel, yyscan_t scanner)
         case SEL_CONST:
         case SEL_GROUPREF:
             sel->flags |= SEL_SINGLEVAL;
-            bUseChildType = FALSE;
+            bUseChildType = false;
             break;
 
         case SEL_EXPRESSION:
@@ -404,12 +404,12 @@ _gmx_selelem_update_flags(t_selelem *sel, yyscan_t scanner)
             {
                 sel->flags |= SEL_ATOMVAL;
             }
-            bUseChildType = FALSE;
+            bUseChildType = false;
             break;
 
         case SEL_ARITHMETIC:
             sel->flags |= SEL_ATOMVAL;
-            bUseChildType = FALSE;
+            bUseChildType = false;
             break;
 
         case SEL_MODIFIER:
@@ -417,21 +417,21 @@ _gmx_selelem_update_flags(t_selelem *sel, yyscan_t scanner)
             {
                 sel->flags |= SEL_VARNUMVAL;
             }
-            bUseChildType = FALSE;
+            bUseChildType = false;
             break;
 
         case SEL_ROOT:
-            bUseChildType = FALSE;
+            bUseChildType = false;
             break;
 
         case SEL_BOOLEAN:
         case SEL_SUBEXPR:
         case SEL_SUBEXPRREF:
-            bUseChildType = TRUE;
+            bUseChildType = true;
             break;
     }
     /* Loop through children to propagate their flags upwards */
-    bOnlySingleChildren = TRUE;
+    bOnlySingleChildren = true;
     child = sel->child;
     while (child)
     {
@@ -456,7 +456,7 @@ _gmx_selelem_update_flags(t_selelem *sel, yyscan_t scanner)
         }
         if (!(child->flags & SEL_SINGLEVAL))
         {
-            bOnlySingleChildren = FALSE;
+            bOnlySingleChildren = false;
         }
 
         child = child->next;
@@ -1304,7 +1304,7 @@ _gmx_sel_append_selection(t_selelem *sel, t_selelem *last, yyscan_t scanner)
 
 /*!
  * \param[in] scanner Scanner data structure.
- * \returns   TRUE if the parser should finish, FALSE if parsing should
+ * \returns   true if the parser should finish, false if parsing should
  *   continue.
  *
  * This function is called always after _gmx_sel_append_selection() to
@@ -1312,7 +1312,7 @@ _gmx_sel_append_selection(t_selelem *sel, t_selelem *last, yyscan_t scanner)
  * This is used to terminate interactive parsers when the correct number of
  * selections has been provided.
  */
-gmx_bool
+bool
 _gmx_sel_parser_should_finish(yyscan_t scanner)
 {
     gmx_ana_selcollection_t *sc = _gmx_sel_lexer_selcollection(scanner);
index 452dd2c13353e7f49f918df3193657dc61f08db7..f018698cea133aa3cea9b0fd180bcb1c6bdd7b6e 100644 (file)
@@ -63,8 +63,8 @@ typedef struct t_selexpr_value
 {
     /** Type of the value. */
     e_selvalue_t            type;
-    /** TRUE if the value is the result of an expression. */
-    gmx_bool                    bExpr;
+    /** true if the value is the result of an expression. */
+    bool                    bExpr;
     /** The actual value. */
     union {
         /** The integer value/range (\p type INT_VALUE); */
@@ -85,7 +85,7 @@ typedef struct t_selexpr_value
         char               *s;
         /** The position value (\p type POS_VALUE); */
         rvec                x;
-        /** The expression if \p bExpr is TRUE. */
+        /** The expression if \p bExpr is true. */
         struct t_selelem   *expr;
     }                       u;
     /** Pointer to the next value. */
@@ -190,7 +190,7 @@ struct t_selelem *
 _gmx_sel_append_selection(struct t_selelem *sel, struct t_selelem *last,
                           void *scanner);
 /** Check whether the parser should finish. */
-gmx_bool
+bool
 _gmx_sel_parser_should_finish(void *scanner);
 
 /** Handle empty commands. */
@@ -202,7 +202,7 @@ _gmx_sel_handle_help_cmd(char *topic, void *scanner);
 
 /* In params.c */
 /** Initializes an array of parameters based on input from the selection parser. */
-gmx_bool
+bool
 _gmx_sel_parse_params(t_selexpr_param *pparams, int nparam,
                       struct gmx_ana_selparam_t *param, struct t_selelem *root,
                       void *scanner);
index e7b9f5c60ee48922710a2deb5faf6fa899c698c7..44cbf43e96cc9c2e45cbd6adcec517d7d9bc76e3 100644 (file)
@@ -143,7 +143,7 @@ struct gmx_ana_poscalc_coll_t
     /** Pointer to the last data structure. */
     gmx_ana_poscalc_t        *last;
     /** Whether the collection has been initialized for evaluation. */
-    gmx_bool                      bInit;
+    bool                      bInit;
 };
 
 /*! \internal \brief
@@ -194,8 +194,8 @@ struct gmx_ana_poscalc_t
     /** Position storage for calculations that are used as a base. */
     gmx_ana_pos_t            *p;
 
-    /** TRUE if the positions have been evaluated for the current frame. */
-    gmx_bool                      bEval;
+    /** true if the positions have been evaluated for the current frame. */
+    bool                      bEval;
     /*! \brief
      * Base position data for this calculation.
      *
@@ -330,7 +330,7 @@ gmx_ana_poscalc_type_from_enum(const char *post, e_poscalc_t *type, int *flags)
 }
 
 /*!
- * \param[in]  bAtom    If TRUE, the "atom" value is included.
+ * \param[in]  bAtom    If true, the "atom" value is included.
  * \returns    NULL-terminated array of strings that contains the string
  *   values acceptable for gmx_ana_poscalc_type_from_enum().
  *
@@ -338,7 +338,7 @@ gmx_ana_poscalc_type_from_enum(const char *post, e_poscalc_t *type, int *flags)
  * be used with Gromacs command-line parsing.
  */
 const char **
-gmx_ana_poscalc_create_type_enum(gmx_bool bAtom)
+gmx_ana_poscalc_create_type_enum(bool bAtom)
 {
     const char **pcenum;
     size_t       i;
@@ -376,7 +376,7 @@ gmx_ana_poscalc_coll_create(gmx_ana_poscalc_coll_t **pccp)
     pcc->top   = NULL;
     pcc->first = NULL;
     pcc->last  = NULL;
-    pcc->bInit = FALSE;
+    pcc->bInit = false;
     *pccp = pcc;
     return 0;
 }
@@ -634,7 +634,7 @@ remove_poscalc(gmx_ana_poscalc_t *pc)
  * \p bBase affects on how the \p pc->gmax field is initialized.
  */
 static void
-set_poscalc_maxindex(gmx_ana_poscalc_t *pc, gmx_ana_index_t *g, gmx_bool bBase)
+set_poscalc_maxindex(gmx_ana_poscalc_t *pc, gmx_ana_index_t *g, bool bBase)
 {
     gmx_ana_index_make_block(&pc->b, pc->coll->top, g, pc->itype, pc->flags & POS_COMPLWHOLE);
     /* Set the type to POS_ATOM if the calculation in fact is such. */
@@ -656,7 +656,7 @@ set_poscalc_maxindex(gmx_ana_poscalc_t *pc, gmx_ana_index_t *g, gmx_bool bBase)
     /* Setup the gmax field */
     if ((pc->flags & POS_COMPLWHOLE) && !bBase && pc->b.nra > g->isize)
     {
-        gmx_ana_index_copy(&pc->gmax, g, TRUE);
+        gmx_ana_index_copy(&pc->gmax, g, true);
         sfree(pc->gmax.name);
         pc->gmax.name  = NULL;
     }
@@ -670,32 +670,32 @@ set_poscalc_maxindex(gmx_ana_poscalc_t *pc, gmx_ana_index_t *g, gmx_bool bBase)
  * Checks whether a position calculation should use a base at all.
  *
  * \param[in] pc   Position calculation data to check.
- * \returns   TRUE if \p pc can use a base and gets some benefit out of it,
- *   FALSE otherwise.
+ * \returns   true if \p pc can use a base and gets some benefit out of it,
+ *   false otherwise.
  */
-static gmx_bool
+static bool
 can_use_base(gmx_ana_poscalc_t *pc)
 {
     /* For atoms, it should be faster to do a simple copy, so don't use a
      * base. */
     if (pc->type == POS_ATOM)
     {
-        return FALSE;
+        return false;
     }
     /* For dynamic selections that do not use completion, it is not possible
      * to use a base. */
     if ((pc->type == POS_RES || pc->type == POS_MOL)
         && (pc->flags & POS_DYNAMIC) && !(pc->flags & (POS_COMPLMAX | POS_COMPLWHOLE)))
     {
-        return FALSE;
+        return false;
     }
     /* Dynamic calculations for a single position cannot use a base. */
     if ((pc->type == POS_ALL || pc->type == POS_ALL_PBC)
         && (pc->flags & POS_DYNAMIC))
     {
-        return FALSE;
+        return false;
     }
-    return TRUE;
+    return true;
 }
 
 /*! \brief
@@ -707,10 +707,10 @@ can_use_base(gmx_ana_poscalc_t *pc)
  *   \p pc1.
  * \param[in,out] g   Working space, should have enough allocated memory to
  *   contain the intersection of the atoms in \p pc1 and \p pc2.
- * \returns   TRUE if the two calculations should be merged to use a common
- *   base, FALSE otherwise.
+ * \returns   true if the two calculations should be merged to use a common
+ *   base, false otherwise.
  */
-static gmx_bool
+static bool
 should_merge(gmx_ana_poscalc_t *pc1, gmx_ana_poscalc_t *pc2,
              gmx_ana_index_t *g1, gmx_ana_index_t *g)
 {
@@ -719,12 +719,12 @@ should_merge(gmx_ana_poscalc_t *pc1, gmx_ana_poscalc_t *pc2,
     /* Do not merge calculations with different mass weighting. */
     if ((pc1->flags & POS_MASS) != (pc2->flags & POS_MASS))
     {
-        return FALSE;
+        return false;
     }
     /* Avoid messing up complete calculations. */
     if ((pc1->flags & POS_COMPLWHOLE) != (pc2->flags & POS_COMPLWHOLE))
     {
-        return FALSE;
+        return false;
     }
     /* Find the overlap between the calculations. */
     gmx_ana_index_set(&g2, pc2->b.nra, pc2->b.a, NULL, 0);
@@ -732,22 +732,22 @@ should_merge(gmx_ana_poscalc_t *pc1, gmx_ana_poscalc_t *pc2,
     /* Do not merge if there is no overlap. */
     if (g->isize == 0)
     {
-        return FALSE;
+        return false;
     }
     /* Full completion calculations always match if the type is correct. */
     if ((pc1->flags & POS_COMPLWHOLE) && (pc2->flags & POS_COMPLWHOLE)
         && pc1->type == pc2->type)
     {
-        return TRUE;
+        return true;
     }
     /* The calculations also match if the intersection consists of full
      * blocks. */
     if (gmx_ana_index_has_full_ablocks(g, &pc1->b)
         && gmx_ana_index_has_full_ablocks(g, &pc2->b))
     {
-        return TRUE;
+        return true;
     }
-    return FALSE;
+    return false;
 }
 
 /*! \brief
@@ -769,7 +769,7 @@ create_simple_base(gmx_ana_poscalc_t *pc)
 
     flags = pc->flags & ~(POS_DYNAMIC | POS_MASKONLY);
     gmx_ana_poscalc_create(&base, pc->coll, pc->type, flags);
-    set_poscalc_maxindex(base, &pc->gmax, TRUE);
+    set_poscalc_maxindex(base, &pc->gmax, true);
 
     snew(base->p, 1);
 
@@ -1074,7 +1074,7 @@ gmx_ana_poscalc_set_flags(gmx_ana_poscalc_t *pc, int flags)
 void
 gmx_ana_poscalc_set_maxindex(gmx_ana_poscalc_t *pc, gmx_ana_index_t *g)
 {
-    set_poscalc_maxindex(pc, g, FALSE);
+    set_poscalc_maxindex(pc, g, false);
     setup_base(pc);
 }
 
@@ -1155,17 +1155,17 @@ gmx_ana_poscalc_free(gmx_ana_poscalc_t *pc)
 
 /*!
  * \param[in] pc  Position calculation data to query.
- * \returns   TRUE if \p pc requires topology for initialization and/or
- *   evaluation, FALSE otherwise.
+ * \returns   true if \p pc requires topology for initialization and/or
+ *   evaluation, false otherwise.
  */
-gmx_bool
+bool
 gmx_ana_poscalc_requires_top(gmx_ana_poscalc_t *pc)
 {
     if ((pc->flags & POS_MASS) || pc->type == POS_RES || pc->type == POS_MOL)
     {
-        return TRUE;
+        return true;
     }
-    return FALSE;
+    return false;
 }
 
 /*!
@@ -1227,7 +1227,7 @@ gmx_ana_poscalc_init_eval(gmx_ana_poscalc_coll_t *pcc)
         }
         pc = pc->next;
     }
-    pcc->bInit = TRUE;
+    pcc->bInit = true;
 }
 
 /*!
@@ -1256,7 +1256,7 @@ gmx_ana_poscalc_init_frame(gmx_ana_poscalc_coll_t *pcc)
     pc = pcc->first;
     while (pc)
     {
-        pc->bEval = FALSE;
+        pc->bEval = false;
         pc = pc->next;
     }
 }
@@ -1278,7 +1278,7 @@ gmx_ana_poscalc_update(gmx_ana_poscalc_t *pc, gmx_ana_pos_t *p,
 {
     int  i, j, bi, bj;
     
-    if (pc->bEval == TRUE && !(pc->flags & POS_MASKONLY))
+    if (pc->bEval == true && !(pc->flags & POS_MASKONLY))
     {
         return;
     }
@@ -1299,18 +1299,18 @@ gmx_ana_poscalc_update(gmx_ana_poscalc_t *pc, gmx_ana_pos_t *p,
     /* Update the index map */
     if (pc->flags & POS_DYNAMIC)
     {
-        gmx_ana_indexmap_update(&p->m, g, FALSE);
+        gmx_ana_indexmap_update(&p->m, g, false);
         p->nr = p->m.nr;
     }
     else if (pc->flags & POS_MASKONLY)
     {
-        gmx_ana_indexmap_update(&p->m, g, TRUE);
+        gmx_ana_indexmap_update(&p->m, g, true);
         if (pc->bEval)
             return;
     }
     if (!(pc->flags & POS_DYNAMIC))
     {
-        pc->bEval = TRUE;
+        pc->bEval = true;
     }
 
     /* Evaluate the positions */
index d57d3cb5965b039e9b7c5850fdb3ba003f86c90c..db39e86f8b9b7e6a76abca34a8fc452e14423685 100644 (file)
@@ -131,7 +131,7 @@ void
 gmx_ana_poscalc_type_from_enum(const char *post, e_poscalc_t *type, int *flags);
 /** Creates a list of strings for position enum parameter handling. */
 const char **
-gmx_ana_poscalc_create_type_enum(gmx_bool bAtom);
+gmx_ana_poscalc_create_type_enum(bool bAtom);
 
 /** Creates a new position calculation collection object. */
 int
@@ -166,8 +166,8 @@ gmx_ana_poscalc_init_pos(gmx_ana_poscalc_t *pc, struct gmx_ana_pos_t *p);
 /** Frees the memory allocated for position calculation. */
 void
 gmx_ana_poscalc_free(gmx_ana_poscalc_t *pc);
-/** Returns TRUE if the position calculation requires topology information. */
-gmx_bool
+/** Returns true if the position calculation requires topology information. */
+bool
 gmx_ana_poscalc_requires_top(gmx_ana_poscalc_t *pc);
 
 /** Initializes evaluation for a position calculation collection. */
index f7dabf223a0bff75782d82986d0b3706b480f0a7..46c93567359b56347e937f81ba41b8762c57f454 100644 (file)
@@ -184,14 +184,14 @@ gmx_ana_pos_free(gmx_ana_pos_t *pos)
 /*!
  * \param[in,out] dest   Destination positions.
  * \param[in]     src    Source positions.
- * \param[in]     bFirst If TRUE, memory is allocated for \p dest and a full
+ * \param[in]     bFirst If true, memory is allocated for \p dest and a full
  *   copy is made; otherwise, only variable parts are copied, and no memory
  *   is allocated.
  *
  * \p dest should have been initialized somehow (calloc() is enough).
  */
 void
-gmx_ana_pos_copy(gmx_ana_pos_t *dest, gmx_ana_pos_t *src, gmx_bool bFirst)
+gmx_ana_pos_copy(gmx_ana_pos_t *dest, gmx_ana_pos_t *src, bool bFirst)
 {
     if (bFirst)
     {
@@ -262,8 +262,8 @@ gmx_ana_pos_empty_init(gmx_ana_pos_t *pos)
     pos->m.b.index[0] = 0;
     /* This function should only be used to construct all the possible
      * positions, so the result should always be static. */
-    pos->m.bStatic = TRUE;
-    pos->m.bMapStatic = TRUE;
+    pos->m.bStatic = true;
+    pos->m.bMapStatic = true;
 }
 
 /*!
@@ -279,12 +279,12 @@ gmx_ana_pos_empty(gmx_ana_pos_t *pos)
     pos->m.mapb.nr = 0;
     /* This should not really be necessary, but do it for safety... */
     pos->m.mapb.index[0] = 0;
-    /* We set the flags to TRUE, although really in the empty state they
-     * should be FALSE. This makes it possible to update the flags in
+    /* We set the flags to true, although really in the empty state they
+     * should be false. This makes it possible to update the flags in
      * gmx_ana_pos_append(), and just make a simple check in
      * gmx_ana_pos_append_finish(). */
-    pos->m.bStatic = TRUE;
-    pos->m.bMapStatic = TRUE;
+    pos->m.bStatic = true;
+    pos->m.bMapStatic = true;
 }
 
 /*!
@@ -389,7 +389,7 @@ gmx_ana_pos_append(gmx_ana_pos_t *dest, gmx_ana_index_t *g,
         if (refid < 0)
         {
             dest->m.refid[j] = -1;
-            dest->m.bStatic = FALSE;
+            dest->m.bStatic = false;
             /* If we are using masks, there is no need to alter the
              * mapid field. */
         }
@@ -397,8 +397,8 @@ gmx_ana_pos_append(gmx_ana_pos_t *dest, gmx_ana_index_t *g,
         {
             if (refid != j)
             {
-                dest->m.bStatic = FALSE;
-                dest->m.bMapStatic = FALSE;
+                dest->m.bStatic = false;
+                dest->m.bMapStatic = false;
             }
             dest->m.refid[j] = refid;
             /* Use the original IDs from the output structure to correctly
@@ -424,7 +424,7 @@ gmx_ana_pos_append_finish(gmx_ana_pos_t *pos)
 {
     if (pos->m.nr != pos->m.b.nr)
     {
-        pos->m.bStatic = FALSE;
-        pos->m.bMapStatic = FALSE;
+        pos->m.bStatic = false;
+        pos->m.bMapStatic = false;
     }
 }
index 8b5adca7f2ab3da3b37cf16e27250976959bbb7c..6ce3f1baf14cd0b08b7a846288b57ef6595928f1 100644 (file)
 
 #include "indexutil.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*! \brief
  * Stores a set of positions together with their origins.
  */
@@ -105,7 +101,7 @@ void
 gmx_ana_pos_free(gmx_ana_pos_t *pos);
 /** Copies the evaluated positions to a preallocated data structure. */
 void
-gmx_ana_pos_copy(gmx_ana_pos_t *dest, gmx_ana_pos_t *src, gmx_bool bFirst);
+gmx_ana_pos_copy(gmx_ana_pos_t *dest, gmx_ana_pos_t *src, bool bFirst);
 
 /** Sets the number of positions in a position structure. */
 void
@@ -132,8 +128,4 @@ gmx_ana_pos_append(gmx_ana_pos_t *dest, gmx_ana_index_t *g,
 void
 gmx_ana_pos_append_finish(gmx_ana_pos_t *pos);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
index 8f1c439bb9a85bdc606341319108f7b27b77cbc6..5fa92659fea4b6a059be6d6574c149884d06da3a 100644 (file)
@@ -818,12 +818,12 @@ YY_DECL
     if (state->bMatchOf)
     {
         BEGIN(matchof);
-        state->bMatchOf = FALSE;
+        state->bMatchOf = false;
     }
     else if (state->bMatchBool)
     {
         BEGIN(matchbool);
-        state->bMatchBool = FALSE;
+        state->bMatchBool = false;
     }
     else if (state->bCmdStart)
     {
index af6c56bab48c29bf0f43df484321a95b397bb0d1..f6230b0a9fcba980508b1065e5bc9a844fee4ab4 100644 (file)
@@ -62,8 +62,8 @@ _gmx_sel_init_lexer(yyscan_t *scannerp, struct gmx_ana_selcollection_t *sc,
 void
 _gmx_sel_free_lexer(yyscan_t scanner);
 
-/** Returns TRUE if the scanner is interactive. */
-gmx_bool
+/** Returns true if the scanner is interactive. */
+bool
 _gmx_sel_is_lexer_interactive(yyscan_t scanner);
 /** Returns the selection collection for the scanner. */
 struct gmx_ana_selcollection_t *
index 1acebe182a0177d1e138c03cb5832dbdaece83ae..eca1aa7e91f83770592d6f9bbc61a99418c02b99 100644 (file)
@@ -97,12 +97,12 @@ COMMENT    (#.*)
     if (state->bMatchOf)
     {
         BEGIN(matchof);
-        state->bMatchOf = FALSE;
+        state->bMatchOf = false;
     }
     else if (state->bMatchBool)
     {
         BEGIN(matchbool);
-        state->bMatchBool = FALSE;
+        state->bMatchBool = false;
     }
     else if (state->bCmdStart)
     {
index 346fc7ee1f25bf2da48e0889b9b2fac764b4b99f..7c617e4042094ef15c3ce2676a4bc9821200e7dd 100644 (file)
@@ -81,7 +81,7 @@
 #undef yytext
 #undef yyleng
 
-static gmx_bool
+static bool
 read_stdin_line(gmx_sel_lexer_t *state)
 {
     char *ptr     = state->inputstr;
@@ -90,7 +90,7 @@ read_stdin_line(gmx_sel_lexer_t *state)
 
     if (feof(stdin))
     {
-        return FALSE;
+        return false;
     }
     if (state->bInteractive)
     {
@@ -147,7 +147,7 @@ int
 _gmx_sel_yyblex(YYSTYPE *yylval, yyscan_t yyscanner)
 {
     gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(yyscanner);
-    gmx_bool bCmdStart;
+    bool bCmdStart;
     int token;
 
     if (!state->bBuffer && !state->inputstr)
@@ -174,7 +174,7 @@ _gmx_sel_yyblex(YYSTYPE *yylval, yyscan_t yyscanner)
 }
 
 static int
-init_param_token(YYSTYPE *yylval, gmx_ana_selparam_t *param, gmx_bool bBoolNo)
+init_param_token(YYSTYPE *yylval, gmx_ana_selparam_t *param, bool bBoolNo)
 {
     if (bBoolNo)
     {
@@ -191,7 +191,7 @@ init_param_token(YYSTYPE *yylval, gmx_ana_selparam_t *param, gmx_bool bBoolNo)
 }
 
 static int
-init_method_token(YYSTYPE *yylval, gmx_ana_selmethod_t *method, gmx_bool bPosMod,
+init_method_token(YYSTYPE *yylval, gmx_ana_selmethod_t *method, bool bPosMod,
                   gmx_sel_lexer_t *state)
 {
     /* If the previous token was not KEYWORD_POS, return EMPTY_POSMOD
@@ -265,7 +265,7 @@ _gmx_sel_lexer_process_pending(YYSTYPE *yylval, gmx_sel_lexer_t *state)
     if (state->nextparam)
     {
         gmx_ana_selparam_t *param = state->nextparam;
-        gmx_bool                bBoolNo = state->bBoolNo;
+        bool                bBoolNo = state->bBoolNo;
 
         if (state->neom > 0)
         {
@@ -273,7 +273,7 @@ _gmx_sel_lexer_process_pending(YYSTYPE *yylval, gmx_sel_lexer_t *state)
             return END_OF_METHOD;
         }
         state->nextparam = NULL;
-        state->bBoolNo   = FALSE;
+        state->bBoolNo   = false;
         _gmx_sel_lexer_add_token(param->name, -1, state);
         return init_param_token(yylval, param, bBoolNo);
     }
@@ -286,7 +286,7 @@ _gmx_sel_lexer_process_pending(YYSTYPE *yylval, gmx_sel_lexer_t *state)
         gmx_ana_selmethod_t *method = state->nextmethod;
 
         state->nextmethod = NULL;
-        return init_method_token(yylval, method, TRUE, state);
+        return init_method_token(yylval, method, true, state);
     }
     return 0;
 }
@@ -302,7 +302,7 @@ _gmx_sel_lexer_process_identifier(YYSTYPE *yylval, char *yytext, size_t yyleng,
     if (state->msp >= 0)
     {
         gmx_ana_selparam_t *param = NULL;
-        gmx_bool                bBoolNo = FALSE;
+        bool                bBoolNo = false;
         int                 sp = state->msp;
         while (!param && sp >= 0)
         {
@@ -320,13 +320,13 @@ _gmx_sel_lexer_process_identifier(YYSTYPE *yylval, char *yytext, size_t yyleng,
                     param = &state->mstack[sp]->param[i];
                     break;
                 }
-                /* Check separately for a 'no' prefix on gmx_boolean parameters */
+                /* Check separately for a 'no' prefix on boolean parameters */
                 if (state->mstack[sp]->param[i].val.type == NO_VALUE
                     && yyleng > 2 && yytext[0] == 'n' && yytext[1] == 'o'
                     && !strncmp(state->mstack[sp]->param[i].name, yytext+2, yyleng-2))
                 {
                     param = &state->mstack[sp]->param[i];
-                    bBoolNo = TRUE;
+                    bBoolNo = true;
                     break;
                 }
             }
@@ -339,7 +339,7 @@ _gmx_sel_lexer_process_identifier(YYSTYPE *yylval, char *yytext, size_t yyleng,
         {
             if (param->val.type == NO_VALUE && !bBoolNo)
             {
-                state->bMatchBool = TRUE;
+                state->bMatchBool = true;
             }
             if (sp < state->msp)
             {
@@ -354,7 +354,7 @@ _gmx_sel_lexer_process_identifier(YYSTYPE *yylval, char *yytext, size_t yyleng,
     }
 
     /* Check if the identifier matches with a symbol */
-    symbol = _gmx_sel_find_symbol_len(state->sc->symtab, yytext, yyleng, FALSE);
+    symbol = _gmx_sel_find_symbol_len(state->sc->symtab, yytext, yyleng, false);
     /* If there is no match, return the token as a string */
     if (!symbol)
     {
@@ -422,7 +422,7 @@ _gmx_sel_lexer_process_identifier(YYSTYPE *yylval, char *yytext, size_t yyleng,
      * some additional handling. */
     if (symtype == SYMBOL_POS)
     {
-        state->bMatchOf = TRUE;
+        state->bMatchOf = true;
         yylval->str = _gmx_sel_sym_name(symbol);
         state->prev_pos_kw = 2;
         return KEYWORD_POS;
@@ -498,11 +498,11 @@ _gmx_sel_init_lexer(yyscan_t *scannerp, struct gmx_ana_selcollection_t *sc,
     state->nextparam    = NULL;
     state->nextmethod   = NULL;
     state->prev_pos_kw  = 0;
-    state->bBoolNo      = FALSE;
-    state->bMatchOf     = FALSE;
-    state->bMatchBool   = FALSE;
-    state->bCmdStart    = TRUE;
-    state->bBuffer      = FALSE;
+    state->bBoolNo      = false;
+    state->bMatchOf     = false;
+    state->bMatchBool   = false;
+    state->bCmdStart    = true;
+    state->bBuffer      = false;
 
     _gmx_sel_yyset_extra(state, *scannerp);
 }
@@ -523,7 +523,7 @@ _gmx_sel_free_lexer(yyscan_t scanner)
     _gmx_sel_yylex_destroy(scanner);
 }
 
-gmx_bool
+bool
 _gmx_sel_is_lexer_interactive(yyscan_t scanner)
 {
     gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(scanner);
@@ -604,7 +604,7 @@ _gmx_sel_set_lex_input_file(yyscan_t scanner, FILE *fp)
 {
     gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(scanner);
 
-    state->bBuffer = TRUE;
+    state->bBuffer = true;
     state->buffer  = _gmx_sel_yy_create_buffer(fp, YY_BUF_SIZE, scanner);
     _gmx_sel_yy_switch_to_buffer(state->buffer, scanner);
 }
@@ -618,6 +618,6 @@ _gmx_sel_set_lex_input_str(yyscan_t scanner, const char *str)
     {
         _gmx_sel_yy_delete_buffer(state->buffer, scanner);
     }
-    state->bBuffer = TRUE;
+    state->bBuffer = true;
     state->buffer  = _gmx_sel_yy_scan_string(str, scanner);
 }
index ef0b247dc28f22f1255af54bf91b5ea669d530c2..3a280b31ceb5c8c8b90c30fc2c60d77bcadb6e42 100644 (file)
@@ -80,7 +80,7 @@ typedef struct gmx_sel_lexer_t
     int                              nexpsel;
 
     //! Whether the parser is interactive.
-    gmx_bool                             bInteractive;
+    bool                             bInteractive;
     //! Current input string (line) for an interactive scanner.
     char                            *inputstr;
     //! Number of bytes allocated for \a inputstr.
@@ -105,7 +105,7 @@ typedef struct gmx_sel_lexer_t
     //! Parameter symbol to return before resuming scanning.
     struct gmx_ana_selparam_t       *nextparam;
     //! Whether \a nextparam was a boolean parameter with a 'no' prefix.
-    gmx_bool                             bBoolNo;
+    bool                             bBoolNo;
     /*! \brief
      * Method symbol to return before resuming scanning
      *
@@ -116,14 +116,14 @@ typedef struct gmx_sel_lexer_t
     int                              prev_pos_kw;
 
     //! Whether the 'of' keyword is acceptable as the next token.
-    gmx_bool                             bMatchOf;
+    bool                             bMatchOf;
     //! Whether boolean values (yes/no/on/off) are acceptable as the next token.
-    gmx_bool                             bMatchBool;
+    bool                             bMatchBool;
     //! Whether the next token starts a new selection.
-    gmx_bool                             bCmdStart;
+    bool                             bCmdStart;
 
     //! Whether an external buffer is set for the scanner.
-    gmx_bool                             bBuffer;
+    bool                             bBuffer;
     //! The current buffer for the scanner.
     YY_BUFFER_STATE                  buffer;
 } gmx_sel_lexer_t;
index d09f88685d29c05c98dd4d6de8111f6065b76fac..f551d265f36e7a6f9fe20816a1625934f35e52e5 100644 (file)
@@ -62,8 +62,8 @@ Selection::Selection(t_selelem *elem, const char *selstr)
 
     if (elem->child->type == SEL_CONST)
     {
-        gmx_ana_pos_copy(&_sel.p, elem->child->v.u.p, TRUE);
-        _sel.bDynamic = FALSE;
+        gmx_ana_pos_copy(&_sel.p, elem->child->v.u.p, true);
+        _sel.bDynamic = false;
     }
     else
     {
@@ -146,16 +146,16 @@ Selection::initCoveredFraction(e_coverfrac_t type)
     sel->cfractype = type;
     if (type == CFRAC_NONE || !sel->selelem)
     {
-        sel->bCFracDyn = FALSE;
+        sel->bCFracDyn = false;
     }
     else if (!_gmx_selelem_can_estimate_cover(sel->selelem))
     {
         sel->cfractype = CFRAC_NONE;
-        sel->bCFracDyn = FALSE;
+        sel->bCFracDyn = false;
     }
     else
     {
-        sel->bCFracDyn = TRUE;
+        sel->bCFracDyn = true;
     }
     sel->cfrac     = sel->bCFracDyn ? 0.0 : 1.0;
     sel->avecfrac  = sel->cfrac;
index f8cfdb389118fa9093a31fba0a322903c3392d2d..e629266471c852c5b9a76dad3efe1bf96caf4089 100644 (file)
@@ -64,12 +64,12 @@ typedef struct gmx_ana_selection_t
     real                   *q;
     /** Pointer to the index group that holds the selected atoms. */
     struct gmx_ana_index_t *g;
-    /** TRUE if the value can change as a function of time. */
-    gmx_bool                    bDynamic;
+    /** true if the value can change as a function of time. */
+    bool                    bDynamic;
     /** Type of the covered fraction. */
     e_coverfrac_t           cfractype;
-    /** TRUE if the covered fraction depends on the frame. */
-    gmx_bool                    bCFracDyn;
+    /** true if the covered fraction depends on the frame. */
+    bool                    bCFracDyn;
     /** Covered fraction of the selection for the current frame. */
     real                    cfrac;
     /** The average covered fraction (over the trajectory). */
index 085279b1477a0ae18833899a336a1831b913f82b..f6c941a34357e510f70b211836037891ee834ded 100644 (file)
@@ -279,7 +279,7 @@ SelectionCollection::initOptions()
     */
 
     Options &options = _impl->_options;
-    const char **postypes = gmx_ana_poscalc_create_type_enum(TRUE);
+    const char **postypes = gmx_ana_poscalc_create_type_enum(true);
     if (postypes == NULL)
     {
         // TODO: Use an out-of-memory exception here
@@ -392,7 +392,7 @@ SelectionCollection::requiresTopology() const
         gmx_ana_poscalc_type_from_enum(_impl->_rpost.c_str(), &type, &flags);
         if (type != POS_ATOM)
         {
-            return TRUE;
+            return true;
         }
     }
     if (!_impl->_spost.empty())
@@ -402,7 +402,7 @@ SelectionCollection::requiresTopology() const
         gmx_ana_poscalc_type_from_enum(_impl->_spost.c_str(), &type, &flags);
         if (type != POS_ATOM)
         {
-            return TRUE;
+            return true;
         }
     }
 
@@ -411,11 +411,11 @@ SelectionCollection::requiresTopology() const
     {
         if (_gmx_selelem_requires_top(sel))
         {
-            return TRUE;
+            return true;
         }
         sel = sel->next;
     }
-    return FALSE;
+    return false;
 }
 
 
index d675711401770b882ee61aeb01f49a3e77dbadee..1d9fdd84c74e2ac27578722538eb70a4ca047ab3 100644 (file)
@@ -102,7 +102,7 @@ _gmx_sel_value_type_str(gmx_ana_selvalue_t *val)
 
 /*! \copydoc _gmx_selelem_type_str() */
 const char *
-_gmx_selelem_gmx_boolean_type_str(t_selelem *sel)
+_gmx_selelem_boolean_type_str(t_selelem *sel)
 {
     switch (sel->u.boolt)
     {
@@ -119,7 +119,7 @@ _gmx_selelem_gmx_boolean_type_str(t_selelem *sel)
  * \returns   Pointer to the newly allocated and initialized element.
  *
  * \c t_selelem::type is set to \p type,
- * \c t_selelem::v::type is set to \ref GROUP_VALUE for gmx_boolean and comparison
+ * \c t_selelem::v::type is set to \ref GROUP_VALUE for boolean and comparison
  * expressions and \ref NO_VALUE for others,
  * \ref SEL_ALLOCVAL is set for non-root elements (\ref SEL_ALLOCDATA is also
  * set for \ref SEL_BOOLEAN elements),
@@ -474,12 +474,12 @@ _gmx_selelem_free_chain(t_selelem *first)
 /*!
  * \param[in] fp      File handle to receive the output.
  * \param[in] sel     Root of the selection subtree to print.
- * \param[in] bValues If TRUE, the evaluated values of selection elements
+ * \param[in] bValues If true, the evaluated values of selection elements
  *   are printed as well.
  * \param[in] level   Indentation level, starting from zero.
  */
 void
-_gmx_selelem_print_tree(FILE *fp, t_selelem *sel, gmx_bool bValues, int level)
+_gmx_selelem_print_tree(FILE *fp, t_selelem *sel, bool bValues, int level)
 {
     t_selelem *child;
     int          i;
@@ -539,7 +539,7 @@ _gmx_selelem_print_tree(FILE *fp, t_selelem *sel, gmx_bool bValues, int level)
     }
     else if (sel->type == SEL_BOOLEAN)
     {
-        fprintf(fp, " %s", _gmx_selelem_gmx_boolean_type_str(sel));
+        fprintf(fp, " %s", _gmx_selelem_boolean_type_str(sel));
     }
     else if (sel->type == SEL_EXPRESSION
              && sel->u.expr.method->name == sm_compare.name)
@@ -658,10 +658,10 @@ _gmx_selelem_print_tree(FILE *fp, t_selelem *sel, gmx_bool bValues, int level)
 
 /*!
  * \param[in] root Root of the subtree to query.
- * \returns TRUE if \p root or any any of its elements require topology
- *   information, FALSE otherwise.
+ * \returns true if \p root or any any of its elements require topology
+ *   information, false otherwise.
  */
-gmx_bool
+bool
 _gmx_selelem_requires_top(t_selelem *root)
 {
     t_selelem *child;
@@ -670,11 +670,11 @@ _gmx_selelem_requires_top(t_selelem *root)
     {
         if (root->u.expr.method && (root->u.expr.method->flags & SMETH_REQTOP))
         {
-            return TRUE;
+            return true;
         }
         if (root->u.expr.pc && gmx_ana_poscalc_requires_top(root->u.expr.pc))
         {
-            return TRUE;
+            return true;
         }
     }
     child = root->child;
@@ -682,9 +682,9 @@ _gmx_selelem_requires_top(t_selelem *root)
     {
         if (_gmx_selelem_requires_top(child))
         {
-            return TRUE;
+            return true;
         }
         child = child->next;
     }
-    return FALSE;
+    return false;
 }
index bc30cfd47e5c82a5a20dd912006f0f868af3ed15..a06d296881256a62804f0b97dd7221279178eb81 100644 (file)
@@ -86,7 +86,7 @@ typedef enum
     SEL_MODIFIER
 } e_selelem_t;
 
-/** Defines the gmx_boolean operation of \c t_selelem objects with type \ref SEL_BOOLEAN. */
+/** Defines the boolean operation of \c t_selelem objects with type \ref SEL_BOOLEAN. */
 typedef enum
 {
     BOOL_NOT,           /**< Not */
@@ -109,9 +109,9 @@ typedef enum
 /** Returns a string representation of the type of a \c t_selelem. */
 extern const char *
 _gmx_selelem_type_str(struct t_selelem *sel);
-/** Returns a string representation of the gmx_boolean type of a \ref SEL_BOOLEAN \c t_selelem. */
+/** Returns a string representation of the boolean type of a \ref SEL_BOOLEAN \c t_selelem. */
 extern const char *
-_gmx_selelem_gmx_boolean_type_str(struct t_selelem *sel);
+_gmx_selelem_boolean_type_str(struct t_selelem *sel);
 /** Returns a string representation of the type of a \c gmx_ana_selvalue_t. */
 extern const char *
 _gmx_sel_value_type_str(gmx_ana_selvalue_t *val);
@@ -361,19 +361,19 @@ _gmx_selelem_free_compiler_data(t_selelem *sel);
 
 /** Prints a human-readable version of a selection element subtree. */
 extern void
-_gmx_selelem_print_tree(FILE *fp, t_selelem *root, gmx_bool bValues, int level);
+_gmx_selelem_print_tree(FILE *fp, t_selelem *root, bool bValues, int level);
 /* In compile.c */
 /** Prints a human-readable version of the internal compiler data structure. */
 extern void
 _gmx_selelem_print_compiler_info(FILE *fp, t_selelem *sel, int level);
 
-/** Returns TRUE if the selection element subtree requires topology information for evaluation. */
-extern gmx_bool
+/** Returns true if the selection element subtree requires topology information for evaluation. */
+extern bool
 _gmx_selelem_requires_top(t_selelem *root);
 
 /* In sm_insolidangle.c */
-/** Returns TRUE if the covered fraction of the selection can be calculated. */
-extern gmx_bool
+/** Returns true if the covered fraction of the selection can be calculated. */
+extern bool
 _gmx_selelem_can_estimate_cover(t_selelem *sel);
 /** Returns the covered fraction of the selection for the current frame. */
 extern real
index a30465d56f43f8dc98e39200acb479d5c8278d97..c37a7a181818eefb5d7786340a3b7bda448725d5 100644 (file)
@@ -283,7 +283,7 @@ static const char *help_syntax[] = {
     "1. An expression like [TT]NUM_EXPR1 < NUM_EXPR2[tt] evaluates to an",
     "[TT]ATOM_EXPR[tt] that selects all the atoms for which the comparison",
     "is true.[BR]",
-    "2. Atom expressions can be combined with gmx_boolean operations such as",
+    "2. Atom expressions can be combined with boolean operations such as",
     "[TT]not ATOM_EXPR[tt], [TT]ATOM_EXPR and ATOM_EXPR[tt], or",
     "[TT]ATOM_EXPR or ATOM_EXPR[tt]. Parentheses can be used to alter the",
     "evaluation order.[BR]",
@@ -330,12 +330,12 @@ static const t_selection_help_item helpitems[] = {
  * \param[in] fp    Where to write the list.
  * \param[in] symtab  Symbol table to use to find available keywords.
  * \param[in] type  Only methods that return this type are printed.
- * \param[in] bMod  If FALSE, \ref SMETH_MODIFIER methods are excluded, otherwise
+ * \param[in] bMod  If false, \ref SMETH_MODIFIER methods are excluded, otherwise
  *     only them are printed.
  */
 static void
 print_keyword_list(FILE *fp, gmx_sel_symtab_t *symtab, e_selvalue_t type,
-                   gmx_bool bMod)
+                   bool bMod)
 {
     gmx_sel_symrec_t *symbol;
 
@@ -343,7 +343,7 @@ print_keyword_list(FILE *fp, gmx_sel_symtab_t *symtab, e_selvalue_t type,
     while (symbol)
     {
         gmx_ana_selmethod_t *method = _gmx_sel_sym_value_method(symbol);
-        gmx_bool                 bShow;
+        bool                 bShow;
         bShow = (method->type == type)
             && ((bMod && (method->flags & SMETH_MODIFIER))
                 || (!bMod && !(method->flags & SMETH_MODIFIER)));
@@ -428,7 +428,7 @@ _gmx_sel_print_help(FILE *fp, gmx_sel_symtab_t *symtab, const char *topic)
                 && strncmp(method->name, topic, strlen(topic)) == 0)
             {
                 print_tty_formatted(fp, method->help.nlhelp,
-                        method->help.help, 0, NULL, NULL, FALSE);
+                        method->help.help, 0, NULL, NULL, false);
                 return;
             }
             symbol = _gmx_sel_next_symbol(symbol, SYMBOL_METHOD);
@@ -438,7 +438,7 @@ _gmx_sel_print_help(FILE *fp, gmx_sel_symtab_t *symtab, const char *topic)
         return;
     }
     /* Print the help */
-    print_tty_formatted(fp, item->nl, item->text, 0, NULL, NULL, FALSE);
+    print_tty_formatted(fp, item->nl, item->text, 0, NULL, NULL, false);
     /* Special handling of certain pages */
     if (!topic)
     {
@@ -465,25 +465,25 @@ _gmx_sel_print_help(FILE *fp, gmx_sel_symtab_t *symtab, const char *topic)
         /* Print the list of keywords */
         fprintf(fp, "\nKeywords that select atoms by an integer property:\n");
         fprintf(fp, "(use in expressions or like \"atomnr 1 to 5 7 9\")\n");
-        print_keyword_list(fp, symtab, INT_VALUE, FALSE);
+        print_keyword_list(fp, symtab, INT_VALUE, false);
 
         fprintf(fp, "\nKeywords that select atoms by a numeric property:\n");
         fprintf(fp, "(use in expressions or like \"occupancy 0.5 to 1\")\n");
-        print_keyword_list(fp, symtab, REAL_VALUE, FALSE);
+        print_keyword_list(fp, symtab, REAL_VALUE, false);
 
         fprintf(fp, "\nKeywords that select atoms by a string property:\n");
         fprintf(fp, "(use like \"name PATTERN [PATTERN] ...\")\n");
-        print_keyword_list(fp, symtab, STR_VALUE, FALSE);
+        print_keyword_list(fp, symtab, STR_VALUE, false);
 
         fprintf(fp, "\nAdditional keywords that directly select atoms:\n");
-        print_keyword_list(fp, symtab, GROUP_VALUE, FALSE);
+        print_keyword_list(fp, symtab, GROUP_VALUE, false);
 
         fprintf(fp, "\nKeywords that directly evaluate to positions:\n");
         fprintf(fp, "(see also \"help positions\")\n");
-        print_keyword_list(fp, symtab, POS_VALUE, FALSE);
+        print_keyword_list(fp, symtab, POS_VALUE, false);
 
         fprintf(fp, "\nAdditional keywords:\n");
-        print_keyword_list(fp, symtab, POS_VALUE, TRUE);
-        print_keyword_list(fp, symtab, NO_VALUE, TRUE);
+        print_keyword_list(fp, symtab, POS_VALUE, true);
+        print_keyword_list(fp, symtab, NO_VALUE, true);
     }
 }
index 6e10315184715604c1a25511816b7e1e5c5c7d0a..48456a859cbabe3fbf6f72733cf2c26ce8c8ab93 100644 (file)
@@ -204,10 +204,10 @@ report_param_error(FILE *fp, const char *mname, const char *pname,
  * \param[in]     name    Name of the method (used for error messages).
  * \param[in]     nparams Number of parameters in \p param.
  * \param[in,out] param   Parameter array
- *   (only the \c flags field of gmx_boolean parameters may be modified).
+ *   (only the \c flags field of boolean parameters may be modified).
  * \param[in]     symtab  Symbol table (used for checking overlaps).
- * \returns       TRUE if there are no problems with the parameters,
- *   FALSE otherwise.
+ * \returns       true if there are no problems with the parameters,
+ *   false otherwise.
  *
  * This function performs some checks common to both check_method() and
  * check_modifier().
@@ -217,19 +217,19 @@ report_param_error(FILE *fp, const char *mname, const char *pname,
  * If you remove a check, make sure that the parameter parser can handle the
  * resulting parameters.
  */
-static gmx_bool
+static bool
 check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[],
              gmx_sel_symtab_t *symtab)
 {
-    gmx_bool              bOk = TRUE;
+    bool              bOk = true;
     gmx_sel_symrec_t *sym;
     int               i, j;
 
     if (nparams > 0 && !param)
     {
         report_error(fp, name, "error: missing parameter data");
-        bOk = FALSE;
-        return FALSE;
+        bOk = false;
+        return false;
     }
     if (nparams == 0 && param)
     {
@@ -242,7 +242,7 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
         if (param[i].name == NULL && i > 0)
         {
             report_error(fp, name, "error: NULL parameter should be the first one");
-            bOk = FALSE;
+            bOk = false;
             continue;
         }
         /* Check for duplicates */
@@ -255,7 +255,7 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
             if (!gmx_strcasecmp(param[i].name, param[j].name))
             {
                 report_error(fp, name, "error: duplicate parameter name '%s'", param[i].name);
-                bOk = FALSE;
+                bOk = false;
                 break;
             }
         }
@@ -270,7 +270,7 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
             if (param[i].val.type != INT_VALUE && param[i].val.type != REAL_VALUE)
             {
                 report_param_error(fp, name, param[i].name, "error: SPAR_RANGES cannot be set for a non-numeric parameter");
-                bOk = FALSE;
+                bOk = false;
             }
             if (param[i].flags & SPAR_DYNAMIC)
             {
@@ -280,53 +280,53 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
             if (!(param[i].flags & SPAR_VARNUM) && param[i].val.nr != 1)
             {
                 report_param_error(fp, name, param[i].name, "error: range should take either one or an arbitrary number of values");
-                bOk = FALSE;
+                bOk = false;
             }
             if (param[i].flags & SPAR_ATOMVAL)
             {
                 report_param_error(fp, name, param[i].name, "error: SPAR_RANGES and SPAR_ATOMVAL both set");
-                bOk = FALSE;
+                bOk = false;
             }
         }
         if ((param[i].flags & SPAR_VARNUM) && (param[i].flags & SPAR_ATOMVAL))
         {
             report_param_error(fp, name, param[i].name, "error: SPAR_VARNUM and SPAR_ATOMVAL both set");
-            bOk = FALSE;
+            bOk = false;
         }
         if (param[i].flags & SPAR_ENUMVAL)
         {
             if (param[i].val.type != STR_VALUE)
             {
                 report_param_error(fp, name, param[i].name, "error: SPAR_ENUMVAL can only be set for string parameters");
-                bOk = FALSE;
+                bOk = false;
             }
             if (param[i].val.nr != 1)
             {
                 report_param_error(fp, name, param[i].name, "error: SPAR_ENUMVAL parameters should take exactly one value");
-                bOk = FALSE;
+                bOk = false;
             }
             if (param[i].flags & (SPAR_DYNAMIC | SPAR_VARNUM | SPAR_ATOMVAL))
             {
                 report_param_error(fp, name, param[i].name, "error: only SPAR_OPTIONAL supported with SPAR_ENUMVAL");
-                bOk = FALSE;
+                bOk = false;
             }
         }
-        /* Check gmx_boolean parameters */
+        /* Check boolean parameters */
         if (param[i].val.type == NO_VALUE)
         {
             if (param[i].val.nr != 0)
             {
-                report_param_error(fp, name, param[i].name, "error: number of values should be zero for gmx_boolean parameters");
-                bOk = FALSE;
+                report_param_error(fp, name, param[i].name, "error: number of values should be zero for boolean parameters");
+                bOk = false;
             }
-            /* The gmx_boolean parameters should always be optional, so set the
+            /* The boolean parameters should always be optional, so set the
              * flag for convenience. */
             param[i].flags |= SPAR_OPTIONAL;
             /* Any other flags should not be specified */
             if (param[i].flags & ~SPAR_OPTIONAL)
             {
-                report_param_error(fp, name, param[i].name, "error: gmx_boolean parameter should not have any flags set");
-                bOk = FALSE;
+                report_param_error(fp, name, param[i].name, "error: boolean parameter should not have any flags set");
+                bOk = false;
             }
         }
         /* Check val.nr */
@@ -343,7 +343,7 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
             if (param[i].val.nr <= 0)
             {
                 report_param_error(fp, name, param[i].name, "error: val.nr <= 0");
-                bOk = FALSE;
+                bOk = false;
             }
         }
         /* Check that the value pointer is NULL */
@@ -363,7 +363,7 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
         if (!isalpha(param[i].name[0]))
         {
             report_param_error(fp, name, param[i].name, "error: name does not begin with a letter");
-            bOk = FALSE;
+            bOk = false;
             continue;
         }
         for (j = 1; param[i].name[j] != 0; ++j)
@@ -371,7 +371,7 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
             if (param[i].name[j] != '_' && !isalnum(param[i].name[j]))
             {
                 report_param_error(fp, name, param[i].name, "error: name contains non-alphanumeric characters");
-                bOk = FALSE;
+                bOk = false;
                 break;
             }
         }
@@ -380,10 +380,10 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
             continue;
         }
         /* Check that the name does not conflict with a method */
-        if (_gmx_sel_find_symbol(symtab, param[i].name, TRUE))
+        if (_gmx_sel_find_symbol(symtab, param[i].name, true))
         {
             report_param_error(fp, name, param[i].name, "error: name conflicts with another method or a keyword");
-            bOk = FALSE;
+            bOk = false;
         }
     } /* End of parameter loop */
     /* Check parameters of existing methods */
@@ -396,7 +396,7 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
         if (param)
         {
             report_param_error(fp, method->name, param->name, "error: name conflicts with another method or a keyword");
-            bOk = FALSE;
+            bOk = false;
         }
         sym = _gmx_sel_next_symbol(sym, SYMBOL_METHOD);
     }
@@ -409,25 +409,25 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
  * \param[in] fp        File handle to use for diagnostic messages
  *   (can be NULL).
  * \param[in] method    The method to check.
- * \returns   TRUE if there are no problems, FALSE otherwise.
+ * \returns   true if there are no problems, false otherwise.
  *
  * This function performs some checks common to both check_method() and
  * check_modifier().
  * This function checks that all the required callbacks are defined, i.e.,
  * not NULL, to find programming errors.
  */
-static gmx_bool
+static bool
 check_callbacks(FILE *fp, gmx_ana_selmethod_t *method)
 {
-    gmx_bool         bOk = TRUE;
-    gmx_bool         bNeedInit;
+    bool         bOk = true;
+    bool         bNeedInit;
     int          i;
 
     /* Make some checks on init_data and free */
     if (method->nparams > 0 && !method->init_data)
     {
         report_error(fp, method->name, "error: init_data should be provided because the method has parameters");
-        bOk = FALSE;
+        bOk = false;
     }
     if (method->free && !method->init_data)
     {
@@ -437,7 +437,7 @@ check_callbacks(FILE *fp, gmx_ana_selmethod_t *method)
     if (method->type == POS_VALUE && !method->outinit)
     {
         report_error(fp, method->name, "error: outinit should be provided because the method has POS_VALUE");
-        bOk = FALSE;
+        bOk = false;
     }
     /* Warn of dynamic callbacks in static methods */
     if (!(method->flags & SMETH_MODIFIER))
@@ -452,24 +452,24 @@ check_callbacks(FILE *fp, gmx_ana_selmethod_t *method)
     if (method->type != NO_VALUE && !method->update && !method->pupdate)
     {
         report_error(fp, method->name, "error: evaluation function missing");
-        bOk = FALSE;
+        bOk = false;
     }
     /* Loop through the parameters to determine if initialization callbacks
      * are needed. */
-    bNeedInit = FALSE;
+    bNeedInit = false;
     for (i = 0; i < method->nparams; ++i)
     {
         if (method->param[i].val.type != POS_VALUE
             && (method->param[i].flags & (SPAR_VARNUM | SPAR_ATOMVAL)))
         {
-            bNeedInit = TRUE;
+            bNeedInit = true;
         }
     }
     /* Check that the callbacks required by the parameters are present */
     if (bNeedInit && !method->init)
     {
         report_error(fp, method->name, "error: init should be provided");
-        bOk = FALSE;
+        bOk = false;
     }
     return bOk;
 }
@@ -487,21 +487,21 @@ check_callbacks(FILE *fp, gmx_ana_selmethod_t *method)
  * If you remove a check, please make sure that the selection parser,
  * compiler, and evaluation functions can deal with the method.
  */
-static gmx_bool
+static bool
 check_method(FILE *fp, gmx_ana_selmethod_t *method, gmx_sel_symtab_t *symtab)
 {
-    gmx_bool         bOk = TRUE;
+    bool         bOk = true;
 
     /* Check the type */
     if (method->type == NO_VALUE)
     {
         report_error(fp, method->name, "error: no value type specified");
-        bOk = FALSE;
+        bOk = false;
     }
     if (method->type == STR_VALUE && method->nparams > 0)
     {
         report_error(fp, method->name, "error: evaluates to a string but is not a keyword");
-        bOk = FALSE;
+        bOk = false;
     }
     /* Check flags */
     if (method->type == GROUP_VALUE)
@@ -513,7 +513,7 @@ check_method(FILE *fp, gmx_ana_selmethod_t *method, gmx_sel_symtab_t *symtab)
         if (method->flags & SMETH_VARNUMVAL)
         {
             report_error(fp, method->name, "error: SMETH_VARNUMVAL cannot be set for group-valued methods");
-            bOk = FALSE;
+            bOk = false;
         }
     }
     else
@@ -522,23 +522,23 @@ check_method(FILE *fp, gmx_ana_selmethod_t *method, gmx_sel_symtab_t *symtab)
             && (method->flags & SMETH_VARNUMVAL))
         {
             report_error(fp, method->name, "error: SMETH_SINGLEVAL and SMETH_VARNUMVAL both set");
-            bOk = FALSE;
+            bOk = false;
         }
     }
     if ((method->flags & SMETH_CHARVAL) && method->type != STR_VALUE)
     {
         report_error(fp, method->name, "error: SMETH_CHARVAL can only be specified for STR_VALUE methods");
-        bOk = FALSE;
+        bOk = false;
     }
     /* Check the parameters */
     if (!check_params(fp, method->name, method->nparams, method->param, symtab))
     {
-        bOk = FALSE;
+        bOk = false;
     }
     /* Check the callback pointers */
     if (!check_callbacks(fp, method))
     {
-        bOk = FALSE;
+        bOk = false;
     }
 
     return bOk;
@@ -557,43 +557,43 @@ check_method(FILE *fp, gmx_ana_selmethod_t *method, gmx_sel_symtab_t *symtab)
  * If you remove a check, please make sure that the selection parser,
  * compiler, and evaluation functions can deal with the method.
  */
-static gmx_bool
+static bool
 check_modifier(FILE *fp, gmx_ana_selmethod_t *method, gmx_sel_symtab_t *symtab)
 {
-    gmx_bool         bOk = TRUE;
+    bool         bOk = true;
 
     /* Check the type */
     if (method->type != NO_VALUE && method->type != POS_VALUE)
     {
         report_error(fp, method->name, "error: modifier should have type POS_VALUE or NO_VALUE");
-        bOk = FALSE;
+        bOk = false;
     }
     /* Check flags */
     if (method->flags & (SMETH_SINGLEVAL | SMETH_VARNUMVAL))
     {
         report_error(fp, method->name, "error: modifier should not have SMETH_SINGLEVAL or SMETH_VARNUMVAL set");
-        bOk = FALSE;
+        bOk = false;
     }
     /* Check the parameters */
     /* The first parameter is skipped */
     if (!check_params(fp, method->name, method->nparams-1, method->param+1, symtab))
     {
-        bOk = FALSE;
+        bOk = false;
     }
     /* Check the callback pointers */
     if (!check_callbacks(fp, method))
     {
-        bOk = FALSE;
+        bOk = false;
     }
     if (method->update)
     {
         report_error(fp, method->name, "error: modifier should not have update");
-        bOk = FALSE;
+        bOk = false;
     }
     if (method->type == POS_VALUE && !method->pupdate)
     {
         report_error(fp, method->name, "error: evaluation function missing");
-        bOk = FALSE;
+        bOk = false;
     }
 
     return bOk;
@@ -620,7 +620,7 @@ int
 gmx_ana_selmethod_register(gmx_sel_symtab_t *symtab,
                            const char *name, gmx_ana_selmethod_t *method)
 {
-    gmx_bool bOk;
+    bool bOk;
 
     /* Check the method */
     if (method->flags & SMETH_MODIFIER)
@@ -636,7 +636,7 @@ gmx_ana_selmethod_register(gmx_sel_symtab_t *symtab,
     {
         if (!_gmx_sel_add_method_symbol(symtab, name, method))
         {
-            bOk = FALSE;
+            bOk = false;
         }
     }
     if (!bOk)
@@ -657,9 +657,9 @@ gmx_ana_selmethod_register_defaults(gmx_sel_symtab_t *symtab)
 {
     size_t i;
     int  rc;
-    gmx_bool bOk;
+    bool bOk;
 
-    bOk = TRUE;
+    bOk = true;
     for (i = 0; i < asize(smtable_def); ++i)
     {
         gmx_ana_selmethod_t *method = smtable_def[i].method;
@@ -674,7 +674,7 @@ gmx_ana_selmethod_register_defaults(gmx_sel_symtab_t *symtab)
         }
         if (rc != 0)
         {
-            bOk = FALSE;
+            bOk = false;
         }
     }
     return bOk ? 0 : -1;
index 507d0fce7f383ae555b94387f31e20c7ded61132..c24f65e6c1f329dd3d1b4b2ffe283bdfc0fd5896 100644 (file)
 #include "indexutil.h"
 #include "selvalue.h"
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
 /*! \name Parameter flags
  * \anchor selparam_flags
  */
@@ -189,8 +184,4 @@ typedef struct gmx_ana_selparam_t
 gmx_ana_selparam_t *
 gmx_ana_selparam_find(const char *name, int nparam, gmx_ana_selparam_t *param);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
index e789ef596721e13414982ed53722e3d515098d5a..abdcdff35be52150e9e2bc19402f47249eb6f3df 100644 (file)
 
 #include "../legacyheaders/types/simple.h"
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
 /** Defines the value type of a different selection objects. */
 typedef enum
 {
-    NO_VALUE,           /**< No value; either an error condition or an gmx_boolean 
+    NO_VALUE,           /**< No value; either an error condition or an boolean 
                              parameter. */
     INT_VALUE,          /**< One or more integer values. */
     REAL_VALUE,         /**< One or more real values. */
@@ -97,7 +92,7 @@ typedef struct gmx_ana_selvalue_t
         /** Group value (type \ref GROUP_VALUE). */
         struct gmx_ana_index_t *g;
         /** Boolean value (only parameters of type \ref NO_VALUE); */
-        gmx_bool                   *b;
+        bool                   *b;
     }                           u;
     /*! \brief
      * Number of elements allocated for the value array.
@@ -118,8 +113,4 @@ _gmx_selvalue_setstore(gmx_ana_selvalue_t *val, void *ptr);
 int
 _gmx_selvalue_setstore_alloc(gmx_ana_selvalue_t *val, void *ptr, int nalloc);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
index 5503a2438b1bd63edeb4038b2172ff2369ff3d9a..defbf421b8e83c2fe161a25f47f76bebb97d6c2a 100644 (file)
@@ -341,14 +341,14 @@ convert_int_real(int n, t_compare_value *val)
  * \param[in]     n      Number of values in the \p val->u array.
  * \param[in,out] val    Value to convert.
  * \param[in]     cmpt   Comparison operator type.
- * \param[in]     bRight TRUE if \p val appears on the right hand size of
+ * \param[in]     bRight true if \p val appears on the right hand size of
  *   \p cmpt.
  * \returns       0 on success, EINVAL on error.
  *
  * The values are rounded such that the same comparison operator can be used.
  */
 static void
-convert_real_int(int n, t_compare_value *val, e_comparison_t cmpt, gmx_bool bRight)
+convert_real_int(int n, t_compare_value *val, e_comparison_t cmpt, bool bRight)
 {
     int   i;
     int  *iv;
@@ -430,7 +430,7 @@ init_compare(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data)
         }
         else /* d->left is static */
         {
-            convert_real_int(n1, &d->left, d->cmpt, FALSE);
+            convert_real_int(n1, &d->left, d->cmpt, false);
         }
     }
     else if (!(d->left.flags & CMP_REALVAL) && (d->right.flags & CMP_REALVAL))
@@ -454,7 +454,7 @@ init_compare(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data)
         }
         else /* d->right is static */
         {
-            convert_real_int(n2, &d->right, d->cmpt, TRUE);
+            convert_real_int(n2, &d->right, d->cmpt, true);
         }
     }
 }
@@ -503,13 +503,13 @@ evaluate_compare_int(t_topology *top, t_trxframe *fr, t_pbc *pbc,
     t_methoddata_compare *d = (t_methoddata_compare *)data;
     int                   i, i1, i2, ig;
     int                   a, b;
-    gmx_bool                  bAccept;
+    bool                  bAccept;
 
     for (i = i1 = i2 = ig = 0; i < g->isize; ++i)
     {
         a = d->left.i[i1];
         b = d->right.i[i2];
-        bAccept = FALSE;
+        bAccept = false;
         switch (d->cmpt)
         {
             case CMP_INVALID: break;
@@ -551,13 +551,13 @@ evaluate_compare_real(t_topology *top, t_trxframe *fr, t_pbc *pbc,
     t_methoddata_compare *d = (t_methoddata_compare *)data;
     int                   i, i1, i2, ig;
     real                  a, b;
-    gmx_bool                  bAccept;
+    bool                  bAccept;
 
     for (i = i1 = i2 = ig = 0; i < g->isize; ++i)
     {
         a = d->left.r[i1];
         b = (d->right.flags & CMP_REALVAL) ? d->right.r[i2] : d->right.i[i2];
-        bAccept = FALSE;
+        bAccept = false;
         switch (d->cmpt)
         {
             case CMP_INVALID: break;
index c054822d6cfb328137502419bde8da3f45f794d2..3b83825d78d52b05dab30de6d8e6dc417ee94fd0 100644 (file)
@@ -226,7 +226,7 @@ free_data_insolidangle(void *data);
 static void
 init_frame_insolidangle(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data);
 /** Internal helper function for evaluate_insolidangle(). */
-static gmx_bool
+static bool
 accept_insolidangle(rvec x, t_pbc *pbc, void *data);
 /** Evaluates the \p insolidangle selection method. */
 static void
@@ -269,7 +269,7 @@ optimize_surface_points(t_methoddata_insolidangle *surf);
 static real
 estimate_covered_fraction(t_methoddata_insolidangle *surf);
 /** Checks whether a point lies within a solid angle. */
-static gmx_bool
+static bool
 is_surface_covered(t_methoddata_insolidangle *surf, rvec x);
 
 /** Parameters for the \p insolidangle selection method. */
@@ -445,9 +445,9 @@ init_frame_insolidangle(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data)
  * \param[in] x    Test point.
  * \param[in] pbc  PBC data (if NULL, no PBC are used).
  * \param[in] data Pointer to a \c t_methoddata_insolidangle data structure.
- * \returns   TRUE if \p x is within the solid angle, FALSE otherwise.
+ * \returns   true if \p x is within the solid angle, false otherwise.
  */
-static gmx_bool
+static bool
 accept_insolidangle(rvec x, t_pbc *pbc, void *data)
 {
     t_methoddata_insolidangle *d = (t_methoddata_insolidangle *)data;
@@ -492,22 +492,22 @@ evaluate_insolidangle(t_topology *top, t_trxframe *fr, t_pbc *pbc,
 
 /*!
  * \param[in] sel Selection element to query.
- * \returns   TRUE if the covered fraction can be estimated for \p sel with
- *   _gmx_selelem_estimate_coverfrac(), FALSE otherwise.
+ * \returns   true if the covered fraction can be estimated for \p sel with
+ *   _gmx_selelem_estimate_coverfrac(), false otherwise.
  */
-gmx_bool
+bool
 _gmx_selelem_can_estimate_cover(t_selelem *sel)
 {
     t_selelem   *child;
-    gmx_bool         bFound;
-    gmx_bool         bDynFound;
+    bool         bFound;
+    bool         bDynFound;
 
     if (sel->type == SEL_BOOLEAN && sel->u.boolt == BOOL_OR)
     {
-        return FALSE;
+        return false;
     }
-    bFound    = FALSE;
-    bDynFound = FALSE;
+    bFound    = false;
+    bDynFound = false;
     child     = sel->child;
     while (child)
     {
@@ -517,27 +517,27 @@ _gmx_selelem_can_estimate_cover(t_selelem *sel)
             {
                 if (bFound || bDynFound)
                 {
-                    return FALSE;
+                    return false;
                 }
-                bFound = TRUE;
+                bFound = true;
             }
             else if (child->u.expr.method
                      && (child->u.expr.method->flags & SMETH_DYNAMIC))
             {
                 if (bFound)
                 {
-                    return FALSE;
+                    return false;
                 }
-                bDynFound = TRUE;
+                bDynFound = true;
             }
         }
         else if (!_gmx_selelem_can_estimate_cover(child))
         {
-            return FALSE;
+            return false;
         }
         child = child->next;
     }
-    return TRUE;
+    return true;
 }
 
 /*!
@@ -545,7 +545,7 @@ _gmx_selelem_can_estimate_cover(t_selelem *sel)
  * \returns Fraction of angles covered by the selection (between zero and one).
  *
  * The return value is undefined if _gmx_selelem_can_estimate_cover() returns
- * FALSE.
+ * false.
  * Should be called after gmx_ana_evaluate_selections() has been called for the
  * frame.
  */
@@ -942,9 +942,9 @@ estimate_covered_fraction(t_methoddata_insolidangle *surf)
 /*!
  * \param[in] surf  Surface data structure to search.
  * \param[in] x     Unit vector to check.
- * \returns   TRUE if \p x is within the solid angle, FALSE otherwise.
+ * \returns   true if \p x is within the solid angle, false otherwise.
  */
-static gmx_bool
+static bool
 is_surface_covered(t_methoddata_insolidangle *surf, rvec x)
 {
     int  bin, i;
@@ -953,15 +953,15 @@ is_surface_covered(t_methoddata_insolidangle *surf, rvec x)
     /* Check for completely covered bin */
     if (surf->bin[bin].n == -1)
     {
-        return TRUE;
+        return true;
     }
     /* Check each point that partially covers the bin */
     for (i = 0; i < surf->bin[bin].n; ++i)
     {
         if (sph_distc(x, surf->bin[bin].x[i]) < surf->distccut)
         {
-            return TRUE;
+            return true;
         }
     }
-    return FALSE;
+    return false;
 }
index fd91e3eb762cd181155fa8960948d1baa0f34538..7abbfbec479f225e3122546e57a6b7011166d771 100644 (file)
@@ -147,15 +147,15 @@ typedef struct t_methoddata_kwstr
      * Array of strings/regular expressions to match against.
      */
     struct t_methoddata_kwstr_match {
-        /** TRUE if the expression is a regular expression, FALSE otherwise. */
-        gmx_bool           bRegExp;
+        /** true if the expression is a regular expression, false otherwise. */
+        bool           bRegExp;
         /** The value to match against. */
         union {
 #ifdef USE_REGEX
-            /** Compiled regular expression if \p bRegExp is TRUE. */
+            /** Compiled regular expression if \p bRegExp is true. */
             regex_t    r;
 #endif
-            /** The string if \p bRegExp is FALSE; */
+            /** The string if \p bRegExp is false; */
             char      *s;
         }              u;
     }                 *m;
@@ -471,7 +471,7 @@ init_kwstr(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data)
     char               *s;
     int                 i;
     size_t              j;
-    gmx_bool                bRegExp;
+    bool                bRegExp;
 
     d->v   = param[0].val.u.s;
     d->n   = param[1].val.nr;
@@ -484,12 +484,12 @@ init_kwstr(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data)
     for (i = 0; i < d->n; ++i)
     {
         s = param[1].val.u.s[i];
-        bRegExp = FALSE;
+        bRegExp = false;
         for (j = 0; j < strlen(s); ++j)
         {
             if (ispunct(s[j]) && s[j] != '?' && s[j] != '*')
             {
-                bRegExp = TRUE;
+                bRegExp = true;
                 break;
             }
         }
@@ -501,13 +501,13 @@ init_kwstr(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data)
             sprintf(buf, "^%s$", s);
             if (regcomp(&d->m[i].u.r, buf, REG_EXTENDED | REG_NOSUB))
             {
-                bRegExp = FALSE;
+                bRegExp = false;
                 fprintf(stderr, "WARNING: error in regular expression,\n"
                                 "         will match '%s' as a simple string\n", s);
             }
             sfree(buf);
 #else
-            bRegExp = FALSE;
+            bRegExp = false;
             fprintf(stderr, "WARNING: no regular expressions support,\n"
                             "         will match '%s' as a simple string\n", s);
 #endif
@@ -560,12 +560,12 @@ evaluate_keyword_str(t_topology *top, t_trxframe *fr, t_pbc *pbc,
 {
     t_methoddata_kwstr *d = (t_methoddata_kwstr *)data;
     int                 i, j;
-    gmx_bool                bFound;
+    bool                bFound;
 
     out->u.g->isize = 0;
     for (i = 0; i < g->isize; ++i)
     {
-        bFound = FALSE;
+        bFound = false;
         for (j = 0; j < d->n && !bFound; ++j)
         {
             if (d->m[j].bRegExp)
@@ -575,7 +575,7 @@ evaluate_keyword_str(t_topology *top, t_trxframe *fr, t_pbc *pbc,
                  * are available, but the ifdef is still needed. */
                 if (!regexec(&d->m[j].u.r, d->v[i], 0, NULL, 0))
                 {
-                    bFound = TRUE;
+                    bFound = true;
                 }
 #endif
             }
@@ -583,7 +583,7 @@ evaluate_keyword_str(t_topology *top, t_trxframe *fr, t_pbc *pbc,
             {
                 if (gmx_wcmatch(d->m[j].u.s, d->v[i]) == 0)
                 {
-                    bFound = TRUE;
+                    bFound = true;
                 }
             }
         }
index 1367086d16262586f37c47c59d402fad42c4be2f..d8372c54469d7fec7e4325bf72892966286da67a 100644 (file)
@@ -192,7 +192,7 @@ init_output_permute(t_topology *top, gmx_ana_selvalue_t *out, void *data)
     t_methoddata_permute *d = (t_methoddata_permute *)data;
     int                   i, j, b, k;
 
-    gmx_ana_pos_copy(out->u.p, &d->p, TRUE);
+    gmx_ana_pos_copy(out->u.p, &d->p, true);
     gmx_ana_pos_set_evalgrp(out->u.p, &d->g);
     d->g.isize = 0;
     gmx_ana_pos_empty_init(out->u.p);
index dba49af332955644df70210556260624fcacb018..18f262e724dc8555ba181ca5de1b676cfa1dca26 100644 (file)
@@ -62,8 +62,8 @@ typedef struct
     gmx_ana_index_t    g;
     /** Position evaluation data structure. */
     gmx_ana_poscalc_t *pc;
-    /** TRUE if periodic boundary conditions should be used. */
-    gmx_bool               bPBC;
+    /** true if periodic boundary conditions should be used. */
+    bool               bPBC;
     /** Type of positions to calculate. */
     char              *type;
     /** Flags for the position calculation. */
@@ -175,7 +175,7 @@ init_data_pos(int npar, gmx_ana_selparam_t *param)
         param[1].val.u.b = &data->bPBC;
     }
     data->pc       = NULL;
-    data->bPBC     = FALSE;
+    data->bPBC     = false;
     data->type     = NULL;
     data->flags    = -1;
     return data;
index d8a5c1e8548cdf323a6a6152e2b383b28be827eb..45d2484a387108ff02570b2a0f464f686fd66451 100644 (file)
@@ -91,7 +91,7 @@ typedef struct
      */
     char                   **as_s_sorted;
     /** Whether simple matching can be used. */
-    gmx_bool                     bSorted;
+    bool                     bSorted;
 } t_methoddata_same;
 
 /** Allocates data for the \p same selection method. */
@@ -327,14 +327,14 @@ init_frame_same_int(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data)
     int                i, j;
 
     /* Collapse adjacent values, and check whether the array is sorted. */
-    d->bSorted = TRUE;
+    d->bSorted = true;
     for (i = 1, j = 0; i < d->nas; ++i)
     {
         if (d->as.i[i] != d->as.i[j])
         {
             if (d->as.i[i] < d->as.i[j])
             {
-                d->bSorted = FALSE;
+                d->bSorted = false;
             }
             ++j;
             d->as.i[j] = d->as.i[i];
@@ -424,7 +424,7 @@ evaluate_same_int(t_topology *top, t_trxframe *fr, t_pbc *pbc,
         }
         if (j < g->isize && d->val.i[j] < d->val.i[j - 1])
         {
-            d->bSorted = FALSE;
+            d->bSorted = false;
         }
     }
 }
@@ -455,8 +455,8 @@ init_frame_same_str(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data)
 
     /* Collapse adjacent values.
      * For strings, it's unlikely that the values would be sorted originally,
-     * so set bSorted always to FALSE. */
-    d->bSorted = FALSE;
+     * so set bSorted always to false. */
+    d->bSorted = false;
     d->as_s_sorted[0] = d->as.s[0];
     for (i = 1, j = 0; i < d->nas; ++i)
     {
index ecf45ffd3af65337fd8f0348046be3cecfcc9c81..30369fa6d6218a23761bd5786ee67dc7457ada8c 100644 (file)
@@ -406,7 +406,7 @@ static void
 evaluate_all(t_topology *top, t_trxframe *fr, t_pbc *pbc,
              gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data)
 {
-    gmx_ana_index_copy(out->u.g, g, FALSE);
+    gmx_ana_index_copy(out->u.g, g, false);
 }
 
 /*!
@@ -493,7 +493,7 @@ evaluate_resindex(t_topology *top, t_trxframe *fr, t_pbc *pbc,
 static void
 check_molecules(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data)
 {
-    gmx_bool bOk;
+    bool bOk;
 
     bOk = (top != NULL && top->mols.nr > 0);
     if (!bOk)
@@ -553,7 +553,7 @@ evaluate_atomname(t_topology *top, t_trxframe *fr, t_pbc *pbc,
 static void
 check_atomtype(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data)
 {
-    gmx_bool bOk;
+    bool bOk;
 
     bOk = (top != NULL && top->atoms.atomtype != NULL);
     if (!bOk)
@@ -695,7 +695,7 @@ evaluate_charge(t_topology *top, t_trxframe *fr, t_pbc *pbc,
 static void
 check_pdbinfo(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data)
 {
-    gmx_bool bOk;
+    bool bOk;
 
     bOk = (top != NULL && top->atoms.pdbinfo != NULL);
     if (!bOk)
index a2376bf7f182ccb562063387756954668dc21451..d837f5f0372699bfab9252225977c7a7d80eea00 100644 (file)
@@ -194,7 +194,7 @@ add_position_symbols(gmx_sel_symtab_t *tab)
     gmx_sel_symrec_t  *last;
     int                i;
 
-    postypes = gmx_ana_poscalc_create_type_enum(TRUE);
+    postypes = gmx_ana_poscalc_create_type_enum(true);
     last = tab->first;
     while (last && last->next)
     {
@@ -263,15 +263,15 @@ _gmx_sel_symtab_free(gmx_sel_symtab_t *tab)
 /*!
  * \param[in] tab    Symbol table to search.
  * \param[in] name   Symbol name to find.
- * \param[in] bExact If FALSE, symbols that begin with \p name are also
+ * \param[in] bExact If false, symbols that begin with \p name are also
  *   considered.
  * \returns   Pointer to the symbol with name \p name, or NULL if not found.
  *
- * If no exact match is found and \p bExact is FALSE, returns a symbol that
+ * If no exact match is found and \p bExact is false, returns a symbol that
  * begins with \p name if a unique matching symbol is found.
  */
 gmx_sel_symrec_t *
-_gmx_sel_find_symbol(gmx_sel_symtab_t *tab, const char *name, gmx_bool bExact)
+_gmx_sel_find_symbol(gmx_sel_symtab_t *tab, const char *name, bool bExact)
 {
     return _gmx_sel_find_symbol_len(tab, name, strlen(name), bExact);
 }
@@ -280,11 +280,11 @@ _gmx_sel_find_symbol(gmx_sel_symtab_t *tab, const char *name, gmx_bool bExact)
  * \param[in] tab    Symbol table to search.
  * \param[in] name   Symbol name to find.
  * \param[in] len    Only consider the first \p len characters of \p name.
- * \param[in] bExact If FALSE, symbols that begin with \p name are also
+ * \param[in] bExact If false, symbols that begin with \p name are also
  *   considered.
  * \returns   Pointer to the symbol with name \p name, or NULL if not found.
  *
- * If no exact match is found and \p bExact is FALSE, returns a symbol that
+ * If no exact match is found and \p bExact is false, returns a symbol that
  * begins with \p name if a unique matching symbol is found.
  *
  * The parameter \p len is there to allow using this function from scanner.l
@@ -292,16 +292,16 @@ _gmx_sel_find_symbol(gmx_sel_symtab_t *tab, const char *name, gmx_bool bExact)
  */
 gmx_sel_symrec_t *
 _gmx_sel_find_symbol_len(gmx_sel_symtab_t *tab, const char *name, size_t len,
-                         gmx_bool bExact)
+                         bool bExact)
 {
     gmx_sel_symrec_t *sym;
     gmx_sel_symrec_t *match;
-    gmx_bool              bUnique;
-    gmx_bool              bMatch;
+    bool              bUnique;
+    bool              bMatch;
 
     match = NULL;
-    bUnique = TRUE;
-    bMatch  = FALSE;
+    bUnique = true;
+    bMatch  = false;
     sym = tab->first;
     while (sym)
     {
@@ -313,9 +313,9 @@ _gmx_sel_find_symbol_len(gmx_sel_symtab_t *tab, const char *name, size_t len,
             }
             if (bMatch)
             {
-                bUnique = FALSE;
+                bUnique = false;
             }
-            bMatch = TRUE;
+            bMatch = true;
             if (sym->type == SYMBOL_METHOD)
             {
                 match = sym;
index bab9483beb919f8de5918cacb62ffc066f2457f9..23b7a15deb93147da96fa16030e7bfc3c40a36fb 100644 (file)
@@ -78,11 +78,11 @@ void
 _gmx_sel_symtab_free(gmx_sel_symtab_t *tab);
 /** Finds a symbol by name. */
 gmx_sel_symrec_t *
-_gmx_sel_find_symbol(gmx_sel_symtab_t *tab, const char *name, gmx_bool bExact);
+_gmx_sel_find_symbol(gmx_sel_symtab_t *tab, const char *name, bool bExact);
 /** Finds a symbol by name. */
 gmx_sel_symrec_t *
 _gmx_sel_find_symbol_len(gmx_sel_symtab_t *tab, const char *name, size_t len,
-                         gmx_bool bExact);
+                         bool bExact);
 /** Returns the first symbol of a given type. */
 gmx_sel_symrec_t *
 _gmx_sel_first_symbol(gmx_sel_symtab_t *tab, e_symbol_t type);
index 7715b1c36fc714b89a24b8d56dbea84104b837f1..d49d913f630607fde876a5b197fc460a99061ba8 100644 (file)
@@ -148,7 +148,7 @@ class TrajectoryAnalysisSettings
         /*! \brief
          * Sets whether PBC are used.
          *
-         * \param[in]  bPBC   TRUE if PBC should be used.
+         * \param[in]  bPBC   true if PBC should be used.
          *
          * If called in TrajectoryAnalysisModule::initOptions(), this function
          * sets the default for whether PBC are used in the analysis.
@@ -169,7 +169,7 @@ class TrajectoryAnalysisSettings
         /*! \brief
          * Sets whether molecules are made whole.
          *
-         * \param[in]     bRmPBC TRUE if molecules should be made whole.
+         * \param[in]     bRmPBC true if molecules should be made whole.
          *
          * If called in TrajectoryAnalysisModule::initOptions(), this function
          * sets the default for whether molecules are made whole.
index af738742283927d09b4440fdf61eaa3a805b6562..bee952662722f8f62862e95ab9c1d816a13e57b7 100644 (file)
@@ -535,7 +535,7 @@ Select::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
 
     if (mdh != NULL)
     {
-        gmx_ana_indexmap_update(d->_mmap, sel[0]->indexGroup(), TRUE);
+        gmx_ana_indexmap_update(d->_mmap, sel[0]->indexGroup(), true);
         mdh->startFrame(frnr, fr.time);
         for (int b = 0; b < d->_mmap->nr; ++b)
         {
index 161a0a738af22d9142d4bc279490cb6d08a1b31d..cb0030d8880b58a924ec3d77f39acfd45fc95252 100644 (file)
@@ -391,7 +391,7 @@ TrajectoryAnalysisRunnerCommon::initFirstFrame()
 bool
 TrajectoryAnalysisRunnerCommon::readNextFrame()
 {
-    bool bContinue = FALSE;
+    bool bContinue = false;
     if (hasTrajectory())
     {
         bContinue = read_next_frame(_impl->_oenv, _impl->_status, _impl->fr);