Enable -Wshadow and fix warnings
[platform/core/security/key-manager.git] / src / manager / service / db-crypto.cpp
index ceccd69..3502121 100644 (file)
@@ -264,8 +264,8 @@ bool Crypto::getDBVersion(int &schemaVersion)
        Transaction transaction(this);
 
        if (m_connection->CheckTableExist("SCHEMA_INFO")) {
-               SchemaInfo SchemaInfo(m_connection.get());
-               if (SchemaInfo.getVersionInfo(schemaVersion)) {
+               SchemaInfo info(m_connection.get());
+               if (info.getVersionInfo(schemaVersion)) {
                        LogDebug("Current DB version: " << schemaVersion);
                        return true;
                }
@@ -315,8 +315,8 @@ void Crypto::initDatabase()
                }
 
                // update DB version info
-               SchemaInfo SchemaInfo(m_connection.get());
-               SchemaInfo.setVersionInfo();
+               SchemaInfo info(m_connection.get());
+               info.setVersionInfo();
                transaction.commit();
        }
        return;
@@ -357,8 +357,8 @@ void Crypto::createDBSchema()
                                 "Can not create the database schema: no initialization script");
 
        m_connection->ExecCommand((*script).c_str());
-       SchemaInfo SchemaInfo(m_connection.get());
-       SchemaInfo.setVersionInfo();
+       SchemaInfo info(m_connection.get());
+       info.setVersionInfo();
        transaction.commit();
 }
 
@@ -618,14 +618,14 @@ void Crypto::getRows(
                         " name ", name, " with owner label ", owner);
 }
 
-void Crypto::listInfos(const ClientId &owner,
+void Crypto::listInfos(const ClientId &accessor,
                                           AliasInfoVector &aliasInfoVector,
                                           DataType type)
 {
-       listInfos(owner, aliasInfoVector, type, type);
+       listInfos(accessor, aliasInfoVector, type, type);
 }
 
-void Crypto::listInfos(const ClientId &owner,
+void Crypto::listInfos(const ClientId &accessor,
                                           AliasInfoVector &aliasInfoVector,
                                           DataType typeRangeStart,
                                           DataType typeRangeStop)
@@ -636,9 +636,8 @@ void Crypto::listInfos(const ClientId &owner,
                        m_connection->PrepareDataCommand(DB_CMD_INFO_SELECT_BY_TYPE_AND_PERMISSION);
                selectCommand->BindInteger(1, typeRangeStart);
                selectCommand->BindInteger(2, typeRangeStop);
-               selectCommand->BindString(104, owner.c_str());
-               selectCommand->BindInteger(4,
-                                                                  static_cast<int>(Permission::READ | Permission::REMOVE));
+               selectCommand->BindString(104, accessor.c_str());
+               selectCommand->BindInteger(4, static_cast<int>(Permission::READ | Permission::REMOVE));
 
                while (selectCommand->Step()) {
                        ClientId owner = selectCommand->GetColumnString(0);
@@ -674,7 +673,7 @@ void Crypto::listInfos(const ClientId &owner,
                         "Couldn't list names of type <",
                         typeRangeStart, ",",
                         typeRangeStop, ">",
-                        " accessible to client ", owner);
+                        " accessible to client ", accessor);
 }
 
 void Crypto::saveKey(