summaryrefslogtreecommitdiffstats
path: root/generic/tclStubLib.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-06-21 11:53:11 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-06-21 11:53:11 (GMT)
commitdcb4da22fa14ad5336a92fc0ae0dd02ef0c64070 (patch)
treed72e35d30860709dafe2eee62ea82000b7ed190f /generic/tclStubLib.c
parent130c6dd2031d65aff05c640b86e14b43a99c4857 (diff)
downloadtcl-dcb4da22fa14ad5336a92fc0ae0dd02ef0c64070.zip
tcl-dcb4da22fa14ad5336a92fc0ae0dd02ef0c64070.tar.gz
tcl-dcb4da22fa14ad5336a92fc0ae0dd02ef0c64070.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.
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;
}