diff options
author | Steven Koo <steven.koo@ni.com> | 2020-09-24 19:00:58 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-09-25 14:25:18 -0500 |
commit | 72c7084e4bf7001aa29cd78dfa6a90c5629155fc (patch) | |
tree | 097f865f0f626cd12ef01f830b5624689fd7e207 | |
parent | b975885de26143d34d3f1baa7388a5d90449b2db (diff) | |
download | uhd-72c7084e4bf7001aa29cd78dfa6a90c5629155fc.tar.gz uhd-72c7084e4bf7001aa29cd78dfa6a90c5629155fc.tar.bz2 uhd-72c7084e4bf7001aa29cd78dfa6a90c5629155fc.zip |
uhd: replace default initializers with named ones
This resolves an issue with building on older compilers.
-rw-r--r-- | host/include/uhd/utils/graph_utils.hpp | 4 | ||||
-rw-r--r-- | host/lib/cal/database.cpp | 15 |
2 files changed, 11 insertions, 8 deletions
diff --git a/host/include/uhd/utils/graph_utils.hpp b/host/include/uhd/utils/graph_utils.hpp index 6a1c9cb48..c4d77b093 100644 --- a/host/include/uhd/utils/graph_utils.hpp +++ b/host/include/uhd/utils/graph_utils.hpp @@ -26,7 +26,9 @@ using block_port_def = std::tuple<std::string, boost::optional<size_t>>; * some of their ports, so we can optionally include a port number. */ static const std::vector<block_port_def> TERMINATOR_BLOCKS{ - {NODE_ID_SEP, boost::none}, {"Radio", boost::none}, {"NullSrcSink", 0}}; + block_port_def{NODE_ID_SEP, boost::none}, + block_port_def{"Radio", boost::none}, + block_port_def{"NullSrcSink", 0}}; /*! * Get a chain of blocks that statically connect back to a terminating block. This diff --git a/host/lib/cal/database.cpp b/host/lib/cal/database.cpp index 4b59cf913..d501be99c 100644 --- a/host/lib/cal/database.cpp +++ b/host/lib/cal/database.cpp @@ -11,9 +11,9 @@ #include <uhd/utils/static.hpp> #include <cmrc/cmrc.hpp> #include <boost/filesystem.hpp> +#include <array> #include <ctime> #include <fstream> -#include <array> #include <tuple> #include <vector> @@ -24,8 +24,8 @@ namespace rc = cmrc::rc; namespace fs = boost::filesystem; namespace { -constexpr char LOG_ID[] = "CAL::DATABASE"; -constexpr char CAL_EXT[] = ".cal"; +constexpr char LOG_ID[] = "CAL::DATABASE"; +constexpr char CAL_EXT[] = ".cal"; //! This value is just for sanity checking. We pick a value (in bytes) that we // are guaranteed to never exceed. Its only purpose is to avoid loading files // that can't possibly be valid cal data based on the filesize. This can avoid @@ -193,12 +193,13 @@ std::vector<uint8_t> get_cal_data_flash(const std::string& key, const std::strin *****************************************************************************/ typedef bool (*has_cal_data_fn)(const std::string&, const std::string&); typedef std::vector<uint8_t> (*get_cal_data_fn)(const std::string&, const std::string&); +typedef std::tuple<source, has_cal_data_fn, get_cal_data_fn> cal_data_fn_tuple; // These are in order of priority! // clang-format off -constexpr std::array<std::tuple<source, has_cal_data_fn, get_cal_data_fn>, 3> data_fns{{ - {source::FILESYSTEM, &has_cal_data_fs, &get_cal_data_fs }, - {source::FLASH, &has_cal_data_flash, &get_cal_data_flash}, - {source::RC, &has_cal_data_rc, &get_cal_data_rc } +constexpr std::array<cal_data_fn_tuple, 3> data_fns{{ + cal_data_fn_tuple{source::FILESYSTEM, &has_cal_data_fs, &get_cal_data_fs }, + cal_data_fn_tuple{source::FLASH, &has_cal_data_flash, &get_cal_data_flash}, + cal_data_fn_tuple{source::RC, &has_cal_data_rc, &get_cal_data_rc } }}; // clang-format on |