From 40d5fc18b3e24792b05d13652a82541a08ba47f0 Mon Sep 17 00:00:00 2001 From: powerof3 Date: Wed, 16 Oct 2024 15:56:36 +0000 Subject: [PATCH] maintenance --- cmake/sourcelist.cmake | 2 + include/RE/B/BSTHashMap.h | 26 ++++----- include/RE/B/BSTTuple.h | 85 ++++++++++++++--------------- include/RE/B/BSTempEffectParticle.h | 4 +- include/RE/C/Color.h | 2 +- include/RE/C/CombatMagicCaster.h | 4 +- include/RE/G/GArrayBase.h | 8 +-- include/RE/G/GList.h | 4 +- include/RE/H/hkBaseTypes.h | 2 +- include/RE/I/IVirtualMachine.h | 2 +- include/RE/N/NativeLatentFunction.h | 2 +- include/RE/N/NiColor.h | 2 +- include/RE/N/NiTMapBase.h | 2 +- include/RE/T/TESForm.h | 4 +- include/REL/ID.h | 8 +-- include/REL/Relocation.h | 30 ++++------ include/REX/REX.h | 15 +++-- include/SKSE/Impl/PCH.h | 15 ++--- include/SKSE/Impl/Stubs.h | 54 +++++++++--------- src/RE/B/BGSSkillPerkTreeNode.cpp | 2 +- src/RE/G/GString.cpp | 4 +- src/RE/I/Inventory3DManager.cpp | 4 +- src/RE/N/NiCamera.cpp | 2 +- src/RE/U/UI3DSceneManager.cpp | 2 +- src/REL/Relocation.cpp | 4 +- 25 files changed, 135 insertions(+), 154 deletions(-) diff --git a/cmake/sourcelist.cmake b/cmake/sourcelist.cmake index adc62e638..df1c8291c 100644 --- a/cmake/sourcelist.cmake +++ b/cmake/sourcelist.cmake @@ -1660,9 +1660,11 @@ set(SOURCES include/REL/Version.h include/REX/PS4.h include/REX/PS4/SCEPAD.h + include/REX/REX.h include/REX/W32.h include/REX/W32/ADVAPI32.h include/REX/W32/BASE.h + include/REX/W32/BCRYPT.h include/REX/W32/COM.h include/REX/W32/COMPTR.h include/REX/W32/D3D.h diff --git a/include/RE/B/BSTHashMap.h b/include/RE/B/BSTHashMap.h index a40ec5434..1059802ec 100644 --- a/include/RE/B/BSTHashMap.h +++ b/include/RE/B/BSTHashMap.h @@ -43,8 +43,8 @@ namespace RE entry_type(const entry_type&) = delete; entry_type(entry_type&& a_rhs) // - noexcept(std::is_nothrow_move_constructible_v && - std::is_nothrow_destructible_v) + noexcept(std::is_nothrow_move_constructible_v&& + std::is_nothrow_destructible_v) { if (a_rhs.has_value()) { const auto rnext = a_rhs.next; @@ -57,8 +57,8 @@ namespace RE entry_type& operator=(const entry_type&) = delete; entry_type& operator=(entry_type&& a_rhs) // - noexcept(std::is_nothrow_move_constructible_v && - std::is_nothrow_destructible_v) + noexcept(std::is_nothrow_move_constructible_v&& + std::is_nothrow_destructible_v) { if (this != std::addressof(a_rhs)) { destroy(); @@ -94,8 +94,8 @@ namespace RE } [[nodiscard]] value_type steal() && // - noexcept(std::is_nothrow_move_constructible_v && - std::is_nothrow_destructible_v) + noexcept(std::is_nothrow_move_constructible_v&& + std::is_nothrow_destructible_v) { assert(has_value()); value_type val = std::move(value); @@ -130,8 +130,7 @@ namespace RE template iterator_base(const iterator_base& a_rhs) noexcept // - requires(std::convertible_to::reference, reference>) - : + requires(std::convertible_to::reference, reference>) : _first(a_rhs._first), _last(a_rhs._last) {} @@ -222,8 +221,7 @@ namespace RE BSTScatterTable(const BSTScatterTable& a_rhs) { insert(a_rhs.begin(), a_rhs.end()); } BSTScatterTable(BSTScatterTable&& a_rhs) noexcept // - requires(std::same_as) - : + requires(std::same_as) : _capacity(std::exchange(a_rhs._capacity, 0)), _free(std::exchange(a_rhs._free, 0)), _good(std::exchange(a_rhs._good, 0)), @@ -540,15 +538,15 @@ namespace RE } [[nodiscard]] size_type hash_function(const key_type& a_key) const // - noexcept(std::is_nothrow_constructible_v && - std::is_nothrow_invocable_v) + noexcept(std::is_nothrow_constructible_v&& + std::is_nothrow_invocable_v) { return static_cast(hasher()(a_key)); } [[nodiscard]] bool key_eq(const key_type& a_lhs, const key_type& a_rhs) const // - noexcept(std::is_nothrow_constructible_v && - std::is_nothrow_invocable_v) + noexcept(std::is_nothrow_constructible_v&& + std::is_nothrow_invocable_v) { return static_cast(key_equal()(a_lhs, a_rhs)); } diff --git a/include/RE/B/BSTTuple.h b/include/RE/B/BSTTuple.h index 351931ef8..cb0c59f98 100644 --- a/include/RE/B/BSTTuple.h +++ b/include/RE/B/BSTTuple.h @@ -13,11 +13,10 @@ namespace RE // 1) BSTTuple() // - noexcept(std::is_nothrow_default_constructible_v && - std::is_nothrow_default_constructible_v) // - requires(std::is_default_constructible_v && - std::is_default_constructible_v) - : + noexcept(std::is_nothrow_default_constructible_v&& + std::is_nothrow_default_constructible_v) // + requires(std::is_default_constructible_v&& + std::is_default_constructible_v) : first(), second() {} @@ -26,11 +25,10 @@ namespace RE explicit(!std::is_convertible_v || !std::is_convertible_v) // BSTTuple(const first_type& a_first, const second_type& a_second) // - noexcept(std::is_nothrow_copy_constructible_v && - std::is_nothrow_copy_constructible_v) // - requires(std::is_copy_constructible_v && - std::is_copy_constructible_v) - : + noexcept(std::is_nothrow_copy_constructible_v&& + std::is_nothrow_copy_constructible_v) // + requires(std::is_copy_constructible_v&& + std::is_copy_constructible_v) : first(a_first), second(a_second) {} @@ -40,11 +38,10 @@ namespace RE explicit(!std::is_convertible_v || !std::is_convertible_v) // BSTTuple(U1&& a_first, U2&& a_second) // - noexcept(std::is_nothrow_constructible_v && - std::is_nothrow_constructible_v) // - requires(std::is_constructible_v && - std::is_constructible_v) - : + noexcept(std::is_nothrow_constructible_v&& + std::is_nothrow_constructible_v) // + requires(std::is_constructible_v&& + std::is_constructible_v) : first(std::forward(a_first)), second(std::forward(a_second)) {} @@ -54,11 +51,10 @@ namespace RE explicit(!std::is_convertible_v || !std::is_convertible_v) // BSTTuple(const BSTTuple& a_rhs) // - noexcept(std::is_nothrow_constructible_v && - std::is_nothrow_constructible_v) // - requires(std::is_constructible_v && - std::is_constructible_v) - : + noexcept(std::is_nothrow_constructible_v&& + std::is_nothrow_constructible_v) // + requires(std::is_constructible_v&& + std::is_constructible_v) : first(a_rhs.first), second(a_rhs.second) {} @@ -68,11 +64,10 @@ namespace RE explicit(!std::is_convertible_v || !std::is_convertible_v) // BSTTuple(BSTTuple&& a_rhs) // - noexcept(std::is_nothrow_constructible_v && - std::is_nothrow_constructible_v) // - requires(std::is_constructible_v && - std::is_constructible_v) - : + noexcept(std::is_nothrow_constructible_v&& + std::is_nothrow_constructible_v) // + requires(std::is_constructible_v&& + std::is_constructible_v) : first(std::forward(a_rhs.first)), second(std::forward(a_rhs.second)) {} @@ -108,10 +103,10 @@ namespace RE // 1) BSTTuple& operator=(const BSTTuple& a_rhs) // - noexcept(std::is_nothrow_copy_assignable_v && - std::is_nothrow_copy_assignable_v) // - requires(std::is_copy_assignable_v && - std::is_copy_assignable_v) + noexcept(std::is_nothrow_copy_assignable_v&& + std::is_nothrow_copy_assignable_v) // + requires(std::is_copy_assignable_v&& + std::is_copy_assignable_v) { if (this != std::addressof(a_rhs)) { first = a_rhs.first; @@ -123,10 +118,10 @@ namespace RE // 2) template BSTTuple& operator=(const BSTTuple& a_rhs) // - noexcept(std::is_nothrow_assignable_v && - std::is_nothrow_assignable_v) // - requires(std::is_assignable_v && - std::is_assignable_v) + noexcept(std::is_nothrow_assignable_v&& + std::is_nothrow_assignable_v) // + requires(std::is_assignable_v&& + std::is_assignable_v) { first = a_rhs.first; second = a_rhs.second; @@ -135,10 +130,10 @@ namespace RE // 3) BSTTuple& operator=(BSTTuple&& a_rhs) // - noexcept(std::is_nothrow_move_assignable_v && - std::is_nothrow_move_assignable_v) // - requires(std::is_move_assignable_v && - std::is_move_assignable_v) + noexcept(std::is_nothrow_move_assignable_v&& + std::is_nothrow_move_assignable_v) // + requires(std::is_move_assignable_v&& + std::is_move_assignable_v) { if (this != std::addressof(a_rhs)) { first = std::move(a_rhs.first); @@ -150,10 +145,10 @@ namespace RE // 4) template BSTTuple& operator=(BSTTuple&& a_rhs) // - noexcept(std::is_nothrow_assignable_v && - std::is_nothrow_assignable_v) // - requires(std::is_assignable_v && - std::is_assignable_v) + noexcept(std::is_nothrow_assignable_v&& + std::is_nothrow_assignable_v) // + requires(std::is_assignable_v&& + std::is_assignable_v) { first = std::move(a_rhs.first); second = std::move(a_rhs.second); @@ -163,8 +158,8 @@ namespace RE TES_HEAP_REDEFINE_NEW(); void swap(BSTTuple& a_rhs) // - noexcept(std::is_nothrow_swappable_v && - std::is_nothrow_swappable_v) + noexcept(std::is_nothrow_swappable_v&& + std::is_nothrow_swappable_v) { using std::swap; if (this != std::addressof(a_rhs)) { @@ -216,8 +211,8 @@ namespace RE template void swap(BSTTuple& a_lhs, BSTTuple& a_rhs) // noexcept(noexcept(a_lhs.swap(a_rhs))) // - requires(std::is_swappable_v && - std::is_swappable_v) + requires(std::is_swappable_v&& + std::is_swappable_v) { a_lhs.swap(a_rhs); } diff --git a/include/RE/B/BSTempEffectParticle.h b/include/RE/B/BSTempEffectParticle.h index fcb509f1b..4ebaa43ee 100644 --- a/include/RE/B/BSTempEffectParticle.h +++ b/include/RE/B/BSTempEffectParticle.h @@ -34,13 +34,13 @@ namespace RE static BSTempEffectParticle* Spawn(TESObjectCELL* a_cell, float a_lifetime, const char* a_modelName, const NiPoint3& a_rotation, const NiPoint3& a_position, float a_scale, std::uint32_t a_flags, NiAVObject* a_target) { using func_t = BSTempEffectParticle* (*)(TESObjectCELL*, float, const char*, const NiPoint3&, const NiPoint3&, float, std::uint32_t, NiAVObject*); - static REL::Relocation func{ RELOCATION_ID(29218, 30071) }; + static REL::Relocation func{ RELOCATION_ID(29218, 30071) }; return func(a_cell, a_lifetime, a_modelName, a_rotation, a_position, a_scale, a_flags, a_target); } static BSTempEffectParticle* Spawn(TESObjectCELL* a_cell, float a_lifetime, const char* a_modelName, const NiMatrix3& a_normal, const NiPoint3& a_position, float a_scale, std::uint32_t a_flags, NiAVObject* a_target) { using func_t = BSTempEffectParticle* (*)(TESObjectCELL*, float, const char*, const NiMatrix3&, const NiPoint3&, float, std::uint32_t, NiAVObject*); - static REL::Relocation func{ RELOCATION_ID(29219, 30072) }; + static REL::Relocation func{ RELOCATION_ID(29219, 30072) }; return func(a_cell, a_lifetime, a_modelName, a_normal, a_position, a_scale, a_flags, a_target); } diff --git a/include/RE/C/Color.h b/include/RE/C/Color.h index 053c64732..8a7e2b171 100644 --- a/include/RE/C/Color.h +++ b/include/RE/C/Color.h @@ -48,7 +48,7 @@ namespace RE constexpr Color(std::uint32_t a_hexValue) noexcept : red((a_hexValue >> 16) & 0xFF), green((a_hexValue >> 8) & 0xFF), - blue((a_hexValue) & 0xFF), + blue((a_hexValue)&0xFF), alpha(0) {} diff --git a/include/RE/C/CombatMagicCaster.h b/include/RE/C/CombatMagicCaster.h index 8c6fd43ce..f9e07321e 100644 --- a/include/RE/C/CombatMagicCaster.h +++ b/include/RE/C/CombatMagicCaster.h @@ -35,14 +35,14 @@ namespace RE bool CheckTargetValid(const CombatController* a_combatController) { - using func_t = bool* (*)(CombatMagicCaster*, const CombatController*); + using func_t = bool* (*)(CombatMagicCaster*, const CombatController*); static REL::Relocation func{ RELOCATION_ID(43956, 45348) }; return func(this, a_combatController); } static bool CheckTargetValid(const CombatController* a_combatController, Actor* a_target, const CombatInventoryItemMagic* a_inventoryItem) { - using func_t = bool* (*)(const CombatController*, Actor*, const CombatInventoryItemMagic*); + using func_t = bool* (*)(const CombatController*, Actor*, const CombatInventoryItemMagic*); static REL::Relocation func{ RELOCATION_ID(43952, 45343) }; return func(a_combatController, a_target, a_inventoryItem); } diff --git a/include/RE/G/GArrayBase.h b/include/RE/G/GArrayBase.h index e9bf9da73..c3d954177 100644 --- a/include/RE/G/GArrayBase.h +++ b/include/RE/G/GArrayBase.h @@ -51,7 +51,7 @@ namespace RE iterator operator++(std::int32_t) { iterator it(*this); - operator++(); + operator++(); return it; } @@ -68,7 +68,7 @@ namespace RE iterator operator--(std::int32_t) { iterator it(*this); - operator--(); + operator--(); return it; } @@ -164,7 +164,7 @@ namespace RE const_iterator operator++(std::int32_t) { const_iterator it(*this); - operator++(); + operator++(); return it; } @@ -180,7 +180,7 @@ namespace RE const_iterator operator--(std::int32_t) { const_iterator it(*this); - operator--(); + operator--(); return it; } diff --git a/include/RE/G/GList.h b/include/RE/G/GList.h index 841926146..e39ac97c1 100644 --- a/include/RE/G/GList.h +++ b/include/RE/G/GList.h @@ -131,7 +131,7 @@ namespace RE iterator_base operator++(int) { iterator_base tmp{ *this }; - operator++(); + operator++(); return tmp; } @@ -146,7 +146,7 @@ namespace RE iterator_base operator--(int) { iterator_base tmp{ *this }; - operator--(); + operator--(); return tmp; } diff --git a/include/RE/H/hkBaseTypes.h b/include/RE/H/hkBaseTypes.h index 21f631616..f754db45c 100644 --- a/include/RE/H/hkBaseTypes.h +++ b/include/RE/H/hkBaseTypes.h @@ -19,7 +19,7 @@ namespace RE explicit hkHalf(const float& a_val); hkHalf& operator=(const float& a_val); - operator float() const; + operator float() const; protected: void SetFloat(const float& a_val); diff --git a/include/RE/I/IVirtualMachine.h b/include/RE/I/IVirtualMachine.h index 0c68c145c..6ce3e7463 100644 --- a/include/RE/I/IVirtualMachine.h +++ b/include/RE/I/IVirtualMachine.h @@ -123,7 +123,7 @@ namespace RE void RegisterLatentFunction(std::string_view a_fnName, std::string_view a_className, F a_callback, bool a_callableFromTasklets = false); template - requires is_return_convertible_v + requires is_return_convertible_v void ReturnLatentResult(VMStackID a_stackID, V result); void SetCallableFromTasklets(const char* a_className, const char* a_stateName, const char* a_fnName, bool a_callable); diff --git a/include/RE/N/NativeLatentFunction.h b/include/RE/N/NativeLatentFunction.h index 3b864c790..a6b5edb9e 100644 --- a/include/RE/N/NativeLatentFunction.h +++ b/include/RE/N/NativeLatentFunction.h @@ -101,7 +101,7 @@ namespace RE */ template - requires is_return_convertible_v + requires is_return_convertible_v void IVirtualMachine::ReturnLatentResult(VMStackID a_stackID, V a_result) { auto var = RE::BSScript::Variable::Variable(); diff --git a/include/RE/N/NiColor.h b/include/RE/N/NiColor.h index 0c9c60538..86f790cb1 100644 --- a/include/RE/N/NiColor.h +++ b/include/RE/N/NiColor.h @@ -46,7 +46,7 @@ namespace RE constexpr NiColor(std::uint32_t a_hexValue) noexcept : red(((a_hexValue >> 16) & 0xFF) / 255.0f), green(((a_hexValue >> 8) & 0xFF) / 255.0f), - blue(((a_hexValue) & 0xFF) / 255.0f) + blue(((a_hexValue)&0xFF) / 255.0f) { } diff --git a/include/RE/N/NiTMapBase.h b/include/RE/N/NiTMapBase.h index 43ada4ce0..53d746c47 100644 --- a/include/RE/N/NiTMapBase.h +++ b/include/RE/N/NiTMapBase.h @@ -171,7 +171,7 @@ namespace RE iterator_base operator++(int) { iterator_base tmp(*this); - operator++(); + operator++(); return tmp; } diff --git a/include/RE/T/TESForm.h b/include/RE/T/TESForm.h index 68b3a4c6a..21ef1a782 100644 --- a/include/RE/T/TESForm.h +++ b/include/RE/T/TESForm.h @@ -314,7 +314,7 @@ namespace RE template [[nodiscard]] bool Is(Args... a_args) const noexcept // - requires(std::same_as && ...) + requires(std::same_as&&...) { return (Is(a_args) || ...); } @@ -334,7 +334,7 @@ namespace RE template [[nodiscard]] bool IsNot(Args... a_args) const noexcept // - requires(std::same_as && ...) + requires(std::same_as&&...) { return (IsNot(a_args) && ...); } diff --git a/include/REL/ID.h b/include/REL/ID.h index fa4c7f9c8..a6214a429 100644 --- a/include/REL/ID.h +++ b/include/REL/ID.h @@ -87,10 +87,10 @@ namespace REL { const mapping_t elem{ 0, a_offset }; const auto it = std::lower_bound( - _offset2id.begin(), - _offset2id.end(), - elem, - [](auto&& a_lhs, auto&& a_rhs) { + _offset2id.begin(), + _offset2id.end(), + elem, + [](auto&& a_lhs, auto&& a_rhs) { return a_lhs.offset < a_rhs.offset; }); if (it == _offset2id.end()) { diff --git a/include/REL/Relocation.h b/include/REL/Relocation.h index c38a13738..8f07112bc 100644 --- a/include/REL/Relocation.h +++ b/include/REL/Relocation.h @@ -267,8 +267,7 @@ namespace REL template std::invoke_result_t operator()(Args&&... a_args) const - noexcept(std::is_nothrow_invocable_v) - requires(std::invocable) + noexcept(std::is_nothrow_invocable_v) requires(std::invocable) { return REL::invoke(get(), std::forward(a_args)...); } @@ -284,56 +283,48 @@ namespace REL } template - void write(const U& a_data) - requires(std::same_as) + void write(const U& a_data) requires(std::same_as) { safe_write(address(), std::addressof(a_data), sizeof(T)); } template - void write(const std::span a_data) - requires(std::same_as) + void write(const std::span a_data) requires(std::same_as) { safe_write(address(), a_data.data(), a_data.size_bytes()); } template - std::uintptr_t write_branch(const std::uintptr_t a_dst) - requires(std::same_as) + std::uintptr_t write_branch(const std::uintptr_t a_dst) requires(std::same_as) { return SKSE::GetTrampoline().write_branch(address(), a_dst); } template - std::uintptr_t write_branch(const F a_dst) - requires(std::same_as) + std::uintptr_t write_branch(const F a_dst) requires(std::same_as) { return SKSE::GetTrampoline().write_branch(address(), stl::unrestricted_cast(a_dst)); } template - std::uintptr_t write_call(const std::uintptr_t a_dst) - requires(std::same_as) + std::uintptr_t write_call(const std::uintptr_t a_dst) requires(std::same_as) { return SKSE::GetTrampoline().write_call(address(), a_dst); } template - std::uintptr_t write_call(const F a_dst) - requires(std::same_as) + std::uintptr_t write_call(const F a_dst) requires(std::same_as) { return SKSE::GetTrampoline().write_call(address(), stl::unrestricted_cast(a_dst)); } - void write_fill(const std::uint8_t a_value, const std::size_t a_count) - requires(std::same_as) + void write_fill(const std::uint8_t a_value, const std::size_t a_count) requires(std::same_as) { safe_fill(address(), a_value, a_count); } template - std::uintptr_t write_vfunc(const std::size_t a_idx, const std::uintptr_t a_newFunc) - requires(std::same_as) + std::uintptr_t write_vfunc(const std::size_t a_idx, const std::uintptr_t a_newFunc) requires(std::same_as) { const auto addr = address() + (sizeof(void*) * a_idx); const auto result = *reinterpret_cast(addr); @@ -342,8 +333,7 @@ namespace REL } template - std::uintptr_t write_vfunc(const std::size_t a_idx, const F a_newFunc) - requires(std::same_as) + std::uintptr_t write_vfunc(const std::size_t a_idx, const F a_newFunc) requires(std::same_as) { return write_vfunc(a_idx, stl::unrestricted_cast(a_newFunc)); } diff --git a/include/REX/REX.h b/include/REX/REX.h index c67edde6b..6c9676e85 100644 --- a/include/REX/REX.h +++ b/include/REX/REX.h @@ -92,8 +92,7 @@ namespace REX template constexpr EnumSet(Args... a_values) noexcept - requires(std::same_as && ...) - : + requires(std::same_as&&...) : _impl((static_cast(a_values) | ...)) {} @@ -124,7 +123,7 @@ namespace REX public: template constexpr EnumSet& set(Args... a_args) noexcept - requires(std::same_as && ...) + requires(std::same_as&&...) { _impl |= (static_cast(a_args) | ...); return *this; @@ -132,7 +131,7 @@ namespace REX template constexpr EnumSet& set(bool a_set, Args... a_args) noexcept - requires(std::same_as && ...) + requires(std::same_as&&...) { if (a_set) _impl |= (static_cast(a_args) | ...); @@ -144,7 +143,7 @@ namespace REX template constexpr EnumSet& reset(Args... a_args) noexcept - requires(std::same_as && ...) + requires(std::same_as&&...) { _impl &= ~(static_cast(a_args) | ...); return *this; @@ -158,21 +157,21 @@ namespace REX template [[nodiscard]] constexpr bool any(Args... a_args) const noexcept - requires(std::same_as && ...) + requires(std::same_as&&...) { return (_impl & (static_cast(a_args) | ...)) != static_cast(0); } template [[nodiscard]] constexpr bool all(Args... a_args) const noexcept - requires(std::same_as && ...) + requires(std::same_as&&...) { return (_impl & (static_cast(a_args) | ...)) == (static_cast(a_args) | ...); } template [[nodiscard]] constexpr bool none(Args... a_args) const noexcept - requires(std::same_as && ...) + requires(std::same_as&&...) { return (_impl & (static_cast(a_args) | ...)) == static_cast(0); } diff --git a/include/SKSE/Impl/PCH.h b/include/SKSE/Impl/PCH.h index 60442a9f3..f2aadb553 100644 --- a/include/SKSE/Impl/PCH.h +++ b/include/SKSE/Impl/PCH.h @@ -148,15 +148,13 @@ namespace SKSE } template - requires(std::invocable>) - class scope_exit + requires(std::invocable>) class scope_exit { public: // 1) template - explicit scope_exit(Fn&& a_fn) - noexcept(std::is_nothrow_constructible_v || - std::is_nothrow_constructible_v) // + explicit scope_exit(Fn&& a_fn) noexcept(std::is_nothrow_constructible_v || + std::is_nothrow_constructible_v) // requires(!std::is_same_v, scope_exit> && std::is_constructible_v) { @@ -171,9 +169,8 @@ namespace SKSE } // 2) - scope_exit(scope_exit&& a_rhs) - noexcept(std::is_nothrow_move_constructible_v || - std::is_nothrow_copy_constructible_v) // + scope_exit(scope_exit&& a_rhs) noexcept(std::is_nothrow_move_constructible_v || + std::is_nothrow_copy_constructible_v) // requires(std::is_nothrow_move_constructible_v || std::is_copy_constructible_v) { @@ -323,7 +320,7 @@ namespace SKSE template [[nodiscard]] inline auto pun_bits(Args... a_args) // - requires(std::same_as, bool> && ...) + requires(std::same_as, bool>&&...) { constexpr auto ARGC = sizeof...(Args); diff --git a/include/SKSE/Impl/Stubs.h b/include/SKSE/Impl/Stubs.h index 57647b327..de1bed3e1 100644 --- a/include/SKSE/Impl/Stubs.h +++ b/include/SKSE/Impl/Stubs.h @@ -29,70 +29,70 @@ namespace SKSE std::uint32_t runtimeVersion; std::uint32_t editorVersion; std::uint32_t isEditor; - void* (*QueryInterface)(std::uint32_t); - PluginHandle (*GetPluginHandle)(); + void* (*QueryInterface)(std::uint32_t); + PluginHandle (*GetPluginHandle)(); std::uint32_t (*GetReleaseIndex)(); - const void* (*GetPluginInfo)(const char*); + const void* (*GetPluginInfo)(const char*); }; struct SKSEMessagingInterface { std::uint32_t interfaceVersion; - bool (*RegisterListener)(PluginHandle, const char*, void*); - bool (*Dispatch)(PluginHandle, std::uint32_t, void*, std::uint32_t, const char*); - void* (*GetEventDispatcher)(std::uint32_t); + bool (*RegisterListener)(PluginHandle, const char*, void*); + bool (*Dispatch)(PluginHandle, std::uint32_t, void*, std::uint32_t, const char*); + void* (*GetEventDispatcher)(std::uint32_t); }; struct SKSEObjectInterface { - std::uint32_t interfaceVersion; - SKSEDelayFunctorManager& (*GetDelayFunctorManager)(); - SKSEObjectRegistry& (*GetObjectRegistry)(); + std::uint32_t interfaceVersion; + SKSEDelayFunctorManager& (*GetDelayFunctorManager)(); + SKSEObjectRegistry& (*GetObjectRegistry)(); SKSEPersistentObjectStorage& (*GetPersistentObjectStorage)(); }; struct SKSEPapyrusInterface { std::uint32_t interfaceVersion; - bool (*Register)(void*); + bool (*Register)(void*); }; struct SKSEScaleformInterface { std::uint32_t interfaceVersion; - bool (*Register)(const char*, void*); - void (*RegisterForInventory)(void*); + bool (*Register)(const char*, void*); + void (*RegisterForInventory)(void*); }; struct SKSESerializationInterface { std::uint32_t version; - void (*SetUniqueID)(PluginHandle, std::uint32_t); - void (*SetRevertCallback)(PluginHandle, void*); - void (*SetSaveCallback)(PluginHandle, void*); - void (*SetLoadCallback)(PluginHandle, void*); - void (*SetFormDeleteCallback)(PluginHandle, void*); - bool (*WriteRecord)(std::uint32_t, std::uint32_t, const void*, std::uint32_t); - bool (*OpenRecord)(std::uint32_t, std::uint32_t); - bool (*WriteRecordData)(const void*, std::uint32_t); - bool (*GetNextRecordInfo)(std::uint32_t*, std::uint32_t*, std::uint32_t*); + void (*SetUniqueID)(PluginHandle, std::uint32_t); + void (*SetRevertCallback)(PluginHandle, void*); + void (*SetSaveCallback)(PluginHandle, void*); + void (*SetLoadCallback)(PluginHandle, void*); + void (*SetFormDeleteCallback)(PluginHandle, void*); + bool (*WriteRecord)(std::uint32_t, std::uint32_t, const void*, std::uint32_t); + bool (*OpenRecord)(std::uint32_t, std::uint32_t); + bool (*WriteRecordData)(const void*, std::uint32_t); + bool (*GetNextRecordInfo)(std::uint32_t*, std::uint32_t*, std::uint32_t*); std::uint32_t (*ReadRecordData)(void*, std::uint32_t); - bool (*ResolveHandle)(std::uint64_t, std::uint64_t*); - bool (*ResolveFormId)(std::uint32_t, std::uint32_t*); + bool (*ResolveHandle)(std::uint64_t, std::uint64_t*); + bool (*ResolveFormId)(std::uint32_t, std::uint32_t*); }; struct SKSETaskInterface { std::uint32_t interfaceVersion; - void (*AddTask)(void*); - void (*AddUITask)(void*); + void (*AddTask)(void*); + void (*AddUITask)(void*); }; struct SKSETrampolineInterface { std::uint32_t interfaceVersion; - void* (*AllocateFromBranchPool)(PluginHandle, std::size_t); - void* (*AllocateFromLocalPool)(PluginHandle, std::size_t); + void* (*AllocateFromBranchPool)(PluginHandle, std::size_t); + void* (*AllocateFromLocalPool)(PluginHandle, std::size_t); }; class TaskDelegate diff --git a/src/RE/B/BGSSkillPerkTreeNode.cpp b/src/RE/B/BGSSkillPerkTreeNode.cpp index bf2ffcd19..910b4148a 100644 --- a/src/RE/B/BGSSkillPerkTreeNode.cpp +++ b/src/RE/B/BGSSkillPerkTreeNode.cpp @@ -5,7 +5,7 @@ namespace RE BGSSkillPerkTreeNode::BGSSkillPerkTreeNode(std::int32_t a_index, ActorValueInfo* a_avInfo) { using func_t = BGSSkillPerkTreeNode* (*)(BGSSkillPerkTreeNode*, std::int32_t, ActorValueInfo*); - static REL::Relocation func{ Offset::BGSSkillPerkTreeNode::Ctor }; + static REL::Relocation func{ Offset::BGSSkillPerkTreeNode::Ctor }; func(this, a_index, a_avInfo); } } diff --git a/src/RE/G/GString.cpp b/src/RE/G/GString.cpp index 3728e2946..2d7de830e 100644 --- a/src/RE/G/GString.cpp +++ b/src/RE/G/GString.cpp @@ -56,7 +56,7 @@ namespace RE _dataDesc() { std::string_view view(""); - operator=(view); + operator=(view); } GString::GString(const GString& a_rhs) : @@ -118,7 +118,7 @@ namespace RE GString& GString::operator=(const char* a_rhs) { std::string_view view(a_rhs); - return operator=(view); + return operator=(view); } GString& GString::operator=(const std::string_view& a_rhs) diff --git a/src/RE/I/Inventory3DManager.cpp b/src/RE/I/Inventory3DManager.cpp index f902993da..2c998536e 100644 --- a/src/RE/I/Inventory3DManager.cpp +++ b/src/RE/I/Inventory3DManager.cpp @@ -24,14 +24,14 @@ namespace RE void Inventory3DManager::LoadInventoryItem(InventoryEntryData* a_objDesc) { - using func_t = void (*)(Inventory3DManager*, InventoryEntryData*); + using func_t = void (*)(Inventory3DManager*, InventoryEntryData*); static REL::Relocation func{ RELOCATION_ID(50884, 51757) }; return func(this, a_objDesc); } void Inventory3DManager::LoadInventoryItem(TESBoundObject* a_object, ExtraDataList* a_extraDataList) { - using func_t = void (*)(Inventory3DManager*, TESBoundObject*, ExtraDataList*); + using func_t = void (*)(Inventory3DManager*, TESBoundObject*, ExtraDataList*); static REL::Relocation func{ RELOCATION_ID(50885, 51758) }; return func(this, a_object, a_extraDataList); } diff --git a/src/RE/N/NiCamera.cpp b/src/RE/N/NiCamera.cpp index 94bcfb127..5898234ab 100644 --- a/src/RE/N/NiCamera.cpp +++ b/src/RE/N/NiCamera.cpp @@ -42,7 +42,7 @@ namespace RE bool NiCamera::WorldPtToScreenPt3(const float a_matrix[4][4], const NiRect& a_port, const NiPoint3& a_point, float& a_xOut, float& a_yOut, float& a_zOut, float a_zeroTolerance) { - using func_t = bool (*)(const float[4][4], const NiRect&, const NiPoint3&, float&, float&, float&, float); + using func_t = bool (*)(const float[4][4], const NiRect&, const NiPoint3&, float&, float&, float&, float); static REL::Relocation func{ Offset::NiCamera::WorldPtToScreenPt3 }; return func(a_matrix, a_port, a_point, a_xOut, a_yOut, a_zOut, a_zeroTolerance); } diff --git a/src/RE/U/UI3DSceneManager.cpp b/src/RE/U/UI3DSceneManager.cpp index 8b2034c29..2fe2b3584 100644 --- a/src/RE/U/UI3DSceneManager.cpp +++ b/src/RE/U/UI3DSceneManager.cpp @@ -15,7 +15,7 @@ namespace RE void UI3DSceneManager::AttachChild(NiAVObject* a_obj, INTERFACE_LIGHT_SCHEME a_scheme) { - using func_t = void (*)(UI3DSceneManager*, NiAVObject*, INTERFACE_LIGHT_SCHEME); + using func_t = void (*)(UI3DSceneManager*, NiAVObject*, INTERFACE_LIGHT_SCHEME); static REL::Relocation func{ RELOCATION_ID(51859, 52731) }; return func(this, a_obj, a_scheme); } diff --git a/src/REL/Relocation.cpp b/src/REL/Relocation.cpp index 7a0d491eb..4ce831bde 100644 --- a/src/REL/Relocation.cpp +++ b/src/REL/Relocation.cpp @@ -8,7 +8,7 @@ namespace REL { std::uint32_t old{ 0 }; bool success = REX::W32::VirtualProtect( - reinterpret_cast(a_dst), a_count, REX::W32::PAGE_EXECUTE_READWRITE, std::addressof(old)); + reinterpret_cast(a_dst), a_count, REX::W32::PAGE_EXECUTE_READWRITE, std::addressof(old)); if (success) { std::memcpy(reinterpret_cast(a_dst), a_src, a_count); success = REX::W32::VirtualProtect( @@ -22,7 +22,7 @@ namespace REL { std::uint32_t old{ 0 }; bool success = REX::W32::VirtualProtect( - reinterpret_cast(a_dst), a_count, REX::W32::PAGE_EXECUTE_READWRITE, std::addressof(old)); + reinterpret_cast(a_dst), a_count, REX::W32::PAGE_EXECUTE_READWRITE, std::addressof(old)); if (success) { std::fill_n(reinterpret_cast(a_dst), a_count, a_value); success = REX::W32::VirtualProtect(