From: Jason Molenda Date: Wed, 15 Oct 2014 23:13:51 +0000 (+0000) Subject: Fix unused-variable warnings from the clang static analyzer. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aeb9a06ff50fde033d442e7757cab1bb36e3b684;p=platform%2Fupstream%2Fllvm.git Fix unused-variable warnings from the clang static analyzer. llvm-svn: 219863 --- diff --git a/lldb/tools/debugserver/source/DNB.cpp b/lldb/tools/debugserver/source/DNB.cpp index 304c655..c6a3dbe 100644 --- a/lldb/tools/debugserver/source/DNB.cpp +++ b/lldb/tools/debugserver/source/DNB.cpp @@ -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); diff --git a/lldb/tools/debugserver/source/MacOSX/Genealogy.cpp b/lldb/tools/debugserver/source/MacOSX/Genealogy.cpp index 1544dc2..e6ada96 100644 --- a/lldb/tools/debugserver/source/MacOSX/Genealogy.cpp +++ b/lldb/tools/debugserver/source/MacOSX/Genealogy.cpp @@ -236,12 +236,10 @@ Genealogy::GetActivities(pid_t pid, const MachThreadList &thread_list, task_t ta 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; diff --git a/lldb/tools/debugserver/source/MacOSX/MachTask.mm b/lldb/tools/debugserver/source/MacOSX/MachTask.mm index c14b377..2cb456c 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachTask.mm +++ b/lldb/tools/debugserver/source/MacOSX/MachTask.mm @@ -309,9 +309,9 @@ static void get_threads_profile_data(DNBProfileDataScanType scanType, task_t tas 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 diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp index aa5bcd1..8f419e7 100644 --- a/lldb/tools/debugserver/source/RNBRemote.cpp +++ b/lldb/tools/debugserver/source/RNBRemote.cpp @@ -4455,9 +4455,9 @@ RNBRemote::HandlePacket_qProcessInfo (const char *p) ++offset; } // Now skip all arguments - for (int i=0; i(argc); ++i) + for (uint32_t i = 0; i < argc; ++i) { - cstr = data.GetCStr(&offset); + data.GetCStr(&offset); } // Now iterate across all environment variables diff --git a/lldb/tools/debugserver/source/RNBServices.cpp b/lldb/tools/debugserver/source/RNBServices.cpp index 9d76209..aaf2d4f 100644 --- a/lldb/tools/debugserver/source/RNBServices.cpp +++ b/lldb/tools/debugserver/source/RNBServices.cpp @@ -194,7 +194,7 @@ ListApplications(std::string& plist, bool opt_runningApps, bool opt_debuggable) #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 plistData (::CFPropertyListCreateXMLData (alloc, plistMutableArray.get()));