python/dist/src/Mac/Modules/win _Winmodule.c, 1.22, 1.23
Update of /cvsroot/python/python/dist/src/Mac/Modules/win In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25508/win Modified Files: _Winmodule.c Log Message: Updated (and regenerated) for name change in tp_init method arguments: they are now _self, _args and _kwds. Index: _Winmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/win/_Winmodule.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- _Winmodule.c 3 Dec 2003 23:20:13 -0000 1.22 +++ _Winmodule.c 3 Jul 2005 20:59:44 -0000 1.23 @@ -36,7 +36,7 @@ static void PyMac_AutoDisposeWindow(WindowPtr w) { - DisposeWindow(w); + DisposeWindow(w); } static PyObject *Win_Error; @@ -69,6 +69,7 @@ } return (PyObject *)it; } + int WinObj_Convert(PyObject *v, WindowPtr *p_itself) { @@ -2309,13 +2310,13 @@ 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 @@ #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 @@ long ptr; if ( !PyArg_ParseTuple(_args, "i", &ptr) ) - return NULL; + return NULL; _res = WinObj_WhichWindow((WindowPtr)ptr); return _res; @@ -3208,21 +3209,21 @@ 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 @@ - 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);
participants (1)
-
jackjansenï¼ users.sourceforge.net