From 8e89563614f98bc46c0a81594b471b4dfb6a70e2 Mon Sep 17 00:00:00 2001 From: apple1417 Date: Thu, 21 Sep 2023 19:01:04 +1200 Subject: [PATCH] linting fixes --- src/unrealsdk/game/bl3/bl3.cpp | 3 +++ src/unrealsdk/unreal/structs/gobjects.cpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/unrealsdk/game/bl3/bl3.cpp b/src/unrealsdk/game/bl3/bl3.cpp index 105ccf0..dd513b5 100644 --- a/src/unrealsdk/game/bl3/bl3.cpp +++ b/src/unrealsdk/game/bl3/bl3.cpp @@ -263,6 +263,9 @@ void BL3Hook::find_ftext_as_culture_invariant(void) { LOG(MISC, "FText::AsCultureInvariant: {:p}", reinterpret_cast(fname_init_ptr)); } +// This is fine, since we consume it when calling the native function +// The rvalue will live for the lifetime of this function call +// NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved) void BL3Hook::ftext_as_culture_invariant(FText* text, TemporaryFString&& str) const { ftext_as_culture_invariant_ptr(text, &str); } diff --git a/src/unrealsdk/unreal/structs/gobjects.cpp b/src/unrealsdk/unreal/structs/gobjects.cpp index a0aa467..8c62cfa 100644 --- a/src/unrealsdk/unreal/structs/gobjects.cpp +++ b/src/unrealsdk/unreal/structs/gobjects.cpp @@ -11,7 +11,8 @@ FUObjectItem* FChunkedFixedUObjectArray::at(size_t idx) const { throw std::out_of_range("FChunkedFixedUObjectArray index out of range"); } // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) - return &this->Objects[idx / this->NumElementsPerChunk][idx % this->NumElementsPerChunk]; + return &this->Objects[idx / FChunkedFixedUObjectArray::NumElementsPerChunk] + [idx % FChunkedFixedUObjectArray::NumElementsPerChunk]; }; #endif