[Python-checkins] python/dist/src/Mac/Modules/list _Listmodule.c, 1.10.2.2, 1.10.2.3

jhylton@users.sourceforge.net jhylton at users.sourceforge.net
Sun Oct 16 07:24:35 CEST 2005


Update of /cvsroot/python/python/dist/src/Mac/Modules/list
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27718/Mac/Modules/list

Modified Files:
      Tag: ast-branch
	_Listmodule.c 
Log Message:
Merge head to branch (for the last time)


Index: _Listmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/list/_Listmodule.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
--- _Listmodule.c	7 Jan 2005 07:01:28 -0000	1.10.2.2
+++ _Listmodule.c	16 Oct 2005 05:24:02 -0000	1.10.2.3
@@ -50,9 +50,9 @@
 {
 	ListObject *it;
 	if (itself == NULL) {
-						PyErr_SetString(List_Error,"Cannot create null List");
-						return NULL;
-					}
+	                                PyErr_SetString(List_Error,"Cannot create null List");
+	                                return NULL;
+	                        }
 	it = PyObject_NEW(ListObject, &List_Type);
 	if (it == NULL) return NULL;
 	it->ob_itself = itself;
@@ -61,6 +61,7 @@
 	SetListRefCon(itself, (long)it);
 	return (PyObject *)it;
 }
+
 int ListObj_Convert(PyObject *v, ListHandle *p_itself)
 {
 	if (!ListObj_Check(v))
@@ -738,16 +739,16 @@
 
 #define ListObj_tp_alloc PyType_GenericAlloc
 
-static PyObject *ListObj_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+static PyObject *ListObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
 {
-	PyObject *self;
+	PyObject *_self;
 	ListHandle itself;
 	char *kw[] = {"itself", 0};
 
-	if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&", kw, ListObj_Convert, &itself)) return NULL;
-	if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
-	((ListObject *)self)->ob_itself = itself;
-	return self;
+	if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, ListObj_Convert, &itself)) return NULL;
+	if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
+	((ListObject *)_self)->ob_itself = itself;
+	return _self;
 }
 
 #define ListObj_tp_free PyObject_Del
@@ -826,10 +827,10 @@
 	                      &hasGrow,
 	                      &scrollHoriz,
 	                      &scrollVert))
-		return NULL;
+	        return NULL;
 
 
-	/* Carbon applications use the CreateCustomList API */ 
+	/* Carbon applications use the CreateCustomList API */
 	theSpec.u.userProc = myListDefFunctionUPP;
 	CreateCustomList(&rView,
 	                 &dataBounds,
@@ -845,7 +846,7 @@
 
 	_res = ListObj_New(outList);
 	if (_res == NULL)
-		return NULL;
+	        return NULL;
 	Py_INCREF(listDefFunc);
 	((ListObject*)_res)->ob_ldef_func = listDefFunc;
 	return _res;
@@ -1024,7 +1025,7 @@
 	Handle h;
 	ListObject *l;
 	if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &h))
-		return NULL;
+	        return NULL;
 	l = (ListObject *)ListObj_New(as_List(h));
 	l->ob_must_be_disposed = 0;
 	_res = Py_BuildValue("O", l);
@@ -1066,34 +1067,34 @@
                        Cell theCell,
                        SInt16 dataOffset,
                        SInt16 dataLen,
-                       ListHandle theList)  
+                       ListHandle theList)
 {
-	PyObject *listDefFunc, *args, *rv=NULL;
-	ListObject *self;
-	
-	self = (ListObject*)GetListRefCon(theList);
-	if (self == NULL || self->ob_itself != theList)
-		return;  /* nothing we can do */
-	listDefFunc = self->ob_ldef_func;
-	if (listDefFunc == NULL)
-		return;  /* nothing we can do */
-	args = Py_BuildValue("hbO&O&hhO", message,
-	                                  selected,
-	                                  PyMac_BuildRect, cellRect,
-	                                  PyMac_BuildPoint, theCell,
-	                                  dataOffset,
-	                                  dataLen,
-	                                  self);
-	if (args != NULL) {
-		rv = PyEval_CallObject(listDefFunc, args);
-		Py_DECREF(args);
-	}
-	if (rv == NULL) {
-		PySys_WriteStderr("error in list definition callback:\n");
-		PyErr_Print();
-	} else {
-		Py_DECREF(rv);
-	}
+        PyObject *listDefFunc, *args, *rv=NULL;
+        ListObject *self;
+
+        self = (ListObject*)GetListRefCon(theList);
+        if (self == NULL || self->ob_itself != theList)
+                return;  /* nothing we can do */
+        listDefFunc = self->ob_ldef_func;
+        if (listDefFunc == NULL)
+                return;  /* nothing we can do */
+        args = Py_BuildValue("hbO&O&hhO", message,
+                                          selected,
+                                          PyMac_BuildRect, cellRect,
+                                          PyMac_BuildPoint, theCell,
+                                          dataOffset,
+                                          dataLen,
+                                          self);
+        if (args != NULL) {
+                rv = PyEval_CallObject(listDefFunc, args);
+                Py_DECREF(args);
+        }
+        if (rv == NULL) {
+                PySys_WriteStderr("error in list definition callback:\n");
+                PyErr_Print();
+        } else {
+                Py_DECREF(rv);
+        }
 }
 
 



More information about the Python-checkins mailing list