Make some single arg constructors explicit 16/214616/4
authorKonrad Lipinski <k.lipinski2@samsung.com>
Tue, 24 Sep 2019 14:45:41 +0000 (16:45 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Thu, 26 Sep 2019 12:58:31 +0000 (12:58 +0000)
Change-Id: Id5023fef37dd0b84a83a90fb0a3c52b0be31974c

src/manager/client/client-common.h
src/manager/initial-values/BufferHandler.h
src/manager/service/db-crypto.h
src/manager/service/encryption-logic.h
src/manager/service/file-system.h
src/manager/service/key-provider.h
tests/DBFixture.h
tests/test_comm-manager.cpp
tests/test_safe-buffer.cpp
tests/test_xml-parser.cpp
tools/ckm_db_tool/db-crypto-ext.h

index 032f2f9..d285b5d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2000 - 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *  Copyright (c) 2000-2019 Samsung Electronics Co., Ltd. All rights reserved
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ namespace CKM {
 
 class AliasSupport {
 public:
-       AliasSupport(const Alias &alias);
+       explicit AliasSupport(const Alias &alias);
 
        const ClientId &getOwner() const;
        const Name &getName() const;
@@ -87,7 +87,7 @@ protected:
 
 class ServiceConnection {
 public:
-       ServiceConnection(const char *service_interface);
+       explicit ServiceConnection(const char *service_interface);
 
        // roundtrip: send and receive
        int processRequest(const CKM::RawBuffer &send_buf,
index 1b45839..b85c492 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2015 - 2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *  Copyright (c) 2015-2019 Samsung Electronics Co., Ltd. All rights reserved
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@ class BufferHandler : public XML::Parser::ElementHandler {
 public:
        typedef std::shared_ptr<BufferHandler> BufferHandlerPtr;
 
-       BufferHandler(EncodingType type);
+       explicit BufferHandler(EncodingType type);
        virtual ~BufferHandler();
 
        virtual void Start(const XML::Parser::Attributes &);
index ad0ef12..4642b74 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014-2019 Samsung Electronics Co., Ltd. All rights reserved
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -133,7 +133,7 @@ public:
 
        class Transaction {
        public:
-               Transaction(Crypto *db) : m_db(db), m_inTransaction(false)
+               explicit Transaction(Crypto *db) : m_db(db), m_inTransaction(false)
                {
                        if (!m_db->m_inUserTransaction) {
                                try {
index b51439e..627ed85 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *  Copyright (c) 2000-2019 Samsung Electronics Co., Ltd. All rights reserved
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ namespace CKM {
 
 class EncryptionLogic {
 public:
-       EncryptionLogic(IEncryptionService &service) : m_service(service) {}
+       explicit EncryptionLogic(IEncryptionService &service) : m_service(service) {}
        virtual ~EncryptionLogic() {}
 
        void Crypt(const CryptoRequest &request);
index 287fbf6..8c77755 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *  Copyright (c) 2000-2019 Samsung Electronics Co., Ltd. All rights reserved
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ typedef std::vector<uid_t> UidVector;
 
 class FileSystem {
 public:
-       FileSystem(uid_t uid);
+       explicit FileSystem(uid_t uid);
 
        std::string getDBPath() const;
 
index 668786e..713e952 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2014 - 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *  Copyright (c) 2014-2019 Samsung Electronics Co., Ltd. All rights reserved
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -98,7 +98,7 @@ private:
 class KeyAndInfoContainer {
 public:
        KeyAndInfoContainer();
-       KeyAndInfoContainer(const unsigned char *);
+       explicit KeyAndInfoContainer(const unsigned char *);
        KeyAndInfo &getKeyAndInfo();
        void setKeyInfoKeyLength(const unsigned int);
        void setKeyInfo(const KeyComponentsInfo *);
index be7e2e0..9efb330 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *  Copyright (c) 2016-2019 Samsung Electronics Co., Ltd. All rights reserved
  *
  *  Contact: Kyungwook Tak <k.tak@samsung.com>
  *
@@ -30,7 +30,7 @@
 class DBFixture {
 public:
        DBFixture();
-       DBFixture(const char *db_fname);
+       explicit DBFixture(const char *db_fname);
 
        constexpr static const char *m_default_name = "name";
        constexpr static const char *m_default_owner = "label";
index b06a3ac..6817632 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *  Copyright (c) 2000-2019 Samsung Electronics Co., Ltd. All rights reserved
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
 
 namespace {
 struct MessageA {
-       MessageA(int ai) : i(ai) {}
+       explicit MessageA(int ai) : i(ai) {}
        int i;
 };
 
 struct MessageB {
-       MessageB(char ac) : c(ac) {}
+       explicit MessageB(char ac) : c(ac) {}
        char c;
 };
 
 struct MessageC {
-       MessageC(const std::string &astr) : str(astr) {}
+       explicit MessageC(const std::string &astr) : str(astr) {}
        std::string str;
 };
 
index fa42c36..47ecbef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *  Copyright (c) 2016-2019 Samsung Electronics Co., Ltd. All rights reserved
  *
  *  Contact: Kyungwook Tak <k.tak@samsung.com>
  *
@@ -34,7 +34,7 @@ namespace {
 const size_t LEN = 100;
 
 struct Item {
-       Item(size_t a) : mA(a) {}
+       explicit Item(size_t a) : mA(a) {}
        ~Item() {}
 
        bool operator==(const size_t &other) const
index 4b71217..5029306 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *  Copyright (c) 2000-2019 Samsung Electronics Co., Ltd. All rights reserved
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -211,7 +211,7 @@ public:
                }
        };
 
-       StructureTest(const char *filename) : m_parser(filename), m_sum(0),
+       explicit StructureTest(const char *filename) : m_parser(filename), m_sum(0),
                m_expectedSum(0)
        {
                m_parser.RegisterErrorCb(StructureTest::Error);
index bb1eb35..bbf7476 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2017 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015-2019 Samsung Electronics Co., Ltd. All rights reserved
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@
 namespace CKM {
 namespace DB {
 struct CryptoExt : public Crypto {
-       CryptoExt(Crypto orig) : Crypto(std::move(orig)) {}
+       explicit CryptoExt(Crypto orig) : Crypto(std::move(orig)) {}
 
        SqlConnection::Output Execute(const std::string &cmd);
        RowVector getRows();