From 071aec5f203109739da1453200d803c8a419228a Mon Sep 17 00:00:00 2001 From: Thaddeus Crews Date: Fri, 12 Jul 2024 10:11:09 -0500 Subject: [PATCH] Core: Change BitField int to unsigned --- include/godot_cpp/core/binder_common.hpp | 8 ++++---- include/godot_cpp/core/type_info.hpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/godot_cpp/core/binder_common.hpp b/include/godot_cpp/core/binder_common.hpp index 26ed4ca3..7bee08bf 100644 --- a/include/godot_cpp/core/binder_common.hpp +++ b/include/godot_cpp/core/binder_common.hpp @@ -68,17 +68,17 @@ namespace godot { template <> \ struct VariantCaster> { \ static _FORCE_INLINE_ BitField cast(const Variant &p_variant) { \ - return BitField(p_variant.operator int64_t()); \ + return BitField(p_variant.operator uint64_t()); \ } \ }; \ template <> \ struct PtrToArg> { \ _FORCE_INLINE_ static BitField convert(const void *p_ptr) { \ - return BitField(*reinterpret_cast(p_ptr)); \ + return BitField(*reinterpret_cast(p_ptr)); \ } \ - typedef int64_t EncodeT; \ + typedef uint64_t EncodeT; \ _FORCE_INLINE_ static void encode(BitField p_val, void *p_ptr) { \ - *reinterpret_cast(p_ptr) = p_val; \ + *reinterpret_cast(p_ptr) = p_val; \ } \ }; \ } diff --git a/include/godot_cpp/core/type_info.hpp b/include/godot_cpp/core/type_info.hpp index 19f37250..29e6e3ac 100644 --- a/include/godot_cpp/core/type_info.hpp +++ b/include/godot_cpp/core/type_info.hpp @@ -260,14 +260,14 @@ inline StringName _gde_constant_get_enum_name(T param, StringName p_constant) { template class BitField { - int64_t value = 0; + uint64_t value = 0; public: _FORCE_INLINE_ void set_flag(T p_flag) { value |= p_flag; } _FORCE_INLINE_ bool has_flag(T p_flag) const { return value & p_flag; } _FORCE_INLINE_ void clear_flag(T p_flag) { value &= ~p_flag; } - _FORCE_INLINE_ BitField(int64_t p_value) { value = p_value; } - _FORCE_INLINE_ operator int64_t() const { return value; } + _FORCE_INLINE_ BitField(uint64_t p_value) { value = p_value; } + _FORCE_INLINE_ operator uint64_t() const { return value; } _FORCE_INLINE_ operator Variant() const { return value; } };