From 454e04bbf4e61fb4a363ffcfedb08e941a17952f Mon Sep 17 00:00:00 2001 From: nijtmans Date: Fri, 5 Feb 2010 22:45:03 +0000 Subject: Make more internal tables "const" tk*Decls.h (regenerated with new genStubs.tcl from Tcl) --- ChangeLog | 11 +++++++++++ carbon/tkMacOSXDialog.c | 4 ++-- generic/tk.decls | 8 ++++---- generic/tkBusy.c | 4 ++-- generic/tkFrame.c | 4 ++-- generic/tkImgPNG.c | 4 ++-- generic/tkImgPhoto.h | 6 +++--- generic/tkStubInit.c | 33 ++++++++++++--------------------- generic/tkStubLib.c | 21 +++++++++++---------- generic/tkWindow.c | 6 +++--- macosx/tkMacOSXDialog.c | 4 ++-- unix/tkUnixButton.c | 4 ++-- unix/tkUnixWm.c | 4 ++-- win/.cvsignore | 1 + win/tkWinDialog.c | 4 ++-- 15 files changed, 61 insertions(+), 57 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89f7dea..2e476a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2010-02-05 Jan Nijtmans + + * carbon/tkMacOSXDialog.c Make more internal + * macosx/tkMacOSXDialog.c tables "const" + * unix/tkUnixButton.c + * unix/tkUnixWm.c + * win/tkWinDialog.c + * generic/tkWindow.c + * generic/tk*Decls.h (regenerated with new + * generic/tkStubInit.c genStubs.tcl from Tcl) + 2010-02-05 Joe English * generic/ttk/*.[ch]: Revert contravariant const qualifiers added diff --git a/carbon/tkMacOSXDialog.c b/carbon/tkMacOSXDialog.c index ff135e5..4086d47 100644 --- a/carbon/tkMacOSXDialog.c +++ b/carbon/tkMacOSXDialog.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.1 2009/06/26 01:42:46 das Exp $ + * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.2 2010/02/05 22:45:03 nijtmans Exp $ */ #include "tkMacOSXPrivate.h" @@ -1783,7 +1783,7 @@ static FMFontStyle fontPanelFontStyle = -1; static FMFontSize fontPanelFontSize = 0; static FMFont fontPanelFontID = kInvalidFont; -static const char *fontchooserOptionStrings[] = { +static const char *const fontchooserOptionStrings[] = { "-parent", "-title", "-font", "-command", "-visible", NULL }; diff --git a/generic/tk.decls b/generic/tk.decls index 7031c0f..a68864c 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -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: tk.decls,v 1.50 2010/01/29 18:07:31 nijtmans Exp $ +# RCS: @(#) $Id: tk.decls,v 1.51 2010/02/05 22:45:03 nijtmans Exp $ library tk @@ -128,7 +128,7 @@ declare 24 generic { void Tk_ClearSelection(Tk_Window tkwin, Atom selection) } declare 25 generic { - int Tk_ClipboardAppend(Tcl_Interp *interp,Tk_Window tkwin, + int Tk_ClipboardAppend(Tcl_Interp *interp, Tk_Window tkwin, Atom target, Atom format, const char *buffer) } declare 26 generic { @@ -831,11 +831,11 @@ declare 217 generic { } #declare 218 generic { -# void Tk_CreateCanvasVisitor(Tcl_Interp *interp, VOID *typePtr) +# void Tk_CreateCanvasVisitor(Tcl_Interp *interp, void *typePtr) #} #declare 219 generic { -# VOID *Tk_GetCanvasVisitor(Tcl_Interp *interp, const char *name) +# void *Tk_GetCanvasVisitor(Tcl_Interp *interp, const char *name) #} declare 220 generic { diff --git a/generic/tkBusy.c b/generic/tkBusy.c index 6f200c3..1275e81 100644 --- a/generic/tkBusy.c +++ b/generic/tkBusy.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: tkBusy.c,v 1.7 2010/01/13 23:08:09 nijtmans Exp $ + * RCS: @(#) $Id: tkBusy.c,v 1.8 2010/02/05 22:45:03 nijtmans Exp $ */ #include "tkInt.h" @@ -791,7 +791,7 @@ Tk_BusyObjCmd( Busy *busyPtr; Tcl_Obj *objPtr; int index, result = TCL_OK; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "cget", "configure", "current", "forget", "hold", "status", NULL }; enum options { diff --git a/generic/tkFrame.c b/generic/tkFrame.c index eea7e9d..eaccd58 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.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: tkFrame.c,v 1.40 2010/01/13 23:08:08 nijtmans Exp $ + * RCS: @(#) $Id: tkFrame.c,v 1.41 2010/02/05 22:45:03 nijtmans Exp $ */ #include "default.h" @@ -164,7 +164,7 @@ enum labelanchor { LABELANCHOR_W, LABELANCHOR_WN, LABELANCHOR_WS }; -static const char *labelAnchorStrings[] = { +static const char *const labelAnchorStrings[] = { "e", "en", "es", "n", "ne", "nw", "s", "se", "sw", "w", "wn", "ws", NULL }; diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index f00c9dd..0468ca9 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkImgPNG.c,v 1.4 2010/01/18 20:43:38 nijtmans Exp $ + * RCS: @(#) $Id: tkImgPNG.c,v 1.5 2010/02/05 22:45:03 nijtmans Exp $ */ #include "tkInt.h" @@ -2212,7 +2212,7 @@ ParseFormat( { Tcl_Obj **objv = NULL; int objc = 0; - static const char *fmtOptions[] = { + static const char *const fmtOptions[] = { "png", "-alpha", NULL }; enum fmtOptions { diff --git a/generic/tkImgPhoto.h b/generic/tkImgPhoto.h index fc1a444..bcbd67f 100644 --- a/generic/tkImgPhoto.h +++ b/generic/tkImgPhoto.h @@ -15,7 +15,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.h,v 1.1 2008/08/25 11:44:04 dkf Exp $ + * RCS: @(#) $Id: tkImgPhoto.h,v 1.2 2010/02/05 22:45:03 nijtmans Exp $ */ #include "tkInt.h" @@ -223,9 +223,9 @@ struct PhotoInstance { * Implementation of the Porter-Duff Source-Over compositing rule. */ -#define PD_SRC_OVER(srcColor,srcAlpha,dstColor,dstAlpha) \ +#define PD_SRC_OVER(srcColor, srcAlpha, dstColor, dstAlpha) \ (srcColor*srcAlpha/255) + dstAlpha*(255-srcAlpha)/255*dstColor/255 -#define PD_SRC_OVER_ALPHA(srcAlpha,dstAlpha) \ +#define PD_SRC_OVER_ALPHA(srcAlpha, dstAlpha) \ (srcAlpha + (255-srcAlpha)*dstAlpha/255) #undef MIN diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index c9739e8..dae166d 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.71 2009/12/02 21:16:45 nijtmans Exp $ + * RCS: @(#) $Id: tkStubInit.c,v 1.72 2010/02/05 22:45:03 nijtmans Exp $ */ #include "tkInt.h" @@ -47,9 +47,11 @@ * below should be made in the generic/tk.decls script. */ +MODULE_SCOPE const TkStubs tkConstStubs; + /* !BEGIN!: Do not edit below this line. */ -static const TkIntStubs tkIntStubs = { +static const TkIntStubs tkIntConstStubs = { TCL_STUB_MAGIC, NULL, TkAllocWindow, /* 0 */ @@ -334,7 +336,7 @@ static const TkIntStubs tkIntStubs = { TkSmoothPrintProc, /* 180 */ }; -static const TkIntPlatStubs tkIntPlatStubs = { +static const TkIntPlatStubs tkIntPlatConstStubs = { TCL_STUB_MAGIC, NULL, #ifdef __WIN32__ /* WIN */ @@ -450,7 +452,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { #endif /* X11 */ }; -static const TkIntXlibStubs tkIntXlibStubs = { +static const TkIntXlibStubs tkIntXlibConstStubs = { TCL_STUB_MAGIC, NULL, #ifdef __WIN32__ /* WIN */ @@ -658,7 +660,7 @@ static const TkIntXlibStubs tkIntXlibStubs = { #endif /* AQUA */ }; -static const TkPlatStubs tkPlatStubs = { +static const TkPlatStubs tkPlatConstStubs = { TCL_STUB_MAGIC, NULL, #ifdef __WIN32__ /* WIN */ @@ -685,13 +687,13 @@ static const TkPlatStubs tkPlatStubs = { }; static const TkStubHooks tkStubHooks = { - &tkPlatStubs, - &tkIntStubs, - &tkIntPlatStubs, - &tkIntXlibStubs + &tkPlatConstStubs, + &tkIntConstStubs, + &tkIntPlatConstStubs, + &tkIntXlibConstStubs }; -static const TkStubs tkStubs = { +const TkStubs tkConstStubs = { TCL_STUB_MAGIC, &tkStubHooks, Tk_MainLoop, /* 0 */ @@ -973,14 +975,3 @@ static const 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 diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c index ce47028..66fdb11 100644 --- a/generic/tkStubLib.c +++ b/generic/tkStubLib.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkStubLib.c,v 1.25 2008/04/27 22:38:58 dkf Exp $ + * RCS: @(#) $Id: tkStubLib.c,v 1.26 2010/02/05 22:45:03 nijtmans Exp $ */ /* @@ -90,11 +90,11 @@ Tk_InitStubs( const char *version, int exact) { - const char *actualVersion; - const TkStubs **stubsPtrPtr = &tkStubsPtr; /* squelch warning */ + ClientData pkgClientData = NULL; + const char *actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 0, + &pkgClientData); + const TkStubs *stubsPtr = pkgClientData; - actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 0, - (ClientData *) stubsPtrPtr); if (!actualVersion) { return NULL; } @@ -125,17 +125,18 @@ Tk_InitStubs( } } - if (!tkStubsPtr) { + if (!stubsPtr) { Tcl_SetResult(interp, "This implementation of Tk does not support stubs", TCL_STATIC); return NULL; } - tkPlatStubsPtr = tkStubsPtr->hooks->tkPlatStubs; - tkIntStubsPtr = tkStubsPtr->hooks->tkIntStubs; - tkIntPlatStubsPtr = tkStubsPtr->hooks->tkIntPlatStubs; - tkIntXlibStubsPtr = tkStubsPtr->hooks->tkIntXlibStubs; + tkPlatStubsPtr = stubsPtr->hooks->tkPlatStubs; + tkIntStubsPtr = stubsPtr->hooks->tkIntStubs; + tkIntPlatStubsPtr = stubsPtr->hooks->tkIntPlatStubs; + tkIntXlibStubsPtr = stubsPtr->hooks->tkIntXlibStubs; + tkStubsPtr = stubsPtr; return actualVersion; } diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 6dd8165..9a26d69 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.108 2010/01/10 20:27:23 nijtmans Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.109 2010/02/05 22:45:03 nijtmans Exp $ */ #include "tkInt.h" @@ -2923,7 +2923,7 @@ Tk_SafeInit( return Initialize(interp); } -MODULE_SCOPE const TkStubs * const tkConstStubsPtr; +MODULE_SCOPE const TkStubs tkConstStubs; /* *---------------------------------------------------------------------- @@ -3200,7 +3200,7 @@ Initialize( */ code = Tcl_PkgProvideEx(interp, "Tk", TK_PATCH_LEVEL, - (ClientData) tkConstStubsPtr); + (ClientData) &tkConstStubs); if (code != TCL_OK) { goto done; } diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index cc45c53..d4c14d0 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.47 2009/10/22 10:12:57 dkf Exp $ + * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.48 2010/02/05 22:45:03 nijtmans Exp $ */ #include "tkMacOSXPrivate.h" @@ -1117,7 +1117,7 @@ static Tcl_Interp *fontchooserInterp = NULL; static NSFont *fontPanelFont = nil; static NSMutableDictionary *fontPanelFontAttributes = nil; -static const char *fontchooserOptionStrings[] = { +static const char *const fontchooserOptionStrings[] = { "-parent", "-title", "-font", "-command", "-visible", NULL }; diff --git a/unix/tkUnixButton.c b/unix/tkUnixButton.c index 5e4c926..c4c9c44 100644 --- a/unix/tkUnixButton.c +++ b/unix/tkUnixButton.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: tkUnixButton.c,v 1.28 2010/01/13 23:08:11 nijtmans Exp $ + * RCS: @(#) $Id: tkUnixButton.c,v 1.29 2010/02/05 22:45:03 nijtmans Exp $ */ #include "tkInt.h" @@ -59,7 +59,7 @@ const Tk_ClassProcs tkpButtonProcs = { */ /* XPM */ -static const char *button_images[] = { +static const char *const button_images[] = { /* width height ncolors chars_per_pixel */ "52 26 7 1", /* colors */ diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index e09f66d..9539fbc 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixWm.c,v 1.79 2010/01/19 01:27:41 patthoyts Exp $ + * RCS: @(#) $Id: tkUnixWm.c,v 1.80 2010/02/05 22:45:03 nijtmans Exp $ */ #include "tkUnixInt.h" @@ -1003,7 +1003,7 @@ Tk_WmObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = clientData; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "aspect", "attributes", "client", "colormapwindows", "command", "deiconify", "focusmodel", "forget", "frame", "geometry", "grid", "group", "iconbitmap", diff --git a/win/.cvsignore b/win/.cvsignore index 83300ce..702b882 100644 --- a/win/.cvsignore +++ b/win/.cvsignore @@ -22,3 +22,4 @@ config.status *.exp *.manifest .#* +*.a diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index ebea91d..81d795c 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.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: tkWinDialog.c,v 1.69 2010/01/13 23:08:11 nijtmans Exp $ + * RCS: @(#) $Id: tkWinDialog.c,v 1.70 2010/02/05 22:45:03 nijtmans Exp $ * */ @@ -2718,7 +2718,7 @@ FontchooserConfigureCmd( Tk_Window tkwin = clientData; HookData *hdPtr = NULL; int i, r = TCL_OK; - static const char *optionStrings[] = { + static const char *const optionStrings[] = { "-parent", "-title", "-font", "-command", "-visible", NULL }; -- cgit v0.12