/* Copyright (c) 2008-2009, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * --- * Author: Kostya Serebryany */ #ifdef _MSC_VER # include #endif #ifdef __cplusplus # error "This file should be built as pure C to avoid name mangling" #endif #include #include #include "dynamic_annotations.h" /* Each function is empty and called (via a macro) only in debug mode. The arguments are captured by dynamic tools at runtime. */ #if DYNAMIC_ANNOTATIONS_ENABLED == 1 void AnnotateRWLockCreate(const char *file, int line, const volatile void *lock){} void AnnotateRWLockDestroy(const char *file, int line, const volatile void *lock){} void AnnotateRWLockAcquired(const char *file, int line, const volatile void *lock, long is_w){} void AnnotateRWLockReleased(const char *file, int line, const volatile void *lock, long is_w){} void AnnotateBarrierInit(const char *file, int line, const volatile void *barrier, long count, long reinitialization_allowed) {} void AnnotateBarrierWaitBefore(const char *file, int line, const volatile void *barrier) {} void AnnotateBarrierWaitAfter(const char *file, int line, const volatile void *barrier) {} void AnnotateBarrierDestroy(const char *file, int line, const volatile void *barrier) {} void AnnotateCondVarWait(const char *file, int line, const volatile void *cv, const volatile void *lock){} void AnnotateCondVarSignal(const char *file, int line, const volatile void *cv){} void AnnotateCondVarSignalAll(const char *file, int line, const volatile void *cv){} void AnnotatePublishMemoryRange(const char *file, int line, const volatile void *address, long size){} void AnnotateUnpublishMemoryRange(const char *file, int line, const volatile void *address, long size){} void AnnotatePCQCreate(const char *file, int line, const volatile void *pcq){} void AnnotatePCQDestroy(const char *file, int line, const volatile void *pcq){} void AnnotatePCQPut(const char *file, int line, const volatile void *pcq){} void AnnotatePCQGet(const char *file, int line, const volatile void *pcq){} void AnnotateNewMemory(const char *file, int line, const volatile void *mem, long size){} void AnnotateExpectRace(const char *file, int line, const volatile void *mem, const char *description){} void AnnotateBenignRace(const char *file, int line, const volatile void *mem, const char *description){} void AnnotateBenignRaceSized(const char *file, int line, const volatile void *mem, long size, const char *description) {} void AnnotateMutexIsUsedAsCondVar(const char *file, int line, const volatile void *mu){} void AnnotateTraceMemory(const char *file, int line, const volatile void *arg){} void AnnotateThreadName(const char *file, int line, const char *name){} void AnnotateIgnoreReadsBegin(const char *file, int line){} void AnnotateIgnoreReadsEnd(const char *file, int line){} void AnnotateIgnoreWritesBegin(const char *file, int line){} void AnnotateIgnoreWritesEnd(const char *file, int line){} void AnnotateIgnoreSyncBegin(const char *file, int line){} void AnnotateIgnoreSyncEnd(const char *file, int line){} void AnnotateEnableRaceDetection(const char *file, int line, int enable){} void AnnotateNoOp(const char *file, int line, const volatile void *arg){} void AnnotateFlushState(const char *file, int line){} static int GetRunningOnValgrind(void) { #ifdef RUNNING_ON_VALGRIND if (RUNNING_ON_VALGRIND) return 1; #endif #ifndef _MSC_VER char *running_on_valgrind_str = getenv("RUNNING_ON_VALGRIND"); if (running_on_valgrind_str) { return strcmp(running_on_valgrind_str, "0") != 0; } #else /* Visual Studio issues warnings if we use getenv, * so we use GetEnvironmentVariableA instead. */ char value[100] = "1"; int res = GetEnvironmentVariableA("RUNNING_ON_VALGRIND", value, sizeof(value)); /* value will remain "1" if res == 0 or res >= sizeof(value). The latter * can happen only if the given value is long, in this case it can't be "0". */ if (res > 0 && !strcmp(value, "0")) return 1; #endif return 0; } /* See the comments in dynamic_annotations.h */ int RunningOnValgrind(void) { static volatile int running_on_valgrind = -1; /* C doesn't have thread-safe initialization of statics, and we don't want to depend on pthread_once here, so hack it. */ int local_running_on_valgrind = running_on_valgrind; if (local_running_on_valgrind == -1) running_on_valgrind = local_running_on_valgrind = GetRunningOnValgrind(); return local_running_on_valgrind; } #endif /* DYNAMIC_ANNOTATIONS_ENABLED == 1 */ /tkIntDecls.h: + * generic/tkIntPlatDecls.h: + * generic/tkListbox.c: + * generic/tkMenu.c: + * generic/tkMenubutton.c: + * generic/tkMessage.c: + * generic/tkOldConfig.c: + * generic/tkOption.c: + * generic/tkRectOval.c: + * generic/tkScale.c: + * generic/tkScrollbar.c: + * generic/tkSelect.c: + * generic/tkStyle.c: + * generic/tkTest.c: + * generic/tkText.c: + * generic/tkText.h: + * generic/tkTextBTree.c: + * generic/tkTextDisp.c: + * generic/tkTextImage.c: + * generic/tkTextIndex.c: + * generic/tkTextMark.c: + * generic/tkTextTag.c: + * generic/tkTextWind.c: + * generic/tkUtil.c: + * generic/tkVisual.c: + * generic/tkWindow.c: + * mac/tkMacConfig.c: + * mac/tkMacCursor.c: + * mac/tkMacEmbed.c: + * mac/tkMacSend.c: + * unix/tkUnixConfig.c: + * unix/tkUnixCursor.c: + * unix/tkUnixEmbed.c: + * unix/tkUnixFont.c: + * unix/tkUnixSelect.c: + * unix/tkUnixSend.c: + * unix/tkUnixWm.c: + * win/tkWinConfig.c: + * win/tkWinCursor.c: + * win/tkWinEmbed.c: + * win/tkWinMenu.c: + * win/tkWinSend.c: + 2002-08-02 Donal K. Fellows * generic/tkPanedWindow.c (DestroyPanedWindow): Idle calls need to diff --git a/doc/3DBorder.3 b/doc/3DBorder.3 index 2780bde..4ad5803 100644 --- a/doc/3DBorder.3 +++ b/doc/3DBorder.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: 3DBorder.3,v 1.3 1999/04/16 01:51:07 stanton Exp $ +'\" RCS: @(#) $Id: 3DBorder.3,v 1.4 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_Alloc3DBorderFromObj 3 8.1 Tk "Tk Library Procedures" @@ -48,7 +48,7 @@ void void \fBTk_SetBackgroundFromBorder(\fItkwin, border\fB)\fR .sp -char * +CONST char * \fBTk_NameOf3DBorder(\fIborder\fB)\fR .sp XColor * diff --git a/doc/BindTable.3 b/doc/BindTable.3 index a2cfbf9..a4e9f28 100644 --- a/doc/BindTable.3 +++ b/doc/BindTable.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: BindTable.3,v 1.2 1998/09/14 18:22:45 stanton Exp $ +'\" RCS: @(#) $Id: BindTable.3,v 1.3 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_CreateBindingTable 3 4.0 Tk "Tk Library Procedures" @@ -27,7 +27,7 @@ unsigned long int \fBTk_DeleteBinding(\fIinterp, bindingTable, object, eventString\fB)\fR .sp -char * +CONST char * \fBTk_GetBinding(\fIinterp, bindingTable, object, eventString\fB)\fR .sp \fBTk_GetAllBindings(\fIinterp, bindingTable, object\fB)\fR @@ -45,7 +45,7 @@ Token for binding table; must have been returned by some previous call to \fBTk_CreateBindingTable\fR. .AP ClientData object in Identifies object with which binding is associated. -.AP char *eventString in +.AP "CONST char" *eventString in String describing event sequence. .AP char *script in Tcl script to invoke when binding triggers. diff --git a/doc/ConfigWidg.3 b/doc/ConfigWidg.3 index dff452d..87ab6e9 100644 --- a/doc/ConfigWidg.3 +++ b/doc/ConfigWidg.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ConfigWidg.3,v 1.7 2000/11/21 16:35:27 dkf Exp $ +'\" RCS: @(#) $Id: ConfigWidg.3,v 1.8 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_ConfigureWidget 3 4.1 Tk "Tk Library Procedures" @@ -40,7 +40,7 @@ Pointer to table specifying legal configuration options for this widget. .AP int argc in Number of arguments in \fIargv\fR. -.AP char **argv in +.AP "CONST char" **argv in Command-line options for configuring widget. .AP char *widgRec in/out Points to widget record structure. Fields in this structure get @@ -55,7 +55,7 @@ selectively disable entries in \fIspecs\fR. The name of the type of a widget record. .AP "field name" field in The name of a field in records of type \fItype\fR. -.AP char *argvName in +.AP "CONST char" *argvName in The name used on Tcl command lines to refer to a particular option (e.g. when creating a widget or invoking the \fBconfigure\fR widget command). If non-NULL, then information is returned only for this diff --git a/doc/CrtImgType.3 b/doc/CrtImgType.3 index 1cbfc38..0793ca0 100644 --- a/doc/CrtImgType.3 +++ b/doc/CrtImgType.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtImgType.3,v 1.5 2000/07/25 21:14:34 jenglish Exp $ +'\" RCS: @(#) $Id: CrtImgType.3,v 1.6 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_CreateImageType 3 8.3 Tk "Tk Library Procedures" @@ -31,7 +31,7 @@ Must be static: a pointer to this structure is retained by the image code. .AP Tcl_Interp *interp in Interpreter in which image was created. -.AP char *name in +.AP "CONST char" *name in Name of existing image. .AP Tk_ImageType **typePtrPtr out Points to word in which to store a pointer to type information for diff --git a/doc/CrtWindow.3 b/doc/CrtWindow.3 index 874d76e..e09fdef 100644 --- a/doc/CrtWindow.3 +++ b/doc/CrtWindow.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtWindow.3,v 1.5 2000/10/05 18:31:24 ericm Exp $ +'\" RCS: @(#) $Id: CrtWindow.3,v 1.6 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_CreateWindow 3 4.2 Tk "Tk Library Procedures" @@ -36,10 +36,10 @@ then \fI*interp\fR isn't modified. .AP Tk_Window parent in Token for the window that is to serve as the logical parent of the new window. -.AP char *name in +.AP "CONST char" *name in Name to use for this window. Must be unique among all children of the same \fIparent\fR. -.AP char *topLevScreen in +.AP "CONST char" *topLevScreen in Has same format as \fIscreenName\fR. If NULL, then new window is created as an internal window. If non-NULL, new window is created as a top-level window on screen \fItopLevScreen\fR. If \fItopLevScreen\fR @@ -47,7 +47,7 @@ is an empty string (``'') then new window is created as top-level window of \fIparent\fR's screen. .AP Tk_Window tkwin in Token for window. -.AP char *pathName in +.AP "CONST char" *pathName in Name of new window, specified as path name within application (e.g. \fB.a.b.c\fR). .BE diff --git a/doc/DeleteImg.3 b/doc/DeleteImg.3 index bf569af..797b489 100644 --- a/doc/DeleteImg.3 +++ b/doc/DeleteImg.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: DeleteImg.3,v 1.2 1998/09/14 18:22:47 stanton Exp $ +'\" RCS: @(#) $Id: DeleteImg.3,v 1.3 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_DeleteImage 3 4.0 Tk "Tk Library Procedures" @@ -20,7 +20,7 @@ Tk_DeleteImage \- Destroy an image. .AS Tcl_Interp *interp .AP Tcl_Interp *interp in Interpreter for which the image was created. -.AP char *name in +.AP "CONST char" *name in Name of the image. .BE diff --git a/doc/FindPhoto.3 b/doc/FindPhoto.3 index 9116252..eb86eac 100644 --- a/doc/FindPhoto.3 +++ b/doc/FindPhoto.3 @@ -9,7 +9,7 @@ '\" Department of Computer Science, '\" Australian National University. '\" -'\" RCS: @(#) $Id: FindPhoto.3,v 1.5 2002/06/14 14:07:50 dkf Exp $ +'\" RCS: @(#) $Id: FindPhoto.3,v 1.6 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_FindPhoto 3 8.0 Tk "Tk Library Procedures" @@ -53,7 +53,7 @@ void .VS Interpreter in which image was created. .VE -.AP char *imageName in +.AP "CONST char" *imageName in Name of the photo image. .AP Tk_PhotoHandle handle in Opaque handle identifying the photo image to be affected. diff --git a/doc/GetAnchor.3 b/doc/GetAnchor.3 index b12d48f..a992980 100644 --- a/doc/GetAnchor.3 +++ b/doc/GetAnchor.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetAnchor.3,v 1.3 1999/04/16 01:51:08 stanton Exp $ +'\" RCS: @(#) $Id: GetAnchor.3,v 1.4 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_GetAnchorFromObj 3 8.1 Tk "Tk Library Procedures" @@ -24,7 +24,7 @@ int int \fBTk_GetAnchor(\fIinterp, string, anchorPtr\fB)\fR .sp -char * +CONST char * \fBTk_NameOfAnchor(\fIanchor\fB)\fR .SH ARGUMENTS .AS "Tk_Anchor" *anchorPtr @@ -35,7 +35,7 @@ Interpreter to use for error reporting, or NULL. String value contains name of anchor point: \fBn\fR, \fBne\fR, \fBe\fR, \fBse\fR, \fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR; internal rep will be modified to cache corresponding Tk_Anchor. -.AP char *string in +.AP "CONST char" *string in Same as \fIobjPtr\fR except description of anchor point is passed as a string. .VE diff --git a/doc/GetBitmap.3 b/doc/GetBitmap.3 index 28b5cb1..f056bec 100644 --- a/doc/GetBitmap.3 +++ b/doc/GetBitmap.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetBitmap.3,v 1.3 1999/04/16 01:51:08 stanton Exp $ +'\" RCS: @(#) $Id: GetBitmap.3,v 1.4 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_AllocBitmapFromObj 3 8.1 Tk "Tk Library Procedures" @@ -30,7 +30,7 @@ Pixmap int \fBTk_DefineBitmap(\fIinterp, name, source, width, height\fB)\fR .sp -char * +CONST char * \fBTk_NameOfBitmap(\fIdisplay, bitmap\fB)\fR .sp \fBTk_SizeOfBitmap(\fIdisplay, bitmap, widthPtr, heightPtr\fB)\fR @@ -57,7 +57,7 @@ resulting Pixmap isn't cached. .VE .AP "CONST char" *name in Name for new bitmap to be defined. -.AP char *source in +.AP "CONST char" *source in Data for bitmap, in standard bitmap format. Must be stored in static memory whose value will never change. .AP "int" width in diff --git a/doc/GetCapStyl.3 b/doc/GetCapStyl.3 index e25c2d6..4cf3b50 100644 --- a/doc/GetCapStyl.3 +++ b/doc/GetCapStyl.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetCapStyl.3,v 1.2 1998/09/14 18:22:48 stanton Exp $ +'\" RCS: @(#) $Id: GetCapStyl.3,v 1.3 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_GetCapStyle 3 "" Tk "Tk Library Procedures" @@ -19,13 +19,13 @@ Tk_GetCapStyle, Tk_NameOfCapStyle \- translate between strings and cap styles int \fBTk_GetCapStyle(\fIinterp, string, capPtr\fB)\fR .sp -char * +CONST char * \fBTk_NameOfCapStyle(\fIcap\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *capPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting. -.AP char *string in +.AP "CONST char" *string in String containing name of cap style: one of ```butt'', ``projecting'', or ``round''. .AP int *capPtr out diff --git a/doc/GetClrmap.3 b/doc/GetClrmap.3 index 625fdb4..ebd08a0 100644 --- a/doc/GetClrmap.3 +++ b/doc/GetClrmap.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetClrmap.3,v 1.2 1998/09/14 18:22:48 stanton Exp $ +'\" RCS: @(#) $Id: GetClrmap.3,v 1.3 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_GetColormap 3 4.0 Tk "Tk Library Procedures" @@ -26,7 +26,7 @@ Colormap Interpreter to use for error reporting. .AP Tk_Window tkwin in Token for window in which colormap will be used. -.AP char *string in +.AP "CONST char" *string in Selects a colormap: either \fBnew\fR or the name of a window with the same screen and visual as \fItkwin\fR. .AP Display *display in diff --git a/doc/GetColor.3 b/doc/GetColor.3 index d5abc78..8b122ca 100644 --- a/doc/GetColor.3 +++ b/doc/GetColor.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetColor.3,v 1.3 1999/04/16 01:51:08 stanton Exp $ +'\" RCS: @(#) $Id: GetColor.3,v 1.4 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_AllocColorFromObj 3 8.1 Tk "Tk Library Procedures" @@ -30,7 +30,7 @@ XColor * XColor * \fBTk_GetColorByValue(\fItkwin, prefPtr\fB)\fR .sp -char * +CONST char * \fBTk_NameOfColor(\fIcolorPtr\fB)\fR .sp GC diff --git a/doc/GetCursor.3 b/doc/GetCursor.3 index 4ae8521..4ceee0f 100644 --- a/doc/GetCursor.3 +++ b/doc/GetCursor.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetCursor.3,v 1.4 1999/12/16 21:57:11 hobbs Exp $ +'\" RCS: @(#) $Id: GetCursor.3,v 1.5 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_AllocCursorFromObj 3 8.1 Tk "Tk Library Procedures" @@ -30,7 +30,7 @@ Tk_Cursor Tk_Cursor \fBTk_GetCursorFromData(\fIinterp, tkwin, source, mask, width, height, xHot, yHot, fg, bg\fB)\fR .sp -char * +CONST char * \fBTk_NameOfCursor(\fIdisplay, cursor\fB)\fR .sp .VS 8.1 @@ -52,9 +52,9 @@ modified to cache pointer to corresponding Tk_Cursor. Same as \fIobjPtr\fR except description of cursor is passed as a string and resulting Tk_Cursor isn't cached. .VE -.AP char *source in +.AP "CONST char" *source in Data for cursor cursor, in standard cursor format. -.AP char *mask in +.AP "CONST char" *mask in Data for mask cursor, in standard cursor format. .AP "int" width in Width of \fIsource\fR and \fImask\fR. diff --git a/doc/GetFont.3 b/doc/GetFont.3 index eb9692a..8e40eb4 100644 --- a/doc/GetFont.3 +++ b/doc/GetFont.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetFont.3,v 1.4 2000/07/25 21:14:34 jenglish Exp $ +'\" RCS: @(#) $Id: GetFont.3,v 1.5 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_AllocFontFromObj 3 8.1 Tk "Tk Library Procedures" @@ -27,7 +27,7 @@ Tk_Font \fBTk_GetFontFromObj(\fItkwin, objPtr\fB)\fR .VE .sp -char * +CONST char * \fBTk_NameOfFont(\fItkfont\fB)\fR .sp .VS 8.1 diff --git a/doc/GetImage.3 b/doc/GetImage.3 index 4dbdc6f..6b78dc4 100644 --- a/doc/GetImage.3 +++ b/doc/GetImage.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetImage.3,v 1.4 1999/04/21 21:53:22 rjohnson Exp $ +'\" RCS: @(#) $Id: GetImage.3,v 1.5 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_GetImage 3 4.0 Tk "Tk Library Procedures" @@ -30,7 +30,7 @@ Tk_Image Place to leave error message. .AP Tk_Window tkwin in Window in which image will be used. -.AP char *name in +.AP "CONST char" *name in Name of image. .AP Tk_ImageChangedProc *changeProc in Procedure for Tk to invoke whenever image content or size changes. diff --git a/doc/GetJoinStl.3 b/doc/GetJoinStl.3 index 757adde..1139582 100644 --- a/doc/GetJoinStl.3 +++ b/doc/GetJoinStl.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetJoinStl.3,v 1.2 1998/09/14 18:22:49 stanton Exp $ +'\" RCS: @(#) $Id: GetJoinStl.3,v 1.3 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_GetJoinStyle 3 "" Tk "Tk Library Procedures" @@ -19,13 +19,13 @@ Tk_GetJoinStyle, Tk_NameOfJoinStyle \- translate between strings and join styles int \fBTk_GetJoinStyle(\fIinterp, string, joinPtr\fB)\fR .sp -char * +CONST char * \fBTk_NameOfJoinStyle(\fIjoin\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *joinPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting. -.AP char *string in +.AP "CONST char" *string in String containing name of join style: one of ``bevel'', ``miter'', or ``round''. .AP int *joinPtr out diff --git a/doc/GetJustify.3 b/doc/GetJustify.3 index 68dced7..384ce5d 100644 --- a/doc/GetJustify.3 +++ b/doc/GetJustify.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetJustify.3,v 1.3 1999/04/16 01:51:08 stanton Exp $ +'\" RCS: @(#) $Id: GetJustify.3,v 1.4 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_GetJustifyFromObj 3 8.1 Tk "Tk Library Procedures" @@ -23,7 +23,7 @@ int int \fBTk_GetJustify(\fIinterp, string, justifyPtr\fB)\fR .sp -char * +CONST char * \fBTk_NameOfJustify(\fIjustify\fB)\fR .SH ARGUMENTS .AS "Tk_Justify" *justifyPtr @@ -34,7 +34,7 @@ Interpreter to use for error reporting, or NULL. String value contains name of justification style (\fBleft\fR, \fBright\fR, or \fBcenter\fR). The internal rep will be modified to cache corresponding justify value. -.AP char *string in +.AP "CONST char" *string in Same as \fIobjPtr\fR except description of justification style is passed as a string. .VE diff --git a/doc/GetOption.3 b/doc/GetOption.3 index 54d05fc..909b044 100644 --- a/doc/GetOption.3 +++ b/doc/GetOption.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetOption.3,v 1.2 1998/09/14 18:22:50 stanton Exp $ +'\" RCS: @(#) $Id: GetOption.3,v 1.3 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_GetOption 3 "" Tk "Tk Library Procedures" @@ -22,9 +22,9 @@ Tk_Uid .AS Tk_Window *class .AP Tk_Window tkwin in Token for window. -.AP char *name in +.AP "CONST char" *name in Name of desired option. -.AP char *class in +.AP "CONST char" *class in Class of desired option. Null means there is no class for this option; do lookup based on name only. .BE diff --git a/doc/GetRelief.3 b/doc/GetRelief.3 index a85280e..f75bdaa 100644 --- a/doc/GetRelief.3 +++ b/doc/GetRelief.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetRelief.3,v 1.3 1999/04/16 01:51:08 stanton Exp $ +'\" RCS: @(#) $Id: GetRelief.3,v 1.4 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_GetReliefFromObj 3 8.1 Tk "Tk Library Procedures" @@ -24,7 +24,7 @@ int int \fBTk_GetRelief(\fIinterp, name, reliefPtr\fB)\fR .sp -char * +CONST char * \fBTk_NameOfRelief(\fIrelief\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *reliefPtr @@ -42,6 +42,8 @@ a string. .AP int *reliefPtr out Pointer to location in which to store relief value corresponding to \fIobjPtr\fR or \fIname\fR. +.AP "CONST char" *name +Name of the relief. .AP int relief in Relief value (one of TK_RELIEF_FLAT, TK_RELIEF_RAISED, TK_RELIEF_SUNKEN, TK_RELIEF_GROOVE, TK_RELIEF_SOLID, or TK_RELIEF_RIDGE). diff --git a/doc/GetScroll.3 b/doc/GetScroll.3 index 0a5e620..96514a4 100644 --- a/doc/GetScroll.3 +++ b/doc/GetScroll.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetScroll.3,v 1.4 2000/04/25 22:06:31 hobbs Exp $ +'\" RCS: @(#) $Id: GetScroll.3,v 1.5 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_GetScrollInfo 3 8.0 Tk "Tk Library Procedures" @@ -27,7 +27,7 @@ int Interpreter to use for error reporting. .AP int argc in Number of strings in \fIargv\fR array. -.AP char *argv[] in +.AP "CONST char" *argv[] in Argument strings. These represent the entire widget command, of which the first word is typically the widget name and the second word is typically \fBxview\fR or \fByview\fR. diff --git a/doc/GetVisual.3 b/doc/GetVisual.3 index 8bb5068..eea3ca4 100644 --- a/doc/GetVisual.3 +++ b/doc/GetVisual.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetVisual.3,v 1.2 1998/09/14 18:22:51 stanton Exp $ +'\" RCS: @(#) $Id: GetVisual.3,v 1.3 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_GetVisual 3 4.0 Tk "Tk Library Procedures" @@ -24,7 +24,7 @@ Visual * Interpreter to use for error reporting. .AP Tk_Window tkwin in Token for window in which the visual will be used. -.AP char *string in +.AP "CONST char" *string in String that identifies the desired visual. See below for valid formats. .AP int *depthPtr out diff --git a/doc/InternAtom.3 b/doc/InternAtom.3 index 3e50fae..1c1b6aa 100644 --- a/doc/InternAtom.3 +++ b/doc/InternAtom.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: InternAtom.3,v 1.2 1998/09/14 18:22:52 stanton Exp $ +'\" RCS: @(#) $Id: InternAtom.3,v 1.3 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_InternAtom 3 "" Tk "Tk Library Procedures" @@ -19,13 +19,13 @@ Tk_InternAtom, Tk_GetAtomName \- manage cache of X atoms Atom \fBTk_InternAtom(\fItkwin, name\fR) .sp -char * +CONST char * \fBTk_GetAtomName(\fItkwin, atom\fR) .SH ARGUMENTS .AS Tk_Window parent .AP Tk_Window tkwin in Token for window. Used to map atom or name relative to a particular display. -.AP char *name in +.AP "CONST char" *name in String name for which atom is desired. .AP Atom atom in Atom for which corresponding string name is desired. diff --git a/doc/NameOfImg.3 b/doc/NameOfImg.3 index 4ca60de..6de79f2 100644 --- a/doc/NameOfImg.3 +++ b/doc/NameOfImg.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: NameOfImg.3,v 1.2 1998/09/14 18:22:53 stanton Exp $ +'\" RCS: @(#) $Id: NameOfImg.3,v 1.3 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_NameOfImage 3 4.0 Tk "Tk Library Procedures" @@ -15,7 +15,7 @@ Tk_NameOfImage \- Return name of image. .nf \fB#include \fR .sp -char * +CONST char * \fBTk_NameOfImage\fR(\fItypePtr\fR) .SH ARGUMENTS .AS Tk_ImageMaster *masterPtr diff --git a/doc/SetAppName.3 b/doc/SetAppName.3 index c22b780..17264a9 100644 --- a/doc/SetAppName.3 +++ b/doc/SetAppName.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SetAppName.3,v 1.2 1998/09/14 18:22:53 stanton Exp $ +'\" RCS: @(#) $Id: SetAppName.3,v 1.3 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_SetAppName 3 4.0 Tk "Tk Library Procedures" @@ -16,14 +16,14 @@ Tk_SetAppName \- Set the name of an application for ``send'' commands .nf \fB#include \fR .sp -char * +CONST char * \fBTk_SetAppName\fR(\fItkwin, name\fR) .SH ARGUMENTS .AS Tk_Window parent .AP Tk_Window tkwin in Token for window in application. Used only to select a particular application. -.AP char *name in +.AP "CONST char" *name in Name under which to register the application. .BE diff --git a/doc/WindowId.3 b/doc/WindowId.3 index 28de341..8f930c8 100644 --- a/doc/WindowId.3 +++ b/doc/WindowId.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: WindowId.3,v 1.6 2001/09/26 20:25:17 pspjuth Exp $ +'\" RCS: @(#) $Id: WindowId.3,v 1.7 2002/08/05 04:30:38 dgp Exp $ '\" .so man.macros .TH Tk_WindowId 3 "8.4" Tk "Tk Library Procedures" @@ -25,7 +25,7 @@ Tk_Window Display * \fBTk_Display\fR(\fItkwin\fR) .sp -char * +CONST char * \fBTk_DisplayName\fR(\fItkwin\fR) .sp int diff --git a/generic/tk.decls b/generic/tk.decls index 0d2ce92..3328b6a 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.22 2002/06/18 23:51:46 dkf Exp $ +# RCS: @(#) $Id: tk.decls,v 1.23 2002/08/05 04:30:38 dgp Exp $ library tk @@ -121,7 +121,7 @@ declare 17 generic { declare 18 generic { int Tk_CanvasTagsParseProc (ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, char *value, char *widgRec, int offset) + Tk_Window tkwin, CONST char *value, char *widgRec, int offset) } declare 19 generic { @@ -164,19 +164,19 @@ declare 26 generic { declare 27 generic { int Tk_ConfigureInfo (Tcl_Interp *interp, Tk_Window tkwin, Tk_ConfigSpec *specs, - char *widgRec, char *argvName, int flags) + char *widgRec, CONST char *argvName, int flags) } declare 28 generic { int Tk_ConfigureValue (Tcl_Interp *interp, Tk_Window tkwin, Tk_ConfigSpec *specs, - char *widgRec, char *argvName, int flags) + char *widgRec, CONST char *argvName, int flags) } declare 29 generic { int Tk_ConfigureWidget (Tcl_Interp *interp, Tk_Window tkwin, Tk_ConfigSpec *specs, - int argc, char **argv, char *widgRec, + int argc, CONST84 char **argv, char *widgRec, int flags) } @@ -199,7 +199,7 @@ declare 32 generic { declare 33 generic { unsigned long Tk_CreateBinding (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, - char *eventStr, char *command, int append) + CONST char *eventStr, CONST char *command, int append) } declare 34 generic { @@ -243,17 +243,17 @@ declare 41 generic { declare 42 generic { Tk_Window Tk_CreateWindow (Tcl_Interp *interp, - Tk_Window parent, char *name, char *screenName) + Tk_Window parent, CONST char *name, CONST char *screenName) } declare 43 generic { Tk_Window Tk_CreateWindowFromPath (Tcl_Interp *interp, Tk_Window tkwin, - char *pathName, char *screenName) + CONST char *pathName, CONST char *screenName) } declare 44 generic { - int Tk_DefineBitmap (Tcl_Interp *interp, CONST char *name, char *source, - int width, int height) + int Tk_DefineBitmap (Tcl_Interp *interp, CONST char *name, + CONST char *source, int width, int height) } declare 45 generic { @@ -267,7 +267,7 @@ declare 46 generic { declare 47 generic { int Tk_DeleteBinding (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, - char *eventStr) + CONST char *eventStr) } declare 48 generic { @@ -289,7 +289,7 @@ declare 51 generic { } declare 52 generic { - void Tk_DeleteImage (Tcl_Interp *interp, char *name) + void Tk_DeleteImage (Tcl_Interp *interp, CONST char *name) } declare 53 generic { @@ -301,7 +301,7 @@ declare 54 generic { } declare 55 generic { - char * Tk_DisplayName (Tk_Window tkwin) + CONST84_RETURN char * Tk_DisplayName (Tk_Window tkwin) } declare 56 generic { @@ -352,7 +352,7 @@ declare 63 generic { } declare 64 generic { - Tk_PhotoHandle Tk_FindPhoto (Tcl_Interp *interp, char *imageName) + Tk_PhotoHandle Tk_FindPhoto (Tcl_Interp *interp, CONST char *imageName) } declare 65 generic { @@ -428,17 +428,17 @@ declare 81 generic { declare 82 generic { int Tk_GetAnchor (Tcl_Interp *interp, - char *str, Tk_Anchor *anchorPtr) + CONST char *str, Tk_Anchor *anchorPtr) } declare 83 generic { - char * Tk_GetAtomName (Tk_Window tkwin, Atom atom) + CONST84_RETURN char * Tk_GetAtomName (Tk_Window tkwin, Atom atom) } declare 84 generic { - char * Tk_GetBinding (Tcl_Interp *interp, + CONST84_RETURN char * Tk_GetBinding (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, - char *eventStr) + CONST char *eventStr) } declare 85 generic { @@ -447,11 +447,11 @@ declare 85 generic { declare 86 generic { Pixmap Tk_GetBitmapFromData (Tcl_Interp *interp, - Tk_Window tkwin, char *source, int width, int height) + Tk_Window tkwin, CONST char *source, int width, int height) } declare 87 generic { - int Tk_GetCapStyle (Tcl_Interp *interp, char *str, int *capPtr) + int Tk_GetCapStyle (Tcl_Interp *interp, CONST char *str, int *capPtr) } declare 88 generic { @@ -463,7 +463,8 @@ declare 89 generic { } declare 90 generic { - Colormap Tk_GetColormap (Tcl_Interp *interp, Tk_Window tkwin, char *str) + Colormap Tk_GetColormap (Tcl_Interp *interp, Tk_Window tkwin, + CONST char *str) } declare 91 generic { @@ -473,7 +474,7 @@ declare 91 generic { declare 92 generic { Tk_Cursor Tk_GetCursorFromData (Tcl_Interp *interp, - Tk_Window tkwin, char *source, char *mask, + Tk_Window tkwin, CONST char *source, CONST char *mask, int width, int height, int xHot, int yHot, Tk_Uid fg, Tk_Uid bg) } @@ -496,13 +497,13 @@ declare 96 generic { } declare 97 generic { - Tk_Image Tk_GetImage (Tcl_Interp *interp, Tk_Window tkwin, char *name, + Tk_Image Tk_GetImage (Tcl_Interp *interp, Tk_Window tkwin, CONST char *name, Tk_ImageChangedProc *changeProc, ClientData clientData) } declare 98 generic { ClientData Tk_GetImageMasterData (Tcl_Interp *interp, - char *name, Tk_ImageType **typePtrPtr) + CONST char *name, Tk_ImageType **typePtrPtr) } declare 99 generic { @@ -510,12 +511,12 @@ declare 99 generic { } declare 100 generic { - int Tk_GetJoinStyle (Tcl_Interp *interp, char *str, int *joinPtr) + int Tk_GetJoinStyle (Tcl_Interp *interp, CONST char *str, int *joinPtr) } declare 101 generic { int Tk_GetJustify (Tcl_Interp *interp, - char *str, Tk_Justify *justifyPtr) + CONST char *str, Tk_Justify *justifyPtr) } declare 102 generic { @@ -523,7 +524,8 @@ declare 102 generic { } declare 103 generic { - Tk_Uid Tk_GetOption (Tk_Window tkwin, char *name, char *className) + Tk_Uid Tk_GetOption (Tk_Window tkwin, CONST char *name, + CONST char *className) } declare 104 generic { @@ -537,7 +539,7 @@ declare 105 generic { } declare 106 generic { - int Tk_GetRelief (Tcl_Interp *interp, char *name, int *reliefPtr) + int Tk_GetRelief (Tcl_Interp *interp, CONST char *name, int *reliefPtr) } declare 107 generic { @@ -546,7 +548,7 @@ declare 107 generic { declare 108 generic { int Tk_GetScrollInfo (Tcl_Interp *interp, - int argc, char **argv, double *dblPtr, int *intPtr) + int argc, CONST84 char **argv, double *dblPtr, int *intPtr) } declare 109 generic { @@ -566,7 +568,7 @@ declare 111 generic { declare 112 generic { Visual * Tk_GetVisual (Tcl_Interp *interp, - Tk_Window tkwin, char *str, int *depthPtr, + Tk_Window tkwin, CONST char *str, int *depthPtr, Colormap *colormapPtr) } @@ -597,7 +599,7 @@ declare 118 generic { } declare 119 generic { - Atom Tk_InternAtom (Tk_Window tkwin, char *name) + Atom Tk_InternAtom (Tk_Window tkwin, CONST char *name) } declare 120 generic { @@ -647,47 +649,47 @@ declare 129 generic { } declare 130 generic { - char * Tk_NameOf3DBorder (Tk_3DBorder border) + CONST84_RETURN char * Tk_NameOf3DBorder (Tk_3DBorder border) } declare 131 generic { - char * Tk_NameOfAnchor (Tk_Anchor anchor) + CONST84_RETURN char * Tk_NameOfAnchor (Tk_Anchor anchor) } declare 132 generic { - char * Tk_NameOfBitmap (Display *display, Pixmap bitmap) + CONST84_RETURN char * Tk_NameOfBitmap (Display *display, Pixmap bitmap) } declare 133 generic { - char * Tk_NameOfCapStyle (int cap) + CONST84_RETURN char * Tk_NameOfCapStyle (int cap) } declare 134 generic { - char * Tk_NameOfColor (XColor *colorPtr) + CONST84_RETURN char * Tk_NameOfColor (XColor *colorPtr) } declare 135 generic { - char * Tk_NameOfCursor (Display *display, Tk_Cursor cursor) + CONST84_RETURN char * Tk_NameOfCursor (Display *display, Tk_Cursor cursor) } declare 136 generic { - char * Tk_NameOfFont (Tk_Font font) + CONST84_RETURN char * Tk_NameOfFont (Tk_Font font) } declare 137 generic { - char * Tk_NameOfImage (Tk_ImageMaster imageMaster) + CONST84_RETURN char * Tk_NameOfImage (Tk_ImageMaster imageMaster) } declare 138 generic { - char * Tk_NameOfJoinStyle (int join) + CONST84_RETURN char * Tk_NameOfJoinStyle (int join) } declare 139 generic { - char * Tk_NameOfJustify (Tk_Justify justify) + CONST84_RETURN char * Tk_NameOfJustify (Tk_Justify justify) } declare 140 generic { - char * Tk_NameOfRelief (int relief) + CONST84_RETURN char * Tk_NameOfRelief (int relief) } declare 141 generic { @@ -780,7 +782,7 @@ declare 159 generic { } declare 160 generic { - char * Tk_SetAppName (Tk_Window tkwin, char *name) + CONST char * Tk_SetAppName (Tk_Window tkwin, CONST char *name) } declare 161 generic { @@ -788,7 +790,7 @@ declare 161 generic { } declare 162 generic { - void Tk_SetClass (Tk_Window tkwin, char *className) + void Tk_SetClass (Tk_Window tkwin, CONST char *className) } declare 163 generic { @@ -1139,7 +1141,7 @@ declare 240 generic { # declare 241 generic { Tk_Window Tk_CreateAnonymousWindow (Tcl_Interp *interp, - Tk_Window parent, char *screenName) + Tk_Window parent, CONST char *screenName) } declare 242 generic { void Tk_SetClassProcs (Tk_Window tkwin, @@ -1181,17 +1183,18 @@ declare 248 generic { # Style engine declare 249 generic { - Tk_StyleEngine Tk_RegisterStyleEngine (char *name, Tk_StyleEngine parent) + Tk_StyleEngine Tk_RegisterStyleEngine (CONST char *name, + Tk_StyleEngine parent) } declare 250 generic { - Tk_StyleEngine Tk_GetStyleEngine (char *name) + Tk_StyleEngine Tk_GetStyleEngine (CONST char *name) } declare 251 generic { int Tk_RegisterStyledElement (Tk_StyleEngine engine, Tk_ElementSpec *templatePtr) } declare 252 generic { - int Tk_GetElementId (char *name) + int Tk_GetElementId (CONST char *name) } declare 253 generic { Tk_Style Tk_CreateStyle (CONST char *name, Tk_StyleEngine engine, diff --git a/generic/tk.h b/generic/tk.h index cdf03ac..f6a7e78 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.65 2002/07/14 17:29:57 dgp Exp $ + * RCS: @(#) $Id: tk.h,v 1.66 2002/08/05 04:30:38 dgp Exp $ */ #ifndef _TK @@ -124,7 +124,7 @@ typedef struct Tk_StyledElement_ *Tk_StyledElement; * Additional types exported to clients. */ -typedef char *Tk_Uid; +typedef CONST char *Tk_Uid; /* * The enum below defines the valid types for Tk configuration options @@ -322,7 +322,7 @@ typedef struct Tk_SavedOptions { #ifndef __NO_OLD_CONFIG typedef int (Tk_OptionParseProc) _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, Tk_Window tkwin, char *value, char *widgRec, + Tcl_Interp *interp, Tk_Window tkwin, CONST84 char *value, char *widgRec, int offset)); typedef char *(Tk_OptionPrintProc) _ANSI_ARGS_((ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, @@ -353,9 +353,9 @@ typedef struct Tk_ConfigSpec { * table must have type TK_CONFIG_END. */ char *argvName; /* Switch used to specify option in argv. * NULL means this spec is part of a group. */ - char *dbName; /* Name for option in option database. */ - char *dbClass; /* Class for option in database. */ - char *defValue; /* Default value for option if not + Tk_Uid dbName; /* Name for option in option database. */ + Tk_Uid dbClass; /* Class for option in database. */ + Tk_Uid defValue; /* Default value for option if not * specified in command line or database. */ int offset; /* Where in widget record to store value; * use Tk_Offset macro to generate values diff --git a/generic/tk3d.c b/generic/tk3d.c index 5e3be12..3c6492e 100644 --- a/generic/tk3d.c +++ b/generic/tk3d.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: tk3d.c,v 1.12 2002/01/17 05:13:11 dgp Exp $ + * RCS: @(#) $Id: tk3d.c,v 1.13 2002/08/05 04:30:38 dgp Exp $ */ #include "tk3d.h" @@ -186,7 +186,7 @@ Tk_Get3DBorder(interp, tkwin, colorName) Tcl_Interp *interp; /* Place to store an error message. */ Tk_Window tkwin; /* Token for window in which border will * be drawn. */ - char *colorName; /* String giving name of color + Tk_Uid colorName; /* String giving name of color * for window background. */ { Tcl_HashEntry *hashPtr; @@ -324,7 +324,7 @@ Tk_Draw3DRectangle(tkwin, drawable, border, x, y, width, height, *-------------------------------------------------------------- */ -char * +CONST char * Tk_NameOf3DBorder(border) Tk_3DBorder border; /* Token for border. */ { @@ -652,7 +652,7 @@ Tk_GetReliefFromObj(interp, objPtr, resultPtr) int Tk_GetRelief(interp, name, reliefPtr) Tcl_Interp *interp; /* For error messages. */ - char *name; /* Name of a relief type. */ + CONST char *name; /* Name of a relief type. */ int *reliefPtr; /* Where to store converted relief. */ { char c; @@ -703,7 +703,7 @@ Tk_GetRelief(interp, name, reliefPtr) *-------------------------------------------------------------- */ -char * +CONST char * Tk_NameOfRelief(relief) int relief; /* One of TK_RELIEF_FLAT, TK_RELIEF_RAISED, * or TK_RELIEF_SUNKEN. */ diff --git a/generic/tkAtom.c b/generic/tkAtom.c index fba9fb8..0137d40 100644 --- a/generic/tkAtom.c +++ b/generic/tkAtom.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkAtom.c,v 1.2 1998/09/14 18:23:03 stanton Exp $ + * RCS: @(#) $Id: tkAtom.c,v 1.3 2002/08/05 04:30:38 dgp Exp $ */ #include "tkPort.h" @@ -80,7 +80,7 @@ Atom Tk_InternAtom(tkwin, name) Tk_Window tkwin; /* Window token; map name to atom * for this window's display. */ - char *name; /* Name to turn into atom. */ + CONST char *name; /* Name to turn into atom. */ { register TkDisplay *dispPtr; register Tcl_HashEntry *hPtr; @@ -127,7 +127,7 @@ Tk_InternAtom(tkwin, name) *-------------------------------------------------------------- */ -char * +CONST char * Tk_GetAtomName(tkwin, atom) Tk_Window tkwin; /* Window token; map atom to name * relative to this window's @@ -168,7 +168,7 @@ Tk_GetAtomName(tkwin, atom) &new); Tcl_SetHashValue(hPtr, name); } - return (char *) Tcl_GetHashValue(hPtr); + return Tcl_GetHashValue(hPtr); } /* diff --git a/generic/tkBind.c b/generic/tkBind.c index c70a1a5..a71ac44 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.25 2002/06/19 19:37:53 mdejong Exp $ + * RCS: @(#) $Id: tkBind.c,v 1.26 2002/08/05 04:30:38 dgp Exp $ */ #include "tkPort.h" @@ -676,13 +676,13 @@ static int DeleteVirtualEvent _ANSI_ARGS_((Tcl_Interp *interp, static void DeleteVirtualEventTable _ANSI_ARGS_(( VirtualEventTable *vetPtr)); static void ExpandPercents _ANSI_ARGS_((TkWindow *winPtr, - char *before, XEvent *eventPtr, KeySym keySym, + CONST char *before, XEvent *eventPtr, KeySym keySym, Tcl_DString *dsPtr)); static void FreeTclBinding _ANSI_ARGS_((ClientData clientData)); static PatSeq * FindSequence _ANSI_ARGS_((Tcl_Interp *interp, Tcl_HashTable *patternTablePtr, ClientData object, - char *eventString, int create, int allowVirtual, - unsigned long *maskPtr)); + CONST char *eventString, int create, + int allowVirtual, unsigned long *maskPtr)); static void GetAllVirtualEvents _ANSI_ARGS_((Tcl_Interp *interp, VirtualEventTable *vetPtr)); static char * GetField _ANSI_ARGS_((char *p, char *copy, int size)); @@ -705,7 +705,7 @@ static int NameToWindow _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window main, Tcl_Obj *objPtr, Tk_Window *tkwinPtr)); static int ParseEventDescription _ANSI_ARGS_((Tcl_Interp *interp, - char **eventStringPtr, Pattern *patPtr, + CONST char **eventStringPtr, Pattern *patPtr, unsigned long *eventMaskPtr)); static void DoWarp _ANSI_ARGS_((ClientData clientData)); @@ -972,9 +972,9 @@ Tk_CreateBinding(interp, bindingTable, object, eventString, command, append) /* Table in which to create binding. */ ClientData object; /* Token for object with which binding is * associated. */ - char *eventString; /* String describing event sequence that + CONST char *eventString; /* String describing event sequence that * triggers binding. */ - 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 @@ -1076,7 +1076,7 @@ TkCreateBindingProcedure(interp, bindingTable, object, eventString, /* Table in which to create binding. */ ClientData object; /* Token for object with which binding is * associated. */ - char *eventString; /* String describing event sequence that + CONST char *eventString; /* String describing event sequence that * triggers binding. */ TkBindEvalProc *eventProc; /* Procedure to invoke when binding * triggers. Must not be NULL. */ @@ -1154,7 +1154,7 @@ Tk_DeleteBinding(interp, bindingTable, object, eventString) Tk_BindingTable bindingTable; /* Table in which to delete binding. */ ClientData object; /* Token for object with which binding * is associated. */ - char *eventString; /* String describing event sequence + CONST char *eventString; /* String describing event sequence * that triggers binding. */ { BindingTable *bindPtr = (BindingTable *) bindingTable; @@ -1243,14 +1243,14 @@ Tk_DeleteBinding(interp, bindingTable, object, eventString) *-------------------------------------------------------------- */ -char * +CONST char * Tk_GetBinding(interp, bindingTable, object, eventString) 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. */ - char *eventString; /* String describing event sequence + CONST char *eventString; /* String describing event sequence * that triggers binding. */ { BindingTable *bindPtr = (BindingTable *) bindingTable; @@ -1263,7 +1263,7 @@ Tk_GetBinding(interp, bindingTable, object, eventString) return NULL; } if (psPtr->eventProc == EvalTclBinding) { - return (char *) psPtr->clientData; + return (CONST char *) psPtr->clientData; } return ""; } @@ -2306,7 +2306,7 @@ static void ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr) TkWindow *winPtr; /* Window where event occurred: needed to * get input context. */ - char *before; /* Command containing percent expressions + CONST char *before; /* Command containing percent expressions * to be replaced. */ XEvent *eventPtr; /* X event containing information to be * used in % replacements. */ @@ -2319,7 +2319,7 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr) * list element. */ int number, flags, length; #define NUM_SIZE 40 - char *string; + CONST char *string; Tcl_DString buf; char numStorage[NUM_SIZE+1]; @@ -3279,7 +3279,8 @@ HandleEventGenerate(interp, mainWin, objc, objv) Tcl_Obj *CONST objv[]; /* Argument objects. */ { XEvent event; - char *name, *p, *windowName; + CONST char *p; + char *name, *windowName; int count, flags, synch, i, number, warp; Tcl_QueuePosition pos; Pattern pat; @@ -3951,7 +3952,7 @@ FindSequence(interp, patternTablePtr, object, eventString, create, ClientData object; /* For binding table, token for object with * which binding is associated. * For virtual event table, NULL. */ - char *eventString; /* String description of pattern to + 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 @@ -3967,7 +3968,7 @@ FindSequence(interp, patternTablePtr, object, eventString, create, Pattern pats[EVENT_BUFFER_SIZE]; int numPats, virtualFound; - char *p; + CONST char *p; Pattern *patPtr; PatSeq *psPtr; Tcl_HashEntry *hPtr; @@ -4122,7 +4123,7 @@ static int ParseEventDescription(interp, eventStringPtr, patPtr, eventMaskPtr) Tcl_Interp *interp; /* For error messages. */ - char **eventStringPtr; /* On input, holds a pointer to start of + 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 @@ -4136,8 +4137,10 @@ ParseEventDescription(interp, eventStringPtr, patPtr, #define FIELD_SIZE 48 char field[FIELD_SIZE]; Tcl_HashEntry *hPtr; + Tcl_DString copy; - p = *eventStringPtr; + Tcl_DStringInit(©); + p = Tcl_DStringAppend(©, *eventStringPtr, -1); patPtr->eventType = -1; patPtr->needMods = 0; @@ -4166,7 +4169,8 @@ ParseEventDescription(interp, eventStringPtr, patPtr, sprintf(buf, "bad ASCII character 0x%x", (unsigned char) *p); Tcl_SetResult(interp, buf, TCL_VOLATILE); - return 0; + count = 0; + goto done; } } p++; @@ -4207,12 +4211,14 @@ ParseEventDescription(interp, eventStringPtr, patPtr, if (p == field) { Tcl_SetResult(interp, "virtual event \"<<>>\" is badly formed", TCL_STATIC); - return 0; + count = 0; + goto done; } if ((p == NULL) || (p[1] != '>')) { Tcl_SetResult(interp, "missing \">\" in virtual binding", TCL_STATIC); - return 0; + count = 0; + goto done; } *p = '\0'; patPtr->eventType = VirtualEvent; @@ -4275,7 +4281,8 @@ ParseEventDescription(interp, eventStringPtr, patPtr, } else if ((eventFlags & BUTTON) == 0) { Tcl_AppendResult(interp, "specified button \"", field, "\" for non-button event", (char *) NULL); - return 0; + count = 0; + goto done; } patPtr->detail.button = (*field - '0'); } else { @@ -4284,7 +4291,8 @@ ParseEventDescription(interp, eventStringPtr, patPtr, if (patPtr->detail.keySym == NoSymbol) { Tcl_AppendResult(interp, "bad event type or keysym \"", field, "\"", (char *) NULL); - return 0; + count = 0; + goto done; } if (eventFlags == 0) { patPtr->eventType = KeyPress; @@ -4292,13 +4300,15 @@ ParseEventDescription(interp, eventStringPtr, patPtr, } else if ((eventFlags & KEY) == 0) { Tcl_AppendResult(interp, "specified keysym \"", field, "\" for non-key event", (char *) NULL); - return 0; + count = 0; + goto done; } } } else if (eventFlags == 0) { Tcl_SetResult(interp, "no event type or button # or keysym", TCL_STATIC); - return 0; + count = 0; + goto done; } while ((*p == '-') || isspace(UCHAR(*p))) { @@ -4311,17 +4321,21 @@ ParseEventDescription(interp, eventStringPtr, patPtr, Tcl_SetResult(interp, "extra characters after detail in binding", TCL_STATIC); - return 0; + count = 0; + goto done; } } Tcl_SetResult(interp, "missing \">\" in binding", TCL_STATIC); - return 0; + count = 0; + goto done; } p++; end: - *eventStringPtr = p; + *eventStringPtr += (p - Tcl_DStringValue(©)); *eventMaskPtr |= eventMask; +done: + Tcl_DStringFree(©); return count; } diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c index fc445f6..3f9e2e6 100644 --- a/generic/tkBitmap.c +++ b/generic/tkBitmap.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: tkBitmap.c,v 1.9 2001/08/15 15:44:36 dkf Exp $ + * RCS: @(#) $Id: tkBitmap.c,v 1.10 2002/08/05 04:30:38 dgp Exp $ */ #include "tkPort.h" @@ -87,7 +87,7 @@ typedef struct TkBitmap { */ typedef struct { - char *source; /* Bitmap bits. */ + CONST char *source; /* Bitmap bits. */ int width, height; /* Dimensions of bitmap. */ } DataKey; @@ -468,7 +468,7 @@ Tk_DefineBitmap(interp, name, source, width, height) Tcl_Interp *interp; /* Interpreter to use for error reporting. */ CONST char *name; /* Name to use for bitmap. Must not already * be defined as a bitmap. */ - char *source; /* Address of bits for bitmap. */ + CONST char *source; /* Address of bits for bitmap. */ int width; /* Width of bitmap. */ int height; /* Height of bitmap. */ { @@ -523,7 +523,7 @@ Tk_DefineBitmap(interp, name, source, width, height) *-------------------------------------------------------------- */ -char * +CONST char * Tk_NameOfBitmap(display, bitmap) Display *display; /* Display for which bitmap was * allocated. */ @@ -809,7 +809,7 @@ Pixmap Tk_GetBitmapFromData(interp, tkwin, source, width, height) Tcl_Interp *interp; /* Interpreter to use for error reporting. */ Tk_Window tkwin; /* Window in which bitmap will be used. */ - char *source; /* Bitmap data for bitmap shape. */ + CONST char *source; /* Bitmap data for bitmap shape. */ int width, height; /* Dimensions of bitmap. */ { DataKey nameKey; diff --git a/generic/tkButton.c b/generic/tkButton.c index 429916f..141f69f 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.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: tkButton.c,v 1.18 2002/06/17 10:54:29 drh Exp $ + * RCS: @(#) $Id: tkButton.c,v 1.19 2002/08/05 04:30:38 dgp Exp $ */ #include "tkButton.h" @@ -524,11 +524,11 @@ static void ButtonSelectImageProc _ANSI_ARGS_(( ClientData clientData, int x, int y, int width, int height, int imgWidth, int imgHeight)); static char * ButtonTextVarProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, char *name1, CONST char *name2, - int flags)); + Tcl_Interp *interp, CONST char *name1, + CONST char *name2, int flags)); static char * ButtonVarProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, char *name1, CONST char *name2, - int flags)); + Tcl_Interp *interp, CONST char *name1, + CONST char *name2, int flags)); static int ButtonWidgetObjCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); @@ -1552,7 +1552,7 @@ static char * ButtonVarProc(clientData, interp, name1, name2, flags) ClientData clientData; /* Information about button. */ Tcl_Interp *interp; /* Interpreter containing variable. */ - char *name1; /* Name of variable. */ + CONST char *name1; /* Name of variable. */ CONST char *name2; /* Second part of variable name. */ int flags; /* Information about what happened. */ { @@ -1631,7 +1631,7 @@ static char * ButtonTextVarProc(clientData, interp, name1, name2, flags) ClientData clientData; /* Information about button. */ Tcl_Interp *interp; /* Interpreter containing variable. */ - char *name1; /* Not used. */ + CONST char *name1; /* Not used. */ CONST char *name2; /* Not used. */ int flags; /* Information about what happened. */ { diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c index d1d5f68..317c272 100644 --- a/generic/tkCanvArc.c +++ b/generic/tkCanvArc.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: tkCanvArc.c,v 1.9 2001/07/03 06:03:44 hobbs Exp $ + * RCS: @(#) $Id: tkCanvArc.c,v 1.10 2002/08/05 04:30:38 dgp Exp $ */ #include @@ -467,8 +467,8 @@ ConfigureArc(interp, canvas, itemPtr, objc, objv, flags) Tk_State state; tkwin = Tk_CanvasTkwin(canvas); - if (Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (char **) objv, - (char *) arcPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { + if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, + (CONST char **) objv, (char *) arcPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c index 39cf6a2..cc35dad 100644 --- a/generic/tkCanvBmap.c +++ b/generic/tkCanvBmap.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: tkCanvBmap.c,v 1.5 2001/07/03 06:03:44 hobbs Exp $ + * RCS: @(#) $Id: tkCanvBmap.c,v 1.6 2002/08/05 04:30:38 dgp Exp $ */ #include @@ -336,8 +336,8 @@ ConfigureBitmap(interp, canvas, itemPtr, objc, objv, flags) Tk_State state; tkwin = Tk_CanvasTkwin(canvas); - if (Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (char **) objv, - (char *) bmapPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { + if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, + (CONST char **) objv, (char *) bmapPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c index 144b755..212ac2f 100644 --- a/generic/tkCanvImg.c +++ b/generic/tkCanvImg.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: tkCanvImg.c,v 1.4 1999/12/14 06:52:25 hobbs Exp $ + * RCS: @(#) $Id: tkCanvImg.c,v 1.5 2002/08/05 04:30:38 dgp Exp $ */ #include @@ -319,8 +319,8 @@ ConfigureImage(interp, canvas, itemPtr, argc, argv, flags) Tk_Image image; tkwin = Tk_CanvasTkwin(canvas); - if (Tk_ConfigureWidget(interp, tkwin, configSpecs, argc, (char **) argv, - (char *) imgPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { + if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, argc, + (CONST char **) argv, (char *) imgPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index 1263249..6431830 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.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: tkCanvLine.c,v 1.10 2002/01/25 21:09:36 dgp Exp $ + * RCS: @(#) $Id: tkCanvLine.c,v 1.11 2002/08/05 04:30:38 dgp Exp $ */ #include @@ -496,8 +496,8 @@ ConfigureLine(interp, canvas, itemPtr, objc, objv, flags) Tk_State state; tkwin = Tk_CanvasTkwin(canvas); - if (Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (char **) objv, - (char *) linePtr, flags|TK_CONFIG_OBJS) != TCL_OK) { + if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, + (CONST char **) objv, (char *) linePtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c index c4adf3c..b3f5374 100644 --- a/generic/tkCanvPoly.c +++ b/generic/tkCanvPoly.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: tkCanvPoly.c,v 1.8 2001/07/04 00:40:11 hobbs Exp $ + * RCS: @(#) $Id: tkCanvPoly.c,v 1.9 2002/08/05 04:30:38 dgp Exp $ */ #include @@ -451,8 +451,8 @@ ConfigurePolygon(interp, canvas, itemPtr, objc, objv, flags) Tk_State state; tkwin = Tk_CanvasTkwin(canvas); - if (Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (char **) objv, - (char *) polyPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { + if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, + (CONST char **) objv, (char *) polyPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c index 47aa841..643f2a9 100644 --- a/generic/tkCanvPs.c +++ b/generic/tkCanvPs.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: tkCanvPs.c,v 1.9 2002/06/25 16:27:43 a_kovalenko Exp $ + * RCS: @(#) $Id: tkCanvPs.c,v 1.10 2002/08/05 04:30:38 dgp Exp $ */ #include "tkInt.h" @@ -146,7 +146,7 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv) TkCanvas *canvasPtr; /* Information about canvas widget. */ Tcl_Interp *interp; /* Current interpreter. */ int argc; /* Number of arguments. */ - char **argv; /* Argument strings. Caller has + CONST char **argv; /* Argument strings. Caller has * already parsed this command enough * to know that argv[1] is * "postscript". */ @@ -739,7 +739,7 @@ Tk_PostscriptFont(interp, psInfo, tkfont) int argc; double size; CONST char **argv; - char *name; + CONST char *name; name = Tk_NameOfFont(tkfont); list = Tcl_GetVar2(interp, psInfoPtr->fontVar, name, 0); diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c index 5254431..a7b9aa3 100644 --- a/generic/tkCanvText.c +++ b/generic/tkCanvText.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: tkCanvText.c,v 1.13 2002/05/26 09:09:19 pspjuth Exp $ + * RCS: @(#) $Id: tkCanvText.c,v 1.14 2002/08/05 04:30:38 dgp Exp $ */ #include @@ -407,8 +407,8 @@ ConfigureText(interp, canvas, itemPtr, objc, objv, flags) Tk_State state; tkwin = Tk_CanvasTkwin(canvas); - if (Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (char **) objv, - (char *) textPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { + if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, + (CONST char **) objv, (char *) textPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index 87aadc9..80ba194 100644 --- a/generic/tkCanvUtil.c +++ b/generic/tkCanvUtil.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: tkCanvUtil.c,v 1.6 2002/01/25 21:09:36 dgp Exp $ + * RCS: @(#) $Id: tkCanvUtil.c,v 1.7 2002/08/05 04:30:38 dgp Exp $ */ #include "tkInt.h" @@ -369,7 +369,7 @@ Tk_CanvasTagsParseProc(clientData, interp, tkwin, value, widgRec, offset) ClientData clientData; /* Not used.*/ Tcl_Interp *interp; /* Used for reporting errors. */ Tk_Window tkwin; /* Window containing canvas widget. */ - char *value; /* Value of option (list of tag + CONST char *value; /* Value of option (list of tag * names). */ char *widgRec; /* Pointer to record for item. */ int offset; /* Offset into item (ignored). */ diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c index 65d09bd..c197584 100644 --- a/generic/tkCanvWind.c +++ b/generic/tkCanvWind.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: tkCanvWind.c,v 1.6 2002/06/14 22:25:12 jenglish Exp $ + * RCS: @(#) $Id: tkCanvWind.c,v 1.7 2002/08/05 04:30:38 dgp Exp $ */ #include @@ -329,8 +329,8 @@ ConfigureWinItem(interp, canvas, itemPtr, objc, objv, flags) oldWindow = winItemPtr->tkwin; canvasTkwin = Tk_CanvasTkwin(canvas); - if (Tk_ConfigureWidget(interp, canvasTkwin, configSpecs, objc, (char **) objv, - (char *) winItemPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { + if (TCL_OK != Tk_ConfigureWidget(interp, canvasTkwin, configSpecs, objc, + (CONST char **) objv, (char *) winItemPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 37f9683..97adaf3 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.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: tkCanvas.c,v 1.19 2002/07/24 19:41:38 hobbs Exp $ + * RCS: @(#) $Id: tkCanvas.c,v 1.20 2002/08/05 04:30:38 dgp Exp $ */ /* #define USE_OLD_TAG_SEARCH 1 */ @@ -291,7 +291,7 @@ static int FindArea _ANSI_ARGS_((Tcl_Interp *interp, TkCanvas *canvasPtr, Tcl_Obj *CONST *argv, Tk_Uid uid, int enclosed)); static double GridAlign _ANSI_ARGS_((double coord, double spacing)); -static char** GetStringsFromObjs _ANSI_ARGS_((int argc, +static CONST char** GetStringsFromObjs _ANSI_ARGS_((int argc, Tcl_Obj *CONST *objv)); static void InitCanvas _ANSI_ARGS_((void)); #ifdef USE_OLD_TAG_SEARCH @@ -770,7 +770,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv) goto done; } } else if (argc == 4) { - char *command; + CONST char *command; command = Tk_GetBinding(interp, canvasPtr->bindingTable, object, Tcl_GetStringFromObj(argv[3], NULL)); @@ -791,7 +791,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv) Tcl_ResetResult(interp); } } else { - Tcl_SetResult(interp, command, TCL_STATIC); + Tcl_SetResult(interp, (char *) command, TCL_STATIC); } } else { Tk_GetAllBindings(interp, canvasPtr->bindingTable, object); @@ -900,7 +900,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv) result = (*itemPtr->typePtr->coordProc)(interp, (Tk_Canvas) canvasPtr, itemPtr, argc-3, argv+3); } else { - char **args = GetStringsFromObjs(argc-3, argv+3); + CONST char **args = GetStringsFromObjs(argc-3, argv+3); result = (*itemPtr->typePtr->coordProc)(interp, (Tk_Canvas) canvasPtr, itemPtr, argc-3, (Tcl_Obj **) args); if (args) ckfree((char *) args); @@ -959,7 +959,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv) result = (*typePtr->createProc)(interp, (Tk_Canvas) canvasPtr, itemPtr, argc-3, argv+3); } else { - char **args = GetStringsFromObjs(argc-3, argv+3); + CONST char **args = GetStringsFromObjs(argc-3, argv+3); result = (*typePtr->createProc)(interp, (Tk_Canvas) canvasPtr, itemPtr, argc-3, (Tcl_Obj **) args); if (args) ckfree((char *) args); @@ -1437,7 +1437,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv) (Tk_Canvas) canvasPtr, itemPtr, argc-3, argv+3, TK_CONFIG_ARGV_ONLY); } else { - char **args = GetStringsFromObjs(argc-3, argv+3); + CONST char **args = GetStringsFromObjs(argc-3, argv+3); result = (*itemPtr->typePtr->configProc)(interp, (Tk_Canvas) canvasPtr, itemPtr, argc-3, (Tcl_Obj **) args, TK_CONFIG_ARGV_ONLY); @@ -1526,7 +1526,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv) break; } case CANV_POSTSCRIPT: { - char **args = GetStringsFromObjs(argc, argv); + CONST char **args = GetStringsFromObjs(argc, argv); result = TkCanvPostscriptCmd(canvasPtr, interp, argc, args); if (args) ckfree((char *) args); break; @@ -1819,7 +1819,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv) - canvasPtr->inset, canvasPtr->scrollX1, canvasPtr->scrollX2)); } else { - char **args = GetStringsFromObjs(argc, argv); + CONST char **args = GetStringsFromObjs(argc, argv); type = Tk_GetScrollInfo(interp, argc, args, &fraction, &count); if (args) ckfree((char *) args); switch (type) { @@ -1863,7 +1863,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv) - canvasPtr->inset, canvasPtr->scrollY1, canvasPtr->scrollY2)); } else { - char **args = GetStringsFromObjs(argc, argv); + CONST char **args = GetStringsFromObjs(argc, argv); type = Tk_GetScrollInfo(interp, argc, args, &fraction, &count); if (args) ckfree((char *) args); switch (type) { @@ -2008,7 +2008,8 @@ ConfigureCanvas(interp, canvasPtr, argc, argv, flags) GC new; if (Tk_ConfigureWidget(interp, canvasPtr->tkwin, configSpecs, - argc, (char **) argv, (char *) canvasPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { + argc, (CONST char **) argv, (char *) canvasPtr, + flags|TK_CONFIG_OBJS) != TCL_OK) { return TCL_ERROR; } @@ -5485,17 +5486,17 @@ CanvasSetOrigin(canvasPtr, xOrigin, yOrigin) *---------------------------------------------------------------------- */ /* ARGSUSED */ -static char ** +static CONST char ** GetStringsFromObjs(argc, objv) int argc; Tcl_Obj *CONST objv[]; { register int i; - char **argv; + CONST char **argv; if (argc <= 0) { return NULL; } - argv = (char **) ckalloc((argc+1) * sizeof(char *)); + argv = (CONST char **) ckalloc((argc+1) * sizeof(char *)); for (i = 0; i < argc; i++) { argv[i]=Tcl_GetStringFromObj(objv[i], (int *) NULL); } diff --git a/generic/tkCanvas.h b/generic/tkCanvas.h index 9d2c392..70cb03d 100644 --- a/generic/tkCanvas.h +++ b/generic/tkCanvas.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: tkCanvas.h,v 1.4 1999/12/14 06:52:27 hobbs Exp $ + * RCS: @(#) $Id: tkCanvas.h,v 1.5 2002/08/05 04:30:38 dgp Exp $ */ #ifndef _TKCANVAS @@ -293,7 +293,7 @@ typedef struct TkCanvas { */ extern int TkCanvPostscriptCmd _ANSI_ARGS_((TkCanvas *canvasPtr, - Tcl_Interp *interp, int argc, char **argv)); + Tcl_Interp *interp, int argc, CONST char **argv)); /* * The following definition is shared between tkCanvPs.c and tkCanvImg.c, diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index 83fb376..2efdeac 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.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: tkClipboard.c,v 1.11 2002/06/19 20:40:55 mdejong Exp $ + * RCS: @(#) $Id: tkClipboard.c,v 1.12 2002/08/05 04:30:38 dgp Exp $ */ #include "tkInt.h" @@ -141,7 +141,7 @@ ClipboardAppHandler(clientData, offset, buffer, maxBytes) { TkDisplay *dispPtr = (TkDisplay *) clientData; size_t length; - char *p; + CONST char *p; p = dispPtr->clipboardAppPtr->winPtr->nameUi