summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-07-06 22:14:44 +0300
committerEd Tanous <ed@tanous.net>2023-07-10 22:53:34 +0300
commitd9fcfcc174eb0e195105f3ba2e95456db29a4132 (patch)
tree7042174e240055a0a6c293bf09cbfe6556704069
parentdfb2b40839d6cd6b96e4d891c46d964c8f2c930b (diff)
downloadbmcweb-d9fcfcc174eb0e195105f3ba2e95456db29a4132.tar.xz
Tidy enable modernize-redundant-void-arg
We have places where we explicitly set something to the pattern of method(void) This is no longer necessary to declare, so fix the places where we do it to make the codebase consistent, and enable the check. Tested: Clang-tidy passes. Change-Id: I3ef03fc07d65b656fecbcfea638dd12ba95f22e0 Signed-off-by: Ed Tanous <edtanous@google.com>
-rw-r--r--.clang-tidy1
-rw-r--r--redfish-core/src/error_messages.cpp66
2 files changed, 34 insertions, 33 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 4e09243ee4..0d22df70ef 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -238,6 +238,7 @@ modernize-loop-convert,
modernize-make-shared,
modernize-make-unique,
modernize-raw-string-literal,
+modernize-redundant-void-arg,
modernize-replace-auto-ptr,
modernize-replace-random-shuffle,
modernize-return-braced-init-list,
diff --git a/redfish-core/src/error_messages.cpp b/redfish-core/src/error_messages.cpp
index 7d1f3a94f9..85aab34530 100644
--- a/redfish-core/src/error_messages.cpp
+++ b/redfish-core/src/error_messages.cpp
@@ -168,7 +168,7 @@ static nlohmann::json getLog(redfish::registries::base::Index name,
* See header file for more information
* @endinternal
*/
-nlohmann::json resourceInUse(void)
+nlohmann::json resourceInUse()
{
return getLog(redfish::registries::base::Index::resourceInUse, {});
}
@@ -186,7 +186,7 @@ void resourceInUse(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json malformedJSON(void)
+nlohmann::json malformedJSON()
{
return getLog(redfish::registries::base::Index::malformedJSON, {});
}
@@ -275,7 +275,7 @@ void actionParameterValueNotInList(crow::Response& res, std::string_view arg1,
* See header file for more information
* @endinternal
*/
-nlohmann::json internalError(void)
+nlohmann::json internalError()
{
return getLog(redfish::registries::base::Index::internalError, {});
}
@@ -296,7 +296,7 @@ void internalError(crow::Response& res, const std::source_location location)
* See header file for more information
* @endinternal
*/
-nlohmann::json unrecognizedRequestBody(void)
+nlohmann::json unrecognizedRequestBody()
{
return getLog(redfish::registries::base::Index::unrecognizedRequestBody,
{});
@@ -357,7 +357,7 @@ void actionParameterUnknown(crow::Response& res, std::string_view arg1,
* See header file for more information
* @endinternal
*/
-nlohmann::json resourceCannotBeDeleted(void)
+nlohmann::json resourceCannotBeDeleted()
{
return getLog(redfish::registries::base::Index::resourceCannotBeDeleted,
{});
@@ -439,7 +439,7 @@ void resourceAlreadyExists(crow::Response& res, std::string_view arg1,
* See header file for more information
* @endinternal
*/
-nlohmann::json accountForSessionNoLongerExists(void)
+nlohmann::json accountForSessionNoLongerExists()
{
return getLog(
redfish::registries::base::Index::accountForSessionNoLongerExists, {});
@@ -592,7 +592,7 @@ void serviceDisabled(crow::Response& res, std::string_view arg1)
* See header file for more information
* @endinternal
*/
-nlohmann::json serviceInUnknownState(void)
+nlohmann::json serviceInUnknownState()
{
return getLog(redfish::registries::base::Index::serviceInUnknownState, {});
}
@@ -610,7 +610,7 @@ void serviceInUnknownState(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json eventSubscriptionLimitExceeded(void)
+nlohmann::json eventSubscriptionLimitExceeded()
{
return getLog(
redfish::registries::base::Index::eventSubscriptionLimitExceeded, {});
@@ -670,7 +670,7 @@ void stringValueTooLong(crow::Response& res, std::string_view arg1, int arg2)
* See header file for more information
* @endinternal
*/
-nlohmann::json sessionTerminated(void)
+nlohmann::json sessionTerminated()
{
return getLog(redfish::registries::base::Index::sessionTerminated, {});
}
@@ -688,7 +688,7 @@ void sessionTerminated(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json subscriptionTerminated(void)
+nlohmann::json subscriptionTerminated()
{
return getLog(redfish::registries::base::Index::subscriptionTerminated, {});
}
@@ -903,7 +903,7 @@ void resourceCreationConflict(crow::Response& res, boost::urls::url_view arg1)
* See header file for more information
* @endinternal
*/
-nlohmann::json maximumErrorsExceeded(void)
+nlohmann::json maximumErrorsExceeded()
{
return getLog(redfish::registries::base::Index::maximumErrorsExceeded, {});
}
@@ -921,7 +921,7 @@ void maximumErrorsExceeded(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json preconditionFailed(void)
+nlohmann::json preconditionFailed()
{
return getLog(redfish::registries::base::Index::preconditionFailed, {});
}
@@ -939,7 +939,7 @@ void preconditionFailed(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json preconditionRequired(void)
+nlohmann::json preconditionRequired()
{
return getLog(redfish::registries::base::Index::preconditionRequired, {});
}
@@ -957,7 +957,7 @@ void preconditionRequired(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json operationFailed(void)
+nlohmann::json operationFailed()
{
return getLog(redfish::registries::base::Index::operationFailed, {});
}
@@ -975,7 +975,7 @@ void operationFailed(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json operationTimeout(void)
+nlohmann::json operationTimeout()
{
return getLog(redfish::registries::base::Index::operationTimeout, {});
}
@@ -1103,7 +1103,7 @@ void queryParameterValueTypeError(crow::Response& res,
* See header file for more information
* @endinternal
*/
-nlohmann::json serviceShuttingDown(void)
+nlohmann::json serviceShuttingDown()
{
return getLog(redfish::registries::base::Index::serviceShuttingDown, {});
}
@@ -1207,7 +1207,7 @@ void strictAccountTypes(crow::Response& res, std::string_view arg1)
* See header file for more information
* @endinternal
*/
-nlohmann::json accountRemoved(void)
+nlohmann::json accountRemoved()
{
return getLog(redfish::registries::base::Index::accountRemoved, {});
}
@@ -1244,7 +1244,7 @@ void accessDenied(crow::Response& res, boost::urls::url_view arg1)
* See header file for more information
* @endinternal
*/
-nlohmann::json queryNotSupported(void)
+nlohmann::json queryNotSupported()
{
return getLog(redfish::registries::base::Index::queryNotSupported, {});
}
@@ -1262,7 +1262,7 @@ void queryNotSupported(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json createLimitReachedForResource(void)
+nlohmann::json createLimitReachedForResource()
{
return getLog(
redfish::registries::base::Index::createLimitReachedForResource, {});
@@ -1281,7 +1281,7 @@ void createLimitReachedForResource(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json generalError(void)
+nlohmann::json generalError()
{
return getLog(redfish::registries::base::Index::generalError, {});
}
@@ -1299,7 +1299,7 @@ void generalError(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json success(void)
+nlohmann::json success()
{
return getLog(redfish::registries::base::Index::success, {});
}
@@ -1318,7 +1318,7 @@ void success(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json created(void)
+nlohmann::json created()
{
return getLog(redfish::registries::base::Index::created, {});
}
@@ -1336,7 +1336,7 @@ void created(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json noOperation(void)
+nlohmann::json noOperation()
{
return getLog(redfish::registries::base::Index::noOperation, {});
}
@@ -1374,7 +1374,7 @@ void propertyUnknown(crow::Response& res, std::string_view arg1)
* See header file for more information
* @endinternal
*/
-nlohmann::json noValidSession(void)
+nlohmann::json noValidSession()
{
return getLog(redfish::registries::base::Index::noValidSession, {});
}
@@ -1411,7 +1411,7 @@ void invalidObject(crow::Response& res, boost::urls::url_view arg1)
* See header file for more information
* @endinternal
*/
-nlohmann::json resourceInStandby(void)
+nlohmann::json resourceInStandby()
{
return getLog(redfish::registries::base::Index::resourceInStandby, {});
}
@@ -1456,7 +1456,7 @@ void actionParameterValueTypeError(crow::Response& res,
* See header file for more information
* @endinternal
*/
-nlohmann::json sessionLimitExceeded(void)
+nlohmann::json sessionLimitExceeded()
{
return getLog(redfish::registries::base::Index::sessionLimitExceeded, {});
}
@@ -1513,7 +1513,7 @@ void invalidIndex(crow::Response& res, int64_t arg1)
* See header file for more information
* @endinternal
*/
-nlohmann::json emptyJSON(void)
+nlohmann::json emptyJSON()
{
return getLog(redfish::registries::base::Index::emptyJSON, {});
}
@@ -1531,7 +1531,7 @@ void emptyJSON(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json queryNotSupportedOnResource(void)
+nlohmann::json queryNotSupportedOnResource()
{
return getLog(redfish::registries::base::Index::queryNotSupportedOnResource,
{});
@@ -1550,7 +1550,7 @@ void queryNotSupportedOnResource(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json queryNotSupportedOnOperation(void)
+nlohmann::json queryNotSupportedOnOperation()
{
return getLog(
redfish::registries::base::Index::queryNotSupportedOnOperation, {});
@@ -1569,7 +1569,7 @@ void queryNotSupportedOnOperation(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json queryCombinationInvalid(void)
+nlohmann::json queryCombinationInvalid()
{
return getLog(redfish::registries::base::Index::queryCombinationInvalid,
{});
@@ -1588,7 +1588,7 @@ void queryCombinationInvalid(crow::Response& res)
* See header file for more information
* @endinternal
*/
-nlohmann::json insufficientPrivilege(void)
+nlohmann::json insufficientPrivilege()
{
return getLog(redfish::registries::base::Index::insufficientPrivilege, {});
}
@@ -1629,7 +1629,7 @@ void propertyValueModified(crow::Response& res, std::string_view arg1,
* See header file for more information
* @endinternal
*/
-nlohmann::json accountNotModified(void)
+nlohmann::json accountNotModified()
{
return getLog(redfish::registries::base::Index::accountNotModified, {});
}
@@ -1712,7 +1712,7 @@ void resourceExhaustion(crow::Response& res, std::string_view arg1)
* See header file for more information
* @endinternal
*/
-nlohmann::json accountModified(void)
+nlohmann::json accountModified()
{
return getLog(redfish::registries::base::Index::accountModified, {});
}