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)
commit8ef38a7e1335498220c1dad6109c3f035f878ffa (patch)
treee9c2b607fa747c61a49074514454eb483ac3ea93 /win/tkWinImage.c
parentb8d8c08583edeba5c3f7b6bce2e13c60c2323c47 (diff)
parent52482ab5023994148201c6b4e71c40b62809b205 (diff)
downloadtk-8ef38a7e1335498220c1dad6109c3f035f878ffa.zip
tk-8ef38a7e1335498220c1dad6109c3f035f878ffa.tar.gz
tk-8ef38a7e1335498220c1dad6109c3f035f878ffa.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++) {