diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-12-16 16:33:50 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-12-16 16:33:50 (GMT) |
commit | 22f8312f1177e98133c31e059d6f1ae948178f37 (patch) | |
tree | e984d3f416896b6823505e01ca26920799b1134f /win/tkWinImage.c | |
parent | 871d0ab87051648f1dcc4fc86445dcde3527c7b2 (diff) | |
parent | 3dd24b804c90d0421a7200b2a2b04794887b95fa (diff) | |
download | tk-22f8312f1177e98133c31e059d6f1ae948178f37.zip tk-22f8312f1177e98133c31e059d6f1ae948178f37.tar.gz tk-22f8312f1177e98133c31e059d6f1ae948178f37.tar.bz2 |
Merge 8.7. More WIP.
Diffstat (limited to 'win/tkWinImage.c')
-rw-r--r-- | win/tkWinImage.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/win/tkWinImage.c b/win/tkWinImage.c index e1660a9..dfb72a8 100644 --- a/win/tkWinImage.c +++ b/win/tkWinImage.c @@ -212,7 +212,10 @@ XCreateImage( int bitmap_pad, int bytes_per_line) { - XImage* imagePtr = ckalloc(sizeof(XImage)); + XImage* imagePtr = (XImage*)ckalloc(sizeof(XImage)); + (void)display; + (void)visual; + imagePtr->width = width; imagePtr->height = height; imagePtr->xoffset = offset; @@ -300,6 +303,7 @@ XGetImageZPixmap( unsigned char *data; TkWinDCState state; BOOL ret; + (void)plane_mask; if (format != ZPixmap) { TkpDisplayWarning("Only ZPixmap types are implemented", @@ -350,7 +354,7 @@ XGetImageZPixmap( if (depth <= 8) { size += sizeof(unsigned short) << depth; } - bmInfo = ckalloc(size); + bmInfo = (BITMAPINFO *)ckalloc(size); bmInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmInfo->bmiHeader.biWidth = width; @@ -368,7 +372,7 @@ XGetImageZPixmap( unsigned char *p, *pend; GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_PAL_COLORS); - data = ckalloc(bmInfo->bmiHeader.biSizeImage); + data = (unsigned char *)ckalloc(bmInfo->bmiHeader.biSizeImage); if (!data) { /* printf("Failed to allocate data area for XImage.\n"); */ ret_image = NULL; @@ -404,7 +408,7 @@ XGetImageZPixmap( unsigned char *p; GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_PAL_COLORS); - data = ckalloc(bmInfo->bmiHeader.biSizeImage); + data = (unsigned char *)ckalloc(bmInfo->bmiHeader.biSizeImage); if (!data) { /* printf("Failed to allocate data area for XImage.\n"); */ ret_image = NULL; @@ -435,7 +439,7 @@ XGetImageZPixmap( } } else if (depth == 16) { GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_RGB_COLORS); - data = ckalloc(bmInfo->bmiHeader.biSizeImage); + data = (unsigned char *)ckalloc(bmInfo->bmiHeader.biSizeImage); if (!data) { /* printf("Failed to allocate data area for XImage.\n"); */ ret_image = NULL; @@ -461,7 +465,7 @@ XGetImageZPixmap( } } else { GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_RGB_COLORS); - data = ckalloc(width * height * 4); + data = (unsigned char *)ckalloc(width * height * 4); if (!data) { /* printf("Failed to allocate data area for XImage.\n"); */ ret_image = NULL; @@ -484,7 +488,7 @@ XGetImageZPixmap( unsigned int byte_width, h, w; byte_width = ((width * 3 + 3) & ~(unsigned)3); - smallBitBase = ckalloc(byte_width * height); + smallBitBase = (unsigned char *)ckalloc(byte_width * height); if (!smallBitBase) { ckfree(ret_image->data); ckfree(ret_image); @@ -614,7 +618,7 @@ XGetImage( imagePtr = XCreateImage(display, NULL, 32, format, 0, NULL, width, height, 32, 0); size = imagePtr->bytes_per_line * imagePtr->height; - imagePtr->data = ckalloc(size); + imagePtr->data = (char *)ckalloc(size); ZeroMemory(imagePtr->data, size); for (yy = 0; yy < height; yy++) { @@ -661,7 +665,7 @@ XGetImage( imagePtr = XCreateImage(display, NULL, 1, XYBitmap, 0, NULL, width, height, 32, 0); - imagePtr->data = ckalloc(imagePtr->bytes_per_line * imagePtr->height); + imagePtr->data = (char *)ckalloc(imagePtr->bytes_per_line * imagePtr->height); dc = GetDC(NULL); |