From 0ba75c195efffcb098ac74440ffb0fa9c85d0d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 27 Feb 2019 08:57:37 +0100 Subject: Fix GCC 5 build after #26331 and cleanup style Also cleanup after 01a3dd3. --- core/io/resource_importer.cpp | 12 ++++++------ core/io/resource_importer.h | 10 ++++++---- core/script_debugger_remote.cpp | 1 - 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'core') diff --git a/core/io/resource_importer.cpp b/core/io/resource_importer.cpp index ef834921b6..427ce2c2cd 100644 --- a/core/io/resource_importer.cpp +++ b/core/io/resource_importer.cpp @@ -32,7 +32,8 @@ #include "core/os/os.h" #include "core/variant_parser.h" -bool ResourceFormatImporter::SortImporterByName::operator() ( const Ref& p_a,const Ref& p_b) const { + +bool ResourceFormatImporter::SortImporterByName::operator()(const Ref &p_a, const Ref &p_b) const { return p_a->get_importer_name() < p_b->get_importer_name(); } @@ -321,7 +322,6 @@ Variant ResourceFormatImporter::get_resource_metadata(const String &p_path) cons return pat.metadata; } - void ResourceFormatImporter::get_dependencies(const String &p_path, List *p_dependencies, bool p_add_types) { PathAndType pat; @@ -394,7 +394,7 @@ bool ResourceFormatImporter::are_import_settings_valid(const String &p_path) con return false; } - for(int i=0;iget_importer_name() == pat.importer) { if (!importers[i]->are_import_settings_valid(p_path)) { //importer thinks this is not valid return false; @@ -405,10 +405,10 @@ bool ResourceFormatImporter::are_import_settings_valid(const String &p_path) con return true; } - String ResourceFormatImporter::get_import_settings_hash() const { +String ResourceFormatImporter::get_import_settings_hash() const { String hash; - for(int i=0;iget_importer_name()+":"+importers[i]->get_import_settings_string(); + for (int i = 0; i < importers.size(); i++) { + hash += ":" + importers[i]->get_importer_name() + ":" + importers[i]->get_import_settings_string(); } return hash.md5_text(); } diff --git a/core/io/resource_importer.h b/core/io/resource_importer.h index 0ae6bf9090..db1befb51e 100644 --- a/core/io/resource_importer.h +++ b/core/io/resource_importer.h @@ -52,7 +52,7 @@ class ResourceFormatImporter : public ResourceFormatLoader { //need them to stay in order to compute the settings hash struct SortImporterByName { - bool operator() ( const Ref& p_a,const Ref& p_b) const; + bool operator()(const Ref &p_a, const Ref &p_b) const; }; Vector > importers; @@ -75,7 +75,10 @@ public: String get_internal_resource_path(const String &p_path) const; void get_internal_resource_path_list(const String &p_path, List *r_paths); - void add_importer(const Ref &p_importer) { importers.push_back(p_importer); importers.sort_custom();} + void add_importer(const Ref &p_importer) { + importers.push_back(p_importer); + importers.sort_custom(); + } void remove_importer(const Ref &p_importer) { importers.erase(p_importer); } Ref get_importer_by_name(const String &p_name) const; Ref get_importer_by_extension(const String &p_extension) const; @@ -117,10 +120,9 @@ public: virtual void get_import_options(List *r_options, int p_preset = 0) const = 0; virtual bool get_option_visibility(const String &p_option, const Map &p_options) const = 0; - virtual Error import(const String &p_source_file, const String &p_save_path, const Map &p_options, List *r_platform_variants, List *r_gen_files = NULL, Variant *r_metadata=NULL) = 0; + virtual Error import(const String &p_source_file, const String &p_save_path, const Map &p_options, List *r_platform_variants, List *r_gen_files = NULL, Variant *r_metadata = NULL) = 0; virtual bool are_import_settings_valid(const String &p_path) const { return true; } virtual String get_import_settings_string() const { return String(); } - }; #endif // RESOURCE_IMPORTER_H diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index 9780cc48ea..3ed25f118d 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -1054,7 +1054,6 @@ void ScriptDebuggerRemote::profiling_set_frame_times(float p_frame_time, float p physics_frame_time = p_physics_frame_time; } - ScriptDebuggerRemote::ResourceUsageFunc ScriptDebuggerRemote::resource_usage_func = NULL; ScriptDebuggerRemote::ScriptDebuggerRemote() : -- cgit v1.2.3