summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-11-29 11:25:09 (GMT)
committernijtmans <nijtmans>2010-11-29 11:25:09 (GMT)
commite55404bc8b824f5841b7e5f42bff2867e7f490ab (patch)
tree387b8aa44b2a3ca8dd4aee1e94187fe633ea2c02 /win
parent46fb4deb02b07e1c713cb89cb01a817e5b35ee89 (diff)
downloadtk-e55404bc8b824f5841b7e5f42bff2867e7f490ab.zip
tk-e55404bc8b824f5841b7e5f42bff2867e7f490ab.tar.gz
tk-e55404bc8b824f5841b7e5f42bff2867e7f490ab.tar.bz2
Fix various 64-bit gcc(-4.5.2) warnings: cast from pointer to integer of different size
Diffstat (limited to 'win')
-rw-r--r--win/tkWinWindow.c13
-rw-r--r--win/tkWinWm.c10
2 files changed, 13 insertions, 10 deletions
diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c
index ea80937..e1ce602 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.21 2010/04/29 15:28:04 nijtmans Exp $
+ * RCS: @(#) $Id: tkWinWindow.c,v 1.22 2010/11/29 11:25:09 nijtmans Exp $
*/
#include "tkWinInt.h"
@@ -213,7 +213,10 @@ TkpScanWindowId(
Window *idPtr) /* Place to store converted result. */
{
Tk_Window tkwin;
- Window number, *numberPtr = &number;
+ union {
+ HWND hwnd;
+ int number;
+ } win;
/*
* We want sscanf for the 64-bit check, but if that doesn't work, then
@@ -222,13 +225,13 @@ TkpScanWindowId(
if (
#ifdef _WIN64
- (sscanf(string, "0x%p", &number) != 1) &&
+ (sscanf(string, "0x%p", &win.hwnd) != 1) &&
#endif
- Tcl_GetInt(interp, string, (int *) numberPtr) != TCL_OK) {
+ Tcl_GetInt(interp, string, &win.number) != TCL_OK) {
return TCL_ERROR;
}
- tkwin = Tk_HWNDToWindow((HWND) number);
+ tkwin = Tk_HWNDToWindow(win.hwnd);
if (tkwin) {
*idPtr = Tk_WindowId(tkwin);
} else {
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index a20161d..9428444 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.145 2010/10/11 13:33:30 nijtmans Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.146 2010/11/29 11:25:09 nijtmans Exp $
*/
#include "tkWinInt.h"
@@ -1946,7 +1946,7 @@ TkWmNewWindow(
wmPtr->x = winPtr->changes.x;
wmPtr->y = winPtr->changes.y;
wmPtr->crefObj = NULL;
- wmPtr->colorref = (COLORREF) NULL;
+ wmPtr->colorref = (COLORREF) 0;
wmPtr->alpha = 1.0;
wmPtr->configWidth = -1;
@@ -2134,7 +2134,7 @@ UpdateWrapper(
wmPtr->style, x, y, width, height,
parentHWND, NULL, Tk_GetHINSTANCE(), NULL);
Tcl_DStringFree(&titleString);
- SetWindowLongPtr(wmPtr->wrapper, GWLP_USERDATA, (INT_PTR) winPtr);
+ SetWindowLongPtr(wmPtr->wrapper, GWLP_USERDATA, (LONG_PTR) winPtr);
tsdPtr->createWindow = NULL;
if (wmPtr->exStyleConfig & WS_EX_LAYERED) {
@@ -2189,7 +2189,7 @@ UpdateWrapper(
WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
if (winPtr->flags & TK_EMBEDDED) {
- SetWindowLongPtr(child, GWLP_WNDPROC, (INT_PTR) TopLevelProc);
+ SetWindowLongPtr(child, GWLP_WNDPROC, (LONG_PTR) TopLevelProc);
}
SetParent(child, wmPtr->wrapper);
@@ -2202,7 +2202,7 @@ UpdateWrapper(
if (oldWrapper && (oldWrapper != wmPtr->wrapper)
&& (oldWrapper != GetDesktopWindow())) {
- SetWindowLongPtr(oldWrapper, GWLP_USERDATA, (LONG) NULL);
+ SetWindowLongPtr(oldWrapper, GWLP_USERDATA, (LONG_PTR) 0);
if (wmPtr->numTransients > 0) {
/*