summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornijtmans <nijtmans>2007-01-18 23:20:37 (GMT)
committernijtmans <nijtmans>2007-01-18 23:20:37 (GMT)
commit363c82a543b016cf30ea86ff60fcebcd66c64564 (patch)
treee80900db52b451a6b7bbc89772414d0e5c8c3907
parent6c75da00b675108a826e392e827698d4eeb5e4cf (diff)
downloadtk-363c82a543b016cf30ea86ff60fcebcd66c64564.zip
tk-363c82a543b016cf30ea86ff60fcebcd66c64564.tar.gz
tk-363c82a543b016cf30ea86ff60fcebcd66c64564.tar.bz2
various "const" additions, in line with TIP #27
-rw-r--r--generic/tkText.h128
-rw-r--r--generic/tkTextBTree.c40
-rw-r--r--generic/tkTextImage.c14
-rw-r--r--generic/tkTextMark.c24
-rw-r--r--generic/tkTextWind.c24
5 files changed, 115 insertions, 115 deletions
diff --git a/generic/tkText.h b/generic/tkText.h
index 464ff5e..5ac25aa 100644
--- a/generic/tkText.h
+++ b/generic/tkText.h
@@ -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: tkText.h,v 1.30 2006/03/26 17:52:40 vincentdarley Exp $
+ * RCS: @(#) $Id: tkText.h,v 1.31 2007/01/18 23:20:37 nijtmans Exp $
*/
#ifndef _TKTEXT
@@ -172,7 +172,7 @@ typedef struct TkTextEmbImage {
*/
typedef struct TkTextSegment {
- struct Tk_SegType *typePtr; /* Pointer to record describing segment's
+ const struct Tk_SegType *typePtr; /* Pointer to record describing segment's
* type. */
struct TkTextSegment *nextPtr;
/* Next in list of segments for this line, or
@@ -299,13 +299,13 @@ typedef enum {
} TkWrapMode;
typedef struct TkTextTag {
- CONST char *name; /* Name of this tag. This field is actually a
+ const char *name; /* Name of this tag. This field is actually a
* pointer to the key from the entry in
* sharedTextPtr->tagTable, so it needn't be
* freed explicitly. For 'sel' tags this is
* just a static string, so again need not be
* freed. */
- CONST struct TkText*textPtr;/* If non-NULL, then this tag only applies to
+ const struct TkText*textPtr;/* If non-NULL, then this tag only applies to
* the given text widget (when there are peer
* widgets). */
int priority; /* Priority of this tag within widget. 0 means
@@ -827,7 +827,7 @@ typedef void Tk_SegCheckProc(TkTextSegment *segPtr,
TkTextLine *linePtr);
typedef struct Tk_SegType {
- CONST char *name; /* Name of this kind of segment. */
+ const char *name; /* Name of this kind of segment. */
int leftGravity; /* If a segment has zero size (e.g. a mark or
* tag toggle), does it attach to character to
* its left or right? 1 means left, 0 means
@@ -942,11 +942,11 @@ typedef struct TkTextElideInfo {
MODULE_SCOPE int tkBTreeDebug;
MODULE_SCOPE int tkTextDebug;
-MODULE_SCOPE Tk_SegType tkTextCharType;
-MODULE_SCOPE Tk_SegType tkTextLeftMarkType;
-MODULE_SCOPE Tk_SegType tkTextRightMarkType;
-MODULE_SCOPE Tk_SegType tkTextToggleOnType;
-MODULE_SCOPE Tk_SegType tkTextToggleOffType;
+MODULE_SCOPE const Tk_SegType tkTextCharType;
+MODULE_SCOPE const Tk_SegType tkTextLeftMarkType;
+MODULE_SCOPE const Tk_SegType tkTextRightMarkType;
+MODULE_SCOPE const Tk_SegType tkTextToggleOnType;
+MODULE_SCOPE const Tk_SegType tkTextToggleOffType;
/*
* Convenience macros for use by B-tree clients which want to access pixel
@@ -963,10 +963,10 @@ MODULE_SCOPE Tk_SegType tkTextToggleOffType;
* shouldn't be used anywhere else in Tk (or by Tk clients):
*/
-MODULE_SCOPE int TkBTreeAdjustPixelHeight(CONST TkText *textPtr,
+MODULE_SCOPE int TkBTreeAdjustPixelHeight(const TkText *textPtr,
TkTextLine *linePtr, int newPixelHeight,
int mergedLogicalLines);
-MODULE_SCOPE int TkBTreeCharTagged(CONST TkTextIndex *indexPtr,
+MODULE_SCOPE int TkBTreeCharTagged(const TkTextIndex *indexPtr,
TkTextTag *tagPtr);
MODULE_SCOPE void TkBTreeCheck(TkTextBTree tree);
MODULE_SCOPE TkTextBTree TkBTreeCreate(TkSharedText *sharedTextPtr);
@@ -981,27 +981,27 @@ MODULE_SCOPE void TkBTreeDeleteIndexRange(TkTextBTree tree,
TkTextIndex *index1Ptr, TkTextIndex *index2Ptr);
MODULE_SCOPE int TkBTreeEpoch(TkTextBTree tree);
MODULE_SCOPE TkTextLine *TkBTreeFindLine(TkTextBTree tree,
- CONST TkText *textPtr, int line);
+ const TkText *textPtr, int line);
MODULE_SCOPE TkTextLine *TkBTreeFindPixelLine(TkTextBTree tree,
- CONST TkText *textPtr, int pixels,
+ const TkText *textPtr, int pixels,
int *pixelOffset);
-MODULE_SCOPE TkTextTag **TkBTreeGetTags(CONST TkTextIndex *indexPtr,
- CONST TkText *textPtr, int *numTagsPtr);
+MODULE_SCOPE TkTextTag **TkBTreeGetTags(const TkTextIndex *indexPtr,
+ const TkText *textPtr, int *numTagsPtr);
MODULE_SCOPE void TkBTreeInsertChars(TkTextBTree tree,
- TkTextIndex *indexPtr, CONST char *string);
-MODULE_SCOPE int TkBTreeLinesTo(CONST TkText *textPtr,
+ TkTextIndex *indexPtr, const char *string);
+MODULE_SCOPE int TkBTreeLinesTo(const TkText *textPtr,
TkTextLine *linePtr);
-MODULE_SCOPE int TkBTreePixelsTo(CONST TkText *textPtr,
+MODULE_SCOPE int TkBTreePixelsTo(const TkText *textPtr,
TkTextLine *linePtr);
MODULE_SCOPE void TkBTreeLinkSegment(TkTextSegment *segPtr,
TkTextIndex *indexPtr);
-MODULE_SCOPE TkTextLine *TkBTreeNextLine(CONST TkText *textPtr,
+MODULE_SCOPE TkTextLine *TkBTreeNextLine(const TkText *textPtr,
TkTextLine *linePtr);
MODULE_SCOPE int TkBTreeNextTag(TkTextSearch *searchPtr);
MODULE_SCOPE int TkBTreeNumLines(TkTextBTree tree,
- CONST TkText *textPtr);
+ const TkText *textPtr);
MODULE_SCOPE int TkBTreeNumPixels(TkTextBTree tree,
- CONST TkText *textPtr);
+ const TkText *textPtr);
MODULE_SCOPE TkTextLine *TkBTreePreviousLine(TkText *textPtr,
TkTextLine *linePtr);
MODULE_SCOPE int TkBTreePrevTag(TkTextSearch *searchPtr);
@@ -1020,10 +1020,10 @@ MODULE_SCOPE void TkTextBindProc(ClientData clientData,
XEvent *eventPtr);
MODULE_SCOPE void TkTextSelectionEvent(TkText *textPtr);
MODULE_SCOPE void TkTextChanged(TkSharedText *sharedTextPtr,
- TkText *textPtr, CONST TkTextIndex *index1Ptr,
- CONST TkTextIndex *index2Ptr);
+ TkText *textPtr, const TkTextIndex *index1Ptr,
+ const TkTextIndex *index2Ptr);
MODULE_SCOPE int TkTextIndexBbox(TkText *textPtr,
- CONST TkTextIndex *indexPtr, int *xPtr, int *yPtr,
+ const TkTextIndex *indexPtr, int *xPtr, int *yPtr,
int *widthPtr, int *heightPtr, int *charWidthPtr);
MODULE_SCOPE int TkTextCharLayoutProc(TkText *textPtr,
TkTextIndex *indexPtr, TkTextSegment *segPtr,
@@ -1031,53 +1031,53 @@ MODULE_SCOPE int TkTextCharLayoutProc(TkText *textPtr,
TkWrapMode wrapMode, TkTextDispChunk *chunkPtr);
MODULE_SCOPE void TkTextCreateDInfo(TkText *textPtr);
MODULE_SCOPE int TkTextDLineInfo(TkText *textPtr,
- CONST TkTextIndex *indexPtr, int *xPtr, int *yPtr,
+ const TkTextIndex *indexPtr, int *xPtr, int *yPtr,
int *widthPtr, int *heightPtr, int *basePtr);
MODULE_SCOPE void TkTextEmbWinDisplayProc(TkText *textPtr,
TkTextDispChunk *chunkPtr, int x, int y,
int lineHeight, int baseline, Display *display,
Drawable dst, int screenY);
MODULE_SCOPE TkTextTag *TkTextCreateTag(TkText *textPtr,
- CONST char *tagName, int *newTag);
+ const char *tagName, int *newTag);
MODULE_SCOPE void TkTextFreeDInfo(TkText *textPtr);
MODULE_SCOPE void TkTextDeleteTag(TkText *textPtr, TkTextTag *tagPtr);
MODULE_SCOPE void TkTextFreeTag(TkText *textPtr, TkTextTag *tagPtr);
MODULE_SCOPE int TkTextGetIndex(Tcl_Interp *interp, TkText *textPtr,
- CONST char *string, TkTextIndex *indexPtr);
+ const char *string, TkTextIndex *indexPtr);
MODULE_SCOPE int TkTextGetObjIndex(Tcl_Interp *interp, TkText *textPtr,
Tcl_Obj *idxPtr, TkTextIndex *indexPtr);
MODULE_SCOPE int TkTextSharedGetObjIndex(Tcl_Interp *interp,
TkSharedText *sharedTextPtr, Tcl_Obj *idxPtr,
TkTextIndex *indexPtr);
-MODULE_SCOPE CONST TkTextIndex *TkTextGetIndexFromObj(Tcl_Interp *interp,
+MODULE_SCOPE const TkTextIndex *TkTextGetIndexFromObj(Tcl_Interp *interp,
TkText *textPtr, Tcl_Obj *objPtr);
MODULE_SCOPE TkTextTabArray *TkTextGetTabs(Tcl_Interp *interp,
TkText *textPtr, Tcl_Obj *stringPtr);
MODULE_SCOPE void TkTextFindDisplayLineEnd(TkText *textPtr,
TkTextIndex *indexPtr, int end, int *xOffset);
-MODULE_SCOPE int TkTextIndexBackBytes(CONST TkText *textPtr,
- CONST TkTextIndex *srcPtr, int count,
+MODULE_SCOPE int TkTextIndexBackBytes(const TkText *textPtr,
+ const TkTextIndex *srcPtr, int count,
TkTextIndex *dstPtr);
-MODULE_SCOPE void TkTextIndexBackChars(CONST TkText *textPtr,
- CONST TkTextIndex *srcPtr, int count,
+MODULE_SCOPE void TkTextIndexBackChars(const TkText *textPtr,
+ const TkTextIndex *srcPtr, int count,
TkTextIndex *dstPtr, TkTextCountType type);
-MODULE_SCOPE int TkTextIndexCmp(CONST TkTextIndex *index1Ptr,
- CONST TkTextIndex *index2Ptr);
-MODULE_SCOPE int TkTextIndexCount(CONST TkText *textPtr,
- CONST TkTextIndex *index1Ptr,
- CONST TkTextIndex *index2Ptr,
+MODULE_SCOPE int TkTextIndexCmp(const TkTextIndex *index1Ptr,
+ const TkTextIndex *index2Ptr);
+MODULE_SCOPE int TkTextIndexCount(const TkText *textPtr,
+ const TkTextIndex *index1Ptr,
+ const TkTextIndex *index2Ptr,
TkTextCountType type);
-MODULE_SCOPE int TkTextIndexForwBytes(CONST TkText *textPtr,
- CONST TkTextIndex *srcPtr, int count,
+MODULE_SCOPE int TkTextIndexForwBytes(const TkText *textPtr,
+ const TkTextIndex *srcPtr, int count,
TkTextIndex *dstPtr);
-MODULE_SCOPE void TkTextIndexForwChars(CONST TkText *textPtr,
- CONST TkTextIndex *srcPtr, int count,
+MODULE_SCOPE void TkTextIndexForwChars(const TkText *textPtr,
+ const TkTextIndex *srcPtr, int count,
TkTextIndex *dstPtr, TkTextCountType type);
MODULE_SCOPE void TkTextIndexOfX(TkText *textPtr, int x,
TkTextIndex *indexPtr);
MODULE_SCOPE int TkTextIndexYPixels(TkText *textPtr,
- CONST TkTextIndex *indexPtr);
-MODULE_SCOPE TkTextSegment *TkTextIndexToSeg(CONST TkTextIndex *indexPtr,
+ const TkTextIndex *indexPtr);
+MODULE_SCOPE TkTextSegment *TkTextIndexToSeg(const TkTextIndex *indexPtr,
int *offsetPtr);
MODULE_SCOPE void TkTextInsertDisplayProc(TkText *textPtr,
TkTextDispChunk *chunkPtr, int x, int y,
@@ -1090,11 +1090,11 @@ MODULE_SCOPE TkTextIndex *TkTextMakeCharIndex(TkTextBTree tree, TkText *textPtr,
MODULE_SCOPE int TkTextMeasureDown(TkText *textPtr,
TkTextIndex *srcPtr, int distance);
MODULE_SCOPE void TkTextFreeElideInfo(TkTextElideInfo *infoPtr);
-MODULE_SCOPE int TkTextIsElided(CONST TkText *textPtr,
- CONST TkTextIndex *indexPtr,
+MODULE_SCOPE int TkTextIsElided(const TkText *textPtr,
+ const TkTextIndex *indexPtr,
TkTextElideInfo *infoPtr);
MODULE_SCOPE TkTextIndex *TkTextMakeByteIndex(TkTextBTree tree,
- CONST TkText *textPtr, int lineIndex,
+ const TkText *textPtr, int lineIndex,
int byteIndex, TkTextIndex *indexPtr);
MODULE_SCOPE int TkTextMakePixelIndex(TkText *textPtr,
int pixelIndex, TkTextIndex *indexPtr);
@@ -1107,19 +1107,19 @@ MODULE_SCOPE int TkTextUpdateOneLine(TkText *textPtr,
TkTextLine *linePtr, int pixelHeight,
TkTextIndex *indexPtr, int partialCalc);
MODULE_SCOPE int TkTextMarkCmd(TkText *textPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int TkTextMarkNameToIndex(TkText *textPtr,
- CONST char *name, TkTextIndex *indexPtr);
+ const char *name, TkTextIndex *indexPtr);
MODULE_SCOPE void TkTextMarkSegToIndex(TkText *textPtr,
TkTextSegment *markPtr, TkTextIndex *indexPtr);
MODULE_SCOPE void TkTextEventuallyRepick(TkText *textPtr);
MODULE_SCOPE void TkTextPickCurrent(TkText *textPtr, XEvent *eventPtr);
MODULE_SCOPE void TkTextPixelIndex(TkText *textPtr, int x, int y,
TkTextIndex *indexPtr, int *nearest);
-MODULE_SCOPE int TkTextPrintIndex(CONST TkText *textPtr,
- CONST TkTextIndex *indexPtr, char *string);
+MODULE_SCOPE int TkTextPrintIndex(const TkText *textPtr,
+ const TkTextIndex *indexPtr, char *string);
MODULE_SCOPE Tcl_Obj* TkTextNewIndexObj(TkText *textPtr,
- CONST TkTextIndex *indexPtr);
+ const TkTextIndex *indexPtr);
MODULE_SCOPE void TkTextRedrawRegion(TkText *textPtr, int x, int y,
int width, int height);
MODULE_SCOPE void TkTextRedrawTag(TkSharedText *sharedTextPtr,
@@ -1128,29 +1128,29 @@ MODULE_SCOPE void TkTextRedrawTag(TkSharedText *sharedTextPtr,
int withTag);
MODULE_SCOPE void TkTextRelayoutWindow(TkText *textPtr, int mask);
MODULE_SCOPE int TkTextScanCmd(TkText *textPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int TkTextSeeCmd(TkText *textPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
-MODULE_SCOPE int TkTextSegToOffset(CONST TkTextSegment *segPtr,
- CONST TkTextLine *linePtr);
+ int objc, Tcl_Obj *const objv[]);
+MODULE_SCOPE int TkTextSegToOffset(const TkTextSegment *segPtr,
+ const TkTextLine *linePtr);
MODULE_SCOPE TkTextSegment *TkTextSetMark(TkText *textPtr,
- CONST char *name, TkTextIndex *indexPtr);
+ const char *name, TkTextIndex *indexPtr);
MODULE_SCOPE void TkTextSetYView(TkText *textPtr,
TkTextIndex *indexPtr, int pickPlace);
MODULE_SCOPE int TkTextTagCmd(TkText *textPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int TkTextImageCmd(TkText *textPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int TkTextImageIndex(TkText *textPtr,
- CONST char *name, TkTextIndex *indexPtr);
+ const char *name, TkTextIndex *indexPtr);
MODULE_SCOPE int TkTextWindowCmd(TkText *textPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
-MODULE_SCOPE int TkTextWindowIndex(TkText *textPtr, CONST char *name,
+ int objc, Tcl_Obj *const objv[]);
+MODULE_SCOPE int TkTextWindowIndex(TkText *textPtr, const char *name,
TkTextIndex *indexPtr);
MODULE_SCOPE int TkTextXviewCmd(TkText *textPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int TkTextYviewCmd(TkText *textPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE void TkTextWinFreeClient(Tcl_HashEntry *hPtr,
TkTextEmbWindowClient *client);
diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c
index 95a7fad..e8f0112 100644
--- a/generic/tkTextBTree.c
+++ b/generic/tkTextBTree.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: tkTextBTree.c,v 1.22 2006/09/10 17:06:32 das Exp $
+ * RCS: @(#) $Id: tkTextBTree.c,v 1.23 2007/01/18 23:20:37 nijtmans Exp $
*/
#include "tkInt.h"
@@ -206,7 +206,7 @@ static void AdjustStartEndRefs _ANSI_ARGS_((BTree *treePtr,
* Type record for character segments:
*/
-Tk_SegType tkTextCharType = {
+const Tk_SegType tkTextCharType = {
"character", /* name */
0, /* leftGravity */
CharSplitProc, /* splitProc */
@@ -221,7 +221,7 @@ Tk_SegType tkTextCharType = {
* Type record for segments marking the beginning of a tagged range:
*/
-Tk_SegType tkTextToggleOnType = {
+const Tk_SegType tkTextToggleOnType = {
"toggleOn", /* name */
0, /* leftGravity */
NULL, /* splitProc */
@@ -236,7 +236,7 @@ Tk_SegType tkTextToggleOnType = {
* Type record for segments marking the end of a tagged range:
*/
-Tk_SegType tkTextToggleOffType = {
+const Tk_SegType tkTextToggleOffType = {
"toggleOff", /* name */
1, /* leftGravity */
NULL, /* splitProc */
@@ -940,7 +940,7 @@ DeleteSummaries(summaryPtr)
int
TkBTreeAdjustPixelHeight(textPtr, linePtr, newPixelHeight, mergedLogicalLines)
- CONST TkText *textPtr; /* Client of the B-tree */
+ const TkText *textPtr; /* Client of the B-tree */
register TkTextLine *linePtr;
/* The logical line to update. */
int newPixelHeight; /* The line's known height in pixels. */
@@ -1014,7 +1014,7 @@ TkBTreeInsertChars(tree, indexPtr, string)
* function returns, this index is no longer
* valid because of changes to the segment
* structure. */
- CONST char *string; /* Pointer to bytes to insert (may contain
+ const char *string; /* Pointer to bytes to insert (may contain
* newlines, must be null-terminated). */
{
register Node *nodePtr;
@@ -1030,7 +1030,7 @@ TkBTreeInsertChars(tree, indexPtr, string)
register TkTextSegment *segPtr;
TkTextLine *newLinePtr;
int chunkSize; /* # characters in current chunk. */
- register CONST char *eol; /* Pointer to character just after last one in
+ register const char *eol; /* Pointer to character just after last one in
* current chunk. */
int changeToLineCount; /* Counts change to total number of lines in
* file. */
@@ -1593,7 +1593,7 @@ TkBTreeDeleteIndexRange(tree, index1Ptr, index2Ptr)
TkTextLine *
TkBTreeFindLine(tree, textPtr, line)
TkTextBTree tree; /* B-tree in which to find line. */
- CONST TkText *textPtr; /* Relative to this client of the B-tree */
+ const TkText *textPtr; /* Relative to this client of the B-tree */
int line; /* Index of desired line. */
{
BTree *treePtr = (BTree *) tree;
@@ -1682,7 +1682,7 @@ TkBTreeFindLine(tree, textPtr, line)
TkTextLine *
TkBTreeFindPixelLine(tree, textPtr, pixels, pixelOffset)
TkTextBTree tree; /* B-tree to use. */
- CONST TkText *textPtr; /* Relative to this client of the B-tree */
+ const TkText *textPtr; /* Relative to this client of the B-tree */
int pixels; /* Pixel index of desired line. */
int *pixelOffset; /* Used to return offset */
{
@@ -1755,7 +1755,7 @@ TkBTreeFindPixelLine(tree, textPtr, pixels, pixelOffset)
TkTextLine *
TkBTreeNextLine(textPtr, linePtr)
- CONST TkText *textPtr; /* Next line in the context of this client */
+ const TkText *textPtr; /* Next line in the context of this client */
register TkTextLine *linePtr;
/* Pointer to existing line in B-tree. */
{
@@ -1894,7 +1894,7 @@ TkBTreePreviousLine(textPtr, linePtr)
int
TkBTreePixelsTo(textPtr, linePtr)
- CONST TkText *textPtr; /* Relative to this client of the B-tree */
+ const TkText *textPtr; /* Relative to this client of the B-tree */
TkTextLine *linePtr; /* Pointer to existing line in B-tree. */
{
register TkTextLine *linePtr2;
@@ -1955,7 +1955,7 @@ TkBTreePixelsTo(textPtr, linePtr)
int
TkBTreeLinesTo(textPtr, linePtr)
- CONST TkText *textPtr; /* Relative to this client of the B-tree */
+ const TkText *textPtr; /* Relative to this client of the B-tree */
TkTextLine *linePtr; /* Pointer to existing line in B-tree. */
{
register TkTextLine *linePtr2;
@@ -3198,7 +3198,7 @@ TkBTreePrevTag(searchPtr)
int
TkBTreeCharTagged(indexPtr, tagPtr)
- CONST TkTextIndex *indexPtr;/* Indicates a character position at which to
+ const TkTextIndex *indexPtr;/* Indicates a character position at which to
* check for a tag. */
TkTextTag *tagPtr; /* Tag of interest. */
{
@@ -3309,9 +3309,9 @@ TkBTreeCharTagged(indexPtr, tagPtr)
/* ARGSUSED */
TkTextTag **
TkBTreeGetTags(indexPtr, textPtr, numTagsPtr)
- CONST TkTextIndex *indexPtr;/* Indicates a particular position in the
+ const TkTextIndex *indexPtr;/* Indicates a particular position in the
* B-tree. */
- CONST TkText *textPtr; /* If non-NULL, then only return tags for this
+ const TkText *textPtr; /* If non-NULL, then only return tags for this
* text widget (when there are peer
* widgets). */
int *numTagsPtr; /* Store number of tags found at this
@@ -3406,7 +3406,7 @@ TkBTreeGetTags(indexPtr, textPtr, numTagsPtr)
for (src = 0, dst = 0; src < tagInfo.numTags; src++) {
if (tagInfo.counts[src] & 1) {
- CONST TkText *tagTextPtr = tagInfo.tagPtrs[src]->textPtr;
+ const TkText *tagTextPtr = tagInfo.tagPtrs[src]->textPtr;
if (tagTextPtr == NULL || textPtr == NULL || tagTextPtr == textPtr) {
tagInfo.tagPtrs[dst] = tagInfo.tagPtrs[src];
dst++;
@@ -3456,8 +3456,8 @@ TkBTreeGetTags(indexPtr, textPtr, numTagsPtr)
/* ARGSUSED */
int
TkTextIsElided(textPtr, indexPtr, elideInfo)
- CONST TkText *textPtr; /* Overall information about text widget. */
- CONST TkTextIndex *indexPtr;/* The character in the text for which display
+ const TkText *textPtr; /* Overall information about text widget. */
+ const TkTextIndex *indexPtr;/* The character in the text for which display
* information is wanted. */
TkTextElideInfo *elideInfo; /* NULL or a pointer to a structure in which
* indexPtr's elide state will be stored and
@@ -4470,7 +4470,7 @@ RecomputeNodeCounts(treePtr, nodePtr)
int
TkBTreeNumLines(tree, textPtr)
TkTextBTree tree; /* Information about tree. */
- CONST TkText *textPtr; /* Relative to this client of the B-tree */
+ const TkText *textPtr; /* Relative to this client of the B-tree */
{
BTree *treePtr = (BTree *) tree;
int count;
@@ -4511,7 +4511,7 @@ TkBTreeNumLines(tree, textPtr)
int
TkBTreeNumPixels(tree, textPtr)
TkTextBTree tree; /* The B-tree */
- CONST TkText *textPtr; /* Relative to this client of the B-tree */
+ const TkText *textPtr; /* Relative to this client of the B-tree */
{
BTree *treePtr = (BTree *) tree;
return treePtr->rootPtr->numPixels[textPtr->pixelReference];
diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c
index 77f3fa5..d290250 100644
--- a/generic/tkTextImage.c
+++ b/generic/tkTextImage.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: tkTextImage.c,v 1.18 2007/01/03 05:06:26 nijtmans Exp $
+ * RCS: @(#) $Id: tkTextImage.c,v 1.19 2007/01/18 23:20:37 nijtmans Exp $
*/
#include "tk.h"
@@ -37,7 +37,7 @@ static void EmbImageBboxProc(TkText *textPtr,
int *widthPtr, int *heightPtr);
static int EmbImageConfigure(TkText *textPtr,
TkTextSegment *eiPtr, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int EmbImageDeleteProc(TkTextSegment *segPtr,
TkTextLine *linePtr, int treeGone);
static void EmbImageDisplayProc(TkText *textPtr,
@@ -57,7 +57,7 @@ static void EmbImageProc(ClientData clientData, int x, int y,
* The following structure declares the "embedded image" segment type.
*/
-static Tk_SegType tkTextEmbImageType = {
+static const Tk_SegType tkTextEmbImageType = {
"image", /* name */
0, /* leftGravity */
NULL, /* splitProc */
@@ -124,14 +124,14 @@ TkTextImageCmd(
register TkText *textPtr, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already
+ Tcl_Obj *const objv[]) /* Argument objects. Someone else has already
* parsed this command enough to know that
* objv[1] is "image". */
{
int idx;
register TkTextSegment *eiPtr;
TkTextIndex index;
- static CONST char *optionStrings[] = {
+ static const char *optionStrings[] = {
"cget", "configure", "create", "names", NULL
};
enum opts {
@@ -319,7 +319,7 @@ EmbImageConfigure(
* embedded image. */
TkTextSegment *eiPtr, /* Embedded image to be configured. */
int objc, /* Number of strings in objv. */
- Tcl_Obj *CONST objv[]) /* Array of strings describing configuration
+ Tcl_Obj *const objv[]) /* Array of strings describing configuration
* options. */
{
Tk_Image image;
@@ -773,7 +773,7 @@ EmbImageBboxProc(
int
TkTextImageIndex(
TkText *textPtr, /* Text widget containing image. */
- CONST char *name, /* Name of image. */
+ const char *name, /* Name of image. */
TkTextIndex *indexPtr) /* Index information gets stored here. */
{
Tcl_HashEntry *hPtr;
diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c
index 50aa4af..e386c0a 100644
--- a/generic/tkTextMark.c
+++ b/generic/tkTextMark.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: tkTextMark.c,v 1.16 2005/11/17 10:57:35 dkf Exp $
+ * RCS: @(#) $Id: tkTextMark.c,v 1.17 2007/01/18 23:20:37 nijtmans Exp $
*/
#include "tkInt.h"
@@ -41,9 +41,9 @@ static int MarkLayoutProc(TkText *textPtr, TkTextIndex *indexPtr,
int maxChars, int noCharsYet, TkWrapMode wrapMode,
TkTextDispChunk *chunkPtr);
static int MarkFindNext(Tcl_Interp *interp,
- TkText *textPtr, CONST char *markName);
+ TkText *textPtr, const char *markName);
static int MarkFindPrev(Tcl_Interp *interp,
- TkText *textPtr, CONST char *markName);
+ TkText *textPtr, const char *markName);
/*
@@ -53,7 +53,7 @@ static int MarkFindPrev(Tcl_Interp *interp,
* their gravity property.
*/
-Tk_SegType tkTextRightMarkType = {
+const Tk_SegType tkTextRightMarkType = {
"mark", /* name */
0, /* leftGravity */
NULL, /* splitProc */
@@ -64,7 +64,7 @@ Tk_SegType tkTextRightMarkType = {
MarkCheckProc /* checkProc */
};
-Tk_SegType tkTextLeftMarkType = {
+const Tk_SegType tkTextLeftMarkType = {
"mark", /* name */
1, /* leftGravity */
NULL, /* splitProc */
@@ -98,7 +98,7 @@ TkTextMarkCmd(
register TkText *textPtr, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already
+ Tcl_Obj *const objv[]) /* Argument objects. Someone else has already
* parsed this command enough to know that
* objv[1] is "mark". */
{
@@ -106,11 +106,11 @@ TkTextMarkCmd(
TkTextSegment *markPtr;
Tcl_HashSearch search;
TkTextIndex index;
- Tk_SegType *newTypePtr;
+ const Tk_SegType *newTypePtr;
int optionIndex;
- static CONST char *markOptionStrings[] = {
+ static const char *markOptionStrings[] = {
"gravity", "names", "next", "previous", "set",
"unset", NULL
};
@@ -261,7 +261,7 @@ TkTextMarkCmd(
TkTextSegment *
TkTextSetMark(
TkText *textPtr, /* Text widget in which to create mark. */
- CONST char *name, /* Name of mark to set. */
+ const char *name, /* Name of mark to set. */
TkTextIndex *indexPtr) /* Where to set mark. */
{
Tcl_HashEntry *hPtr = NULL;
@@ -406,7 +406,7 @@ TkTextMarkSegToIndex(
int
TkTextMarkNameToIndex(
TkText *textPtr, /* Text widget containing mark. */
- CONST char *name, /* Name of mark. */
+ const char *name, /* Name of mark. */
TkTextIndex *indexPtr) /* Index information gets stored here. */
{
TkTextSegment *segPtr;
@@ -733,7 +733,7 @@ static int
MarkFindNext(
Tcl_Interp *interp, /* For error reporting */
TkText *textPtr, /* The widget */
- CONST char *string) /* The starting index or mark name */
+ const char *string) /* The starting index or mark name */
{
TkTextIndex index;
Tcl_HashEntry *hPtr;
@@ -833,7 +833,7 @@ static int
MarkFindPrev(
Tcl_Interp *interp, /* For error reporting */
TkText *textPtr, /* The widget */
- CONST char *string) /* The starting index or mark name */
+ const char *string) /* The starting index or mark name */
{
TkTextIndex index;
Tcl_HashEntry *hPtr;
diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c
index 4a577c8..b85852a 100644
--- a/generic/tkTextWind.c
+++ b/generic/tkTextWind.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: tkTextWind.c,v 1.19 2007/01/05 00:00:51 nijtmans Exp $
+ * RCS: @(#) $Id: tkTextWind.c,v 1.20 2007/01/18 23:20:37 nijtmans Exp $
*/
#include "tk.h"
@@ -55,7 +55,7 @@ static void EmbWinBboxProc(TkText *textPtr,
int *xPtr, int *yPtr, int *widthPtr,
int *heightPtr);
static int EmbWinConfigure(TkText *textPtr, TkTextSegment *ewPtr,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void EmbWinDelayedUnmap(ClientData clientData);
static int EmbWinDeleteProc(TkTextSegment *segPtr,
TkTextLine *linePtr, int treeGone);
@@ -68,14 +68,14 @@ static void EmbWinStructureProc(ClientData clientData,
XEvent *eventPtr);
static void EmbWinUndisplayProc(TkText *textPtr,
TkTextDispChunk *chunkPtr);
-static TkTextEmbWindowClient* EmbWinGetClient(CONST TkText *textPtr,
+static TkTextEmbWindowClient* EmbWinGetClient(const TkText *textPtr,
TkTextSegment *ewPtr);
/*
* The following structure declares the "embedded window" segment type.
*/
-static Tk_SegType tkTextEmbWindowType = {
+static const Tk_SegType tkTextEmbWindowType = {
"window", /* name */
0, /* leftGravity */
NULL, /* splitProc */
@@ -141,13 +141,13 @@ TkTextWindowCmd(
register TkText *textPtr, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already
+ Tcl_Obj *const objv[]) /* Argument objects. Someone else has already
* parsed this command enough to know that
* objv[1] is "window". */
{
int optionIndex;
- static CONST char *windOptionStrings[] = {
+ static const char *windOptionStrings[] = {
"cget", "configure", "create", "names", NULL
};
enum windOptions {
@@ -385,7 +385,7 @@ EmbWinConfigure(
* embedded window. */
TkTextSegment *ewPtr, /* Embedded window to be configured. */
int objc, /* Number of strings in objv. */
- Tcl_Obj *CONST objv[]) /* Array of objects describing configuration
+ Tcl_Obj *const objv[]) /* Array of objects describing configuration
* options. */
{
Tk_Window oldWindow;
@@ -856,8 +856,8 @@ EmbWinLayoutProc(
Tcl_DString name;
Tk_Window ancestor;
Tcl_HashEntry *hPtr;
- CONST char *before;
- CONST char *string;
+ const char *before;
+ const char *string;
Tcl_DString buf;
Tcl_DString *dsPtr = NULL;
@@ -887,7 +887,7 @@ EmbWinLayoutProc(
*/
int spaceNeeded, cvtFlags, length;
- CONST char *str = Tk_PathName(textPtr->tkwin);
+ const char *str = Tk_PathName(textPtr->tkwin);
spaceNeeded = Tcl_ScanElement(str, &cvtFlags);
length = Tcl_DStringLength(dsPtr);
@@ -1331,7 +1331,7 @@ EmbWinDelayedUnmap(
int
TkTextWindowIndex(
TkText *textPtr, /* Text widget containing window. */
- CONST char *name, /* Name of window. */
+ const char *name, /* Name of window. */
TkTextIndex *indexPtr) /* Index information gets stored here. */
{
Tcl_HashEntry *hPtr;
@@ -1375,7 +1375,7 @@ TkTextWindowIndex(
static TkTextEmbWindowClient*
EmbWinGetClient(
- CONST TkText *textPtr, /* Information about text widget. */
+ const TkText *textPtr, /* Information about text widget. */
TkTextSegment *ewPtr) /* Segment containing embedded window. */
{
TkTextEmbWindowClient *client = ewPtr->body.ew.clients;