[Python-checkins] python/dist/src/Mac/Modules/win _Winmodule.c, 1.10.2.2, 1.10.2.3
jhylton@users.sourceforge.net
jhylton at users.sourceforge.net
Sun Oct 16 07:24:36 CEST 2005
Update of /cvsroot/python/python/dist/src/Mac/Modules/win
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27718/Mac/Modules/win
Modified Files:
Tag: ast-branch
_Winmodule.c
Log Message:
Merge head to branch (for the last time)
Index: _Winmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/win/_Winmodule.c,v
retrieving revision 1.10.2.2
retrieving revision 1.10.2.3
diff -u -d -r1.10.2.2 -r1.10.2.3
--- _Winmodule.c 7 Jan 2005 07:02:05 -0000 1.10.2.2
+++ _Winmodule.c 16 Oct 2005 05:24:03 -0000 1.10.2.3
@@ -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);
More information about the Python-checkins
mailing list