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/account_service.hpp b/redfish-core/lib/account_service.hpp
index b8517b4..fae181c 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -965,8 +965,6 @@
 
     void handleLDAPPatch(nlohmann::json& input,
                          const std::shared_ptr<AsyncResp>& asyncResp,
-                         const crow::Request& req,
-                         const std::vector<std::string>& params,
                          const std::string& serverType)
     {
         std::string dbusObjectPath;
@@ -978,6 +976,10 @@
         {
             dbusObjectPath = ldapConfigObjectName;
         }
+        else
+        {
+            return;
+        }
 
         std::optional<nlohmann::json> authentication;
         std::optional<nlohmann::json> ldapService;
@@ -1121,8 +1123,8 @@
         });
     }
 
-    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
     {
         const persistent_data::AuthConfigMethods& authMethodsConfig =
             persistent_data::SessionStore::getInstance().getAuthMethodsConfig();
@@ -1210,6 +1212,10 @@
 
         auto callback = [asyncResp](bool success, LDAPConfigData& confData,
                                     const std::string& ldapType) {
+            if (!success)
+            {
+                return;
+            }
             parseLDAPConfigData(asyncResp->res.jsonValue, confData, ldapType);
         };
 
@@ -1218,7 +1224,7 @@
     }
 
     void doPatch(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);
 
@@ -1252,7 +1258,7 @@
 
         if (ldapObject)
         {
-            handleLDAPPatch(*ldapObject, asyncResp, req, params, "LDAP");
+            handleLDAPPatch(*ldapObject, asyncResp, "LDAP");
         }
 
         if (std::optional<nlohmann::json> oemOpenBMCObject;
@@ -1273,7 +1279,7 @@
 
         if (activeDirectoryObject)
         {
-            handleLDAPPatch(*activeDirectoryObject, asyncResp, req, params,
+            handleLDAPPatch(*activeDirectoryObject, asyncResp,
                             "ActiveDirectory");
         }
 
@@ -1337,7 +1343,7 @@
 
   private:
     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);
         res.jsonValue = {{"@odata.id", "/redfish/v1/AccountService/Accounts"},
@@ -1393,7 +1399,7 @@
             "org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
     }
     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);
 
@@ -1886,7 +1892,7 @@
             });
     }
 
-    void doDelete(crow::Response& res, const crow::Request& req,
+    void doDelete(crow::Response& res, const crow::Request&,
                   const std::vector<std::string>& params) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);