summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-09-02 13:51:00 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-09-02 13:51:00 (GMT)
commitcf61ac364550b41e29306428d3423420b743943c (patch)
treea73a4283a1c95a171c6f7885c32b3c0cc314b422
parent13d9114a51d1c63fb18d21d2abe4cade17b13612 (diff)
parent3d16dc9d8da782d7095e058e2415e47ac96a1ac9 (diff)
downloadtk-cf61ac364550b41e29306428d3423420b743943c.zip
tk-cf61ac364550b41e29306428d3423420b743943c.tar.gz
tk-cf61ac364550b41e29306428d3423420b743943c.tar.bz2
Undo experiment. Merge 9.0
-rw-r--r--doc/3DBorder.32
-rw-r--r--doc/GetColor.32
-rw-r--r--doc/GetCursor.38
-rw-r--r--doc/GetRelief.34
-rw-r--r--generic/tk.decls8
-rw-r--r--generic/tk3d.c23
-rw-r--r--generic/tkCmds.c4
-rw-r--r--generic/tkColor.c21
-rw-r--r--generic/tkCursor.c10
-rw-r--r--generic/tkDecls.h17
-rw-r--r--generic/tkGrab.c10
-rw-r--r--generic/tkGrid.c64
-rw-r--r--generic/tkImgBmap.c12
-rw-r--r--generic/tkImgGIF.c24
-rw-r--r--generic/tkImgListFormat.c36
-rw-r--r--generic/tkImgPhoto.c4
-rw-r--r--generic/tkOldConfig.c8
-rw-r--r--generic/tkText.c2
-rw-r--r--macosx/tkMacOSXDefault.h2
-rw-r--r--macosx/tkMacOSXDialog.c2
-rw-r--r--unix/tkUnixDefault.h2
-rw-r--r--win/tkWinDefault.h2
-rw-r--r--win/tkWinDialog.c2
-rw-r--r--win/tkWinWm.c4
24 files changed, 120 insertions, 153 deletions
diff --git a/doc/3DBorder.3 b/doc/3DBorder.3
index 0233f94..dbe88e2 100644
--- a/doc/3DBorder.3
+++ b/doc/3DBorder.3
@@ -67,7 +67,7 @@ must be the window for which the border was allocated).
Pointer to value whose value describes color corresponding to
background (flat areas). Illuminated edges will be brighter than
this and shadowed edges will be darker than this.
-.AP char *colorName in
+.AP "const char" *colorName in
Same as \fIobjPtr\fR except value is supplied as a string rather
than a value.
.AP Drawable drawable in
diff --git a/doc/GetColor.3 b/doc/GetColor.3
index bfb7ac0..4dce903 100644
--- a/doc/GetColor.3
+++ b/doc/GetColor.3
@@ -45,7 +45,7 @@ Token for window in which color will be used.
.AP Tcl_Obj *objPtr in/out
String value describes desired color; internal rep will be
modified to cache pointer to corresponding (XColor *).
-.AP char *name in
+.AP "const char" *name in
Same as \fIobjPtr\fR except description of color is passed as a string and
resulting (XColor *) is not cached.
.AP XColor *prefPtr in
diff --git a/doc/GetCursor.3 b/doc/GetCursor.3
index 6f8e34f..6bfad3f 100644
--- a/doc/GetCursor.3
+++ b/doc/GetCursor.3
@@ -42,7 +42,7 @@ Token for window in which the cursor will be used.
.AP Tcl_Obj *objPtr in/out
Description of cursor; see below for possible values. Internal rep will be
modified to cache pointer to corresponding Tk_Cursor.
-.AP char *name in
+.AP "const char" *name in
Same as \fIobjPtr\fR except description of cursor is passed as a string and
resulting Tk_Cursor is not cached.
.AP "const char" *source in
@@ -57,9 +57,9 @@ Height of \fIsource\fR and \fImask\fR.
X-location of cursor hot-spot.
.AP "int" yHot in
Y-location of cursor hot-spot.
-.AP Tk_Uid fg in
+.AP "const char" *fg in
Textual description of foreground color for cursor.
-.AP Tk_Uid bg in
+.AP "const char" *bg in
Textual description of background color for cursor.
.AP Display *display in
Display for which \fIcursor\fR was allocated.
@@ -174,7 +174,7 @@ Tk_Cursor cursor;
#include "mask.cursor"
cursor = Tk_GetCursorFromData(interp, tkwin, source_bits,
mask_bits, source_width, source_height, source_x_hot,
- source_y_hot, Tk_GetUid("red"), Tk_GetUid("blue"));
+ source_y_hot, "red", "blue");
.CE
.PP
Under normal conditions \fBTk_GetCursorFromData\fR
diff --git a/doc/GetRelief.3 b/doc/GetRelief.3
index 528e1ba..d9ecb13 100644
--- a/doc/GetRelief.3
+++ b/doc/GetRelief.3
@@ -38,14 +38,12 @@ or
.QW \fBsunken\fR
(or any unique abbreviation thereof on input);
the internal rep will be modified to cache corresponding relief value.
-.AP char *string in
+.AP "const char" *name in
Same as \fIobjPtr\fR except description of relief is passed as
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 \fBTK_RELIEF_FLAT\fR, \fBTK_RELIEF_RAISED\fR,
\fBTK_RELIEF_SUNKEN\fR, \fBTK_RELIEF_GROOVE\fR, \fBTK_RELIEF_SOLID\fR,
diff --git a/generic/tk.decls b/generic/tk.decls
index d1b5ffb..c776715 100644
--- a/generic/tk.decls
+++ b/generic/tk.decls
@@ -334,7 +334,7 @@ declare 79 {
}
declare 80 {
Tk_3DBorder Tk_Get3DBorder(Tcl_Interp *interp, Tk_Window tkwin,
- Tk_Uid colorName)
+ const char *colorName)
}
declare 81 {
void Tk_GetAllBindings(Tcl_Interp *interp,
@@ -363,7 +363,7 @@ declare 87 {
int Tk_GetCapStyle(Tcl_Interp *interp, const char *str, int *capPtr)
}
declare 88 {
- XColor *Tk_GetColor(Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid name)
+ XColor *Tk_GetColor(Tcl_Interp *interp, Tk_Window tkwin, const char *name)
}
declare 89 {
XColor *Tk_GetColorByValue(Tk_Window tkwin, XColor *colorPtr)
@@ -374,13 +374,13 @@ declare 90 {
}
declare 91 {
Tk_Cursor Tk_GetCursor(Tcl_Interp *interp, Tk_Window tkwin,
- Tk_Uid str)
+ const char *str)
}
declare 92 {
Tk_Cursor Tk_GetCursorFromData(Tcl_Interp *interp,
Tk_Window tkwin, const char *source, const char *mask,
int width, int height, int xHot, int yHot,
- Tk_Uid fg, Tk_Uid bg)
+ const char *fg, const char *bg)
}
declare 93 {
Tk_Font Tk_GetFont(Tcl_Interp *interp,
diff --git a/generic/tk3d.c b/generic/tk3d.c
index 32717fb..66c8575 100644
--- a/generic/tk3d.c
+++ b/generic/tk3d.c
@@ -179,12 +179,12 @@ Tk_Alloc3DBorderFromObj(
*--------------------------------------------------------------
*/
-static Tk_3DBorder
-Tk_Get3DBorder_(
+Tk_3DBorder
+Tk_Get3DBorder(
Tcl_Interp *interp, /* Place to store an error message. */
Tk_Window tkwin, /* Token for window in which border will be
* drawn. */
- Tk_Uid colorName) /* String giving name of color for window
+ const char *colorName) /* String giving name of color for window
* background. */
{
Tcl_HashEntry *hashPtr;
@@ -254,23 +254,6 @@ Tk_Get3DBorder_(
borderPtr->bgGC = Tk_GetGC(tkwin, GCForeground, &gcValues);
return (Tk_3DBorder) borderPtr;
}
-
-Tk_3DBorder
-Tk_Get3DBorder(
- Tcl_Interp *interp, /* Place to store an error message. */
- Tk_Window tkwin, /* Token for window in which border will be
- * drawn. */
- Tk_Uid colorName) /* String giving name of color for window
- * background. */
-{
- Tk_3DBorder x;
- Tcl_Obj *obj = Tcl_NewStringObj(colorName, -1);
-
- x = Tk_Get3DBorder_(interp, tkwin, Tcl_GetString(obj));
- Tcl_DecrRefCount(obj);
- return x;
-
-}
/*
*--------------------------------------------------------------
diff --git a/generic/tkCmds.c b/generic/tkCmds.c
index 81c459d..d9de4c2 100644
--- a/generic/tkCmds.c
+++ b/generic/tkCmds.c
@@ -1776,11 +1776,11 @@ Tk_WinfoObjCmd(
{
Colormap temp = Tk_Colormap(tkwin);
Tk_Colormap(tkwin) = TK_DYNAMIC_COLORMAP;
- colorPtr = Tk_GetColor(interp, tkwin, Tcl_GetString(objv[3]));
+ colorPtr = Tk_AllocColorFromObj(interp, tkwin, objv[3]);
Tk_Colormap(tkwin) = temp;
}
#else
- colorPtr = Tk_GetColor(interp, tkwin, Tcl_GetString(objv[3]));
+ colorPtr = Tk_AllocColorFromObj(interp, tkwin, objv[3]);
#endif
if (colorPtr == NULL) {
return TCL_ERROR;
diff --git a/generic/tkColor.c b/generic/tkColor.c
index 1793b85..9dc63b4 100644
--- a/generic/tkColor.c
+++ b/generic/tkColor.c
@@ -185,12 +185,12 @@ Tk_AllocColorFromObj(
*----------------------------------------------------------------------
*/
-static XColor *
-Tk_GetColor_(
+XColor *
+Tk_GetColor(
Tcl_Interp *interp, /* Place to leave error message if color can't
* be found. */
Tk_Window tkwin, /* Window in which color will be used. */
- Tk_Uid name) /* Name of color to be allocated (in form
+ const char *name) /* Name of color to be allocated (in form
* suitable for passing to XParseColor). */
{
Tcl_HashEntry *nameHashPtr;
@@ -265,21 +265,6 @@ Tk_GetColor_(
return &tkColPtr->color;
}
-XColor *
-Tk_GetColor(
- Tcl_Interp *interp, /* Place to leave error message if color can't
- * be found. */
- Tk_Window tkwin, /* Window in which color will be used. */
- Tk_Uid name) /* Name of color to be allocated (in form
- * suitable for passing to XParseColor). */
-{
- XColor *x;
- Tcl_Obj *obj = Tcl_NewStringObj(name, -1);
-
- x = Tk_GetColor_(interp, tkwin, Tcl_GetString(obj));
- Tcl_DecrRefCount(obj);
- return x;
-}
/*
*----------------------------------------------------------------------
*
diff --git a/generic/tkCursor.c b/generic/tkCursor.c
index 1bed0c4..f2d3af0 100644
--- a/generic/tkCursor.c
+++ b/generic/tkCursor.c
@@ -190,7 +190,7 @@ Tk_Cursor
Tk_GetCursor(
Tcl_Interp *interp, /* Interpreter to use for error reporting. */
Tk_Window tkwin, /* Window in which cursor will be used. */
- Tk_Uid string) /* Description of cursor. See manual entry for
+ const char *string) /* Description of cursor. See manual entry for
* details on legal syntax. */
{
TkCursor *cursorPtr = TkcGetCursor(interp, tkwin, string);
@@ -321,8 +321,8 @@ Tk_GetCursorFromData(
const char *mask, /* Bitmap data for cursor mask. */
int width, int height, /* Dimensions of cursor. */
int xHot, int yHot, /* Location of hot-spot in cursor. */
- Tk_Uid fg, /* Foreground color for cursor. */
- Tk_Uid bg) /* Background color for cursor. */
+ const char *fg, /* Foreground color for cursor. */
+ const char *bg) /* Background color for cursor. */
{
DataKey dataKey;
Tcl_HashEntry *dataHashPtr;
@@ -341,8 +341,8 @@ Tk_GetCursorFromData(
dataKey.height = height;
dataKey.xHot = xHot;
dataKey.yHot = yHot;
- dataKey.fg = fg;
- dataKey.bg = bg;
+ dataKey.fg = Tk_GetUid(fg);
+ dataKey.bg = Tk_GetUid(bg);
dataKey.display = Tk_Display(tkwin);
dataHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorDataTable,
(char *) &dataKey, &isNew);
diff --git a/generic/tkDecls.h b/generic/tkDecls.h
index 8695993..00ad267 100644
--- a/generic/tkDecls.h
+++ b/generic/tkDecls.h
@@ -296,7 +296,7 @@ EXTERN void Tk_GeometryRequest(Tk_Window tkwin, int reqWidth,
int reqHeight);
/* 80 */
EXTERN Tk_3DBorder Tk_Get3DBorder(Tcl_Interp *interp, Tk_Window tkwin,
- Tk_Uid colorName);
+ const char *colorName);
/* 81 */
EXTERN void Tk_GetAllBindings(Tcl_Interp *interp,
Tk_BindingTable bindingTable, void *object);
@@ -321,7 +321,7 @@ EXTERN int Tk_GetCapStyle(Tcl_Interp *interp, const char *str,
int *capPtr);
/* 88 */
EXTERN XColor * Tk_GetColor(Tcl_Interp *interp, Tk_Window tkwin,
- Tk_Uid name);
+ const char *name);
/* 89 */
EXTERN XColor * Tk_GetColorByValue(Tk_Window tkwin, XColor *colorPtr);
/* 90 */
@@ -329,12 +329,13 @@ EXTERN Colormap Tk_GetColormap(Tcl_Interp *interp, Tk_Window tkwin,
const char *str);
/* 91 */
EXTERN Tk_Cursor Tk_GetCursor(Tcl_Interp *interp, Tk_Window tkwin,
- Tk_Uid str);
+ const char *str);
/* 92 */
EXTERN Tk_Cursor Tk_GetCursorFromData(Tcl_Interp *interp,
Tk_Window tkwin, const char *source,
const char *mask, int width, int height,
- int xHot, int yHot, Tk_Uid fg, Tk_Uid bg);
+ int xHot, int yHot, const char *fg,
+ const char *bg);
/* 93 */
EXTERN Tk_Font Tk_GetFont(Tcl_Interp *interp, Tk_Window tkwin,
const char *str);
@@ -979,7 +980,7 @@ typedef struct TkStubs {
void (*reserved77)(void);
GC (*tk_GCForColor) (XColor *colorPtr, Drawable drawable); /* 78 */
void (*tk_GeometryRequest) (Tk_Window tkwin, int reqWidth, int reqHeight); /* 79 */
- Tk_3DBorder (*tk_Get3DBorder) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid colorName); /* 80 */
+ Tk_3DBorder (*tk_Get3DBorder) (Tcl_Interp *interp, Tk_Window tkwin, const char *colorName); /* 80 */
void (*tk_GetAllBindings) (Tcl_Interp *interp, Tk_BindingTable bindingTable, void *object); /* 81 */
int (*tk_GetAnchor) (Tcl_Interp *interp, const char *str, Tk_Anchor *anchorPtr); /* 82 */
const char * (*tk_GetAtomName) (Tk_Window tkwin, Atom atom); /* 83 */
@@ -987,11 +988,11 @@ typedef struct TkStubs {
Pixmap (*tk_GetBitmap) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 85 */
Pixmap (*tk_GetBitmapFromData) (Tcl_Interp *interp, Tk_Window tkwin, const void *source, int width, int height); /* 86 */
int (*tk_GetCapStyle) (Tcl_Interp *interp, const char *str, int *capPtr); /* 87 */
- XColor * (*tk_GetColor) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid name); /* 88 */
+ XColor * (*tk_GetColor) (Tcl_Interp *interp, Tk_Window tkwin, const char *name); /* 88 */
XColor * (*tk_GetColorByValue) (Tk_Window tkwin, XColor *colorPtr); /* 89 */
Colormap (*tk_GetColormap) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 90 */
- Tk_Cursor (*tk_GetCursor) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid str); /* 91 */
- Tk_Cursor (*tk_GetCursorFromData) (Tcl_Interp *interp, Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, Tk_Uid fg, Tk_Uid bg); /* 92 */
+ Tk_Cursor (*tk_GetCursor) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 91 */
+ Tk_Cursor (*tk_GetCursorFromData) (Tcl_Interp *interp, Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, const char *fg, const char *bg); /* 92 */
Tk_Font (*tk_GetFont) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 93 */
Tk_Font (*tk_GetFontFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 94 */
void (*tk_GetFontMetrics) (Tk_Font font, Tk_FontMetrics *fmPtr); /* 95 */
diff --git a/generic/tkGrab.c b/generic/tkGrab.c
index 5b7cbde..f131e83 100644
--- a/generic/tkGrab.c
+++ b/generic/tkGrab.c
@@ -524,24 +524,24 @@ Tk_Grab(
if (grabResult == GrabNotViewable) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"grab failed: window not viewable", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "GRAB", "UNVIEWABLE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRAB", "UNVIEWABLE", (char *)NULL);
} else if (grabResult == AlreadyGrabbed) {
alreadyGrabbed:
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"grab failed: another application has grab", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "GRAB", "GRABBED", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRAB", "GRABBED", (char *)NULL);
} else if (grabResult == GrabFrozen) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"grab failed: keyboard or pointer frozen", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "GRAB", "FROZEN", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRAB", "FROZEN", (char *)NULL);
} else if (grabResult == GrabInvalidTime) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"grab failed: invalid time", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "GRAB", "BAD_TIME", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRAB", "BAD_TIME", (char *)NULL);
} else {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"grab failed for unknown reason (code %d)", grabResult));
- Tcl_SetErrorCode(interp, "TK", "GRAB", "UNKNOWN", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRAB", "UNKNOWN", (char *)NULL);
}
return TCL_ERROR;
}
diff --git a/generic/tkGrid.c b/generic/tkGrid.c
index 078ae9e..c4ebef6 100644
--- a/generic/tkGrid.c
+++ b/generic/tkGrid.c
@@ -417,7 +417,7 @@ Tk_GridObjCmd(
/* This should not happen */
Tcl_SetObjResult(interp, Tcl_NewStringObj("internal error in grid", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "API_ABUSE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "API_ABUSE", (char *)NULL);
return TCL_ERROR;
}
@@ -1018,7 +1018,7 @@ GridRowColumnConfigureCommand(
if (lObjc == 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf("no %s indices specified",
(slotType == COLUMN) ? "column" : "row"));
- Tcl_SetErrorCode(interp, "TK", "GRID", "NO_INDEX", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "NO_INDEX", (char *)NULL);
Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
}
@@ -1031,7 +1031,7 @@ GridRowColumnConfigureCommand(
if (lObjc != 1) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"must specify a single element on retrieval", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "GRID", "USAGE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "USAGE", (char *)NULL);
Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
}
@@ -1039,7 +1039,7 @@ GridRowColumnConfigureCommand(
Tcl_AppendResult(interp,
" (when retrieving options only integer indices are "
"allowed)", NULL);
- Tcl_SetErrorCode(interp, "TK", "GRID", "INDEX_FORMAT", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "INDEX_FORMAT", (char *)NULL);
Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
}
@@ -1144,14 +1144,14 @@ GridRowColumnConfigureCommand(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"the window \"%s\" is not managed by \"%s\"",
Tcl_GetString(lObjv[j]), Tcl_GetString(objv[2])));
- Tcl_SetErrorCode(interp, "TK", "GRID", "NOT_MANAGED", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "NOT_MANAGED", (char *)NULL);
Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
}
} else {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"illegal index \"%s\"", Tcl_GetString(lObjv[j])));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "GRID_INDEX", NULL);
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "GRID_INDEX", (char *)NULL);
Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
}
@@ -1175,7 +1175,7 @@ GridRowColumnConfigureCommand(
"\"%s\" is out of range",
Tcl_GetString(lObjv[j])));
Tcl_SetErrorCode(interp, "TK", "GRID", "INDEX_RANGE",
- NULL);
+ (char *)NULL);
Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
}
@@ -1282,7 +1282,7 @@ GridRowColumnConfigureCommand(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"invalid arg \"%s\": should be non-negative",
Tcl_GetString(objv[i])));
- Tcl_SetErrorCode(interp, "TK", "GRID", "NEG_INDEX", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "NEG_INDEX", (char *)NULL);
return TCL_ERROR;
}
@@ -1388,7 +1388,7 @@ GridContentCommand(
if (value < 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"%d is an invalid value: should NOT be < 0", value));
- Tcl_SetErrorCode(interp, "TK", "GRID", "NEG_INDEX", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "NEG_INDEX", (char *)NULL);
return TCL_ERROR;
}
if (index == CONTENT_COLUMN) {
@@ -2553,8 +2553,8 @@ SetContentColumn(
lastCol = ((newColumn >= 0) ? newColumn : 0) + newNumCols;
if (lastCol >= MAX_ELEMENT) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj("column out of bounds",-1));
- Tcl_SetErrorCode(interp, "TK", "GRID", "BAD_COLUMN", NULL);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj("column out of bounds", TCL_INDEX_NONE));
+ Tcl_SetErrorCode(interp, "TK", "GRID", "BAD_COLUMN", (char *)NULL);
return TCL_ERROR;
}
@@ -2595,7 +2595,7 @@ SetContentRow(
lastRow = ((newRow >= 0) ? newRow : 0) + newNumRows;
if (lastRow >= MAX_ELEMENT) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("row out of bounds", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "GRID", "BAD_ROW", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "BAD_ROW", (char *)NULL);
return TCL_ERROR;
}
@@ -3034,7 +3034,7 @@ ConfigureContent(
if (length > 1 && i == 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad argument \"%s\": must be name of window", string));
- Tcl_SetErrorCode(interp, "TK", "GRID", "BAD_PARAMETER", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "BAD_PARAMETER", (char *)NULL);
return TCL_ERROR;
}
if (length > 1 && firstChar == '-') {
@@ -3044,7 +3044,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"unexpected parameter \"%s\" in configure list:"
" should be window name or option", string));
- Tcl_SetErrorCode(interp, "TK", "GRID", "BAD_PARAMETER", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "BAD_PARAMETER", (char *)NULL);
return TCL_ERROR;
}
@@ -3052,7 +3052,7 @@ ConfigureContent(
(prevChar == REL_SKIP) || (prevChar == REL_VERT))) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"must specify window before shortcut '-'", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "GRID", "SHORTCUT_USAGE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "SHORTCUT_USAGE", (char *)NULL);
return TCL_ERROR;
}
@@ -3064,7 +3064,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"invalid window shortcut, \"%s\" should be '-', 'x', or '^'",
string));
- Tcl_SetErrorCode(interp, "TK", "GRID", "SHORTCUT_USAGE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "SHORTCUT_USAGE", (char *)NULL);
return TCL_ERROR;
}
numWindows = i;
@@ -3072,7 +3072,7 @@ ConfigureContent(
if ((objc - numWindows) & 1) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"extra option or option with no value", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "GRID", "BAD_PARAMETER", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "BAD_PARAMETER", (char *)NULL);
return TCL_ERROR;
}
@@ -3101,7 +3101,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad row value \"%s\": must be a non-negative integer",
Tcl_GetString(objv[i+1])));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "POSITIVE_INT", NULL);
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "POSITIVE_INT", (char *)NULL);
return TCL_ERROR;
}
defaultRow = tmp;
@@ -3167,7 +3167,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't manage \"%s\": it's a top-level window",
Tcl_GetString(objv[j])));
- Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", (char *)NULL);
return TCL_ERROR;
}
contentPtr = GetGrid(content);
@@ -3197,7 +3197,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad column value \"%s\": must be a non-negative integer",
Tcl_GetString(objv[i+1])));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "COLUMN", NULL);
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "COLUMN", (char *)NULL);
return TCL_ERROR;
}
if (SetContentColumn(interp, contentPtr, tmp, -1) != TCL_OK) {
@@ -3210,7 +3210,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad columnspan value \"%s\": must be a positive integer",
Tcl_GetString(objv[i+1])));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "SPAN", NULL);
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "SPAN", (char *)NULL);
return TCL_ERROR;
}
if (SetContentColumn(interp, contentPtr, -1, tmp) != TCL_OK) {
@@ -3225,7 +3225,7 @@ ConfigureContent(
if (other == content) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"window can't be managed in itself", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", (char *)NULL);
return TCL_ERROR;
}
positionGiven = 1;
@@ -3240,7 +3240,7 @@ ConfigureContent(
"bad stickyness value \"%s\": must be"
" a string containing n, e, s, and/or w",
Tcl_GetString(objv[i+1])));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "STICKY", NULL);
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "STICKY", (char *)NULL);
return TCL_ERROR;
}
contentPtr->sticky = sticky;
@@ -3252,7 +3252,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad ipadx value \"%s\": must be positive screen distance",
Tcl_GetString(objv[i+1])));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", NULL);
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", (char *)NULL);
return TCL_ERROR;
}
contentPtr->iPadX = tmp * 2;
@@ -3263,7 +3263,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad ipady value \"%s\": must be positive screen distance",
Tcl_GetString(objv[i+1])));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", NULL);
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", (char *)NULL);
return TCL_ERROR;
}
contentPtr->iPadY = tmp * 2;
@@ -3286,7 +3286,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad row value \"%s\": must be a non-negative integer",
Tcl_GetString(objv[i+1])));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "COLUMN", NULL);
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "COLUMN", (char *)NULL);
return TCL_ERROR;
}
if (SetContentRow(interp, contentPtr, tmp, -1) != TCL_OK) {
@@ -3299,7 +3299,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad rowspan value \"%s\": must be a positive integer",
Tcl_GetString(objv[i+1])));
- Tcl_SetErrorCode(interp, "TK", "VALUE", "SPAN", NULL);
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "SPAN", (char *)NULL);
return TCL_ERROR;
}
if (SetContentRow(interp, contentPtr, -1, tmp) != TCL_OK) {
@@ -3370,7 +3370,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't put \"%s\" inside \"%s\"", Tcl_GetString(objv[j]),
Tk_PathName(containerPtr->tkwin)));
- Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL);
Unlink(contentPtr);
return TCL_ERROR;
}
@@ -3386,7 +3386,7 @@ ConfigureContent(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't put \"%s\" inside \"%s\": would cause management loop",
Tcl_GetString(objv[j]), Tk_PathName(containerPtr->tkwin)));
- Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", (char *)NULL);
Unlink(contentPtr);
return TCL_ERROR;
}
@@ -3470,7 +3470,7 @@ ConfigureContent(
if (containerPtr == NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't use '^', can't find container window", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "GRID", "SHORTCUT_USAGE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "SHORTCUT_USAGE", (char *)NULL);
return TCL_ERROR;
}
@@ -3524,7 +3524,7 @@ ConfigureContent(
if (!match) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't find content to extend with \"^\"", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "GRID", "SHORTCUT_USAGE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "SHORTCUT_USAGE", (char *)NULL);
return TCL_ERROR;
}
}
@@ -3532,7 +3532,7 @@ ConfigureContent(
if (containerPtr == NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't determine container window", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "GRID", "SHORTCUT_USAGE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "GRID", "SHORTCUT_USAGE", (char *)NULL);
return TCL_ERROR;
}
SetGridSize(containerPtr);
diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c
index ce45d06..7abc5d3 100644
--- a/generic/tkImgBmap.c
+++ b/generic/tkImgBmap.c
@@ -271,7 +271,7 @@ ImgBmapConfigureModel(
Tcl_SetObjResult(modelPtr->interp, Tcl_NewStringObj(
"cannot have a mask without a bitmap", TCL_INDEX_NONE));
Tcl_SetErrorCode(modelPtr->interp, "TK", "IMAGE", "BITMAP",
- "NO_BITMAP", NULL);
+ "NO_BITMAP", (char *)NULL);
return TCL_ERROR;
}
modelPtr->maskData = TkGetBitmapData(modelPtr->interp,
@@ -287,7 +287,7 @@ ImgBmapConfigureModel(
Tcl_SetObjResult(modelPtr->interp, Tcl_NewStringObj(
"bitmap and mask have different sizes", TCL_INDEX_NONE));
Tcl_SetErrorCode(modelPtr->interp, "TK", "IMAGE", "BITMAP",
- "MASK_SIZE", NULL);
+ "MASK_SIZE", (char *)NULL);
return TCL_ERROR;
}
}
@@ -488,7 +488,7 @@ TkGetBitmapData(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't get bitmap data from a file in a safe interpreter",
-1));
- Tcl_SetErrorCode(interp, "TK", "SAFE", "BITMAP_FILE", NULL);
+ Tcl_SetErrorCode(interp, "TK", "SAFE", "BITMAP_FILE", (char *)NULL);
return NULL;
}
expandedFileName = Tcl_TranslateFileName(NULL, fileName, &buffer);
@@ -593,7 +593,7 @@ TkGetBitmapData(
"format error in bitmap data; looks like it's an"
" obsolete X10 bitmap file", TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "BITMAP", "OBSOLETE",
- NULL);
+ (char *)NULL);
}
goto errorCleanup;
}
@@ -637,7 +637,7 @@ TkGetBitmapData(
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"format error in bitmap data", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "IMAGE", "BITMAP", "FORMAT", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "BITMAP", "FORMAT", (char *)NULL);
}
errorCleanup:
@@ -1210,7 +1210,7 @@ ImgBmapPostscript(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"unable to generate postscript for bitmaps larger than 60000"
" pixels", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "MEMLIMIT", NULL);
+ Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "MEMLIMIT", (char *)NULL);
return TCL_ERROR;
}
diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c
index 193c54f..a04196d 100644
--- a/generic/tkImgGIF.c
+++ b/generic/tkImgGIF.c
@@ -469,7 +469,7 @@ FileReadGIF(
"no value given for \"%s\" option",
Tcl_GetString(objv[i])));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "GIF", "OPT_VALUE",
- (char *) NULL);
+ (char *)NULL);
return TCL_ERROR;
}
if (Tcl_GetIntFromObj(interp, objv[++i], &index) != TCL_OK) {
@@ -485,14 +485,14 @@ FileReadGIF(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't read GIF header from file \"%s\"", fileName));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "GIF", "HEADER",
- (char *) NULL);
+ (char *)NULL);
return TCL_ERROR;
}
if ((fileWidth <= 0) || (fileHeight <= 0)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"GIF image file \"%s\" has dimension(s) <= 0", fileName));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "GIF", "BOGUS_SIZE",
- (char *) NULL);
+ (char *)NULL);
return TCL_ERROR;
}
@@ -507,7 +507,7 @@ FileReadGIF(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"GIF file truncated", -1));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "GIF", "TRUNCATED",
- (char *) NULL);
+ (char *)NULL);
return TCL_ERROR;
}
bitPixel = 2 << (buf[0] & 0x07);
@@ -517,7 +517,7 @@ FileReadGIF(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"error reading color map", TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "GIF", "COLOR_MAP",
- (char *) NULL);
+ (char *)NULL);
return TCL_ERROR;
}
}
@@ -563,7 +563,7 @@ FileReadGIF(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"no image data for this index", TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "GIF", "NO_DATA",
- (char *) NULL);
+ (char *)NULL);
goto error;
case GIF_EXTENSION:
@@ -581,7 +581,7 @@ FileReadGIF(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"error reading extension in GIF image", TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "GIF", "BAD_EXT",
- (char *) NULL);
+ (char *)NULL);
goto error;
}
continue;
@@ -591,7 +591,7 @@ FileReadGIF(
"couldn't read left/top/width/height in GIF image",
-1));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "GIF", "DIMENSIONS",
- (char *) NULL);
+ (char *)NULL);
goto error;
}
break;
@@ -622,7 +622,7 @@ FileReadGIF(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"error reading color map", TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "GIF",
- "COLOR_MAP", (char *) NULL);
+ "COLOR_MAP", (char *)NULL);
goto error;
}
}
@@ -685,7 +685,7 @@ FileReadGIF(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"error reading color map", TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "GIF", "COLOR_MAP",
- (char *) NULL);
+ (char *)NULL);
goto error;
}
}
@@ -1349,7 +1349,7 @@ ReadImage(
if (initialCodeSize > MAX_LWZ_BITS) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("malformed image", TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "GIF", "MALFORMED",
- (char *) NULL);
+ (char *)NULL);
return TCL_ERROR;
}
@@ -2047,7 +2047,7 @@ CommonWriteGIF(
if (state.num >= MAXCOLORMAPSIZE) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("too many colors", TCL_INDEX_NONE));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "GIF", "COLORFUL",
- (char *) NULL);
+ (char *)NULL);
return TCL_ERROR;
}
if (state.num<2) {
diff --git a/generic/tkImgListFormat.c b/generic/tkImgListFormat.c
index 9d2fbea..ab2e271 100644
--- a/generic/tkImgListFormat.c
+++ b/generic/tkImgListFormat.c
@@ -242,7 +242,7 @@ ParseFormatOptions(
if (!optionExists || !((1 << optIndex) & allowedOptions)) {
Tcl_SetObjResult(interp, GetBadOptMsg(Tcl_GetString(objv[index]),
allowedOptions));
- Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "BAD_OPTION", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "BAD_OPTION", (char *)NULL);
return TCL_ERROR;
}
@@ -257,7 +257,7 @@ ParseFormatOptions(
Tcl_SetObjResult(interp, Tcl_ObjPrintf("the \"%s\" option "
"requires a value", Tcl_GetString(objv[index - 1])));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
- "MISSING_VALUE", NULL);
+ "MISSING_VALUE", (char *)NULL);
return TCL_ERROR;
}
if (Tcl_GetIndexFromObj(NULL, objv[index], colorFormatNames, "",
@@ -269,7 +269,7 @@ ParseFormatOptions(
"\"%s\": must be rgb, rgba, or list",
Tcl_GetString(objv[index])));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
- "BAD_COLOR_FORMAT", NULL);
+ "BAD_COLOR_FORMAT", (char *)NULL);
return TCL_ERROR;
}
optPtr->colorFormat = (enum ColorFormatType)typeIndex;
@@ -401,7 +401,7 @@ StringMatchDef(
Tcl_SetObjResult(interp, Tcl_ObjPrintf("invalid row # %" TCL_SIZE_MODIFIER "d: "
"all rows must have the same number of elements", y));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
- "INVALID_DATA", NULL);
+ "INVALID_DATA", (char *)NULL);
}
return 0;
}
@@ -500,7 +500,7 @@ StringReadDef(
if (optIndex < objc) {
Tcl_SetObjResult(interp,
GetBadOptMsg(Tcl_GetString(objv[optIndex]), 0));
- Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "BAD_OPTION", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "BAD_OPTION", (char *)NULL);
return TCL_ERROR;
}
}
@@ -526,7 +526,7 @@ StringReadDef(
}
if (srcX < 0 || srcY < 0 || srcX >= rowCount || srcY >= colCount) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf("source coordinates out of range"));
- Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "COORDINATES", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "COORDINATES", (char *)NULL);
return TCL_ERROR;
}
@@ -539,7 +539,7 @@ StringReadDef(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"photo image dimensions exceed Tcl memory limits"));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
- "OVERFLOW", NULL);
+ "OVERFLOW", (char *)NULL);
return TCL_OK;
}
@@ -558,7 +558,7 @@ StringReadDef(
srcBlock.pixelPtr = (unsigned char *)attemptckalloc(srcBlock.pitch * srcBlock.height);
if (srcBlock.pixelPtr == NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(TK_PHOTO_ALLOC_FAILURE_MESSAGE));
- Tcl_SetErrorCode(interp, "TK", "MALLOC", NULL);
+ Tcl_SetErrorCode(interp, "TK", "MALLOC", (char *)NULL);
return TCL_ERROR;
}
curPixelPtr = srcBlock.pixelPtr;
@@ -647,7 +647,7 @@ StringWriteDef(
if (optIndex < objc) {
Tcl_SetObjResult(interp,
GetBadOptMsg(Tcl_GetString(objv[optIndex]), allowedOpts));
- Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "BAD_OPTION", NULL);
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "BAD_OPTION", (char *)NULL);
return TCL_ERROR;
}
@@ -794,7 +794,7 @@ ParseColor(
if (length > TK_PHOTO_MAX_COLOR_LENGTH) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf("invalid color"));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
- "INVALID_COLOR", NULL);
+ "INVALID_COLOR", (char *)NULL);
return TCL_ERROR;
}
if (specString[0] == '#') {
@@ -897,7 +897,7 @@ ParseColorAsList(
* ParseColorAsHex --
*
* This function extracts color and alpha values from a string
- * starting with '#', followed by hex digits. It undestands both
+ * starting with '#', followed by hex digits. It understands both
* the #RGBA form and the #RBG (with optional suffix)
*
* Results:
@@ -971,7 +971,7 @@ ParseColorAsHex(
*
* ParseColorAsStandard --
*
- * This function tries to split a color stirng in a color and a
+ * This function tries to split a color string in a color and a
* suffix part and to extract color and alpha values from them. The
* color part is treated as regular Tk color.
*
@@ -1024,7 +1024,7 @@ ParseColorAsStandard(
* Try to parse as standard Tk color.
*
* We don't use Tk_GetColor() et al. here, as those functions
- * migth return a color that does not exaxtly match the given name
+ * might return a color that does not exactly match the given name
* if the colormap is full. Also, we don't really want the color to be
* added to the colormap.
*/
@@ -1033,7 +1033,7 @@ ParseColorAsStandard(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"invalid color name \"%s\"", specString));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
- "INVALID_COLOR", NULL);
+ "INVALID_COLOR", (char *)NULL);
return TCL_ERROR;
}
@@ -1051,7 +1051,7 @@ ParseColorAsStandard(
"suffix \"%s\": expected floating-point value",
suffixString));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
- "INVALID COLOR", NULL);
+ "INVALID COLOR", (char *)NULL);
return TCL_ERROR;
}
if (fracAlpha < 0 || fracAlpha > 1) {
@@ -1059,7 +1059,7 @@ ParseColorAsStandard(
" \"%s\": value must be in the range from 0 to 1",
suffixString));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
- "INVALID_COLOR", NULL);
+ "INVALID_COLOR", (char *)NULL);
return TCL_ERROR;
}
suffixAlpha = (unsigned int) floor(fracAlpha * 255 + 0.5);
@@ -1069,7 +1069,7 @@ ParseColorAsStandard(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"invalid alpha suffix \"%s\"", suffixString));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
- "INVALID_COLOR", NULL);
+ "INVALID_COLOR", (char *)NULL);
return TCL_ERROR;
}
for (i = 1; i <= (int)strlen(suffixString + 1); i++) {
@@ -1078,7 +1078,7 @@ ParseColorAsStandard(
"invalid alpha suffix \"%s\": expected hex digit",
suffixString));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
- "INVALID_COLOR", NULL);
+ "INVALID_COLOR", (char *)NULL);
return TCL_ERROR;
}
}
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 5b46027..01eae00 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -1668,8 +1668,8 @@ ParseSubcommandOptions(
goto oneValueRequired;
}
*optIndexPtr = ++index;
- optPtr->background = Tk_GetColor(interp, Tk_MainWindow(interp),
- Tcl_GetString(objv[index]));
+ optPtr->background = Tk_AllocColorFromObj(interp, Tk_MainWindow(interp),
+ objv[index]);
if (!optPtr->background) {
return TCL_ERROR;
}
diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c
index d0f2d19..3df1af1 100644
--- a/generic/tkOldConfig.c
+++ b/generic/tkOldConfig.c
@@ -406,7 +406,7 @@ DoConfig(
if (nullValue) {
newPtr = NULL;
} else {
- newPtr = Tk_GetColor(interp, tkwin, value);
+ newPtr = Tk_AllocColorFromObj(interp, tkwin, arg);
if (newPtr == NULL) {
return TCL_ERROR;
}
@@ -457,7 +457,7 @@ DoConfig(
if (nullValue) {
newBorder = NULL;
} else {
- newBorder = Tk_Get3DBorder(interp, tkwin, value);
+ newBorder = Tk_Alloc3DBorderFromObj(interp, tkwin, arg);
if (newBorder == NULL) {
return TCL_ERROR;
}
@@ -481,7 +481,7 @@ DoConfig(
if (nullValue) {
newCursor = NULL;
} else {
- newCursor = Tk_GetCursor(interp, tkwin, value);
+ newCursor = Tk_AllocCursorFromObj(interp, tkwin, arg);
if (newCursor == NULL) {
return TCL_ERROR;
}
@@ -497,7 +497,7 @@ DoConfig(
break;
}
case TK_CONFIG_JUSTIFY:
- if (Tk_GetJustify(interp, value, (Tk_Justify *)ptr) != TCL_OK) {
+ if (Tk_GetJustifyFromObj(interp, arg, (Tk_Justify *)ptr) != TCL_OK) {
return TCL_ERROR;
}
break;
diff --git a/generic/tkText.c b/generic/tkText.c
index b3406a1..afb5532 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -153,7 +153,7 @@ static const Tk_OptionSpec optionSpecs[] = {
offsetof(TkText, highlightWidth), 0, 0, TK_TEXT_LINE_GEOMETRY},
{TK_OPTION_BORDER, "-inactiveselectbackground","inactiveSelectBackground",
"Foreground",
- DEF_TEXT_INACTIVE_SELECT_COLOR,
+ DEF_TEXT_INACTIVE_SELECT_BG_COLOR,
TCL_INDEX_NONE, offsetof(TkText, inactiveSelBorder),
TK_OPTION_NULL_OK, DEF_TEXT_SELECT_MONO, 0},
{TK_OPTION_BORDER, "-insertbackground", "insertBackground", "Foreground",
diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h
index 60430be..ca4db03 100644
--- a/macosx/tkMacOSXDefault.h
+++ b/macosx/tkMacOSXDefault.h
@@ -517,7 +517,7 @@
#define DEF_TEXT_PADX "1"
#define DEF_TEXT_PADY "1"
#define DEF_TEXT_RELIEF "flat"
-#define DEF_TEXT_INACTIVE_SELECT_COLOR INACTIVE_SELECT_BG
+#define DEF_TEXT_INACTIVE_SELECT_BG_COLOR INACTIVE_SELECT_BG
#define DEF_TEXT_SELECT_COLOR SELECT_BG
#define DEF_TEXT_SELECT_MONO BLACK
#define DEF_TEXT_SELECT_BD_COLOR "1"
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index 425919c..f2368ac 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -464,7 +464,7 @@ Tk_ChooseColorObjCmd(
case COLOR_INITIAL: {
XColor *colorPtr;
- colorPtr = Tk_GetColor(interp, tkwin, value);
+ colorPtr = Tk_AllocColorFromObj(interp, tkwin, objv[i + 1]);
if (colorPtr == NULL) {
goto end;
}
diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h
index 16fdcc6..eccd2c1 100644
--- a/unix/tkUnixDefault.h
+++ b/unix/tkUnixDefault.h
@@ -490,7 +490,7 @@
#define DEF_TEXT_PADX "1"
#define DEF_TEXT_PADY "1"
#define DEF_TEXT_RELIEF "sunken"
-#define DEF_TEXT_INACTIVE_SELECT_COLOR SELECT_BG
+#define DEF_TEXT_INACTIVE_SELECT_BG_COLOR SELECT_BG
#define DEF_TEXT_SELECT_COLOR SELECT_BG
#define DEF_TEXT_SELECT_MONO BLACK
#define DEF_TEXT_SELECT_BD_COLOR "0"
diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h
index 5af7877..9f546de 100644
--- a/win/tkWinDefault.h
+++ b/win/tkWinDefault.h
@@ -492,7 +492,7 @@
#define DEF_TEXT_PADX "1"
#define DEF_TEXT_PADY "1"
#define DEF_TEXT_RELIEF "sunken"
-#define DEF_TEXT_INACTIVE_SELECT_COLOR NULL
+#define DEF_TEXT_INACTIVE_SELECT_BG_COLOR NULL
#define DEF_TEXT_SELECT_COLOR SELECT_BG
#define DEF_TEXT_SELECT_MONO BLACK
#define DEF_TEXT_SELECT_BD_COLOR "0"
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 0b0494b..efd3a4b 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -760,7 +760,7 @@ Tk_ChooseColorObjCmd(
case COLOR_INITIAL: {
XColor *colorPtr;
- colorPtr = Tk_GetColor(interp, tkwin, string);
+ colorPtr = Tk_AllocColorFromObj(interp, tkwin, valuePtr);
if (colorPtr == NULL) {
return TCL_ERROR;
}
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 8aef4fa..c2d1683 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -3070,7 +3070,7 @@ WmAttributesCmd(
}
wmPtr->alpha = dval;
} else { /* -transparentcolor */
- const char *crefstr = Tcl_GetStringFromObj(objv[i+1], &length);
+ (void)Tcl_GetStringFromObj(objv[i+1], &length);
if (length == 0) {
/* reset to no transparent color */
@@ -3080,7 +3080,7 @@ WmAttributesCmd(
}
} else {
XColor *cPtr =
- Tk_GetColor(interp, tkwin, crefstr);
+ Tk_AllocColorFromObj(interp, tkwin, objv[i+1]);
if (cPtr == NULL) {
return TCL_ERROR;
}