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
+6
View File
@@ -52,17 +52,23 @@ std::string CanFrame::toString(StringRepresentation mode) const
else
{
for (int dlen = 0; dlen < dlc; dlen++) // hex bytes
{
wpos += snprintf(wpos, epos - wpos, " %02x", (unsigned int)data[dlen]);
}
while (mode == StrAligned && wpos < buf + ASCII_COLUMN_OFFSET) // alignment
{
*wpos++ = ' ';
}
wpos += snprintf(wpos, epos - wpos, " \'"); // ascii
for (int dlen = 0; dlen < dlc; dlen++)
{
uint8_t ch = data[dlen];
if (ch < 0x20 || ch > 0x7E)
{
ch = '.';
}
wpos += snprintf(wpos, epos - wpos, "%c", ch);
}
wpos += snprintf(wpos, epos - wpos, "\'");