summaryrefslogtreecommitdiffstats
path: root/generic
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 /generic
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 'generic')
-rw-r--r--generic/tkConsole.c2
-rw-r--r--generic/tkIntXlibDecls.h4
-rw-r--r--generic/tkMain.c2
-rw-r--r--generic/tkObj.c15
-rw-r--r--generic/tkTest.c2
-rw-r--r--generic/tkWindow.c2
6 files changed, 21 insertions, 6 deletions
diff --git a/generic/tkConsole.c b/generic/tkConsole.c
index fc60d5f..57e8364 100644
--- a/generic/tkConsole.c
+++ b/generic/tkConsole.c
@@ -223,7 +223,7 @@ Tk_InitConsoleChannels(
* Ensure that we are getting a compatible version of Tcl.
*/
- if (Tcl_InitStubs(interp, "8.6", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) {
return;
}
diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h
index de44068..ce9752f 100644
--- a/generic/tkIntXlibDecls.h
+++ b/generic/tkIntXlibDecls.h
@@ -23,6 +23,10 @@
# include <tcl.h>
#endif
+#ifndef EXTERN
+# define EXTERN extern TCL_STORAGE_CLASS
+#endif
+
/* Some (older) versions of X11/Xutil.h have a wrong signature of those
two functions, so move them out of the way temporarly. */
#define XOffsetRegion _XOffsetRegion
diff --git a/generic/tkMain.c b/generic/tkMain.c
index 1b21223..87a3cf7 100644
--- a/generic/tkMain.c
+++ b/generic/tkMain.c
@@ -196,7 +196,7 @@ Tk_MainEx(
* Ensure that we are getting a compatible version of Tcl.
*/
- if (Tcl_InitStubs(interp, "8.6", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) {
if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
abort();
} else {
diff --git a/generic/tkObj.c b/generic/tkObj.c
index 7c09656..90fedbc 100644
--- a/generic/tkObj.c
+++ b/generic/tkObj.c
@@ -153,8 +153,19 @@ GetTypeCache(void)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->doubleTypePtr == NULL) {
- tsdPtr->doubleTypePtr = Tcl_GetObjType("double");
- tsdPtr->intTypePtr = Tcl_GetObjType("int");
+ /* Smart initialization of doubleTypePtr/intTypePtr without
+ * hash-table lookup or creating complete Tcl_Obj's */
+ Tcl_Obj obj;
+ obj.length = 3;
+ obj.bytes = (char *)"0.0";
+ obj.typePtr = NULL;
+ Tcl_GetDoubleFromObj(NULL, &obj, &obj.internalRep.doubleValue);
+ tsdPtr->doubleTypePtr = obj.typePtr;
+ obj.bytes += 2;
+ obj.length = 1;
+ obj.typePtr = NULL;
+ Tcl_GetLongFromObj(NULL, &obj, &obj.internalRep.longValue);
+ tsdPtr->intTypePtr = obj.typePtr;
}
return tsdPtr;
}
diff --git a/generic/tkTest.c b/generic/tkTest.c
index faba89d..e23be36 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -227,7 +227,7 @@ Tktest_Init(
{
static int initialized = 0;
- if (Tcl_InitStubs(interp, "8.6", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) {
return TCL_ERROR;
}
if (Tk_InitStubs(interp, TK_VERSION, 0) == NULL) {
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 20b4f20..f02db35 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -3040,7 +3040,7 @@ Initialize(
* Ensure that we are getting a compatible version of Tcl.
*/
- if (Tcl_InitStubs(interp, "8.6", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) {
return TCL_ERROR;
}