diff --git a/src/algorithms/PVT/libs/rtcm.cc b/src/algorithms/PVT/libs/rtcm.cc index deb7a997b..e514d733a 100644 --- a/src/algorithms/PVT/libs/rtcm.cc +++ b/src/algorithms/PVT/libs/rtcm.cc @@ -140,7 +140,7 @@ bool Rtcm::is_server_running() const std::string Rtcm::add_CRC(const std::string& message_without_crc) const { // ****** Computes Qualcomm CRC-24Q ****** - boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false> CRC_RTCM; + boost::crc_optimal<24, 0x1864CFBU, 0x0, 0x0, false, false> CRC_RTCM; // 1) Converts the string to a vector of uint8_t: boost::dynamic_bitset<uint8_t> frame_bits(message_without_crc); std::vector<uint8_t> bytes; @@ -159,7 +159,7 @@ std::string Rtcm::add_CRC(const std::string& message_without_crc) const bool Rtcm::check_CRC(const std::string& message) const { - boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false> CRC_RTCM_CHECK; + boost::crc_optimal<24, 0x1864CFBU, 0x0, 0x0, false, false> CRC_RTCM_CHECK; // Convert message to binary std::string message_bin = Rtcm::binary_data_to_bin(message); // Check CRC @@ -5330,7 +5330,7 @@ int32_t Rtcm::set_DF398(const Gnss_Synchro& gnss_synchro) } else { - rr_mod_ms = static_cast<uint32_t>(std::floor(rough_range_m / meters_to_miliseconds / TWO_N10) + 0.5) & 0x3FFu; + rr_mod_ms = static_cast<uint32_t>(std::floor(rough_range_m / meters_to_miliseconds / TWO_N10) + 0.5) & 0x3FFU; } DF398 = std::bitset<10>(rr_mod_ms); return 0; diff --git a/src/algorithms/libs/beidou_b1i_signal_processing.cc b/src/algorithms/libs/beidou_b1i_signal_processing.cc index 570c1e03a..5b848e6e7 100644 --- a/src/algorithms/libs/beidou_b1i_signal_processing.cc +++ b/src/algorithms/libs/beidou_b1i_signal_processing.cc @@ -135,7 +135,7 @@ void beidou_b1i_code_gen_complex(gsl::span<std::complex<float>> _dest, int32_t _ for (uint32_t ii = 0; ii < _code_length; ++ii) { - _dest[ii] = std::complex<float>(static_cast<float>(b1i_code_int[ii]), 0.0f); + _dest[ii] = std::complex<float>(static_cast<float>(b1i_code_int[ii]), 0.0F); } } diff --git a/src/algorithms/libs/beidou_b3i_signal_processing.cc b/src/algorithms/libs/beidou_b3i_signal_processing.cc index 2c36fd64d..b7f0cd2a5 100644 --- a/src/algorithms/libs/beidou_b3i_signal_processing.cc +++ b/src/algorithms/libs/beidou_b3i_signal_processing.cc @@ -193,7 +193,7 @@ void beidou_b3i_code_gen_complex(gsl::span<std::complex<float>> _dest, signed in for (unsigned int ii = 0; ii < _code_length; ++ii) { - _dest[ii] = std::complex<float>(static_cast<float>(b3i_code_int[ii]), 0.0f); + _dest[ii] = std::complex<float>(static_cast<float>(b3i_code_int[ii]), 0.0F); } } diff --git a/src/algorithms/libs/galileo_e1_signal_processing.cc b/src/algorithms/libs/galileo_e1_signal_processing.cc index bdeba713b..f0294e834 100644 --- a/src/algorithms/libs/galileo_e1_signal_processing.cc +++ b/src/algorithms/libs/galileo_e1_signal_processing.cc @@ -211,7 +211,7 @@ void galileo_e1_code_gen_float_sampled(gsl::span<float> _dest, const std::array< { for (unsigned k = 0; k < _samplesPerCode; k++) { - _signal_E1C_secondary_span[i * _samplesPerCode + k] = _signal_E1_span[k] * (GALILEO_E1_C_SECONDARY_CODE.at(i) == '0' ? 1.0f : -1.0f); + _signal_E1C_secondary_span[i * _samplesPerCode + k] = _signal_E1_span[k] * (GALILEO_E1_C_SECONDARY_CODE.at(i) == '0' ? 1.0F : -1.0F); } } @@ -251,7 +251,7 @@ void galileo_e1_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, c for (uint32_t ii = 0; ii < _samplesPerCode; ++ii) { - _dest[ii] = std::complex<float>(real_code_span[ii], 0.0f); + _dest[ii] = std::complex<float>(real_code_span[ii], 0.0F); } volk_gnsssdr_free(real_code); } diff --git a/src/algorithms/libs/gps_sdr_signal_processing.cc b/src/algorithms/libs/gps_sdr_signal_processing.cc index 3375e3b40..4f7411dc6 100644 --- a/src/algorithms/libs/gps_sdr_signal_processing.cc +++ b/src/algorithms/libs/gps_sdr_signal_processing.cc @@ -139,7 +139,7 @@ void gps_l1_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, int32_t _p for (uint32_t ii = 0; ii < _code_length; ++ii) { - _dest[ii] = std::complex<float>(static_cast<float>(ca_code_int[ii]), 0.0f); + _dest[ii] = std::complex<float>(static_cast<float>(ca_code_int[ii]), 0.0F); } } diff --git a/src/algorithms/libs/rtklib/rtklib_ionex.cc b/src/algorithms/libs/rtklib/rtklib_ionex.cc index 8b8d39ade..d07740dc7 100644 --- a/src/algorithms/libs/rtklib/rtklib_ionex.cc +++ b/src/algorithms/libs/rtklib/rtklib_ionex.cc @@ -149,7 +149,7 @@ tec_t *addtec(const double *lats, const double *lons, const double *hgts, for (i = 0; i < n; i++) { p->data[i] = 0.0; - p->rms[i] = 0.0f; + p->rms[i] = 0.0F; } nav->nt++; return p; diff --git a/src/algorithms/libs/rtklib/rtklib_preceph.cc b/src/algorithms/libs/rtklib/rtklib_preceph.cc index 61217a8ae..c1b5c23e6 100644 --- a/src/algorithms/libs/rtklib/rtklib_preceph.cc +++ b/src/algorithms/libs/rtklib/rtklib_preceph.cc @@ -209,14 +209,14 @@ void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, co for (j = 0; j < 4; j++) { peph.pos[i][j] = 0.0; - peph.std[i][j] = 0.0f; + peph.std[i][j] = 0.0F; peph.vel[i][j] = 0.0; - peph.vst[i][j] = 0.0f; + peph.vst[i][j] = 0.0F; } for (j = 0; j < 3; j++) { - peph.cov[i][j] = 0.0f; - peph.vco[i][j] = 0.0f; + peph.cov[i][j] = 0.0F; + peph.vco[i][j] = 0.0F; } } for (i = pred_o = pred_c = v = 0; i < n && fgets(buff, sizeof(buff), fp); i++) diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc index 8f9e331fc..fc60a4221 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc @@ -778,7 +778,7 @@ unsigned int getbitu(const unsigned char *buff, int pos, int len) int i; for (i = pos; i < pos + len; i++) { - bits = (bits << 1) + ((buff[i / 8] >> (7 - i % 8)) & 1u); + bits = (bits << 1) + ((buff[i / 8] >> (7 - i % 8)) & 1U); } return bits; } @@ -787,11 +787,11 @@ unsigned int getbitu(const unsigned char *buff, int pos, int len) int getbits(const unsigned char *buff, int pos, int len) { unsigned int bits = getbitu(buff, pos, len); - if (len <= 0 || 32 <= len || !(bits & (1u << (len - 1)))) + if (len <= 0 || 32 <= len || !(bits & (1U << (len - 1)))) { return static_cast<int>(bits); } - return static_cast<int>(bits | (~0u << len)); /* extend sign */ + return static_cast<int>(bits | (~0U << len)); /* extend sign */ } @@ -805,7 +805,7 @@ int getbits(const unsigned char *buff, int pos, int len) *-----------------------------------------------------------------------------*/ void setbitu(unsigned char *buff, int pos, int len, unsigned int data) { - unsigned int mask = 1u << (len - 1); + unsigned int mask = 1U << (len - 1); int i; if (len <= 0 || 32 < len) { @@ -815,11 +815,11 @@ void setbitu(unsigned char *buff, int pos, int len, unsigned int data) { if (data & mask) { - buff[i / 8] |= 1u << (7 - i % 8); + buff[i / 8] |= 1U << (7 - i % 8); } else { - buff[i / 8] &= ~(1u << (7 - i % 8)); + buff[i / 8] &= ~(1U << (7 - i % 8)); } } } @@ -2080,10 +2080,10 @@ unsigned int tickget(void) /* linux kernel > 2.6.28 */ if (!clock_gettime(CLOCK_MONOTONIC_RAW, &tp)) { - return tp.tv_sec * 1000u + tp.tv_nsec / 1000000u; + return tp.tv_sec * 1000U + tp.tv_nsec / 1000000U; } gettimeofday(&tv, nullptr); - return tv.tv_sec * 1000u + tv.tv_usec / 1000u; + return tv.tv_sec * 1000U + tv.tv_usec / 1000U; #else gettimeofday(&tv, NULL); diff --git a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc index e59327680..65e3f6905 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc @@ -2075,10 +2075,10 @@ int resamb_LAMBDA(rtk_t *rtk, double *bias, double *xa) trace(4, "N(2)="); tracemat(4, b + nb, 1, nb, 10, 3); - rtk->sol.ratio = s[0] > 0 ? static_cast<float>(s[1] / s[0]) : 0.0f; + rtk->sol.ratio = s[0] > 0 ? static_cast<float>(s[1] / s[0]) : 0.0F; if (rtk->sol.ratio > 999.9) { - rtk->sol.ratio = 999.9f; + rtk->sol.ratio = 999.9F; } /* validation by popular ratio-test */ diff --git a/src/algorithms/libs/rtklib/rtklib_sbas.cc b/src/algorithms/libs/rtklib/rtklib_sbas.cc index 943b271f0..8b5c7c774 100644 --- a/src/algorithms/libs/rtklib/rtklib_sbas.cc +++ b/src/algorithms/libs/rtklib/rtklib_sbas.cc @@ -188,7 +188,7 @@ int decode_sbstype2(const sbsmsg_t *msg, sbssat_t *sbssat) t0 = sbssat->sat[j].fcorr.t0; prc = sbssat->sat[j].fcorr.prc; sbssat->sat[j].fcorr.t0 = gpst2time(msg->week, msg->tow); - sbssat->sat[j].fcorr.prc = getbits(msg->msg, 18 + i * 12, 12) * 0.125f; + sbssat->sat[j].fcorr.prc = getbits(msg->msg, 18 + i * 12, 12) * 0.125F; sbssat->sat[j].fcorr.udre = udre + 1; dt = timediff(sbssat->sat[j].fcorr.t0, t0); if (t0.time == 0 || dt <= 0.0 || 18.0 < dt || sbssat->sat[j].fcorr.ai == 0) @@ -468,7 +468,7 @@ int decode_sbstype24(const sbsmsg_t *msg, sbssat_t *sbssat) udre = getbitu(msg->msg, 86 + 4 * i, 4); sbssat->sat[j].fcorr.t0 = gpst2time(msg->week, msg->tow); - sbssat->sat[j].fcorr.prc = getbits(msg->msg, 14 + i * 12, 12) * 0.125f; + sbssat->sat[j].fcorr.prc = getbits(msg->msg, 14 + i * 12, 12) * 0.125F; sbssat->sat[j].fcorr.udre = udre + 1; sbssat->sat[j].fcorr.iodf = iodf; } @@ -509,7 +509,7 @@ int decode_sbstype26(const sbsmsg_t *msg, sbsion_t *sbsion) delay = getbitu(msg->msg, 22 + i * 13, 9); sbsion[band].igp[j].t0 = gpst2time(msg->week, msg->tow); - sbsion[band].igp[j].delay = delay == 0x1FF ? 0.0f : delay * 0.125f; + sbsion[band].igp[j].delay = delay == 0x1FF ? 0.0F : delay * 0.125F; sbsion[band].igp[j].give = give + 1; if (sbsion[band].igp[j].give >= 16) diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index 188da4bdc..bbc5b57d6 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -76,7 +76,7 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, // 1. Setup lookup table for (unsigned i = 0; i < 0xff; i++) { - lookup_[i] = (static_cast<float>(i & 0xff) - 127.4f) * (1.0f / 128.0f); + lookup_[i] = (static_cast<float>(i & 0xff) - 127.4F) * (1.0F / 128.0F); } // 2. Set socket options diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc index ebca21346..44cd5cd40 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_gs.cc @@ -190,7 +190,7 @@ int gps_l2c_telemetry_decoder_gs::general_work(int noutput_items __attribute__(( // Expand packet bits to bitsets. Notice the reverse order of the bits sequence, required by the CNAV message decoder for (uint32_t i = 0; i < GPS_L2_CNAV_DATA_PAGE_BITS; i++) { - raw_bits[GPS_L2_CNAV_DATA_PAGE_BITS - 1 - i] = ((msg.raw_msg[i / 8] >> (7 - i % 8)) & 1u); + raw_bits[GPS_L2_CNAV_DATA_PAGE_BITS - 1 - i] = ((msg.raw_msg[i / 8] >> (7 - i % 8)) & 1U); } d_CNAV_Message.decode_page(raw_bits); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc index b5329b8d2..ea8a87e44 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_gs.cc @@ -241,7 +241,7 @@ int gps_l5_telemetry_decoder_gs::general_work(int noutput_items __attribute__((u // Expand packet bits to bitsets. Notice the reverse order of the bits sequence, required by the CNAV message decoder for (uint32_t i = 0; i < GPS_L5_CNAV_DATA_PAGE_BITS; i++) { - raw_bits[GPS_L5_CNAV_DATA_PAGE_BITS - 1 - i] = ((msg.raw_msg[i / 8] >> (7 - i % 8)) & 1u); + raw_bits[GPS_L5_CNAV_DATA_PAGE_BITS - 1 - i] = ((msg.raw_msg[i / 8] >> (7 - i % 8)) & 1U); } d_CNAV_Message.decode_page(raw_bits); diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.c b/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.c index 1cbe9eb12..3544aad03 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.c +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.c @@ -75,7 +75,7 @@ uint32_t getbitu(const uint8_t *buff, uint32_t pos, uint8_t len) for (i = pos; i < pos + len; i++) { bits = (bits << 1) + - ((buff[i / 8] >> (7 - i % 8)) & 1u); + ((buff[i / 8] >> (7 - i % 8)) & 1U); } return bits; @@ -99,7 +99,7 @@ int32_t getbits(const uint8_t *buff, uint32_t pos, uint8_t len) /* Sign extend, taken from: * http://graphics.stanford.edu/~seander/bithacks.html#VariableSignExtend */ - int32_t m = 1u << (len - 1); + int32_t m = 1U << (len - 1); return (bits ^ m) - m; } @@ -114,7 +114,7 @@ int32_t getbits(const uint8_t *buff, uint32_t pos, uint8_t len) */ void setbitu(uint8_t *buff, uint32_t pos, uint32_t len, uint32_t data) { - uint32_t mask = 1u << (len - 1); + uint32_t mask = 1U << (len - 1); if (len <= 0 || 32 < len) { @@ -125,11 +125,11 @@ void setbitu(uint8_t *buff, uint32_t pos, uint32_t len, uint32_t data) { if (data & mask) { - buff[i / 8] |= 1u << (7 - i % 8); + buff[i / 8] |= 1U << (7 - i % 8); } else { - buff[i / 8] &= ~(1u << (7 - i % 8)); + buff[i / 8] &= ~(1U << (7 - i % 8)); } } } diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.c b/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.c index 1676fc0cd..260237d40 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.c +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.c @@ -56,9 +56,9 @@ */ /** GPS L2C preamble */ -const uint32_t GPS_CNAV_PREAMBLE1 = 0x8Bu; /* (0b10001011u) */ +const uint32_t GPS_CNAV_PREAMBLE1 = 0x8BU; /* (0b10001011u) */ /** Inverted GPS L2C preamble */ -const uint32_t GPS_CNAV_PREAMBLE2 = 0x74u; /* (0b01110100u) */ +const uint32_t GPS_CNAV_PREAMBLE2 = 0x74U; /* (0b01110100u) */ /** GPS L2C preamble length in bits */ #define GPS_CNAV_PREAMBLE_LENGTH (8) /** GPS L2C CNAV message length in bits */ @@ -307,7 +307,7 @@ static void _cnav_msg_invert(cnav_v27_part_t *part) size_t i = 0; for (i = 0; i < sizeof(part->decoded); i++) { - part->decoded[i] ^= 0xFFu; + part->decoded[i] ^= 0xFFU; } } diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/edc.c b/src/algorithms/telemetry_decoder/libs/libswiftcnav/edc.c index 6e3e06c6f..7bb1e644b 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/edc.c +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/edc.c @@ -125,18 +125,18 @@ uint32_t crc24q_bits(uint32_t crc, const uint8_t *buf, uint32_t n_bits, bool inv acc = (acc << 8) | *buf++; if (invert) { - acc ^= 0xFFu; + acc ^= 0xFFU; } - b = (acc >> shift) & 0xFFu; - crc = ((crc << 8) & 0xFFFFFFu) ^ CRC24QTAB[((crc >> 16) ^ b) & 0xFFu]; + b = (acc >> shift) & 0xFFU; + crc = ((crc << 8) & 0xFFFFFFU) ^ CRC24QTAB[((crc >> 16) ^ b) & 0xFFU]; } acc = (acc << 8) | *buf; if (invert) { - acc ^= 0xFFu; + acc ^= 0xFFU; } - b = (acc >> shift) & 0xFFu; - crc = ((crc << 8) & 0xFFFFFFu) ^ CRC24QTAB[((crc >> 16) ^ b) & 0xFFu]; + b = (acc >> shift) & 0xFFU; + crc = ((crc << 8) & 0xFFFFFFU) ^ CRC24QTAB[((crc >> 16) ^ b) & 0xFFU]; return crc; } diff --git a/src/core/system_parameters/galileo_fnav_message.cc b/src/core/system_parameters/galileo_fnav_message.cc index 9dc6eb49e..3807fc143 100644 --- a/src/core/system_parameters/galileo_fnav_message.cc +++ b/src/core/system_parameters/galileo_fnav_message.cc @@ -42,7 +42,7 @@ #include <iostream> // for string, operator<< #include <iterator> // for back_insert_iterator -using CRC_Galileo_FNAV_type = boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false>; +using CRC_Galileo_FNAV_type = boost::crc_optimal<24, 0x1864CFBU, 0x0, 0x0, false, false>; void Galileo_Fnav_Message::reset() { diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index 62fe2d243..cb5f55b02 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -38,7 +38,7 @@ #include <iostream> // for operator<< -using CRC_Galileo_INAV_type = boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false>; +using CRC_Galileo_INAV_type = boost::crc_optimal<24, 0x1864CFBU, 0x0, 0x0, false, false>; void Galileo_Navigation_Message::reset()