diff --git a/app/src/main/cpp/skyline/common/settings.cpp b/app/src/main/cpp/skyline/common/settings.cpp index 193998c1..5d593009 100644 --- a/app/src/main/cpp/skyline/common/settings.cpp +++ b/app/src/main/cpp/skyline/common/settings.cpp @@ -25,7 +25,7 @@ namespace skyline { #undef PREF_ELEM - std::bitset> preferencesSet{}; // A bitfield to keep track of all the preferences we've set + std::bitset> preferencesSet{}; // A bitfield to keep track of all the preferences we've set for (auto element{document.last_child().first_child()}; element; element = element.next_sibling()) { std::string_view name{element.attribute("name").value()}; std::apply([&](auto... preferences) { diff --git a/app/src/main/cpp/skyline/gpu.cpp b/app/src/main/cpp/skyline/gpu.cpp index a083c668..f22a15b3 100644 --- a/app/src/main/cpp/skyline/gpu.cpp +++ b/app/src/main/cpp/skyline/gpu.cpp @@ -119,11 +119,11 @@ namespace skyline::gpu { return std::move(vk::raii::PhysicalDevices(instance).front()); // We just select the first device as we aren't expecting multiple GPUs } - vk::raii::Device GPU::CreateDevice(const vk::raii::PhysicalDevice &physicalDevice, typeof(vk::DeviceQueueCreateInfo::queueCount) &vkQueueFamilyIndex, QuirkManager &quirks) { + vk::raii::Device GPU::CreateDevice(const vk::raii::PhysicalDevice &physicalDevice, decltype(vk::DeviceQueueCreateInfo::queueCount) &vkQueueFamilyIndex, QuirkManager &quirks) { auto properties{physicalDevice.getProperties()}; auto deviceFeatures2{physicalDevice.getFeatures2()}; - typeof(deviceFeatures2) enabledFeatures2{}; // We only want to enable features we required due to potential overhead from unused features + decltype(deviceFeatures2) enabledFeatures2{}; // We only want to enable features we required due to potential overhead from unused features #define FEAT_REQ(structName, feature) \ if (deviceFeatures2.get().feature) \ @@ -160,7 +160,7 @@ namespace skyline::gpu { auto queueFamilies{physicalDevice.getQueueFamilyProperties()}; float queuePriority{1.0f}; //!< The priority of the only queue we use, it's set to the maximum of 1.0 vk::DeviceQueueCreateInfo queue{[&] { - typeof(vk::DeviceQueueCreateInfo::queueFamilyIndex) index{}; + decltype(vk::DeviceQueueCreateInfo::queueFamilyIndex) index{}; for (const auto &queueFamily : queueFamilies) { if (queueFamily.queueFlags & vk::QueueFlagBits::eGraphics && queueFamily.queueFlags & vk::QueueFlagBits::eCompute) { vkQueueFamilyIndex = index; diff --git a/app/src/main/cpp/skyline/gpu.h b/app/src/main/cpp/skyline/gpu.h index 38579672..115c1a25 100644 --- a/app/src/main/cpp/skyline/gpu.h +++ b/app/src/main/cpp/skyline/gpu.h @@ -23,7 +23,7 @@ namespace skyline::gpu { static vk::raii::PhysicalDevice CreatePhysicalDevice(const vk::raii::Instance &instance); - static vk::raii::Device CreateDevice(const vk::raii::PhysicalDevice &physicalDevice, typeof(vk::DeviceQueueCreateInfo::queueCount)& queueConfiguration, QuirkManager& quirks); + static vk::raii::Device CreateDevice(const vk::raii::PhysicalDevice &physicalDevice, decltype(vk::DeviceQueueCreateInfo::queueCount)& queueConfiguration, QuirkManager& quirks); public: static constexpr u32 VkApiVersion{VK_API_VERSION_1_1}; //!< The version of core Vulkan that we require diff --git a/app/src/main/cpp/skyline/services/nvdrv/core/nvmap.h b/app/src/main/cpp/skyline/services/nvdrv/core/nvmap.h index f52165b4..3149b320 100644 --- a/app/src/main/cpp/skyline/services/nvdrv/core/nvmap.h +++ b/app/src/main/cpp/skyline/services/nvdrv/core/nvmap.h @@ -33,7 +33,7 @@ namespace skyline::service::nvdrv::core { i32 pins{}; u32 pinVirtAddress{}; - std::optional>::iterator)> unmapQueueEntry{}; + std::optional>::iterator> unmapQueueEntry{}; struct Flags { bool mapUncached : 1; //!< If the handle should be mapped as uncached @@ -140,4 +140,4 @@ namespace skyline::service::nvdrv::core { */ std::optional FreeHandle(Handle::Id handle, bool internalSession); }; -} \ No newline at end of file +} diff --git a/app/src/main/cpp/skyline/soc/gm20b/engines/gpfifo.cpp b/app/src/main/cpp/skyline/soc/gm20b/engines/gpfifo.cpp index 37aea7dd..28d567a3 100644 --- a/app/src/main/cpp/skyline/soc/gm20b/engines/gpfifo.cpp +++ b/app/src/main/cpp/skyline/soc/gm20b/engines/gpfifo.cpp @@ -14,10 +14,10 @@ namespace skyline::soc::gm20b::engine { registers.raw[method] = argument; #define GPFIFO_OFFSET(field) U32_OFFSET(Registers, field) - #define GPFIFO_STRUCT_OFFSET(field, member) GPFIFO_OFFSET(field) + U32_OFFSET(typeof(Registers::field), member) + #define GPFIFO_STRUCT_OFFSET(field, member) GPFIFO_OFFSET(field) + U32_OFFSET(decltype(Registers::field), member) #define GPFIFO_CASE_BASE(fieldName, fieldAccessor, offset, content) case offset: { \ - auto fieldName{util::BitCast(argument)}; \ + auto fieldName{util::BitCast(argument)}; \ content \ return; \ } diff --git a/app/src/main/cpp/skyline/soc/gm20b/engines/maxwell_3d.cpp b/app/src/main/cpp/skyline/soc/gm20b/engines/maxwell_3d.cpp index f6fd5cf5..95a5915f 100644 --- a/app/src/main/cpp/skyline/soc/gm20b/engines/maxwell_3d.cpp +++ b/app/src/main/cpp/skyline/soc/gm20b/engines/maxwell_3d.cpp @@ -45,21 +45,21 @@ namespace skyline::soc::gm20b::engine::maxwell3d { } void Maxwell3D::HandleMethod(u32 method, u32 argument) { - #define MAXWELL3D_OFFSET(field) (sizeof(typeof(Registers::field)) - sizeof(typeof(*Registers::field))) / sizeof(u32) - #define MAXWELL3D_STRUCT_OFFSET(field, member) MAXWELL3D_OFFSET(field) + U32_OFFSET(typeof(*Registers::field), member) - #define MAXWELL3D_ARRAY_OFFSET(field, index) MAXWELL3D_OFFSET(field) + ((sizeof(typeof(Registers::field[0])) / sizeof(u32)) * index) - #define MAXWELL3D_ARRAY_STRUCT_OFFSET(field, index, member) MAXWELL3D_ARRAY_OFFSET(field, index) + U32_OFFSET(typeof(Registers::field[0]), member) - #define MAXWELL3D_ARRAY_STRUCT_STRUCT_OFFSET(field, index, member, submember) MAXWELL3D_ARRAY_STRUCT_OFFSET(field, index, member) + U32_OFFSET(typeof(Registers::field[0].member), submember) + #define MAXWELL3D_OFFSET(field) (sizeof(typeof(Registers::field)) - sizeof(std::remove_reference_t)) / sizeof(u32) + #define MAXWELL3D_STRUCT_OFFSET(field, member) MAXWELL3D_OFFSET(field) + U32_OFFSET(std::remove_reference_t, member) + #define MAXWELL3D_ARRAY_OFFSET(field, index) MAXWELL3D_OFFSET(field) + ((sizeof(std::remove_reference_t) / sizeof(u32)) * index) + #define MAXWELL3D_ARRAY_STRUCT_OFFSET(field, index, member) MAXWELL3D_ARRAY_OFFSET(field, index) + U32_OFFSET(std::remove_reference_t, member) + #define MAXWELL3D_ARRAY_STRUCT_STRUCT_OFFSET(field, index, member, submember) MAXWELL3D_ARRAY_STRUCT_OFFSET(field, index, member) + U32_OFFSET(decltype(Registers::field[0].member), submember) - #define MAXWELL3D_CASE(field, content) case MAXWELL3D_OFFSET(field): { \ - auto field{util::BitCast(argument)}; \ - content \ - return; \ + #define MAXWELL3D_CASE(field, content) case MAXWELL3D_OFFSET(field): { \ + auto field{util::BitCast>(argument)}; \ + content \ + return; \ } - #define MAXWELL3D_CASE_BASE(fieldName, fieldAccessor, offset, content) case offset: { \ - auto fieldName{util::BitCast(argument)}; \ - content \ - return; \ + #define MAXWELL3D_CASE_BASE(fieldName, fieldAccessor, offset, content) case offset: { \ + auto fieldName{util::BitCast>(argument)}; \ + content \ + return; \ } #define MAXWELL3D_STRUCT_CASE(field, member, content) MAXWELL3D_CASE_BASE(member, field->member, MAXWELL3D_STRUCT_OFFSET(field, member), content) #define MAXWELL3D_ARRAY_CASE(field, index, content) MAXWELL3D_CASE_BASE(field, field[index], MAXWELL3D_ARRAY_OFFSET(field, index), content)