[Lldb-commits] [lldb] r219863 - Fix unused-variable warnings from the clang static analyzer.

Jason Molenda jmolenda at apple.com
Wed Oct 15 16:13:51 PDT 2014


Author: jmolenda
Date: Wed Oct 15 18:13:51 2014
New Revision: 219863

URL: http://llvm.org/viewvc/llvm-project?rev=219863&view=rev
Log:
Fix unused-variable warnings from the clang static analyzer.

Modified:
    lldb/trunk/tools/debugserver/source/DNB.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/Genealogy.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm
    lldb/trunk/tools/debugserver/source/RNBRemote.cpp
    lldb/trunk/tools/debugserver/source/RNBServices.cpp

Modified: lldb/trunk/tools/debugserver/source/DNB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNB.cpp?rev=219863&r1=219862&r2=219863&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/DNB.cpp (original)
+++ lldb/trunk/tools/debugserver/source/DNB.cpp Wed Oct 15 18:13:51 2014
@@ -192,24 +192,20 @@ kqueue_thread (void *arg)
             bool exited = false;
             int signal = 0;
             int exit_status = 0;
-            const char *status_cstr = NULL;
             if (WIFSTOPPED(status))
             {
                 signal = WSTOPSIG(status);
-                status_cstr = "STOPPED";
                 DNBLogThreadedIf(LOG_PROCESS, "waitpid (%i) -> STOPPED (signal = %i)", child_pid, signal);
             }
             else if (WIFEXITED(status))
             {
                 exit_status = WEXITSTATUS(status);
-                status_cstr = "EXITED";
                 exited = true;
                 DNBLogThreadedIf(LOG_PROCESS, "waitpid (%i) -> EXITED (status = %i)", child_pid, exit_status);
             }
             else if (WIFSIGNALED(status))
             {
                 signal = WTERMSIG(status);
-                status_cstr = "SIGNALED";
                 if (child_pid == abs(pid))
                 {
                     DNBLogThreadedIf(LOG_PROCESS, "waitpid (%i) -> SIGNALED and EXITED (signal = %i)", child_pid, signal);

Modified: lldb/trunk/tools/debugserver/source/MacOSX/Genealogy.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/Genealogy.cpp?rev=219863&r1=219862&r2=219863&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/Genealogy.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/Genealogy.cpp Wed Oct 15 18:13:51 2014
@@ -236,12 +236,10 @@ Genealogy::GetActivities(pid_t pid, cons
             nub_thread_t thread_id = iter->first;
             uint64_t activity_id = iter->second;
             ActivityList::const_iterator activity_search;
-            bool found_activity_for_this_thread = false;
             for (activity_search = activities.begin(); activity_search != activities.end(); ++activity_search)
             {
                 if (activity_search->activity_id == activity_id)
                 {
-                    found_activity_for_this_thread = true;
                     ThreadActivitySP thread_activity_sp (new ThreadActivity());
                     thread_activity_sp->current_activity = *activity_search;
     

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm?rev=219863&r1=219862&r2=219863&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm Wed Oct 15 18:13:51 2014
@@ -309,9 +309,9 @@ static void get_threads_profile_data(DNB
             threads_used_usec.push_back(used_usec);
         }
         
-        kr = mach_port_deallocate(mach_task_self(), threads[i]);
+        mach_port_deallocate(mach_task_self(), threads[i]);
     }
-    kr = mach_vm_deallocate(mach_task_self(), (mach_vm_address_t)(uintptr_t)threads, tcnt * sizeof(*threads));
+    mach_vm_deallocate(mach_task_self(), (mach_vm_address_t)(uintptr_t)threads, tcnt * sizeof(*threads));
 }
 
 #define RAW_HEXBASE     std::setfill('0') << std::hex << std::right

Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=219863&r1=219862&r2=219863&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Wed Oct 15 18:13:51 2014
@@ -4455,9 +4455,9 @@ RNBRemote::HandlePacket_qProcessInfo (co
                         ++offset;
                     }
                     // Now skip all arguments
-                    for (int i=0; i<static_cast<int>(argc); ++i)
+                    for (uint32_t i = 0; i < argc; ++i)
                     {
-                        cstr = data.GetCStr(&offset);
+                        data.GetCStr(&offset);
                     }
                     
                     // Now iterate across all environment variables

Modified: lldb/trunk/tools/debugserver/source/RNBServices.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBServices.cpp?rev=219863&r1=219862&r2=219863&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/RNBServices.cpp (original)
+++ lldb/trunk/tools/debugserver/source/RNBServices.cpp Wed Oct 15 18:13:51 2014
@@ -194,7 +194,7 @@ ListApplications(std::string& plist, boo
 #else // #if defined (WITH_SPRINGBOARD) || defined (WITH_BKS)
     // When root, show all processes
     bool all_users = (our_uid == 0);
-    result = GetProcesses (plistMutableArray.get(), all_users);
+    GetProcesses (plistMutableArray.get(), all_users);
 #endif
     
     CFReleaser<CFDataRef> plistData (::CFPropertyListCreateXMLData (alloc, plistMutableArray.get()));





More information about the lldb-commits mailing list