summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-12 21:59:23 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-12 21:59:23 (GMT)
commitdd4f5b0646f28e3e3729557730e81550f3faeb16 (patch)
tree99dce5cc0b6563216817878a1170376b663365d2 /generic
parent1a1118fa21d731504dac09ed2e6d6238601f5c84 (diff)
downloadtk-dd4f5b0646f28e3e3729557730e81550f3faeb16.zip
tk-dd4f5b0646f28e3e3729557730e81550f3faeb16.tar.gz
tk-dd4f5b0646f28e3e3729557730e81550f3faeb16.tar.bz2
Even more -1 -> TCL_INDEX_NONE
Diffstat (limited to 'generic')
-rw-r--r--generic/tkCanvPs.c4
-rw-r--r--generic/tkText.c76
-rw-r--r--generic/tkTextDisp.c28
-rw-r--r--generic/tkTextImage.c12
-rw-r--r--generic/tkTextIndex.c2
-rw-r--r--generic/tkTextMark.c6
-rw-r--r--generic/tkTextTag.c16
-rw-r--r--generic/tkTextWind.c20
8 files changed, 83 insertions, 81 deletions
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c
index 3b2c7c3..e62d4ba 100644
--- a/generic/tkCanvPs.c
+++ b/generic/tkCanvPs.c
@@ -1196,11 +1196,13 @@ GetPostscriptPoints(
#if defined(_WIN32) || defined(MAC_OSX_TK)
static void
TkImageGetColor(
- TCL_UNUSED(TkColormapData *),
+ TkColormapData *cdata,
unsigned long pixel, /* Pixel value to look up */
double *red, double *green, double *blue)
/* Color data to return */
{
+ (void)cdata;
+
*red = (double) GetRValue(pixel) / 255.0;
*green = (double) GetGValue(pixel) / 255.0;
*blue = (double) GetBValue(pixel) / 255.0;
diff --git a/generic/tkText.c b/generic/tkText.c
index a1ab880..d535428 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -87,15 +87,15 @@ static const char *const insertUnfocussedStrings[] = {
* freeing.
*/
-static int SetLineStartEnd(ClientData clientData,
+static int SetLineStartEnd(void *clientData,
Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj **value, char *recordPtr,
Tcl_Size internalOffset, char *oldInternalPtr,
int flags);
-static Tcl_Obj * GetLineStartEnd(ClientData clientData,
+static Tcl_Obj * GetLineStartEnd(void *clientData,
Tk_Window tkwin, char *recordPtr,
Tcl_Size internalOffset);
-static void RestoreLineStartEnd(ClientData clientData,
+static void RestoreLineStartEnd(void *clientData,
Tk_Window tkwin, char *internalPtr,
char *oldInternalPtr);
static int ObjectIsEmpty(Tcl_Obj *objPtr);
@@ -272,7 +272,7 @@ typedef ClientData SearchAddLineProc(int lineNum,
int *extraLinesPtr);
typedef int SearchMatchProc(int lineNum,
struct SearchSpec *searchSpecPtr,
- ClientData clientData, Tcl_Obj *theLine,
+ void *clientData, Tcl_Obj *theLine,
Tcl_Size matchOffset, Tcl_Size matchLength);
typedef int SearchLineIndexProc(Tcl_Interp *interp,
Tcl_Obj *objPtr, struct SearchSpec *searchSpecPtr,
@@ -313,7 +313,7 @@ typedef struct SearchSpec {
SearchLineIndexProc *lineIndexProc;
/* Function to call when we have found a
* match. */
- ClientData clientData; /* Information about structure being searched,
+ void *clientData; /* Information about structure being searched,
* in this case a text widget. */
} SearchSpec;
@@ -352,14 +352,14 @@ static void DestroyText(TkText *textPtr);
static int InsertChars(TkSharedText *sharedTextPtr,
TkText *textPtr, TkTextIndex *indexPtr,
Tcl_Obj *stringPtr, int viewUpdate);
-static void TextBlinkProc(ClientData clientData);
-static void TextCmdDeletedProc(ClientData clientData);
+static void TextBlinkProc(void *clientData);
+static void TextCmdDeletedProc(void *clientData);
static int CreateWidget(TkSharedText *sharedPtr, Tk_Window tkwin,
Tcl_Interp *interp, const TkText *parent,
int objc, Tcl_Obj *const objv[]);
-static void TextEventProc(ClientData clientData,
+static void TextEventProc(void *clientData,
XEvent *eventPtr);
-static Tcl_Size TextFetchSelection(ClientData clientData, Tcl_Size offset,
+static Tcl_Size TextFetchSelection(void *clientData, Tcl_Size offset,
char *buffer, Tcl_Size maxBytes);
static int TextIndexSortProc(const void *first,
const void *second);
@@ -375,13 +375,13 @@ static int TextSearchCmd(TkText *textPtr, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static int TextEditCmd(TkText *textPtr, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
-static int TextWidgetObjCmd(ClientData clientData,
+static int TextWidgetObjCmd(void *clientData,
Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
-static int SharedTextObjCmd(ClientData clientData,
+static int SharedTextObjCmd(void *clientData,
Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
-static void TextWorldChangedCallback(ClientData instanceData);
+static void TextWorldChangedCallback(void *instanceData);
static void TextWorldChanged(TkText *textPtr, int mask);
static int TextDumpCmd(TkText *textPtr, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
@@ -450,7 +450,7 @@ static const Tk_ClassProcs textClass = {
int
Tk_TextObjCmd(
- ClientData clientData, /* Main window associated with interpreter. */
+ void *clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -688,7 +688,7 @@ CreateWidget(
static int
TextWidgetObjCmd(
- ClientData clientData, /* Information about text widget. */
+ void *clientData, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -1596,7 +1596,7 @@ TextWidgetObjCmd(
static int
SharedTextObjCmd(
- ClientData clientData, /* Information about shared test B-tree. */
+ void *clientData, /* Information about shared test B-tree. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -2124,7 +2124,7 @@ ConfigureText(
}
if (start > end) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "-startline must be less than or equal to -endline", -1));
+ "-startline must be less than or equal to -endline", TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "TK", "TEXT", "INDEX_ORDER", NULL);
Tk_RestoreSavedOptions(&savedOptions);
return TCL_ERROR;
@@ -2374,7 +2374,7 @@ ConfigureText(
static void
TextWorldChangedCallback(
- ClientData instanceData) /* Information about widget. */
+ void *instanceData) /* Information about widget. */
{
TkText *textPtr = (TkText *)instanceData;
@@ -2464,7 +2464,7 @@ TextWorldChanged(
static void
TextEventProc(
- ClientData clientData, /* Information about window. */
+ void *clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
TkText *textPtr = (TkText *)clientData;
@@ -2574,7 +2574,7 @@ TextEventProc(
static void
TextCmdDeletedProc(
- ClientData clientData) /* Pointer to widget record for widget. */
+ void *clientData) /* Pointer to widget record for widget. */
{
TkText *textPtr = (TkText *)clientData;
Tk_Window tkwin = textPtr->tkwin;
@@ -2810,13 +2810,13 @@ TextPushUndoAction(
Tcl_IncrRefCount(index2Obj);
Tcl_ListObjAppendElement(NULL, seeInsertObj,
- Tcl_NewStringObj(Tk_PathName(textPtr->tkwin), -1));
+ Tcl_NewStringObj(Tk_PathName(textPtr->tkwin), TCL_INDEX_NONE));
Tcl_ListObjAppendElement(NULL, seeInsertObj, Tcl_NewStringObj("see", 3));
Tcl_ListObjAppendElement(NULL, seeInsertObj,
Tcl_NewStringObj("insert", 6));
Tcl_ListObjAppendElement(NULL, markSet1InsertObj,
- Tcl_NewStringObj(Tk_PathName(textPtr->tkwin), -1));
+ Tcl_NewStringObj(Tk_PathName(textPtr->tkwin), TCL_INDEX_NONE));
Tcl_ListObjAppendElement(NULL, markSet1InsertObj,
Tcl_NewStringObj("mark", 4));
Tcl_ListObjAppendElement(NULL, markSet1InsertObj,
@@ -2843,7 +2843,7 @@ TextPushUndoAction(
Tcl_ListObjAppendElement(NULL, deleteCmdObj, index2Obj);
Tcl_ListObjAppendElement(NULL, markSetLUndoMarkCmdObj,
- Tcl_NewStringObj(Tk_PathName(textPtr->tkwin), -1));
+ Tcl_NewStringObj(Tk_PathName(textPtr->tkwin), TCL_INDEX_NONE));
Tcl_ListObjAppendElement(NULL, markSetLUndoMarkCmdObj,
Tcl_NewStringObj("mark", 4));
Tcl_ListObjAppendElement(NULL, markSetLUndoMarkCmdObj,
@@ -2854,23 +2854,23 @@ TextPushUndoAction(
strcat(lMarkName, stringUndoMarkId);
strcat(rMarkName, stringUndoMarkId);
Tcl_ListObjAppendElement(NULL, markSetLUndoMarkCmdObj,
- Tcl_NewStringObj(lMarkName, -1));
+ Tcl_NewStringObj(lMarkName, TCL_INDEX_NONE));
Tcl_ListObjAppendElement(NULL, markSetRUndoMarkCmdObj,
- Tcl_NewStringObj(rMarkName, -1));
+ Tcl_NewStringObj(rMarkName, TCL_INDEX_NONE));
Tcl_ListObjAppendElement(NULL, markSetLUndoMarkCmdObj, index1Obj);
Tcl_ListObjAppendElement(NULL, markSetRUndoMarkCmdObj, index2Obj);
Tcl_ListObjAppendElement(NULL, markGravityLUndoMarkCmdObj,
- Tcl_NewStringObj(Tk_PathName(textPtr->tkwin), -1));
+ Tcl_NewStringObj(Tk_PathName(textPtr->tkwin), TCL_INDEX_NONE));
Tcl_ListObjAppendElement(NULL, markGravityLUndoMarkCmdObj,
Tcl_NewStringObj("mark", 4));
Tcl_ListObjAppendElement(NULL, markGravityLUndoMarkCmdObj,
Tcl_NewStringObj("gravity", 7));
markGravityRUndoMarkCmdObj = Tcl_DuplicateObj(markGravityLUndoMarkCmdObj);
Tcl_ListObjAppendElement(NULL, markGravityLUndoMarkCmdObj,
- Tcl_NewStringObj(lMarkName, -1));
+ Tcl_NewStringObj(lMarkName, TCL_INDEX_NONE));
Tcl_ListObjAppendElement(NULL, markGravityRUndoMarkCmdObj,
- Tcl_NewStringObj(rMarkName, -1));
+ Tcl_NewStringObj(rMarkName, TCL_INDEX_NONE));
Tcl_ListObjAppendElement(NULL, markGravityLUndoMarkCmdObj,
Tcl_NewStringObj("left", 4));
Tcl_ListObjAppendElement(NULL, markGravityRUndoMarkCmdObj,
@@ -2954,7 +2954,7 @@ TextPushUndoAction(
int
TextUndoRedoCallback(
Tcl_Interp *interp, /* Current interpreter. */
- ClientData clientData, /* Passed from undo code, but contains our
+ void *clientData, /* Passed from undo code, but contains our
* shared text data structure. */
Tcl_Obj *objPtr) /* Arguments of a command to be handled by the
* shared text data structure. */
@@ -3009,7 +3009,7 @@ TextUndoRedoCallback(
* allow it to take place here.
*/
- cmdNameObj = Tcl_NewStringObj(Tk_PathName(textPtr->tkwin), -1);
+ cmdNameObj = Tcl_NewStringObj(Tk_PathName(textPtr->tkwin), TCL_INDEX_NONE);
Tcl_ListObjAppendElement(NULL, evalObj, cmdNameObj);
Tcl_ListObjAppendList(NULL, evalObj, objPtr);
res = Tcl_EvalObjEx(interp, evalObj, TCL_EVAL_GLOBAL);
@@ -3406,7 +3406,7 @@ DeleteIndexRange(
static Tcl_Size
TextFetchSelection(
- ClientData clientData, /* Information about text widget. */
+ void *clientData, /* Information about text widget. */
Tcl_Size offset, /* Offset within selection of first character
* to be returned. */
char *buffer, /* Location in which to place selection. */
@@ -3544,7 +3544,7 @@ TextFetchSelection(
void
TkTextLostSelection(
- ClientData clientData) /* Information about text widget. */
+ void *clientData) /* Information about text widget. */
{
TkText *textPtr = (TkText *)clientData;
@@ -3629,7 +3629,7 @@ TkTextSelectionEvent(
static void
TextBlinkProc(
- ClientData clientData) /* Pointer to record describing text. */
+ void *clientData) /* Pointer to record describing text. */
{
TkText *textPtr = (TkText *)clientData;
TkTextIndex index;
@@ -3863,7 +3863,7 @@ TextSearchCmd(
case TK_TEXT_SEARCH_COUNT:
if (i >= objc-1) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "no value given for \"-count\" option", -1));
+ "no value given for \"-count\" option", TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "TK", "TEXT", "VALUE", NULL);
return TCL_ERROR;
}
@@ -3917,7 +3917,7 @@ TextSearchCmd(
if (searchSpec.noLineStop && searchSpec.exact) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"the \"-nolinestop\" option requires the \"-regexp\" option"
- " to be present", -1));
+ " to be present", TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "TK", "TEXT", "SEARCH_USAGE", NULL);
return TCL_ERROR;
}
@@ -3925,7 +3925,7 @@ TextSearchCmd(
if (searchSpec.overlap && !searchSpec.all) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"the \"-overlap\" option requires the \"-all\" option"
- " to be present", -1));
+ " to be present", TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "TK", "TEXT", "SEARCH_USAGE", NULL);
return TCL_ERROR;
}
@@ -4252,7 +4252,7 @@ static int
TextSearchFoundMatch(
int lineNum, /* Line on which match was found. */
SearchSpec *searchSpecPtr, /* Search parameters. */
- ClientData clientData, /* Token returned by the 'addNextLineProc',
+ void *clientData, /* Token returned by the 'addNextLineProc',
* TextSearchAddNextLine. May be NULL, in
* which we case we must generate it (from
* lineNum). */
@@ -5588,7 +5588,7 @@ UpdateDirtyFlag(
void
TkTextRunAfterSyncCmd(
- ClientData clientData) /* Information about text widget. */
+ void *clientData) /* Information about text widget. */
{
TkText *textPtr = (TkText *)clientData;
int code;
@@ -5851,7 +5851,7 @@ SearchCore(
Tcl_IncrRefCount(theLine);
for (passes = 0; passes < 2; ) {
- ClientData lineInfo;
+ void *lineInfo;
int linesSearched = 1;
int extraLinesSearched = 0;
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index d7890df..c818691 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -570,7 +570,7 @@ static void DisplayDLine(TkText *textPtr, DLine *dlPtr,
DLine *prevPtr, Pixmap pixmap);
static void DisplayLineBackground(TkText *textPtr, DLine *dlPtr,
DLine *prevPtr, Pixmap pixmap);
-static void DisplayText(ClientData clientData);
+static void DisplayText(void *clientData);
static DLine * FindDLine(TkText *textPtr, DLine *dlPtr,
const TkTextIndex *indexPtr);
static void FreeDLines(TkText *textPtr, DLine *firstPtr,
@@ -617,9 +617,9 @@ static int TextGetScrollInfoObj(Tcl_Interp *interp,
TkText *textPtr, int objc,
Tcl_Obj *const objv[], double *dblPtr,
int *intPtr);
-static void AsyncUpdateLineMetrics(ClientData clientData);
+static void AsyncUpdateLineMetrics(void *clientData);
static void GenerateWidgetViewSyncEvent(TkText *textPtr, Bool InSync);
-static void AsyncUpdateYScrollbar(ClientData clientData);
+static void AsyncUpdateYScrollbar(void *clientData);
static int IsStartOfNotMergedLine(TkText *textPtr,
const TkTextIndex *indexPtr);
@@ -3013,7 +3013,7 @@ DisplayLineBackground(
static void
AsyncUpdateLineMetrics(
- ClientData clientData) /* Information about widget. */
+ void *clientData) /* Information about widget. */
{
TkText *textPtr = (TkText *)clientData;
TextDInfo *dInfoPtr = textPtr->dInfoPtr;
@@ -4171,7 +4171,7 @@ TkTextUpdateOneLine(
static void
DisplayText(
- ClientData clientData) /* Information about widget. */
+ void *clientData) /* Information about widget. */
{
TkText *textPtr = (TkText *)clientData;
TextDInfo *dInfoPtr = textPtr->dInfoPtr;
@@ -6540,10 +6540,10 @@ GetXView(
Tcl_PrintDouble(NULL, first, buf1+1);
Tcl_PrintDouble(NULL, last, buf2+1);
Tcl_DStringInit(&buf);
- Tcl_DStringAppend(&buf, textPtr->xScrollCmd, -1);
- Tcl_DStringAppend(&buf, buf1, -1);
- Tcl_DStringAppend(&buf, buf2, -1);
- code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, TCL_EVAL_GLOBAL);
+ Tcl_DStringAppend(&buf, textPtr->xScrollCmd, TCL_INDEX_NONE);
+ Tcl_DStringAppend(&buf, buf1, TCL_INDEX_NONE);
+ Tcl_DStringAppend(&buf, buf2, TCL_INDEX_NONE);
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), TCL_INDEX_NONE, TCL_EVAL_GLOBAL);
Tcl_DStringFree(&buf);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
@@ -6825,10 +6825,10 @@ GetYView(
Tcl_PrintDouble(NULL, first, buf1+1);
Tcl_PrintDouble(NULL, last, buf2+1);
Tcl_DStringInit(&buf);
- Tcl_DStringAppend(&buf, textPtr->yScrollCmd, -1);
- Tcl_DStringAppend(&buf, buf1, -1);
- Tcl_DStringAppend(&buf, buf2, -1);
- code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, TCL_EVAL_GLOBAL);
+ Tcl_DStringAppend(&buf, textPtr->yScrollCmd, TCL_INDEX_NONE);
+ Tcl_DStringAppend(&buf, buf1, TCL_INDEX_NONE);
+ Tcl_DStringAppend(&buf, buf2, TCL_INDEX_NONE);
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), TCL_INDEX_NONE, TCL_EVAL_GLOBAL);
Tcl_DStringFree(&buf);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
@@ -6858,7 +6858,7 @@ GetYView(
static void
AsyncUpdateYScrollbar(
- ClientData clientData) /* Information about widget. */
+ void *clientData) /* Information about widget. */
{
TkText *textPtr = (TkText *)clientData;
diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c
index 760ac22..00f9c34 100644
--- a/generic/tkTextImage.c
+++ b/generic/tkTextImage.c
@@ -50,7 +50,7 @@ static int EmbImageLayoutProc(TkText *textPtr,
Tcl_Size offset, int maxX, Tcl_Size maxChars,
int noCharsYet, TkWrapMode wrapMode,
TkTextDispChunk *chunkPtr);
-static void EmbImageProc(ClientData clientData, int x, int y,
+static void EmbImageProc(void *clientData, int x, int y,
int width, int height, int imageWidth,
int imageHeight);
@@ -389,7 +389,7 @@ EmbImageConfigure(
if (name == NULL) {
Tcl_SetObjResult(textPtr->interp, Tcl_NewStringObj(
"Either a \"-name\" or a \"-image\" argument must be"
- " provided to the \"image create\" subcommand", -1));
+ " provided to the \"image create\" subcommand", TCL_INDEX_NONE));
Tcl_SetErrorCode(textPtr->interp, "TK", "TEXT", "IMAGE_CREATE_USAGE",
NULL);
return TCL_ERROR;
@@ -414,19 +414,19 @@ EmbImageConfigure(
}
Tcl_DStringInit(&newName);
- Tcl_DStringAppend(&newName, name, -1);
+ Tcl_DStringAppend(&newName, name, TCL_INDEX_NONE);
if (conflict) {
char buf[4 + TCL_INTEGER_SPACE];
snprintf(buf, sizeof(buf), "#%d", count+1);
- Tcl_DStringAppend(&newName, buf, -1);
+ Tcl_DStringAppend(&newName, buf, TCL_INDEX_NONE);
}
name = Tcl_DStringValue(&newName);
hPtr = Tcl_CreateHashEntry(&textPtr->sharedTextPtr->imageTable, name,
&dummy);
Tcl_SetHashValue(hPtr, eiPtr);
- Tcl_SetObjResult(textPtr->interp, Tcl_NewStringObj(name, -1));
+ Tcl_SetObjResult(textPtr->interp, Tcl_NewStringObj(name, TCL_INDEX_NONE));
eiPtr->body.ei.name = (char *)ckalloc(Tcl_DStringLength(&newName) + 1);
strcpy(eiPtr->body.ei.name, name);
Tcl_DStringFree(&newName);
@@ -837,7 +837,7 @@ TkTextImageIndex(
static void
EmbImageProc(
- ClientData clientData, /* Pointer to widget record. */
+ void *clientData, /* Pointer to widget record. */
TCL_UNUSED(int), /* Upper left pixel (within image) that must
* be redisplayed. */
TCL_UNUSED(int),
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c
index eb9baf5..2449a12 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -800,7 +800,7 @@ GetIndex(
*/
Tcl_DStringInit(&copy);
- p = strrchr(Tcl_DStringAppend(&copy, string, -1), '.');
+ p = strrchr(Tcl_DStringAppend(&copy, string, TCL_INDEX_NONE), '.');
if (p != NULL) {
TkTextSearch search;
TkTextTag *tagPtr;
diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c
index c302ca0..ca3cba0 100644
--- a/generic/tkTextMark.c
+++ b/generic/tkTextMark.c
@@ -157,7 +157,7 @@ TkTextMarkCmd(
} else {
typeStr = "left";
}
- Tcl_SetObjResult(interp, Tcl_NewStringObj(typeStr, -1));
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(typeStr, TCL_INDEX_NONE));
return TCL_OK;
}
str = Tcl_GetStringFromObj(objv[4],&length);
@@ -188,9 +188,9 @@ TkTextMarkCmd(
}
resultObj = Tcl_NewObj();
Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj(
- "insert", -1));
+ "insert", TCL_INDEX_NONE));
Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj(
- "current", -1));
+ "current", TCL_INDEX_NONE));
for (hPtr = Tcl_FirstHashEntry(&textPtr->sharedTextPtr->markTable,
&search); hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj(
diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c
index 10b6e1c..235fc52 100644
--- a/generic/tkTextTag.c
+++ b/generic/tkTextTag.c
@@ -280,7 +280,7 @@ TkTextTagCmd(
(void *) tagPtr->name, Tcl_GetString(objv[4]));
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"requested illegal events; only key, button, motion,"
- " enter, leave, and virtual events may be used", -1));
+ " enter, leave, and virtual events may be used", TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "TK", "TEXT", "TAG_BIND_EVENT",NULL);
return TCL_ERROR;
}
@@ -304,7 +304,7 @@ TkTextTagCmd(
}
Tcl_ResetResult(interp);
} else {
- Tcl_SetObjResult(interp, Tcl_NewStringObj(command, -1));
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(command, TCL_INDEX_NONE));
}
} else {
Tk_GetAllBindings(interp, textPtr->sharedTextPtr->bindingTable,
@@ -723,11 +723,11 @@ TkTextTagCmd(
resultObj = Tcl_NewObj();
TkTextPrintIndex(textPtr, &tSearch.curIndex, position);
Tcl_ListObjAppendElement(NULL, resultObj,
- Tcl_NewStringObj(position, -1));
+ Tcl_NewStringObj(position, TCL_INDEX_NONE));
TkBTreeNextTag(&tSearch);
TkTextPrintIndex(textPtr, &tSearch.curIndex, position);
Tcl_ListObjAppendElement(NULL, resultObj,
- Tcl_NewStringObj(position, -1));
+ Tcl_NewStringObj(position, TCL_INDEX_NONE));
Tcl_SetObjResult(interp, resultObj);
break;
}
@@ -838,9 +838,9 @@ TkTextTagCmd(
gotPrevIndexPair:
resultObj = Tcl_NewObj();
Tcl_ListObjAppendElement(NULL, resultObj,
- Tcl_NewStringObj(position1, -1));
+ Tcl_NewStringObj(position1, TCL_INDEX_NONE));
Tcl_ListObjAppendElement(NULL, resultObj,
- Tcl_NewStringObj(position2, -1));
+ Tcl_NewStringObj(position2, TCL_INDEX_NONE));
Tcl_SetObjResult(interp, resultObj);
break;
}
@@ -1405,7 +1405,7 @@ ChangeTagPriority(
void
TkTextBindProc(
- ClientData clientData, /* Pointer to text widget structure. */
+ void *clientData, /* Pointer to text widget structure. */
XEvent *eventPtr) /* Pointer to X event that just happened. */
{
TkText *textPtr = (TkText *)clientData;
@@ -1750,7 +1750,7 @@ TagBindEvent(
}
}
Tk_BindEvent(textPtr->sharedTextPtr->bindingTable, eventPtr,
- textPtr->tkwin, numTags, (ClientData *) nameArrPtr);
+ textPtr->tkwin, numTags, (void **) nameArrPtr);
if (numTags > NUM_BIND_TAGS) {
ckfree(nameArrPtr);
diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c
index e95ca34..391f836 100644
--- a/generic/tkTextWind.c
+++ b/generic/tkTextWind.c
@@ -20,9 +20,9 @@
* geometry manager:
*/
-static void EmbWinRequestProc(ClientData clientData,
+static void EmbWinRequestProc(void *clientData,
Tk_Window tkwin);
-static void EmbWinLostContentProc(ClientData clientData,
+static void EmbWinLostContentProc(void *clientData,
Tk_Window tkwin);
static const Tk_GeomMgr textGeomType = {
@@ -52,14 +52,14 @@ static void EmbWinBboxProc(TkText *textPtr,
int *widthPtr, int *heightPtr);
static int EmbWinConfigure(TkText *textPtr, TkTextSegment *ewPtr,
int objc, Tcl_Obj *const objv[]);
-static void EmbWinDelayedUnmap(ClientData clientData);
+static void EmbWinDelayedUnmap(void *clientData);
static int EmbWinDeleteProc(TkTextSegment *segPtr,
TkTextLine *linePtr, int treeGone);
static int EmbWinLayoutProc(TkText *textPtr,
TkTextIndex *indexPtr, TkTextSegment *segPtr,
Tcl_Size offset, int maxX, Tcl_Size maxChars,int noCharsYet,
TkWrapMode wrapMode, TkTextDispChunk *chunkPtr);
-static void EmbWinStructureProc(ClientData clientData,
+static void EmbWinStructureProc(void *clientData,
XEvent *eventPtr);
static void EmbWinUndisplayProc(TkText *textPtr,
TkTextDispChunk *chunkPtr);
@@ -521,7 +521,7 @@ EmbWinConfigure(
static void
EmbWinStructureProc(
- ClientData clientData, /* Pointer to record describing window item. */
+ void *clientData, /* Pointer to record describing window item. */
XEvent *eventPtr) /* Describes what just happened. */
{
TkTextEmbWindowClient *client = (TkTextEmbWindowClient *)clientData;
@@ -567,7 +567,7 @@ EmbWinStructureProc(
static void
EmbWinRequestProc(
- ClientData clientData, /* Pointer to record for window item. */
+ void *clientData, /* Pointer to record for window item. */
TCL_UNUSED(Tk_Window)) /* Window that changed its desired size. */
{
TkTextEmbWindowClient *client = (TkTextEmbWindowClient *)clientData;
@@ -611,7 +611,7 @@ EmbWinRequestProc(
static void
EmbWinLostContentProc(
- ClientData clientData, /* Pointer to record describing window item. */
+ void *clientData, /* Pointer to record describing window item. */
Tk_Window tkwin) /* Window that was claimed away by another
* geometry manager. */
{
@@ -908,10 +908,10 @@ EmbWinLayoutProc(
if (dsPtr != NULL) {
Tcl_DStringAppend(dsPtr, before, (int) (string-before));
- code = Tcl_EvalEx(textPtr->interp, Tcl_DStringValue(dsPtr), -1, TCL_EVAL_GLOBAL);
+ code = Tcl_EvalEx(textPtr->interp, Tcl_DStringValue(dsPtr), TCL_INDEX_NONE, TCL_EVAL_GLOBAL);
Tcl_DStringFree(dsPtr);
} else {
- code = Tcl_EvalEx(textPtr->interp, ewPtr->body.ew.create, -1, TCL_EVAL_GLOBAL);
+ code = Tcl_EvalEx(textPtr->interp, ewPtr->body.ew.create, TCL_INDEX_NONE, TCL_EVAL_GLOBAL);
}
if (code != TCL_OK) {
Tcl_BackgroundException(textPtr->interp, code);
@@ -1300,7 +1300,7 @@ EmbWinBboxProc(
static void
EmbWinDelayedUnmap(
- ClientData clientData) /* Token for the window to be unmapped. */
+ void *clientData) /* Token for the window to be unmapped. */
{
TkTextEmbWindowClient *client = (TkTextEmbWindowClient *)clientData;