summaryrefslogtreecommitdiffstats
path: root/generic/tclStubLib.c
diff options
context:
space:
mode:
authorjan.nijtmans <jan.nijtmans@noemail.net>2013-06-21 11:53:11 (GMT)
committerjan.nijtmans <jan.nijtmans@noemail.net>2013-06-21 11:53:11 (GMT)
commit7594f0c08eb799270a0d9d8af2a2187030b453ec (patch)
treed72e35d30860709dafe2eee62ea82000b7ed190f /generic/tclStubLib.c
parentf253413230e0c62d93eea9c887152fc111227405 (diff)
downloadtcl-7594f0c08eb799270a0d9d8af2a2187030b453ec.zip
tcl-7594f0c08eb799270a0d9d8af2a2187030b453ec.tar.gz
tcl-7594f0c08eb799270a0d9d8af2a2187030b453ec.tar.bz2
Modify internal TclStubInfoType type: use TclStubs * in stead of ClientData, so less type casts are needed in the code.
Disadvantage: somewhat more code duplication, but it makes the code much more understandable. FossilOrigin-Name: 6fcb6b3e579652cea22c62d146f5411f2fb4547b
Diffstat (limited to 'generic/tclStubLib.c')
-rw-r--r--generic/tclStubLib.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c
index e617515..859cbf9 100644
--- a/generic/tclStubLib.c
+++ b/generic/tclStubLib.c
@@ -13,6 +13,16 @@
#include "tclInt.h"
+MODULE_SCOPE const TclStubs *tclStubsPtr;
+MODULE_SCOPE const TclPlatStubs *tclPlatStubsPtr;
+MODULE_SCOPE const TclIntStubs *tclIntStubsPtr;
+MODULE_SCOPE const TclIntPlatStubs *tclIntPlatStubsPtr;
+
+const TclStubs *tclStubsPtr = NULL;
+const TclPlatStubs *tclPlatStubsPtr = NULL;
+const TclIntStubs *tclIntStubsPtr = NULL;
+const TclIntPlatStubs *tclIntPlatStubsPtr = NULL;
+
/*
* Use our own isDigit to avoid linking to libc on windows
*/
@@ -48,7 +58,7 @@ Tcl_InitStubs(
{
Interp *iPtr = (Interp *) interp;
const char *actualVersion = NULL;
- TclStubInfoType stub;
+ ClientData pkgData = NULL;
const TclStubs *stubsPtr = iPtr->stubTable;
/*
@@ -63,7 +73,7 @@ Tcl_InitStubs(
return NULL;
}
- actualVersion = stubsPtr->tcl_PkgRequireEx(interp, "Tcl", version, 0, &stub.data);
+ actualVersion = stubsPtr->tcl_PkgRequireEx(interp, "Tcl", version, 0, &pkgData);
if (actualVersion == NULL) {
return NULL;
}
@@ -93,7 +103,18 @@ Tcl_InitStubs(
}
}
}
- TclInitStubTable(stub.version);
+ tclStubsPtr = (TclStubs *)pkgData;
+
+ if (tclStubsPtr->hooks) {
+ tclPlatStubsPtr = tclStubsPtr->hooks->tclPlatStubs;
+ tclIntStubsPtr = tclStubsPtr->hooks->tclIntStubs;
+ tclIntPlatStubsPtr = tclStubsPtr->hooks->tclIntPlatStubs;
+ } else {
+ tclPlatStubsPtr = NULL;
+ tclIntStubsPtr = NULL;
+ tclIntPlatStubsPtr = NULL;
+ }
+
return actualVersion;
}