diff options
| author | nyamatongwe <nyamatongwe@gmail.com> | 2011-10-28 23:29:26 +1100 |
|---|---|---|
| committer | nyamatongwe <nyamatongwe@gmail.com> | 2011-10-28 23:29:26 +1100 |
| commit | 8fb895a3fa20892c65e975107e2f7d8922efea48 (patch) | |
| tree | a8755d99f7a46c18cd795fd0bbcd107b9a45838b /cocoa/ScintillaCocoa.mm | |
| parent | afaa74bd063cbd1e6e3f4f94c394d5a8a9d21192 (diff) | |
| download | scintilla-mirror-8fb895a3fa20892c65e975107e2f7d8922efea48.tar.gz | |
Fix warnings from Clang analyze by using single statement alloc and init.
Remove unused variables. Fix potential leak.
Diffstat (limited to 'cocoa/ScintillaCocoa.mm')
| -rw-r--r-- | cocoa/ScintillaCocoa.mm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index 7927652a7..eb3fbc50c 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -417,7 +417,7 @@ std::string ScintillaCocoa::CaseMapString(const std::string &s, int caseMapping) sMapped = [(NSString *)cfsVal lowercaseString]; break; default: - sMapped = [(NSString *)cfsVal copy]; + sMapped = (NSString *)cfsVal; } // Back to encoding @@ -782,8 +782,7 @@ void ScintillaCocoa::CreateCallTipWindow(PRectangle rc) { [callTip setLevel:NSFloatingWindowLevel]; [callTip setHasShadow:YES]; NSRect ctContent = NSMakeRect(0,0, rc.Width(), rc.Height()); - CallTipView *caption = [CallTipView alloc]; - [caption initWithFrame: ctContent]; + CallTipView *caption = [[CallTipView alloc] initWithFrame: ctContent]; [caption setAutoresizingMask: NSViewWidthSizable | NSViewMaxYMargin]; [caption setSci: this]; [[callTip contentView] addSubview: caption]; |
