Apply clang-tidy fix modernize-use-bool-literals

This commit is contained in:
Carles Fernandez 2018-12-11 12:08:54 +01:00
parent b80f22fc43
commit f351615ef9
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
9 changed files with 29 additions and 29 deletions

View File

@ -1,3 +1,3 @@
--- ---
Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-named-parameter,readability-string-compare' Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-inefficient-algorithm,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-named-parameter,readability-string-compare'
HeaderFilterRegex: '.*' HeaderFilterRegex: '.*'

View File

@ -247,7 +247,7 @@ void pcps_quicksync_acquisition_cc::set_state(int32_t state)
d_mag = 0.0; d_mag = 0.0;
d_input_power = 0.0; d_input_power = 0.0;
d_test_statistics = 0.0; d_test_statistics = 0.0;
d_active = 1; d_active = true;
} }
else if (d_state == 0) else if (d_state == 0)
{ {

View File

@ -46,7 +46,7 @@ void glonass_l1_ca_code_gen_complex(std::complex<float>* _dest, /* int32_t _prn
for (lcv = 0; lcv < 9; lcv++) for (lcv = 0; lcv < 9; lcv++)
{ {
G1_register[lcv] = 1; G1_register[lcv] = true;
} }
/* Generate G1 Register */ /* Generate G1 Register */

View File

@ -46,7 +46,7 @@ void glonass_l2_ca_code_gen_complex(std::complex<float>* _dest, /* int32_t _prn,
for (lcv = 0; lcv < 9; lcv++) for (lcv = 0; lcv < 9; lcv++)
{ {
G1_register[lcv] = 1; G1_register[lcv] = true;
} }
/* Generate G1 Register */ /* Generate G1 Register */

View File

@ -40,9 +40,9 @@
std::deque<bool> l5i_xa_shift(std::deque<bool> xa) std::deque<bool> l5i_xa_shift(std::deque<bool> xa)
{ {
if (xa == std::deque<bool>{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}) if (xa == std::deque<bool>{true, true, true, true, true, true, true, true, true, true, true, false, true})
{ {
return std::deque<bool>{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; return std::deque<bool>{true, true, true, true, true, true, true, true, true, true, true, true, true};
} }
std::deque<bool> out(xa.begin(), xa.end() - 1); std::deque<bool> out(xa.begin(), xa.end() - 1);
out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]);
@ -52,9 +52,9 @@ std::deque<bool> l5i_xa_shift(std::deque<bool> xa)
std::deque<bool> l5q_xa_shift(std::deque<bool> xa) std::deque<bool> l5q_xa_shift(std::deque<bool> xa)
{ {
if (xa == std::deque<bool>{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}) if (xa == std::deque<bool>{true, true, true, true, true, true, true, true, true, true, true, false, true})
{ {
return std::deque<bool>{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; return std::deque<bool>{true, true, true, true, true, true, true, true, true, true, true, true, true};
} }
std::deque<bool> out(xa.begin(), xa.end() - 1); std::deque<bool> out(xa.begin(), xa.end() - 1);
out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]);
@ -80,8 +80,8 @@ std::deque<bool> l5q_xb_shift(std::deque<bool> xb)
std::deque<bool> make_l5i_xa() std::deque<bool> make_l5i_xa()
{ {
std::deque<bool> xa = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; std::deque<bool> xa = {true, true, true, true, true, true, true, true, true, true, true, true, true};
std::deque<bool> y(GPS_L5i_CODE_LENGTH_CHIPS, 0); std::deque<bool> y(GPS_L5i_CODE_LENGTH_CHIPS, false);
for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++) for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++)
{ {
@ -94,8 +94,8 @@ std::deque<bool> make_l5i_xa()
std::deque<bool> make_l5i_xb() std::deque<bool> make_l5i_xb()
{ {
std::deque<bool> xb = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; std::deque<bool> xb = {true, true, true, true, true, true, true, true, true, true, true, true, true};
std::deque<bool> y(GPS_L5i_CODE_LENGTH_CHIPS, 0); std::deque<bool> y(GPS_L5i_CODE_LENGTH_CHIPS, false);
for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++) for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++)
{ {
@ -108,8 +108,8 @@ std::deque<bool> make_l5i_xb()
std::deque<bool> make_l5q_xa() std::deque<bool> make_l5q_xa()
{ {
std::deque<bool> xa = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; std::deque<bool> xa = {true, true, true, true, true, true, true, true, true, true, true, true, true};
std::deque<bool> y(GPS_L5q_CODE_LENGTH_CHIPS, 0); std::deque<bool> y(GPS_L5q_CODE_LENGTH_CHIPS, false);
for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++) for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++)
{ {
@ -122,8 +122,8 @@ std::deque<bool> make_l5q_xa()
std::deque<bool> make_l5q_xb() std::deque<bool> make_l5q_xb()
{ {
std::deque<bool> xb = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; std::deque<bool> xb = {true, true, true, true, true, true, true, true, true, true, true, true, true};
std::deque<bool> y(GPS_L5q_CODE_LENGTH_CHIPS, 0); std::deque<bool> y(GPS_L5q_CODE_LENGTH_CHIPS, false);
for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++) for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++)
{ {
@ -140,13 +140,13 @@ void make_l5i(int32_t* _dest, int32_t prn)
std::deque<bool> xb = make_l5i_xb(); std::deque<bool> xb = make_l5i_xb();
std::deque<bool> xa = make_l5i_xa(); std::deque<bool> xa = make_l5i_xa();
std::deque<bool> xb_shift(GPS_L5i_CODE_LENGTH_CHIPS, 0); std::deque<bool> xb_shift(GPS_L5i_CODE_LENGTH_CHIPS, false);
for (int32_t n = 0; n < GPS_L5i_CODE_LENGTH_CHIPS; n++) for (int32_t n = 0; n < GPS_L5i_CODE_LENGTH_CHIPS; n++)
{ {
xb_shift[n] = xb[(xb_offset + n) % GPS_L5i_CODE_LENGTH_CHIPS]; xb_shift[n] = xb[(xb_offset + n) % GPS_L5i_CODE_LENGTH_CHIPS];
} }
std::deque<bool> out_code(GPS_L5i_CODE_LENGTH_CHIPS, 0); std::deque<bool> out_code(GPS_L5i_CODE_LENGTH_CHIPS, false);
for (int32_t n = 0; n < GPS_L5i_CODE_LENGTH_CHIPS; n++) for (int32_t n = 0; n < GPS_L5i_CODE_LENGTH_CHIPS; n++)
{ {
_dest[n] = xa[n] xor xb_shift[n]; _dest[n] = xa[n] xor xb_shift[n];
@ -160,13 +160,13 @@ void make_l5q(int32_t* _dest, int32_t prn)
std::deque<bool> xb = make_l5q_xb(); std::deque<bool> xb = make_l5q_xb();
std::deque<bool> xa = make_l5q_xa(); std::deque<bool> xa = make_l5q_xa();
std::deque<bool> xb_shift(GPS_L5q_CODE_LENGTH_CHIPS, 0); std::deque<bool> xb_shift(GPS_L5q_CODE_LENGTH_CHIPS, false);
for (int32_t n = 0; n < GPS_L5q_CODE_LENGTH_CHIPS; n++) for (int32_t n = 0; n < GPS_L5q_CODE_LENGTH_CHIPS; n++)
{ {
xb_shift[n] = xb[(xb_offset + n) % GPS_L5q_CODE_LENGTH_CHIPS]; xb_shift[n] = xb[(xb_offset + n) % GPS_L5q_CODE_LENGTH_CHIPS];
} }
std::deque<bool> out_code(GPS_L5q_CODE_LENGTH_CHIPS, 0); std::deque<bool> out_code(GPS_L5q_CODE_LENGTH_CHIPS, false);
for (int32_t n = 0; n < GPS_L5q_CODE_LENGTH_CHIPS; n++) for (int32_t n = 0; n < GPS_L5q_CODE_LENGTH_CHIPS; n++)
{ {
_dest[n] = xa[n] xor xb_shift[n]; _dest[n] = xa[n] xor xb_shift[n];

View File

@ -68,8 +68,8 @@ void gps_l1_ca_code_gen_int(int32_t* _dest, int32_t _prn, uint32_t _chip_shift)
for (lcv = 0; lcv < 10; lcv++) for (lcv = 0; lcv < 10; lcv++)
{ {
G1_register[lcv] = 1; G1_register[lcv] = true;
G2_register[lcv] = 1; G2_register[lcv] = true;
} }
/* Generate G1 & G2 Register */ /* Generate G1 & G2 Register */

View File

@ -424,7 +424,7 @@ void decodefile(rtksvr_t *svr, int index)
{ /* precise clock */ { /* precise clock */
/* read rinex clock */ // Disabled!! /* read rinex clock */ // Disabled!!
if (1 /*readrnxc(file, &nav)<=0 */) if (true /*readrnxc(file, &nav)<=0 */)
{ {
tracet(1, "rinex clock file read error: %s\n", file); tracet(1, "rinex clock file read error: %s\n", file);
return; return;

View File

@ -191,7 +191,7 @@ bool front_end_capture(const std::shared_ptr<ConfigurationInterface>& configurat
catch (const boost::exception_ptr& e) catch (const boost::exception_ptr& e)
{ {
std::cout << "Exception caught in creating source " << e << std::endl; std::cout << "Exception caught in creating source " << e << std::endl;
return 0; return false;
} }
std::shared_ptr<GNSSBlockInterface> conditioner; std::shared_ptr<GNSSBlockInterface> conditioner;
@ -202,7 +202,7 @@ bool front_end_capture(const std::shared_ptr<ConfigurationInterface>& configurat
catch (const boost::exception_ptr& e) catch (const boost::exception_ptr& e)
{ {
std::cout << "Exception caught in creating signal conditioner " << e << std::endl; std::cout << "Exception caught in creating signal conditioner " << e << std::endl;
return 0; return false;
} }
gr::block_sptr sink; gr::block_sptr sink;
sink = gr::blocks::file_sink::make(sizeof(gr_complex), "tmp_capture.dat"); sink = gr::blocks::file_sink::make(sizeof(gr_complex), "tmp_capture.dat");

View File

@ -260,15 +260,15 @@ int main(int argc, char** argv)
eph.d_TGD = rne.Tgd; eph.d_TGD = rne.Tgd;
eph.d_IODC = rne.IODC; eph.d_IODC = rne.IODC;
eph.i_AODO = 0; // eph.i_AODO = 0; //
eph.b_fit_interval_flag = (rne.fitint > 4) ? 1 : 0; eph.b_fit_interval_flag = (rne.fitint > 4) ? true : false;
eph.d_spare1 = 0.0; eph.d_spare1 = 0.0;
eph.d_spare2 = 0.0; eph.d_spare2 = 0.0;
eph.d_A_f0 = rne.af0; eph.d_A_f0 = rne.af0;
eph.d_A_f1 = rne.af1; eph.d_A_f1 = rne.af1;
eph.d_A_f2 = rne.af2; eph.d_A_f2 = rne.af2;
eph.b_integrity_status_flag = 0; // eph.b_integrity_status_flag = false; //
eph.b_alert_flag = 0; // eph.b_alert_flag = false; //
eph.b_antispoofing_flag = 0; // eph.b_antispoofing_flag = false; //
eph_map[i] = eph; eph_map[i] = eph;
i++; i++;
} }