create constants for multichar constants

Multichar constants are not portable as the byte order is undefined.  Use a
constant value instead.  This avoids a warning when compiling with gcc 4.8+
(-Wmultichar) and makes the code more portable.

llvm-svn: 204110
This commit is contained in:
Saleem Abdulrasool 2014-03-18 04:43:47 +00:00
parent cb97c48243
commit 44edda0af7
2 changed files with 15 additions and 4 deletions

View File

@ -678,6 +678,9 @@ protected:
class CommandObjectTargetVariable : public CommandObjectParsed
{
static const uint32_t SHORT_OPTION_FILE = 0x66696c65; // 'file'
static const uint32_t SHORT_OPTION_SHLB = 0x73686c62; // 'shlb'
public:
CommandObjectTargetVariable (CommandInterpreter &interpreter) :
CommandObjectParsed (interpreter,
@ -688,8 +691,12 @@ public:
m_option_group (interpreter),
m_option_variable (false), // Don't include frame options
m_option_format (eFormatDefault),
m_option_compile_units (LLDB_OPT_SET_1, false, "file", 'file', 0, eArgTypeFilename, "A basename or fullpath to a file that contains global variables. This option can be specified multiple times."),
m_option_shared_libraries (LLDB_OPT_SET_1, false, "shlib",'shlb', 0, eArgTypeFilename, "A basename or fullpath to a shared library to use in the search for global variables. This option can be specified multiple times."),
m_option_compile_units (LLDB_OPT_SET_1, false, "file",
SHORT_OPTION_FILE, 0, eArgTypeFilename,
"A basename or fullpath to a file that contains global variables. This option can be specified multiple times."),
m_option_shared_libraries (LLDB_OPT_SET_1, false, "shlib",
SHORT_OPTION_SHLB, 0, eArgTypeFilename,
"A basename or fullpath to a shared library to use in the search for global variables. This option can be specified multiple times."),
m_varobj_options()
{
CommandArgumentEntry arg;

View File

@ -28,11 +28,15 @@ OptionGroupOutputFile::~OptionGroupOutputFile ()
{
}
static const uint32_t SHORT_OPTION_APND = 0x61706e64; // 'apnd'
static OptionDefinition
g_option_table[] =
{
{ LLDB_OPT_SET_1 , false, "outfile", 'o', OptionParser::eRequiredArgument, NULL, 0, eArgTypeFilename , "Specify a path for capturing command output."},
{ LLDB_OPT_SET_1 , false, "append-outfile" , 'apnd', OptionParser::eNoArgument, NULL, 0, eArgTypeNone , "Append to the the file specified with '--outfile <path>'."},
{ LLDB_OPT_SET_1 , false, "append-outfile" , SHORT_OPTION_APND,
OptionParser::eNoArgument, NULL, 0, eArgTypeNone ,
"Append to the the file specified with '--outfile <path>'."},
};
uint32_t
@ -61,7 +65,7 @@ OptionGroupOutputFile::SetOptionValue (CommandInterpreter &interpreter,
error = m_file.SetValueFromCString (option_arg);
break;
case 'apnd':
case SHORT_OPTION_APND:
m_append.SetCurrentValue(true);
break;