summaryrefslogtreecommitdiffstats
path: root/generic/tkTextTag.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-04-27 22:38:54 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-04-27 22:38:54 (GMT)
commit4513cb9f431ea8c6b151913a016ec6c75bcac559 (patch)
tree681f7c2354a3726da3ab7da646d316c1275f540d /generic/tkTextTag.c
parent1876f5f7ee429456ad89540bcf659c092245bf1b (diff)
downloadtk-4513cb9f431ea8c6b151913a016ec6c75bcac559.zip
tk-4513cb9f431ea8c6b151913a016ec6c75bcac559.tar.gz
tk-4513cb9f431ea8c6b151913a016ec6c75bcac559.tar.bz2
Get rid of pre-C89-isms (esp. CONST vs const).
Diffstat (limited to 'generic/tkTextTag.c')
-rw-r--r--generic/tkTextTag.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c
index 97929bd..b54ae3f 100644
--- a/generic/tkTextTag.c
+++ b/generic/tkTextTag.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: tkTextTag.c,v 1.27 2007/12/13 15:24:17 dgp Exp $
+ * RCS: @(#) $Id: tkTextTag.c,v 1.28 2008/04/27 22:38:58 dkf Exp $
*/
#include "default.h"
@@ -101,7 +101,7 @@ static void ChangeTagPriority(TkText *textPtr, TkTextTag *tagPtr,
static TkTextTag * FindTag(Tcl_Interp *interp, TkText *textPtr,
Tcl_Obj *tagName);
static void SortTags(int numTags, TkTextTag **tagArrayPtr);
-static int TagSortProc(CONST VOID *first, CONST VOID *second);
+static int TagSortProc(const void *first, const void *second);
static void TagBindEvent(TkText *textPtr, XEvent *eventPtr,
int numTags, TkTextTag **tagArrayPtr);
@@ -128,11 +128,11 @@ TkTextTagCmd(
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 "tag". */
{
- static CONST char *tagOptionStrings[] = {
+ static const char *tagOptionStrings[] = {
"add", "bind", "cget", "configure", "delete", "lower", "names",
"nextrange", "prevrange", "raise", "ranges", "remove", NULL
};
@@ -225,7 +225,7 @@ TkTextTagCmd(
if (addTag && textPtr->exportSelection
&& !(textPtr->flags & GOT_SELECTION)) {
Tk_OwnSelection(textPtr->tkwin, XA_PRIMARY,
- TkTextLostSelection, (ClientData) textPtr);
+ TkTextLostSelection, textPtr);
textPtr->flags |= GOT_SELECTION;
}
textPtr->abortSelections = 1;
@@ -285,13 +285,13 @@ TkTextTagCmd(
return TCL_ERROR;
}
} else if (objc == 5) {
- CONST char *command;
+ const char *command;
command = Tk_GetBinding(interp,
textPtr->sharedTextPtr->bindingTable,
(ClientData) tagPtr->name, Tcl_GetString(objv[4]));
if (command == NULL) {
- CONST char *string = Tcl_GetStringResult(interp);
+ const char *string = Tcl_GetStringResult(interp);
/*
* Ignore missing binding errors. This is a special hack that
@@ -541,7 +541,7 @@ TkTextTagCmd(
continue;
}
- tagPtr = (TkTextTag *) Tcl_GetHashValue(hPtr);
+ tagPtr = Tcl_GetHashValue(hPtr);
if (tagPtr == textPtr->selTagPtr) {
continue;
}
@@ -607,7 +607,7 @@ TkTextTagCmd(
for (i=0, hPtr = Tcl_FirstHashEntry(
&textPtr->sharedTextPtr->tagTable, &search);
hPtr != NULL; i++, hPtr = Tcl_NextHashEntry(&search)) {
- arrayPtr[i] = (TkTextTag *) Tcl_GetHashValue(hPtr);
+ arrayPtr[i] = Tcl_GetHashValue(hPtr);
}
/*
@@ -928,14 +928,14 @@ TkTextTagCmd(
TkTextTag *
TkTextCreateTag(
TkText *textPtr, /* Widget in which tag is being used. */
- CONST char *tagName, /* Name of desired tag. */
+ const char *tagName, /* Name of desired tag. */
int *newTag) /* If non-NULL, then return 1 if new, or 0 if
* already exists. */
{
register TkTextTag *tagPtr;
Tcl_HashEntry *hPtr = NULL;
int isNew;
- CONST char *name;
+ const char *name;
if (!strcmp(tagName, "sel")) {
if (textPtr->selTagPtr != NULL) {
@@ -955,7 +955,7 @@ TkTextCreateTag(
*newTag = isNew;
}
if (!isNew) {
- return (TkTextTag *) Tcl_GetHashValue(hPtr);
+ return Tcl_GetHashValue(hPtr);
}
name = Tcl_GetHashKey(&textPtr->sharedTextPtr->tagTable, hPtr);
}
@@ -1048,7 +1048,7 @@ FindTag(
{
Tcl_HashEntry *hPtr;
int len;
- CONST char *str;
+ const char *str;
str = Tcl_GetStringFromObj(tagName, &len);
if (len == 3 && !strcmp(str,"sel")) {
@@ -1057,7 +1057,7 @@ FindTag(
hPtr = Tcl_FindHashEntry(&textPtr->sharedTextPtr->tagTable,
Tcl_GetString(tagName));
if (hPtr != NULL) {
- return (TkTextTag *) Tcl_GetHashValue(hPtr);
+ return Tcl_GetHashValue(hPtr);
}
if (interp != NULL) {
Tcl_AppendResult(interp, "tag \"", Tcl_GetString(tagName),
@@ -1279,8 +1279,8 @@ SortTags(
static int
TagSortProc(
- CONST void *first,
- CONST void *second) /* Elements to be compared. */
+ const void *first,
+ const void *second) /* Elements to be compared. */
{
TkTextTag *tagPtr1, *tagPtr2;
@@ -1349,7 +1349,7 @@ ChangeTagPriority(
}
for (hPtr = Tcl_FirstHashEntry(&textPtr->sharedTextPtr->tagTable, &search);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- tagPtr2 = (TkTextTag *) Tcl_GetHashValue(hPtr);
+ tagPtr2 = Tcl_GetHashValue(hPtr);
if ((tagPtr2->priority >= low) && (tagPtr2->priority <= high)) {
tagPtr2->priority += delta;
}
@@ -1380,7 +1380,7 @@ TkTextBindProc(
ClientData clientData, /* Pointer to canvas structure. */
XEvent *eventPtr) /* Pointer to X event that just happened. */
{
- TkText *textPtr = (TkText *) clientData;
+ TkText *textPtr = clientData;
int repick = 0;
# define AnyButtonMask \
@@ -1687,8 +1687,8 @@ TagBindEvent(
TkTextTag **tagArrayPtr) /* Array of relevant tags. */
{
#define NUM_BIND_TAGS 10
- CONST char *nameArray[NUM_BIND_TAGS];
- CONST char **nameArrPtr;
+ const char *nameArray[NUM_BIND_TAGS];
+ const char **nameArrPtr;
int i;
/*
@@ -1696,7 +1696,7 @@ TagBindEvent(
*/
if (numTags > NUM_BIND_TAGS) {
- nameArrPtr = (CONST char **) ckalloc(numTags * sizeof(CONST char *));
+ nameArrPtr = (const char **) ckalloc(numTags * sizeof(const char *));
} else {
nameArrPtr = nameArray;
}