diff --git a/source/blender/blenkernel/intern/pbvh_uv_islands.cc b/source/blender/blenkernel/intern/pbvh_uv_islands.cc index e22bf3f8d8d..85e57f77157 100644 --- a/source/blender/blenkernel/intern/pbvh_uv_islands.cc +++ b/source/blender/blenkernel/intern/pbvh_uv_islands.cc @@ -670,7 +670,7 @@ struct Fan { #endif - static bool is_path_valid(const Span &path, + static bool is_path_valid(const Span path, const MeshData &mesh_data, const int from_vertex, const int to_vertex) diff --git a/source/blender/blenlib/intern/mesh_boolean.cc b/source/blender/blenlib/intern/mesh_boolean.cc index 28ff2bbd18f..68ecb161928 100644 --- a/source/blender/blenlib/intern/mesh_boolean.cc +++ b/source/blender/blenlib/intern/mesh_boolean.cc @@ -102,7 +102,7 @@ static std::ostream &operator<<(std::ostream &os, const Edge &e) return os; } -static std::ostream &operator<<(std::ostream &os, const Span &a) +static std::ostream &operator<<(std::ostream &os, const Span a) { for (int i : a.index_range()) { os << a[i]; @@ -1908,7 +1908,7 @@ struct ComponentContainer { */ static Vector find_component_containers(int comp, const Span> components, - const Array &ambient_cell, + const Span ambient_cell, const IMesh &tm, const PatchesInfo &pinfo, const TriMeshTopology &tmtopo, diff --git a/source/blender/blenlib/intern/mesh_intersect.cc b/source/blender/blenlib/intern/mesh_intersect.cc index 8a9f72c824e..b8579e6583b 100644 --- a/source/blender/blenlib/intern/mesh_intersect.cc +++ b/source/blender/blenlib/intern/mesh_intersect.cc @@ -2331,7 +2331,7 @@ class TriOverlaps { public: TriOverlaps(const IMesh &tm, - const Array &tri_bb, + const Span tri_bb, int nshapes, std::function shape_fn, bool use_self) @@ -2642,7 +2642,7 @@ static void calc_subdivided_non_cluster_tris(Array &r_tri_subdivided, static void calc_cluster_tris(Array &tri_subdivided, const IMesh &tm, const CoplanarClusterInfo &clinfo, - const Array &cluster_subdivided, + const Span cluster_subdivided, IMeshArena *arena) { for (int c : clinfo.index_range()) { diff --git a/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc b/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc index 25541cc197e..f1a67cb1030 100644 --- a/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc +++ b/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc @@ -95,7 +95,7 @@ template CDT_input fill_input_from_string(const char *spec) /* Find an original index in a table mapping new to original. * Return -1 if not found. */ -static int get_orig_index(const Array> &out_to_orig, int orig_index) +static int get_orig_index(const Span> out_to_orig, int orig_index) { int n = int(out_to_orig.size()); for (int i = 0; i < n; ++i) { @@ -264,9 +264,9 @@ static bool draw_append = false; /* Will be set to true after first call. */ template void graph_draw(const std::string &label, - const Array> &verts, - const Array> &edges, - const Array> &faces) + const Span> verts, + const Span> edges, + const Span> faces) { /* Would like to use BKE_tempdir_base() here, but that brings in dependence on kernel library. * This is just for developer debugging anyway, and should never be called in production Blender. diff --git a/source/blender/draw/intern/DRW_gpu_wrapper.hh b/source/blender/draw/intern/DRW_gpu_wrapper.hh index 19ea58c259f..563db401002 100644 --- a/source/blender/draw/intern/DRW_gpu_wrapper.hh +++ b/source/blender/draw/intern/DRW_gpu_wrapper.hh @@ -462,7 +462,7 @@ class StorageVectorBuffer : public StorageArrayBuffer { new (ptr) T(std::forward(value)...); } - void extend(const Span &values) + void extend(const Span values) { /* TODO(fclem): Optimize to a single memcpy. */ for (auto v : values) { diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_undo.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_undo.cc index fe34595df72..bb61568250a 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_undo.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_undo.cc @@ -82,7 +82,7 @@ class StepDrawingGeometryBase { * Mismatch in drawing types can happen when some drawings have been deleted between the undo * step storage, and the current state of the GreasePencil data. */ - void decode_valid_drawingtype_at_index_ensure(MutableSpan &drawings, + void decode_valid_drawingtype_at_index_ensure(MutableSpan drawings, const GreasePencilDrawingType drawing_type) const { /* TODO: Maybe that code should rather be part of GreasePencil:: API, together with diff --git a/source/blender/editors/space_node/node_shader_preview.cc b/source/blender/editors/space_node/node_shader_preview.cc index 468236d539e..b7fd483bd21 100644 --- a/source/blender/editors/space_node/node_shader_preview.cc +++ b/source/blender/editors/space_node/node_shader_preview.cc @@ -448,7 +448,7 @@ static void connect_node_to_surface_output(const Span treepath, /* Connect the nodes to some aov nodes located in the first nodetree from `treepath`. Last element * of `treepath` should be the path to the nodes nodetree. */ static void connect_nodes_to_aovs(const Span treepath, - const Span &nodesocket_span) + const Span nodesocket_span) { if (nodesocket_span.is_empty()) { return; diff --git a/source/blender/geometry/intern/uv_pack.cc b/source/blender/geometry/intern/uv_pack.cc index 39c6c895e75..15d3198840a 100644 --- a/source/blender/geometry/intern/uv_pack.cc +++ b/source/blender/geometry/intern/uv_pack.cc @@ -1998,7 +1998,7 @@ static float pack_islands_scale_margin(const Span islands, * Find the optimal scale to pack islands into the unit square. * returns largest scale that will pack `islands` into the unit square. */ -static float pack_islands_margin_fraction(const Span &islands, +static float pack_islands_margin_fraction(const Span islands, const float margin_fraction, const bool rescale_margin, const UVPackIsland_Params ¶ms) @@ -2112,7 +2112,7 @@ static float pack_islands_margin_fraction(const Span &islands, return scale_low; } -static float calc_margin_from_aabb_length_sum(const Span &island_vector, +static float calc_margin_from_aabb_length_sum(const Span island_vector, const UVPackIsland_Params ¶ms) { /* Logic matches previous behavior from #geometry::uv_parametrizer_pack. @@ -2201,7 +2201,7 @@ class OverlapMerger { return result; } - static float pack_islands_overlap(const Span &islands, + static float pack_islands_overlap(const Span islands, const UVPackIsland_Params ¶ms) { @@ -2261,7 +2261,7 @@ class OverlapMerger { } }; -static void finalize_geometry(const Span &islands, const UVPackIsland_Params ¶ms) +static void finalize_geometry(const Span islands, const UVPackIsland_Params ¶ms) { MemArena *arena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__); Heap *heap = BLI_heap_new(); diff --git a/source/blender/io/ply/importer/ply_import.cc b/source/blender/io/ply/importer/ply_import.cc index bb739e284c2..8296c8b98df 100644 --- a/source/blender/io/ply/importer/ply_import.cc +++ b/source/blender/io/ply/importer/ply_import.cc @@ -35,7 +35,7 @@ namespace blender::io::ply { /* If line starts with keyword, returns true and drops it from the line. */ -static bool parse_keyword(Span &str, StringRef keyword) +static bool parse_keyword(Span str, StringRef keyword) { const size_t keyword_len = keyword.size(); if (str.size() < keyword_len) { @@ -48,7 +48,7 @@ static bool parse_keyword(Span &str, StringRef keyword) return true; } -static Span parse_word(Span &str) +static Span parse_word(Span str) { size_t len = 0; while (len < str.size() && str[len] > ' ') { @@ -59,7 +59,7 @@ static Span parse_word(Span &str) return word; } -static void skip_space(Span &str) +static void skip_space(Span str) { while (!str.is_empty() && str[0] <= ' ') { str = str.drop_front(1); diff --git a/source/blender/modifiers/intern/MOD_grease_pencil_noise.cc b/source/blender/modifiers/intern/MOD_grease_pencil_noise.cc index 4d46cce317a..39a772c3f5d 100644 --- a/source/blender/modifiers/intern/MOD_grease_pencil_noise.cc +++ b/source/blender/modifiers/intern/MOD_grease_pencil_noise.cc @@ -144,7 +144,7 @@ static void deform_drawing(const GreasePencilNoiseModifierData &mmd, return vertex_weight * BKE_curvemapping_evaluateF(mmd.influence.custom_curve, 0, value); }; - auto get_noise = [](const Array &noise_table, const float value) { + auto get_noise = [](const Span noise_table, const float value) { return math::interpolate(noise_table[int(math::ceil(value))], noise_table[int(math::floor(value))], math::fract(value)); diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index bb0b61f969b..e13dd3791da 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -921,7 +921,7 @@ struct BakeFrameIndices { }; static BakeFrameIndices get_bake_frame_indices( - const Span> &frame_caches, const SubFrame frame) + const Span> frame_caches, const SubFrame frame) { BakeFrameIndices frame_indices; if (!frame_caches.is_empty()) { diff --git a/source/blender/sequencer/intern/sequencer.hh b/source/blender/sequencer/intern/sequencer.hh index a51c6073f0b..bd11a020dc9 100644 --- a/source/blender/sequencer/intern/sequencer.hh +++ b/source/blender/sequencer/intern/sequencer.hh @@ -4,7 +4,7 @@ #pragma once -#include +#include "BLI_vector_set.hh" /** \file * \ingroup sequencer diff --git a/source/blender/sequencer/intern/strip_time.cc b/source/blender/sequencer/intern/strip_time.cc index a566e5acf17..e4ae324febf 100644 --- a/source/blender/sequencer/intern/strip_time.cc +++ b/source/blender/sequencer/intern/strip_time.cc @@ -230,7 +230,8 @@ void seq_time_effect_range_set(const Scene *scene, Sequence *seq) seq->len = seq->enddisp - seq->startdisp; } -void seq_time_update_effects_strip_range(const Scene *scene, blender::Span &effects) +void seq_time_update_effects_strip_range(const Scene *scene, + const blender::Span effects) { /* First pass: Update length of immediate effects. */ for (Sequence *seq : effects) { diff --git a/source/blender/sequencer/intern/strip_time.hh b/source/blender/sequencer/intern/strip_time.hh index b09fbe92e79..e9bd6a60d2d 100644 --- a/source/blender/sequencer/intern/strip_time.hh +++ b/source/blender/sequencer/intern/strip_time.hh @@ -4,7 +4,7 @@ #pragma once -#include +#include "BLI_span.hh" /** \file * \ingroup sequencer @@ -40,7 +40,7 @@ void seq_time_effect_range_set(const Scene *scene, Sequence *seq); /** * Update strip `startdisp` and `enddisp` (n-input effects have no length to calculate these). */ -void seq_time_update_effects_strip_range(const Scene *scene, blender::Span &effects); +void seq_time_update_effects_strip_range(const Scene *scene, blender::Span effects); void seq_time_translate_handles(const Scene *scene, Sequence *seq, const int offset); float seq_time_media_playback_rate_factor_get(const Scene *scene, const Sequence *seq); int seq_time_strip_original_content_length_get(const Scene *scene, const Sequence *seq);