[Lldb-commits] [lldb] r246606 - [debugserver] Fix sign comparison warning.

Bruce Mitchener via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 1 16:45:14 PDT 2015


Author: brucem
Date: Tue Sep  1 18:45:14 2015
New Revision: 246606

URL: http://llvm.org/viewvc/llvm-project?rev=246606&view=rev
Log:
[debugserver] Fix sign comparison warning.

Summary:
Comparing m_page_size against kInvalidPageSize was resulting in
a warning about comparing integers with different signs. Since
kInvalidPageSize isn't used anywhere outside of MachVMMemory.cpp,
we can readily transform it into a static const vm_size_t with
the correct value to avoid the sign comparison warnings.

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D12519

Modified:
    lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.h

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp?rev=246606&r1=246605&r2=246606&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp Tue Sep  1 18:45:14 2015
@@ -19,6 +19,8 @@
 #include <sys/sysctl.h>
 #include <dlfcn.h>
 
+static const vm_size_t kInvalidPageSize = ~0;
+
 MachVMMemory::MachVMMemory() :
     m_page_size    (kInvalidPageSize),
     m_err        (0)

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.h?rev=246606&r1=246605&r2=246606&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.h (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.h Tue Sep  1 18:45:14 2015
@@ -21,7 +21,6 @@
 class MachVMMemory
 {
 public:
-    enum { kInvalidPageSize = ~0 };
     MachVMMemory();
     ~MachVMMemory();
     nub_size_t Read(task_t task, nub_addr_t address, void *data, nub_size_t data_count);




More information about the lldb-commits mailing list