mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 14:33:35 +08:00
try_implicit_cast<>() --> coerceOrFallback<>()
This commit is contained in:
@@ -876,7 +876,7 @@ public:
|
||||
template <typename Predicate>
|
||||
inline LazyConstructor<LogEntryInfo> traverseLogFromEndUntil(const Predicate& predicate) const
|
||||
{
|
||||
UAVCAN_ASSERT(try_implicit_cast<bool>(predicate, true));
|
||||
UAVCAN_ASSERT(coerceOrFallback<bool>(predicate, true));
|
||||
for (int index = static_cast<int>(persistent_state_.getLog().getLastIndex()); index >= 0; index--)
|
||||
{
|
||||
const Entry* const entry = persistent_state_.getLog().getEntryAtIndex(Log::Index(index));
|
||||
|
||||
@@ -50,7 +50,7 @@ class UAVCAN_EXPORT PanicListener : Noncopyable
|
||||
|
||||
void invokeCallback(const ReceivedDataStructure<protocol::Panic>& msg)
|
||||
{
|
||||
if (try_implicit_cast<bool>(callback_, true))
|
||||
if (coerceOrFallback<bool>(callback_, true))
|
||||
{
|
||||
callback_(msg);
|
||||
}
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
int start(const Callback& callback)
|
||||
{
|
||||
stop();
|
||||
if (!try_implicit_cast<bool>(callback, true))
|
||||
if (!coerceOrFallback<bool>(callback, true))
|
||||
{
|
||||
UAVCAN_TRACE("PanicListener", "Invalid callback");
|
||||
return -ErrInvalidParam;
|
||||
|
||||
Reference in New Issue
Block a user