summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-01-11 15:35:39 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-01-11 15:35:39 (GMT)
commita7b45de808c4bca805fab7b4eb90aa6e6f09e2ac (patch)
tree9afda096b9165b4f20fb70975876d2bf0c1c2c29 /win
parenta46a8df372318c40d2d0c346578eef7412a7b257 (diff)
downloadtk-a7b45de808c4bca805fab7b4eb90aa6e6f09e2ac.zip
tk-a7b45de808c4bca805fab7b4eb90aa6e6f09e2ac.tar.gz
tk-a7b45de808c4bca805fab7b4eb90aa6e6f09e2ac.tar.bz2
Many minute fixes to reduce number of minor warnings from GCC.
Diffstat (limited to 'win')
-rw-r--r--win/tkWinButton.c19
-rw-r--r--win/tkWinClipboard.c14
-rw-r--r--win/tkWinColor.c56
-rw-r--r--win/tkWinDialog.c4
-rw-r--r--win/tkWinDraw.c53
-rw-r--r--win/tkWinFont.c21
-rw-r--r--win/tkWinImage.c21
-rw-r--r--win/tkWinMenu.c33
-rw-r--r--win/tkWinPixmap.c4
-rw-r--r--win/tkWinRegion.c5
-rw-r--r--win/tkWinSend.c32
-rw-r--r--win/tkWinWindow.c13
-rw-r--r--win/tkWinWm.c45
-rw-r--r--win/tkWinX.c24
-rw-r--r--win/ttkWinMonitor.c12
-rw-r--r--win/ttkWinTheme.c22
-rw-r--r--win/ttkWinXPTheme.c4
17 files changed, 203 insertions, 179 deletions
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index c79aff8..7a1ed35 100644
--- a/win/tkWinButton.c
+++ b/win/tkWinButton.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinButton.c,v 1.30 2006/12/19 19:51:06 hobbs Exp $
+ * RCS: @(#) $Id: tkWinButton.c,v 1.31 2007/01/11 15:35:40 dkf Exp $
*/
#define OEMRESOURCE
@@ -725,9 +725,10 @@ TkpDisplayButton(
border, TK_3D_FLAT_GC));
dc = TkWinGetDrawableDC(butPtr->display, pixmap, &state);
- StretchDIBits(dc, x, y, tsdPtr->boxWidth, tsdPtr->boxHeight, xSrc,
- ySrc, tsdPtr->boxWidth, tsdPtr->boxHeight, tsdPtr->boxesBits,
- (LPBITMAPINFO) tsdPtr->boxesPtr, DIB_RGB_COLORS, SRCCOPY);
+ StretchDIBits(dc, x, y, (int)tsdPtr->boxWidth, (int)tsdPtr->boxHeight,
+ xSrc, ySrc, (int)tsdPtr->boxWidth, (int)tsdPtr->boxHeight,
+ tsdPtr->boxesBits, (LPBITMAPINFO) tsdPtr->boxesPtr,
+ DIB_RGB_COLORS, SRCCOPY);
TkWinReleaseDrawableDC(pixmap, dc, &state);
}
@@ -781,15 +782,15 @@ TkpDisplayButton(
if (defaultWidth != 0) {
dc = TkWinGetDrawableDC(butPtr->display, pixmap, &state);
TkWinFillRect(dc, 0, 0, Tk_Width(tkwin), defaultWidth,
- butPtr->highlightColorPtr->pixel);
+ (int) butPtr->highlightColorPtr->pixel);
TkWinFillRect(dc, 0, 0, defaultWidth, Tk_Height(tkwin),
- butPtr->highlightColorPtr->pixel);
+ (int) butPtr->highlightColorPtr->pixel);
TkWinFillRect(dc, 0, Tk_Height(tkwin) - defaultWidth,
Tk_Width(tkwin), defaultWidth,
- butPtr->highlightColorPtr->pixel);
+ (int) butPtr->highlightColorPtr->pixel);
TkWinFillRect(dc, Tk_Width(tkwin) - defaultWidth, 0,
defaultWidth, Tk_Height(tkwin),
- butPtr->highlightColorPtr->pixel);
+ (int) butPtr->highlightColorPtr->pixel);
TkWinReleaseDrawableDC(pixmap, dc, &state);
}
@@ -1083,6 +1084,8 @@ TkpComputeButtonGeometry(
height = imgHeight;
}
break;
+ case COMPOUND_NONE:
+ break;
} /* switch */
/*
diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c
index bb91f4d..093280c 100644
--- a/win/tkWinClipboard.c
+++ b/win/tkWinClipboard.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinClipboard.c,v 1.8 2005/12/02 00:19:04 dkf Exp $
+ * RCS: @(#) $Id: tkWinClipboard.c,v 1.9 2007/01/11 15:35:40 dkf Exp $
*/
#include "tkWinInt.h"
@@ -275,7 +275,7 @@ TkWinClipboardRender(
* Copy the data and change EOL characters.
*/
- buffer = rawText = ckalloc(length + 1);
+ buffer = rawText = ckalloc((unsigned)length + 1);
if (targetPtr != NULL) {
for (cbPtr = targetPtr->firstBufferPtr; cbPtr != NULL;
cbPtr = cbPtr->nextPtr) {
@@ -300,13 +300,14 @@ TkWinClipboardRender(
Tcl_UtfToUniCharDString(rawText, -1, &ds);
ckfree(rawText);
handle = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE,
- Tcl_DStringLength(&ds)+2);
+ (unsigned) Tcl_DStringLength(&ds) + 2);
if (!handle) {
Tcl_DStringFree(&ds);
return;
}
buffer = GlobalLock(handle);
- memcpy(buffer, Tcl_DStringValue(&ds), Tcl_DStringLength(&ds) + 2);
+ memcpy(buffer, Tcl_DStringValue(&ds),
+ (unsigned) Tcl_DStringLength(&ds) + 2);
GlobalUnlock(handle);
Tcl_DStringFree(&ds);
SetClipboardData(CF_UNICODETEXT, handle);
@@ -314,13 +315,14 @@ TkWinClipboardRender(
Tcl_UtfToExternalDString(NULL, rawText, -1, &ds);
ckfree(rawText);
handle = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE,
- Tcl_DStringLength(&ds)+1);
+ (unsigned) Tcl_DStringLength(&ds) + 1);
if (!handle) {
Tcl_DStringFree(&ds);
return;
}
buffer = GlobalLock(handle);
- memcpy(buffer, Tcl_DStringValue(&ds), Tcl_DStringLength(&ds) + 1);
+ memcpy(buffer, Tcl_DStringValue(&ds),
+ (unsigned) Tcl_DStringLength(&ds) + 1);
GlobalUnlock(handle);
Tcl_DStringFree(&ds);
SetClipboardData(CF_TEXT, handle);
diff --git a/win/tkWinColor.c b/win/tkWinColor.c
index 911a4d1..1972695 100644
--- a/win/tkWinColor.c
+++ b/win/tkWinColor.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinColor.c,v 1.10 2005/12/02 13:42:29 dkf Exp $
+ * RCS: @(#) $Id: tkWinColor.c,v 1.11 2007/01/11 15:35:40 dkf Exp $
*/
#include "tkWinInt.h"
@@ -38,33 +38,33 @@ typedef struct {
} SystemColorEntry;
static SystemColorEntry sysColors[] = {
- "3dDarkShadow", COLOR_3DDKSHADOW,
- "3dLight", COLOR_3DLIGHT,
- "ActiveBorder", COLOR_ACTIVEBORDER,
- "ActiveCaption", COLOR_ACTIVECAPTION,
- "AppWorkspace", COLOR_APPWORKSPACE,
- "Background", COLOR_BACKGROUND,
- "ButtonFace", COLOR_BTNFACE,
- "ButtonHighlight", COLOR_BTNHIGHLIGHT,
- "ButtonShadow", COLOR_BTNSHADOW,
- "ButtonText", COLOR_BTNTEXT,
- "CaptionText", COLOR_CAPTIONTEXT,
- "DisabledText", COLOR_GRAYTEXT,
- "GrayText", COLOR_GRAYTEXT,
- "Highlight", COLOR_HIGHLIGHT,
- "HighlightText", COLOR_HIGHLIGHTTEXT,
- "InactiveBorder", COLOR_INACTIVEBORDER,
- "InactiveCaption", COLOR_INACTIVECAPTION,
- "InactiveCaptionText", COLOR_INACTIVECAPTIONTEXT,
- "InfoBackground", COLOR_INFOBK,
- "InfoText", COLOR_INFOTEXT,
- "Menu", COLOR_MENU,
- "MenuText", COLOR_MENUTEXT,
- "Scrollbar", COLOR_SCROLLBAR,
- "Window", COLOR_WINDOW,
- "WindowFrame", COLOR_WINDOWFRAME,
- "WindowText", COLOR_WINDOWTEXT,
- NULL, 0
+ {"3dDarkShadow", COLOR_3DDKSHADOW},
+ {"3dLight", COLOR_3DLIGHT},
+ {"ActiveBorder", COLOR_ACTIVEBORDER},
+ {"ActiveCaption", COLOR_ACTIVECAPTION},
+ {"AppWorkspace", COLOR_APPWORKSPACE},
+ {"Background", COLOR_BACKGROUND},
+ {"ButtonFace", COLOR_BTNFACE},
+ {"ButtonHighlight", COLOR_BTNHIGHLIGHT},
+ {"ButtonShadow", COLOR_BTNSHADOW},
+ {"ButtonText", COLOR_BTNTEXT},
+ {"CaptionText", COLOR_CAPTIONTEXT},
+ {"DisabledText", COLOR_GRAYTEXT},
+ {"GrayText", COLOR_GRAYTEXT},
+ {"Highlight", COLOR_HIGHLIGHT},
+ {"HighlightText", COLOR_HIGHLIGHTTEXT},
+ {"InactiveBorder", COLOR_INACTIVEBORDER},
+ {"InactiveCaption", COLOR_INACTIVECAPTION},
+ {"InactiveCaptionText", COLOR_INACTIVECAPTIONTEXT},
+ {"InfoBackground", COLOR_INFOBK},
+ {"InfoText", COLOR_INFOTEXT},
+ {"Menu", COLOR_MENU},
+ {"MenuText", COLOR_MENUTEXT},
+ {"Scrollbar", COLOR_SCROLLBAR},
+ {"Window", COLOR_WINDOW},
+ {"WindowFrame", COLOR_WINDOWFRAME},
+ {"WindowText", COLOR_WINDOWTEXT},
+ {NULL, 0}
};
typedef struct ThreadSpecificData {
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 9183f20..1da6aae 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinDialog.c,v 1.43 2005/12/02 00:19:04 dkf Exp $
+ * RCS: @(#) $Id: tkWinDialog.c,v 1.44 2007/01/11 15:35:40 dkf Exp $
*
*/
@@ -1460,7 +1460,7 @@ MakeFilter(
if (valuePtr == NULL) {
len = 0;
} else {
- CONST char* string = Tcl_GetStringFromObj(valuePtr, &len);
+ (void) Tcl_GetStringFromObj(valuePtr, &len);
}
/*
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c
index d351a0f..8c736ab 100644
--- a/win/tkWinDraw.c
+++ b/win/tkWinDraw.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinDraw.c,v 1.17 2005/12/02 13:42:29 dkf Exp $
+ * RCS: @(#) $Id: tkWinDraw.c,v 1.18 2007/01/11 15:35:40 dkf Exp $
*/
#include "tkWinInt.h"
@@ -325,8 +325,8 @@ XCopyArea(
OffsetClipRgn(destDC, gc->clip_x_origin, gc->clip_y_origin);
}
- BitBlt(destDC, dest_x, dest_y, width, height, srcDC, src_x, src_y,
- tkpWinBltModes[gc->function]);
+ BitBlt(destDC, dest_x, dest_y, (int) width, (int) height, srcDC,
+ src_x, src_y, (DWORD) tkpWinBltModes[gc->function]);
SelectClipRgn(destDC, NULL);
@@ -399,8 +399,8 @@ XCopyPlane(
SetBkMode(destDC, OPAQUE);
SetBkColor(destDC, gc->foreground);
SetTextColor(destDC, gc->background);
- BitBlt(destDC, dest_x, dest_y, width, height, srcDC, src_x, src_y,
- SRCCOPY);
+ BitBlt(destDC, dest_x, dest_y, (int) width, (int) height, srcDC,
+ src_x, src_y, SRCCOPY);
SelectClipRgn(destDC, NULL);
} else if (clipPtr->type == TKP_CLIP_PIXMAP) {
@@ -414,8 +414,8 @@ XCopyPlane(
fgBrush = CreateSolidBrush(gc->foreground);
oldBrush = SelectObject(destDC, fgBrush);
- BitBlt(destDC, dest_x, dest_y, width, height, srcDC, src_x, src_y,
- MASKPAT);
+ BitBlt(destDC, dest_x, dest_y, (int) width, (int) height, srcDC,
+ src_x, src_y, MASKPAT);
SelectObject(destDC, oldBrush);
DeleteObject(fgBrush);
} else {
@@ -435,7 +435,7 @@ XCopyPlane(
maskDC = TkWinGetDrawableDC(display, clipPtr->value.pixmap,
&maskState);
memDC = CreateCompatibleDC(destDC);
- bitmap = CreateBitmap(width, height, 1, 1, NULL);
+ bitmap = CreateBitmap((int) width, (int) height, 1, 1, NULL);
SelectObject(memDC, bitmap);
/*
@@ -444,27 +444,28 @@ XCopyPlane(
* destination.
*/
- BitBlt(memDC, 0, 0, width, height, srcDC, src_x, src_y, SRCCOPY);
- BitBlt(memDC, 0, 0, width, height, maskDC,
+ BitBlt(memDC, 0, 0, (int) width, (int) height, srcDC, src_x, src_y,
+ SRCCOPY);
+ BitBlt(memDC, 0, 0, (int) width, (int) height, maskDC,
dest_x - gc->clip_x_origin, dest_y - gc->clip_y_origin,
SRCAND);
oldBrush = SelectObject(destDC, fgBrush);
- BitBlt(destDC, dest_x, dest_y, width, height, memDC, 0, 0,
- MASKPAT);
+ BitBlt(destDC, dest_x, dest_y, (int) width, (int) height, memDC,
+ 0, 0, MASKPAT);
/*
* Set background bits. Same as foreground, except we use ((NOT
* source) AND mask) and the background brush.
*/
- BitBlt(memDC, 0, 0, width, height, srcDC, src_x, src_y,
+ BitBlt(memDC, 0, 0, (int) width, (int) height, srcDC, src_x, src_y,
NOTSRCCOPY);
- BitBlt(memDC, 0, 0, width, height, maskDC,
+ BitBlt(memDC, 0, 0, (int) width, (int) height, maskDC,
dest_x - gc->clip_x_origin, dest_y - gc->clip_y_origin,
SRCAND);
SelectObject(destDC, bgBrush);
- BitBlt(destDC, dest_x, dest_y, width, height, memDC, 0, 0,
- MASKPAT);
+ BitBlt(destDC, dest_x, dest_y, (int) width, (int) height, memDC,
+ 0, 0, MASKPAT);
TkWinReleaseDrawableDC(clipPtr->value.pixmap, maskDC, &maskState);
SelectObject(destDC, oldBrush);
@@ -589,7 +590,8 @@ TkPutImage(
return;
}
bitmap = SelectObject(dcMem, bitmap);
- BitBlt(dc, dest_x, dest_y, width, height, dcMem, src_x, src_y, SRCCOPY);
+ BitBlt(dc, dest_x, dest_y, (int) width, (int) height, dcMem, src_x, src_y,
+ SRCCOPY);
DeleteObject(SelectObject(dcMem, bitmap));
DeleteDC(dcMem);
TkWinReleaseDrawableDC(d, dc, &state);
@@ -972,7 +974,7 @@ XDrawRectangle(
oldBrush = SelectObject(dc, GetStockObject(NULL_BRUSH));
SetROP2(dc, tkpWinRopModes[gc->function]);
- Rectangle(dc, x, y, x+width+1, y+height+1);
+ Rectangle(dc, x, y, (int) x+width+1, (int) y+height+1);
DeleteObject(SelectObject(dc, oldPen));
SelectObject(dc, oldBrush);
@@ -1133,14 +1135,17 @@ DrawOrFillArc(
*/
SetBkMode(dc, TRANSPARENT);
- Arc(dc, x, y, x+width+1, y+height+1, xstart, ystart, xend, yend);
+ Arc(dc, x, y, (int) (x+width+1), (int) (y+height+1), xstart, ystart,
+ xend, yend);
} else {
brush = CreateSolidBrush(gc->foreground);
oldBrush = SelectObject(dc, brush);
if (gc->arc_mode == ArcChord) {
- Chord(dc, x, y, x+width+1, y+height+1, xstart, ystart, xend, yend);
- } else if ( gc->arc_mode == ArcPieSlice ) {
- Pie(dc, x, y, x+width+1, y+height+1, xstart, ystart, xend, yend);
+ Chord(dc, x, y, (int) (x+width+1), (int) (y+height+1),
+ xstart, ystart, xend, yend);
+ } else if (gc->arc_mode == ArcPieSlice) {
+ Pie(dc, x, y, (int) (x+width+1), (int) (y+height+1),
+ xstart, ystart, xend, yend);
}
DeleteObject(SelectObject(dc, oldBrush));
}
@@ -1197,7 +1202,7 @@ SetUpGraphicsPort(
style = PS_SOLID;
}
if (gc->line_width < 2) {
- return CreatePen(style, gc->line_width, gc->foreground);
+ return CreatePen((int) style, gc->line_width, gc->foreground);
} else {
LOGBRUSH lb;
@@ -1229,7 +1234,7 @@ SetUpGraphicsPort(
style |= PS_JOIN_BEVEL;
break;
}
- return ExtCreatePen(style, gc->line_width, &lb, 0, NULL);
+ return ExtCreatePen(style, (DWORD) gc->line_width, &lb, 0, NULL);
}
}
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index 564471d..7ae3db7 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinFont.c,v 1.28 2006/12/01 20:14:24 kennykb Exp $
+ * RCS: @(#) $Id: tkWinFont.c,v 1.29 2007/01/11 15:35:40 dkf Exp $
*/
#include "tkWinInt.h"
@@ -1047,7 +1047,7 @@ Tk_DrawChars(
MultiFontTextOut(dcMem, fontPtr, source, numBytes, 0, tm.tmAscent);
BitBlt(dc, x, y - tm.tmAscent, size.cx, size.cy, dcMem,
- 0, 0, tkpWinBltModes[gc->function]);
+ 0, 0, (DWORD) tkpWinBltModes[gc->function]);
/*
* Destroy the temporary bitmap and restore the device context.
@@ -2463,7 +2463,8 @@ LoadFontRanges(
}
for (i = 0; i < cmapTable.numTables; i++) {
offset = sizeof(cmapTable) + i * sizeof(encTable);
- GetFontData(hdc, cmapKey, offset, &encTable, sizeof(encTable));
+ GetFontData(hdc, cmapKey, (DWORD) offset, &encTable,
+ sizeof(encTable));
if (swapped) {
SwapShort(&encTable.platform);
SwapShort(&encTable.encoding);
@@ -2482,7 +2483,7 @@ LoadFontRanges(
continue;
}
- GetFontData(hdc, cmapKey, encTable.offset, &subTable,
+ GetFontData(hdc, cmapKey, (DWORD) encTable.offset, &subTable,
sizeof(subTable));
if (swapped) {
SwapShort(&subTable.any.format);
@@ -2494,13 +2495,13 @@ LoadFontRanges(
segCount = subTable.segment.segCountX2 / 2;
cbData = segCount * sizeof(USHORT);
- startCount = (USHORT *) ckalloc(cbData);
- endCount = (USHORT *) ckalloc(cbData);
+ startCount = (USHORT *) ckalloc((unsigned)cbData);
+ endCount = (USHORT *) ckalloc((unsigned)cbData);
offset = encTable.offset + sizeof(subTable.segment);
- GetFontData(hdc, cmapKey, offset, endCount, cbData);
+ GetFontData(hdc, cmapKey, (DWORD) offset, endCount, cbData);
offset += cbData + sizeof(USHORT);
- GetFontData(hdc, cmapKey, offset, startCount, cbData);
+ GetFontData(hdc, cmapKey, (DWORD) offset, startCount, cbData);
if (swapped) {
for (i = 0; i < segCount; i++) {
SwapShort(&endCount[i]);
@@ -2538,8 +2539,8 @@ LoadFontRanges(
segCount = 1;
cbData = segCount * sizeof(USHORT);
- startCount = (USHORT *) ckalloc(cbData);
- endCount = (USHORT *) ckalloc(cbData);
+ startCount = (USHORT *) ckalloc((unsigned) cbData);
+ endCount = (USHORT *) ckalloc((unsigned) cbData);
startCount[0] = 0x0000;
endCount[0] = 0x00ff;
}
diff --git a/win/tkWinImage.c b/win/tkWinImage.c
index e07fcdf..dbced49 100644
--- a/win/tkWinImage.c
+++ b/win/tkWinImage.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinImage.c,v 1.9 2005/12/02 00:19:04 dkf Exp $
+ * RCS: @(#) $Id: tkWinImage.c,v 1.10 2007/01/11 15:35:40 dkf Exp $
*/
#include "tkWinInt.h"
@@ -315,7 +315,7 @@ XGetImageZPixmap(
* Need to do a Blt operation to copy into a new bitmap.
*/
- hbmp = CreateCompatibleBitmap(hdc, width, height);
+ hbmp = CreateCompatibleBitmap(hdc, (int) width, (int) height);
hdcMem = CreateCompatibleDC(hdc);
hbmpPrev = SelectObject(hdcMem, hbmp);
hPal = state.palette;
@@ -332,7 +332,7 @@ XGetImageZPixmap(
}
}
- ret = BitBlt(hdcMem, 0, 0, width, height, hdc, x, y, SRCCOPY);
+ ret = BitBlt(hdcMem, 0, 0, (int) width, (int) height, hdc, x, y, SRCCOPY);
if (hPal) {
SelectPalette(hdc, hPalPrev2, FALSE);
}
@@ -351,7 +351,7 @@ XGetImageZPixmap(
if (depth <= 8) {
size += sizeof(unsigned short) * (1 << depth);
}
- bmInfo = (BITMAPINFO *) ckalloc(size);
+ bmInfo = (BITMAPINFO *) ckalloc((unsigned)size);
bmInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmInfo->bmiHeader.biWidth = width;
@@ -376,7 +376,7 @@ XGetImageZPixmap(
goto cleanup;
}
ret_image = XCreateImage(display, NULL, depth, ZPixmap, 0, data,
- width, height, 32, ((width + 31) >> 3) & ~1);
+ width, height, 32, (int) ((width + 31) >> 3) & ~1);
if (ret_image == NULL) {
ckfree(data);
goto cleanup;
@@ -412,7 +412,7 @@ XGetImageZPixmap(
goto cleanup;
}
ret_image = XCreateImage(display, NULL, 8, ZPixmap, 0, data,
- width, height, 8, width);
+ width, height, 8, (int) width);
if (ret_image == NULL) {
ckfree((char *) data);
goto cleanup;
@@ -469,7 +469,7 @@ XGetImageZPixmap(
goto cleanup;
}
ret_image = XCreateImage(display, NULL, 32, ZPixmap, 0, data,
- width, height, 0, width * 4);
+ width, height, 0, (int) width * 4);
if (ret_image == NULL) {
ckfree((char *) data);
goto cleanup;
@@ -484,7 +484,7 @@ XGetImageZPixmap(
unsigned char *smallBitData, *smallBitBase, *bigBitData;
unsigned int byte_width, h, w;
- byte_width = ((width * 3 + 3) & ~3);
+ byte_width = ((width * 3 + 3) & ~(unsigned)3);
smallBitBase = ckalloc(byte_width * height);
if (!smallBitBase) {
ckfree((char *) ret_image->data);
@@ -624,7 +624,7 @@ XGetImage(
if (pixel == CLR_INVALID) {
break;
}
- PutPixel(imagePtr, xx, yy, pixel);
+ PutPixel(imagePtr, (int) xx, (int) yy, pixel);
}
}
@@ -662,7 +662,8 @@ XGetImage(
imagePtr = XCreateImage(display, NULL, 1, XYBitmap, 0, NULL,
width, height, 32, 0);
- imagePtr->data = ckalloc(imagePtr->bytes_per_line * imagePtr->height);
+ imagePtr->data =
+ ckalloc((unsigned) imagePtr->bytes_per_line*imagePtr->height);
dc = GetDC(NULL);
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index 0424563..bacfb70 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinMenu.c,v 1.51 2006/11/24 18:11:32 hobbs Exp $
+ * RCS: @(#) $Id: tkWinMenu.c,v 1.52 2007/01/11 15:35:40 dkf Exp $
*/
#define OEMRESOURCE
@@ -497,7 +497,7 @@ GetEntryText(mePtr)
}
}
- itemText = ckalloc(Tcl_DStringLength(&itemString) + 1);
+ itemText = ckalloc((unsigned)Tcl_DStringLength(&itemString) + 1);
strcpy(itemText, Tcl_DStringValue(&itemString));
Tcl_DStringFree(&itemString);
}
@@ -940,7 +940,7 @@ TkWinEmbeddedMenuProc(hwnd, message, wParam, lParam)
WPARAM wParam;
LPARAM lParam;
{
- static nIdles = 0;
+ static int nIdles = 0;
LRESULT lResult = 1;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
@@ -1987,32 +1987,33 @@ TkWinMenuKeyObjCmd(clientData, interp, objc, objv)
case XK_Alt_L:
scanCode = MapVirtualKey(VK_LMENU, 0);
CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
- WM_SYSKEYDOWN, VK_MENU, (scanCode << 16) | (1 << 29));
+ WM_SYSKEYDOWN, VK_MENU,
+ (int) (scanCode << 16) | (1 << 29));
break;
case XK_Alt_R:
scanCode = MapVirtualKey(VK_RMENU, 0);
CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
- WM_SYSKEYDOWN, VK_MENU, (scanCode << 16)
- | (1 << 29) | (1 << 24));
+ WM_SYSKEYDOWN, VK_MENU,
+ (int) (scanCode << 16) | (1 << 29) | (1 << 24));
break;
case XK_F10:
scanCode = MapVirtualKey(VK_F10, 0);
CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
- WM_SYSKEYDOWN, VK_F10, (scanCode << 16));
+ WM_SYSKEYDOWN, VK_F10, (int) (scanCode << 16));
break;
default:
virtualKey = XKeysymToKeycode(winPtr->display, keySym);
scanCode = MapVirtualKey(virtualKey, 0);
if (0 != scanCode) {
CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
- WM_SYSKEYDOWN, virtualKey, ((scanCode << 16)
- | (1 << 29)));
+ WM_SYSKEYDOWN, virtualKey,
+ (int) ((scanCode << 16) | (1 << 29)));
if (eventPtr->xkey.nbytes > 0) {
for (i = 0; i < eventPtr->xkey.nbytes; i++) {
CallWindowProc(DefWindowProc,
Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSCHAR,
eventPtr->xkey.trans_chars[i],
- ((scanCode << 16) | (1 << 29)));
+ (int) ((scanCode << 16) | (1 << 29)));
}
}
}
@@ -2022,27 +2023,27 @@ TkWinMenuKeyObjCmd(clientData, interp, objc, objv)
case XK_Alt_L:
scanCode = MapVirtualKey(VK_LMENU, 0);
CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
- WM_SYSKEYUP, VK_MENU, (scanCode << 16)
+ WM_SYSKEYUP, VK_MENU, (int) (scanCode << 16)
| (1 << 29) | (1 << 30) | (1 << 31));
break;
case XK_Alt_R:
scanCode = MapVirtualKey(VK_RMENU, 0);
CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
- WM_SYSKEYUP, VK_MENU, (scanCode << 16) | (1 << 24)
+ WM_SYSKEYUP, VK_MENU, (int) (scanCode << 16) | (1 << 24)
| (0x111 << 29) | (1 << 30) | (1 << 31));
break;
case XK_F10:
scanCode = MapVirtualKey(VK_F10, 0);
CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
- WM_SYSKEYUP, VK_F10, (scanCode << 16)
- | (1 << 30) | (1 << 31));
+ WM_SYSKEYUP, VK_F10,
+ (int) (scanCode << 16) | (1 << 30) | (1 << 31));
break;
default:
virtualKey = XKeysymToKeycode(winPtr->display, keySym);
scanCode = MapVirtualKey(virtualKey, 0);
if (0 != scanCode) {
CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
- WM_SYSKEYUP, virtualKey, ((scanCode << 16)
+ WM_SYSKEYUP, virtualKey, (int) ((scanCode << 16)
| (1 << 29) | (1 << 30) | (1 << 31)));
}
}
@@ -2580,7 +2581,7 @@ GetMenuLabelGeometry(mePtr, tkfont, fmPtr, widthPtr, heightPtr)
* portion */
{
TkMenu *menuPtr = mePtr->menuPtr;
- int haveImage = 0, haveText = 0;
+ int haveImage = 0;
if (mePtr->image != NULL) {
Tk_SizeOfImage(mePtr->image, widthPtr, heightPtr);
diff --git a/win/tkWinPixmap.c b/win/tkWinPixmap.c
index ee07e7c..369c25c 100644
--- a/win/tkWinPixmap.c
+++ b/win/tkWinPixmap.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinPixmap.c,v 1.6 2005/12/02 13:42:29 dkf Exp $
+ * RCS: @(#) $Id: tkWinPixmap.c,v 1.7 2007/01/11 15:35:41 dkf Exp $
*/
#include "tkWinInt.h"
@@ -66,7 +66,7 @@ Tk_GetPixmap(
depth /= planes;
}
newTwdPtr->bitmap.handle =
- CreateBitmap(width, height, planes, depth, NULL);
+ CreateBitmap(width, height, (DWORD) planes, (DWORD) depth, NULL);
if (newTwdPtr->bitmap.handle == NULL) {
ckfree((char *) newTwdPtr);
diff --git a/win/tkWinRegion.c b/win/tkWinRegion.c
index 7cbdb9d..3de6d35 100644
--- a/win/tkWinRegion.c
+++ b/win/tkWinRegion.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinRegion.c,v 1.6 2005/12/02 00:19:04 dkf Exp $
+ * RCS: @(#) $Id: tkWinRegion.c,v 1.7 2007/01/11 15:35:41 dkf Exp $
*/
#include "tkWinInt.h"
@@ -206,7 +206,8 @@ TkpBuildRegionFromAlphaData(
* Manipulate Win32 regions directly; it's more efficient.
*/
- SetRectRgn(rectRgn, x+x1, y+y1, x+end, y+y1+1);
+ SetRectRgn(rectRgn, (int) (x+x1), (int) (y+y1),
+ (int) (x+end), (int) (y+y1+1));
CombineRgn((HRGN) region, (HRGN) region, rectRgn, RGN_OR);
}
}
diff --git a/win/tkWinSend.c b/win/tkWinSend.c
index 2269512..3a064be 100644
--- a/win/tkWinSend.c
+++ b/win/tkWinSend.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinSend.c,v 1.11 2005/12/02 00:19:04 dkf Exp $
+ * RCS: @(#) $Id: tkWinSend.c,v 1.12 2007/01/11 15:35:41 dkf Exp $
*/
#include "tkWinSendCom.h"
@@ -51,10 +51,12 @@ typedef struct SendEvent {
Tcl_Obj *cmdPtr;
} SendEvent;
+#ifdef TK_SEND_ENABLED_ON_WINDOWS
typedef struct {
int initialized;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
+#endif
/*
* Functions internal to this file.
@@ -116,14 +118,6 @@ Tk_SetAppName(
* interpreter in later "send" commands. Must
* be globally unique. */
{
- ThreadSpecificData *tsdPtr = NULL;
- TkWindow *winPtr = (TkWindow *)tkwin;
- RegisteredInterp *riPtr = NULL;
- Tcl_Interp *interp;
- HRESULT hr = S_OK;
-
- interp = winPtr->mainPtr->interp;
-
#ifndef TK_SEND_ENABLED_ON_WINDOWS
/*
* Temporarily disabled for bug #858822
@@ -132,6 +126,14 @@ Tk_SetAppName(
return name;
#else /* TK_SEND_ENABLED_ON_WINDOWS */
+ ThreadSpecificData *tsdPtr = NULL;
+ TkWindow *winPtr = (TkWindow *)tkwin;
+ RegisteredInterp *riPtr = NULL;
+ Tcl_Interp *interp;
+ HRESULT hr = S_OK;
+
+ interp = winPtr->mainPtr->interp;
+
tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
@@ -207,12 +209,6 @@ TkGetInterpNames(
Tk_Window tkwin) /* Window whose display is to be used for the
* lookup. */
{
- LPRUNNINGOBJECTTABLE pROT = NULL;
- LPCOLESTR oleszStub = TKWINSEND_REGISTRATION_BASE;
- HRESULT hr = S_OK;
- Tcl_Obj *objList = NULL;
- int result = TCL_OK;
-
#ifndef TK_SEND_ENABLED_ON_WINDOWS
/*
* Temporarily disabled for bug #858822
@@ -221,6 +217,12 @@ TkGetInterpNames(
return TCL_OK;
#else /* TK_SEND_ENABLED_ON_WINDOWS */
+ LPRUNNINGOBJECTTABLE pROT = NULL;
+ LPCOLESTR oleszStub = TKWINSEND_REGISTRATION_BASE;
+ HRESULT hr = S_OK;
+ Tcl_Obj *objList = NULL;
+ int result = TCL_OK;
+
hr = GetRunningObjectTable(0, &pROT);
if (SUCCEEDED(hr)) {
IBindCtx* pBindCtx = NULL;
diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c
index 2f6ab18..4fc6a0e 100644
--- a/win/tkWinWindow.c
+++ b/win/tkWinWindow.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinWindow.c,v 1.12 2005/12/02 13:42:29 dkf Exp $
+ * RCS: @(#) $Id: tkWinWindow.c,v 1.13 2007/01/11 15:35:41 dkf Exp $
*/
#include "tkWinInt.h"
@@ -250,8 +250,7 @@ TkpScanWindowId(
*/
Window
-TkpMakeWindow(
- TkWindow *winPtr,
+TkpMakeWindow( TkWindow *winPtr,
Window parent)
{
HWND parentWin;
@@ -272,7 +271,7 @@ TkpMakeWindow(
*/
hwnd = CreateWindowEx(WS_EX_NOPARENTNOTIFY, TK_WIN_CHILD_CLASS_NAME, NULL,
- style, Tk_X(winPtr), Tk_Y(winPtr), Tk_Width(winPtr),
+ (DWORD) style, Tk_X(winPtr), Tk_Y(winPtr), Tk_Width(winPtr),
Tk_Height(winPtr), parentWin, NULL, Tk_GetHINSTANCE(), NULL);
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
@@ -512,7 +511,7 @@ XMoveResizeWindow(
unsigned int width, unsigned int height)
{
display->request++;
- MoveWindow(Tk_GetHWND(w), x, y, width, height, TRUE);
+ MoveWindow(Tk_GetHWND(w), x, y, (int) width, (int) height, TRUE);
}
/*
@@ -571,8 +570,8 @@ XResizeWindow(
display->request++;
- MoveWindow(Tk_GetHWND(w), winPtr->changes.x, winPtr->changes.y, width,
- height, TRUE);
+ MoveWindow(Tk_GetHWND(w), winPtr->changes.x, winPtr->changes.y, (int)width,
+ (int)height, TRUE);
}
/*
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index ce53b89..4118b17 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinWm.c,v 1.111 2007/01/05 00:00:52 nijtmans Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.112 2007/01/11 15:35:41 dkf Exp $
*/
#include "tkWinInt.h"
@@ -1215,7 +1215,7 @@ TkWinGetIcon(
* return default toplevel icon
*/
- return GetIcon(tsdPtr->iconPtr, iconsize);
+ return GetIcon(tsdPtr->iconPtr, (int)iconsize);
}
/*
@@ -1239,7 +1239,7 @@ TkWinGetIcon(
* return window toplevel icon
*/
- return GetIcon(wmPtr->iconPtr, iconsize);
+ return GetIcon(wmPtr->iconPtr, (int)iconsize);
}
/*
@@ -1341,7 +1341,7 @@ ReadIconFromFile(
if (res != 0) {
SHFILEINFO sfi;
- int size;
+ unsigned size;
Tcl_ResetResult(interp);
res = (*shgetfileinfoProc)(Tcl_DStringValue(&ds2), 0, &sfi,
@@ -1716,7 +1716,7 @@ ReadIconOrCursorFromFile(
*/
dwBytesRead = Tcl_Read(channel, (char*) lpIDE,
- lpIR->nNumImages * sizeof(ICONDIRENTRY));
+ (int)(lpIR->nNumImages * sizeof(ICONDIRENTRY)));
if (dwBytesRead != lpIR->nNumImages * sizeof(ICONDIRENTRY)) {
Tcl_AppendResult(interp, "Error reading file", NULL);
Tcl_Close(NULL, channel);
@@ -1758,8 +1758,8 @@ ReadIconOrCursorFromFile(
* Read it in.
*/
- dwBytesRead = Tcl_Read( channel, lpIR->IconImages[i].lpBits,
- lpIDE[i].dwBytesInRes);
+ dwBytesRead = Tcl_Read(channel, lpIR->IconImages[i].lpBits,
+ (int) lpIDE[i].dwBytesInRes);
if (dwBytesRead != lpIDE[i].dwBytesInRes) {
Tcl_AppendResult(interp, "Error reading file", NULL);
goto readError;
@@ -2272,7 +2272,7 @@ UpdateWrapper(
setLayeredWindowAttributesProc((HWND) wmPtr->wrapper,
wmPtr->colorref, (BYTE) (wmPtr->alpha * 255 + 0.5),
- LWA_ALPHA | (wmPtr->crefObj ? LWA_COLORKEY : 0));
+ (unsigned)(LWA_ALPHA | (wmPtr->crefObj?LWA_COLORKEY:0)));
} else {
/*
* Layering not used or supported.
@@ -2630,7 +2630,6 @@ TkpWmSetFullScreen(
int changed = 0;
int full_screen = False;
WmInfo *wmPtr = winPtr->wmInfoPtr;
- TkWindow *focusWinPtr;
if (full_screen_state) {
if (! (wmPtr->flags & WM_FULLSCREEN)) {
@@ -2663,9 +2662,12 @@ TkpWmSetFullScreen(
if (!(wmPtr->flags & (WM_NEVER_MAPPED)
&& !(winPtr->flags & TK_EMBEDDED))) {
+ TkWindow *focusWinPtr;
+
UpdateWrapper(winPtr);
- if (focusWinPtr = TkGetFocusWin(winPtr)) {
+ focusWinPtr = TkGetFocusWin(winPtr);
+ if (focusWinPtr) {
TkSetFocusWin(focusWinPtr, 1);
}
}
@@ -2940,7 +2942,7 @@ Tk_WmObjCmd(
}
argv1 = Tcl_GetStringFromObj(objv[1], &length);
- if ((argv1[0] == 't') && (strncmp(argv1, "tracing", length) == 0)
+ if ((argv1[0] == 't') && !strncmp(argv1, "tracing", (unsigned) length)
&& (length >= 3)) {
int wmTracing;
@@ -3197,23 +3199,23 @@ WmAttributesCmd(
if ((length < 2) || (string[0] != '-')) {
goto configArgs;
}
- if (strncmp(string, "-disabled", length) == 0) {
+ if (strncmp(string, "-disabled", (unsigned) length) == 0) {
stylePtr = &style;
styleBit = WS_DISABLED;
- } else if ((strncmp(string, "-alpha", length) == 0)
+ } else if ((strncmp(string, "-alpha", (unsigned) length) == 0)
|| ((length > 2) && (strncmp(string, "-transparentcolor",
- length) == 0))) {
+ (unsigned) length) == 0))) {
stylePtr = &exStyle;
styleBit = WS_EX_LAYERED;
- } else if (strncmp(string, "-fullscreen", length) == 0) {
+ } else if (strncmp(string, "-fullscreen", (unsigned) length) == 0) {
config_fullscreen = 1;
styleBit = 0;
} else if ((length > 3)
- && (strncmp(string, "-toolwindow", length) == 0)) {
+ && (strncmp(string, "-toolwindow", (unsigned) length) == 0)) {
stylePtr = &exStyle;
styleBit = WS_EX_TOOLWINDOW;
} else if ((length > 3)
- && (strncmp(string, "-topmost", length) == 0)) {
+ && (strncmp(string, "-topmost", (unsigned) length) == 0)) {
stylePtr = &exStyle;
styleBit = WS_EX_TOPMOST;
if ((i < objc-1) && (winPtr->flags & TK_EMBEDDED)) {
@@ -3291,11 +3293,13 @@ WmAttributesCmd(
* Set the window directly regardless of UpdateWrapper.
* The user supplies a double from [0..1], but Windows
* wants an int (transparent) 0..255 (opaque), so do the
- * translation. Add the 0.5 to round the value.
+ * translation. Add the 0.5 to round the value.
*/
+
setLayeredWindowAttributesProc((HWND) wmPtr->wrapper,
wmPtr->colorref, (BYTE) (wmPtr->alpha * 255 + 0.5),
- LWA_ALPHA | (wmPtr->crefObj ? LWA_COLORKEY : 0));
+ (unsigned) (LWA_ALPHA |
+ (wmPtr->crefObj ? LWA_COLORKEY : 0)));
}
}
} else {
@@ -4321,10 +4325,11 @@ WmIconphotoCmd(
TkWindow *useWinPtr = winPtr; /* window to apply to (NULL if -default) */
Tk_PhotoHandle photo;
Tk_PhotoImageBlock block;
- int i, size, width, height, startObj = 3;
+ int i, width, height, startObj = 3;
BlockOfIconImagesPtr lpIR;
WinIconPtr titlebaricon = NULL;
HICON hIcon;
+ unsigned size;
if (objc < 4) {
Tcl_WrongNumArgs(interp, 2, objv,
diff --git a/win/tkWinX.c b/win/tkWinX.c
index 5614385..145eb6d 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinX.c,v 1.54 2006/08/30 21:55:51 hobbs Exp $
+ * RCS: @(#) $Id: tkWinX.c,v 1.55 2007/01/11 15:35:41 dkf Exp $
*/
/*
@@ -173,8 +173,8 @@ TkGetServerInfo(
os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&os);
- sprintf(buffer, "Windows %d.%d %d %s", os.dwMajorVersion,
- os.dwMinorVersion, os.dwBuildNumber,
+ sprintf(buffer, "Windows %d.%d %d %s", (int)os.dwMajorVersion,
+ (int)os.dwMinorVersion, (int)os.dwBuildNumber,
#ifdef _WIN64
"Win64"
#else
@@ -316,7 +316,7 @@ TkWinXInit(
LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER,
(LPTSTR) &lpCP, sizeof(lpCP)/sizeof(TCHAR))
&& TranslateCharsetInfo((DWORD *)lpCP, &lpCs, TCI_SRCCODEPAGE)) {
- UpdateInputLanguage(lpCs.ciCharset);
+ UpdateInputLanguage((int) lpCs.ciCharset);
}
/*
@@ -818,7 +818,7 @@ TkWinChildProc(
switch (message) {
case WM_INPUTLANGCHANGE:
- UpdateInputLanguage(wParam);
+ UpdateInputLanguage((int) wParam);
result = 1;
break;
@@ -1263,7 +1263,7 @@ GenerateXEvent(
event.type = KeyPress;
event.xany.send_event = -3;
event.xkey.keycode = wParam;
- event.xkey.nbytes = Tcl_UniCharToUtf(wParam, buffer);
+ event.xkey.nbytes = Tcl_UniCharToUtf((int)wParam, buffer);
for (i=0; i<event.xkey.nbytes && i<TCL_UTF_MAX; ++i) {
event.xkey.trans_chars[i] = buffer[i];
}
@@ -1600,18 +1600,20 @@ HandleIMEComposition(
}
if (n > 0) {
- char *buff = ckalloc(n);
+ char *buff = ckalloc((unsigned) n);
TkWindow *winPtr;
XEvent event;
int i;
if (isWinNT) {
- n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, buff, n);
+ n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, buff,
+ (unsigned) n);
} else {
Tcl_DString utfString, unicodeString;
Tcl_Encoding unicodeEncoding = TkWinGetUnicodeEncoding();
- n = ImmGetCompositionStringA(hIMC, GCS_RESULTSTR, buff, n);
+ n = ImmGetCompositionStringA(hIMC, GCS_RESULTSTR, buff,
+ (unsigned) n);
Tcl_DStringInit(&utfString);
Tcl_ExternalToUtfDString(keyInputEncoding, buff, n, &utfString);
Tcl_UtfToExternalDString(unicodeEncoding,
@@ -1625,10 +1627,10 @@ HandleIMEComposition(
*/
ckfree((char *) buff);
- buff = (char *) ckalloc(i);
+ buff = (char *) ckalloc((unsigned) i);
}
n = i;
- memcpy(buff, Tcl_DStringValue(&unicodeString), n);
+ memcpy(buff, Tcl_DStringValue(&unicodeString), (unsigned) n);
Tcl_DStringFree(&utfString);
Tcl_DStringFree(&unicodeString);
}
diff --git a/win/ttkWinMonitor.c b/win/ttkWinMonitor.c
index 11f2dda..2fa63b0 100644
--- a/win/ttkWinMonitor.c
+++ b/win/ttkWinMonitor.c
@@ -1,4 +1,4 @@
-/* $Id: ttkWinMonitor.c,v 1.4 2006/11/03 15:42:42 patthoyts Exp $
+/* $Id: ttkWinMonitor.c,v 1.5 2007/01/11 15:35:41 dkf Exp $
*/
#ifdef _MSC_VER
@@ -80,7 +80,7 @@ CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp)
HWND hwnd = NULL;
CHAR title[32] = "TtkMonitorWindow";
CHAR name[32] = "TtkMonitorClass";
-
+
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = (WNDPROC)WndProc;
@@ -93,11 +93,11 @@ CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp)
wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
wc.lpszMenuName = name;
wc.lpszClassName = name;
-
+
if (RegisterClassEx(&wc)) {
- hwnd = CreateWindow( name, title, WS_OVERLAPPEDWINDOW,
- CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
- NULL, NULL, hinst, NULL );
+ hwnd = CreateWindow(name, title, WS_OVERLAPPEDWINDOW,
+ (int) CW_USEDEFAULT, (int) CW_USEDEFAULT, (int) CW_USEDEFAULT,
+ (int) CW_USEDEFAULT, NULL, NULL, hinst, NULL);
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG)interp);
ShowWindow(hwnd, SW_HIDE);
UpdateWindow(hwnd);
diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c
index 73010f3..b2f8c0b 100644
--- a/win/ttkWinTheme.c
+++ b/win/ttkWinTheme.c
@@ -1,6 +1,6 @@
/* winTheme.c - Copyright (C) 2004 Pat Thoyts <patthoyts@users.sf.net>
*
- * $Id: ttkWinTheme.c,v 1.2 2006/11/03 03:06:22 das Exp $
+ * $Id: ttkWinTheme.c,v 1.3 2007/01/11 15:35:41 dkf Exp $
*/
#ifdef _MSC_VER
@@ -146,8 +146,8 @@ static void FrameControlElementDraw(
HDC hdc = TkWinGetDrawableDC(Tk_Display(tkwin), d, &dcState);
DrawFrameControl(hdc, &rc,
- elementData->classId,
- elementData->partId|Ttk_StateTableLookup(elementData->stateMap, state));
+ (DWORD) elementData->classId, (DWORD) elementData->partId
+ | Ttk_StateTableLookup(elementData->stateMap, state));
TkWinReleaseDrawableDC(d, hdc, &dcState);
}
@@ -292,7 +292,7 @@ static void ButtonBorderElementGeometry(
ButtonBorderElement *bd = elementRecord;
int relief = TK_RELIEF_RAISED;
int defaultState = TTK_BUTTON_DEFAULT_DISABLED;
- short int cx, cy;
+ int cx, cy;
Tk_GetReliefFromObj(NULL, bd->reliefObj, &relief);
Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState);
@@ -329,9 +329,10 @@ static void ButtonBorderElementDraw(
if (defaultState == TTK_BUTTON_DEFAULT_ACTIVE) {
XColor *highlightColor =
- Tk_GetColorFromObj(tkwin, bd->highlightColorObj);
+ Tk_GetColorFromObj(tkwin, bd->highlightColorObj);
GC gc = Tk_GCForColor(highlightColor, d);
- XDrawRectangle(Tk_Display(tkwin), d, gc, b.x,b.y,b.width-1,b.height-1);
+ XDrawRectangle(Tk_Display(tkwin), d, gc, b.x, b.y,
+ (unsigned)b.width-1, (unsigned)b.height-1);
}
if (defaultState != TTK_BUTTON_DEFAULT_DISABLED) {
++b.x; ++b.y; b.width -= 2; b.height -= 2;
@@ -341,13 +342,13 @@ static void ButtonBorderElementDraw(
rc = BoxToRect(b);
DrawFrameControl(hdc, &rc,
- DFC_BUTTON, /* classId */
- DFCS_BUTTONPUSH | Ttk_StateTableLookup(pushbutton_statemap, state));
+ (DWORD) DFC_BUTTON, /* classId */ (DWORD) DFCS_BUTTONPUSH
+ | Ttk_StateTableLookup(pushbutton_statemap, state));
/* Draw focus ring:
*/
if (state & TTK_STATE_FOCUS) {
- short int borderWidth = 3; /* @@@ Use GetSystemMetrics?*/
+ int borderWidth = 3; /* @@@ Use GetSystemMetrics?*/
rc = BoxToRect(Ttk_PadBox(b, Ttk_UniformPadding(borderWidth)));
DrawFocusRect(hdc, &rc);
}
@@ -424,7 +425,8 @@ static void FillFocusElementDraw(
GC gc = Tk_GCForColor(fillColor, d);
HDC hdc;
- XFillRectangle(Tk_Display(tkwin),d,gc, b.x,b.y,b.width,b.height);
+ XFillRectangle(Tk_Display(tkwin),d,gc,
+ b.x,b.y,(unsigned)b.width,(unsigned)b.height);
hdc = TkWinGetDrawableDC(Tk_Display(tkwin), d, &dcState);
DrawFocusRect(hdc, &rc);
TkWinReleaseDrawableDC(d, hdc, &dcState);
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index 41e5e6b..0d249dd 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -1,5 +1,5 @@
/*
- * $Id: ttkWinXPTheme.c,v 1.4 2006/11/21 02:21:27 jenglish Exp $
+ * $Id: ttkWinXPTheme.c,v 1.5 2007/01/11 15:35:41 dkf Exp $
*
* Tk theme engine which uses the Windows XP "Visual Styles" API
* Adapted from Georgios Petasis' XP theme patch.
@@ -565,7 +565,7 @@ ThumbElementDraw(
return;
elementData->procs->DrawThemeBackground(elementData->hTheme,
- elementData->hDC, elementData->info->partId, stateId,
+ elementData->hDC, elementData->info->partId, (int) stateId,
&rc, NULL);
FreeElementData(elementData);