summaryrefslogtreecommitdiffstats
path: root/win/tkWinImage.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-08-13 21:51:23 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-08-13 21:51:23 (GMT)
commit0edc144061461b953360aecd132e523ba91f09dd (patch)
treee9c2b607fa747c61a49074514454eb483ac3ea93 /win/tkWinImage.c
parent1666bb95721c4472aec20f876e5f197d90e7628a (diff)
parentf967d5778d14a31469b8667667bcc65049c4e542 (diff)
downloadtk-0edc144061461b953360aecd132e523ba91f09dd.zip
tk-0edc144061461b953360aecd132e523ba91f09dd.tar.gz
tk-0edc144061461b953360aecd132e523ba91f09dd.tar.bz2
[Bug 3388350] mingw64 compiler warnings
Diffstat (limited to 'win/tkWinImage.c')
-rw-r--r--win/tkWinImage.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/win/tkWinImage.c b/win/tkWinImage.c
index d6a6d73..8e6ef38 100644
--- a/win/tkWinImage.c
+++ b/win/tkWinImage.c
@@ -68,7 +68,7 @@ ImageGetPixel(
int x, int y)
{
unsigned long pixel = 0;
- unsigned char *srcPtr = &(image->data[(y * image->bytes_per_line)
+ unsigned char *srcPtr = (unsigned char *) &(image->data[(y * image->bytes_per_line)
+ ((x * image->bits_per_pixel) / NBBY)]);
switch (image->bits_per_pixel) {
@@ -116,7 +116,7 @@ PutPixel(
int x, int y,
unsigned long pixel)
{
- unsigned char *destPtr = &(image->data[(y * image->bytes_per_line)
+ unsigned char *destPtr = (unsigned char *) &(image->data[(y * image->bytes_per_line)
+ ((x * image->bits_per_pixel) / NBBY)]);
switch (image->bits_per_pixel) {
@@ -368,16 +368,16 @@ 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;
goto cleanup;
}
- ret_image = XCreateImage(display, NULL, depth, ZPixmap, 0, data,
+ ret_image = XCreateImage(display, NULL, depth, ZPixmap, 0, (char *)data,
width, height, 32, (int) ((width + 31) >> 3) & ~1);
if (ret_image == NULL) {
- ckfree(data);
+ ckfree((char *)data);
goto cleanup;
}
@@ -404,13 +404,13 @@ 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;
goto cleanup;
}
- ret_image = XCreateImage(display, NULL, 8, ZPixmap, 0, data,
+ ret_image = XCreateImage(display, NULL, 8, ZPixmap, 0, (char *)data,
width, height, 8, (int) width);
if (ret_image == NULL) {
ckfree((char *) data);
@@ -435,13 +435,13 @@ 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;
goto cleanup;
}
- ret_image = XCreateImage(display, NULL, 16, ZPixmap, 0, data,
+ ret_image = XCreateImage(display, NULL, 16, ZPixmap, 0, (char *) data,
width, height, 16, 0 /* will be calc'ed from bitmap_pad */);
if (ret_image == NULL) {
ckfree((char *) data);
@@ -461,13 +461,13 @@ 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;
goto cleanup;
}
- ret_image = XCreateImage(display, NULL, 32, ZPixmap, 0, data,
+ ret_image = XCreateImage(display, NULL, 32, ZPixmap, 0, (char *) data,
width, height, 0, (int) width * 4);
if (ret_image == NULL) {
ckfree((char *) data);
@@ -484,7 +484,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((char *) ret_image->data);
ckfree((char *) ret_image);
@@ -511,7 +511,7 @@ XGetImageZPixmap(
*/
for (h = 0; h < height; h++) {
- bigBitData = ret_image->data + h * ret_image->bytes_per_line;
+ bigBitData = (unsigned char *) (ret_image->data + h * ret_image->bytes_per_line);
smallBitData = smallBitBase + h * byte_width;
for (w = 0; w < width; w++) {