diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-27 14:05:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-27 14:05:13 +0200 |
commit | 0f38fa2e0c35ea956fb9ddeeb19d014503b974fa (patch) | |
tree | f2360e8fae663604b9aace73748f7c5e911d8670 /core/variant | |
parent | 0f7b7bcbce32bca96a0d9fe08a2335cce81fae2a (diff) | |
parent | 95088f6bfaad8af476198f5e7d52baf06b86edf1 (diff) |
Merge pull request #50931 from Faless/fix/4.x_enum_cast
[Core] Make enum variant cast and encoding 64 bits
Diffstat (limited to 'core/variant')
-rw-r--r-- | core/variant/binder_common.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/variant/binder_common.h b/core/variant/binder_common.h index ef5867c685..3cb2a6bfb5 100644 --- a/core/variant/binder_common.h +++ b/core/variant/binder_common.h @@ -69,17 +69,17 @@ struct VariantCaster<const T &> { template <> \ struct VariantCaster<m_enum> { \ static _FORCE_INLINE_ m_enum cast(const Variant &p_variant) { \ - return (m_enum)p_variant.operator int(); \ + return (m_enum)p_variant.operator int64_t(); \ } \ }; \ template <> \ struct PtrToArg<m_enum> { \ _FORCE_INLINE_ static m_enum convert(const void *p_ptr) { \ - return m_enum(*reinterpret_cast<const int *>(p_ptr)); \ + return m_enum(*reinterpret_cast<const int64_t *>(p_ptr)); \ } \ typedef int64_t EncodeT; \ _FORCE_INLINE_ static void encode(m_enum p_val, const void *p_ptr) { \ - *(int *)p_ptr = p_val; \ + *(int64_t *)p_ptr = p_val; \ } \ }; |