From 15369fdb1d692e1515dd888dfbae275074be63be Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Sun, 28 Jan 2024 21:51:39 +0100 Subject: [PATCH] Remove unnecessary `this->` expressions --- core/math/convex_hull.cpp | 16 +++++----- core/math/vector2.cpp | 4 +-- core/math/vector3.cpp | 2 +- core/math/vector3.h | 4 +-- core/object/message_queue.cpp | 12 ++++---- core/string/translation_po.cpp | 4 +-- core/string/ustring.cpp | 28 ++++++++--------- core/variant/dictionary.cpp | 2 +- core/variant/variant.cpp | 30 +++++++++---------- core/variant/variant.h | 2 +- drivers/gles3/shader_gles3.cpp | 2 +- editor/editor_audio_buses.cpp | 2 +- editor/editor_help.cpp | 18 +++++------ editor/editor_inspector.cpp | 4 +-- editor/editor_node.cpp | 2 +- editor/export/editor_export_platform.cpp | 2 +- editor/plugins/script_text_editor.cpp | 2 +- editor/plugins/sprite_2d_editor_plugin.cpp | 8 ++--- editor/plugins/text_editor.cpp | 2 +- editor/project_manager.cpp | 2 +- modules/gdscript/gdscript.cpp | 20 ++++++------- modules/gdscript/gdscript_parser.cpp | 8 ++--- modules/gdscript/gdscript_parser.h | 2 +- .../gdscript_extend_parser.cpp | 22 +++++++------- .../gdscript_text_document.cpp | 4 +-- modules/gltf/structures/gltf_skeleton.h | 12 ++++---- modules/navigation/nav_utils.h | 2 +- scene/2d/remote_transform_2d.cpp | 2 +- scene/3d/audio_stream_player_3d.cpp | 14 ++++----- scene/3d/remote_transform_3d.cpp | 2 +- scene/animation/animation_blend_space_1d.cpp | 4 +-- scene/animation/animation_blend_space_2d.cpp | 4 +-- scene/gui/control.cpp | 24 +++++++-------- scene/gui/item_list.cpp | 2 +- scene/gui/popup_menu.cpp | 2 +- scene/gui/tree.cpp | 10 +++---- scene/main/window.cpp | 26 ++++++++-------- .../joints/godot_cone_twist_joint_3d.cpp | 10 +++---- .../joints/godot_generic_6dof_joint_3d.cpp | 2 +- 39 files changed, 160 insertions(+), 160 deletions(-) diff --git a/core/math/convex_hull.cpp b/core/math/convex_hull.cpp index 68d995fe673..478fde3a64f 100644 --- a/core/math/convex_hull.cpp +++ b/core/math/convex_hull.cpp @@ -344,31 +344,31 @@ public: Rational128(int64_t p_value) { if (p_value > 0) { sign = 1; - this->numerator = p_value; + numerator = p_value; } else if (p_value < 0) { sign = -1; - this->numerator = -p_value; + numerator = -p_value; } else { sign = 0; - this->numerator = (uint64_t)0; + numerator = (uint64_t)0; } - this->denominator = (uint64_t)1; + denominator = (uint64_t)1; is_int_64 = true; } Rational128(const Int128 &p_numerator, const Int128 &p_denominator) { sign = p_numerator.get_sign(); if (sign >= 0) { - this->numerator = p_numerator; + numerator = p_numerator; } else { - this->numerator = -p_numerator; + numerator = -p_numerator; } int32_t dsign = p_denominator.get_sign(); if (dsign >= 0) { - this->denominator = p_denominator; + denominator = p_denominator; } else { sign = -sign; - this->denominator = -p_denominator; + denominator = -p_denominator; } is_int_64 = false; } diff --git a/core/math/vector2.cpp b/core/math/vector2.cpp index df8c804243b..42191eccbf2 100644 --- a/core/math/vector2.cpp +++ b/core/math/vector2.cpp @@ -164,7 +164,7 @@ Vector2 Vector2::slide(const Vector2 &p_normal) const { #ifdef MATH_CHECKS ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector2(), "The normal Vector2 must be normalized."); #endif - return *this - p_normal * this->dot(p_normal); + return *this - p_normal * dot(p_normal); } Vector2 Vector2::bounce(const Vector2 &p_normal) const { @@ -175,7 +175,7 @@ Vector2 Vector2::reflect(const Vector2 &p_normal) const { #ifdef MATH_CHECKS ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector2(), "The normal Vector2 must be normalized."); #endif - return 2.0f * p_normal * this->dot(p_normal) - *this; + return 2.0f * p_normal * dot(p_normal) - *this; } bool Vector2::is_equal_approx(const Vector2 &p_v) const { diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp index ae009fc4eff..c483d659a30 100644 --- a/core/math/vector3.cpp +++ b/core/math/vector3.cpp @@ -109,7 +109,7 @@ Vector3 Vector3::octahedron_decode(const Vector2 &p_oct) { Vector2 Vector3::octahedron_tangent_encode(const float sign) const { const float bias = 1.0f / 32767.0f; - Vector2 res = this->octahedron_encode(); + Vector2 res = octahedron_encode(); res.y = MAX(res.y, bias); res.y = res.y * 0.5f + 0.5f; res.y = sign >= 0.0f ? res.y : 1 - res.y; diff --git a/core/math/vector3.h b/core/math/vector3.h index 18943a820f2..bdf49a019ec 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -514,7 +514,7 @@ Vector3 Vector3::slide(const Vector3 &p_normal) const { #ifdef MATH_CHECKS ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector3(), "The normal Vector3 must be normalized."); #endif - return *this - p_normal * this->dot(p_normal); + return *this - p_normal * dot(p_normal); } Vector3 Vector3::bounce(const Vector3 &p_normal) const { @@ -525,7 +525,7 @@ Vector3 Vector3::reflect(const Vector3 &p_normal) const { #ifdef MATH_CHECKS ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector3(), "The normal Vector3 must be normalized."); #endif - return 2.0f * p_normal * this->dot(p_normal) - *this; + return 2.0f * p_normal * dot(p_normal) - *this; } #endif // VECTOR3_H diff --git a/core/object/message_queue.cpp b/core/object/message_queue.cpp index a394c957d01..83a19554dc2 100644 --- a/core/object/message_queue.cpp +++ b/core/object/message_queue.cpp @@ -40,12 +40,12 @@ #ifdef DEV_ENABLED // Includes safety checks to ensure that a queue set as a thread singleton override // is only ever called from the thread it was set for. -#define LOCK_MUTEX \ - if (this != MessageQueue::thread_singleton) { \ - DEV_ASSERT(!this->is_current_thread_override); \ - mutex.lock(); \ - } else { \ - DEV_ASSERT(this->is_current_thread_override); \ +#define LOCK_MUTEX \ + if (this != MessageQueue::thread_singleton) { \ + DEV_ASSERT(!is_current_thread_override); \ + mutex.lock(); \ + } else { \ + DEV_ASSERT(is_current_thread_override); \ } #else #define LOCK_MUTEX \ diff --git a/core/string/translation_po.cpp b/core/string/translation_po.cpp index 6b1595174ad..06fd4717d76 100644 --- a/core/string/translation_po.cpp +++ b/core/string/translation_po.cpp @@ -41,8 +41,8 @@ void TranslationPO::print_translation_map() { return; } - file->store_line("NPlural : " + String::num_int64(this->get_plural_forms())); - file->store_line("Plural rule : " + this->get_plural_rule()); + file->store_line("NPlural : " + String::num_int64(get_plural_forms())); + file->store_line("Plural rule : " + get_plural_rule()); file->store_line(""); List context_l; diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 6afe28a6a72..d094184c4bc 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -302,7 +302,7 @@ void String::copy_from(const char *p_cstr) { resize(len + 1); // include 0 - char32_t *dst = this->ptrw(); + char32_t *dst = ptrw(); for (size_t i = 0; i <= len; i++) { #if CHAR_MIN == 0 @@ -339,7 +339,7 @@ void String::copy_from(const char *p_cstr, const int p_clip_to) { resize(len + 1); // include 0 - char32_t *dst = this->ptrw(); + char32_t *dst = ptrw(); for (int i = 0; i < len; i++) { #if CHAR_MIN == 0 @@ -1043,7 +1043,7 @@ String String::_camelcase_to_underscore() const { String new_string; int start_index = 0; - for (int i = 1; i < this->size(); i++) { + for (int i = 1; i < size(); i++) { bool is_prev_upper = is_ascii_upper_case(cstr[i - 1]); bool is_prev_lower = is_ascii_lower_case(cstr[i - 1]); bool is_prev_digit = is_digit(cstr[i - 1]); @@ -1053,7 +1053,7 @@ String String::_camelcase_to_underscore() const { bool is_curr_digit = is_digit(cstr[i]); bool is_next_lower = false; - if (i + 1 < this->size()) { + if (i + 1 < size()) { is_next_lower = is_ascii_lower_case(cstr[i + 1]); } @@ -1063,17 +1063,17 @@ String String::_camelcase_to_underscore() const { const bool cond_d = (is_prev_upper || is_prev_lower) && is_curr_digit; // A2, a2 if (cond_a || cond_b || cond_c || cond_d) { - new_string += this->substr(start_index, i - start_index) + "_"; + new_string += substr(start_index, i - start_index) + "_"; start_index = i; } } - new_string += this->substr(start_index, this->size() - start_index); + new_string += substr(start_index, size() - start_index); return new_string.to_lower(); } String String::capitalize() const { - String aux = this->_camelcase_to_underscore().replace("_", " ").strip_edges(); + String aux = _camelcase_to_underscore().replace("_", " ").strip_edges(); String cap; for (int i = 0; i < aux.get_slice_count(" "); i++) { String slice = aux.get_slicec(' ', i); @@ -1090,7 +1090,7 @@ String String::capitalize() const { } String String::to_camel_case() const { - String s = this->to_pascal_case(); + String s = to_pascal_case(); if (!s.is_empty()) { s[0] = _find_lower(s[0]); } @@ -1098,11 +1098,11 @@ String String::to_camel_case() const { } String String::to_pascal_case() const { - return this->capitalize().replace(" ", ""); + return capitalize().replace(" ", ""); } String String::to_snake_case() const { - return this->_camelcase_to_underscore().replace(" ", "_").strip_edges(); + return _camelcase_to_underscore().replace(" ", "_").strip_edges(); } String String::get_with_code_lines() const { @@ -1185,7 +1185,7 @@ String String::get_slicec(char32_t p_splitter, int p_slice) const { return String(); } - const char32_t *c = this->ptr(); + const char32_t *c = ptr(); int i = 0; int prev = 0; int count = 0; @@ -3516,7 +3516,7 @@ bool String::matchn(const String &p_wildcard) const { } String String::format(const Variant &values, const String &placeholder) const { - String new_string = String(this->ptr()); + String new_string = String(ptr()); if (values.get_type() == Variant::ARRAY) { Array values_arr = values; @@ -4467,7 +4467,7 @@ bool String::is_valid_float() const { String String::path_to_file(const String &p_path) const { // Don't get base dir for src, this is expected to be a dir already. - String src = this->replace("\\", "/"); + String src = replace("\\", "/"); String dst = p_path.replace("\\", "/").get_base_dir(); String rel = src.path_to(dst); if (rel == dst) { // failed @@ -4478,7 +4478,7 @@ String String::path_to_file(const String &p_path) const { } String String::path_to(const String &p_path) const { - String src = this->replace("\\", "/"); + String src = replace("\\", "/"); String dst = p_path.replace("\\", "/"); if (!src.ends_with("/")) { src += "/"; diff --git a/core/variant/dictionary.cpp b/core/variant/dictionary.cpp index 8b61a8993a1..9f65a73c6fd 100644 --- a/core/variant/dictionary.cpp +++ b/core/variant/dictionary.cpp @@ -251,7 +251,7 @@ void Dictionary::clear() { void Dictionary::merge(const Dictionary &p_dictionary, bool p_overwrite) { for (const KeyValue &E : p_dictionary._p->variant_map) { if (p_overwrite || !has(E.key)) { - this->operator[](E.key) = E.value; + operator[](E.key) = E.value; } } } diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp index c352d800f9a..d918e727558 100644 --- a/core/variant/variant.cpp +++ b/core/variant/variant.cpp @@ -1246,53 +1246,53 @@ void Variant::zero() { case NIL: break; case BOOL: - this->_data._bool = false; + _data._bool = false; break; case INT: - this->_data._int = 0; + _data._int = 0; break; case FLOAT: - this->_data._float = 0; + _data._float = 0; break; case VECTOR2: - *reinterpret_cast(this->_data._mem) = Vector2(); + *reinterpret_cast(_data._mem) = Vector2(); break; case VECTOR2I: - *reinterpret_cast(this->_data._mem) = Vector2i(); + *reinterpret_cast(_data._mem) = Vector2i(); break; case RECT2: - *reinterpret_cast(this->_data._mem) = Rect2(); + *reinterpret_cast(_data._mem) = Rect2(); break; case RECT2I: - *reinterpret_cast(this->_data._mem) = Rect2i(); + *reinterpret_cast(_data._mem) = Rect2i(); break; case VECTOR3: - *reinterpret_cast(this->_data._mem) = Vector3(); + *reinterpret_cast(_data._mem) = Vector3(); break; case VECTOR3I: - *reinterpret_cast(this->_data._mem) = Vector3i(); + *reinterpret_cast(_data._mem) = Vector3i(); break; case VECTOR4: - *reinterpret_cast(this->_data._mem) = Vector4(); + *reinterpret_cast(_data._mem) = Vector4(); break; case VECTOR4I: - *reinterpret_cast(this->_data._mem) = Vector4i(); + *reinterpret_cast(_data._mem) = Vector4i(); break; case PLANE: - *reinterpret_cast(this->_data._mem) = Plane(); + *reinterpret_cast(_data._mem) = Plane(); break; case QUATERNION: - *reinterpret_cast(this->_data._mem) = Quaternion(); + *reinterpret_cast(_data._mem) = Quaternion(); break; case COLOR: - *reinterpret_cast(this->_data._mem) = Color(); + *reinterpret_cast(_data._mem) = Color(); break; default: Type prev_type = type; - this->clear(); + clear(); if (type != prev_type) { // clear() changes type to NIL, so it needs to be restored. Callable::CallError ce; diff --git a/core/variant/variant.h b/core/variant/variant.h index 602d287f224..ef48fa9fba0 100644 --- a/core/variant/variant.h +++ b/core/variant/variant.h @@ -176,7 +176,7 @@ private: struct PackedArrayRefBase { SafeRefCount refcount; _FORCE_INLINE_ PackedArrayRefBase *reference() { - if (this->refcount.ref()) { + if (refcount.ref()) { return this; } else { return nullptr; diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp index 27402da7c84..688d32de0b6 100644 --- a/drivers/gles3/shader_gles3.cpp +++ b/drivers/gles3/shader_gles3.cpp @@ -561,7 +561,7 @@ bool ShaderGLES3::_load_from_cache(Version *p_version) { } int cache_variant_count = static_cast(f->get_32()); - ERR_FAIL_COND_V_MSG(cache_variant_count != this->variant_count, false, "shader cache variant count mismatch, expected " + itos(this->variant_count) + " got " + itos(cache_variant_count)); //should not happen but check + ERR_FAIL_COND_V_MSG(cache_variant_count != variant_count, false, "shader cache variant count mismatch, expected " + itos(variant_count) + " got " + itos(cache_variant_count)); //should not happen but check LocalVector> variants; for (int i = 0; i < cache_variant_count; i++) { diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 61a4b341b92..5127dd43d86 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -328,7 +328,7 @@ void EditorAudioBus::_volume_changed(float p_normalized) { updating_bus = true; - const float p_db = this->_normalized_volume_to_scaled_db(p_normalized); + const float p_db = _normalized_volume_to_scaled_db(p_normalized); if (Input::get_singleton()->is_key_pressed(Key::CMD_OR_CTRL)) { // Snap the value when holding Ctrl for easier editing. diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index f0f7f877111..4dd7bfa4123 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -218,31 +218,31 @@ void EditorHelp::_class_desc_select(const String &p_select) { if (tag == "method") { topic = "class_method"; - table = &this->method_line; + table = &method_line; } else if (tag == "constructor") { topic = "class_method"; - table = &this->method_line; + table = &method_line; } else if (tag == "operator") { topic = "class_method"; - table = &this->method_line; + table = &method_line; } else if (tag == "member") { topic = "class_property"; - table = &this->property_line; + table = &property_line; } else if (tag == "enum") { topic = "class_enum"; - table = &this->enum_line; + table = &enum_line; } else if (tag == "signal") { topic = "class_signal"; - table = &this->signal_line; + table = &signal_line; } else if (tag == "constant") { topic = "class_constant"; - table = &this->constant_line; + table = &constant_line; } else if (tag == "annotation") { topic = "class_annotation"; - table = &this->annotation_line; + table = &annotation_line; } else if (tag == "theme_item") { topic = "theme_item"; - table = &this->theme_property_line; + table = &theme_property_line; } else { return; } diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index a3530fc9abd..8a90aeb4752 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -3777,13 +3777,13 @@ void EditorInspector::_property_changed(const String &p_path, const Variant &p_v // The "changing" variable must be true for properties that trigger events as typing occurs, // like "text_changed" signal. E.g. text property of Label, Button, RichTextLabel, etc. if (p_changing) { - this->changing++; + changing++; } _edit_set(p_path, p_value, p_update_all, p_name); if (p_changing) { - this->changing--; + changing--; } if (restart_request_props.has(p_path)) { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 24bfba3844a..a23c0f7c061 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2331,7 +2331,7 @@ void EditorNode::_edit_current(bool p_skip_foreign) { } bool inspector_only = editor_history.is_current_inspector_only(); - this->current = current_obj; + current = current_obj; if (!current_obj) { SceneTreeDock::get_singleton()->set_selected(nullptr); diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index ee25893a30d..440089022bd 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -1210,7 +1210,7 @@ Error EditorExportPlatform::export_project_files(const Ref & } if (remap_features.size() > 1) { - this->resolve_platform_feature_priorities(p_preset, remap_features); + resolve_platform_feature_priorities(p_preset, remap_features); } err = OK; diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 370144a4271..d8fb55ca543 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -2508,5 +2508,5 @@ void ScriptTextEditor::register_editor() { } void ScriptTextEditor::validate() { - this->code_editor->validate_script(); + code_editor->validate_script(); } diff --git a/editor/plugins/sprite_2d_editor_plugin.cpp b/editor/plugins/sprite_2d_editor_plugin.cpp index c1e70704515..3e98f3d64fb 100644 --- a/editor/plugins/sprite_2d_editor_plugin.cpp +++ b/editor/plugins/sprite_2d_editor_plugin.cpp @@ -416,7 +416,7 @@ void Sprite2DEditor::_create_collision_polygon_2d_node() { ur->create_action(TTR("Create CollisionPolygon2D Sibling")); ur->add_do_method(this, "_add_as_sibling_or_child", node, collision_polygon_2d_instance); ur->add_do_reference(collision_polygon_2d_instance); - ur->add_undo_method(node != this->get_tree()->get_edited_scene_root() ? node->get_parent() : this->get_tree()->get_edited_scene_root(), "remove_child", collision_polygon_2d_instance); + ur->add_undo_method(node != get_tree()->get_edited_scene_root() ? node->get_parent() : get_tree()->get_edited_scene_root(), "remove_child", collision_polygon_2d_instance); ur->commit_action(); } } @@ -449,21 +449,21 @@ void Sprite2DEditor::_create_light_occluder_2d_node() { ur->create_action(TTR("Create LightOccluder2D Sibling")); ur->add_do_method(this, "_add_as_sibling_or_child", node, light_occluder_2d_instance); ur->add_do_reference(light_occluder_2d_instance); - ur->add_undo_method(node != this->get_tree()->get_edited_scene_root() ? node->get_parent() : this->get_tree()->get_edited_scene_root(), "remove_child", light_occluder_2d_instance); + ur->add_undo_method(node != get_tree()->get_edited_scene_root() ? node->get_parent() : get_tree()->get_edited_scene_root(), "remove_child", light_occluder_2d_instance); ur->commit_action(); } } void Sprite2DEditor::_add_as_sibling_or_child(Node *p_own_node, Node *p_new_node) { // Can't make sibling if own node is scene root - if (p_own_node != this->get_tree()->get_edited_scene_root()) { + if (p_own_node != get_tree()->get_edited_scene_root()) { p_own_node->get_parent()->add_child(p_new_node, true); Object::cast_to(p_new_node)->set_transform(Object::cast_to(p_own_node)->get_transform()); } else { p_own_node->add_child(p_new_node, true); } - p_new_node->set_owner(this->get_tree()->get_edited_scene_root()); + p_new_node->set_owner(get_tree()->get_edited_scene_root()); } void Sprite2DEditor::_debug_uv_input(const Ref &p_input) { diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index 3fdb0388f21..a2364278b6f 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -712,5 +712,5 @@ TextEditor::~TextEditor() { } void TextEditor::validate() { - this->code_editor->validate_script(); + code_editor->validate_script(); } diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index fff7b89c013..d18e5a237f3 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -843,7 +843,7 @@ void ProjectManager::shortcut_input(const Ref &p_ev) { } break; case Key::F: { if (k->is_command_or_control_pressed()) { - this->search_box->grab_focus(); + search_box->grab_focus(); } else { keycode_handled = false; } diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 7b486f2a352..02c21618f07 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1696,7 +1696,7 @@ bool GDScriptInstance::get(const StringName &p_name, Variant &r_ret) const { { HashMap::ConstIterator E = sptr->_signals.find(p_name); if (E) { - r_ret = Signal(this->owner, E->key); + r_ret = Signal(owner, E->key); return true; } } @@ -1705,9 +1705,9 @@ bool GDScriptInstance::get(const StringName &p_name, Variant &r_ret) const { HashMap::ConstIterator E = sptr->member_functions.find(p_name); if (E) { if (sptr->rpc_config.has(p_name)) { - r_ret = Callable(memnew(GDScriptRPCCallable(this->owner, E->key))); + r_ret = Callable(memnew(GDScriptRPCCallable(owner, E->key))); } else { - r_ret = Callable(this->owner, E->key); + r_ret = Callable(owner, E->key); } return true; } @@ -2185,7 +2185,7 @@ void GDScriptLanguage::finish() { void GDScriptLanguage::profiling_start() { #ifdef DEBUG_ENABLED - MutexLock lock(this->mutex); + MutexLock lock(mutex); SelfList *elem = function_list.first(); while (elem) { @@ -2216,7 +2216,7 @@ void GDScriptLanguage::profiling_set_save_native_calls(bool p_enable) { void GDScriptLanguage::profiling_stop() { #ifdef DEBUG_ENABLED - MutexLock lock(this->mutex); + MutexLock lock(mutex); profiling = false; #endif @@ -2226,7 +2226,7 @@ int GDScriptLanguage::profiling_get_accumulated_data(ProfilingInfo *p_info_arr, int current = 0; #ifdef DEBUG_ENABLED - MutexLock lock(this->mutex); + MutexLock lock(mutex); profiling_collate_native_call_data(true); SelfList *elem = function_list.first(); @@ -2264,7 +2264,7 @@ int GDScriptLanguage::profiling_get_frame_data(ProfilingInfo *p_info_arr, int p_ int current = 0; #ifdef DEBUG_ENABLED - MutexLock lock(this->mutex); + MutexLock lock(mutex); profiling_collate_native_call_data(false); SelfList *elem = function_list.first(); @@ -2353,7 +2353,7 @@ void GDScriptLanguage::reload_all_scripts() { print_verbose("GDScript: Reloading all scripts"); Array scripts; { - MutexLock lock(this->mutex); + MutexLock lock(mutex); SelfList *elem = script_list.first(); while (elem) { @@ -2387,7 +2387,7 @@ void GDScriptLanguage::reload_scripts(const Array &p_scripts, bool p_soft_reload List> scripts; { - MutexLock lock(this->mutex); + MutexLock lock(mutex); SelfList *elem = script_list.first(); while (elem) { @@ -2519,7 +2519,7 @@ void GDScriptLanguage::frame() { #ifdef DEBUG_ENABLED if (profiling) { - MutexLock lock(this->mutex); + MutexLock lock(mutex); SelfList *elem = function_list.first(); while (elem) { diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 03cf334bed7..2f1b3c1bfd5 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3865,7 +3865,7 @@ bool GDScriptParser::uid_annotation(const AnnotationNode *p_annotation, Node *p_ ERR_FAIL_COND_V(p_annotation->resolved_arguments.is_empty(), false); #ifdef DEBUG_ENABLED - if (this->_has_uid) { + if (_has_uid) { push_error(R"("@uid" annotation can only be used once.)", p_annotation); return false; } @@ -3885,18 +3885,18 @@ bool GDScriptParser::uid_annotation(const AnnotationNode *p_annotation, Node *p_ class_node->uid_string = uid_string; - this->_has_uid = true; + _has_uid = true; return true; } bool GDScriptParser::tool_annotation(const AnnotationNode *p_annotation, Node *p_target, ClassNode *p_class) { #ifdef DEBUG_ENABLED - if (this->_is_tool) { + if (_is_tool) { push_error(R"("@tool" annotation can only be used once.)", p_annotation); return false; } #endif // DEBUG_ENABLED - this->_is_tool = true; + _is_tool = true; return true; } diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index e0587373064..8cbf862f1a3 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -223,7 +223,7 @@ public: } bool operator!=(const DataType &p_other) const { - return !(this->operator==(p_other)); + return !(*this == p_other); } void operator=(const DataType &p_other) { diff --git a/modules/gdscript/language_server/gdscript_extend_parser.cpp b/modules/gdscript/language_server/gdscript_extend_parser.cpp index 36806d2f73e..0f8648e9a34 100644 --- a/modules/gdscript/language_server/gdscript_extend_parser.cpp +++ b/modules/gdscript/language_server/gdscript_extend_parser.cpp @@ -48,17 +48,17 @@ lsp::Position GodotPosition::to_lsp(const Vector &p_lines) const { lsp::Position res; // Special case: `line = 0` -> root class (range covers everything). - if (this->line <= 0) { + if (line <= 0) { return res; } // Special case: `line = p_lines.size() + 1` -> root class (range covers everything). - if (this->line >= p_lines.size() + 1) { + if (line >= p_lines.size() + 1) { res.line = p_lines.size(); return res; } - res.line = this->line - 1; + res.line = line - 1; // Note: character outside of `pos_line.length()-1` is valid. - res.character = this->column - 1; + res.character = column - 1; String pos_line = p_lines[res.line]; if (pos_line.contains("\t")) { @@ -67,7 +67,7 @@ lsp::Position GodotPosition::to_lsp(const Vector &p_lines) const { int in_col = 1; int res_char = 0; - while (res_char < pos_line.size() && in_col < this->column) { + while (res_char < pos_line.size() && in_col < column) { if (pos_line[res_char] == '\t') { in_col += tab_size; res_char++; @@ -211,7 +211,7 @@ void ExtendGDScriptParser::update_document_links(const String &p_code) { String value = const_val; lsp::DocumentLink link; link.target = GDScriptLanguageProtocol::get_singleton()->get_workspace()->get_file_uri(scr_path); - link.range = GodotRange(GodotPosition(token.start_line, token.start_column), GodotPosition(token.end_line, token.end_column)).to_lsp(this->lines); + link.range = GodotRange(GodotPosition(token.start_line, token.start_column), GodotPosition(token.end_line, token.end_column)).to_lsp(lines); document_links.push_back(link); } } @@ -222,7 +222,7 @@ void ExtendGDScriptParser::update_document_links(const String &p_code) { lsp::Range ExtendGDScriptParser::range_of_node(const GDScriptParser::Node *p_node) const { GodotPosition start(p_node->start_line, p_node->start_column); GodotPosition end(p_node->end_line, p_node->end_column); - return GodotRange(start, end).to_lsp(this->lines); + return GodotRange(start, end).to_lsp(lines); } void ExtendGDScriptParser::parse_class_symbol(const GDScriptParser::ClassNode *p_class, lsp::DocumentSymbol &r_symbol) { @@ -394,8 +394,8 @@ void ExtendGDScriptParser::parse_class_symbol(const GDScriptParser::ClassNode *p symbol.name = m.enum_value.identifier->name; symbol.kind = lsp::SymbolKind::EnumMember; symbol.deprecated = false; - symbol.range.start = GodotPosition(m.enum_value.line, m.enum_value.leftmost_column).to_lsp(this->lines); - symbol.range.end = GodotPosition(m.enum_value.line, m.enum_value.rightmost_column).to_lsp(this->lines); + symbol.range.start = GodotPosition(m.enum_value.line, m.enum_value.leftmost_column).to_lsp(lines); + symbol.range.end = GodotPosition(m.enum_value.line, m.enum_value.rightmost_column).to_lsp(lines); symbol.selectionRange = range_of_node(m.enum_value.identifier); symbol.documentation = m.enum_value.doc_data.description; symbol.uri = uri; @@ -430,8 +430,8 @@ void ExtendGDScriptParser::parse_class_symbol(const GDScriptParser::ClassNode *p child.name = value.identifier->name; child.kind = lsp::SymbolKind::EnumMember; child.deprecated = false; - child.range.start = GodotPosition(value.line, value.leftmost_column).to_lsp(this->lines); - child.range.end = GodotPosition(value.line, value.rightmost_column).to_lsp(this->lines); + child.range.start = GodotPosition(value.line, value.leftmost_column).to_lsp(lines); + child.range.end = GodotPosition(value.line, value.rightmost_column).to_lsp(lines); child.selectionRange = range_of_node(value.identifier); child.documentation = value.doc_data.description; child.uri = uri; diff --git a/modules/gdscript/language_server/gdscript_text_document.cpp b/modules/gdscript/language_server/gdscript_text_document.cpp index e00b92b752f..9bf458e031c 100644 --- a/modules/gdscript/language_server/gdscript_text_document.cpp +++ b/modules/gdscript/language_server/gdscript_text_document.cpp @@ -421,7 +421,7 @@ Array GDScriptTextDocument::definition(const Dictionary &p_params) { lsp::TextDocumentPositionParams params; params.load(p_params); List symbols; - Array arr = this->find_symbols(params, symbols); + Array arr = find_symbols(params, symbols); return arr; } @@ -429,7 +429,7 @@ Variant GDScriptTextDocument::declaration(const Dictionary &p_params) { lsp::TextDocumentPositionParams params; params.load(p_params); List symbols; - Array arr = this->find_symbols(params, symbols); + Array arr = find_symbols(params, symbols); if (arr.is_empty() && !symbols.is_empty() && !symbols.front()->get()->native_class.is_empty()) { // Find a native symbol const lsp::DocumentSymbol *symbol = symbols.front()->get(); if (GDScriptLanguageProtocol::get_singleton()->is_goto_native_symbols_enabled()) { diff --git a/modules/gltf/structures/gltf_skeleton.h b/modules/gltf/structures/gltf_skeleton.h index b2f2dcb2a2d..db5ce7e338b 100644 --- a/modules/gltf/structures/gltf_skeleton.h +++ b/modules/gltf/structures/gltf_skeleton.h @@ -70,29 +70,29 @@ public: Skeleton3D *get_godot_skeleton(); // Skeleton *get_godot_skeleton() { - // return this->godot_skeleton; + // return godot_skeleton; // } // void set_godot_skeleton(Skeleton p_*godot_skeleton) { - // this->godot_skeleton = p_godot_skeleton; + // godot_skeleton = p_godot_skeleton; // } TypedArray get_unique_names(); void set_unique_names(TypedArray p_unique_names); //RBMap get_godot_bone_node() { - // return this->godot_bone_node; + // return godot_bone_node; //} //void set_godot_bone_node(const RBMap &p_godot_bone_node) { - // this->godot_bone_node = p_godot_bone_node; + // godot_bone_node = p_godot_bone_node; //} Dictionary get_godot_bone_node(); void set_godot_bone_node(Dictionary p_indict); //Dictionary get_godot_bone_node() { - // return VariantConversion::to_dict(this->godot_bone_node); + // return VariantConversion::to_dict(godot_bone_node); //} //void set_godot_bone_node(Dictionary p_indict) { - // VariantConversion::set_from_dict(this->godot_bone_node, p_indict); + // VariantConversion::set_from_dict(godot_bone_node, p_indict); //} BoneAttachment3D *get_bone_attachment(int idx); diff --git a/modules/navigation/nav_utils.h b/modules/navigation/nav_utils.h index aa5ccc96dc8..175d08ca6d0 100644 --- a/modules/navigation/nav_utils.h +++ b/modules/navigation/nav_utils.h @@ -138,7 +138,7 @@ struct NavigationPoly { poly(p_poly) {} bool operator==(const NavigationPoly &other) const { - return this->poly == other.poly; + return poly == other.poly; } bool operator!=(const NavigationPoly &other) const { diff --git a/scene/2d/remote_transform_2d.cpp b/scene/2d/remote_transform_2d.cpp index f7de4f3376b..5ea5098475f 100644 --- a/scene/2d/remote_transform_2d.cpp +++ b/scene/2d/remote_transform_2d.cpp @@ -34,7 +34,7 @@ void RemoteTransform2D::_update_cache() { cache = ObjectID(); if (has_node(remote_node)) { Node *node = get_node(remote_node); - if (!node || this == node || node->is_ancestor_of(this) || this->is_ancestor_of(node)) { + if (!node || this == node || node->is_ancestor_of(this) || is_ancestor_of(node)) { return; } diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index b01be4dffbf..49bcb77ea72 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -53,8 +53,8 @@ private: public: Spcap(unsigned int speaker_count, const Vector3 *speaker_directions) { - this->speakers.resize(speaker_count); - Speaker *w = this->speakers.ptrw(); + speakers.resize(speaker_count); + Speaker *w = speakers.ptrw(); for (unsigned int speaker_num = 0; speaker_num < speaker_count; speaker_num++) { w[speaker_num].direction = speaker_directions[speaker_num]; w[speaker_num].squared_gain = 0.0; @@ -66,23 +66,23 @@ public: } unsigned int get_speaker_count() const { - return (unsigned int)this->speakers.size(); + return (unsigned int)speakers.size(); } Vector3 get_speaker_direction(unsigned int index) const { - return this->speakers.ptr()[index].direction; + return speakers.ptr()[index].direction; } void calculate(const Vector3 &source_direction, real_t tightness, unsigned int volume_count, real_t *volumes) const { - const Speaker *r = this->speakers.ptr(); + const Speaker *r = speakers.ptr(); real_t sum_squared_gains = 0.0; - for (unsigned int speaker_num = 0; speaker_num < (unsigned int)this->speakers.size(); speaker_num++) { + for (unsigned int speaker_num = 0; speaker_num < (unsigned int)speakers.size(); speaker_num++) { real_t initial_gain = 0.5 * powf(1.0 + r[speaker_num].direction.dot(source_direction), tightness) / r[speaker_num].effective_number_of_speakers; r[speaker_num].squared_gain = initial_gain * initial_gain; sum_squared_gains += r[speaker_num].squared_gain; } - for (unsigned int speaker_num = 0; speaker_num < MIN(volume_count, (unsigned int)this->speakers.size()); speaker_num++) { + for (unsigned int speaker_num = 0; speaker_num < MIN(volume_count, (unsigned int)speakers.size()); speaker_num++) { volumes[speaker_num] = sqrtf(r[speaker_num].squared_gain / sum_squared_gains); } } diff --git a/scene/3d/remote_transform_3d.cpp b/scene/3d/remote_transform_3d.cpp index add58da4bac..8d6e7171321 100644 --- a/scene/3d/remote_transform_3d.cpp +++ b/scene/3d/remote_transform_3d.cpp @@ -34,7 +34,7 @@ void RemoteTransform3D::_update_cache() { cache = ObjectID(); if (has_node(remote_node)) { Node *node = get_node(remote_node); - if (!node || this == node || node->is_ancestor_of(this) || this->is_ancestor_of(node)) { + if (!node || this == node || node->is_ancestor_of(this) || is_ancestor_of(node)) { return; } diff --git a/scene/animation/animation_blend_space_1d.cpp b/scene/animation/animation_blend_space_1d.cpp index 981bb88bc4e..4cbd9b1d762 100644 --- a/scene/animation/animation_blend_space_1d.cpp +++ b/scene/animation/animation_blend_space_1d.cpp @@ -401,8 +401,8 @@ double AnimationNodeBlendSpace1D::_process(const AnimationMixer::PlaybackInfo p_ } } - set_parameter(this->closest, cur_closest); - set_parameter(this->length_internal, cur_length_internal); + set_parameter(closest, cur_closest); + set_parameter(length_internal, cur_length_internal); return max_time_remaining; } diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp index dbec2be0bac..d5c6253e9d0 100644 --- a/scene/animation/animation_blend_space_2d.cpp +++ b/scene/animation/animation_blend_space_2d.cpp @@ -579,8 +579,8 @@ double AnimationNodeBlendSpace2D::_process(const AnimationMixer::PlaybackInfo p_ } } - set_parameter(this->closest, cur_closest); - set_parameter(this->length_internal, cur_length_internal); + set_parameter(closest, cur_closest); + set_parameter(length_internal, cur_length_internal); return mind; } diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index a7be5c9af0c..3f48f04d4b5 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2550,7 +2550,7 @@ StringName Control::get_theme_type_variation() const { Ref Control::get_theme_icon(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(Ref()); if (!data.initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_type_variation) { @@ -2574,7 +2574,7 @@ Ref Control::get_theme_icon(const StringName &p_name, const StringNam Ref Control::get_theme_stylebox(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(Ref()); if (!data.initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_type_variation) { @@ -2598,7 +2598,7 @@ Ref Control::get_theme_stylebox(const StringName &p_name, const String Ref Control::get_theme_font(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(Ref()); if (!data.initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_type_variation) { @@ -2622,7 +2622,7 @@ Ref Control::get_theme_font(const StringName &p_name, const StringName &p_ int Control::get_theme_font_size(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(0); if (!data.initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_type_variation) { @@ -2646,7 +2646,7 @@ int Control::get_theme_font_size(const StringName &p_name, const StringName &p_t Color Control::get_theme_color(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(Color()); if (!data.initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_type_variation) { @@ -2670,7 +2670,7 @@ Color Control::get_theme_color(const StringName &p_name, const StringName &p_the int Control::get_theme_constant(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(0); if (!data.initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_type_variation) { @@ -2721,7 +2721,7 @@ Ref Control::get_editor_theme_icon(const StringName &p_name) const { bool Control::has_theme_icon(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(false); if (!data.initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_type_variation) { @@ -2738,7 +2738,7 @@ bool Control::has_theme_icon(const StringName &p_name, const StringName &p_theme bool Control::has_theme_stylebox(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(false); if (!data.initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_type_variation) { @@ -2755,7 +2755,7 @@ bool Control::has_theme_stylebox(const StringName &p_name, const StringName &p_t bool Control::has_theme_font(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(false); if (!data.initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_type_variation) { @@ -2772,7 +2772,7 @@ bool Control::has_theme_font(const StringName &p_name, const StringName &p_theme bool Control::has_theme_font_size(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(false); if (!data.initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_type_variation) { @@ -2789,7 +2789,7 @@ bool Control::has_theme_font_size(const StringName &p_name, const StringName &p_ bool Control::has_theme_color(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(false); if (!data.initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_type_variation) { @@ -2806,7 +2806,7 @@ bool Control::has_theme_color(const StringName &p_name, const StringName &p_them bool Control::has_theme_constant(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(false); if (!data.initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_type_variation) { diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index e9d34fae3b1..65184727576 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -1619,7 +1619,7 @@ Vector ItemList::get_selected_items() { for (int i = 0; i < items.size(); i++) { if (items[i].selected) { selected.push_back(i); - if (this->select_mode == SELECT_SINGLE) { + if (select_mode == SELECT_SINGLE) { break; } } diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index dc586e86c93..38c326773dd 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -74,7 +74,7 @@ String PopupMenu::bind_global_menu() { global_menu_name = "__PopupMenu#" + itos(get_instance_id()); if (system_menu_name.length() > 0) { if (system_menus.has(system_menu_name)) { - WARN_PRINT(vformat("Attempting to bind PopupMenu to the special menu %s, but another menu is already bound to it. This menu: %s, current menu: %s", system_menu_name, this->get_description(), system_menus[system_menu_name]->get_description())); + WARN_PRINT(vformat("Attempting to bind PopupMenu to the special menu %s, but another menu is already bound to it. This menu: %s, current menu: %s", system_menu_name, get_description(), system_menus[system_menu_name]->get_description())); } else { const Dictionary &supported_special_names = DisplayServer::get_singleton()->global_menu_get_system_menu_roots(); if (supported_special_names.has(system_menu_name)) { diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 4ecbc173b7f..a402c8b256d 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -868,7 +868,7 @@ TreeItem *TreeItem::_get_prev_in_tree(bool p_wrap, bool p_include_invisible) { } else if (!current) { if (p_wrap) { current = this; - TreeItem *temp = this->get_next_visible(); + TreeItem *temp = get_next_visible(); while (temp) { current = temp; temp = temp->get_next_visible(); @@ -894,7 +894,7 @@ TreeItem *TreeItem::_get_prev_in_tree(bool p_wrap, bool p_include_invisible) { TreeItem *TreeItem::get_prev_visible(bool p_wrap) { TreeItem *loop = this; - TreeItem *prev_item = this->_get_prev_in_tree(p_wrap); + TreeItem *prev_item = _get_prev_in_tree(p_wrap); while (prev_item && !prev_item->is_visible()) { prev_item = prev_item->_get_prev_in_tree(p_wrap); if (prev_item == loop) { @@ -935,7 +935,7 @@ TreeItem *TreeItem::_get_next_in_tree(bool p_wrap, bool p_include_invisible) { TreeItem *TreeItem::get_next_visible(bool p_wrap) { TreeItem *loop = this; - TreeItem *next_item = this->_get_next_in_tree(p_wrap); + TreeItem *next_item = _get_next_in_tree(p_wrap); while (next_item && !next_item->is_visible()) { next_item = next_item->_get_next_in_tree(p_wrap); if (next_item == loop) { @@ -948,12 +948,12 @@ TreeItem *TreeItem::get_next_visible(bool p_wrap) { } TreeItem *TreeItem::get_prev_in_tree(bool p_wrap) { - TreeItem *prev_item = this->_get_prev_in_tree(p_wrap, true); + TreeItem *prev_item = _get_prev_in_tree(p_wrap, true); return prev_item; } TreeItem *TreeItem::get_next_in_tree(bool p_wrap) { - TreeItem *next_item = this->_get_next_in_tree(p_wrap, true); + TreeItem *next_item = _get_next_in_tree(p_wrap, true); return next_item; } diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 70b70b89289..99f9e11b1f5 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -911,7 +911,7 @@ void Window::_set_transient_exclusive_child(bool p_clear_invalid) { if (!is_in_edited_scene_root()) { // Transient parent has another exclusive child. if (transient_parent->exclusive_child && transient_parent->exclusive_child != this) { - ERR_PRINT(vformat("Attempting to make child window exclusive, but the parent window already has another exclusive child. This window: %s, parent window: %s, current exclusive child window: %s", this->get_description(), transient_parent->get_description(), transient_parent->exclusive_child->get_description())); + ERR_PRINT(vformat("Attempting to make child window exclusive, but the parent window already has another exclusive child. This window: %s, parent window: %s, current exclusive child window: %s", get_description(), transient_parent->get_description(), transient_parent->exclusive_child->get_description())); } transient_parent->exclusive_child = this; } @@ -2066,7 +2066,7 @@ StringName Window::get_theme_type_variation() const { Ref Window::get_theme_icon(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(Ref()); if (!initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == theme_type_variation) { @@ -2090,7 +2090,7 @@ Ref Window::get_theme_icon(const StringName &p_name, const StringName Ref Window::get_theme_stylebox(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(Ref()); if (!initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == theme_type_variation) { @@ -2114,7 +2114,7 @@ Ref Window::get_theme_stylebox(const StringName &p_name, const StringN Ref Window::get_theme_font(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(Ref()); if (!initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == theme_type_variation) { @@ -2138,7 +2138,7 @@ Ref Window::get_theme_font(const StringName &p_name, const StringName &p_t int Window::get_theme_font_size(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(0); if (!initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == theme_type_variation) { @@ -2162,7 +2162,7 @@ int Window::get_theme_font_size(const StringName &p_name, const StringName &p_th Color Window::get_theme_color(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(Color()); if (!initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == theme_type_variation) { @@ -2186,7 +2186,7 @@ Color Window::get_theme_color(const StringName &p_name, const StringName &p_them int Window::get_theme_constant(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(0); if (!initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == theme_type_variation) { @@ -2237,7 +2237,7 @@ Ref Window::get_editor_theme_icon(const StringName &p_name) const { bool Window::has_theme_icon(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(false); if (!initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == theme_type_variation) { @@ -2254,7 +2254,7 @@ bool Window::has_theme_icon(const StringName &p_name, const StringName &p_theme_ bool Window::has_theme_stylebox(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(false); if (!initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == theme_type_variation) { @@ -2271,7 +2271,7 @@ bool Window::has_theme_stylebox(const StringName &p_name, const StringName &p_th bool Window::has_theme_font(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(false); if (!initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == theme_type_variation) { @@ -2288,7 +2288,7 @@ bool Window::has_theme_font(const StringName &p_name, const StringName &p_theme_ bool Window::has_theme_font_size(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(false); if (!initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == theme_type_variation) { @@ -2305,7 +2305,7 @@ bool Window::has_theme_font_size(const StringName &p_name, const StringName &p_t bool Window::has_theme_color(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(false); if (!initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == theme_type_variation) { @@ -2322,7 +2322,7 @@ bool Window::has_theme_color(const StringName &p_name, const StringName &p_theme bool Window::has_theme_constant(const StringName &p_name, const StringName &p_theme_type) const { ERR_READ_THREAD_GUARD_V(false); if (!initialized) { - WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", this->get_description())); + WARN_PRINT_ONCE(vformat("Attempting to access theme items too early in %s; prefer NOTIFICATION_POSTINITIALIZE and NOTIFICATION_THEME_CHANGED", get_description())); } if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == theme_type_variation) { diff --git a/servers/physics_3d/joints/godot_cone_twist_joint_3d.cpp b/servers/physics_3d/joints/godot_cone_twist_joint_3d.cpp index c654756d3ca..40914227898 100644 --- a/servers/physics_3d/joints/godot_cone_twist_joint_3d.cpp +++ b/servers/physics_3d/joints/godot_cone_twist_joint_3d.cpp @@ -114,8 +114,8 @@ bool GodotConeTwistJoint3D::setup(real_t p_timestep) { Vector3 b1Axis1, b1Axis2, b1Axis3; Vector3 b2Axis1, b2Axis2; - b1Axis1 = A->get_transform().basis.xform(this->m_rbAFrame.basis.get_column(0)); - b2Axis1 = B->get_transform().basis.xform(this->m_rbBFrame.basis.get_column(0)); + b1Axis1 = A->get_transform().basis.xform(m_rbAFrame.basis.get_column(0)); + b2Axis1 = B->get_transform().basis.xform(m_rbBFrame.basis.get_column(0)); real_t swing1 = real_t(0.), swing2 = real_t(0.); @@ -125,7 +125,7 @@ bool GodotConeTwistJoint3D::setup(real_t p_timestep) { // Get Frame into world space if (m_swingSpan1 >= real_t(0.05f)) { - b1Axis2 = A->get_transform().basis.xform(this->m_rbAFrame.basis.get_column(1)); + b1Axis2 = A->get_transform().basis.xform(m_rbAFrame.basis.get_column(1)); //swing1 = btAtan2Fast( b2Axis1.dot(b1Axis2),b2Axis1.dot(b1Axis1) ); swx = b2Axis1.dot(b1Axis1); swy = b2Axis1.dot(b1Axis2); @@ -136,7 +136,7 @@ bool GodotConeTwistJoint3D::setup(real_t p_timestep) { } if (m_swingSpan2 >= real_t(0.05f)) { - b1Axis3 = A->get_transform().basis.xform(this->m_rbAFrame.basis.get_column(2)); + b1Axis3 = A->get_transform().basis.xform(m_rbAFrame.basis.get_column(2)); //swing2 = btAtan2Fast( b2Axis1.dot(b1Axis3),b2Axis1.dot(b1Axis1) ); swx = b2Axis1.dot(b1Axis1); swy = b2Axis1.dot(b1Axis3); @@ -166,7 +166,7 @@ bool GodotConeTwistJoint3D::setup(real_t p_timestep) { // Twist limits if (m_twistSpan >= real_t(0.)) { - Vector3 b2Axis22 = B->get_transform().basis.xform(this->m_rbBFrame.basis.get_column(1)); + Vector3 b2Axis22 = B->get_transform().basis.xform(m_rbBFrame.basis.get_column(1)); Quaternion rotationArc = Quaternion(b2Axis1, b1Axis1); Vector3 TwistRef = rotationArc.xform(b2Axis22); real_t twist = atan2fast(TwistRef.dot(b1Axis3), TwistRef.dot(b1Axis2)); diff --git a/servers/physics_3d/joints/godot_generic_6dof_joint_3d.cpp b/servers/physics_3d/joints/godot_generic_6dof_joint_3d.cpp index 8ad3af2f72d..226f8a0f7fe 100644 --- a/servers/physics_3d/joints/godot_generic_6dof_joint_3d.cpp +++ b/servers/physics_3d/joints/godot_generic_6dof_joint_3d.cpp @@ -360,7 +360,7 @@ bool GodotGeneric6DOFJoint3D::setup(real_t p_timestep) { for (i = 0; i < 3; i++) { //calculates error angle if (m_angularLimits[i].m_enableLimit && testAngularLimitMotor(i)) { - normalWorld = this->getAxis(i); + normalWorld = getAxis(i); // Create angular atom buildAngularJacobian(m_jacAng[i], normalWorld); }