mirror of
https://github.com/boostorg/msm.git
synced 2026-02-02 09:02:09 +00:00
Merge pull request #24 from Romain-Geissler-1A/ignore-unused-warning
Ignore unused argument warning when compiling with -DNDEBUG.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <boost/core/no_exceptions_support.hpp>
|
||||
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
#include <boost/mpl/contains.hpp>
|
||||
#include <boost/mpl/deref.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
@@ -442,6 +443,7 @@ private:
|
||||
|
||||
BOOST_STATIC_CONSTANT(int, current_state = (get_state_id<stt,current_state_type>::type::value));
|
||||
BOOST_STATIC_CONSTANT(int, next_state = (get_state_id<stt,next_state_type>::type::value));
|
||||
boost::ignore_unused(state); // Avoid warnings if BOOST_ASSERT expands to nothing.
|
||||
BOOST_ASSERT(state == (current_state));
|
||||
// if T1 is an exit pseudo state, then take the transition only if the pseudo exit state is active
|
||||
if (has_pseudo_exit<T1>::type::value &&
|
||||
@@ -521,6 +523,7 @@ private:
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(int, current_state = (get_state_id<stt,current_state_type>::type::value));
|
||||
BOOST_STATIC_CONSTANT(int, next_state = (get_state_id<stt,next_state_type>::type::value));
|
||||
boost::ignore_unused(state); // Avoid warnings if BOOST_ASSERT expands to nothing.
|
||||
BOOST_ASSERT(state == (current_state));
|
||||
// if T1 is an exit pseudo state, then take the transition only if the pseudo exit state is active
|
||||
if (has_pseudo_exit<T1>::type::value &&
|
||||
@@ -584,6 +587,7 @@ private:
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(int, current_state = (get_state_id<stt,current_state_type>::type::value));
|
||||
BOOST_STATIC_CONSTANT(int, next_state = (get_state_id<stt,next_state_type>::type::value));
|
||||
boost::ignore_unused(state); // Avoid warnings if BOOST_ASSERT expands to nothing.
|
||||
BOOST_ASSERT(state == (current_state));
|
||||
|
||||
// if T1 is an exit pseudo state, then take the transition only if the pseudo exit state is active
|
||||
@@ -650,6 +654,7 @@ private:
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(int, current_state = (get_state_id<stt,current_state_type>::type::value));
|
||||
BOOST_STATIC_CONSTANT(int, next_state = (get_state_id<stt,next_state_type>::type::value));
|
||||
boost::ignore_unused(state); // Avoid warnings if BOOST_ASSERT expands to nothing.
|
||||
BOOST_ASSERT(state == (current_state));
|
||||
|
||||
// if T1 is an exit pseudo state, then take the transition only if the pseudo exit state is active
|
||||
@@ -701,6 +706,7 @@ private:
|
||||
{
|
||||
|
||||
BOOST_STATIC_CONSTANT(int, current_state = (get_state_id<stt,current_state_type>::type::value));
|
||||
boost::ignore_unused(state, current_state); // Avoid warnings if BOOST_ASSERT expands to nothing.
|
||||
BOOST_ASSERT(state == (current_state));
|
||||
if (!check_guard(fsm,evt))
|
||||
{
|
||||
@@ -743,6 +749,7 @@ private:
|
||||
static HandledEnum execute(library_sm& fsm, int , int state, transition_event const& evt)
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(int, current_state = (get_state_id<stt,current_state_type>::type::value));
|
||||
boost::ignore_unused(state, current_state); // Avoid warnings if BOOST_ASSERT expands to nothing.
|
||||
BOOST_ASSERT(state == (current_state));
|
||||
if (!check_guard(fsm,evt))
|
||||
{
|
||||
@@ -770,6 +777,7 @@ private:
|
||||
static HandledEnum execute(library_sm& fsm, int , int state, transition_event const& evt)
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(int, current_state = (get_state_id<stt,current_state_type>::type::value));
|
||||
boost::ignore_unused(state, current_state); // Avoid warnings if BOOST_ASSERT expands to nothing.
|
||||
BOOST_ASSERT(state == (current_state));
|
||||
|
||||
// call the action method
|
||||
@@ -797,6 +805,7 @@ private:
|
||||
static HandledEnum execute(library_sm& , int , int state, transition_event const& )
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(int, current_state = (get_state_id<stt,current_state_type>::type::value));
|
||||
boost::ignore_unused(state, current_state); // Avoid warnings if BOOST_ASSERT expands to nothing.
|
||||
BOOST_ASSERT(state == (current_state));
|
||||
return HANDLED_TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user