Skip to content

Commit

Permalink
fix: fixed codeql issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jfayot committed Aug 27, 2024
1 parent c6ff011 commit 1f7ef3b
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions include/dsm/dsm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ namespace dsm
std::string demangle(const char* name)
{
std::string res;
int status{ 0 };

// Demangle the type name if using non-portable GNU extensions.
#ifdef HAS_GNU_EXTENSIONS_
char* ret = abi::__cxa_demangle(name, nullptr, nullptr, &status);
int status{0};
char *ret = abi::__cxa_demangle(name, nullptr, nullptr, &status);
if (ret != nullptr)
{
res = ret;
Expand Down Expand Up @@ -1902,7 +1902,7 @@ namespace dsm
*/
auto store()
{
return topSm() != nullptr ? topSm()->store() : nullptr;
return topSm() != nullptr ? topSm()->m_store : nullptr;
}

/**
Expand All @@ -1912,7 +1912,7 @@ namespace dsm
*/
const auto store() const
{
return topSm() != nullptr ? topSm()->store() : nullptr;
return topSm() != nullptr ? topSm()->m_store : nullptr;
}

/**
Expand Down Expand Up @@ -2294,7 +2294,7 @@ namespace dsm
}

protected:
StateMachine(const std::string& name = details::Name<SmType>())
explicit StateMachine(const std::string& name = details::Name<SmType>())
: State<SmType, SmType>{}
, m_store{ new StoreType() }
{
Expand All @@ -2317,26 +2317,6 @@ namespace dsm
}

public:
/**
* @brief store
* @details Provides the state machine's local storage
* @return Reference to the state machine's local storage
*/
StoreType* store()
{
return m_store;
}

/**
* @brief store
* @details Provides the state machine's local storage
* @return Const reference to the state machine's local storage
*/
const StoreType* store() const
{
return m_store;
}

/**
* @brief visit
* @param[in,out] visitor: applied visitor
Expand Down

0 comments on commit 1f7ef3b

Please sign in to comment.