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 032f2f9267b0b19cc5c9c9cc8a9e54ec9a0d455c..d285b5d14046d939016e8c07ccd6642266f26e5e 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 1b45839b7330eb0dd446da015f765018dd9d74fd..b85c49263d3216e48a5a61cc392ff124709cada6 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 ad0ef12ba7ab6bee0c15b659a896219737dfd129..4642b749c5bd14aa953a13439f678daccbc35097 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 b51439e6b72ea4fa97bdc12ce2a45df2b65fb89b..627ed8581c2b3fc0664ed81c9f222ffb05e02c09 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 287fbf612c3be8d8a7e25cd63baa29d87b452c70..8c7775585a4f77c04053a8bccfa086dc5af794a1 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 668786ee096de7bdf691f097547b7ef4f99e6feb..713e95269a9f5bfdbb09f9c856c5ff6f78ed53ba 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 be7e2e026deee3b8bd01649383da58f1e7ee637e..9efb33092b7e82668de55b41018f5839c6e66cb1 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 b06a3acd11740d8a5b288ed11e008dc3eeeac9c8..6817632d8c1075d575d12c9b9cd4b110a8a90c55 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 fa42c369fc0aca19dff6ef6b3832589c65d2311c..47ecbeffa2aa99509fce47ebb5b1e6ffa4b439a4 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 4b71217c472ad72e503fcc6921d6651b81bc0861..502930676af153f51146ede5bb5e149cde4e9d40 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 bb1eb357aa1590f0ea10ee08719d6307c73b7b41..bbf74769a8e7db7ffe4183c0e50534666de12b1f 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();