From 3bcdfc0ec19df671655eeedb10da2ff9399b8b65 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Tue, 4 Dec 2012 00:32:51 +0000 Subject: Cleaned up the option parsing code to always pass around the short options as integers. Previously we cast this down to "char" and lost some information. I recently added an assert that would detect duplicate short character options which was firing during the test suite. This fix does the following: - make sure all short options are treated as "int" - make sure that short options can be non-printable values when a short option is not required or when an option group is mixed into many commands and a short option is not desired - fix the help printing to "do the right thing" in all cases. Previously if there were duplicate short character options, it would just not emit help for the duplicates - fix option parsing when there are duplicates to parse options correctly. Previously the option parsing, when done for an OptionGroup, would just start parsing options incorrectly by omitting table entries and it would end up setting the wrong option value llvm-svn: 169189 --- lldb/source/Interpreter/OptionGroupWatchpoint.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lldb/source/Interpreter/OptionGroupWatchpoint.cpp') diff --git a/lldb/source/Interpreter/OptionGroupWatchpoint.cpp b/lldb/source/Interpreter/OptionGroupWatchpoint.cpp index aa5b0001c02..e352a0e705e 100644 --- a/lldb/source/Interpreter/OptionGroupWatchpoint.cpp +++ b/lldb/source/Interpreter/OptionGroupWatchpoint.cpp @@ -73,7 +73,7 @@ OptionGroupWatchpoint::SetOptionValue (CommandInterpreter &interpreter, const char *option_arg) { Error error; - char short_option = (char) g_option_table[option_idx].short_option; + const int short_option = g_option_table[option_idx].short_option; switch (short_option) { case 'w': -- cgit v1.2.3