From 0e0b1973f05d53ee80e11558e738fa1ba8392ce1 Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari Date: Wed, 8 Apr 2015 01:01:11 +0530 Subject: [PATCH] removing redundant init_options --- src/lib_ccx/params.c | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/src/lib_ccx/params.c b/src/lib_ccx/params.c index d59d4eef..13f9ed62 100644 --- a/src/lib_ccx/params.c +++ b/src/lib_ccx/params.c @@ -787,27 +787,6 @@ int atoi_hex (char *s) return atoi (s); } } -void init_option (struct ccx_s_options *option) -{ - if(option->gui_mode_reports) - { - option->no_progress_bar=1; - // Do it as soon as possible, because it something fails we might not have a chance - activity_report_version(); - } - - if(option->sentence_cap) - { - if(add_built_in_words()) - fatal (EXIT_NOT_ENOUGH_MEMORY, "Not enough memory for word list"); - if(option->sentence_cap_file && process_cap_file (option->sentence_cap_file)) - fatal (EXIT_ERROR_IN_CAPITALIZATION_FILE, "There was an error processing the capitalization file.\n"); - - ccx_encoders_helpers_perform_shellsort_words(); - } - if(option->ts_forced_program != -1) - option->ts_forced_program_selected = 1; -} void parse_parameters (struct ccx_s_options *opt, int argc, char *argv[]) { @@ -1672,4 +1651,22 @@ void parse_parameters (struct ccx_s_options *opt, int argc, char *argv[]) fatal (EXIT_INCOMPATIBLE_PARAMETERS, "Error: Parameter %s not understood.\n", argv[i]); // Unrecognized switches are silently ignored } + if(opt->gui_mode_reports) + { + opt->no_progress_bar=1; + // Do it as soon as possible, because it something fails we might not have a chance + activity_report_version(); + } + + if(opt->sentence_cap) + { + if(add_built_in_words()) + fatal (EXIT_NOT_ENOUGH_MEMORY, "Not enough memory for word list"); + if(opt->sentence_cap_file && process_cap_file (opt->sentence_cap_file)) + fatal (EXIT_ERROR_IN_CAPITALIZATION_FILE, "There was an error processing the capitalization file.\n"); + + ccx_encoders_helpers_perform_shellsort_words(); + } + if(opt->ts_forced_program != -1) + opt->ts_forced_program_selected = 1; }