summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorChristopher Wiley <wiley@google.com>2015-12-30 10:22:55 -0800
committerChristopher Wiley <wiley@google.com>2015-12-30 10:22:55 -0800
commit3bf7081cf806cd9ebedb47b3eff76671794efa68 (patch)
treea42fa4b50b92c4216c41909221bd533a346cc40b /base
parentb8803f9a9cde62141aebc7566550995910e0bd3f (diff)
downloadlibchrome-3bf7081cf806cd9ebedb47b3eff76671794efa68.tar.gz
Fix mac specific warnings
Fix a number of unused parameter warnings and two uninitlialized member warnings. Bug: 26228533 Change-Id: I46e40115c1087882821a51a978591d013f911b73 Test: Compiles on mac for x86_64-eng
Diffstat (limited to 'base')
-rw-r--r--base/files/dir_reader_fallback.h2
-rw-r--r--base/files/file_path_watcher_kqueue.cc2
-rw-r--r--base/mac/libdispatch_task_runner.cc2
-rw-r--r--base/message_loop/message_pump_mac.mm37
-rw-r--r--base/process/process_metrics_mac.cc6
-rw-r--r--base/process/process_posix.cc6
-rw-r--r--base/threading/platform_thread_mac.mm3
7 files changed, 33 insertions, 25 deletions
diff --git a/base/files/dir_reader_fallback.h b/base/files/dir_reader_fallback.h
index a435f25963..d2bf252a6e 100644
--- a/base/files/dir_reader_fallback.h
+++ b/base/files/dir_reader_fallback.h
@@ -11,7 +11,7 @@ class DirReaderFallback {
public:
// Open a directory. If |IsValid| is true, then |Next| can be called to start
// the iteration at the beginning of the directory.
- explicit DirReaderFallback(const char* directory_path) {}
+ explicit DirReaderFallback(const char* /* directory_path */) {}
// After construction, IsValid returns true iff the directory was
// successfully opened.
diff --git a/base/files/file_path_watcher_kqueue.cc b/base/files/file_path_watcher_kqueue.cc
index e15cba7d34..a126db708d 100644
--- a/base/files/file_path_watcher_kqueue.cc
+++ b/base/files/file_path_watcher_kqueue.cc
@@ -302,7 +302,7 @@ void FilePathWatcherKQueue::OnFileCanReadWithoutBlocking(int fd) {
}
}
-void FilePathWatcherKQueue::OnFileCanWriteWithoutBlocking(int fd) {
+void FilePathWatcherKQueue::OnFileCanWriteWithoutBlocking(int /* fd */) {
NOTREACHED();
}
diff --git a/base/mac/libdispatch_task_runner.cc b/base/mac/libdispatch_task_runner.cc
index 4b5abaf30c..7194c40fa6 100644
--- a/base/mac/libdispatch_task_runner.cc
+++ b/base/mac/libdispatch_task_runner.cc
@@ -17,7 +17,7 @@ LibDispatchTaskRunner::LibDispatchTaskRunner(const char* name)
}
bool LibDispatchTaskRunner::PostDelayedTask(
- const tracked_objects::Location& from_here,
+ const tracked_objects::Location& /* from_here */,
const Closure& task,
base::TimeDelta delay) {
if (!queue_)
diff --git a/base/message_loop/message_pump_mac.mm b/base/message_loop/message_pump_mac.mm
index 914977b13d..95d1c5f1fc 100644
--- a/base/message_loop/message_pump_mac.mm
+++ b/base/message_loop/message_pump_mac.mm
@@ -57,7 +57,7 @@ void CFRunLoopRemoveObserverFromAllModes(CFRunLoopRef rl,
CFRunLoopRemoveObserver(rl, observer, kMessageLoopExclusiveRunLoopMode);
}
-void NoOp(void* info) {
+void NoOp(void* /* info */) {
}
const CFTimeInterval kCFTimeIntervalMax =
@@ -282,8 +282,9 @@ void MessagePumpCFRunLoopBase::SetTimerSlack(TimerSlack timer_slack) {
// Called from the run loop.
// static
-void MessagePumpCFRunLoopBase::RunDelayedWorkTimer(CFRunLoopTimerRef timer,
- void* info) {
+void MessagePumpCFRunLoopBase::RunDelayedWorkTimer(
+ CFRunLoopTimerRef /* timer */,
+ void* info) {
MessagePumpCFRunLoopBase* self = static_cast<MessagePumpCFRunLoopBase*>(info);
// The timer won't fire again until it's reset.
@@ -436,9 +437,10 @@ void MessagePumpCFRunLoopBase::MaybeScheduleNestingDeferredWork() {
// Called from the run loop.
// static
-void MessagePumpCFRunLoopBase::PreWaitObserver(CFRunLoopObserverRef observer,
- CFRunLoopActivity activity,
- void* info) {
+void MessagePumpCFRunLoopBase::PreWaitObserver(
+ CFRunLoopObserverRef /* observer */,
+ CFRunLoopActivity /* activity */,
+ void* info) {
MessagePumpCFRunLoopBase* self = static_cast<MessagePumpCFRunLoopBase*>(info);
// Attempt to do some idle work before going to sleep.
@@ -453,9 +455,10 @@ void MessagePumpCFRunLoopBase::PreWaitObserver(CFRunLoopObserverRef observer,
// Called from the run loop.
// static
-void MessagePumpCFRunLoopBase::PreSourceObserver(CFRunLoopObserverRef observer,
- CFRunLoopActivity activity,
- void* info) {
+void MessagePumpCFRunLoopBase::PreSourceObserver(
+ CFRunLoopObserverRef /* observer */,
+ CFRunLoopActivity /* activity */,
+ void* info) {
MessagePumpCFRunLoopBase* self = static_cast<MessagePumpCFRunLoopBase*>(info);
// The run loop has reached the top of the loop and is about to begin
@@ -468,9 +471,10 @@ void MessagePumpCFRunLoopBase::PreSourceObserver(CFRunLoopObserverRef observer,
// Called from the run loop.
// static
-void MessagePumpCFRunLoopBase::EnterExitObserver(CFRunLoopObserverRef observer,
- CFRunLoopActivity activity,
- void* info) {
+void MessagePumpCFRunLoopBase::EnterExitObserver(
+ CFRunLoopObserverRef /* observer */,
+ CFRunLoopActivity activity,
+ void* info) {
MessagePumpCFRunLoopBase* self = static_cast<MessagePumpCFRunLoopBase*>(info);
switch (activity) {
@@ -511,7 +515,8 @@ void MessagePumpCFRunLoopBase::EnterExitObserver(CFRunLoopObserverRef observer,
// Called by MessagePumpCFRunLoopBase::EnterExitRunLoop. The default
// implementation is a no-op.
-void MessagePumpCFRunLoopBase::EnterExitRunLoop(CFRunLoopActivity activity) {
+void MessagePumpCFRunLoopBase::EnterExitRunLoop(
+ CFRunLoopActivity /* activity */) {
}
// Base version returns a standard NSAutoreleasePool.
@@ -529,7 +534,7 @@ MessagePumpCFRunLoop::~MessagePumpCFRunLoop() {}
// running lower on the run loop thread's stack when this object was created,
// the same number of CFRunLoopRun loops must be running for the outermost call
// to Run. Run/DoRun are reentrant after that point.
-void MessagePumpCFRunLoop::DoRun(Delegate* delegate) {
+void MessagePumpCFRunLoop::DoRun(Delegate* /* delegate */) {
// This is completely identical to calling CFRunLoopRun(), except autorelease
// pool management is introduced.
int result;
@@ -586,7 +591,7 @@ MessagePumpNSRunLoop::~MessagePumpNSRunLoop() {
CFRelease(quit_source_);
}
-void MessagePumpNSRunLoop::DoRun(Delegate* delegate) {
+void MessagePumpNSRunLoop::DoRun(Delegate* /* delegate */) {
while (keep_running_) {
// NSRunLoop manages autorelease pools itself.
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode
@@ -633,7 +638,7 @@ MessagePumpNSApplication::MessagePumpNSApplication()
MessagePumpNSApplication::~MessagePumpNSApplication() {}
-void MessagePumpNSApplication::DoRun(Delegate* delegate) {
+void MessagePumpNSApplication::DoRun(Delegate* /* delegate */) {
bool last_running_own_loop_ = running_own_loop_;
// NSApp must be initialized by calling:
diff --git a/base/process/process_metrics_mac.cc b/base/process/process_metrics_mac.cc
index f84b435a10..456b118f71 100644
--- a/base/process/process_metrics_mac.cc
+++ b/base/process/process_metrics_mac.cc
@@ -48,7 +48,7 @@ bool GetTaskInfo(mach_port_t task, task_basic_info_64* task_info_data) {
return kr == KERN_SUCCESS;
}
-bool GetCPUTypeForProcess(pid_t pid, cpu_type_t* cpu_type) {
+bool GetCPUTypeForProcess(pid_t /* pid */, cpu_type_t* cpu_type) {
size_t len = sizeof(*cpu_type);
int result = sysctlbyname("sysctl.proc_cputype",
cpu_type,
@@ -320,7 +320,7 @@ int ProcessMetrics::GetIdleWakeupsPerSecond() {
power_info_data.task_platform_idle_wakeups);
}
-bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) const {
+bool ProcessMetrics::GetIOCounters(IoCounters* /* io_counters */) const {
return false;
}
@@ -333,7 +333,7 @@ ProcessMetrics::ProcessMetrics(ProcessHandle process,
processor_count_ = SysInfo::NumberOfProcessors();
}
-mach_port_t ProcessMetrics::TaskForPid(ProcessHandle process) const {
+mach_port_t ProcessMetrics::TaskForPid(ProcessHandle /* process */) const {
mach_port_t task = MACH_PORT_NULL;
if (port_provider_)
task = port_provider_->TaskForPid(process_);
diff --git a/base/process/process_posix.cc b/base/process/process_posix.cc
index 03e762b3c7..775b78e4a0 100644
--- a/base/process/process_posix.cc
+++ b/base/process/process_posix.cc
@@ -97,7 +97,8 @@ static bool WaitForSingleNonChildProcess(base::ProcessHandle handle,
return false;
}
- struct kevent change = {0};
+ struct kevent change;
+ memset(&change, 0, sizeof(change));
EV_SET(&change, handle, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, NULL);
int result = HANDLE_EINTR(kevent(kq.get(), &change, 1, NULL, 0, NULL));
if (result == -1) {
@@ -121,7 +122,8 @@ static bool WaitForSingleNonChildProcess(base::ProcessHandle handle,
}
result = -1;
- struct kevent event = {0};
+ struct kevent event;
+ memset(&event, 0, sizeof(event));
while (wait_forever || remaining_delta > base::TimeDelta()) {
struct timespec remaining_timespec;
diff --git a/base/threading/platform_thread_mac.mm b/base/threading/platform_thread_mac.mm
index 813cae26d2..f737854111 100644
--- a/base/threading/platform_thread_mac.mm
+++ b/base/threading/platform_thread_mac.mm
@@ -174,7 +174,8 @@ void PlatformThread::SetThreadPriority(PlatformThreadHandle handle,
}
// static
-ThreadPriority PlatformThread::GetThreadPriority(PlatformThreadHandle handle) {
+ThreadPriority PlatformThread::GetThreadPriority(
+ PlatformThreadHandle /* handle */) {
NOTIMPLEMENTED();
return ThreadPriority::NORMAL;
}