[Lldb-commits] [lldb] r113433 - in /lldb/trunk/source/Commands: CommandObjectProcess.cpp CommandObjectSettings.cpp CommandObjectSource.cpp

Chris Lattner sabre at nondot.org
Wed Sep 8 15:55:31 PDT 2010


Author: lattner
Date: Wed Sep  8 17:55:31 2010
New Revision: 113433

URL: http://llvm.org/viewvc/llvm-project?rev=113433&view=rev
Log:
fix a bunch of signed/unsigned comparison warnings, stop evaluating "getsize" every time through the loop.

Modified:
    lldb/trunk/source/Commands/CommandObjectProcess.cpp
    lldb/trunk/source/Commands/CommandObjectSettings.cpp
    lldb/trunk/source/Commands/CommandObjectSource.cpp

Modified: lldb/trunk/source/Commands/CommandObjectProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectProcess.cpp?rev=113433&r1=113432&r2=113433&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectProcess.cpp Wed Sep  8 17:55:31 2010
@@ -174,8 +174,8 @@
         if (run_args_value.GetSize() > 0)
         {
             run_args = new Args;
-            for (int i = 0; i < run_args_value.GetSize(); ++i)
-                run_args->AppendArgument (run_args_value.GetStringAtIndex (i));
+            for (unsigned i = 0, e = run_args_value.GetSize(); i != e; ++i)
+                run_args->AppendArgument(run_args_value.GetStringAtIndex(i));
         }
         
         Args *environment = NULL;
@@ -185,7 +185,7 @@
         if (env_vars_value.GetSize() > 0)
         {
             environment = new Args;
-            for (int i = 0; i < env_vars_value.GetSize(); ++i)
+            for (unsigned i = 0, e = env_vars_value.GetSize(); i != e; ++i)
                 environment->AppendArgument (env_vars_value.GetStringAtIndex (i));
         }
 

Modified: lldb/trunk/source/Commands/CommandObjectSettings.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSettings.cpp?rev=113433&r1=113432&r2=113433&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectSettings.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectSettings.cpp Wed Sep  8 17:55:31 2010
@@ -308,7 +308,7 @@
             else
             {
                 result.AppendMessageWithFormat ("%s%s:\n", variable_name, type_name);
-                for (int i = 0; i < value.GetSize(); ++i)
+                for (unsigned i = 0, e = value.GetSize(); i != e; ++i)
                 {
                     result.AppendMessageWithFormat ("  [%d]: '%s'\n", i, value.GetStringAtIndex (i));
                 }

Modified: lldb/trunk/source/Commands/CommandObjectSource.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSource.cpp?rev=113433&r1=113432&r2=113433&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectSource.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectSource.cpp Wed Sep  8 17:55:31 2010
@@ -283,7 +283,7 @@
             if (m_options.m_modules.size() > 0)
             {
                 ModuleList matching_modules;
-                for (int i = 0; i < m_options.m_modules.size(); i++)
+                for (unsigned i = 0, e = m_options.m_modules.size(); i != e; i++)
                 {
                     FileSpec module_spec(m_options.m_modules[i].c_str());
                     if (module_spec)
@@ -457,7 +457,7 @@
             if (m_options.m_modules.size() > 0)
             {
                 ModuleList matching_modules;
-                for (int i = 0; i < m_options.m_modules.size(); i++)
+                for (unsigned i = 0, e = m_options.m_modules.size(); i != e; i++)
                 {
                     FileSpec module_spec(m_options.m_modules[i].c_str());
                     if (module_spec)
@@ -495,7 +495,7 @@
                 bool got_multiple = false;
                 FileSpec *test_cu_spec = NULL;
 
-                for (int i = 0; i < num_matches; i++)
+                for (unsigned i = 0; i < num_matches; i++)
                 {
                     sc_list.GetContextAtIndex(i, sc);
                     if (sc.comp_unit)





More information about the lldb-commits mailing list