summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-20 14:37:27 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-20 14:37:27 (GMT)
commitb8a68d0c335e5b303b12e9fd8194e27be780a219 (patch)
tree17fd1a08d397cdc6fc894f06d6de1d3c2eb7c142 /win
parent0c33edcbe038707fa9ad175f159140800fc6c621 (diff)
downloadtk-b8a68d0c335e5b303b12e9fd8194e27be780a219.zip
tk-b8a68d0c335e5b303b12e9fd8194e27be780a219.tar.gz
tk-b8a68d0c335e5b303b12e9fd8194e27be780a219.tar.bz2
Smarter initialization of doubleTypePtr/intTypePtr without hash-table lookup or creating complete Tcl_Obj's.
In Windows tests, allow up to 64 bits for HWND. Check stubs for "8.6-" in stead of "8.6", for better interoperability with "novem".
Diffstat (limited to 'win')
-rw-r--r--win/tkWinTest.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/win/tkWinTest.c b/win/tkWinTest.c
index d824ee4..095358d 100644
--- a/win/tkWinTest.c
+++ b/win/tkWinTest.c
@@ -483,7 +483,7 @@ TestfindwindowObjCmd(
AppendSystemError(interp, GetLastError());
r = TCL_ERROR;
} else {
- Tcl_SetObjResult(interp, Tcl_NewLongObj(PTR2INT(hwnd)));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj((size_t)hwnd));
}
Tcl_DStringFree(&titleString);
@@ -499,7 +499,7 @@ EnumChildrenProc(
{
Tcl_Obj *listObj = (Tcl_Obj *) lParam;
- Tcl_ListObjAppendElement(NULL, listObj, Tcl_NewLongObj(PTR2INT(hwnd)));
+ Tcl_ListObjAppendElement(NULL, listObj, Tcl_NewWideIntObj((size_t)hwnd));
return TRUE;
}
@@ -510,7 +510,7 @@ TestgetwindowinfoObjCmd(
int objc,
Tcl_Obj *const objv[])
{
- long hwnd;
+ Tcl_WideInt hwnd;
Tcl_Obj *dictObj = NULL, *classObj = NULL, *textObj = NULL;
Tcl_Obj *childrenObj = NULL;
TCHAR buf[512];
@@ -521,10 +521,10 @@ TestgetwindowinfoObjCmd(
return TCL_ERROR;
}
- if (Tcl_GetLongFromObj(interp, objv[1], &hwnd) != TCL_OK)
+ if (Tcl_GetWideIntFromObj(interp, objv[1], &hwnd) != TCL_OK)
return TCL_ERROR;
- cch = GetClassName(INT2PTR(hwnd), buf, cchBuf);
+ cch = GetClassName((HWND)(size_t)hwnd, buf, cchBuf);
if (cch == 0) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("failed to get class name: ", -1));
AppendSystemError(interp, GetLastError());
@@ -539,17 +539,17 @@ TestgetwindowinfoObjCmd(
dictObj = Tcl_NewDictObj();
Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("class", 5), classObj);
Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("id", 2),
- Tcl_NewLongObj(GetWindowLongA(INT2PTR(hwnd), GWL_ID)));
+ Tcl_NewWideIntObj(GetWindowLongPtr((HWND)(size_t)hwnd, GWL_ID)));
- cch = GetWindowText(INT2PTR(hwnd), (LPTSTR)buf, cchBuf);
+ cch = GetWindowText((HWND)(size_t)hwnd, (LPTSTR)buf, cchBuf);
textObj = Tcl_NewUnicodeObj((LPCWSTR)buf, cch);
Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("text", 4), textObj);
Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("parent", 6),
- Tcl_NewLongObj(PTR2INT(GetParent((INT2PTR(hwnd))))));
+ Tcl_NewWideIntObj((size_t)(GetParent((HWND)(size_t)hwnd))));
childrenObj = Tcl_NewListObj(0, NULL);
- EnumChildWindows(INT2PTR(hwnd), EnumChildrenProc, (LPARAM)childrenObj);
+ EnumChildWindows((HWND)(size_t)hwnd, EnumChildrenProc, (LPARAM)childrenObj);
Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("children", -1), childrenObj);
Tcl_SetObjResult(interp, dictObj);