diff --git a/core/class_db.cpp b/core/class_db.cpp index 2cbf53ba0bb..794d9900838 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -1148,7 +1148,7 @@ Variant::Type ClassDB::get_property_type(const StringName &p_class, const String return Variant::NIL; } -StringName ClassDB::get_property_setter(StringName p_class, const StringName p_property) { +StringName ClassDB::get_property_setter(StringName p_class, const StringName &p_property) { ClassInfo *type = classes.getptr(p_class); ClassInfo *check = type; @@ -1165,7 +1165,7 @@ StringName ClassDB::get_property_setter(StringName p_class, const StringName p_p return StringName(); } -StringName ClassDB::get_property_getter(StringName p_class, const StringName p_property) { +StringName ClassDB::get_property_getter(StringName p_class, const StringName &p_property) { ClassInfo *type = classes.getptr(p_class); ClassInfo *check = type; diff --git a/core/class_db.h b/core/class_db.h index 237ae9b8062..3d9a695f028 100644 --- a/core/class_db.h +++ b/core/class_db.h @@ -337,8 +337,8 @@ public: static bool has_property(const StringName &p_class, const StringName &p_property, bool p_no_inheritance = false); static int get_property_index(const StringName &p_class, const StringName &p_property, bool *r_is_valid = NULL); static Variant::Type get_property_type(const StringName &p_class, const StringName &p_property, bool *r_is_valid = NULL); - static StringName get_property_setter(StringName p_class, const StringName p_property); - static StringName get_property_getter(StringName p_class, const StringName p_property); + static StringName get_property_setter(StringName p_class, const StringName &p_property); + static StringName get_property_getter(StringName p_class, const StringName &p_property); static bool has_method(StringName p_class, StringName p_method, bool p_no_inheritance = false); static void set_method_flags(StringName p_class, StringName p_method, int p_flags); diff --git a/core/math/basis.cpp b/core/math/basis.cpp index 1540bc8fe19..400f3420184 100644 --- a/core/math/basis.cpp +++ b/core/math/basis.cpp @@ -852,7 +852,7 @@ void Basis::set_quat_scale(const Quat &p_quat, const Vector3 &p_scale) { rotate(p_quat); } -void Basis::set_diagonal(const Vector3 p_diag) { +void Basis::set_diagonal(const Vector3 &p_diag) { elements[0][0] = p_diag.x; elements[0][1] = 0; elements[0][2] = 0; diff --git a/core/math/basis.h b/core/math/basis.h index 75037c2c52e..d3adad3d90f 100644 --- a/core/math/basis.h +++ b/core/math/basis.h @@ -153,7 +153,7 @@ public: int get_orthogonal_index() const; void set_orthogonal_index(int p_index); - void set_diagonal(const Vector3 p_diag); + void set_diagonal(const Vector3 &p_diag); bool is_orthogonal() const; bool is_diagonal() const; diff --git a/core/project_settings.cpp b/core/project_settings.cpp index 3597e2b818c..c1d4967f556 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -487,7 +487,7 @@ void ProjectSettings::set_registering_order(bool p_enable) { registering_order = p_enable; } -Error ProjectSettings::_load_settings_binary(const String p_path) { +Error ProjectSettings::_load_settings_binary(const String &p_path) { Error err; FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err); @@ -530,7 +530,7 @@ Error ProjectSettings::_load_settings_binary(const String p_path) { return OK; } -Error ProjectSettings::_load_settings_text(const String p_path) { +Error ProjectSettings::_load_settings_text(const String &p_path) { Error err; FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err); @@ -593,7 +593,7 @@ Error ProjectSettings::_load_settings_text(const String p_path) { } } -Error ProjectSettings::_load_settings_text_or_binary(const String p_text_path, const String p_bin_path) { +Error ProjectSettings::_load_settings_text_or_binary(const String &p_text_path, const String &p_bin_path) { // Attempt first to load the text-based project.godot file Error err_text = _load_settings_text(p_text_path); diff --git a/core/project_settings.h b/core/project_settings.h index 0ff18ab3f5e..d7651417d56 100644 --- a/core/project_settings.h +++ b/core/project_settings.h @@ -97,9 +97,9 @@ protected: static ProjectSettings *singleton; - Error _load_settings_text(const String p_path); - Error _load_settings_binary(const String p_path); - Error _load_settings_text_or_binary(const String p_text_path, const String p_bin_path); + Error _load_settings_text(const String &p_path); + Error _load_settings_binary(const String &p_path); + Error _load_settings_text_or_binary(const String &p_text_path, const String &p_bin_path); Error _save_settings_text(const String &p_file, const Map > &props, const CustomMap &p_custom = CustomMap(), const String &p_custom_features = String()); Error _save_settings_binary(const String &p_file, const Map > &props, const CustomMap &p_custom = CustomMap(), const String &p_custom_features = String()); diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp index f8e771aea0e..6a57a2e5626 100644 --- a/drivers/unix/net_socket_posix.cpp +++ b/drivers/unix/net_socket_posix.cpp @@ -212,7 +212,7 @@ NetSocketPosix::NetError NetSocketPosix::_get_socket_error() { #pragma GCC diagnostic pop #endif -bool NetSocketPosix::_can_use_ip(const IP_Address p_ip, const bool p_for_bind) const { +bool NetSocketPosix::_can_use_ip(const IP_Address &p_ip, const bool p_for_bind) const { if (p_for_bind && !(p_ip.is_valid() || p_ip.is_wildcard())) { return false; diff --git a/drivers/unix/net_socket_posix.h b/drivers/unix/net_socket_posix.h index ce6dc00d422..40406b241ad 100644 --- a/drivers/unix/net_socket_posix.h +++ b/drivers/unix/net_socket_posix.h @@ -65,7 +65,7 @@ private: protected: static NetSocket *_create_func(); - bool _can_use_ip(const IP_Address p_ip, const bool p_for_bind) const; + bool _can_use_ip(const IP_Address &p_ip, const bool p_for_bind) const; public: static void make_default(); diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index f2e4d1086b9..327e61cea30 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -50,7 +50,7 @@ bool EditorResourcePreviewGenerator::handles(const String &p_type) const { ERR_FAIL_V(false); } -Ref EditorResourcePreviewGenerator::generate(const RES &p_from, const Size2 p_size) const { +Ref EditorResourcePreviewGenerator::generate(const RES &p_from, const Size2 &p_size) const { if (get_script_instance() && get_script_instance()->has_method("generate")) { return get_script_instance()->call("generate", p_from, p_size); @@ -59,7 +59,7 @@ Ref EditorResourcePreviewGenerator::generate(const RES &p_from, const S ERR_FAIL_V(Ref()); } -Ref EditorResourcePreviewGenerator::generate_from_path(const String &p_path, const Size2 p_size) const { +Ref EditorResourcePreviewGenerator::generate_from_path(const String &p_path, const Size2 &p_size) const { if (get_script_instance() && get_script_instance()->has_method("generate_from_path")) { return get_script_instance()->call("generate_from_path", p_path, p_size); diff --git a/editor/editor_resource_preview.h b/editor/editor_resource_preview.h index e0fd54c9244..ad4136e9ab7 100644 --- a/editor/editor_resource_preview.h +++ b/editor/editor_resource_preview.h @@ -45,8 +45,8 @@ protected: public: virtual bool handles(const String &p_type) const; - virtual Ref generate(const RES &p_from, const Size2 p_size) const; - virtual Ref generate_from_path(const String &p_path, const Size2 p_size) const; + virtual Ref generate(const RES &p_from, const Size2 &p_size) const; + virtual Ref generate_from_path(const String &p_path, const Size2 &p_size) const; virtual bool generate_small_preview_automatically() const; virtual bool can_generate_small_preview() const; diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp index 4bd68a593f0..e4e32b2ce0a 100644 --- a/editor/editor_run.cpp +++ b/editor/editor_run.cpp @@ -37,7 +37,7 @@ EditorRun::Status EditorRun::get_status() const { return status; } -Error EditorRun::run(const String &p_scene, const String p_custom_args, const List &p_breakpoints) { +Error EditorRun::run(const String &p_scene, const String &p_custom_args, const List &p_breakpoints) { List args; diff --git a/editor/editor_run.h b/editor/editor_run.h index c27c8a05c8e..9127c620304 100644 --- a/editor/editor_run.h +++ b/editor/editor_run.h @@ -51,7 +51,7 @@ private: public: Status get_status() const; - Error run(const String &p_scene, const String p_custom_args, const List &p_breakpoints); + Error run(const String &p_scene, const String &p_custom_args, const List &p_breakpoints); void run_native_notify() { status = STATUS_PLAY; } void stop(); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index b74350c98b4..947d96f8977 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -163,7 +163,7 @@ Vector FileSystemDock::_compute_uncollapsed_paths() { return uncollapsed_paths; } -void FileSystemDock::_update_tree(const Vector p_uncollapsed_paths, bool p_uncollapse_root, bool p_select_in_favorites) { +void FileSystemDock::_update_tree(const Vector &p_uncollapsed_paths, bool p_uncollapse_root, bool p_select_in_favorites) { // Recreate the tree tree->clear(); @@ -812,7 +812,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { } } -void FileSystemDock::_select_file(const String p_path, bool p_select_in_favorites) { +void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorites) { String fpath = p_path; if (fpath.ends_with("/")) { if (fpath != "res://") { @@ -1502,7 +1502,7 @@ void FileSystemDock::_file_list_rmb_option(int p_option) { _file_option(p_option, selected); } -void FileSystemDock::_file_option(int p_option, const Vector p_selected) { +void FileSystemDock::_file_option(int p_option, const Vector &p_selected) { // The first one should be the active item switch (p_option) { diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 76f92665dbd..6de370ad291 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -175,7 +175,7 @@ private: Ref _get_tree_item_icon(EditorFileSystemDirectory *p_dir, int p_idx); bool _create_tree(TreeItem *p_parent, EditorFileSystemDirectory *p_dir, Vector &uncollapsed_paths, bool p_select_in_favorites); Vector _compute_uncollapsed_paths(); - void _update_tree(const Vector p_uncollapsed_paths = Vector(), bool p_uncollapse_root = false, bool p_select_in_favorites = false); + void _update_tree(const Vector &p_uncollapsed_paths = Vector(), bool p_uncollapse_root = false, bool p_select_in_favorites = false); void _navigate_to_path(const String &p_path, bool p_select_in_favorites = false); void _file_list_gui_input(Ref p_event); @@ -188,7 +188,7 @@ private: void _tree_toggle_collapsed(); - void _select_file(const String p_path, bool p_select_in_favorites = false); + void _select_file(const String &p_path, bool p_select_in_favorites = false); void _tree_activate_file(); void _file_list_activate_file(int p_idx); void _file_multi_selected(int p_index, bool p_selected); @@ -221,7 +221,7 @@ private: void _tree_rmb_option(int p_option); void _file_list_rmb_option(int p_option); - void _file_option(int p_option, const Vector p_selected); + void _file_option(int p_option, const Vector &p_selected); void _fw_history(); void _bw_history(); diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index d2d2b8f1303..dafd1e6f604 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -783,7 +783,7 @@ bool CurvePreviewGenerator::handles(const String &p_type) const { return p_type == "Curve"; } -Ref CurvePreviewGenerator::generate(const Ref &p_from, const Size2 p_size) const { +Ref CurvePreviewGenerator::generate(const Ref &p_from, const Size2 &p_size) const { Ref curve_ref = p_from; ERR_FAIL_COND_V(curve_ref.is_null(), Ref()); diff --git a/editor/plugins/curve_editor_plugin.h b/editor/plugins/curve_editor_plugin.h index be774a96968..f772e1ff3d9 100644 --- a/editor/plugins/curve_editor_plugin.h +++ b/editor/plugins/curve_editor_plugin.h @@ -142,7 +142,7 @@ class CurvePreviewGenerator : public EditorResourcePreviewGenerator { public: virtual bool handles(const String &p_type) const; - virtual Ref generate(const Ref &p_from, const Size2 p_size) const; + virtual Ref generate(const Ref &p_from, const Size2 &p_size) const; }; #endif // CURVE_EDITOR_PLUGIN_H diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index d260b171a83..c8ffc2744ab 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -82,7 +82,7 @@ bool EditorTexturePreviewPlugin::generate_small_preview_automatically() const { return true; } -Ref EditorTexturePreviewPlugin::generate(const RES &p_from, const Size2 p_size) const { +Ref EditorTexturePreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { Ref img; Ref atex = p_from; @@ -148,7 +148,7 @@ bool EditorImagePreviewPlugin::handles(const String &p_type) const { return p_type == "Image"; } -Ref EditorImagePreviewPlugin::generate(const RES &p_from, const Size2 p_size) const { +Ref EditorImagePreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { Ref img = p_from; @@ -196,7 +196,7 @@ bool EditorBitmapPreviewPlugin::handles(const String &p_type) const { return ClassDB::is_parent_class(p_type, "BitMap"); } -Ref EditorBitmapPreviewPlugin::generate(const RES &p_from, const Size2 p_size) const { +Ref EditorBitmapPreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { Ref bm = p_from; @@ -263,12 +263,12 @@ bool EditorPackedScenePreviewPlugin::handles(const String &p_type) const { return ClassDB::is_parent_class(p_type, "PackedScene"); } -Ref EditorPackedScenePreviewPlugin::generate(const RES &p_from, const Size2 p_size) const { +Ref EditorPackedScenePreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { return generate_from_path(p_from->get_path(), p_size); } -Ref EditorPackedScenePreviewPlugin::generate_from_path(const String &p_path, const Size2 p_size) const { +Ref EditorPackedScenePreviewPlugin::generate_from_path(const String &p_path, const Size2 &p_size) const { String temp_path = EditorSettings::get_singleton()->get_cache_dir(); String cache_base = ProjectSettings::get_singleton()->globalize_path(p_path).md5_text(); @@ -321,7 +321,7 @@ bool EditorMaterialPreviewPlugin::generate_small_preview_automatically() const { return true; } -Ref EditorMaterialPreviewPlugin::generate(const RES &p_from, const Size2 p_size) const { +Ref EditorMaterialPreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { Ref material = p_from; ERR_FAIL_COND_V(material.is_null(), Ref()); @@ -487,7 +487,7 @@ bool EditorScriptPreviewPlugin::handles(const String &p_type) const { return ClassDB::is_parent_class(p_type, "Script"); } -Ref EditorScriptPreviewPlugin::generate(const RES &p_from, const Size2 p_size) const { +Ref EditorScriptPreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { Ref