Shorter error strings - saves ~200 bytes

This commit is contained in:
Pavel Kirienko
2014-04-16 16:59:58 +04:00
parent 97cb814ffd
commit f8b10ab003
12 changed files with 17 additions and 16 deletions
+2 -2
View File
@@ -543,7 +543,7 @@ public:
Base::clear();
if (ch == NULL)
{
handleFatalError("Null pointer in Array<>::operator=(const char*)");
handleFatalError("Array::operator=(const char*)");
}
while (*ch)
{
@@ -558,7 +558,7 @@ public:
StaticAssert<IsDynamic>::check();
if (ch == NULL)
{
handleFatalError("Null pointer in Array<>::operator+=(const char*)");
handleFatalError("Array::operator+=(const char*)");
}
while (*ch)
{
@@ -124,7 +124,7 @@ struct UAVCAN_EXPORT DefaultDataTypeRegistrator
if (res != GlobalDataTypeRegistry::RegistResultOk)
{
handleFatalError("Type registration failed");
handleFatalError("Type reg failed");
}
}
};
@@ -164,7 +164,8 @@ GlobalDataTypeRegistry::RegistResult GlobalDataTypeRegistry::regist(DataTypeID i
return remove_res;
}
}
new (storage.buffer) Entry(DataTypeKind(Type::DataTypeKind), id, Type::getDataTypeSignature(), Type::getDataTypeFullName());
new (storage.buffer) Entry(DataTypeKind(Type::DataTypeKind), id, Type::getDataTypeSignature(),
Type::getDataTypeFullName());
{
const RegistResult remove_res = remove(entry);
if (remove_res != RegistResultOk)
@@ -187,7 +187,7 @@ void ServiceClient<DataType_, Callback_>::invokeCallback(ServiceCallResultType&
}
else
{
handleFatalError("Invalid caller callback");
handleFatalError("Srv client clbk");
}
}
@@ -61,7 +61,7 @@ private:
}
else
{
handleFatalError("Invalid service server callback");
handleFatalError("Srv serv clbk");
}
const int res = publisher_.publish(response_, TransferTypeServiceResponse, request.getSrcNodeID(),
+1 -1
View File
@@ -50,7 +50,7 @@ private:
}
else
{
handleFatalError("Invalid subscriber callback");
handleFatalError("Sub clbk");
}
}
@@ -31,7 +31,7 @@ class UAVCAN_EXPORT LazyConstructor
{
if (!ptr_)
{
handleFatalError("LazyConstructor<T> is not constructed");
handleFatalError("LazyConstructor<T>");
}
}
@@ -39,7 +39,7 @@ class UAVCAN_EXPORT LazyConstructor
{
if (ptr_)
{
handleFatalError("LazyConstructor<T> is already constructed");
handleFatalError("LazyConstructor<T>");
}
}
@@ -21,7 +21,7 @@ class UAVCAN_EXPORT MethodBinder
{
if (!operator bool())
{
handleFatalError("Null method binder");
handleFatalError("Null binder");
}
}
@@ -30,13 +30,13 @@ void GlobalTimeSyncMaster::IfaceMaster::setTxTimestamp(UtcTime ts)
if (ts.isZero())
{
assert(0);
pub_.getNode().registerInternalFailure("GlobalTimeSyncMaster got zero UTC TX timestamp");
pub_.getNode().registerInternalFailure("GlobalTimeSyncMaster zero TX ts");
return;
}
if (!prev_tx_utc_.isZero())
{
prev_tx_utc_ = UtcTime(); // Reset again, because there's something broken in the driver and we don't trust it
pub_.getNode().registerInternalFailure("GlobalTimeSyncMaster publication conflict");
pub_.getNode().registerInternalFailure("GlobalTimeSyncMaster pub conflict");
return;
}
prev_tx_utc_ = ts;
@@ -15,7 +15,7 @@ NodeStatusMonitor::Entry& NodeStatusMonitor::getEntry(NodeID node_id) const
{
if (node_id.get() < 1 || node_id.get() > NodeID::Max)
{
handleFatalError("NodeStatusMonitor NodeID out of range");
handleFatalError("NodeStatusMonitor NodeID");
}
return entries_[node_id.get() - 1];
}
@@ -31,7 +31,7 @@ void NodeStatusProvider::publishWithErrorHandling()
const int res = publish();
if (res < 0)
{
getNode().registerInternalFailure("NodeStatus publication failed");
getNode().registerInternalFailure("NodeStatus pub failed");
}
}
@@ -13,7 +13,7 @@ void PanicBroadcaster::publishOnce()
const int res = pub_.broadcast(msg_);
if (res < 0)
{
pub_.getNode().registerInternalFailure("Panic broadcasting failure");
pub_.getNode().registerInternalFailure("Panic pub failed");
}
}
+1 -1
View File
@@ -294,7 +294,7 @@ CanIOManager::CanIOManager(ICanDriver& driver, IPoolAllocator& allocator, ISyste
{
if (num_ifaces_ < 1 || num_ifaces_ > MaxCanIfaces)
{
handleFatalError("Wrong number of CAN ifaces");
handleFatalError("Num ifaces");
}
if (mem_blocks_per_iface == 0)