diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2019-06-16 09:21:30 +1000 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2019-06-16 09:21:30 +1000 |
commit | 5f73e5a7cdd14ff8d6a17874ccd3fa39bad0bdce (patch) | |
tree | 751227042cd7ba5a58b9cd8c0264a71c83303cf0 | |
parent | ae703a47e6ad96c83376f4958f2fafee8135735f (diff) | |
download | scintilla-mirror-5f73e5a7cdd14ff8d6a17874ccd3fa39bad0bdce.tar.gz |
Fix Xcode static analysis warning by renmaing GetImage to CreateImage.
A naming convention is used by the analyzer where a "Create" prefix is used when
the reference is owned by the caller and a "Get" prefix when the reference is
not owned so should not be released.
-rw-r--r-- | cocoa/PlatCocoa.h | 2 | ||||
-rw-r--r-- | cocoa/PlatCocoa.mm | 12 | ||||
-rw-r--r-- | cocoa/ScintillaCocoa.mm | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/cocoa/PlatCocoa.h b/cocoa/PlatCocoa.h index 7a2c578e9..7dbc32487 100644 --- a/cocoa/PlatCocoa.h +++ b/cocoa/PlatCocoa.h @@ -80,7 +80,7 @@ public: void PenColour(ColourDesired fore) override; /** Returns a CGImageRef that represents the surface. Returns NULL if this is not possible. */ - CGImageRef GetImage(); + CGImageRef CreateImage(); void CopyImageRectangle(Surface &surfaceSource, PRectangle srcRect, PRectangle dstRect); int LogPixelsY() override; diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 9b73b3dcf..71c078bab 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -483,8 +483,8 @@ void SurfaceImpl::FillColour(const ColourDesired &back) { //-------------------------------------------------------------------------------------------------- -CGImageRef SurfaceImpl::GetImage() { - // For now, assume that GetImage can only be called on PixMap surfaces. +CGImageRef SurfaceImpl::CreateImage() { + // For now, assume that CreateImage can only be called on PixMap surfaces. if (!bitmapData) return NULL; @@ -655,7 +655,7 @@ void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) { SurfaceImpl &patternSurface = static_cast<SurfaceImpl &>(surfacePattern); // For now, assume that copy can only be called on PixMap surfaces. Shows up black. - CGImageRef image = patternSurface.GetImage(); + CGImageRef image = patternSurface.CreateImage(); if (image == NULL) { FillRectangle(rc, ColourDesired(0)); return; @@ -970,7 +970,7 @@ void SurfaceImpl::Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back) void SurfaceImpl::CopyImageRectangle(Surface &surfaceSource, PRectangle srcRect, PRectangle dstRect) { SurfaceImpl &source = static_cast<SurfaceImpl &>(surfaceSource); - CGImageRef image = source.GetImage(); + CGImageRef image = source.CreateImage(); CGRect src = PRectangleToCGRect(srcRect); CGRect dst = PRectangleToCGRect(dstRect); @@ -1002,7 +1002,7 @@ void SurfaceImpl::Copy(PRectangle rc, Scintilla::Point from, Surface &surfaceSou SurfaceImpl &source = static_cast<SurfaceImpl &>(surfaceSource); // Get the CGImageRef - CGImageRef image = source.GetImage(); + CGImageRef image = source.CreateImage(); // If we could not get an image reference, fill the rectangle black if (image == NULL) { FillRectangle(rc, ColourDesired(0)); @@ -1471,7 +1471,7 @@ static NSImage *ImageFromXPM(XPM *pxpm) { SurfaceImpl *surfaceIXPM = static_cast<SurfaceImpl *>(surfaceXPM.get()); CGContextClearRect(surfaceIXPM->GetContext(), CGRectMake(0, 0, width, height)); pxpm->Draw(surfaceXPM.get(), rcxpm); - CGImageRef imageRef = surfaceIXPM->GetImage(); + CGImageRef imageRef = surfaceIXPM->CreateImage(); img = [[NSImage alloc] initWithCGImage: imageRef size: NSZeroSize]; CGImageRelease(imageRef); } diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index ffb365d13..9a507e55c 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -1409,7 +1409,7 @@ void ScintillaCocoa::StartDrag() { // the full rectangle which may include non-selected text. NSBitmapImageRep *bitmap = NULL; - CGImageRef imagePixmap = pixmap.GetImage(); + CGImageRef imagePixmap = pixmap.CreateImage(); if (imagePixmap) bitmap = [[NSBitmapImageRep alloc] initWithCGImage: imagePixmap]; CGImageRelease(imagePixmap); |