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/Process | |
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/Process')
5 files changed, 11 insertions, 11 deletions
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp index 198a1eb595c..8583f67ab0e 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp +++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp @@ -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 tid) 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. diff --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp index b7867c385e8..744d7ada9c8 100644 --- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp +++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp @@ -323,7 +323,7 @@ DynamicRegisterInfo::SetRegisterInfo (const lldb_private::PythonDictionary &dict 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 (const lldb_private::PythonDictionary &dict 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"); diff --git a/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp b/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp index 5db08e5c26d..37fd4f48955 100644 --- a/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp +++ b/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp @@ -347,7 +347,7 @@ bool UnwindLLDB::SearchForSavedLocationForRegister (uint32_t lldb_regnum, lldb_private::UnwindLLDB::RegisterLocation ®loc, 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 diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index f436799a86a..706d67ea961 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -3106,7 +3106,7 @@ GDBRemoteCommunicationClient::GetFilePermissions(const char *path, uint32_t &fil else { const uint32_t mode = response.GetS32(-1); - if (mode == -1) + if (static_cast<int32_t>(mode) == -1) { if (response.GetChar() == ',') { diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp index 9e5b0d79e10..acaf825d18b 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -689,23 +689,23 @@ GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb::DataBufferSP &data 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 |