From fba7461e1a51643ea4762f2dc5d4811b49cedbef Mon Sep 17 00:00:00 2001 From: Chris Blackbourn Date: Mon, 14 Nov 2022 08:20:53 +1300 Subject: UV: fix compile on windows Remove VLAs for compiling on windows. Regression from 721fc9c1c950 --- .../blender/editors/uvedit/uvedit_clipboard_graph_iso.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/uvedit/uvedit_clipboard_graph_iso.cc b/source/blender/editors/uvedit/uvedit_clipboard_graph_iso.cc index 43975d0d382..897361472a8 100644 --- a/source/blender/editors/uvedit/uvedit_clipboard_graph_iso.cc +++ b/source/blender/editors/uvedit/uvedit_clipboard_graph_iso.cc @@ -309,9 +309,11 @@ static void maximum_common_subgraph_internal( { int min = std::min(n0, n1); - uint8_t cur[min][2]; - uint8_t domains[min * min][BDS]; - uint8_t left[n0], right[n1]; + uint8_t(*cur)[2] = (uint8_t(*)[2])MEM_mallocN(min * sizeof(*cur), __func__); + uint8_t(*domains)[BDS] = (uint8_t(*)[8])MEM_mallocN(min * min * sizeof(*domains), __func__); + uint8_t *left = static_cast(MEM_mallocN(n0 * sizeof *left, __func__)); + uint8_t *right = static_cast(MEM_mallocN(n1 * sizeof *right, __func__)); + uint8_t v, w, *bd; int bd_pos = 0; for (int i = 0; i < n0; i++) { @@ -330,7 +332,8 @@ static void maximum_common_subgraph_internal( * Can occur with moderate sized inputs where the graph has lots of symmetry, e.g. a cube * subdivided 3x times. */ - return; + *inc_pos = 0; + break; } bd = &domains[bd_pos - 1][L]; if (calc_bound(domains, bd_pos, bd[P]) + bd[P] <= *inc_pos || @@ -354,6 +357,11 @@ static void maximum_common_subgraph_internal( } } } + + MEM_freeN(cur); + MEM_freeN(domains); + MEM_freeN(right); + MEM_freeN(left); } static bool check_automorphism(const GraphISO *g0, -- cgit v1.2.3