summaryrefslogtreecommitdiffstats
path: root/generic/tkMain.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkMain.c')
-rw-r--r--generic/tkMain.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/generic/tkMain.c b/generic/tkMain.c
index 9f6a73c..396c93f 100644
--- a/generic/tkMain.c
+++ b/generic/tkMain.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMain.c,v 1.29 2008/04/01 16:30:54 dgp Exp $
+ * RCS: @(#) $Id: tkMain.c,v 1.30 2008/04/27 22:38:56 dkf Exp $
*/
#include <ctype.h>
@@ -56,7 +56,7 @@ static Tcl_ThreadDataKey dataKey;
#if !defined(__WIN32__) && !defined(_WIN32)
extern int isatty(int fd);
-extern char * strrchr(CONST char *string, int c);
+extern char * strrchr(const char *string, int c);
#endif
/*
@@ -96,7 +96,7 @@ Tk_MainEx(
Tcl_Interp *interp)
{
Tcl_Obj *path, *argvPtr;
- CONST char *encodingName;
+ const char *encodingName;
int code, nullStdin = 0;
Tcl_Channel inChannel, outChannel;
ThreadSpecificData *tsdPtr;
@@ -114,12 +114,11 @@ Tk_MainEx(
abort();
}
- tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_FindExecutable(argv[0]);
tsdPtr->interp = interp;
- Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve(interp);
#if defined(__WIN32__)
Tk_InitConsoleChannels(interp);
@@ -176,7 +175,7 @@ Tk_MainEx(
Tcl_ExternalToUtfDString(NULL, argv[0], -1, &appName);
} else {
int numBytes;
- CONST char *pathName = Tcl_GetStringFromObj(path, &numBytes);
+ const char *pathName = Tcl_GetStringFromObj(path, &numBytes);
Tcl_ExternalToUtfDString(NULL, pathName, numBytes, &appName);
path = Tcl_NewStringObj(Tcl_DStringValue(&appName), -1);
@@ -298,7 +297,7 @@ Tk_MainEx(
inChannel = Tcl_GetStdChannel(TCL_STDIN);
if (inChannel) {
Tcl_CreateChannelHandler(inChannel, TCL_READABLE, StdinProc,
- (ClientData) inChannel);
+ inChannel);
}
if (tsdPtr->tty) {
Prompt(interp, 0);
@@ -320,7 +319,7 @@ Tk_MainEx(
Tk_MainLoop();
Tcl_DeleteInterp(interp);
- Tcl_Release((ClientData) interp);
+ Tcl_Release(interp);
Tcl_SetStartupScript(NULL, NULL);
Tcl_Exit(0);
}
@@ -353,8 +352,8 @@ StdinProc(
static int gotPartial = 0;
char *cmd;
int code, count;
- Tcl_Channel chan = (Tcl_Channel) clientData;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_Channel chan = clientData;
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_Interp *interp = tsdPtr->interp;
@@ -364,13 +363,12 @@ StdinProc(
if (tsdPtr->tty) {
Tcl_Exit(0);
} else {
- Tcl_DeleteChannelHandler(chan, StdinProc, (ClientData) chan);
+ Tcl_DeleteChannelHandler(chan, StdinProc, chan);
}
return;
}
- (void) Tcl_DStringAppend(&tsdPtr->command, Tcl_DStringValue(
- &tsdPtr->line), -1);
+ Tcl_DStringAppend(&tsdPtr->command, Tcl_DStringValue(&tsdPtr->line), -1);
cmd = Tcl_DStringAppend(&tsdPtr->command, "\n", -1);
Tcl_DStringFree(&tsdPtr->line);
if (!Tcl_CommandComplete(cmd)) {
@@ -386,13 +384,12 @@ StdinProc(
* things, this will trash the text of the command being evaluated.
*/
- Tcl_CreateChannelHandler(chan, 0, StdinProc, (ClientData) chan);
+ Tcl_CreateChannelHandler(chan, 0, StdinProc, chan);
code = Tcl_RecordAndEval(interp, cmd, TCL_EVAL_GLOBAL);
chan = Tcl_GetStdChannel(TCL_STDIN);
if (chan) {
- Tcl_CreateChannelHandler(chan, TCL_READABLE, StdinProc,
- (ClientData) chan);
+ Tcl_CreateChannelHandler(chan, TCL_READABLE, StdinProc, chan);
}
Tcl_DStringFree(&tsdPtr->command);
if (Tcl_GetStringResult(interp)[0] != '\0') {