summaryrefslogtreecommitdiffstats
path: root/generic/tkConsole.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkConsole.c')
-rw-r--r--generic/tkConsole.c68
1 files changed, 32 insertions, 36 deletions
diff --git a/generic/tkConsole.c b/generic/tkConsole.c
index 701ce77..095d132 100644
--- a/generic/tkConsole.c
+++ b/generic/tkConsole.c
@@ -67,7 +67,7 @@ static int InterpreterObjCmd(ClientData clientData, Tcl_Interp *interp,
static const Tcl_ChannelType consoleChannelType = {
"console", /* Type name. */
- TCL_CHANNEL_VERSION_5, /* v4 channel */
+ TCL_CHANNEL_VERSION_5, /* v5 channel */
ConsoleClose, /* Close proc. */
ConsoleInput, /* Input proc. */
ConsoleOutput, /* Output proc. */
@@ -228,7 +228,7 @@ Tk_InitConsoleChannels(
return;
}
- consoleInitPtr = Tcl_GetThreadData(&consoleInitKey, (int) sizeof(int));
+ consoleInitPtr = (int *)Tcl_GetThreadData(&consoleInitKey, (int) sizeof(int));
if (*consoleInitPtr) {
/*
* We've already initialized console channels in this thread.
@@ -256,13 +256,13 @@ Tk_InitConsoleChannels(
* interp for it to live in.
*/
- info = ckalloc(sizeof(ConsoleInfo));
+ info = (ConsoleInfo *) ckalloc(sizeof(ConsoleInfo));
info->consoleInterp = NULL;
info->interp = NULL;
info->refCount = 0;
if (doIn) {
- ChannelData *data = ckalloc(sizeof(ChannelData));
+ ChannelData *data = (ChannelData *)ckalloc(sizeof(ChannelData));
data->info = info;
data->info->refCount++;
@@ -279,7 +279,7 @@ Tk_InitConsoleChannels(
}
if (doOut) {
- ChannelData *data = ckalloc(sizeof(ChannelData));
+ ChannelData *data = (ChannelData *)ckalloc(sizeof(ChannelData));
data->info = info;
data->info->refCount++;
@@ -296,7 +296,7 @@ Tk_InitConsoleChannels(
}
if (doErr) {
- ChannelData *data = ckalloc(sizeof(ChannelData));
+ ChannelData *data = (ChannelData *)ckalloc(sizeof(ChannelData));
data->info = info;
data->info->refCount++;
@@ -378,7 +378,7 @@ Tk_CreateConsoleWindow(
* New ConsoleInfo for a new console window.
*/
- info = ckalloc(sizeof(ConsoleInfo));
+ info = (ConsoleInfo *)ckalloc(sizeof(ConsoleInfo));
info->refCount = 0;
/*
@@ -408,7 +408,7 @@ Tk_CreateConsoleWindow(
}
}
} else {
- info = ckalloc(sizeof(ConsoleInfo));
+ info = (ConsoleInfo *)ckalloc(sizeof(ConsoleInfo));
info->refCount = 0;
}
@@ -457,7 +457,7 @@ Tk_CreateConsoleWindow(
if (mainWindow) {
Tk_DeleteEventHandler(mainWindow, StructureNotifyMask,
ConsoleEventProc, info);
- if (--info->refCount <= 0) {
+ if (info->refCount-- <= 1) {
ckfree(info);
}
}
@@ -498,7 +498,7 @@ ConsoleOutput(
int toWrite, /* How many bytes to write? */
int *errorCode) /* Where to store error code. */
{
- ChannelData *data = instanceData;
+ ChannelData *data = (ChannelData *)instanceData;
ConsoleInfo *info = data->info;
*errorCode = 0;
@@ -559,14 +559,13 @@ ConsoleOutput(
*----------------------------------------------------------------------
*/
- /* ARGSUSED */
static int
ConsoleInput(
- ClientData instanceData, /* Unused. */
- char *buf, /* Where to store data read. */
- int bufSize, /* How much space is available in the
+ TCL_UNUSED(void *),
+ TCL_UNUSED(char *), /* Where to store data read. */
+ TCL_UNUSED(int), /* How much space is available in the
* buffer? */
- int *errorCode) /* Where to store error code. */
+ TCL_UNUSED(int *)) /* Where to store error code. */
{
return 0; /* Always return EOF. */
}
@@ -587,17 +586,16 @@ ConsoleInput(
*----------------------------------------------------------------------
*/
- /* ARGSUSED */
static int
ConsoleClose(
- ClientData instanceData, /* Unused. */
- Tcl_Interp *interp) /* Unused. */
+ ClientData instanceData,
+ TCL_UNUSED(Tcl_Interp *))
{
- ChannelData *data = instanceData;
+ ChannelData *data = (ChannelData *)instanceData;
ConsoleInfo *info = data->info;
if (info) {
- if (--info->refCount <= 0) {
+ if (info->refCount-- <= 1) {
/*
* Assuming the Tcl_Interp * fields must already be NULL.
*/
@@ -639,11 +637,10 @@ Console2Close(
*----------------------------------------------------------------------
*/
- /* ARGSUSED */
static void
ConsoleWatch(
- ClientData instanceData, /* Device ID for the channel. */
- int mask) /* OR-ed combination of TCL_READABLE,
+ TCL_UNUSED(void *), /* Device ID for the channel. */
+ TCL_UNUSED(int)) /* OR-ed combination of TCL_READABLE,
* TCL_WRITABLE and TCL_EXCEPTION, for the
* events we are interested in. */
{
@@ -666,14 +663,13 @@ ConsoleWatch(
*----------------------------------------------------------------------
*/
- /* ARGSUSED */
static int
ConsoleHandle(
- ClientData instanceData, /* Device ID for the channel. */
- int direction, /* TCL_READABLE or TCL_WRITABLE to indicate
+ TCL_UNUSED(void *), /* Device ID for the channel. */
+ TCL_UNUSED(int), /* TCL_READABLE or TCL_WRITABLE to indicate
* which direction of the channel is being
* requested. */
- ClientData *handlePtr) /* Where to store handle */
+ TCL_UNUSED(void **)) /* Where to store handle */
{
return TCL_ERROR;
}
@@ -707,7 +703,7 @@ ConsoleObjCmd(
"eval", "hide", "show", "title", NULL};
enum option {CON_EVAL, CON_HIDE, CON_SHOW, CON_TITLE};
Tcl_Obj *cmd = NULL;
- ConsoleInfo *info = clientData;
+ ConsoleInfo *info = (ConsoleInfo *)clientData;
Tcl_Interp *consoleInterp = info->consoleInterp;
if (objc < 2) {
@@ -797,7 +793,7 @@ InterpreterObjCmd(
int index, result = TCL_OK;
static const char *const options[] = {"eval", "record", NULL};
enum option {OTHER_EVAL, OTHER_RECORD};
- ConsoleInfo *info = clientData;
+ ConsoleInfo *info = (ConsoleInfo *)clientData;
Tcl_Interp *otherInterp = info->interp;
if (objc < 2) {
@@ -865,7 +861,7 @@ static void
DeleteConsoleInterp(
ClientData clientData)
{
- Tcl_Interp *interp = clientData;
+ Tcl_Interp *interp = (Tcl_Interp *)clientData;
Tcl_DeleteInterp(interp);
}
@@ -892,13 +888,13 @@ InterpDeleteProc(
ClientData clientData,
Tcl_Interp *interp)
{
- ConsoleInfo *info = clientData;
+ ConsoleInfo *info = (ConsoleInfo *)clientData;
if (info->consoleInterp == interp) {
Tcl_DeleteThreadExitHandler(DeleteConsoleInterp, info->consoleInterp);
info->consoleInterp = NULL;
}
- if (--info->refCount <= 0) {
+ if (info->refCount-- <= 1) {
ckfree(info);
}
}
@@ -924,12 +920,12 @@ static void
ConsoleDeleteProc(
ClientData clientData)
{
- ConsoleInfo *info = clientData;
+ ConsoleInfo *info = (ConsoleInfo *)clientData;
if (info->consoleInterp) {
Tcl_DeleteInterp(info->consoleInterp);
}
- if (--info->refCount <= 0) {
+ if (info->refCount-- <= 1) {
ckfree(info);
}
}
@@ -959,14 +955,14 @@ ConsoleEventProc(
XEvent *eventPtr)
{
if (eventPtr->type == DestroyNotify) {
- ConsoleInfo *info = clientData;
+ ConsoleInfo *info = (ConsoleInfo *)clientData;
Tcl_Interp *consoleInterp = info->consoleInterp;
if (consoleInterp && !Tcl_InterpDeleted(consoleInterp)) {
Tcl_EvalEx(consoleInterp, "tk::ConsoleExit", -1, TCL_EVAL_GLOBAL);
}
- if (--info->refCount <= 0) {
+ if (info->refCount-- <= 1) {
ckfree(info);
}
}