Import 2017-06-07 23:51:09: master 21caa171

Author Committer Branch Timestamp Parent
jcfr jcfr master 2015-12-03 22:51:02 master 2c283160
Changeset

COMP: qMRMLAnnotationROIWidget: Fix VS build avoiding stack allocated VLA

This commit fixes a regression introduced in r24803 (ENH: Support VR
ROI visibility update through MRML node) removing the use of Variable
Length Array allocated (VLA) on the stack that are allowed in gcc but not
supported in Visual Studio.

For more details, see [1][2]

[1] http://stackoverflow.com/questions/7812566/why-no-variable-size-array-in-stack/7812587#7812587
[2] https://msdn.microsoft.com/library/zb1574zs(v=vs.100).aspx

Error reported by Visual Studio (VS) was the following:

Modules\Loadable\Annotations\Widgets\qMRMLAnnotationROIWidget.cxx(200) : error C2057: expected constant expression
Modules\Loadable\Annotations\Widgets\qMRMLAnnotationROIWidget.cxx(200) : error C2466: cannot allocate an array of constant size 0
Modules\Loadable\Annotations\Widgets\qMRMLAnnotationROIWidget.cxx(200) : error C2133: 'wasModifying' : unknown size

Reported-by: Andras Lasso <lasso@queensu.ca>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24805 3bd1e089-480b-0410-8dfb-8563597acbee

mod - Modules/Loadable/Annotations/Widgets/qMRMLAnnotationROIWidget.cxx Diff File