Use correct type for ircii_rem_str()

This commit is contained in:
Kevin Easton
2017-10-24 18:48:36 +11:00
parent ff048fbee9
commit 481970b30d
2 changed files with 7 additions and 8 deletions

View File

@@ -1337,7 +1337,6 @@ TclVars tcl_vars[] =
{ NULL, NULL, 0, 0} { NULL, NULL, 0, 0}
}; };
extern char *ircii_rem_str(ClientData *, Tcl_Interp *, char *, char *, int);
void init_public_var(Tcl_Interp *intp) void init_public_var(Tcl_Interp *intp)
{ {
int i; int i;

View File

@@ -1452,15 +1452,15 @@ void toggle_reverse_status(Window *win, char *unused, int value)
} }
#ifdef WANT_TCL #ifdef WANT_TCL
char *ircii_rem_str(ClientData *cd, Tcl_Interp *intp, char *name1, char *name2, int flags) static char *ircii_rem_str(ClientData cd, Tcl_Interp *intp, char *name1, char *name2, int flags)
{ {
char *s; char *s = Tcl_GetVar(intp, name1, TCL_GLOBAL_ONLY);
IrcVariable *n; IrcVariable *n = (IrcVariable *)cd;
n = (IrcVariable *)cd;
if ((s = Tcl_GetVar(intp, name1, TCL_GLOBAL_ONLY))) if (s)
{ {
Tcl_UnlinkVar(intp, name1); Tcl_UnlinkVar(intp, name1);
if (s && *s) if (*s)
malloc_strcpy(&n->string, s); malloc_strcpy(&n->string, s);
else else
new_free(&n->string); new_free(&n->string);
@@ -1499,7 +1499,7 @@ int i = 0;
type_of); type_of);
if (irc_variable[i].type == STR_TYPE_VAR) if (irc_variable[i].type == STR_TYPE_VAR)
Tcl_TraceVar(tcl_interp, varname, TCL_TRACE_WRITES, Tcl_TraceVar(tcl_interp, varname, TCL_TRACE_WRITES,
(Tcl_VarTraceProc *)ircii_rem_str, &ircii_rem_str,
(ClientData)&irc_variable[i]); (ClientData)&irc_variable[i]);
} }
} }