C++17ification.

C++17ification!

- Filesystem interaction now uses std::filesystem::path.
- Usage of const char*, std::string have been changed to
  std::string_view where appropriate.
- Usage of printf-style functions changed to use fmt.
This commit is contained in:
gibbed
2020-03-02 09:37:11 -06:00
committed by Rick Gibbed
parent 114cea6fb7
commit 5bf0b34445
220 changed files with 4944 additions and 4294 deletions

View File

@@ -2,7 +2,7 @@
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Copyright 2020 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
@@ -31,7 +31,7 @@ struct DeviceInfo {
uint32_t device_type;
uint64_t total_bytes;
uint64_t free_bytes;
wchar_t name[28];
char16_t name[28];
};
// TODO(gibbed): real information.
@@ -48,7 +48,7 @@ static const DeviceInfo dummy_device_info_ = {
0xF00D0000, 1,
4ull * ONE_GB, // 4GB
3ull * ONE_GB, // 3GB, so it looks a little used.
L"Dummy HDD",
u"Dummy HDD",
};
#undef ONE_GB
@@ -70,19 +70,19 @@ dword_result_t XamContentGetLicenseMask(lpdword_t mask_ptr,
DECLARE_XAM_EXPORT2(XamContentGetLicenseMask, kContent, kStub, kHighFrequency);
dword_result_t XamContentGetDeviceName(dword_t device_id,
lpwstring_t name_buffer,
lpu16string_t name_buffer,
dword_t name_capacity) {
if ((device_id & 0xFFFF0000) != dummy_device_info_.device_id) {
return X_ERROR_DEVICE_NOT_CONNECTED;
}
auto name = std::wstring(dummy_device_info_.name);
auto name = std::u16string(dummy_device_info_.name);
if (name_capacity < name.size() + 1) {
return X_ERROR_INSUFFICIENT_BUFFER;
}
xe::store_and_swap<std::wstring>(name_buffer, name);
((wchar_t*)name_buffer)[name.size()] = 0;
xe::store_and_swap<std::u16string>(name_buffer, name);
((char16_t*)name_buffer)[name.size()] = 0;
return X_ERROR_SUCCESS;
}
DECLARE_XAM_EXPORT1(XamContentGetDeviceName, kContent, kImplemented);
@@ -132,7 +132,7 @@ dword_result_t XamContentGetDeviceData(
device_data->unknown = device_id & 0xFFFF; // Fake it.
device_data->total_bytes = device_info.total_bytes;
device_data->free_bytes = device_info.free_bytes;
xe::store_and_swap<std::wstring>(&device_data->name[0], device_info.name);
xe::store_and_swap<std::u16string>(&device_data->name[0], device_info.name);
return X_ERROR_SUCCESS;
}
DECLARE_XAM_EXPORT1(XamContentGetDeviceData, kContent, kImplemented);