From 522cb6b1372dc47fad2ead9d6f6c36a4299cc62d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Fri, 12 Feb 2021 00:54:13 +0100 Subject: IOS: Use less ambiguous names for classes Some of the device names can be ambiguous and require fully or partly qualifying the name (e.g. IOS::HLE::FS::) in a somewhat verbose way. Additionally, insufficiently qualified names are prone to breaking. Consider the example of IOS::HLE::FS:: (namespace) and IOS::HLE::Device::FS (class). If we use FS::Foo in a file that doesn't know about the class, everything will work fine. However, as soon as Device::FS is declared via a header include or even just forward declared, that code will cease to compile because FS:: now resolves to Device::FS if FS::Foo was used in the Device namespace. It also leads to having to write IOS::ES:: to access ES types and utilities even for code that is already under the IOS namespace. The fix for this is simple: rename the device classes and give them a "device" suffix in their names if the existing ones may be ambiguous. This makes it clear whether we're referring to the device class or to something else. This is not any longer to type, considering it lets us get rid of the Device namespace, which is now wholly unnecessary. There are no functional changes in this commit. A future commit will fix unnecessarily qualified names. --- Source/Core/DiscIO/VolumeVerifier.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'Source/Core/DiscIO/VolumeVerifier.cpp') diff --git a/Source/Core/DiscIO/VolumeVerifier.cpp b/Source/Core/DiscIO/VolumeVerifier.cpp index 2a217f72f1..21ac8f5d39 100644 --- a/Source/Core/DiscIO/VolumeVerifier.cpp +++ b/Source/Core/DiscIO/VolumeVerifier.cpp @@ -568,12 +568,12 @@ bool VolumeVerifier::CheckPartition(const Partition& partition) const std::vector& cert_chain = m_volume.GetCertificateChain(partition); if (IOS::HLE::IPC_SUCCESS != - es->VerifyContainer(IOS::HLE::Device::ES::VerifyContainerType::Ticket, - IOS::HLE::Device::ES::VerifyMode::DoNotUpdateCertStore, + es->VerifyContainer(IOS::HLE::ESDevice::VerifyContainerType::Ticket, + IOS::HLE::ESDevice::VerifyMode::DoNotUpdateCertStore, m_volume.GetTicket(partition), cert_chain) || IOS::HLE::IPC_SUCCESS != - es->VerifyContainer(IOS::HLE::Device::ES::VerifyContainerType::TMD, - IOS::HLE::Device::ES::VerifyMode::DoNotUpdateCertStore, + es->VerifyContainer(IOS::HLE::ESDevice::VerifyContainerType::TMD, + IOS::HLE::ESDevice::VerifyMode::DoNotUpdateCertStore, m_volume.GetTMD(partition), cert_chain)) { AddProblem(Severity::Low, @@ -1010,8 +1010,8 @@ void VolumeVerifier::CheckMisc() const std::vector& cert_chain = m_volume.GetCertificateChain(PARTITION_NONE); if (IOS::HLE::IPC_SUCCESS != - es->VerifyContainer(IOS::HLE::Device::ES::VerifyContainerType::Ticket, - IOS::HLE::Device::ES::VerifyMode::DoNotUpdateCertStore, m_ticket, + es->VerifyContainer(IOS::HLE::ESDevice::VerifyContainerType::Ticket, + IOS::HLE::ESDevice::VerifyMode::DoNotUpdateCertStore, m_ticket, cert_chain)) { // i18n: "Ticket" here is a kind of digital authorization to use a certain title (e.g. a game) @@ -1019,9 +1019,8 @@ void VolumeVerifier::CheckMisc() } if (IOS::HLE::IPC_SUCCESS != - es->VerifyContainer(IOS::HLE::Device::ES::VerifyContainerType::TMD, - IOS::HLE::Device::ES::VerifyMode::DoNotUpdateCertStore, tmd, - cert_chain)) + es->VerifyContainer(IOS::HLE::ESDevice::VerifyContainerType::TMD, + IOS::HLE::ESDevice::VerifyMode::DoNotUpdateCertStore, tmd, cert_chain)) { AddProblem(Severity::Low, Common::GetStringT("The TMD is not correctly signed.")); } -- cgit v1.2.3