Mailing List Archive

python/dist/src/Modules _tkinter.c,1.128,1.129
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv29494

Modified Files:
_tkinter.c
Log Message:
Eliminate constness warnings with Tcl 8.4.


Index: _tkinter.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_tkinter.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -C2 -d -r1.128 -r1.129
*** _tkinter.c 1 Oct 2002 17:48:31 -0000 1.128
--- _tkinter.c 1 Oct 2002 18:08:06 -0000 1.129
***************
*** 42,45 ****
--- 42,52 ----
#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>
***************
*** 608,613 ****
/* 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;

/* If the result contains any bytes with the top bit set,
--- 615,620 ----
/* We could request the object result here, but doing
so would confuse applications that expect a string. */
! const char *s = Tcl_GetStringResult(interp);
! const char *p = s;

/* If the result contains any bytes with the top bit set,
***************
*** 784,788 ****
SetVar(PyObject *self, PyObject *args, int flags)
{
! char *name1, *name2, *ok, *s;
PyObject *newValue;
PyObject *tmp;
--- 791,796 ----
SetVar(PyObject *self, PyObject *args, int flags)
{
! char *name1, *name2, *s;
! const char *ok;
PyObject *newValue;
PyObject *tmp;
***************
*** 844,848 ****
GetVar(PyObject *self, PyObject *args, int flags)
{
! char *name1, *name2=NULL, *s;
PyObject *res = NULL;

--- 852,857 ----
GetVar(PyObject *self, PyObject *args, int flags)
{
! char *name1, *name2=NULL;
! const char *s;
PyObject *res = NULL;