Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53898 - in trunk/boost/spirit/home/phoenix: core operator operator/detail scope statement statement/detail stl/container
From: frabar666_at_[hidden]
Date: 2009-06-14 05:00:12


Author: fbarel
Date: 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
New Revision: 53898
URL: http://svn.boost.org/trac/boost/changeset/53898

Log:
Phoenix: move all PHOENIX_*LIMIT definitions to core/limits.hpp and add range checks
Text files modified:
   trunk/boost/spirit/home/phoenix/core/actor.hpp | 9 +++----
   trunk/boost/spirit/home/phoenix/core/argument.hpp | 6 ----
   trunk/boost/spirit/home/phoenix/core/basic_environment.hpp | 5 ----
   trunk/boost/spirit/home/phoenix/core/composite.hpp | 4 ---
   trunk/boost/spirit/home/phoenix/core/limits.hpp | 49 ++++++++++++++++++++++++++++++++++++++-
   trunk/boost/spirit/home/phoenix/operator/detail/mem_fun_ptr_eval.hpp | 1
   trunk/boost/spirit/home/phoenix/operator/detail/mem_fun_ptr_gen.hpp | 2
   trunk/boost/spirit/home/phoenix/operator/member.hpp | 6 ----
   trunk/boost/spirit/home/phoenix/scope/dynamic.hpp | 4 ---
   trunk/boost/spirit/home/phoenix/scope/lambda.hpp | 4 ---
   trunk/boost/spirit/home/phoenix/scope/let.hpp | 4 ---
   trunk/boost/spirit/home/phoenix/scope/local_variable.hpp | 4 ---
   trunk/boost/spirit/home/phoenix/statement/detail/catch_all_eval.hpp | 2
   trunk/boost/spirit/home/phoenix/statement/detail/catch_eval.hpp | 2
   trunk/boost/spirit/home/phoenix/statement/try_catch.hpp | 6 ----
   trunk/boost/spirit/home/phoenix/stl/container/container.hpp | 6 ----
   16 files changed, 56 insertions(+), 58 deletions(-)

Modified: trunk/boost/spirit/home/phoenix/core/actor.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/core/actor.hpp (original)
+++ trunk/boost/spirit/home/phoenix/core/actor.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -7,15 +7,14 @@
 #ifndef PHOENIX_CORE_ACTOR_HPP
 #define PHOENIX_CORE_ACTOR_HPP
 
+#include <boost/spirit/home/phoenix/core/limits.hpp>
+
 #if !defined(BOOST_RESULT_OF_NUM_ARGS)
 # define BOOST_RESULT_OF_NUM_ARGS PHOENIX_ACTOR_LIMIT
-#else
-# if (BOOST_RESULT_OF_NUM_ARGS < PHOENIX_ACTOR_LIMIT)
-# error "BOOST_RESULT_OF_NUM_ARGS < PHOENIX_ACTOR_LIMIT"
-# endif
+#elif (BOOST_RESULT_OF_NUM_ARGS < PHOENIX_ACTOR_LIMIT)
+# error "BOOST_RESULT_OF_NUM_ARGS < PHOENIX_ACTOR_LIMIT"
 #endif
 
-#include <boost/spirit/home/phoenix/core/limits.hpp>
 #include <boost/spirit/home/phoenix/core/basic_environment.hpp>
 #include <boost/mpl/min.hpp>
 #include <boost/mpl/identity.hpp>

Modified: trunk/boost/spirit/home/phoenix/core/argument.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/core/argument.hpp (original)
+++ trunk/boost/spirit/home/phoenix/core/argument.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -8,7 +8,7 @@
 #define PHOENIX_CORE_ARGUMENT_HPP
 
 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
-#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/inc.hpp>
 #include <boost/spirit/home/phoenix/core/actor.hpp>
 #include <boost/fusion/include/at.hpp>
 #include <boost/mpl/if.hpp>
@@ -21,10 +21,6 @@
 #include <boost/mpl/size.hpp>
 #include <boost/type_traits/add_reference.hpp>
 
-#if !defined(PHOENIX_ARG_LIMIT)
-# define PHOENIX_ARG_LIMIT PHOENIX_LIMIT
-#endif
-
 #define PHOENIX_DECLARE_ARG(z, n, data) \
     actor<argument<n> > const \
         BOOST_PP_CAT(arg, BOOST_PP_INC(n)) = argument<n>(); \

