diff options
author | nyamatongwe <nyamatongwe@gmail.com> | 2011-11-14 14:27:34 +1100 |
---|---|---|
committer | nyamatongwe <nyamatongwe@gmail.com> | 2011-11-14 14:27:34 +1100 |
commit | 41a9f1b9d84ecad403798967fb1728043984f466 (patch) | |
tree | c14d5e220cc3a35dbce8790e93c4f989c3f862cb | |
parent | b528166ba492b12be6779e7f0c77586e35778204 (diff) | |
download | scintilla-mirror-41a9f1b9d84ecad403798967fb1728043984f466.tar.gz |
Use fields to hold NSTimer pointers to avoid warnings from Analyze.
Does not change behaviour.
-rw-r--r-- | cocoa/ScintillaCocoa.h | 3 | ||||
-rw-r--r-- | cocoa/ScintillaCocoa.mm | 21 |
2 files changed, 13 insertions, 11 deletions
diff --git a/cocoa/ScintillaCocoa.h b/cocoa/ScintillaCocoa.h index 58cc66b88..5ee1f149f 100644 --- a/cocoa/ScintillaCocoa.h +++ b/cocoa/ScintillaCocoa.h @@ -116,6 +116,9 @@ private: int scrollSpeed; int scrollTicks; + NSTimer* tickTimer; + NSTimer* idleTimer; + protected: PRectangle GetClientRectangle(); Point ConvertPoint(NSPoint point); diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index ccaa384f7..e7beda69b 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -583,12 +583,11 @@ void ScintillaCocoa::SetTicking(bool on) if (timer.ticking) { // Scintilla ticks = milliseconds - // Using userInfo as flag to distinct between tick and idle timer. - NSTimer* tickTimer = [NSTimer scheduledTimerWithTimeInterval: timer.tickSize / 1000.0 - target: timerTarget - selector: @selector(timerFired:) - userInfo: nil - repeats: YES]; + tickTimer = [NSTimer scheduledTimerWithTimeInterval: timer.tickSize / 1000.0 + target: timerTarget + selector: @selector(timerFired:) + userInfo: nil + repeats: YES]; timer.tickerID = reinterpret_cast<TickerID>(tickTimer); } else @@ -611,11 +610,11 @@ bool ScintillaCocoa::SetIdle(bool on) if (idler.state) { // Scintilla ticks = milliseconds - NSTimer* idleTimer = [NSTimer scheduledTimerWithTimeInterval: timer.tickSize / 1000.0 - target: timerTarget - selector: @selector(idleTimerFired:) - userInfo: nil - repeats: YES]; + idleTimer = [NSTimer scheduledTimerWithTimeInterval: timer.tickSize / 1000.0 + target: timerTarget + selector: @selector(idleTimerFired:) + userInfo: nil + repeats: YES]; idler.idlerID = reinterpret_cast<IdlerID>(idleTimer); } else |