[Lldb-commits] [lldb] r205390 - sanitise sign comparisons

Saleem Abdulrasool compnerd at compnerd.org
Tue Apr 1 20:51:36 PDT 2014


Author: compnerd
Date: Tue Apr  1 22:51:35 2014
New Revision: 205390

URL: http://llvm.org/viewvc/llvm-project?rev=205390&view=rev
Log:
sanitise sign comparisons

This is a mechanical change addressing the various sign comparison warnings that
are identified by both clang and gcc.  This helps cleanup some of the warning
spew that occurs during builds.

Modified:
    lldb/trunk/source/API/SBCommandInterpreter.cpp
    lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
    lldb/trunk/source/Commands/CommandObjectFrame.cpp
    lldb/trunk/source/Commands/CommandObjectQuit.cpp
    lldb/trunk/source/Commands/CommandObjectSettings.cpp
    lldb/trunk/source/Commands/CommandObjectType.cpp
    lldb/trunk/source/Core/ConnectionMachPort.cpp
    lldb/trunk/source/Core/DataBufferMemoryMap.cpp
    lldb/trunk/source/Core/IOHandler.cpp
    lldb/trunk/source/Core/Opcode.cpp
    lldb/trunk/source/DataFormatters/CF.cpp
    lldb/trunk/source/Expression/IRInterpreter.cpp
    lldb/trunk/source/Host/common/Host.cpp
    lldb/trunk/source/Host/common/Terminal.cpp
    lldb/trunk/source/Host/linux/Host.cpp
    lldb/trunk/source/Host/macosx/Host.mm
    lldb/trunk/source/Interpreter/Args.cpp
    lldb/trunk/source/Interpreter/CommandInterpreter.cpp
    lldb/trunk/source/Interpreter/CommandObject.cpp
    lldb/trunk/source/Interpreter/OptionValueArray.cpp
    lldb/trunk/source/Interpreter/Options.cpp
    lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
    lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
    lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp
    lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
    lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
    lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
    lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
    lldb/trunk/source/Symbol/ClangASTType.cpp
    lldb/trunk/source/Symbol/ObjectFile.cpp
    lldb/trunk/source/Symbol/UnwindPlan.cpp
    lldb/trunk/source/Target/PathMappingList.cpp
    lldb/trunk/source/Target/StackFrame.cpp
    lldb/trunk/source/Target/Thread.cpp
    lldb/trunk/source/lldb.cpp

