summaryrefslogtreecommitdiff
path: root/src/nsimage.m
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2017-05-20 16:36:24 +0200
committerPhilipp Stephani <phst@google.com>2017-05-21 21:49:09 +0200
commit84b28ec759ed3d294c2f49353942ae76e0c75532 (patch)
tree2f562d459878de7c76b03bcb62bf87ca555f0e79 /src/nsimage.m
parent08212929ba7052883bd506be320dfaaae5b68970 (diff)
downloademacs-84b28ec759ed3d294c2f49353942ae76e0c75532.tar.gz
Nextstep: Use instancetype explicit return type
This removes compiler warnings on macOS and improves type safety. * nsterm.m (initFrameFromEmacs:): (menuDown:): (toolbarClicked:): (toggleToolbar:): (setMiniwindowImage:): (initFrame:window:): (condemn, reprieve, setPosition:portion:whole:): (repeatScroll:): * nsmenu.m (initWithTitle:): (initWithTitle:frame:): (initForView:withIdentifier:): (init, initWithContentRect:styleMask:backing:defer:): (initFromContents:isQuestion:): * nsimage.m (allocInitFromFile:): (initFromXBM:width:height:fg:bg:): (setXBMColor:): (initForXPMWithDepth:width:height:): Use instancetype as return type instead of implicit id.
Diffstat (limited to 'src/nsimage.m')
-rw-r--r--src/nsimage.m8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nsimage.m b/src/nsimage.m
index e87da77ccf1..1c82fa780a0 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -152,7 +152,7 @@ ns_set_alpha (void *img, int x, int y, unsigned char a)
@implementation EmacsImage
-+ allocInitFromFile: (Lisp_Object)file
++ (instancetype)allocInitFromFile: (Lisp_Object)file
{
NSImageRep *imgRep;
Lisp_Object found;
@@ -197,7 +197,7 @@ ns_set_alpha (void *img, int x, int y, unsigned char a)
/* Create image from monochrome bitmap. If both FG and BG are 0
(black), set the background to white and make it transparent. */
-- initFromXBM: (unsigned char *)bits width: (int)w height: (int)h
+- (instancetype)initFromXBM: (unsigned char *)bits width: (int)w height: (int)h
fg: (unsigned long)fg bg: (unsigned long)bg
{
unsigned char *planes[5];
@@ -269,7 +269,7 @@ ns_set_alpha (void *img, int x, int y, unsigned char a)
}
/* Set color for a bitmap image. */
-- setXBMColor: (NSColor *)color
+- (instancetype)setXBMColor: (NSColor *)color
{
NSSize s = [self size];
unsigned char *planes[5];
@@ -309,7 +309,7 @@ ns_set_alpha (void *img, int x, int y, unsigned char a)
}
-- initForXPMWithDepth: (int)depth width: (int)width height: (int)height
+- (instancetype)initForXPMWithDepth: (int)depth width: (int)width height: (int)height
{
NSSize s = {width, height};
int i;