Apply clang-tidy fix 'modernize-return-braced-init-list'

This commit is contained in:
Gunnar Beutner 2018-01-04 09:28:24 +01:00
parent e0c350b8a5
commit e0174b8f3f
6 changed files with 7 additions and 7 deletions

View File

@ -58,7 +58,7 @@ int ObjectType::GetFieldId(const String& name) const
Field ObjectType::GetFieldInfo(int id) const Field ObjectType::GetFieldInfo(int id) const
{ {
if (id == 0) if (id == 0)
return Field(1, "String", "type", nullptr, nullptr, 0, 0); return {1, "String", "type", nullptr, nullptr, 0, 0};
else else
BOOST_THROW_EXCEPTION(std::runtime_error("Invalid field ID.")); BOOST_THROW_EXCEPTION(std::runtime_error("Invalid field ID."));
} }

View File

@ -201,7 +201,7 @@ Field TypeType::GetFieldInfo(int id) const
return GetBaseType()->GetFieldInfo(id); return GetBaseType()->GetFieldInfo(id);
if (real_id == 0) if (real_id == 0)
return Field(0, "String", "name", "", nullptr, 0, 0); return {0, "String", "name", "", nullptr, 0, 0};
else if (real_id == 1) else if (real_id == 1)
return Field(1, "Object", "prototype", "", nullptr, 0, 0); return Field(1, "Object", "prototype", "", nullptr, 0, 0);
else if (real_id == 2) else if (real_id == 2)

View File

@ -296,7 +296,7 @@ DbReference DbConnection::GetObjectID(const DbObject::Ptr& dbobj) const
auto it = m_ObjectIDs.find(dbobj); auto it = m_ObjectIDs.find(dbobj);
if (it == m_ObjectIDs.end()) if (it == m_ObjectIDs.end())
return DbReference(); return {};
return it->second; return it->second;
} }
@ -325,7 +325,7 @@ DbReference DbConnection::GetInsertID(const DbObject::Ptr& dbobj) const
DbReference DbConnection::GetInsertID(const DbType::Ptr& type, const DbReference& objid) const DbReference DbConnection::GetInsertID(const DbType::Ptr& type, const DbReference& objid) const
{ {
if (!objid.IsValid()) if (!objid.IsValid())
return DbReference(); return {};
auto it = m_InsertIDs.find(std::make_pair(type, objid)); auto it = m_InsertIDs.find(std::make_pair(type, objid));

View File

@ -654,7 +654,7 @@ DbReference IdoMysqlConnection::GetLastInsertID()
{ {
AssertOnWorkQueue(); AssertOnWorkQueue();
return DbReference(m_Mysql->insert_id(&m_Connection)); return {m_Mysql->insert_id(&m_Connection)};
} }
int IdoMysqlConnection::GetAffectedRows() int IdoMysqlConnection::GetAffectedRows()

View File

@ -498,7 +498,7 @@ DbReference IdoPgsqlConnection::GetSequenceValue(const String& table, const Stri
Log(LogDebug, "IdoPgsqlConnection") Log(LogDebug, "IdoPgsqlConnection")
<< "Sequence Value: " << row->Get("id"); << "Sequence Value: " << row->Get("id");
return DbReference(Convert::ToLong(row->Get("id"))); return {Convert::ToLong(row->Get("id"))};
} }
int IdoPgsqlConnection::GetAffectedRows() int IdoPgsqlConnection::GetAffectedRows()

View File

@ -359,7 +359,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
nameref = "nullptr"; nameref = "nullptr";
m_Impl << "\t\t" << "case " << num << ":" << std::endl m_Impl << "\t\t" << "case " << num << ":" << std::endl
<< "\t\t\t" << "return Field(" << num << ", \"" << ftype << "\", \"" << field.Name << "\", \"" << (field.NavigationName.empty() ? field.Name : field.NavigationName) << "\", " << nameref << ", " << field.Attributes << ", " << field.Type.ArrayRank << ");" << std::endl; << "\t\t\t" << "return {" << num << ", \"" << ftype << "\", \"" << field.Name << "\", \"" << (field.NavigationName.empty() ? field.Name : field.NavigationName) << "\", " << nameref << ", " << field.Attributes << ", " << field.Type.ArrayRank << "};" << std::endl;
num++; num++;
} }