From 72c7084e4bf7001aa29cd78dfa6a90c5629155fc Mon Sep 17 00:00:00 2001 From: Steven Koo Date: Thu, 24 Sep 2020 19:00:58 -0500 Subject: uhd: replace default initializers with named ones This resolves an issue with building on older compilers. --- host/lib/cal/database.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'host/lib/cal') 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 #include #include +#include #include #include -#include #include #include @@ -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 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 (*get_cal_data_fn)(const std::string&, const std::string&); +typedef std::tuple cal_data_fn_tuple; // These are in order of priority! // clang-format off -constexpr std::array, 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 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 -- cgit v1.2.3