From 9e9eac46763feec5334f50c55b5ffdd233ae6472 Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Sun, 15 Jan 2023 20:33:20 +0100 Subject: Use enum instead of int in virtual methods return type --- core/io/resource_loader.cpp | 4 ++-- core/io/resource_loader.h | 2 +- core/io/resource_saver.cpp | 6 +++--- core/io/resource_saver.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'core/io') 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, _get_dependencies, String, bool) GDVIRTUAL1RC(Vector, _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 &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, String, uint32_t) + GDVIRTUAL3R(Error, _save, Ref, String, uint32_t) GDVIRTUAL2R(Error, _set_uid, String, ResourceUID::ID) GDVIRTUAL1RC(bool, _recognize, Ref) GDVIRTUAL1RC(Vector, _get_recognized_extensions, Ref) -- cgit v1.2.3