diff options
author | nijtmans <nijtmans> | 2007-01-18 23:56:43 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2007-01-18 23:56:43 (GMT) |
commit | 70241ed12dcc2b7c07c8f6d0e14654db03632683 (patch) | |
tree | 14d4b70e0f8f510d7c3dd57fd689e8587d0d74e1 | |
parent | 363c82a543b016cf30ea86ff60fcebcd66c64564 (diff) | |
download | tk-70241ed12dcc2b7c07c8f6d0e14654db03632683.zip tk-70241ed12dcc2b7c07c8f6d0e14654db03632683.tar.gz tk-70241ed12dcc2b7c07c8f6d0e14654db03632683.tar.bz2 |
various "const" additions, in line with TIP #27
-rw-r--r-- | generic/tk.h | 30 | ||||
-rw-r--r-- | generic/tkBind.c | 62 | ||||
-rw-r--r-- | generic/tkCmds.c | 58 | ||||
-rw-r--r-- | generic/tkFont.c | 90 | ||||
-rw-r--r-- | generic/tkInt.h | 4 | ||||
-rw-r--r-- | generic/tkUtil.c | 34 | ||||
-rw-r--r-- | win/tkWinFont.c | 4 | ||||
-rw-r--r-- | win/tkWinTest.c | 4 |
8 files changed, 143 insertions, 143 deletions
diff --git a/generic/tk.h b/generic/tk.h index 560967a..bb75692 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -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: tk.h,v 1.93 2007/01/05 00:00:50 nijtmans Exp $ + * RCS: @(#) $Id: tk.h,v 1.94 2007/01/18 23:56:43 nijtmans Exp $ */ #ifndef _TK @@ -123,7 +123,7 @@ typedef struct Tk_StyledElement_ *Tk_StyledElement; * Additional types exported to clients. */ -typedef CONST char *Tk_Uid; +typedef const char *Tk_Uid; /* * The enum below defines the valid types for Tk configuration options as @@ -986,13 +986,13 @@ typedef int Tk_ItemCoordProc _ANSI_ARGS_((Tcl_Interp *interp, #else typedef int Tk_ItemCreateProc _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int argc, - Tcl_Obj *CONST objv[])); + Tcl_Obj *const objv[])); typedef int Tk_ItemConfigureProc _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int argc, - Tcl_Obj *CONST objv[], int flags)); + Tcl_Obj *const objv[], int flags)); typedef int Tk_ItemCoordProc _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int argc, - Tcl_Obj *CONST argv[])); + Tcl_Obj *const argv[])); #endif typedef void Tk_ItemDeleteProc _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item *itemPtr, Display *display)); @@ -1197,7 +1197,7 @@ typedef int (Tk_ImageCreateProc) _ANSI_ARGS_((Tcl_Interp *interp, Tk_ImageMaster master, ClientData *masterDataPtr)); #else typedef int (Tk_ImageCreateProc) _ANSI_ARGS_((Tcl_Interp *interp, - char *name, int objc, Tcl_Obj *CONST objv[], Tk_ImageType *typePtr, + char *name, int objc, Tcl_Obj *const objv[], Tk_ImageType *typePtr, Tk_ImageMaster master, ClientData *masterDataPtr)); #endif typedef ClientData (Tk_ImageGetProc) _ANSI_ARGS_((Tk_Window tkwin, @@ -1316,20 +1316,20 @@ typedef int (Tk_ImageStringWriteProc) _ANSI_ARGS_((Tcl_Interp *interp, Tk_PhotoImageBlock *blockPtr)); #else typedef int (Tk_ImageFileMatchProc) _ANSI_ARGS_((Tcl_Channel chan, - CONST char *fileName, Tcl_Obj *format, int *widthPtr, + const char *fileName, Tcl_Obj *format, int *widthPtr, int *heightPtr, Tcl_Interp *interp)); typedef int (Tk_ImageStringMatchProc) _ANSI_ARGS_((Tcl_Obj *dataObj, Tcl_Obj *format, int *widthPtr, int *heightPtr, Tcl_Interp *interp)); typedef int (Tk_ImageFileReadProc) _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Channel chan, CONST char *fileName, Tcl_Obj *format, + Tcl_Channel chan, const char *fileName, Tcl_Obj *format, Tk_PhotoHandle imageHandle, int destX, int destY, int width, int height, int srcX, int srcY)); typedef int (Tk_ImageStringReadProc) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *dataObj, Tcl_Obj *format, Tk_PhotoHandle imageHandle, int destX, int destY, int width, int height, int srcX, int srcY)); typedef int (Tk_ImageFileWriteProc) _ANSI_ARGS_((Tcl_Interp *interp, - CONST char *fileName, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr)); + const char *fileName, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr)); typedef int (Tk_ImageStringWriteProc) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr)); #endif @@ -1398,16 +1398,16 @@ EXTERN void Tk_CreateOldPhotoImageFormat _ANSI_ARGS_(( */ typedef void (Tk_GetElementSizeProc) _ANSI_ARGS_((ClientData clientData, - char *recordPtr, CONST Tk_OptionSpec **optionsPtr, Tk_Window tkwin, + char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, int width, int height, int inner, int *widthPtr, int *heightPtr)); typedef void (Tk_GetElementBoxProc) _ANSI_ARGS_((ClientData clientData, - char *recordPtr, CONST Tk_OptionSpec **optionsPtr, Tk_Window tkwin, + char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, int x, int y, int width, int height, int inner, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr)); typedef int (Tk_GetElementBorderWidthProc) _ANSI_ARGS_((ClientData clientData, - char *recordPtr, CONST Tk_OptionSpec **optionsPtr, Tk_Window tkwin)); + char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin)); typedef void (Tk_DrawElementProc) _ANSI_ARGS_((ClientData clientData, - char *recordPtr, CONST Tk_OptionSpec **optionsPtr, Tk_Window tkwin, + char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, Drawable d, int x, int y, int width, int height, int state)); typedef struct Tk_ElementOptionSpec { @@ -1493,8 +1493,8 @@ typedef struct Tk_ElementSpec { #define Tk_Main(argc, argv, proc) \ Tk_MainEx(argc, argv, proc, Tcl_CreateInterp()) -CONST char * Tk_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, - CONST char *version, int exact)); +const char * Tk_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, + const char *version, int exact)); #ifndef USE_TK_STUBS diff --git a/generic/tkBind.c b/generic/tkBind.c index 1ee4e7d..4f37426 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.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: tkBind.c,v 1.41 2006/07/21 06:26:28 das Exp $ + * RCS: @(#) $Id: tkBind.c,v 1.42 2007/01/18 23:56:43 nijtmans Exp $ */ #include "tkPort.h" @@ -586,7 +586,7 @@ static int flagArray[TK_LASTEVENT] = { * event should be queued and the string used to specify the location. */ -static TkStateMap queuePosition[] = { +static const TkStateMap queuePosition[] = { {-1, "now"}, {TCL_QUEUE_HEAD, "head"}, {TCL_QUEUE_MARK, "mark"}, @@ -601,7 +601,7 @@ static TkStateMap queuePosition[] = { * data from an XEvent to the user. */ -static TkStateMap notifyMode[] = { +static const TkStateMap notifyMode[] = { {NotifyNormal, "NotifyNormal"}, {NotifyGrab, "NotifyGrab"}, {NotifyUngrab, "NotifyUngrab"}, @@ -609,7 +609,7 @@ static TkStateMap notifyMode[] = { {-1, NULL} }; -static TkStateMap notifyDetail[] = { +static const TkStateMap notifyDetail[] = { {NotifyAncestor, "NotifyAncestor"}, {NotifyVirtual, "NotifyVirtual"}, {NotifyInferior, "NotifyInferior"}, @@ -621,20 +621,20 @@ static TkStateMap notifyDetail[] = { {-1, NULL} }; -static TkStateMap circPlace[] = { +static const TkStateMap circPlace[] = { {PlaceOnTop, "PlaceOnTop"}, {PlaceOnBottom, "PlaceOnBottom"}, {-1, NULL} }; -static TkStateMap visNotify[] = { +static const TkStateMap visNotify[] = { {VisibilityUnobscured, "VisibilityUnobscured"}, {VisibilityPartiallyObscured, "VisibilityPartiallyObscured"}, {VisibilityFullyObscured, "VisibilityFullyObscured"}, {-1, NULL} }; -static TkStateMap configureRequestDetail[] = { +static const TkStateMap configureRequestDetail[] = { {None, "None"}, {Above, "Above"}, {Below, "Below"}, @@ -644,7 +644,7 @@ static TkStateMap configureRequestDetail[] = { {-1, NULL} }; -static TkStateMap propNotify[] = { +static const TkStateMap propNotify[] = { {PropertyNewValue, "NewValue"}, {PropertyDelete, "Delete"}, {-1, NULL} @@ -663,12 +663,12 @@ static int DeleteVirtualEvent(Tcl_Interp *interp, VirtualEventTable *vetPtr, char *virtString, char *eventString); static void DeleteVirtualEventTable(VirtualEventTable *vetPtr); -static void ExpandPercents(TkWindow *winPtr, CONST char *before, +static void ExpandPercents(TkWindow *winPtr, const char *before, XEvent *eventPtr,KeySym keySym,Tcl_DString *dsPtr); static void FreeTclBinding(ClientData clientData); static PatSeq * FindSequence(Tcl_Interp *interp, Tcl_HashTable *patternTablePtr, ClientData object, - CONST char *eventString, int create, + const char *eventString, int create, int allowVirtual, unsigned long *maskPtr); static void GetAllVirtualEvents(Tcl_Interp *interp, VirtualEventTable *vetPtr); @@ -679,7 +679,7 @@ static int GetVirtualEvent(Tcl_Interp *interp, static Tk_Uid GetVirtualEventUid(Tcl_Interp *interp, char *virtString); static int HandleEventGenerate(Tcl_Interp *interp, Tk_Window main, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void InitVirtualEventTable(VirtualEventTable *vetPtr); static PatSeq * MatchPatterns(TkDisplay *dispPtr, BindingTable *bindPtr, PatSeq *psPtr, @@ -688,7 +688,7 @@ static PatSeq * MatchPatterns(TkDisplay *dispPtr, static int NameToWindow(Tcl_Interp *interp, Tk_Window main, Tcl_Obj *objPtr, Tk_Window *tkwinPtr); static int ParseEventDescription(Tcl_Interp *interp, - CONST char **eventStringPtr, Pattern *patPtr, + const char **eventStringPtr, Pattern *patPtr, unsigned long *eventMaskPtr); static void DoWarp(ClientData clientData); @@ -950,9 +950,9 @@ Tk_CreateBinding( /* Table in which to create binding. */ ClientData object, /* Token for object with which binding is * associated. */ - CONST char *eventString, /* String describing event sequence that + const char *eventString, /* String describing event sequence that * triggers binding. */ - CONST char *command, /* Contains Tcl command to execute when + const char *command, /* Contains Tcl command to execute when * binding triggers. */ int append) /* 0 means replace any existing binding for * eventString; 1 means append to that @@ -1051,7 +1051,7 @@ TkCreateBindingProcedure( /* Table in which to create binding. */ ClientData object, /* Token for object with which binding is * associated. */ - CONST char *eventString, /* String describing event sequence that + const char *eventString, /* String describing event sequence that * triggers binding. */ TkBindEvalProc *eventProc, /* Function to invoke when binding triggers. * Must not be NULL. */ @@ -1129,7 +1129,7 @@ Tk_DeleteBinding( /* Table in which to delete binding. */ ClientData object, /* Token for object with which binding is * associated. */ - CONST char *eventString) /* String describing event sequence that + const char *eventString) /* String describing event sequence that * triggers binding. */ { BindingTable *bindPtr = (BindingTable *) bindingTable; @@ -1217,14 +1217,14 @@ Tk_DeleteBinding( *-------------------------------------------------------------- */ -CONST char * +const char * Tk_GetBinding( Tcl_Interp *interp, /* Interpreter for error reporting. */ Tk_BindingTable bindingTable, /* Table in which to look for binding. */ ClientData object, /* Token for object with which binding is * associated. */ - CONST char *eventString) /* String describing event sequence that + const char *eventString) /* String describing event sequence that * triggers binding. */ { BindingTable *bindPtr = (BindingTable *) bindingTable; @@ -1237,7 +1237,7 @@ Tk_GetBinding( return NULL; } if (psPtr->eventProc == EvalTclBinding) { - return (CONST char *) psPtr->clientData; + return (const char *) psPtr->clientData; } return ""; } @@ -2273,7 +2273,7 @@ static void ExpandPercents( TkWindow *winPtr, /* Window where event occurred: needed to get * input context. */ - CONST char *before, /* Command containing percent expressions to + const char *before, /* Command containing percent expressions to * be replaced. */ XEvent *eventPtr, /* X event containing information to be used * in % replacements. */ @@ -2286,7 +2286,7 @@ ExpandPercents( * list element. */ int number, flags, length; #define NUM_SIZE 40 - CONST char *string; + const char *string; Tcl_DString buf; char numStorage[NUM_SIZE+1]; @@ -2726,13 +2726,13 @@ Tk_EventObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int index; Tk_Window tkwin; VirtualEventTable *vetPtr; TkBindInfo bindInfo; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "add", "delete", "generate", "info", NULL }; @@ -3051,7 +3051,7 @@ DeleteVirtualEvent( eventPSPtr = FindSequence(interp, &vetPtr->patternTable, NULL, eventString, 0, 0, &eventMask); if (eventPSPtr == NULL) { - CONST char *string; + const char *string; string = Tcl_GetStringResult(interp); return (string[0] != '\0') ? TCL_ERROR : TCL_OK; @@ -3287,10 +3287,10 @@ HandleEventGenerate( Tcl_Interp *interp, /* Interp for errors return and name lookup. */ Tk_Window mainWin, /* Main window associated with interp. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { XEvent event; - CONST char *p; + const char *p; char *name, *windowName; int count, flags, synch, i, number, warp; Tcl_QueuePosition pos; @@ -3299,7 +3299,7 @@ HandleEventGenerate( TkWindow *mainPtr; unsigned long eventMask; Tcl_Obj *userDataObj; - static CONST char *fieldStrings[] = { + static const char *fieldStrings[] = { "-when", "-above", "-borderwidth", "-button", "-count", "-data", "-delta", "-detail", "-focus", "-height", @@ -3651,7 +3651,7 @@ HandleEventGenerate( } break; case EVENT_SEND: { - CONST char *value; + const char *value; value = Tcl_GetString(valuePtr); if (isdigit(UCHAR(value[0]))) { @@ -3985,7 +3985,7 @@ FindSequence( ClientData object, /* For binding table, token for object with * which binding is associated. For virtual * event table, NULL. */ - CONST char *eventString, /* String description of pattern to match on. + const char *eventString, /* String description of pattern to match on. * See user documentation for details. */ int create, /* 0 means don't create the entry if it * doesn't already exist. Non-zero means @@ -3997,7 +3997,7 @@ FindSequence( { Pattern pats[EVENT_BUFFER_SIZE]; int numPats, virtualFound; - CONST char *p; + const char *p; Pattern *patPtr; PatSeq *psPtr; Tcl_HashEntry *hPtr; @@ -4150,7 +4150,7 @@ FindSequence( static int ParseEventDescription( Tcl_Interp *interp, /* For error messages. */ - CONST char **eventStringPtr,/* On input, holds a pointer to start of event + const char **eventStringPtr,/* On input, holds a pointer to start of event * string. On exit, gets pointer to rest of * string after parsed event. */ Pattern *patPtr, /* Filled with the pattern parsed from the diff --git a/generic/tkCmds.c b/generic/tkCmds.c index 16df75d..04d1dc9 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.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: tkCmds.c,v 1.38 2006/03/13 18:19:18 dgp Exp $ + * RCS: @(#) $Id: tkCmds.c,v 1.39 2007/01/18 23:56:43 nijtmans Exp $ */ #include "tkPort.h" @@ -31,8 +31,8 @@ static TkWindow * GetTopHierarchy(Tk_Window tkwin); static char * WaitVariableProc(ClientData clientData, - Tcl_Interp *interp, CONST char *name1, - CONST char *name2, int flags); + Tcl_Interp *interp, const char *name1, + const char *name2, int flags); static void WaitVisibilityProc(ClientData clientData, XEvent *eventPtr); static void WaitWindowProc(ClientData clientData, @@ -60,9 +60,9 @@ Tk_BellObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - static CONST char *bellOptions[] = { + static const char *bellOptions[] = { "-displayof", "-nice", NULL }; enum options { TK_BELL_DISPLAYOF, TK_BELL_NICE }; @@ -125,7 +125,7 @@ Tk_BindObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window) clientData; TkWindow *winPtr; @@ -193,7 +193,7 @@ Tk_BindObjCmd( return TCL_ERROR; } } else if (objc == 3) { - CONST char *command; + const char *command; command = Tk_GetBinding(interp, winPtr->mainPtr->bindingTable, object, Tcl_GetString(objv[2])); @@ -311,7 +311,7 @@ Tk_BindtagsObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window) clientData; TkWindow *winPtr, *winPtr2; @@ -454,7 +454,7 @@ Tk_DestroyObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window window; Tk_Window tkwin = (Tk_Window) clientData; @@ -502,7 +502,7 @@ Tk_LowerObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window mainwin = (Tk_Window) clientData; Tk_Window tkwin, other; @@ -556,7 +556,7 @@ Tk_RaiseObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window mainwin = (Tk_Window) clientData; Tk_Window tkwin, other; @@ -609,11 +609,11 @@ Tk_TkObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int index; Tk_Window tkwin; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "appname", "caret", "scaling", "useinputmethods", "windowingsystem", "inactive", NULL }; @@ -662,7 +662,7 @@ Tk_TkObjCmd( Tcl_Obj *objPtr; TkCaret *caretPtr; Tk_Window window; - static CONST char *caretStrings[] = { + static const char *caretStrings[] = { "-x", "-y", "-height", NULL }; enum caretOptions { @@ -831,7 +831,7 @@ Tk_TkObjCmd( break; } case TK_WINDOWINGSYSTEM: { - CONST char *windowingsystem; + const char *windowingsystem; if (objc != 2) { Tcl_WrongNumArgs(interp, 2, objv, NULL); @@ -912,11 +912,11 @@ Tk_TkwaitObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window) clientData; int done, index; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "variable", "visibility", "window", NULL }; enum options { @@ -1017,8 +1017,8 @@ static char * WaitVariableProc( ClientData clientData, /* Pointer to integer to set to 1. */ Tcl_Interp *interp, /* Interpreter containing variable. */ - CONST char *name1, /* Name of variable. */ - CONST char *name2, /* Second part of variable name. */ + const char *name1, /* Name of variable. */ + const char *name2, /* Second part of variable name. */ int flags) /* Information about what happened. */ { int *donePtr = (int *) clientData; @@ -1078,9 +1078,9 @@ Tk_UpdateObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - static CONST char *updateOptions[] = {"idletasks", NULL}; + static const char *updateOptions[] = {"idletasks", NULL}; int flags, index; TkDisplay *dispPtr; @@ -1149,7 +1149,7 @@ Tk_WinfoObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int index, x, y, width, height, useX, useY, class, skip; char *string; @@ -1157,7 +1157,7 @@ Tk_WinfoObjCmd( Tk_Window tkwin; Tcl_Obj *resultPtr; - static TkStateMap visualMap[] = { + static const TkStateMap visualMap[] = { {PseudoColor, "pseudocolor"}, {GrayScale, "grayscale"}, {DirectColor, "directcolor"}, @@ -1166,7 +1166,7 @@ Tk_WinfoObjCmd( {StaticGray, "staticgray"}, {-1, NULL} }; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "cells", "children", "class", "colormapfull", "depth", "geometry", "height", "id", "ismapped", "manager", "name", "parent", @@ -1457,7 +1457,7 @@ Tk_WinfoObjCmd( Tcl_SetLongObj(resultPtr, (long) Tk_InternAtom(tkwin, string)); break; case WIN_ATOMNAME: { - CONST char *name; + const char *name; long id; skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin); @@ -1721,12 +1721,12 @@ Tk_WmObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin; TkWindow *winPtr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "aspect", "client", "command", "deiconify", "focusmodel", "frame", "geometry", "grid", "group", "iconbitmap", "iconify", "iconmask", @@ -1943,7 +1943,7 @@ int TkGetDisplayOf( Tcl_Interp *interp, /* Interpreter for error reporting. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[], /* Argument objects. If it is present, + Tcl_Obj *const objv[], /* Argument objects. If it is present, * "-displayof" should be in objv[0] and * objv[1] the name of a window. */ Tk_Window *tkwinPtr) /* On input, contains main window of @@ -2000,7 +2000,7 @@ TkDeadAppCmd( ClientData clientData, /* Dummy. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { Tcl_AppendResult(interp, "can't invoke \"", argv[0], "\" command: application has been destroyed", NULL); diff --git a/generic/tkFont.c b/generic/tkFont.c index 50f55f1..4a9fa37 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.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: tkFont.c,v 1.31 2007/01/03 04:10:54 nijtmans Exp $ + * RCS: @(#) $Id: tkFont.c,v 1.32 2007/01/18 23:56:43 nijtmans Exp $ */ #include "tkPort.h" @@ -66,7 +66,7 @@ typedef struct NamedFont { */ typedef struct LayoutChunk { - CONST char *start; /* Pointer to simple string to be displayed. + const char *start; /* Pointer to simple string to be displayed. * This is a pointer into the TkTextLayout's * string. */ int numBytes; /* The number of bytes in this chunk. */ @@ -91,7 +91,7 @@ typedef struct LayoutChunk { typedef struct TextLayout { Tk_Font tkfont; /* The font used when laying out the text. */ - CONST char *string; /* The string that was layed out. */ + const char *string; /* The string that was layed out. */ int width; /* The maximum width of all lines in the text * layout. */ int numChunks; /* Number of chunks actually used in following @@ -108,24 +108,24 @@ typedef struct TextLayout { * strings. */ -static TkStateMap weightMap[] = { +static const TkStateMap weightMap[] = { {TK_FW_NORMAL, "normal"}, {TK_FW_BOLD, "bold"}, {TK_FW_UNKNOWN, NULL} }; -static TkStateMap slantMap[] = { +static const TkStateMap slantMap[] = { {TK_FS_ROMAN, "roman"}, {TK_FS_ITALIC, "italic"}, {TK_FS_UNKNOWN, NULL} }; -static TkStateMap underlineMap[] = { +static const TkStateMap underlineMap[] = { {1, "underline"}, {0, NULL} }; -static TkStateMap overstrikeMap[] = { +static const TkStateMap overstrikeMap[] = { {1, "overstrike"}, {0, NULL} }; @@ -135,7 +135,7 @@ static TkStateMap overstrikeMap[] = { * TkFontAttributes. */ -static TkStateMap xlfdWeightMap[] = { +static const TkStateMap xlfdWeightMap[] = { {TK_FW_NORMAL, "normal"}, {TK_FW_NORMAL, "medium"}, {TK_FW_NORMAL, "book"}, @@ -146,14 +146,14 @@ static TkStateMap xlfdWeightMap[] = { {TK_FW_NORMAL, NULL} /* Assume anything else is "normal". */ }; -static TkStateMap xlfdSlantMap[] = { +static const TkStateMap xlfdSlantMap[] = { {TK_FS_ROMAN, "r"}, {TK_FS_ITALIC, "i"}, {TK_FS_OBLIQUE, "o"}, {TK_FS_ROMAN, NULL} /* Assume anything else is "roman". */ }; -static TkStateMap xlfdSetwidthMap[] = { +static const TkStateMap xlfdSetwidthMap[] = { {TK_SW_NORMAL, "normal"}, {TK_SW_CONDENSE, "narrow"}, {TK_SW_CONDENSE, "semicondensed"}, @@ -166,7 +166,7 @@ static TkStateMap xlfdSetwidthMap[] = { * configuring a set of font attributes. */ -static CONST char *fontOpt[] = { +static const char *fontOpt[] = { "-family", "-size", "-weight", @@ -317,24 +317,24 @@ static char *globalFontClass[] = { }; #define GetFontAttributes(tkfont) \ - ((CONST TkFontAttributes *) &((TkFont *) (tkfont))->fa) + ((const TkFontAttributes *) &((TkFont *) (tkfont))->fa) #define GetFontMetrics(tkfont) \ - ((CONST TkFontMetrics *) &((TkFont *) (tkfont))->fm) + ((const TkFontMetrics *) &((TkFont *) (tkfont))->fm) static int ConfigAttributesObj(Tcl_Interp *interp, - Tk_Window tkwin, int objc, Tcl_Obj *CONST objv[], + Tk_Window tkwin, int objc, Tcl_Obj *const objv[], TkFontAttributes *faPtr); static int CreateNamedFont(Tcl_Interp *interp, Tk_Window tkwin, - CONST char *name, TkFontAttributes *faPtr); + const char *name, TkFontAttributes *faPtr); static void DupFontObjProc(Tcl_Obj *srcObjPtr, Tcl_Obj *dupObjPtr); -static int FieldSpecified(CONST char *field); +static int FieldSpecified(const char *field); static void FreeFontObjProc(Tcl_Obj *objPtr); static int GetAttributeInfoObj(Tcl_Interp *interp, - CONST TkFontAttributes *faPtr, Tcl_Obj *objPtr); + const TkFontAttributes *faPtr, Tcl_Obj *objPtr); static LayoutChunk * NewChunk(TextLayout **layoutPtrPtr, int *maxPtr, - CONST char *start, int numChars, int curX, + const char *start, int numChars, int curX, int newX, int y); static int ParseFontNameObj(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, TkFontAttributes *faPtr); @@ -473,12 +473,12 @@ Tk_FontObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int index; Tk_Window tkwin; TkFontInfo *fiPtr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "actual", "configure", "create", "delete", "families", "measure", "metrics", "names", NULL @@ -510,7 +510,7 @@ Tk_FontObjCmd( Tcl_Obj *charPtr; Tcl_Obj *resultPtr; Tcl_UniChar uniChar = 0; - CONST TkFontAttributes *faPtr; + const TkFontAttributes *faPtr; TkFontAttributes fa; /* @@ -738,8 +738,8 @@ Tk_FontObjCmd( case FONT_METRICS: { Tk_Font tkfont; int skip, index, i; - CONST TkFontMetrics *fmPtr; - static CONST char *switches[] = { + const TkFontMetrics *fmPtr; + static const char *switches[] = { "-ascent", "-descent", "-linespace", "-fixed", NULL }; @@ -942,7 +942,7 @@ static int CreateNamedFont( Tcl_Interp *interp, /* Interp for error return. */ Tk_Window tkwin, /* A window associated with interp. */ - CONST char *name, /* Name for the new named font. */ + const char *name, /* Name for the new named font. */ TkFontAttributes *faPtr) /* Attributes for the new named font. */ { TkFontInfo *fiPtr; @@ -1010,7 +1010,7 @@ Tk_Font Tk_GetFont( Tcl_Interp *interp, /* Interp for database and error return. */ Tk_Window tkwin, /* For display on which font will be used. */ - CONST char *string) /* String describing font, as: named font, + const char *string) /* String describing font, as: named font, * native format, or parseable string. */ { Tk_Font tkfont; @@ -1331,7 +1331,7 @@ SetFontFromAny( *--------------------------------------------------------------------------- */ -CONST char * +const char * Tk_NameOfFont( Tk_Font tkfont) /* Font whose name is desired. */ { @@ -1760,7 +1760,7 @@ Tk_PostscriptFontName( int Tk_TextWidth( Tk_Font tkfont, /* Font in which text will be measured. */ - CONST char *string, /* String whose width will be computed. */ + const char *string, /* String whose width will be computed. */ int numBytes) /* Number of bytes to consider from string, or * < 0 for strlen(). */ { @@ -1805,7 +1805,7 @@ Tk_UnderlineChars( Tk_Font tkfont, /* Font used in GC; must have been allocated * by Tk_GetFont(). Used for character * dimensions, etc. */ - CONST char *string, /* String containing characters to be + const char *string, /* String containing characters to be * underlined or overstruck. */ int x, int y, /* Coordinates at which first character of * string is drawn. */ @@ -1832,7 +1832,7 @@ TkUnderlineCharsInContext(display, drawable, gc, tkfont, string, numBytes, Tk_Font tkfont; /* Font used in GC; must have been allocated * by Tk_GetFont(). Used for character * dimensions, etc. */ - CONST char *string; /* String containing characters to be + const char *string; /* String containing characters to be * underlined or overstruck. */ int numBytes; /* Number of bytes in string. */ int x, y; /* Coordinates at which the first character @@ -1888,7 +1888,7 @@ TkUnderlineCharsInContext(display, drawable, gc, tkfont, string, numBytes, Tk_TextLayout Tk_ComputeTextLayout( Tk_Font tkfont, /* Font that will be used to display text. */ - CONST char *string, /* String whose dimensions are to be + const char *string, /* String whose dimensions are to be * computed. */ int numChars, /* Number of characters to consider from * string, or < 0 for strlen(). */ @@ -1905,12 +1905,12 @@ Tk_ComputeTextLayout( int *heightPtr) /* Filled with height of string. */ { TkFont *fontPtr; - CONST char *start, *end, *special; + const char *start, *end, *special; int n, y, bytesThisChunk, maxChunks; int baseline, height, curX, newX, maxWidth; TextLayout *layoutPtr; LayoutChunk *chunkPtr; - CONST TkFontMetrics *fmPtr; + const TkFontMetrics *fmPtr; Tcl_DString lineBuffer; int *lineLengths; int curLine, layoutHeight; @@ -2059,7 +2059,7 @@ Tk_ComputeTextLayout( start++; } if (chunkPtr != NULL) { - CONST char *end; + const char *end; /* * Append all the extra spaces on this line to the end of the last @@ -2241,8 +2241,8 @@ Tk_DrawTextLayout( { TextLayout *layoutPtr; int i, numDisplayChars, drawX; - CONST char *firstByte; - CONST char *lastByte; + const char *firstByte; + const char *lastByte; LayoutChunk *chunkPtr; layoutPtr = (TextLayout *) layout; @@ -2527,7 +2527,7 @@ Tk_CharBbox( int i, x, w; Tk_Font tkfont; TkFont *fontPtr; - CONST char *end; + const char *end; if (index < 0) { return 0; @@ -2827,7 +2827,7 @@ Tk_TextLayoutToPostscript( LayoutChunk *chunkPtr; int i, j, used, c, baseline; Tcl_UniChar ch; - CONST char *p, *last_p,*glyphname; + const char *p, *last_p,*glyphname; TextLayout *layoutPtr; char uindex[5]="\0\0\0\0"; char one_char[5]; @@ -2957,7 +2957,7 @@ ConfigAttributesObj( Tcl_Interp *interp, /* Interp for error return. */ Tk_Window tkwin, /* For display on which font will be used. */ int objc, /* Number of elements in argv. */ - Tcl_Obj *CONST objv[], /* Command line options. */ + Tcl_Obj *const objv[], /* Command line options. */ TkFontAttributes *faPtr) /* Font attributes structure whose fields are * to be modified. Structure must already be * properly initialized. */ @@ -3055,14 +3055,14 @@ ConfigAttributesObj( static int GetAttributeInfoObj( Tcl_Interp *interp, /* Interp to hold result. */ - CONST TkFontAttributes *faPtr, + const TkFontAttributes *faPtr, /* The font attributes to inspect. */ Tcl_Obj *objPtr) /* If non-NULL, indicates the single option * whose value is to be returned. Otherwise * information is returned for all options. */ { int i, index, start, end; - CONST char *str; + const char *str; Tcl_Obj *optionPtr, *valuePtr, *resultPtr; resultPtr = Tcl_GetObjResult(interp); @@ -3290,7 +3290,7 @@ static LayoutChunk * NewChunk( TextLayout **layoutPtrPtr, int *maxPtr, - CONST char *start, + const char *start, int numBytes, int curX, int newX, @@ -3346,7 +3346,7 @@ NewChunk( int TkFontParseXLFD( - CONST char *string, /* Parseable font description string. */ + const char *string, /* Parseable font description string. */ TkFontAttributes *faPtr, /* Filled with attributes parsed from font * name. Any attributes that were not * specified in font name are filled with @@ -3358,7 +3358,7 @@ TkFontParseXLFD( * information is not desired. */ { char *src; - CONST char *str; + const char *str; int i, j; char *field[XLFD_NUMFIELDS + 2]; Tcl_DString ds; @@ -3547,7 +3547,7 @@ TkFontParseXLFD( static int FieldSpecified( - CONST char *field) /* The field of the XLFD to check. Strictly + const char *field) /* The field of the XLFD to check. Strictly * speaking, only when the string is "*" does * it mean don't-care. However, an unspecified * or question mark is also interpreted as @@ -3651,7 +3651,7 @@ TkFontGetPoints( char ** TkFontGetAliasList( - CONST char *faceName) /* Font name to test for aliases. */ + const char *faceName) /* Font name to test for aliases. */ { int i, j; diff --git a/generic/tkInt.h b/generic/tkInt.h index 50af9ef..627ec58 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -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: tkInt.h,v 1.76 2007/01/03 05:06:27 nijtmans Exp $ + * RCS: $Id: tkInt.h,v 1.77 2007/01/18 23:56:43 nijtmans Exp $ */ #ifndef _TKINT @@ -845,7 +845,7 @@ typedef struct TkWindow { typedef struct TkStateMap { int numKey; /* Integer representation of a value. */ - char *strKey; /* String representation of a value. */ + const char *strKey; /* String representation of a value. */ } TkStateMap; /* diff --git a/generic/tkUtil.c b/generic/tkUtil.c index 3af56e4..543bf2d 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.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: tkUtil.c,v 1.14 2005/11/13 20:42:54 dkf Exp $ + * RCS: @(#) $Id: tkUtil.c,v 1.15 2007/01/18 23:56:43 nijtmans Exp $ */ #include "tkInt.h" @@ -52,7 +52,7 @@ TkStateParseProc( ClientData clientData, /* some flags.*/ Tcl_Interp *interp, /* Used for reporting errors. */ Tk_Window tkwin, /* Window containing canvas widget. */ - CONST char *value, /* Value of option. */ + const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ int offset) /* Offset into item. */ { @@ -172,7 +172,7 @@ TkOrientParseProc( ClientData clientData, /* some flags.*/ Tcl_Interp *interp, /* Used for reporting errors. */ Tk_Window tkwin, /* Window containing canvas widget. */ - CONST char *value, /* Value of option. */ + const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ int offset) /* Offset into item. */ { @@ -259,13 +259,13 @@ TkOffsetParseProc( ClientData clientData, /* not used */ Tcl_Interp *interp, /* Interpreter to send results back to */ Tk_Window tkwin, /* Window on same display as tile */ - CONST char *value, /* Name of image */ + const char *value, /* Name of image */ char *widgRec, /* Widget structure record */ int offset) /* Offset of tile in record */ { Tk_TSOffset *offsetPtr = (Tk_TSOffset *)(widgRec + offset); Tk_TSOffset tsoffset; - CONST char *q, *p; + const char *q, *p; int result; if ((value == NULL) || (*value == 0)) { @@ -466,7 +466,7 @@ TkPixelParseProc( * well */ Tcl_Interp *interp, /* Interpreter to send results back to */ Tk_Window tkwin, /* Window on same display as tile */ - CONST char *value, /* Name of image */ + const char *value, /* Name of image */ char *widgRec, /* Widget structure record */ int offset) /* Offset of tile in record */ { @@ -629,7 +629,7 @@ int Tk_GetScrollInfo( Tcl_Interp *interp, /* Used for error reporting. */ int argc, /* # arguments for command. */ - CONST char **argv, /* Arguments for command. */ + const char **argv, /* Arguments for command. */ double *dblPtr, /* Filled in with argument "moveto" option, if * any. */ int *intPtr) /* Filled in with number of pages or lines to @@ -705,7 +705,7 @@ int Tk_GetScrollInfoObj( Tcl_Interp *interp, /* Used for error reporting. */ int objc, /* # arguments for command. */ - Tcl_Obj *CONST objv[], /* Arguments for command. */ + Tcl_Obj *const objv[], /* Arguments for command. */ double *dblPtr, /* Filled in with argument "moveto" option, if * any. */ int *intPtr) /* Filled in with number of pages or lines to @@ -845,7 +845,7 @@ TkComputeAnchor( char * TkFindStateString( - CONST TkStateMap *mapPtr, /* The state table. */ + const TkStateMap *mapPtr, /* The state table. */ int numKey) /* The key to try to find in the table. */ { for ( ; mapPtr->strKey != NULL; mapPtr++) { @@ -880,11 +880,11 @@ TkFindStateString( int TkFindStateNum( Tcl_Interp *interp, /* Interp for error reporting. */ - CONST char *option, /* String to use when constructing error. */ - CONST TkStateMap *mapPtr, /* Lookup table. */ - CONST char *strKey) /* String to try to find in lookup table. */ + const char *option, /* String to use when constructing error. */ + const TkStateMap *mapPtr, /* Lookup table. */ + const char *strKey) /* String to try to find in lookup table. */ { - CONST TkStateMap *mPtr; + const TkStateMap *mPtr; for (mPtr = mapPtr; mPtr->strKey != NULL; mPtr++) { if (strcmp(strKey, mPtr->strKey) == 0) { @@ -908,12 +908,12 @@ int TkFindStateNumObj( Tcl_Interp *interp, /* Interp for error reporting. */ Tcl_Obj *optionPtr, /* String to use when constructing error. */ - CONST TkStateMap *mapPtr, /* Lookup table. */ + const TkStateMap *mapPtr, /* Lookup table. */ Tcl_Obj *keyPtr) /* String key to find in lookup table. */ { - CONST TkStateMap *mPtr; - CONST char *key; - CONST Tcl_ObjType *typePtr; + const TkStateMap *mPtr; + const char *key; + const Tcl_ObjType *typePtr; if ((keyPtr->typePtr == &tkStateKeyObjType) && (keyPtr->internalRep.twoPtrValue.ptr1 == (VOID *) mapPtr)) { diff --git a/win/tkWinFont.c b/win/tkWinFont.c index a86a6bd..2f5671b 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.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: tkWinFont.c,v 1.30 2007/01/12 10:41:23 dkf Exp $ + * RCS: @(#) $Id: tkWinFont.c,v 1.31 2007/01/18 23:56:44 nijtmans Exp $ */ #include "tkWinInt.h" @@ -157,7 +157,7 @@ typedef struct CanUse { * represent the system fonts and the numbers used by Windows. */ -static TkStateMap systemMap[] = { +static const TkStateMap systemMap[] = { {ANSI_FIXED_FONT, "ansifixed"}, {ANSI_VAR_FONT, "ansi"}, {DEVICE_DEFAULT_FONT, "device"}, diff --git a/win/tkWinTest.c b/win/tkWinTest.c index 195605a..d73f159 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.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: tkWinTest.c,v 1.11 2005/12/09 00:48:54 das Exp $ + * RCS: @(#) $Id: tkWinTest.c,v 1.12 2007/01/18 23:56:44 nijtmans Exp $ */ #include "tkWinInt.h" @@ -237,7 +237,7 @@ TestwineventCmd( UINT message; WPARAM wParam; LPARAM lParam; - static TkStateMap messageMap[] = { + static const TkStateMap messageMap[] = { {WM_LBUTTONDOWN, "WM_LBUTTONDOWN"}, {WM_LBUTTONUP, "WM_LBUTTONUP"}, {WM_CHAR, "WM_CHAR"}, |