Use uppercase literal suffix

This commit is contained in:
Carles Fernandez 2019-06-29 14:22:15 +02:00
parent f90d52a1e2
commit c37b3e00b5
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
18 changed files with 45 additions and 45 deletions

View File

@ -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;

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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++)

View File

@ -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);

View File

@ -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 */

View File

@ -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)

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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));
}
}
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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()
{

View File

@ -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()