Automated style fixes in order to bring the code a little bit closer to compliance with MISRA C++ rules. No changes in logic.

This commit is contained in:
Pavel Kirienko
2014-03-25 03:04:36 +04:00
parent cce657e1fe
commit 0cc627016a
64 changed files with 777 additions and 283 deletions
@@ -89,16 +89,20 @@ int DataTypeInfoProvider::start()
res = cats_srv_.start(
ComputeAggregateTypeSignatureCallback(this, &DataTypeInfoProvider::handleComputeAggregateTypeSignatureRequest));
if (res < 0)
{
goto fail;
}
res = gdti_srv_.start(GetDataTypeInfoCallback(this, &DataTypeInfoProvider::handleGetDataTypeInfoRequest));
if (res < 0)
{
goto fail;
}
assert(res >= 0);
return res;
fail:
fail:
assert(res < 0);
cats_srv_.stop();
gdti_srv_.stop();
@@ -13,8 +13,8 @@ bool NodeStatusProvider::isNodeInfoInitialized() const
{
// Hardware version is not required
return (node_info_.software_version != protocol::SoftwareVersion()) &&
(node_info_.uavcan_version != protocol::SoftwareVersion()) &&
(!node_info_.name.empty());
(node_info_.uavcan_version != protocol::SoftwareVersion()) &&
(!node_info_.name.empty());
}
int NodeStatusProvider::publish()
@@ -32,7 +32,9 @@ void NodeStatusProvider::publishWithErrorHandling()
{
const int res = publish();
if (res < 0)
{
getNode().registerInternalFailure("NodeStatus publication failed");
}
}
void NodeStatusProvider::handleTimerEvent(const TimerEvent&)
@@ -67,21 +69,27 @@ int NodeStatusProvider::startAndPublish()
res = publish(); // Initial broadcast
if (res < 0)
{
goto fail;
}
res = gdr_sub_.start(GlobalDiscoveryRequestCallback(this, &NodeStatusProvider::handleGlobalDiscoveryRequest));
if (res < 0)
{
goto fail;
}
res = gni_srv_.start(GetNodeInfoCallback(this, &NodeStatusProvider::handleGetNodeInfoRequest));
if (res < 0)
{
goto fail;
}
Timer::startPeriodic(MonotonicDuration::fromMSec(protocol::NodeStatus::PUBLICATION_PERIOD_MS));
return res;
fail:
fail:
assert(res < 0);
gdr_sub_.stop();
gni_srv_.stop();
@@ -29,7 +29,9 @@ void PanicBroadcaster::panic(const char* short_reason)
while (p && *p)
{
if (msg_.reason_text.size() == msg_.reason_text.capacity())
{
break;
}
msg_.reason_text.push_back(*p);
p++;
}