diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-05-04 09:06:02 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-05-04 09:06:02 (GMT) |
commit | e90c3f6d3a2bec9a074ebbbac695bda5557c6df5 (patch) | |
tree | f3b4762703c67daadfd224044575694214c6c0f5 /macosx | |
parent | efedcb7679d2e241e5b02315e780b47e67655a74 (diff) | |
download | tk-e90c3f6d3a2bec9a074ebbbac695bda5557c6df5.zip tk-e90c3f6d3a2bec9a074ebbbac695bda5557c6df5.tar.gz tk-e90c3f6d3a2bec9a074ebbbac695bda5557c6df5.tar.bz2 |
uint32 -> uint32_t, more TCL_UNUSED() and typecasts
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXImage.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index 1d9a50c..0ec2031 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -4,7 +4,7 @@ * The code in this file provides an interface for XImages, * * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. + * Copyright (c) 2001-2009, Apple Inc. * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net> * Copyright (c) 2017-2020 Marc Culler. * @@ -23,7 +23,7 @@ static CGImageRef CreateCGImageFromDrawableRect( Drawable drawable, int _XInitImageFuncPtrs( - XImage *image) + TCL_UNUSED(XImage *)) /* image */ { return 0; } @@ -45,14 +45,18 @@ _XInitImageFuncPtrs( *---------------------------------------------------------------------- */ -static void ReleaseData(void *info, const void *data, size_t size) { +static void ReleaseData( + void *info, + TCL_UNUSED(const void *), /* data */ + TCL_UNUSED(size_t)) /* size */ +{ ckfree(info); } CGImageRef TkMacOSXCreateCGImageWithXImage( XImage *image, - uint32 alphaInfo) + uint32_t alphaInfo) { CGImageRef img = NULL; size_t bitsPerComponent, bitsPerPixel; @@ -77,7 +81,7 @@ TkMacOSXCreateCGImageWithXImage( if (image->bitmap_bit_order != MSBFirst) { char *srcPtr = image->data + image->xoffset; char *endPtr = srcPtr + len; - char *destPtr = (data = ckalloc(len)); + char *destPtr = (data = (char *)ckalloc(len)); while (srcPtr < endPtr) { *destPtr++ = xBitReverseTable[(unsigned char)(*(srcPtr++))]; @@ -322,7 +326,7 @@ ImagePutPixel( XImage * XCreateImage( Display* display, - Visual* visual, + TCL_UNUSED(Visual*), /* visual */ unsigned int depth, int format, int offset, @@ -570,13 +574,13 @@ CreateCGImageFromDrawableRect( return NULL; } NSSize size = view.frame.size; - NSUInteger width = size.width, height = size.height; + NSUInteger view_width = size.width, view_height = size.height; NSUInteger bytesPerPixel = 4, - bytesPerRow = bytesPerPixel * width, + bytesPerRow = bytesPerPixel * view_width, bitsPerComponent = 8; - imageData = ckalloc(height * bytesPerRow); + imageData = ckalloc(view_height * bytesPerRow); CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - cg_context = CGBitmapContextCreate(imageData, width, height, + cg_context = CGBitmapContextCreate(imageData, view_width, view_height, bitsPerComponent, bytesPerRow, colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); CFRelease(colorSpace); @@ -657,7 +661,7 @@ XGetImage( int y, unsigned int width, unsigned int height, - unsigned long plane_mask, + TCL_UNUSED(unsigned long), /* plane_mask */ int format) { NSBitmapImageRep* bitmapRep = nil; |