Switch NULL to C++11 nullptr in source/Interpreter
Patch by Robert Matusewicz
llvm-svn: 206711
diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp
index ce98757..3d65116 100644
--- a/lldb/source/Interpreter/Options.cpp
+++ b/lldb/source/Interpreter/Options.cpp
@@ -242,14 +242,14 @@
Options::NumCommandOptions ()
{
const OptionDefinition *opt_defs = GetDefinitions ();
- if (opt_defs == NULL)
+ if (opt_defs == nullptr)
return 0;
int i = 0;
- if (opt_defs != NULL)
+ if (opt_defs != nullptr)
{
- while (opt_defs[i].long_option != NULL)
+ while (opt_defs[i].long_option != nullptr)
++i;
}
@@ -265,7 +265,7 @@
// Check to see if there are any options.
const uint32_t num_options = NumCommandOptions();
if (num_options == 0)
- return NULL;
+ return nullptr;
uint32_t i;
const OptionDefinition *opt_defs = GetDefinitions();
@@ -279,7 +279,7 @@
m_getopt_table[i].name = opt_defs[i].long_option;
m_getopt_table[i].has_arg = opt_defs[i].option_has_arg;
- m_getopt_table[i].flag = NULL;
+ m_getopt_table[i].flag = nullptr;
m_getopt_table[i].val = short_opt;
if (option_seen.find(short_opt) == option_seen.end())
@@ -312,14 +312,14 @@
//getopt_long_only requires a NULL final entry in the table:
- m_getopt_table[i].name = NULL;
+ m_getopt_table[i].name = nullptr;
m_getopt_table[i].has_arg = 0;
- m_getopt_table[i].flag = NULL;
+ m_getopt_table[i].flag = nullptr;
m_getopt_table[i].val = 0;
}
if (m_getopt_table.empty())
- return NULL;
+ return nullptr;
return &m_getopt_table.front();
}
@@ -592,7 +592,7 @@
if (opt_defs[i].usage_mask & opt_set_mask && isprint8(opt_defs[i].short_option))
{
if (opt_defs[i].required && opt_defs[i].option_has_arg != OptionParser::eNoArgument)
- PrintOption (opt_defs[i], eDisplayBestOption, " ", NULL, true, strm);
+ PrintOption (opt_defs[i], eDisplayBestOption, " ", nullptr, true, strm);
}
}
@@ -605,7 +605,7 @@
// Add current option to the end of out_stream.
if (!opt_defs[i].required && opt_defs[i].option_has_arg != OptionParser::eNoArgument)
- PrintOption (opt_defs[i], eDisplayBestOption, " ", NULL, true, strm);
+ PrintOption (opt_defs[i], eDisplayBestOption, " ", nullptr, true, strm);
}
}
@@ -669,13 +669,13 @@
strm.Indent ();
if (opt_defs[i].short_option && isprint8(opt_defs[i].short_option))
{
- PrintOption (opt_defs[i], eDisplayShortOption, NULL, NULL, false, strm);
+ PrintOption (opt_defs[i], eDisplayShortOption, nullptr, nullptr, false, strm);
PrintOption (opt_defs[i], eDisplayLongOption, " ( ", " )", false, strm);
}
else
{
// Short option is not printable, just print long option
- PrintOption (opt_defs[i], eDisplayLongOption, NULL, NULL, false, strm);
+ PrintOption (opt_defs[i], eDisplayLongOption, nullptr, nullptr, false, strm);
}
strm.EOL();
@@ -685,11 +685,11 @@
OutputFormattedUsageText (strm,
opt_defs[i].usage_text,
screen_width);
- if (opt_defs[i].enum_values != NULL)
+ if (opt_defs[i].enum_values != nullptr)
{
strm.Indent ();
strm.Printf("Values: ");
- for (int k = 0; opt_defs[i].enum_values[k].string_value != NULL; k++)
+ for (int k = 0; opt_defs[i].enum_values[k].string_value != nullptr; k++)
{
if (k == 0)
strm.Printf("%s", opt_defs[i].enum_values[k].string_value);
@@ -908,11 +908,11 @@
// See if this is an enumeration type option, and if so complete it here:
OptionEnumValueElement *enum_values = opt_defs[opt_defs_index].enum_values;
- if (enum_values != NULL)
+ if (enum_values != nullptr)
{
bool return_value = false;
std::string match_string(input.GetArgumentAtIndex (opt_arg_pos), input.GetArgumentAtIndex (opt_arg_pos) + char_pos);
- for (int i = 0; enum_values[i].string_value != NULL; i++)
+ for (int i = 0; enum_values[i].string_value != nullptr; i++)
{
if (strstr(enum_values[i].string_value, match_string.c_str()) == enum_values[i].string_value)
{
@@ -1001,7 +1001,7 @@
if (opt_def.short_option == short_opt)
return m_option_infos[i].option_group;
}
- return NULL;
+ return nullptr;
}
void
@@ -1026,7 +1026,7 @@
OptionGroupOptions::Finalize ()
{
m_did_finalize = true;
- OptionDefinition empty_option_def = { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL };
+ OptionDefinition empty_option_def = { 0, false, nullptr, 0, 0, nullptr, 0, eArgTypeNone, nullptr };
m_option_defs.push_back (empty_option_def);
}