[Python-checkins] r46620 - python/branches/release24-maint/Modules/_tkinter.c

andrew.kuchling python-checkins at python.org
Sat Jun 3 22:34:34 CEST 2006


Author: andrew.kuchling
Date: Sat Jun  3 22:34:33 2006
New Revision: 46620

Modified:
   python/branches/release24-maint/Modules/_tkinter.c
Log:
[Bug #1497414] _self is a reserved word in the WATCOM 10.6 C compiler.
Fix by renaming the variable.

In a different module, Neal fixed it by renaming _self to self.  There's
already a variable named 'self' here, so I used selfptr.


Modified: python/branches/release24-maint/Modules/_tkinter.c
==============================================================================
--- python/branches/release24-maint/Modules/_tkinter.c	(original)
+++ python/branches/release24-maint/Modules/_tkinter.c	Sat Jun  3 22:34:33 2006
@@ -1264,13 +1264,13 @@
       and perform processing there. */
 
 static PyObject *
-Tkapp_Call(PyObject *_self, PyObject *args)
+Tkapp_Call(PyObject *selfptr, PyObject *args)
 {
 	Tcl_Obj *objStore[ARGSZ];
 	Tcl_Obj **objv = NULL;
 	int objc, i;
 	PyObject *res = NULL;
-	TkappObject *self = (TkappObject*)_self;
+	TkappObject *self = (TkappObject*)selfptr;
 	/* Could add TCL_EVAL_GLOBAL if wrapped by GlobalCall... */
 	int flags = TCL_EVAL_DIRECT;
 
@@ -1316,7 +1316,7 @@
 		ENTER_OVERLAP
 
 		if (i == TCL_ERROR)
-			Tkinter_Error(_self);
+			Tkinter_Error(selfptr);
 		else
 			res = Tkapp_CallResult(self);
 
@@ -1532,12 +1532,12 @@
 }
 
 static PyObject*
-var_invoke(EventFunc func, PyObject *_self, PyObject *args, int flags)
+var_invoke(EventFunc func, PyObject *selfptr, PyObject *args, int flags)
 {
-	TkappObject *self = (TkappObject*)_self;
+	TkappObject *self = (TkappObject*)selfptr;
 #ifdef WITH_THREAD
 	if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
-		TkappObject *self = (TkappObject*)_self;
+		TkappObject *self = (TkappObject*)selfptr;
 		VarEvent *ev;
 		PyObject *res, *exc_type, *exc_val;
 		
@@ -1549,7 +1549,7 @@
 
 		ev = (VarEvent*)ckalloc(sizeof(VarEvent));
 
-		ev->self = _self;
+		ev->self = selfptr;
 		ev->args = args;
 		ev->flags = flags;
 		ev->func = func;
@@ -1569,7 +1569,7 @@
 	}
 #endif
         /* Tcl is not threaded, or this is the interpreter thread. */
-	return func(_self, args, flags);
+	return func(selfptr, args, flags);
 }
 
 static PyObject *
@@ -2069,9 +2069,9 @@
 }
 
 static PyObject *
-Tkapp_CreateCommand(PyObject *_self, PyObject *args)
+Tkapp_CreateCommand(PyObject *selfptr, PyObject *args)
 {
-	TkappObject *self = (TkappObject*)_self;
+	TkappObject *self = (TkappObject*)selfptr;
 	PythonCmd_ClientData *data;
 	char *cmdName;
 	PyObject *func;
@@ -2095,7 +2095,7 @@
 		return PyErr_NoMemory();
 	Py_XINCREF(self);
 	Py_XINCREF(func);
-	data->self = _self;
+	data->self = selfptr;
 	data->func = func;
 	
 	if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
@@ -2129,9 +2129,9 @@
 
 
 static PyObject *
-Tkapp_DeleteCommand(PyObject *_self, PyObject *args)
+Tkapp_DeleteCommand(PyObject *selfptr, PyObject *args)
 {
-	TkappObject *self = (TkappObject*)_self;
+	TkappObject *self = (TkappObject*)selfptr;
 	char *cmdName;
 	int err;
 
@@ -2492,10 +2492,10 @@
 /** Event Loop **/
 
 static PyObject *
-Tkapp_MainLoop(PyObject *_self, PyObject *args)
+Tkapp_MainLoop(PyObject *selfptr, PyObject *args)
 {
 	int threshold = 0;
-	TkappObject *self = (TkappObject*)_self;
+	TkappObject *self = (TkappObject*)selfptr;
 #ifdef WITH_THREAD
 	PyThreadState *tstate = PyThreadState_Get();
 #endif


More information about the Python-checkins mailing list