summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordas <das>2008-04-16 14:51:28 (GMT)
committerdas <das>2008-04-16 14:51:28 (GMT)
commit54bfce14793fed20c259085043af7e9ab0579aef (patch)
tree7bc936a8c902ad26432c19fd773a273fbfdf5276 /generic
parentf4a2a378897fa69d2d7f86f96f00c8282d5a34b5 (diff)
downloadtk-54bfce14793fed20c259085043af7e9ab0579aef.zip
tk-54bfce14793fed20c259085043af7e9ab0579aef.tar.gz
tk-54bfce14793fed20c259085043af7e9ab0579aef.tar.bz2
* generic/tkStubInit.c: make stubs tables static const
* generic/tkWindow.c (Initialize): and export only a module-scope pointer to to the main stubs table (for package init). [Patch 1938497]
Diffstat (limited to 'generic')
-rw-r--r--generic/tkStubInit.c28
-rw-r--r--generic/tkWindow.c6
2 files changed, 18 insertions, 16 deletions
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index ef40e30..c7f02e7 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkStubInit.c,v 1.61 2008/04/02 21:32:33 das Exp $
+ * RCS: @(#) $Id: tkStubInit.c,v 1.62 2008/04/16 14:51:29 das Exp $
*/
#include "tkInt.h"
@@ -41,12 +41,6 @@
#define Tk_GetCanvasVisitor \
((VOID * (*)(Tcl_Interp * interp, CONST char * name)) NULL)
-MODULE_SCOPE TkIntStubs tkIntStubs;
-MODULE_SCOPE TkIntPlatStubs tkIntPlatStubs;
-MODULE_SCOPE TkIntXlibStubs tkIntXlibStubs;
-MODULE_SCOPE TkPlatStubs tkPlatStubs;
-MODULE_SCOPE TkStubs tkStubs;
-
/*
* WARNING: The contents of this file is automatically generated by the
* tools/genStubs.tcl script. Any modifications to the function declarations
@@ -55,7 +49,7 @@ MODULE_SCOPE TkStubs tkStubs;
/* !BEGIN!: Do not edit below this line. */
-TkIntStubs tkIntStubs = {
+static const TkIntStubs tkIntStubs = {
TCL_STUB_MAGIC,
NULL,
TkAllocWindow, /* 0 */
@@ -317,7 +311,7 @@ TkIntStubs tkIntStubs = {
TkpTesttextCmd, /* 157 */
};
-TkIntPlatStubs tkIntPlatStubs = {
+static const TkIntPlatStubs tkIntPlatStubs = {
TCL_STUB_MAGIC,
NULL,
#ifdef __WIN32__ /* WIN */
@@ -432,7 +426,7 @@ TkIntPlatStubs tkIntPlatStubs = {
#endif /* X11 */
};
-TkIntXlibStubs tkIntXlibStubs = {
+static const TkIntXlibStubs tkIntXlibStubs = {
TCL_STUB_MAGIC,
NULL,
#ifdef __WIN32__ /* WIN */
@@ -640,7 +634,7 @@ TkIntXlibStubs tkIntXlibStubs = {
#endif /* AQUA */
};
-TkPlatStubs tkPlatStubs = {
+static const TkPlatStubs tkPlatStubs = {
TCL_STUB_MAGIC,
NULL,
#ifdef __WIN32__ /* WIN */
@@ -673,7 +667,7 @@ static const TkStubHooks tkStubHooks = {
&tkIntXlibStubs
};
-TkStubs tkStubs = {
+static const TkStubs tkStubs = {
TCL_STUB_MAGIC,
&tkStubHooks,
Tk_MainLoop, /* 0 */
@@ -954,5 +948,13 @@ TkStubs tkStubs = {
/* !END!: Do not edit above this line. */
+/*
+ * Module-scope pointer to the main static stubs table, used for package
+ * initialization via Tcl_PkgProvideEx().
+ */
+
+MODULE_SCOPE const TkStubs * const tkConstStubsPtr;
+
+const TkStubs * const tkConstStubsPtr = &tkStubs;
+
#undef UNIX_TK
-#undef MAC_OSX_TK
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 854bb82..c73b950 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWindow.c,v 1.93 2008/04/07 23:14:36 hobbs Exp $
+ * RCS: @(#) $Id: tkWindow.c,v 1.94 2008/04/16 14:51:29 das Exp $
*/
#include "tkInt.h"
@@ -2912,7 +2912,7 @@ Tk_SafeInit(
return Initialize(interp);
}
-extern TkStubs tkStubs;
+MODULE_SCOPE const TkStubs * const tkConstStubsPtr;
/*
*----------------------------------------------------------------------
@@ -3190,7 +3190,7 @@ Initialize(
*/
code = Tcl_PkgProvideEx(interp, "Tk", TK_PATCH_LEVEL,
- (ClientData) &tkStubs);
+ (ClientData) tkConstStubsPtr);
if (code != TCL_OK) {
goto done;
}