From 02d69e54eb28cfd2b021fb2796d6beb8acee9d8b Mon Sep 17 00:00:00 2001 From: GullCode Date: Wed, 27 Jan 2021 17:03:20 +0100 Subject: [PATCH] Fixed uninitialized / missing switch cases, unused --- firmware/application/apps/ui_scanner.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/firmware/application/apps/ui_scanner.cpp b/firmware/application/apps/ui_scanner.cpp index 17f5cc0a..6874280a 100644 --- a/firmware/application/apps/ui_scanner.cpp +++ b/firmware/application/apps/ui_scanner.cpp @@ -172,7 +172,7 @@ void ScannerView::show_max() { //show total number of freqs to scan ScannerView::ScannerView( NavigationView& nav - ) : nav_ { nav } + ) : nav_ { nav } , loaded_file_name { "SCANNER" } { add_children({ &labels, @@ -364,7 +364,7 @@ ScannerView::ScannerView( big_display.set(frequency_list[current_index]); //After showing an error } else { - auto result = scanner_file.append(freq_file_path); //Second: append if it is not there + scanner_file.append(freq_file_path); //Second: append if it is not there scanner_file.write_line(frequency_to_add + ",d=ADD FQ"); } } else @@ -409,7 +409,12 @@ void ScannerView::frequency_file_load(std::string file_name, bool stop_all_befor case FM_2: def_step = 50000; break ; case N_1: def_step = 25000; break ; case N_2: def_step = 250000; break ; - case AIRBAND:def_step= 8330; break ; + case AIRBAND: def_step= 8330; break ; + case ERROR_STEP: + case STEP_DEF: + default: + def_step = step_mode.selected_index_value(); //Use def_step from manual selector + break ; } frequency_list.push_back(entry.frequency_a); //Store starting freq and description description_list.push_back("R" + to_string_short_freq(entry.frequency_a) @@ -435,7 +440,7 @@ void ScannerView::frequency_file_load(std::string file_name, bool stop_all_befor } else { - loaded_file_name = 'SCANNER'; // back to the default frequency file + loaded_file_name = "SCANNER"; // back to the default frequency file desc_cycle.set(" NO " + file_name + ".TXT FILE ..." ); } audio::output::stop(); @@ -504,7 +509,9 @@ size_t ScannerView::change_mode(uint8_t new_mod) { //Before this, do a scan_thre using option_t = std::pair; using options_t = std::vector; options_t bw; - field_bw.on_change = [this](size_t n, OptionsField::value_t) { }; + field_bw.on_change = [this](size_t n, OptionsField::value_t) { + (void)n; //avoid unused warning + }; switch (new_mod) { case NFM: //bw 16k (2) default @@ -556,4 +563,4 @@ void ScannerView::start_scan_thread() { scan_thread = std::make_unique(frequency_list); } -} /* namespace ui */ \ No newline at end of file +} /* namespace ui */