[Lldb-commits] [lldb] r241322 - Fix type signature for CMIUtilString::IsAllValidAlphaAndNumeric.

Bruce Mitchener bruce.mitchener at gmail.com
Fri Jul 3 00:28:12 PDT 2015


Author: brucem
Date: Fri Jul  3 02:28:11 2015
New Revision: 241322

URL: http://llvm.org/viewvc/llvm-project?rev=241322&view=rev
Log:
Fix type signature for CMIUtilString::IsAllValidAlphaAndNumeric.

This should take a "const char*" not a "char &".

Summary:
Fix type signature for CMIUtilString::IsAllValidAlphaAndNumeric.

This passes the MI tests on Mac OS X.

Reviewers: ki.stfu, abidh, domipheus

Subscribers: lldb-commits-list

Differential Revision: http://reviews.llvm.org/D10906

Modified:
    lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
    lldb/trunk/tools/lldb-mi/MIUtilString.cpp
    lldb/trunk/tools/lldb-mi/MIUtilString.h

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp?rev=241322&r1=241321&r2=241322&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp Fri Jul  3 02:28:11 2015
@@ -383,7 +383,7 @@ CMICmnLLDBDebugSessionInfo::MIResponseFo
     const MIchar *pThreadName = rThread.GetName();
     const MIuint len = (pThreadName != nullptr) ? CMIUtilString(pThreadName).length() : 0;
     const bool bHaveName = ((pThreadName != nullptr) && (len > 0) && (len < 32) &&
-                            CMIUtilString::IsAllValidAlphaAndNumeric(*pThreadName)); // 32 is arbitary number
+                            CMIUtilString::IsAllValidAlphaAndNumeric(pThreadName)); // 32 is arbitary number
     const MIchar *pThrdFmt = bHaveName ? "%s" : "Thread %d";
     CMIUtilString strThread;
     if (bHaveName)

Modified: lldb/trunk/tools/lldb-mi/MIUtilString.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MIUtilString.cpp?rev=241322&r1=241321&r2=241322&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MIUtilString.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MIUtilString.cpp Fri Jul  3 02:28:11 2015
@@ -475,21 +475,20 @@ CMIUtilString::ExtractNumberFromHexadeci
 // Details: Determine if the text is all valid alpha numeric characters. Letters can be
 //          either upper or lower case.
 // Type:    Static method.
-// Args:    vrText  - (R) The text data to examine.
+// Args:    vpText  - (R) The text data to examine.
 // Return:  bool - True = yes all alpha, false = one or more chars is non alpha.
 // Throws:  None.
 //--
 bool
-CMIUtilString::IsAllValidAlphaAndNumeric(const MIchar &vrText)
+CMIUtilString::IsAllValidAlphaAndNumeric(const MIchar *vpText)
 {
-    const MIuint len = ::strlen(&vrText);
+    const MIuint len = ::strlen(vpText);
     if (len == 0)
         return false;
 
-    MIchar *pPtr = const_cast<MIchar *>(&vrText);
-    for (MIuint i = 0; i < len; i++, pPtr++)
+    for (MIuint i = 0; i < len; i++, vpText++)
     {
-        const MIchar c = *pPtr;
+        const MIchar c = *vpText;
         if (::isalnum((int)c) == 0)
             return false;
     }

Modified: lldb/trunk/tools/lldb-mi/MIUtilString.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MIUtilString.h?rev=241322&r1=241321&r2=241322&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MIUtilString.h (original)
+++ lldb/trunk/tools/lldb-mi/MIUtilString.h Fri Jul  3 02:28:11 2015
@@ -35,7 +35,7 @@ class CMIUtilString : public std::string
     static CMIUtilString Format(const CMIUtilString vFormating, ...);
     static CMIUtilString FormatBinary(const MIuint64 vnDecimal);
     static CMIUtilString FormatValist(const CMIUtilString &vrFormating, va_list vArgs);
-    static bool IsAllValidAlphaAndNumeric(const MIchar &vrText);
+    static bool IsAllValidAlphaAndNumeric(const MIchar *vpText);
     static bool Compare(const CMIUtilString &vrLhs, const CMIUtilString &vrRhs);
     static CMIUtilString ConvertToPrintableASCII(const char vChar);
     static CMIUtilString ConvertToPrintableASCII(const char16_t vChar16);





More information about the lldb-commits mailing list