summaryrefslogtreecommitdiff
path: root/redfish-core/include
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-06-06 19:57:26 +0300
committerEd Tanous <ed@tanous.net>2022-06-30 21:48:06 +0300
commit4e23a444e8503fd03ab40de2844c783e142ebef8 (patch)
treef3d9d1fbe5dde9f0d5e1bc23bfb2ac326bf23a4f /redfish-core/include
parent69320d54efe41fa5b0947adab5702d9023cc1ee3 (diff)
downloadbmcweb-4e23a444e8503fd03ab40de2844c783e142ebef8.tar.xz
Require explicit decorator on one arg constructors
We essentially follow this rule already, not relying on implicit operators, although there are a number of cases where in theory we could've implicitly constructed an object. This commit enables the clang-tidy check. Tested: Code compiles, passes clang-tidy. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ia428463313b075c69614fdb326e8c5c094e7adde
Diffstat (limited to 'redfish-core/include')
-rw-r--r--redfish-core/include/event_service_manager.hpp3
-rw-r--r--redfish-core/include/privileges.hpp3
-rw-r--r--redfish-core/include/redfish.hpp2
-rw-r--r--redfish-core/include/server_sent_events.hpp3
4 files changed, 7 insertions, 4 deletions
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index 3c476988fd..1785828444 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -374,7 +374,8 @@ class Subscription : public persistent_data::UserSubscription
// Subscription constructor
}
- Subscription(const std::shared_ptr<boost::beast::tcp_stream>& adaptor) :
+ explicit Subscription(
+ const std::shared_ptr<boost::beast::tcp_stream>& adaptor) :
eventSeqNum(1)
{
sseConn = std::make_shared<crow::ServerSentEvents>(adaptor);
diff --git a/redfish-core/include/privileges.hpp b/redfish-core/include/privileges.hpp
index 160816fd93..f20cedee15 100644
--- a/redfish-core/include/privileges.hpp
+++ b/redfish-core/include/privileges.hpp
@@ -198,7 +198,8 @@ class Privileges
}
private:
- Privileges(const std::bitset<maxPrivilegeCount>& p) : privilegeBitset{p}
+ explicit Privileges(const std::bitset<maxPrivilegeCount>& p) :
+ privilegeBitset{p}
{}
std::bitset<maxPrivilegeCount> privilegeBitset = 0;
};
diff --git a/redfish-core/include/redfish.hpp b/redfish-core/include/redfish.hpp
index c961b2db05..8c05dd7f86 100644
--- a/redfish-core/include/redfish.hpp
+++ b/redfish-core/include/redfish.hpp
@@ -62,7 +62,7 @@ class RedfishService
*
* @param[in] app Crow app on which Redfish will initialize
*/
- RedfishService(App& app)
+ explicit RedfishService(App& app)
{
requestAccountServiceRoutes(app);
requestRoutesRoles(app);
diff --git a/redfish-core/include/server_sent_events.hpp b/redfish-core/include/server_sent_events.hpp
index 6663f66c61..16d8e186d8 100644
--- a/redfish-core/include/server_sent_events.hpp
+++ b/redfish-core/include/server_sent_events.hpp
@@ -256,7 +256,8 @@ class ServerSentEvents : public std::enable_shared_from_this<ServerSentEvents>
ServerSentEvents(ServerSentEvents&&) = delete;
ServerSentEvents& operator=(ServerSentEvents&&) = delete;
- ServerSentEvents(const std::shared_ptr<boost::beast::tcp_stream>& adaptor) :
+ explicit ServerSentEvents(
+ const std::shared_ptr<boost::beast::tcp_stream>& adaptor) :
sseConn(adaptor)
{
startSSE();