From a8454114544b1a4f93ea6c6a217a19494ffc852a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 10 Dec 2017 01:27:02 +0100 Subject: [PATCH] Style: Re-apply clang-format over recent invalid additions --- core/io/json.cpp | 6 +++--- core/io/json.h | 4 ++-- editor/editor_help.cpp | 5 +++-- editor/editor_node.cpp | 1 - editor/editor_plugin.h | 2 +- editor/import/editor_import_collada.cpp | 2 +- editor/import/editor_import_collada.h | 2 +- editor/import/editor_scene_importer_gltf.h | 2 +- editor/import/resource_importer_obj.h | 2 +- modules/gdscript/gdscript_function.cpp | 4 ++-- scene/3d/gi_probe.cpp | 2 +- scene/3d/particles.cpp | 4 ++-- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/core/io/json.cpp b/core/io/json.cpp index ddfc792cc70..82e938d2db5 100644 --- a/core/io/json.cpp +++ b/core/io/json.cpp @@ -43,7 +43,7 @@ const char *JSON::tk_name[TK_MAX] = { "EOF", }; -static String _make_indent(const String& p_indent, int p_size) { +static String _make_indent(const String &p_indent, int p_size) { String indent_text = ""; if (!p_indent.empty()) { @@ -53,7 +53,7 @@ static String _make_indent(const String& p_indent, int p_size) { return indent_text; } -String JSON::_print_var(const Variant &p_var, const String& p_indent, int p_cur_indent, bool p_sort_keys) { +String JSON::_print_var(const Variant &p_var, const String &p_indent, int p_cur_indent, bool p_sort_keys) { String colon = ":"; String end_statement = ""; @@ -116,7 +116,7 @@ String JSON::_print_var(const Variant &p_var, const String& p_indent, int p_cur_ } } -String JSON::print(const Variant &p_var, const String& p_indent, bool p_sort_keys) { +String JSON::print(const Variant &p_var, const String &p_indent, bool p_sort_keys) { return _print_var(p_var, p_indent, 0, p_sort_keys); } diff --git a/core/io/json.h b/core/io/json.h index 5e1a89f069d..fbb7875c7c7 100644 --- a/core/io/json.h +++ b/core/io/json.h @@ -64,7 +64,7 @@ class JSON { static const char *tk_name[TK_MAX]; - static String _print_var(const Variant &p_var, const String& p_indent, int p_cur_indent, bool p_sort_keys); + static String _print_var(const Variant &p_var, const String &p_indent, int p_cur_indent, bool p_sort_keys); static Error _get_token(const CharType *p_str, int &index, int p_len, Token &r_token, int &line, String &r_err_str); static Error _parse_value(Variant &value, Token &token, const CharType *p_str, int &index, int p_len, int &line, String &r_err_str); @@ -72,7 +72,7 @@ class JSON { static Error _parse_object(Dictionary &object, const CharType *p_str, int &index, int p_len, int &line, String &r_err_str); public: - static String print(const Variant &p_var, const String& p_indent = "", bool p_sort_keys = true); + static String print(const Variant &p_var, const String &p_indent = "", bool p_sort_keys = true); static Error parse(const String &p_json, Variant &r_ret, String &r_err_str, int &r_err_line); }; diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 8f427582aef..676b168371f 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -202,8 +202,9 @@ class EditorHelpSearch::IncrementalSearch : public Reference { } public: - IncrementalSearch(EditorHelpSearch *p_search, Tree *p_search_options, const String &p_term) - : search(p_search), search_options(p_search_options) { + IncrementalSearch(EditorHelpSearch *p_search, Tree *p_search_options, const String &p_term) : + search(p_search), + search_options(p_search_options) { def_icon = search->get_icon("Node", "EditorIcons"); doc = EditorHelp::get_doc_data(); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 0252358a27c..908bc468a0e 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3366,7 +3366,6 @@ void EditorNode::register_editor_types() { ClassDB::register_class(); ClassDB::register_class(); - // FIXME: Is this stuff obsolete, or should it be ported to new APIs? ClassDB::register_class(); //ClassDB::register_type(); diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h index 89a6d3d2500..f45d1c1ecc0 100644 --- a/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -31,11 +31,11 @@ #define EDITOR_PLUGIN_H #include "editor/import/editor_import_plugin.h" +#include "editor/import/resource_importer_scene.h" #include "io/config_file.h" #include "scene/gui/tool_button.h" #include "scene/main/node.h" #include "scene/resources/texture.h" -#include "editor/import/resource_importer_scene.h" #include "undo_redo.h" /** diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index c38391c71b4..c4315f1b833 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -1979,7 +1979,7 @@ Node *EditorSceneImporterCollada::import_scene(const String &p_path, uint32_t p_ return state.scene; } -Ref EditorSceneImporterCollada::import_animation(const String &p_path, uint32_t p_flags,int p_bake_fps) { +Ref EditorSceneImporterCollada::import_animation(const String &p_path, uint32_t p_flags, int p_bake_fps) { ColladaImport state; diff --git a/editor/import/editor_import_collada.h b/editor/import/editor_import_collada.h index 986b5b766fb..904080c19b8 100644 --- a/editor/import/editor_import_collada.h +++ b/editor/import/editor_import_collada.h @@ -40,7 +40,7 @@ public: virtual uint32_t get_import_flags() const; virtual void get_extensions(List *r_extensions) const; virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List *r_missing_deps = NULL, Error *r_err = NULL); - virtual Ref import_animation(const String &p_path, uint32_t p_flags,int p_bake_fps); + virtual Ref import_animation(const String &p_path, uint32_t p_flags, int p_bake_fps); EditorSceneImporterCollada(); }; diff --git a/editor/import/editor_scene_importer_gltf.h b/editor/import/editor_scene_importer_gltf.h index 0c8000427e5..91c584a05ae 100644 --- a/editor/import/editor_scene_importer_gltf.h +++ b/editor/import/editor_scene_importer_gltf.h @@ -296,7 +296,7 @@ public: virtual uint32_t get_import_flags() const; virtual void get_extensions(List *r_extensions) const; virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List *r_missing_deps = NULL, Error *r_err = NULL); - virtual Ref import_animation(const String &p_path, uint32_t p_flags,int p_bake_fps); + virtual Ref import_animation(const String &p_path, uint32_t p_flags, int p_bake_fps); EditorSceneImporterGLTF(); }; diff --git a/editor/import/resource_importer_obj.h b/editor/import/resource_importer_obj.h index 09dc8ac8a19..e66ea47b69c 100644 --- a/editor/import/resource_importer_obj.h +++ b/editor/import/resource_importer_obj.h @@ -40,7 +40,7 @@ public: virtual uint32_t get_import_flags() const; virtual void get_extensions(List *r_extensions) const; virtual Node *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List *r_missing_deps, Error *r_err = NULL); - virtual Ref import_animation(const String &p_path, uint32_t p_flags,int p_bake_fps); + virtual Ref import_animation(const String &p_path, uint32_t p_flags, int p_bake_fps); EditorOBJImporter(); }; diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index d2ce318f82b..ee23f0ea0fc 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -515,7 +515,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a } else { v = "of type '" + _get_var_type(index) + "'"; } - err_text = "Invalid set index " + v + " (on base: '" + _get_var_type(dst) + "') with value of type '"+_get_var_type(value)+"'"; + err_text = "Invalid set index " + v + " (on base: '" + _get_var_type(dst) + "') with value of type '" + _get_var_type(value) + "'"; OPCODE_BREAK; } #endif @@ -574,7 +574,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a #ifdef DEBUG_ENABLED if (!valid) { String err_type; - err_text = "Invalid set index '" + String(*index) + "' (on base: '" + _get_var_type(dst) + "') with value of type '"+_get_var_type(value)+"'."; + err_text = "Invalid set index '" + String(*index) + "' (on base: '" + _get_var_type(dst) + "') with value of type '" + _get_var_type(value) + "'."; OPCODE_BREAK; } #endif diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index ff5cb411357..1f2b43165e5 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -1286,7 +1286,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug) { Ref probe_data = get_probe_data(); - if(probe_data.is_null()) + if (probe_data.is_null()) probe_data.instance(); probe_data->set_bounds(AABB(-extents, extents * 2.0)); diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index c137b7e8ffb..821f1a5a782 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -1189,7 +1189,7 @@ void ParticlesMaterial::set_flag(Flags p_flag, bool p_enable) { ERR_FAIL_INDEX(p_flag, FLAG_MAX); flags[p_flag] = p_enable; _queue_shader_change(); - if (p_flag==FLAG_DISABLE_Z) { + if (p_flag == FLAG_DISABLE_Z) { _change_notify(); } } @@ -1379,7 +1379,7 @@ void ParticlesMaterial::_validate_property(PropertyInfo &property) const { } if (property.name.begins_with("orbit_") && !flags[FLAG_DISABLE_Z]) { - property.usage=0; + property.usage = 0; } }