summaryrefslogtreecommitdiffstats
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-10-01 18:08:06 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-10-01 18:08:06 (GMT)
commit71e25a0e064891f7b89cf4e7e57d9b4caf78af72 (patch)
treef9b76c8651f7063c70be4e53e482dc0559d2c239 /Modules/_tkinter.c
parent0ac885e8216436fb000da97702a9cf4c53b710f2 (diff)
downloadcpython-71e25a0e064891f7b89cf4e7e57d9b4caf78af72.zip
cpython-71e25a0e064891f7b89cf4e7e57d9b4caf78af72.tar.gz
cpython-71e25a0e064891f7b89cf4e7e57d9b4caf78af72.tar.bz2
Eliminate constness warnings with Tcl 8.4.
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 60ce4ee..b16dba1 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -41,6 +41,13 @@ Copyright (C) 1994 Steen Lumholt.
#define MAC_TCL
#endif
+/* Starting with Tcl 8.4, many APIs offer const-correctness. Unfortunately,
+ making _tkinter correct for this API means to break earlier
+ versions. USE_COMPAT_CONST allows to make _tkinter work with both 8.4 and
+ earlier versions. Once Tcl releases before 8.4 don't need to be supported
+ anymore, this should go. */
+#define USE_COMPAT_CONST
+
#ifdef TK_FRAMEWORK
#include <Tcl/tcl.h>
#include <Tk/tk.h>
@@ -607,8 +614,8 @@ Tkapp_Call(PyObject *self, PyObject *args)
else {
/* We could request the object result here, but doing
so would confuse applications that expect a string. */
- char *s = Tcl_GetStringResult(interp);
- char *p = s;
+ const char *s = Tcl_GetStringResult(interp);
+ const char *p = s;
/* If the result contains any bytes with the top bit set,
it's UTF-8 and we should decode it to Unicode */
@@ -783,7 +790,8 @@ Tkapp_AddErrorInfo(PyObject *self, PyObject *args)
static PyObject *
SetVar(PyObject *self, PyObject *args, int flags)
{
- char *name1, *name2, *ok, *s;
+ char *name1, *name2, *s;
+ const char *ok;
PyObject *newValue;
PyObject *tmp;
@@ -843,7 +851,8 @@ Tkapp_GlobalSetVar(PyObject *self, PyObject *args)
static PyObject *
GetVar(PyObject *self, PyObject *args, int flags)
{
- char *name1, *name2=NULL, *s;
+ char *name1, *name2=NULL;
+ const char *s;
PyObject *res = NULL;
if (!PyArg_ParseTuple(args, "s|s:getvar", &name1, &name2))