Permalink
Browse files

Merge pull request #7027 from leoetlino/cleanup

Use some C++17 features available since GCC 6
  • Loading branch information...
leoetlino committed Jun 4, 2018
2 parents 2a89ad9 + fb124c2 commit 6ce9c96d91d976cffb95e774e89182c0f79e1e7a
Showing with 178 additions and 616 deletions.
  1. +6 −18 Source/Core/Common/ChunkFile.h
  2. +2 −8 Source/Core/Common/LinearDiskCache.h
  3. +2 −8 Source/Core/Core/IOS/DI/DI.cpp
  4. +2 −8 Source/Core/Core/IOS/DI/DI.h
  5. +2 −5 Source/Core/Core/IOS/Device.cpp
  6. +2 −5 Source/Core/Core/IOS/Device.h
  7. +2 −8 Source/Core/Core/IOS/DeviceStub.cpp
  8. +2 −8 Source/Core/Core/IOS/DeviceStub.h
  9. +2 −8 Source/Core/Core/IOS/ES/ES.cpp
  10. +2 −8 Source/Core/Core/IOS/ES/ES.h
  11. +2 −5 Source/Core/Core/IOS/ES/Formats.cpp
  12. +2 −8 Source/Core/Core/IOS/ES/Identity.cpp
  13. +2 −8 Source/Core/Core/IOS/ES/NandUtils.cpp
  14. +2 −8 Source/Core/Core/IOS/ES/TitleContents.cpp
  15. +2 −8 Source/Core/Core/IOS/ES/TitleInformation.cpp
  16. +2 −8 Source/Core/Core/IOS/ES/TitleManagement.cpp
  17. +2 −8 Source/Core/Core/IOS/ES/Views.cpp
  18. +2 −5 Source/Core/Core/IOS/IOSC.cpp
  19. +2 −8 Source/Core/Core/IOS/MIOS.cpp
  20. +2 −8 Source/Core/Core/IOS/MIOS.h
  21. +2 −8 Source/Core/Core/IOS/Network/IP/Top.cpp
  22. +2 −5 Source/Core/Core/IOS/Network/IP/Top.h
  23. +2 −8 Source/Core/Core/IOS/Network/KD/NWC24Config.cpp
  24. +2 −5 Source/Core/Core/IOS/Network/KD/NWC24Config.h
  25. +2 −8 Source/Core/Core/IOS/Network/KD/NetKDRequest.cpp
  26. +2 −8 Source/Core/Core/IOS/Network/KD/NetKDRequest.h
  27. +2 −8 Source/Core/Core/IOS/Network/KD/NetKDTime.cpp
  28. +2 −8 Source/Core/Core/IOS/Network/KD/NetKDTime.h
  29. +2 −5 Source/Core/Core/IOS/Network/MACUtils.cpp
  30. +2 −5 Source/Core/Core/IOS/Network/MACUtils.h
  31. +2 −8 Source/Core/Core/IOS/Network/NCD/Manage.cpp
  32. +2 −8 Source/Core/Core/IOS/Network/NCD/Manage.h
  33. +2 −8 Source/Core/Core/IOS/Network/NCD/WiiNetConfig.cpp
  34. +2 −5 Source/Core/Core/IOS/Network/NCD/WiiNetConfig.h
  35. +2 −8 Source/Core/Core/IOS/Network/SSL.cpp
  36. +2 −5 Source/Core/Core/IOS/Network/SSL.h
  37. +2 −5 Source/Core/Core/IOS/Network/Socket.cpp
  38. +2 −5 Source/Core/Core/IOS/Network/Socket.h
  39. +2 −8 Source/Core/Core/IOS/Network/WD/Command.cpp
  40. +2 −8 Source/Core/Core/IOS/Network/WD/Command.h
  41. +2 −8 Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp
  42. +2 −8 Source/Core/Core/IOS/SDIO/SDIOSlot0.h
  43. +2 −8 Source/Core/Core/IOS/STM/STM.cpp
  44. +2 −8 Source/Core/Core/IOS/STM/STM.h
  45. +2 −5 Source/Core/Core/IOS/USB/Bluetooth/BTBase.cpp
  46. +2 −5 Source/Core/Core/IOS/USB/Bluetooth/BTBase.h
  47. +2 −5 Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp
  48. +2 −5 Source/Core/Core/IOS/USB/Bluetooth/BTEmu.h
  49. +2 −8 Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp
  50. +4 −13 Source/Core/Core/IOS/USB/Bluetooth/BTReal.h
  51. +2 −8 Source/Core/Core/IOS/USB/Bluetooth/BTStub.cpp
  52. +2 −8 Source/Core/Core/IOS/USB/Bluetooth/BTStub.h
  53. +2 −5 Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp
  54. +2 −5 Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.h
  55. +2 −5 Source/Core/Core/IOS/USB/Bluetooth/WiimoteHIDAttr.cpp
  56. +2 −5 Source/Core/Core/IOS/USB/Bluetooth/WiimoteHIDAttr.h
  57. +2 −8 Source/Core/Core/IOS/USB/Common.cpp
  58. +2 −8 Source/Core/Core/IOS/USB/Common.h
  59. +2 −8 Source/Core/Core/IOS/USB/Host.cpp
  60. +2 −8 Source/Core/Core/IOS/USB/Host.h
  61. +2 −8 Source/Core/Core/IOS/USB/LibusbDevice.cpp
  62. +2 −8 Source/Core/Core/IOS/USB/LibusbDevice.h
  63. +2 −8 Source/Core/Core/IOS/USB/OH0/OH0.cpp
  64. +2 −5 Source/Core/Core/IOS/USB/OH0/OH0.h
  65. +2 −8 Source/Core/Core/IOS/USB/OH0/OH0Device.cpp
  66. +2 −8 Source/Core/Core/IOS/USB/OH0/OH0Device.h
  67. +2 −8 Source/Core/Core/IOS/USB/USBV0.cpp
  68. +2 −5 Source/Core/Core/IOS/USB/USBV0.h
  69. +2 −8 Source/Core/Core/IOS/USB/USBV4.cpp
  70. +2 −5 Source/Core/Core/IOS/USB/USBV4.h
  71. +2 −5 Source/Core/Core/IOS/USB/USBV5.cpp
  72. +2 −5 Source/Core/Core/IOS/USB/USBV5.h
  73. +2 −8 Source/Core/Core/IOS/USB/USB_HID/HIDv4.cpp
  74. +2 −8 Source/Core/Core/IOS/USB/USB_HID/HIDv4.h
  75. +2 −8 Source/Core/Core/IOS/USB/USB_HID/HIDv5.cpp
  76. +2 −8 Source/Core/Core/IOS/USB/USB_HID/HIDv5.h
  77. +2 −8 Source/Core/Core/IOS/USB/USB_KBD.cpp
  78. +2 −8 Source/Core/Core/IOS/USB/USB_KBD.h
  79. +2 −8 Source/Core/Core/IOS/USB/USB_VEN/VEN.cpp
  80. +2 −8 Source/Core/Core/IOS/USB/USB_VEN/VEN.h
  81. +2 −5 Source/Core/Core/IOS/VersionInfo.cpp
  82. +2 −5 Source/Core/Core/IOS/VersionInfo.h
  83. +2 −5 Source/Core/Core/IOS/WFS/WFSI.cpp
  84. +2 −5 Source/Core/Core/IOS/WFS/WFSI.h
  85. +2 −5 Source/Core/Core/IOS/WFS/WFSSRV.cpp
  86. +2 −5 Source/Core/Core/IOS/WFS/WFSSRV.h
  87. +0 −6 Source/Core/VideoBackends/Vulkan/ShaderCache.cpp
