diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-03-26 15:57:45 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-03-26 15:57:45 (GMT) |
commit | 9ff27d9770c73b844da4165fe4512f16453e2b89 (patch) | |
tree | 600abdc9bc2814441b3186bdc57d9a80039fdfbe /generic | |
parent | 555d9b42ae752e2209d03200ccfd44be8b394e42 (diff) | |
download | tcl-9ff27d9770c73b844da4165fe4512f16453e2b89.zip tcl-9ff27d9770c73b844da4165fe4512f16453e2b89.tar.gz tcl-9ff27d9770c73b844da4165fe4512f16453e2b89.tar.bz2 |
Looks like TCL_INIT_CUSTOM (previously known as TCL_INIT_STUFF) is not a bad idea at all,
provided it has a Tcl_Interp* argument as well, so it can initialize the stub table.
A typedef for the function is not necessary, as a variable-argument function doesn't do any type checking. It's for the experienced developer anyway.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tcl.h | 2 | ||||
-rw-r--r-- | generic/tclEncoding.c | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index 9325bf2..522171e 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -2412,7 +2412,7 @@ const char * TclTomMathInitializeStubs(Tcl_Interp *interp, /* Tcl_InitSubsystems, see TIP #414 */ #define TCL_INIT_PANIC (1) /* Set Panic proc */ -#define TCL_INIT_STUFF (2) /* Do any stuff before initializing the encoding */ +#define TCL_INIT_CUSTOM (2) /* Do any stuff before initializing the encoding */ EXTERN Tcl_Interp *Tcl_InitSubsystems(int flags, ...); diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 753222f..9905eaa 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -1446,22 +1446,24 @@ Tcl_Interp * Tcl_InitSubsystems(int flags, ...) { va_list argList; + Tcl_Interp *interp = (Tcl_Interp *) &dummyInterp; va_start(argList, flags); if (flags & TCL_INIT_PANIC) { Tcl_SetPanicProc(va_arg(argList, Tcl_PanicProc *)); } TclInitSubsystems(); - if (flags & TCL_INIT_STUFF) { + if (flags & TCL_INIT_CUSTOM) { ClientData clientData = va_arg(argList, ClientData); - void (*fn)() = va_arg(argList, void (*)(ClientData)); - fn(clientData); + void (*fn)(Tcl_Interp *, ClientData) = va_arg(argList, + void (*)(Tcl_Interp *, ClientData)); + fn(interp, clientData); } va_end(argList); TclpSetInitialEncodings(); TclpFindExecutable(NULL); - return (Tcl_Interp *) &dummyInterp; + return interp; } void |