Skip to content

Commit

Permalink
Remove dead code and mark conditionally-dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
willglynn committed Jul 23, 2017
1 parent dce8ece commit dff60d3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
6 changes: 5 additions & 1 deletion src/platform/macos/events_loop/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::sync::{Arc, Mutex, Weak};
use super::window::{self, Window};

mod nsevent;
mod timer;

// Simple blocking runloop
#[cfg(not(feature="context"))]
Expand All @@ -16,6 +15,10 @@ mod runloop;
#[path="runloop_context.rs"]
mod runloop;

// NSTimer wrapper, needed only for coroutine-baesd runloop
#[cfg(feature="context")]
mod timer;

use self::runloop::Runloop;

pub struct EventsLoop {
Expand Down Expand Up @@ -54,6 +57,7 @@ impl Shared {
}

// Are there any events pending delivery?
#[allow(dead_code)]
fn has_queued_events(&self) -> bool {
!self.pending_events.lock().unwrap().is_empty()
}
Expand Down
4 changes: 1 addition & 3 deletions src/platform/macos/events_loop/nsevent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ impl RetainedEvent {
unsafe { CFRetain(event as CFTypeRef); }
RetainedEvent(event)
}
pub fn into_inner(self) -> cocoa::base::id {
self.0
}
pub fn id(&self) -> cocoa::base::id {
self.0
}
Expand Down Expand Up @@ -116,6 +113,7 @@ impl Modifiers {
//
// The event itself corresponds to no `Event`, but it does cause `receive_event_from_cocoa()` to
// return to its caller.
#[allow(dead_code)]
pub fn post_event_to_self() {
unsafe {
let pool = foundation::NSAutoreleasePool::new(cocoa::base::nil);
Expand Down
3 changes: 1 addition & 2 deletions src/platform/macos/events_loop/runloop.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::sync::Weak;
use core_foundation;
use cocoa::{self, foundation};
use cocoa::appkit::{self, NSApplication, NSApp};
use cocoa;

use super::{Shared,Timeout};
use super::nsevent;
Expand Down
3 changes: 1 addition & 2 deletions src/platform/macos/events_loop/runloop_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ use context;
use core_foundation;
use core_foundation::base::*;
use core_foundation::runloop::*;
use cocoa::{self, foundation};
use cocoa::appkit::{self, NSApplication, NSApp};
use cocoa;
use libc::c_void;

use super::{Shared,Timeout};
Expand Down
8 changes: 0 additions & 8 deletions src/platform/macos/events_loop/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ impl Timer {
// default to firing every year, starting one year in the future
let interval: CFTimeInterval = interval_seconds;
let now = unsafe { CFAbsoluteTimeGetCurrent() };
let next_interval = now + interval;

let mut context: CFRunLoopTimerContext = unsafe { mem::zeroed() };

Expand All @@ -54,13 +53,6 @@ impl Timer {
timer
}
}

// Cause the timer to fire ASAP. Can be called across threads.
pub fn trigger(&self) {
unsafe {
CFRunLoopTimerSetNextFireDate(self.timer, CFAbsoluteTimeGetCurrent());
}
}
}

impl Drop for Timer {
Expand Down

0 comments on commit dff60d3

Please sign in to comment.