From 180e5d30286279c979507a571bf6d336aa49da9d Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 3 May 2022 01:43:50 +0200 Subject: Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>` These typedefs don't save much typing compared to the full `Ref` and `Ref`, yet they sometimes introduce confusion among new contributors. --- core/extension/native_extension.cpp | 10 +++++----- core/extension/native_extension.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'core/extension') diff --git a/core/extension/native_extension.cpp b/core/extension/native_extension.cpp index 076d04a5eb..7e51d221a7 100644 --- a/core/extension/native_extension.cpp +++ b/core/extension/native_extension.cpp @@ -356,7 +356,7 @@ void NativeExtension::initialize_native_extensions() { gdnative_interface.classdb_unregister_extension_class = _unregister_extension_class; } -RES NativeExtensionResourceLoader::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, CacheMode p_cache_mode) { +Ref NativeExtensionResourceLoader::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, CacheMode p_cache_mode) { Ref config; config.instantiate(); @@ -367,14 +367,14 @@ RES NativeExtensionResourceLoader::load(const String &p_path, const String &p_or } if (err != OK) { - return RES(); + return Ref(); } if (!config->has_section_key("configuration", "entry_symbol")) { if (r_error) { *r_error = ERR_INVALID_DATA; } - return RES(); + return Ref(); } String entry_symbol = config->get_value("configuration", "entry_symbol"); @@ -406,7 +406,7 @@ RES NativeExtensionResourceLoader::load(const String &p_path, const String &p_or if (r_error) { *r_error = ERR_FILE_NOT_FOUND; } - return RES(); + return Ref(); } if (!library_path.is_resource_file()) { @@ -423,7 +423,7 @@ RES NativeExtensionResourceLoader::load(const String &p_path, const String &p_or } if (err != OK) { - return RES(); + return Ref(); } return lib; diff --git a/core/extension/native_extension.h b/core/extension/native_extension.h index ebfedfb29a..d148200035 100644 --- a/core/extension/native_extension.h +++ b/core/extension/native_extension.h @@ -90,7 +90,7 @@ VARIANT_ENUM_CAST(NativeExtension::InitializationLevel) class NativeExtensionResourceLoader : public ResourceFormatLoader { public: - virtual RES load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads = false, float *r_progress = nullptr, CacheMode p_cache_mode = CACHE_MODE_REUSE); + virtual Ref load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads = false, float *r_progress = nullptr, CacheMode p_cache_mode = CACHE_MODE_REUSE); virtual void get_recognized_extensions(List *p_extensions) const; virtual bool handles_type(const String &p_type) const; virtual String get_resource_type(const String &p_path) const; -- cgit v1.2.3