Prepare for clang-tidy-14
clang-tidy 14 now detects some more stuff that it couldn't before.
These are all pretty reasonable and things that we enforce today.
All changes were made by the robot.
Tested: Code compiles and unit tests pass.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I880d714c97adc38a190472766fb922fbfb30e82a
diff --git a/include/kvm_websocket.hpp b/include/kvm_websocket.hpp
index 51246aa..d45d414 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.getIoContext()), doingWrite(false)
+ conn(connIn), hostSocket(conn.getIoContext())
{
boost::asio::ip::tcp::endpoint endpoint(
boost::asio::ip::make_address("127.0.0.1"), 5900);
@@ -147,7 +147,7 @@
boost::asio::ip::tcp::socket hostSocket;
boost::beast::flat_static_buffer<1024UL * 50UL> outputBuffer;
boost::beast::flat_static_buffer<1024UL> inputBuffer;
- bool doingWrite;
+ bool doingWrite{false};
};
static boost::container::flat_map<crow::websocket::Connection*,
diff --git a/include/vm_websocket.hpp b/include/vm_websocket.hpp
index 6b7d9e7..5adf303 100644
--- a/include/vm_websocket.hpp
+++ b/include/vm_websocket.hpp
@@ -25,7 +25,7 @@
{
public:
Handler(const std::string& mediaIn, boost::asio::io_context& ios) :
- pipeOut(ios), pipeIn(ios), media(mediaIn), doingWrite(false),
+ pipeOut(ios), pipeIn(ios), media(mediaIn),
outputBuffer(new boost::beast::flat_static_buffer<nbdBufferSize>),
inputBuffer(new boost::beast::flat_static_buffer<nbdBufferSize>)
{}
@@ -150,7 +150,7 @@
boost::process::async_pipe pipeIn;
boost::process::child proxy;
std::string media;
- bool doingWrite;
+ bool doingWrite{false};
std::unique_ptr<boost::beast::flat_static_buffer<nbdBufferSize>>
outputBuffer;
diff --git a/redfish-core/include/server_sent_events.hpp b/redfish-core/include/server_sent_events.hpp
index 79703f0..13840d3 100644
--- a/redfish-core/include/server_sent_events.hpp
+++ b/redfish-core/include/server_sent_events.hpp
@@ -52,9 +52,9 @@
std::shared_ptr<boost::beast::tcp_stream> sseConn;
std::queue<std::pair<uint64_t, std::string>> requestDataQueue;
std::string outBuffer;
- SseConnState state;
- int retryCount;
- int maxRetryAttempts;
+ SseConnState state{SseConnState::startInit};
+ int retryCount{0};
+ int maxRetryAttempts{5};
void sendEvent(const std::string& id, const std::string& msg)
{
@@ -257,8 +257,7 @@
ServerSentEvents& operator=(ServerSentEvents&&) = delete;
ServerSentEvents(const std::shared_ptr<boost::beast::tcp_stream>& adaptor) :
- sseConn(adaptor), state(SseConnState::startInit), retryCount(0),
- maxRetryAttempts(5)
+ sseConn(adaptor)
{
startSSE();
}
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index cc2ee57..6770c48 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -2081,7 +2081,8 @@
if (ipv6StaticAddresses)
{
- nlohmann::json ipv6Static = *ipv6StaticAddresses;
+ const nlohmann::json& ipv6Static =
+ *ipv6StaticAddresses;
handleIPv6StaticAddressesPatch(ifaceId, ipv6Static,
ipv6Data, asyncResp);
}