aboutsummaryrefslogtreecommitdiff
path: root/tools/lldb-mi/MICmdInterpreter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lldb-mi/MICmdInterpreter.cpp')
-rw-r--r--tools/lldb-mi/MICmdInterpreter.cpp42
1 files changed, 15 insertions, 27 deletions
diff --git a/tools/lldb-mi/MICmdInterpreter.cpp b/tools/lldb-mi/MICmdInterpreter.cpp
index 33db4b8196df..ce5d30e92316 100644
--- a/tools/lldb-mi/MICmdInterpreter.cpp
+++ b/tools/lldb-mi/MICmdInterpreter.cpp
@@ -7,18 +7,6 @@
//
//===----------------------------------------------------------------------===//
-//++
-// File: MICmdInterpreter.cpp
-//
-// Overview: CMICmdInterpreter implementation.
-//
-// Environment: Compilers: Visual C++ 12.
-// gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
-// Libraries: See MIReadmetxt.
-//
-// Copyright: None.
-//--
-
// In-house headers:
#include "MICmdInterpreter.h"
#include "MICmdFactory.h"
@@ -117,8 +105,8 @@ CMICmdInterpreter::ValidateIsMi(const CMIUtilString &vTextLine, bool &vwbYesVali
m_miCmdData.Clear();
m_miCmdData.strMiCmd = vTextLine;
- // The following change m_miCmdData as valid parts are indentified
- vwbYesValid = (MiHasCmdTokenEndingHypthen(vTextLine) || MiHasCmdTokenEndingAlpha(vTextLine));
+ // The following change m_miCmdData as valid parts are identified
+ vwbYesValid = (MiHasCmdTokenEndingHyphen(vTextLine) || MiHasCmdTokenEndingAlpha(vTextLine));
vwbYesValid = vwbYesValid && MiHasCmd(vTextLine);
if (vwbYesValid)
{
@@ -162,11 +150,11 @@ CMICmdInterpreter::HasCmdFactoryGotMiCmd(const SMICmdData &vCmd) const
// Throws: None.
//--
bool
-CMICmdInterpreter::MiHasCmdTokenEndingHypthen(const CMIUtilString &vTextLine)
+CMICmdInterpreter::MiHasCmdTokenEndingHyphen(const CMIUtilString &vTextLine)
{
- // The hythen is mandatory
- const MIint nPos = vTextLine.find("-", 0);
- if ((nPos == (MIint)std::string::npos))
+ // The hyphen is mandatory
+ const size_t nPos = vTextLine.find("-", 0);
+ if ((nPos == std::string::npos))
return false;
if (MiHasCmdTokenPresent(vTextLine))
@@ -198,7 +186,7 @@ CMICmdInterpreter::MiHasCmdTokenEndingHypthen(const CMIUtilString &vTextLine)
bool
CMICmdInterpreter::MiHasCmdTokenEndingAlpha(const CMIUtilString &vTextLine)
{
- MIchar cChar = vTextLine[0];
+ char cChar = vTextLine[0];
MIuint i = 0;
while (::isdigit(cChar) != 0)
{
@@ -218,7 +206,7 @@ CMICmdInterpreter::MiHasCmdTokenEndingAlpha(const CMIUtilString &vTextLine)
//++ ------------------------------------------------------------------------------------
// Details: Does the command entered match the criteria for a MI command format.
-// Is the command token present before the hypen?
+// Is the command token present before the hyphen?
// Type: Method.
// Args: vTextLine - (R) Text data to interpret.
// Return: bool - True = yes command token present, false = token not present.
@@ -227,13 +215,13 @@ CMICmdInterpreter::MiHasCmdTokenEndingAlpha(const CMIUtilString &vTextLine)
bool
CMICmdInterpreter::MiHasCmdTokenPresent(const CMIUtilString &vTextLine)
{
- const MIint nPos = vTextLine.find("-", 0);
+ const size_t nPos = vTextLine.find("-", 0);
return (nPos > 0);
}
//++ ------------------------------------------------------------------------------------
// Details: Does the command name entered match the criteria for a MI command format.
-// Is a recogised command present? The command name is entered into the
+// Is a recognised command present? The command name is entered into the
// command meta data structure whether correct or not for reporting or later
// command execution purposes. Command options is present are also put into the
// command meta data structure.
@@ -245,11 +233,11 @@ CMICmdInterpreter::MiHasCmdTokenPresent(const CMIUtilString &vTextLine)
bool
CMICmdInterpreter::MiHasCmd(const CMIUtilString &vTextLine)
{
- MIint nPos = 0;
+ size_t nPos = 0;
if (m_miCmdData.bMIOldStyle)
{
char cChar = vTextLine[0];
- MIuint i = 0;
+ size_t i = 0;
while (::isdigit(cChar) != 0)
{
cChar = vTextLine[++i];
@@ -262,9 +250,9 @@ CMICmdInterpreter::MiHasCmd(const CMIUtilString &vTextLine)
}
bool bFoundCmd = false;
- const MIint nLen = vTextLine.length();
- const MIint nPos2 = vTextLine.find(" ", nPos);
- if (nPos2 != (MIint)std::string::npos)
+ const size_t nLen = vTextLine.length();
+ const size_t nPos2 = vTextLine.find(" ", nPos);
+ if (nPos2 != std::string::npos)
{
if (nPos2 == nLen)
return false;