Core: address comparison of signed and unsigned types
authorSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 13 Jun 2014 03:30:42 +0000 (03:30 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 13 Jun 2014 03:30:42 +0000 (03:30 +0000)
Add a cast to ensure that the comparison is done with the same sign type.
Identified by GCC.

llvm-svn: 210880

lldb/source/Core/StructuredData.cpp

index 8bbc829..3c43e41 100644 (file)
@@ -286,9 +286,11 @@ StructuredData::ParseJSON (std::string json_text)
     {
         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 == '{')
             {