try_implicit_cast<>() --> coerceOrFallback<>()

This commit is contained in:
Pavel Kirienko
2015-06-05 15:21:05 +03:00
parent 1f1679c75d
commit 8ab48f61e7
9 changed files with 34 additions and 34 deletions
@@ -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;