From 37a2effab77ff6cc0b1f7ba2c2fc3206046c63b4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 27 Jul 2025 17:04:15 +1000 Subject: [PATCH] Cleanup: avoid casting away 'const' Copy into a non-const variable before assignment to avoid casts that remove `const`. --- .../editors/space_outliner/tree/tree_element_rna.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/space_outliner/tree/tree_element_rna.cc b/source/blender/editors/space_outliner/tree/tree_element_rna.cc index b940054f10f..ec455973d90 100644 --- a/source/blender/editors/space_outliner/tree/tree_element_rna.cc +++ b/source/blender/editors/space_outliner/tree/tree_element_rna.cc @@ -224,13 +224,14 @@ TreeElementRNAArrayElement::TreeElementRNAArrayElement(TreeElement &legacy_te, char c = RNA_property_array_item_char(TreeElementRNAArrayElement::get_property_rna(), index); const size_t name_size = sizeof(char[20]); - legacy_te_.name = MEM_calloc_arrayN(name_size, "OutlinerRNAArrayName"); + char *name = MEM_calloc_arrayN(name_size, "OutlinerRNAArrayName"); if (c) { - BLI_snprintf_utf8((char *)legacy_te_.name, name_size, " %c", c); + BLI_snprintf_utf8(name, name_size, " %c", c); } else { - BLI_snprintf_utf8((char *)legacy_te_.name, name_size, " %d", index + 1); + BLI_snprintf_utf8(name, name_size, " %d", index + 1); } + legacy_te_.name = name; legacy_te_.flag |= TE_FREE_NAME; }