bmcweb: Fix a bunch of warnings
bmcweb classically has not taken a strong opinion on warnings. With
this commit, that policy is changing, and bmcweb will invoke the best
warnings we are able to enable, and turn on -Werror for all builds.
This is intended to reduce the likelihood of hard-to-debug situations
that the compiler coulve caught early on.
Change-Id: I57474410821e82666b3a108cfd0db7d070e8900a
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/redfish-core/include/privileges.hpp b/redfish-core/include/privileges.hpp
index 3b20c9f..15e1af4 100644
--- a/redfish-core/include/privileges.hpp
+++ b/redfish-core/include/privileges.hpp
@@ -34,10 +34,10 @@
"Login", "ConfigureManager", "ConfigureComponents", "ConfigureSelf",
"ConfigureUsers"};
-constexpr const int basePrivilegeCount = basePrivileges.size();
+constexpr const size_t basePrivilegeCount = basePrivileges.size();
/** @brief Max number of privileges per type */
-constexpr const int maxPrivilegeCount = 32;
+constexpr const size_t maxPrivilegeCount = 32;
/** @brief A vector of all privilege names and their indexes */
static const std::vector<std::string> privilegeNames{basePrivileges.begin(),
@@ -96,7 +96,7 @@
*/
bool setSinglePrivilege(const char* privilege)
{
- for (int searchIndex = 0; searchIndex < privilegeNames.size();
+ for (size_t searchIndex = 0; searchIndex < privilegeNames.size();
searchIndex++)
{
if (privilege == privilegeNames[searchIndex])
@@ -136,8 +136,8 @@
{
std::vector<const std::string*> activePrivileges;
- int searchIndex = 0;
- int endIndex = basePrivilegeCount;
+ size_t searchIndex = 0;
+ size_t endIndex = basePrivilegeCount;
if (type == PrivilegeType::OEM)
{
searchIndex = basePrivilegeCount - 1;