From be1c9d677d8bab3a14d4f966da313dd6d2dd3428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gilles=20Roudi=C3=A8re?= Date: Wed, 7 Dec 2022 12:11:28 +0100 Subject: Rename all gdnative occurences to gdextension Non-exhaustive list of case-sensitive renames: GDExtension -> GDNative GDNATIVE -> GDEXTENSION gdextension -> gdnative ExtensionExtension ->Extension (for where there was GDNativeExtension) EXTENSION_EXTENSION ->EXTENSION (for where there was GDNATIVE_EXTENSION) gdnlib -> gdextension gdn_interface -> gde_interface gdni -> gde_interface --- core/variant/native_ptr.h | 92 ++++++++++++++++++++--------------------- core/variant/variant_internal.h | 2 +- 2 files changed, 47 insertions(+), 47 deletions(-) (limited to 'core/variant') diff --git a/core/variant/native_ptr.h b/core/variant/native_ptr.h index ed68e0f6c9..18670310b0 100644 --- a/core/variant/native_ptr.h +++ b/core/variant/native_ptr.h @@ -36,90 +36,90 @@ #include "core/variant/type_info.h" template -struct GDNativeConstPtr { +struct GDExtensionConstPtr { const T *data = nullptr; - GDNativeConstPtr(const T *p_assign) { data = p_assign; } + GDExtensionConstPtr(const T *p_assign) { data = p_assign; } static const char *get_name() { return "const void"; } operator const T *() const { return data; } operator Variant() const { return uint64_t(data); } }; template -struct GDNativePtr { +struct GDExtensionPtr { T *data = nullptr; - GDNativePtr(T *p_assign) { data = p_assign; } + GDExtensionPtr(T *p_assign) { data = p_assign; } static const char *get_name() { return "void"; } operator T *() const { return data; } operator Variant() const { return uint64_t(data); } }; -#define GDVIRTUAL_NATIVE_PTR(m_type) \ - template <> \ - struct GDNativeConstPtr { \ - const m_type *data = nullptr; \ - GDNativeConstPtr() {} \ - GDNativeConstPtr(const m_type *p_assign) { data = p_assign; } \ - static const char *get_name() { return "const " #m_type; } \ - operator const m_type *() const { return data; } \ - operator Variant() const { return uint64_t(data); } \ - }; \ - template <> \ - struct VariantCaster> { \ - static _FORCE_INLINE_ GDNativeConstPtr cast(const Variant &p_variant) { \ - return GDNativeConstPtr((const m_type *)p_variant.operator uint64_t()); \ - } \ - }; \ - template <> \ - struct GDNativePtr { \ - m_type *data = nullptr; \ - GDNativePtr() {} \ - GDNativePtr(m_type *p_assign) { data = p_assign; } \ - static const char *get_name() { return #m_type; } \ - operator m_type *() const { return data; } \ - operator Variant() const { return uint64_t(data); } \ - }; \ - template <> \ - struct VariantCaster> { \ - static _FORCE_INLINE_ GDNativePtr cast(const Variant &p_variant) { \ - return GDNativePtr((m_type *)p_variant.operator uint64_t()); \ - } \ +#define GDVIRTUAL_NATIVE_PTR(m_type) \ + template <> \ + struct GDExtensionConstPtr { \ + const m_type *data = nullptr; \ + GDExtensionConstPtr() {} \ + GDExtensionConstPtr(const m_type *p_assign) { data = p_assign; } \ + static const char *get_name() { return "const " #m_type; } \ + operator const m_type *() const { return data; } \ + operator Variant() const { return uint64_t(data); } \ + }; \ + template <> \ + struct VariantCaster> { \ + static _FORCE_INLINE_ GDExtensionConstPtr cast(const Variant &p_variant) { \ + return GDExtensionConstPtr((const m_type *)p_variant.operator uint64_t()); \ + } \ + }; \ + template <> \ + struct GDExtensionPtr { \ + m_type *data = nullptr; \ + GDExtensionPtr() {} \ + GDExtensionPtr(m_type *p_assign) { data = p_assign; } \ + static const char *get_name() { return #m_type; } \ + operator m_type *() const { return data; } \ + operator Variant() const { return uint64_t(data); } \ + }; \ + template <> \ + struct VariantCaster> { \ + static _FORCE_INLINE_ GDExtensionPtr cast(const Variant &p_variant) { \ + return GDExtensionPtr((m_type *)p_variant.operator uint64_t()); \ + } \ }; template -struct GetTypeInfo> { +struct GetTypeInfo> { static const Variant::Type VARIANT_TYPE = Variant::NIL; static const GodotTypeInfo::Metadata METADATA = GodotTypeInfo::METADATA_NONE; static inline PropertyInfo get_class_info() { - return PropertyInfo(Variant::INT, String(), PROPERTY_HINT_INT_IS_POINTER, GDNativeConstPtr::get_name()); + return PropertyInfo(Variant::INT, String(), PROPERTY_HINT_INT_IS_POINTER, GDExtensionConstPtr::get_name()); } }; template -struct GetTypeInfo> { +struct GetTypeInfo> { static const Variant::Type VARIANT_TYPE = Variant::NIL; static const GodotTypeInfo::Metadata METADATA = GodotTypeInfo::METADATA_NONE; static inline PropertyInfo get_class_info() { - return PropertyInfo(Variant::INT, String(), PROPERTY_HINT_INT_IS_POINTER, GDNativePtr::get_name()); + return PropertyInfo(Variant::INT, String(), PROPERTY_HINT_INT_IS_POINTER, GDExtensionPtr::get_name()); } }; template -struct PtrToArg> { - _FORCE_INLINE_ static GDNativeConstPtr convert(const void *p_ptr) { - return GDNativeConstPtr(reinterpret_cast(p_ptr)); +struct PtrToArg> { + _FORCE_INLINE_ static GDExtensionConstPtr convert(const void *p_ptr) { + return GDExtensionConstPtr(reinterpret_cast(p_ptr)); } typedef const T *EncodeT; - _FORCE_INLINE_ static void encode(GDNativeConstPtr p_val, void *p_ptr) { + _FORCE_INLINE_ static void encode(GDExtensionConstPtr p_val, void *p_ptr) { *((const T **)p_ptr) = p_val.data; } }; template -struct PtrToArg> { - _FORCE_INLINE_ static GDNativePtr convert(const void *p_ptr) { - return GDNativePtr(reinterpret_cast(p_ptr)); +struct PtrToArg> { + _FORCE_INLINE_ static GDExtensionPtr convert(const void *p_ptr) { + return GDExtensionPtr(reinterpret_cast(p_ptr)); } typedef T *EncodeT; - _FORCE_INLINE_ static void encode(GDNativePtr p_val, void *p_ptr) { + _FORCE_INLINE_ static void encode(GDExtensionPtr p_val, void *p_ptr) { *((T **)p_ptr) = p_val.data; } }; diff --git a/core/variant/variant_internal.h b/core/variant/variant_internal.h index 94e7296a99..684baff348 100644 --- a/core/variant/variant_internal.h +++ b/core/variant/variant_internal.h @@ -1517,7 +1517,7 @@ struct VariantTypeAdjust { } }; -// GDNative extension helpers. +// GDExtension helpers. template struct VariantTypeConstructor { -- cgit v1.2.3