Modified: lldb/trunk/source/API/SBCommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommandInterpreter.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/API/SBCommandInterpreter.cpp (original)
+++ lldb/trunk/source/API/SBCommandInterpreter.cpp Tue Apr  1 22:51:35 2014
@@ -176,7 +176,8 @@ SBCommandInterpreter::HandleCompletion (
         return 0;
         
     size_t current_line_size = strlen (current_line);
-    if (cursor - current_line > current_line_size || last_char - current_line > current_line_size)
+    if (cursor - current_line > static_cast<ptrdiff_t>(current_line_size) ||
+        last_char - current_line > static_cast<ptrdiff_t>(current_line_size))
         return 0;
         
     if (log)

Modified: lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp Tue Apr  1 22:51:35 2014
@@ -1843,7 +1843,7 @@ CommandObjectMultiwordBreakpoint::Verify
             if (breakpoint != NULL)
             {
                 const size_t num_locations = breakpoint->GetNumLocations();
-                if (cur_bp_id.GetLocationID() > num_locations)
+                if (static_cast<size_t>(cur_bp_id.GetLocationID()) > num_locations)
                 {
                     StreamString id_str;
                     BreakpointID::GetCanonicalReference (&id_str, 

Modified: lldb/trunk/source/Commands/CommandObjectFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFrame.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectFrame.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectFrame.cpp Tue Apr  1 22:51:35 2014
@@ -204,7 +204,7 @@ protected:
             
             if (m_options.relative_frame_offset < 0)
             {
-                if (frame_idx >= -m_options.relative_frame_offset)
+                if (static_cast<int32_t>(frame_idx) >= -m_options.relative_frame_offset)
                     frame_idx += m_options.relative_frame_offset;
                 else
                 {
@@ -224,7 +224,7 @@ protected:
                 // I don't want "up 20" where "20" takes you past the top of the stack to produce
                 // an error, but rather to just go to the top.  So I have to count the stack here...
                 const uint32_t num_frames = thread->GetStackFrameCount();
-                if (num_frames - frame_idx > m_options.relative_frame_offset)
+                if (static_cast<int32_t>(num_frames - frame_idx) > m_options.relative_frame_offset)
                     frame_idx += m_options.relative_frame_offset;
                 else
                 {

Modified: lldb/trunk/source/Commands/CommandObjectQuit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectQuit.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectQuit.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectQuit.cpp Tue Apr  1 22:51:35 2014
@@ -53,7 +53,7 @@ CommandObjectQuit::ShouldAskForConfirmat
             continue;
         const TargetList& target_list(debugger_sp->GetTargetList());
         for (uint32_t target_idx = 0;
-             target_idx < target_list.GetNumTargets();
+             target_idx < static_cast<uint32_t>(target_list.GetNumTargets());
              target_idx++)
         {
             TargetSP target_sp(target_list.GetTargetAtIndex(target_idx));

Modified: lldb/trunk/source/Commands/CommandObjectSettings.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSettings.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectSettings.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectSettings.cpp Tue Apr  1 22:51:35 2014
@@ -164,7 +164,8 @@ insert-before or insert-after.\n");
         const size_t argc = input.GetArgumentCount();
         const char *arg = NULL;
         int setting_var_idx;
-        for (setting_var_idx = 1; setting_var_idx < argc; ++setting_var_idx)
+        for (setting_var_idx = 1; setting_var_idx < static_cast<int>(argc);
+             ++setting_var_idx)
         {
             arg = input.GetArgumentAtIndex(setting_var_idx);
             if (arg && arg[0] != '-')

Modified: lldb/trunk/source/Commands/CommandObjectType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectType.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectType.cpp Tue Apr  1 22:51:35 2014
@@ -100,7 +100,7 @@ public:
 static bool
 WarnOnPotentialUnquotedUnsignedType (Args& command, CommandReturnObject &result)
 {
-    for (int idx = 0; idx < command.GetArgumentCount(); idx++)
+    for (unsigned idx = 0; idx < command.GetArgumentCount(); idx++)
     {
         const char* arg = command.GetArgumentAtIndex(idx);
         if (idx+1 < command.GetArgumentCount())

Modified: lldb/trunk/source/Core/ConnectionMachPort.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ConnectionMachPort.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Core/ConnectionMachPort.cpp (original)
+++ lldb/trunk/source/Core/ConnectionMachPort.cpp Tue Apr  1 22:51:35 2014
@@ -127,7 +127,7 @@ ConnectionMachPort::BootstrapCheckIn (co
     {
         name_t port_name;
         int len = snprintf(port_name, sizeof(port_name), "%s", port);
-        if (len < sizeof(port_name))
+        if (static_cast<size_t>(len) < sizeof(port_name))
         {
             kret = ::bootstrap_check_in (bootstrap_port, 
                                          port_name, 
@@ -160,7 +160,7 @@ ConnectionMachPort::BootstrapLookup (con
 
     if (port && port[0])
     {
-        if (::snprintf (port_name, sizeof (port_name), "%s", port) >= sizeof (port_name))
+        if (static_cast<size_t>(::snprintf (port_name, sizeof (port_name), "%s", port)) >= sizeof (port_name))
         {
             if (error_ptr)
                 error_ptr->SetErrorString ("port netname is too long");

Modified: lldb/trunk/source/Core/DataBufferMemoryMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataBufferMemoryMap.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Core/DataBufferMemoryMap.cpp (original)
+++ lldb/trunk/source/Core/DataBufferMemoryMap.cpp Tue Apr  1 22:51:35 2014
@@ -240,7 +240,8 @@ DataBufferMemoryMap::MemoryMapFromFileDe
         struct stat stat;
         if (::fstat(fd, &stat) == 0)
         {
-            if (S_ISREG(stat.st_mode) && (stat.st_size > offset))
+            if (S_ISREG(stat.st_mode) &&
+                (stat.st_size > static_cast<off_t>(offset)))
             {
                 const size_t max_bytes_available = stat.st_size - offset;
                 if (length == SIZE_MAX)

Modified: lldb/trunk/source/Core/IOHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/IOHandler.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Core/IOHandler.cpp (original)
+++ lldb/trunk/source/Core/IOHandler.cpp Tue Apr  1 22:51:35 2014
@@ -1332,7 +1332,7 @@ type summary add -s "${var.origin%S} ${v
                     const size_t max_length = help_delegate_ap->GetMaxLineLength();
                     Rect bounds = GetBounds();
                     bounds.Inset(1, 1);
-                    if (max_length + 4 < bounds.size.width)
+                    if (max_length + 4 < static_cast<size_t>(bounds.size.width))
                     {
                         bounds.origin.x += (bounds.size.width - max_length + 4)/2;
                         bounds.size.width = max_length + 4;
@@ -1347,7 +1347,7 @@ type summary add -s "${var.origin%S} ${v
                         }
                     }
                     
-                    if (num_lines + 2 < bounds.size.height)
+                    if (num_lines + 2 < static_cast<size_t>(bounds.size.height))
                     {
                         bounds.origin.y += (bounds.size.height - num_lines + 2)/2;
                         bounds.size.height = num_lines + 2;
@@ -1845,9 +1845,9 @@ type summary add -s "${var.origin%S} ${v
         for (size_t i=0; i<num_submenus; ++i)
         {
             Menu *submenu = submenus[i].get();
-            if (m_max_submenu_name_length < submenu->m_name.size())
+            if (static_cast<size_t>(m_max_submenu_name_length) < submenu->m_name.size())
                 m_max_submenu_name_length = submenu->m_name.size();
-            if (m_max_submenu_key_name_length < submenu->m_key_name.size())
+            if (static_cast<size_t>(m_max_submenu_key_name_length) < submenu->m_key_name.size())
                 m_max_submenu_key_name_length = submenu->m_key_name.size();
         }
     }
@@ -1856,9 +1856,9 @@ type summary add -s "${var.origin%S} ${v
     Menu::AddSubmenu (const MenuSP &menu_sp)
     {
         menu_sp->m_parent = this;
-        if (m_max_submenu_name_length < menu_sp->m_name.size())
+        if (static_cast<size_t>(m_max_submenu_name_length) < menu_sp->m_name.size())
             m_max_submenu_name_length = menu_sp->m_name.size();
-        if (m_max_submenu_key_name_length < menu_sp->m_key_name.size())
+        if (static_cast<size_t>(m_max_submenu_key_name_length) < menu_sp->m_key_name.size())
             m_max_submenu_key_name_length = menu_sp->m_key_name.size();
         m_submenus.push_back(menu_sp);
     }
@@ -1874,7 +1874,7 @@ type summary add -s "${var.origin%S} ${v
             if (width > 2)
             {
                 width -= 2;
-                for (size_t i=0; i< width; ++i)
+                for (int i=0; i< width; ++i)
                     window.PutChar(ACS_HLINE);
             }
             window.PutChar(ACS_RTEE);
@@ -1975,7 +1975,8 @@ type summary add -s "${var.origin%S} ${v
                 window.Box();
                 for (size_t i=0; i<num_submenus; ++i)
                 {
-                    const bool is_selected = i == selected_idx;
+                    const bool is_selected =
+                      (i == static_cast<size_t>(selected_idx));
                     window.MoveCursor(x, y + i);
                     if (is_selected)
                     {
@@ -2014,7 +2015,7 @@ type summary add -s "${var.origin%S} ${v
                 case KEY_DOWN:
                 case KEY_UP:
                     // Show last menu or first menu
-                    if (selected_idx < num_submenus)
+                    if (selected_idx < static_cast<int>(num_submenus))
                         run_menu_sp = submenus[selected_idx];
                     else if (!submenus.empty())
                         run_menu_sp = submenus.front();
@@ -2024,9 +2025,9 @@ type summary add -s "${var.origin%S} ${v
                 case KEY_RIGHT:
                 {
                     ++m_selected;
-                    if (m_selected >= num_submenus)
+                    if (m_selected >= static_cast<int>(num_submenus))
                         m_selected = 0;
-                    if (m_selected < num_submenus)
+                    if (m_selected < static_cast<int>(num_submenus))
                         run_menu_sp = submenus[m_selected];
                     else if (!submenus.empty())
                         run_menu_sp = submenus.front();
@@ -2039,7 +2040,7 @@ type summary add -s "${var.origin%S} ${v
                     --m_selected;
                     if (m_selected < 0)
                         m_selected = num_submenus - 1;
-                    if (m_selected < num_submenus)
+                    if (m_selected < static_cast<int>(num_submenus))
                         run_menu_sp = submenus[m_selected];
                     else if (!submenus.empty())
                         run_menu_sp = submenus.front();
@@ -2093,7 +2094,7 @@ type summary add -s "${var.origin%S} ${v
                         const int start_select = m_selected;
                         while (++m_selected != start_select)
                         {
-                            if (m_selected >= num_submenus)
+                            if (static_cast<size_t>(m_selected) >= num_submenus)
                                 m_selected = 0;
                             if (m_submenus[m_selected]->GetType() == Type::Separator)
                                 continue;
@@ -2110,7 +2111,7 @@ type summary add -s "${var.origin%S} ${v
                         const int start_select = m_selected;
                         while (--m_selected != start_select)
                         {
-                            if (m_selected < 0)
+                            if (m_selected < static_cast<int>(0))
                                 m_selected = num_submenus - 1;
                             if (m_submenus[m_selected]->GetType() == Type::Separator)
                                 continue;
@@ -2122,7 +2123,7 @@ type summary add -s "${var.origin%S} ${v
                     break;
                     
                 case KEY_RETURN:
-                    if (selected_idx < num_submenus)
+                    if (static_cast<size_t>(selected_idx) < num_submenus)
                     {
                         if (submenus[selected_idx]->Action() == MenuActionResult::Quit)
                             return eQuitApplication;
@@ -2679,7 +2680,8 @@ public:
                 window.PutChar (ACS_DIAMOND);
                 window.PutChar (ACS_HLINE);
             }
-            bool highlight = (selected_row_idx == m_row_idx) && window.IsActive();
+            bool highlight =
+              (selected_row_idx == static_cast<size_t>(m_row_idx)) && window.IsActive();
 
             if (highlight)
                 window.AttributeOn(A_REVERSE);
@@ -2746,11 +2748,11 @@ public:
     TreeItem *
     GetItemForRowIndex (uint32_t row_idx)
     {
-        if (m_row_idx == row_idx)
+        if (static_cast<uint32_t>(m_row_idx) == row_idx)
             return this;
         if (m_children.empty())
             return NULL;
-        if (m_children.back().m_row_idx < row_idx)
+        if (static_cast<uint32_t>(m_children.back().m_row_idx) < row_idx)
             return NULL;
         if (IsExpanded())
         {
@@ -3459,7 +3461,7 @@ public:
                 // Page up key
                 if (m_first_visible_row > 0)
                 {
-                    if (m_first_visible_row > m_max_y)
+                    if (static_cast<int>(m_first_visible_row) > m_max_y)
                         m_first_visible_row -= m_max_y;
                     else
                         m_first_visible_row = 0;
@@ -3470,7 +3472,7 @@ public:
             case '.':
             case KEY_NPAGE:
                 // Page down key
-                if (m_num_rows > m_max_y)
+                if (m_num_rows > static_cast<size_t>(m_max_y))
                 {
                     if (m_first_visible_row + m_max_y < m_num_rows)
                     {
@@ -3637,7 +3639,7 @@ protected:
             // Save the row index in each Row structure
             row.row_idx = m_num_rows;
             if ((m_num_rows >= m_first_visible_row) &&
-                ((m_num_rows - m_first_visible_row) < NumVisibleRows()))
+                ((m_num_rows - m_first_visible_row) < static_cast<size_t>(NumVisibleRows())))
             {
                 row.x = m_min_x;
                 row.y = m_num_rows - m_first_visible_row + 1;
@@ -4009,7 +4011,7 @@ HelpDialogDelegate::WindowDelegateDraw (
     int y = 1;
     const int min_y = y;
     const int max_y = window_height - 1 - y;
-    const int num_visible_lines = max_y - min_y + 1;
+    const size_t num_visible_lines = max_y - min_y + 1;
     const size_t num_lines = m_text.GetSize();
     const char *bottom_message;
     if (num_lines <= num_visible_lines)
@@ -4057,7 +4059,7 @@ HelpDialogDelegate::WindowDelegateHandle
             case ',':
                 if (m_first_visible_line > 0)
                 {
-                    if (m_first_visible_line >= num_visible_lines)
+                    if (static_cast<size_t>(m_first_visible_line) >= num_visible_lines)
                         m_first_visible_line -= num_visible_lines;
                     else
                         m_first_visible_line = 0;
@@ -4068,7 +4070,7 @@ HelpDialogDelegate::WindowDelegateHandle
                 if (m_first_visible_line + num_visible_lines < num_lines)
                 {
                     m_first_visible_line += num_visible_lines;
-                    if (m_first_visible_line > num_lines)
+                    if (static_cast<size_t>(m_first_visible_line) > num_lines)
                         m_first_visible_line = num_lines - num_visible_lines;
                 }
                 break;
@@ -4681,7 +4683,7 @@ public:
                     {
                         // Same file, nothing to do, we should either have the
                         // lines or not (source file missing)
-                        if (m_selected_line >= m_first_visible_line)
+                        if (m_selected_line >= static_cast<size_t>(m_first_visible_line))
                         {
                             if (m_selected_line >= m_first_visible_line + num_visible_lines)
                                 m_first_visible_line = m_selected_line - 10;
@@ -4825,7 +4827,7 @@ public:
             const attr_t selected_highlight_attr = A_REVERSE;
             const attr_t pc_highlight_attr = COLOR_PAIR(1);
 
-            for (int i=0; i<num_visible_lines; ++i)
+            for (size_t i=0; i<num_visible_lines; ++i)
             {
                 const uint32_t curr_line = m_first_visible_line + i;
                 if (curr_line < num_source_lines)
@@ -4947,12 +4949,12 @@ public:
                 }
 
                 const uint32_t non_visible_pc_offset = (num_visible_lines / 5);
-                if (m_first_visible_line >= num_disassembly_lines)
+                if (static_cast<size_t>(m_first_visible_line) >= num_disassembly_lines)
                     m_first_visible_line = 0;
 
                 if (pc_idx < num_disassembly_lines)
                 {
-                    if (pc_idx < m_first_visible_line ||
+                    if (pc_idx < static_cast<uint32_t>(m_first_visible_line) ||
                         pc_idx >= m_first_visible_line + num_visible_lines)
                         m_first_visible_line = pc_idx - non_visible_pc_offset;
                 }
@@ -5087,7 +5089,7 @@ public:
             case ',':
             case KEY_PPAGE:
                 // Page up key
-                if (m_first_visible_line > num_visible_lines)
+                if (static_cast<uint32_t>(m_first_visible_line) > num_visible_lines)
                     m_first_visible_line -= num_visible_lines;
                 else
                     m_first_visible_line = 0;
@@ -5112,7 +5114,7 @@ public:
                 if (m_selected_line > 0)
                 {
                     m_selected_line--;
-                    if (m_first_visible_line > m_selected_line)
+                    if (static_cast<size_t>(m_first_visible_line) > m_selected_line)
                         m_first_visible_line = m_selected_line;
                 }
                 return eKeyHandled;

Modified: lldb/trunk/source/Core/Opcode.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Opcode.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Core/Opcode.cpp (original)
+++ lldb/trunk/source/Core/Opcode.cpp Tue Apr  1 22:51:35 2014
@@ -63,7 +63,7 @@ Opcode::Dump (Stream *s, uint32_t min_by
 
     // Add spaces to make sure bytes dispay comes out even in case opcodes
     // aren't all the same size
-    if (bytes_written < min_byte_width)
+    if (static_cast<uint32_t>(bytes_written) < min_byte_width)
         bytes_written = s->Printf ("%*s", min_byte_width - bytes_written, "");
     return bytes_written;
 }

Modified: lldb/trunk/source/DataFormatters/CF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CF.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/CF.cpp (original)
+++ lldb/trunk/source/DataFormatters/CF.cpp Tue Apr  1 22:51:35 2014
@@ -160,7 +160,7 @@ lldb_private::formatters::CFBitVectorSum
     if (error.Fail() || num_bytes == 0)
         return false;
     uint8_t *bytes = buffer_sp->GetBytes();
-    for (int byte_idx = 0; byte_idx < num_bytes-1; byte_idx++)
+    for (uint64_t byte_idx = 0; byte_idx < num_bytes-1; byte_idx++)
     {
         uint8_t byte = bytes[byte_idx];
         bool bit0 = (byte & 1) == 1;

Modified: lldb/trunk/source/Expression/IRInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRInterpreter.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRInterpreter.cpp (original)
+++ lldb/trunk/source/Expression/IRInterpreter.cpp Tue Apr  1 22:51:35 2014
@@ -642,7 +642,7 @@ IRInterpreter::Interpret (llvm::Module &
          ai != ae;
          ++ai, ++arg_index)
     {
-        if (args.size() < arg_index)
+        if (args.size() < static_cast<size_t>(arg_index))
         {
             error.SetErrorString ("Not enough arguments passed in to function");
             return false;

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Tue Apr  1 22:51:35 2014
@@ -1786,8 +1786,8 @@ Host::LaunchProcessPosixSpawn (const cha
         cpu_type_t cpu = arch_spec.GetMachOCPUType();
         cpu_type_t sub = arch_spec.GetMachOCPUSubType();
         if (cpu != 0 &&
-            cpu != UINT32_MAX &&
-            cpu != LLDB_INVALID_CPUTYPE &&
+            cpu != static_cast<cpu_type_t>(UINT32_MAX) &&
+            cpu != static_cast<cpu_type_t>(LLDB_INVALID_CPUTYPE) &&
             !(cpu == 0x01000007 && sub == 8)) // If haswell is specified, don't try to set the CPU type or we will fail 
         {
             size_t ocount = 0;
@@ -2306,7 +2306,7 @@ Host::Readlink (const char *path, char *
     ssize_t count = ::readlink(path, buf, buf_len);
     if (count < 0)
         error.SetErrorToErrno();
-    else if (count < (buf_len-1))
+    else if (static_cast<size_t>(count) < (buf_len-1))
         buf[count] = '\0'; // Success
     else
         error.SetErrorString("'buf' buffer is too small to contain link contents");
@@ -2391,7 +2391,8 @@ Host::WriteFile (lldb::user_id_t fd, uin
         error.SetErrorString ("invalid host backing file");
         return UINT64_MAX;
     }
-    if (file_sp->SeekFromStart(offset, &error) != offset || error.Fail())
+    if (static_cast<uint64_t>(file_sp->SeekFromStart(offset, &error)) != offset ||
+        error.Fail())
         return UINT64_MAX;
     size_t bytes_written = src_len;
     error = file_sp->Write(src, bytes_written);
@@ -2421,7 +2422,8 @@ Host::ReadFile (lldb::user_id_t fd, uint
         error.SetErrorString ("invalid host backing file");
         return UINT64_MAX;
     }
-    if (file_sp->SeekFromStart(offset, &error) != offset || error.Fail())
+    if (static_cast<uint64_t>(file_sp->SeekFromStart(offset, &error)) != offset ||
+        error.Fail())
         return UINT64_MAX;
     size_t bytes_read = dst_len;
     error = file_sp->Read(dst ,bytes_read);

Modified: lldb/trunk/source/Host/common/Terminal.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Terminal.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Terminal.cpp (original)
+++ lldb/trunk/source/Host/common/Terminal.cpp Tue Apr  1 22:51:35 2014
@@ -250,7 +250,7 @@ TerminalState::TTYStateIsValid() const
 bool
 TerminalState::ProcessGroupIsValid() const
 {
-    return m_process_group != -1;
+    return static_cast<int32_t>(m_process_group) != -1;
 }
 
 //------------------------------------------------------------------

Modified: lldb/trunk/source/Host/linux/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/Host.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Host/linux/Host.cpp (original)
+++ lldb/trunk/source/Host/linux/Host.cpp Tue Apr  1 22:51:35 2014
@@ -520,7 +520,7 @@ Host::GetDistributionId ()
             "/usr/bin/lsb_release"
         };
 
-        for (int exe_index = 0;
+        for (size_t exe_index = 0;
              exe_index < sizeof (exe_paths) / sizeof (exe_paths[0]);
              ++exe_index)
         {

Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Tue Apr  1 22:51:35 2014
@@ -1171,7 +1171,7 @@ GetMacOSXProcessArgs (const ProcessInsta
                     }
                     // Now extract all arguments
                     Args &proc_args = process_info.GetArguments();
-                    for (int i=0; i<argc; ++i)
+                    for (int i=0; i<static_cast<int>(argc); ++i)
                     {
                         cstr = data.GetCStr(&offset);
                         if (cstr)
@@ -1248,7 +1248,7 @@ Host::FindProcesses (const ProcessInstan
     bool all_users = match_info.GetMatchAllUsers();
     const lldb::pid_t our_pid = getpid();
     const uid_t our_uid = getuid();
-    for (int i = 0; i < actual_pid_count; i++)
+    for (size_t i = 0; i < actual_pid_count; i++)
     {
         const struct kinfo_proc &kinfo = kinfos[i];
         
@@ -1263,7 +1263,7 @@ Host::FindProcesses (const ProcessInstan
           kinfo_user_matches = true;
 
         if (kinfo_user_matches == false         || // Make sure the user is acceptable
-            kinfo.kp_proc.p_pid == our_pid      || // Skip this process
+            static_cast<lldb::pid_t>(kinfo.kp_proc.p_pid) == our_pid || // Skip this process
             kinfo.kp_proc.p_pid == 0            || // Skip kernel (kernel pid is zero)
             kinfo.kp_proc.p_stat == SZOMB       || // Zombies are bad, they like brains...
             kinfo.kp_proc.p_flag & P_TRACED     || // Being debugged?
@@ -1327,9 +1327,9 @@ PackageXPCArguments (xpc_object_t messag
     memset(buf, 0, 50);
     sprintf(buf, "%sCount", prefix);
 	xpc_dictionary_set_int64(message, buf, count);
-    for (int i=0; i<count; i++) {
+    for (size_t i=0; i<count; i++) {
         memset(buf, 0, 50);
-        sprintf(buf, "%s%i", prefix, i);
+        sprintf(buf, "%s%zi", prefix, i);
         xpc_dictionary_set_string(message, buf, args.GetArgumentAtIndex(i));
     }
 }

Modified: lldb/trunk/source/Interpreter/Args.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/Args.cpp (original)
+++ lldb/trunk/source/Interpreter/Args.cpp Tue Apr  1 22:51:35 2014
@@ -1516,11 +1516,11 @@ Args::ParseArgsForCompletion
             // were passed.  This will be useful when we come to restricting completions based on what other
             // options we've seen on the line.
 
-            if (OptionParser::GetOptionIndex() < dummy_vec.size() - 1
+            if (static_cast<size_t>(OptionParser::GetOptionIndex()) < dummy_vec.size() - 1
                 && (strcmp (dummy_vec[OptionParser::GetOptionIndex()-1], "--") == 0))
             {
                 dash_dash_pos = OptionParser::GetOptionIndex() - 1;
-                if (OptionParser::GetOptionIndex() - 1 == cursor_index)
+                if (static_cast<size_t>(OptionParser::GetOptionIndex() - 1) == cursor_index)
                 {
                     option_element_vector.push_back (OptionArgElement (OptionArgElement::eBareDoubleDash, OptionParser::GetOptionIndex() - 1,
                                                                    OptionArgElement::eBareDoubleDash));
@@ -1630,7 +1630,7 @@ Args::ParseArgsForCompletion
     // the option_element_vector, but only if it is not after the "--".  But it turns out that OptionParser::Parse just ignores
     // an isolated "-".  So we have to look it up by hand here.  We only care if it is AT the cursor position.
     
-    if ((dash_dash_pos == -1 || cursor_index < dash_dash_pos)
+    if ((static_cast<int32_t>(dash_dash_pos) == -1 || cursor_index < dash_dash_pos)
          && strcmp (GetArgumentAtIndex(cursor_index), "-") == 0)
     {
         option_element_vector.push_back (OptionArgElement (OptionArgElement::eBareDash, cursor_index, 

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Tue Apr  1 22:51:35 2014
@@ -1363,7 +1363,7 @@ CommandInterpreter::BuildAliasResult (co
                         int index = GetOptionArgumentPosition (value.c_str());
                         if (index == 0)
                             result_str.Printf ("%s", value.c_str());
-                        else if (index >= cmd_args.GetArgumentCount())
+                        else if (static_cast<size_t>(index) >= cmd_args.GetArgumentCount())
                         {
                             
                             result.AppendErrorWithFormat
@@ -2254,7 +2254,7 @@ CommandInterpreter::BuildAliasCommandArg
                         }
 
                     }
-                    else if (index >= cmd_args.GetArgumentCount())
+                    else if (static_cast<size_t>(index) >= cmd_args.GetArgumentCount())
                     {
                         result.AppendErrorWithFormat
                                     ("Not enough arguments provided; you need at least %d arguments to use this alias.\n",

Modified: lldb/trunk/source/Interpreter/CommandObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandObject.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandObject.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandObject.cpp Tue Apr  1 22:51:35 2014
@@ -477,7 +477,7 @@ CommandObject::GetNumArgumentEntries  ()
 CommandObject::CommandArgumentEntry *
 CommandObject::GetArgumentEntryAtIndex (int idx)
 {
-    if (idx < m_arguments.size())
+    if (static_cast<size_t>(idx) < m_arguments.size())
         return &(m_arguments[idx]);
 
     return NULL;

Modified: lldb/trunk/source/Interpreter/OptionValueArray.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueArray.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueArray.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionValueArray.cpp Tue Apr  1 22:51:35 2014
@@ -222,7 +222,8 @@ OptionValueArray::SetArgs (const Args &a
             size_t i;
             for (i=0; i<argc; ++i)
             {
-                const int idx = Args::StringToSInt32(args.GetArgumentAtIndex(i), INT32_MAX);
+                const size_t idx =
+                  Args::StringToSInt32(args.GetArgumentAtIndex(i), INT32_MAX);
                 if (idx >= size)
                 {
                     all_indexes_valid = false;

Modified: lldb/trunk/source/Interpreter/Options.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Options.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/Options.cpp (original)
+++ lldb/trunk/source/Interpreter/Options.cpp Tue Apr  1 22:51:35 2014
@@ -344,7 +344,7 @@ Options::OutputFormattedUsageText
 
     // Will it all fit on one line?
 
-    if ((len + strm.GetIndentLevel()) < output_max_columns)
+    if (static_cast<uint32_t>(len + strm.GetIndentLevel()) < output_max_columns)
     {
         // Output it as a single line.
         strm.Indent (text);

Modified: lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp Tue Apr  1 22:51:35 2014
@@ -237,10 +237,10 @@ ABIMacOSX_arm64::PrepareTrivialCall (Thr
 {
     RegisterContext *reg_ctx = thread.GetRegisterContext().get();
     if (!reg_ctx)
-        return false;    
-    
+        return false;
+
     Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
-    
+
     if (log)
     {
         StreamString s;
@@ -249,8 +249,8 @@ ABIMacOSX_arm64::PrepareTrivialCall (Thr
                  (uint64_t)sp,
                  (uint64_t)func_addr,
                  (uint64_t)return_addr);
-        
-        for (int i = 0; i < args.size(); ++i)
+
+        for (size_t i = 0; i < args.size(); ++i)
             s.Printf (", arg%d = 0x%" PRIx64, i + 1, args[i]);
         s.PutCString (")");
         log->PutCString(s.GetString().c_str());
@@ -259,12 +259,12 @@ ABIMacOSX_arm64::PrepareTrivialCall (Thr
     const uint32_t pc_reg_num = reg_ctx->ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC);
     const uint32_t sp_reg_num = reg_ctx->ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP);
     const uint32_t ra_reg_num = reg_ctx->ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA);
-    
+
     // x0 - x7 contain first 8 simple args
     if (args.size() > 8) // TODO handle more than 6 arguments
         return false;
-    
-    for (int i = 0; i < args.size(); ++i)
+
+    for (size_t i = 0; i < args.size(); ++i)
     {
         const RegisterInfo *reg_info = reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG1 + i);
         if (log)
@@ -276,15 +276,15 @@ ABIMacOSX_arm64::PrepareTrivialCall (Thr
     // Set "lr" to the return address
     if (!reg_ctx->WriteRegisterFromUnsigned (reg_ctx->GetRegisterInfoAtIndex (ra_reg_num), return_addr))
         return false;
-    
+
     // Set "sp" to the requested value
     if (!reg_ctx->WriteRegisterFromUnsigned (reg_ctx->GetRegisterInfoAtIndex (sp_reg_num), sp))
         return false;
-    
+
     // Set "pc" to the address requested
     if (!reg_ctx->WriteRegisterFromUnsigned (reg_ctx->GetRegisterInfoAtIndex (pc_reg_num), func_addr))
         return false;
-    
+
     return true;
 }
 

Modified: lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp Tue Apr  1 22:51:35 2014
@@ -316,8 +316,8 @@ ABISysV_x86_64::PrepareTrivialCall (Thre
                     (uint64_t)func_addr,
                     (uint64_t)return_addr);
 
-        for (int i = 0; i < args.size(); ++i)
-            s.Printf (", arg%d = 0x%" PRIx64, i + 1, args[i]);
+        for (size_t i = 0; i < args.size(); ++i)
+            s.Printf (", arg%zd = 0x%" PRIx64, i + 1, args[i]);
         s.PutCString (")");
         log->PutCString(s.GetString().c_str());
     }
@@ -331,11 +331,11 @@ ABISysV_x86_64::PrepareTrivialCall (Thre
     if (args.size() > 6) // TODO handle more than 6 arguments
         return false;
     
-    for (int i = 0; i < args.size(); ++i)
+    for (size_t i = 0; i < args.size(); ++i)
     {
         reg_info = reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG1 + i);
         if (log)
-            log->Printf("About to write arg%d (0x%" PRIx64 ") into %s", i + 1, args[i], reg_info->name);
+            log->Printf("About to write arg%zd (0x%" PRIx64 ") into %s", i + 1, args[i], reg_info->name);
         if (!reg_ctx->WriteRegisterFromUnsigned(reg_info, args[i]))
             return false;
     }

Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Tue Apr  1 22:51:35 2014
@@ -635,11 +635,11 @@ DynamicLoaderMacOSXDYLD::NotifyBreakpoin
         if (abi->GetArgumentValues (exe_ctx.GetThreadRef(), argument_values))
         {
             uint32_t dyld_mode = argument_values.GetValueAtIndex(0)->GetScalar().UInt (-1);
-            if (dyld_mode != -1)
+            if (dyld_mode != static_cast<uint32_t>(-1))
             {
                 // Okay the mode was right, now get the number of elements, and the array of new elements...
                 uint32_t image_infos_count = argument_values.GetValueAtIndex(1)->GetScalar().UInt (-1);
-                if (image_infos_count != -1)
+                if (image_infos_count != static_cast<uint32_t>(-1))
                 {
                     // Got the number added, now go through the array of added elements, putting out the mach header 
                     // address, and adding the image.

Modified: lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp Tue Apr  1 22:51:35 2014
@@ -329,7 +329,7 @@ ObjectFileJIT::ReadSectionData (const ll
                                 size_t dst_len) const
 {
     lldb::offset_t file_size = section->GetFileSize();
-    if (section_offset < file_size)
+    if (section_offset < static_cast<off_t>(file_size))
     {
         uint64_t src_len = file_size - section_offset;
         if (src_len > dst_len)

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Apr  1 22:51:35 2014
@@ -4646,7 +4646,7 @@ ObjectFileMachO::GetProcessSharedCacheUU
 
         Error err;
         uint32_t version_or_magic = process->ReadUnsignedIntegerFromMemory (all_image_infos, 4, -1, err);
-        if (version_or_magic != -1 
+        if (version_or_magic != static_cast<uint32_t>(-1)
             && version_or_magic != MH_MAGIC
             && version_or_magic != MH_CIGAM
             && version_or_magic != MH_MAGIC_64

Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp Tue Apr  1 22:51:35 2014
@@ -1142,7 +1142,7 @@ ProcessMonitor::Launch(LaunchArgs *args)
     if (envp == NULL || envp[0] == NULL)
         envp = const_cast<const char **>(environ);
 
-    if ((pid = terminal.Fork(err_str, err_len)) == -1)
+    if ((pid = terminal.Fork(err_str, err_len)) == static_cast<lldb::pid_t>(-1))
     {
         args->m_error.SetErrorToGenericError();
         args->m_error.SetErrorString("Process fork failed.");
@@ -1203,7 +1203,7 @@ ProcessMonitor::Launch(LaunchArgs *args)
     }
 
     // Wait for the child process to to trap on its call to execve.
-    pid_t wpid;
+    lldb::pid_t wpid;
     int status;
     if ((wpid = waitpid(pid, &status, 0)) < 0)
     {
@@ -1746,7 +1746,7 @@ ProcessMonitor::StopThread(lldb::tid_t t
         if (log)
             log->Printf ("ProcessMonitor::%s(bp) waitpid, pid = %" PRIu64 ", status = %d", __FUNCTION__, wait_pid, status);
 
-        if (wait_pid == -1)
+        if (wait_pid == static_cast<lldb::pid_t>(-1))
         {
             // If we got interrupted by a signal (in our process, not the
             // inferior) try again.

Modified: lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp Tue Apr  1 22:51:35 2014
@@ -323,7 +323,7 @@ DynamicRegisterInfo::SetRegisterInfo (co
                     reg_info.encoding = (Encoding)reg_info_dict.GetItemForKeyAsInteger (encoding_pystr, eEncodingUint);
 
                 const int64_t set = reg_info_dict.GetItemForKeyAsInteger(set_pystr, -1);
-                if (set >= m_sets.size())
+                if (static_cast<size_t>(set) >= m_sets.size())
                 {
                     Clear();
                     return 0;
@@ -379,7 +379,7 @@ DynamicRegisterInfo::SetRegisterInfo (co
                                 if (invalidate_reg_num)
                                 {
                                     const int64_t r = invalidate_reg_num.GetInteger();
-                                    if (r != UINT64_MAX)
+                                    if (r != static_cast<int64_t>(UINT64_MAX))
                                         m_invalidate_regs_map[i].push_back(r);
                                     else
                                         printf("error: 'invalidate-regs' list value wasn't a valid integer\n");

Modified: lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp Tue Apr  1 22:51:35 2014
@@ -347,7 +347,7 @@ bool
 UnwindLLDB::SearchForSavedLocationForRegister (uint32_t lldb_regnum, lldb_private::UnwindLLDB::RegisterLocation &regloc, uint32_t starting_frame_num, bool pc_reg)
 {
     int64_t frame_num = starting_frame_num;
-    if (frame_num >= m_frames.size())
+    if (static_cast<size_t>(frame_num) >= m_frames.size())
         return false;
 
     // Never interrogate more than one level while looking for the saved pc value.  If the value

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Tue Apr  1 22:51:35 2014
@@ -3106,7 +3106,7 @@ GDBRemoteCommunicationClient::GetFilePer
         else
         {
             const uint32_t mode = response.GetS32(-1);
-            if (mode == -1)
+            if (static_cast<int32_t>(mode) == -1)
             {
                 if (response.GetChar() == ',')
                 {

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp Tue Apr  1 22:51:35 2014
@@ -689,23 +689,23 @@ GDBRemoteRegisterContext::WriteAllRegist
                             size_including_slice_registers += reg_info->byte_size;
                             if (reg_info->value_regs == NULL)
                                 size_not_including_slice_registers += reg_info->byte_size;
-                            if (reg_info->byte_offset >= size_by_highest_offset)
+                            if (static_cast<off_t>(reg_info->byte_offset) >= size_by_highest_offset)
                                 size_by_highest_offset = reg_info->byte_offset + reg_info->byte_size;
                         }
 
                         bool use_byte_offset_into_buffer;
-                        if (size_by_highest_offset == restore_data.GetByteSize())
+                        if (static_cast<size_t>(size_by_highest_offset) == restore_data.GetByteSize())
                         {
                             // The size of the packet agrees with the highest offset: + size in the register file
                             use_byte_offset_into_buffer = true;
                         }
-                        else if (size_not_including_slice_registers == restore_data.GetByteSize())
+                        else if (static_cast<size_t>(size_not_including_slice_registers) == restore_data.GetByteSize())
                         {
                             // The size of the packet is the same as concenating all of the registers sequentially,
                             // skipping the slice registers
                             use_byte_offset_into_buffer = true;
                         }
-                        else if (size_including_slice_registers == restore_data.GetByteSize())
+                        else if (static_cast<size_t>(size_including_slice_registers) == restore_data.GetByteSize())
                         {
                             // The slice registers are present in the packet (when they shouldn't be).
                             // Don't try to use the RegisterInfo byte_offset into the restore_data, it will

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp Tue Apr  1 22:51:35 2014
@@ -795,7 +795,7 @@ DWARFDebugLine::ParseStatementTable
                 // as a multiple of LEB128 operands for each opcode.
                 {
                     uint8_t i;
-                    assert (opcode - 1 < prologue->standard_opcode_lengths.size());
+                    assert (static_cast<size_t>(opcode - 1) < prologue->standard_opcode_lengths.size());
                     const uint8_t opcode_length = prologue->standard_opcode_lengths[opcode - 1];
                     for (i=0; i<opcode_length; ++i)
                         debug_line_data.Skip_LEB128(offset_ptr);

Modified: lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp Tue Apr  1 22:51:35 2014
@@ -620,7 +620,8 @@ SystemRuntimeMacOSX::GetPendingItemRefsF
                         pending_item_refs.new_style = true;
                         uint32_t item_size = extractor.GetU32(&offset);
                         uint32_t start_of_array_offset = offset;
-                        while (offset < pending_items_pointer.items_buffer_size && i < pending_items_pointer.count)
+                        while (offset < pending_items_pointer.items_buffer_size &&
+                               static_cast<size_t>(i) < pending_items_pointer.count)
                         {
                             offset = start_of_array_offset + (i * item_size);
                             ItemRefAndCodeAddress item;
@@ -634,7 +635,8 @@ SystemRuntimeMacOSX::GetPendingItemRefsF
                     {
                         offset = 0;
                         pending_item_refs.new_style = false;
-                        while (offset < pending_items_pointer.items_buffer_size && i < pending_items_pointer.count)
+                        while (offset < pending_items_pointer.items_buffer_size &&
+                               static_cast<size_t>(i) < pending_items_pointer.count)
                         {
                             ItemRefAndCodeAddress item;
                             item.item_ref = extractor.GetPointer (&offset);

Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp (original)
+++ lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp Tue Apr  1 22:51:35 2014
@@ -479,7 +479,8 @@ AssemblyParse_x86::instruction_length (A
     const bool prefer_file_cache = true;
     Error error;
     Target *target = m_exe_ctx.GetTargetPtr();
-    if (target->ReadMemory (addr, prefer_file_cache, opcode_data.data(), max_op_byte_size, error) == -1)
+    if (target->ReadMemory (addr, prefer_file_cache, opcode_data.data(),
+                            max_op_byte_size, error) == static_cast<size_t>(-1))
     {
         return false;
     }
@@ -552,7 +553,8 @@ AssemblyParse_x86::get_non_call_site_unw
             // An unrecognized/junk instruction
             break;
         }
-        if (target->ReadMemory (m_cur_insn, prefer_file_cache, m_cur_insn_bytes, insn_len, error) == -1)
+        if (target->ReadMemory (m_cur_insn, prefer_file_cache, m_cur_insn_bytes,
+                                insn_len, error) == static_cast<size_t>(-1))
         {
            // Error reading the instruction out of the file, stop scanning
            break;
@@ -600,7 +602,7 @@ AssemblyParse_x86::get_non_call_site_unw
             bool need_to_push_row = false;
             // the PUSH instruction has moved the stack pointer - if the CFA is set in terms of the stack pointer,
             // we need to add a new row of instructions.
-            if (row->GetCFARegister() == m_lldb_sp_regnum)
+            if (row->GetCFARegister() == static_cast<uint32_t>(m_lldb_sp_regnum))
             {
                 need_to_push_row = true;
                 row->SetCFAOffset (current_sp_bytes_offset_from_cfa);
@@ -645,7 +647,7 @@ AssemblyParse_x86::get_non_call_site_unw
         if (sub_rsp_pattern_p (stack_offset))
         {
             current_sp_bytes_offset_from_cfa += stack_offset;
-            if (row->GetCFARegister() == m_lldb_sp_regnum)
+            if (row->GetCFARegister() == static_cast<uint32_t>(m_lldb_sp_regnum))
             {
                 row->SetOffset (current_func_text_offset + insn_len);
                 row->SetCFAOffset (current_sp_bytes_offset_from_cfa);
@@ -699,7 +701,8 @@ loopnext:
         uint8_t bytebuf[7];
         Address last_seven_bytes(end_of_fun);
         last_seven_bytes.SetOffset (last_seven_bytes.GetOffset() - 7);
-        if (target->ReadMemory (last_seven_bytes, prefer_file_cache, bytebuf, 7, error) != -1)
+        if (target->ReadMemory (last_seven_bytes, prefer_file_cache, bytebuf, 7,
+                                error) != static_cast<size_t>(-1))
         {
             if (bytebuf[5] == 0x5d && bytebuf[6] == 0xc3)  // mov, ret
             {
@@ -715,7 +718,8 @@ loopnext:
         uint8_t bytebuf[2];
         Address last_two_bytes(end_of_fun);
         last_two_bytes.SetOffset (last_two_bytes.GetOffset() - 2);
-        if (target->ReadMemory (last_two_bytes, prefer_file_cache, bytebuf, 2, error) != -1)
+        if (target->ReadMemory (last_two_bytes, prefer_file_cache, bytebuf, 2,
+                                error) != static_cast<size_t>(-1))
         {
             if (bytebuf[0] == 0x5d && bytebuf[1] == 0xc3) // mov, ret
             {
@@ -776,7 +780,8 @@ AssemblyParse_x86::get_fast_unwind_plan
     uint8_t bytebuf[4];
     Error error;
     const bool prefer_file_cache = true;
-    if (target->ReadMemory (func.GetBaseAddress(), prefer_file_cache, bytebuf, sizeof (bytebuf), error) == -1)
+    if (target->ReadMemory (func.GetBaseAddress(), prefer_file_cache, bytebuf,
+                            sizeof (bytebuf), error) == static_cast<size_t>(-1))
         return false;
 
     uint8_t i386_prologue[] = {0x55, 0x89, 0xe5};
@@ -859,7 +864,8 @@ AssemblyParse_x86::find_first_non_prolog
             // An error parsing the instruction, i.e. probably data/garbage - stop scanning
             break;
         }
-        if (target->ReadMemory (m_cur_insn, prefer_file_cache, m_cur_insn_bytes, insn_len, error) == -1)
+        if (target->ReadMemory (m_cur_insn, prefer_file_cache, m_cur_insn_bytes,
+                                insn_len, error) == static_cast<size_t>(-1))
         {
            // Error reading the instruction out of the file, stop scanning
            break;

Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Tue Apr  1 22:51:35 2014
@@ -3268,7 +3268,7 @@ ClangASTType::GetChildClangTypeAtIndex (
                                     // Setting this to UINT32_MAX to make sure we don't compute it twice...
                                     bit_offset = UINT32_MAX;
                                     
-                                    if (child_byte_offset == LLDB_INVALID_IVAR_OFFSET)
+                                    if (child_byte_offset == static_cast<int32_t>(LLDB_INVALID_IVAR_OFFSET))
                                     {
                                         bit_offset = interface_layout.getFieldOffset (child_idx - superclass_idx);
                                         child_byte_offset = bit_offset / 8;

Modified: lldb/trunk/source/Symbol/ObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ObjectFile.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ObjectFile.cpp (original)
+++ lldb/trunk/source/Symbol/ObjectFile.cpp Tue Apr  1 22:51:35 2014
@@ -486,7 +486,7 @@ ObjectFile::ReadSectionData (const Secti
     else
     {
         const uint64_t section_file_size = section->GetFileSize();
-        if (section_offset < section_file_size)
+        if (section_offset < static_cast<off_t>(section_file_size))
         {
             const uint64_t section_bytes_left = section_file_size - section_offset;
             uint64_t section_dst_len = dst_len;

Modified: lldb/trunk/source/Symbol/UnwindPlan.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/UnwindPlan.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/UnwindPlan.cpp (original)
+++ lldb/trunk/source/Symbol/UnwindPlan.cpp Tue Apr  1 22:51:35 2014
@@ -326,7 +326,7 @@ UnwindPlan::GetRowForFunctionOffset (int
             collection::const_iterator pos, end = m_row_list.end();
             for (pos = m_row_list.begin(); pos != end; ++pos)
             {
-                if ((*pos)->GetOffset() <= offset)
+                if ((*pos)->GetOffset() <= static_cast<lldb::offset_t>(offset))
                     row = *pos;
                 else
                     break;

Modified: lldb/trunk/source/Target/PathMappingList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/PathMappingList.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Target/PathMappingList.cpp (original)
+++ lldb/trunk/source/Target/PathMappingList.cpp Tue Apr  1 22:51:35 2014
@@ -134,7 +134,7 @@ PathMappingList::Replace (const ConstStr
 bool
 PathMappingList::Remove (off_t index, bool notify)
 {
-    if (index >= m_pairs.size())
+    if (static_cast<size_t>(index) >= m_pairs.size())
         return false;
 
     ++m_mod_id;
@@ -161,7 +161,7 @@ PathMappingList::Dump (Stream *s, int pa
     }
     else
     {
-        if (pair_index < numPairs)
+        if (static_cast<unsigned int>(pair_index) < numPairs)
             s->Printf("%s -> %s",
                       m_pairs[pair_index].first.GetCString(), m_pairs[pair_index].second.GetCString());
     }

Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Tue Apr  1 22:51:35 2014
@@ -861,7 +861,7 @@ StackFrame::GetValueForVariableExpressio
                                                                             valobj_sp->GetTypeName().AsCString("<invalid type>"),
                                                                             var_expr_path_strm.GetString().c_str());
                                         }
-                                        else if (child_index >= synthetic->GetNumChildren() /* synthetic does not have that many values */)
+                                        else if (static_cast<uint32_t>(child_index) >= synthetic->GetNumChildren() /* synthetic does not have that many values */)
                                         {
                                             valobj_sp->GetExpressionPath (var_expr_path_strm, false);
                                             error.SetErrorStringWithFormat ("array index %ld is not valid for \"(%s) %s\"", 
@@ -937,7 +937,7 @@ StackFrame::GetValueForVariableExpressio
                                                                         valobj_sp->GetTypeName().AsCString("<invalid type>"),
                                                                         var_expr_path_strm.GetString().c_str());
                                     }
-                                    else if (child_index >= synthetic->GetNumChildren() /* synthetic does not have that many values */)
+                                    else if (static_cast<uint32_t>(child_index) >= synthetic->GetNumChildren() /* synthetic does not have that many values */)
                                     {
                                         valobj_sp->GetExpressionPath (var_expr_path_strm, false);
                                         error.SetErrorStringWithFormat ("array index %ld is not valid for \"(%s) %s\"", 

Modified: lldb/trunk/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Tue Apr  1 22:51:35 2014
@@ -2121,7 +2121,8 @@ Thread::IsStillAtLastBreakpointHit ()
             {
                 lldb::addr_t pc = reg_ctx_sp->GetPC();
                 BreakpointSiteSP bp_site_sp = GetProcess()->GetBreakpointSiteList().FindByAddress(pc);
-                if (bp_site_sp && value == bp_site_sp->GetID())
+                if (bp_site_sp &&
+                    static_cast<break_id_t>(value) == bp_site_sp->GetID())
                     return true;
             }
         }

Modified: lldb/trunk/source/lldb.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/lldb.cpp?rev=205390&r1=205389&r2=205390&view=diff
==============================================================================
--- lldb/trunk/source/lldb.cpp (original)
+++ lldb/trunk/source/lldb.cpp Tue Apr  1 22:51:35 2014
@@ -297,7 +297,8 @@ lldb_private::GetVersion ()
         
         size_t version_len = sizeof(g_version_string);
         
-        if (newline_loc && (newline_loc - version_string < version_len))
+        if (newline_loc &&
+            (newline_loc - version_string < static_cast<ptrdiff_t>(version_len)))
             version_len = newline_loc - version_string;
         
         ::strncpy(g_version_string, version_string, version_len);





More information about the lldb-commits mailing list