diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 67301faf9..4a52770c9 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -877,11 +877,9 @@ bool rtklib_pvt_cc::save_gnss_synchro_map_xml(const std::string& file_name) } return true; } - else - { - LOG(WARNING) << "Failed to save gnss_synchro, map is empty"; - return false; - } + + LOG(WARNING) << "Failed to save gnss_synchro, map is empty"; + return false; } @@ -925,10 +923,8 @@ bool rtklib_pvt_cc::get_latest_PVT(double* longitude_deg, return true; } - else - { - return false; - } + + return false; } diff --git a/src/algorithms/PVT/libs/geojson_printer.cc b/src/algorithms/PVT/libs/geojson_printer.cc index 0e1091b98..7f4da17c1 100644 --- a/src/algorithms/PVT/libs/geojson_printer.cc +++ b/src/algorithms/PVT/libs/geojson_printer.cc @@ -149,19 +149,15 @@ bool GeoJSON_Printer::set_headers(const std::string& filename, bool time_tag_nam geojson_file << " \"properties\": {" << std::endl; geojson_file << R"( "name": "Locations generated by GNSS-SDR" )" << std::endl; geojson_file << " }," << std::endl; - - geojson_file << " \"geometry\": {" << std::endl; geojson_file << R"( "type": "MultiPoint",)" << std::endl; geojson_file << " \"coordinates\": [" << std::endl; return true; } - else - { - std::cout << "File " << filename_ << " cannot be saved. Wrong permissions?" << std::endl; - return false; - } + + std::cout << "File " << filename_ << " cannot be saved. Wrong permissions?" << std::endl; + return false; } @@ -200,10 +196,7 @@ bool GeoJSON_Printer::print_position(const std::shared_ptr& positi } return true; } - else - { - return false; - } + return false; } @@ -222,11 +215,7 @@ bool GeoJSON_Printer::close_file() { if (remove(filename_.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; } - return true; } - else - { - return false; - } + return false; } diff --git a/src/algorithms/PVT/libs/gpx_printer.cc b/src/algorithms/PVT/libs/gpx_printer.cc index 78e7ecda1..7ca86052a 100644 --- a/src/algorithms/PVT/libs/gpx_printer.cc +++ b/src/algorithms/PVT/libs/gpx_printer.cc @@ -149,11 +149,8 @@ bool Gpx_Printer::set_headers(const std::string& filename, bool time_tag_name) << indent << indent << "" << std::endl; return true; } - else - { - std::cout << "File " << gpx_filename << " cannot be saved. Wrong permissions?" << std::endl; - return false; - } + std::cout << "File " << gpx_filename << " cannot be saved. Wrong permissions?" << std::endl; + return false; } @@ -201,10 +198,7 @@ bool Gpx_Printer::print_position(const std::shared_ptr& position, << "" << std::endl; return true; } - else - { - return false; - } + return false; } @@ -218,10 +212,7 @@ bool Gpx_Printer::close_file() gpx_file.close(); return true; } - else - { - return false; - } + return false; } diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index e0892562b..76018ba35 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -206,11 +206,8 @@ bool Kml_Printer::set_headers(const std::string& filename, bool time_tag_name) return true; } - else - { - std::cout << "File " << kml_filename << " cannot be saved. Wrong permissions?" << std::endl; - return false; - } + std::cout << "File " << kml_filename << " cannot be saved. Wrong permissions?" << std::endl; + return false; } @@ -282,10 +279,7 @@ bool Kml_Printer::print_position(const std::shared_ptr& position, return true; } - else - { - return false; - } + return false; } @@ -319,10 +313,7 @@ bool Kml_Printer::close_file() return true; } - else - { - return false; - } + return false; } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc index 7cdcacf14..26c3e42fb 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc @@ -203,10 +203,7 @@ signed int GalileoE1Pcps8msAmbiguousAcquisition::mag() { return acquisition_cc_->mag(); } - else - { - return 0; - } + return 0; } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc index 791aad2e3..22262ca2b 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -334,7 +334,7 @@ gr::basic_block_sptr GalileoE1PcpsAmbiguousAcquisition::get_left_block() { return acquisition_; } - else if (item_type_ == "cshort") + if (item_type_ == "cshort") { return acquisition_; } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc index 809924e89..d0e16de1f 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc @@ -206,10 +206,7 @@ signed int GalileoE1PcpsCccwsrAmbiguousAcquisition::mag() { return acquisition_cc_->mag(); } - else - { - return 0; - } + return 0; } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc index ab87e5f79..ecc243de0 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc @@ -237,10 +237,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::mag() { return acquisition_cc_->mag(); } - else - { - return 0; - } + return 0; } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc index 7843078f0..db77547a5 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc @@ -207,10 +207,7 @@ signed int GalileoE1PcpsTongAmbiguousAcquisition::mag() { return acquisition_cc_->mag(); } - else - { - return 0; - } + return 0; } diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc index c2841157e..d9fe2ac69 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc @@ -213,10 +213,7 @@ signed int GalileoE5aNoncoherentIQAcquisitionCaf::mag() { return acquisition_cc_->mag(); } - else - { - return 0; - } + return 0; } diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc index 42f6cb3f3..9f9cb22d6 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc @@ -319,7 +319,7 @@ gr::basic_block_sptr GlonassL1CaPcpsAcquisition::get_left_block() { return acquisition_; } - else if (item_type_ == "cshort") + if (item_type_ == "cshort") { return acquisition_; } diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc index fac80f39e..ef6a7dcf1 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc @@ -318,7 +318,7 @@ gr::basic_block_sptr GlonassL2CaPcpsAcquisition::get_left_block() { return acquisition_; } - else if (item_type_ == "cshort") + if (item_type_ == "cshort") { return acquisition_; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc index 991ae7880..2af325c52 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -307,7 +307,7 @@ gr::basic_block_sptr GpsL1CaPcpsAcquisition::get_left_block() { return acquisition_; } - else if (item_type_ == "cshort") + if (item_type_ == "cshort") { return acquisition_; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc index 56bcee3a2..8a4774f7b 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc @@ -231,10 +231,7 @@ signed int GpsL1CaPcpsQuickSyncAcquisition::mag() { return acquisition_cc_->mag(); } - else - { - return 0; - } + return 0; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc index cf3a0c61f..7663d76ca 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc @@ -193,10 +193,7 @@ signed int GpsL1CaPcpsTongAcquisition::mag() { return acquisition_cc_->mag(); } - else - { - return 0; - } + return 0; } diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc index 9f1fa5e2e..acf415635 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -321,7 +321,7 @@ gr::basic_block_sptr GpsL2MPcpsAcquisition::get_left_block() { return acquisition_; } - else if (item_type_ == "cshort") + if (item_type_ == "cshort") { return acquisition_; } diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc index c9ee6bc4c..16066ebaa 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc @@ -309,7 +309,7 @@ gr::basic_block_sptr GpsL5iPcpsAcquisition::get_left_block() { return acquisition_; } - else if (item_type_ == "cshort") + if (item_type_ == "cshort") { return acquisition_; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 156134a77..224a873e6 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -268,7 +268,7 @@ bool pcps_acquisition::is_fdma() LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_old_freq << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl; return true; } - else if (strcmp(d_gnss_synchro->Signal, "2G") == 0) + if (strcmp(d_gnss_synchro->Signal, "2G") == 0) { d_old_freq += DFRQ2_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN); LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_old_freq << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl; diff --git a/src/algorithms/channel/libs/channel_fsm.cc b/src/algorithms/channel/libs/channel_fsm.cc index ad6ed9e3a..968ea2393 100644 --- a/src/algorithms/channel/libs/channel_fsm.cc +++ b/src/algorithms/channel/libs/channel_fsm.cc @@ -81,13 +81,10 @@ bool ChannelFsm::Event_start_acquisition() { return false; } - else - { - d_state = 1; - start_acquisition(); - DLOG(INFO) << "CH = " << channel_ << ". Ev start acquisition"; - return true; - } + d_state = 1; + start_acquisition(); + DLOG(INFO) << "CH = " << channel_ << ". Ev start acquisition"; + return true; } @@ -98,13 +95,10 @@ bool ChannelFsm::Event_valid_acquisition() { return false; } - else - { - d_state = 2; - start_tracking(); - DLOG(INFO) << "CH = " << channel_ << ". Ev valid acquisition"; - return true; - } + d_state = 2; + start_tracking(); + DLOG(INFO) << "CH = " << channel_ << ". Ev valid acquisition"; + return true; } @@ -115,13 +109,10 @@ bool ChannelFsm::Event_failed_acquisition_repeat() { return false; } - else - { - d_state = 1; - start_acquisition(); - DLOG(INFO) << "CH = " << channel_ << ". Ev failed acquisition repeat"; - return true; - } + d_state = 1; + start_acquisition(); + DLOG(INFO) << "CH = " << channel_ << ". Ev failed acquisition repeat"; + return true; } @@ -132,13 +123,10 @@ bool ChannelFsm::Event_failed_acquisition_no_repeat() { return false; } - else - { - d_state = 3; - request_satellite(); - DLOG(INFO) << "CH = " << channel_ << ". Ev failed acquisition no repeat"; - return true; - } + d_state = 3; + request_satellite(); + DLOG(INFO) << "CH = " << channel_ << ". Ev failed acquisition no repeat"; + return true; } @@ -149,13 +137,10 @@ bool ChannelFsm::Event_failed_tracking_standby() { return false; } - else - { - d_state = 0U; - notify_stop_tracking(); - DLOG(INFO) << "CH = " << channel_ << ". Ev failed tracking standby"; - return true; - } + d_state = 0U; + notify_stop_tracking(); + DLOG(INFO) << "CH = " << channel_ << ". Ev failed tracking standby"; + return true; } diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc b/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc index 4d773eb7e..5cfbd4186 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_cbyte.cc @@ -144,8 +144,5 @@ gr::basic_block_sptr IbyteToCbyte::get_right_block() { return conjugate_ic_; } - else - { - return ibyte_to_cbyte_; - } + return ibyte_to_cbyte_; } diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc index 6e448d536..cd8c14850 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_complex.cc @@ -142,8 +142,5 @@ gr::basic_block_sptr IbyteToComplex::get_right_block() { return conjugate_cc_; } - else - { - return gr_interleaved_char_to_complex_; - } + return gr_interleaved_char_to_complex_; } diff --git a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc index ea2580c25..f4c8b6207 100644 --- a/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc +++ b/src/algorithms/data_type_adapter/adapters/ibyte_to_cshort.cc @@ -141,8 +141,5 @@ gr::basic_block_sptr IbyteToCshort::get_right_block() { return conjugate_sc_; } - else - { - return interleaved_byte_to_complex_short_; - } + return interleaved_byte_to_complex_short_; } diff --git a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc index 54cea92b3..918dbd8a3 100644 --- a/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc +++ b/src/algorithms/data_type_adapter/adapters/ishort_to_complex.cc @@ -142,8 +142,5 @@ gr::basic_block_sptr IshortToComplex::get_right_block() { return conjugate_cc_; } - else - { - return gr_interleaved_short_to_complex_; - } + return gr_interleaved_short_to_complex_; } diff --git a/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc b/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc index a6d07ab21..c6a7d7490 100644 --- a/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc +++ b/src/algorithms/data_type_adapter/adapters/ishort_to_cshort.cc @@ -144,8 +144,5 @@ gr::basic_block_sptr IshortToCshort::get_right_block() { return conjugate_sc_; } - else - { - return interleaved_short_to_complex_short_; - } + return interleaved_short_to_complex_short_; } diff --git a/src/algorithms/input_filter/adapters/fir_filter.cc b/src/algorithms/input_filter/adapters/fir_filter.cc index 3537ab0da..5ed87fd75 100644 --- a/src/algorithms/input_filter/adapters/fir_filter.cc +++ b/src/algorithms/input_filter/adapters/fir_filter.cc @@ -284,7 +284,7 @@ gr::basic_block_sptr FirFilter::get_left_block() { return fir_filter_ccf_; } - else if ((taps_item_type_ == "float") && (input_item_type_ == "cshort") && (output_item_type_ == "cshort")) + if ((taps_item_type_ == "float") && (input_item_type_ == "cshort") && (output_item_type_ == "cshort")) { return cshort_to_float_x2_; } @@ -314,7 +314,7 @@ gr::basic_block_sptr FirFilter::get_right_block() { return fir_filter_ccf_; } - else if ((taps_item_type_ == "float") && (input_item_type_ == "cshort") && (output_item_type_ == "cshort")) + if ((taps_item_type_ == "float") && (input_item_type_ == "cshort") && (output_item_type_ == "cshort")) { return short_x2_to_cshort_; } diff --git a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc index ba2a30899..643929db7 100644 --- a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc +++ b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc @@ -324,7 +324,7 @@ gr::basic_block_sptr FreqXlatingFirFilter::get_left_block() { return freq_xlating_fir_filter_ccf_; } - else if ((taps_item_type_ == "float") && (input_item_type_ == "float") && (output_item_type_ == "gr_complex")) + if ((taps_item_type_ == "float") && (input_item_type_ == "float") && (output_item_type_ == "gr_complex")) { return freq_xlating_fir_filter_fcf_; } @@ -358,7 +358,7 @@ gr::basic_block_sptr FreqXlatingFirFilter::get_right_block() { return freq_xlating_fir_filter_ccf_; } - else if ((taps_item_type_ == "float") && (input_item_type_ == "float") && (output_item_type_ == "gr_complex")) + if ((taps_item_type_ == "float") && (input_item_type_ == "float") && (output_item_type_ == "gr_complex")) { return freq_xlating_fir_filter_fcf_; } diff --git a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc index 504baf800..236ecd4cc 100644 --- a/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc +++ b/src/algorithms/input_filter/adapters/pulse_blanking_filter.cc @@ -158,15 +158,12 @@ gr::basic_block_sptr PulseBlankingFilter::get_left_block() { return freq_xlating_; } - else - { - return pulse_blanking_cc_; - } + return pulse_blanking_cc_; } else { - return nullptr; LOG(ERROR) << " Unknown input filter input/output item type conversion"; + return nullptr; } } @@ -177,9 +174,6 @@ gr::basic_block_sptr PulseBlankingFilter::get_right_block() { return pulse_blanking_cc_; } - else - { - return nullptr; - LOG(ERROR) << " Unknown input filter input/output item type conversion"; - } + LOG(ERROR) << " Unknown input filter input/output item type conversion"; + return nullptr; } diff --git a/src/algorithms/libs/gnss_sdr_create_directory.cc b/src/algorithms/libs/gnss_sdr_create_directory.cc index 3a880143b..d0af41952 100644 --- a/src/algorithms/libs/gnss_sdr_create_directory.cc +++ b/src/algorithms/libs/gnss_sdr_create_directory.cc @@ -79,9 +79,7 @@ bool gnss_sdr_create_directory(const std::string& foldername) } return true; } - else - { - os_test_file.close(); - return false; - } + + os_test_file.close(); + return false; } diff --git a/src/algorithms/libs/gnss_sdr_valve.cc b/src/algorithms/libs/gnss_sdr_valve.cc index 9e8dec580..8ef8eb08d 100644 --- a/src/algorithms/libs/gnss_sdr_valve.cc +++ b/src/algorithms/libs/gnss_sdr_valve.cc @@ -90,11 +90,8 @@ int gnss_sdr_valve::work(int noutput_items, { return -1; // Done! } - else - { - usleep(1000000); - return 0; // do not produce or consume - } + usleep(1000000); + return 0; // do not produce or consume } unsigned long long n = std::min(d_nitems - d_ncopied_items, static_cast(noutput_items)); if (n == 0) return 0; @@ -102,9 +99,7 @@ int gnss_sdr_valve::work(int noutput_items, d_ncopied_items += n; return n; } - else - { - memcpy(output_items[0], input_items[0], noutput_items * input_signature()->sizeof_stream_item(0)); - return noutput_items; - } + + memcpy(output_items[0], input_items[0], noutput_items * input_signature()->sizeof_stream_item(0)); + return noutput_items; } diff --git a/src/algorithms/libs/gps_l5_signal.cc b/src/algorithms/libs/gps_l5_signal.cc index c5e970bf5..2c1336a21 100644 --- a/src/algorithms/libs/gps_l5_signal.cc +++ b/src/algorithms/libs/gps_l5_signal.cc @@ -44,12 +44,9 @@ std::deque l5i_xa_shift(std::deque xa) { return std::deque{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; } - else - { - std::deque out(xa.begin(), xa.end() - 1); - out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); - return out; - } + std::deque out(xa.begin(), xa.end() - 1); + out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); + return out; } @@ -59,12 +56,9 @@ std::deque l5q_xa_shift(std::deque xa) { return std::deque{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; } - else - { - std::deque out(xa.begin(), xa.end() - 1); - out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); - return out; - } + std::deque out(xa.begin(), xa.end() - 1); + out.push_front(xa[12] xor xa[11] xor xa[9] xor xa[8]); + return out; } diff --git a/src/algorithms/libs/pass_through.cc b/src/algorithms/libs/pass_through.cc index fc50da210..b388363da 100644 --- a/src/algorithms/libs/pass_through.cc +++ b/src/algorithms/libs/pass_through.cc @@ -149,7 +149,7 @@ gr::basic_block_sptr Pass_Through::get_left_block() { return conjugate_cc_; } - else if (item_type_ == "cshort") + if (item_type_ == "cshort") { return conjugate_sc_; } @@ -176,7 +176,7 @@ gr::basic_block_sptr Pass_Through::get_right_block() { return conjugate_cc_; } - else if (item_type_ == "cshort") + if (item_type_ == "cshort") { return conjugate_sc_; } diff --git a/src/algorithms/libs/rtklib/rtklib_ionex.cc b/src/algorithms/libs/rtklib/rtklib_ionex.cc index ab7747135..baae973c5 100644 --- a/src/algorithms/libs/rtklib/rtklib_ionex.cc +++ b/src/algorithms/libs/rtklib/rtklib_ionex.cc @@ -400,18 +400,17 @@ void readtec(const char *file, nav_t *nav, int opt) trace(2, "ionex file open error %s\n", efiles[i]); continue; } - else + + /* read ionex header */ + if (readionexh(fp, lats, lons, hgts, &rb, &nexp, dcb, rms) <= 0.0) { - /* read ionex header */ - if (readionexh(fp, lats, lons, hgts, &rb, &nexp, dcb, rms) <= 0.0) - { - trace(2, "ionex file format error %s\n", efiles[i]); - fclose(fp); - continue; - } - /* read ionex body */ - readionexb(fp, lats, lons, hgts, rb, nexp, nav); + trace(2, "ionex file format error %s\n", efiles[i]); + fclose(fp); + continue; } + + /* read ionex body */ + readionexb(fp, lats, lons, hgts, rb, nexp, nav); fclose(fp); } for (i = 0; i < MAXEXFILE; i++) free(efiles[i]); diff --git a/src/algorithms/libs/rtklib/rtklib_lambda.cc b/src/algorithms/libs/rtklib/rtklib_lambda.cc index 3130b0e21..74e247aa0 100644 --- a/src/algorithms/libs/rtklib/rtklib_lambda.cc +++ b/src/algorithms/libs/rtklib/rtklib_lambda.cc @@ -197,13 +197,11 @@ int search(int n, int m, const double *L, const double *D, { if (k == n - 1) break; - else - { - k++; - z[k] += step[k]; - y = zb[k] - z[k]; - step[k] = -step[k] - SGN_LAMBDA(step[k]); - } + + k++; + z[k] += step[k]; + y = zb[k] - z[k]; + step[k] = -step[k] - SGN_LAMBDA(step[k]); } } for (i = 0; i < m - 1; i++) diff --git a/src/algorithms/libs/rtklib/rtklib_pntpos.cc b/src/algorithms/libs/rtklib/rtklib_pntpos.cc index d2b4b43da..5c3a3255f 100644 --- a/src/algorithms/libs/rtklib/rtklib_pntpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_pntpos.cc @@ -243,7 +243,7 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel, return 0.0; } - else if (obs->code[i] != CODE_NONE and obs->code[j] == CODE_NONE) + if (obs->code[i] != CODE_NONE and obs->code[j] == CODE_NONE) { P1 += P1_C1; /* C1->P1 */ PC = P1 - P1_P2; diff --git a/src/algorithms/libs/rtklib/rtklib_rtcm.cc b/src/algorithms/libs/rtklib/rtklib_rtcm.cc index 46163873e..56e46907c 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtcm.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtcm.cc @@ -194,8 +194,8 @@ int input_rtcm2(rtcm_t *rtcm, unsigned char data) } if (++rtcm->nbit < 30) continue; - else - rtcm->nbit = 0; + + rtcm->nbit = 0; /* check parity */ if (!decode_word(rtcm->word, rtcm->buff + rtcm->nbyte)) diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc index 612f8791a..2ac962251 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc @@ -1775,11 +1775,9 @@ unsigned int tickget(void) { return tp.tv_sec * 1000u + tp.tv_nsec / 1000000u; } - else - { - gettimeofday(&tv, nullptr); - return tv.tv_sec * 1000u + tv.tv_usec / 1000u; - } + gettimeofday(&tv, nullptr); + return tv.tv_sec * 1000u + tv.tv_usec / 1000u; + #else gettimeofday(&tv, NULL); return tv.tv_sec * 1000u + tv.tv_usec / 1000u; @@ -3175,7 +3173,7 @@ void freenav(nav_t *nav, int opt) /* debug trace functions -----------------------------------------------------*/ //#ifdef TRACE // -FILE *fp_trace = nullptr; /* file pointer of trace */ +FILE *fp_trace = nullptr; /* file pointer of trace */ char file_trace[1024]; /* trace file */ static int level_trace = 0; /* level of trace */ unsigned int tick_trace = 0; /* tick time at traceopen (ms) */ @@ -3635,7 +3633,7 @@ double satwavelen(int sat, int frq, const nav_t *nav) { if (frq == 0) return SPEED_OF_LIGHT / FREQ1_BDS; /* B1 */ - else if (frq == 1) + if (frq == 1) return SPEED_OF_LIGHT / FREQ2_BDS; /* B2 */ else if (frq == 2) return SPEED_OF_LIGHT / FREQ3_BDS; /* B3 */ @@ -3644,7 +3642,7 @@ double satwavelen(int sat, int frq, const nav_t *nav) { if (frq == 0) return SPEED_OF_LIGHT / FREQ1; /* L1/E1 */ - else if (frq == 1) + if (frq == 1) return SPEED_OF_LIGHT / FREQ2; /* L2 */ else if (frq == 2) return SPEED_OF_LIGHT / FREQ5; /* L5/E5a */ @@ -3886,7 +3884,7 @@ double interpc(const double coef[], double lat) int i = (int)(lat / 15.0); if (i < 1) return coef[0]; - else if (i > 4) + if (i > 4) return coef[4]; return coef[i - 1] * (1.0 - lat / 15.0 + i) + coef[i] * (lat / 15.0 - i); } @@ -3999,7 +3997,7 @@ double interpvar(double ang, const double *var) int i = (int)a; if (i < 0) return var[0]; - else if (i >= 18) + if (i >= 18) return var[18]; return var[i] * (1.0 - a + i) + var[i + 1] * (a - i); } diff --git a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc index ef971be0e..20dac4267 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc @@ -67,7 +67,7 @@ static int resamb_TCAR(rtk_t *rtk __attribute((unused)), const obsd_t *obs __att /* global variables ----------------------------------------------------------*/ static int statlevel = 0; /* rtk status output level (0:off) */ -static FILE *fp_stat = nullptr; /* rtk status file pointer */ +static FILE *fp_stat = nullptr; /* rtk status file pointer */ static char file_stat[1024] = ""; /* rtk status file original path */ static gtime_t time_stat = {0, 0}; /* rtk status file time */ @@ -1616,8 +1616,7 @@ int ddmat(rtk_t *rtk, double *D) rtk->ssat[i - k].fix[f] = 2; /* fix */ break; } - else - rtk->ssat[i - k].fix[f] = 1; + rtk->ssat[i - k].fix[f] = 1; } for (j = k; j < k + MAXSAT; j++) { diff --git a/src/algorithms/libs/rtklib/rtklib_solution.cc b/src/algorithms/libs/rtklib/rtklib_solution.cc index a0c4c8663..587067bb7 100644 --- a/src/algorithms/libs/rtklib/rtklib_solution.cc +++ b/src/algorithms/libs/rtklib/rtklib_solution.cc @@ -79,7 +79,7 @@ const char *opt2sep(const solopt_t *opt) { if (!*opt->sep) return " "; - else if (!strcmp(opt->sep, "\\t")) + if (!strcmp(opt->sep, "\\t")) return "\t"; return opt->sep; } @@ -343,7 +343,7 @@ int decode_nmea(char *buff, sol_t *sol) { return decode_nmearmc(val + 1, n - 1, sol); } - else if (!strcmp(val[0], "$GPGGA")) + if (!strcmp(val[0], "$GPGGA")) { return decode_nmeagga(val + 1, n - 1, sol); } diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 8696dad44..59b833c5b 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -1227,7 +1227,7 @@ int rspntrip_s(ntrip_t *ntrip, char *msg) tracet(2, "rspntrip_s: response ok nb=%d\n", ntrip->nb); return 1; } - else if ((p = strstr((char *)ntrip->buff, NTRIP_RSP_ERROR))) + if ((p = strstr((char *)ntrip->buff, NTRIP_RSP_ERROR))) { /* error */ nb = ntrip->nb < MAXSTATMSG ? ntrip->nb : MAXSTATMSG; // strncpy(msg, (char *)ntrip->buff, nb); This line triggers a warning. Replaced by; @@ -2362,7 +2362,7 @@ void strsendcmd(stream_t *str, const char *cmd) } if (*q == '\0') break; - else - p = q + 1; + + p = q + 1; } } diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc index ffd2dfdf0..d2d6edd2d 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc @@ -409,10 +409,7 @@ bool hybrid_observables_cc::interp_trk_obs(Gnss_Synchro &interpolated_obs, const // << " ,diff: " << old_abs_diff << " samples (" << static_cast(old_abs_diff) / static_cast(d_gnss_synchro_history->at(ch, nearest_element).fs) << " s)\n"; return true; } - else - { - return false; - } + return false; } else { @@ -616,8 +613,5 @@ int hybrid_observables_cc::general_work(int noutput_items __attribute__((unused) } return 1; } - else - { - return 0; - } + return 0; } diff --git a/src/algorithms/signal_source/adapters/file_signal_source.cc b/src/algorithms/signal_source/adapters/file_signal_source.cc index 5f674cc79..7dbea2d0e 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/file_signal_source.cc @@ -370,15 +370,9 @@ gr::basic_block_sptr FileSignalSource::get_right_block() { return valve_; } - else + if (enable_throttle_control_ == true) { - if (enable_throttle_control_ == true) - { - return throttle_; - } - else - { - return file_source_; - } + return throttle_; } + return file_source_; } diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc index ef46fd725..60566ed5e 100644 --- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc @@ -309,15 +309,9 @@ gr::basic_block_sptr NsrFileSignalSource::get_right_block() { return valve_; } - else + if (enable_throttle_control_ == true) { - if (enable_throttle_control_ == true) - { - return throttle_; - } - else - { - return unpack_byte_; - } + return throttle_; } + return unpack_byte_; } diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc index f01dec094..d5692e434 100644 --- a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc @@ -308,15 +308,9 @@ gr::basic_block_sptr SpirFileSignalSource::get_right_block() { return valve_; } - else + if (enable_throttle_control_ == true) { - if (enable_throttle_control_ == true) - { - return throttle_; - } - else - { - return unpack_intspir_; - } + return throttle_; } + return unpack_intspir_; } diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc index 8f113cd72..7115771e9 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc @@ -318,15 +318,9 @@ gr::basic_block_sptr TwoBitCpxFileSignalSource::get_right_block() { return valve_; } - else + if (enable_throttle_control_ == true) { - if (enable_throttle_control_ == true) - { - return throttle_; - } - else - { - return unpack_byte_; - } + return throttle_; } + return unpack_byte_; } diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.cc b/src/algorithms/signal_source/adapters/uhd_signal_source.cc index 8002c9c8d..80f165a60 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.cc +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.cc @@ -314,8 +314,5 @@ gr::basic_block_sptr UhdSignalSource::get_right_block(int RF_channel) { return valve_.at(RF_channel); } - else - { - return uhd_source_; - } + return uhd_source_; } diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc index 1d1990038..c633d97a5 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc @@ -300,7 +300,7 @@ int labsat23_source::general_work(int noutput_items, return -1; } - //check if the selected channel in config file match the file encoding + // check if the selected channel in config file match the file encoding if (d_channel_selector_config == 2 and d_channel_selector != 0) { std::cout << "Labsat source channel config inconsistency: channel 2 is selected but the file has only one channel" << std::endl; @@ -359,18 +359,15 @@ int labsat23_source::general_work(int noutput_items, std::cout << "Unknown channel B constellation ID " << static_cast(channel_b_constellation) << std::endl; } - //end of header + // end of header d_header_parsed = true; - //seek file to the first signal sample + // seek file to the first signal sample binary_input_file->clear(); binary_input_file->seekg(header_bytes, binary_input_file->beg); return 0; } - else - { - std::cout << "Labsat file header error: section 2 is not available." << std::endl; - return -1; - } + std::cout << "Labsat file header error: section 2 is not available." << std::endl; + return -1; } else { @@ -380,7 +377,7 @@ int labsat23_source::general_work(int noutput_items, } else { - //ready to start reading samples + // ready to start reading samples switch (d_bits_per_sample) { case 2: @@ -391,7 +388,7 @@ int labsat23_source::general_work(int noutput_items, // dual channel 2 bits per complex sample break; default: - //single channel 2 bits per complex sample (1 bit I + 1 bit Q, 8 samples per int16) + // single channel 2 bits per complex sample (1 bit I + 1 bit Q, 8 samples per int16) int n_int16_to_read = noutput_items / 8; if (n_int16_to_read > 0) { @@ -408,23 +405,21 @@ int labsat23_source::general_work(int noutput_items, } return output_pointer; } + + // trigger the read of the next file in the sequence + std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl; + + d_current_file_number++; + binary_input_file->close(); + binary_input_file->open(generate_filename().c_str(), std::ios::in | std::ios::binary); + if (binary_input_file->is_open()) + { + std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl; + } else { - //trigger the read of the next file in the sequence - std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl; - - d_current_file_number++; - binary_input_file->close(); - binary_input_file->open(generate_filename().c_str(), std::ios::in | std::ios::binary); - if (binary_input_file->is_open()) - { - std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl; - } - else - { - std::cout << "Last file reached, LabSat source stop" << std::endl; - return -1; - } + std::cout << "Last file reached, LabSat source stop" << std::endl; + return -1; } } else @@ -442,7 +437,7 @@ int labsat23_source::general_work(int noutput_items, // dual channel break; default: - //single channel 4 bits per complex sample (2 bit I + 2 bit Q, 4 samples per int16) + // single channel 4 bits per complex sample (2 bit I + 2 bit Q, 4 samples per int16) int n_int16_to_read = noutput_items / 4; if (n_int16_to_read > 0) { @@ -459,23 +454,21 @@ int labsat23_source::general_work(int noutput_items, } return output_pointer; } + + // trigger the read of the next file in the sequence + std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl; + + d_current_file_number++; + binary_input_file->close(); + binary_input_file->open(generate_filename().c_str(), std::ios::in | std::ios::binary); + if (binary_input_file->is_open()) + { + std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl; + } else { - //trigger the read of the next file in the sequence - std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl; - - d_current_file_number++; - binary_input_file->close(); - binary_input_file->open(generate_filename().c_str(), std::ios::in | std::ios::binary); - if (binary_input_file->is_open()) - { - std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl; - } - else - { - std::cout << "Last file reached, LabSat source stop" << std::endl; - return -1; - } + std::cout << "Last file reached, LabSat source stop" << std::endl; + return -1; } } else diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc index 7e3578130..4fc08e96e 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc @@ -66,8 +66,8 @@ bool systemBytesAreBigEndian() b.byte = static_cast(0x01); if (*(char *)&b.byte == 1) return false; - else - return true; + + return true; } diff --git a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc index 0f2419498..fab664d28 100644 --- a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc +++ b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc @@ -126,28 +126,26 @@ double rtl_tcp_dongle_info::clip_gain(int gain) const // no defined gains to clip to return gain; } - else - { - double last_stop = gains.front(); - BOOST_FOREACH (double g, gains) - { - g /= 10.0; - if (gain < g) + double last_stop = gains.front(); + BOOST_FOREACH (double g, gains) + { + g /= 10.0; + + if (gain < g) + { + if (std::abs(gain - g) < std::abs(gain - last_stop)) { - if (std::abs(gain - g) < std::abs(gain - last_stop)) - { - return g; - } - else - { - return last_stop; - } + return g; + } + else + { + return last_stop; } - last_stop = g; } - return last_stop; + last_stop = g; } + return last_stop; } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc index 0e0fd2214..25bb90297 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc @@ -780,8 +780,5 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__(( *out[0] = current_symbol; return 1; } - else - { - return 0; - } + return 0; } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc index e566abf83..97f7b1887 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc @@ -136,9 +136,11 @@ bool gps_l1_ca_telemetry_decoder_cc::gps_word_parityCheck(uint32_t gpsword) parity = t ^ _rotl(t, 6) ^ _rotl(t, 12) ^ _rotl(t, 18) ^ _rotl(t, 24); parity = parity & 0x3F; if (parity == (gpsword & 0x3F)) - return (true); - else - return (false); + { + return (true); + } + + return (false); } @@ -474,8 +476,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__ return 1; } - else - { - return 0; - } + + + return 0; } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc index de69376c5..b437a9bee 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc @@ -282,8 +282,5 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u out[0] = current_synchro_data; return 1; } - else - { - return 0; - } + return 0; } diff --git a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc index 92b022253..ef71c4537 100644 --- a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc +++ b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc @@ -559,12 +559,9 @@ int Viterbi_Decoder::Prev::get_anchestor_state_of_current_state(int current_stat { return state[current_state]; } - else - { - //std::cout<<"alarm "<<"num_states="< 0) d_carrier_lock_fail_counter--; - } - if (d_carrier_lock_fail_counter > trk_parameters.max_lock_fail) - { - std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; - LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; - this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock - d_carrier_lock_fail_counter = 0; - return false; - } - else - { - return true; - } + if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; } + if (d_carrier_lock_fail_counter > trk_parameters.max_lock_fail) + { + std::cout << "Loss of lock in channel " << d_channel << "!" << std::endl; + LOG(INFO) << "Loss of lock in channel " << d_channel << "!"; + this->message_port_pub(pmt::mp("events"), pmt::from_long(3)); // 3 -> loss of lock + d_carrier_lock_fail_counter = 0; + return false; + } + return true; } diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc index 3c2620306..a7b4d0780 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc @@ -64,7 +64,7 @@ galileo_e1_tcp_connector_tracking_cc_sptr galileo_e1_tcp_connector_make_tracking int64_t fs_in, uint32_t vector_length, bool dump, - const std::string& dump_filename, + const std::string &dump_filename, float pll_bw_hz, float dll_bw_hz, float early_late_space_chips, @@ -544,8 +544,6 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri { return 1; } - else - { - return 0; - } + + return 0; } diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc index 8ce7d3d09..8ad85d13e 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -905,8 +905,6 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attrib { return 1; } - else - { - return 0; - } + + return 0; } diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc index 2a541fabd..5caacfd8d 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -906,8 +906,6 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __attrib { return 1; } - else - { - return 0; - } + + return 0; } diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc index 7875a2bbc..8c9cb9e51 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc @@ -62,7 +62,7 @@ gps_l1_ca_tcp_connector_make_tracking_cc( int64_t fs_in, uint32_t vector_length, bool dump, - const std::string& dump_filename, + const std::string &dump_filename, float early_late_space_chips, size_t port_ch0) { @@ -583,8 +583,6 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib { return 1; } - else - { - return 0; - } + + return 0; } diff --git a/src/algorithms/tracking/libs/tracking_discriminators.cc b/src/algorithms/tracking/libs/tracking_discriminators.cc index 5d7283d65..c7ba2858f 100644 --- a/src/algorithms/tracking/libs/tracking_discriminators.cc +++ b/src/algorithms/tracking/libs/tracking_discriminators.cc @@ -81,10 +81,7 @@ double pll_cloop_two_quadrant_atan(gr_complex prompt_s1) { return atan(prompt_s1.imag() / prompt_s1.real()); } - else - { - return 0.0; - } + return 0.0; } @@ -105,10 +102,7 @@ double dll_nc_e_minus_l_normalized(gr_complex early_s1, gr_complex late_s1) { return 0.0; } - else - { - return 0.5 * (P_early - P_late) / (P_early + P_late); - } + return 0.5 * (P_early - P_late) / (P_early + P_late); } /* @@ -129,8 +123,5 @@ double dll_nc_vemlp_normalized(gr_complex very_early_s1, gr_complex early_s1, gr { return 0.0; } - else - { - return (P_early - P_late) / (P_early + P_late); - } + return (P_early - P_late) / (P_early + P_late); } diff --git a/src/core/libs/string_converter.cc b/src/core/libs/string_converter.cc index 7420aad64..a529ae5fd 100644 --- a/src/core/libs/string_converter.cc +++ b/src/core/libs/string_converter.cc @@ -46,7 +46,7 @@ bool StringConverter::convert(const std::string& value, bool default_value) { return true; } - else if (value == "false") + if (value == "false") { return false; } @@ -68,10 +68,8 @@ int64_t StringConverter::convert(const std::string& value, int64_t default_value { return default_value; } - else - { - return result; - } + + return result; } @@ -86,10 +84,8 @@ uint64_t StringConverter::convert(const std::string& value, uint64_t default_val { return default_value; } - else - { - return result; - } + + return result; } @@ -104,10 +100,8 @@ int32_t StringConverter::convert(const std::string& value, int32_t default_value { return default_value; } - else - { - return result; - } + + return result; } @@ -122,10 +116,8 @@ uint32_t StringConverter::convert(const std::string& value, uint32_t default_val { return default_value; } - else - { - return result; - } + + return result; } @@ -140,10 +132,8 @@ uint16_t StringConverter::convert(const std::string& value, uint16_t default_val { return default_value; } - else - { - return result; - } + + return result; } @@ -158,10 +148,8 @@ int16_t StringConverter::convert(const std::string& value, int16_t default_value { return default_value; } - else - { - return result; - } + + return result; } @@ -176,10 +164,8 @@ float StringConverter::convert(const std::string& value, float default_value) { return default_value; } - else - { - return result; - } + + return result; } @@ -194,8 +180,6 @@ double StringConverter::convert(const std::string& value, double default_value) { return default_value; } - else - { - return result; - } + + return result; } diff --git a/src/core/receiver/concurrent_map.h b/src/core/receiver/concurrent_map.h index 7df929b82..218030286 100644 --- a/src/core/receiver/concurrent_map.h +++ b/src/core/receiver/concurrent_map.h @@ -94,11 +94,8 @@ public: lock.unlock(); return true; } - else - { - lock.unlock(); - return false; - } + lock.unlock(); + return false; } }; diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index a99a499dc..5fc45e668 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -289,10 +289,8 @@ int ControlThread::run() { return 42; // signal the gnss-sdr-harness.sh to restart the receiver program } - else - { - return 0; // normal shutdown - } + + return 0; // normal shutdown } diff --git a/src/core/receiver/file_configuration.cc b/src/core/receiver/file_configuration.cc index 614d9268c..62992c074 100644 --- a/src/core/receiver/file_configuration.cc +++ b/src/core/receiver/file_configuration.cc @@ -69,10 +69,7 @@ std::string FileConfiguration::property(std::string property_name, std::string d { return overrided_->property(property_name, default_value); } - else - { - return ini_reader_->Get("GNSS-SDR", property_name, default_value); - } + return ini_reader_->Get("GNSS-SDR", property_name, default_value); } @@ -82,11 +79,8 @@ bool FileConfiguration::property(std::string property_name, bool default_value) { return overrided_->property(property_name, default_value); } - else - { - std::string empty; - return converter_->convert(property(property_name, empty), default_value); - } + std::string empty; + return converter_->convert(property(property_name, empty), default_value); } @@ -96,11 +90,8 @@ int64_t FileConfiguration::property(std::string property_name, int64_t default_v { return overrided_->property(property_name, default_value); } - else - { - std::string empty; - return converter_->convert(property(property_name, empty), default_value); - } + std::string empty; + return converter_->convert(property(property_name, empty), default_value); } @@ -110,11 +101,8 @@ uint64_t FileConfiguration::property(std::string property_name, uint64_t default { return overrided_->property(property_name, default_value); } - else - { - std::string empty; - return converter_->convert(property(property_name, empty), default_value); - } + std::string empty; + return converter_->convert(property(property_name, empty), default_value); } @@ -124,11 +112,8 @@ int FileConfiguration::property(std::string property_name, int default_value) { return overrided_->property(property_name, default_value); } - else - { - std::string empty; - return converter_->convert(property(property_name, empty), default_value); - } + std::string empty; + return converter_->convert(property(property_name, empty), default_value); } @@ -138,11 +123,8 @@ unsigned int FileConfiguration::property(std::string property_name, unsigned int { return overrided_->property(property_name, default_value); } - else - { - std::string empty; - return converter_->convert(property(property_name, empty), default_value); - } + std::string empty; + return converter_->convert(property(property_name, empty), default_value); } @@ -152,11 +134,8 @@ uint16_t FileConfiguration::property(std::string property_name, uint16_t default { return overrided_->property(property_name, default_value); } - else - { - std::string empty; - return converter_->convert(property(property_name, empty), default_value); - } + std::string empty; + return converter_->convert(property(property_name, empty), default_value); } @@ -166,11 +145,8 @@ int16_t FileConfiguration::property(std::string property_name, int16_t default_v { return overrided_->property(property_name, default_value); } - else - { - std::string empty; - return converter_->convert(property(property_name, empty), default_value); - } + std::string empty; + return converter_->convert(property(property_name, empty), default_value); } @@ -180,11 +156,8 @@ float FileConfiguration::property(std::string property_name, float default_value { return overrided_->property(property_name, default_value); } - else - { - std::string empty; - return converter_->convert(property(property_name, empty), default_value); - } + std::string empty; + return converter_->convert(property(property_name, empty), default_value); } @@ -194,11 +167,8 @@ double FileConfiguration::property(std::string property_name, double default_val { return overrided_->property(property_name, default_value); } - else - { - std::string empty; - return converter_->convert(property(property_name, empty), default_value); - } + std::string empty; + return converter_->convert(property(property_name, empty), default_value); } diff --git a/src/core/receiver/in_memory_configuration.cc b/src/core/receiver/in_memory_configuration.cc index 3a3d220b7..4801d2eb2 100644 --- a/src/core/receiver/in_memory_configuration.cc +++ b/src/core/receiver/in_memory_configuration.cc @@ -55,10 +55,7 @@ std::string InMemoryConfiguration::property(std::string property_name, std::stri { return iter->second; } - else - { - return default_value; - } + return default_value; } diff --git a/src/core/system_parameters/galileo_fnav_message.cc b/src/core/system_parameters/galileo_fnav_message.cc index 03d74680b..58888effe 100644 --- a/src/core/system_parameters/galileo_fnav_message.cc +++ b/src/core/system_parameters/galileo_fnav_message.cc @@ -224,10 +224,8 @@ bool Galileo_Fnav_Message::_CRC_test(std::bitset b { return true; } - else - { - return false; - } + + return false; } @@ -498,10 +496,7 @@ bool Galileo_Fnav_Message::have_new_ephemeris() // Check if we have a new ephem std::cout << "Batch number: " << IOD_ephemeris << std::endl; return true; } - else - { - return false; - } + return false; } else { diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index ded7a075a..8407cf3e6 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -253,10 +253,7 @@ bool Galileo_Navigation_Message::CRC_test(std::bitset b { return true; } - else - { - return false; - } + return false; } @@ -442,10 +439,9 @@ bool Galileo_Navigation_Message::have_new_ephemeris() // Check if we have a new std::cout << "Batch number: " << IOD_ephemeris << std::endl; return true; } - else - { - return false; - } + + + return false; } else return false; @@ -459,8 +455,8 @@ bool Galileo_Navigation_Message::have_new_iono_and_GST() // Check if we have a flag_iono_and_GST = false; // clear the flag return true; } - else - return false; + + return false; } @@ -471,8 +467,8 @@ bool Galileo_Navigation_Message::have_new_utc_model() // Check if we have a new flag_utc_model = false; // clear the flag return true; } - else - return false; + + return false; } @@ -488,8 +484,8 @@ bool Galileo_Navigation_Message::have_new_almanac() // Check if we have a new a flag_all_almanac = true; return true; } - else - return false; + + return false; } diff --git a/src/core/system_parameters/glonass_gnav_navigation_message.cc b/src/core/system_parameters/glonass_gnav_navigation_message.cc index 005e14597..b360a5c02 100644 --- a/src/core/system_parameters/glonass_gnav_navigation_message.cc +++ b/src/core/system_parameters/glonass_gnav_navigation_message.cc @@ -83,7 +83,7 @@ void Glonass_Gnav_Navigation_Message::reset() // Data update information d_previous_tb = 0.0; - for (double & i : d_previous_Na) + for (double& i : d_previous_Na) i = 0.0; std::map satelliteBlock; // Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus @@ -200,7 +200,7 @@ bool Glonass_Gnav_Navigation_Message::CRC_test(std::bitset