summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXDraw.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXDraw.c')
-rw-r--r--macosx/tkMacOSXDraw.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index 5698a44..ec3c963 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -4,10 +4,10 @@
* This file contains functions that draw to windows. Many of thees
* functions emulate Xlib functions.
*
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright (c) 2001-2009 Apple Inc.
- * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2014-2020 Marc Culler.
+ * Copyright © 1995-1997 Sun Microsystems, Inc.
+ * Copyright © 2001-2009 Apple Inc.
+ * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright © 2014-2020 Marc Culler.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -133,7 +133,7 @@ TkMacOSXGetNSImageFromTkImage(
{
Pixmap pixmap;
NSImage *nsImage;
- if (width == 0 || height == 0) {
+ if (width <= 0 || height <= 0) {
return nsImage = [[NSImage alloc] initWithSize:NSMakeSize(0,0)];
}
pixmap = Tk_GetPixmap(display, None, width, height, 0);
@@ -175,7 +175,7 @@ TkMacOSXGetNSImageFromBitmap(
gc->background = transparentColor;
XSetClipOrigin(display, gc, 0, 0);
- XCopyPlane(display, bitmap, pixmap, gc, 0, 0, width, height, 0, 0, 1);
+ XCopyPlane(display, bitmap, pixmap, gc, 0, 0, (unsigned)width, (unsigned)height, 0, 0, 1);
gc->background = origBackground;
nsImage = CreateNSImageFromPixmap(pixmap, width, height);
Tk_FreePixmap(display, pixmap);
@@ -273,8 +273,8 @@ TkMacOSXGetCGContextForDrawable(
len = macDraw->size.height * bytesPerRow;
data = (char *)ckalloc(len);
bzero(data, len);
- macDraw->context = CGBitmapContextCreate(data, macDraw->size.width,
- macDraw->size.height, bitsPerComponent, bytesPerRow,
+ macDraw->context = CGBitmapContextCreate(data, (unsigned)macDraw->size.width,
+ (unsigned)macDraw->size.height, bitsPerComponent, bytesPerRow,
colorspace, bitmapInfo);
if (macDraw->context) {
CGContextClearRect(macDraw->context, bounds);