1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-09-08 13:56:04 +00:00

Fix warning -Wrestrict raised when using c++20

This commit is contained in:
Carles Fernandez
2022-12-17 13:15:16 +01:00
parent 3747e0396d
commit 840b184beb
6 changed files with 21 additions and 35 deletions

View File

@@ -5602,29 +5602,9 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int32_t, Gal
E5B_HS = "11"; E5B_HS = "11";
} }
if (E1B_HS == "11")
{
LOG(WARNING) << "Signal Component currently in Test";
}
if (E1B_HS == "10")
{
LOG(WARNING) << "Signal will be out of service";
}
if (E1B_HS == "01")
{
LOG(WARNING) << "Signal out of service";
}
E1B_HS = "00"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID
std::string E1B_DVS = std::to_string(galileo_ephemeris_iter->second.E1B_DVS); std::string E1B_DVS = std::to_string(galileo_ephemeris_iter->second.E1B_DVS);
if (E1B_DVS == "1")
{
LOG(WARNING) << "Navigation data without guarantee";
}
E1B_DVS = "0"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID
std::string SVhealth_str = E5B_HS + std::to_string(galileo_ephemeris_iter->second.E5b_DVS) + "11" + "1" + std::string(E1B_DVS) + std::string(E1B_HS) + std::to_string(galileo_ephemeris_iter->second.E1B_DVS); std::string SVhealth_str = E5B_HS + std::to_string(galileo_ephemeris_iter->second.E5b_DVS) + "11" + "1" + std::string(E1B_DVS) + std::string(E1B_HS) + std::to_string(galileo_ephemeris_iter->second.E1B_DVS);
SVhealth_str = "000000000"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID
int32_t SVhealth = Rinex_Printer::toInt(SVhealth_str, 9); int32_t SVhealth = Rinex_Printer::toInt(SVhealth_str, 9);
line += Rinex_Printer::doub2for(static_cast<double>(SVhealth), 18, 2); line += Rinex_Printer::doub2for(static_cast<double>(SVhealth), 18, 2);
line += std::string(1, ' '); line += std::string(1, ' ');

View File

