Enable unused variable warnings and resolve
This commit enables the "unused variables" warning in clang. Throughout
this, it did point out several issues that would've been functional
bugs, so I think it was worthwhile. It also cleaned up several unused
variable from old constructs that no longer exist.
Tested:
Built with clang. Code no longer emits warnings.
Downloaded bmcweb to system and pulled up the webui, observed webui
loads and logs in properly.
Change-Id: I51505f4222cc147d6f2b87b14d7e2ac4a74cafa8
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/redfish-core/lib/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp
index e237fd3..35c60b1 100644
--- a/redfish-core/lib/certificate_service.hpp
+++ b/redfish-core/lib/certificate_service.hpp
@@ -68,8 +68,8 @@
}
private:
- void doGet(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ void doGet(crow::Response& res, const crow::Request&,
+ const std::vector<std::string>&) override
{
res.jsonValue = {
{"@odata.type", "#CertificateService.v1_0_0.CertificateService"},
@@ -261,7 +261,7 @@
private:
void doPost(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ const std::vector<std::string>&) override
{
static const int RSA_KEY_BIT_LENGTH = 2048;
auto asyncResp = std::make_shared<AsyncResp>(res);
@@ -479,7 +479,7 @@
});
crow::connections::systemBus->async_method_call(
[asyncResp](const boost::system::error_code& ec,
- const std::string& path) {
+ const std::string&) {
if (ec)
{
BMCWEB_LOG_ERROR << "DBUS response error: " << ec.message();
@@ -699,7 +699,7 @@
private:
void doPost(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ const std::vector<std::string>&) override
{
std::string certificate;
nlohmann::json certificateUri;
@@ -866,8 +866,8 @@
{boost::beast::http::verb::delete_, {{"ConfigureComponents"}}},
{boost::beast::http::verb::post, {{"ConfigureComponents"}}}};
}
- void doGet(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ void doGet(crow::Response& res, const crow::Request&,
+ const std::vector<std::string>&) override
{
res.jsonValue = {
{"@odata.id",
@@ -907,7 +907,7 @@
}
void doPost(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ const std::vector<std::string>&) override
{
BMCWEB_LOG_DEBUG << "HTTPSCertificateCollection::doPost";
auto asyncResp = std::make_shared<AsyncResp>(res);
@@ -978,8 +978,8 @@
}
private:
- void doGet(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ void doGet(crow::Response& res, const crow::Request&,
+ const std::vector<std::string>&) override
{
res.jsonValue = {
{"@odata.id",
@@ -1066,8 +1066,8 @@
{boost::beast::http::verb::delete_, {{"ConfigureComponents"}}},
{boost::beast::http::verb::post, {{"ConfigureComponents"}}}};
}
- void doGet(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ void doGet(crow::Response& res, const crow::Request&,
+ const std::vector<std::string>&) override
{
res.jsonValue = {
{"@odata.id", "/redfish/v1/AccountService/LDAP/Certificates"},
@@ -1105,7 +1105,7 @@
}
void doPost(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ const std::vector<std::string>&) override
{
auto asyncResp = std::make_shared<AsyncResp>(res);
std::string certFileBody = getCertificateFromReqBody(asyncResp, req);
@@ -1172,7 +1172,7 @@
}
void doGet(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ const std::vector<std::string>&) override
{
auto asyncResp = std::make_shared<AsyncResp>(res);
long id = getIDFromURL(req.url);
@@ -1209,8 +1209,8 @@
{boost::beast::http::verb::delete_, {{"ConfigureComponents"}}},
{boost::beast::http::verb::post, {{"ConfigureComponents"}}}};
}
- void doGet(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ void doGet(crow::Response& res, const crow::Request&,
+ const std::vector<std::string>&) override
{
res.jsonValue = {
{"@odata.id", "/redfish/v1/Managers/bmc/Truststore/Certificates/"},
@@ -1249,7 +1249,7 @@
}
void doPost(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ const std::vector<std::string>&) override
{
auto asyncResp = std::make_shared<AsyncResp>(res);
std::string certFileBody = getCertificateFromReqBody(asyncResp, req);
@@ -1316,7 +1316,7 @@
}
void doGet(crow::Response& res, const crow::Request& req,
- const std::vector<std::string>& params) override
+ const std::vector<std::string>&) override
{
auto asyncResp = std::make_shared<AsyncResp>(res);
long id = getIDFromURL(req.url);