Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-09-25 11:33:28 +0300
committerCampbell Barton <campbell@blender.org>2022-09-25 13:17:08 +0300
commitf68cfd6bb078482c4a779a6e26a56e2734edb5b8 (patch)
tree2878e5b80dba5bdeba186d99661d604eb38879cd /source/blender/editors/space_spreadsheet
parentc7b247a118e302a3afc6473797e53b6af28b69e2 (diff)
Cleanup: replace C-style casts with functional casts for numeric types
Diffstat (limited to 'source/blender/editors/space_spreadsheet')
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_layout.cc4
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc4
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc2
3 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_layout.cc b/source/blender/editors/space_spreadsheet/spreadsheet_layout.cc
index 3fe4c7c8ee0..7e6b0ab18c3 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_layout.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_layout.cc
@@ -283,7 +283,7 @@ class SpreadsheetLayoutDrawer : public SpreadsheetDrawer {
void draw_float_vector(const CellDrawParams &params, const Span<float> values) const
{
BLI_assert(!values.is_empty());
- const float segment_width = (float)params.width / values.size();
+ const float segment_width = float(params.width) / values.size();
for (const int i : values.index_range()) {
std::stringstream ss;
const float value = values[i];
@@ -314,7 +314,7 @@ class SpreadsheetLayoutDrawer : public SpreadsheetDrawer {
{
const ColorGeometry4f float_color = color.decode();
Span<float> values(&float_color.r, 4);
- const float segment_width = (float)params.width / values.size();
+ const float segment_width = float(params.width) / values.size();
for (const int i : values.index_range()) {
std::stringstream ss;
const float value = values[i];
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc b/source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc
index 03cf0116dce..96827692a25 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_row_filter.cc
@@ -242,14 +242,14 @@ static void apply_row_filter(const SpreadsheetRowFilter &row_filter,
switch (row_filter.operation) {
case SPREADSHEET_ROW_FILTER_EQUAL: {
const float4 value_floats = {
- (float)value.r, (float)value.g, (float)value.b, (float)value.a};
+ float(value.r), float(value.g), float(value.b), float(value.a)};
const float threshold_sq = pow2f(row_filter.threshold);
apply_filter_operation(
column_data.typed<ColorGeometry4b>(),
[&](const ColorGeometry4b cell_bytes) {
const ColorGeometry4f cell = cell_bytes.decode();
const float4 cell_floats = {
- (float)cell.r, (float)cell.g, (float)cell.b, (float)cell.a};
+ float(cell.r), float(cell.g), float(cell.b), float(cell.a)};
return len_squared_v4v4(value_floats, cell_floats) <= threshold_sq;
},
prev_mask,
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc b/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc
index 548e6cf29e4..a1f6de56bb2 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc
@@ -309,7 +309,7 @@ static short get_filter_expand_flag(const bContext *UNUSED(C), Panel *panel)
PointerRNA *filter_ptr = UI_panel_custom_data_get(panel);
SpreadsheetRowFilter *filter = (SpreadsheetRowFilter *)filter_ptr->data;
- return (short)filter->flag & SPREADSHEET_ROW_FILTER_UI_EXPAND;
+ return short(filter->flag) & SPREADSHEET_ROW_FILTER_UI_EXPAND;
}
static void set_filter_expand_flag(const bContext *UNUSED(C), Panel *panel, short expand_flag)