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/dbus_monitor.hpp b/include/dbus_monitor.hpp
index 3f0b826..e177388 100644
--- a/include/dbus_monitor.hpp
+++ b/include/dbus_monitor.hpp
@@ -168,9 +168,9 @@
paths->size() *
(1U + interfaceCount));
}
- std::string object_manager_match_string;
- std::string properties_match_string;
- std::string object_manager_interfaces_match_string;
+ std::string objectManagerMatchString;
+ std::string propertiesMatchString;
+ std::string objectManagerInterfacesMatchString;
// These regexes derived on the rules here:
// https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names
std::regex validPath("^/([A-Za-z0-9_]+/?)*$");
@@ -193,7 +193,7 @@
conn.close();
return;
}
- properties_match_string =
+ propertiesMatchString =
("type='signal',"
"interface='org.freedesktop.DBus.Properties',"
"path_namespace='" +
@@ -205,12 +205,12 @@
if (thisSession.interfaces.size() == 0)
{
BMCWEB_LOG_DEBUG << "Creating match "
- << properties_match_string;
+ << propertiesMatchString;
thisSession.matches.emplace_back(
std::make_unique<sdbusplus::bus::match::match>(
*crow::connections::systemBus,
- properties_match_string, onPropertyUpdate, &conn));
+ propertiesMatchString, onPropertyUpdate, &conn));
}
else
{
@@ -225,9 +225,8 @@
conn.close();
return;
}
- std::string ifaceMatchString = properties_match_string +
- ",arg0='" + interface +
- "'";
+ std::string ifaceMatchString =
+ propertiesMatchString + ",arg0='" + interface + "'";
BMCWEB_LOG_DEBUG << "Creating match "
<< ifaceMatchString;
thisSession.matches.emplace_back(
@@ -236,7 +235,7 @@
onPropertyUpdate, &conn));
}
}
- object_manager_match_string =
+ objectManagerMatchString =
("type='signal',"
"interface='org.freedesktop.DBus.ObjectManager',"
"path_namespace='" +
@@ -244,11 +243,11 @@
"',"
"member='InterfacesAdded'");
BMCWEB_LOG_DEBUG << "Creating match "
- << object_manager_match_string;
+ << objectManagerMatchString;
thisSession.matches.emplace_back(
std::make_unique<sdbusplus::bus::match::match>(
- *crow::connections::systemBus,
- object_manager_match_string, onPropertyUpdate, &conn));
+ *crow::connections::systemBus, objectManagerMatchString,
+ onPropertyUpdate, &conn));
}
});
}
diff --git a/include/ibm/management_console_rest.hpp b/include/ibm/management_console_rest.hpp
index e789bda..c318cc6 100644
--- a/include/ibm/management_console_rest.hpp
+++ b/include/ibm/management_console_rest.hpp
@@ -144,7 +144,7 @@
res.jsonValue["Description"] = "File Updated";
redfish::EventServiceManager::getInstance().sendEvent(
- redfish::messages::ResourceChanged(), origin, "IBMConfigFile");
+ redfish::messages::resourceChanged(), origin, "IBMConfigFile");
}
else
{
@@ -152,7 +152,7 @@
res.jsonValue["Description"] = "File Created";
redfish::EventServiceManager::getInstance().sendEvent(
- redfish::messages::ResourceCreated(), origin, "IBMConfigFile");
+ redfish::messages::resourceCreated(), origin, "IBMConfigFile");
}
}
}
@@ -255,8 +255,8 @@
std::string filePath("/var/lib/obmc/bmc-console-mgmt/save-area/" + fileID);
BMCWEB_LOG_DEBUG << "Removing the file : " << filePath << "\n";
- std::ifstream file_open(filePath.c_str());
- if (static_cast<bool>(file_open))
+ std::ifstream fileOpen(filePath.c_str());
+ if (static_cast<bool>(fileOpen))
if (remove(filePath.c_str()) == 0)
{
BMCWEB_LOG_DEBUG << "File removed!\n";
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
{
diff --git a/include/kvm_websocket.hpp b/include/kvm_websocket.hpp
index df50778..fea3840 100644
--- a/include/kvm_websocket.hpp
+++ b/include/kvm_websocket.hpp
@@ -17,7 +17,7 @@
{
public:
explicit KvmSession(crow::websocket::Connection& connIn) :
- conn(connIn), hostSocket(conn.get_io_context()), doingWrite(false)
+ conn(connIn), hostSocket(conn.getIoContext()), doingWrite(false)
{
boost::asio::ip::tcp::endpoint endpoint(
boost::asio::ip::make_address("127.0.0.1"), 5900);
diff --git a/include/nbd_proxy.hpp b/include/nbd_proxy.hpp
index ee0d9cd..a7f8c6d 100644
--- a/include/nbd_proxy.hpp
+++ b/include/nbd_proxy.hpp
@@ -44,7 +44,7 @@
const std::string& endpointIdIn, const std::string& pathIn) :
socketId(socketIdIn),
endpointId(endpointIdIn), path(pathIn),
- acceptor(connIn.get_io_context(), stream_protocol::endpoint(socketId)),
+ acceptor(connIn.getIoContext(), stream_protocol::endpoint(socketId)),
connection(connIn)
{}
diff --git a/include/obmc_console.hpp b/include/obmc_console.hpp
index 29efbef..06df7fd 100644
--- a/include/obmc_console.hpp
+++ b/include/obmc_console.hpp
@@ -13,7 +13,7 @@
namespace obmc_console
{
-static std::unique_ptr<boost::asio::local::stream_protocol::socket> host_socket;
+static std::unique_ptr<boost::asio::local::stream_protocol::socket> hostSocket;
static std::array<char, 4096> outputBuffer;
static std::string inputBuffer;
@@ -37,7 +37,7 @@
}
doingWrite = true;
- host_socket->async_write_some(
+ hostSocket->async_write_some(
boost::asio::buffer(inputBuffer.data(), inputBuffer.size()),
[](boost::beast::error_code ec, std::size_t bytes_written) {
doingWrite = false;
@@ -63,7 +63,7 @@
inline void doRead()
{
BMCWEB_LOG_DEBUG << "Reading from socket";
- host_socket->async_read_some(
+ hostSocket->async_read_some(
boost::asio::buffer(outputBuffer.data(), outputBuffer.size()),
[](const boost::system::error_code& ec, std::size_t bytesRead) {
BMCWEB_LOG_DEBUG << "read done. Read " << bytesRead << " bytes";
@@ -112,15 +112,15 @@
BMCWEB_LOG_DEBUG << "Connection " << &conn << " opened";
sessions.insert(&conn);
- if (host_socket == nullptr)
+ if (hostSocket == nullptr)
{
const std::string consoleName("\0obmc-console", 13);
boost::asio::local::stream_protocol::endpoint ep(consoleName);
- host_socket = std::make_unique<
+ hostSocket = std::make_unique<
boost::asio::local::stream_protocol::socket>(
- conn.get_io_context());
- host_socket->async_connect(ep, connectHandler);
+ conn.getIoContext());
+ hostSocket->async_connect(ep, connectHandler);
}
})
.onclose([](crow::websocket::Connection& conn,
@@ -128,7 +128,7 @@
sessions.erase(&conn);
if (sessions.empty())
{
- host_socket = nullptr;
+ hostSocket = nullptr;
inputBuffer.clear();
inputBuffer.shrink_to_fit();
}
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index d66c5f1..f8d5d4a 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -821,17 +821,17 @@
{
return -1;
}
- const std::string& key_type = codes[0];
- const std::string& value_type = codes[1];
+ const std::string& keyType = codes[0];
+ const std::string& valueType = codes[1];
for (auto it : j->items())
{
- r = convertJsonToDbus(m, key_type, it.key());
+ r = convertJsonToDbus(m, keyType, it.key());
if (r < 0)
{
return r;
}
- r = convertJsonToDbus(m, value_type, it.value());
+ r = convertJsonToDbus(m, valueType, it.value());
if (r < 0)
{
return r;
diff --git a/include/vm_websocket.hpp b/include/vm_websocket.hpp
index da9a06f..8521993 100644
--- a/include/vm_websocket.hpp
+++ b/include/vm_websocket.hpp
@@ -180,7 +180,7 @@
// media is the last digit of the endpoint /vm/0/0. A future
// enhancement can include supporting different endpoint values.
const char* media = "0";
- handler = std::make_shared<Handler>(media, conn.get_io_context());
+ handler = std::make_shared<Handler>(media, conn.getIoContext());
handler->connect();
})
.onclose([](crow::websocket::Connection& conn,