@@ -31,10 +31,10 @@ FifoSignalSource::FifoSignalSource(ConfigurationInterface const* configuration,
[[maybe_unused]] Concurrent_Queue<pmt::pmt_t>* queue) [[maybe_unused]] Concurrent_Queue<pmt::pmt_t>* queue)
: SignalSourceBase(configuration, role, "Fifo_Signal_Source"s), : SignalSourceBase(configuration, role, "Fifo_Signal_Source"s),
item_size_(sizeof(gr_complex)), // currenty output item size is always gr_complex item_size_(sizeof(gr_complex)), // currenty output item size is always gr_complex
fifo_reader_(FifoReader::make(configuration->property(role + ".filename"s, "../data/example_capture.dat"s), fifo_reader_(FifoReader::make(configuration->property(role + ".filename", "../data/example_capture.dat"s),
configuration->property(role + ".sample_type"s, "ishort"s))), configuration->property(role + ".sample_type", "ishort"s))),
dump_(configuration->property(role + ".dump", false)), dump_(configuration->property(role + ".dump", false)),
dump_filename_(configuration->property(role + ".dump_filename"s, "./data/signal_source.dat"s)) dump_filename_(configuration->property(role + ".dump_filename", "./data/signal_source.dat"s))
{ {
if (dump_) if (dump_)
{ {

View File

@@ -27,9 +27,9 @@ ZmqSignalSource::ZmqSignalSource(const ConfigurationInterface* configuration,
unsigned int /* out_stream [[maybe_unused]] */, unsigned int /* out_stream [[maybe_unused]] */,
Concurrent_Queue<pmt::pmt_t>* /* queue [[maybe_unused]] */) Concurrent_Queue<pmt::pmt_t>* /* queue [[maybe_unused]] */)
: SignalSourceBase(configuration, role, "ZMQ_Signal_Source"s), : SignalSourceBase(configuration, role, "ZMQ_Signal_Source"s),
d_item_size(decode_item_type(configuration->property(role + ".item_type"s, "gr_complex"s), nullptr, true)), d_item_size(decode_item_type(configuration->property(role + ".item_type", "gr_complex"s), nullptr, true)),
d_dump_filename(configuration->property(role + ".dump_filename"s, "data/zmq_dump.dat"s)), d_dump_filename(configuration->property(role + ".dump_filename", "data/zmq_dump.dat"s)),
d_dump(configuration->property(role + ".dump"s, false)) d_dump(configuration->property(role + ".dump", false))
{ {
auto vlen = configuration->property(role + ".vlen"s, 1); auto vlen = configuration->property(role + ".vlen"s, 1);
auto pass_tags = configuration->property(role + ".pass_tags"s, false); auto pass_tags = configuration->property(role + ".pass_tags"s, false);

View File

@@ -681,6 +681,8 @@ void galileo_e6_has_msg_receiver::read_MT1_body(const std::string& message_body)
d_HAS_data.satellite_submask = std::vector<uint64_t>(d_HAS_data.Nsys_sub); d_HAS_data.satellite_submask = std::vector<uint64_t>(d_HAS_data.Nsys_sub);
d_HAS_data.delta_clock_correction_clock_subset = std::vector<std::vector<int16_t>>(d_HAS_data.Nsys_sub, std::vector<int16_t>()); d_HAS_data.delta_clock_correction_clock_subset = std::vector<std::vector<int16_t>>(d_HAS_data.Nsys_sub, std::vector<int16_t>());
const std::string str_one("1");
const std::string str_zero("0");
for (uint8_t i = 0; i < d_HAS_data.Nsys_sub; i++) for (uint8_t i = 0; i < d_HAS_data.Nsys_sub; i++)
{ {
d_HAS_data.gnss_id_clock_subset[i] = read_has_message_body_uint8(message.substr(0, HAS_MSG_ID_CLOCK_SUBSET_LENGTH)); d_HAS_data.gnss_id_clock_subset[i] = read_has_message_body_uint8(message.substr(0, HAS_MSG_ID_CLOCK_SUBSET_LENGTH));
@@ -711,11 +713,11 @@ void galileo_e6_has_msg_receiver::read_MT1_body(const std::string& message_body)
{ {
if ((aux & mask_value) >= 1) if ((aux & mask_value) >= 1)
{ {
binary.insert(0, "1"); binary.insert(0, str_one);
} }
else else
{ {
binary.insert(0, "0"); binary.insert(0, str_zero);
} }
aux <<= 1; aux <<= 1;
} }

View File

@@ -76,16 +76,20 @@ std::vector<int> Galileo_HAS_data::get_PRNs_in_submask(uint8_t nsys) const
uint64_t sat_submask = satellite_submask[nsys]; uint64_t sat_submask = satellite_submask[nsys];
// convert into string // convert into string
std::string sat_submask_str(""); std::string sat_submask_str("");
sat_submask_str.reserve(number_sats_this_gnss_id);
uint64_t aux = 1; uint64_t aux = 1;
const std::string one_str("1");
const std::string zero_str("0");
for (int k = 0; k < number_sats_this_gnss_id - 1; k++) for (int k = 0; k < number_sats_this_gnss_id - 1; k++)
{ {
if ((aux & sat_submask) >= 1) if ((aux & sat_submask) >= 1)
{ {
sat_submask_str.insert(0, "1"); sat_submask_str.insert(0, one_str);
} }
else else
{ {
sat_submask_str.insert(0, "0"); sat_submask_str.insert(0, zero_str);
} }
aux <<= 1; aux <<= 1;
} }

View File

@@ -30,9 +30,9 @@ Gnss_Satellite::Gnss_Satellite(const std::string& system_, uint32_t PRN_)
void Gnss_Satellite::reset() void Gnss_Satellite::reset()
{ {
PRN = 0;
system = std::string(""); system = std::string("");
block = std::string(""); block = std::string("");
PRN = 0;
rf_link = 0; rf_link = 0;
} }
@@ -43,11 +43,11 @@ std::ostream& operator<<(std::ostream& out, const Gnss_Satellite& sat) // outpu
std::string tag2; std::string tag2;
if (sat.get_system() == "Galileo") if (sat.get_system() == "Galileo")
{ {
tag = "E"; tag = std::string("E");
} }
if (sat.get_PRN() < 10) if (sat.get_PRN() < 10)
{ {
tag2 = "0"; tag2 = std::string("0");
} }
out << sat.get_system() << " PRN " << tag << tag2 << sat.get_PRN() << " (Block " << sat.get_block() << ")"; out << sat.get_system() << " PRN " << tag << tag2 << sat.get_PRN() << " (Block " << sat.get_block() << ")";
return out; return out;
@@ -85,8 +85,8 @@ Gnss_Satellite& Gnss_Satellite::operator=(const Gnss_Satellite& rhs)
if (this != &rhs) if (this != &rhs)
{ {
this->system = rhs.system; this->system = rhs.system;
this->PRN = rhs.PRN;
this->block = rhs.block; this->block = rhs.block;
this->PRN = rhs.PRN;
this->rf_link = rhs.rf_link; this->rf_link = rhs.rf_link;
} }
return *this; return *this;
@@ -106,8 +106,8 @@ Gnss_Satellite& Gnss_Satellite::operator=(Gnss_Satellite&& other) noexcept
if (this != &other) if (this != &other)
{ {
this->system = other.get_system(); this->system = other.get_system();
this->PRN = other.get_PRN();
this->block = other.get_block(); this->block = other.get_block();
this->PRN = other.get_PRN();
this->rf_link = other.get_rf_link(); this->rf_link = other.get_rf_link();
} }
return *this; return *this;