diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-01 07:45:28 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-01 07:45:28 +0100 |
commit | e8240031e78e4cdfd0afad8e6b5f23b68686bfd5 (patch) | |
tree | 5101632d655794dd87f0cfef80210c48ceed1b7d /core | |
parent | a5be03e59a82de61b8c65e60719ca5b58a10db37 (diff) | |
parent | c7f4ca36a4541686d5944f7bf88e1aa7d32cc24f (diff) |
Merge pull request #71479 from raulsntos/virtual-return-type
Use enum instead of int in virtual methods return type
Diffstat (limited to 'core')
-rw-r--r-- | core/io/resource_loader.cpp | 4 | ||||
-rw-r--r-- | core/io/resource_loader.h | 2 | ||||
-rw-r--r-- | core/io/resource_saver.cpp | 6 | ||||
-rw-r--r-- | core/io/resource_saver.h | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 7447119ab7..fc3547261b 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -176,9 +176,9 @@ Error ResourceFormatLoader::rename_dependencies(const String &p_path, const Hash deps_dict[E.key] = E.value; } - int64_t err = OK; + Error err = OK; GDVIRTUAL_CALL(_rename_dependencies, p_path, deps_dict, err); - return (Error)err; + return err; } void ResourceFormatLoader::_bind_methods() { diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h index eb8155e046..c47b6c950a 100644 --- a/core/io/resource_loader.h +++ b/core/io/resource_loader.h @@ -58,7 +58,7 @@ protected: GDVIRTUAL1RC(ResourceUID::ID, _get_resource_uid, String) GDVIRTUAL2RC(Vector<String>, _get_dependencies, String, bool) GDVIRTUAL1RC(Vector<String>, _get_classes_used, String) - GDVIRTUAL2RC(int64_t, _rename_dependencies, String, Dictionary) + GDVIRTUAL2RC(Error, _rename_dependencies, String, Dictionary) GDVIRTUAL1RC(bool, _exists, String) GDVIRTUAL4RC(Variant, _load, String, String, bool, int) diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp index b8201cc6b9..6e377847a8 100644 --- a/core/io/resource_saver.cpp +++ b/core/io/resource_saver.cpp @@ -42,9 +42,9 @@ ResourceSavedCallback ResourceSaver::save_callback = nullptr; ResourceSaverGetResourceIDForPath ResourceSaver::save_get_id_for_path = nullptr; Error ResourceFormatSaver::save(const Ref<Resource> &p_resource, const String &p_path, uint32_t p_flags) { - int64_t res = ERR_METHOD_NOT_FOUND; - GDVIRTUAL_CALL(_save, p_resource, p_path, p_flags, res); - return (Error)res; + Error err = ERR_METHOD_NOT_FOUND; + GDVIRTUAL_CALL(_save, p_resource, p_path, p_flags, err); + return err; } Error ResourceFormatSaver::set_uid(const String &p_path, ResourceUID::ID p_uid) { diff --git a/core/io/resource_saver.h b/core/io/resource_saver.h index 9e88b2086b..572742d129 100644 --- a/core/io/resource_saver.h +++ b/core/io/resource_saver.h @@ -41,7 +41,7 @@ class ResourceFormatSaver : public RefCounted { protected: static void _bind_methods(); - GDVIRTUAL3R(int64_t, _save, Ref<Resource>, String, uint32_t) + GDVIRTUAL3R(Error, _save, Ref<Resource>, String, uint32_t) GDVIRTUAL2R(Error, _set_uid, String, ResourceUID::ID) GDVIRTUAL1RC(bool, _recognize, Ref<Resource>) GDVIRTUAL1RC(Vector<String>, _get_recognized_extensions, Ref<Resource>) |