Fix incorrect ctor order

This commit is contained in:
Kawe Mazidjatari 2023-04-08 17:45:21 +02:00
parent 7a4358800d
commit 23b2d0174a
2 changed files with 9 additions and 9 deletions

View File

@ -29,11 +29,11 @@ struct FactoryInfo_t
string m_szFactoryName;
string m_szFactoryVersion;
FactoryInfo_t() : m_szFactoryFullName(string()), m_szFactoryName(string()), m_szFactoryVersion(string()), m_pFactoryPtr(nullptr) {}
FactoryInfo_t(string factoryFullName, string factoryName, string factoryVersion, uintptr_t factoryPtr) :
m_szFactoryFullName(factoryFullName), m_szFactoryName(factoryName), m_szFactoryVersion(factoryVersion), m_pFactoryPtr(factoryPtr) {}
FactoryInfo_t(string factoryFullName, uintptr_t factoryPtr) :
m_szFactoryFullName(factoryFullName), m_szFactoryName(string()), m_szFactoryVersion(string()), m_pFactoryPtr(factoryPtr) {}
FactoryInfo_t() : m_pFactoryPtr(nullptr) {}
FactoryInfo_t(const uintptr_t factoryPtr, const string& factoryFullName, const string& factoryName, const string& factoryVersion) :
m_pFactoryPtr(factoryPtr), m_szFactoryFullName(factoryFullName), m_szFactoryName(factoryName), m_szFactoryVersion(factoryVersion) {}
FactoryInfo_t(const uintptr_t factoryPtr, const string& factoryFullName) :
m_pFactoryPtr(factoryPtr), m_szFactoryFullName(factoryFullName) {}
};
#endif // INTERFACE_H

View File

@ -15,8 +15,8 @@
void CFactory::AddFactory(const string& svFactoryName, void* pFactory)
{
size_t nVersionIndex = GetVersionIndex(svFactoryName);
FactoryInfo_t factoryInfo = FactoryInfo_t(svFactoryName, svFactoryName.substr(0, nVersionIndex),
svFactoryName.substr(nVersionIndex), reinterpret_cast<uintptr_t>(pFactory));
FactoryInfo_t factoryInfo(reinterpret_cast<uintptr_t>(pFactory), svFactoryName,
svFactoryName.substr(0, nVersionIndex), svFactoryName.substr(nVersionIndex));
m_vFactories.push_back(factoryInfo); // Push factory info back into the vector.
}
@ -61,8 +61,8 @@ void CFactory::GetFactoriesFromRegister(void)
size_t nVersionIndex = GetVersionIndex(svInterfaceName);
// Push back the interface.
AddFactory(FactoryInfo_t(svInterfaceName, svInterfaceName.substr(0, nVersionIndex),
svInterfaceName.substr(nVersionIndex), reinterpret_cast<uintptr_t>(it->m_pInterfacePtr())));
AddFactory(FactoryInfo_t(reinterpret_cast<uintptr_t>(it->m_pInterfacePtr()), svInterfaceName,
svInterfaceName.substr(0, nVersionIndex), svInterfaceName.substr(nVersionIndex)));
}
}