artf4106: ISO C++ forbids variable-size array

C++14 changed the definition of VLAs, so the previous usage was no longer valid ISO C++. GCC 5.1.0 actually enforces this definition, so this commit fixes the build under GCC 5.1.0. This also builds under GCC 4.9.1.

Change-Id: Ib5ae2c49b4c4c21455b722b6633d7841066b4872
This commit is contained in:
Tyler Veness
2015-06-23 19:16:28 -07:00
committed by Tyler Veness (3512)
parent b5695581c3
commit f96b61ef11
3 changed files with 8 additions and 17 deletions

View File

@@ -5,6 +5,7 @@
#include <regex>
#include <chrono>
#include <thread>
#include <memory>
#include <iostream>
#include <iomanip>
@@ -130,8 +131,8 @@ void USBCamera::UpdateSettings() {
uInt32 count = 0;
uInt32 currentMode = 0;
SAFE_IMAQ_CALL(IMAQdxEnumerateVideoModes, m_id, nullptr, &count, &currentMode);
IMAQdxVideoMode modes[count];
SAFE_IMAQ_CALL(IMAQdxEnumerateVideoModes, m_id, modes, &count, &currentMode);
auto modes = std::make_unique<IMAQdxVideoMode[]>(count);
SAFE_IMAQ_CALL(IMAQdxEnumerateVideoModes, m_id, modes.get(), &count, &currentMode);
// Groups are:
// 0 - width