From eff1cad4048d796fb3116bf07162a0f6d67e8c2b Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Tue, 28 Feb 2023 16:29:37 -0400 Subject: macros: Make the getter of `PRIVATE_MEMBER_ACCESSORS` return a reference, and add `PRIVATE_MEMBER_ACCESSORS_NON_REF` --- include/pso/PSOV3Encryption.h | 4 ++-- include/pso/macros.h | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/pso/PSOV3Encryption.h b/include/pso/PSOV3Encryption.h index 0526cfb..966ff70 100644 --- a/include/pso/PSOV3Encryption.h +++ b/include/pso/PSOV3Encryption.h @@ -24,8 +24,8 @@ public: virtual u32 next() override; PRIVATE_MEMBER_ACCESSORS_ARRAY(u32, buffer, 522); - PRIVATE_MEMBER_ACCESSORS(u32 *, buffer_start); - PRIVATE_MEMBER_ACCESSORS(u32 *, buffer_end); + PRIVATE_MEMBER_ACCESSORS_NON_REF(u32 *, buffer_start); + PRIVATE_MEMBER_ACCESSORS_NON_REF(u32 *, buffer_end); private: TArray m_buffer; diff --git a/include/pso/macros.h b/include/pso/macros.h index e93e2de..afe5400 100644 --- a/include/pso/macros.h +++ b/include/pso/macros.h @@ -85,7 +85,11 @@ } #define PRIVATE_MEMBER_ACCESSORS(type, name) \ - PRIVATE_MEMBER_GETTER(type, name); \ + PRIVATE_MEMBER_GETTER(type &, name); \ + PRIVATE_MEMBER_SETTER(type, name) + +#define PRIVATE_MEMBER_ACCESSORS_NON_REF(type, name) \ + PRIVATE_MEMBER_GETTER(type, name); \ PRIVATE_MEMBER_SETTER(type, name) #define PRIVATE_MEMBER_ACCESSORS_ARRAY(type, name, size) \ -- cgit v1.2.3-13-gbd6f