summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/win
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2005-07-03 20:59:44 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2005-07-03 20:59:44 (GMT)
commit918a9e2f63a037de2a32e2b009944a0e5c693742 (patch)
tree951482c937428033e9ba8ce37bf6678503b3c163 /Mac/Modules/win
parenta6af76cbe4e5b188ccdba0b628f9d75771c623c1 (diff)
downloadcpython-918a9e2f63a037de2a32e2b009944a0e5c693742.zip
cpython-918a9e2f63a037de2a32e2b009944a0e5c693742.tar.gz
cpython-918a9e2f63a037de2a32e2b009944a0e5c693742.tar.bz2
Updated (and regenerated) for name change in tp_init method arguments:
they are now _self, _args and _kwds.
Diffstat (limited to 'Mac/Modules/win')
-rw-r--r--Mac/Modules/win/_Winmodule.c61
1 files changed, 31 insertions, 30 deletions
diff --git a/Mac/Modules/win/_Winmodule.c b/Mac/Modules/win/_Winmodule.c
index 2a13182..fa8c52d 100644
--- a/Mac/Modules/win/_Winmodule.c
+++ b/Mac/Modules/win/_Winmodule.c
@@ -36,7 +36,7 @@ extern int _WinObj_Convert(PyObject *, WindowRef *);
static void
PyMac_AutoDisposeWindow(WindowPtr w)
{
- DisposeWindow(w);
+ DisposeWindow(w);
}
static PyObject *Win_Error;
@@ -69,6 +69,7 @@ PyObject *WinObj_New(WindowPtr itself)
}
return (PyObject *)it;
}
+
int WinObj_Convert(PyObject *v, WindowPtr *p_itself)
{
@@ -2309,13 +2310,13 @@ static PyObject *WinObj_AutoDispose(WindowObject *_self, PyObject *_args)
int onoff, old = 0;
if (!PyArg_ParseTuple(_args, "i", &onoff))
- return NULL;
+ return NULL;
if ( _self->ob_freeit )
- old = 1;
+ old = 1;
if ( onoff )
- _self->ob_freeit = PyMac_AutoDisposeWindow;
+ _self->ob_freeit = PyMac_AutoDisposeWindow;
else
- _self->ob_freeit = NULL;
+ _self->ob_freeit = NULL;
_res = Py_BuildValue("i", old);
return _res;
@@ -2590,16 +2591,16 @@ static int WinObj_hash(WindowObject *self)
#define WinObj_tp_alloc PyType_GenericAlloc
-static PyObject *WinObj_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+static PyObject *WinObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
{
- PyObject *self;
+ PyObject *_self;
WindowPtr itself;
char *kw[] = {"itself", 0};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&", kw, WinObj_Convert, &itself)) return NULL;
- if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
- ((WindowObject *)self)->ob_itself = itself;
- return self;
+ if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, WinObj_Convert, &itself)) return NULL;
+ if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
+ ((WindowObject *)_self)->ob_itself = itself;
+ return _self;
}
#define WinObj_tp_free PyObject_Del
@@ -3121,7 +3122,7 @@ static PyObject *Win_WhichWindow(PyObject *_self, PyObject *_args)
long ptr;
if ( !PyArg_ParseTuple(_args, "i", &ptr) )
- return NULL;
+ return NULL;
_res = WinObj_WhichWindow((WindowPtr)ptr);
return _res;
@@ -3208,21 +3209,21 @@ static PyMethodDef Win_methods[] = {
PyObject *
WinObj_WhichWindow(WindowPtr w)
{
- PyObject *it;
-
- if (w == NULL) {
- it = Py_None;
- Py_INCREF(it);
- } else {
- it = (PyObject *) GetWRefCon(w);
- if (it == NULL || !IsPointerValid((Ptr)it) || ((WindowObject *)it)->ob_itself != w || !WinObj_Check(it)) {
- it = WinObj_New(w);
- ((WindowObject *)it)->ob_freeit = NULL;
- } else {
- Py_INCREF(it);
- }
- }
- return it;
+ PyObject *it;
+
+ if (w == NULL) {
+ it = Py_None;
+ Py_INCREF(it);
+ } else {
+ it = (PyObject *) GetWRefCon(w);
+ if (it == NULL || !IsPointerValid((Ptr)it) || ((WindowObject *)it)->ob_itself != w || !WinObj_Check(it)) {
+ it = WinObj_New(w);
+ ((WindowObject *)it)->ob_freeit = NULL;
+ } else {
+ Py_INCREF(it);
+ }
+ }
+ return it;
}
@@ -3233,9 +3234,9 @@ void init_Win(void)
- PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_New);
- PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_WhichWindow);
- PyMac_INIT_TOOLBOX_OBJECT_CONVERT(WindowPtr, WinObj_Convert);
+ PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_New);
+ PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_WhichWindow);
+ PyMac_INIT_TOOLBOX_OBJECT_CONVERT(WindowPtr, WinObj_Convert);
m = Py_InitModule("_Win", Win_methods);