[Lldb-commits] [lldb] r210880 - Core: address comparison of signed and unsigned types

Saleem Abdulrasool compnerd at compnerd.org
Thu Jun 12 20:30:42 PDT 2014


Author: compnerd
Date: Thu Jun 12 22:30:42 2014
New Revision: 210880

URL: http://llvm.org/viewvc/llvm-project?rev=210880&view=rev
Log:
Core: address comparison of signed and unsigned types

Add a cast to ensure that the comparison is done with the same sign type.
Identified by GCC.

Modified:
    lldb/trunk/source/Core/StructuredData.cpp

Modified: lldb/trunk/source/Core/StructuredData.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/StructuredData.cpp?rev=210880&r1=210879&r2=210880&view=diff
==============================================================================
--- lldb/trunk/source/Core/StructuredData.cpp (original)
+++ lldb/trunk/source/Core/StructuredData.cpp Thu Jun 12 22:30:42 2014
@@ -286,9 +286,11 @@ StructuredData::ParseJSON (std::string j
     {
         const char *start_of_json_text = json_text.c_str();
         const char *c = json_text.c_str();
-        while (*c != '\0' && c - start_of_json_text <= json_text_size)
+        while (*c != '\0' &&
+               static_cast<size_t>(c - start_of_json_text) <= json_text_size)
         {
-            while (isspace (*c) && c - start_of_json_text < json_text_size)
+            while (isspace (*c) &&
+                   static_cast<size_t>(c - start_of_json_text) < json_text_size)
                 c++;
             if (*c == '{')
             {





More information about the lldb-commits mailing list