I enabled some extra warnings for hidden local variables and for hidden
virtual functions and caught some things and did some general code cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@108299 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/Args.cpp b/source/Interpreter/Args.cpp
index 78c1003..4d35816 100644
--- a/source/Interpreter/Args.cpp
+++ b/source/Interpreter/Args.cpp
@@ -454,7 +454,6 @@
Args::ParseOptions (Options &options)
{
StreamString sstr;
- int i;
Error error;
struct option *long_options = options.GetLongOptions();
if (long_options == NULL)
@@ -463,7 +462,7 @@
return error;
}
- for (i=0; long_options[i].name != NULL; ++i)
+ for (int i=0; long_options[i].name != NULL; ++i)
{
if (long_options[i].flag == NULL)
{
@@ -950,7 +949,6 @@
)
{
StreamString sstr;
- int i;
struct option *long_options = options.GetLongOptions();
option_element_vector.clear();
@@ -963,7 +961,7 @@
// to suppress error messages.
sstr << ":";
- for (i = 0; long_options[i].name != NULL; ++i)
+ for (int i = 0; long_options[i].name != NULL; ++i)
{
if (long_options[i].flag == NULL)
{
diff --git a/source/Interpreter/Options.cpp b/source/Interpreter/Options.cpp
index 28f2922..90eb66c 100644
--- a/source/Interpreter/Options.cpp
+++ b/source/Interpreter/Options.cpp
@@ -570,9 +570,9 @@
// within the option group they belong to.
char opt_str[3] = {'-', 'a', '\0'};
- for (int i = 0 ; opt_defs[i].short_option != 0 ; i++)
+ for (int j = 0 ; opt_defs[j].short_option != 0 ; j++)
{
- opt_str[1] = opt_defs[i].short_option;
+ opt_str[1] = opt_defs[j].short_option;
matches.AppendString (opt_str);
}
return true;
@@ -580,10 +580,10 @@
else if (opt_defs_index == OptionArgElement::eBareDoubleDash)
{
std::string full_name ("--");
- for (int i = 0 ; opt_defs[i].short_option != 0 ; i++)
+ for (int j = 0 ; opt_defs[j].short_option != 0 ; j++)
{
full_name.erase(full_name.begin() + 2, full_name.end());
- full_name.append (opt_defs[i].long_option);
+ full_name.append (opt_defs[j].long_option);
matches.AppendString (full_name.c_str());
}
return true;
@@ -619,18 +619,18 @@
if (cur_opt_str && strlen (cur_opt_str) > 2
&& cur_opt_str[0] == '-' && cur_opt_str[1] == '-')
{
- for (int i = 0 ; opt_defs[i].short_option != 0 ; i++)
+ for (int j = 0 ; opt_defs[j].short_option != 0 ; j++)
{
- if (strstr(opt_defs[i].long_option, cur_opt_str + 2) == opt_defs[i].long_option)
+ if (strstr(opt_defs[j].long_option, cur_opt_str + 2) == opt_defs[j].long_option)
{
std::string full_name ("--");
- full_name.append (opt_defs[i].long_option);
+ full_name.append (opt_defs[j].long_option);
// The options definitions table has duplicates because of the
// way the grouping information is stored, so only add once.
bool duplicate = false;
- for (int j = 0; j < matches.GetSize(); j++)
+ for (int k = 0; k < matches.GetSize(); k++)
{
- if (matches.GetStringAtIndex(j) == full_name)
+ if (matches.GetStringAtIndex(k) == full_name)
{
duplicate = true;
break;
diff --git a/source/Interpreter/ScriptInterpreter.cpp b/source/Interpreter/ScriptInterpreter.cpp
index e5d7bc3..9c5c086 100644
--- a/source/Interpreter/ScriptInterpreter.cpp
+++ b/source/Interpreter/ScriptInterpreter.cpp
@@ -54,6 +54,7 @@
void
ScriptInterpreter::CollectDataForBreakpointCommandCallback
(
+ CommandInterpreter &interpreter,
BreakpointOptions *bp_options,
CommandReturnObject &result
)