@@ -33,22 +33,10 @@
#include "Common/Flag.h"
#include "Common/Logging/Log.h"
// ewww
#ifndef __has_feature
#define __has_feature(x) (0)
#endif
#if (__has_feature(is_trivially_copyable) && \
(defined(_LIBCPP_VERSION) || defined(__GLIBCXX__))) || \
(defined(__GNUC__) && __GNUC__ >= 5) || defined(_MSC_VER)
#define IsTriviallyCopyable(T) \
std::is_trivially_copyable<typename std::remove_volatile<T>::type>::value
#elif __GNUC__
#define IsTriviallyCopyable(T) std::has_trivial_copy_constructor<T>::value
#else
#error No version of is_trivially_copyable
#endif
// XXX: Replace this with std::is_trivially_copyable<T> once we stop using volatile
// on things that are put in savestates, as volatile types are not trivially copyable.
template <typename T>
constexpr bool IsTriviallyCopyable = std::is_trivially_copyable<std::remove_volatile_t<T>>::value;
// Wrapper class
class PointerWrap
@@ -167,7 +155,7 @@ class PointerWrap
template <typename T>
void DoArray(T* x, u32 count)
{
static_assert(IsTriviallyCopyable(T), "Only sane for trivially copyable types");
static_assert(IsTriviallyCopyable<T>, "Only sane for trivially copyable types");
DoVoid(x, count * sizeof(T));
}
@@ -197,7 +185,7 @@ class PointerWrap
template <typename T>
void Do(T& x)
{
static_assert(IsTriviallyCopyable(T), "Only sane for trivially copyable types");
static_assert(IsTriviallyCopyable<T>, "Only sane for trivially copyable types");
// Note:
// Usually we can just use x = **ptr, etc. However, this doesn't work
// for unions containing BitFields (long story, stupid language rules)
@@ -56,15 +56,9 @@ class LinearDiskCache
{
using std::ios_base;
// Since we're reading/writing directly to the storage of K instances,
// K must be trivially copyable. TODO: Remove #if once GCC 5.0 is a
// minimum requirement.
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5
static_assert(std::has_trivial_copy_constructor<K>::value,
"K must be a trivially copyable type");
#else
// Since we're reading/writing directly to the storage of K instances,
// K must be trivially copyable.
static_assert(std::is_trivially_copyable<K>::value, "K must be a trivially copyable type");
#endif
// close any currently opened file
Close();
@@ -20,11 +20,7 @@
#include "Core/IOS/ES/Formats.h"
#include "DiscIO/Volume.h"
namespace IOS
{
namespace HLE
{
namespace Device
namespace IOS::HLE::Device
{
DI::DI(Kernel& ios, const std::string& device_name) : Device(ios, device_name)
{
@@ -123,6 +119,4 @@ IPCCommandResult DI::IOCtlV(const IOCtlVRequest& request)
}
return GetDefaultReply(return_value);
}
} // namespace Device
} // namespace HLE
} // namespace IOS
} // namespace IOS::HLE::Device
@@ -18,11 +18,7 @@ namespace DVDInterface
enum DIInterruptType : int;
}
namespace IOS
{
namespace HLE
{
namespace Device
namespace IOS::HLE::Device
{
class DI : public Device
{
@@ -41,6 +37,4 @@ class DI : public Device
std::deque<u32> m_commands_to_execute;
};
} // namespace Device
} // namespace HLE
} // namespace IOS
} // namespace IOS::HLE::Device
@@ -14,9 +14,7 @@
#include "Core/HW/SystemTimers.h"
#include "Core/IOS/IOS.h"
namespace IOS
{
namespace HLE
namespace IOS::HLE
{
Request::Request(const u32 address_) : address(address_)
{
@@ -205,5 +203,4 @@ IPCCommandResult Device::GetNoReply()
return {IPC_SUCCESS, false, 0};
}
} // namespace Device
} // namespace HLE
} // namespace IOS
} // namespace IOS::HLE
@@ -13,9 +13,7 @@
#include "Common/Logging/Log.h"
#include "Core/IOS/IOS.h"
namespace IOS
{
namespace HLE
namespace IOS::HLE
{
enum ReturnCode : s32
{
@@ -213,5 +211,4 @@ class Device
IPCCommandResult Unsupported(const Request& request);
};
} // namespace Device
} // namespace HLE
} // namespace IOS
} // namespace IOS::HLE
@@ -6,11 +6,7 @@
#include "Common/Logging/Log.h"
namespace IOS
{
namespace HLE
{
namespace Device
namespace IOS::HLE::Device
{
IPCCommandResult Stub::Open(const OpenRequest& request)
{
@@ -30,6 +26,4 @@ IPCCommandResult Stub::IOCtlV(const IOCtlVRequest& request)
WARN_LOG(IOS, "%s faking IOCtlV()", m_name.c_str());
return GetDefaultReply(IPC_SUCCESS);
}
} // namespace Device
} // namespace HLE
} // namespace IOS
} // namespace IOS::HLE::Device
@@ -10,11 +10,7 @@
#include "Core/IOS/Device.h"
#include "Core/IOS/IOS.h"
namespace IOS
{
namespace HLE
{
namespace Device
namespace IOS::HLE::Device
{
class Stub final : public Device
{
@@ -25,6 +21,4 @@ class Stub final : public Device
IPCCommandResult IOCtl(const IOCtlRequest& request) override;
IPCCommandResult IOCtlV(const IOCtlVRequest& request) override;
};
} // namespace Device
} // namespace HLE
} // namespace IOS
} // namespace IOS::HLE::Device
@@ -26,11 +26,7 @@
#include "Core/IOS/Uids.h"
#include "Core/IOS/VersionInfo.h"
namespace IOS
{
namespace HLE
{
namespace Device
namespace IOS::HLE::Device
{
// Title to launch after IOS has been reset and reloaded (similar to /sys/launch.sys).
static u64 s_title_to_launch;
@@ -988,6 +984,4 @@ ReturnCode ES::VerifyContainer(VerifyContainerType type, VerifyMode mode,
}
return ret;
}
} // namespace Device
} // namespace HLE
} // namespace IOS
} // namespace IOS::HLE::Device
@@ -18,11 +18,7 @@
class PointerWrap;
namespace IOS
{
namespace HLE
{
namespace Device
namespace IOS::HLE::Device
{
struct TitleContext
{
@@ -365,6 +361,4 @@ class ES final : public Device
ContextArray m_contexts;
TitleContext m_title_context{};
};
} // namespace Device
} // namespace HLE
} // namespace IOS
} // namespace IOS::HLE::Device
@@ -32,9 +32,7 @@
#include "Core/IOS/IOSC.h"
#include "Core/IOS/Uids.h"
namespace IOS
{
namespace ES
namespace IOS::ES
{
constexpr size_t CONTENT_VIEW_SIZE = 0x10;
@@ -771,5 +769,4 @@ std::map<std::string, CertReader> ParseCertChain(const std::vector<u8>& chain)
}
return certs;
}
} // namespace ES
} // namespace IOS
} // namespace IOS::ES
@@ -18,11 +18,7 @@
#include "Core/IOS/IOSC.h"
#include "Core/IOS/Uids.h"
namespace IOS
{
namespace HLE
{
namespace Device
namespace IOS::HLE::Device
{
ReturnCode ES::GetDeviceId(u32* device_id) const
{
@@ -213,6 +209,4 @@ IPCCommandResult ES::VerifySign(const IOCtlVRequest& request)
return GetDefaultReply(VerifySign(hash, ecc_signature, certs));
}
} // namespace Device
} // namespace HLE
} // namespace IOS
} // namespace IOS::HLE::Device
@@ -20,11 +20,7 @@
#include "Core/IOS/ES/Formats.h"
#include "Core/IOS/Uids.h"
namespace IOS
{
namespace HLE
{
namespace Device
namespace IOS::HLE::Device
{
static IOS::ES::TMDReader FindTMD(FS::FileSystem* fs, u64 title_id, const std::string& tmd_path)
{
@@ -377,6 +373,4 @@ std::string ES::GetContentPath(const u64 title_id, const IOS::ES::Content& conte
IOS::ES::SharedContentMap map{m_ios.GetFS()};
return GetContentPath(title_id, content, map);
}
} // namespace Device
} // namespace HLE
} // namespace IOS
} // namespace IOS::HLE::Device
@@ -14,11 +14,7 @@
#include "Core/IOS/ES/Formats.h"
#include "Core/IOS/Uids.h"
namespace IOS
{
namespace HLE
{
namespace Device
namespace IOS::HLE::Device
{
s32 ES::OpenContent(const IOS::ES::TMDReader& tmd, u16 content_index, u32 uid)
{
@@ -168,6 +164,4 @@ IPCCommandResult ES::SeekContent(u32 uid, const IOCtlVRequest& request)
return GetDefaultReply(SeekContent(cfd, offset, mode, uid));
}
} // namespace Device
} // namespace HLE
} // namespace IOS
} // namespace IOS::HLE::Device
@@ -13,11 +13,7 @@
#include "Core/HW/Memmap.h"
#include "Core/IOS/ES/Formats.h"
namespace IOS
{
namespace HLE
{
namespace Device
namespace IOS::HLE::Device
{
// Used by the GetStoredContents ioctlvs. This assumes that the first output vector
// is used for the content count (u32).
@@ -243,6 +239,4 @@ IPCCommandResult ES::GetSharedContents(const IOCtlVRequest& request) const
INFO_LOG(IOS_ES, "GetSharedContents: %u contents (%u requested)", count, max_count);
return GetDefaultReply(IPC_SUCCESS);
}
} // namespace Device
} // namespace HLE
} // namespace IOS
} // namespace IOS::HLE::Device
@@ -22,11 +22,7 @@
#include "Core/IOS/FS/FileSystem.h"
#include "Core/IOS/Uids.h"
namespace IOS
{
namespace HLE
{
namespace Device
namespace IOS::HLE::Device
{
static ReturnCode WriteTicket(FS::FileSystem* fs, const IOS::ES::TicketReader& ticket)
{
@@ -849,6 +845,4 @@ IPCCommandResult ES::DeleteSharedContent(const IOCtlVRequest& request)
Memory::CopyFromEmu(sha1.data(), request.in_vectors[0].address, request.in_vectors[0].size);
return GetDefaultReply(DeleteSharedContent(sha1));
}
} // namespace Device
} // namespace HLE
} // namespace IOS
} // namespace IOS::HLE::Device
@@ -19,11 +19,7 @@
#include "Core/IOS/ES/Formats.h"
#include "Core/IOS/VersionInfo.h"
namespace IOS
{
namespace HLE
{
namespace Device
namespace IOS::HLE::Device
{
// HACK: Since we do not want to require users to install disc updates when launching
// Wii games from the game list (which is the inaccurate game boot path anyway),
@@ -412,6 +408,4 @@ IPCCommandResult ES::DIGetTMD(const IOCtlVRequest& request)
Memory::CopyToEmu(request.io_vectors[0].address, tmd_bytes.data(), tmd_bytes.size());
return GetDefaultReply(IPC_SUCCESS);
}
} // namespace Device
} // namespace HLE
} // namespace IOS
} // namespace IOS::HLE::Device
@@ -95,9 +95,7 @@ static_assert(sizeof(BootMiiKeyDump) == 0x400, "Wrong size");
#pragma pack(pop)
} // end of anonymous namespace
namespace IOS
{
namespace HLE
namespace IOS::HLE
{
constexpr u32 DEFAULT_DEVICE_ID = 0x0403AC68;
constexpr u32 DEFAULT_KEY_ID = 0x6AAB8C59;
@@ -655,5 +653,4 @@ void IOSC::KeyEntry::DoState(PointerWrap& p)
p.Do(data);
p.Do(owner_mask);
}
} // namespace HLE
} // namespace IOS
} // namespace IOS::HLE
Oops, something went wrong.

0 comments on commit 6ce9c96

Please sign in to comment.