diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-06-21 11:53:11 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-06-21 11:53:11 (GMT) |
commit | c12c83e799a79e5d1faa3dc446e1ef322eaa31fd (patch) | |
tree | d72e35d30860709dafe2eee62ea82000b7ed190f /generic/tclStubLib.c | |
parent | bd74c3a8549b56bbbf082f0d92034cdd58c43eb8 (diff) | |
download | tcl-c12c83e799a79e5d1faa3dc446e1ef322eaa31fd.zip tcl-c12c83e799a79e5d1faa3dc446e1ef322eaa31fd.tar.gz tcl-c12c83e799a79e5d1faa3dc446e1ef322eaa31fd.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.c | 27 |
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; } |