summaryrefslogtreecommitdiffstats
path: root/win/tkWinCursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tkWinCursor.c')
-rw-r--r--win/tkWinCursor.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/win/tkWinCursor.c b/win/tkWinCursor.c
index dee3419..8366db3 100644
--- a/win/tkWinCursor.c
+++ b/win/tkWinCursor.c
@@ -40,7 +40,7 @@ typedef struct {
*/
static struct CursorName {
- char *name;
+ const char *name;
LPCTSTR id;
} cursorNames[] = {
{"starting", IDC_APPSTARTING},
@@ -73,7 +73,7 @@ static struct CursorName {
#define TK_DEFAULT_CURSOR IDC_ARROW
-
+
/*
*----------------------------------------------------------------------
*
@@ -100,7 +100,7 @@ TkGetCursorByName(
struct CursorName *namePtr;
TkWinCursor *cursorPtr;
int argc;
- CONST char **argv = NULL;
+ const char **argv = NULL;
/*
* All cursor names are valid lists of one element (for
@@ -114,7 +114,7 @@ TkGetCursorByName(
goto badCursorSpec;
}
- cursorPtr = (TkWinCursor *) ckalloc(sizeof(TkWinCursor));
+ cursorPtr = ckalloc(sizeof(TkWinCursor));
cursorPtr->info.cursor = (Tk_Cursor) cursorPtr;
cursorPtr->winCursor = NULL;
cursorPtr->system = 0;
@@ -133,11 +133,11 @@ TkGetCursorByName(
if (Tcl_IsSafe(interp)) {
Tcl_AppendResult(interp, "can't get cursor from a file in",
" a safe interpreter", NULL);
- ckfree((char *) argv);
- ckfree((char *) cursorPtr);
+ ckfree(argv);
+ ckfree(cursorPtr);
return NULL;
}
- cursorPtr->winCursor = LoadCursorFromFile(&(argv[0][1]));
+ cursorPtr->winCursor = LoadCursorFromFileA(&(argv[0][1]));
} else {
/*
* Check for the cursor in the system cursor set.
@@ -156,24 +156,23 @@ TkGetCursorByName(
* one of our application resources.
*/
- cursorPtr->winCursor = LoadCursor(Tk_GetHINSTANCE(), argv[0]);
+ cursorPtr->winCursor = LoadCursorA(Tk_GetHINSTANCE(), argv[0]);
} else {
cursorPtr->system = 1;
}
}
if (cursorPtr->winCursor == NULL) {
- ckfree((char *) cursorPtr);
+ ckfree(cursorPtr);
badCursorSpec:
- ckfree((char *) argv);
+ ckfree(argv);
Tcl_AppendResult(interp, "bad cursor spec \"", string, "\"", NULL);
return NULL;
- } else {
- ckfree((char *) argv);
- return (TkCursor *) cursorPtr;
}
+ ckfree(argv);
+ return (TkCursor *) cursorPtr;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -193,8 +192,8 @@ TkGetCursorByName(
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. */
@@ -202,7 +201,7 @@ TkCreateCursorFromData(
{
return NULL;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -226,7 +225,7 @@ TkpFreeCursor(
{
/* TkWinCursor *winCursorPtr = (TkWinCursor *) cursorPtr; */
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -261,7 +260,7 @@ TkpSetCursor(
SetCursor(hcursor);
}
}
-
+
/*
* Local Variables:
* mode: c