Fix naming conventions
Lots of code has been checked in that doesn't match the naming
conventions. Lets fix that.
Tested:
Code compiles. Variable/function renames only.
Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I6bd107811d0b724f1fad990016113cdf035b604b
diff --git a/include/json_html_serializer.hpp b/include/json_html_serializer.hpp
index 174b086..f8248c8 100644
--- a/include/json_html_serializer.hpp
+++ b/include/json_html_serializer.hpp
@@ -56,7 +56,7 @@
std::size_t bytes = 0; // number of bytes written to string_buffer
// number of bytes written at the point of the last valid byte
- std::size_t bytes_after_last_accept = 0;
+ std::size_t bytesAfterLastAccept = 0;
std::size_t undumpedChars = 0;
for (std::size_t i = 0; i < str.size(); ++i)
@@ -198,7 +198,7 @@
}
// remember the byte position of this accept
- bytes_after_last_accept = bytes;
+ bytesAfterLastAccept = bytes;
undumpedChars = 0;
break;
}
@@ -216,7 +216,7 @@
// reset length buffer to the last accepted index;
// thus removing/ignoring the invalid characters
- bytes = bytes_after_last_accept;
+ bytes = bytesAfterLastAccept;
stringBuffer[bytes++] = '\\';
stringBuffer[bytes++] = 'u';
@@ -225,7 +225,7 @@
stringBuffer[bytes++] = 'f';
stringBuffer[bytes++] = 'd';
- bytes_after_last_accept = bytes;
+ bytesAfterLastAccept = bytes;
undumpedChars = 0;
@@ -256,34 +256,34 @@
else
{
// write all accepted bytes
- out.append(stringBuffer.data(), bytes_after_last_accept);
+ out.append(stringBuffer.data(), bytesAfterLastAccept);
out += "\\ufffd";
}
}
inline unsigned int countDigits(uint64_t number) noexcept
{
- unsigned int n_digits = 1;
+ unsigned int nDigits = 1;
for (;;)
{
if (number < 10)
{
- return n_digits;
+ return nDigits;
}
if (number < 100)
{
- return n_digits + 1;
+ return nDigits + 1;
}
if (number < 1000)
{
- return n_digits + 2;
+ return nDigits + 2;
}
if (number < 10000)
{
- return n_digits + 3;
+ return nDigits + 3;
}
number = number / 10000u;
- n_digits += 4;
+ nDigits += 4;
}
}
@@ -295,7 +295,7 @@
{
std::array<char, 64> numberbuffer{{}};
- static constexpr std::array<std::array<char, 2>, 100> digits_to_99{{
+ static constexpr std::array<std::array<char, 2>, 100> digitsTo99{{
{'0', '0'}, {'0', '1'}, {'0', '2'}, {'0', '3'}, {'0', '4'}, {'0', '5'},
{'0', '6'}, {'0', '7'}, {'0', '8'}, {'0', '9'}, {'1', '0'}, {'1', '1'},
{'1', '2'}, {'1', '3'}, {'1', '4'}, {'1', '5'}, {'1', '6'}, {'1', '7'},
@@ -361,15 +361,15 @@
{
const auto digitsIndex = static_cast<unsigned>((absValue % 100));
absValue /= 100;
- *(--bufferPtr) = digits_to_99[digitsIndex][1];
- *(--bufferPtr) = digits_to_99[digitsIndex][0];
+ *(--bufferPtr) = digitsTo99[digitsIndex][1];
+ *(--bufferPtr) = digitsTo99[digitsIndex][0];
}
if (absValue >= 10)
{
const auto digitsIndex = static_cast<unsigned>(absValue);
- *(--bufferPtr) = digits_to_99[digitsIndex][1];
- *(--bufferPtr) = digits_to_99[digitsIndex][0];
+ *(--bufferPtr) = digitsTo99[digitsIndex][1];
+ *(--bufferPtr) = digitsTo99[digitsIndex][0];
}
else
{