uavcan: fix initialization of std::array

in C++11, double braces are needed for std::array aggregate initialization,
or assignment with =.
see: http://en.cppreference.com/w/cpp/container/array
This commit is contained in:
Beat Küng 2016-11-04 10:58:44 +01:00 committed by Lorenz Meier
parent 09d36a63ef
commit 4bcf2cdb52
1 changed files with 2 additions and 2 deletions

View File

@ -1258,10 +1258,10 @@ UavcanNode::print_info()
// Printing all nodes that are online
std::printf("Online nodes (Node ID, Health, Mode):\n");
_node_status_monitor.forEachNode([](uavcan::NodeID nid, uavcan::NodeStatusMonitor::NodeStatus ns) {
static constexpr std::array<const char*, 4> HEALTH {
static constexpr std::array<const char*, 4> HEALTH = {
"OK", "WARN", "ERR", "CRIT"
};
static constexpr std::array<const char*, 8> MODES {
static constexpr std::array<const char*, 8> MODES = {
"OPERAT", "INIT", "MAINT", "SW_UPD", "?", "?", "?", "OFFLN"
};
std::printf("\t% 3d %-10s %-10s\n", int(nid.get()), HEALTH.at(ns.health), MODES.at(ns.mode));