Skip to content

Commit e6161b7

Browse files
committed
auth/Auth.h: mark constructor as explicit
Fix for cppcheck warning: Struct 'AuthAuthorizer' has a constructor with 1 argument that is not explicit. Such constructors should in general be explicit for type safety reasons. Using the explicit keyword in the constructor means some mistakes when using the class can be avoided. For more information check: http://www.tantalon.com/pete/cppopt/asyougo.htm#UseExplicitConstructors Signed-off-by: Danny Al-Gaaf <[email protected]>
1 parent 9921836 commit e6161b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/auth/Auth.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ struct AuthAuthorizer {
136136
bufferlist bl;
137137
CryptoKey session_key;
138138

139-
AuthAuthorizer(__u32 p) : protocol(p) {}
139+
explicit AuthAuthorizer(__u32 p) : protocol(p) {}
140140
virtual ~AuthAuthorizer() {}
141141
virtual bool verify_reply(bufferlist::iterator& reply) = 0;
142142
};

0 commit comments

Comments
 (0)