Modified: trunk/boost/spirit/home/phoenix/core/basic_environment.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/core/basic_environment.hpp (original)
+++ trunk/boost/spirit/home/phoenix/core/basic_environment.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -8,11 +8,6 @@
 #define PHOENIX_CORE_BASIC_ENVIRONMENT_HPP
 
 #include <boost/spirit/home/phoenix/core/limits.hpp>
-
-#if !defined(PHOENIX_ARG_LIMIT)
-# define PHOENIX_ARG_LIMIT PHOENIX_LIMIT
-#endif
-
 #include <boost/mpl/remove.hpp>
 #include <boost/mpl/transform.hpp>
 #include <boost/preprocessor/cat.hpp>

Modified: trunk/boost/spirit/home/phoenix/core/composite.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/core/composite.hpp (original)
+++ trunk/boost/spirit/home/phoenix/core/composite.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -17,10 +17,6 @@
 #include <boost/mpl/bool.hpp>
 #include <boost/mpl/or.hpp>
 
-#if !defined(PHOENIX_COMPOSITE_LIMIT)
-# define PHOENIX_COMPOSITE_LIMIT PHOENIX_LIMIT
-#endif
-
 namespace boost { namespace phoenix
 {
     namespace detail

Modified: trunk/boost/spirit/home/phoenix/core/limits.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/core/limits.hpp (original)
+++ trunk/boost/spirit/home/phoenix/core/limits.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -7,16 +7,61 @@
 #ifndef PHOENIX_CORE_LIMITS_HPP
 #define PHOENIX_CORE_LIMITS_HPP
 
+#include <boost/preprocessor/dec.hpp>
+
 #if !defined(PHOENIX_LIMIT)
 # define PHOENIX_LIMIT 10
+#elif (PHOENIX_LIMIT < 5)
+# error "PHOENIX_LIMIT is set too low"
+#endif
+
+#if !defined(PHOENIX_ARG_LIMIT)
+# define PHOENIX_ARG_LIMIT PHOENIX_LIMIT
+#elif (PHOENIX_ARG_LIMIT < 5)
+# error "PHOENIX_ARG_LIMIT is set too low"
 #endif
 
 #if !defined(PHOENIX_ACTOR_LIMIT)
 # define PHOENIX_ACTOR_LIMIT PHOENIX_LIMIT
-#elif (PHOENIX_ACTOR_LIMIT > PHOENIX_LIMIT)
-# error "PHOENIX_ACTOR_LIMIT is set too high"
+#elif (PHOENIX_ACTOR_LIMIT > PHOENIX_ARG_LIMIT)
+# error "PHOENIX_ACTOR_LIMIT > PHOENIX_ARG_LIMIT"
+#elif (PHOENIX_ACTOR_LIMIT < 3)
+# error "PHOENIX_ACTOR_LIMIT is set too low"
+#endif
+
+#if !defined(PHOENIX_COMPOSITE_LIMIT)
+# define PHOENIX_COMPOSITE_LIMIT PHOENIX_LIMIT
+#elif (PHOENIX_COMPOSITE_LIMIT < 5)
+# error "PHOENIX_COMPOSITE_LIMIT is set too low"
+#endif
+
+#if !defined(PHOENIX_MEMBER_LIMIT)
+# define PHOENIX_MEMBER_LIMIT BOOST_PP_DEC(BOOST_PP_DEC(PHOENIX_COMPOSITE_LIMIT))
+#elif (PHOENIX_MEMBER_LIMIT > PHOENIX_COMPOSITE_LIMIT)
+# error "PHOENIX_MEMBER_LIMIT > PHOENIX_COMPOSITE_LIMIT"
+#elif (PHOENIX_MEMBER_LIMIT < 3)
+# error "PHOENIX_MEMBER_LIMIT is set too low"
 #endif
 
+#if !defined(PHOENIX_CATCH_LIMIT)
+# define PHOENIX_CATCH_LIMIT BOOST_PP_DEC(PHOENIX_COMPOSITE_LIMIT)
+#elif (PHOENIX_CATCH_LIMIT < 1)
+# error "PHOENIX_CATCH_LIMIT is set too low"
+#endif
+
+#if !defined(PHOENIX_DYNAMIC_LIMIT)
+# define PHOENIX_DYNAMIC_LIMIT PHOENIX_LIMIT
+#elif (PHOENIX_DYNAMIC_LIMIT < 1)
+# error "PHOENIX_DYNAMIC_LIMIT is set too low"
+#endif
+
+#if !defined(PHOENIX_LOCAL_LIMIT)
+# define PHOENIX_LOCAL_LIMIT PHOENIX_LIMIT
+#elif (PHOENIX_LOCAL_LIMIT < 3)
+# error "PHOENIX_LOCAL_LIMIT is set too low"
+#endif
+
+
 #if !defined(FUSION_MAX_TUPLE_SIZE)
 # define FUSION_MAX_TUPLE_SIZE PHOENIX_LIMIT
 #elif (FUSION_MAX_TUPLE_SIZE < PHOENIX_LIMIT)

Modified: trunk/boost/spirit/home/phoenix/operator/detail/mem_fun_ptr_eval.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/operator/detail/mem_fun_ptr_eval.hpp (original)
+++ trunk/boost/spirit/home/phoenix/operator/detail/mem_fun_ptr_eval.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -17,6 +17,7 @@
 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
 #include <boost/preprocessor/iteration/iterate.hpp>
 #include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/arithmetic/dec.hpp>
 
 #include <boost/mpl/void.hpp>
 

Modified: trunk/boost/spirit/home/phoenix/operator/detail/mem_fun_ptr_gen.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/operator/detail/mem_fun_ptr_gen.hpp (original)
+++ trunk/boost/spirit/home/phoenix/operator/detail/mem_fun_ptr_gen.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -18,7 +18,7 @@
 #include <boost/preprocessor/repetition/enum_params.hpp>
 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
 #include <boost/preprocessor/iteration/iterate.hpp>
-#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/arithmetic/dec.hpp>
 
 #include <boost/spirit/home/phoenix/operator/detail/mem_fun_ptr_eval.hpp>
 

Modified: trunk/boost/spirit/home/phoenix/operator/member.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/operator/member.hpp (original)
+++ trunk/boost/spirit/home/phoenix/operator/member.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -29,12 +29,6 @@
 
 #include <boost/get_pointer.hpp>
 
-#include <boost/preprocessor/arithmetic/sub.hpp>
-
-#if !defined(PHOENIX_MEMBER_LIMIT)
-#define PHOENIX_MEMBER_LIMIT BOOST_PP_DEC(BOOST_PP_DEC(PHOENIX_COMPOSITE_LIMIT))
-#endif
-
 #include <boost/spirit/home/phoenix/operator/detail/mem_fun_ptr_gen.hpp>
 
 #include <memory>

Modified: trunk/boost/spirit/home/phoenix/scope/dynamic.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/scope/dynamic.hpp (original)
+++ trunk/boost/spirit/home/phoenix/scope/dynamic.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -8,10 +8,6 @@
 #ifndef PHOENIX_SCOPE_DYNAMIC_HPP
 #define PHOENIX_SCOPE_DYNAMIC_HPP
 
-#if !defined(PHOENIX_DYNAMIC_LIMIT)
-# define PHOENIX_DYNAMIC_LIMIT PHOENIX_LIMIT
-#endif
-
 #include <boost/spirit/home/phoenix/core/limits.hpp>
 #include <boost/fusion/include/at.hpp>
 #include <boost/fusion/include/vector.hpp>

Modified: trunk/boost/spirit/home/phoenix/scope/lambda.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/scope/lambda.hpp (original)
+++ trunk/boost/spirit/home/phoenix/scope/lambda.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -8,10 +8,6 @@
 #ifndef PHOENIX_SCOPE_LAMBDA_HPP
 #define PHOENIX_SCOPE_LAMBDA_HPP
 
-#if !defined(PHOENIX_LOCAL_LIMIT)
-# define PHOENIX_LOCAL_LIMIT PHOENIX_LIMIT
-#endif
-
 #include <boost/spirit/home/phoenix/core/limits.hpp>
 #include <boost/spirit/home/phoenix/core/composite.hpp>
 #include <boost/spirit/home/phoenix/scope/scoped_environment.hpp>

Modified: trunk/boost/spirit/home/phoenix/scope/let.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/scope/let.hpp (original)
+++ trunk/boost/spirit/home/phoenix/scope/let.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -8,10 +8,6 @@
 #ifndef PHOENIX_SCOPE_LET_HPP
 #define PHOENIX_SCOPE_LET_HPP
 
-#if !defined(PHOENIX_LOCAL_LIMIT)
-# define PHOENIX_LOCAL_LIMIT PHOENIX_LIMIT
-#endif
-
 #include <boost/spirit/home/phoenix/core/limits.hpp>
 #include <boost/spirit/home/phoenix/core/composite.hpp>
 #include <boost/spirit/home/phoenix/scope/scoped_environment.hpp>

Modified: trunk/boost/spirit/home/phoenix/scope/local_variable.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/scope/local_variable.hpp (original)
+++ trunk/boost/spirit/home/phoenix/scope/local_variable.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -8,10 +8,6 @@
 #ifndef PHOENIX_SCOPE_LOCAL_VARIABLE_HPP
 #define PHOENIX_SCOPE_LOCAL_VARIABLE_HPP
 
-#if !defined(PHOENIX_LOCAL_LIMIT)
-# define PHOENIX_LOCAL_LIMIT PHOENIX_LIMIT
-#endif
-
 #include <boost/spirit/home/phoenix/core/limits.hpp>
 #include <boost/spirit/home/phoenix/detail/local_reference.hpp>
 #include <boost/spirit/home/phoenix/scope/detail/local_variable.hpp>

Modified: trunk/boost/spirit/home/phoenix/statement/detail/catch_all_eval.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/statement/detail/catch_all_eval.hpp (original)
+++ trunk/boost/spirit/home/phoenix/statement/detail/catch_all_eval.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -16,7 +16,7 @@
 #include <boost/preprocessor/repetition/enum_params.hpp>
 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
 #include <boost/preprocessor/repetition/repeat.hpp>
-#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/dec.hpp>
 #include <boost/preprocessor/cat.hpp>
 #include <boost/mpl/void.hpp>
 

Modified: trunk/boost/spirit/home/phoenix/statement/detail/catch_eval.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/statement/detail/catch_eval.hpp (original)
+++ trunk/boost/spirit/home/phoenix/statement/detail/catch_eval.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -16,7 +16,7 @@
 #include <boost/preprocessor/repetition/enum_params.hpp>
 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
 #include <boost/preprocessor/repetition/repeat.hpp>
-#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/dec.hpp>
 #include <boost/preprocessor/cat.hpp>
 #include <boost/mpl/void.hpp>
 

Modified: trunk/boost/spirit/home/phoenix/statement/try_catch.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/statement/try_catch.hpp (original)
+++ trunk/boost/spirit/home/phoenix/statement/try_catch.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -15,12 +15,6 @@
 #include <boost/fusion/include/push_back.hpp>
 #include <boost/fusion/include/as_vector.hpp>
 
-#include <boost/preprocessor/arithmetic/dec.hpp>
-
-#if !defined(PHOENIX_CATCH_LIMIT)
-#define PHOENIX_CATCH_LIMIT BOOST_PP_DEC(PHOENIX_COMPOSITE_LIMIT)
-#endif
-
 #include <boost/spirit/home/phoenix/statement/detail/catch_composite.hpp>
 #include <boost/spirit/home/phoenix/statement/detail/catch_eval.hpp>
 #include <boost/spirit/home/phoenix/statement/detail/catch_all_eval.hpp>

Modified: trunk/boost/spirit/home/phoenix/stl/container/container.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/stl/container/container.hpp (original)
+++ trunk/boost/spirit/home/phoenix/stl/container/container.hpp 2009-06-14 05:00:10 EDT (Sun, 14 Jun 2009)
@@ -8,12 +8,6 @@
 #ifndef PHOENIX_STL_CONTAINER_CONTAINER_HPP
 #define PHOENIX_STL_CONTAINER_CONTAINER_HPP
 
-#include <boost/spirit/home/phoenix/core/limits.hpp>
-
-#if (PHOENIX_LIMIT < 5)
-# error "PHOENIX_LIMIT is set too low"
-#endif
-
 #include <boost/spirit/home/phoenix/stl/container/detail/container.hpp>
 #include <boost/spirit/home/phoenix/function/function.hpp>
 #include <boost/mpl/and.hpp>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk