diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-04-02 03:51:35 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-04-02 03:51:35 +0000 |
commit | 3985c8c64680d89a3ab328347e795af0c69c48ea (patch) | |
tree | 79b033e897a72dfd79894bf9fea2481042976232 /lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp | |
parent | f7da6c1fcf5d0968b473226df0ec7493d61f2711 (diff) | |
download | bcm5719-llvm-3985c8c64680d89a3ab328347e795af0c69c48ea.tar.gz bcm5719-llvm-3985c8c64680d89a3ab328347e795af0c69c48ea.zip |
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.
llvm-svn: 205390
Diffstat (limited to 'lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp')
-rw-r--r-- | lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp index 1768798f71d..ff7f758cf95 100644 --- a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp +++ b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp @@ -479,7 +479,8 @@ AssemblyParse_x86::instruction_length (Address addr, int &length) 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_unwind_plan (UnwindPlan &unwind_plan) // 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_unwind_plan (UnwindPlan &unwind_plan) 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_unwind_plan (UnwindPlan &unwind_plan) 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 (AddressRange& func, UnwindPlan &unwind_ 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_prologue_insn (Address &address) // 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; |