Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1514,9 +1514,9 @@ void ProjectSettings::_bind_methods() {

void ProjectSettings::_add_builtin_input_map() {
if (InputMap::get_singleton()) {
HashMap<String, List<Ref<InputEvent>>> builtins = InputMap::get_singleton()->get_builtins();
const HashMap<String, List<Ref<InputEvent>>> builtins = HashMap<String, List<Ref<InputEvent>>>(InputMap::get_singleton()->get_builtins());

for (KeyValue<String, List<Ref<InputEvent>>> &E : builtins) {
for (const KeyValue<String, List<Ref<InputEvent>>> &E : builtins) {
Array events;

// Convert list of input events into array
Expand Down
2 changes: 1 addition & 1 deletion core/config/project_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class ProjectSettings : public Object {
const HashMap<StringName, PropertyInfo> &get_custom_property_info() const;
uint64_t get_last_saved_time() { return last_save_time; }

List<String> get_input_presets() const { return input_presets; }
List<String> get_input_presets() const { return List<String>(input_presets); }

Variant get_setting_with_override(const StringName &p_name) const;
Variant get_setting_with_override_and_custom_features(const StringName &p_name, const Vector<String> &p_features) const;
Expand Down
2 changes: 1 addition & 1 deletion core/extension/gdextension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ void GDExtension::prepare_reload() {
state.push_back(Pair<String, Variant>(P.name, value));
}
E.value.instance_state[obj_id] = {
state, // List<Pair<String, Variant>> properties;
List<Pair<String, Variant>>(state), // List<Pair<String, Variant>> properties;
obj->is_extension_placeholder(), // bool is_placeholder;
};
}
Expand Down
2 changes: 1 addition & 1 deletion core/input/input_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ const HashMap<String, List<Ref<InputEvent>>> &InputMap::get_builtins_with_featur
}

void InputMap::load_default() {
HashMap<String, List<Ref<InputEvent>>> builtins = get_builtins_with_feature_overrides_applied();
const HashMap<String, List<Ref<InputEvent>>> builtins = HashMap<String, List<Ref<InputEvent>>>(get_builtins_with_feature_overrides_applied());

for (const KeyValue<String, List<Ref<InputEvent>>> &E : builtins) {
String name = E.key;
Expand Down
2 changes: 1 addition & 1 deletion core/io/file_access_pack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ uint8_t *PackedData::get_file_hash(const String &p_path) {
HashSet<String> PackedData::get_file_paths() const {
HashSet<String> file_paths;
_get_file_paths(root, root->name, file_paths);
return file_paths;
return HashSet<String>(file_paths);
}

void PackedData::_get_file_paths(PackedDir *p_dir, const String &p_parent_dir, HashSet<String> &r_paths) const {
Expand Down
4 changes: 2 additions & 2 deletions core/io/ip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ IPAddress IP::get_resolve_item_address(ResolverID p_id) const {
return IPAddress();
}

List<IPAddress> res = resolver->queue[p_id].response;
const List<IPAddress> res = List<IPAddress>(resolver->queue[p_id].response);

for (const IPAddress &E : res) {
if (E.is_valid()) {
Expand All @@ -224,7 +224,7 @@ Array IP::get_resolve_item_addresses(ResolverID p_id) const {
return Array();
}

List<IPAddress> res = resolver->queue[p_id].response;
const List<IPAddress> res = List<IPAddress>(resolver->queue[p_id].response);

Array result;
for (const IPAddress &E : res) {
Expand Down
2 changes: 1 addition & 1 deletion core/math/a_star_grid_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void AStarGrid2D::update() {
solid_mask.push_back(false);
}
solid_mask.push_back(true);
points.push_back(line);
points.push_back(LocalVector<Point>(line));
}

for (int32_t x = region.position.x; x < end_x + 2; x++) {
Expand Down
4 changes: 2 additions & 2 deletions core/math/geometry_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ class Geometry3D {
};

if (polygon.is_empty()) {
return polygon;
return Vector<Vector3>(polygon);
}

int *location_cache = (int *)alloca(sizeof(int) * polygon.size());
Expand All @@ -514,7 +514,7 @@ class Geometry3D {
}

if (outside_count == 0) {
return polygon; // No changes.
return Vector<Vector3>(polygon); // No changes.
} else if (inside_count == 0) {
return Vector<Vector3>(); // Empty.
}
Expand Down
2 changes: 1 addition & 1 deletion core/object/class_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ void ClassDB::get_method_list_with_compatibility(const StringName &p_class, List
#endif // DEBUG_ENABLED

for (const KeyValue<StringName, LocalVector<MethodBind *, unsigned int, false, false>> &E : type->method_map_compatibility) {
LocalVector<MethodBind *> compat = E.value;
const LocalVector<MethodBind *> compat = LocalVector<MethodBind *>(E.value);
for (MethodBind *method : compat) {
MethodInfo minfo = info_from_bind(method);

Expand Down
2 changes: 1 addition & 1 deletion core/os/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ bool OS::is_restart_on_exit_set() const {
}

List<String> OS::get_restart_on_exit_arguments() const {
return restart_commandline;
return List<String>(restart_commandline);
}

PackedStringArray OS::get_connected_midi_inputs() {
Expand Down
4 changes: 2 additions & 2 deletions core/os/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ class OS {
virtual String get_distribution_name() const = 0;
virtual String get_version() const = 0;
virtual String get_version_alias() const { return get_version(); }
virtual List<String> get_cmdline_args() const { return _cmdline; }
virtual List<String> get_cmdline_user_args() const { return _user_args; }
virtual List<String> get_cmdline_args() const { return List<String>(_cmdline); }
virtual List<String> get_cmdline_user_args() const { return List<String>(_user_args); }
virtual List<String> get_cmdline_platform_args() const { return List<String>(); }
virtual String get_model_name() const;

Expand Down
2 changes: 1 addition & 1 deletion core/string/translation_domain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ HashSet<Ref<Translation>> TranslationDomain::get_potential_translations(const St
res.insert(E);
}
}
return res;
return HashSet<Ref<Translation>>(res);
}

Ref<Translation> TranslationDomain::get_translation_object(const String &p_locale) const {
Expand Down
2 changes: 1 addition & 1 deletion core/templates/cowdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class CowData {
_FORCE_INLINE_ CowData() {}
_FORCE_INLINE_ ~CowData() { _unref(); }
_FORCE_INLINE_ CowData(std::initializer_list<T> p_init);
_FORCE_INLINE_ CowData(const CowData<T> &p_from) { _ref(p_from); }
_FORCE_INLINE_ explicit CowData(const CowData<T> &p_from) { _ref(p_from); }
_FORCE_INLINE_ CowData(CowData<T> &&p_from) {
_ptr = p_from._ptr;
p_from._ptr = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion core/templates/fixed_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class FixedVector {
}

template <uint32_t p_capacity>
constexpr FixedVector(const FixedVector<T, p_capacity> &p_from) {
constexpr explicit FixedVector(const FixedVector<T, p_capacity> &p_from) {
ERR_FAIL_COND(p_from.size() > CAPACITY);
if constexpr (std::is_trivially_copyable_v<T>) {
// Copy size and all provided elements at once.
Expand Down
2 changes: 1 addition & 1 deletion core/templates/hash_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ class HashMap : private Allocator {

/* Constructors */

HashMap(const HashMap &p_other) {
explicit HashMap(const HashMap &p_other) {
reserve(hash_table_size_primes[p_other._capacity_idx]);

if (p_other._size == 0) {
Expand Down
2 changes: 1 addition & 1 deletion core/templates/hash_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ class HashSet {

/* Constructors */

HashSet(const HashSet &p_other) {
explicit HashSet(const HashSet &p_other) {
_init_from(p_other);
}

Expand Down
15 changes: 14 additions & 1 deletion core/templates/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,19 @@ class List {
/**
* find an element in the list,
*/
template <typename T_v>
const Element *find(const T_v &p_val) const {
const Element *it = front();
while (it) {
if (it->value == p_val) {
return it;
}
it = it->next();
}

return nullptr;
}

template <typename T_v>
Element *find(const T_v &p_val) {
Element *it = front();
Expand Down Expand Up @@ -677,7 +690,7 @@ class List {
/**
* copy constructor for the list
*/
List(const List &p_list) {
explicit List(const List &p_list) {
const Element *it = p_list.front();
while (it) {
push_back(it->get());
Expand Down
2 changes: 1 addition & 1 deletion core/templates/local_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ class LocalVector {
push_back(element);
}
}
_FORCE_INLINE_ LocalVector(const LocalVector &p_from) {
_FORCE_INLINE_ explicit LocalVector(const LocalVector &p_from) {
resize(p_from.size());
for (U i = 0; i < p_from.count; i++) {
data[i] = p_from.data[i];
Expand Down
2 changes: 1 addition & 1 deletion core/templates/rb_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ class RBMap {
_copy_from(p_map);
}

RBMap(const RBMap &p_map) {
explicit RBMap(const RBMap &p_map) {
_copy_from(p_map);
}

Expand Down
2 changes: 1 addition & 1 deletion core/templates/rb_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ class RBSet {
_copy_from(p_set);
}

RBSet(const RBSet &p_set) {
explicit RBSet(const RBSet &p_set) {
_copy_from(p_set);
}

Expand Down
2 changes: 1 addition & 1 deletion core/templates/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Vector {
public:
// Must take a copy instead of a reference (see GH-31736).
_FORCE_INLINE_ bool push_back(T p_elem) { return _cowdata.push_back(p_elem); }
_FORCE_INLINE_ bool append(const T &p_elem) { return push_back(p_elem); } //alias
_FORCE_INLINE_ bool append(const T &p_elem) { return push_back(T(p_elem)); } //alias
void fill(T p_elem);

void remove_at(Size p_index) { _cowdata.remove_at(p_index); }
Expand Down
4 changes: 2 additions & 2 deletions drivers/gles3/shader_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ bool ShaderGLES3::_load_from_cache(Version *p_version) {

variant.insert(specialization_key, specialization);
}
variants.push_back(variant);
variants.push_back(AHashMap<uint64_t, Version::Specialization>(variant));
}
p_version->variants = variants;

Expand Down Expand Up @@ -706,7 +706,7 @@ void ShaderGLES3::_initialize_version(Version *p_version) {
p_version->variants.reserve(variant_count);
for (int i = 0; i < variant_count; i++) {
AHashMap<uint64_t, Version::Specialization> variant;
p_version->variants.push_back(variant);
p_version->variants.push_back(AHashMap<uint64_t, Version::Specialization>(variant));
Version::Specialization spec;
_compile_specialization(spec, i, p_version, specialization_default_mask);
p_version->variants[i].insert(specialization_default_mask, spec);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles3/storage/texture_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ void TextureStorage::texture_remap_proxies(RID p_from_texture, RID p_to_texture)
}

// Make a local copy, we're about to change the content of the original.
thread_local LocalVector<RID> proxies = from_tex->proxies;
thread_local LocalVector<RID> proxies = LocalVector<RID>(from_tex->proxies);

// Now change them to our new texture.
for (RID &proxy : proxies) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/metal/metal_objects.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@
}
}

BoundUniformSet bs = { .buffer = enc_buffer, .usage_to_resources = usage_to_resources };
BoundUniformSet bs = { .buffer = enc_buffer, .usage_to_resources = ResourceUsageMap(usage_to_resources) };
bound_uniforms.insert(p_shader, bs);
bs.merge_into(p_resource_usage);
return bound_uniforms.get(p_shader);
Expand Down
2 changes: 1 addition & 1 deletion editor/animation/animation_bezier_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {

for (const KeyValue<int, RBMap<int, Rect2>> &E : subtrack_icons) {
int track = E.key;
RBMap<int, Rect2> track_icons = E.value;
const RBMap<int, Rect2> track_icons = RBMap<int, Rect2>(E.value);
for (const KeyValue<int, Rect2> &I : track_icons) {
if (I.value.has_point(mb->get_position())) {
if (I.key == REMOVE_ICON) {
Expand Down
4 changes: 2 additions & 2 deletions editor/docks/filesystem_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ HashSet<String> FileSystemDock::_get_valid_conversions_for_file_paths(const Vect
}
}

return all_valid_conversion_to_targets;
return HashSet<String>(all_valid_conversion_to_targets);
}

void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorites, bool p_navigate) {
Expand Down Expand Up @@ -1627,7 +1627,7 @@ void FileSystemDock::_update_dependencies_after_move(const HashMap<String, Strin

void FileSystemDock::_update_project_settings_after_move(const HashMap<String, String> &p_renames, const HashMap<String, String> &p_folders_renames) {
// Find all project settings of type FILE and replace them if needed.
const HashMap<StringName, PropertyInfo> prop_info = ProjectSettings::get_singleton()->get_custom_property_info();
const HashMap<StringName, PropertyInfo> prop_info = HashMap<StringName, PropertyInfo>(ProjectSettings::get_singleton()->get_custom_property_info());
for (const KeyValue<StringName, PropertyInfo> &E : prop_info) {
if (E.value.hint == PROPERTY_HINT_FILE || E.value.hint == PROPERTY_HINT_FILE_PATH) {
String old_path = GLOBAL_GET(E.key);
Expand Down
20 changes: 10 additions & 10 deletions editor/docks/scene_tree_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
break;
}

List<Node *> selection = editor_selection->get_top_selected_node_list();
List<Node *> selection = List<Node *>(editor_selection->get_top_selected_node_list());
if (selection.is_empty()) {
break;
}
Expand Down Expand Up @@ -821,7 +821,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
bool MOVING_UP = !MOVING_DOWN;

Node *common_parent = scene_tree->get_selected()->get_parent();
List<Node *> selection = editor_selection->get_top_selected_node_list();
List<Node *> selection = List<Node *>(editor_selection->get_top_selected_node_list());
selection.sort_custom<Node::Comparator>(); // sort by index
if (MOVING_DOWN) {
selection.reverse();
Expand Down Expand Up @@ -894,7 +894,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
break;
}

List<Node *> selection = editor_selection->get_top_selected_node_list();
List<Node *> selection = List<Node *>(editor_selection->get_top_selected_node_list());
if (selection.is_empty()) {
break;
}
Expand Down Expand Up @@ -989,7 +989,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
break;
}

List<Node *> nodes = editor_selection->get_top_selected_node_list();
const List<Node *> nodes = List<Node *>(editor_selection->get_top_selected_node_list());
HashSet<Node *> nodeset;
for (Node *E : nodes) {
nodeset.insert(E);
Expand All @@ -1002,7 +1002,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
break;
}

List<Node *> nodes = editor_selection->get_top_selected_node_list();
const List<Node *> nodes = List<Node *>(editor_selection->get_top_selected_node_list());
ERR_FAIL_COND(nodes.size() != 1);

Node *node = nodes.front()->get();
Expand Down Expand Up @@ -1085,7 +1085,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
break;
}

List<Node *> remove_list = editor_selection->get_top_selected_node_list();
const List<Node *> remove_list = List<Node *>(editor_selection->get_top_selected_node_list());

if (remove_list.is_empty()) {
return;
Expand All @@ -1096,7 +1096,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
}

bool allow_ask_delete_tracks = EDITOR_GET("docks/scene_tree/ask_before_deleting_related_animation_tracks").operator bool();
bool has_tracks_to_delete = allow_ask_delete_tracks && _has_tracks_to_delete(edited_scene, remove_list);
bool has_tracks_to_delete = allow_ask_delete_tracks && _has_tracks_to_delete(edited_scene, List<Node *>(remove_list));
if (p_confirm_override && !has_tracks_to_delete) {
_delete_confirm();
} else {
Expand Down Expand Up @@ -1914,7 +1914,7 @@ void SceneTreeDock::_fill_path_renames(Vector<StringName> base_path, Vector<Stri
}
}

bool SceneTreeDock::_has_tracks_to_delete(Node *p_node, List<Node *> &p_to_delete) const {
bool SceneTreeDock::_has_tracks_to_delete(Node *p_node, const List<Node *> &p_to_delete) const {
// Skip if this node will be deleted.
for (const Node *F : p_to_delete) {
if (F == p_node || F->is_ancestor_of(p_node)) {
Expand Down Expand Up @@ -2770,7 +2770,7 @@ void SceneTreeDock::_toggle_editable_children(Node *p_node) {
}

void SceneTreeDock::_delete_confirm(bool p_cut) {
List<Node *> remove_list = editor_selection->get_top_selected_node_list();
List<Node *> remove_list = List<Node *>(editor_selection->get_top_selected_node_list());

if (remove_list.is_empty()) {
return;
Expand Down Expand Up @@ -4375,7 +4375,7 @@ List<Node *> SceneTreeDock::paste_nodes(bool p_paste_as_sibling) {
}

List<Node *> SceneTreeDock::get_node_clipboard() const {
return node_clipboard;
return List<Node *>(node_clipboard);
}

void SceneTreeDock::add_remote_tree_editor(Control *p_remote) {
Expand Down
2 changes: 1 addition & 1 deletion editor/docks/scene_tree_dock.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class SceneTreeDock : public EditorDock {
void _queue_update_script_button();

void _fill_path_renames(Vector<StringName> base_path, Vector<StringName> new_base_path, Node *p_node, HashMap<Node *, NodePath> *p_renames);
bool _has_tracks_to_delete(Node *p_node, List<Node *> &p_to_delete) const;
bool _has_tracks_to_delete(Node *p_node, const List<Node *> &p_to_delete) const;

void _normalize_drop(Node *&to_node, int &to_pos, int p_type);
Array _get_selection_array();
Expand Down
Loading