summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixCursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tkUnixCursor.c')
-rw-r--r--unix/tkUnixCursor.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/unix/tkUnixCursor.c b/unix/tkUnixCursor.c
index 1ab238e..bbf5206 100644
--- a/unix/tkUnixCursor.c
+++ b/unix/tkUnixCursor.c
@@ -28,8 +28,8 @@ typedef struct {
* the official cursor font:
*/
-static struct CursorName {
- CONST char *name;
+static const struct CursorName {
+ const char *name;
unsigned int shape;
} cursorNames[] = {
{"X_cursor", XC_X_cursor},
@@ -159,9 +159,9 @@ static struct CursorName {
#endif /* DEFINE_MYARROW_CURSOR */
-static struct TkCursorName {
- char *name;
- char *data;
+static const struct TkCursorName {
+ const char *name;
+ const char *data;
char *mask;
} tkCursorNames[] = {
{"none", CURSOR_NONE_DATA, NULL},
@@ -180,9 +180,9 @@ static struct TkCursorName {
#endif
static Cursor CreateCursorFromTableOrFile(Tcl_Interp *interp,
- Tk_Window tkwin, int argc, CONST char **argv,
- struct TkCursorName *tkCursorPtr);
-
+ Tk_Window tkwin, int argc, const char **argv,
+ const struct TkCursorName *tkCursorPtr);
+
/*
*----------------------------------------------------------------------
*
@@ -211,10 +211,10 @@ TkGetCursorByName(
TkUnixCursor *cursorPtr = NULL;
Cursor cursor = None;
int argc;
- CONST char **argv = NULL;
+ const char **argv = NULL;
Display *display = Tk_Display(tkwin);
int inTkTable = 0;
- struct TkCursorName* tkCursorPtr = NULL;
+ const struct TkCursorName *tkCursorPtr = NULL;
if (Tcl_SplitList(interp, string, &argc, &argv) != TCL_OK) {
return NULL;
@@ -245,7 +245,7 @@ TkGetCursorByName(
if ((argv[0][0] != '@') && !inTkTable) {
XColor fg, bg;
unsigned int maskIndex;
- register struct CursorName *namePtr;
+ register const struct CursorName *namePtr;
TkDisplay *dispPtr;
/*
@@ -332,20 +332,20 @@ TkGetCursorByName(
}
if (cursor != None) {
- cursorPtr = (TkUnixCursor *) ckalloc(sizeof(TkUnixCursor));
+ cursorPtr = ckalloc(sizeof(TkUnixCursor));
cursorPtr->info.cursor = (Tk_Cursor) cursor;
cursorPtr->display = display;
}
cleanup:
if (argv != NULL) {
- ckfree((char *) argv);
+ ckfree(argv);
}
return (TkCursor *) cursorPtr;
badString:
if (argv) {
- ckfree((char *) argv);
+ ckfree(argv);
}
Tcl_AppendResult(interp, "bad cursor spec \"", string, "\"", NULL);
return NULL;
@@ -375,8 +375,8 @@ CreateCursorFromTableOrFile(
Tcl_Interp *interp, /* Interpreter to use for error reporting. */
Tk_Window tkwin, /* Window in which cursor will be used. */
int argc,
- CONST char **argv, /* Cursor spec parsed into elements. */
- struct TkCursorName *tkCursorPtr)
+ const char **argv, /* Cursor spec parsed into elements. */
+ const struct TkCursorName *tkCursorPtr)
/* Non-NULL when cursor is defined in Tk
* table. */
{
@@ -386,8 +386,8 @@ CreateCursorFromTableOrFile(
int xHot = -1, yHot = -1;
int dummy1, dummy2;
XColor fg, bg;
- CONST char *fgColor;
- CONST char *bgColor;
+ const char *fgColor;
+ const char *bgColor;
int inTkTable = (tkCursorPtr != NULL);
Display *display = Tk_Display(tkwin);
@@ -428,7 +428,7 @@ CreateCursorFromTableOrFile(
ckfree(data);
} else {
if (TkReadBitmapFile(display, drawable, &argv[0][1],
- (unsigned int *) &width, (unsigned int *) &height,
+ (unsigned *) &width, (unsigned *) &height,
&source, &xHot, &yHot) != BitmapSuccess) {
Tcl_AppendResult(interp, "cleanup reading bitmap file \"",
&argv[0][1], "\"", NULL);
@@ -548,7 +548,7 @@ CreateCursorFromTableOrFile(
}
return cursor;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -568,8 +568,8 @@ CreateCursorFromTableOrFile(
TkCursor *
TkCreateCursorFromData(
Tk_Window tkwin, /* Window in which cursor will be used. */
- CONST char *source, /* Bitmap data for cursor shape. */
- CONST char *mask, /* Bitmap data for cursor mask. */
+ const char *source, /* Bitmap data for cursor shape. */
+ 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. */
XColor fgColor, /* Foreground color for cursor. */
@@ -592,13 +592,13 @@ TkCreateCursorFromData(
Tk_FreePixmap(display, maskPixmap);
if (cursor != None) {
- cursorPtr = (TkUnixCursor *) ckalloc(sizeof(TkUnixCursor));
+ cursorPtr = ckalloc(sizeof(TkUnixCursor));
cursorPtr->info.cursor = (Tk_Cursor) cursor;
cursorPtr->display = display;
}
return (TkCursor *) cursorPtr;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -625,7 +625,7 @@ TkpFreeCursor(
XFreeCursor(unixCursorPtr->display, (Cursor) unixCursorPtr->info.cursor);
Tk_FreeXId(unixCursorPtr->display, (XID) unixCursorPtr->info.cursor);
}
-
+
/*
* Local Variables:
* mode: c